Skip to content

Commit

Permalink
Refactored property names to be more readable or just be shorter. Als…
Browse files Browse the repository at this point in the history
…o renamed resilience property to toughness, fixed the stat that vigilance grants, and changed the description of stone resistance to versus stone.
  • Loading branch information
elunna committed Oct 13, 2023
1 parent 84d73c0 commit ecf76ef
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 160 deletions.
61 changes: 32 additions & 29 deletions include/obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,31 +592,34 @@ struct obj {
#define ITEM_FROST 0x00000002L /* frost damage or resistance */
#define ITEM_SHOCK 0x00000004L /* shock damage or resistance */
#define ITEM_VENOM 0x00000008L /* poison damage or resistance */
#define ITEM_ACID 0x00000010L /* acid damage or resistance */
#define ITEM_SIZZLE 0x00000010L /* acid damage or resistance */
#define ITEM_SCREAM 0x00000020L /* sonic damage or resistance */
#define ITEM_DRLI 0x00000040L /* drains life or resists it */
#define ITEM_DECAY 0x00000040L /* drains life or resistance */
#define ITEM_OILSKIN 0x00000080L /* permanently greased */
#define ITEM_ESP 0x00000100L /* extrinsic telepathy */
#define ITEM_SEARCHING 0x00000200L /* extrinsic searching */
#define ITEM_VIGIL 0x00000400L /* extrinsic warning */
#define ITEM_EXCEL 0x00000800L /* confers luck, charisma boost */
#define ITEM_FUMBLING 0x00001000L /* extrinsic fumbling */
#define ITEM_HUNGER 0x00002000L /* extrinsic hunger */
#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 */
#define ITEM_STEALTH 0x00040000L /* extrinsic stealth */
#define ITEM_INSIGHT 0x00080000L /* extrinsic see invisible */
#define ITEM_SLEEP 0x00100000L /* extrinsic sleep resistance */
#define ITEM_STONE 0x00200000L /* extrinsic stoning resistance */
#define ITEM_SICK 0x00400000L /* extrinsic sickness resistance */
#define ITEM_STUN 0x00800000L /* extrinsic stun resistance */
#define ITEM_STABLE 0x01000000L /* extrinsic clobber resistance */
#define ITEM_WWALK 0x02000000L /* extrinsic water walking */
#define ITEM_SWIM 0x04000000L /* extrinsic swimming */
#define ITEM_RAGE 0x08000000L /* extrinsic rage and fearlessness */
#define ITEM_TOUGH 0x10000000L /* extrinsic disintegration res */
#define ITEM_ESP 0x00000100L /* telepathy */
#define ITEM_SEARCH 0x00000200L /* searching */
#define ITEM_VIGIL 0x00000400L /* warning, wisdom boost, flanking defense */
#define ITEM_EXCEL 0x00000800L /* luck, charisma boost */
#define ITEM_FUMBLE 0x00001000L /* fumbling */
#define ITEM_HUNGER 0x00002000L /* hunger */
#define ITEM_STENCH 0x00004000L /* aggravate monster, prevents digestion
* stenchy items cannot be eaten by players or monsters */
#define ITEM_TELE 0x00008000L /* teleportitis */
#define ITEM_SLOW 0x00010000L /* slowness */
#define ITEM_SUSTAIN 0x00020000L /* sustain ability, items retain their enchantment level */
#define ITEM_STEALTH 0x00040000L /* stealth */
#define ITEM_INSIGHT 0x00080000L /* see invisible, magical vision */
#define ITEM_SLEEP 0x00100000L /* sleep resistance */
#define ITEM_FLEX 0x00200000L /* stoning resistance */
#define ITEM_HEALTH 0x00400000L /* sickness resistance */
#define ITEM_STUN 0x00800000L /* stun resistance */
#define ITEM_STABLE 0x01000000L /* clobber resistance */
#define ITEM_SURF 0x02000000L /* water walking */
#define ITEM_SWIM 0x04000000L /* swimming */
#define ITEM_RAGE 0x08000000L /* fearlessness, bloodthirsty
* makes your weapon deal max damage */
#define ITEM_TOUGH 0x10000000L /* disintegration res
* Makes items erosionproof and indestructible */
#define ITEM_PROWESS 0x20000000L /* Speeds up tech cooldowns, skill bonuses */

#define ITEM_MAGICAL 0x80000000L /* known to have magical properties */
Expand All @@ -626,19 +629,19 @@ struct obj {

/* Properties that grant both a worn resistance and attack type */
#define ITEM_RES_PROPS (ITEM_FIRE | ITEM_FROST | ITEM_SHOCK | ITEM_VENOM \
| ITEM_ACID | ITEM_SCREAM | ITEM_DRLI \
| ITEM_SLEEP | ITEM_STONE | ITEM_SICK \
| ITEM_SIZZLE | ITEM_SCREAM | ITEM_DECAY \
| ITEM_SLEEP | ITEM_FLEX | ITEM_HEALTH \
| ITEM_STUN)
/* Positive properties */
#define ITEM_GOOD_PROPS (ITEM_OILSKIN | ITEM_ESP | ITEM_SEARCHING \
#define ITEM_GOOD_PROPS (ITEM_OILSKIN | ITEM_ESP | ITEM_SEARCH \
| ITEM_VIGIL | ITEM_EXCEL | ITEM_SUSTAIN \
| ITEM_STEALTH | ITEM_INSIGHT | ITEM_STABLE \
| ITEM_WWALK | ITEM_SWIM | ITEM_RAGE | ITEM_TOUGH)
| ITEM_SURF | ITEM_SWIM | ITEM_RAGE | ITEM_TOUGH)
/* Negative properties */
#define ITEM_BAD_PROPS (ITEM_FUMBLING | ITEM_HUNGER | ITEM_STENCH \
#define ITEM_BAD_PROPS (ITEM_FUMBLE | ITEM_HUNGER | ITEM_STENCH \
| ITEM_TELE | ITEM_SLOW)

