MCPcopy Create free account
hub / github.com/crawl/crawl / fire

Method fire

crawl-ref/source/fineff.cc:996–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994}
995
996void 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
1025void anguish_fineff::fire()
1026{

Callers 1

fire_final_effectsFunction · 0.45

Calls 15

mprfFunction · 0.85
mprFunction · 0.85
ouchFunction · 0.85
simple_monster_messageFunction · 0.85
monster_by_midFunction · 0.85
make_stringfFunction · 0.85
ru_do_retributionFunction · 0.85
adjacentFunction · 0.85
monster_atFunction · 0.85
testbitsFunction · 0.85
actor_atFunction · 0.85

Tested by

no test coverage detected