As a tip for any level without a default code:
1. Make a plan and break it into pieces
2.Choose a free hero (for complex ones you have more opportunities for mistakes)
3.Solve the problem step by step
I tried to complete Summit gate without casualties.
I have Twilight glasses so i ran this code:
var es = hero.findEnemies();
for (var i = es.length; --i > -1;){
var e = es[i];
console.log("e#" + i + " " + e.type + " " + e.id + ": " + e.health + e.pos );
}
// console output:
// e#30 door Sanctum Gate: 600{x: 288.00, y: 32.75, z: 4.00}
// e#29 door Inner Gate: 300{x: 158.00, y: 32.75, z: 4.00}
// e#28 door Outer Gate: 300{x: 100.00, y: 33.25, z: 4.00}
// e#19 catapult Catapult 1: 140{x: 92.18, y: 6.84, z: 1.00}
// e#0 catapult Catapult: 140{x: 92.10, y: 60.30, z: 1.00}
// + many enemies
So my first goal was to:
Destroy the catapults
Defeat the enemies , but without destroying the door
Summon archers
Heal the hero
As a break condition i use the fact there are 3 enemies remaining, The Outer , The Inner and The Sanctum gates
I checked the solutions in the Leader Board for 2 days to see how the recent users have completed the level. So my findings are:
From 18 successful submissions:
2 users have solved the level without flags.
2 users have solved the level with flags.
1 level doesn’t work
1 level fails with Infinite Loop Detected 12 users have the same code stolen from internet No Comment
# Vecht je weg in het Binnenste Heiligdom van het ogre-opperhoofd, en versla haar.
while True:
paladins = []
enemy = hero.findNearestEnemy()
if hero.canCast("invisibility", hero):
hero.cast("invisibility", hero)
friends = hero.findFriends()
for friend in friends:
if friend.type == "paladin":
paladins.append(paladin)
for enemy in enemies:
if enemy.type == "catapult":
while enemy.health > 0:
hero.attack(enemy)
friends = hero.findFriends()
for friend in friends:
e = friend.findNearestEnemy()
if e:
hero.command(friend, "attack", e)
fire = hero.findNearestEnemy()
if fire:
while fire.health > 0:
hero.attack(fire)
if fire.type == "tower":
pass
if hero.pos.x > 160:
hero.moveXY(175, 35)
hero.moveXY(175, 8)
hero.moveXY(245, 14)
hero.moveXY(245, 35 )
while hero.health < hero.maxHealth:
hero.moveXY(245, 35)
if hero.gold > hero.costOf("griffin-rider"):
hero.summon("griffin-rider")
paladin = hero.findByType("paladin")
for paladin in paladins:
if paladin:
if paladin.canCast("heal",paladin):
hero.command(paladin, "cast", "heal", hero)
if hero.maxHealth <= hero.health:
if fire:
hero.moveXY(277, 34)
hero.moveXY(277, 5)
DJ = hero.findNearestEnemy()
if DJ:
while DJ.health > 0:
hero.attack(DJ)
hero.moveXY(277, 48)
lie = hero.findNearestEnemy()
if lie:
while lie.health > 0:
hero.attack(lie)
while True:
paladins = hero.findByType("paladin")
for paladin in paladins:
if paladin:
if paladin.canCast("heal", paladin):
hero.command(paladin, "cast", "heal", hero)
n00B = hero.findNearestEnemy()
if n00B:
hero.attack(n00B)