Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

[Touch of Death] Making Drain-Life work!


My character will not cast “drain-life”. I’m not sure what I’m doing wrong.


The same issue as most the posts in the forums. You are not checking if enemy exists before trying to us it.

wrap a

if enemy:

around your code that uses the enemy object


It looks like he does actually have an enemy check on line 5, he’s just redefining enemy on line 10, which is harmless.

I need to work on this, but try casting spells like this:

self.cast("drain-life", enemy)

I’ve opened a GitHub issue here to make the docs show the right values:


Oh … right. i missed that if enemy at the top. :smile:

yeah. seems to be safer to always use self.cast instead of the helper methods.