Uncursing objects now causes them to become unequipped.
This commit is contained in:
parent
dc48475d8b
commit
9330c00ab3
21
lf.c
21
lf.c
|
@ -12383,6 +12383,8 @@ void giveobflags(lifeform_t *lf, object_t *o, enum FLAG whattype) {
|
||||||
newval[1] = f->val[2];
|
newval[1] = f->val[2];
|
||||||
|
|
||||||
// cursed objects might confer different flags...
|
// cursed objects might confer different flags...
|
||||||
|
// TODO: if you uncurse the object, you don't lose the penalty until
|
||||||
|
// you take it off.
|
||||||
if (iscursed(o)) {
|
if (iscursed(o)) {
|
||||||
if (newid == F_VISRANGEMOD) {
|
if (newid == F_VISRANGEMOD) {
|
||||||
if (newval[0] != NA) {
|
if (newval[0] != NA) {
|
||||||
|
@ -25234,8 +25236,6 @@ int takeoff(lifeform_t *lf, object_t *o) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the equipped flag
|
// remove the equipped flag
|
||||||
killflagsofid(o->flags, F_EQUIPPED);
|
|
||||||
|
|
||||||
taketime(lf, getactspeed(lf));
|
taketime(lf, getactspeed(lf));
|
||||||
if (gamemode == GM_GAMESTARTED) {
|
if (gamemode == GM_GAMESTARTED) {
|
||||||
if (isplayer(lf)) {
|
if (isplayer(lf)) {
|
||||||
|
@ -25249,15 +25249,9 @@ int takeoff(lifeform_t *lf, object_t *o) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unequipeffects(lf, o);
|
makeunequipped(lf, o);
|
||||||
|
|
||||||
// if you don't have a pack, it goes to the ground.
|
|
||||||
if (lfhasflag(lf, F_NOPACK)) {
|
|
||||||
moveob(o, lf->cell->obpile, o->amt);
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_FALSE;
|
return B_FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26023,8 +26017,6 @@ int unweild(lifeform_t *lf, object_t *o) {
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove the equipped flag
|
|
||||||
killflagsofid(o->flags, F_EQUIPPED);
|
|
||||||
|
|
||||||
// unweilding doesn't take any time
|
// unweilding doesn't take any time
|
||||||
if (gamemode == GM_GAMESTARTED) {
|
if (gamemode == GM_GAMESTARTED) {
|
||||||
|
@ -26037,12 +26029,7 @@ int unweild(lifeform_t *lf, object_t *o) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unequipeffects(lf, o);
|
makeunequipped(lf, o);
|
||||||
|
|
||||||
// if you don't have a pack, it goes to the ground.
|
|
||||||
if (lfhasflag(lf, F_NOPACK)) {
|
|
||||||
moveob(o, lf->cell->obpile, o->amt);
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_FALSE;
|
return B_FALSE;
|
||||||
}
|
}
|
||||||
|
|
40
objects.c
40
objects.c
|
@ -9071,6 +9071,17 @@ int makedullermaybe(object_t *o, int howmuch) {
|
||||||
return B_FALSE;
|
return B_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void makeunequipped(lifeform_t *lf, object_t *o) {
|
||||||
|
// remove the equipped flag
|
||||||
|
killflagsofid(o->flags, F_EQUIPPED);
|
||||||
|
|
||||||
|
unequipeffects(lf, o);
|
||||||
|
|
||||||
|
// if you don't have a pack, it goes to the ground.
|
||||||
|
if (lfhasflag(lf, F_NOPACK)) {
|
||||||
|
moveob(o, lf->cell->obpile, o->amt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void makehot(object_t *o, int howmuch, int howlong) {
|
void makehot(object_t *o, int howmuch, int howlong) {
|
||||||
flag_t *f;
|
flag_t *f;
|
||||||
|
@ -13750,6 +13761,35 @@ int readsomething(lifeform_t *lf, object_t *o) {
|
||||||
// otherwise only equipped objects will be uncursed.
|
// otherwise only equipped objects will be uncursed.
|
||||||
if (o->blessed || isequipped(oo)) {
|
if (o->blessed || isequipped(oo)) {
|
||||||
uncurseob(oo, &seen);
|
uncurseob(oo, &seen);
|
||||||
|
if (isequipped(oo)) {
|
||||||
|
// forcibly unequip it.
|
||||||
|
makeunequipped(lf, oo);
|
||||||
|
|
||||||
|
if (isplayer(lf)) {
|
||||||
|
char obname[BUFLEN];
|
||||||
|
// announce
|
||||||
|
getobname(oo,obname,oo->amt);
|
||||||
|
if (oo->pile->owner == lf) {
|
||||||
|
msg("Your %s vanishes and reappears in your pack.", noprefix(obname));
|
||||||
|
} else {
|
||||||
|
msg("Your %s vanishes and appears on the ground.", noprefix(obname));
|
||||||
|
}
|
||||||
|
} else if (cansee(player, lf)) {
|
||||||
|
char obname[BUFLEN],lfname[BUFLEN];
|
||||||
|
// announce
|
||||||
|
getobname(oo,obname,oo->amt);
|
||||||
|
getlfname(lf, lfname);
|
||||||
|
if (oo->pile->owner == lf) {
|
||||||
|
msg("%s%s %s vanishes and reappears in %ss pack.", lfname,
|
||||||
|
getpossessive(lfname),
|
||||||
|
noprefix(obname), it(lf));
|
||||||
|
} else {
|
||||||
|
msg("%s%s %s vanishes and appears on the ground.", lfname,
|
||||||
|
getpossessive(lfname),
|
||||||
|
noprefix(obname));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -261,6 +261,7 @@ lifeform_t *makeanimated(lifeform_t *lf, object_t *o, int level);
|
||||||
void makecool(object_t *o, int howmuch, int howlong);
|
void makecool(object_t *o, int howmuch, int howlong);
|
||||||
int makeduller(object_t *o, int howmuch);
|
int makeduller(object_t *o, int howmuch);
|
||||||
int makedullermaybe(object_t *o, int howmuch);
|
int makedullermaybe(object_t *o, int howmuch);
|
||||||
|
void makeunequipped(lifeform_t *lf, object_t *o);
|
||||||
void makehot(object_t *o, int howmuch, int howlong);
|
void makehot(object_t *o, int howmuch, int howlong);
|
||||||
void makeknown(enum OBTYPE otid);
|
void makeknown(enum OBTYPE otid);
|
||||||
void makeknownobclass(enum OBCLASS ocid, enum RARITY rrlev);
|
void makeknownobclass(enum OBCLASS ocid, enum RARITY rrlev);
|
||||||
|
|
Loading…
Reference in New Issue