siggame / MegaMinerAI-13

MegaMinerAI-13: Droids
1 stars 5 forks source link

Player's scrap amount doesn't change after OrbitalDrop #27

Closed scj7t4 closed 10 years ago

scj7t4 commented 10 years ago

The assertion in this code fails:

                print "Spawning {}".format(variant)
                initial_scrap = self.me.getScrapAmount()
                self.me.orbitalDrop(tile.getX(), tile.getY(), variant.getVariant())
                assert initial_scrap > self.me.getScrapAmount()

Attempting to spawn this variant:

Spawning id: 802
name: Claw
variant: 0
cost: 20
maxAttacks: 1
maxHealth: 30
maxMovement: 4
range: 1
attack: 10
maxArmor: 0
scrapWorth: 5
turnsToBeHacked: 20
hacketsMax: 6

Am I write in assuming that the player's scrap amount should be subtracted if they are doing a valid spawn? I tried to check my Mars code, but that was hardcoded to spawn a fixed set of units.

Tarnasa commented 10 years ago

IIRC Currently there is no client-side logic to subtract the scrap, Scrap will only be updated on the next turn

scj7t4 commented 10 years ago

Fixed this.