The Snowhold Clash topic

You guys know the drill by now. Anything Snowhld Clash! Enjoy! :grin:

2 Likes

How do I define the enemy hero?

1 Like

which language 20 chars suck

1 Like

Easiest way to select the enemy hero - CodeCombat Discourse

1 Like

For some reason this dosent work.

if enemy.health > 300 and < 450:

image

1 Like

Does it work elsewhere? For javascript it doesn’t work anywhere.

1 Like

Nope (20charsssssss)

1 Like

I guess I could just make it so that it runs through 2 if loops.

1 Like

You could also do if enemy.health > 300 and enemy.health < 450

Ohhhh ok thanks!! :grin: :grin: :grin:

2 Likes

@JustALuke I need your help!!! How do you make lightning target spirits, catapults and brawlers, and then fireballs target paladins, archers, soldiers???

Hi @ChickenMaster I think I can help.

  1. Use def (insert variable name here)
  2. Use a for loop to loop through all enemies.
  3. Inside the for loop insert a if loop to find the the enemy.type == the enemy you want to lightning.
  4. Then cast the lightning on the enemy.x and enemy.y
  5. Repeat steps 2 - 4 until all the enemies you want to lightning are covered

To fireball just change the lightning to a fireball.
Hope that helps! :grin:

1 Like

Wait, are you playing live now?? It looks like you are!!!

( deleted by author)

What variable???

Just pick a name. (20chars)

Can you write it please??( It is not working for me.)

def lightning:
   enemies = hero.findEnemies
    for enemy in enemies:
        if enemy.type == "paladin":
            hero.cast("lightning", enemy.x, enemy.y)
            break;
1 Like

P.S. My username is R1b!!! So, thanks!!!

Oh, and how do you target a spirit???