From 3ed45475234648842067431e723f5e8ee5a50b50 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Tue, 8 Nov 2011 16:29:48 +0000 Subject: [PATCH] - [+] if you hide while a monster can see you, it automaticlaly gains F_SPOTtED (unless your hide skill is high enough) - [+] lower damage of cockatrice attack - [+] Allies attacking each other!! - [+] Your vampire bat claws the young wolf. Your young wolf no longer looks quite so friendly! - [+] think this was related to broken ally code? --- data.c | 2 +- lf.c | 5 ++++- spell.c | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/data.c b/data.c index 1429332..1a7b1d3 100644 --- a/data.c +++ b/data.c @@ -6489,7 +6489,7 @@ 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_DTIMMUNE, DT_PETRIFY, B_TRUE, NA, NULL); - addflag(lastrace->flags, F_HASATTACK, OT_TEETH, 9, NA, NULL); + addflag(lastrace->flags, F_HASATTACK, OT_TEETH, 2, NA, NULL); addflag(lastrace->flags, F_MORALE, 30, NA, NA, NULL); // special attack handled in attack.c diff --git a/lf.c b/lf.c index b09e233..02ace08 100644 --- a/lf.c +++ b/lf.c @@ -9504,6 +9504,10 @@ int isfriendly(lifeform_t *lf) { if (lfhasflag(lf, F_FRIENDLY)) { return B_TRUE; } + if (ispetof(lf, player)) { + return B_TRUE; + } + return B_FALSE; } @@ -14287,7 +14291,6 @@ void startlfturn(lifeform_t *lf) { bonus += getskill(lf, SK_LISTEN); } - dist = getcelldist(lf->cell, l->cell); if (dist > 1) { bonus -= (dist*2); diff --git a/spell.c b/spell.c index 4adf2cf..29e2c05 100644 --- a/spell.c +++ b/spell.c @@ -2772,6 +2772,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef killflag(f3); } else if (abilid == OT_A_HIDE) { int penalty = 0; + lifeform_t *lf; if (isswimming(user) && !lfhasflag(user, F_AQUATIC)) { if (isplayer(user)) msg("You can't hide while swimming!"); @@ -2788,6 +2789,15 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef if (isplayer(user)) msg("You can't hide - there are monsters around!"); return B_TRUE; } + if (getskill(user, SK_STEALTH) < PR_EXPERT) { + // anyone who saw you start hiding can still see you + for (lf = user->cell->map->lf ; lf ; lf = lf->next) { + if (lf == user) continue; + if (cansee(lf, user)) { + addflag(lf->flags, F_SPOTTED, user->id, NA, NA, NULL); + } + } + } // start hiding addflag(user->flags, F_HIDING, penalty, NA, NA, NULL);