# \[Touch of Death\] Making Drain-Life work!

**URL:** https://discourse.codecombat.com/t/touch-of-death-making-drain-life-work/1987
**Category:** Bugs
**Created:** [December 19, 2014, 1:42pm UTC](https://discourse.codecombat.com/t/touch-of-death-making-drain-life-work/1987 "2014-12-19T13:42:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lukebrannigan57](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lukebrannigan57/32/1873_2.png) [@lukebrannigan57](https://discourse.codecombat.com/u/lukebrannigan57)
#### Post date: [December 19, 2014, 1:42pm UTC](https://discourse.codecombat.com/t/touch-of-death-making-drain-life-work/1987/1 "2014-12-19T13:42:16Z")

</div>

![](https://sea2.discourse-cdn.com/flex016/uploads/codecombat/1786/c95557a1db233cb2.png)

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

---

<div class="post-metadata">

### Author: ![sotonin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sotonin/32/24089_2.png) [@sotonin](https://discourse.codecombat.com/u/sotonin)
#### Post date: [December 19, 2014, 3:56pm UTC](https://discourse.codecombat.com/t/touch-of-death-making-drain-life-work/1987/2 "2014-12-19T15:56:35Z")

</div>

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

wrap a

```python
if enemy:

```

around your code that uses the enemy object

---

<div class="post-metadata">

### Author: ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)
#### Post date: [December 19, 2014, 6:17pm UTC](https://discourse.codecombat.com/t/touch-of-death-making-drain-life-work/1987/3 "2014-12-19T18:17:49Z")

</div>

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:

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

```

I’ve opened a GitHub issue here to make the docs show the right values: [https://github.com/codecombat/codecombat/issues/1961](https://github.com/codecombat/codecombat/issues/1961)

---

<div class="post-metadata">

### Author: ![sotonin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sotonin/32/24089_2.png) [@sotonin](https://discourse.codecombat.com/u/sotonin)
#### Post date: [December 19, 2014, 6:18pm UTC](https://discourse.codecombat.com/t/touch-of-death-making-drain-life-work/1987/4 "2014-12-19T18:18:56Z")

</div>

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

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