| 994 | } |
| 995 | |
| 996 | void mirror_damage_fineff::fire() |
| 997 | { |
| 998 | actor *attack = attacker(); |
| 999 | if (!attack || attack == defender() || !attack->alive()) |
| 1000 | return; |
| 1001 | // defender being dead is ok, if we killed them we still suffer |
| 1002 | |
| 1003 | god_acting gdact(GOD_YREDELEMNUL); // XXX: remove? |
| 1004 | |
| 1005 | if (att == MID_PLAYER) |
| 1006 | { |
| 1007 | const monster* reflector = defender() ? |
| 1008 | defender()->as_monster() : nullptr; |
| 1009 | if (reflector) |
| 1010 | { |
| 1011 | mprf("%s reflects your damage back at you!", |
| 1012 | reflector->name(DESC_THE).c_str()); |
| 1013 | } |
| 1014 | else |
| 1015 | mpr("Your damage is reflected back at you!"); |
| 1016 | ouch(damage, KILLED_BY_MIRROR_DAMAGE); |
| 1017 | } |
| 1018 | else |
| 1019 | { |
| 1020 | simple_monster_message(*monster_by_mid(att), " suffers a backlash!"); |
| 1021 | attack->hurt(defender(), damage); |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | void anguish_fineff::fire() |
| 1026 | { |
no test coverage detected