From 4a7711d11039c691117fcd3fcb11035fc65fbbff Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Wed, 1 Jun 2016 16:51:09 +1000 Subject: [PATCH] Genies should be immune to cold Objects/lfs made of gas shouldn't be able to be knocked backwards --- ai.c | 6 +++++- data.c | 1 + lf.c | 2 +- move.c | 6 ++++++ objects.c | 6 +++++- spell.c | 4 ++-- 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ai.c b/ai.c index 0e6ce5b..b8214bf 100644 --- a/ai.c +++ b/ai.c @@ -1631,6 +1631,7 @@ int ai_housekeeping(lifeform_t *lf, lifeform_t *master) { if (lfhasflag(lf, F_ISPRISONER) && master && isplayer(master) && (cansee(lf, master) || isadjacent(lf->cell,master->cell))) { + // soon after escaping the dungeon, they'll leave you. if (isoutdoors(lf->cell->map) && pctchance(85)) { object_t *o; say(lf, "Thanks for getting me out!", SV_TALK); @@ -1641,7 +1642,7 @@ int ai_housekeeping(lifeform_t *lf, lifeform_t *master) { getobname(o, obname, o->amt); msgnocap("%c - %s", o->letter, obname); } - // no longer an ally - but don't announce this. + // no longer an ally killflagsofid(lf->flags, F_FRIENDLY); killflagsofid(lf->flags, F_PETOF); killflagsofid(lf->flags, F_ISPRISONER); @@ -1881,6 +1882,9 @@ int ai_movement(lifeform_t *lf) { // can see a non-enemy on top of the object, and we are adjacent valid = B_FALSE; } + } else { + // weird ? + raise (SIGINT); } if (valid) { diff --git a/data.c b/data.c index 0522bd5..9b0e5f3 100644 --- a/data.c +++ b/data.c @@ -12493,6 +12493,7 @@ void initrace(void) { addflag(lastrace->flags, F_STARTATT, A_WIS, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_STARTATT, A_CHA, AT_HIGH, NA, NULL); addflag(lastrace->flags, F_DTIMMUNE, DT_PROJECTILE, NA, NA, NULL); + addflag(lastrace->flags, F_DTIMMUNE, DT_COLD, NA, NA, NULL); addflag(lastrace->flags, F_HASATTACK, OT_FISTS, 7, NA, NULL); addflag(lastrace->flags, F_STARTOB, 100, NA, NA, "2 scimitars"); addflag(lastrace->flags, F_STARTOB, 50, NA, NA, "silk shirt"); diff --git a/lf.c b/lf.c index 7fde7db..2176871 100644 --- a/lf.c +++ b/lf.c @@ -24170,7 +24170,7 @@ void startlfturn(lifeform_t *lf) { } // extra effects - if (!ko && (f->val[0] == P_COLD)) { + if (!ko && (f->val[0] == P_COLD) && !isimmuneto(lf->flags, DT_COLD, B_FALSE)) { if (rnd(1,100) <= 10) { shiver(lf); } diff --git a/move.c b/move.c index adbbb68..4c2e7b0 100644 --- a/move.c +++ b/move.c @@ -895,6 +895,11 @@ int knockback(lifeform_t *lf, int dir, int howfar, lifeform_t *pusher, int fallc int preventchance = 0; enum LFSIZE lfsize; + // can't knock non-solid things back + if (getmaterialstate(getlfmaterial(lf)) != MS_SOLID) { + return B_TRUE; + } + if (lfhasflag(lf, F_GRAVLESSENED)) { howfar *= 2; } else if (lfhasflag(lf, F_GRAVBOOSTED)) { @@ -2656,6 +2661,7 @@ int initiatemove(lifeform_t *lf, cell_t *cell, int onpurpose, int *didmsg) { if (willstand) { standup(lf); + reason = E_OK; // doesn't count as a move for monster who were feigning death! if (!isplayer(lf) && lfhasflag(lf, F_FEIGNINGDEATH)) { diff --git a/objects.c b/objects.c index aa6f9dd..ad32043 100644 --- a/objects.c +++ b/objects.c @@ -16277,7 +16277,8 @@ void timeeffectsob(object_t *o) { object_t *oo; lf = o->pile->where->lf; creator = getobcreatedby(o); - if (lf && (lf != creator) ) { + + if (lf && (lf != creator) && (getmaterialstate(getlfmaterial(lf)) == MS_SOLID)) { char damstring[BUFLEN]; if (cansee(player, lf)) { char lfname[BUFLEN]; @@ -16302,9 +16303,12 @@ void timeeffectsob(object_t *o) { // objects get knocked away for (oo = o->pile->where->obpile->first ; oo ; oo = oo->next) { if (oo == o) continue; + + // note: f_nopickup obs will still get moved! if (hasflag(oo->flags, F_COSMETIC) || hasflag(oo->flags, F_CLIMBABLE) || (hasflag(oo->flags, F_TRAIL)) || + (getmaterialstate(o->material->id) != MS_SOLID) || (hasflag(oo->flags, F_KNOCKAWAY)) || // don't affect other wind knockaway objects (oo->type->obclass->id == OC_BUILDING)) { } else { diff --git a/spell.c b/spell.c index 540d50e..c7fc35d 100644 --- a/spell.c +++ b/spell.c @@ -8313,7 +8313,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ if (cansee(player, target)) { if (seenbyplayer) *seenbyplayer = B_TRUE; } - makehot(o, amt, rnd(1,2)); + makehot(o, amt, 2); } } } @@ -8343,7 +8343,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_ if (seenbyplayer) *seenbyplayer = B_TRUE; donesomething = B_TRUE; } - makehot(o, amt, rnd(1,2)); + makehot(o, amt, 2); if (isplayer(caster)) { char obname[BUFLEN]; getobname(o, obname, o->amt);