# Help with level "Reaping fire"

**URL:** <https://discourse.codecombat.com/t/help-with-level-reaping-fire/10072>\
**Category:** Adventurer\
**Created:** [December 24, 2016, 11:49am UTC](https://discourse.codecombat.com/t/help-with-level-reaping-fire/10072 "2016-12-24T11:49:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrstn1](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chrstn1](https://discourse.codecombat.com/u/chrstn1)\
**Post date:** [December 24, 2016, 11:49am UTC](https://discourse.codecombat.com/t/help-with-level-reaping-fire/10072/1 "2016-12-24T11:49:10Z")

</div>

Hi guys,  
merry Christmas!  
But … this level is hard for me!  
I just can’t find my error (“attempted to read only property” - is there any misspelling? I can’t find it.)  
Could anyone help me?

```python
# The goal is to survive for 30 seconds, and keep the mines intact for at least 30 seconds.

def chooseStrategy():
    enemies = hero.findEnemies()
    # If you can summon a griffin-rider, return "griffin-rider"
    if hero.gold >= hero.costOf(griffin-rider):
        return "griffin-rider"
    # If there is a fangrider on your side of the mines, return "fight-back"
    enemy = hero.findNearest(hero.findByType("fangrider"))
    elif enemy and enemy.type == "fangrider" and hero.distanceTo(enemy) < 30: 
        return "fight-back"
    # Otherwise, return "collect-coins"
    else: 
        return "collect-coins"

def commandAttack():
    # Command your griffin riders to attack ogres.
    for griffin in hero.findByType("griffin-rider"): 
        if griffin: 
            enemy = griffin.findNearest(griffin.findEnemies())
            if enemy and enemy.type == "ogre": 
                hero.command(griffin, "attack", enemy)
    
    
def pickUpCoin():
    # Collect coins
    coin = hero.findNearest(hero.findItems())
    if coin: 
        hero.move(coin.pos)
    pass
    
def heroAttack():
    # Your hero should attack fang riders that cross the minefield.
    enemy = hero.findNearest(hero.findEnemies())
    if enemy and enemy.type == "fangrider" and hero.distanceTo(fangrider) < 30: 
        if hero.canCast("chain-lightning", enemy): 
            hero.cast("chain-lightning", enemy)
        elif: 
            if hero.canCast("drain-life", enemy): 
                hero.cast("drain-life", enemy)
        else: 
            hero.attack(enemy)
    
    
while True:
    commandAttack()
    strategy = chooseStrategy()
    # Call a function, depending on what the current strategy is.
    if strategy == "griffin-rider": 
        hero.summon("griffin-rider")
        
        
    if strategy == "fight-back": 
        hero.attack()
        
        
    if strategy == "collect-coins": 
        pickUpCoin()

```

---

<div class="post-metadata">

**Author:** ![Ty\_Ler](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ty_ler/32/5322_2.png) [@Ty\_Ler](https://discourse.codecombat.com/u/Ty_Ler)\
**Post date:** [December 24, 2016, 2:14pm UTC](https://discourse.codecombat.com/t/help-with-level-reaping-fire/10072/2 "2016-12-24T14:14:16Z")

</div>

In method chooseStrategy.

```python
if hero.gold >= hero.costOf(griffin-rider) #<-- Needs double quotes for "griffin-rider"

```

In method commandAttack.

```python
enemy = griffin.findNearest(griffin.findEnemies()) #<--- This is your error. Griffin can not use findEnemies() only hero can.

```

You can fix this by finding the enemies through the hero then using the array made from the hero for the giffin.

---

<div class="post-metadata">

**Author:** ![taylerzy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/taylerzy/32/5214_2.png) [@taylerzy](https://discourse.codecombat.com/u/taylerzy)\
**Post date:** [December 24, 2016, 4:16pm UTC](https://discourse.codecombat.com/t/help-with-level-reaping-fire/10072/3 "2016-12-24T16:16:46Z")

</div>

You’re right about the double quotes. Nice catch.

However, I’m pretty sure the line `enemy = griffin.findNearest(griffin.findEnemies())` should work fine. Summoned minions can use many of the same methods as the hero can. However, it’s usually standard to use: `enemy = griffin.findNearestEnemy()` instead. Specifically, on the Glacier map **Kelvintaph Defiler** , players are required to find enemies through their allies, as a wall separates the hero from their allies, and Twilight Glasses (to see through walls) are disabled.

---

<div class="post-metadata">

**Author:** ![chrstn1](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chrstn1](https://discourse.codecombat.com/u/chrstn1)\
**Post date:** [December 27, 2016, 11:02am UTC](https://discourse.codecombat.com/t/help-with-level-reaping-fire/10072/4 "2016-12-27T11:02:03Z")

</div>

Thank you! I needed to add a “if enemy” statement somewhere in my code to solve this level!
