added old code, fixed it (mostly), merged some new code to the old code, made it mostly runnable

This commit is contained in:
2024-01-21 23:03:24 +01:00
parent d6ba33874d
commit 5daffa8a8e
192 changed files with 2373 additions and 44 deletions

View File

@@ -0,0 +1,42 @@
# validation for placing cards:
- is the game still running
- is it the players turn
- does the card exist
- does the player have that card in his deck
- does the player have this card in his hand
- is the type of card allowed in that type of field
- is the field already blocked by another card
# validation for attacking another player
- is the game still running
- is it the players turn
- does the card exist
- does the player have that card in his deck
- is that card played
- does the enemy have remaining monster cards on his side
- if yes a direct attack would only be possible if a effect allows it
- can this card attack
- is the card of correct type
- is it blocked by effects (will be implemented after card effects are implemented)
# player death management (win condition)
- does a players hp go to 0?
- make the other player the winner
- if an effect affects the playing player card priority comes first
# handle a player leaving
- check if game still runs
- make remaining player win if yes
# turn management
- server keeps track of each turn
- whos turn is it
- what turn state is currently active
- draw state
- place state
- is the player trying to do actions not allowed in the given state
# drawing cards:
- ensure the player only can have 7 cards
- if limit exceeds the player payes lifepoints and drops a card
- ensure the drawn card for sure still can be in the players deck