diff --git a/attack.cpp b/attack.cpp index f69e0cc5..e853eb0f 100644 --- a/attack.cpp +++ b/attack.cpp @@ -153,7 +153,7 @@ EX bool canAttack(cell *c1, eMonster m1, cell *c2, eMonster m2, flagtype flags) if(c1 && c2 && againstRose(c1, c2) && !ignoresSmell(m1)) return false; - if(m2 == moShadow && !(flags & AF_SWORD)) return false; + if(m2 == moShadow && !(flags & (AF_SWORD | AF_SWORD_INTO | AF_CRUSH))) return false; if(isWorm(m2) && m2 != moTentacleGhost && !isDragon(m2)) return false; // dragon can't attack itself, or player who mounted it @@ -457,7 +457,8 @@ EX void killMonster(cell *c, eMonster who, flagtype deathflags IS(0)) { bool fallanim = (deathflags & AF_FALL) && m != moMimic; int pcount = fallanim ? 0 : 16; - if(m == moShadow) return; + if(m == moShadow) + kill_shadow_at(c); #if CAP_HISTORY if(!isBug(m) && !isAnyIvy(m)) { diff --git a/monstermove.cpp b/monstermove.cpp index 8d104f84..984216c8 100644 --- a/monstermove.cpp +++ b/monstermove.cpp @@ -1443,6 +1443,14 @@ EX void clearshadow() { shpos[i][p] = NULL; } +/** \brief kill the shadow by clearing its history -- c is provided for multiplayer */ +EX void kill_shadow_at(cell *c) { + for(int p=0; pmonst == moNone && where->cpdist && among(where->land, laGraveyard, laCursed) && - !sword::at(where)) { + if(sword::at(where)) { + kill_shadow_at(where); + fightmessage(moShadow, moPlayer, false, AF_SWORD_INTO); + continue; + } + if(where && where->monst == moNone && where->cpdist && among(where->land, laGraveyard, laCursed)) { if(shfrom) animateMovement(match(shfrom, where), LAYER_SMALL); where->monst = moShadow; where->hitpoints = p;