thrownobj, kick[ed]obj (trunk only)
Rename ``kickobj'' to ``kickedobj'' so that the tense matches that of ``thrownobj''. Also, move their declarations to decl.h and their definitions to decl.c since usage has spread from dokick.c/dothrow.c to various files and is about to expand to another one.
This commit is contained in:
+2
-1
@@ -244,7 +244,8 @@ E NEARDATA struct obj *uchain; /* defined only when punished */
|
|||||||
E NEARDATA struct obj *uball;
|
E NEARDATA struct obj *uball;
|
||||||
E NEARDATA struct obj *migrating_objs;
|
E NEARDATA struct obj *migrating_objs;
|
||||||
E NEARDATA struct obj *billobjs;
|
E NEARDATA struct obj *billobjs;
|
||||||
E NEARDATA struct obj *current_wand;
|
E NEARDATA struct obj *current_wand, *thrownobj, *kickedobj;
|
||||||
|
|
||||||
E NEARDATA struct obj zeroobj; /* init'd and defined in decl.c */
|
E NEARDATA struct obj zeroobj; /* init'd and defined in decl.c */
|
||||||
E NEARDATA anything zeroany; /* init'd and defined in decl.c */
|
E NEARDATA anything zeroany; /* init'd and defined in decl.c */
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -162,7 +162,11 @@ NEARDATA struct obj *invent = (struct obj *)0,
|
|||||||
*ublindf = (struct obj *)0,
|
*ublindf = (struct obj *)0,
|
||||||
*uchain = (struct obj *)0,
|
*uchain = (struct obj *)0,
|
||||||
*uball = (struct obj *)0;
|
*uball = (struct obj *)0;
|
||||||
NEARDATA struct obj *current_wand = 0; /* wand currently zapped/applied */
|
/* some objects need special handling during destruction or placement */
|
||||||
|
NEARDATA struct obj
|
||||||
|
*current_wand = 0, /* wand currently zapped/applied */
|
||||||
|
*thrownobj = 0, /* object in flight due to throwing */
|
||||||
|
*kickedobj = 0; /* object in flight due to kicking */
|
||||||
|
|
||||||
#ifdef TEXTCOLOR
|
#ifdef TEXTCOLOR
|
||||||
/*
|
/*
|
||||||
|
|||||||
+66
-67
@@ -1,5 +1,4 @@
|
|||||||
/* NetHack 3.5 dokick.c $Date$ $Revision$ */
|
/* NetHack 3.5 dokick.c $Date$ $Revision$ */
|
||||||
/* SCCS Id: @(#)dokick.c 3.5 2008/09/04 */
|
|
||||||
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
|
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -12,7 +11,7 @@
|
|||||||
static NEARDATA struct rm *maploc, nowhere;
|
static NEARDATA struct rm *maploc, nowhere;
|
||||||
static NEARDATA const char *gate_str;
|
static NEARDATA const char *gate_str;
|
||||||
|
|
||||||
struct obj *kickobj; /* also used by obfree(shk.c) */
|
/* kickedobj (decl.c) tracks a kicked object until placed or destroyed */
|
||||||
|
|
||||||
extern boolean notonhead; /* for long worms */
|
extern boolean notonhead; /* for long worms */
|
||||||
|
|
||||||
@@ -418,11 +417,11 @@ xchar x, y;
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
||||||
/* if a pile, the "top" object gets kicked */
|
/* if a pile, the "top" object gets kicked */
|
||||||
kickobj = level.objects[x][y];
|
kickedobj = level.objects[x][y];
|
||||||
if (kickobj) {
|
if (kickedobj) {
|
||||||
/* kick the object; if doing is fatal, done() will clean up kickobj */
|
/* kick object; if doing is fatal, done() will clean up kickedobj */
|
||||||
res = really_kick_object(x, y);
|
res = really_kick_object(x, y);
|
||||||
kickobj = (struct obj *)0;
|
kickedobj = (struct obj *)0;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -438,10 +437,10 @@ xchar x, y;
|
|||||||
char bhitroom;
|
char bhitroom;
|
||||||
boolean costly, isgold, slide = FALSE;
|
boolean costly, isgold, slide = FALSE;
|
||||||
|
|
||||||
/* kickobj should always be set due to conditions of call */
|
/* kickedobj should always be set due to conditions of call */
|
||||||
if(!kickobj || kickobj->otyp == BOULDER
|
if (!kickedobj || kickedobj->otyp == BOULDER ||
|
||||||
|| kickobj == uball || kickobj == uchain)
|
kickedobj == uball || kickedobj == uchain)
|
||||||
return(0);
|
return 0;
|
||||||
|
|
||||||
if ((trap = t_at(x,y)) != 0 &&
|
if ((trap = t_at(x,y)) != 0 &&
|
||||||
(((trap->ttyp == PIT ||
|
(((trap->ttyp == PIT ||
|
||||||
@@ -459,25 +458,25 @@ xchar x, y;
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!uarmf && kickobj->otyp == CORPSE &&
|
if (!uarmf && kickedobj->otyp == CORPSE &&
|
||||||
touch_petrifies(&mons[kickobj->corpsenm]) &&
|
touch_petrifies(&mons[kickedobj->corpsenm]) &&
|
||||||
!Stone_resistance) {
|
!Stone_resistance) {
|
||||||
You("kick %s with your bare %s.",
|
You("kick %s with your bare %s.",
|
||||||
corpse_xname(kickobj, (const char *)0, CXN_PFX_THE),
|
corpse_xname(kickedobj, (const char *)0, CXN_PFX_THE),
|
||||||
makeplural(body_part(FOOT)));
|
makeplural(body_part(FOOT)));
|
||||||
if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM)) {
|
if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM)) {
|
||||||
; /* hero has been transformed but kick continues */
|
; /* hero has been transformed but kick continues */
|
||||||
} else {
|
} else {
|
||||||
/* normalize body shape here; foot, not body_part(FOOT) */
|
/* normalize body shape here; foot, not body_part(FOOT) */
|
||||||
Sprintf(killer.name, "kicking %s barefoot",
|
Sprintf(killer.name, "kicking %s barefoot",
|
||||||
killer_xname(kickobj));
|
killer_xname(kickedobj));
|
||||||
instapetrify(killer.name);
|
instapetrify(killer.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* range < 2 means the object will not move. */
|
/* range < 2 means the object will not move. */
|
||||||
/* maybe dexterity should also figure here. */
|
/* maybe dexterity should also figure here. */
|
||||||
range = (int)((ACURRSTR)/2 - kickobj->owt/40);
|
range = (int)((ACURRSTR) / 2 - kickedobj->owt / 40);
|
||||||
|
|
||||||
if(martial()) range += rnd(3);
|
if(martial()) range += rnd(3);
|
||||||
|
|
||||||
@@ -489,20 +488,20 @@ xchar x, y;
|
|||||||
range += rnd(3);
|
range += rnd(3);
|
||||||
} else {
|
} else {
|
||||||
if (is_ice(x, y)) range += rnd(3), slide = TRUE;
|
if (is_ice(x, y)) range += rnd(3), slide = TRUE;
|
||||||
if (kickobj->greased) range += rnd(3), slide = TRUE;
|
if (kickedobj->greased) range += rnd(3), slide = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mjollnir is magically too heavy to kick */
|
/* Mjollnir is magically too heavy to kick */
|
||||||
if(kickobj->oartifact == ART_MJOLLNIR) range = 1;
|
if (kickedobj->oartifact == ART_MJOLLNIR) range = 1;
|
||||||
|
|
||||||
/* see if the object has a place to move into */
|
/* see if the object has a place to move into */
|
||||||
if(!ZAP_POS(levl[x+u.dx][y+u.dy].typ) || closed_door(x+u.dx, y+u.dy))
|
if(!ZAP_POS(levl[x+u.dx][y+u.dy].typ) || closed_door(x+u.dx, y+u.dy))
|
||||||
range = 1;
|
range = 1;
|
||||||
|
|
||||||
costly = (!(kickobj->no_charge && !Has_contents(kickobj)) &&
|
costly = (!(kickedobj->no_charge && !Has_contents(kickedobj)) &&
|
||||||
(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0 &&
|
(shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0 &&
|
||||||
costly_spot(x, y));
|
costly_spot(x, y));
|
||||||
isgold = (kickobj->oclass == COIN_CLASS);
|
isgold = (kickedobj->oclass == COIN_CLASS);
|
||||||
|
|
||||||
if (IS_ROCK(levl[x][y].typ) || closed_door(x, y)) {
|
if (IS_ROCK(levl[x][y].typ) || closed_door(x, y)) {
|
||||||
if ((!martial() && rn2(20) > ACURR(A_DEX)) ||
|
if ((!martial() && rn2(20) > ACURR(A_DEX)) ||
|
||||||
@@ -511,49 +510,47 @@ xchar x, y;
|
|||||||
pline("It doesn't come loose.");
|
pline("It doesn't come loose.");
|
||||||
else
|
else
|
||||||
pline("%s %sn't come loose.",
|
pline("%s %sn't come loose.",
|
||||||
The(distant_name(kickobj, xname)),
|
The(distant_name(kickedobj, xname)),
|
||||||
otense(kickobj, "do"));
|
otense(kickedobj, "do"));
|
||||||
return (!rn2(3) || martial());
|
return (!rn2(3) || martial());
|
||||||
}
|
}
|
||||||
if (Blind)
|
if (Blind)
|
||||||
pline("It comes loose.");
|
pline("It comes loose.");
|
||||||
else
|
else
|
||||||
pline("%s %s loose.",
|
pline("%s %s loose.",
|
||||||
The(distant_name(kickobj, xname)),
|
The(distant_name(kickedobj, xname)),
|
||||||
otense(kickobj, "come"));
|
otense(kickedobj, "come"));
|
||||||
obj_extract_self(kickobj);
|
obj_extract_self(kickedobj);
|
||||||
newsym(x, y);
|
newsym(x, y);
|
||||||
if (costly && (!costly_spot(u.ux, u.uy) ||
|
if (costly && (!costly_spot(u.ux, u.uy) ||
|
||||||
!index(u.urooms, *in_rooms(x, y, SHOPBASE))))
|
!index(u.urooms, *in_rooms(x, y, SHOPBASE))))
|
||||||
addtobill(kickobj, FALSE, FALSE, FALSE);
|
addtobill(kickedobj, FALSE, FALSE, FALSE);
|
||||||
if (!flooreffects(kickobj, u.ux, u.uy, "fall")) {
|
if (!flooreffects(kickedobj, u.ux, u.uy, "fall")) {
|
||||||
place_object(kickobj, u.ux, u.uy);
|
place_object(kickedobj, u.ux, u.uy);
|
||||||
stackobj(kickobj);
|
stackobj(kickedobj);
|
||||||
newsym(u.ux, u.uy);
|
newsym(u.ux, u.uy);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* a box gets a chance of breaking open here */
|
/* a box gets a chance of breaking open here */
|
||||||
if(Is_box(kickobj)) {
|
if (Is_box(kickedobj)) {
|
||||||
boolean otrp = kickobj->otrapped;
|
boolean otrp = kickedobj->otrapped;
|
||||||
|
|
||||||
if(range < 2) pline("THUD!");
|
if (range < 2) pline("THUD!");
|
||||||
|
container_impact_dmg(kickedobj);
|
||||||
container_impact_dmg(kickobj);
|
if (kickedobj->olocked) {
|
||||||
|
|
||||||
if (kickobj->olocked) {
|
|
||||||
if (!rn2(5) || (martial() && !rn2(2))) {
|
if (!rn2(5) || (martial() && !rn2(2))) {
|
||||||
You("break open the lock!");
|
You("break open the lock!");
|
||||||
breakchestlock(kickobj, FALSE);
|
breakchestlock(kickedobj, FALSE);
|
||||||
if (otrp) (void) chest_trap(kickobj, LEG, FALSE);
|
if (otrp) (void) chest_trap(kickedobj, LEG, FALSE);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!rn2(3) || (martial() && !rn2(2))) {
|
if (!rn2(3) || (martial() && !rn2(2))) {
|
||||||
pline_The("lid slams open, then falls shut.");
|
pline_The("lid slams open, then falls shut.");
|
||||||
kickobj->lknown = 1;
|
kickedobj->lknown = 1;
|
||||||
if (otrp) (void) chest_trap(kickobj, LEG, FALSE);
|
if (otrp) (void) chest_trap(kickedobj, LEG, FALSE);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -562,20 +559,21 @@ xchar x, y;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* fragile objects should not be kicked */
|
/* fragile objects should not be kicked */
|
||||||
if (hero_breaks(kickobj, kickobj->ox, kickobj->oy, FALSE)) return 1;
|
if (hero_breaks(kickedobj, kickedobj->ox, kickedobj->oy, FALSE))
|
||||||
|
return 1;
|
||||||
|
|
||||||
/* too heavy to move. range is calculated as potential distance from
|
/* too heavy to move. range is calculated as potential distance from
|
||||||
* player, so range == 2 means the object may move up to one square
|
* player, so range == 2 means the object may move up to one square
|
||||||
* from its current position
|
* from its current position
|
||||||
*/
|
*/
|
||||||
if(range < 2) {
|
if (range < 2) {
|
||||||
if(!Is_box(kickobj)) pline("Thump!");
|
if (!Is_box(kickedobj)) pline("Thump!");
|
||||||
return(!rn2(3) || martial());
|
return (!rn2(3) || martial());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kickobj->quan > 1L) {
|
if (kickedobj->quan > 1L) {
|
||||||
if (!isgold) {
|
if (!isgold) {
|
||||||
kickobj = splitobj(kickobj, 1L);
|
kickedobj = splitobj(kickedobj, 1L);
|
||||||
} else {
|
} else {
|
||||||
if (rn2(20)) {
|
if (rn2(20)) {
|
||||||
static NEARDATA const char * const flyingcoinmsg[] = {
|
static NEARDATA const char * const flyingcoinmsg[] = {
|
||||||
@@ -587,11 +585,11 @@ xchar x, y;
|
|||||||
pline("Thwwpingg!");
|
pline("Thwwpingg!");
|
||||||
You("%s!", flyingcoinmsg[rn2(SIZE(flyingcoinmsg))]);
|
You("%s!", flyingcoinmsg[rn2(SIZE(flyingcoinmsg))]);
|
||||||
(void)scatter(x, y, rn2(3)+1,
|
(void)scatter(x, y, rn2(3)+1,
|
||||||
VIS_EFFECTS|MAY_HIT, kickobj);
|
VIS_EFFECTS|MAY_HIT, kickedobj);
|
||||||
newsym(x, y);
|
newsym(x, y);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (kickobj->quan > 300L) {
|
if (kickedobj->quan > 300L) {
|
||||||
pline("Thump!");
|
pline("Thump!");
|
||||||
return(!rn2(3) || martial());
|
return(!rn2(3) || martial());
|
||||||
}
|
}
|
||||||
@@ -599,47 +597,48 @@ xchar x, y;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (slide && !Blind)
|
if (slide && !Blind)
|
||||||
pline("Whee! %s %s across the %s.", Doname2(kickobj),
|
pline("Whee! %s %s across the %s.", Doname2(kickedobj),
|
||||||
otense(kickobj, "slide"), surface(x,y));
|
otense(kickedobj, "slide"), surface(x,y));
|
||||||
|
|
||||||
if (costly && !isgold) addtobill(kickobj, FALSE, FALSE, TRUE);
|
if (costly && !isgold) addtobill(kickedobj, FALSE, FALSE, TRUE);
|
||||||
obj_extract_self(kickobj);
|
obj_extract_self(kickedobj);
|
||||||
(void) snuff_candle(kickobj);
|
(void) snuff_candle(kickedobj);
|
||||||
newsym(x, y);
|
newsym(x, y);
|
||||||
mon = bhit(u.dx, u.dy, range, KICKED_WEAPON,
|
mon = bhit(u.dx, u.dy, range, KICKED_WEAPON,
|
||||||
(int FDECL((*),(MONST_P,OBJ_P)))0,
|
(int FDECL((*),(MONST_P,OBJ_P)))0,
|
||||||
(int FDECL((*),(OBJ_P,OBJ_P)))0,
|
(int FDECL((*),(OBJ_P,OBJ_P)))0,
|
||||||
&kickobj);
|
&kickedobj);
|
||||||
if (!kickobj) return 1; /* object broken */
|
if (!kickedobj) return 1; /* object broken */
|
||||||
|
|
||||||
if(mon) {
|
if (mon) {
|
||||||
if (mon->isshk &&
|
if (mon->isshk &&
|
||||||
kickobj->where == OBJ_MINVENT && kickobj->ocarry == mon)
|
kickedobj->where == OBJ_MINVENT &&
|
||||||
|
kickedobj->ocarry == mon)
|
||||||
return 1; /* alert shk caught it */
|
return 1; /* alert shk caught it */
|
||||||
notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y);
|
notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y);
|
||||||
if (isgold ? ghitm(mon, kickobj) : /* caught? */
|
if (isgold ? ghitm(mon, kickedobj) : /* caught? */
|
||||||
thitmonst(mon, kickobj)) /* hit && used up? */
|
thitmonst(mon, kickedobj)) /* hit && used up? */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the object might have fallen down a hole;
|
/* the object might have fallen down a hole;
|
||||||
ship_object() will have taken care of shop billing */
|
ship_object() will have taken care of shop billing */
|
||||||
if (kickobj->where == OBJ_MIGRATING) return 1;
|
if (kickedobj->where == OBJ_MIGRATING) return 1;
|
||||||
|
|
||||||
bhitroom = *in_rooms(bhitpos.x, bhitpos.y, SHOPBASE);
|
bhitroom = *in_rooms(bhitpos.x, bhitpos.y, SHOPBASE);
|
||||||
if (costly && (!costly_spot(bhitpos.x, bhitpos.y) ||
|
if (costly && (!costly_spot(bhitpos.x, bhitpos.y) ||
|
||||||
*in_rooms(x, y, SHOPBASE) != bhitroom)) {
|
*in_rooms(x, y, SHOPBASE) != bhitroom)) {
|
||||||
if(isgold)
|
if(isgold)
|
||||||
costly_gold(x, y, kickobj->quan);
|
costly_gold(x, y, kickedobj->quan);
|
||||||
else (void)stolen_value(kickobj, x, y,
|
else (void)stolen_value(kickedobj, x, y,
|
||||||
(boolean)shkp->mpeaceful, FALSE);
|
(boolean)shkp->mpeaceful, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flooreffects(kickobj,bhitpos.x,bhitpos.y,"fall")) return(1);
|
if (flooreffects(kickedobj, bhitpos.x, bhitpos.y, "fall")) return 1;
|
||||||
if (kickobj->unpaid) subfrombill(kickobj, shkp);
|
if (kickedobj->unpaid) subfrombill(kickedobj, shkp);
|
||||||
place_object(kickobj, bhitpos.x, bhitpos.y);
|
place_object(kickedobj, bhitpos.x, bhitpos.y);
|
||||||
stackobj(kickobj);
|
stackobj(kickedobj);
|
||||||
newsym(kickobj->ox, kickobj->oy);
|
newsym(kickedobj->ox, kickedobj->oy);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,7 +649,7 @@ char *buf;
|
|||||||
{
|
{
|
||||||
const char *what;
|
const char *what;
|
||||||
|
|
||||||
if (kickobj) what = killer_xname(kickobj);
|
if (kickedobj) what = killer_xname(kickedobj);
|
||||||
else if (maploc == &nowhere) what = "nothing";
|
else if (maploc == &nowhere) what = "nothing";
|
||||||
else if (IS_DOOR(maploc->typ)) what = "a door";
|
else if (IS_DOOR(maploc->typ)) what = "a door";
|
||||||
else if (IS_TREE(maploc->typ)) what = "a tree";
|
else if (IS_TREE(maploc->typ)) what = "a tree";
|
||||||
|
|||||||
+3
-4
@@ -26,9 +26,8 @@ static NEARDATA const char toss_objs[] =
|
|||||||
static NEARDATA const char bullets[] =
|
static NEARDATA const char bullets[] =
|
||||||
{ ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, GEM_CLASS, 0 };
|
{ ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, GEM_CLASS, 0 };
|
||||||
|
|
||||||
struct obj *thrownobj = 0; /* tracks an object until it lands */
|
/* thrownobj (decl.c) tracks an object until it lands */
|
||||||
|
|
||||||
extern struct obj *kickobj; /* from dokick.c */
|
|
||||||
extern boolean notonhead; /* for long worms */
|
extern boolean notonhead; /* for long worms */
|
||||||
|
|
||||||
|
|
||||||
@@ -1265,7 +1264,7 @@ boolean maybe_wakeup;
|
|||||||
int
|
int
|
||||||
thitmonst(mon, obj)
|
thitmonst(mon, obj)
|
||||||
register struct monst *mon;
|
register struct monst *mon;
|
||||||
register struct obj *obj; /* thrownobj or kickobj or uwep */
|
register struct obj *obj; /* thrownobj or kickedobj or uwep */
|
||||||
{
|
{
|
||||||
register int tmp; /* Base chance to hit */
|
register int tmp; /* Base chance to hit */
|
||||||
register int disttmp; /* distance modifier */
|
register int disttmp; /* distance modifier */
|
||||||
@@ -1273,7 +1272,7 @@ register struct obj *obj; /* thrownobj or kickobj or uwep */
|
|||||||
boolean guaranteed_hit = (u.uswallow && mon == u.ustuck);
|
boolean guaranteed_hit = (u.uswallow && mon == u.ustuck);
|
||||||
|
|
||||||
hmode = (obj == uwep) ? HMON_APPLIED :
|
hmode = (obj == uwep) ? HMON_APPLIED :
|
||||||
(obj == kickobj) ? HMON_KICKED : HMON_THROWN;
|
(obj == kickedobj) ? HMON_KICKED : HMON_THROWN;
|
||||||
|
|
||||||
/* Differences from melee weapons:
|
/* Differences from melee weapons:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
#define FIRST_AMULET AMULET_OF_ESP
|
#define FIRST_AMULET AMULET_OF_ESP
|
||||||
#define LAST_AMULET AMULET_OF_YENDOR
|
#define LAST_AMULET AMULET_OF_YENDOR
|
||||||
|
|
||||||
extern struct obj *thrownobj; /* dothrow.c */
|
|
||||||
extern struct obj *kickobj; /* dokick.c */
|
|
||||||
|
|
||||||
struct valuable_data { long count; int typ; };
|
struct valuable_data { long count; int typ; };
|
||||||
|
|
||||||
static struct valuable_data
|
static struct valuable_data
|
||||||
@@ -893,7 +890,7 @@ die:
|
|||||||
/* maybe not on object lists; if an active light source, would cause
|
/* maybe not on object lists; if an active light source, would cause
|
||||||
big trouble (`obj_is_local' panic) for savebones() -> savelev() */
|
big trouble (`obj_is_local' panic) for savebones() -> savelev() */
|
||||||
if (thrownobj && thrownobj->where == OBJ_FREE) dealloc_obj(thrownobj);
|
if (thrownobj && thrownobj->where == OBJ_FREE) dealloc_obj(thrownobj);
|
||||||
if (kickobj && kickobj->where == OBJ_FREE) dealloc_obj(kickobj);
|
if (kickedobj && kickedobj->where == OBJ_FREE) dealloc_obj(kickedobj);
|
||||||
|
|
||||||
/* Sometimes you die on the first move. Life's not fair.
|
/* Sometimes you die on the first move. Life's not fair.
|
||||||
* On those rare occasions you get hosed immediately, go out
|
* On those rare occasions you get hosed immediately, go out
|
||||||
|
|||||||
+3
-7
@@ -1,5 +1,4 @@
|
|||||||
/* NetHack 3.5 mkobj.c $Date$ $Revision$ */
|
/* NetHack 3.5 mkobj.c $Date$ $Revision$ */
|
||||||
/* SCCS Id: @(#)mkobj.c 3.5 2009/01/20 */
|
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -19,9 +18,6 @@ STATIC_DCL void FDECL(insane_object,
|
|||||||
STATIC_DCL void FDECL(check_contained, (struct obj *,const char *));
|
STATIC_DCL void FDECL(check_contained, (struct obj *,const char *));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern struct obj *thrownobj; /* defined in dothrow.c */
|
|
||||||
extern struct obj *kickobj; /* dokick.c */
|
|
||||||
|
|
||||||
/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */
|
/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */
|
||||||
|
|
||||||
struct icp {
|
struct icp {
|
||||||
@@ -1871,7 +1867,7 @@ dealloc_obj(obj)
|
|||||||
del_light_source(LS_OBJECT, obj_to_any(obj));
|
del_light_source(LS_OBJECT, obj_to_any(obj));
|
||||||
|
|
||||||
if (obj == thrownobj) thrownobj = 0;
|
if (obj == thrownobj) thrownobj = 0;
|
||||||
if (obj == kickobj) kickobj = 0;
|
if (obj == kickedobj) kickedobj = 0;
|
||||||
|
|
||||||
if (obj->oextra) dealloc_oextra(obj->oextra);
|
if (obj->oextra) dealloc_oextra(obj->oextra);
|
||||||
free((genericptr_t) obj);
|
free((genericptr_t) obj);
|
||||||
@@ -2003,8 +1999,8 @@ obj_sanity_check()
|
|||||||
they should have arrived somewhere by the time we get called */
|
they should have arrived somewhere by the time we get called */
|
||||||
if (thrownobj)
|
if (thrownobj)
|
||||||
insane_object(thrownobj, ofmt3, "thrownobj sanity", (struct monst *)0);
|
insane_object(thrownobj, ofmt3, "thrownobj sanity", (struct monst *)0);
|
||||||
if (kickobj)
|
if (kickedobj)
|
||||||
insane_object(kickobj, ofmt3, "kickobj sanity", (struct monst *)0);
|
insane_object(kickedobj, ofmt3, "kickedobj sanity", (struct monst *)0);
|
||||||
/* [how about current_wand too?] */
|
/* [how about current_wand too?] */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* NetHack 3.5 mon.c $Date$ $Revision$ */
|
/* NetHack 3.5 mon.c $Date$ $Revision$ */
|
||||||
/* SCCS Id: @(#)mon.c 3.5 2009/01/24 */
|
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -12,8 +11,6 @@
|
|||||||
#include "mfndpos.h"
|
#include "mfndpos.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
extern struct obj *thrownobj; /* dothrow.c */
|
|
||||||
|
|
||||||
STATIC_DCL boolean FDECL(restrap,(struct monst *));
|
STATIC_DCL boolean FDECL(restrap,(struct monst *));
|
||||||
STATIC_DCL long FDECL(mm_aggression, (struct monst *,struct monst *));
|
STATIC_DCL long FDECL(mm_aggression, (struct monst *,struct monst *));
|
||||||
#ifdef BARGETHROUGH
|
#ifdef BARGETHROUGH
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* NetHack 3.5 shk.c $Date$ $Revision$ */
|
/* NetHack 3.5 shk.c $Date$ $Revision$ */
|
||||||
/* SCCS Id: @(#)shk.c 3.5 2007/03/01 */
|
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -27,8 +26,6 @@ STATIC_DCL void FDECL(kops_gone, (BOOLEAN_P));
|
|||||||
(shkp)->data->msound <= MS_ANIMAL)
|
(shkp)->data->msound <= MS_ANIMAL)
|
||||||
|
|
||||||
extern const struct shclass shtypes[]; /* defined in shknam.c */
|
extern const struct shclass shtypes[]; /* defined in shknam.c */
|
||||||
extern struct obj *thrownobj; /* defined in dothrow.c */
|
|
||||||
extern struct obj *kickobj; /* dokick.c */
|
|
||||||
|
|
||||||
STATIC_VAR NEARDATA long int followmsg; /* last time of follow message */
|
STATIC_VAR NEARDATA long int followmsg; /* last time of follow message */
|
||||||
STATIC_VAR const char and_its_contents[] = " and its contents";
|
STATIC_VAR const char and_its_contents[] = " and its contents";
|
||||||
@@ -281,7 +278,7 @@ register struct monst *shkp;
|
|||||||
clear_unpaid(fobj);
|
clear_unpaid(fobj);
|
||||||
clear_unpaid(level.buriedobjlist);
|
clear_unpaid(level.buriedobjlist);
|
||||||
if (thrownobj) thrownobj->unpaid = 0;
|
if (thrownobj) thrownobj->unpaid = 0;
|
||||||
if (kickobj) kickobj->unpaid = 0;
|
if (kickedobj) kickedobj->unpaid = 0;
|
||||||
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
|
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
|
||||||
clear_unpaid(mtmp->minvent);
|
clear_unpaid(mtmp->minvent);
|
||||||
for(mtmp = migrating_mons; mtmp; mtmp = mtmp->nmon)
|
for(mtmp = migrating_mons; mtmp; mtmp = mtmp->nmon)
|
||||||
|
|||||||
Reference in New Issue
Block a user