#define NON_WEP_PROPS (ITEM_SLEEP | ITEM_STONE | ITEM_SICK | ITEM_STUN)
#define NON_WEP_PROPS (ITEM_SLEEP | ITEM_FLEX | ITEM_HEALTH | ITEM_STUN)
#define ONLY_WEP_PROPS (ITEM_RAGE | ITEM_PROWESS)

/*
Expand Down
40 changes: 20 additions & 20 deletions src/artifact.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ int prop;
{
int i;
/* Alchemy smock is the king of exceptions */
if (otmp->otyp == ALCHEMY_SMOCK && (prop & (ITEM_ACID | ITEM_VENOM)))
if (otmp->otyp == ALCHEMY_SMOCK && (prop & (ITEM_SIZZLE | ITEM_VENOM)))
return TRUE;

for (i = 0; i < NUM_PROPERTIES; i++) {
Expand Down Expand Up @@ -762,15 +762,15 @@ struct obj *otmp;
return TRUE;
if (adtyp == AD_DRST && (otmp->oprops & ITEM_VENOM))
return TRUE;
if (adtyp == AD_ACID && (otmp->oprops & ITEM_ACID))
if (adtyp == AD_ACID && (otmp->oprops & ITEM_SIZZLE))
return TRUE;
if (adtyp == AD_DRLI && (otmp->oprops & ITEM_DRLI))
if (adtyp == AD_DRLI && (otmp->oprops & ITEM_DECAY))
return TRUE;
if (adtyp == AD_SLEE && (otmp->oprops & ITEM_SLEEP))
return TRUE;
if (adtyp == AD_STON && (otmp->oprops & ITEM_STONE))
if (adtyp == AD_STON && (otmp->oprops & ITEM_FLEX))
return TRUE;
if (adtyp == AD_DISE && (otmp->oprops & ITEM_SICK))
if (adtyp == AD_DISE && (otmp->oprops & ITEM_HEALTH))
return TRUE;
if (adtyp == AD_STUN && (otmp->oprops & ITEM_STUN))
return TRUE;
Expand Down Expand Up @@ -958,7 +958,7 @@ long wp_mask;
if (oart) {
spfx = (wp_mask != W_ART) ? oart->spfx : oart->cspfx;
} else if (wp_mask == W_WEP || wp_mask == W_SWAPWEP) {
if (otmp->oprops & ITEM_SEARCHING)
if (otmp->oprops & ITEM_SEARCH)
spfx |= SPFX_SEARCH;
if (otmp->oprops & ITEM_VIGIL)
spfx |= SPFX_WARN;
Expand Down Expand Up @@ -1435,7 +1435,7 @@ int tmp;
return dbon;
}
}
if ((otmp->oprops & ITEM_DRLI)
if ((otmp->oprops & ITEM_DECAY)
&& ((yours) ? (!Drain_resistance) : (!resists_drli(mon)))) {
spec_dbon_applies = TRUE;
return 0;
Expand Down Expand Up @@ -2211,7 +2211,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
: "burns",
hittee, !spec_dbon_applies ? '.' : '!');
} else if (otmp->oclass == WEAPON_CLASS
&& (otmp->oprops & ITEM_ACID)) {
&& (otmp->oprops & ITEM_SIZZLE)) {
pline_The("acidic %s %s %s%c",
distant_name(otmp, xname),
!spec_dbon_applies ? "hits"
Expand All @@ -2225,8 +2225,8 @@ int dieroll; /* needed for Magicbane and vorpal blades */
if (!rn2(5))
erode_armor(mdef, ERODE_CORRODE);
}
if ((otmp->oprops & ITEM_ACID) && spec_dbon_applies) {
otmp->oprops_known |= ITEM_ACID;
if ((otmp->oprops & ITEM_SIZZLE) && spec_dbon_applies) {
otmp->oprops_known |= ITEM_SIZZLE;
update_inventory();
}
return realizes_damage;
Expand Down Expand Up @@ -3014,7 +3014,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
pline_The("massive sword draws the %s from %s!",
life, mon_nam(mdef));
else if (otmp->oclass == WEAPON_CLASS
&& (otmp->oprops & ITEM_DRLI))
&& (otmp->oprops & ITEM_DECAY))
pline_The("deadly %s draws the %s from %s!",
distant_name(otmp, xname), life,
mon_nam(mdef));
Expand All @@ -3023,8 +3023,8 @@ int dieroll; /* needed for Magicbane and vorpal blades */
pline("%s draws the %s from %s!",
The(distant_name(otmp, xname)), life,
mon_nam(mdef));
if (otmp->oprops & ITEM_DRLI) {
otmp->oprops_known |= ITEM_DRLI;
if (otmp->oprops & ITEM_DECAY) {
otmp->oprops_known |= ITEM_DECAY;
update_inventory();
}
}
Expand Down Expand Up @@ -3059,15 +3059,15 @@ int dieroll; /* needed for Magicbane and vorpal blades */
else if (otmp->oartifact == ART_LIFESTEALER)
pline_The("massive sword drains your %s!", life);
else if (otmp->oclass == WEAPON_CLASS
&& (otmp->oprops & ITEM_DRLI))
&& (otmp->oprops & ITEM_DECAY))
pline_The("deadly %s drains your %s!",
distant_name(otmp, xname), life);
/* The Staff of Aesculapius */
else
pline("%s drains your %s!", The(distant_name(otmp, xname)),
life);
if (otmp->oprops & ITEM_DRLI) {
otmp->oprops_known |= ITEM_DRLI;
if (otmp->oprops & ITEM_DECAY) {
otmp->oprops_known |= ITEM_DECAY;
update_inventory();
}
losexp("life drainage");
Expand Down Expand Up @@ -4119,10 +4119,10 @@ struct obj *obj;
obj->oprops_known |= ITEM_SHOCK;
return TRUE;
}
if (ad_type == AD_DRLI || oprops & ITEM_DRLI) {
if (ad_type == AD_DRLI || oprops & ITEM_DECAY) {
pline("%s thins the %s!", The(xname(obj)), hliquid("water"));
if (oprops)
obj->oprops_known |= ITEM_DRLI;
obj->oprops_known |= ITEM_DECAY;
return TRUE;
}
if (ad_type == AD_LOUD || oprops & ITEM_SCREAM) {
Expand All @@ -4131,10 +4131,10 @@ struct obj *obj;
obj->oprops_known |= ITEM_SCREAM;
return TRUE;
}
if (ad_type == AD_ACID || oprops & ITEM_ACID) {
if (ad_type == AD_ACID || oprops & ITEM_SIZZLE) {
pline("The %s bubbles from contact with your %s!", hliquid("water"), xname(obj));
if (oprops)
obj->oprops_known |= ITEM_ACID;
obj->oprops_known |= ITEM_SIZZLE;
return TRUE;
}
if (oprops & ITEM_RAGE) {
Expand Down
32 changes: 16 additions & 16 deletions src/do_wear.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ long mask;
EShock_resistance |= mask;
if (props & ITEM_VENOM)
EPoison_resistance |= mask;
if (props & ITEM_ACID)
if (props & ITEM_SIZZLE)
EAcid_resistance |= mask;
if (props & ITEM_SCREAM)
ESonic_resistance |= mask;
if (props & ITEM_DRLI)
if (props & ITEM_DECAY)
EDrain_resistance |= mask;
if (props & ITEM_SLEEP)
ESleep_resistance |= mask;
if (props & ITEM_STONE)
if (props & ITEM_FLEX)
EStone_resistance |= mask;
if (props & ITEM_SICK)
if (props & ITEM_HEALTH)
ESick_resistance |= mask;
if (props & ITEM_STUN)
EStun_resistance |= mask;
Expand All @@ -251,7 +251,7 @@ long mask;
ETelepat |= mask;
see_monsters();
}
if (props & ITEM_SEARCHING)
if (props & ITEM_SEARCH)
ESearching |= mask;

if (props & ITEM_INSIGHT) {
Expand All @@ -271,7 +271,7 @@ long mask;
if (props & ITEM_PROWESS) {
(void) changes_stat(otmp, ITEM_PROWESS);
}
if (props & ITEM_FUMBLING) {
if (props & ITEM_FUMBLE) {
if (!EFumbling && !(HFumbling & ~TIMEOUT))
incr_itimeout(&HFumbling, rnd(20));
EFumbling |= mask;
Expand All @@ -298,11 +298,11 @@ long mask;
}
if (props & ITEM_STABLE)
EStable |= mask;
if (props & ITEM_WWALK) {
if (props & ITEM_SURF) {
EWwalking |= mask;
if (u.uinwater || is_lava(u.ux, u.uy) || is_sewage(u.ux, u.uy)) {
spoteffects(TRUE);
otmp->oprops_known |= ITEM_WWALK;
otmp->oprops_known |= ITEM_SURF;
}
}
if (props & ITEM_SWIM) {
Expand All @@ -328,21 +328,21 @@ long mask;
EFire_resistance &= ~mask;
if (props & ITEM_FROST)
ECold_resistance &= ~mask;
if (props & ITEM_DRLI)
if (props & ITEM_DECAY)
EDrain_resistance &= ~mask;
if (props & ITEM_SHOCK)
EShock_resistance &= ~mask;
if (props & ITEM_SCREAM)
ESonic_resistance &= ~mask;
if (props & ITEM_VENOM)
EPoison_resistance &= ~mask;
if (props & ITEM_ACID)
if (props & ITEM_SIZZLE)
EAcid_resistance &= ~mask;
if (props & ITEM_SLEEP)
ESleep_resistance &= ~mask;
if (props & ITEM_STONE)
if (props & ITEM_FLEX)
EStone_resistance &= ~mask;
if (props & ITEM_SICK)
if (props & ITEM_HEALTH)
ESick_resistance &= ~mask;
if (props & ITEM_STUN)
EStun_resistance &= ~mask;
Expand All @@ -356,7 +356,7 @@ long mask;
ETelepat &= ~mask;
see_monsters();
}
if (props & ITEM_SEARCHING)
if (props & ITEM_SEARCH)
ESearching &= ~mask;
if (props & ITEM_INSIGHT) {
ESee_invisible &= ~mask;
Expand All @@ -375,7 +375,7 @@ long mask;
if (props & ITEM_PROWESS) {
(void) changes_stat(otmp, ITEM_PROWESS);
}
if (props & ITEM_FUMBLING) {
if (props & ITEM_FUMBLE) {
EFumbling &= ~mask;
if (!EFumbling && !(HFumbling & ~TIMEOUT))
HFumbling = EFumbling = 0;
Expand All @@ -396,13 +396,13 @@ long mask;
}
if (props & ITEM_STABLE)
EStable &= ~mask;
if (props & ITEM_WWALK) {
if (props & ITEM_SURF) {
EWwalking &= ~mask;
if ((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy))
&& !Levitation && !Flying && !is_clinger(youmonst.data)
&& !context.takeoff.cancelled_don
&& !iflags.in_lava_effects) {
otmp->oprops_known |= ITEM_WWALK;
otmp->oprops_known |= ITEM_SURF;
spoteffects(TRUE);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/makemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2641,7 +2641,7 @@ register struct monst *mtmp;
(void) mpickobj(mtmp, otmp);
} else if (ptr == &mons[PM_VECNA]) {
otmp = mksobj(ROBE, FALSE, FALSE);
otmp->oprops = ITEM_DRLI;
otmp->oprops = ITEM_DECAY;
otmp->oeroded2 = TRUE;
curse(otmp);
(void) mpickobj(mtmp, otmp);
Expand Down
Loading

0 comments on commit ecf76ef

Please sign in to comment.