The only thing I didn’t understand is that if the findFriends() method returns the peasants, then why the findEnemies() doesn’t return the ogres? Although you can still solve it with a one-liner, it’s just uglier
I think he meant the health of the enemy with the least health.
The problem in the ref code was that it would subtract the last victim’s entire health even when poisonMass was less than health (resulting in negative poisonMass at the end).
I submitted a patch for this and a few other things:
Fixed poisonAttack calculation
set hero.seeThroughWalls = false (makes it harder to use attacks like chain-lightning, which can kill any remaining ogres)
set ignoreItemGold to true (no income from boss stars => no summoning, although it might not make much of a difference)
replaced munchkins with scouts (for a larger health range and so that health does not need to go above their natural maxHealth)
changed a few words in the sample code (but this could mess with translations)
edit: noticed a typo in the comments: “require mass” should be “required mass”. (was not changed in the above commit)