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

Kelvintaph Defiler - Help!


Please help on Kelvintaph Defiler! The paladin keeps on dying before drain life wears off on her.

Here is my code:

step = 0

def choiseTarget(enemies):
    for enemy in enemies:
        for att in attack:
            if att[0] == enemy.pos.x and att[1] == enemy.pos.y:
                return enemy
    return None

def commandTroops():
    for index, friend in enumerate(hero.findFriends()):
        if (step == 0 and friend.pos.y > 60 and (friend.type != 'archer' or > 3.7)):
            enemy = friend.findNearestEnemy()
            if enemy:
                hero.command(friend, "attack", enemy)
        elif step == 4:
            hero.command(friend, "move", {'x': 42, 'y': 67})
        elif friend.type == 'archer':
        elif friend.type == 'paladin':

def CommandPaladin(soldier):
    if step < 4:
        if (soldier.canCast("heal") and > 3):
            hero.command(soldier, "cast", "heal", soldier)
        elif > 3 and < soldier.maxHealth * 0.7:
            hero.command(soldier, "shield")

def CommandSoldier(soldier):
    if step < 4:
        if soldier.pos.x < 74:
            hero.command(soldier, "move", {'x': 76, 'y': 76})
            enemy = soldier.findNearestEnemy()
            if enemy:
                hero.command(soldier, "attack", enemy)

def CommandArcher(soldier):
    if step == 1:
        if soldier.pos.y > 60:
            hero.command(soldier, "move", {'x': 22, 'y': 55})
            enemies = soldier.findEnemies()
            for enemy in enemies:
                if enemy.type != 'yeti':
                    hero.command(soldier, "attack", enemy)
    elif step == 2:
        if soldier.pos.x > 14:
            hero.command(soldier, "move", {'x': 8, 'y': 77})
            enemy = soldier.findNearestEnemy()
            if enemy:
                hero.command(soldier, "attack", enemy)
    elif step == 3:
        if soldier.pos.x < 74:
            hero.command(soldier, "move", {'x': 76, 'y': 76})
            enemy = soldier.findNearestEnemy()
            if enemy:
                hero.command(soldier, "attack", enemy)

def moveTo(position, fast=True):
    if (hero.isReady("jump") and fast):

index = 0
route = [[33, 12, False], [34, 9, False], [32, 6, False]]

def moveHero():
    if len(route) > index:
        moveTo({'x': route[index][0], 'y': route[index][1]}, route[index][2])
        if (hero.pos.x == route[index][0] and hero.pos.y == route[index][1]):
            return True
            return False

def attack(target):
    if target:
        if (hero.distanceTo(target) > 10):
        elif (hero.isReady("bash")):

while True:
    if ( > 6 and < 12):
        step = 1
    elif ( > 10 and < 17):
        step = 2
    elif ( > 15 and < 30):
        step = 3
    elif ( > 28 and < 600):
        step = 4
    if step < 4:
        if moveHero():
            index = index + 1
        enemy = hero.findNearest(hero.findEnemies())
        if enemy:
            moveTo({'x': 74, 'y': 44})

Here is my gear:

<img src="/uploads/codecombat/original/2X/7/7574990a4ca45f415a2d53b868768fe05200374b.PNG" width="366"height=“500”>

Please help!

How do you do the kelvintaph defiler

The necromancer drain life the paladin forever until it die. Sorry I can’t really help because I haven’t figure out the solution yet.


Sorry but using the git hub code is not very good. I prefer if you try using your own code. But one hint: damage nalfar enough and he will retreat. That is how I saved all allies and got the boss star 4


Try killing all the shaman and get all your soldier and archer to attack the necromancer.


Or a simple act of sending *** to nalfar and he will soon escape


Can you explain a little bit clearer.


You see the **** is: A commandable unit and it has to die and nalfar somehow escapes


Ok thank for explaining it better.:slightly_smiling_face:


Are you on kelvintaph defiler?


Yes :slightly_smiling_face:


Sorry I took so long.


Sorry that I stop helping you. Here is one tip your units can attack in mid air but not while the shaman casting fear on them.


I finished it long ago


Congratulation. I haven’t so can you give me some tip please because I haven’t finish it.:slightly_smiling_face:


@Chaboi_3000 im not getting this… what’s the **** u are talking about…?


Check here:


even with that hint i can’t figure it out :rofl::joy:


A commandable unit would mean a unit on team human, but if a human dies, then u dont get the bonus, so it’s not on team human…
but how else could it be commandable…?


Bonus is not neccecary.


so… wut’s the ****? i still can’t figure it out
rip me