uhandedness follow-up
boomerang trajectory bones
This commit is contained in:
@@ -174,6 +174,7 @@ extern boolean can_make_bones(void);
|
|||||||
extern void savebones(int, time_t, struct obj *);
|
extern void savebones(int, time_t, struct obj *);
|
||||||
extern int getbones(void);
|
extern int getbones(void);
|
||||||
extern boolean bones_include_name(const char *);
|
extern boolean bones_include_name(const char *);
|
||||||
|
extern void fix_ghostly_obj(struct obj *);
|
||||||
|
|
||||||
/* ### botl.c ### */
|
/* ### botl.c ### */
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -137,15 +137,16 @@ struct obj {
|
|||||||
* and for horn of plenty (when tipping) even though
|
* and for horn of plenty (when tipping) even though
|
||||||
* they have no locks */
|
* they have no locks */
|
||||||
Bitfield(pickup_prev, 1); /* was picked up previously */
|
Bitfield(pickup_prev, 1); /* was picked up previously */
|
||||||
|
Bitfield(ghostly, 1); /* it just got placed into a bones file */
|
||||||
#if 0
|
#if 0
|
||||||
/* not implemented */
|
/* not implemented */
|
||||||
Bitfield(tknown, 1); /* trap status known for chests */
|
Bitfield(tknown, 1); /* trap status known for chests */
|
||||||
Bitfield(eknown, 1); /* effect known for wands zapped or rings worn when
|
Bitfield(eknown, 1); /* effect known for wands zapped or rings worn when
|
||||||
* not seen yet after being picked up while blind
|
* not seen yet after being picked up while blind
|
||||||
* [maybe for remaining stack of used potion too] */
|
* [maybe for remaining stack of used potion too] */
|
||||||
/* 1 free bit */
|
/* 0 free bits */
|
||||||
#else
|
#else
|
||||||
/* 3 free bits */
|
/* 2 free bits */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int corpsenm; /* type of corpse is mons[corpsenm] */
|
int corpsenm; /* type of corpse is mons[corpsenm] */
|
||||||
|
|||||||
+40
@@ -11,6 +11,7 @@ static void resetobjs(struct obj *, boolean);
|
|||||||
static void give_to_nearby_mon(struct obj *, coordxy, coordxy);
|
static void give_to_nearby_mon(struct obj *, coordxy, coordxy);
|
||||||
static boolean fixuporacle(struct monst *);
|
static boolean fixuporacle(struct monst *);
|
||||||
static void remove_mon_from_bones(struct monst *);
|
static void remove_mon_from_bones(struct monst *);
|
||||||
|
static void set_ghostly_objlist(struct obj *objchain);
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
no_bones_level(d_level *lev)
|
no_bones_level(d_level *lev)
|
||||||
@@ -448,6 +449,7 @@ savebones(int how, time_t when, struct obj *corpse)
|
|||||||
for (f = gf.ffruit; f; f = f->nextf)
|
for (f = gf.ffruit; f; f = f->nextf)
|
||||||
f->fid = -f->fid;
|
f->fid = -f->fid;
|
||||||
|
|
||||||
|
set_ghostly_objlist(gi.invent);
|
||||||
/* dispose of your possessions, usually cursed */
|
/* dispose of your possessions, usually cursed */
|
||||||
if (u.ugrave_arise == (NON_PM - 1)) {
|
if (u.ugrave_arise == (NON_PM - 1)) {
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
@@ -503,6 +505,7 @@ savebones(int how, time_t when, struct obj *corpse)
|
|||||||
mtmp->msleeping = 1;
|
mtmp->msleeping = 1;
|
||||||
}
|
}
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||||
|
set_ghostly_objlist(mtmp->minvent);
|
||||||
resetobjs(mtmp->minvent, FALSE);
|
resetobjs(mtmp->minvent, FALSE);
|
||||||
/* do not zero out m_ids for bones levels any more */
|
/* do not zero out m_ids for bones levels any more */
|
||||||
mtmp->mlstmv = 0L;
|
mtmp->mlstmv = 0L;
|
||||||
@@ -515,7 +518,9 @@ savebones(int how, time_t when, struct obj *corpse)
|
|||||||
ttmp->madeby_u = 0;
|
ttmp->madeby_u = 0;
|
||||||
ttmp->tseen = unhideable_trap(ttmp->ttyp);
|
ttmp->tseen = unhideable_trap(ttmp->ttyp);
|
||||||
}
|
}
|
||||||
|
set_ghostly_objlist(fobj);
|
||||||
resetobjs(fobj, FALSE);
|
resetobjs(fobj, FALSE);
|
||||||
|
set_ghostly_objlist(gl.level.buriedobjlist);
|
||||||
resetobjs(gl.level.buriedobjlist, FALSE);
|
resetobjs(gl.level.buriedobjlist, FALSE);
|
||||||
|
|
||||||
/* Hero is no longer on the map. */
|
/* Hero is no longer on the map. */
|
||||||
@@ -722,4 +727,39 @@ bones_include_name(const char *name)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* set the ghostly bit in a list of objects */
|
||||||
|
static void
|
||||||
|
set_ghostly_objlist(struct obj *objchain)
|
||||||
|
{
|
||||||
|
while (objchain) {
|
||||||
|
objchain->ghostly = 1;
|
||||||
|
objchain = objchain->nobj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is called when a marked object from a bones file is picked-up.
|
||||||
|
Some could result in a message, and the obj->ghostly flag is always
|
||||||
|
cleared. obj->ghostly has no other usage at this time. */
|
||||||
|
void
|
||||||
|
fix_ghostly_obj(struct obj *obj)
|
||||||
|
{
|
||||||
|
if (!obj->ghostly)
|
||||||
|
return;
|
||||||
|
switch(obj->otyp) {
|
||||||
|
/* asymetrical weapons */
|
||||||
|
case BOW:
|
||||||
|
case ELVEN_BOW:
|
||||||
|
case ORCISH_BOW:
|
||||||
|
case YUMI:
|
||||||
|
case BOOMERANG:
|
||||||
|
You("make adjustments to %s to suit your %s hand.",
|
||||||
|
the(xname(obj)),
|
||||||
|
URIGHTY ? "right" : "left");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
obj->ghostly = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*bones.c*/
|
/*bones.c*/
|
||||||
|
|||||||
@@ -1790,6 +1790,8 @@ pickup_object(
|
|||||||
if (uwep && uwep == obj)
|
if (uwep && uwep == obj)
|
||||||
gm.mrg_to_wielded = TRUE;
|
gm.mrg_to_wielded = TRUE;
|
||||||
pickup_prinv(obj, count, "lifting");
|
pickup_prinv(obj, count, "lifting");
|
||||||
|
if (obj->ghostly)
|
||||||
|
fix_ghostly_obj(obj);
|
||||||
gm.mrg_to_wielded = FALSE;
|
gm.mrg_to_wielded = FALSE;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4011,7 +4011,8 @@ boomhit(struct obj *obj, coordxy dx, coordxy dy)
|
|||||||
register int i, ct;
|
register int i, ct;
|
||||||
int boom; /* showsym[] index */
|
int boom; /* showsym[] index */
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
boolean counterclockwise = TRUE; /* right-handed throw */
|
boolean counterclockwise = URIGHTY; /* URIGHTY = right-handed throw
|
||||||
|
else ULEFTY = left-handed throw */
|
||||||
|
|
||||||
/* counterclockwise traversal patterns:
|
/* counterclockwise traversal patterns:
|
||||||
* ..........................54.................................
|
* ..........................54.................................
|
||||||
|
|||||||
Reference in New Issue
Block a user