How do you make it so that when your enemy uses fire shield you use water ball or something like that?
Could you send the link to your level, and post your code?
@Flame.exe pretty sure you don’t suck at coding. This is just a problem you haven’t figured out the solution to yet.
In this case, what you needed was just finding the right functions to call.
First (and you might already have done this), you need to be able to get the object that represents the enemy hero. The instructions in “Hints” tell us that we can get it using hero.getEnemyHero()
. It also tells us that this object has all the same properties as the hero
object which refers to our own hero.
Second, there is the hero.getActiveShield()
method which is listed in the methods list (for Python).
The description says that this returns the active shield (if there is one) as an object. And this object would have some properties including .mana
which is the type of mana of the shield.
So since the enemy hero object you can get from hero.getEnemyHero()
is a hero object just like your own, you can call .getActiveShield()
on it to get the shield your opponent is using. Then, if there is one, you can examine its .mana
to determine if it is “fire”, “water”, or “earth”, and use that in your logic.