Conversation
ptal
left a comment
There was a problem hiding this comment.
Hello! Good work!
I made some comments below that should be addressed before merging. You can also comment my comments (that's a discussion on the code).
| // First check if a champion needs to be revived. | ||
| arena.teamOf(teamID).forEachChampion((champion, id) -> { | ||
| if (!champion.isAlive()){ | ||
| turn.registerAction(new Revive(teamID, id, (int) (Math.random()*9), (int) (Math.random()*9))); |
There was a problem hiding this comment.
I think this should be automatic on the server side, and the champion should spawn next to its nexus.
Also, because it is done on the client side, the client can choose to spawn just next to the opponent nexus.
Why do we need a revive action? Doesn't a Spawn action would be enough? (It would also allows to reuse most of the mechanics of a spawn action).
| } | ||
|
|
||
| public void removeChampion(Destructible d, int x, int y) { | ||
| if (d instanceof Champion && !d.isAlive()) { |
There was a problem hiding this comment.
We could generalize to removeDestructible since anything destructible (including nexus) should be remove when it's dead. That would also remove the need for an instanceof.
| return deathTimer==3; | ||
| } | ||
|
|
||
| public void resetTimer() { |
There was a problem hiding this comment.
Would it be possible to override revive and reset the timer there?
Added the ability to revive fallen champions after 3 turns. The number of turns can be changed. The position where the champion is being revived is random, but can be changed later by modifying two parameters. Reviving is done before any other action.
Added the ability to attack enemy champions. This was needed to be able to revive the champions, because if no champions die no champions can be revived. Attacking other champions is done before attacking the nexus or moving if possible.
The modifications also allow to remove dead corpses from the field as soon as they die. This was needed in order not to overload the battlefield with useless corpses.