From fd73f03aa56f9e255b06b824451d9c2a2103c918 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Thu, 2 Apr 2020 01:23:04 +0100 Subject: [PATCH] Initial outline of a Ship --- internal/ordoor/ordoor.go | 2 ++ internal/ordoor/ship.go | 70 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 internal/ordoor/ship.go diff --git a/internal/ordoor/ordoor.go b/internal/ordoor/ordoor.go index f7f3705..f7e1d5f 100644 --- a/internal/ordoor/ordoor.go +++ b/internal/ordoor/ordoor.go @@ -35,6 +35,8 @@ type Ordoor struct { music *audio.Player win *ui.Window + ship *Ship + state gameState nextState gameState diff --git a/internal/ordoor/ship.go b/internal/ordoor/ship.go new file mode 100644 index 0000000..d03e08e --- /dev/null +++ b/internal/ordoor/ship.go @@ -0,0 +1,70 @@ +package ordoor + +// Ship encapsulates campaign state, including current location in the campaign, +// marines and their stats, supplies, etc. +type Ship struct { + CurrentMission string + + Squads []*Squad + Captain *Character + Chaplain *Character + Apothecary *Character + Techmarines [2]*Character + Librarians [4]*Character +} + +type SquadType int +type CharacterType int + +const ( + SquadTypeTactical SquadType = 0 + SquadTypeTerminator SquadType = 1 + SquadTypeAssault SquadType = 2 + SquadTypeDevastator SquadType = 3 + + CharTypeMarine CharacterType = 0 + CharTypeCaptain CharacterType = 1 + CharTypeChaplain CharacterType = 2 + CharTypeApothecary CharacterType = 3 + CharTypeTechmarine CharacterType = 4 + CharTypeLibrarian CharacterType = 5 +) + +type Squad struct { + Type SquadType + + Characters []*Character +} + +type Character struct { + Name string + Type CharacterType + + Stats + Honours +} + +type Stats struct { + ActionPoints int + Health int + Armour int + BallisticSkill int + WeaponSkill int + Strength int + Toughness int + Initiative int + Attacks int + Leadership int + + MissionCount int + KillCount int + + Experience int +} + +type Honours struct { + Marksman bool + CruxTerminatus bool + PuritySeal bool + ImperialLaurel bool +}