phxql / restwars-kotlin

A browser-game style game, playable via a REST interface
1 stars 1 forks source link

Combat system is broken #12

Open phxql opened 6 years ago

phxql commented 6 years ago

10 mostquitos vs 13 mosquitos result in both sides being completely destroyed.

This is due to the fact that one mosquito has firepower to destroy 14. Probably one mosquito should only kill one ship at most. (this problem needs verification)

phxql commented 6 years ago

Idea from dom:

Combat takes place in rounds. Sum the AP of all ships. Every ship has a chance to hit of 80%. The AP will be distributed randomly on the enemy ships. Every ship has 20% chance of absorbing attacks. Remove the destroyed ships from the list. If both sides have ships left, simulate another round.

phxql commented 6 years ago
19:10:04.951 [main] DEBUG r.business.fight.FightCalculatorImpl - Fight between Ships(ships=[Ship(type=MOSQUITO, amount=10)]) and Ships(ships=[Ship(type=MOSQUITO, amount=13)])
19:10:04.955 [main] DEBUG r.business.fight.FightCalculatorImpl - Attacker attack points: 140
19:10:04.956 [main] DEBUG r.business.fight.FightCalculatorImpl - Remaining defending ships: Ships(ships=[Ship(type=MOSQUITO, amount=0)])
19:10:04.956 [main] DEBUG r.business.fight.FightCalculatorImpl - Attacker attack points: 182
19:10:04.956 [main] DEBUG r.business.fight.FightCalculatorImpl - Remaining defending ships: Ships(ships=[Ship(type=MOSQUITO, amount=0)])

That shouldn't happen.