mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 13:07:16 +00:00
improved Shadow slaing: SWORD, SWORD_INTO and CRUSH now clear the Shadow history (previously SWORD killed it for 1 turn)
This commit is contained in:
parent
dd3f5a3d6b
commit
41f8f7fba3
@ -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)) {
|
||||
|
@ -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; p<MAXPLAYER; p++)
|
||||
if(shpos[cshpos][p] == c)
|
||||
for(int i=0; i<SHSIZE; i++)
|
||||
changes.value_set(shpos[i][p], (cell*) nullptr);
|
||||
}
|
||||
|
||||
EX void moveshadow() {
|
||||
|
||||
cell *shfrom = NULL;
|
||||
@ -1462,8 +1470,12 @@ EX void moveshadow() {
|
||||
cshpos = (cshpos+1) % SHSIZE;
|
||||
for(int p: player_indices()) {
|
||||
cell* where = shpos[cshpos][p];
|
||||
if(where && where->monst == 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;
|
||||
|
Loading…
Reference in New Issue
Block a user