From c7845ee622917854b11838c6602807f0e5f7d68c Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Thu, 6 Oct 2011 20:12:13 +0000 Subject: [PATCH] - [+] fixed buf where f_restuntilbetter wasn't cleared - [+] monk was starting with agility too high. - [+] crash: missing room ids. hopefully fixed. - [+] notify player when stamina rises from 0 - [+] resting - get rid of seperate "rest until xxx", just rest until EVERYTHINg is good. - [+] steam should deal heat damage, not fire (ie. don't set things alight) - [+] river going through a level. how do i do this? - [+] outline???: "hasriver" - [+] river code: - [+] pick random radius (0-3) - [+] pick random spot along top ( x >= radius and x <= w-radius-1) - [+] pick random spot along bottom - [+] bresnham between spots to make centrelist - [+] for each centrelist - [+] make a second list of rivercells (rivercell->x - wid/2) - (rivercell->x + wid/2) - [+] foreach riverercell - [+] move any staircases here to somewhere else - [+] clearcell - [+] convert to low rock floor - [+] convert to deep water - [+] make ctrl-y work, as well as ctrl-c - [+] i'm noticing tripwires too often (adventurer with 0 perception skill) - [+] make the check harder! - [+] tweak safetorest() so that monsters don't just look away form the plaeyr then go to sleep! --- attack.c | 13 +++- attack.h | 1 + data.c | 42 +++++++---- data/hiscores.db | Bin 7168 -> 8192 bytes defs.h | 14 +++- io.c | 189 +++++++++++++++++++++++++---------------------- lf.c | 80 ++++++++++++++------ lf.h | 1 + map.c | 121 ++++++++++++++++++++++++------ map.h | 2 + nexus.c | 4 +- objects.c | 17 ++--- spell.c | 8 +- 13 files changed, 323 insertions(+), 169 deletions(-) diff --git a/attack.c b/attack.c index 2521eb5..9546da3 100644 --- a/attack.c +++ b/attack.c @@ -1098,7 +1098,7 @@ int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag) } } else { // victim turns to ice for a while! - freezelf(victim, lf, rnd(5,10)); + freezelf(victim, lf, f->val[1]); } killflag(f); } @@ -1455,6 +1455,15 @@ int attackob(lifeform_t *lf, object_t *o, object_t *wep, flag_t *damflag) { return B_FALSE; } +enum DAMTYPE basedamagetype(enum DAMTYPE dt) { + switch (dt) { + case DT_HEAT: + dt = DT_FIRE; break; + default: + break; + } + return dt; +} void criticalhit(lifeform_t *lf, lifeform_t *victim, enum BODYPART hitpos, int dam, enum DAMTYPE damtype) { object_t *o,*armour; @@ -1780,7 +1789,7 @@ char *getattackverb(lifeform_t *lf, object_t *wep, enum DAMTYPE damtype, int dam } else { return "electrocute"; } - } else if (damtype == DT_FIRE) { + } else if ((damtype == DT_FIRE) || (damtype == DT_HEAT)) { if (pct <= 5) { return "scorch"; } else if (pct <= 20) { diff --git a/attack.h b/attack.h index 2d2bf75..450b4a5 100644 --- a/attack.h +++ b/attack.h @@ -5,6 +5,7 @@ void applyarmourdamreduction(lifeform_t *lf, object_t *wep, int reduceamt, int * int attackcell(lifeform_t *lf, cell_t *c, int force); int attacklf(lifeform_t *lf, lifeform_t *victim, object_t *wep, flag_t *damflag); int attackob(lifeform_t *lf, object_t *o, object_t *wep, flag_t *damflag); +enum DAMTYPE basedamagetype(enum DAMTYPE dt); void confereffects(flagpile_t *fp, lifeform_t *victim); void criticalhit(lifeform_t *lf, lifeform_t *victim, enum BODYPART hitpos, int dam, enum DAMTYPE damtype); int damtypecausesbleed(enum DAMTYPE dt); diff --git a/data.c b/data.c index de7c9e9..7b4846e 100644 --- a/data.c +++ b/data.c @@ -215,7 +215,7 @@ void initjobs(void) { addjob(J_COMMANDO, "Commando"); // stat mods addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 2, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_IQ, -4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_IQ, -3, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_CON, 3, NA, NULL); // initial objects addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "combat knife"); @@ -255,7 +255,7 @@ void initjobs(void) { addjob(J_DRUID, "Druid"); // stats addflag(lastjob->flags, F_MPDICE, 1, 1, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 3, NA, NULL); addflag(lastjob->flags, F_JOBATTRMOD, A_CHA, 2, NA, NULL); // initial objects addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "quarterstaff"); @@ -292,9 +292,9 @@ void initjobs(void) { /////////////////////////////////////// addjob(J_MONK, "Monk"); // stats - addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 2, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 4, NA, NULL); - addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 4, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_STR, 1, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_AGI, 2, NA, NULL); + addflag(lastjob->flags, F_JOBATTRMOD, A_WIS, 2, NA, NULL); // initial objects addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "robe"); addflag(lastjob->flags, F_STARTOB, 100, NA, NA, "2 loaf of stale bread"); @@ -341,6 +341,7 @@ void initjobs(void) { addflag(lastjob->flags, F_LEVFLAG, 10, F_DTIMMUNE, DT_POISON, NULL); addflag(lastjob->flags, F_LEVSPELL, 11, OT_S_PSYARMOUR, NA, NULL); // 12: quivering palm (v.high mp cost OR once every 200 turns or so) + addflag(lastjob->flags, F_LEVABIL, 12, OT_A_QUIVERINGPALM, NA, NULL); addflag(lastjob->flags, F_LEVABIL, 13, OT_S_BLINK, 10, "pw:6;"); // l6 = controlled // 14: speak with plants (mp?innate?) // 15: mind bar??? what is this @@ -1232,6 +1233,7 @@ void initobjects(void) { addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_SECRET, 20, NA, NA, NULL); addflag(lastot->flags, F_NOBLESS, B_TRUE, NA, NA, NULL); addot(OT_TRAPROCK, "falling rock trap", "A pressure plate which causes heavy rocks to drop from the ceiling.", MT_NOTHING, 0, OC_TRAP, SZ_SMALL); @@ -1255,7 +1257,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOFEEL, B_TRUE, NA, NA, NULL); addot(OT_TRAPTRIP, "tripwire", "A thin wire at ankle height.", MT_WIRE, 0.1, OC_TRAP, SZ_SMALL); - addflag(lastot->flags, F_TRAP, 10, B_FALSE, 20, NULL); + addflag(lastot->flags, F_TRAP, 15, B_FALSE, 20, NULL); addflag(lastot->flags, F_RARITY, H_DUNGEON, 90, NA, NULL); addflag(lastot->flags, F_GLYPH, C_GREY, NA, NA, "^"); addflag(lastot->flags, F_NOPICKUP, B_TRUE, NA, NA, NULL); @@ -2941,6 +2943,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOANNOUNCE, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_AICASTTOATTACK, ST_SELF, 10, NA, NULL); addot(OT_A_QUIVERINGPALM, "quivering palm", "A deadly palm strike which knocks the molecules in the target's body out of alignment.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); + addflag(lastot->flags, F_STAMCOST, 10, NA, NA, NULL); addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); addot(OT_A_PRAY, "pray", "Ask for help from a higher being.", MT_NOTHING, 0, OC_ABILITY, SZ_TINY); addflag(lastot->flags, F_SPELLSCHOOL, SS_ABILITY, NA, NA, NULL); @@ -3957,7 +3960,7 @@ void initobjects(void) { 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_WALKDAM, DT_FIRE, NA, NA, "1d2"); + addflag(lastot->flags, F_WALKDAM, DT_HEAT, NA, NA, "1d2"); addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); addot(OT_STEAMPUFF, "puff of steam", "A small puff of scalding steam.", MT_GAS, 0, OC_EFFECT, SZ_MEDIUM); @@ -3968,7 +3971,7 @@ void initobjects(void) { 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, 1, NA, NA, NULL); - addflag(lastot->flags, F_WALKDAM, DT_FIRE, NA, NA, "1d1+1"); + addflag(lastot->flags, F_WALKDAM, DT_HEAT, NA, NA, "1d1+1"); addflag(lastot->flags, F_THEREISHERE, B_TRUE, NA, NA, "!"); @@ -5877,7 +5880,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_STR, AT_LOW, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); - addflag(lastrace->flags, F_SIZE, SZ_SMALL, NA, NA, NULL); + addflag(lastrace->flags, F_SIZE, SZ_MEDIUM, NA, NA, NULL); addflag(lastrace->flags, F_HITDICE, NA, NA, NA, "1d4+3"); addflag(lastrace->flags, F_EVASION, 20, NA, NA, NULL); addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); @@ -6346,7 +6349,7 @@ void initrace(void) { addflag(lastrace->flags, F_EVASION, 5, NA, NA, NULL); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); - addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3-1"); + addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); 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_AGI, AT_HIGH, NA, NULL); @@ -6809,7 +6812,7 @@ void initrace(void) { addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); - addflag(lastrace->flags, F_CANCAST, OT_S_FIREDART, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_FIREDART, NA, NA, "pw:1;"); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gestures"); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); addflag(lastrace->flags, F_PRODUCESLIGHT, 2, NA, NA, NULL); @@ -6834,9 +6837,9 @@ void initrace(void) { addflag(lastrace->flags, F_FLYING, B_TRUE, NA, NA, ""); addflag(lastrace->flags, F_MOVESPEED, SP_NORMAL, NA, NA, NULL); addflag(lastrace->flags, F_ACTIONSPEED, SP_NORMAL, NA, NA, ""); - addflag(lastrace->flags, F_CANCAST, OT_S_FROSTBITE, NA, NA, NULL); - addflag(lastrace->flags, F_CANCAST, OT_S_FREEZEOB, NA, NA, NULL); - addflag(lastrace->flags, F_CANCAST, OT_S_ICICLE, NA, NA, NULL); + addflag(lastrace->flags, F_CANWILL, OT_S_FROSTBITE, NA, NA, "pw:1;"); + addflag(lastrace->flags, F_CANWILL, OT_S_FREEZEOB, NA, NA, "pw:1;"); + addflag(lastrace->flags, F_CANWILL, OT_S_ICICLE, NA, NA, "pw:1;"); addflag(lastrace->flags, F_SPELLCASTTEXT, NA, NA, B_APPENDYOU, "gestures"); addflag(lastrace->flags, F_HASATTACK, OT_CLAWS, NA, NA, "1d3"); addflag(lastrace->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); @@ -6946,6 +6949,7 @@ void initrace(void) { addrace(R_PIRANHA, "piranha", 0.5, ';', C_GREEN, MT_FLESH, RC_AQUATIC); addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); @@ -6966,6 +6970,7 @@ void initrace(void) { addflag(lastrace->flags, F_MORALE, 2, NA, NA, NULL); addrace(R_PIRANHAKING, "king piranha", 1, ';', C_GREEN, MT_FLESH, RC_AQUATIC); addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_SIZE, SZ_TINY, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_UNCOMMON, NULL); @@ -6987,6 +6992,7 @@ void initrace(void) { addflag(lastrace->flags, F_MORALE, 5, NA, NA, NULL); addrace(R_EELELEC, "electric eel", 120, ';', C_CYAN, MT_FLESH, RC_AQUATIC); addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); @@ -7007,6 +7013,7 @@ void initrace(void) { addflag(lastrace->flags, F_MORALE, 3, NA, NA, NULL); addrace(R_EELGIANT, "giant eel", 150, ';', C_BLUE, MT_FLESH, RC_AQUATIC); addflag(lastrace->flags, F_NEEDSWATER, B_TRUE, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); addflag(lastrace->flags, F_SIZE, SZ_HUMAN, NA, NA, NULL); @@ -8019,6 +8026,7 @@ void initrace(void) { addflag(lastrace->flags, F_DTVULN, DT_POISONGAS, NA, NA, NULL); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 0, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_TIMID, B_TRUE, NA, NA, NULL); addrace(R_GIANTFLY, "giant fly", 1, 'i', C_GREY, MT_FLESH, RC_INSECT); lastrace->baseid = R_GIANTFLY; @@ -8047,6 +8055,7 @@ void initrace(void) { addflag(lastrace->flags, F_WANTS, OT_CORPSE, B_COVETS, NA, NULL); addflag(lastrace->flags, F_ATTACKRANGE, 1, 2, NA, NULL); // just buzz around addflag(lastrace->flags, F_MORALE, 0, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, 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); @@ -8075,6 +8084,7 @@ void initrace(void) { addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_ATTACKRANGE, 1, 2, NA, NULL); // just buzz around addflag(lastrace->flags, F_MORALE, 0, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, 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); addflag(lastrace->flags, F_HOSTILE, B_TRUE, NA, NA, NULL); @@ -8102,6 +8112,7 @@ void initrace(void) { 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_MORALE, 10, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); addrace(R_CENTIPEDE, "giant centipede", 3, 'w', C_GREEN, MT_FLESH, RC_INSECT); addflag(lastrace->flags, F_RARITY, H_DUNGEON, NA, RR_COMMON, NULL); @@ -8151,6 +8162,7 @@ void initrace(void) { addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_NOCTURNAL, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 0, NA, NA, NULL); + addflag(lastrace->flags, F_AWARENESS, B_TRUE, NA, NA, NULL); // demons addrace(R_DRETCH, "dretch", 30, '&', C_BROWN, MT_FLESH, RC_DEMON); @@ -8276,7 +8288,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTOB, 25, NA, NA, "buckler"); addflag(lastrace->flags, F_DTVULN, DT_BASH, NA, NA, NULL); addflag(lastrace->flags, F_DTRESIST, DT_SLASH, NA, NA, NULL); - addflag(lastrace->flags, F_DTIMMUNE, DT_PIERCE, NA, NA, NULL); + addflag(lastrace->flags, F_DTRESIST, DT_PIERCE, NA, NA, NULL); addflag(lastrace->flags, F_HUMANOID, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_DEAF, B_TRUE, NA, NA, NULL); addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); diff --git a/data/hiscores.db b/data/hiscores.db index f042e0fdbc865f2066557474ac1992c7d34ac971..b7de0b40f752f359017b55d12173be55cb5849de 100644 GIT binary patch delta 478 zcmZp$XmFSy&DgwA<^{6=3-cQWAmCvB&HRn|BlDZhA}lwUS%D(#fs;S73p0l^`A%l% zm?_3o&s4=!%2dFV&6LKJ$P~jA&J@JtyRmROqd5yR17kRd2m=wJAR+`r1cQhm5D^F> z0zia6i0}guzMEUP8hF(N8Dbfj&oNJBj$u|~de5{SXpbM0IO7AxwT$JA4vgFkml$R+ z#7-Y$L|YW$q6a zvSrtstRSTv*q9zMFrQ_f#hlM<$1KA1Xk+0y zCN6_;kinYP3|}U{6O|RoOiooOE-1<@N!8N`1DUC*>pVG5RC=;LKO3ihC|Jar1tcP# zn5U3hQIL~goSC1erx^k^Mwjs{NRB^IA-^bD&oCJ5Dq{hVcP203Vdpdqf`|x$MA(Z< JGKflags, F_RESTUNTILHP, B_TRUE, NA, NA, NULL); + addflag(lf->flags, F_RESTUNTILBETTER, B_TRUE, NA, NA, NULL); startresting(lf, B_FALSE); } else { msg("%s is too nervous to rest (perhaps there are monsters nearby).", lfname); @@ -4800,6 +4800,7 @@ char *makedesc_ob(object_t *o, char *retbuf) { } else { int first = B_TRUE; for (i = 0; i < MAXDAMTYPE; i++) { + if (basedamagetype(i) != i) continue; f = isimmuneto(o->flags, i); if (f) { char buf2[BUFLEN]; @@ -4826,6 +4827,7 @@ char *makedesc_ob(object_t *o, char *retbuf) { } else { int first = B_TRUE; for (i = 0; i < MAXDAMTYPE; i++) { + if (basedamagetype(i) != i) continue; f = isresistantto(o->flags, i); if (f) { char buf2[BUFLEN]; @@ -4852,6 +4854,7 @@ char *makedesc_ob(object_t *o, char *retbuf) { } else { int first = B_TRUE; for (i = 0; i < MAXDAMTYPE; i++) { + if (basedamagetype(i) != i) continue; f = isvulnto(o->flags, i); if (f) { char buf2[BUFLEN]; @@ -6234,7 +6237,9 @@ void dorest(void) { if (check_rest_ok(player)) return; if (needstorest(player, validchars)) { + /* if (strchr(validchars, 'h') && strchr(validchars, 'm')) { + strcat(validchars, "bn"); strcpy(ques, "Rest until full Health, Mana, Both, or none"); ch = askchar(ques, validchars, "b", B_TRUE); @@ -6259,6 +6264,12 @@ void dorest(void) { addflag(player->flags, F_RESTUNTILMP, B_TRUE, NA, NA, NULL); } } + */ + strcpy(ques, "Rest"); + ch = askchar(ques, "yn", "y", B_TRUE); + if (ch == 'y') { + addflag(player->flags, F_RESTUNTILBETTER, B_TRUE, NA, NA, NULL); + } } else { if (countnearbyhurtallies(player)) { strcpy(ques, "Rest until nearby allies are healed?"); @@ -6272,9 +6283,7 @@ void dorest(void) { } } - if (!lfhasflag(player, F_RESTUNTILHP) && - !lfhasflag(player, F_RESTUNTILMP) && - !lfhasflag(player, F_RESTUNTILALLIES)) { + if (!lfhasflag(player, F_RESTUNTILBETTER) && !lfhasflag(player, F_RESTUNTILALLIES)) { msg("Cancelled."); return; } @@ -6686,8 +6695,8 @@ void initgfx(void) { noecho(); - cbreak(); - //raw(); + //cbreak(); + raw(); nodelay(mainwin, FALSE); getmaxyx(mainwin, SCREENH, SCREENW); @@ -7267,6 +7276,12 @@ int getkey(void) { } } + if (key_code == CH_BREAK) { // ctrl-c + cbreak(); + raise(SIGINT); + raw(); + } + return keycodetokey(key_code); } @@ -8190,18 +8205,18 @@ void drawstatus(void) { // find highest amount of poison if (getskill(player, SK_FIRSTAID) >= PR_ADEPT) { if (poisonthreatenslife(player, f)) { - setcol(statwin, C_GREEN); + setcol(statwin, C_RED); wprintw(statwin, " %s(bad)", getpoisondesc(f->val[0])); - unsetcol(statwin, C_GREEN); + unsetcol(statwin, C_RED); } else { setcol(statwin, C_BROWN); wprintw(statwin, " %s(mild)", getpoisondesc(f->val[0])); unsetcol(statwin, C_BROWN); } } else { - setcol(statwin, C_GREEN); + setcol(statwin, C_RED); wprintw(statwin, " %s", getpoisondesc(f->val[0])); - unsetcol(statwin, C_GREEN); + unsetcol(statwin, C_RED); } } @@ -8783,11 +8798,9 @@ void showlfstats(lifeform_t *lf, int showall) { } break; case A_AGI: - if (accmod > 0) { - snprintf(buf2, BUFLEN, ", +%d%% acc",accmod ); - strcat(buf, buf2); - } else if (accmod < 0) { - snprintf(buf2, BUFLEN, ", %d%% acc",accmod ); + if (accmod != 0) { + snprintf(buf2, BUFLEN, ", %c%d acc",(accmod >= 0) ? '+' : '-', + abs(accmod)/5 ); strcat(buf, buf2); } break; @@ -8852,85 +8865,80 @@ void showlfstats(lifeform_t *lf, int showall) { } } + if (!nweps) { + // get first innate attack weapon. + op = addobpile(NULL, NULL, NULL); + f = hasflag(lf->flags, F_HASATTACK); + w[0] = addobfast(op, f->val[0]); + if (w[0]) { + nweps = 1; + } + } - if (nweps == 0) { - int speed,accmod; - // no weapon - snprintf(buf, BUFLEN, "(innate attack)"); - doheadingsmall(mainwin, y2, x2, ftext, "Weapon"); - wprintw(mainwin, "%-20s", buf); y2++; - - // attack speed & accuracy - acc = getlfaccuracy(lf, NULL); - accmod = getaccuracynum(acc); - speed = getattackspeed(lf); - getspeedname(speed, buf2); - capitalise(buf2); - snprintf(buf, BUFLEN, "Spd:%s Acc:%c%d",buf2,(accmod < 0) ? '-' : '+', abs(accmod)); - mvwprintw(mainwin, y2, x2, "%14s", " "); - wprintw(mainwin, "%-20s", buf); y2++; - } else { - for (i = 0; i < nweps; i++) { - if (w[i]) { - int mindam,maxdam; - int bonus,speed; - int accnum; - - // weapon - if (showall) { - char buf2[BUFLEN]; - // calculate damage - f = hasflag(w[i]->flags, F_BONUS); - if (f && f->known) { - // only tell player about bonuses if they are known.! - bonus = f->val[0]; - } else { - bonus = 0; - } - - f = hasflag(w[i]->flags, F_DAM); - if (f) { - getdamrange(f, &mindam, &maxdam); - } else { - mindam = 0; - maxdam = 0; - } - - mindam += bonus; - maxdam += bonus; - - // apply damage mod for strength - if (!hasflag(w[i]->flags, F_NOSTRDAMMOD) && !lfhasflag(lf, F_NOSTRDAMMOD)) { - mindam = (int)((float)mindam * dammod); - maxdam = (int)((float)maxdam * dammod); - } - - if (mindam < 0) mindam = 0; - if (maxdam < 0) maxdam = 0; - - - snprintf(buf, BUFLEN, "%s (%d-%d dmg)", w[i]->type->name,(int)mindam,(int)maxdam); - doheadingsmall(mainwin, y2, x2, ftext, "Weapon"); - wprintw(mainwin, "%-20s", buf); y2++; - - // attack speed & accuracy - acc = getlfaccuracy(lf, w[i]); - accnum = getaccuracynum(acc); - speed = getattackspeed(lf); - getspeedname(speed, buf2); - capitalise(buf2); - snprintf(buf, BUFLEN, "Spd:%s Acc:%c%d",buf2,(accnum < 0) ? '-' : '+', abs(accnum)); - mvwprintw(mainwin, y2, x2, "%14s", " "); - wprintw(mainwin, "%-20s", buf); y2++; + for (i = 0; i < nweps; i++) { + if (w[i]) { + int mindam,maxdam; + int bonus,speed; + int accnum; + // weapon + if (showall) { + char buf2[BUFLEN]; + // calculate damage + f = hasflag(w[i]->flags, F_BONUS); + if (f && f->known) { + // only tell player about bonuses if they are known.! + bonus = f->val[0]; } else { - // just show weapon name - snprintf(buf, BUFLEN, "%s", w[i]->type->name); - doheadingsmall(mainwin, y2, x2, ftext, "Weapon"); - wprintw(mainwin, "%-20s", buf); y2++; + bonus = 0; } + + f = hasflag(w[i]->flags, F_DAM); + if (f) { + getdamrange(f, &mindam, &maxdam); + } else { + mindam = 0; + maxdam = 0; + } + + mindam += bonus; + maxdam += bonus; + + // apply damage mod for strength + if (!hasflag(w[i]->flags, F_NOSTRDAMMOD) && !lfhasflag(lf, F_NOSTRDAMMOD)) { + mindam = (int)((float)mindam * dammod); + maxdam = (int)((float)maxdam * dammod); + } + + if (mindam < 0) mindam = 0; + if (maxdam < 0) maxdam = 0; + + + snprintf(buf, BUFLEN, "%s (%d-%d dmg)", w[i]->type->name,(int)mindam,(int)maxdam); + doheadingsmall(mainwin, y2, x2, ftext, "Weapon"); + wprintw(mainwin, "%-20s", buf); y2++; + + // attack speed & accuracy + acc = getlfaccuracy(lf, w[i]); + accnum = getaccuracynum(acc); + speed = getattackspeed(lf); + getspeedname(speed, buf2); + capitalise(buf2); + snprintf(buf, BUFLEN, "Spd:%s Acc:%c%d",buf2,(accnum < 0) ? '-' : '+', abs(accnum)); + mvwprintw(mainwin, y2, x2, "%14s", " "); + wprintw(mainwin, "%-20s", buf); y2++; + + } else { + // just show weapon name + snprintf(buf, BUFLEN, "%s", w[i]->type->name); + doheadingsmall(mainwin, y2, x2, ftext, "Weapon"); + wprintw(mainwin, "%-20s", buf); y2++; } - } // end for each weapon + } + } // end for each weapon + + if (op) { + killobpile(op); } // skip a line @@ -9839,6 +9847,7 @@ void showlfstats(lifeform_t *lf, int showall) { } else { first = B_TRUE; for (i = 0; i < MAXDAMTYPE; i++) { + if (basedamagetype(i) != i) continue; f = isresistantto(lf->flags, i); if (f) { if (first) { @@ -9872,6 +9881,7 @@ void showlfstats(lifeform_t *lf, int showall) { } else { first = B_TRUE; for (i = 0; i < MAXDAMTYPE; i++) { + if (basedamagetype(i) != i) continue; f = isimmuneto(lf->flags, i); if (f) { if (first) { @@ -9897,6 +9907,7 @@ void showlfstats(lifeform_t *lf, int showall) { } else { first = B_TRUE; for (i = 0; i < MAXDAMTYPE; i++) { + if (basedamagetype(i) != i) continue; f = isvulnto(lf->flags, i); if (f) { if (first) { diff --git a/lf.c b/lf.c index 558e9ec..8d773d1 100644 --- a/lf.c +++ b/lf.c @@ -5495,8 +5495,14 @@ int getmiscastchance(lifeform_t *lf) { int chance = 0; getflags(lf->flags, retflag, &nretflags, F_ARMOURPENALTY, F_SHIELDPENALTY, F_NONE); for (i = 0; i < nretflags; i++) { - if (retflag[i]->val[0] != NA) chance += retflag[i]->val[0]; - if (retflag[i]->val[1] != NA) chance += retflag[i]->val[1]; + int (*adjustfunc)(lifeform_t *, float) = NULL; + if (retflag[i]->id == F_ARMOURPENALTY) { + adjustfunc = adjustarmourpenalty; + } else { + adjustfunc = adjustshieldpenalty; + } + if (retflag[i]->val[0] != NA) chance += adjustfunc(lf, retflag[i]->val[0]); + if (retflag[i]->val[1] != NA) chance += adjustfunc(lf, retflag[i]->val[1]); } return chance; } @@ -5798,11 +5804,10 @@ float getmaxpushweight(lifeform_t *lf) { float getmaxstamina(lifeform_t *lf) { int stam = 0; + stam = (getattr(lf, A_CON) / 3) * (getskill(lf, SK_ATHLETICS) + 1); if (lfhasflagval(lf, F_INJURY, IJ_LUNGCOLLAPSED, NA, NA, NULL)) { - return 0; + limit(&stam, NA, 2); } - stam = (getattr(lf, A_CON) / 3); - stam += (getskill(lf, SK_ATHLETICS)*2); return stam; } @@ -6261,7 +6266,7 @@ int getpoisondamchance(enum POISONTYPE ptype) { case P_GAS: case P_VENOM: case P_COLD: - chance = 33; + chance = 25; break; default: chance = 0; @@ -8848,6 +8853,18 @@ int isfriendly(lifeform_t *lf) { return B_FALSE; } +int isfullyhealed(lifeform_t *lf) { + int healed = B_TRUE; + if ((lf->hp < lf->maxhp) || hastempinjuries(lf)) { + healed = B_FALSE; + } else if (lf->mp < getmaxmp(lf)) { + healed = B_FALSE; + } else if (getstamina(lf) < getmaxstamina(lf)) { + healed = B_FALSE; + } + return healed; +} + int isgenius(lifeform_t *lf) { enum ATTRBRACKET iqb; iqb = getattrbracket(getattr(lf, A_IQ), A_IQ, NULL); @@ -8862,6 +8879,7 @@ int isgenius(lifeform_t *lf) { flag_t *isimmuneto(flagpile_t *fp, enum DAMTYPE dt) { flag_t *f; + dt = basedamagetype(dt); f = hasflagval(fp, F_DTIMMUNE, dt, NA, NA, NULL); if (f) return f; f = hasflagval(fp, F_DTIMMUNE, DT_ALL, NA, NA, NULL); @@ -9036,6 +9054,7 @@ int isprone(lifeform_t *lf) { flag_t *isresistantto(flagpile_t *fp, enum DAMTYPE dt) { flag_t *f; + dt = basedamagetype(dt); f = hasflagval(fp, F_DTRESIST, dt, NA, NA, NULL); if (f) return f; f = hasflagval(fp, F_DTRESIST, DT_ALL, NA, NA, NULL); @@ -9919,6 +9938,8 @@ int isundead(lifeform_t *lf) { flag_t *isvulnto(flagpile_t *fp, enum DAMTYPE dt) { flag_t *f; + dt = basedamagetype(dt); + f = hasflagval(fp, F_DTVULN, dt, NA, NA, NULL); if (f) return f; f = hasflagval(fp, F_DTVULN, DT_ALL, NA, NA, NULL); @@ -10554,7 +10575,7 @@ void makenoise(lifeform_t *lf, enum NOISETYPE nid) { getflags(lf->flags, retflag, &nretflags, F_NOISETEXT, F_NONE); for (i = 0; i < nretflags; i++) { - if (retflag[i]->id == nid) { + if (retflag[i]->val[0] == nid) { nflag[nnflags++] = retflag[i]; } } @@ -10946,7 +10967,11 @@ void modstamina(lifeform_t *lf, float howmuch) { statdirty = B_TRUE; drawstatus(); updatestatus(); - if (getstamina(lf) == 0) msg("You are exhausted."); + if (getstamina(lf) == 0) { + msg("^BYou are exhausted."); + } else if (orig == 0) { + msg("You feel less exhausted now."); + } } else if (cansee(player, lf)) { if (getstamina(lf) == 0) { char lfname[BUFLEN]; @@ -10978,6 +11003,10 @@ int needstorest(lifeform_t *lf, char *validchars) { if (validchars) strcat(validchars, "m"); need = B_TRUE; } + if (getstamina(lf) < getmaxstamina(lf)) { + if (validchars) strcat(validchars, "s"); + need = B_TRUE; + } return need; } @@ -12000,8 +12029,20 @@ int safetorest(lifeform_t *lf) { reason = E_OK; for (l = lf->cell->map->lf ; l ; l = l->next) { - if ((l != lf) && cansee(lf, l) && areenemies(lf, l) ) { - if (!lfhasflag(l, F_HARMLESS)) { + if ((l != lf) && areenemies(lf, l) && !lfhasflag(l, F_HARMLESS)) { + int monsternearby = B_FALSE; + + if (isplayer(lf)) { + if (cansee(lf, l)) { + monsternearby = B_TRUE; + } + } else { + if (haslof(lf->cell, l->cell, LOF_WALLSTOP, NULL)) { + monsternearby = B_TRUE; + } + } + + if (monsternearby) { reason = E_MONSTERNEARBY; return B_FALSE; } @@ -13581,7 +13622,7 @@ void startlfturn(lifeform_t *lf) { taketime(lf, getactspeed(lf)); } - snprintf(buf, BUFLEN, "poisoning^from %s",f->text); + snprintf(buf, BUFLEN, "%s^from %s",getpoisonname(f->val[0]), f->text); losehp(lf, f->val[1], DT_DIRECT, NULL, buf); if (!asleep) { @@ -14041,6 +14082,8 @@ void stopresting(lifeform_t *lf) { killflag(f); statdirty = B_TRUE; } + killflagsofid(lf->flags, F_RESTUNTILALLIES); + killflagsofid(lf->flags, F_RESTUNTILBETTER); } void stoprunning(lifeform_t *lf) { @@ -15265,13 +15308,8 @@ int rest(lifeform_t *lf, int onpurpose) { wantclearmsg = B_FALSE; // resting - if ((lf->hp >= lf->maxhp) && !hastempinjuries(lf)) { - hf = lfhasflag(lf, F_RESTUNTILHP); - if (hf) killflag(hf); - } - if (lf->mp >= getmaxmp(lf)) { - hf = lfhasflag(lf, F_RESTUNTILMP); - if (hf) killflag(hf); + if (isfullyhealed(lf)) { + killflagsofid(lf->flags, F_RESTUNTILBETTER); } hf = lfhasflag(lf, F_RESTUNTILALLIES); @@ -15283,7 +15321,7 @@ int rest(lifeform_t *lf, int onpurpose) { for (l = lf->cell->map->lf ; l ; l = l->next) { if ((l != lf) && areallies(l, lf)) { - if (l->hp < l->maxhp) { + if (!isfullyhealed(l)) { moretogo = B_TRUE; break; } @@ -15294,9 +15332,7 @@ int rest(lifeform_t *lf, int onpurpose) { } } - if (!lfhasflag(lf, F_RESTUNTILHP) && - !lfhasflag(lf, F_RESTUNTILMP) && - !lfhasflag(lf, F_RESTUNTILALLIES)) { + if (!lfhasflag(lf, F_RESTUNTILBETTER) && !lfhasflag(lf, F_RESTUNTILALLIES)) { if (isplayer(lf)) { if (fullpartyrest) { msg("Your party has finished resting."); diff --git a/lf.h b/lf.h index 75898e7..57c9770 100644 --- a/lf.h +++ b/lf.h @@ -261,6 +261,7 @@ object_t *isdualweilding(lifeform_t *lf); int isfleeing(lifeform_t *lf); int isfreebp(lifeform_t *lf, enum BODYPART bp); int isfriendly(lifeform_t *lf); +int isfullyhealed(lifeform_t *lf); int isgenius(lifeform_t *lf); int isgod(lifeform_t *lf); int ishirable(lifeform_t *lf); diff --git a/map.c b/map.c index d5b12ef..4debc10 100644 --- a/map.c +++ b/map.c @@ -1784,12 +1784,6 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ int dir; int lastdir; int numrooms = 0; - int roomw[MAXROOMS],roomh[MAXROOMS]; - vault_t *roomvault[MAXROOMS]; - //int roomspecial[MAX_MAPROOMS]; - //int bestx,besty; - //int w,h; - //int startdir,forcex,forcey,ntries; cell_t *cell, *c; object_t *o; int db = B_FALSE; @@ -1982,23 +1976,18 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ //dblog("Adding %d rooms...\n",numrooms); for (i = 0; i < numrooms; i++) { // maybe make it a special room - roomvault[i] = NULL; + //roomvault[i] = NULL; if (rnd(1,100) <= map->habitat->randvaultpct) { vault_t *v; v = getvaulttype(map); - if (createvault(map, i, v, &roomw[i],&roomh[i], NULL, NULL)) { - // failed - } else { + if (!createvault(map, i, v, NULL, NULL, NULL, NULL)) { // success - roomvault[i] = v; + continue; } } - if (!roomvault[i]) { - int rx,ry; - // just do a normal room - createroom(map, i, NA, NA, DEF_VAULTMARGIN, DEF_VAULTMARGIN, &rx, &ry, &roomw[i],&roomh[i], 50, B_FALSE); - roomvault[i] = B_FALSE; - } + // just do a normal room + createroom(map, i, NA, NA, DEF_VAULTMARGIN, DEF_VAULTMARGIN, NULL, NULL, NULL, NULL, 50, B_FALSE); + //roomvault[i] = B_FALSE; } } @@ -2072,13 +2061,17 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ // add pillars & objects & monsters to rooms if (wantrooms && (numrooms > 0)) { - for (i = 0; i < numrooms; i++) { - if (!roomvault[i] || hasflag(roomvault[i]->flags, F_AUTOPOPULATE)) { + for (i = 0; i < map->nrooms; i++) { + if (!map->room[i].vault || hasflag(map->room[i].vault->flags, F_AUTOPOPULATE)) { int numobsmin,numobsmax,numobs,n; int maxpillars; + int rw,rh; + + rw = map->room[i].x2 - map->room[i].x1; + rh = map->room[i].y2 - map->room[i].y1; //dblog("Adding obs to room %d/%d",i+1,numrooms); - maxpillars = (roomw[i] / 4) + (roomh[i] / 4); + maxpillars = (rw / 4) + (rh / 4); // add pillars first if ((maxpillars > 0) && pctchance(PCTCH_PILLAR)) { int n; @@ -2097,7 +2090,7 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ } numobsmin = 0; - numobsmax = MAXOF(roomw[i],roomh[i]) / 2; + numobsmax = MAXOF(rw,rh) / 2; //numobsmax = MAXOF(roomw[i],roomh[i]); // then objects/monsters @@ -2147,6 +2140,13 @@ void createdungeon(map_t *map, int depth, map_t *parentmap, int exitdir, object_ } // end if wantrooms & nrooms>0 if (db) dblog("Finished adding stuff to rooms."); + + // river? + if ((depth >= 4) && pctchance(20)) { + createriver(map); + } + + // now do a border y = 0; for (x = 0; x < map->w; x++) { @@ -3472,6 +3472,68 @@ void createregionlink(map_t *m, cell_t *c, object_t *o, char *obname, enum REGIO f->val[1] = r->id; } +void createriver(map_t *m) { + int dir,width,startcentre,endcentre; + cell_t *retcell[MAXRETCELLS]; + cell_t *dirtcell[MAXRETCELLS]; + int nretcell,ndirtcells,i; + // pick direction + dir = rnd(B_VERT,B_HORZ); + // pick random river width + width = rnd(0,2); + // pick random spot along top && bottom ( x >= width and x <= w-width-1) + // then bresnham between spots to make centrelist + if (dir == B_VERT) { + startcentre = rnd(1,m->w - width - 1); + endcentre = rnd(1,m->w - width - 1); + calcbresnham(m, startcentre, 0, endcentre, m->h - 1, retcell, &nretcell); + } else { + startcentre = rnd(1,m->h - width - 1); + endcentre = rnd(1,m->h - width - 1); + calcbresnham(m, 0, startcentre, m->w - 1, endcentre, retcell, &nretcell); + } + + // for each centrelist + for (i = 0; i < nretcell; i++) { + int pos,start,end,n; + // make a second list of rivercells (rivercell->x - wid) to (rivercell->x + wid) + if (dir == B_VERT) { + start = retcell[i]->x; + end = retcell[i]->x + width; + } else { + start = retcell[i]->y; + end = retcell[i]->y + width; + } + limit(&start, 0, m->w-1); + limit(&end, 0, m->w-1); + // foreach cell across the river's width + for (pos = start; pos <= end; pos++) { + cell_t *c; + object_t *o; + if (dir == B_VERT) { + c = getcellat(m, pos, retcell[i]->y); + } else { + c = getcellat(m, retcell[i]->x, pos); + } + // move any staircases here to somewhere else + while ((o = hasobwithflag(c->obpile, F_CLIMBABLE)) != NULL) { + moveobtoclearcell(o); + } + // clear cell, convert to low rock floor, add water + clearcell(c); + setcelltype(c, CT_LOWFLOOR); + addobfast(c->obpile, OT_WATERDEEP); + // suround with dirt + getradiuscells(c, 7, DT_ORTH, B_FALSE, LOF_NEED, B_FALSE, dirtcell, &ndirtcells, 70); + for (n = 0; n < ndirtcells; n++) { + if (!dirtcell[n]->type->solid && (dirtcell[n]->type->id != CT_LOWFLOOR)) { + setcelltype(dirtcell[n], CT_DIRT); + } + } + } + } +} + // room w/h are returned in *w and *h if given. int createroom(map_t *map, int roomid, int overrideminw, int overrideminh, int xmargin, int ymargin, int *retx, int *rety, int *retw, int *reth, int doorpct, int forcewalls) { int x,y; @@ -4225,7 +4287,7 @@ char *getregionname(char *buf, map_t *m, int withlevel) { strcpy(buf, "the surface"); break; case RG_FIRSTDUNGEON: - strcpy(buf, "a dungeon"); + strcpy(buf, "the dungeon"); break; case RG_HEAVEN: snprintf(buf, BUFLEN, "the realm of gods"); @@ -5173,6 +5235,21 @@ void mapentereffects(map_t *m) { } } +void moveobtoclearcell(object_t *o) { + cell_t *c,*startcell; + startcell = getoblocation(o); + + c = startcell; + while ((c == startcell) || + !cellwalkable(NULL, c, NULL) || + hasobwithflag(c->obpile, F_CLIMBABLE) || + hasobwithflag(c->obpile, F_DEEPWATER) ) { + c = getrandomcell(startcell->map); + } + + moveob(o, c->obpile, ALL); +} + enum RACE parserace(char *name, flagpile_t *wantflags, enum JOB *wantjob) { int donesomething; char *p; diff --git a/map.h b/map.h index 87985c0..1f4ca4d 100644 --- a/map.h +++ b/map.h @@ -54,6 +54,7 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex void createpit(map_t *map, int depth, map_t *parentmap, int exitdir, object_t *entryob); void createregionlink(map_t *m, cell_t *c, object_t *o, char *obname, enum REGIONTYPE newregiontype, region_t *parent); void createregionthing(map_t *map, regionthing_t *rt); +void createriver(map_t *m); int createroom(map_t *map, int roomid, int overrideminw, int overrideminh, int xmargin, int ymargin, int *retx, int *rety, int *retw, int *reth, int doorpct, int forcewalls); int createvault(map_t *map, int roomid, vault_t *v, int *retw, int *reth, int *retx, int *rety); int dirtox(int dt, int dir); @@ -125,6 +126,7 @@ void makedoor(cell_t *cell, int openchance); void makelit(cell_t *c, enum LIGHTLEV how, int howlong); void makelitradius(cell_t *c, int radius, enum LIGHTLEV how, int howlong); void mapentereffects(map_t *m); +void moveobtoclearcell(object_t *o); enum RACE parserace(char *name, flagpile_t *wantflags, enum JOB *wantjob); int remove_deadends(map_t *m, int howmuch); void set_scanned_glyph(int targettype, void *what, char *descappend, char *desc, glyph_t *glyph); diff --git a/nexus.c b/nexus.c index 0b4013b..93a615c 100644 --- a/nexus.c +++ b/nexus.c @@ -367,7 +367,7 @@ int main(int argc, char **argv) { } getplayernamefull(pname); - snprintf(welcomemsg, BUFLEN, "Greetings %s, welcome to %snexus!", pname, newworld ? "the new " : ""); + snprintf(welcomemsg, BUFLEN, "Greetings %s, welcome to nexus!", pname); // 00:00 - 23:59 curtime = rnd(0,DAYSECS-1); @@ -728,7 +728,7 @@ void donextturn(map_t *map) { // check for interrupt of resting... if (isplayer(who) && checkforkey()) { msg("Stopped %s.",(f->id == F_TRAINING) ? "training" : "resting"); - killflag(f); + stopresting(who); } else { if (isplayer(who)) { if (++who->turnsskipped >= 10) { diff --git a/objects.c b/objects.c index 1a7e521..ab7bc78 100644 --- a/objects.c +++ b/objects.c @@ -865,9 +865,11 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int wantlinkholes } // water ob onto dirt -> mud - if ((ot->material->id == MT_WATER) && where->where) { - if (where->where->type->id == CT_DIRT) { - ot = findot(OT_MUDPOOL); + if (where->where) { + if ((ot->material->id == MT_WATER) || (ot->id == OT_SPLASHWATER)) { + if (where->where->type->id == CT_DIRT) { + ot = findot(OT_MUDPOOL); + } } } @@ -3102,11 +3104,6 @@ int getobaccuracy(object_t *wep, lifeform_t *weilder) { break; } } - - // modify for attacker's level - if (wep->pile->owner) { - acc += (wep->pile->owner->level * 2); - } } return acc; } @@ -3523,6 +3520,7 @@ char *getdamname(enum DAMTYPE damtype) { case DT_EXPLOSIVE: return "explosive"; case DT_FALL: return "falling"; case DT_FIRE: return "fire"; + case DT_HEAT: return "heat"; case DT_HOLY: return "holy damage"; case DT_LIGHT: return "light"; case DT_MAGIC: return "magical"; @@ -3556,6 +3554,7 @@ char *getdamnamenoun(enum DAMTYPE damtype) { case DT_ELECTRIC: return "electricity"; case DT_EXPLOSIVE: return "explosives"; case DT_FIRE: return "fire"; + case DT_HEAT: return "heat"; case DT_BITE: return "bite"; case DT_BASH: return "bludgeoning"; case DT_CHOP: return "chopping"; @@ -9205,7 +9204,7 @@ int readsomething(lifeform_t *lf, object_t *o) { // learn it addflag(lf->flags, F_CANCAST, linkspell->id, NA, NA, NULL); } else { - msg("You fail to learn %s.",linkspell->name); + msg("^bYou fail to learn %s.",linkspell->name); } } else { msg("You are not yet skilled in %s.",getschoolnameshort(school)); diff --git a/spell.c b/spell.c index 50b3393..6368c59 100644 --- a/spell.c +++ b/spell.c @@ -1409,15 +1409,15 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef } - // go there! - movelf(user, targcell); - // announce if (isplayer(user)) { msg("You tumble across the ground!"); } else if (cansee(player, user)) { msg("%s tumbles across the ground!", username); } + // go there! + movelf(user, targcell); + // pits/water? if (stopob) { char obname[BUFLEN]; @@ -4605,7 +4605,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ } } else { // next thing touched - addflag(caster->flags, F_FREEZINGTOUCH, 1, NA, 10+power, NULL); + addflag(caster->flags, F_FREEZINGTOUCH, 1, power, 10+power, NULL); if (isplayer(caster)) { msg("Your hands begin to glow blue!"); if (seenbyplayer) *seenbyplayer = B_TRUE;