Add chess (and mostly just tabletop backend stuff) (#4429)

* Add draggable tabletop component

* Use EntityCoordinates instead

* Don't send coordinates every frame

* Add chessboard + verb WIP

* Add documentation, verb networking works now

* Work so far
Need PVS refactor before being able to continue
Current code is broken

* viewsubscriber magic

* yes

* Fix map creation

* Add chess pieces, attempt prediction

* Add chess sprites and yml

* Clamping + other stuff

* fix

* stuff

* StopDragging() StartDragging()

* add piece grabbing

* Refactor dragging player to seperate event

* 🤣 Who did this 🤣💯👌

* 📮 sussy 📮

* Update chessboard sprite, scale piece while dragging

* yes

* ye

* y

* Close tabletop window when player dies

* Make interaction check more sane

* Fix funny behaviour when stunned

* Add icon

* Fix rsi

* Make time passed check more accurate

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Use EyeManager.PixelsPerMeter

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Add missing import

* Move viewport properties to XAML

* Make shared system and component abstract

* Use built in EntityManager

* Use RaiseNetworkEvent instead of SendSystemNetworkMessage

* Cache ViewSubscriberSystem

* Move unnecessary code to prototype

* Delete map on component shutdown instead of round restart

* Make documentation match rest of codebase

* Use ComponentManager instead of TryGetComponent

* Use TryGetComponent instead of GetComponent

* Add nullspace check to ClampPositionToViewport()

* Set world pos instead of local pos

* Improve server side verification

* Use visualizer

* Add netsync: false to sprites using visualizer

* Close window when chessboard is picked up

* Update to master

* Fix bug when opening window while another is opened

* Use ComponentManager

* Use TryGetValue

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Visne
2021-09-13 11:58:44 +02:00
committed by GitHub
parent 19551047c8
commit 973926fc9a
41 changed files with 1287 additions and 4 deletions

View File

@@ -0,0 +1,147 @@
# Chessboard item (normal in game item you can hold in your hand)
- type: entity
parent: BaseItem
id: ChessBoard
name: chessboard
description: A chessboard. Pieces included!
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chessboard.rsi
state: chessboard
- type: TabletopGame
# Chessboard tabletop item (item only visible in tabletop game)
- type: entity
id: ChessBoardTabletop
name: chessboard
abstract: true
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chessboard_tabletop.rsi
state: chessboard_tabletop
noRot: false
drawdepth: FloorTiles
## Chess pieces
- type: entity
id: BaseChessPiece
parent: BaseItem
abstract: true
components:
- type: TabletopDraggable
- type: Sprite
netsync: false
noRot: true
- type: Appearance
visuals:
- type: TabletopItemVisualizer
# White pieces
- type: entity
id: WhiteKing
name: white king
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: w_king
- type: entity
id: WhiteQueen
name: white queen
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: w_queen
- type: entity
id: WhiteRook
name: white rook
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: w_rook
- type: entity
id: WhiteBishop
name: white bishop
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: w_bishop
- type: entity
id: WhiteKnight
name: white knight
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: w_knight
- type: entity
id: WhitePawn
name: white pawn
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: w_pawn
# Black pieces
- type: entity
id: BlackKing
name: black king
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: b_king
- type: entity
id: BlackQueen
name: black queen
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: b_queen
- type: entity
id: BlackRook
name: black rook
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: b_rook
- type: entity
id: BlackBishop
name: black bishop
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: b_bishop
- type: entity
id: BlackKnight
name: black knight
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: b_knight
- type: entity
id: BlackPawn
name: black pawn
parent: BaseChessPiece
components:
- type: Sprite
sprite: Objects/Fun/Tabletop/chess_pieces.rsi
state: b_pawn