Skip to content

Commit

Permalink
The aggravation property has been renamed to the 'stench' property. I…
Browse files Browse the repository at this point in the history
…n addition to aggravate monster, this property also prevents you from being engulfed and digested. When you interact with NPC's, they'll also notice something stinks.
  • Loading branch information
elunna committed Oct 1, 2023
1 parent e4e7537 commit f99ba11
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 31 deletions.
1 change: 1 addition & 0 deletions include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ E boolean FDECL(is_magic_key, (struct monst *, struct obj *));
E struct obj *FDECL(has_magic_key, (struct monst *));
E boolean FDECL(wielding_artifact, (int));
E boolean FDECL(wearing_artifact, (int));
E struct obj *FDECL(using_oprop, (long));
E boolean NDECL(awaiting_guaranteed_gift);
E int FDECL(arti_align, (int));
E boolean FDECL(non_wishable_artifact, (struct obj *));
Expand Down
4 changes: 2 additions & 2 deletions include/obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ struct obj {
#define ITEM_EXCEL 0x00000800L /* confers luck, charisma boost */
#define ITEM_FUMBLING 0x00001000L /* extrinsic fumbling */
#define ITEM_HUNGER 0x00002000L /* extrinsic hunger */
#define ITEM_AGGRO 0x00004000L /* extrinsic aggravate monster */
#define ITEM_STENCH 0x00004000L /* extrinsic aggravate monster */
#define ITEM_TELE 0x00008000L /* extrinsic teleportitis */
#define ITEM_SLOW 0x00010000L /* extrinsic slowness */
#define ITEM_SUSTAIN 0x00020000L /* extrinsic sustain ability */
Expand Down Expand Up @@ -631,7 +631,7 @@ struct obj {
| ITEM_STEALTH | ITEM_SEEINV | ITEM_STABLE \
| ITEM_WWALK | ITEM_SWIM | ITEM_BRAVE)
/* Negative properties */
#define ITEM_BAD_PROPS (ITEM_FUMBLING | ITEM_HUNGER | ITEM_AGGRO \
#define ITEM_BAD_PROPS (ITEM_FUMBLING | ITEM_HUNGER | ITEM_STENCH \
| ITEM_TELE | ITEM_SLOW)

#define NON_WEP_PROPS (ITEM_SLEEP | ITEM_STONE | ITEM_SICK | ITEM_STUN)
Expand Down
11 changes: 11 additions & 0 deletions src/artifact.c
Original file line number Diff line number Diff line change
Expand Up @@ -4734,6 +4734,17 @@ int art;
|| (uright && uright->oartifact == art));
}

struct obj *
using_oprop(oprop)
long oprop;
{
struct obj *otmp;
for (otmp = invent; otmp; otmp = otmp->nobj) {
if (otmp->oprops & oprop && is_worn(otmp))
return otmp;
}
return (struct obj *) 0;
}

