how do you avoid the firetraps?
I said use lightning bolt. It has unlimited range, and it should kill it in one shot.
Nope.
Experiment and try different methods. Think as a player which just completed early forest levels.
<health
property is introduced later>
OK this is my new code. Can you help me to make it better?
enemy = hero.findNearestEnemy()
hero.cast("chain-lightning", enemy)
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
if hero.isReady("root"):
hero.cast("root", enemy)
if hero.isReady("chain-lightning"):
hero.cast("chain-lightning", enemy)
elif hero.isReady("lightning-bolt") and enemy.type == "scout" or enemy.type == "catapult":
hero.cast("lightning-bolt", enemy)
elif hero.isReady("regen") and hero.health<70:
hero.cast("regen", hero)
elif hero.isReady("shockwave") and hero.distanceTo(enemy) < 20:
hero.cast("shockwave", enemy)
elif hero.distanceTo(enemy) < 5:
hero.moveXY(8, 36)
Hmm, why do root
and shockwave
work??? Thanks. I will find and remove them.
Why do you need to remove it? Isnāt it better if we have more abilities?
Also it said in the Hints that we can use root
and shockwave
.
Nope. Itās in the spell pallet and itās automatically
No. If you add all spells and all thangs on the field it doesnāt help to make a good level.
Oh ok i understand.
we canāt attack the catapults until we see it, and we canāt see it until it is within 60 meters, and it isnāt within 60 meters.
The heroās visual range is 65 in this level. Anyway what the problem?
Guys. This is a level for early Forest. Donāt complicate it. Try to make your solution step by step. Attack first. Then add some spell, another. The keyword for this level is IF-ELSE-IF
.
This is a great little puzzle that took me a few tries. I think the important part (for anyone having trouble as I did) is to understand the way the if-else statements interact and more importantly, understand how to properly nest them.
For example, I originally had my hero check for the ogre AFTER checking the distances to the enemies, like this:
if distance <= 30:
if hero.canCast("chain-lightning"):
hero.cast("chain-lightning", enemy)
else:
hero.attack(enemy)
elif distance > 30:
if hero.canCast("lightning-bolt"):
hero.cast("lightning-bolt", enemy)
elif enemy.type == "ogre":
hero.moveXY(7, 32)
But because the hero notices the enemy distance first, the enemy.type == āogreā statement never runs. I needed the hero to check the enemy type first.
Try to set type checking before distance checking
Wow this level really gets you thinking out of the box.
Before I had a complicated code, then I decided to restart.
The simpler code I wrote after I restarted allowed to get all the bonuses when the complicated one canāt.
Great level!
Hint to the people who are stuck on the level:
Hint
Try moving back a bit, so the ogres take longer to reach you.
you still have to be withing 65 meters.
yep. that too. (20 chars)
So then i canāt attack the catapult.
I pass this level, using the plan array
plan = ["lightning-bolt", 'attack', 'attack', 'attack', 'attack', 'attack', "lightning-bolt", "chain-lightning",
"regen", 'attack', "regen", "lightning-bolt", "chain-lightning", 'attack', 'attack', "lightning-bolt", 'attack',
"regen", "lightning-bolt", 'say', "away", 'armagedon']
whatās armagedon? (20)
No need to do thatā¦ You just need to move back so you have more time to attack the ogresā¦