[Bugged] Gas Attack, Sarven Desert and see through walls

If I take off all glasses, it tells me to equip the twilight glasses.

The bug is that the game doesn’t tell you to equip the twilight glasses if you already have a different pair of glasses equipped. My code is fine, here it is for clarity:

# Calculate the total health of all the ogres.

def sumHealth(enemies):
    totalHealth = 0
    index = 0
    enemies = hero.findEnemies()
    while index < len(enemies):
        totalHealth += enemies[index].health
        index += 1
    return totalHealth

# Use the cannon to defeat the ogres.
cannon = hero.findNearest(hero.findFriends())
# The cannon can see through the walls.
enemies = cannon.findEnemies()
# Calculate the sum of the ogres' health.
ogreSummaryHealth = sumHealth(enemies)
hero.say("Use " + ogreSummaryHealth + " grams.")

Please post the code you used to beat it without the twilight glasses.

@xython is saying the glasses have bugs not the code, so knowing the code doesn’t help.

Who is finding the enemies? Your hero or the canon? Comment

enemies = hero.findEnemies()

in the function.

1 Like

Thank you xython! I’m dumb for not realizing that before. Makes me wonder why the game tells you to equip the twilight glasses though.

You can replace [solved] with [ bugged ] :grinning:

Actually I can’t test this right now, but I think the game might automatically tell you to equip your best pair of glasses, which for me happens to be the twilight glasses. Could just be a confusing coincidence.

I’m glad I made this thread now. I beat that level on accident using the wrong method and now I’ve learned the correct way.