diff --git a/Content.Server/Tabletop/TabletopConquestSetup.cs b/Content.Server/Tabletop/TabletopConquestSetup.cs new file mode 100644 index 00000000000..7f6a9fd8083 --- /dev/null +++ b/Content.Server/Tabletop/TabletopConquestSetup.cs @@ -0,0 +1,76 @@ +using JetBrains.Annotations; +using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; + +namespace Content.Server.Tabletop +{ + [UsedImplicitly] + public sealed partial class TabletopConquestSetup : TabletopSetup + { + + [DataField("redPiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer))] + public string RedPiecePrototype { get; private set; } = "RedTabletopPiece"; + + [DataField("greenPiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer))] + public string GreenPiecePrototype { get; private set; } = "GreenTabletopPiece"; + + [DataField("yellowPiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer))] + public string YellowPiecePrototype { get; private set; } = "YellowTabletopPiece"; + + [DataField("bluePiecePrototype", customTypeSerializer:typeof(PrototypeIdSerializer))] + public string BluePiecePrototype { get; private set; } = "BlueTabletopPiece"; + + public override void SetupTabletop(TabletopSession session, IEntityManager entityManager) + { + var board = entityManager.SpawnEntity(BoardPrototype, session.Position); + + const float x1 = 6.25f; + const float x2 = 4.25f; + + const float y1 = 6.25f; + const float y2 = 4.25f; + + var center = session.Position; + + // Red pieces. + var tempQualifier = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y1)); + session.Entities.Add(tempQualifier); + var tempQualifier1 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x1, -y2)); + session.Entities.Add(tempQualifier1); + var tempQualifier2 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y1)); + session.Entities.Add(tempQualifier2); + var tempQualifier3 = entityManager.SpawnEntity(RedPiecePrototype, center.Offset(-x2, -y2)); + session.Entities.Add(tempQualifier3); + + // Green pieces. + var tempQualifier4 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y1)); + session.Entities.Add(tempQualifier4); + var tempQualifier5 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x1, -y2)); + session.Entities.Add(tempQualifier5); + var tempQualifier6 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y1)); + session.Entities.Add(tempQualifier6); + var tempQualifier7 = entityManager.SpawnEntity(GreenPiecePrototype, center.Offset(x2, -y2)); + session.Entities.Add(tempQualifier7); + + // Yellow pieces. + var tempQualifier8 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y1)); + session.Entities.Add(tempQualifier8); + var tempQualifier9 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x1, y2)); + session.Entities.Add(tempQualifier9); + var tempQualifier10 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y1)); + session.Entities.Add(tempQualifier10); + var tempQualifier11 = entityManager.SpawnEntity(YellowPiecePrototype, center.Offset(x2, y2)); + session.Entities.Add(tempQualifier11); + + // Blue pieces. + var tempQualifier12 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y1)); + session.Entities.Add(tempQualifier12); + var tempQualifier13 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x1, y2)); + session.Entities.Add(tempQualifier13); + var tempQualifier14 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y1)); + session.Entities.Add(tempQualifier14); + var tempQualifier15 = entityManager.SpawnEntity(BluePiecePrototype, center.Offset(-x2, y2)); + session.Entities.Add(tempQualifier15); + } + } +} diff --git a/Resources/Prototypes/Entities/Objects/Fun/Tabletop/conquest.yml b/Resources/Prototypes/Entities/Objects/Fun/Tabletop/conquest.yml new file mode 100644 index 00000000000..056ec143006 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Fun/Tabletop/conquest.yml @@ -0,0 +1,28 @@ +# A Null Sector Board Game +- type: entity + parent: BaseBoardEntity + id: ConquestBoard + name: conquest board + description: A fast, competitive war game centered around the tormentuous state of galactic politics. It's even Armadan-approved! + components: + - type: Sprite + sprite: Objects/Fun/Tabletop/conquest.rsi + state: board + - type: TabletopGame + boardName: tabletop-parchis-board-name + size: 574, 574 + setup: + !type:TabletopConquestSetup + boardPrototype: ConquestBoardTabletop + +# Conquest tabletop item (item only visible in tabletop game) +- type: entity + id: ConquestBoardTabletop + name: conquest + parent: BaseBoardTabletop + categories: [ HideSpawnMenu ] + components: + - type: Sprite + sprite: Objects/Fun/Tabletop/conquest_tabletop.rsi + state: board + diff --git a/Resources/Prototypes/Entities/Objects/Misc/books.yml b/Resources/Prototypes/Entities/Objects/Misc/books.yml index 8b8f48614ba..7d0bf105a9c 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/books.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/books.yml @@ -78,7 +78,7 @@ - type: GuideHelp openOnActivation: true guides: - - NF14 # Frontier: SS14 NullSectorIntro - type: MeleeWeapon # Should write it again since BaseGuidebook doesn't inherit BookBase soundHit: collection: Punch @@ -108,7 +108,7 @@ color: "#42b6f5" - type: GuideHelp guides: - - NF14 # Frontier: SS14 NullSectorIntro - type: entity id: BookTheBookOfControl diff --git a/Resources/Textures/Objects/Fun/Tabletop/conquest.rsi/board.png b/Resources/Textures/Objects/Fun/Tabletop/conquest.rsi/board.png new file mode 100644 index 00000000000..fd700bf97c0 Binary files /dev/null and b/Resources/Textures/Objects/Fun/Tabletop/conquest.rsi/board.png differ diff --git a/Resources/Textures/Objects/Fun/Tabletop/conquest.rsi/meta.json b/Resources/Textures/Objects/Fun/Tabletop/conquest.rsi/meta.json new file mode 100644 index 00000000000..35f979c5ddc --- /dev/null +++ b/Resources/Textures/Objects/Fun/Tabletop/conquest.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "LukeZurg22", + "size": { + "x": 18, + "y": 18 + }, + "states": [ + { + "name": "board" + } + ] +} diff --git a/Resources/Textures/Objects/Fun/Tabletop/conquest_tabletop.rsi/board.png b/Resources/Textures/Objects/Fun/Tabletop/conquest_tabletop.rsi/board.png new file mode 100644 index 00000000000..6668352995a Binary files /dev/null and b/Resources/Textures/Objects/Fun/Tabletop/conquest_tabletop.rsi/board.png differ diff --git a/Resources/Textures/Objects/Fun/Tabletop/conquest_tabletop.rsi/meta.json b/Resources/Textures/Objects/Fun/Tabletop/conquest_tabletop.rsi/meta.json new file mode 100644 index 00000000000..0a2dc758eda --- /dev/null +++ b/Resources/Textures/Objects/Fun/Tabletop/conquest_tabletop.rsi/meta.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "LukeZurg22", + "size": { + "x": 512, + "y": 512 + }, + "metaAtlas": false, + "states": [ + { + "name": "board" + } + ] +}