Browse Source

Finished Ship & ShipModel, Added Corp & Player

Steve Thielemann 7 months ago
parent
commit
46411bd634
3 changed files with 72 additions and 4 deletions
  1. 19 0
      corp.go
  2. 13 0
      player.go
  3. 40 4
      ship.go

+ 19 - 0
corp.go

@@ -0,0 +1,19 @@
+package main
+
+type Corperation struct {
+	ID ID
+	Name string
+	Tag string // Prefix to refer to this Corp
+	Description []string
+	MOTD []string
+	AlliesCorp []ID // Allied Corps
+	AlliesIndividual []ID // Allied Individual Players
+	AllowGood bool
+	AllowEvil bool
+	Leader ID
+	SeniorOfficers []ID
+	Officers []ID
+	Members []ID
+	Password string
+	RadioFrequency ID // Frequency to reserve for Corp (See RadioChannel)
+}

+ 13 - 0
player.go

@@ -0,0 +1,13 @@
+package main
+
+type Player struct {
+	ID ID
+	Name string
+	Password string
+	Corp ID
+	Radio ID // Frequency set too
+	Ship ID // Ship the Player is currently in
+	Credits uint64
+	CreditsBanked uint64
+	Location ID // Sector
+}

+ 40 - 4
ship.go

@@ -1,18 +1,35 @@
 package main
 
+type ComputerCombatMode uint8
+
+const (
+	CCM_Passive ComputerCombatMode = iota // The Ship will not do anything, even when attacked
+	CCM_Defend // The Ship will only attack once it has been attacked first
+	CCM_Attack // The Ship will attack on sight
+)
+
 type ShipModel struct {
 	ID ID
 	Name string
+	RequiredExperience uint64
+	RequiredAlignment int64 // Use negative for "Evil" and positive for "Good"
 	MaxFighters uint64
 	MaxShields uint64
+	FightersPerAttack uint64 // Limits number of fighters per attack command (though the player can always specify an amount)
+	HasComputerController bool
+	MaxHolds uint64
+	MaxGenUpgrades uint64
+	StartingHolds uint64
 	GenShieldAmount uint64
 	GenShieldTurns uint64
 	GenFighterAmount uint64
 	GenFighterTurns uint64
-	CanLand bool
-	AttackRatio float32
-	DefenseRatio float32
-	CanWarp bool
+	MaxHangers uint64
+	StartingHangers uint64
+	CanLand bool // Can land on planets
+	OrbitRatio float32 // ie. While in orbit of a planet increase fighter efficiency, 2.0 means 1:2, while 0.5 means 2:1
+	CanWarp bool // Can a Warp Drive be installed
+	WarpCost uint64 // Number of Ore used per Sector distance to Warp (Lower is more efficient)
 }
 
 type Ship struct {
@@ -21,8 +38,27 @@ type Ship struct {
 	CorpOwned bool
 	Model ID
 	Name string
+	ComputerControlled bool
+	CombatMode ComputerCombatMode
+	ComputedAttackAmount float32 // 1.0 for all fighters, 0.25 for 25%, etc.
+	LandedOn ID
+	InShip bool
+	Hangers uint64
 	Fighters uint64
 	Shields uint64
 	GenFighterTick uint64
 	GenShieldTick uint64
+	GenUpgrades uint64
+	GenUpFighterAmount uint64
+	GenUpFighterTurns uint64
+	GenUpShieldAmount uint64
+	GenUpShieldTurns uint64
+	Holds uint64
+	Ore uint64
+	Org uint64
+	Equ uint64
+	People uint64
+	Mines uint64
+	TrackerMines uint64
+	WarpDrive bool // Does this ship have a Warp Drive installed?
 }