boolean
awaiting_guaranteed_gift()
Expand Down
4 changes: 2 additions & 2 deletions src/do_wear.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ long mask;
}
if (props & ITEM_HUNGER)
EHunger |= mask;
if (props & ITEM_AGGRO)
if (props & ITEM_STENCH)
EAggravate_monster |= mask;
if (props & ITEM_TELE)
ETeleportation |= mask;
Expand Down Expand Up @@ -382,7 +382,7 @@ long mask;
}
if (props & ITEM_HUNGER)
EHunger &= ~mask;
if (props & ITEM_AGGRO)
if (props & ITEM_STENCH)
EAggravate_monster &= ~mask;
if (props & ITEM_TELE)
ETeleportation &= ~mask;
Expand Down
19 changes: 13 additions & 6 deletions src/mhitu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2827,14 +2827,15 @@ struct monst *mtmp;
struct attack *mattk;
{
struct trap *t = t_at(u.ux, u.uy);
struct obj *pseudo;
struct obj *pseudo, *otmp2;
struct obj *prevents_gulp = using_oprop(ITEM_STENCH);
int tmp = d((int) mattk->damn, (int) mattk->damd);
int tim_tmp;
struct obj *otmp2;
int i;
int i, tim_tmp;

boolean physical_damage = FALSE;
/* for tracking if this is the first engulf */
boolean old_uswallow = u.uswallow;


if (!u.uswallow) { /* swallows you */
int omx = mtmp->mx, omy = mtmp->my;
Expand Down Expand Up @@ -2946,7 +2947,7 @@ struct attack *mattk;
switch (mattk->adtyp) {
case AD_DGST:
physical_damage = TRUE;
if (Slow_digestion) {
if (Slow_digestion || prevents_gulp) {
/* Messages are handled below */
u.uswldtim = 0;
tmp = 0;
Expand Down Expand Up @@ -3228,8 +3229,14 @@ struct attack *mattk;
expels(mtmp, mtmp->data, TRUE);
if (flags.verbose
&& (is_swallower(mtmp->data)
|| (dmgtype(mtmp->data, AD_DGST) && Slow_digestion)))
|| (dmgtype(mtmp->data, AD_DGST)
&& (Slow_digestion || prevents_gulp)))) {
if (prevents_gulp && !(prevents_gulp->oprops_known & ITEM_STENCH)) {
prevents_gulp->oprops_known |= ITEM_STENCH;
/* Do we need a special message here? */
}
pline("Obviously %s doesn't like your taste.", mon_nam(mtmp));
}
}
return 1;
}
Expand Down
12 changes: 6 additions & 6 deletions src/objnam.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,9 @@ boolean has_of;
Strcpy(of, " and");
}
}
if (props & ITEM_AGGRO) {
if ((props_known & ITEM_AGGRO) || dump_prop_flag) {
Strcat(buf, of), Strcat(buf, " aggravation"),
if (props & ITEM_STENCH) {
if ((props_known & ITEM_STENCH) || dump_prop_flag) {
Strcat(buf, of), Strcat(buf, " stench"),
Strcpy(of, " and");
}
}
Expand Down Expand Up @@ -4348,9 +4348,9 @@ struct obj *no_wish;
if (!objpropcount || wizard)
objprops |= ITEM_HUNGER;
objpropcount++;
} else if (!strncmpi((p + of), "aggravation", l = strlen("aggravation"))) {
} else if (!strncmpi((p + of), "stench", l = strlen("stench"))) {
if (!objpropcount || wizard)
objprops |= ITEM_AGGRO;
objprops |= ITEM_STENCH;
objpropcount++;
} else if (!strncmpi((p + of), "teleportation", l = strlen("teleportation"))) {
if (!objpropcount || wizard)
Expand All @@ -4372,7 +4372,7 @@ struct obj *no_wish;
if (!objpropcount || wizard)
objprops |= ITEM_STABLE;
objpropcount++;
} else if (!strncmpi((p + of), "water walking", l = strlen("water walking"))
} else if (!strncmpi((p + of), "water walking", l = strlen("water walking"))
|| !strncmpi((p + of), "surfing", l = strlen("surfing"))) {
if (!objpropcount || wizard)
objprops |= ITEM_WWALK;
Expand Down
2 changes: 1 addition & 1 deletion src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ char *usr_text;
if (obj->oprops & ITEM_SEEINV) OBJPUTSTR("Grants see invisible");
if (obj->oprops & ITEM_EXCEL) OBJPUTSTR("Grants luck/charisma adjustment");
if (obj->oprops & ITEM_HUNGER) OBJPUTSTR("Grants hunger");
if (obj->oprops & ITEM_AGGRO) OBJPUTSTR("Grants aggravate monster");
if (obj->oprops & ITEM_STENCH) OBJPUTSTR("Grants aggravate monster");
if (obj->oprops & ITEM_TELE) OBJPUTSTR("Grants teleportation");
if (obj->oprops & ITEM_SLOW) OBJPUTSTR("Grants lethargy");
if (obj->oprops & ITEM_SUSTAIN) OBJPUTSTR("Grants sustainability");
Expand Down
25 changes: 25 additions & 0 deletions src/sounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ register struct monst *mtmp;
*verbl_msg = 0, /* verbalize() */
*verbl_msg_mcan = 0; /* verbalize() if cancelled */
struct permonst *ptr = mtmp->data;
struct obj *obj_stench = using_oprop(ITEM_STENCH);
int msound = ptr->msound, gnomeplan = 0;

/* presumably nearness and sleep checks have already been made */
Expand All @@ -655,6 +656,30 @@ register struct monst *mtmp;
if (is_silent(ptr))
return 0;

/* They'll notice your stenchy items */
if (obj_stench && olfaction(mtmp->data)) {
if (obj_stench->oprops_known & ITEM_STENCH) {
switch (rnd(3)) {
case 1:
verbalize("Haven't you gotten rid of that smelly thing yet?");
break;
case 2:
verbalize("You don't smell that?");
break;
case 3:
verbalize("Please take your %s out of here!", xname(obj_stench));
break;
}
} else {
if (rn2(2))
verbalize("Ugh, what is that smell?");
else
verbalize("Something really stinks... Is it you?");
obj_stench->oprops_known |= ITEM_STENCH;

}
}

/* leader might be poly'd; if he can still speak, give leader speech */
if (mtmp->m_id == quest_status.leader_m_id && msound > MS_ANIMAL)
msound = MS_LEADER;
Expand Down
14 changes: 6 additions & 8 deletions src/trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4679,14 +4679,12 @@ drown()
pline("Hey! You can swim!");
makeknown(GAUNTLETS_OF_SWIMMING);
} else if (!HSwimming) {
/* *Something* is making us swim! */
for (otmp = invent; otmp; otmp = otmp->nobj)
if (otmp->oprops & ITEM_SWIM && is_worn(otmp)
&& !(otmp->oprops_known & ITEM_SWIM)) {
pline("Hey! You can swim!");
otmp->oprops_known |= ITEM_SWIM;
update_inventory();
}
otmp = using_oprop(ITEM_SWIM);
if (otmp && otmp->oprops_known & ITEM_SWIM) {
pline("Hey! You can swim!");
otmp->oprops_known |= ITEM_SWIM;
update_inventory();
}
}

if (Amphibious) {
Expand Down
8 changes: 4 additions & 4 deletions src/wield.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ register struct obj *obj;
if (olduwep->oprops & ITEM_HUNGER) {
EHunger &= ~W_WEP;
}
if (olduwep->oprops & ITEM_AGGRO) {
if (olduwep->oprops & ITEM_STENCH) {
EAggravate_monster &= ~W_WEP;
}
if (olduwep->oprops & ITEM_TELE) {
Expand Down Expand Up @@ -218,7 +218,7 @@ register struct obj *obj;
if (uwep->oprops & ITEM_HUNGER) {
EHunger |= W_WEP;
}
if (uwep->oprops & ITEM_AGGRO) {
if (uwep->oprops & ITEM_STENCH) {
EAggravate_monster |= W_WEP;
}
if (uwep->oprops & ITEM_TELE) {
Expand Down Expand Up @@ -530,10 +530,10 @@ register struct obj *obj;

/* Aggravate monster property */
if (uswapwep == obj
&& (u.twoweap && (uswapwep->oprops & ITEM_AGGRO))) {
&& (u.twoweap && (uswapwep->oprops & ITEM_STENCH))) {
EAggravate_monster |= W_SWAPWEP;
}
if (!u.twoweap && olduswapwep && (olduswapwep->oprops & ITEM_AGGRO)) {
if (!u.twoweap && olduswapwep && (olduswapwep->oprops & ITEM_STENCH)) {
EAggravate_monster &= ~W_SWAPWEP;
}

Expand Down
4 changes: 2 additions & 2 deletions src/worn.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ int which;
case HUNGER:
return !!(obj->oprops & ITEM_HUNGER);
case AGGRAVATE_MONSTER:
return !!(obj->oprops & ITEM_AGGRO);
return !!(obj->oprops & ITEM_STENCH);
case TELEPORT:
return !!(obj->oprops & ITEM_TELE);
case SLOW:
Expand Down Expand Up @@ -703,7 +703,7 @@ boolean on, silently;
case ITEM_HUNGER:
which = HUNGER;
break;
case ITEM_AGGRO:
case ITEM_STENCH:
which = AGGRAVATE_MONSTER;
break;
case ITEM_TELE:
Expand Down

0 comments on commit f99ba11

Please sign in to comment.