"Anti Gravity" discussions, tips & tricks, chatter

@Venneth I think there is a glitch with the mirroring bc when I cast in the ogres side my cast is in the wrong place.
image

def cast(place):
    boulders = hero.findBoulders()
    for boulder in boulders:
        if boulder.lane == place:
            hero.cast("pull", place, boulder.x + edited out)
            hero.cast("push", place, boulder.x - edited out)
            hero.cast("burst", place, boulder.x - edited out)

I have issues with mirroring too, I win to HeeroL with about 3500 hp, but when i fight on the ogres side, he(she) wins with 4500hp?!!

nvm it was another submission,but first problem still wrong

Mirroring coordinates should be fixed, thanks for the reports!

3 Likes

-Added a new ability "switchUnits", switch the position of any of your two units, refer to hints, abilities page for more details

4 Likes


:star_struck:

can switch be made to switch two lines instead of two units? :sweat_smile:

@SharkyCombat0, how do you properly use switch units?

Exactly what I was thinking yesterday. :laughing:

1 Like

at first I was thinking of making the switch ability similar to this, but then realized that some units might then appear in front of the boulder which might cause unexpected behaviours

3 Likes

Hi guys. I was wondering if anyone could help me with this code. It’s compatible with Python 3 but dosn’t work with the Code Combat version of python and I don’t know how to make it work with it.

sortedLane = sorted(laneDict.items(), key=lambda kv: kv[1])

This should work.

# Assuming laneDict is your dictionary
keys = laneDict.keys()

# Create a list of keys sorted by their corresponding values in laneDict
sortedKeys = sorted(keys, key=lambda x: laneDict[x])

# Now you can iterate over sortedKeys to access the items in laneDict in sorted order
for key in sortedKeys:
    value = laneDict[key]
    # Now you can use the key and value as needed

1 Like

Maybe we can switch two lines but only switch the units which are at the back of the boulder of the line you are going to switch to. Idk if that makes sense :sweat_smile:


:stuck_out_tongue:

by the way shouldnt there be a Anti Gravity Patch Notes considering that there was one for previous arenas

Hello. It appears hero.findUnits() is not performing properly with a lane as a parameter.

hero.findUnits(0) returns all units in all lanes.

Lanes 1-3 returns no values.

Obviously one can work around this by using:
allUnits = hero.findMyUnits(t) + hero.findEnemyUnits(t)

I used this code and you can see the log results in the consol.

 if hero.time > 30:    
        for t in range(4):
            totalMyUnits = len(hero.findMyUnits())
            totalEnemyUnits = len(hero.findEnemyUnits())
            totalUnits = len(hero.findUnits())
            
            if t == 0:
                print('Testing All Lanes ' + t + ' / Time Of: ' + round(hero.time,1) + 
                '\nmyunits: '  + totalMyUnits + 
                '\nBadUnits: ' + totalEnemyUnits + 
                '\nTotUnits: ' + totalUnits + '\nzzz')
            
            myUnits = len(hero.findMyUnits(t))
            badUnits = len(hero.findEnemyUnits(t))
            allUnits = len(hero.findUnits(t))
            print('Testing Lane ' + t + ' / Time Of: ' + round(hero.time,1) + 
                '\nmyunits: ' + myUnits + 
                '\nBadUnits: ' + badUnits + 
                '\nAllUnits: ' + allUnits + '\nzzz')
                

Red arrows are incorrect.

Thank you for the report!
The findUnits function should return the correct values now
sorry for the inconvenience

1 Like

Hey @Venneth, I’ve noticed that there is a problem with the amount you can add or subtract from a units position. In some lanes you need to add to its position to get the boulder down the lane, and in others you have to subtract.

There probably should be, it would make it a lot easier on “Venneth”.

Who would want an Anti Gravity Patch Notes chat?

  • Yes :+1:
  • No :-1:
0 voters