From 25db5b0da77a4925b980d8664498f383ebd09f9c Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Tue, 4 Oct 2011 03:24:53 +0000 Subject: [PATCH] - [+] job abilities can now generally happen as often as you like, since they're ilmited by stamina. - [+] rename dexterity to agility - [+] The leprechaun steals an uncursed ring of miracles from you! The leprechaun cowers away from you! - [+] should FLEE , not cower! - [+] should set blessknown after reading a scroll - [+] cursed mending scroll not working on non-damaged objects - [+] spanner helps metal repair - [+] needle boosts sewing ability - [+] when resting in a tent, monstesr have very low chance of noticing you (5%) - [+] move display of resistances to 'effects' section. - [+] show what a mosnter wants in effects (if you have >= beginner knowledge) - [+] prevent running into monsters with shift+dir - [+] infinite loop when creating a map, constant getrandomroomcell() calls failing - [+] monstesr will steal objects they WANT rather than always random - [+] monster: - [+] leprechaun - [+] lucky - [+] covets gold - [+] shillelagh ? or just a club? - [+] blink - [+] steal - [+] dodge - [+] at the moment attack doesn't seem to be draining stamina... - [+] it is, but i'm getting it right back due to attack speed. - [+] make stamina take longer to regen. - 1 per 3 turns rather than 1 per 2. - [+] stamina loss must be MORE than basic regen rate (0.3) - [+] make stamina loss for attack depend on atatck speed! - [+] instead of "you feel sick", say "you have contracted weakening poison" or "you have been infected with xxx" - [+] store stamina as a float, but getstamina() should return an int. - [+] sprinting - use 1.5 stamina per cell instead of 1? - [+] modify accuracy text - [+] fork - [+] showing f_entertext should set didmsg - [+] instead of printing 100% accuracy, show "Acc:0" (ie 100), "Acc:-1" (ie -10) etc - [+] do this in @@ - [+] do this in describeob - [+] nocturnal monsters - [+] base monsters initially being asleep on time and whether mosnter is nocturnal - [+] also during aiturn(), if they have nothing to do and it's their sleeping time, goto sleep - [+] add flags - [+] flies should always move towards corpses if possible - [+] maybe F_WANTSOB corpse, covet? - [+] but thye can't pick it up so they'll just hover nearby? - [+] now they can be hostile too - [+] when we're picking a random corpse, try again if we get something with nocorpse like a ghost - [+] getrandomcorpserace() - [+] lower stamina max - currently at lv1+ft:11 i have 7 stam. should be more like 5 - [+] severed finger shoudn't count as making you bleed when you attack - [+] in askcoords, always show cell name - [+] monsters with no melee attacks can always cast spells while adjacent - [+] resting issues - [+] having a temporary injury means oyu need to rest, so don't say "you don't need to rest"! - [+] also don't stop resting until all temporary injuries are healed - [+] show comparative weights / armour ratings - [+] make price for npcs to join be lower - [+] assertion failure with who->timespent == 0 when a mosnter falls through a hole - [+] (after I follow by falling down the pit) - [+] make taketime() not work when not on the player's map - [+] bug - monsters never waking up - [+] "tailwind" spell (fast movement speed but forwards only) - [+] now that i have Hardness, _all_ reduced damage should go towards armour. - [+] earthquake - pits open up around you (but not under you) - [+] force sphere - radial blast outwards, knocks back lfs + obs + doors etc --- ai.c | 78 ++-- attack.c | 30 +- data.c | 370 +++++++++++------ data/hiscores.db | Bin 6144 -> 7168 bytes defs.h | 41 +- io.c | 869 +++++++++++++++++++++++++--------------- lf.c | 337 ++++++++++------ lf.h | 9 +- map.c | 36 +- map.h | 2 +- move.c | 49 ++- objects.c | 129 +++--- objects.h | 4 +- save.c | 4 +- spell.c | 164 +++++++- text.c | 82 +++- text.h | 5 + vaults/playerstart2.vlt | 10 +- vaults/playerstart4.vlt | 16 +- 19 files changed, 1490 insertions(+), 745 deletions(-) diff --git a/ai.c b/ai.c index 7678d41..ddce9bc 100644 --- a/ai.c +++ b/ai.c @@ -68,7 +68,7 @@ int aiattack(lifeform_t *lf, lifeform_t *victim, int timelimit) { penalty = (getcelldist(lf->cell, victim->cell)-1); if (penalty < 0) penalty = 0; penalty *= 3; - if (!skillcheckvs(lf, SC_WILL, -penalty, victim, SC_WILL, 5)) { + if (!skillcheckvs(lf, SC_WILL, -penalty, victim, SC_WILL, 5+gethitdice(victim))) { dblog(".oO { attempted target fooled me with feign death. ignoring. }"); return B_TRUE; } @@ -602,6 +602,8 @@ int aimovetolf(lifeform_t *lf, lifeform_t *target, int wantattack) { if ( (spell != OT_NONE) && // found a valid spell/ability to use ((dist != 1) || // there is distance between us and target (st->obclass->id == OC_ABILITY) || // OR this works from adjacent + (st->obclass->id == OC_ABILITY) || // OR we have no melee attack + !countinnateattacks(lf) || (rnd(1,3) == 1)) // OR random chance of using anyway... ) { int spellfailed = B_FALSE; @@ -669,8 +671,8 @@ int aimovetolf(lifeform_t *lf, lifeform_t *target, int wantattack) { // spell succesful if ((spell == OT_A_STEAL) && !lfhasflag(lf, F_NOFLEE)) { - // run away for a few turns - fleefrom(lf, spelllf, rnd(3,7), B_TRUE); + // run away for a while + fleefrom(lf, spelllf, rnd(10,20), B_TRUE); } return B_FALSE; } @@ -1031,7 +1033,6 @@ void aiturn(lifeform_t *lf) { // housekeeping - weapon changes, drop/pickup, // use items, talk,etc /////////////////////////////////////////////// - if (lfhasflag(lf, F_ISPRISONER) && master && isplayer(master) && cansee(lf, master)) { if (isoutdoors(lf->cell->map) && pctchance(20)) { object_t *o; @@ -1096,7 +1097,11 @@ void aiturn(lifeform_t *lf) { int vol; f = poss[rnd(0,nposs-1)]; vol = rnd(f->val[1], f->val[2]); - sayphrase(lf, f->val[0], vol, NA, NULL); + if (f->text) { + say(lf, f->text, vol); + } else { + sayphrase(lf, f->val[0], vol, NA, NULL); + } } } } @@ -1144,6 +1149,17 @@ void aiturn(lifeform_t *lf) { if (lf->hp < (lf->maxhp/2)) { if (!useitemwithflag(lf, F_AIHEALITEM)) { return; + } else { + // don't have or can't use our healing items + // no enemies in sight? + if (safetorest(lf)) { + // if it's "night time" for us, sleep forever. + // otehrwise just sleep until we're healed + if (!gotosleep(lf, issleepingtimefor(lf) ? B_TRUE : B_FALSE)) { + taketime(lf, getactspeed(lf)); // to make sure our turn ends + return; // success + } + } } } @@ -1393,39 +1409,49 @@ void aiturn(lifeform_t *lf) { } if (!lfhasflag(lf, F_STUNNED)) { + lifeform_t *hateposs[MAXCANDIDATES],*poss[MAXCANDIDATES]; + int nposs = 0, nhateposs = 0; if (db) dblog(".oO { looking for a target . }"); - // look for any race which we hate + + // look for any hated lfs or enemies newtarget = NULL; for (n = 0; n < lf->nlos; n++) { lifeform_t *who; - if (lf->los[n] != lf->cell) { + if (lf->los[n] != lf->cell) { // not ourself who = lf->los[n]->lf; if (who && !isdead(who) && !isunconscious(who) && cansee(lf, who)) { - if (lfhasflagval(lf, F_HATESRACE, who->race->id, NA, NA, NULL) || - lfhasflagval(lf, F_HATESRACE, who->race->baseid, NA, NA, NULL) ) { - if (db) dblog(".oO { found a hated target - lfid %d (%s) ! }",who->id, who->race->name); - newtarget = who; - break; + int chance = 100; + // targets sleeping in a tent will probably be ignored + if (isresting(lf)) { + object_t *restob; + restob = getrestob(who); + if (restob && (restob->type->id == OT_TENT)) { + chance = 5; + } } - } - } - } - if (!newtarget) { - // now look for enemies - for (n = 0; n < lf->nlos; n++) { - if (lf->los[n] != lf->cell) { - lifeform_t *who; - who = lf->los[n]->lf; - if (who && cansee(lf, who) && !isdead(who) && !isunconscious(who)) { - if (areenemies(lf, who)) { - if (db) dblog(".oO { found an enemy target - lfid %d (%s) ! }",who->id, who->race->name); - newtarget = who; + if (pctchance(chance)) { + if (lfhasflagval(lf, F_HATESRACE, who->race->id, NA, NA, NULL) || + lfhasflagval(lf, F_HATESRACE, who->race->baseid, NA, NA, NULL) ) { + if (nhateposs < MAXCANDIDATES) { + if (db) dblog(".oO { found a hated target - lfid %d (%s) ! }",who->id, who->race->name); + hateposs[nhateposs++] = who; + } break; + } else if (!nhateposs && areenemies(lf, who)) { // dont check if we've already found a hated target + if (nposs < MAXCANDIDATES) { + if (db) dblog(".oO { found an enemy target - lfid %d (%s) ! }",who->id, who->race->name); + poss[nposs++] = who; + } } } } } } + if (nhateposs) { + newtarget = hateposs[rnd(0,nhateposs-1)]; + } else if (nposs) { + newtarget = poss[rnd(0,nposs-1)]; + } } if (newtarget) { @@ -1788,7 +1814,7 @@ int aispellok(lifeform_t *lf, enum OBTYPE spellid, lifeform_t *victim, enum FLAG if ((ot->id == OT_S_SMITEEVIL) && (getalignment(victim) != AL_EVIL)) { specificcheckok = B_FALSE; } - if ((ot->id == OT_A_SPRINT) && (lfhasflag(lf, F_SPRINTING) || !lf->stamina)) { + if ((ot->id == OT_A_SPRINT) && (lfhasflag(lf, F_SPRINTING) || !getstamina(lf))) { specificcheckok = B_FALSE; } if ((ot->id == OT_A_STEAL) || (ot->id == OT_S_CONFISCATE)) { diff --git a/attack.c b/attack.c index 23f9f79..931f027 100644 --- a/attack.c +++ b/attack.c @@ -175,7 +175,7 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) { int attackedpeaceful = B_FALSE; // warn if attacking will cause injury - if (!force && isplayer(lf)) { + if (!force && isplayer(lf) && haslos(lf, c)) { if (!confirm_injury_action(BP_HANDS, DT_SLASH, "attack")) { return B_TRUE; } @@ -268,12 +268,6 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) { return B_TRUE; } - // lose a tiny bit of stamina - modstamina(lf, -0.2); - - // stop sprinting - stopsprinting(lf); - // ai code... if (lfhasflag(lf, F_DEMANDSBRIBE)) { if (!isplayer(lf) && (attacktype == AT_LF) && isplayer((lifeform_t *)attacktarget)) { @@ -336,9 +330,6 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) { innateattacks = countinnateattacks(lf); - // stop sprinting - stopsprinting(lf); - // take time attacktime = getattackspeed(lf); @@ -467,7 +458,7 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) { sayphrase(lf, SP_SORRY, -1, NA, NULL); } - if (lfhasflagval(lf, F_INJURY, NA, BP_HANDS, DT_SLASH, NULL)) { + if (hasbleedinginjury(lf, BP_HANDS)) { if (!bleedfrom(lf, BP_HANDS, B_FALSE)) { losehp(lf, 1, DT_DIRECT, NULL, "blood loss"); } @@ -517,6 +508,11 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) { } } + // lose a bit of stamina + modstamina(lf, -getattackstamloss(lf)); + + // stop sprinting + stopsprinting(lf); return B_FALSE; } @@ -2070,7 +2066,7 @@ int getdamroll(object_t *o, lifeform_t *victim, flag_t *damflag) { } if (victim) { - if (lfhasflagval(victim, F_INJURY, NA, BP_BODY, DT_SLASH, NULL)) { + if (hasbleedinginjury(victim, BP_BODY)) { if (willbleedfrom(victim, BP_BODY)) { // extra damage dam += rnd(1,2); @@ -2236,7 +2232,7 @@ void modifyforsize(int *val, lifeform_t *lf, lifeform_t *victim, int howmuch, en } } -// returns true if we hit +// returns true if we hit. also sets 'critical' if passed int rolltohit(lifeform_t *lf, lifeform_t *victim, object_t *wep, int *critical) { int acc,ev; int gothit = B_FALSE; @@ -2286,6 +2282,10 @@ int rolltohit(lifeform_t *lf, lifeform_t *victim, object_t *wep, int *critical) acc += 30; } + if (lfhasflag(lf, F_AIMEDSTRIKE)) { + acc -= 50; + } + // modify for defender's evasion if (isprone(victim) || !cansee(victim, lf)) { ev = 0; @@ -2310,6 +2310,10 @@ int rolltohit(lifeform_t *lf, lifeform_t *victim, object_t *wep, int *critical) if (pctchance(acc)) gothit = B_TRUE; } + if (gothit && lfhasflag(lf, F_AIMEDSTRIKE) && critical) { + *critical = 1; + } + return gothit; } diff --git a/data.c b/data.c index 2d1d934..995fac4 100644 --- a/data.c +++ b/data.c @@ -112,7 +112,7 @@ void initjobs(void) { // this will make sure that they have the letter 'a'. addjob(J_GOD, "Diety"); addflag(lastjob->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastjob->flags, F_STARTATT, A_DEX, AT_EXHIGH, NA, NULL); + addflag(lastjob->flags, F_STARTATT, A_AGI, AT_EXHIGH, NA, NULL); addflag(lastjob->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); addflag(lastjob->flags, F_STARTATT, A_CON, AT_EXHIGH, NA, NULL); addflag(lastjob->flags, F_STARTATT, A_WIS, AT_EXHIGH, NA, NULL); @@ -184,7 +184,7 @@ void initjobs(void) { addjob(J_ALLOMANCER, "Allomancer"); // stat mods - addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 2, NA, NULL); // initial objects addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "1 gold coins"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "club"); @@ -251,6 +251,7 @@ void initjobs(void) { addflag(lastjob->flags, F_CANLEARN, SK_THROWING, PR_EXPERT, NA, NULL); addflag(lastjob->flags, F_CANLEARN, SK_UNARMED, PR_SKILLED, NA, NULL); // abilities + addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); addjob(J_DRUID, "Druid"); // stats addflag(lastjob->flags, F_MPDICE, 1, 1, NA, NULL); @@ -292,7 +293,7 @@ void initjobs(void) { addjob(J_MONK, "Monk"); // stats addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 2, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 4, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 4, NA, NULL); // initial objects addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "robe"); @@ -331,11 +332,11 @@ void initjobs(void) { addflag(lastjob->flags, F_LEVSPELL, 3, OT_S_LOWERMETAB, NA, NULL); // 4: self-healing (mp), immune to haste/slow (innate) addflag(lastjob->flags, F_LEVFLAG, 4, F_DISEASEIMMUNE, B_TRUE, NULL); - addflag(lastjob->flags, F_LEVABIL, 5, OT_A_HEAVYBLOW, 3, NULL); + addflag(lastjob->flags, F_LEVABIL, 5, OT_A_FLURRY, NA, "pw:1;"); // 6: waterawlk via 'body equilibrium' (innate) - addflag(lastjob->flags, F_LEVFLAG, 7, F_TREMORSENSE, 3, NULL); + addflag(lastjob->flags, F_LEVFLAG, 7, F_TREMORSENSE, NA, NULL); // 8: molecular manipulation (ie. lower hardness of physical obs by level-7, not lfs) (innate) - addflag(lastjob->flags, F_LEVABIL, 8, OT_A_FLURRY, 3, "pw:1;"); + addflag(lastjob->flags, F_LEVABIL, 8, OT_A_AIMEDSTRIKE, NA, NULL); // 9: resistance to charm, hypnosis, sleep (innate) addflag(lastjob->flags, F_LEVFLAG, 10, F_DTIMMUNE, DT_POISON, NULL); addflag(lastjob->flags, F_LEVSPELL, 11, OT_S_PSYARMOUR, NA, NULL); @@ -374,7 +375,7 @@ void initjobs(void) { // abilities addflag(lastjob->flags, F_EVASION, 30, NA, NA, NULL); addflag(lastjob->flags, F_OBESE, B_TRUE, NA, NA, NULL); - addflag(lastjob->flags, F_CANWILL, OT_A_JUMP, 3, 3, NULL); + addflag(lastjob->flags, F_CANWILL, OT_A_JUMP, NA, NA, NULL); addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); addjob(J_PRINCE, "Prince"); // stats @@ -414,7 +415,7 @@ void initjobs(void) { addjob(J_PIRATE, "Pirate"); // stats addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 3, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 2, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_CON, 4, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, -3, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, -3, NA, NULL); @@ -449,7 +450,7 @@ void initjobs(void) { addflag(lastjob->flags, F_STABILITY, B_TRUE, NA, NA, NULL); addflag(lastjob->flags, F_NOBODYPART, BP_LEFTFINGER, NA, NA, NULL); addflag(lastjob->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); - addflag(lastjob->flags, F_EXTRALUCK, B_TRUE, NA, NA, NULL); + addflag(lastjob->flags, F_EXTRALUCK, 1, NA, NA, NULL); addflag(lastjob->flags, F_HASPET, NA, NA, NA, "young hawk"); addflag(lastjob->flags, F_MAXATTACKS, 2, 2, NA, NULL);// this is so that our hookhand works addflag(lastjob->flags, F_INJURY, IJ_EYEDESTROYED, NA, NA, NULL); @@ -459,7 +460,7 @@ void initjobs(void) { addjob(J_ROGUE, "Rogue"); // stats addflag(lastjob->flags, F_JOBATTRMOD, A_STR, -3, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 4, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_CON, -2, NA, NULL); // initial objects addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "dagger"); @@ -503,7 +504,7 @@ void initjobs(void) { addjob(J_WARRIOR, "Warrior"); // stats addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 2, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_DEX, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 2, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_IQ, -3, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_CON, 2, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, -3, NA, NULL); @@ -545,11 +546,12 @@ void initjobs(void) { // abilities addflag(lastjob->flags, F_MAXHPMOD, 120, NA, NA, NULL); addflag(lastjob->flags, F_SELECTWEAPON, B_TRUE, NA, NA, NULL); - addflag(lastjob->flags, F_LEVABIL, 3, OT_A_HEAVYBLOW, 3, NULL); - addflag(lastjob->flags, F_LEVABIL, 4, OT_A_WARCRY, 4, NULL); - addflag(lastjob->flags, F_LEVABIL, 5, OT_A_CHARGE, 5, NULL); - addflag(lastjob->flags, F_LEVABIL, 6, OT_A_RAGE, 50, NULL); - addflag(lastjob->flags, F_LEVABIL, 10, OT_A_HURRICANESTRIKE, 5, NULL); + addflag(lastjob->flags, F_LEVABIL, 3, OT_A_HEAVYBLOW, NA, NULL); + addflag(lastjob->flags, F_LEVABIL, 4, OT_A_WARCRY, NA, NULL); + addflag(lastjob->flags, F_LEVABIL, 5, OT_A_CHARGE, NA, NULL); + addflag(lastjob->flags, F_LEVABIL, 6, OT_A_RAGE, NA, NULL); + addflag(lastjob->flags, F_LEVABIL, 8, OT_A_AIMEDSTRIKE, NA, NULL); + addflag(lastjob->flags, F_LEVABIL, 10, OT_A_HURRICANESTRIKE, NA, NULL); addflag(lastjob->flags, F_HIRABLE, B_TRUE, NA, NA, NULL); addjob(J_WIZARD, "Wizard"); @@ -772,7 +774,7 @@ void initobjects(void) { addbrand(BR_WEAKNESS, "of feebleness", BP_HANDS); addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_STR, -3, NULL, PERMENANT, B_UNKNOWN, -1); addbrand(BR_NIMBLENESS, "of nimbleness", BP_HANDS); - addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_DEX, 3, NULL, PERMENANT, B_UNKNOWN, -1); + addflag_real(lastbrand->flags, F_EQUIPCONFER, F_ATTRMOD, A_AGI, 3, NULL, PERMENANT, B_UNKNOWN, -1); // head addbrand(BR_THINKING, "of thinking", BP_HEAD); @@ -2081,6 +2083,7 @@ void initobjects(void) { addot(OT_S_SPARK, "spark", "Creates a tiny spark of flame, dealing 1-3 fire damage to creatures and objects.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); addflag(lastot->flags, F_SPELLSCHOOL, SS_FIRE, NA, NA, NULL); addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addflag(lastot->flags, F_SPELLLEVEL, 1, NA, NA, NULL); addflag(lastot->flags, F_MAXPOWER, 1, NA, NA, NULL); addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); @@ -2235,7 +2238,7 @@ void initobjects(void) { addflag(lastot->flags, F_AICASTTOATTACK, ST_ANYWHERE, NA, NA, NULL); addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); /////////////////// - // nature + // nature / enviromancy /////////////////// // l1 addot(OT_S_CALMANIMALS, "calm animals", "Makes animals within the casters line of sight become peaceful.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); @@ -2392,6 +2395,12 @@ void initobjects(void) { addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_NEED, NA, NULL); // l5 + addot(OT_S_EARTHQUAKE, "earthquake", "Opens up huge rents in the earth around you, collapsing walls and dropping enemies into the ground.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 5, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); + addflag(lastot->flags, F_MAXPOWER, 10, NA, NA, NULL); + addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL); addot(OT_S_HAILSTORM, "hail storm", "Creates an intense storm of hail, causing damage to all within.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the size of the storm."); addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "This spell's power is boosted when cast outside."); @@ -2446,6 +2455,11 @@ void initobjects(void) { addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_VICTIM, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOFLEE, ST_VICTIM, NA, NA, NULL); + addot(OT_S_FORCESPHERE, "force sphere", "Radiates a shock wave out from the caster, knocking opponents away.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines the radius of the blast (1 - 3 cells)."); + addflag(lastot->flags, F_SPELLSCHOOL, SS_GRAVITY, NA, NA, NULL); + addflag(lastot->flags, F_SPELLLEVEL, 3, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOFLEE, ST_ADJSELF, NA, NA, NULL); // l4 addot(OT_S_GRAVBOOST, "boost gravity", "Greatly increases gravity around the target, stopping them from moving.", MT_NOTHING, 0, OC_SPELL, SZ_TINY); addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "The spell's power determines how long its effects will last."); @@ -2870,6 +2884,10 @@ void initobjects(void) { addflag(lastot->flags, F_LOSLOF, B_FALSE, LOF_DONTNEED, NA, NULL); // abilities + addot(OT_A_AIMEDSTRIKE, "aimed strike", "A carefully placed strike - much lower accuracy but causes a critical hit if it connects.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); + addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJVICTIM, NA, NA, NULL); + addflag(lastot->flags, F_STAMCOST, 2, NA, NA, NULL); addot(OT_A_EMPLOY, "employ", "Assigns a job to the target lifeform.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); addot(OT_A_CHARGE, "charge", "You can quickly charge into close quarters for battle.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); @@ -2912,6 +2930,7 @@ void initobjects(void) { addot(OT_A_HURRICANESTRIKE, "hurricane strike", "A sweeping attack aginst everything nearby.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_ADJSELF, NA, NA, NULL); + addflag(lastot->flags, F_STAMCOST, 4, NA, NA, NULL); addot(OT_A_INSPECT, "inspect", "Try to identify an unknown scroll, book, wand or ring from your pack.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); addot(OT_A_JUMP, "jump", "You can leap large distances.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); @@ -3868,6 +3887,29 @@ void initobjects(void) { // NOTE: must add F_TRAIL when creating this object. // effects + addot(OT_DUSTCLOUD, "large dust cloud", "A very thick cloud of dust particles.", MT_GAS, 0, OC_EFFECT, SZ_LARGE); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "}"); + addflag(lastot->flags, F_NODIECONVERTTEXT, NA, NA, NA, NULL); + addflag(lastot->flags, F_DIECONVERT, NA, NA, NA, "small dust cloud"); + addflag(lastot->flags, F_OBHP, 3, 3, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addflag(lastot->flags, F_CAUSESCOUGH, 18, NA, NA, NULL); + + addot(OT_DUSTPUFF, "small dust cloud", "A small cloud of dust particles.", MT_GAS, 0, OC_EFFECT, SZ_MEDIUM); + addflag(lastot->flags, F_GLYPH, C_BROWN, NA, NA, "}"); + addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "disperses"); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + addflag(lastot->flags, F_OBHPDRAIN, 1, NA, NA, NULL); + addflag(lastot->flags, F_NOOBDAMTEXT, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_BLOCKSVIEW, 3, NA, NA, NULL); + addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "."); + addflag(lastot->flags, F_CAUSESCOUGH, 12, NA, NA, NULL); + addot(OT_FIRELARGE, "large fire", "A large, roaring inferno.", MT_FIRE, 0, OC_EFFECT, SZ_HUMAN); addflag(lastot->flags, F_GLYPH, C_ORANGE, NA, NA, "{"); addflag(lastot->flags, F_DIECONVERTTEXT, NA, NA, NA, "dies down a little"); @@ -3953,6 +3995,7 @@ void initobjects(void) { addflag(lastot->flags, F_DAMAGABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); + addot(OT_SMOKECLOUD, "cloud of smoke", "A thick cloud of black smoke.", MT_GAS, 0, OC_EFFECT, SZ_LARGE); addflag(lastot->flags, F_GLYPH, NA, NA, NA, "}"); addflag(lastot->flags, F_NODIECONVERTTEXT, NA, NA, NA, NULL); @@ -3965,7 +4008,6 @@ void initobjects(void) { addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); addflag(lastot->flags, F_CAUSESCOUGH, 26, NA, NA, NULL); - addot(OT_SMOKEPUFF, "puff of smoke", "A small puff of black smoke.", MT_GAS, 0, OC_EFFECT, SZ_MEDIUM); addflag(lastot->flags, F_GLYPH, NA, NA, NA, "}"); addflag(lastot->flags, F_OBDIETEXT, B_TRUE, NA, NA, "disperses"); @@ -4069,7 +4111,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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, NA, NULL); addot(OT_ARMOURLEATHER, "leather armour", "Body armour created from soft leather.", MT_LEATHER, 10, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); @@ -4124,7 +4166,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); addflag(lastot->flags, F_ARMOURRATING, 2, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 7, NA, NULL); addflag(lastot->flags, F_OBHP, 10, 10, NA, NULL); addot(OT_SILKSHIRT, "silk shirt", "A lightweight, comfortable white silk shirt.", MT_SILK, 0.5, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); @@ -4132,7 +4174,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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, NA, NULL); addot(OT_ROBE, "robe", "A plain robe.", MT_CLOTH, 4, OC_ARMOUR, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_BODY, NA, NA, NULL); @@ -4156,7 +4198,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_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_WAIST, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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); @@ -4165,20 +4207,20 @@ 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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); 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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_LEGS, 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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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_DUNGEON, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_GOESON, BP_LEGS, NA, NA, NULL); @@ -4186,7 +4228,7 @@ void initobjects(void) { 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, 9, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, NA, NULL); // armour - feet addot(OT_SANDALS, "pair of sandals", "Comfortable pair of open leather sandals.", MT_LEATHER, 1, OC_ARMOUR, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); @@ -4200,7 +4242,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_DEX, 7, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 7, 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_DUNGEON, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_GOESON, BP_FEET, NA, NA, NULL); @@ -4208,28 +4250,28 @@ 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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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_DUNGEON, 100, RR_RARE, NULL); 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_EQUIPCONFER, F_STABILITY, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 7, 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_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_COMMON, NULL); 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_DEX, 7, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 7, 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_DUNGEON, 100, RR_UNCOMMON, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, RR_RARE, NULL); 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_DEX, 7, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 7, 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); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_COMMON, NULL); @@ -4237,20 +4279,20 @@ 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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_HANDS, 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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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_DUNGEON, 100, RR_COMMON, NULL); addflag(lastot->flags, F_GOESON, BP_HANDS, NA, NA, NULL); 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_DEX, 3, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 3, 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); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, RR_UNCOMMON, NULL); @@ -4416,7 +4458,7 @@ void initobjects(void) { addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL); addot(OT_RING_DEX, "ring of dexterity", "Increases the wearer's dexterity.", MT_METAL, 0.1, OC_RING, SZ_MINI); addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, ""); - addflag(lastot->flags, F_EQUIPCONFER, F_ATTRMOD, A_DEX, 1, NULL); // '1' is randomized during generation + addflag(lastot->flags, F_EQUIPCONFER, F_ATTRMOD, A_AGI, 1, NULL); // '1' is randomized during generation addflag(lastot->flags, F_IDWHENUSED, B_TRUE, NA, NA, NULL); addot(OT_RING_HUNGER, "ring of hunger", "Greatly increases the metabolic rate of the wearer.", MT_METAL, 0.1, OC_RING, SZ_MINI); @@ -4596,6 +4638,7 @@ void initobjects(void) { addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, ST_ASLEEP, NA, NULL); addot(OT_NEEDLE, "needle", "A tiny pointed needle.", MT_METAL, 0.02, OC_MISSILE, SZ_TINY); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "It makes sewing easier."); addflag(lastot->flags, F_STACKABLE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_THROWMISSILE, B_TRUE, NA, NA, ""); addflag(lastot->flags, F_MISSILEDAM, 1, NA, NA, ""); @@ -4669,7 +4712,7 @@ void initobjects(void) { addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); 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_OBATTACKDELAY, 150, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 180, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_CHOP, NA, NA, "1d9+1"); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 70, NA, NA, NULL); @@ -4712,6 +4755,12 @@ 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_CANBEDIFFMAT, MT_SILVER, 10, NA, NULL); + 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_DAM, DT_PIERCE, NA, NA, "1d2"); + addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); + addflag(lastot->flags, F_OBHP, 2, 2, NA, NULL); + 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); addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d3"); @@ -4749,7 +4798,7 @@ void initobjects(void) { addflag(lastot->flags, F_DISARMATTACK, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_SHORTBLADES, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 10, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 10, NA, NULL); addot(OT_SHORTSWORD, "short sword", "A short blade for fighting. Better for stabbing.", MT_METAL, 4, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); addflag(lastot->flags, F_DAM, DT_PIERCE, NA, NA, "1d6"); @@ -4783,7 +4832,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); addot(OT_GREATSWORD, "greatsword", "A massive two-handed sword.", MT_METAL, 10, OC_WEAPON, SZ_MEDIUM); addflag(lastot->flags, F_RARITY, H_DUNGEON, 55, NA, NULL); - addflag(lastot->flags, F_OBATTACKDELAY, 150, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 180, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_SLASH, NA, NA, "1d12+6"); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); @@ -4839,7 +4888,7 @@ void initobjects(void) { 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, 13, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 7, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 7, NA, NULL); 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); @@ -4850,7 +4899,7 @@ void initobjects(void) { addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_POLEARMS, NA, NA, NULL); addflag(lastot->flags, F_ATTREQ, A_STR, 13, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 9, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 9, NA, NULL); 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); @@ -4870,7 +4919,7 @@ void initobjects(void) { 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, 13, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 9, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 9, NA, NULL); 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_OBATTACKDELAY, 150, NA, NA, NULL); @@ -4928,7 +4977,7 @@ void initobjects(void) { 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, 7, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 9, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 9, NA, NULL); addflag(lastot->flags, F_RODSHAPED, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); @@ -4969,7 +5018,7 @@ void initobjects(void) { addflag(lastot->flags, F_CRITCHANCE, 8, 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); addflag(lastot->flags, F_RARITY, H_DUNGEON, 50, NA, NULL); - addflag(lastot->flags, F_OBATTACKDELAY, 180, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 220, NA, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d10+5"); addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL); addflag(lastot->flags, F_TWOHANDED, B_TRUE, NA, NA, NULL); @@ -4997,15 +5046,21 @@ void initobjects(void) { addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d6+1"); addflag(lastot->flags, F_ACCURACY, 75, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); - addflag(lastot->flags, F_ATTREQ, A_DEX, 10, NA, NULL); + addflag(lastot->flags, F_ATTREQ, A_AGI, 10, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); addot(OT_SPANNER, "spanner", "A long, heavy metal wrench.", MT_METAL, 1, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "It makes metalwork easier."); addflag(lastot->flags, F_RARITY, H_DUNGEON, 70, NA, NULL); addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d4"); addflag(lastot->flags, F_ACCURACY, 65, NA, NA, NULL); addflag(lastot->flags, F_OPERABLE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_OPERNEEDDIR, B_TRUE, NA, NA, "Use your spanner in which direction"); addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); + addot(OT_SHILLELAGH, "shillelagh", "An small club, lightweight yet surprisingly effective. Irish in origin.", MT_WOOD, 2, OC_WEAPON, SZ_MEDIUM); + addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); + addflag(lastot->flags, F_DAM, DT_BASH, NA, NA, "1d4+1"); + addflag(lastot->flags, F_ACCURACY, 90, NA, NA, NULL); + addflag(lastot->flags, F_USESSKILL, SK_CLUBS, NA, NA, NULL); addot(OT_STICK, "stick", "A sturdy wooden stick.", MT_WOOD, 0.5, OC_WEAPON, SZ_SMALL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 100, NA, NULL); addflag(lastot->flags, F_RARITY, H_FOREST, 100, NA, NULL); @@ -5178,7 +5233,7 @@ void initrace(void) { //addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d4"); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "11-13"); + addflag(lastrace->flags, F_STARTATT, A_AGI, NA, NA, "11-13"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_LTAVERAGE, NA, NULL); @@ -5194,8 +5249,8 @@ void initrace(void) { addflag(lastrace->flags, F_FLEEONHPPCT, 40, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_POLEARMS, PR_ADEPT, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_ARMOUR, PR_ADEPT, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_HEAVYBLOW, 2, 2, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_HURRICANESTRIKE, 2, 2, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HEAVYBLOW, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HURRICANESTRIKE, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_RAGE, 20, 20, NULL); addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); @@ -5205,7 +5260,7 @@ void initrace(void) { addrace(R_HUMAN, "human", 75, '@', C_GREY, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); @@ -5227,7 +5282,7 @@ void initrace(void) { // stats addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_LOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); @@ -5258,7 +5313,7 @@ void initrace(void) { // stats addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_LOW, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LOW, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_LOW, NA, NULL); @@ -5301,7 +5356,7 @@ void initrace(void) { addrace(R_DWARF, "dwarf", 60, 'h', C_BROWN, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_LTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); @@ -5323,7 +5378,7 @@ void initrace(void) { addrace(R_ELF, "elf", 60, '@', C_GREEN, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_PLAYABLE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_AVERAGE, NA, NULL); @@ -5412,13 +5467,14 @@ void initrace(void) { addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+2"); addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-2 gold coins"); addflag(lastrace->flags, F_STARTOB, 25, OC_POTION, NA, "potion of rum"); addflag(lastrace->flags, F_STARTSKILL, SK_THIEVERY, PR_BEGINNER, NA, NULL); addflag(lastrace->flags, F_RANDOMTALKPCT, 30, NA, NA, NULL); addflag(lastrace->flags, F_RANDOMTALK, SP_BEG, SV_WHISPER, SV_TALK, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_DRUNK, "drunkard", 90, '@', C_GREY, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_RARITY, H_VILLAGE, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); @@ -5435,6 +5491,7 @@ void initrace(void) { addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RANDOMTALKPCT, 30, NA, NA, NULL); addflag(lastrace->flags, F_RANDOMTALK, SP_DRUNK, SV_WHISPER, SV_SHOUT, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); f = addflag(lastrace->flags, F_DRUNK, 5, NA, NA, NULL); addcondition(f, FC_NOCONDITION, 30); addaltval(f, F_DRUNK, 3, NA, NA, NULL); @@ -5454,6 +5511,7 @@ void initrace(void) { addflag(lastrace->flags, F_ISPRISONER, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HIREPRICE, 0, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_TOWNGUARD, "town guard", 100, '@', C_GREY, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); @@ -5486,7 +5544,7 @@ void initrace(void) { addrace(R_GODPURITY, "Amberon", 90, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD); addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "20"); - addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_AGI, NA, NA, "10"); addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "18"); addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "16"); addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "16"); @@ -5534,7 +5592,7 @@ void initrace(void) { addrace(R_GODTHIEVES, "Felix", 300, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD); addflag(lastrace->flags, F_ALIGNMENT, AL_NEUTRAL, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "20"); - addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_AGI, NA, NA, "10"); addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "9"); addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "10"); addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "8"); @@ -5579,7 +5637,7 @@ void initrace(void) { addrace(R_GODDEATH, "Hecta", 100, '@', C_BOLDMAGENTA, MT_FLESH, RC_GOD); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "16"); - addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "20"); + addflag(lastrace->flags, F_STARTATT, A_AGI, NA, NA, "20"); addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "15"); addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "18"); addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "6"); @@ -5625,7 +5683,7 @@ void initrace(void) { addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); addflag(lastrace->flags, F_FLEEONHPPCT, 95, NA, NA, ""); addflag(lastrace->flags, F_STARTATT, A_STR, NA, NA, "10"); - addflag(lastrace->flags, F_STARTATT, A_DEX, NA, NA, "10"); + addflag(lastrace->flags, F_STARTATT, A_AGI, NA, NA, "10"); addflag(lastrace->flags, F_STARTATT, A_WIS, NA, NA, "18"); addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "17"); addflag(lastrace->flags, F_STARTATT, A_CON, NA, NA, "10"); @@ -5716,7 +5774,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "roars^a roar"); addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "roars^a roar"); addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_HEAVYBLOW, 2, 2, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_HEAVYBLOW, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); addflag(lastrace->flags, F_MINIONS, 50, 1, 3, "goblin"); @@ -5726,7 +5784,7 @@ void initrace(void) { addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); addrace(R_COCKATRICE, "cockatrice", 5, 'c', C_YELLOW, MT_FLESH, RC_MAGIC); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, "splash of cockatrice blood"); @@ -5778,7 +5836,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTHIDDENPCT, 80, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_EXHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); @@ -5849,6 +5907,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d5"); addflag(lastrace->flags, F_STARTOB, 90, NA, NA, "25-100 gold coins"); addflag(lastrace->flags, F_STARTOB, 70, NA, NA, "1-2 boulders"); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); f = addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "great club"); addcondition(f, FC_NOCONDITION, 70); @@ -5892,11 +5951,12 @@ void initrace(void) { addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "bellows^a bellow"); addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_GIANTFIREFC, "fire giant forgecaller", 160, 'H', C_RED, MT_FLESH, RC_HUMANOID); lastrace->baseid = R_GIANTFIRE; @@ -5921,7 +5981,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "bellows^a bellow"); addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); addflag(lastrace->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL); @@ -5932,6 +5992,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTSKILL, SK_SS_FIRE, PR_ADEPT, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_GIANTFIRETITAN, "fire titan", 160, 'H', C_RED, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); @@ -5952,7 +6013,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTOBCLASS, 30, OC_POTION, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 4, NA, "bellows^a bellow"); addflag(lastrace->flags, F_NOISETEXT, N_WALK, 3, NA, "^crackling flames."); addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, NULL); @@ -5961,6 +6022,7 @@ void initrace(void) { addflag(lastrace->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); // TODO: storm giant // TODO: storm titan @@ -5979,7 +6041,7 @@ void initrace(void) { addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+4"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); @@ -5993,6 +6055,7 @@ void initrace(void) { addflag(lastrace->flags, F_BODYPARTNAME, BP_HANDS, NA, NA, "claws"); addflag(lastrace->flags, F_BODYPARTNAME, BP_RIGHTFINGER, NA, NA, "right foreclaw"); addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_GNOLLHM, "gnoll huntmaster", 130, 'h', C_BROWN, MT_FLESH, RC_HUMANOID); lastrace->baseid = R_GNOLL; @@ -6009,7 +6072,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+4"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); @@ -6026,6 +6089,7 @@ void initrace(void) { addflag(lastrace->flags, F_BODYPARTNAME, BP_HANDS, NA, NA, "claws"); addflag(lastrace->flags, F_BODYPARTNAME, BP_RIGHTFINGER, NA, NA, "right foreclaw"); addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_GNOLLMR, "gnoll marauder", 130, 'h', C_BROWN, MT_FLESH, RC_HUMANOID); lastrace->baseid = R_GNOLL; @@ -6042,7 +6106,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4+2"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); @@ -6058,6 +6122,7 @@ void initrace(void) { addflag(lastrace->flags, F_BODYPARTNAME, BP_HANDS, NA, NA, "claws"); addflag(lastrace->flags, F_BODYPARTNAME, BP_RIGHTFINGER, NA, NA, "right foreclaw"); addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_GOBLIN, "goblin", 20, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); @@ -6073,7 +6138,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-25 gold coins"); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "short sword"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "sling"); @@ -6087,6 +6152,7 @@ void initrace(void) { addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTJOB, 25, J_ROGUE, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_NOVICE, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_GOBLINWAR, "goblin warrior", 30, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); @@ -6104,7 +6170,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4+2"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "spear"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "1-5 javelins"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "leather armour"); @@ -6116,6 +6182,7 @@ void initrace(void) { addflag(lastrace->flags, F_MINIONS, 90, 1, 2, "goblin"); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_GOBLINSHOOTER, "goblin sharpshooter", 20, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); lastrace->baseid = R_GOBLIN; @@ -6132,7 +6199,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "short sword"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "hand crossbow"); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "1-15 bolts"); @@ -6147,6 +6214,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTHIDDENPCT, 75, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_GOBLINHEXER, "goblin hexer", 20, 'g', C_BROWN, MT_FLESH, RC_HUMANOID); lastrace->baseid = R_GOBLIN; @@ -6163,7 +6231,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d4"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "club"); addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "leather armour"); addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); @@ -6177,6 +6245,7 @@ void initrace(void) { addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MINIONS, 90, 1, 2, "goblin"); addflag(lastrace->flags, F_CASTCHANCE, 30, NA, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_HOBGOBLIN, "hobgoblin", 90, 'g', C_GREEN, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); @@ -6193,7 +6262,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+2"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 80, NA, NA, "longsword"); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "buckler"); addflag(lastrace->flags, F_STARTOBCLASS, 100, OC_ARMOUR, NA, NULL); @@ -6208,6 +6277,7 @@ void initrace(void) { addflag(lastrace->flags, F_MINIONS, 50, 1, 2, "goblin"); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_HOBGOBLINWAR, "hobgoblin warrior", 90, 'g', C_GREEN, MT_FLESH, RC_HUMANOID); lastrace->baseid = R_HOBGOBLIN; @@ -6225,7 +6295,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d6+4"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "flail"); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-75 gold coins"); addflag(lastrace->flags, F_STARTOB, 90, NA, NA, "large shield"); @@ -6241,6 +6311,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOFLEE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); // TODO: hobgoblin archer // TODO: hobgoblin warcaster @@ -6259,7 +6330,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3-1"); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTOBDT, 20, DT_PIERCE, NA, NULL); addflag(lastrace->flags, F_STARTOBCLASS, 25, OC_POTION, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_THROWING, PR_ADEPT, NA, NULL); @@ -6278,15 +6349,16 @@ void initrace(void) { addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, 78, NA, NULL); - addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4"); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); addflag(lastrace->flags, F_ARMOURRATING, 10, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); - addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d4"); - addflag(lastrace->flags, F_HASATTACK, OT_TAIL, NA, NA, "1d6"); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2"); + addflag(lastrace->flags, F_HASATTACK, OT_TAIL, NA, NA, "1d2"); + addflag(lastrace->flags, F_MAXATTACKS, 1, 1, NA, NULL); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "club"); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "buckler"); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-10 gold coins"); @@ -6295,6 +6367,29 @@ void initrace(void) { addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); addflag(lastrace->flags, F_STENCH, 3, 3, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); + + addrace(R_LEPRECHAUN, "leprechaun", 35, 'n', C_GREEN, MT_FLESH, RC_HUMANOID); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_RARE, NULL); + addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4"); + addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_STR, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_IQ, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "1d2-1"); + addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "shillelagh"); + addflag(lastrace->flags, F_STARTOB, 10, NA, NA, "ring of luck"); + addflag(lastrace->flags, F_STARTOB, 75, NA, NA, "50-100 gold coins"); + addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); + addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_BLINK, 5, 5, "pw:1;"); + addflag(lastrace->flags, F_STARTSKILL, SK_THIEVERY, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_GOLD, B_COVETS, NA, NULL); + addflag(lastrace->flags, F_DODGES, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_EXTRALUCK, 2, NA, NA, NULL); addrace(R_LIZARDMAN, "lizardman", 100, 'z', C_GREEN, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); @@ -6306,7 +6401,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d5+1"); addflag(lastrace->flags, F_HASATTACK, OT_TAIL, NA, NA, "1d4"); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "1-50 gold coins"); @@ -6319,6 +6414,7 @@ void initrace(void) { addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "spits"); addflag(lastrace->flags, F_CANWILL, OT_S_POISONBOLT, 5, 5, "pw:5;"); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_SKILLED, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_MINOTAUR, "minotaur", 130, 'H', C_BROWN, MT_FLESH, RC_HUMANOID); @@ -6334,7 +6430,7 @@ void initrace(void) { addflag(lastrace->flags, F_STAYINROOM, NA, NA, NA, NULL); // stay in our maze addflag(lastrace->flags, F_CARNIVORE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, NA, NA, "5-7"); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_BUTT, NA, NA, "2d4+6"); addflag(lastrace->flags, F_HASATTACK, OT_BUTT, NA, NA, "2d4+6"); @@ -6366,7 +6462,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d4"); addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "2d4"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VLOW, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_WANTS, OT_GOLD, B_COVETS, NA, NULL); @@ -6396,7 +6492,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "3d4"); addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "3d4"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VLOW, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); @@ -6426,7 +6522,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "4d4"); addflag(lastrace->flags, F_HASATTACK, OT_FISTS, NA, NA, "4d4"); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_VLOW, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_WANTSBETTERWEP, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_WANTS, OT_GOLD, NA, NA, NULL); @@ -6469,9 +6565,10 @@ void initrace(void) { addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "shouts^a shout"); addflag(lastrace->flags, F_SEEINDARK, 2, NA, NA, NULL); //addflag(lastrace->flags, F_STARTJOB, 20, J_WIZARD, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, 5, 5, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_ORCWARRIOR, "orc warrior", 90, 'o', C_BROWN, MT_FLESH, RC_HUMANOID); lastrace->baseid = R_ORC; @@ -6504,6 +6601,7 @@ void initrace(void) { addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_ORK, "ork", 90, 'o', C_BROWN, MT_FLESH, RC_HUMANOID); addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "orc corpse"); @@ -6532,6 +6630,7 @@ void initrace(void) { addflag(lastrace->flags, F_SEEINDARK, 3, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTSKILL, SK_PERCEPTION, PR_ADEPT, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_PEGASUS, "pegasus", 130, 'Q', C_GREY, MT_FLESH, RC_MAGIC); addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); @@ -6553,7 +6652,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, NA, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, 2, 2, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); addflag(lastrace->flags, F_SWOOPRANGE, 4, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 4, NA, "screams in pain^screams of pain"); addflag(lastrace->flags, F_RESISTMAG, 5, NA, NA, NULL); @@ -6740,7 +6839,7 @@ void initrace(void) { addflag(lastrace->flags, F_BODYPARTNAME, BP_HANDS, NA, NA, "claws"); addflag(lastrace->flags, F_BODYPARTNAME, BP_RIGHTFINGER, NA, NA, "right foreclaw"); addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); - + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_XAT, "xat", 2, 'x', C_BROWN, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); @@ -6759,6 +6858,7 @@ void initrace(void) { addflag(lastrace->flags, F_BODYPARTNAME, BP_HANDS, NA, NA, "claws"); addflag(lastrace->flags, F_BODYPARTNAME, BP_RIGHTFINGER, NA, NA, "right foreclaw"); addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "snorts^a snort"); // fish addrace(R_CRAB, "giant crab", 150, ';', C_ORANGE, MT_FLESH, RC_AQUATIC); @@ -6802,7 +6902,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOBODYPART, BP_WAIST, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_LEGS, NA, NA, NULL); addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_SONICBOLT, 5, 5, "pw:5;dam:2d6;"); + addflag(lastrace->flags, F_CANWILL, OT_A_SONICBOLT, NA, NA, "pw:5;dam:2d6;"); addflag(lastrace->flags, F_BODYPARTNAME, BP_HANDS, NA, NA, "pincers"); addflag(lastrace->flags, F_BODYPARTNAME, BP_RIGHTFINGER, NA, NA, "right foreclaw"); addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); @@ -6990,6 +7090,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_FLY, 1, NA, "^flapping wings"); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_BATMUTATED, "mutated bat", 3, 'B', C_MAGENTA, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_UNCOMMON, NULL); @@ -7004,7 +7105,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_CASTCHANCE, 40, NA, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_SONICBOLT, 5, 5, "pw:5;dam:1d6;"); + addflag(lastrace->flags, F_CANWILL, OT_A_SONICBOLT, NA, NA, "pw:5;dam:1d6;"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7037,6 +7138,7 @@ void initrace(void) { addflag(lastrace->flags, F_MATVULN, MT_SILVER, 200, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_FLY, 1, NA, "^flapping wings"); addflag(lastrace->flags, F_ENHANCESMELL, 4, NA, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_BEAR, "black bear", 150, 'q', C_BLUE, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); @@ -7166,7 +7268,7 @@ void initrace(void) { addflag(lastrace->flags, F_RARITY, H_FOREST, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_ARMOURRATING, 4, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_AVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_AVERAGE, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "6d4+0"); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); @@ -7200,7 +7302,7 @@ void initrace(void) { addflag(lastrace->flags, F_VEGETARIAN, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SEEINDARK, 1, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "squarks^squarking"); - addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^clucking."); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^clucking"); addrace(R_DOG, "dog", 35, 'd', C_BROWN, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RNDHOSTILE, 10, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); @@ -7226,6 +7328,7 @@ void initrace(void) { addflag(lastrace->flags, F_BODYPARTNAME, BP_HANDS, NA, NA, "paws"); addflag(lastrace->flags, F_BODYPARTNAME, BP_RIGHTFINGER, NA, NA, "right foreclaw"); addflag(lastrace->flags, F_BODYPARTNAME, BP_LEFTFINGER, NA, NA, "left foreclaw"); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_DOGBLINK, "blink dog", 35, 'd', C_BLUE, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_ALIGNMENT, AL_GOOD, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); @@ -7331,10 +7434,11 @@ void initrace(void) { 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); - addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, 3, 3, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); addflag(lastrace->flags, F_SWOOPRANGE, 2, NA, NA, NULL); addflag(lastrace->flags, F_LEVRACE, 4, R_HAWK, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 3, NA, "screeches in pain^screeches of pain"); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_HAWK, "hawk", 1, 'A', C_GREY, MT_FLESH, RC_ANIMAL); // 'A' for Avian lastrace->baseid = R_HAWK; @@ -7357,12 +7461,13 @@ void initrace(void) { addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, 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, 3, 3, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); addflag(lastrace->flags, F_SWOOPRANGE, 3, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 5, NA, NA, NULL); addflag(lastrace->flags, F_SEEINDARK, 4, NA, NA, NULL); addflag(lastrace->flags, F_LEVRACE, 8, R_HAWKBLOOD, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 3, NA, "screeches in pain^screeches of pain"); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_HAWKBLOOD, "blood hawk", 1, 'A', C_RED, MT_FLESH, RC_ANIMAL); // 'A' for Avian lastrace->baseid = R_HAWK; @@ -7385,7 +7490,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, 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, 3, 3, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); addflag(lastrace->flags, F_SWOOPRANGE, 5, NA, NA, NULL); addflag(lastrace->flags, F_SEEINDARK, 6, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 7, NA, NA, NULL); @@ -7410,7 +7515,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOBODYPART, BP_HANDS, 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, 3, 3, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SWOOP, NA, NA, NULL); addflag(lastrace->flags, F_SWOOPRANGE, 8, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_S_COLDBURST, 2, 2, "pw:2;"); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, NA, "screeches"); @@ -7460,6 +7565,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTRESIST, DT_FIRE, B_TRUE, NA, NULL); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_PORCUPINE, "giant porcupine", 10, 'r', C_GREY, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HATESRACE, R_ANT, NA, NA, NULL); @@ -7513,6 +7619,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4"); addflag(lastrace->flags, F_HITCONFER, F_POISONED, SC_POISON, 20, "5-10"); addflag(lastrace->flags, F_HITCONFERVALS, P_VENOM, 1, NA, NULL); + addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "torso"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7523,8 +7630,10 @@ void initrace(void) { addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^hissing"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_SNAKECARPET, "carpet snake", 3, 's', C_GREY, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); @@ -7535,6 +7644,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4"); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3+1"); + addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "torso"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7544,8 +7654,10 @@ void initrace(void) { addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^hissing"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_SNAKETREE, "tree snake", 3, 's', C_GREEN, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); @@ -7556,6 +7668,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "3d4+1"); + addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "torso"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7564,11 +7677,13 @@ void initrace(void) { addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); - addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^hissing"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, 2, 2, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, NA, NA, NULL); addflag(lastrace->flags, F_CASTCHANCE, 60, NA, NA, NULL); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_SNAKECOBRABLACK, "black cobra", 3, 's', C_BLUE, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); @@ -7579,6 +7694,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4"); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3+1"); + addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "torso"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7587,12 +7703,14 @@ void initrace(void) { addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); - addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^hissing"); addflag(lastrace->flags, F_CANWILL, OT_S_POISONBOLT, 4, 4, "pw:3;"); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "spits"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_SNAKECOBRAGOLDEN, "golden cobra", 3, 's', C_YELLOW, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); @@ -7603,6 +7721,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "3d4+2"); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3+1"); + addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "torso"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7611,13 +7730,15 @@ void initrace(void) { addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); - addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^hissing"); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "spits"); addflag(lastrace->flags, F_CASTTYPE, CT_EYESPIT, NA, NA, NULL); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_S_BLINDNESS, 4, 4, "pw:3;range:2;"); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_SNAKECONSTRICTOR, "constrictor", 3, 's', C_MAGENTA, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_COLDBLOOD, B_TRUE, NA, NA, NULL); @@ -7629,6 +7750,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "4d4+3"); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "0d1"); + addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "torso"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7637,11 +7759,13 @@ void initrace(void) { addflag(lastrace->flags, F_NOPACK, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOSPELLS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); - addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^hissing"); + addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^hissing"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); addflag(lastrace->flags, F_CANWILL, OT_A_CRUSH, NA, NA, "dam:2d6;"); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_SNAKEWATER, "water snake", 3, 's', C_BLUE, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_AQUATIC, B_TRUE, NA, NA, NULL); @@ -7654,6 +7778,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4"); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4+1"); + addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "torso"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7664,12 +7789,14 @@ void initrace(void) { addflag(lastrace->flags, F_DTVULN, DT_COLD, NA, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_POISON, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_WALK, 1, NA, "^slithering"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "hisses^hissing"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_TREMORSENSE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_DIURNAL, B_TRUE, NA, NA, NULL); addrace(R_SPIDER, "giant spider", 5, 'S', C_GREY, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); @@ -7691,11 +7818,12 @@ void initrace(void) { addflag(lastrace->flags, F_HOMELEVOB, NA, NA, NA, "1-10 webs"); addflag(lastrace->flags, F_BODYPARTNAME, BP_HEAD, NA, NA, "cephalothorax"); addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "abdomen"); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_SPIDERFUNNELWEB, "giant funnelweb", 5, 'S', C_MAGENTA, MT_FLESH, RC_ANIMAL); lastrace->baseid = R_SPIDER; addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); @@ -7719,11 +7847,12 @@ void initrace(void) { addflag(lastrace->flags, F_HOMELEVOB, NA, NA, NA, "20-30 webs"); addflag(lastrace->flags, F_BODYPARTNAME, BP_HEAD, NA, NA, "cephalothorax"); addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "abdomen"); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_SPIDERREDBACK, "giant redback", 5, 'S', C_RED, MT_FLESH, RC_ANIMAL); lastrace->baseid = R_SPIDER; addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_GTAVERAGE, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, ""); @@ -7747,6 +7876,7 @@ void initrace(void) { addflag(lastrace->flags, F_HOMELEVOB, NA, NA, NA, "10-20 webs"); addflag(lastrace->flags, F_BODYPARTNAME, BP_HEAD, NA, NA, "cephalothorax"); addflag(lastrace->flags, F_BODYPARTNAME, BP_BODY, NA, NA, "abdomen"); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addrace(R_WOLFYOUNG, "young wolf", 10, 'd', C_GREY, MT_FLESH, RC_ANIMAL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); @@ -7766,7 +7896,7 @@ void initrace(void) { addflag(lastrace->flags, F_CARNIVORE, 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); - addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, 8, 8, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, NA, NA, NULL); addflag(lastrace->flags, F_LEVRACE, 5, R_WOLF, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "growls^growling"); @@ -7794,7 +7924,7 @@ void initrace(void) { addflag(lastrace->flags, F_CARNIVORE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_WANTSOBFLAG, F_EDIBLE, B_COVETS, NA, NULL); addflag(lastrace->flags, F_SEEINDARK, 5, NA, NA, NULL); - addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, 5, 5, NULL); + addflag(lastrace->flags, F_CANWILL, OT_A_SPRINT, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_LOWHP, 2, NA, "whines in pain^whining"); addflag(lastrace->flags, F_NOISETEXT, N_FRUSTRATED, 3, NA, "growls^growling"); addflag(lastrace->flags, F_FLEEONHPPCT, 50, NA, NA, ""); @@ -7825,6 +7955,7 @@ void initrace(void) { addrace(R_GIANTFLY, "giant fly", 1, 'i', C_GREY, MT_FLESH, RC_INSECT); lastrace->baseid = R_GIANTFLY; addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); addflag(lastrace->flags, F_NUMAPPEAR, 3, 3, NA, ""); addflag(lastrace->flags, F_MOVESPEED, SP_VERYFAST, NA, NA, ""); @@ -7832,9 +7963,10 @@ void initrace(void) { addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); - addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+0"); + addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d1+0"); addflag(lastrace->flags, F_EVASION, 10, NA, NA, NULL); - addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d2"); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d1-1"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7844,9 +7976,11 @@ void initrace(void) { addflag(lastrace->flags, F_NOISETEXT, N_FLY, 2, NA, "^buzzing"); addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); - addrace(R_GIANTBLOWFLY, "giant blowfly", 2, 'i', C_WHITE, MT_FLESH, RC_INSECT); + addflag(lastrace->flags, F_WANTS, OT_CORPSE, B_COVETS, NA, NULL); + addrace(R_GIANTBLOWFLY, "giant blowfly", 2, 'i', C_GREY, MT_FLESH, RC_INSECT); lastrace->baseid = R_GIANTFLY; addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_ANIMAL, NA, NULL); addflag(lastrace->flags, F_CORPSETYPE, NA, NA, NA, "giant fly corpse"); addflag(lastrace->flags, F_NUMAPPEAR, 1, 2, NA, ""); @@ -7856,7 +7990,8 @@ void initrace(void) { addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "2d4+1"); addflag(lastrace->flags, F_EVASION, 5, NA, NA, NULL); - addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d3"); + addflag(lastrace->flags, F_ENHANCESMELL, 5, NA, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d1"); addflag(lastrace->flags, F_NOBODYPART, BP_WEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SECWEAPON, NA, NA, NULL); addflag(lastrace->flags, F_NOBODYPART, BP_SHOULDERS, NA, NA, NULL); @@ -7866,6 +8001,7 @@ void initrace(void) { addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "buzzes angrily^an angry buzzing"); addflag(lastrace->flags, F_NOISETEXT, N_FLY, 2, NA, "^buzzing"); addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); + addflag(lastrace->flags, F_WANTS, OT_CORPSE, B_COVETS, NA, NULL); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addrace(R_STIRGE, "stirge", 10, 'i', C_BROWN, MT_FLESH, RC_INSECT); addflag(lastrace->flags, F_INSECT, B_TRUE, NA, NA, NULL); @@ -7939,6 +8075,7 @@ void initrace(void) { addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); addflag(lastrace->flags, F_NOISETEXT, N_FLY, 2, NA, "^buzzing"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); // demons addrace(R_DRETCH, "dretch", 30, '&', C_BROWN, MT_FLESH, RC_DEMON); @@ -8000,7 +8137,7 @@ void initrace(void) { addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); addflag(lastrace->flags, F_STARTATT, A_STR, AT_LTAVERAGE, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_HIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_LOW, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3-1"); addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4-1"); @@ -8036,6 +8173,13 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d5"); addflag(lastrace->flags, F_CANWILL, OT_A_GRAB, NA, NA, NULL); addflag(lastrace->flags, F_SILENTMOVE, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_RANDOMTALKPCT, 20, NA, NA, NULL); + addflag(lastrace->flags, F_RANDOMTALK, NA, SV_WHISPER, SV_TALK, "Braaaains..."); + addflag(lastrace->flags, F_RANDOMTALK, NA, SV_WHISPER, SV_TALK, "Fooodd..."); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "moans^a gutteral moan"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "groans^a gutteral groan"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 2, NA, "gurgles^a gurgle"); + addflag(lastrace->flags, F_NOISETEXT, N_GETANGRY, 3, NA, "growls^a growl"); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); @@ -8119,7 +8263,7 @@ void initrace(void) { // special: ghosts gain canwill->possession if they are near // their previous corpse. use f_mycorpse->oid for this. - addrace(R_GHOUL, "ghoul", 50, 'Z', C_BLUE, MT_FLESH, RC_UNDEAD); + addrace(R_GHOUL, "ghoul", 50, 'Z', C_GREEN, MT_FLESH, RC_UNDEAD); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, IQ_MINDLESS, NA, NULL); addflag(lastrace->flags, F_BLOODOB, NA, NA, NA, NULL); @@ -8144,7 +8288,7 @@ void initrace(void) { addrace(R_VAMPIRE, "vampire", 75, 'V', C_BLUE, MT_FLESH, RC_UNDEAD); addflag(lastrace->flags, F_ALIGNMENT, AL_EVIL, NA, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_STR, AT_EXHIGH, NA, NULL); - addflag(lastrace->flags, F_STARTATT, A_DEX, AT_VHIGH, NA, NULL); + addflag(lastrace->flags, F_STARTATT, A_AGI, AT_VHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_WIS, AT_GTAVERAGE, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_IQ, AT_EXHIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CON, AT_AVERAGE, NA, NULL); @@ -8170,7 +8314,7 @@ void initrace(void) { addflag(lastrace->flags, F_HASATTACK, OT_TEETH, NA, NA, "1d4+3"); addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_CANWILL, OT_S_CHARM, 3, 3, "pw:6;"); - addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, 5, 5, "range:3;"); + addflag(lastrace->flags, F_CANWILL, OT_A_CHARGE, NA, NA, "range:3;"); addflag(lastrace->flags, F_CANWILL, OT_S_STUN, 5, 5, "pw:1;"); addflag(lastrace->flags, F_CANWILL, OT_S_POLYMORPH, 3, 3, "pw:1;race:vampire bat;"); addflag(lastrace->flags, F_CASTCHANCE, 40, NA, NA, NULL); @@ -8415,7 +8559,7 @@ void initskills(void) { addskilldesc(SK_SPEECH, PR_SKILLED, "^gShop item prices are reduced by 20%.^n", B_FALSE); addskilldesc(SK_SPEECH, PR_EXPERT, "^gShop item prices are reduced by 25%.^n", B_FALSE); addskilldesc(SK_SPEECH, PR_MASTER, "^gShop item prices are reduced by 30%.^n", B_FALSE); - addskill(SK_SPELLCASTING, "Sorcery", "Increases the power of spells from all schools except Allomancy, Nature and Psionics.", 50); + addskill(SK_SPELLCASTING, "Sorcery", "Increases the power of spells from all schools except Allomancy, Enviromancy and Psionics.", 50); addskilldesc(SK_SPELLCASTING, PR_SKILLED, "^gYou gain the 'study scrolls' ability.^n", B_FALSE); addskill(SK_PERCEPTION, "Perception", "Your ability to notice hidden details, from simple footprints to sinister traps.", 50); addskilldesc(SK_PERCEPTION, PR_INEPT, "- At higher levels this skill will also let you obscure your own tracks.", B_TRUE); diff --git a/data/hiscores.db b/data/hiscores.db index 4bfa493add17295b74e017aa15fbbce7e1096ba9..c09383cc6491a14e095c25ee66ddee774bfdf1ad 100644 GIT binary patch delta 427 zcmZoLXt0otzlZuw1{ag(+sA`8w-CjPCmfJqUp)P%)saYBHTfQ8;EcP5iTIY z8ALdN2*=F_xEy$;c!8#JGKn)VpJSfN9K)=}^qy%uQ$3R(llaEMzl@xwo@@+^!lu?n zldDBkB~w!sit`e)Q}y&c*ch0EO?6p3it>|u%1kFWib(T&W#%U3>zTQOb=Wcibtuc^ zmX;)zq^2k&C6?%!xq&rVGxLHq838qE2$;Hp1ua<~!3AZd(u-0n74q||QuRz+z|!W7 z$_Qzp;>7awqQv52J#%NUUG|J1yTsD-b5c_C6q56kiW2qAogh*yASwIg#G-=K5~$-1 u96@I4n=%PO9IxO}nwyxX5T006l$l@TotcvZa&Vtext is the description // ie 'magic armour', 'force field' @@ -2322,6 +2344,7 @@ enum FLAG { // v1 is enum sleeptype st_xxx // if v2 is set, means we are sleeping on // purpose and will wake up when at full hp/mp/etc. + // ie. "resting" F_ATTACHEDTO, // you are attached to lf id v0, and will move with it F_AWARENESS, // you can see 360 degrees around yourself F_BEINGSTONED,// turn to stone when v0 drops to zero. (drops 1/turn) @@ -2383,7 +2406,6 @@ enum FLAG { // v2 is save difficulty F_GRABBEDBY,// you've been grabbed by lf id v0 F_GRABBING, // you are grabbing lf id v0 - F_HURRICANESTRIKE, // lf is performing a hurricane strike F_HIDING, // lifeform is hiding. v0 is modifier to stealth checks. F_ICESLIDE, // lf has "slide" spell active. // v0 = timeleft (since 'lifetime' is used for FROMSPELL) @@ -2428,7 +2450,6 @@ enum FLAG { F_STENCH, // creatures within v0 gain f_nauseated = v1 F_STUNNED, // cannot attack or cast spells F_TREMORSENSE, // doesn't need eyes to see, can see in dark with v0 - F_TRUESTRIKE, // your attacks ALWAYS hit. turnsleft=v0 F_PRODUCESLIGHT, // produces light of val0 radius. // (but not for obs in pack) // if val2 is true, will only make light if ob diff --git a/io.c b/io.c index 8f022f6..7e99a06 100644 --- a/io.c +++ b/io.c @@ -626,9 +626,9 @@ cell_t *askcoords(char *prompt, char *subprompt, int targettype, lifeform_t *src cell_t *trailtarg = NULL; // show what we are over in msg bar strcpy(buf, ""); + // can we see the cell? if (haslos(player, c)) { int i; - // can see the cell... if (c->lf) { if (cansee(player, c->lf)) { flag_t *f; @@ -1112,7 +1112,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { case A_IQ: msg("^%c%s %s %s!",getlfcol(lf, (f->val[1] < 0) ? CC_BAD : CC_GOOD), lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] < 0) ? "more stupid" : "smarter"); break; - case A_DEX: + case A_AGI: msg("^%c%s %s %s!",getlfcol(lf, (f->val[1] < 0) ? CC_BAD : CC_GOOD), lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] < 0) ? "sluggish" : "more agile"); break; case A_CON: @@ -1138,7 +1138,7 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { case A_IQ: msg("^%c%s %s %s!",getlfcol(lf, (f->val[1] < myatt) ? CC_BAD : CC_GOOD), lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] < myatt) ? "stupid" : "smart"); break; - case A_DEX: + case A_AGI: msg("^%c%s %s %s!",getlfcol(lf, (f->val[1] < myatt) ? CC_BAD : CC_GOOD), lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] < myatt) ? "sluggish" : "agile"); break; case A_CON: @@ -1386,7 +1386,15 @@ int announceflaggain(lifeform_t *lf, flag_t *f) { } break; case F_POISONED: - msg("^%c%s %s very sick.", getlfcol(lf, CC_VBAD), lfname, isplayer(lf) ? "feel" : "looks"); + if (isplayer(lf)) { + if (streq(getpoisondesc(f->val[0]), "Sick")) { + msg("^%cYou have contracted %s.", getlfcol(lf, CC_VBAD), getpoisonname(f->val[0])); + } else { + msg("^%cYou are sick with %s.", getlfcol(lf, CC_VBAD), getpoisonname(f->val[0])); + } + } else { + msg("^%c%s looks very sick.", getlfcol(lf, CC_VBAD), lfname); + } donesomething = B_TRUE; break; case F_ENHANCESEARCH: @@ -1709,7 +1717,7 @@ int announceflagloss(lifeform_t *lf, flag_t *f) { case A_IQ: msg("%s %s %s!",lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] > 0) ? "less smart" : "less stupid"); break; - case A_DEX: + case A_AGI: msg("%s %s %s!",lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] > 0) ? "less agile" : "less sluggish"); break; case A_CON: @@ -1732,7 +1740,7 @@ int announceflagloss(lifeform_t *lf, flag_t *f) { case A_IQ: msg("%s %s %s!",lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] > myatt) ? "less smart" : "less stupid"); break; - case A_DEX: + case A_AGI: msg("%s %s %s!",lfname, isplayer(lf) ? "feel" : "seems", (f->val[1] > myatt) ? "less agile" : "less sluggish"); break; case A_CON: @@ -2348,8 +2356,7 @@ int confirm_injury_action(enum BODYPART bp, enum DAMTYPE dt, char *actionname) { char ch; char ques[BUFLEN]; - if (lfhasflagval(player, F_INJURY, NA, bp, dt, NULL) && - willbleedfrom(player, bp)) { + if (hasbleedinginjury(player, bp) && willbleedfrom(player, bp)) { snprintf(ques, BUFLEN, "Your %s injury will cause damage if you %s - continue?", getinjuredbpname(bp), actionname); ch = askchar(ques, "yn","n", B_TRUE); @@ -3182,7 +3189,6 @@ void describegod(lifeform_t *god) { void describeob(object_t *o) { char buf[BIGBUFLEN]; char *buf2; - cls(); // title @@ -3481,7 +3487,7 @@ void docomms(lifeform_t *lf) { if (givenob) { if ((lf->race->id == R_BEGGAR) && (givenob->type->id == OT_GOLD)) { // begger effects - if (countmoney(lf) == 1) { + if (countmoney(lf->pack) == 1) { i = rnd(1,100); if (i <= 5) { // attack you sayphrase(lf, SP_BEGATTACK, SV_SHOUT, NA, NULL); @@ -3607,7 +3613,7 @@ void docomms(lifeform_t *lf) { msg("You buy %s.", buf); angeramt += 25; // get it identified? - if (!isknown(o) && (countmoney(player) >= DEF_SHOPIDENTPRICE)) { + if (!isknown(o) && (countmoney(player->pack) >= DEF_SHOPIDENTPRICE)) { char buf2[BUFLEN]; char ch2; snprintf(buf2, BUFLEN, "Pay $%d to identify %s?",(int)DEF_SHOPIDENTPRICE, buf); @@ -3917,7 +3923,7 @@ void dovendingmachine(lifeform_t *lf, object_t *vm) { y++; - mvwprintw(mainwin, y, 0, "You have $%d.", countmoney(player)); + mvwprintw(mainwin, y, 0, "You have $%d.", countmoney(player->pack)); y++; y++; @@ -3932,7 +3938,7 @@ void dovendingmachine(lifeform_t *lf, object_t *vm) { o = hasobletter(vm->contents, ch); if (o) { // do you have enough money? - if (countmoney(player) >= getobvalue(o)) { + if (countmoney(player->pack) >= getobvalue(o)) { object_t *gold; // if so, buy it // lose money (do this first to avoid potential weight issues) @@ -4251,6 +4257,25 @@ char *makedesc_ob(object_t *o, char *retbuf) { int obknown,i,throwrange; flag_t *retflag[MAXCANDIDATES]; int nretflags; + object_t *compareob = NULL; + + // do we need to compare this object with an equipped on? + if (!isequipped(o)) { + if (isweapon(o)) { + compareob = getweapon(player); + } else { + getflags(o->flags, retflag, &nretflags, F_GOESON, F_NONE); + for (i = 0; i < nretflags; i++) { + f = retflag[i]; + if (f->id == F_GOESON) { + compareob = getequippedob(player->pack, f->val[0]); + if (compareob) { + break; + } + } + } + } + } strcpy(retbuf, ""); @@ -4261,6 +4286,17 @@ char *makedesc_ob(object_t *o, char *retbuf) { strncat(retbuf, buf, HUGEBUFLEN); strncat(retbuf, "\n\n", HUGEBUFLEN); + // extra object descriptions? + getflags(o->flags, retflag, &nretflags, F_EXTRADESC, F_NONE); + for (i = 0; i < nretflags; i++) { + f = retflag[i]; + snprintf(buf, BUFLEN, "%s\n", f->text); + strncat(retbuf, buf, BUFLEN); + } + if (nretflags) { + strcat(retbuf, "\n"); + } + // append masterwork etc onto description f = hasflag(o->flags, F_MASTERWORK); if (f && f->known) { @@ -4273,6 +4309,7 @@ char *makedesc_ob(object_t *o, char *retbuf) { // weight if (o->material->id != MT_NOTHING) { + float obw; if (o->material->id == MT_FOOD) { snprintf(buf, BUFLEN, "%s %s food product%s, ",(o->amt == 1) ? "It is a" : "They are", getsizetext(getobsize(o)), @@ -4283,20 +4320,41 @@ char *makedesc_ob(object_t *o, char *retbuf) { o->material->name); } + obw = getobweight(o); if (o->amt == 1) { char wbuf[BUFLEN]; - getweighttext(getobweight(o), wbuf, B_FALSE); - snprintf(buf2, BUFLEN, "and weighs %s.",wbuf); + getweighttext(obw, wbuf, B_FALSE); + snprintf(buf2, BUFLEN, "and weighs %s",wbuf); strcat(buf, buf2); } else { char wbuf[BUFLEN]; char wbuf2[BUFLEN]; - getweighttext(getobweight(o), wbuf, B_FALSE); + getweighttext(obw, wbuf, B_FALSE); getweighttext(getobunitweight(o), wbuf2, B_FALSE); - snprintf(buf2, BUFLEN, "and weigh %s (%s each).",wbuf, wbuf2); + snprintf(buf2, BUFLEN, "and weigh %s (%s each)",wbuf, wbuf2); strcat(buf, buf2); } - strncat(retbuf, buf, HUGEBUFLEN); strncat(retbuf, "\n", HUGEBUFLEN); + + + if (compareob && (o->amt == 1)) { + int diff; + float compareobw; + compareobw = getobweight(compareob); + diff = obw - compareobw; + if (diff == 0) { + strcpy(buf2, " (=)"); + } else { + char wbuf[BUFLEN]; + getweighttext(abs(diff), wbuf, B_FALSE); + + // weighing less is better + snprintf(buf2, BUFLEN, " %s(%c%s)^n", (diff > 0) ? "^B" : "^g", + (diff > 0) ? '+' : '-', wbuf); + } + strncat(buf, buf2, HUGEBUFLEN); + } + + strncat(retbuf, buf, HUGEBUFLEN); strncat(retbuf, ".\n", HUGEBUFLEN); throwrange = getmaxthrowrange(player, o); if (throwrange >= 1) { @@ -4356,9 +4414,10 @@ char *makedesc_ob(object_t *o, char *retbuf) { strncat(retbuf, buf, HUGEBUFLEN); f = hasflag(o->flags, F_ACCURACY); if (f) { - int acc; + int acc,accnum; acc = getobaccuracy(o, NULL); - sprintf(buf, " It has %s accuracy.\n",getaccuracyname(acc)); + accnum = getaccuracynum(acc); + sprintf(buf, " It has an accuracy modifier of %c%d (%s)",(accnum < 0) ? '-' : '+', abs(accnum), getaccuracyname(acc)); strncat(retbuf, buf, HUGEBUFLEN); } f = hasflag(o->flags, F_RANGE); @@ -4430,13 +4489,13 @@ char *makedesc_ob(object_t *o, char *retbuf) { getdamrange(damflag, &mindam, &maxdam); mindam += bonus; maxdam += bonus; - if (mindam < 0) mindam = 0; - if (maxdam < 0) maxdam = 0; + limit(&mindam, 0, NA); + limit(&maxdam, 0, NA); if (mindam == maxdam) { - snprintf(buf2, BUFLEN, " which inflicts %d %s damage",maxdam, getdamname(damtype)); + snprintf(buf2, BUFLEN, ", dealing %d %s damage",maxdam, getdamname(damtype)); } else { - snprintf(buf2, BUFLEN, " which inflicts %d-%d %s damage",mindam,maxdam, getdamname(damtype)); + snprintf(buf2, BUFLEN, ", dealing %d-%d %s damage",mindam,maxdam, getdamname(damtype)); } strcat(buf, buf2); @@ -4444,10 +4503,35 @@ char *makedesc_ob(object_t *o, char *retbuf) { strcat(buf, " ("); strcat(buf, damflag->text); // ie. 2d6 - strcat(buf, ").\n"); - + strcat(buf, ")"); strncat(retbuf, buf, HUGEBUFLEN); + if (compareob) { + flag_t *comparedf; + int comparebonus = 0,cmin,cmax,diff; + comparedf = hasflag(compareob->flags, F_DAM); + + f = hasflag(compareob->flags, F_BONUS); + if (f && f->known) comparebonus = f->val[0]; + + getdamrange(comparedf, &cmin, &cmax); + cmin += bonus; cmax += bonus; + limit(&cmin, 0, NA); limit(&cmax, 0, NA); + + diff = maxdam - cmax; + + if (mindam == 0) { + strcat(retbuf, " (=)"); + } else { + // higher maxdamage is better + snprintf(buf2, BUFLEN, " %s(%c%d)^n", (diff < 0) ? "^B" : "^g", + (diff < 0) ? '-' : '+', abs(diff)); + strcat(retbuf, buf2); + } + } + + strcat(retbuf, ".\n"); + // other extra damage or effects? f = hasflag(o->flags, F_ONFIRE); if (f) { @@ -4463,27 +4547,73 @@ char *makedesc_ob(object_t *o, char *retbuf) { strncat(retbuf, "\n", HUGEBUFLEN); } - delay = 100; f = hasflag(o->flags, F_OBATTACKDELAY); - if (f) { - delay = f->val[0]; + if (f) delay = f->val[0]; + else delay = 100; + sprintf(buf, " Its attack delay is %d%%",delay - 100); + if (compareob) { + int cdelay,diff; + f = hasflag(compareob->flags, F_OBATTACKDELAY); + if (f) cdelay = f->val[0]; + else cdelay = 100; + diff = delay - cdelay; + if (diff == 0) { + strcat(buf, " (=)"); + } else { + // lower attack delay is better + snprintf(buf2, BUFLEN, " %s(%c%d)^n", (diff > 0) ? "^B" : "^g", + (diff > 0) ? '+' : '-', abs(diff)); + strcat(buf, buf2); + } } - sprintf(buf, " Its attack delay is %d%%.\n",delay - 100); + + strcat(buf, ".\n"); strncat(retbuf, buf, HUGEBUFLEN); critchance = getcritchance(player, o, NULL); - if (critchance > 0) { - sprintf(buf, " You have a %d%% critical hit chance with it.\n", critchance); - strncat(retbuf, buf, HUGEBUFLEN); + sprintf(buf, " You have a %d%% critical hit chance with it", critchance); + if (compareob) { + int ccritch,diff; + ccritch = getcritchance(player, compareob, NULL); + diff = critchance - ccritch; + if (diff == 0) { + strcat(buf, " (=)"); + } else { + // higher crit chance is better + snprintf(buf2, BUFLEN, " %s(%c%d)^n", (diff < 0) ? "^B" : "^g", + (diff > 0) ? '+' : '-', abs(diff)); + strcat(buf, buf2); + } } + strcat(buf, ".\n"); + strncat(retbuf, buf, HUGEBUFLEN); + + f = hasflag(o->flags, F_ACCURACY); if (f) { - int acc; + int acc,accnum; acc = getobaccuracy(o, NULL); - sprintf(buf, " It has %s accuracy.\n",getaccuracyname(acc)); + accnum = getaccuracynum(acc); + sprintf(buf, " It has an accuracy modifier of %c%d (%s)",(accnum < 0) ? '-' : '+', abs(accnum) , getaccuracyname(acc)); + if (compareob && hasflag(compareob->flags, F_ACCURACY)) { + int cacc,caccnum,diff; + cacc = getobaccuracy(compareob, NULL); + caccnum = getaccuracynum(cacc); + diff = accnum - caccnum; + if (diff == 0) { + strcat(buf, " (=)"); + } else { + // higher accuracy is better + snprintf(buf2, BUFLEN, " %s(%c%d)^n", (diff < 0) ? "^B" : "^g", (diff < 0) ? '-' : '+', abs(diff)); + strcat(buf, buf2); + } + } + + strcat(buf, ".\n"); strncat(retbuf, buf, HUGEBUFLEN); } + f = hasflag(o->flags, F_DISARMATTACK); if (f) { sprintf(buf, " A skilled weilder can disarm opponents with it.\n"); @@ -4504,6 +4634,7 @@ char *makedesc_ob(object_t *o, char *retbuf) { } // damage if (isarmour(o)) { + int thisar = 0; f = hasflag(o->flags, F_GOESON); if (f) { snprintf(buf, BUFLEN, "It is worn %s your %s, ",getbodypartequipname(f->val[0]), getbodypartname(NULL, f->val[0])); @@ -4512,18 +4643,41 @@ char *makedesc_ob(object_t *o, char *retbuf) { } f = hasflag(o->flags, F_ARMOURRATING); if (f) { + thisar = f->val[0] + getobbonus(o, B_TRUE); if (strlen(buf)) { - snprintf(buf2, BUFLEN, "and has an Armour Rating of %d.",f->val[0] + getobbonus(o)); + snprintf(buf2, BUFLEN, "and has an Armour Rating of %d",thisar); strcat(buf, buf2); } else { - snprintf(buf, BUFLEN, "It has an Armour Rating of %d.",f->val[0] + getobbonus(o)); + snprintf(buf, BUFLEN, "It has an Armour Rating of %d",thisar); } } else { + thisar = 0; if (strlen(buf)) { - snprintf(buf2, BUFLEN, "and provides no protection."); + snprintf(buf2, BUFLEN, "and provides no protection"); strcat(buf, buf2); } } + if (strlen(buf) && compareob) { + int diff,comparear = 0; + + f = hasflag(compareob->flags, F_ARMOURRATING); + if (f) { + comparear = f->val[0] + getobbonus(compareob, B_TRUE); + } else { + comparear = 0; + } + diff = thisar - comparear; + if (diff == 0) { + strcpy(buf2, " (=)"); + } else { + // higher AR is better + snprintf(buf2, BUFLEN, " %s(%c%d)^n", (diff > 0) ? "^g" : "^B", + (diff > 0) ? '+' : '-', abs(diff)); + } + strncat(buf, buf2, HUGEBUFLEN); + } + strcat(buf, "."); + strncat(retbuf, buf, HUGEBUFLEN); strncat(retbuf, "\n", HUGEBUFLEN); @@ -5217,7 +5371,9 @@ char *makedesc_spell(objecttype_t *ot, char *retbuf) { snprintf(buf, BUFLEN, "%s\n", f->text); strncat(retbuf, buf, BUFLEN); } - strcat(retbuf, "\n"); + if (nretflags) { + strcat(retbuf, "\n"); + } // properties f = hasflag(ot->flags, F_SPELLLEVEL); @@ -6080,7 +6236,7 @@ void dorest(void) { if (needstorest(player, validchars)) { if (strchr(validchars, 'h') && strchr(validchars, 'm')) { strcat(validchars, "bn"); - strcpy(ques, "Rest until full HP, Mana, Both, or none"); + strcpy(ques, "Rest until full Health, Mana, Both, or none"); ch = askchar(ques, validchars, "b", B_TRUE); if (ch == 'b') { addflag(player->flags, F_RESTUNTILHP, B_TRUE, NA, NA, NULL); @@ -6091,7 +6247,7 @@ void dorest(void) { addflag(player->flags, F_RESTUNTILMP, B_TRUE, NA, NA, NULL); } } else if (strchr(validchars, 'h')) { - strcpy(ques, "Rest until full HP"); + strcpy(ques, "Rest until full Health"); ch = askchar(ques, "yn", "y", B_TRUE); if (ch == 'y') { addflag(player->flags, F_RESTUNTILHP, B_TRUE, NA, NA, NULL); @@ -7832,9 +7988,9 @@ void drawstatus(void) { // stamina wattron(statwin, A_BOLD); wprintw(statwin, "SP:"); wattroff(statwin, A_BOLD); - setcol(statwin, getpctcol((int)player->stamina, (int)getmaxstamina(player))); - wprintw(statwin, "%d",(int)player->stamina); - unsetcol(statwin, getpctcol((int)player->stamina, (int)getmaxstamina(player))); + setcol(statwin, getpctcol(getstamina(player), (int)getmaxstamina(player))); + wprintw(statwin, "%d",getstamina(player)); + unsetcol(statwin, getpctcol(getstamina(player), (int)getmaxstamina(player))); wprintw(statwin, "/%d ",(int)getmaxstamina(player)); @@ -8122,7 +8278,7 @@ void drawstatus(void) { wprintw(statwin, "%d ", getevasion(player)); wattron(statwin, A_BOLD); wprintw(statwin, "$:"); wattroff(statwin, A_BOLD); - snprintf(buf, BUFLEN, "%d ", countmoney(player)); + snprintf(buf, BUFLEN, "%d ", countmoney(player->pack)); wprintw(statwin, buf); for (a = 0; a < MAXATTS; a++) { @@ -8458,8 +8614,8 @@ void showlfstats(lifeform_t *lf, int showall) { isplayer(lf) ? "" : "^WI^ntems " ); snprintf(cmdchars, BUFLEN, "@asme%s%s",isplayer(lf) ? "g" : "", isplayer(lf) ? "" : "i"); } else { - snprintf(promptstr, BUFLEN, "^h[^W@^n=stats %s ESC=quit]", isplayer(lf) ? "" : "^WI^ntems "); - snprintf(cmdchars, BUFLEN, "@i"); + snprintf(promptstr, BUFLEN, "^h[^W@^n=stats ^WE^nffects %s ESC=quit]", isplayer(lf) ? "" : "^WI^ntems "); + snprintf(cmdchars, BUFLEN, "@ie"); } while (!done) { @@ -8472,11 +8628,12 @@ void showlfstats(lifeform_t *lf, int showall) { } else{ centre(mainwin, C_WHITE, 0, "MONSTER DETAILS"); } + x = 0; y = 2; y2 = 2; dammod = getstrdammod(lf); - accmod = getstatmod(lf, A_DEX); + accmod = getstatmod(lf, A_AGI); if (isplayer(lf)) { getplayername(buf); @@ -8533,7 +8690,7 @@ void showlfstats(lifeform_t *lf, int showall) { getyx(mainwin, yy, xx); doheadingsmall(mainwin, y, xx, "%5s:", "Stam"); - wprintw(mainwin, " %d/%d", (int)lf->stamina , (int)getmaxstamina(lf)); + wprintw(mainwin, " %d/%d", getstamina(lf) , (int)getmaxstamina(lf)); y++; } else { char hpinfo[BUFLEN]; @@ -8625,7 +8782,7 @@ void showlfstats(lifeform_t *lf, int showall) { strcat(buf, buf2); } break; - case A_DEX: + case A_AGI: if (accmod > 0) { snprintf(buf2, BUFLEN, ", +%d%% acc",accmod ); strcat(buf, buf2); @@ -8697,18 +8854,19 @@ void showlfstats(lifeform_t *lf, int showall) { if (nweps == 0) { - int speed; + int speed,accmod; // no weapon snprintf(buf, BUFLEN, "(innate attack)"); doheadingsmall(mainwin, y2, x2, ftext, "Weapon"); wprintw(mainwin, "%-20s", buf); y2++; - // attack speed + // attack speed & accuracy acc = getlfaccuracy(lf, NULL); + accmod = getaccuracynum(acc); speed = getattackspeed(lf); getspeedname(speed, buf2); capitalise(buf2); - snprintf(buf, BUFLEN, "%s, %d%%",buf2,acc); + snprintf(buf, BUFLEN, "Spd:%s Acc:%c%d",buf2,(accmod < 0) ? '-' : '+', abs(accmod)); mvwprintw(mainwin, y2, x2, "%14s", " "); wprintw(mainwin, "%-20s", buf); y2++; } else { @@ -8716,6 +8874,7 @@ void showlfstats(lifeform_t *lf, int showall) { if (w[i]) { int mindam,maxdam; int bonus,speed; + int accnum; // weapon if (showall) { @@ -8754,12 +8913,13 @@ void showlfstats(lifeform_t *lf, int showall) { doheadingsmall(mainwin, y2, x2, ftext, "Weapon"); wprintw(mainwin, "%-20s", buf); y2++; - // attack speed + // attack speed & accuracy acc = getlfaccuracy(lf, w[i]); + accnum = getaccuracynum(acc); speed = getattackspeed(lf); getspeedname(speed, buf2); capitalise(buf2); - snprintf(buf, BUFLEN, "%s, %d%%",buf2,acc); + snprintf(buf, BUFLEN, "Spd:%s Acc:%c%d",buf2,(accnum < 0) ? '-' : '+', abs(accnum)); mvwprintw(mainwin, y2, x2, "%14s", " "); wprintw(mainwin, "%-20s", buf); y2++; @@ -9120,7 +9280,7 @@ void showlfstats(lifeform_t *lf, int showall) { wrapprint(mainwin, &y, &x, "%s %s sprinting.", you(lf), is(lf)); } - if (lf->stamina == 0) { + if (!getstamina(lf)) { wrapprint(mainwin, &y, &x, "%s %s exhausted.", you(lf), is(lf)); } @@ -9221,101 +9381,6 @@ void showlfstats(lifeform_t *lf, int showall) { wrapprint(mainwin, &y, &x, "%s %s made out of %s.",you(lf), is(lf), mt->name); } - if (showall) { - // resistances - strcpy(buf, ""); - f = lfhasflagval(lf, F_DTRESIST, DT_ALL, NA, NA, NULL); - if (f && (showall || f->known)) { - snprintf(buf, BUFLEN, "%s %s resistant to %s", you(lf), is(lf), getdamname(DT_ALL)); - } else { - first = B_TRUE; - for (i = 0; i < MAXDAMTYPE; i++) { - f = isresistantto(lf->flags, i); - if (f && (showall || f->known)) { - if (first) { - snprintf(buf2, BUFLEN, "%s %s resistant to: %s", you(lf), is(lf),getdamnamenoun(i)); - first = B_FALSE; - } else { - snprintf(buf2, BUFLEN, ", %s", getdamnamenoun(i)); - } - - - if (lfhasknownflag(lf, F_EXTRAINFO) || lfhasflag(lf, F_OMNIPOTENT)) { - if (f->lifetime != PERMENANT) { - char buf3[BUFLEN]; - snprintf(buf3, BUFLEN, "[%dt]",f->lifetime); - strcat(buf2, buf3); - } - } - strcat(buf, buf2); - } - } - } - if (strlen(buf) > 0) { - strcat(buf, "."); - wrapprint(mainwin, &y, &x, buf); - } - - // immunities - strcpy(buf, ""); - f = lfhasflagval(lf, F_DTIMMUNE, DT_ALL, NA, NA, NULL); - if (f && (showall || f->known)) { - snprintf(buf, BUFLEN, "%s %s immune to %s", you(lf), is(lf), getdamname(DT_ALL)); - } else { - first = B_TRUE; - for (i = 0; i < MAXDAMTYPE; i++) { - f = isimmuneto(lf->flags, i); - if (f && (showall || f->known)) { - if (first) { - snprintf(buf2, BUFLEN, "%s %s immune to: %s", you(lf), is(lf), getdamname(i)); - first = B_FALSE; - } else { - snprintf(buf2, BUFLEN, ", %s", getdamname(i)); - } - strcat(buf, buf2); - } - } - } - - if (strlen(buf) > 0) { - strcat(buf, "."); - wrapprint(mainwin, &y, &x, buf); - } - - // vulnerabilities - strcpy(buf, ""); - f = lfhasflagval(lf, F_DTVULN, DT_ALL, NA, NA, NULL); - if (f && (showall || f->known)) { - snprintf(buf, BUFLEN, "%s %s vulnerable to %s", you(lf), is(lf), getdamname(DT_ALL)); - } else { - first = B_TRUE; - for (i = 0; i < MAXDAMTYPE; i++) { - f = isvulnto(lf->flags, i); - if (f && (showall || f->known)) { - if (first) { - snprintf(buf2, BUFLEN, "%s %s vulnerable to: %s", you(lf), is(lf), getdamnamenoun(i)); - first = B_FALSE; - } else { - snprintf(buf2, BUFLEN, ", %s", getdamnamenoun(i)); - } - - - if (lfhasknownflag(lf, F_EXTRAINFO) || lfhasflag(lf, F_OMNIPOTENT)) { - if (f->lifetime > 0) { - char buf3[BUFLEN]; - snprintf(buf3, BUFLEN, "[%dturns]",f->lifetime); - strcat(buf2, buf3); - } - } - strcat(buf, buf2); - } - } - } - if (strlen(buf) > 0) { - strcat(buf, "."); - wrapprint(mainwin, &y, &x, buf); - } - } } else if (mode == 'a') { centre(mainwin, C_WHITE, 0, "ABILITIES"); y = 2; @@ -9509,7 +9574,7 @@ void showlfstats(lifeform_t *lf, int showall) { mvwprintw(mainwin, y, 0, "%s cannot cast any spells.", you(lf)); } } else if (mode == 'e') { - int nfound = 0; + int nfound = 0,luckmod; x = 0; // override // down a line. centre(mainwin, C_WHITE, y, "EFFECTS"); @@ -9586,16 +9651,308 @@ void showlfstats(lifeform_t *lf, int showall) { } } - // flags which aren't really intrinsics - if (lfhasflag(lf, F_AQUATIC)) { - mvwprintw(mainwin, y, 0, "%s %s aquatic, and move normally through water.", you(lf), is(lf)); - y++; - } - if (lfhasflag(lf, F_VEGETARIAN)) { - mvwprintw(mainwin, y, 0, "%s %s a vegetarian.", you(lf), is(lf)); - y++; + // traits based on the monster's racial characteristics + // these are fairly common knowledge - ie if you ask around most + // people would know this. + if (showall || (lorelev >= PR_NOVICE)) { + if (lfhasflag(lf, F_AQUATIC)) { + mvwprintw(mainwin, y, 0, "%s %s aquatic, and move normally through water.", you(lf), is(lf)); + y++; + } + if (isdeaf(lf)) { + mvwprintw(mainwin, y, 0, "%s %s deaf.", you(lf), is(lf)); + y++; + } + f = lfhasknownflag(lf, F_NOPACK); + if (f && (f->known)) { + mvwprintw(mainwin, y, 0, "%s cannot carry objects.", you(lf)); + y++; + } + f = lfhasknownflag(lf, F_ENHANCESMELL); + if (f) { + mvwprintw(mainwin, y, 0, "%s %s an enhanced sense of smell.", you(lf), isplayer(lf) ? "have" : "has"); + y++; + } + f = lfhasknownflag(lf, F_DISEASEIMMUNE); + if (f) { + mvwprintw(mainwin, y, 0, "%s %s immune to disease.", you(lf), is(lf)); + y++; + } + + f = lfhasknownflag(lf, F_PACKATTACK); + if (f && (f->known)) { + snprintf(buf, BUFLEN,"%s deal%s extra damage when in a pack.", you(lf), isplayer(lf) ? "" : "s"); + mvwprintw(mainwin, y, 0, buf); + y++; + } + f = lfhasknownflag(lf, F_PHALANX); + if (f && (f->known)) { + snprintf(buf, BUFLEN,"%s gain%s %d extra armour rating when in a %s pack.", you(lf), isplayer(lf) ? "" : "s", + f->val[0], f->text); + mvwprintw(mainwin, y, 0, buf); + y++; + } + f = lfhasknownflag(lf, F_HEAVYBLOW); + if (f) { + snprintf(buf, BUFLEN,"%s%s attacks knock enemies back.", you(lf), getpossessive(you(lf))); + mvwprintw(mainwin, y, 0, buf); + y++; + } + f = lfhasknownflag(lf, F_QUICKBITE); + if (f && (f->known)) { + snprintf(buf, BUFLEN,"%s can bite wounded enemies for extra damage.", you(lf)); + mvwprintw(mainwin, y, 0, buf); + y++; + } + f = lfhasflag(lf, F_MEDITATES); + if (f && (f->known)) { + mvwprintw(mainwin, y, 0, "%s retain awareness via 'sleeping' through meditation.", you(lf)); + y++; + } + + f = lfhasflag(lf, F_NEEDSWATER); + if (f && (f->known)) { + mvwprintw(mainwin, y, 0, "%s will suffocate without water.", you(lf)); + y++; + } + + f = lfhasknownflag(lf, F_REGENERATES); + if (f) { + char regenspeed[BUFLEN]; + if (f->val[0] == 1) { + strcpy(regenspeed, ""); + } else if (f->val[0] == 2) { + strcpy(regenspeed, " quickly"); + } else if (f->val[0] == 3) { + strcpy(regenspeed, " very quickly"); + } else { // >= 4 + strcpy(regenspeed, " extremely quickly"); + } + mvwprintw(mainwin, y, 0, "%s regenerate%s health%s.", you(lf),isplayer(lf) ? "" : "s", regenspeed); + y++; + } + f = lfhasknownflag(lf, F_RESISTMAG); + if (f) { + int mr; + char adjective[BUFLEN]; + mr = getmr(lf); + if (mr <= 5) { + strcpy(adjective, "slightly"); + } else if (mr <= 10) { + strcpy(adjective, "quite"); + } else if (mr <= 15) { + strcpy(adjective, "very"); + } else if (mr <= 20) { + strcpy(adjective, "extremely"); + } else { // ie. 21 upwards + strcpy(adjective, "incredibly"); + } + mvwprintw(mainwin, y, 0, "%s %s %s resistant to magic.", you(lf), is(lf), adjective); + y++; + } + f = lfhasknownflag(lf, F_TREMORSENSE); + if (f) { + mvwprintw(mainwin, y, 0, "%s can 'see' by sensing vibrations around %s.", you(lf), you(lf)); + y++; + } + f = lfhasflag(lf, F_STENCH); + if (f && (f->known)) { + mvwprintw(mainwin, y, 0, "%s smell%s terrible.", you(lf), isplayer(lf) ? "" : "s"); + y++; + } + f = lfhasknownflag(lf, F_SEEINDARK); + if (f) { + mvwprintw(mainwin, y, 0, "%s can see in the dark.", you(lf)); + y++; + } + f = lfhasknownflag(lf, F_SEEINVIS); + if (f) { + mvwprintw(mainwin, y, 0, "%s can see invisible things.", you(lf)); + y++; + } + f = lfhasknownflag(lf, F_XRAYVIS); + if (f) { + mvwprintw(mainwin, y, 0, "%s can see through walls.", you(lf)); + y++; + } + + // material vulnerbilities + getflags(lf->flags, retflag, &nretflags, F_MATVULN, F_NONE); + for (i = 0; i < nretflags; i++) { + material_t *mt; + mt = findmaterial(retflag[i]->val[0]); + + sprintf(buf, "%s take%s %d%% damage from weapons made of %s.", you(lf), + isplayer(lf) ? "" : "s", retflag[i]->val[1], mt->name); + mvwprintw(mainwin, y, 0, buf); y++; + } } + + // traits based on the monster's bevaviour. + // only known if you've studied this creature type a bit. + if (showall || (lorelev >= PR_BEGINNER)) { + // sleeping habits + if (!isplayer(lf)) { + if (lfhasflag(lf, F_NOCTURNAL)) { + mvwprintw(mainwin, y, 0, "It normally sleeps during the day."); y++; + } + if (lfhasflag(lf, F_DIURNAL)) { + mvwprintw(mainwin, y, 0, "It normally sleeps during the night."); y++; + } + } + // eating habits + if (lfhasflag(lf, F_CARNIVORE)) { + mvwprintw(mainwin, y, 0, "%s %s a carnivore (only eats meat).", you(lf), is(lf)); + y++; + } else if (lfhasflag(lf, F_PARTVEGETARIAN)) { + mvwprintw(mainwin, y, 0, "%s %s a vegetarian (will only eat meat when hungry).", you(lf), is(lf)); + y++; + } else if (lfhasflag(lf, F_VEGETARIAN)) { + mvwprintw(mainwin, y, 0, "%s %s a vegetarian (will not eat meat).", you(lf), is(lf)); + y++; + } + + // damage desistances/vulnerabilities + // resistances + strcpy(buf, ""); + f = lfhasflagval(lf, F_DTRESIST, DT_ALL, NA, NA, NULL); + if (f) { + snprintf(buf, BUFLEN, "%s %s resistant to %s", you(lf), is(lf), getdamname(DT_ALL)); + } else { + first = B_TRUE; + for (i = 0; i < MAXDAMTYPE; i++) { + f = isresistantto(lf->flags, i); + if (f) { + if (first) { + snprintf(buf2, BUFLEN, "%s %s resistant to: %s", you(lf), is(lf),getdamnamenoun(i)); + first = B_FALSE; + } else { + snprintf(buf2, BUFLEN, ", %s", getdamnamenoun(i)); + } + + + if (lfhasknownflag(lf, F_EXTRAINFO) || lfhasflag(lf, F_OMNIPOTENT)) { + if (f->lifetime != PERMENANT) { + char buf3[BUFLEN]; + snprintf(buf3, BUFLEN, "[%dt]",f->lifetime); + strcat(buf2, buf3); + } + } + strcat(buf, buf2); + } + } + } + if (strlen(buf) > 0) { + strcat(buf, ".\n"); + wrapprint(mainwin, &y, &x, buf); + } + // immunities + strcpy(buf, ""); + f = lfhasflagval(lf, F_DTIMMUNE, DT_ALL, NA, NA, NULL); + if (f) { + snprintf(buf, BUFLEN, "%s %s immune to %s", you(lf), is(lf), getdamname(DT_ALL)); + } else { + first = B_TRUE; + for (i = 0; i < MAXDAMTYPE; i++) { + f = isimmuneto(lf->flags, i); + if (f) { + if (first) { + snprintf(buf2, BUFLEN, "%s %s immune to: %s", you(lf), is(lf), getdamname(i)); + first = B_FALSE; + } else { + snprintf(buf2, BUFLEN, ", %s", getdamname(i)); + } + strcat(buf, buf2); + } + } + } + + if (strlen(buf) > 0) { + strcat(buf, ".\n"); + wrapprint(mainwin, &y, &x, buf); + } + // vulnerabilities + strcpy(buf, ""); + f = lfhasflagval(lf, F_DTVULN, DT_ALL, NA, NA, NULL); + if (f) { + snprintf(buf, BUFLEN, "%s %s vulnerable to %s", you(lf), is(lf), getdamname(DT_ALL)); + } else { + first = B_TRUE; + for (i = 0; i < MAXDAMTYPE; i++) { + f = isvulnto(lf->flags, i); + if (f) { + if (first) { + snprintf(buf2, BUFLEN, "%s %s vulnerable to: %s", you(lf), is(lf), getdamnamenoun(i)); + first = B_FALSE; + } else { + snprintf(buf2, BUFLEN, ", %s", getdamnamenoun(i)); + } + + + if (lfhasknownflag(lf, F_EXTRAINFO) || lfhasflag(lf, F_OMNIPOTENT)) { + if (f->lifetime > 0) { + char buf3[BUFLEN]; + snprintf(buf3, BUFLEN, "[%dturns]",f->lifetime); + strcat(buf2, buf3); + } + } + strcat(buf, buf2); + } + } + } + if (strlen(buf) > 0) { + strcat(buf, ".\n"); + wrapprint(mainwin, &y, &x, buf); + } + + // wants/desires + if (!isplayer(lf)) { + getflags(lf->flags, retflag, &nretflags, F_WANTS, F_WANTSOBFLAG, F_WANTSBETTERWEP, F_WANTSBETTERARM, F_NONE); + for (i = 0; i < nretflags; i++) { + f = retflag[i]; + if (f->id == F_WANTS) { + char *pname; + objecttype_t *ot; + ot = findot(f->val[0]); + pname = makeplural(ot->name); + mvwprintw(mainwin, y, 0, "It %s %s.", (f->val[1] == B_COVETS) ? "covets" : "wants", pname); + y++; + free(pname); + } else if (f->id == F_WANTSOBFLAG) { + char what[BUFLEN]; + switch (f->val[0]) { + case F_EDIBLE: strcpy(what, "edible things"); break; + case F_OPERABLE: strcpy(what, "tools and technology"); break; + case F_RARITY: strcpy(what, "all objects"); break; // special case + default: + strcpy(what, "some objects"); break; // shouldn't happen + } + mvwprintw(mainwin, y, 0, "It %s %s.", (f->val[1] == B_COVETS) ? "covets" : "wants", what); + y++; + } else if (f->id == F_WANTSBETTERWEP) { + mvwprintw(mainwin, y, 0, "It %s better weapons.", (f->val[1] == B_COVETS) ? "covets" : "wants"); + y++; + } else if (f->id == F_WANTSBETTERARM) { + mvwprintw(mainwin, y, 0, "It %s better armour.", (f->val[1] == B_COVETS) ? "covets" : "wants"); + y++; + } + } + } + // other + f = lfhasflag(lf, F_SILENTMOVE); + if (f && (f->known)) { + mvwprintw(mainwin, y, 0, "%s move%s silently.", you(lf), isplayer(lf) ? "" : "s"); + y++; + } + + f = lfhasflag(lf, F_STABILITY); + if (f && (f->known)) { + mvwprintw(mainwin, y, 0, "%s will not fall on slippery ground.", you(lf)); + y++; + } + + } // show intrinsics f = lfhasknownflag(lf, F_ATTRSET); @@ -9626,11 +9983,6 @@ void showlfstats(lifeform_t *lf, int showall) { y++; } - f = lfhasknownflag(lf, F_NOPACK); - if (f && (f->known)) { - mvwprintw(mainwin, y, 0, "%s cannot carry objects.", you(lf)); - y++; - } f = lfhasflag(lf, F_OMNIPOTENT); if (f && (f->known)) { mvwprintw(mainwin, y, 0, "%s are omnipotent.", you(lf)); @@ -9668,11 +10020,6 @@ void showlfstats(lifeform_t *lf, int showall) { mvwprintw(mainwin, y, 0, "%s %s confused.", you(lf), is(lf)); y++; } - - if (isdeaf(lf)) { - mvwprintw(mainwin, y, 0, "%s %s deaf.", you(lf), is(lf)); - y++; - } f = lfhasknownflag(lf, F_DETECTAURAS); if (f) { mvwprintw(mainwin, y, 0, "%s automatically detect blessings or curses.", you(lf)); @@ -9704,17 +10051,6 @@ void showlfstats(lifeform_t *lf, int showall) { mvwprintw(mainwin, y, 0, "%s searching ability is enhanced.", you(lf), isplayer(lf) ? "Your" : "Its"); y++; } - f = lfhasknownflag(lf, F_ENHANCESMELL); - if (f) { - mvwprintw(mainwin, y, 0, "%s %s an enhanced sense of smell.", you(lf), isplayer(lf) ? "have" : "has"); - y++; - } - - f = lfhasknownflag(lf, F_DISEASEIMMUNE); - if (f) { - mvwprintw(mainwin, y, 0, "%s %s immune to disease.", you(lf), is(lf)); - y++; - } f = lfhasknownflag(lf, F_DRUNK); if (f) { @@ -9722,22 +10058,6 @@ void showlfstats(lifeform_t *lf, int showall) { y++; } - getflags(lf->flags, retflag, &nretflags, F_INJURY, F_NONE); - for (i = 0; i < nretflags; i++) { - char buf[BUFLEN], buf2[BUFLEN]; - f = retflag[i]; - strcpy(buf, getinjuredbpname(f->val[0])); - strcpy(buf2, getinjuryname(f->val[1])); - if (isplayer(lf)) { - msg("^%cYour %s is %s.", getlfcol(lf, CC_VBAD), buf, buf2); - } else { - char lfname[BUFLEN]; - getlfname(lf, lfname); - msg("^%c%s%s %s is %s.", getlfcol(lf, CC_VBAD), - lfname, getpossessive(lfname), buf, buf2); - } - } - getflags(lf->flags, retflag, &nretflags, F_EXTRADAM, F_NONE); for (i = 0; i < nretflags; i++) { int ndice,nsides,bonus; @@ -9777,9 +10097,19 @@ void showlfstats(lifeform_t *lf, int showall) { y++; } - f = lfhasknownflag(lf, F_EXTRALUCK); - if (f) { - mvwprintw(mainwin, y, 0, "Your luck is being boosted.", you(lf)); + sumflags(lf->flags, F_EXTRALUCK, &luckmod, NULL, NULL); + if (luckmod) { + char luckamt[BUFLEN]; + switch (luckmod) { + case 1: strcpy(luckamt, "fairly "); break; + case 2: strcpy(luckamt, "quite "); break; + case 3: strcpy(luckamt, "very "); break; + case 4: strcpy(luckamt, "extremely "); break; + case 5: + default: + strcpy(luckamt, "incredibly "); break; + } + mvwprintw(mainwin, y, 0, "%s %s %slucky.", you(lf), is(lf), luckamt); y++; } @@ -9823,25 +10153,6 @@ void showlfstats(lifeform_t *lf, int showall) { mvwprintw(mainwin, y, 0, "%s %s nauseated.", you(lf), is(lf)); y++; } - f = lfhasknownflag(lf, F_PACKATTACK); - if (f && (f->known)) { - snprintf(buf, BUFLEN,"%s deal%s extra damage when in a pack.", you(lf), isplayer(lf) ? "" : "s"); - mvwprintw(mainwin, y, 0, buf); - y++; - } - f = lfhasknownflag(lf, F_PHALANX); - if (f && (f->known)) { - snprintf(buf, BUFLEN,"%s gain%s %d extra armour rating when in a %s pack.", you(lf), isplayer(lf) ? "" : "s", - f->val[0], f->text); - mvwprintw(mainwin, y, 0, buf); - y++; - } - f = lfhasknownflag(lf, F_HEAVYBLOW); - if (f) { - snprintf(buf, BUFLEN,"%s%s attacks knock enemies back.", you(lf), getpossessive(you(lf))); - mvwprintw(mainwin, y, 0, buf); - y++; - } f = lfhasknownflag(lf, F_HOLYAURA); if (f) { mvwprintw(mainwin, y, 0, "%s %s surrounded by a holy aura.", you(lf), is(lf)); @@ -9852,12 +10163,6 @@ void showlfstats(lifeform_t *lf, int showall) { msg("%s%s feet automatically generating sheets of ice.",your(lf)); } - f = lfhasknownflag(lf, F_QUICKBITE); - if (f && (f->known)) { - snprintf(buf, BUFLEN,"%s can bite wounded enemies for extra damage.", you(lf)); - mvwprintw(mainwin, y, 0, buf); - y++; - } f = lfhasknownflag(lf, F_FREEZINGTOUCH); if (f && (f->known)) { strcpy(buf,"The next object you touch will turn to solid ice."); @@ -9894,18 +10199,6 @@ void showlfstats(lifeform_t *lf, int showall) { mvwprintw(mainwin, y, 0, "%s %s surrounded by a magnetic shield.", you(lf), is(lf)); y++; } - f = lfhasflag(lf, F_MEDITATES); - if (f && (f->known)) { - mvwprintw(mainwin, y, 0, "%s retain awareness via 'sleeping' through meditation.", you(lf), is(lf)); - y++; - } - - f = lfhasflag(lf, F_NEEDSWATER); - if (f && (f->known)) { - mvwprintw(mainwin, y, 0, "%s will suffocate without water.", you(lf), is(lf)); - y++; - } - f = lfhasflag(lf, F_PAIN); if (f && (f->known)) { if (lfhasflag(lf, F_DRUNK)) { @@ -9931,46 +10224,7 @@ void showlfstats(lifeform_t *lf, int showall) { mvwprintw(mainwin, y, 0, "%s %s enraged, gaining accuracy, damage and hit point bonuses.", you(lf), is(lf)); y++; } - f = lfhasknownflag(lf, F_REGENERATES); - if (f) { - char regenspeed[BUFLEN]; - if (f->val[0] == 1) { - strcpy(regenspeed, ""); - } else if (f->val[0] == 2) { - strcpy(regenspeed, " quickly"); - } else if (f->val[0] == 3) { - strcpy(regenspeed, " very quickly"); - } else { // >= 4 - strcpy(regenspeed, " extremely quickly"); - } - mvwprintw(mainwin, y, 0, "%s regenerate%s health%s.", you(lf),isplayer(lf) ? "" : "s", regenspeed); - y++; - } - f = lfhasknownflag(lf, F_RESISTMAG); - if (f) { - int mr; - char adjective[BUFLEN]; - mr = getmr(lf); - if (mr <= 5) { - strcpy(adjective, "slightly"); - } else if (mr <= 10) { - strcpy(adjective, "quite"); - } else if (mr <= 15) { - strcpy(adjective, "very"); - } else if (mr <= 20) { - strcpy(adjective, "extremely"); - } else { // ie. 21 upwards - strcpy(adjective, "incredibly"); - } - mvwprintw(mainwin, y, 0, "%s %s %s resistant to magic.", you(lf), is(lf), adjective); - y++; - } - f = lfhasknownflag(lf, F_TREMORSENSE); - if (f) { - mvwprintw(mainwin, y, 0, "%s can 'see' by sensing vibrations around %s.", you(lf), you(lf)); - y++; - } - f = lfhasknownflag(lf, F_TREMORSENSE); + f = lfhasknownflag(lf, F_TRUESTRIKE); if (f) { mvwprintw(mainwin, y, 0, "%s%s attacks will automatically hit.", you(lf), getpossessive(you(lf))); y++; @@ -9992,57 +10246,11 @@ void showlfstats(lifeform_t *lf, int showall) { y++; } - f = lfhasflag(lf, F_SILENTMOVE); - if (f && (f->known)) { - mvwprintw(mainwin, y, 0, "%s move%s silently.", you(lf), isplayer(lf) ? "" : "s"); - y++; - } - - f = lfhasflag(lf, F_STABILITY); - if (f && (f->known)) { - mvwprintw(mainwin, y, 0, "%s will not fall on slippery ground.", you(lf)); - y++; - } - - f = lfhasflag(lf, F_STENCH); - if (f && (f->known)) { - mvwprintw(mainwin, y, 0, "%s smell%s terrible.", you(lf), isplayer(lf) ? "" : "s"); - y++; - } f = lfhasflag(lf, F_STUNNED); if (f && (f->known)) { mvwprintw(mainwin, y, 0, "%s %s stunned and cannot attack, cast spells or use abilities.", you(lf), is(lf)); y++; } - - if (!isblind(lf)) { - f = lfhasknownflag(lf, F_SEEINDARK); - if (f) { - mvwprintw(mainwin, y, 0, "%s can see in the dark.", you(lf)); - y++; - } - f = lfhasknownflag(lf, F_SEEINVIS); - if (f) { - mvwprintw(mainwin, y, 0, "%s can see invisible things.", you(lf)); - y++; - } - f = lfhasknownflag(lf, F_XRAYVIS); - if (f) { - mvwprintw(mainwin, y, 0, "%s can see through walls.", you(lf)); - y++; - } - } - - // material vulnerbilities - getflags(lf->flags, retflag, &nretflags, F_MATVULN, F_NONE); - for (i = 0; i < nretflags; i++) { - material_t *mt; - mt = findmaterial(retflag[i]->val[0]); - - sprintf(buf, "%s take%s %d%% damage from weapons made of %s.", you(lf), - isplayer(lf) ? "" : "s", retflag[i]->val[1], mt->name); - mvwprintw(mainwin, y, 0, buf); y++; - } } else if (mode == 'i') { object_t *o; cls(); @@ -10167,22 +10375,23 @@ void showlfstats(lifeform_t *lf, int showall) { if (ch == '\0') { ch = getch(); } + if (!strchr(cmdchars, ch)) { + if ((ch != 27) && (ch != '?')) { + ch = '\0'; + } + } switch (ch) { case 27: // ESC done = B_TRUE; break; case '@': - mode = ch; - break; case 'a': case 'e': case 'g': case 'm': case 's': - if (showall) mode = ch; - break; case 'i': - if (!isplayer(lf)) mode = ch; + mode = ch; break; case '?': if (mode == 'g') { // help on gods @@ -10357,7 +10566,7 @@ void wrapprint(WINDOW *win, int *y, int *x, char *format, ... ) { w = getmaxx(win); if (*x != 0) { - if (*x + strlen(buf) >= w) { + if (*x + strlen(buf) + 2 >= w) { (*y)++; *x = 0; } @@ -10365,6 +10574,8 @@ void wrapprint(WINDOW *win, int *y, int *x, char *format, ... ) { wmove(win, *y, *x); textwithcol(win, buf); (*x) += strlen(buf); + + getyx(win, *y, *x); } diff --git a/lf.c b/lf.c index f661532..abf957e 100644 --- a/lf.c +++ b/lf.c @@ -492,7 +492,7 @@ void callguards(lifeform_t *caller, lifeform_t *victim) { } int canattack(lifeform_t *lf) { - if (!lf->stamina) { + if (!getstamina(lf)) { reason = E_NOSTAM; return B_FALSE; } else if (lfhasflag(lf, F_STUNNED)) { @@ -583,7 +583,7 @@ int cancast(lifeform_t *lf, enum OBTYPE oid, int *mpcost) { } f = hasflag(ot->flags, F_STAMCOST); - if (f && (lf->stamina < f->val[0])) { + if (f && (getstamina(lf) < f->val[0])) { reason = E_NOSTAM; return B_FALSE; } @@ -696,12 +696,13 @@ int canhear(lifeform_t *lf, cell_t *dest, int volume) { // can't hear noises from other maps if (lf->cell->map != dest->map) return B_FALSE; + celldist = getcelldist(lf->cell, dest); + // for player only: // can't hear if you have a hostile mosnter next to you // and you're not blind. // (you're too engrossed in the battle) /* - celldist = getcelldist(lf->cell, dest); if (isplayer(lf) && isinbattle(lf)) { if (celldist != 1) return B_FALSE; } @@ -1300,7 +1301,7 @@ int castspell(lifeform_t *lf, enum OBTYPE sid, lifeform_t *targlf, object_t *tar losemp(lf, cost); // miscast chance? - if (isplayer(lf)) { + if (isplayer(lf) && !hasjob(lf, J_GOD)) { if (pctchance(getmiscastchance(lf))) { msg("^WYour cumbersome armour makes you miscast your spell!"); return B_FALSE; @@ -1353,7 +1354,9 @@ int castspell(lifeform_t *lf, enum OBTYPE sid, lifeform_t *targlf, object_t *tar } } else { // player can't see them if ((targlf == player) || (targcell = player->cell)) { - msg("Something casts a spell at you."); + if (!lfhasflag(player, F_ASLEEP)) { + msg("Something casts a spell at you."); + } } } } @@ -1576,7 +1579,7 @@ int checkfordrowning(lifeform_t *lf, object_t *o) { } losehp(lf, roll("6d6"), DT_DIRECT, NULL, "running water"); } - if ((!slev || !lf->stamina) && !lfhasflag(lf, F_BREATHWATER) ) { + if ((!slev || !getstamina(lf)) && !lfhasflag(lf, F_BREATHWATER) ) { int damamt; // take drowning damage. generally you'll die @@ -1707,17 +1710,6 @@ int countinnateattacks(lifeform_t *lf) { } -int countmoney(lifeform_t *lf) { - object_t *o; - int amt = 0; - for (o = lf->pack->first ; o ; o = o->next) { - if (o->type->id == OT_GOLD) { - amt += o->amt; - } - } - return amt; -} - int countnearbyallies(lifeform_t *lf) { lifeform_t *l; int count = 0; @@ -1785,7 +1777,7 @@ int demandbribe(lifeform_t *lf) { hd = gethitdice(lf); gold = hasob(player->pack, OT_GOLD); if (gold) { - totmoney = countmoney(player); + totmoney = countmoney(player->pack); } else { totmoney = 0; } @@ -2737,6 +2729,14 @@ int eat(lifeform_t *lf, object_t *o) { // announce if (turnstoeat <= 1) { + char taste[BUFLEN]; + if (hasflagval(o->flags, F_CORPSEOF, R_CHICKEN, NA, NA, NULL)) { + sprintf(taste, " Tastes like chicken!"); + } else if (f->val[1] >= 20) { + sprintf(taste, " Yum!"); + } else { + strcpy(taste, ""); + } if (alreadyeating) { if (isplayer(lf)) { msg("You finish %s.%s", drinking ? "drinking" : "eating", @@ -2988,10 +2988,10 @@ void enhanceskills(lifeform_t *lf) { if (isplayer(lf)) { char ch; more(); - ch = askchar("Increase your Strength, Dexterity, Fitness, IQ or Wisdom?", "sdfiw",NULL, B_TRUE); + ch = askchar("Increase your Strength, Agility, Fitness, IQ or Wisdom?", "safiw",NULL, B_TRUE); switch (ch) { case 's': att = A_STR; break; - case 'd': att = A_DEX; break; + case 'a': att = A_AGI; break; case 'f': att = A_CON; break; case 'i': att = A_IQ; break; case 'w': att = A_WIS; break; @@ -4512,7 +4512,7 @@ int getarmourrating(lifeform_t *lf, object_t **hitob, int *hitchance, int *narms ar += thisar; - ar += getobbonus(o); + ar += getobbonus(o, B_FALSE); if (hitob) { hitob[*narms] = o; hitchance[*narms] = getbodyparthitchance(isshield ? BP_BODY : eqflag->val[0]); @@ -4526,7 +4526,6 @@ int getarmourrating(lifeform_t *lf, object_t **hitob, int *hitchance, int *narms } // how far away should we be before attacking? - int getattackspeed(lifeform_t *lf) { object_t *w; float speed; @@ -4542,6 +4541,22 @@ int getattackspeed(lifeform_t *lf) { return (int)speed; } +float getattackstamloss(lifeform_t *lf) { + object_t *w; + float loss; + loss = ((float)STAMREGEN+0.2); + + w = getweapon(lf); + if (w) { + int del; + del = getobattackdelay(w); + loss = pctof(del, loss); + } + + return loss; +} + + int getattpoints(lifeform_t *lf) { flag_t *f; int attpoints = 0; @@ -4583,7 +4598,7 @@ int real_getattr(lifeform_t *lf, enum ATTRIB attr, int ignoreattrset) { val += f->val[1]; } if (f->id == F_DRUNK) { - if (attr == A_DEX) { + if (attr == A_AGI) { if (hasjob(lf, J_PIRATE)) { val += f->val[0]; } else { @@ -4807,7 +4822,7 @@ int getevasion(lifeform_t *lf) { ev += level_ev; // dexterity mod - ev += getattr(lf, A_DEX); + ev += getattr(lf, A_AGI); // you are easier to hit if you're glowing if (hasflag(lf->flags, F_PRODUCESLIGHT)) { @@ -5318,7 +5333,7 @@ int getlfaccuracy(lifeform_t *lf, object_t *wep) { } else { int dexmod; // modify with dexterity - dexmod = getstatmod(lf, A_DEX); + dexmod = getstatmod(lf, A_AGI); // double dex penalties when dual weilding if (isdualweilding(lf) && (dexmod < 0)) { dexmod *= 2; @@ -5369,7 +5384,7 @@ int getlfaccuracy(lifeform_t *lf, object_t *wep) { } } - if (acc < 0) acc = 0; + //if (acc < 0) acc = 0; return acc; } @@ -5772,7 +5787,7 @@ float getmaxstamina(lifeform_t *lf) { if (lfhasflagval(lf, F_INJURY, IJ_LUNGCOLLAPSED, NA, NA, NULL)) { return 0; } - stam = (getattr(lf, A_CON) / 2); + stam = (getattr(lf, A_CON) / 3); stam += (getskill(lf, SK_ATHLETICS)*2); return stam; } @@ -6174,6 +6189,11 @@ int getspellspeed(lifeform_t *lf) { return speed; } +// note: stamina is stored as a float, but we treat it as an int. +int getstamina(lifeform_t *lf) { + return (int)floor(lf->stamina); +} + char *getplayername(char *buf) { flag_t *f; f = hasflag(player->flags, F_NAME); @@ -6219,52 +6239,6 @@ int getpoisondamchance(enum POISONTYPE ptype) { return chance; } -char *getpoisondamverb(enum POISONTYPE ptype) { - switch (ptype) { - case P_FOOD: - case P_VENOM: - return "vomit"; - case P_GAS: - case P_COLD: - return "cough"; - default: - break; - } - return ""; -} - -char *getpoisondesc(enum POISONTYPE ptype) { - switch (ptype) { - case P_FOOD: - case P_VENOM: - case P_GAS: - case P_WEAKNESS: - return "Poisoned"; - case P_COLD: - return "Sick"; - default: - break; - } - return "Poisoned"; -} - -char *getpoisonname(enum POISONTYPE ptype) { - switch (ptype) { - case P_COLD: - return "hypothermia"; - case P_FOOD: - return "food poisoning"; - case P_GAS: - return "gas inhalation"; - case P_VENOM: - return "venom poisoning"; - case P_WEAKNESS: - return "weakening poison"; - default: - break; - } - return ""; -} enum POISONSEVERITY getpoisonseverity(enum POISONTYPE ptype) { switch (ptype) { @@ -6374,6 +6348,16 @@ enum BODYPART getrandomcorebp(lifeform_t *lf) { return selbp; } +race_t *getrandomcorpserace(cell_t *c) { + race_t *r; + r = getrandomrace(c, NA); + while (hasflag(r->flags, F_NOCORPSE)) { + r = getrandomrace(c, NA); + } + return r; +} + + job_t *getrandomjob(int onlyplayerjobs) { job_t *j; int njobs = 0; @@ -6687,7 +6671,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "hideous"); break; case A_CON: strcpy(buf, "frail"); break; - case A_DEX: + case A_AGI: strcpy(buf, "uncoordinated"); break; case A_IQ: strcpy(buf, "vegetable"); break; @@ -6707,7 +6691,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "repulsive"); break; case A_CON: strcpy(buf, "sickly"); break; - case A_DEX: + case A_AGI: strcpy(buf, "oafish"); break; case A_IQ: strcpy(buf, "animal"); break; @@ -6727,7 +6711,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "ugly"); break; case A_CON: strcpy(buf, "unhealthy"); break; - case A_DEX: + case A_AGI: strcpy(buf, "clumsy"); break; case A_IQ: strcpy(buf, "dim-witted"); break; @@ -6747,7 +6731,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "unattractive"); break; case A_CON: strcpy(buf, "unfit"); break; - case A_DEX: + case A_AGI: strcpy(buf, "awkward"); break; case A_IQ: strcpy(buf, "dopey"); break; @@ -6765,7 +6749,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { switch (whichatt) { case A_CHA: case A_CON: - case A_DEX: + case A_AGI: case A_STR: case A_IQ: case A_WIS: @@ -6782,7 +6766,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "attractive"); break; case A_CON: strcpy(buf, "healthy"); break; - case A_DEX: + case A_AGI: strcpy(buf, "dextrous"); break; case A_IQ: strcpy(buf, "smart"); break; @@ -6802,7 +6786,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "alluring"); break; case A_CON: strcpy(buf, "very fit"); break; - case A_DEX: + case A_AGI: strcpy(buf, "nimble"); break; case A_IQ: strcpy(buf, "enlightened"); break; @@ -6822,7 +6806,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "beautiful"); break; case A_CON: strcpy(buf, "hardy"); break; - case A_DEX: + case A_AGI: strcpy(buf, "agile"); break; case A_IQ: strcpy(buf, "genius"); break; @@ -6842,7 +6826,7 @@ enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, char *buf) { strcpy(buf, "stunning"); break; case A_CON: strcpy(buf, "very hardy"); break; - case A_DEX: + case A_AGI: strcpy(buf, "very agile"); break; case A_IQ: strcpy(buf, "supergenius"); break; @@ -7786,8 +7770,22 @@ int gotosleep(lifeform_t *lf, int onpurpose) { return B_FALSE; } +flag_t *hasbleedinginjury(lifeform_t *lf, enum BODYPART bp) { + flag_t *f, *retflag[MAXCANDIDATES]; + int nretflags,i; + getflags(player->flags, retflag, &nretflags, F_INJURY, F_NONE); + for (i = 0;i < nretflags; i++) { + f = retflag[i]; + // only temporary flags count - not permenant ones + if ((f->lifetime > 0) && (f->val[1] == bp) && (f->val[2] == DT_SLASH)) { + return f; + } + } + return NULL; +} + + int hasfreeaction(lifeform_t *lf) { - if (isdead(lf)) return B_FALSE; if (isimmobile(lf)) return B_FALSE; if (lfhasflag(lf, F_CASTINGSPELL)) return B_FALSE; if (lfhasflag(lf, F_EATING)) return B_FALSE; @@ -7802,6 +7800,17 @@ job_t *hasjob(lifeform_t *lf, enum JOB job) { return j; } +int hastempinjuries(lifeform_t *lf) { + flag_t *retflag[MAXCANDIDATES]; + int nretflags,i,count = 0; + + getflags(lf->flags, retflag, &nretflags, F_INJURY, F_NONE); + for (i = 0; i < nretflags; i++) { + if (retflag[i]->lifetime > 0) count++; + } + return count; +} + void inc_quad_range(enum QUADRANT *start, enum QUADRANT *end, int howmuch) { int i; for (i = 0; i < abs(howmuch); i++) { @@ -9005,6 +9014,16 @@ flag_t *isresting(lifeform_t *lf) { return NULL; } + +int issleepingtimefor(lifeform_t *lf) { + if (lfhasflag(lf, F_NOCTURNAL) && !isnighttime()) { + return B_TRUE; + } else if (lfhasflag(lf, F_DIURNAL) && isnighttime()) { + return B_TRUE; + } + return B_FALSE; +} + object_t *isstuck(lifeform_t *lf) { object_t *o; @@ -10306,6 +10325,22 @@ int losehp_real(lifeform_t *lf, int amt, enum DAMTYPE damtype, lifeform_t *froml snprintf(buf2, BUFLEN, "^%d damage",amt); strcat(buf, buf2); + // unseen? + if (fromlf && !cansee(lf, fromlf)) { + strcat(buf2, "^unseen"); + } + + // "while xxx" + strcpy(buf2, ""); + if ((countcellexits(lf->cell) == 1) && fromlf && (getcelldist(fromlf->cell, lf->cell) == 1)) { + strcat(buf2, "^while cornered"); + } + if (!hasfreeaction(lf)) { + if (strlen(buf2)) strcat(buf2, " and helpless"); + else strcat(buf2, "^while helpless"); + } + if (strlen(buf2)) strcat(buf, buf2); + setlastdam(lf, buf); @@ -10459,19 +10494,28 @@ int makenauseated(lifeform_t *lf, int amt, int howlong) { } void makenoise(lifeform_t *lf, enum NOISETYPE nid) { - flag_t *f; + flag_t *retflag[MAXCANDIDATES],*nflag[MAXCANDIDATES]; + int nretflags, volume = 1, i,nnflags = 0; char *verb = NULL, *noun = NULL; - int volume = 1; if (lfhasflag(lf, F_FROZEN)) { // can't make noise if frozen! return; } - f = hasflagval(lf->flags, F_NOISETEXT, nid, NA, NA, NULL); - if (f) { + + getflags(lf->flags, retflag, &nretflags, F_NOISETEXT, F_NONE); + for (i = 0; i < nretflags; i++) { + if (retflag[i]->id == nid) { + nflag[nnflags++] = retflag[i]; + } + } + + if (nnflags) { + flag_t *f; char *dummy; char noisetext[BUFLEN]; + f = nflag[rnd(0,nnflags-1)]; volume = f->val[1]; @@ -10585,7 +10629,7 @@ int meetsattreq(lifeform_t *lf, flag_t *f, object_t *o) { if (myval < valneeded) { switch (att) { - case A_DEX: + case A_AGI: reason = E_LOWDEX; break; case A_CHA: @@ -10651,7 +10695,7 @@ int modattr(lifeform_t *lf, enum ATTRIB attr, int amt) { case A_CON: strcpy(adverb, "healthier"); break; - case A_DEX: + case A_AGI: strcpy(adverb, "more agile"); break; case A_IQ: @@ -10674,7 +10718,7 @@ int modattr(lifeform_t *lf, enum ATTRIB attr, int amt) { case A_CON: strcpy(adverb, "frail"); break; - case A_DEX: + case A_AGI: strcpy(adverb, "sluggish"); break; case A_IQ: @@ -10800,17 +10844,17 @@ float modifybystat(float num, lifeform_t *lf, enum ATTRIB att) { void modstamina(lifeform_t *lf, float howmuch) { float orig; - orig = lf->stamina; + orig = getstamina(lf); lf->stamina += howmuch; limitf(&(lf->stamina), 0, getmaxstamina(lf)); - if (lf->stamina != orig) { + if (getstamina(lf) != orig) { if (isplayer(lf)) { statdirty = B_TRUE; drawstatus(); updatestatus(); - if (lf->stamina == 0) msg("You are exhausted."); + if (getstamina(lf) == 0) msg("You are exhausted."); } else if (cansee(player, lf)) { - if (lf->stamina == 0) { + if (getstamina(lf) == 0) { char lfname[BUFLEN]; getlfname(lf, lfname); msg("%s looks exhausted.", lfname); @@ -10818,7 +10862,7 @@ void modstamina(lifeform_t *lf, float howmuch) { } } - if (lf->stamina == 0) { + if (getstamina(lf) == 0) { stopsprinting(lf); } } @@ -10832,6 +10876,9 @@ int needstorest(lifeform_t *lf, char *validchars) { if (lf->hp < lf->maxhp) { if (validchars) strcat(validchars, "h"); need = B_TRUE; + } else if (hastempinjuries(lf)) { + if (validchars) strcat(validchars, "h"); + need = B_TRUE; } if ((getmaxmp(lf) > 0) && (lf->mp < getmaxmp(lf))) { if (validchars) strcat(validchars, "m"); @@ -11589,16 +11636,16 @@ int recruit(lifeform_t *lf) { difficulty = 20 + ((gethitdice(player) - gethitdice(lf))*2); if (real_skillcheck(player, A_CHA, difficulty, 0, &result)) { // passed - askingprice = rnd(gethitdice(lf)*50, gethitdice(lf)*100 ); + askingprice = rnd(gethitdice(lf)*5, gethitdice(lf)*20 ); addflag(lf->flags, F_HIREPRICE, askingprice, NA, NA, NULL); } else { if (difficulty - result >= 10) { // very expensive - askingprice = rnd(gethitdice(lf)*250, gethitdice(lf)*300 ); + askingprice = rnd(gethitdice(lf)*20, gethitdice(lf)*30 ); addflag(lf->flags, F_HIREPRICE, askingprice, NA, NA, NULL); } else { // expensive - askingprice = rnd(gethitdice(lf)*100, gethitdice(lf)*200 ); + askingprice = rnd(gethitdice(lf)*10, gethitdice(lf)*25 ); addflag(lf->flags, F_HIREPRICE, askingprice, NA, NA, NULL); } } @@ -11606,12 +11653,15 @@ int recruit(lifeform_t *lf) { if (askingprice != 0) { // modify by charisma - askingprice = pctof(100 + getstatmod(player, A_CHA), askingprice); + askingprice = pctof(100 - getstatmod(player, A_CHA), askingprice); + limit(&askingprice, 0, NA); + } + if (askingprice > 0) { sayphrase(lf, SP_RECRUIT_ASKPRICE, SV_TALK, askingprice, NULL); more(); - if (askingprice > countmoney(player)) { + if (askingprice > countmoney(player->pack)) { } else { char ch; snprintf(buf, BUFLEN, "Pay $%d to hire %s", askingprice, lfname); @@ -11635,7 +11685,7 @@ int recruit(lifeform_t *lf) { } sayphrase(lf, SP_RECRUIT_ACCEPT, SV_TALK, NA, p); } else { - if (askingprice > countmoney(player)) { + if (askingprice > countmoney(player->pack)) { sayphrase(lf, SP_RECRUIT_DECLINE_CANTPAY, SV_TALK, askingprice, NULL); } else { sayphrase(lf, SP_RECRUIT_DECLINE_WONTPAY, SV_TALK, askingprice, NULL); @@ -12499,7 +12549,7 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r attrib = getattr(lf, A_CON); break; case SC_DEX: - attrib = getattr(lf, A_DEX); + attrib = getattr(lf, A_AGI); break; case SC_IQ: attrib = getattr(lf, A_IQ); @@ -12516,7 +12566,7 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r break; /////////////// case SC_OPENLOCKS: - attrib = getattr(lf, A_DEX); + attrib = getattr(lf, A_AGI); break; case SC_WILL: attrib = getattr(lf, A_WIS); @@ -12535,10 +12585,10 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r break; case SC_SLIP: case SC_FALL: - attrib = getattr(lf, A_DEX); + attrib = getattr(lf, A_AGI); break; case SC_SHIELDBLOCK: - attrib = (getattr(lf, A_DEX) / 4); + attrib = (getattr(lf, A_AGI) / 4); break; case SC_POISON: attrib = getattr(lf, A_CON); @@ -12546,7 +12596,7 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r case SC_DISARM: attrib = (getskill(lf, SK_TRAPS)*3); if (attrib) { - attrib += (getattr(lf, A_DEX)/4); + attrib += (getattr(lf, A_AGI)/4); } break; case SC_CLIMB: @@ -12628,14 +12678,14 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r slev = PR_INEPT; } switch (slev) { - case PR_NOVICE: othermod = 4; break; - case PR_BEGINNER: othermod = 7; break; - case PR_ADEPT: othermod = 10; break; - case PR_SKILLED: othermod = 13; break; - case PR_EXPERT: othermod = 16; break; - case PR_MASTER: othermod = 20; break; + case PR_NOVICE: othermod = 0; break; + case PR_BEGINNER: othermod = 4; break; + case PR_ADEPT: othermod = 7; break; + case PR_SKILLED: othermod = 10; break; + case PR_EXPERT: othermod = 13; break; + case PR_MASTER: othermod = 16; break; default: - othermod = 0; + othermod = -4; break; } } else if (ct == SC_MORALE) { @@ -12664,7 +12714,7 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r } else if (ct == SC_STEAL) { if (attrib > 0) { // ie. -3 to 3 - othermod += (getstatmod(lf, A_DEX) / 15); + othermod += (getstatmod(lf, A_AGI) / 15); } } else if (ct == SC_STEALTH) { if (attrib > 0) { @@ -12680,7 +12730,7 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r levmod *= 2; } else if (ct == SC_TUMBLE) { // ie. -3 to 3 - othermod += (getstatmod(lf, A_DEX) / 15); + othermod += (getstatmod(lf, A_AGI) / 15); } @@ -13044,7 +13094,7 @@ void startlfturn(lifeform_t *lf) { // either use up stamina, or gain it if (lfhasflag(lf, F_SPRINTING)) { - modstamina(lf, -1); + modstamina(lf, -1.5); } else if (isswimming(lf)) { int lossamt; // lose stamina based on swimming skill @@ -13059,8 +13109,8 @@ void startlfturn(lifeform_t *lf) { } if (lossamt) modstamina(lf, -lossamt); } else { - if (lf->stamina < getmaxstamina(lf)) { - float regenrate = 0.5; + if (getstamina(lf) < getmaxstamina(lf)) { + float regenrate = STAMREGEN; if (lfhasflagval(lf, F_INJURY, IJ_WINDPIPECRUSHED, NA, NA, NULL)) { regenrate = 0.2; // override everything else } else { @@ -13094,7 +13144,7 @@ void startlfturn(lifeform_t *lf) { if (f) { cell_t *retcell[MAXCANDIDATES]; int nretcells; - getradiuscells(lf->cell, 2, DT_COMPASS, LOF_WALLSTOP, B_FALSE, retcell, &nretcells, 0); + getradiuscells(lf->cell, 2, DT_COMPASS, B_FALSE, LOF_WALLSTOP, B_FALSE, retcell, &nretcells, 0); for (i = 0; i < nretcells; i++) { if (retcell[i]->lf && areenemies(lf, retcell[i]->lf)) { int dir,reldir; @@ -13752,11 +13802,33 @@ int steal(lifeform_t *lf, obpile_t *op, enum FLAG wantflag) { } } if (prompt.nchoices > 1) { - if (isplayer(lf) && (slev >= PR_ADEPT)) { - addchoice(&prompt, '-', "Nothing", NULL, NULL, NULL); - // pick what you want - getchoice(&prompt); - o = (object_t *)prompt.result; + if (slev >= PR_ADEPT) { + if (isplayer(lf)) { + addchoice(&prompt, '-', "Nothing", NULL, NULL, NULL); + // pick what you want + getchoice(&prompt); + o = (object_t *)prompt.result; + } else { + int nn,nposs = 0; + object_t *poss[MAXCHOICES*2]; + // get something we want + for (nn = 0; nn < prompt.nchoices; nn++) { + int cov; + if (aiwants(lf, (object_t *)prompt.choice[nn].data, &cov)) { + if (cov) { // add twice + poss[nposs++] = o; + poss[nposs++] = o; + } else { + poss[nposs++] = o; + } + } + } + if (nposs) { + o = poss[rnd(0,nposs-1)]; + } else { + o = (object_t *)prompt.choice[rnd(0,prompt.nchoices-1)].data; + } + } } else { // random o = (object_t *)prompt.choice[rnd(0,prompt.nchoices-1)].data; @@ -14015,12 +14087,21 @@ void taketime(lifeform_t *lf, long howlong) { } map = lf->cell->map; + + if (gamemode == GM_GAMESTARTED) { + if (map != player->cell->map) { + // lfs not on the player's map don't take time. + // this avoids the assertion below failing when + // (for example) a monster falls through a pit. + return; + } + if (db && cansee(player, lf)) { + dblog("lfid %d (%s) spending %d time\n",lf->id,lf->race->name, howlong); + } + } assert(howlong > 0); - if (db && (gamemode == GM_GAMESTARTED) && cansee(player, lf)) { - dblog("lfid %d (%s) spending %d time\n",lf->id,lf->race->name, howlong); - } // inc timespent lf->timespent += howlong; assert(lf->timespent >= 0); @@ -15082,7 +15163,7 @@ int rest(lifeform_t *lf, int onpurpose) { wantclearmsg = B_FALSE; // resting - if (lf->hp >= lf->maxhp) { + if ((lf->hp >= lf->maxhp) && !hastempinjuries(lf)) { hf = lfhasflag(lf, F_RESTUNTILHP); if (hf) killflag(hf); } diff --git a/lf.h b/lf.h index b643ea1..7cf7bb5 100644 --- a/lf.h +++ b/lf.h @@ -54,7 +54,6 @@ int check_rest_ok(lifeform_t *lf); float comparelfs(lifeform_t *lf1, lifeform_t *lf2); int confuse(lifeform_t *lf, int howlong); int countinnateattacks(lifeform_t *lf); -int countmoney(lifeform_t *lf); int countnearbyallies(lifeform_t *lf); int countnearbyhurtallies(lifeform_t *lf); int countplantsinsight(lifeform_t *lf); @@ -110,6 +109,8 @@ object_t *getarmour(lifeform_t *lf, enum BODYPART bp); int getarmournoise(lifeform_t *lf); int getarmourrating(lifeform_t *lf, object_t **hitob, int *hitchance, int *narms); int getattackspeed(lifeform_t *lf); +float getattackstamloss(lifeform_t *lf); +float getattackstamloss(lifeform_t *lf); int getattpoints(lifeform_t *lf); int getattr(lifeform_t *lf, enum ATTRIB attr); enum ATTRBRACKET getattrbracket(int attrval, enum ATTRIB whichatt, /*@null@*/char *buf); @@ -182,6 +183,7 @@ float getlfweight(lifeform_t *lf, int withobs); object_t *getsecmeleeweapon(lifeform_t *lf); object_t *getshield(lifeform_t *lf); int getspellspeed(lifeform_t *lf); +int getstamina(lifeform_t *lf); char *getplayername(char *buf); char *getplayernamefull(char *buf); int getpoisondamchance(enum POISONTYPE ptype); @@ -193,6 +195,7 @@ int getraceclass(lifeform_t *lf); int getracerarity(map_t *map, enum RACE rid); object_t *getrandomarmour(lifeform_t *lf); enum BODYPART getrandomcorebp(lifeform_t *lf); +race_t *getrandomcorpserace(cell_t *c); job_t *getrandomjob(int onlyplayerjobs); int getrandommonlevel(race_t *r, map_t *m); race_t *getrandomrace(cell_t *c, int forcedepth); @@ -224,13 +227,14 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp); void givestartskills(lifeform_t *lf, flagpile_t *fp); map_t *gotolev(lifeform_t *lf, int depth, object_t *fromstairs); int gotosleep(lifeform_t *lf, int onpurpose); +flag_t *hasbleedinginjury(lifeform_t *lf, enum BODYPART bp); int hasfreeaction(lifeform_t *lf); job_t *hasjob(lifeform_t *lf, enum JOB job); void inc_quad_range(enum QUADRANT *start, enum QUADRANT *end, int howmuch); int injure(lifeform_t *lf, enum BODYPART where, enum DAMTYPE damtype); int lfcanbestoned(lifeform_t *lf); flag_t *lfhasflag(lifeform_t *lf, enum FLAG fid); -flag_t *lfhasflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2, /*@null@*/ char *text); +flag_t *lfhasflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2, char *text); flag_t *lfhasknownflag(lifeform_t *lf, enum FLAG fid); flag_t *lfhasknownflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2, /*@null@*/ char *text); int lfproduceslight(lifeform_t *lf); @@ -274,6 +278,7 @@ int ispolymorphed(lifeform_t *lf); int isprone(lifeform_t *lf); flag_t *isresistantto(flagpile_t *fp, enum DAMTYPE dt); flag_t *isresting(lifeform_t *lf); +int issleepingtimefor(lifeform_t *lf); object_t *isstuck(lifeform_t *lf); int issmellablelf(lifeform_t *lf); int isswimming(lifeform_t *lf); diff --git a/map.c b/map.c index fa1ae15..d5b12ef 100644 --- a/map.c +++ b/map.c @@ -285,6 +285,11 @@ lifeform_t *addmonster(cell_t *c, enum RACE rid, char *racename, int jobok, int // TODO: base this on the time, and whether monster is nocturnal if (pctchance(asleepchance)) { addflag(lf->flags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL); + } else { + // might be asleep based on time. + if (issleepingtimefor(lf)) { + addflag(lf->flags, F_ASLEEP, NA, ST_ASLEEP, NA, NULL); + } } } // monsters who on dark levels can always see in the dark @@ -535,7 +540,7 @@ int getmapmaxvisrange(map_t *m) { // populates retcell[] with all cells within given radius of centre // if 'scatter' is >0, then not all cells will be returned - as you approach the edge of the radius, // chances of getting the cells are lowered -void getradiuscells(cell_t *centre, int radius, int dirtype, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells, int scatterdensity) { +void getradiuscells(cell_t *centre, int radius, int dirtype, int outsideonly, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells, int scatterdensity) { int (*distfunc)(cell_t *, cell_t *); int x,y; cell_t *c; @@ -554,10 +559,14 @@ void getradiuscells(cell_t *centre, int radius, int dirtype, enum LOFTYPE needlo for (x = centre->x - radius; x <= centre->x + radius; x++) { c = getcellat(centre->map, x,y); if (c) { - int distance; + int distance,distmatch = B_FALSE; distance = distfunc(centre, c); - if (haslof(centre, c, needlof, NULL) && (distance <= radius) && - (wantcentre || (c != centre)) ) { + if (outsideonly) { + if (distance == radius) distmatch = B_TRUE; + } else { + if (distance <= radius) distmatch = B_TRUE; + } + if (distmatch && haslof(centre, c, needlof, NULL) && (wantcentre || (c != centre)) ) { int chance; if (scatterdensity) { chance = 100 - (((float)distance / (float)radius) * scatterdensity); @@ -2035,8 +2044,12 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ } else { for (i = 0; i < map->region->rtype->stairsperlev; i++) { c = NULL; - while (!c || !isempty(c) || countobs(c->obpile, B_TRUE)) { + while (!isempty(c) || countobs(c->obpile, B_TRUE)) { c = getrandomroomcell(map, ANYROOM); + if (!c) { + // ANY cell at all, doesn't have to be a room. + c = getrandomcell(map); + } } o = addobfast(c->obpile, OT_STAIRSUP); linkstairs(o, NULL); @@ -2213,14 +2226,14 @@ void createforest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t c = getrandomcell(map); w = rnd(MINCLEARINGRADIUS,MAXCLEARINGRADIUS); // clear obs in all clearing cells - getradiuscells(c, w, DT_ORTH, LOF_DONTNEED, B_TRUE, retcell, &nretcells, B_FALSE); + getradiuscells(c, w, DT_ORTH, B_FALSE, LOF_DONTNEED, B_TRUE, retcell, &nretcells, B_FALSE); for (n = 0; n < nretcells; n++) { // kill all obs here while (retcell[n]->obpile->first) killob(retcell[n]->obpile->first); } // fill some cells with dirt - getradiuscells(c, w, DT_ORTH, LOF_DONTNEED, B_TRUE, retcell, &nretcells, 70); + getradiuscells(c, w, DT_ORTH,B_FALSE, LOF_DONTNEED, B_TRUE, retcell, &nretcells, 70); for (n = 0; n < nretcells; n++) { setcelltype(retcell[n], CT_DIRT); } @@ -2235,7 +2248,7 @@ void createforest(map_t *map, int depth, map_t *parentmap, int exitdir, object_t w = rnd(MINCLEARINGRADIUS,MAXCLEARINGRADIUS); - getradiuscells(c, w, DT_ORTH, LOF_DONTNEED, B_TRUE, retcell, &nretcells, 80); + getradiuscells(c, w, DT_ORTH, B_FALSE, LOF_DONTNEED, B_TRUE, retcell, &nretcells, 80); for (n = 0; n < nretcells; n++) { switch (rnd(0,1)) { default: case 0: strcpy(buf, "tree"); break; @@ -3280,7 +3293,10 @@ int linkexit(cell_t *startcell, int wantfilled, int *ncellsadded) { } } else { if (db) dblog(" Cannot find a way to link up."); - assert(0 == 1); // for debugging + // debugging - a failure here during fix_reachability is fatal. + if (wantfilled) { + assert(0 == 1); + } } return B_TRUE; } @@ -5295,7 +5311,7 @@ void setcellknown(cell_t *cell, int forcelev) { void setcellknownradius(cell_t *centre, int forcelev, int radius, int dirtype) { cell_t *cell[MAXCANDIDATES]; int ncells,i; - getradiuscells(centre, radius, dirtype, LOF_DONTNEED, B_TRUE, cell, &ncells, B_FALSE); + getradiuscells(centre, radius, dirtype, B_FALSE, LOF_DONTNEED, B_TRUE, cell, &ncells, B_FALSE); for (i = 0; i < ncells; i++) { cell_t *c; c = cell[i]; diff --git a/map.h b/map.h index 6ef2343..87985c0 100644 --- a/map.h +++ b/map.h @@ -32,7 +32,7 @@ flag_t *getmapcoords(map_t *m, int *x, int *y); int getmapdifficulty(map_t *m); map_t *getmapindir(map_t *src, int dir); int getmapmaxvisrange(map_t *m); -void getradiuscells(cell_t *centre, int radius, int dirtype, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells, int scatterdensity); +void getradiuscells(cell_t *centre, int radius, int dirtype, int outsideonly, enum LOFTYPE needlof, int wantcentre, cell_t **retcell, int *ncells, int scatterdensity); int getroomid(cell_t *c); void getroomedge(map_t *m, int roomid, int minx, int miny, int maxx, int maxy, int whichside, cell_t **retcell, int *ncells, int onlywantsolid); object_t *gettopobject(cell_t *where, int forglyph); diff --git a/move.c b/move.c index cd5856a..006b7c6 100644 --- a/move.c +++ b/move.c @@ -7,6 +7,7 @@ #include "attack.h" #include "defs.h" #include "flag.h" +#include "god.h" #include "io.h" #include "lf.h" #include "map.h" @@ -476,6 +477,7 @@ int dorandommove(lifeform_t *lf, int badmovesok, int restonfail) { // src is where something is // dst is what we are going away from +// if srclf is set, it is used for cellwalkable() checks. ie. if move will be involuntary, don't set this! // wantcheck is whether to check for dangerous things before considering a direction valid int getdiraway(cell_t *src, cell_t *dst, lifeform_t *srclf, int wantcheck, int dirtype, int keepinlof) { int d; @@ -931,7 +933,7 @@ int moveeffects(lifeform_t *lf) { } if (isbleeding(lf)) { - if (lfhasflagval(lf, F_INJURY, NA, BP_LEGS, DT_SLASH, NULL)) { + if (hasbleedinginjury(lf, BP_LEGS)) { if (!bleedfrom(lf, BP_LEGS, B_FALSE)) { losehp(lf, 1, DT_DIRECT, NULL, "blood loss"); } @@ -1265,6 +1267,7 @@ int movelf(lifeform_t *lf, cell_t *newcell) { f = hasflag(postroom->vault->flags, F_VAULTENTERTEXT); if (f) { msg("%s", f->text); + didmsg = B_TRUE; } } } @@ -1530,9 +1533,6 @@ int move_will_hurt(lifeform_t *lf) { flag_t *retflag[MAXCANDIDATES]; int nretflags,i; - if (lfhasflag(lf, F_PAIN)) { - return B_TRUE; - } getflags(lf->flags, retflag, &nretflags, F_INJURY, F_PAIN, F_NONE); for (i = 0; i < nretflags; i++) { flag_t *f; @@ -1547,6 +1547,10 @@ int move_will_hurt(lifeform_t *lf) { } } } + + if (hasbleedinginjury(lf, BP_LEGS)) { + return B_TRUE; + } return B_FALSE; } @@ -1819,11 +1823,17 @@ int closedoor(lifeform_t *lf, object_t *o) { } int tryrun(lifeform_t *lf, int dir) { - if (!trymove(lf, dir, B_TRUE, B_TRUE)) { - // success! + int willrun = B_TRUE,rv; + if (!moveclear(lf, dir, NULL)) { + // don't double move into monsters, etc + willrun = B_FALSE; + } + rv = trymove(lf, dir, B_TRUE, B_TRUE); + if (!rv && willrun) { + // successful move addflag(lf->flags, F_RUNNING, dir, B_FALSE, NA, NULL); } - return B_FALSE; + return rv; } int trysneak(lifeform_t *lf, int dir) { @@ -2206,13 +2216,18 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) { int rndmove = B_FALSE; int howlong; int reldir; + int srcmoney = 0; flag_t *f; howlong = getmovespeed(lf); reldir = getrelativedir(lf, dir); + if (onpurpose) { + if (isplayer(lf)) { + srcmoney = countmoney(lf->cell->obpile); + } if ((reldir != RD_FORWARDS) && !lfhasflag(lf, F_AWARENESS)) { // if the given dir is behind us, just turn. if (!strafe) { @@ -2248,8 +2263,8 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) { cell = getcellindir(lf->cell, dir); - // warn if moving will cause injury - if (onpurpose && isplayer(lf)) { + // warn if moving will cause damage + if (cell && !cell->lf && onpurpose && isplayer(lf) ) { if (!confirm_injury_action(BP_LEGS, DT_SLASH, "move")) { return B_TRUE; } @@ -2536,6 +2551,7 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) { char lfname[BUFLEN]; getlfname(lfinway, lfname); msg("You swap places with %s.", lfname); + dontclearmsg = B_TRUE; } swapplaces(lf, lfinway, B_FALSE, onpurpose); @@ -2600,11 +2616,16 @@ int trymove(lifeform_t *lf, int dir, int onpurpose, int strafe) { default: break; } - if (reason == E_OK) { - return B_FALSE; - } else { - return B_TRUE; - } + } + + + // purposely moving away fmor money? + if (onpurpose && isplayer(lf) && srcmoney) { + angergodmaybe(R_GODTHIEVES, srcmoney); + } + + if (reason != E_OK) { + return B_TRUE; } return B_FALSE; } diff --git a/objects.c b/objects.c index ec9c8b2..84c1421 100644 --- a/objects.c +++ b/objects.c @@ -1222,9 +1222,9 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes if (o->type->id == OT_CORPSE) { flag_t *rf, *cf; - if (!corpserace) { + if (!corpserace || hasflag(corpserace->flags, F_NOCORPSE)) { // random one. - corpserace = getrandomrace(NULL, NA); + corpserace = getrandomcorpserace(NULL); } o->weight = corpserace->weight; @@ -1250,11 +1250,11 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes where = getoblocation(o); // select random race if (where) { - corpserace = getrandomrace(where, NA); + corpserace = getrandomcorpserace(where); } if (!corpserace) { // ie. vending machine, or inside another object/fake cell? - corpserace = getrandomrace(NULL, NA); + corpserace = getrandomcorpserace(NULL); } } @@ -1311,9 +1311,9 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes } else if (o->type->id == OT_ROASTMEAT) { flag_t *rf, *cf; - if (!corpserace) { + if (!corpserace || hasflag(corpserace->flags, F_NOCORPSE)) { // random one. - corpserace = getrandomrace(NULL, NA); + corpserace = getrandomcorpserace(NULL); } o->weight = corpserace->weight / 2; @@ -1468,7 +1468,7 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes if (o->blessed == B_CURSED) f->val[2] *= -1; } else if (o->type->id == OT_RING_DEX) { flag_t *f; - f = hasflagval(o->flags, F_EQUIPCONFER, F_ATTRMOD, A_DEX, NA, NULL); + f = hasflagval(o->flags, F_EQUIPCONFER, F_ATTRMOD, A_AGI, NA, NULL); if (f) { if (bonus) f->val[2] = bonus; else f->val[2] = rnd(1,3); @@ -1592,7 +1592,7 @@ int addobburst(cell_t *where, int range, int dirtype, char *name, lifeform_t *fr redrawpause(); - getradiuscells(where, range, dirtype, needlof, B_TRUE, cell, &ncells, B_FALSE); + getradiuscells(where, range, dirtype, B_FALSE, needlof, B_TRUE, cell, &ncells, B_FALSE); for (i = 0; i < ncells; i++) { cell_t *c; c = cell[i]; @@ -2390,6 +2390,18 @@ void copyobprops(object_t *dst, object_t *src) { } +int countmoney(obpile_t *op) { + object_t *o; + int amt = 0; + for (o = op->first ; o ; o = o->next) { + if (o->type->id == OT_GOLD) { + amt += o->amt; + } + } + return amt; +} + + int countnames(char **list) { int count; for (count = 0; list[count]; count++); @@ -3042,9 +3054,10 @@ int getobaccuracy(object_t *wep, lifeform_t *weilder) { } // blessed weapons have better base accuracy - if (wep->blessed == B_BLESSED) acc += 50; + if (wep->blessed == B_BLESSED) acc += 10; + //bonusses? - acc += (getobbonus(wep)*5); + acc += (getobbonus(wep, B_FALSE)*10); if (weilder) { enum SKILLLEVEL slev; @@ -3085,14 +3098,17 @@ int getobaccuracy(object_t *wep, lifeform_t *weilder) { return acc; } -int getobbonus(object_t *o) { +int getobbonus(object_t *o, int onlyknown) { int bonus = 0,i; flag_t *retflag[MAXCANDIDATES]; int nretflags = 0; getflags(o->flags, retflag, &nretflags, F_BONUS, F_NONE); for (i = 0; i < nretflags; i++) { - bonus += retflag[i]->val[0]; + if (onlyknown && !retflag[i]->known) { + } else { + bonus += retflag[i]->val[0]; + } } return bonus; } @@ -3326,29 +3342,6 @@ object_t *getoutercontainerop(obpile_t *op) { return o; } -// ie. "it has xxx accuracy" -char *getaccuracyname(int accpct) { - if (accpct >= 200) { - return "godlike"; - } else if (accpct >= 150) { - return "incredible"; - } else if (accpct >= 100) { - return "very good"; - } else if (accpct >= 70) { - return "good"; - } else if (accpct >= 50) { - return "average"; - } else if (accpct >= 30) { - return "poor"; - } else if (accpct >= 20) { - return "very poor"; - } else if (accpct >= 0) { - return "incredibly poor"; - } else { - return "a complete lack of"; - } -} - object_t *getammo(object_t *gun) { object_t *o; @@ -4547,7 +4540,7 @@ char *real_getobname(object_t *o, char *buf, int count, int wantpremods, int wan } if (hasflag(o->flags, F_KNOWNBAD)) { - strcat(localbuf, " [bad]"); + strcat(localbuf, " [badfeeling]"); } if (getskill(player, SK_COOKING) >= PR_BEGINNER) { @@ -5212,12 +5205,15 @@ int getthrowdam(object_t *o) { return (int)dam; } -// get either name of top object, or cell type if solid +// get either name of top object, or cell type char *gettopobname(cell_t *c, char *retbuf) { char buf[BUFLEN]; int nother; + strcpy(retbuf, ""); + /* if (c->type->solid) { strcpy(retbuf, c->type->name); + nother = countnoncosmeticobs(c->obpile, B_TRUE); if (nother) { snprintf(buf, BUFLEN, " (+%d other thing%s)", nother, (nother == 1) ? "" : "s"); @@ -5225,21 +5221,24 @@ char *gettopobname(cell_t *c, char *retbuf) { } return retbuf; } else { - object_t *o; - o = gettopobject(c, B_FALSE); - if (o) { - getobname(o, buf, o->amt); - strcat(retbuf, buf); - // other obs here too? - nother = countnoncosmeticobs(c->obpile, B_TRUE) - 1; - if (nother >= 1) { - snprintf(buf, BUFLEN, " (+%d other thing%s)", nother, (nother == 1) ? "" : "s"); - strcat(retbuf, buf); - } - return retbuf; - } } - return NULL; + */ + object_t *o; + o = gettopobject(c, B_FALSE); + if (o) { + getobname(o, buf, o->amt); + strcat(retbuf, buf); + // other obs here too? + nother = countnoncosmeticobs(c->obpile, B_TRUE) - 1; + if (nother >= 1) { + snprintf(buf, BUFLEN, " (+%d other thing%s)", nother, (nother == 1) ? "" : "s"); + strcat(retbuf, buf); + } + } else { + // just print the cell's name + strcat(retbuf, c->type->name); + } + return retbuf; } enum BODYPART getweildloc(object_t *o, enum BODYPART *otherloc, int *twohanded) { @@ -5825,6 +5824,9 @@ int ismagical(object_t *o) { if (hasflag(o->flags, F_ENCHANTABLE) && hasflag(o->flags, F_BONUS)) { return B_TRUE; } + if (o->type->id == OT_SHILLELAGH) { + return B_TRUE; + } return B_FALSE; } @@ -6245,9 +6247,9 @@ int makeduller(object_t *o, int howmuch) { // get object name before changing the bonus getobname(o,obname, 1); - oldbonus = getobbonus(o); + oldbonus = getobbonus(o, B_FALSE); modbonus(o, -howmuch); - newbonus = getobbonus(o); + newbonus = getobbonus(o, B_FALSE); if (newbonus < oldbonus) { if (o->pile->owner) { @@ -7641,7 +7643,7 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) { if ((m->region->rtype->id == RG_FIRSTDUNGEON) && (m->depth == 1)) { cell_t *cell[MAXCANDIDATES]; int ncells,i; - getradiuscells(lf->cell, 1, DT_COMPASS, B_FALSE, B_TRUE, cell, &ncells, B_FALSE); + getradiuscells(lf->cell, 1, DT_COMPASS, B_FALSE, LOF_DONTNEED, B_TRUE, cell, &ncells, B_FALSE); for (i = 0; i < ncells; i++) { if (hasob(cell[i]->obpile, OT_STAIRSUP)) { object_t *o; @@ -8594,8 +8596,8 @@ void potioneffects(lifeform_t *lf, enum OBTYPE oid, object_t *o, enum BLESSTYPE setattr(lf, A_STR, lf->baseatt[A_STR]); failed = B_FALSE; } - if (getattr(lf,A_DEX) < lf->baseatt[A_DEX]) { - setattr(lf, A_DEX, lf->baseatt[A_DEX]); + if (getattr(lf,A_AGI) < lf->baseatt[A_AGI]) { + setattr(lf, A_AGI, lf->baseatt[A_AGI]); failed = B_FALSE; } if (getattr(lf,A_IQ) < lf->baseatt[A_IQ]) { @@ -8872,6 +8874,7 @@ int readsomething(lifeform_t *lf, object_t *o) { } else { makeknown(o->type->id); } + o->blessknown = B_TRUE; real_getobname(o, obname, 1, B_FALSE, B_TRUE, B_FALSE, B_TRUE, B_FALSE); // don't adjust for blindness if (isplayer(lf)) { // tell the player @@ -8893,7 +8896,9 @@ int readsomething(lifeform_t *lf, object_t *o) { } } } - if (seen) makeknown(o->type->id); + if (seen) { + makeknown(o->type->id); o->blessknown = B_TRUE; + } } else if ((o->type->id == OT_SCR_MENDING) && isblessed(o)) { int seen = B_FALSE; object_t *oo; @@ -8906,7 +8911,7 @@ int readsomething(lifeform_t *lf, object_t *o) { } } if (seen) { - makeknown(o->type->id); + makeknown(o->type->id); o->blessknown = B_TRUE; } else { if (isplayer(lf) || cansee(player, lf)) nothinghappens(); } @@ -8936,7 +8941,7 @@ int readsomething(lifeform_t *lf, object_t *o) { dospelleffects(lf, f->val[0], power, NULL, targob, NULL, o->blessed, &seen, B_FALSE); if (seen) { // id the scroll now - makeknown(o->type->id); + makeknown(o->type->id); o->blessknown = B_TRUE; } // removeob one of the object @@ -9152,7 +9157,7 @@ int readsomething(lifeform_t *lf, object_t *o) { if (seen) { // id the scroll now - makeknown(o->type->id); + makeknown(o->type->id); o->blessknown = B_TRUE; } else { if (isplayer(lf)) { nothinghappens(); @@ -10350,7 +10355,7 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed, if (willcatch) { acc = 100; } else { - acc = getmissileaccuracy(thrower, where, o, firearm, A_DEX); + acc = getmissileaccuracy(thrower, where, o, firearm, A_AGI); } } else { // purely based on saving throw... @@ -11609,6 +11614,8 @@ int getcritchance(lifeform_t *lf, object_t *o, lifeform_t *victim) { f = hasflag(o->flags, F_CRITCHANCE); if (f) { chance += f->val[0]; + } else { + return 0; } if (lf) { diff --git a/objects.h b/objects.h index 83f03d2..7d42ea3 100644 --- a/objects.h +++ b/objects.h @@ -36,6 +36,7 @@ int changemat(object_t *o, enum MATERIAL mat); int checkobnames(char *haystack, char *needle); void colourmatchob(object_t *o, lifeform_t *lf); void copyobprops(object_t *dst, object_t *src); +int countmoney(obpile_t *op); int countnames(char **list); int countobs(obpile_t *op, int onlyifknown); int countobsoftype(obpile_t *op, enum OBTYPE oid); @@ -66,7 +67,7 @@ enum COLOUR getmaterialcolour(enum MATERIAL mat ); enum MATSTATE getmaterialstate(enum MATERIAL mat); int getmissileaccuracy(lifeform_t *thrower, cell_t *where, object_t *missile, object_t *firearm, enum ATTRIB whichatt); int getobaccuracy(object_t *wep, lifeform_t *weilder); -int getobbonus(object_t *o); +int getobbonus(object_t *o, int onlyknown); int getobpoints(object_t *o); skill_t *getobskill(object_t *o); enum LFSIZE getobsize(object_t *o); @@ -76,7 +77,6 @@ char *getoperateverb(object_t *o); object_t *getoutercontainer(object_t *o); object_t *getoutercontainerop(obpile_t *op); //int getobtypevalue(objecttype_t *ot); -char *getaccuracyname(int accpct); object_t *getammo(object_t *gun); objecttype_t *getbasicweaponforskill(enum SKILL skid); object_t *getrandomammo(lifeform_t *lf); diff --git a/save.c b/save.c index e3c7b9c..5f4d13e 100644 --- a/save.c +++ b/save.c @@ -196,7 +196,7 @@ lifeform_t *loadlf(FILE *f, cell_t *where) { // load rest of this lf fscanf(f, "str: %d/%d\n",&l->att[A_STR],&l->baseatt[A_STR]); - fscanf(f, "dex: %d/%d\n",&l->att[A_DEX],&l->baseatt[A_DEX]); + fscanf(f, "dex: %d/%d\n",&l->att[A_AGI],&l->baseatt[A_AGI]); fscanf(f, "int: %d/%d\n",&l->att[A_IQ],&l->baseatt[A_IQ]); fscanf(f, "xp: %ld\n",&l->xp); fscanf(f, "skp: %d\n",&l->skillpoints); @@ -784,7 +784,7 @@ int savelf(FILE *f, lifeform_t *l) { fprintf(f, "newlevel: %d\n",l->newlevel); // liefform will be created after loading the above. fprintf(f, "str: %d/%d\n",l->att[A_STR],l->baseatt[A_STR]); - fprintf(f, "dex: %d/%d\n",l->att[A_DEX],l->baseatt[A_DEX]); + fprintf(f, "dex: %d/%d\n",l->att[A_AGI],l->baseatt[A_AGI]); fprintf(f, "int: %d/%d\n",l->att[A_IQ],l->baseatt[A_IQ]); fprintf(f, "xp: %ld\n",l->xp); fprintf(f, "skp: %d\n",l->skillpoints); diff --git a/spell.c b/spell.c index 7050980..d8ec83d 100644 --- a/spell.c +++ b/spell.c @@ -99,7 +99,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef if (f) stamcost = f->val[0]; if (stamcost) { - if (user->stamina < stamcost) { + if (getstamina(user) < stamcost) { if (isplayer(user)) { msg("You are too tired to do that right now."); } @@ -580,7 +580,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } // victim gets a skilcheck to avoid being grabbed - if (skillcheck(target, SC_DODGE, getattr(user, A_DEX)+11, 0)) { + if (skillcheck(target, SC_DODGE, getattr(user, A_AGI)+11, 0)) { if (cansee(player, user)) { msg("%s evade%s %s%s grasp.", targetname, isplayer(target) ? "" : "s", username, getpossessive(username)); @@ -800,12 +800,13 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } } else if (abilid == OT_A_REPAIR) { enum SKILLLEVEL slev; - object_t *o; + object_t *o,*helpob = NULL; enum MATERIAL repairablemats[MAXCANDIDATES]; int repaircutoff = 0; int cutoffpct[MAXCANDIDATES]; int nmats = 0; int i; + char helpobname[BUFLEN]; // get list of repairable materials slev = getskill(user, SK_METALWORK); @@ -820,6 +821,8 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef case PR_MASTER: cutoff = 100; break; default: cutoff = 0; break; } + helpob = hasob(user->pack, OT_SPANNER); + if (helpob) cutoff += 15; repairablemats[nmats] = MT_METAL; cutoffpct[nmats] = cutoff; nmats++; @@ -836,6 +839,8 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef case PR_MASTER: cutoff = 100; break; default: cutoff = 0; break; } + helpob = hasob(user->pack, OT_NEEDLE); + if (helpob) cutoff += 15; repairablemats[nmats] = MT_CLOTH; cutoffpct[nmats] = cutoff; nmats++; @@ -844,6 +849,11 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef nmats++; } + if (helpob) { + real_getobname(helpob, helpobname, helpob->amt, B_TRUE, B_FALSE, B_TRUE, B_TRUE, B_FALSE); + } else { + strcpy(helpobname, ""); + } // 1.compile a list of repairable objects // sk_armour lets you repair armour up to xx% (depends on skill) @@ -864,10 +874,11 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef f = hasflag(o->flags, F_OBHP); pct = ((float)f->val[0] /(float) f->val[1]) * 100; if (pct < cutoff) { - char buf[BUFLEN]; + char buf[BUFLEN],desc[BUFLEN]; getobname(o, buf, o->amt); + sprintf(desc, "%s (-> %d%%)",buf, cutoff); // we can repair this object - addchoice(&prompt, o->letter, buf, buf, o, NULL); + addchoice(&prompt, o->letter, desc, desc, o, NULL); } } } @@ -909,13 +920,21 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef f = hasflag(o->flags, F_OBHP); f->val[0] = pctof(repaircutoff, f->val[1]); if (isplayer(user)) { - char buf[BUFLEN]; + char buf[BUFLEN],withbuf[BUFLEN]; real_getobname(o, buf, o->amt, B_TRUE, B_FALSE, B_TRUE, B_TRUE, B_FALSE); - msg("You %srepair your %s.", (f->val[0] == f->val[1]) ? "" : "partially ", noprefix(buf)); + if (helpob) sprintf(withbuf, " (with %s)", helpobname); + else strcpy(withbuf, ""); + + msg("You %srepair your %s%s.", (f->val[0] == f->val[1]) ? "" : "partially ", + noprefix(buf), withbuf); } else { - char buf[BUFLEN]; + char buf[BUFLEN],withbuf[BUFLEN]; real_getobname(o, buf, o->amt, B_TRUE, B_FALSE, B_TRUE, B_TRUE, B_FALSE); - msg("%s %s repairs %s.", username, (f->val[0] == f->val[1]) ? "completely" : "partially", buf); + if (helpob) sprintf(withbuf, " with %s", helpobname); + else strcpy(withbuf, ""); + + msg("%s %s repairs %s%s.", username, (f->val[0] == f->val[1]) ? "completely" : "partially", + buf, withbuf); } // TODO: make this like eating/resting/etc ? @@ -1416,6 +1435,47 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } msg("all blinded!"); return B_FALSE; + } else if (abilid == OT_A_AIMEDSTRIKE) { + object_t *wep; + char dirch; + char targetname[BUFLEN]; + flag_t *f; + + if (isswimming(user) && !lfhasflag(user, F_AQUATIC)) { + if (isplayer(user)) msg("You lack the control for an aimed strike while swimming."); + return B_TRUE; + } + + wep = getweapon(user); + + // ask for direction + if (!targcell) { + dirch = askchar("Aimed strike in which direction (- to cancel)", "yuhjklbn.-","-", B_FALSE); + if (dirch == '.') { + // yourself! + targcell = user->cell; + } else { + int dir; + dir = chartodir(dirch); + if (dir == D_NONE) { + if (isplayer(user)) msg("Cancelled."); + return B_TRUE ; + } else { + targcell = getcellindir(user->cell, dir); + } + } + } + + target = targcell->lf; + if (!target) { + if (isplayer(user)) msg("There is nobody there to attack!"); + return B_TRUE; + } + getlfname(target, targetname); + + f = addflag(user->flags, F_AIMEDSTRIKE, B_TRUE, NA, NA, NULL); + attackcell(user, targcell, B_TRUE); + killflag(f); } else if (abilid == OT_A_COMBOSTRIKE) { object_t *wep; skill_t *wepsk = NULL; @@ -1537,10 +1597,10 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef if (where && where->lf) { char ch; enum ATTRIB att; - ch = askchar("Enhance which stat (n for none)?", "sdcin",NULL, B_TRUE); + ch = askchar("Enhance which stat (n for none)?", "sacin",NULL, B_TRUE); switch (ch) { case 's': att = A_STR; break; - case 'd': att = A_DEX; break; + case 'a': att = A_AGI; break; case 'c': att = A_CON; break; case 'i': att = A_IQ; break; default: att = A_NONE; break; @@ -2094,7 +2154,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ msg("%s unleashes a freezing blast!", castername, getpossessive(castername)); } // freeze lfs, obs in most cells - getradiuscells(caster->cell, 7, DT_ORTH, LOF_WALLSTOP, B_FALSE, retcell, &nretcells, 90); + getradiuscells(caster->cell, 7, DT_ORTH, B_FALSE, LOF_WALLSTOP, B_FALSE, retcell, &nretcells, 90); for (i = 0; i < nretcells; i++) { object_t *o, *nexto; if (retcell[i]->lf) { @@ -3688,7 +3748,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ // don't need line of fire! if (!validatespellcell(caster, &targcell, TT_OBJECT, spellid, power, frompot)) return B_TRUE; - getradiuscells(targcell, power, DT_ORTH, LOF_NEED, B_TRUE, cell, &ncells, B_FALSE); + getradiuscells(targcell, power, DT_ORTH, B_FALSE, LOF_NEED, B_TRUE, cell, &ncells, B_FALSE); for (i = 0; i < ncells; i++) { object_t *o,*nexto; for (o = cell[i]->obpile->first ; o ; o = nexto) { @@ -4051,6 +4111,32 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ if (failed) { fizzle(caster); } + } else if (spellid == OT_S_FORCESPHERE) { + cell_t *retcell[MAXRETCELLS]; + int radius,nretcells,n,i; + if (!target) target = caster; + targcell = target->cell; + radius = power/3; + if (isplayer(target)) { + msg("You unleash a mighty shockwave!"); + if (seenbyplayer) *seenbyplayer = B_TRUE; + } else if (cansee(player, target)) { + char tname[BUFLEN]; + getlfname(target, tname); + msg("%s unleashes a mighty shockwave!", tname); + if (seenbyplayer) *seenbyplayer = B_TRUE; + } + // start at outside. + for (n = radius; n >= 1; n--) { + getradiuscells(targcell, n, DT_COMPASS, B_TRUE, LOF_WALLSTOP, B_FALSE, retcell, &nretcells, 0); + for (i = 0; i < nretcells; i++) { + if (retcell[i]->lf) { + knockback(retcell[i]->lf, + getdiraway(retcell[i], targcell, NULL, B_FALSE, DT_COMPASS, B_FALSE), + 2, target, 27+power); + } + } + } } else if (spellid == OT_S_ENERGYBOLT) { char lfname[BUFLEN]; char numbuf[BUFLEN]; @@ -4265,6 +4351,50 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ if (failed) { fizzle(caster); } + } else if (spellid == OT_S_EARTHQUAKE) { + cell_t *retcell[MAXRETCELLS],*c; + int nretcells,i,radius,seenwalls = 0, seenpits = 0; + radius = 3 + power; + getradiuscells(caster->cell, radius, DT_ORTH, B_FALSE, LOF_DONTNEED, B_FALSE, retcell, &nretcells, 80); + for (i = 0; i < nretcells; i++) { + c = retcell[i]; + if (c->type->solid) { + if (haslos(player, c)) seenwalls++; + setcelltype(c, c->map->habitat->emptycelltype); + addob(c->obpile, "50-100 stones"); + } else { + // it collapses + addobfast(c->obpile, OT_HOLEINGROUND); + if (haslos(player, c)) seenpits++; + } + } + getradiuscells(caster->cell, radius, DT_ORTH, B_FALSE, LOF_WALLSTOP, B_FALSE, retcell, &nretcells, 80); + for (i = 0; i < nretcells; i++) { + c = retcell[i]; + if (!c->type->solid) { + addobfast(c->obpile, OT_DUSTCLOUD); + } + } + if (seenpits || seenwalls || cansee(player, caster)) { + msg("The earth below you shudders and shakes violently!"); + setlosdirty(player); + } + if (seenpits) { + if (seenbyplayer) *seenbyplayer = B_TRUE; + if (seenwalls == 1) { + msg("A huge rent opens up in the ground!"); + } else { + msg("Huge rents open up in the ground!"); + } + } + if (seenwalls) { + if (seenbyplayer) *seenbyplayer = B_TRUE; + if (seenwalls == 1) { + msg("A nearby wall collapse into the ground!"); + } else { + msg("Nearby walls collapse into the ground!"); + } + } } else if (spellid == OT_S_ENCHANT) { object_t *o; @@ -6271,12 +6401,12 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ } f = hasflag(o->flags, F_OBHP); - if (f && isdamaged(o)) { + if (f) { if (blessed == B_CURSED) { if (isplayer(caster) || cansee(player, caster)) msg("%s deteriorates!", fullobname); takedamage(o, rnd(1,6) + power, DT_DIRECT); donesomething = B_TRUE; - } else { + } else if (isdamaged(o)) { f->val[0] += (rnd(1,6) + power); if (f->val[0] >= f->val[1]) { @@ -6630,7 +6760,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ amttolose = power*2; // only announce if the target will have some stamina left. // if they drop to 0, modstamina will handle the announce. - if (target->stamina >= amttolose) { + if (getstamina(target) >= amttolose) { if (isplayer(target)) { msg("You suddenly feel very lethargic!"); } else if (cansee(player, target)) { @@ -6804,7 +6934,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ } } else { // 2nd one failed - lose all stamina instead - modstamina(target, -(target->stamina)); + modstamina(target, -(getstamina(target))); if (isplayer(target)) { msg("You suddenly feel very lethargic!"); } else if (cansee(player, target)) { diff --git a/text.c b/text.c index bcc3462..52a100c 100644 --- a/text.c +++ b/text.c @@ -153,6 +153,33 @@ int flip(int ch) { return ch; } +// ie. "it has xxx accuracy" +char *getaccuracyname(int accpct) { + if (accpct >= 200) { + return "incredible"; + } else if (accpct >= 150) { + return "very good"; + } else if (accpct >= 100) { + return "good"; + } else if (accpct >= 70) { + return "average"; + } else if (accpct >= 50) { + return "poor"; + } else if (accpct >= 30) { + return "very poor"; + } else if (accpct >= 20) { + return "extremely poor"; + } else { + return "a complete lack of"; + } +} + +int getaccuracynum(int accpct) { + int num; + num = (accpct - 100) / 5; // + return num; +} + char *getattrabbrev(enum ATTRIB att) { switch (att) { case A_NONE: @@ -161,8 +188,8 @@ char *getattrabbrev(enum ATTRIB att) { return "Ch"; case A_CON: return "Ft"; - case A_DEX: - return "Dx"; + case A_AGI: + return "Ag"; case A_IQ: return "Iq"; case A_STR: @@ -181,8 +208,8 @@ char *getattrname(enum ATTRIB att) { return "charisma"; case A_CON: return "fitness"; - case A_DEX: - return "dexterity"; + case A_AGI: + return "agility"; case A_IQ: return "intelligence"; case A_STR: @@ -301,6 +328,53 @@ int gethitconferlifetime(char *text, int *min, int *max) { return howlong; } +char *getpoisondamverb(enum POISONTYPE ptype) { + switch (ptype) { + case P_FOOD: + case P_VENOM: + return "vomit"; + case P_GAS: + case P_COLD: + return "cough"; + default: + break; + } + return ""; +} + +char *getpoisondesc(enum POISONTYPE ptype) { + switch (ptype) { + case P_FOOD: + case P_VENOM: + case P_GAS: + case P_WEAKNESS: + return "Poisoned"; + case P_COLD: + return "Sick"; + default: + break; + } + return "Poisoned"; +} + +char *getpoisonname(enum POISONTYPE ptype) { + switch (ptype) { + case P_COLD: + return "hypothermia"; + case P_FOOD: + return "food poisoning"; + case P_GAS: + return "gas inhalation"; + case P_VENOM: + return "venom poisoning"; + case P_WEAKNESS: + return "weakening poison"; + default: + break; + } + return ""; +} + char *getpossessive(char *text) { char lastchar; // you -> your diff --git a/text.h b/text.h index e43b2c0..47f09d7 100644 --- a/text.h +++ b/text.h @@ -6,11 +6,16 @@ char *capitaliseall(char *text); enum COLOUR chartocol(char ch); char *dicetotext(int ndice, int nsides, int bonus, int *min, int *max, char *dicebuf, char *minmaxbuf); int flip(int ch); +char *getaccuracyname(int accpct); +int getaccuracynum(int accpct); char *getattrabbrev(enum ATTRIB att); char *getattrname(enum ATTRIB att); char *getdirname(int dir); char *getdirnameshort(int dir); int gethitconferlifetime(char *text, int *min, int *max); +char *getpoisondamverb(enum POISONTYPE ptype); +char *getpoisondesc(enum POISONTYPE ptype); +char *getpoisonname(enum POISONTYPE ptype); char *getpossessive(char *text); char *getdrunktext(flag_t *drunkflag); char *getinjuredbpname(enum BODYPART bp); diff --git a/vaults/playerstart2.vlt b/vaults/playerstart2.vlt index 3fca739..5e00be5 100644 --- a/vaults/playerstart2.vlt +++ b/vaults/playerstart2.vlt @@ -1,21 +1,19 @@ @id:playerstart_2 @map ###x### -#m|.|m# +#.-.-.# ###.### -#m|.-p# +#.-.-p# ###.### -#m|.|m# +#.-.-.# ###.### -#m|.|m# +#.-.-.# ###x### @end @legend #:cell:rock wall -|:ob:locked iron gate -:ob:iron gate p:ob:playerstart -m:mon:humanoid x:exit @end @flags diff --git a/vaults/playerstart4.vlt b/vaults/playerstart4.vlt index 3c80174..75140f0 100644 --- a/vaults/playerstart4.vlt +++ b/vaults/playerstart4.vlt @@ -1,12 +1,14 @@ @id:playerstart_4 @map -###x### -#ww_ww# -#ww.ww# -x_.p._x -#ww.ww# -#ww_ww# -###x### +####x#### +#.......# +#.ww_ww.# +#.ww.ww.# +x._.p._.x +#.ww.ww.# +#.ww_ww.# +#.......# +####x#### @end @legend #:cell:rock wall