For the record, rotting attacks from monsters currently have the same problem that draining attacks used to, due to monsters::rot()'s directly modifying the monster's max HP, as well as its directly calling monsters::hurt().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8340 c06c8d41-db1a-0410-9941-cceddc491573
3B3GZ4E2L4RIPHILKXACK4GF7DCQA5XC4UG75PHQXIVH4UCQWYAAC QXI6JLO5RGDKUG5H7RBMQTTT3234L2NGHJTMWAF6UJEBJDBDMMNAC S3U5CQV7LXDDRA36QLMALXKEDPKJXLYLOTZ7S6ZDBKUCDIQX43AAC QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC R22TTMI6WXWULC7ODKFF3QCB7MOTETQQ6IR4BUCUPOCQKQNCTT5AC 6L4EP4ZRWWYLT55PD5KTTJON5J2JB5VV5MWNHF5VPZQZ5BKEYZ4QC 5FHWTG7M6FW4B3I33YI7QSM3OZIB6ZGC6TI6JISSLY5Y43HI56VAC 6LTQT4CP7LJZLAE7JTPQ4OT4JOG3IFYM7RNXL3FINKBFO6452DTAC NWJ5IHZJXYE4I7CKSDNMTLGTIKOWK42LC2UYZL2TLXSZLM67WKRAC B62ICMDTN5V7R7RBL4JALFVKEMVOOVLRSJASRNYS6CGFWBEEF5JQC C5U3HSOOQ7BKXKXIDS7MLVXUKDTHAWJ5NXNX6YDXTM3GWY5UWX4QC PI5BATR2SER3RFE76IUGHM2AGXVFOUM3PLU7WC2K2Q2BA5K2E73QC EQDLV5OMIFO5ZPYNE27VQLLZEIRMSALGNEFWVSCFXJN22A43GCWQC JLAGD2FAV3CWVO7PLXTHLT7MBI23TUSYLSNHFAWP5IB5UO77VKJAC void monsters::rot(actor *atk, int rotlevel, int immed_rot){if (res_rotting() > 0)return;// Apply immediate damage because we can't handle rotting for// monsters yet.const int damage = immed_rot;if (damage > 0){if (mons_near(this) && player_monster_visible(this)){mprf("%s %s!", name(DESC_CAP_THE).c_str(),rotlevel == 0 ? "looks less resilient" : "rots");}hurt(atk, damage);if (alive()){max_hit_points -= immed_rot * 2;if (hit_points > max_hit_points)hit_points = max_hit_points;}}
// Apply immediate damage because we can't handle rotting for monsters yet.const int damage = immed_rot;if (damage > 0){if (mons_near(this) && player_monster_visible(this)){mprf("%s %s!", name(DESC_CAP_THE).c_str(),rotlevel == 0? "looks less resilient" : "rots");}hurt(agent, damage);if (alive()){max_hit_points -= immed_rot * 2;if (hit_points > max_hit_points)hit_points = max_hit_points;}}if (rotlevel > 0){add_ench(mon_enchant(ENCH_ROT, std::min(rotlevel, 4),agent->kill_alignment()));}}
virtual int hurt(const actor *attacker, int amount,beam_type flavour = BEAM_MISSILE,bool cleanup_dead = true) = 0;
virtual void rot(actor *attacker, int rotlevel, int immed_rot) = 0;virtual int hurt(const actor *attacker, int amount,beam_type flavour = BEAM_MISSILE,bool cleanup_dead = true) = 0;