diff --git a/ai.c b/ai.c index 6fee197..7b60379 100644 --- a/ai.c +++ b/ai.c @@ -2248,6 +2248,8 @@ int aispellok(lifeform_t *lf, enum OBTYPE spellid, lifeform_t *victim, enum FLAG specificcheckok = B_FALSE; } else if (!safetorest(lf)) { specificcheckok = B_FALSE; + } else if (lfhasflag(lf, F_PRODUCESLIGHT)) { + specificcheckok = B_FALSE; } } if ((ot->id == OT_S_INVISIBILITY) && lfhasflag(victim, F_INVISIBLE)) { diff --git a/attack.c b/attack.c index 42b6ddb..fc8fdce 100644 --- a/attack.c +++ b/attack.c @@ -245,7 +245,7 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) { attacklfid = c->lf->id; // remember for later if (areallies(lf, attacktarget)) attackedfriend = B_TRUE; - if (!cansee(attacktarget, lf) || isfleeing(attacktarget)) attackedhelpless = B_TRUE; + attackedhelpless = ishelplessvictim(attacktarget, lf, NULL); } else { object_t *o; // has an impassable object? @@ -406,19 +406,12 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) { saysorry = B_TRUE; } - // announce helpless attcaks - if (isplayer(lf) && attackedhelpless) { + // announce attacks from behind which aren't backstabs. + if (isplayer(lf) && attackedhelpless && !willbackstab(lf, victim, wep[i])) { char vname[BUFLEN]; getlfname(victim, vname); if (isbehind(lf, victim)) { msg("You attack %s from behind!", vname); - } else { - char *vn; - // strip "the" from "the xxx" - vn = strdup(vname); - vn = strrep(vn, "the ", "", NULL); - msg("You attack the helpless %s!", vn); - free(vn); } } } @@ -584,6 +577,13 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag) return B_TRUE; } + // if you have somehow attacked someone who was + // hiding (bump into them?) then you have now + // spotted them. + if (ishidingfrom(victim, lf)) { + spot_hiding_lf(lf, victim); + } + // get names getlfname(lf, attackername); @@ -792,18 +792,10 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag) modifyforsize(&dam[0], lf, victim, 5, M_PCT); // backstab? - if ((damtype[0] == DT_PIERCE) && // using a stabbing weapon - getskill(lf, SK_BACKSTAB)) { // able to backstab - if (!lfhasflagval(victim, F_STABBEDBY, lf->id, NA, NA, NULL) ) { // haven't stabbed them before - // && !lfhasflagval(victim, F_TARGETLF, lf->id, NA, NA, NULL)) { // victim isnt attacking us - - if (!cansee(victim, lf) || // victim can't see us - isfleeing(victim)) { - addflag(victim->flags, F_STABBEDBY, lf->id, NA, NA, NULL); - dam[0] *= (getskill(lf, SK_BACKSTAB)); - firstisbackstab = B_TRUE; - } - } + if (willbackstab(lf, victim, wep)) { + addflag(victim->flags, F_STABBEDBY, lf->id, NA, NA, NULL); + dam[0] *= (getskill(lf, SK_BACKSTAB)); + firstisbackstab = B_TRUE; } // target asleep? @@ -1467,7 +1459,7 @@ int attackwall(lifeform_t *lf, cell_t *c, object_t *wep, flag_t *damflag) { for (i = 0; i < ndam; i++) { // announce the hit - construct_hit_string(lf, NULL, attackername, c->type->name, NULL, wep, damtype[i], dam[i], maxhp, i, B_FALSE, B_FALSE, B_FALSE, isunarmed, buf); + construct_hit_string(lf, NULL, attackername, c->type->name, NULL, wep, damtype[i], dam[i], maxhp, i, B_FALSE, B_FALSE, B_FALSE, isunarmed, buf); if (strlen(buf)) { msg("%s", buf); diff --git a/data.c b/data.c index 24dd639..ab96b33 100644 --- a/data.c +++ b/data.c @@ -633,6 +633,7 @@ void initjobs(void) { addflag(lastjob->flags, F_CANLEARN, SK_LORE_ARCANA, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_POLEARMS, PR_ADEPT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_PERCEPTION, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, NA, NA, NULL); // abilities addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); @@ -671,6 +672,7 @@ void initjobs(void) { addflag(lastjob->flags, F_CANLEARN, SK_THIEVERY, PR_ADEPT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_THROWING, PR_SKILLED, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_PERCEPTION, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, NA, NA, NULL); // abilities addflag(lastjob->flags, F_STABILITY, B_TRUE, NA, NA, NULL); addflag(lastjob->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); @@ -690,7 +692,6 @@ void initjobs(void) { // initial objects addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "dagger"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "leather armour"); - addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "50-100 gold coins"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "5 lockpicks"); // initial skills addflag(lastjob->flags, F_STARTSKILL, SK_ATHLETICS, PR_BEGINNER, NA, NULL); @@ -698,24 +699,25 @@ void initjobs(void) { addflag(lastjob->flags, F_STARTSKILL, SK_CLIMBING, PR_BEGINNER, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_STEALTH, PR_BEGINNER, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_LISTEN, PR_BEGINNER, NA, NULL); - addflag(lastjob->flags, F_STARTSKILL, SK_BACKSTAB, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_BACKSTAB, PR_NOVICE, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_LOCKPICKING, PR_BEGINNER, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_SHORTBLADES, PR_NOVICE, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_SPEECH, PR_NOVICE, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_THIEVERY, PR_BEGINNER, NA, NULL); + addflag(lastjob->flags, F_STARTSKILL, SK_THROWING, PR_NOVICE, NA, NULL); addflag(lastjob->flags, F_STARTSKILL, SK_LORE_HUMANOID, PR_BEGINNER, NA, NULL); // learnable skills addflag(lastjob->flags, F_CANLEARN, SK_CHANNELING, PR_SKILLED, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_COOKING, NA, NA, NULL); - addflag(lastjob->flags, F_CANLEARN, SK_SPEECH, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_SEWING, NA, NA, NULL); // addflag(lastjob->flags, F_CANLEARN, SK_SHORTBLADES, PR_SKILLED, NA, NULL); // addflag(lastjob->flags, F_CANLEARN, SK_STAVES, PR_ADEPT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_SWIMMING, NA, NA, NULL); - addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, PR_EXPERT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, NA, NA, NULL); - addflag(lastjob->flags, F_CANLEARN, SK_PERCEPTION, PR_SKILLED, NA, NULL); - addflag(lastjob->flags, F_CANLEARN, SK_THROWING, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_TWOWEAPON, PR_EXPERT, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, PR_EXPERT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_SS_DIVINATION, PR_ADEPT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_SS_GRAVITY, PR_BEGINNER, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_SS_MODIFICATION, PR_BEGINNER, NA, NULL); @@ -767,6 +769,7 @@ void initjobs(void) { addflag(lastjob->flags, F_CANLEARN, SK_POLEARMS, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_STAVES, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, NA, NA, NULL); + addflag(lastjob->flags, F_CANLEARN, SK_TECHUSAGE, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_THROWING, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_TWOWEAPON, NA, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_LORE_DRAGONS, PR_ADEPT, NA, NULL); @@ -997,6 +1000,8 @@ void initobjects(void) { addflag_real(lastbrand->flags, F_ARMOURIGNORE, B_TRUE, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); 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_PROTECTION, "of protection", BP_WEAPON, B_UNCURSED, 0); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ARBOOST, 10, NA, NULL, PERMENANT, B_UNKNOWN, -1); addbrand(BR_REFLECTION, "of reflection", BP_SECWEAPON, B_UNCURSED, 0); addflag_real(lastbrand->flags, F_ONLYFOROBWITHFLAG, F_SHIELD, NA, NA, NULL, PERMENANT, B_UNKNOWN, -1); @@ -5301,7 +5306,7 @@ void initobjects(void) { addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 5, 5, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_DTRESIST, DT_COLD, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 80, NA, NA, NULL); // armour - body @@ -5324,7 +5329,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 33, NA, NA, NULL); addot(OT_ARMOURDEMON, "demonskin vest", "Body armour created by flaying the flesh from a living demon, it retains its innate immunity to fire.", MT_FLESH, 7, OC_ARMOUR, SZ_MEDIUM); @@ -5335,7 +5340,7 @@ void initobjects(void) { addflag(lastot->flags, F_EQUIPCONFER, F_DTIMMUNE, DT_FIRE, NA, NULL); addflag(lastot->flags, F_DTIMMUNE, DT_FIRE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 80, NA, NA, NULL); addflag(lastot->flags, F_STARTBLESSED, B_CURSED, NA, NA, NULL); addot(OT_ARMOURLEATHER, "leather armour", "Body armour created from soft leather.", MT_LEATHER, 10, OC_ARMOUR, SZ_MEDIUM); @@ -5345,7 +5350,7 @@ void initobjects(void) { addflag(lastot->flags, F_ARMOURRATING, 4, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 10, 10, NULL); addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 95, NA, NA, NULL); addot(OT_ARMOURRING, "suit of ring mail", "Body armour formed by a series of metallic rings sewn to a leather foundation.", MT_METAL, 15, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); @@ -5353,7 +5358,7 @@ void initobjects(void) { addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 6, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 20, 20, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 35, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 35, NA, NULL); addflag(lastot->flags, F_OBHP, 30, 30, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); addot(OT_ARMOURSCALE, "suit of scale armour", "Body armour consisting of many small scales attached to leather.", MT_METAL, 20, OC_ARMOUR, SZ_MEDIUM); @@ -5362,7 +5367,7 @@ void initobjects(void) { addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 10, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 30, 30, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 45, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 45, NA, NULL); addflag(lastot->flags, F_OBHP, 35, 35, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); addot(OT_ARMOURCHAIN, "suit of chainmail", "Heavy body armour consisting of tightly meshed metal rings.", MT_METAL, 25, OC_ARMOUR, SZ_MEDIUM); @@ -5371,7 +5376,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 15, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 40, 40, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 45, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 45, NA, NULL); addflag(lastot->flags, F_OBHP, 45, 45, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); addot(OT_ARMOURSPLINT, "suit of splint mail", "Heavy armour, consisting of strips of metal attached to a leather backing.", MT_METAL, 35, OC_ARMOUR, SZ_MEDIUM); @@ -5380,7 +5385,7 @@ void initobjects(void) { addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 20, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 50, 50, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 55, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 55, NA, NULL); addflag(lastot->flags, F_OBHP, 50, 50, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); addot(OT_ARMOURPLATE, "suit of plate mail", "Heavy armour with embedded metal plates.", MT_METAL, 40, OC_ARMOUR, SZ_MEDIUM); @@ -5389,7 +5394,7 @@ void initobjects(void) { addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 25, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 60, 60, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, NA, NULL); addflag(lastot->flags, F_OBHP, 60, 60, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); @@ -5399,7 +5404,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 10, 10, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 50, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 50, NA, NULL); addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); addot(OT_OVERALLS, "pair of overalls", "Well-made, brightly coloured workman overalls.", MT_CLOTH, 1, OC_ARMOUR, SZ_MEDIUM); @@ -5407,7 +5412,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 35, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 35, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 85, NA, NA, NULL); addot(OT_SILKSHIRT, "silk shirt", "A lightweight, comfortable white silk shirt.", MT_SILK, 0.5, OC_ARMOUR, SZ_MEDIUM); @@ -5417,7 +5422,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 50, NA, NA, NULL); addot(OT_ROBE, "robe", "A plain robe.", MT_CLOTH, 4, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); @@ -5464,7 +5469,7 @@ void initobjects(void) { addot(OT_BELTLEATHER, "leather belt", "A plain leather belt.", MT_LEATHER, 0.2, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_WAIST, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); // armour - legs addot(OT_CLOTHTROUSERS, "pair of cloth trousers", "A rough pair of cloth trousers.", MT_CLOTH, 2, OC_ARMOUR, SZ_MEDIUM); @@ -5474,7 +5479,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 60, NA, NA, NULL); addot(OT_RIDINGTROUSERS, "pair of riding trousers", "A fitted pair of leather trousers.", MT_LEATHER, 2, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); @@ -5483,7 +5488,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 75, NA, NA, NULL); addot(OT_COMBATPANTS, "pair of combat pants", "An lightly-armoured pair of camoflauged trousers.", MT_CLOTH, 2, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); @@ -5491,7 +5496,7 @@ void initobjects(void) { addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 3, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 90, NA, NA, NULL); addot(OT_GREAVES, "set of greaves", "A set of heavy metal greaves.", MT_METAL, 4, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_UNCOMMON, NULL); @@ -5500,8 +5505,8 @@ void initobjects(void) { addflag(lastot->flags, F_ARMOURRATING, 4, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 25, 25, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 15, 15, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 45, 0, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 45, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); // armour - feet addot(OT_SANDALS, "pair of sandals", "Comfortable pair of open leather sandals.", MT_LEATHER, 1, OC_ARMOUR, SZ_SMALL); @@ -5519,7 +5524,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 35, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 35, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 85, NA, NA, NULL); addot(OT_BOOTSRUBBER, "pair of rubber boots", "A waterproof (but somewhat cumbersome) pair of rubber boots.", MT_RUBBER, 6, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_UNCOMMON, NULL); @@ -5529,7 +5534,7 @@ void initobjects(void) { addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 0, 5, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_DTRESIST, DT_ELECTRIC, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 95, NA, NA, NULL); addot(OT_BOOTSSPIKED, "pair of spiked boots", "A plain pair of leather boots with spikes on the bottom.", MT_LEATHER, 3, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_RARE, NULL); @@ -5538,7 +5543,7 @@ void initobjects(void) { addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_STABILITY, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 35, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 35, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 90, NA, NA, NULL); addot(OT_BOOTSLEATHER, "pair of leather boots", "A stout pair of leather boots.", MT_LEATHER, 4, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); @@ -5547,7 +5552,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 35, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 35, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 90, NA, NA, NULL); addot(OT_BOOTSMETAL, "pair of metal boots", "A strong pair of metal boots.", MT_METAL, 5, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_UNCOMMON, NULL); @@ -5556,7 +5561,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 20, 20, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 35, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 35, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); // armour - gloves addot(OT_GLOVESCLOTH, "pair of cloth gloves", "A pair of soft cloth gloves.", MT_CLOTH, 0.15, OC_ARMOUR, SZ_SMALL); @@ -5566,7 +5571,7 @@ void initobjects(void) { addflag(lastot->flags, F_GOESON, BP_HANDS, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 0, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 70, NA, NA, NULL); addot(OT_GLOVESLEATHER, "pair of leather gloves", "A pair of coarse leather gloves.", MT_LEATHER, 0.25, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); @@ -5574,7 +5579,7 @@ void initobjects(void) { addflag(lastot->flags, F_MULTISIZE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 1, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 90, NA, NA, NULL); addot(OT_GAUNTLETS, "pair of gauntlets", "A durable pair of metal gauntlets.", MT_METAL, 2, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_COMMON, NULL); @@ -5583,7 +5588,7 @@ void initobjects(void) { addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_ARMOURPENALTY, 10, 5, NULL); addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 15, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 15, NA, NULL); addflag(lastot->flags, F_CRITPROTECTION, 100, NA, NA, NULL); // armour - head addot(OT_SUNHAT, "sun hat", "Wide-brimmed hat made for working in the sun.", MT_CLOTH, 1, OC_ARMOUR, SZ_SMALL); @@ -6177,7 +6182,7 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 45, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 45, 65, "10"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addot(OT_BATTLEAXE, "battleaxe", "An large axe specifically designed for combat.", MT_METAL, 8, OC_WEAPON, SZ_MEDIUM); @@ -6189,7 +6194,7 @@ void initobjects(void) { addflag(lastot->flags, F_ARMOURPIERCE, 4, NA, NA, ""); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, 75, "10"); addot(OT_GREATAXE, "greataxe", "An enormous axe made designed for combat.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 50, NA, NULL); @@ -6201,7 +6206,7 @@ void initobjects(void) { addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 75, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 75, 80, "15"); addot(OT_HANDAXE, "hand axe", "A fast one-handed axe, ideal for throwing.", MT_METAL, 2.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); @@ -6211,7 +6216,7 @@ void initobjects(void) { addflag(lastot->flags, F_MISSILEDAM, 5, NA, NA, NULL); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 35, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 35, 55, "5"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addot(OT_HATCHET, "hatchet", "Similar to a handaxe but weighted at the head. A fast one-handed axe, ideal for throwing.", MT_METAL, 4, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); @@ -6221,7 +6226,7 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 40, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 40, 60, "5"); addflag(lastot->flags, F_CRITCHANCE, 6, NA, NA, NULL); addot(OT_WARAXE, "war axe", "An axe made for combat.", MT_METAL, 7, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); @@ -6231,7 +6236,7 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_BASH, 5, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_AXES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 55, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 55, 75, "10"); // short blades addot(OT_COMBATKNIFE, "combat knife", "A sharp knife designed for military use.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); @@ -6255,7 +6260,7 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 4, NA, NULL); addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 40, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 40, 60, "10"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_DAGGER, "dagger", "A short stabbing weapon with a pointed blade.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); @@ -6273,6 +6278,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 10, NA, NULL); addflag(lastot->flags, F_CANBEDIFFMAT, MT_BONE, 10, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, NA, 65, "10"); addot(OT_FORK, "fork", "A common kitchen fork.", MT_METAL, 0.2, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); @@ -6280,6 +6286,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_PIERCE, 2, NA, NULL); addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, NA, 65, "10"); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addot(OT_KNIFE, "knife", "A moderately sharp stabbing tool.", MT_METAL, 0.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); @@ -6293,6 +6300,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 5, 5, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, NA, 65, "10"); addot(OT_MEATCLEAVER, "meat cleaver", "A short, heavy kitchen knife. Not very accurate but its weight makes it capable of dealing critical blows.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 100, NA, NULL); @@ -6300,6 +6308,8 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 15, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 30, NA, "15"); + addflag(lastot->flags, F_ATTREQ, A_AGI, NA, 65, "10"); addot(OT_ORNDAGGER, "ornamental dagger", "This dagger is pretty, but not particularly effective.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 50, NA, NULL); @@ -6310,6 +6320,7 @@ void initobjects(void) { addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_PICKLOCKS, 7, B_BLUNTONFAIL, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, NA, 65, "10"); addot(OT_QUICKBLADE, "quickblade", "A short blade of exceptional quality and balance, it allows its bearar to attack faster than would seem possible.", MT_METAL, 3.0, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 73, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 73, NA, NULL); @@ -6320,6 +6331,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, NA, 75, "10"); addot(OT_RAPIER, "rapier", "A long, narrow French sword lacking a cutting edge. Made for stabbing.", MT_METAL, 3.5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 80, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 80, NA, NULL); @@ -6327,7 +6339,7 @@ void initobjects(void) { addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 30, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 30, 50, "10"); addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_PIERCE, NA, NA, NULL); addot(OT_SHORTSWORD, "gladius", "A short gladiator blade. Designed for stabbing rather than slashing.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); @@ -6337,7 +6349,7 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_SLASH, 6, NA, NULL); addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 30, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 30, 50, "5"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 5, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6373,7 +6385,7 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, 80, "10"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 5, NA, NULL); addot(OT_FALCHION, "falchion", "A single-edged heavy sword made for chopping.", MT_METAL, 6.5, OC_WEAPON, SZ_MEDIUM); @@ -6383,7 +6395,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_CHOP, 11, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, 85, "10"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addot(OT_GREATSWORD, "greatsword", "A massive two-handed sword.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 55, NA, NULL); @@ -6396,7 +6408,7 @@ void initobjects(void) { addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 75, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 75, 90, "3"); addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); addot(OT_LONGSWORD, "longsword", "Standard issue long slashing weapon.", MT_METAL, 5, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); @@ -6405,7 +6417,7 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_PIERCE, 9, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 50, 3, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 50, 70, "3"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 5, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); @@ -6425,7 +6437,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_SLASH, 8, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_LONGBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 40, 3, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 40, 60, "3"); addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6440,7 +6452,7 @@ void initobjects(void) { addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, 85, "5"); addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addot(OT_GUISARME, "guisarme", "A hooked polearm, made by attaching a hook to a spear shaft.", MT_METAL, 10, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); @@ -6453,8 +6465,8 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_BASH, 6, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 1, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 35, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, 80, "1"); + addflag(lastot->flags, F_ATTREQ, A_AGI, 35, 55, "5"); addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addot(OT_HALBERD, "halberd", "A spiked axe blade mounted on a long shaft, with a hook on the back.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 71, NA, NULL); @@ -6468,8 +6480,8 @@ void initobjects(void) { addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 35, 10, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 45, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 35, 55, "10"); + addflag(lastot->flags, F_ATTREQ, A_AGI, 45, 65, "5"); addflag(lastot->flags, F_CRITCHANCE, 2, NA, NA, NULL); addot(OT_LANCE, "lance", "A pole weapon designed for use while mounted.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); @@ -6481,7 +6493,7 @@ void initobjects(void) { addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_THRUST, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 80, "10"); addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addot(OT_RANSEUR, "ranseur", "A long spear and cross hilt, resembling a pole-mounted sai. Good for disarming.", MT_METAL, 12, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 67, NA, NULL); @@ -6494,8 +6506,8 @@ void initobjects(void) { addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_THRUST, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 45, 1, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 45, 65, "1"); + addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 80, "5"); addot(OT_SCYTHE, "scythe", "An agricultural hand tool for mowing grass, or reaping crops.", MT_METAL, 6, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); @@ -6504,7 +6516,7 @@ void initobjects(void) { addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 45, 3, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 45, 65, "3"); addot(OT_SPEAR, "spear", "A long pole with a sharpened head.", MT_METAL, 9, OC_WEAPON, SZ_HUMAN); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 75, NA, NULL); @@ -6517,7 +6529,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OBHP, 15, 15, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 70, "5"); addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addot(OT_TRIDENT, "trident", "A three-pronged stabbing weapon.", MT_METAL, 5, OC_WEAPON, SZ_HUMAN); @@ -6527,7 +6539,7 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_BASH, 4, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 55, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 55, 75, "10"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6540,7 +6552,7 @@ void initobjects(void) { addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 60, "15"); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6553,7 +6565,7 @@ void initobjects(void) { addflag(lastot->flags, F_NEEDSSPACE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 60, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 60, 70, "15"); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6567,7 +6579,7 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 75, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 75, 85, "15"); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6581,8 +6593,8 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_STAVES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 60, 10, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 60, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 60, 70, "10"); + addflag(lastot->flags, F_ATTREQ, A_AGI, 60, 70, "10"); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 8, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6597,7 +6609,7 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_LORE_ARCANA, NA, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_IQ, 50, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_IQ, 50, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch"); addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); @@ -6611,7 +6623,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_LORE_ARCANA, NA, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_MAGICBOOST, 1, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_IQ, 60, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_IQ, 60, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch"); addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); @@ -6625,7 +6637,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_LORE_ARCANA, NA, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_MAGICBOOST, 2, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_IQ, 70, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_IQ, 70, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch"); addot(OT_WIZARDSTAFF4, "spellbinder staff", "A twisted branch of wood.", MT_DRAGONWOOD, 4, OC_WEAPON, SZ_HUMAN); @@ -6638,7 +6650,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_LORE_ARCANA, NA, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_MAGICBOOST, 3, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_IQ, 80, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_IQ, 80, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch"); addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); @@ -6652,7 +6664,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_LORE_ARCANA, NA, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_MAGICBOOST, 4, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_IQ, 85, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_IQ, 85, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch"); addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); @@ -6666,7 +6678,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_LORE_ARCANA, NA, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_EQUIPCONFER, F_MAGICBOOST, 5, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_IQ, 90, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_IQ, 90, NA, NULL); addflag(lastot->flags, F_HASHIDDENNAME, B_TRUE, NA, NA, "twisted branch"); addflag(lastot->flags, F_NOQUALITY, B_TRUE, NA, NA, NULL); @@ -6677,7 +6689,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_BASH, 6, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 50, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 50, 60, "10"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 110, NA, NA, NULL); addot(OT_FLAIL, "flail", "A flexible chain attached to a heavy weight.", MT_METAL, 9, OC_WEAPON, SZ_MEDIUM); @@ -6686,8 +6698,8 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_BASH, 8, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 50, 10, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 50, 60, "10"); + addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 70, "5"); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 125, NA, NA, NULL); addot(OT_FLAILHEAVY, "heavy flail", "A flexible chain attached to a very heavy weight.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); @@ -6697,8 +6709,8 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_BASH, 10, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 70, 10, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 5, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 70, 80, "10"); + addflag(lastot->flags, F_ATTREQ, A_AGI, 50, NA, "5"); addflag(lastot->flags, F_CRITCHANCE, 8, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 125, NA, NA, NULL); addot(OT_GREATCLUB, "great club", "An enormous, very heavy, blunt instrument to hit things with.", MT_STONE, 15, OC_WEAPON, SZ_MEDIUM); @@ -6709,7 +6721,7 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 75, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 75, 85, "10"); addot(OT_MACE, "mace", "A weapon with a heavy head on a solid shaft used to bludgeon opponents.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); addflag(lastot->flags, F_RARITY, H_CAVE, 90, NA, NULL); @@ -6717,7 +6729,7 @@ void initobjects(void) { addflag(lastot->flags, F_ARMOURPIERCE, 4, NA, NA, ""); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 60, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 60, 80, "10"); addflag(lastot->flags, F_CRITCHANCE, 7, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 125, NA, NA, NULL); addot(OT_MORNINGSTAR, "morningstar", "A heavy, spiked mace. Its weight makes it good for penetrating armour.", MT_METAL, 12, OC_WEAPON, SZ_MEDIUM); @@ -6729,7 +6741,7 @@ void initobjects(void) { addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 10, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, 75, "10"); addflag(lastot->flags, F_CRITCHANCE, 8, NA, NA, NULL); addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); addot(OT_SPANNER, "spanner", "A long, heavy metal wrench.", MT_METAL, 1, OC_WEAPON, SZ_MEDIUM); @@ -6768,7 +6780,7 @@ void initobjects(void) { addflag(lastot->flags, F_ALTDAM, DT_BASH, 3, NA, NULL); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_EXOTICWEPS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 60, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 60, 70, "15"); addflag(lastot->flags, F_CRITCHANCE, 10, NA, NA, NULL); addflag(lastot->flags, F_CANBEDIFFMAT, MT_SILVER, 5, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); @@ -6780,7 +6792,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_BASH, 7, NA, NULL); addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_EXOTICWEPS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 75, "15"); addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); addot(OT_SAI, "sai", "A dagger with two long prongs on either side, made to trap opponents' weapons.", MT_METAL, 1.5, OC_WEAPON, SZ_SMALL); @@ -6790,7 +6802,7 @@ void initobjects(void) { addflag(lastot->flags, F_EQUIPCONFER, F_CANWILL, OT_A_DISARMLF, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_EXOTICWEPS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 15, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 50, 60, "15"); addflag(lastot->flags, F_CANBLOCK, DT_SLASH, NA, NA, NULL); // projectile weapons @@ -6805,7 +6817,7 @@ void initobjects(void) { addflag(lastot->flags, F_AMMOOB, OT_ARROW, NA, NA, NULL); addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); addflag(lastot->flags, F_RELOADTURNS, 1, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 45, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 45, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addot(OT_CROSSBOW, "crossbow", "A standard crossbow. Very powerful, but slow to reload and needs high strength to use.", MT_WOOD, 8, OC_WEAPON, SZ_MEDIUM); @@ -6819,7 +6831,7 @@ void initobjects(void) { addflag(lastot->flags, F_AMMOOB, OT_BOLT, NA, NA, NULL); addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); addflag(lastot->flags, F_RELOADTURNS, 2, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 75, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 75, NA, NULL); addot(OT_CROSSBOWHAND, "hand crossbow", "A small wrist-mounted crossbow. Less powerful and accurate than its full-sized sibling, the hand crossbow's primary strength is its ability to fire multiple shots before reloading.", MT_WOOD, 3, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 75, NA, NULL); @@ -6844,7 +6856,7 @@ void initobjects(void) { addflag(lastot->flags, F_AMMOOB, OT_ARROW, NA, NA, NULL); addflag(lastot->flags, F_AMMOCAPACITY, 1, NA, NA, NULL); addflag(lastot->flags, F_RELOADTURNS, 1, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_STR, 65, 0, NULL); + addflag(lastot->flags, F_ATTREQ, A_STR, 65, NA, NULL); addot(OT_REVOLVER, "revolver", "Basic one-handed firearm.", MT_METAL, 1, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 60, NA, NULL); @@ -7591,8 +7603,8 @@ void initrace(void) { addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "giving away or discarding money"); addflag(lastrace->flags, F_GODDISLIKES, NA, NA, NA, "opening locked objects through force"); // sacrifices (piety val will be overridden with value) - addflag(lastrace->flags, F_SACRIFICEOBCLASS, OC_MONEY, NA, 2, "OB IS consumed in a swirl of shadowy blackness"); - addflag(lastrace->flags, F_SACRIFICEOBWITHFLAG, F_GEM, NA, 2, "OB IS consumed in a swirl of shadowy blackness"); + addflag(lastrace->flags, F_SACRIFICEOBCLASS, OC_MONEY, NA, 2, "OB IS consumed in a swirl of shadowy blackness."); + addflag(lastrace->flags, F_SACRIFICEOBWITHFLAG, F_GEM, NA, 2, "OB IS consumed in a swirl of shadowy blackness."); addrace(R_GODDEATH, "Hecta", 100, '@', C_BOLDMAGENTA, MT_BONE, RC_GOD, "The skeletal god of death is garbed in a cloak made of pure shadow. and weilds an enormous scythe."); @@ -9062,7 +9074,6 @@ void initrace(void) { addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); - addflag(lastrace->flags, F_ENHANCESMELL, 3, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, 3, NA, NULL); @@ -9327,7 +9338,7 @@ void initrace(void) { addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); - addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_TREMORSENSE, 2, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_FLY, 1, NA, "^flapping wings"); addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 2, NA, NA, NULL); @@ -9710,7 +9721,6 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_TEETH, 2, NA, NULL); addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); - addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); @@ -9741,7 +9751,6 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 3, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, 3, NA, NULL); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); - addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); @@ -9771,7 +9780,6 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 6, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, 7, NA, NULL); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); - addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); @@ -9797,7 +9805,6 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 11, NA, NULL); addflag(lastrace->flags, F_EXTRADAM, DT_COLD, NA, NA, "1d6"); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); - addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); @@ -9892,7 +9899,6 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_TEETH, 2, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, 3, NA, NULL); addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); - addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL); @@ -11057,7 +11063,7 @@ void initrace(void) { addflag(lastrace->flags, F_NUMAPPEAR, 1, 3, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); - addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+4"); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); addflag(lastrace->flags, F_ARMOURRATING, 5, NA, NA, NULL); addflag(lastrace->flags, F_EVASION, -10, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_SLOW, NA, NA, NULL); @@ -11564,9 +11570,9 @@ void initskills(void) { addskilldesc(SK_PERCEPTION, PR_EXPERT, "^gYou can now move without leaving footprints.^n", B_TRUE); addskilldesc(SK_PERCEPTION, PR_MASTER, "^gYou now have perception of your blind spots.^n", B_TRUE); addskill(SK_STEALTH, "Stealth", "Affects your ability to move silently.", 0); // untrainable? - addskilldesc(SK_STEALTH, PR_BEGINNER, "^gYou gain the 'hide' ability.^n", B_FALSE); + addskilldesc(SK_STEALTH, PR_NOVICE, "^gYou gain the 'hide' ability.^n", B_FALSE); + addskilldesc(SK_STEALTH, PR_BEGINNER, "^gYou can now move while hiding.^n", B_TRUE); addskilldesc(SK_STEALTH, PR_SKILLED, "^gYou can now peek down staircases.^n", B_TRUE); - addskilldesc(SK_STEALTH, PR_EXPERT, "^gYou can now hide even when monsters are nearby.^n", B_TRUE); addskill(SK_SWIMMING, "Swimming", "Allows you to safely swim through deep water.", 50); addskilldesc(SK_SWIMMING, PR_NOVICE, "^gYou can now swim.^n", B_TRUE); addskilldesc(SK_SWIMMING, PR_BEGINNER, "^gYou can now swim a bit faster.^n", B_TRUE); diff --git a/data/hiscores.db b/data/hiscores.db index 579f9de..a27c465 100644 Binary files a/data/hiscores.db and b/data/hiscores.db differ diff --git a/defs.h b/defs.h index 6e0bb17..19e2a2b 100644 --- a/defs.h +++ b/defs.h @@ -636,6 +636,12 @@ enum BURDENED { BR_OVERLOADED = 3, }; +enum HELPLESSTYPE { + HL_NONE = 0, + HL_CANTSEE = 1, + HL_FLEEING = 2, +}; + enum LFCONDITION { C_DEAD = 0, @@ -2324,8 +2330,15 @@ enum FLAG { F_CANHAVEOBMOD, // weapon can have obmod om_v0 applied // optional: v1 is chance of randomly having it F_ATTREQ, // requires attrib v0 to be at least v1 - // can adjust dam or tohit by up to (v2*10)% if you are - // too low or extra high. + // v2 = "boostlev" + // text = scalepct. + // if attrib is less than v1, apply "scalepct" % penalty + // per 10 points under. + // if v2 != NA, and attrib is >= v2, apply "scalepct"% bonus + // per 10 points over. + // (up to a max of 20 points higher/lower) + // + // if scalepct == 0, then you MUST meet the base req. //F_DAMTYPE, // val0 = damage type F_CRITCHANCE, // v0 = %chance of critical hit with this weapon F_CRITPROTECTION, // v0 = %chance of preventing critical hits @@ -2447,6 +2460,12 @@ enum FLAG { F_DONEDARKMSG, // tells the game not to say 'it is very dark here' F_DONELISTEN, // supress further 'you hear xx' messages this turn. // lifeform flags / lf flags / monster flags + + F_ARBOOST, // modify lf's armour rating by v0 + // this is slightly different from f_armourrating. + // f_armourrating is used for innate armour. + // f_arboost is used by objects "of protection" which + // enhance your armour rating. F_DONEKNOWLEDGETRADE, // you've already traded knowledge with this // person. F_FOLLOWTIME, // v0 = how long will ai chase you for? defaults to @@ -2521,7 +2540,7 @@ enum FLAG { F_HOMELEVOB, // when this monster is auto generated on a level, place // between v0 and v1 objects of type 'text' somewhere on // the level. - F_SNEAK, // moving slowly on purpose to avoid slipping. + F_CAREFULMOVE, // moving slowly on purpose to avoid slipping. F_AUTOCMD, // val0 = how many times to repeat this F_LASTCMD, // text[0] = last command performed, v0/1 = x/y of cell, v2=various F_WILLTHROW, // this lf will treat obid v0 as a thrown missile. @@ -3877,6 +3896,7 @@ enum BRAND { BR_KNOWLEDGE, BR_LEVITATION, BR_LIFESUCK, + BR_PROTECTION, BR_FEATHERFALL, BR_ANTIMAG, BR_CONCEALMENT, diff --git a/flag.c b/flag.c index 180a658..aaf2155 100644 --- a/flag.c +++ b/flag.c @@ -604,6 +604,7 @@ int flagcausesstatredraw(lifeform_t *lf, enum FLAG fid) { switch (fid) { case F_ASLEEP: + case F_ARBOOST: case F_ATTRMOD: case F_BLIND: case F_CLIMBING: diff --git a/god.c b/god.c index ba359dd..ffed34e 100644 --- a/god.c +++ b/god.c @@ -758,6 +758,7 @@ int godisangry(enum RACE rid) { void godsay(enum RACE rid, int says, char *format, ...) { lifeform_t *god; char godname[BUFLEN], buf[BUFLEN]; + char voiceverb[BUFLEN]; va_list args; va_start(args, format); @@ -767,8 +768,24 @@ void godsay(enum RACE rid, int says, char *format, ...) { god = findgod(rid); real_getlfname(god, godname, B_FALSE, B_FALSE); + switch (rid) { + case R_GODDEATH: + strcpy(voiceverb, "grates against your mind"); + break; + case R_GODTHIEVES: + strcpy(voiceverb, "whispers in your ear"); + break; + case R_GODMERCY: + strcpy(voiceverb, "washes over you"); + break; + case R_GODPURITY: + default: + strcpy(voiceverb, "booms out from the heavens"); + break; + } + if (says) { - msg("%s%s voice booms out from the heavens:", godname, getpossessive(godname)); more(); + msg("%s%s voice %s:", godname, getpossessive(godname), voiceverb); more(); } msg("\"%s\"", buf); } @@ -955,20 +972,38 @@ int prayto(lifeform_t *lf, lifeform_t *god) { // teleport away msg("\"Nothing like a quick getaway!\""); dospelleffects(NULL, OT_S_DISPERSAL, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_FALSE); + donesomething = B_TRUE; } else { - // steal from your enemies - for (l = lf->cell->map->lf ; l ; l = l->next) { - if ((l != lf) && lfhasflagval(l, F_TARGETLF, lf->id, NA, NA, NULL)) { - object_t *wep; - // confiscate their weapon - wep = getweapon(l); - if (wep) { - if (!donesomething) { - msg("\"I'll take that...\""); - donesomething = B_TRUE; + int redo = B_TRUE; + while (redo) { + redo = B_FALSE; + switch (rnd(1,2)) { + case 1: + // steal from your enemies + for (l = lf->cell->map->lf ; l ; l = l->next) { + if ((l != lf) && lfhasflagval(l, F_TARGETLF, lf->id, NA, NA, NULL)) { + object_t *wep; + // confiscate their weapon + wep = getweapon(l); + if (wep) { + if (!donesomething) { + msg("\"I'll take that...\""); + donesomething = B_TRUE; + } + castspell(god, OT_S_CONFISCATE, l, wep, l->cell, NULL, NULL); + } + } } - castspell(god, OT_S_CONFISCATE, l, wep, l->cell, NULL, NULL); - } + break; + case 2: + if (lfhasflag(lf, F_INVISIBLE)) { + redo = B_TRUE; + } else { + // invisibility + msg("\"Can't hurt what you can't see...\""); + addtempflag(lf->flags, F_INVISIBLE, B_TRUE, NA, NA, NULL, 20); + } + break; } } } diff --git a/io.c b/io.c index 1bdd71c..f897842 100644 --- a/io.c +++ b/io.c @@ -797,7 +797,7 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src } else if (rating >= 0.125) { snprintf(dangerbuf, BUFLEN, "dangerous"); } else { - snprintf(dangerbuf, BUFLEN, "very dangerous"); + snprintf(dangerbuf, BUFLEN, "extremely dangerous"); } if (strlen(extrainfo)) strcat(extrainfo, ", "); strcat(extrainfo, dangerbuf); @@ -1201,6 +1201,12 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { } switch (f->id) { + case F_ARBOOST: + if (isplayer(lf)) { + msg("You feel %s!", (f->val[0] >= 0) ? "protected" : "vulnerable"); + donesomething = B_TRUE; + } + break; case F_ATTRMOD: switch (f->val[0]) { case A_STR: @@ -1860,6 +1866,12 @@ int announceflagloss(lifeform_t *lf, flag_t *f) { return B_FALSE; } switch (f->id) { + case F_ARBOOST: + if (isplayer(lf)) { + msg("You no longer feel so %s.", (f->val[0] >= 0) ? "protected" : "vulnerable"); + donesomething = B_TRUE; + } + break; case F_ATTRMOD: switch (f->val[0]) { case A_STR: @@ -5743,6 +5755,10 @@ char *makedesc_ob(object_t *o, char *retbuf) { sprintf(buf2, "%s obscures your identity.\n", buf); strncat(retbuf, buf2, HUGEBUFLEN); break; + case F_ARBOOST: + sprintf(buf2, "%s %s your Armour Rating.\n", buf, (f->val[0] >= 0) ? "increases" : "decreases"); + strncat(retbuf, buf2, HUGEBUFLEN); + break; case F_ATTRMOD: sprintf(buf2, "%s %s your %s.\n", buf, (f->val[2] > 0) ? "increases" : "decreases", getattrname(f->val[1])); strncat(retbuf, buf2, HUGEBUFLEN); @@ -6062,25 +6078,52 @@ char *makedesc_ob(object_t *o, char *retbuf) { } else { col = C_GREY; } - sprintf(buf, "^%dIt requires at least %d %s to use%s.^n\n", col, f->val[1], getattrname(f->val[0]), - (f->val[2] == 0) ? "" : " effectively"); + if (f->val[1] != NA) { + sprintf(buf, "^%dIt requires at least %d %s to use%s.", col, f->val[1], getattrname(f->val[0]), + strlen(f->text) ? " effectively" : ""); + if (f->val[2] != NA) { + char bbuf[BUFLEN]; + sprintf(bbuf, " (bonus at %d)", f->val[2]); + strcat(buf, bbuf); + } + } + if (f->val[2] != NA) { + sprintf(buf, "^nIt can be used more effectively with at least %d %s.\n", f->val[2], getattrname(f->val[0])); + } + strcat(buf, "^n\n"); strncat(retbuf, buf, HUGEBUFLEN); if (usable && isweapon(o)) { if (pctmod > 0) { - sprintf(buf, "^%dYour high %s will increase your %s with this weapon by %d%s.^n\n", + char howmuch[BUFLEN]; + if ((f->val[0] == A_AGI) && (pctmod < 5)) { + sprintf(howmuch, "fractionally"); + } else { + sprintf(howmuch, "by %d%s", + (f->val[0] == A_AGI) ? getaccuracynum(100 + pctmod) : pctmod, + (f->val[0] == A_AGI) ? "" : "%"); + } + sprintf(buf, "^%dYour high %s will increase your %s with this weapon %s.^n\n", C_GREEN, getattrname(f->val[0]), (f->val[0] == A_AGI) ? "accuracy" : "damage", - (f->val[0] == A_AGI) ? getaccuracynum(100 + pctmod) : pctmod, - (f->val[0] == A_AGI) ? "" : "%"); + howmuch); + strncat(retbuf, buf, HUGEBUFLEN); } else if (pctmod < 0) { - sprintf(buf, "^%dYour low %s will decrease your %s with this weapon by %d%s.^n\n", C_BROWN, + char howmuch[BUFLEN]; + if ((f->val[0] == A_AGI) && (pctmod > -5)) { + sprintf(howmuch, "fractionally"); + } else { + sprintf(howmuch, "by %d%s", + (f->val[0] == A_AGI) ? getaccuracynum(100 + abs(pctmod)) : abs(pctmod), + (f->val[0] == A_AGI) ? "" : "%"); + } + sprintf(buf, "^%dYour low %s will decrease your %s with this weapon %s.^n\n", + C_BROWN, getattrname(f->val[0]), (f->val[0] == A_AGI) ? "accuracy" : "damage", - (f->val[0] == A_AGI) ? getaccuracynum(100 + abs(pctmod)) : abs(pctmod), - (f->val[0] == A_AGI) ? "" : "%"); + howmuch); strncat(retbuf, buf, HUGEBUFLEN); } } @@ -10032,32 +10075,50 @@ void showlfarmour(lifeform_t *lf) { outerob = getouterequippedob(lf, bp); if (o) { flag_t *f; + int thisar = 0,showar = B_FALSE; char obname[BUFLEN]; - getobname(o, obname, o->amt); - sprintf(rhs, "%c - %s",o->letter, obname); - - if (outerob && (outerob != o)) { - char outerobname[BUFLEN]; - getobname(outerob, outerobname, outerob->amt); - if (strlen(rhs)) strcat(rhs, " "); - strcat(rhs, "(covered) "); - } - f = hasflag(o->flags, F_ARMOURRATING); - if (f && (f->val[0])) { - char numbuf[BUFLENSMALL]; - int thisar; - thisar = f->val[0] + getobbonus(o, B_TRUE); - snprintf(numbuf, BUFLENSMALL, " ^g[AR:%d]^n",thisar); - strcat(rhs, numbuf); - } - f = hasflag(o->flags, F_OBHP); - if (f && (f->val[0] != f->val[1])) { - char numbuf[BUFLENSMALL]; - int pct; - pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); - snprintf(numbuf, BUFLENSMALL, " ^w[%d%%]^n",pct); - strcat(rhs, numbuf); - } + + // two handed weapons. + if ((bp == BP_SECWEAPON ) && (o == arm[BP_WEAPON])) { + sprintf(rhs, "(using two-handed weapon)"); + } else { + getobname(o, obname, o->amt); + sprintf(rhs, "%c - %s",o->letter, obname); + + if (outerob && (outerob != o)) { + char outerobname[BUFLEN]; + getobname(outerob, outerobname, outerob->amt); + if (strlen(rhs)) strcat(rhs, " "); + strcat(rhs, "(covered) "); + } + + + f = hasflag(o->flags, F_ARMOURRATING); + if (f && (f->val[0])) { + thisar += f->val[0]; + thisar += getobbonus(o, B_TRUE); + showar = B_TRUE; + } + f = hasflagvalknown(o->flags, F_EQUIPCONFER, F_ARBOOST, NA, NA, NULL); + if (f) { + thisar += f->val[1]; + showar = B_TRUE; + } + + if (showar) { + char numbuf[BUFLENSMALL]; + snprintf(numbuf, BUFLENSMALL, " ^g[AR:%d]^n",thisar); + strcat(rhs, numbuf); + } + f = hasflag(o->flags, F_OBHP); + if (f && (f->val[0] != f->val[1])) { + char numbuf[BUFLENSMALL]; + int pct; + pct = (int)(((float)f->val[0] / (float)f->val[1]) * 100.0); + snprintf(numbuf, BUFLENSMALL, " ^w[%d%%]^n",pct); + strcat(rhs, numbuf); + } + } } else { strcpy(rhs, "-"); } @@ -10750,7 +10811,7 @@ void showlfstats(lifeform_t *lf, int showall) { } else if (rating >= 0.25) { snprintf(buf, BUFLEN, "It would make a formidable opponent."); } else if (rating >= 0.125) { - snprintf(buf, BUFLEN, "It is very dangerous to you."); + snprintf(buf, BUFLEN, "It is dangerous to you."); } else { snprintf(buf, BUFLEN, "It is EXTREMELY dangerous to you."); } @@ -11595,6 +11656,12 @@ void showlfstats(lifeform_t *lf, int showall) { } // show intrinsics + f = lfhasknownflag(lf, F_ARBOOST); + if (f) { + mvwprintw(mainwin, y, 0, "%s Armour Rating is being magically %s.", your(lf), (f->val[0] >= 0) ? "boosted" : "reduced"); + y++; + } + f = lfhasknownflag(lf, F_ATTRSET); if (f && (f->known)) { mvwprintw(mainwin, y, 0, "%s %s has been modified.", your(lf), getattrname(f->val[0])); diff --git a/lf.c b/lf.c index 043171a..0340465 100644 --- a/lf.c +++ b/lf.c @@ -1191,10 +1191,8 @@ int cansee_real(lifeform_t *viewer, lifeform_t *viewee, int uselos) { } // viewee hiding? - if (lfhasflag(viewee, F_HIDING) && (viewee != viewer)) { - if (!lfhasflagval(viewer, F_SPOTTED, viewee->id, NA, NA, NULL)) { - invisible = B_TRUE; - } + if (ishidingfrom(viewee, viewer)) { + invisible = B_TRUE; } if (invisible) { @@ -3705,7 +3703,7 @@ void enhanceskills(lifeform_t *lf) { // pick randomly att = rnd(0,MAXATTS-1); } - modattr(lf, att, 5); + modattr(lf, att, 2); f->val[2]--; if (f->val[2] <= 0) { killflag(f); @@ -4607,7 +4605,8 @@ void gainlevel(lifeform_t *lf, int autotrain) { lf->newlevel++; - // stat gain (str etc) every 3 levels + // stat gain (str etc) every level + /* if ((lf->newlevel % 3) == 0) { flag_t *f; f = lfhasflag(lf, F_STATGAINREADY); @@ -4618,6 +4617,14 @@ void gainlevel(lifeform_t *lf, int autotrain) { f = addflag(lf->flags, F_STATGAINREADY, NA, NA, 1, NULL); } } + */ + f = lfhasflag(lf, F_STATGAINREADY); + if (f) { + // TODO: should never happen now. + f->val[2]++; + } else { + f = addflag(lf->flags, F_STATGAINREADY, NA, NA, 1, NULL); + } // auto skill gain for monsters if (!isplayer(lf)) { @@ -5173,26 +5180,25 @@ int getarmourrating(lifeform_t *lf, object_t **hitob, int *hitchance, enum BODYP (*narms) = 0; } - getflags(lf->flags, retflag, &nretflags, F_ARMOURRATING, F_MAGICARMOUR, F_PHALANX, F_NONE); + getflags(lf->flags, retflag, &nretflags, F_ARBOOST, F_ARMOURRATING, F_MAGICARMOUR, F_PHALANX, F_NONE); for (i = 0; i < nretflags; i++) { f = retflag[i]; + if (f->id == F_ARBOOST) { + ar += f->val[0]; + } if (f->id == F_ARMOURRATING) { ar += f->val[0]; + /* if (hitob) { hitob[*narms] = NULL; hitchance[*narms] = getbodyparthitchance(BP_BODY); if (hitbp) hitbp[*narms] = BP_BODY; (*narms)++; } + */ } if (f->id == F_MAGICARMOUR) { ar += f->val[0]; - if (hitob) { - hitob[*narms] = NULL; - hitchance[*narms] = getbodyparthitchance(BP_BODY); - if (hitbp) hitbp[*narms] = BP_BODY; - (*narms)++; - } } if (f->id == F_PHALANX) { int dir; @@ -5209,12 +5215,6 @@ int getarmourrating(lifeform_t *lf, object_t **hitob, int *hitchance, enum BODYP } if (nmatched >= f->val[2]) { ar += f->val[0]; - if (hitob) { - hitob[*narms] = NULL; - hitchance[*narms] = getbodyparthitchance(BP_BODY); - if (hitbp) hitbp[*narms] = BP_BODY; - (*narms)++; - } } } } @@ -5925,30 +5925,6 @@ int gethearingrange(lifeform_t *lf) { return range; } -int gethidemodifier(lifeform_t *lf) { - int modifier = 0; - - reason = E_OK; - if (!safetorest(lf)) { - if (getskill(lf, SK_STEALTH) == PR_EXPERT) { - // can still hide, but with a modifier - modifier = -4; - } else if (getskill(lf, SK_STEALTH) == PR_MASTER) { - // can still hide, but with a modifier - modifier = -2; - } else { - reason = E_IMPOSSIBLE; - modifier = -100; // special case - } - } - - // no stealth skill? - if (!getskill(lf, SK_STEALTH)) { - modifier = -5; - } - return modifier; -} - int gethitdice(lifeform_t *lf) { if (isplayer(lf) || lfhasflag(lf, F_VARLEVEL)) { return lf->level; @@ -6560,7 +6536,7 @@ int getnoisedetails(lifeform_t *lf, enum NOISETYPE nid, char *heartext, if (strlen(movetext)) { if (volume) *volume += getarmournoise(lf); if (heartext) strcpy(heartext, movetext); - if (lfhasflag(lf, F_SNEAK)) { + if (lfhasflag(lf, F_CAREFULMOVE)) { (*volume)--; limit(volume, 1, NA); } @@ -6963,7 +6939,7 @@ int getmovespeed(lifeform_t *lf) { } // modifier? - getflags(lf->flags, retflag, &nretflags, F_FASTMOVE, F_FASTACTMOVE, F_INJURY, F_SLOWMOVE, + getflags(lf->flags, retflag, &nretflags, F_FASTMOVE, F_FASTACTMOVE, F_HIDING, F_INJURY, F_SLOWMOVE, F_SLOWACTMOVE, F_SPRINTING, F_NONE); for (i = 0; i < nretflags; i++) { f = retflag[i]; @@ -6971,6 +6947,8 @@ int getmovespeed(lifeform_t *lf) { speed += f->val[0]; } else if ((f->id == F_FASTMOVE) || (f->id == F_FASTACTMOVE)) { speed -= f->val[0]; + } else if (f->id == F_HIDING) { + speed += 10; } else if (f->id == F_INJURY) { if (!isairborne(lf)) { switch (f->val[0]) { @@ -7012,7 +6990,8 @@ int getmovespeed(lifeform_t *lf) { } - if (lfhasflag(lf, F_SNEAK)) { + // caseful walking + if (lfhasflag(lf, F_CAREFULMOVE)) { speed *= 2; } @@ -8500,6 +8479,9 @@ int getweapons(lifeform_t *lf, object_t **wep, flag_t **damflag, int *lastweapon enum SKILLLEVEL getweaponskill(lifeform_t *lf, object_t *o) { skill_t *sk; + if (!o) { + return getskill(lf, SK_UNARMED); + } sk = getobskill(o); if (sk) { enum SKILLLEVEL weplev; @@ -8958,6 +8940,11 @@ flag_t *giveskill(lifeform_t *lf, enum SKILL id) { if (!newf) { newf = addtempflag(lf->flags, F_CANWILL, OT_A_REPAIR, NA, NA, NULL, FROMSKILL); } + } else if (id == SK_STEALTH) { + newf = hasflagval(lf->flags, F_CANWILL, OT_A_HIDE, NA, NA, NULL); + if (!newf) { + newf = addtempflag(lf->flags, F_CANWILL, OT_A_HIDE, NA, NA, NULL, FROMSKILL); + } } else if (id == SK_THIEVERY) { newf = hasflagval(lf->flags, F_CANWILL, OT_A_STEAL, NA, NA, NULL); if (!newf) { @@ -9075,10 +9062,6 @@ flag_t *giveskill(lifeform_t *lf, enum SKILL id) { if (f->val[1] == PR_BEGINNER) { newf = addtempflag(lf->flags, F_CANWILL, OT_A_SHIELDBASH, NA, NA, NULL, FROMSKILL); } - } else if (id == SK_STEALTH) { - if (f->val[1] == PR_BEGINNER) { - newf = addtempflag(lf->flags, F_CANWILL, OT_A_HIDE, NA, NA, NULL, FROMSKILL); - } } else if (id == SK_TECHUSAGE) { if (isplayer(lf)) { objecttype_t *ot; @@ -10907,6 +10890,30 @@ int isgod(lifeform_t *lf) { return B_FALSE; } +int ishelplessvictim(lifeform_t *victim, lifeform_t *attacker, enum HELPLESSTYPE *how) { + if (isfleeing(victim)) { + if (how) *how = HL_FLEEING; + return B_TRUE; + } else if (!cansee(victim, attacker)) { + if (how) *how = HL_CANTSEE; + return B_TRUE; + } + if (how) *how = HL_NONE; + return B_FALSE; +} + + +flag_t *ishidingfrom(lifeform_t *hider, lifeform_t *seeker) { + if (hider != seeker) { + flag_t *f; + f = lfhasflag(hider, F_HIDING); + if (f && !lfhasflagval(seeker, F_SPOTTED, hider->id, NA, NA, NULL)) { + return f; + } + } + return NULL; +} + // can you try to recruit this lf? int ishirable(lifeform_t *lf) { if (!isplayer(lf) && ispeaceful(lf)) { @@ -13000,51 +13007,103 @@ int meetsallattreqs(lifeform_t *lf, object_t *o) { // if you don't meet it, return why not in 'reason' int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o, int *pctmod) { enum ATTRIB att; - int valneeded; + int valneeded,valbonus; int myval; - int diff; + int neededdiff,bonusdiff; + int dopenaltycheck = B_TRUE, dobonuscheck = B_FALSE; int scaleamt; + enum { + NONE=0, + PENALTY=1, + BONUS = 2, + } bonorpen = NONE; + + + if (pctmod) { + *pctmod = 0; + } + att = f->val[0]; valneeded = f->val[1]; - scaleamt = f->val[2]; - if (scaleamt == NA) scaleamt = 10; + if (valneeded == NA) { + dopenaltycheck = B_FALSE; + } else { + dopenaltycheck = B_TRUE; + } + valbonus = f->val[2]; + if (valbonus == NA) { + dobonuscheck = B_FALSE; + } else { + dobonuscheck = B_TRUE; + } + if (strlen(f->text)) { + scaleamt = atoi(f->text); + } else { + scaleamt = 0; + } + // modify for masterwork if (o) { if (hasflag(o->flags, F_MASTERWORK)) { - valneeded -= 3; - if (valneeded < 0) valneeded = 0; + if (dopenaltycheck) { + valneeded -= 10; + if (valneeded < 0) valneeded = 0; + } + if (dobonuscheck) { + valbonus -= 10; + if (valbonus < 0) valbonus = 0; + } } } myval = getattr(lf, att); - diff = myval - valneeded; - limit(&diff,-20, 20); - // for firearms or scaleamt == 0, you MUST meet the requirement. - if (diff < 0) { + if (dopenaltycheck) { + neededdiff = myval - valneeded; + limit(&neededdiff,-20, 20); + } + + if (dobonuscheck) { + bonusdiff = myval - valbonus; + // for this one, just meeting it gives you once "scaleamt" worth of bonus + if (bonusdiff >= 0) bonusdiff += 10; + limit(&bonusdiff,-20, 30); + } + + if (dopenaltycheck && (neededdiff < 0)) { + // penalty? + // for firearms, armour or scaleamt == 0, you MUST meet the requirement. if (scaleamt == 0) { - diff = -20; + neededdiff = -20; } else if (o && isarmour(o)) { - diff = -20; + neededdiff = -20; } else if (o && isfirearm(o)) { - diff = -20; + neededdiff = -20; } - } else if (diff > 0) { + bonorpen = PENALTY; + } else if (dobonuscheck && (bonusdiff > 0)) { + // maybe a bonus? // no bonusses if you're unskilled if (o && !getweaponskill(lf, o)) { - diff = 0; + bonusdiff = 0; + } else { + bonorpen = BONUS; } } - if (pctmod) { - // for each 5 points you are over/under the requirement, adjust "scaleamt" percent. - *pctmod = (diff/10) * scaleamt; + if (scaleamt && pctmod) { + // for each 10 points you are over/under the requirement, adjust "scaleamt" percent. + if (bonorpen == PENALTY) { + *pctmod = (neededdiff/10) * scaleamt; + } else if (bonorpen == BONUS) { + *pctmod = (bonusdiff/10) * scaleamt; + } } // too low? - if (diff <= -4) { + if ((bonorpen == PENALTY) && (neededdiff <= -20)) { switch (att) { case A_AGI: reason = E_LOWDEX; @@ -14416,6 +14475,21 @@ void setskillused(lifeform_t *lf, enum SKILL skid) { } } +void spot_hiding_lf(lifeform_t *lf, lifeform_t *hider) { + addflag(lf->flags, F_SPOTTED, hider->id, NA, NA, NULL); + // announce + if (isplayer(lf)) { + char hidername[BUFLEN]; + getlfname(hider, hidername); + msg("^wYou spot %s!", hidername); + } else if (isplayer(hider) && cansee(hider, lf)) { + char lfname[BUFLEN]; + getlfname(lf, lfname); + msg("You think %s has spotted you!", lfname); + } + practice(lf, SK_PERCEPTION, 1); +} + int startclimbing(lifeform_t *lf) { cell_t *where; char lfname[BUFLEN]; @@ -15814,12 +15888,14 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r othermod += (getstatmod(lf, A_AGI) / 15); } } else if (ct == SC_STEALTH) { + /* if (attrib > 0) { - if (lfhasflag(lf, F_SNEAK)) { + if (lfhasflag(lf, F_CAREFULMOVE)) { othermod += 3; } } - if (isairborne(lf)) { + */ + if (!islit(lf->cell)) { othermod += 5; } } else if (ct == SC_WILL) { @@ -16543,8 +16619,8 @@ void startlfturn(lifeform_t *lf) { } // they are hiding, and you haven't spotted them yet - f = lfhasflag(l, F_HIDING); - if (f && !lfhasflagval(lf, F_SPOTTED, l->id, NA, NA, NULL) && !isinbattle(lf)) { + f = ishidingfrom(l, lf); + if (f && !isinbattle(lf)) { // can you see their cell? if (!lfhasflag(lf, F_TRAINING) && haslos(lf, l->cell)) { int bonus = 0; @@ -16560,18 +16636,7 @@ void startlfturn(lifeform_t *lf) { // did you spot them? if (skillcheckvs(lf, SC_SEARCH, bonus, l, SC_STEALTH, f->val[0])) { - addflag(lf->flags, F_SPOTTED, l->id, NA, NA, NULL); - // announce - if (isplayer(lf)) { - char lname[BUFLEN]; - getlfname(l, lname); - msg("^wYou spot %s!", lname); - } else if (isplayer(l) && cansee(l, lf)) { - char lfname[BUFLEN]; - getlfname(lf, lfname); - msg("You think %s has spotted you!", lfname); - } - practice(lf, SK_PERCEPTION, 1); + spot_hiding_lf(lf, l); } } } @@ -16861,10 +16926,9 @@ void startlfturn(lifeform_t *lf) { } if (isdead(lf)) return; - // effects for/on your own flags getflags(lf->flags, retflag, &nretflags, F_ATTACHEDTO, F_CANWILL, F_CHARMEDBY, F_CLIMBING, F_FEIGNFOOLEDBY,F_FLEEFROM, - F_GRABBEDBY, F_GRABBING, F_GUNTARGET, F_BOOSTSPELL, F_FEIGNINGDEATH, F_HPDRAIN, F_INJURY, + F_GRABBEDBY, F_GRABBING, F_HIDING, F_BOOSTSPELL, F_FEIGNINGDEATH, F_HPDRAIN, F_INJURY, F_NOFLEEFROM, F_PETOF, F_SPOTTED, F_STABBEDBY, F_STRIKETOKO, F_TARGETCELL, F_TARGETLF, F_NONE); for (i = 0; i < nretflags; i++) { f = retflag[i]; @@ -16892,6 +16956,14 @@ void startlfturn(lifeform_t *lf) { continue; } } + + if (f->id == F_HIDING) { + if (lfhasflag(lf, F_SPRINTING) || lfhasflag(lf, F_PRODUCESLIGHT)) { + killflag(f); + continue; + } + } + if (f->id == F_GRABBEDBY) { lifeform_t *lf2; lf2 = findlf(NULL, f->val[0]); @@ -19057,6 +19129,9 @@ int wear(lifeform_t *lf, object_t *o) { } // end while !canwear } // end for each required bodypart + // at this point, we're going to try to wear it... + killflagsofid(lf->flags, F_HIDING); + // some checks first... if (touch(lf, o)) { taketime(lf, getactspeed(lf)); @@ -19266,8 +19341,9 @@ int weild(lifeform_t *lf, object_t *o) { else ch = 'n'; } if (ch == 'y') { - // make sure we are skiled in 2nd weapon - if (getweaponskill(lf, o)) { + // make sure we are skilled in 2nd weapon + // (weilding null (nothing) there is always okay too. + if (!o || getweaponskill(lf, o)) { enum BODYPART temp; // swap locations. temp = weildloc; @@ -19482,6 +19558,18 @@ int weild(lifeform_t *lf, object_t *o) { return B_FALSE; } +int willbackstab(lifeform_t *lf, lifeform_t *victim, object_t *wep) { + if (getraceclass(victim) == RC_PLANT) return B_FALSE; + + if (wep && (getdamtype(wep) == DT_PIERCE) && // stabbing weapon + getskill(lf, SK_BACKSTAB) && // able to backstab + !lfhasflagval(victim, F_STABBEDBY, lf->id, NA, NA, NULL) && // haven't stabbed them already + ishelplessvictim(victim, lf, NULL)) { // victim can't see us or is fleeing + return B_TRUE; + } + return B_FALSE; +} + int willbleedfrom(lifeform_t *lf, enum BODYPART bp) { object_t *o; o = getequippedob(lf->pack, bp); diff --git a/lf.h b/lf.h index a49cc8c..e274dc2 100644 --- a/lf.h +++ b/lf.h @@ -152,7 +152,6 @@ lifeform_t *getguntarget(lifeform_t *lf); int getguntargetid(lifeform_t *lf); //int gethealtime(lifeform_t *lf); int gethearingrange(lifeform_t *lf); -int gethidemodifier(lifeform_t *lf); int gethitdice(lifeform_t *lf); int gethitdicerace(race_t *r); int gethitstokill(lifeform_t *lf, lifeform_t *victim, int useevasion, int usearmour); @@ -301,6 +300,8 @@ int isfriendly(lifeform_t *lf); int isfullyhealed(lifeform_t *lf); int isgenius(lifeform_t *lf); int isgod(lifeform_t *lf); +int ishelplessvictim(lifeform_t *victim, lifeform_t *attacker, enum HELPLESSTYPE *how); +flag_t *ishidingfrom(lifeform_t *hider, lifeform_t *seeker); int ishirable(lifeform_t *lf); int isimmobile(lifeform_t *lf); flag_t *isimmuneto(flagpile_t *fp, enum DAMTYPE dt, int onlytemp); @@ -377,6 +378,7 @@ void relinklf(lifeform_t *src, map_t *dst); int resizelf(lifeform_t *lf, enum LFSIZE newsize); int rest(lifeform_t *lf, int onpurpose); void setskillused(lifeform_t *lf, enum SKILL skid); +void spot_hiding_lf(lifeform_t *lf, lifeform_t *hider); int startclimbing(lifeform_t *lf); int startresting(lifeform_t *lf, int willtrain); int rollattr(enum ATTRBRACKET bracket); @@ -435,6 +437,7 @@ int validateraces(void); void wakeup(lifeform_t *lf, int howmuch); int wear(lifeform_t *lf, object_t *o); int weild(lifeform_t *lf, object_t *o); +int willbackstab(lifeform_t *lf, lifeform_t *victim, object_t *wep); int willbleedfrom(lifeform_t *lf, enum BODYPART bp); int willburden(lifeform_t *lf, object_t *o, int howmany); int willeatlf(lifeform_t *eater, lifeform_t *eatee); diff --git a/map.c b/map.c index b9c59d0..f746584 100644 --- a/map.c +++ b/map.c @@ -191,6 +191,7 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int flagpile_t *wantflags = NULL; enum JOB wantjob = J_NONE; + if (nadded) *nadded = 0; //if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging @@ -200,6 +201,8 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int return NULL; } + wantflags = addflagpile(NULL, NULL); + if (rid != R_SPECIFIED) { if (rid == R_RANDOM) { r = getrandomrace(c, NA); @@ -207,8 +210,6 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int r = findrace(rid); } } else { - // get params - wantflags = addflagpile(NULL, NULL); //if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging rid = parserace(racename, wantflags, &wantjob); @@ -221,6 +222,7 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int } } if (!r) { + killflagpile(wantflags); return NULL; } @@ -243,6 +245,7 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int // if so, move it here, then exit. if (lf) { teleportto(lf, c, B_FALSE); + killflagpile(wantflags); return lf; } } @@ -291,27 +294,30 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int // note: if we start off hidden, we have no hide penalty. // this is so we can have monsters which start hidden, but // don't have the 'hide' skill. - addflag(lf->flags, F_HIDING, 0, NA, NA, NULL); + addflag(wantflags, F_HIDING, 0, NA, NA, NULL); } } if (!lfhasflag(lf, F_HIDING) && !lfhasflag(lf, F_DEAF) && cansleep(lf) ) { // if not already asleep... - if (wantflags && hasflag(wantflags, F_ASLEEP)) { + if (hasflag(wantflags, F_ASLEEP)) { } else { - int asleepchance = 70; + int asleepchance = 70,willsleep = B_FALSE; f = lfhasflag(lf, F_STARTASLEEPPCT); if (f) { asleepchance = f->val[0]; } // TODO: base this on the time, and whether monster is nocturnal if (pctchance(asleepchance)) { - addflag(lf->flags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL); + willsleep = B_TRUE; } else { // might be asleep based on time. if (issleepingtimefor(lf)) { - addflag(lf->flags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL); + willsleep = B_TRUE; } } + if (willsleep) { + addflag(wantflags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL); + } } } finalisemonster(lf, NULL, wantflags); @@ -443,9 +449,7 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int //if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging // free mem - if (wantflags) { - killflagpile(wantflags); - } + killflagpile(wantflags); //if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging if (db) dbtimeend("finished addmonster"); @@ -5021,18 +5025,22 @@ void finalisemonster(lifeform_t *lf, lifeform_t *leader, flagpile_t *wantflags) flag_t *f; if (leader) { // if leader is asleep, minions will also be asleep - if (lfhasflag(leader, F_ASLEEP) || (wantflags && hasflag(wantflags, F_ASLEEP))) { - addflag(lf->flags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL); + if (lfhasflag(leader, F_ASLEEP)) { + if (wantflags && hasflag(wantflags, F_ASLEEP)) { + } else { + addflag(wantflags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL); + } } if ((lf->cell->map->illumination != IL_FULLLIT) && !lfhasflag(lf, F_SEEINDARK)) { if ((getraceclass(lf) != RC_HUMANOID) && pctchance(75)) { - addflag(lf->flags, F_SEEINDARK, rnd(3,5), NA, NA, NULL); + addflag(wantflags, F_SEEINDARK, rnd(3,5), NA, NA, NULL); } } // minions never have certain flags. killflagsofid(lf->flags, F_DEMANDSBRIBE); + killflagsofid(wantflags, F_DEMANDSBRIBE); } // random monster behaviours @@ -5079,6 +5087,11 @@ void finalisemonster(lifeform_t *lf, lifeform_t *leader, flagpile_t *wantflags) if (wantflags) { copyflags(lf->flags, wantflags, NA); } + + if (lfhasflag(lf, F_ASLEEP)) { + killflagsofid(lf->flags, F_FLYING); + killflagsofid(lf->flags, F_HIDING); + } } celltype_t *findcelltype(enum CELLTYPE cid) { diff --git a/move.c b/move.c index a3ac940..55d3e09 100644 --- a/move.c +++ b/move.c @@ -1220,7 +1220,9 @@ int movelf(lifeform_t *lf, cell_t *newcell) { didmsg = moveeffects(lf); - killflagsofid(lf->flags, F_HIDING); + if (lfhasflag(lf, F_HIDING) && (getskill(lf, SK_STEALTH) < PR_BEGINNER)) { + killflagsofid(lf->flags, F_HIDING); + } // remove grabs (but not attached things) // Note: only remove this from the person _being grabbed_. @@ -1292,7 +1294,7 @@ int movelf(lifeform_t *lf, cell_t *newcell) { } f = hasflag(o->flags, F_SHARP); - if (f && hasbp(lf, BP_FEET) && !lfhasflag(lf, F_SNEAK)) { + if (f && hasbp(lf, BP_FEET) && !lfhasflag(lf, F_CAREFULMOVE)) { object_t *boots; // has boots on? boots = getequippedob(lf->pack, BP_FEET); @@ -1312,7 +1314,7 @@ int movelf(lifeform_t *lf, cell_t *newcell) { } f = hasflag(o->flags, F_CRUSHABLE); - if (f && !lfhasflag(lf, F_SNEAK)) { + if (f && !lfhasflag(lf, F_CAREFULMOVE)) { enum LFSIZE crushsize; crushsize = f->val[0]; @@ -1537,6 +1539,7 @@ int moveto(lifeform_t *lf, cell_t *newcell, int onpurpose, int dontclearmsg) { char lfname[BUFLEN]; int didmsg; int predark = B_FALSE,postdark = B_FALSE; + int willmakenoise = B_TRUE; // for the player, moving means that we don't regenerate stamina. // this is the equivilant of losing the same amount of stamina which we @@ -1631,9 +1634,16 @@ int moveto(lifeform_t *lf, cell_t *newcell, int onpurpose, int dontclearmsg) { } - // make some noise + // maybe make some noise // (stealth check to avoid this) - if (!skillcheck(lf, SC_STEALTH, 20, 0)) { + willmakenoise = B_TRUE; + if (lfhasflag(lf, F_HIDING)) { + if (skillcheck(lf, SC_STEALTH, 20, isairborne(lf) ? 5 : 0)) { + willmakenoise = B_FALSE; + } + } + + if (willmakenoise) { if (isairborne(lf)) { makenoise(lf, N_FLY); } else { @@ -1646,7 +1656,7 @@ int moveto(lifeform_t *lf, cell_t *newcell, int onpurpose, int dontclearmsg) { int slip; object_t *slipob; - if (!lfhasflag(lf, F_SNEAK)) { + if (!lfhasflag(lf, F_CAREFULMOVE)) { slip = getslipperyness(newcell, &slipob); if (slip && !skillcheck(lf, SC_SLIP, slip, 0)) { slipon(lf, slipob); @@ -2123,9 +2133,9 @@ int trysneak(lifeform_t *lf, int dir) { return B_TRUE; } } - addflag(lf->flags, F_SNEAK, NA, NA, NA, NULL); + addflag(lf->flags, F_CAREFULMOVE, NA, NA, NA, NULL); trymove(lf, dir, B_TRUE, B_FALSE); - killflagsofid(lf->flags, F_SNEAK); + killflagsofid(lf->flags, F_CAREFULMOVE); return B_FALSE; } @@ -2364,7 +2374,7 @@ int initiatemove(lifeform_t *lf, cell_t *cell, int onpurpose, int *didmsg) { int slip; object_t *slipob; - if (!lfhasflag(lf, F_SNEAK)) { + if (!lfhasflag(lf, F_CAREFULMOVE)) { slip = getslipperyness(lf->cell, &slipob); if (slip && !skillcheck(lf, SC_SLIP, slip, 0)) { if (!slipon(lf, slipob)) { @@ -2641,7 +2651,7 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) { */ // warn before moving onto dangerous cells - if (onpurpose && isplayer(lf) && !lfhasflag(lf, F_SNEAK) && !rndmove) { + if (onpurpose && isplayer(lf) && !lfhasflag(lf, F_CAREFULMOVE) && !rndmove) { char ques[BUFLEN]; char ch; if (cell && celldangerous(lf, cell, B_TRUE, &errcode)) { diff --git a/objects.c b/objects.c index fb0d602..0dd5737 100644 --- a/objects.c +++ b/objects.c @@ -1183,7 +1183,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes } /* - need to do the below for _all_ objects added! + need to do the below for _all_ objects added (searchfor"each object added")! */ for (i = 0; i < nadded; i++) { cell_t *obloc; @@ -1313,6 +1313,21 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes turnon(NULL, o); } + // firearms usually come loaded + if (o && isfirearm(o)) { + objecttype_t *ammotype; + flag_t *ammoflag; + int ammoamt; + ammoflag = hasflag(o->flags, F_AMMOCAPACITY); + ammoamt = rnd(0,ammoflag->val[0]); // note: can be 0 + ammotype = getrandomammofor(o); + if (ammotype && (ammoamt > 0)) { + char ammostring[BUFLEN]; + sprintf(ammostring, "%d %s",ammoamt,ammotype->name); + addob(o->contents, ammostring); + } + } + // fill in armour size if (o && hasflag(o->flags, F_MULTISIZE)) { if (wantarmsize == SZ_ANY) { @@ -4368,7 +4383,17 @@ enum DEPTH getobdepth(object_t *o, lifeform_t *lf) { } char *getobdesc(object_t *o, char *buf) { - if (isknown(o)) { + int blind = B_FALSE; + if (gamemode == GM_GAMESTARTED) { + if (o->pile->owner == player) { + if (!haslos(player, player->cell) || isblind(player)) { + if (!hasflag(o->flags, F_FEELTEXT)) { + blind = B_TRUE; + } + } + } + } + if (isknown(o) && !blind) { if (o->type->id == OT_CORPSE) { flag_t *f; f = hasflag(o->flags, F_CORPSEOF); @@ -4433,6 +4458,7 @@ char *getobdesc(object_t *o, char *buf) { snprintf(buf, BUFLEN, "%s", o->type->desc); } } else { + // show generic description objecttype_t *ot = NULL; flag_t *f; f = hasflag(o->flags, F_HASHIDDENNAME); @@ -10177,6 +10203,9 @@ int readsomething(lifeform_t *lf, object_t *o) { readtime = SPEED_READ; } + stopsprinting(lf); + killflagsofid(lf->flags, F_HIDING); + taketime(lf, readtime); if (isplayer(lf)) maketried(o->type->id); @@ -12202,20 +12231,6 @@ int real_fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int sp } } - - f = hasflag(o->flags, F_TANGLEMISSILE); - if (f) { - missiledam = 0; - if (isairborne(target) || !skillcheck(target, SC_SLIP, f->val[0], 0)) { - fall(target, NULL, B_TRUE); - taketime(target, getactspeed(target)*2); - - if (f->val[1] != NA) { - addflag(o->flags, F_RESTRICTMOVEMENT, f->val[1], f->val[2], B_FALSE, NULL); - } - } - } - if (thrower) { if (firearm) { practice(thrower, SK_THROWING, 1); @@ -12867,7 +12882,7 @@ void trapeffects(object_t *trapob, enum OBTYPE oid, cell_t *c) { break; } // easier to avoid if you're sneaking - if (lfhasflag(lf, F_SNEAK)) mod += 5; + if (lfhasflag(lf, F_CAREFULMOVE)) mod += 5; mod += getskill(lf, SK_TRAPS); avoided = skillcheck(lf, ct, f->val[2], mod); } @@ -13361,11 +13376,6 @@ int validateobs(void) { goterror = B_TRUE; } } - f = hasflag(ot->flags, F_ATTREQ); - if (f && (f->val[2] == NA)) { - printf("ERROR in object '%s' - f_attreq missing scale factor.\n", ot->name); - goterror = B_TRUE; - } } if (hasflagval(ot->flags, F_PICKLOCKS, NA, B_BLUNTONFAIL, NA, NULL) && hasflag(ot->flags, F_STACKABLE)) { printf("ERROR in object '%s' - cannot have F_BLUNTONFAIL on stackable objects.\n", ot->name); @@ -13435,6 +13445,11 @@ int validateobs(void) { printf("ERROR in object '%s' - has both dietext & noobdietext.\n", ot->name); goterror = B_TRUE; } + f = hasflag(ot->flags, F_ATTREQ); + if (f && (f->val[2] != NA) && !strlen(f->text)) { + printf("ERROR in object '%s' - has val2(BONUS_AT) but no ->text.\n", ot->name); + goterror = B_TRUE; + } f = hasflag(ot->flags, F_THEREISHERE); if (f && !strlen(f->text)) { printf("ERROR in object '%s' - has f_thereishere but no ->text.\n", ot->name); diff --git a/spell.c b/spell.c index 3d31be3..052fa73 100644 --- a/spell.c +++ b/spell.c @@ -1803,6 +1803,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef addflag(user->flags, F_SPRINTING, B_TRUE, NA, NA, NULL); practice(user, SK_ATHLETICS, 1); + killflagsofid(user->flags, F_HIDING); } else if (abilid == OT_A_STINGACID) { validateabillf(user, abilid, &target); if (!target) return B_TRUE; @@ -3221,24 +3222,33 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef killflag(f2); killflag(f3); } else if (abilid == OT_A_HIDE) { - int penalty = 0; lifeform_t *lf; if (isswimming(user) && !lfhasflag(user, F_AQUATIC)) { if (isplayer(user)) msg("You can't hide while swimming!"); return B_TRUE; } - - if (lfhasflag(user, F_HIDING)) { - if (isplayer(user)) msg("You are already hiding!"); + if (lfhasflag(user, F_PRODUCESLIGHT)) { + if (isplayer(user)) msg("You can't hide while producing light!"); return B_TRUE; } - penalty = gethidemodifier(user); - if (reason == E_IMPOSSIBLE) { - if (isplayer(user)) msg("You can't hide - there are monsters around!"); + if (lfhasflag(user, F_HIDING)) { + // stop hiding. + killflagsofid(user->flags, F_HIDING); + taketime(user, getactspeed(user)); return B_TRUE; } + + if (isplayer(user)) { + if (!safetorest(user)) { + if (getattrbracket(getattr(user, A_WIS), A_WIS, NULL) >= AT_GTAVERAGE) { + if (askchar("Really try to hide while in view of enemies?", "yn", "n", B_TRUE, B_FALSE) != 'y') { + return B_TRUE; + } + } + } + } if (getskill(user, SK_STEALTH) < PR_EXPERT) { // anyone who saw you start hiding can still see you for (lf = user->cell->map->lf ; lf ; lf = lf->next) { @@ -3250,7 +3260,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } stopsprinting(user); // start hiding - addflag(user->flags, F_HIDING, penalty, NA, NA, NULL); + addflag(user->flags, F_HIDING, 0, NA, NA, NULL); // even though it's untrainable - this will // still mark it as used. diff --git a/text.c b/text.c index 885405b..b3973bd 100644 --- a/text.c +++ b/text.c @@ -89,12 +89,35 @@ enum COLOUR chartocol(char ch) { char *construct_hit_string(lifeform_t *lf, lifeform_t *victim, char *attackername, char *victimname, char *victimbpname, object_t *wep, enum DAMTYPE damtype, int dam, int maxhp, int idx, int backstab, int critical, int fatal, int isunarmed, char *retbuf) { int usecrittext = B_FALSE; char wepname[BUFLEN],buf[BUFLEN]; + char locvictimname[BUFLEN]; + enum HELPLESSTYPE helpless; // default strcpy(retbuf, ""); getobname(wep, wepname, 1); + // modify victimname if required + //if (helpless && !isbehind(lf, victim)) { + if (!isplayer(victim) && ishelplessvictim(victim, lf, &helpless)) { + char *vn; + // strip "the" from "the xxx" + vn = strdup(victimname); + vn = strrep(vn, "the ", "", NULL); + switch (helpless) { + case HL_CANTSEE: + sprintf(locvictimname, "the helpless %s", vn); + break; + case HL_FLEEING: + sprintf(locvictimname, "the fleeing %s", vn); + break; + default: break; + } + free(vn); + } else { + strcpy(locvictimname, victimname); + } + // initial hit... if (idx == 0) { if (critical && !fatal) usecrittext = B_TRUE; @@ -151,7 +174,7 @@ char *construct_hit_string(lifeform_t *lf, lifeform_t *victim, char *attackernam } snprintf(retbuf, BUFLEN, "^%dYou %s%s %s%s%s%s", col, usecrittext ? "critically " : "", verb, - usecrittext ? victimbpname : victimname, withwep,extradambuf, + usecrittext ? victimbpname : locvictimname, withwep,extradambuf, (fatal || backstab) ? "!" : "."); if (needfree) { @@ -191,7 +214,7 @@ char *construct_hit_string(lifeform_t *lf, lifeform_t *victim, char *attackernam snprintf(retbuf, BUFLEN, "^%d%s %s%s%s %s%s%s.", col, buf, usecrittext ? "critically " : "", attackverb, needses(attackverb) ? "es" : "s", - usecrittext ? victimbpname : victimname,withwep, nodamstr); + usecrittext ? victimbpname : locvictimname,withwep, nodamstr); } } } else { // follow-up weapon damage (ie from a flaming sword etc) @@ -199,49 +222,49 @@ char *construct_hit_string(lifeform_t *lf, lifeform_t *victim, char *attackernam if (dam == 0) { // ineffectual switch (damtype) { case DT_COLD: - snprintf(retbuf, BUFLEN, "^n%s %s cold.", victimname, isplayer(victim) ? "don't feel" : "doesn't look"); + snprintf(retbuf, BUFLEN, "^n%s %s cold.", locvictimname, isplayer(victim) ? "don't feel" : "doesn't look"); break; case DT_HEAT: case DT_FIRE: - snprintf(retbuf, BUFLEN, "^n%s %s hot.", victimname, isplayer(victim) ? "don't feel" : "doesn't look"); + snprintf(retbuf, BUFLEN, "^n%s %s hot.", locvictimname, isplayer(victim) ? "don't feel" : "doesn't look"); break; case DT_MAGIC: strcpy(retbuf, ""); break; default: - snprintf(retbuf, BUFLEN, "^n%s shrug%s off the effects.", victimname, isplayer(victim) ? "" : "s"); + snprintf(retbuf, BUFLEN, "^n%s shrug%s off the effects.", locvictimname, isplayer(victim) ? "" : "s"); break; } } else if (fatal) { // fatal switch (damtype) { case DT_COLD: - snprintf(retbuf, BUFLEN, "^%c%s %s chilled to the bone!", getlfcol(victim, CC_BAD), victimname, is(victim)); + snprintf(retbuf, BUFLEN, "^%c%s %s chilled to the bone!", getlfcol(victim, CC_BAD), locvictimname, is(victim)); break; case DT_HEAT: case DT_FIRE: - snprintf(retbuf, BUFLEN, "^%c%s %s incinerated!", getlfcol(victim, CC_BAD), victimname, is(victim)); + snprintf(retbuf, BUFLEN, "^%c%s %s incinerated!", getlfcol(victim, CC_BAD), locvictimname, is(victim)); break; case DT_MAGIC: - snprintf(retbuf, BUFLEN, "^%c%s %s blasted with magic!", getlfcol(victim, CC_BAD), victimname, is(victim)); + snprintf(retbuf, BUFLEN, "^%c%s %s blasted with magic!", getlfcol(victim, CC_BAD), locvictimname, is(victim)); break; default: - snprintf(retbuf, BUFLEN, "^%c%s %s killed!", getlfcol(victim, CC_BAD), victimname, is(victim)); + snprintf(retbuf, BUFLEN, "^%c%s %s killed!", getlfcol(victim, CC_BAD), locvictimname, is(victim)); break; } } else { // normal switch (damtype) { case DT_COLD: - snprintf(retbuf, BUFLEN, "^n%s %s chilled!", victimname, is(victim)); + snprintf(retbuf, BUFLEN, "^n%s %s chilled!", locvictimname, is(victim)); break; case DT_HEAT: case DT_FIRE: - snprintf(retbuf, BUFLEN, "^n%s %s burned!", victimname, is(victim)); + snprintf(retbuf, BUFLEN, "^n%s %s burned!", locvictimname, is(victim)); break; case DT_MAGIC: - snprintf(retbuf, BUFLEN, "^nMagical energy sears %s!", victimname); + snprintf(retbuf, BUFLEN, "^nMagical energy sears %s!", locvictimname); break; default: - snprintf(retbuf, BUFLEN, "^n%s %s hurt!", victimname, is(victim)); + snprintf(retbuf, BUFLEN, "^n%s %s hurt!", locvictimname, is(victim)); break; } } diff --git a/vaults/bazaar.vlt b/vaults/bazaar.vlt index ca30f41..3c64650 100644 --- a/vaults/bazaar.vlt +++ b/vaults/bazaar.vlt @@ -22,5 +22,6 @@ goesin:dungeon mayrotate rarity:vrare maintainedge +entertext:You enter a small bazaar of shops. @end