Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Help with Kelvintaph Delifer

# The ogres are trapping you with their dark rituals!
# Your hero can't do anything besides command and move without angering the warlocks.
# Beware ice, robots, traps, antigravity fields, and other dark magic.
# Somehow, you'll need to defeat Nalfar and save your paladin.
# The great treasure of Kelvintaph awaits your victory.
#1111111111111111111111111111111111111
hero.moveXY(33, 21)
def commandFriend():
    friends = hero.findFriends()
    for friend in friends:
        enemy = friend.findNearestEnemy()
        n = friend.findNearest(hero.findByType("necromancer"))
        s = friend.findNearest(hero.findByType("shaman"))
        if friend.type == "paladin" and n:
            hero.command(friend, "attack", n)
        elif friend.type == "soldier" and s:
            hero.command(friend, "attack", s)

while True:
    commandFriend()

This is my code and I have no idea what to do my character didn’t command the soldier and everyone :frowning:

I found this post to be helpful. I did use flags to simplify all the movement and timing. As the post mentions about this level:

If you time your initial attack and paladin shield correctly, you will open up some opportunities and get off of the slippery ice. Oh, and you don’t have to defeat the Yeti, just get Nalfar to run away. That should be enough to get you started.

Yeah but I need a starter code my self can’t command the soldier/archer i don’t know why but this is so tricky I don’t even know how to command my friend to attack the enemy I saw someone using like “enemy.name” I don’t understand :frowning:

You don’t need a starter code. Use everything u’ve learned to create your own starter code.

Note: To start you off, Try to command your troops to kill the second shaman (don’t kill the first one). Then, once that shaman is dead, command your free archer to kill other shamans and free some of your troops. Then, once some of ur troops are free, go attack Nalfar and then run away (since he will swap with the yeti). Do everything fast so your paladin doesn’t die. (Also command your paladin to cast heal and shield herself)

try not to think initially about it in terms of what code to write. Write your comments (pseudo code) first. Then write the code according to your plan.

# First do this
# Then do this
# Then do this
#  If that happens do this

Honestly I never do pseudocode :stuck_out_tongue:

1 Like

I don’t always do it either. If I can picture it in my head then I just write the code. I have used pseudo code on more complex levels though, just to keep my thoughts straight.