diff --git a/ai.c b/ai.c index 0d926c0..5364e09 100644 --- a/ai.c +++ b/ai.c @@ -665,7 +665,7 @@ int ai_bored(lifeform_t *lf, lifeform_t *master, int icanattack) { } if (pctchance(chance)) { - if (lfhasflag(lf, F_HATESALL)) { + if (lfhasflag(lf, F_HATESALL) || lfhasflag(lf, F_RAGE)) { if (nhateposs < MAXCANDIDATES) { if (db) dblog(".oO { hate everything - found lfid %d (%s) ! }",who->id, who->race->name); hateposs[nhateposs++] = who; diff --git a/data.c b/data.c index 37e32be..79d67a3 100644 --- a/data.c +++ b/data.c @@ -91,6 +91,7 @@ void initcommands(void) { addcommand(CMD_QUAFF, 'q', "Quaff (drink) a potion."); addcommand(CMD_READ, 'r', "Read a scroll/book."); addcommand(CMD_RESTFULL, 'R', "Rest until healed, or train your skills."); + addcommand(CMD_THROW, 's', "Step carefully."); addcommand(CMD_THROW, 't', "Throw an object."); addcommand(CMD_TAKEOFF, 'T', "Take off an item of clothing/jewelery."); addcommand(CMD_WEILD, 'w', "Weild a weapon."); @@ -951,92 +952,92 @@ void initobjects(void) { // ie. spellbook of flight, boots of flight. // weapons - addbrand(BR_BALANCE, "of balance", BP_WEAPON); + addbrand(BR_BALANCE, "of balance", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_BALANCE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_IMPACT, "of impact", BP_WEAPON); + addbrand(BR_IMPACT, "of impact", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_ONLYFORDAMTYPE, DT_BASH, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_HEAVYBLOW, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_MERCY, "of mercy", BP_WEAPON); + addbrand(BR_MERCY, "of mercy", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_MERCIFUL, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_PYROMANIA, "of pyromania", BP_WEAPON); + addbrand(BR_PYROMANIA, "of pyromania", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_FLAMESTRIKE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_REVENGE, "of revenge", BP_WEAPON); + addbrand(BR_REVENGE, "of revenge", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_REVENGE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SHARPNESS, "of sharpness", BP_WEAPON); + addbrand(BR_SHARPNESS, "of sharpness", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_ARMOURPIERCE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_LIFESUCK, "of lifesucking", BP_WEAPON); + addbrand(BR_LIFESUCK, "of lifesucking", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_VAMPIRIC, NA, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SLAY_ANIMAL, "of butchering", BP_WEAPON); + addbrand(BR_SLAY_ANIMAL, "of butchering", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_ONLYFORDAMTYPE, DT_SLASH, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_RACESLAY, RC_ANIMAL, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SLAY_DRAGON, "of dragonslaying", BP_WEAPON); + addbrand(BR_SLAY_DRAGON, "of dragonslaying", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_ONLYFORWEPSKILL, SK_POLEARMS, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_RACESLAY, RC_DRAGON, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SLAY_MAGIC, "of antimagic", BP_WEAPON); + addbrand(BR_SLAY_MAGIC, "of antimagic", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_RACESLAY, RC_MAGIC, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SLAY_PLANT, "of blight", BP_WEAPON); + addbrand(BR_SLAY_PLANT, "of blight", BP_WEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_ONLYFOROBTYPE, OT_SCYTHE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_RACESLAY, RC_PLANT, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SLAY_UNDEAD, "of divine power", BP_WEAPON); + addbrand(BR_SLAY_UNDEAD, "of divine power", BP_WEAPON, B_BLESSED, 80); addflag_real(lastbrand->flags, F_ONLYFORWEPSKILL, SK_LONGBLADES, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_ONLYFORWEPSKILL, SK_SHORTBLADES, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_RACESLAY, RC_UNDEAD, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_PRODUCESLIGHT, 3, NA, NULL, PERMENANT, B_KNOWN, -1); // feet - addbrand(BR_LEVITATION, "of hovering", BP_FEET); + addbrand(BR_LEVITATION, "of hovering", BP_FEET, B_CURSED, 50); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_LEVITATING, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_FEATHERFALL, "of featherfall", BP_FEET); + addbrand(BR_FEATHERFALL, "of featherfall", BP_FEET, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DTIMMUNE, DT_FALL, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SWIFTNESS, "of swiftness", BP_FEET); + addbrand(BR_SWIFTNESS, "of swiftness", BP_FEET, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_FASTMOVE, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SLOTH, "of sloth", BP_FEET); + addbrand(BR_SLOTH, "of sloth", BP_FEET, B_CURSED, 80); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_SLOWMOVE, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_STEALTH, "of stealth", BP_FEET); + addbrand(BR_STEALTH, "of stealth", BP_FEET, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_SILENTMOVE, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); // hands - addbrand(BR_POWER, "of power", BP_HANDS); + addbrand(BR_POWER, "of power", BP_HANDS, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_STR, 3, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_WEAKNESS, "of feebleness", BP_HANDS); + addbrand(BR_WEAKNESS, "of feebleness", BP_HANDS, B_CURSED, 80); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_STR, -3, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_NIMBLENESS, "of nimbleness", BP_HANDS); + addbrand(BR_NIMBLENESS, "of nimbleness", BP_HANDS, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_AGI, 3, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SPIDERCLIMB, "of the spider", BP_HANDS); + addbrand(BR_SPIDERCLIMB, "of the spider", BP_HANDS, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_SPIDERCLIMB, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); // head - addbrand(BR_THINKING, "of thinking", BP_HEAD); + addbrand(BR_THINKING, "of thinking", BP_HEAD, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_IQ, 3, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_KNOWLEDGE, "of knowledge", BP_HEAD); + addbrand(BR_KNOWLEDGE, "of knowledge", BP_HEAD, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DETECTAURAS, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DETECTMAGIC, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_TELEPATHY, "of telepathy", BP_HEAD); + addbrand(BR_TELEPATHY, "of telepathy", BP_HEAD, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_DETECTLIFE, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_TELEKINESIS, "of the poltergeist", BP_HEAD); + addbrand(BR_TELEKINESIS, "of the poltergeist", BP_HEAD, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_CANWILL, OT_S_TELEKINESIS, NA, NULL, PERMENANT, B_UNKNOWN, -1); // waist - addbrand(BR_GIANTSTRENGTH, "of giant strength", BP_WAIST); + addbrand(BR_GIANTSTRENGTH, "of giant strength", BP_WAIST, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRSET, A_STR, 18, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_FEEBLENESS, "of feebleness", BP_WAIST); + addbrand(BR_FEEBLENESS, "of feebleness", BP_WAIST, B_CURSED, 80); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRSET, A_STR, 3, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_FLIGHT, "of the eagle", BP_WAIST); + addbrand(BR_FLIGHT, "of the eagle", BP_WAIST, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_FLYING, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SPEED, "of swiftness", BP_WAIST); + addbrand(BR_SPEED, "of swiftness", BP_WAIST, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_FASTACT, 5, NA, NULL, PERMENANT, B_UNKNOWN, -1); // shoulders - addbrand(BR_CONCEALMENT, "of concealment", BP_SHOULDERS); + addbrand(BR_CONCEALMENT, "of concealment", BP_SHOULDERS, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_INVISIBLE, B_TRUE, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_ANTIMAG, "of antimagic", BP_SHOULDERS); + addbrand(BR_ANTIMAG, "of antimagic", BP_SHOULDERS, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_RESISTMAG, 10, NA, NULL, PERMENANT, B_UNKNOWN, -1); - addbrand(BR_SHADOWS, "of shadows", BP_SHOULDERS); + addbrand(BR_SHADOWS, "of shadows", BP_SHOULDERS, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_CANWILL, OT_A_DARKWALK, NA, NULL, PERMENANT, B_UNKNOWN, -1); // body - addbrand(BR_HEALTH, "of health", BP_BODY); + addbrand(BR_HEALTH, "of health", BP_BODY, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_CON, 3, NULL, PERMENANT, B_UNKNOWN, -1); // materials @@ -2080,6 +2081,7 @@ void initobjects(void) { addflag(lastot->flags, F_VALUE, 15, NA, NA, NULL); addot(OT_POT_RESTORATION, "potion of restoration", "Restores lost abilities to the drinker.", MT_GLASS, 1, OC_POTION, SZ_TINY); addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL); + addflag(lastot->flags, F_AIHEALITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 170, NA, NA, NULL); addot(OT_POT_SLEEP, "potion of sleep", "Puts the drinker into a deep sleep.", MT_GLASS, 1, OC_POTION, SZ_TINY); addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL); @@ -2126,6 +2128,7 @@ void initobjects(void) { addflag(lastot->flags, F_VALUE, 15, NA, NA, NULL); addot(OT_POT_SANCTUARY, "potion of sanctuary", "Creates a temporary magical barrier abour the drinker.", MT_GLASS, 1, OC_POTION, SZ_TINY); addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL); + addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_VALUE, 75, NA, NA, NULL); addot(OT_POT_ETHEREALNESS, "potion of etherealness", "Allows the walker to temporarily pass through walls.", MT_GLASS, 1, OC_POTION, SZ_TINY); @@ -2142,9 +2145,14 @@ void initobjects(void) { addflag(lastot->flags, F_VALUE, 35, NA, NA, NULL); addot(OT_POT_COMPETENCE, "potion of competence", "Permemantly increases the drinker's base attribites (Strength, IQ, etc).", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL); addflag(lastot->flags, F_VALUE, 160, NA, NA, NULL); + addot(OT_POT_FURY, "potion of fury", "Causes the drinker to enter a state of berzerk rage.", MT_GLASS, 1, OC_POTION, SZ_TINY); + addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL); + addflag(lastot->flags, F_VALUE, 70, NA, NA, NULL); addot(OT_POT_GASEOUSFORM, "potion of gaseous form", "Turns the drinker into a cloud of gas. Only intended for emergencies, since it will cause you to drop all your items.", MT_GLASS, 1, OC_POTION, SZ_TINY); addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL); addflag(lastot->flags, F_AIFLEEITEM, B_TRUE, NA, NA, NULL); @@ -9026,6 +9034,7 @@ void initrace(void) { addrace(R_LEECH, "giant leech", 10, 'j', C_MAGENTA, MT_FLESH, RC_ANIMAL, "A boneless blood-sucking creature. Quite dangerous until it eats it becomes satiated with blood, at which point it will slither off and fall asleep."); addbodypart(lastrace, BP_BODY, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_VULNTOSALT, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); diff --git a/data/hiscores.db b/data/hiscores.db index 0a2fc0f..f0fb037 100644 Binary files a/data/hiscores.db and b/data/hiscores.db differ diff --git a/defs.h b/defs.h index 335c38e..1e477b1 100644 --- a/defs.h +++ b/defs.h @@ -1165,6 +1165,7 @@ enum OBTYPE { OT_POT_ELEMENTIMMUNE, OT_POT_ETHEREALNESS, OT_POT_EXPERIENCE, + OT_POT_FURY, OT_POT_GASEOUSFORM, OT_POT_HEALING, OT_POT_HEALINGMIN, @@ -2611,7 +2612,8 @@ enum FLAG { // movement penalties F_AVIAN, // this race is an avian F_CANINE, // this race is a canine - F_HUMANOID, // this race can wear armour / use weapons + F_HUMANOID, // this race is a humanoid + // (can wear armour / use weapons) F_INSECT, // this race is classed as an insect F_UNDEAD, // this race is classed as undead F_COLDBLOOD, // this race is coldblooded @@ -2634,6 +2636,7 @@ enum FLAG { F_SPOTTED, // you have spotted hiding lf id v0. you lsoe this if they // go out of sight. F_TIMID, // monster will only move close if behind its target. + F_VULNTOSALT, // salt kills this monster // special attack flags F_AIMEDSTRIKE, // next attack is an aimed strike F_COMBOSTRIKE, // lf is performing a combination strike @@ -3680,6 +3683,8 @@ typedef struct brand_s { char *suffix; flagpile_t *flags; enum BODYPART bp; + enum BLESSTYPE blessed; + int blesschance; struct brand_s *next, *prev; } brand_t; diff --git a/io.c b/io.c index a129c77..f34f5b1 100644 --- a/io.c +++ b/io.c @@ -8263,9 +8263,10 @@ void handleinput(void) { lastdir = f->val[0]; ihaveturned = f->val[1]; - // certain objects will stop us from running. + // certain objects in the current cell will stop us from running. for (o = player->cell->obpile->first ; o ; o = o->next) { if ( !hasflag(o->flags, F_NOPICKUP) || + hasflag(o->flags, F_SHOP) || hasflag(o->flags, F_CLIMBABLE) ) { stopnow = B_TRUE; break; @@ -8321,14 +8322,20 @@ void handleinput(void) { if (stopnow) { stoprunning(player); } else { - if (trymove(player, rundir, B_TRUE, B_FALSE)) { - // failed. + cell_t *c; + c = getcellindir(player->cell, rundir); + if (c && celldangerous(player, c, B_TRUE, NULL)) { stoprunning(player); } else { - // moved ok. remember this dir. - f->val[0] = rundir; - // our turn ends - return; + if (trymove(player, rundir, B_TRUE, B_FALSE)) { + // failed. + stoprunning(player); + } else { + // moved ok. remember this dir. + f->val[0] = rundir; + // our turn ends + return; + } } } } diff --git a/lf.c b/lf.c index 83aff92..5e3b648 100644 --- a/lf.c +++ b/lf.c @@ -2791,8 +2791,6 @@ int digdown(lifeform_t *lf, object_t *o) { char lfname[BUFLEN]; getlfname(lf, lfname); - // TODO: check if the floor is solid? - if (o) { if (lfhasflag(lf, F_LEVITATING)) { if (isplayer(lf)) { @@ -2802,10 +2800,21 @@ int digdown(lifeform_t *lf, object_t *o) { } } + // TODO: check if the floor is solid? + if (lf->cell->map->depth >= lf->cell->map->region->rtype->maxdepth) { + if (isplayer(lf)) { + msg("The floor here is too solid to dig in."); + } else if (cansee(player, lf)) { + msg("%s tries to dig a hole in the floor, but fails.", lfname); + } + return B_TRUE; + } + + if (isplayer(lf)) { msg("You dig a hole in the floor."); } else if (cansee(player, lf)) { - msg("%s digs a hole in the floor."); + msg("%s digs a hole in the floor.", lfname); } addobfast(lf->cell->obpile, OT_HOLEINGROUND); @@ -5302,6 +5311,10 @@ int getevasion(lifeform_t *lf) { return 0; } + // no evasion if you're holding someone, or someone is holding you + if (lfhasflag(lf, F_GRABBEDBY) || lfhasflag(lf, F_GRABBING)) { + return 0; + } ////////////////////////////////////////////////// // positive modifiers first @@ -14831,6 +14844,11 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r modroll = 0; } + // auto pass some things + if (lfhasflag(lf, F_RAGE) && (ct == SC_MORALE)) { + modroll = diff; + } + // natural 20 will pass some checks if (roll == 20) { switch (ct) { diff --git a/move.c b/move.c index b4b389f..9184540 100644 --- a/move.c +++ b/move.c @@ -221,8 +221,17 @@ int celldangerous(lifeform_t *lf, cell_t *cell, int onlyifknown, enum ERROR *err f = hasflag(o->flags, F_DEEPWATER); if (f) { // non swimming creature in water? - if (!isairborne(lf) && (getobdepth(o, lf) >= DP_HEAD)) { - if (getskill(lf, SK_SWIMMING) - isburdened(lf) <= 0) { + if (!isairborne(lf)) { + if ((getobdepth(o, lf) >= DP_HEAD)) { + if (getskill(lf, SK_SWIMMING) - isburdened(lf) <= 0) { + if (error) { + *error = E_AVOIDOB; + rdata = o; + } + return B_TRUE; + } + } + if (isvulnto(lf->flags, DT_WATER, B_FALSE)) { if (error) { *error = E_AVOIDOB; rdata = o; @@ -256,7 +265,7 @@ int celldangerous(lifeform_t *lf, cell_t *cell, int onlyifknown, enum ERROR *err } } - // non-obvious things - only include these if we are smart enough + // non-obvious things - only include these if we are wise enough if (!onlyifknown) { include_nonobvious = B_TRUE; } else { diff --git a/objects.c b/objects.c index 1ea128c..642ae1e 100644 --- a/objects.c +++ b/objects.c @@ -228,7 +228,7 @@ char *ringadjective[] = { long nextoid = 0; -brand_t *addbrand(enum BRAND id, char *suffix, enum BODYPART bp) { +brand_t *addbrand(enum BRAND id, char *suffix, enum BODYPART bp, enum BLESSTYPE blessed, int blesschance) { brand_t *a, *om; char buf[BUFLEN]; //flag_t *f; @@ -257,6 +257,8 @@ brand_t *addbrand(enum BRAND id, char *suffix, enum BODYPART bp) { a->bp = bp; snprintf(buf, BUFLEN, " %s",suffix); a->suffix = strdup(buf); + a->blessed = blessed; + a->blesschance = blesschance; a->flags = addflagpile(NULL, NULL); @@ -1637,6 +1639,9 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes if (brandappliesto(wantbrand, o->type)) { copyflags(o->flags, wantbrand->flags, FROMBRAND); addflag(o->flags, F_HASBRAND, wantbrand->id, NA, NA, NULL); + if (pctchance(wantbrand->blesschance)) { + o->blessed = wantbrand->blessed; + } } } @@ -9430,6 +9435,9 @@ void potioneffects(lifeform_t *lf, enum OBTYPE oid, object_t *o, enum BLESSTYPE } gainlevel(lf, B_TRUE); + break; + case OT_POT_FURY: + abilityeffects(lf, OT_A_RAGE, lf->cell, lf, NULL); break; case OT_POT_GASEOUSFORM: dospelleffects(lf, OT_S_GASEOUSFORM, (potblessed) ? 5 : 1, lf, NULL, lf->cell, potblessed, seen, B_TRUE); @@ -9498,28 +9506,22 @@ void potioneffects(lifeform_t *lf, enum OBTYPE oid, object_t *o, enum BLESSTYPE break; case OT_POT_POLYMORPH: if (potblessed == B_BLESSED) { - // controlled polymorph - dospelleffects(lf, OT_S_POLYMORPH, 5, lf, NULL, lf->cell, potblessed, NULL, B_TRUE); + // controlled polymorph - you can chnage back. + dospelleffects(NULL, OT_S_POLYMORPH, 5, lf, NULL, lf->cell, potblessed, NULL, B_TRUE); } else { // random polymorph - dospelleffects(lf, OT_S_POLYMORPH, 1, lf, NULL, lf->cell, potblessed, NULL, B_TRUE); + dospelleffects(NULL, OT_S_POLYMORPH, 1, lf, NULL, lf->cell, potblessed, NULL, B_TRUE); } break; case OT_POT_RESTORATION: failed = B_TRUE; - if (getattr(lf,A_STR) < lf->baseatt[A_STR]) { - setattr(lf, A_STR, lf->baseatt[A_STR]); - failed = B_FALSE; + for (i = 0; i < MAXATTS; i++ ){ + if (getattr(lf,i) < lf->baseatt[i]) { + setattr(lf, i, lf->baseatt[i]); + failed = B_FALSE; + } } - if (getattr(lf,A_AGI) < lf->baseatt[A_AGI]) { - setattr(lf, A_AGI, lf->baseatt[A_AGI]); - failed = B_FALSE; - } - if (getattr(lf,A_IQ) < lf->baseatt[A_IQ]) { - setattr(lf, A_IQ, lf->baseatt[A_IQ]); - failed = B_FALSE; - } - + // blessed restores hp/mp to full if (potblessed == B_BLESSED) { hpheal = lf->maxhp; mpheal = getmaxmp(lf); @@ -9530,8 +9532,6 @@ void potioneffects(lifeform_t *lf, enum OBTYPE oid, object_t *o, enum BLESSTYPE hpheal = lf->maxhp / 2; mpheal = getmaxmp(lf) / 2; } - - // blessed restores hp/mp to full if (lf->hp < hpheal) { gainhp(lf, hpheal - lf->hp); if (!isplayer(lf) && cansee(player, lf)) { @@ -11362,12 +11362,33 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, spellcloud(srcloc, radius, UNI_SHADELIGHT, C_MAGENTA, OT_S_SLEEP, radius, B_TRUE, buf, "A wispy mist appears!"); } else if (o->type->id == OT_SALT) { if (target && (getcelldist(srcloc, where) <= 1)) { - if (hasbp(target, BP_EYES) && !isblind(target) && !getequippedob(target->pack, BP_EYES)) { + // salt won't work if they're immersed in water + if (lfhasflag(target, F_VULNTOSALT) && + (getcellwaterdepth(target->cell, target) < DP_WAIST)) { + // instakill if (cansee(player, target)) { - msg("%s irritates %s%s eyes!", obname, targetname, getpossessive(targetname)); + msg("%s%s skin sizzles and bubbles!", targetname, getpossessive(targetname)); + } + target->hp = 0; + setlastdam(target, "osmosis"); + setkillverb(target, "Dehydrated"); + } else { + if (hasbp(target, BP_EYES) && + !isblind(target) && + !getequippedob(target->pack, BP_EYES)) { + if (cansee(player, target)) { + msg("%s stings %s%s eyes!", obname, targetname, getpossessive(targetname)); + } + // blind for 5-7 turns + addtempflag(target->flags, F_BLIND, B_TRUE, NA, NA, NULL, rnd(5,10)); + } + if (isbleeding(target)) { + if (cansee(player, target)) { + msg("%s irritates %s%s wounds!", obname, targetname, getpossessive(targetname)); + } + // pain for 3-5 turns + addtempflag(target->flags, F_PAIN, DT_DIRECT, NA, NA, "1d4", rnd(3,5)); } - // blind for 5-7 turns - addtempflag(target->flags, F_BLIND, B_TRUE, NA, NA, NULL, rnd(5,10)); } } else { if (haslos(player, srcloc)) { diff --git a/objects.h b/objects.h index 50ef2ac..08f1970 100644 --- a/objects.h +++ b/objects.h @@ -2,7 +2,7 @@ #define __OBJECTS_H #include "defs.h" -brand_t *addbrand(enum BRAND id, char *suffix, enum BODYPART bp); +brand_t *addbrand(enum BRAND id, char *suffix, enum BODYPART bp, enum BLESSTYPE blessed, int blesschance); object_t *addemptyob(obpile_t *where, object_t *o); hiddenname_t *addhiddenname(enum OBCLASS obclass, char *text); knowledge_t *addknowledge(enum OBCLASS id, char *hiddenname, int known); diff --git a/spell.c b/spell.c index 240a050..a2fbf51 100644 --- a/spell.c +++ b/spell.c @@ -1385,7 +1385,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef losehp(victim, dam, DT_BASH, user, buf); } */ - // both victim and attacker wall + // both victim and attacker fall if (!isdead(victim)) fall(victim, NULL, B_TRUE); fall(user, NULL, B_TRUE); } @@ -7773,8 +7773,8 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ // become the new race! setrace(target, r->id, B_TRUE); - // if someone cast the spell at themself, they can change back at will. - if (target == caster) { + // if someone cast the spell at themself and it's controlled, they can change back at will. + if ((target == caster) && (power >= 5)) { addflag(target->flags, F_CANWILL, OT_A_POLYREVERT, NA, NA, NULL); }