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

Help with level "Reaping fire"


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?

# 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.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"
        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: 
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)
            if hero.canCast("drain-life", enemy): 
                hero.cast("drain-life", enemy)
while True:
    strategy = chooseStrategy()
    # Call a function, depending on what the current strategy is.
    if strategy == "griffin-rider": 
    if strategy == "fight-back": 
    if strategy == "collect-coins": 


In method chooseStrategy.

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

In method commandAttack.

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.


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.


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