Cardshifter / HTML-Client

HTML/CSS/JS-based client for Cardshifter
http://cardshifter.zomis.net
Apache License 2.0
13 stars 5 forks source link

Upgrado card not being replaced from Mk III to IV and from Mk IV to V #163

Open Phrancis opened 6 years ago

Phrancis commented 6 years ago

Turn 1, initial play Upgrado Mk I

Sending to server: {"gameId":67,"id":61,"action":"Play","command":"use"}

image

Turn 2, Upgrado Mk I is correctly replaced by Mk II

Message received: {"command":"zoneChange","entity":112,"sourceZone":-1,"destinationZone":47}
Message received: {"command":"card","id":112,"properties":{"SCRAP":2,"MAX_HEALTH":4,"imagePath":"cyborg-chronicles/default.png","creatureType":"Mech","TAUNT":1,"flavor":"Upgrades itself on each new turn up to Mk V.","SICKNESS":0,"effect":"Deal 1 damage to creatures owned by opponent on Battlefield\nAt the start of your turn, summon 1 Upgrado Mk III to your Battlefield\nAt the start of your turn, perish","name":"Upgrado Mk II","ATTACK":2,"HEALTH":4,"id":"upgrado-mk-ii","ATTACK_AVAILABLE":1},"zone":47}

image

Turn 3, Upgrado Mk II is correctly replaced by Mk III

Message received: {"command":"zoneChange","entity":113,"sourceZone":-1,"destinationZone":47}
Message received: {"command":"card","id":113,"properties":{"SCRAP":3,"MAX_HEALTH":5,"imagePath":"cyborg-chronicles/default.png","creatureType":"Mech","TAUNT":1,"flavor":"Upgrades itself on each new turn up to Mk V.","SICKNESS":0,"effect":"Change SCRAP by 2 on you\nAt the start of your turn, summon 1 Upgrado Mk IV to your Battlefield\nAt the start of your turn, perish","name":"Upgrado Mk III","ATTACK":3,"HEALTH":5,"id":"upgrado-mk-iii","ATTACK_AVAILABLE":1},"zone":47}

image

Turn 4, Upgrado Mk VI is placed on Battlefield, but Mk III is not removed.

All game actions have become unavailable, so the game is basically frozen now. The browser console did not display any error.

Message received: {"command":"zoneChange","entity":114,"sourceZone":-1,"destinationZone":47}
Message received: {"command":"card","id":114,"properties":{"SCRAP":4,"MAX_HEALTH":6,"imagePath":"cyborg-chronicles/default.png","creatureType":"Mech","TAUNT":1,"flavor":"Upgrades itself on each new turn up to Mk V.","SICKNESS":0,"effect":"As long as this is on the battlefield, give creatures of type Mech owned by you on Battlefield 1 ATTACK and HEALTH\nAt the start of your turn, summon 1 Upgrado Mk V to your Battlefield\nAt the start of your turn, perish","name":"Upgrado Mk IV","ATTACK":4,"HEALTH":6,"id":"upgrado-mk-iv","ATTACK_AVAILABLE":1},"zone":47}

image

Zomis commented 6 years ago

The messages shown here, such as {"command":"zoneChange","entity":112,"sourceZone":-1,"destinationZone":47} are only for the new card being created. (sourceZone -1) and then a cardInfo message for the same entity id.

Need to check for the other messages which probably have destinationZone -1

Phrancis commented 6 years ago

Could we make those messages log to the console as well? I didn't notice anything like that going on while reproducing the bug,

Zomis commented 6 years ago

Sorry, my bad. Look for messages that say {"command":"entityRemoved","entity":61}

Phrancis commented 6 years ago

OK I'll test it again later and update this issue with my findings.