Iron and Ice help

can someone help me find a good strat because right now im doing a tournament between my district and im slowly going down the ranks to #3 I would just like some people to find the best strat.

archers for majority of match, pull on other guys tower, push on yours, don’t use teleport, burst on your tower

3 Likes

And also counter the opponents anomalies

1 Like

also how would I do a while true loop with like a if 25 mana thing for the tower. but also I do I do that with all of the towers.

1 Like

From what I gether your trying to sort of even out the levels of your towers?
I’d run a checklist to make sure all your towers are even

var towerA = hero.buildTower('tower-type', towerA.x, towerA.y);
var towerB = hero.buildTower('tower-type', towerB.x, towerB.y);
var towerC = hero.buildTower('tower-type', towerC.x, towerC.y);
if(towerA.level > towerB.level){
    hero.build('tower-type', towerB.x, towerB.y);
}else if(towerB.level > towerC.level
    hero.build('tower-type', towerC.x, towerC.y);
}

and so on.

No what I was trying to do was was use a while true loop for the counter anomalies code then when I have enough mana to build a tower (a if 25 mana code) then continue back to the counter anomalies code. Then after that do the same thing but place a different tower. Also Im python.

Okay, I cant help with the python, but you could make the anomolie code a function and put it between every step.

hero.whoopdidoo()
anomolyCounter()
hero.wippidybam()

so like just put my anomaly code between my towers.

I like to make an array of the towers I want to build, like:

toBuild = [
    {"x": 18, "y": 52, "type": "cannon", "targeting": "right"},
    {"x": 18, "y": 40, "type": "archer", "targeting": "close"},
    # ... more towers here
]

built = 0
while True:
    if hero.mana >= 25:
        next = toBuild[built % len(toBuild)]
        tower = hero.build(type, next.x, next.y)
        if tower != 'interrupted':
            hero.setTargeting(tower, next.targeting)
        built += 1
    else:
        # your anomaly code here

You could then go on to split your tower building and anomaly code into functions that return whether they blocked, so that your hero is only taking one blocking action per iteration of the while True: loop. Maybe you decide to use anomalies first before building towers?

def maybeBuild():
    if hero.mana < 25:
        return False
    # tower building logic here
    return True

def maybeUseAnomaly():
    # anomaly-using code here, returning True if you use one
    return False

while True:
    if maybeUseAnomaly():
        pass  # do nothing this round of the loop
    elif maybeBuild():
        pass
    else:
        pass  # chillin' like a villain
1 Like

Thank you that helps me a lot.

If anyone still see this post can anyone help me with anomaly codes, i dont understand them and that the last thing i need to improve my code

Welcome TO THE DISCOURSE :smiley: this is a warming and cozy chatting place! for topics like coding and other topics but… :grimacing: this topic is from a year ago please do not necro post

no, he is okay because he is on topic

Oh wait I forgot I apologize

Uhhhh dont mind my original REPLY cuz i forgot if its on topic its ok if necro