ship.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package main
  2. type ComputerCombatMode uint8
  3. const (
  4. CCM_Passive ComputerCombatMode = iota // The Ship will not do anything, even when attacked
  5. CCM_Defend // The Ship will only attack once it has been attacked first
  6. CCM_Attack // The Ship will attack on sight
  7. )
  8. type ShipModel struct {
  9. ID ID
  10. Name string
  11. RequiredExperience uint64
  12. RequiredAlignment int64 // Use negative for "Evil" and positive for "Good"
  13. MaxFighters uint64
  14. MaxShields uint64
  15. FightersPerAttack uint64 // Limits number of fighters per attack command (though the player can always specify an amount)
  16. HasComputerController bool
  17. MaxHolds uint64
  18. MaxGenUpgrades uint64
  19. StartingHolds uint64
  20. GenShieldAmount uint64
  21. GenShieldTurns uint64
  22. GenFighterAmount uint64
  23. GenFighterTurns uint64
  24. MaxHangers uint64
  25. StartingHangers uint64
  26. CanLand bool // Can land on planets
  27. OrbitRatio float32 // ie. While in orbit of a planet increase fighter efficiency, 2.0 means 1:2, while 0.5 means 2:1
  28. CanWarp bool // Can a Warp Drive be installed
  29. WarpCost uint64 // Number of Ore used per Sector distance to Warp (Lower is more efficient)
  30. }
  31. type Ship struct {
  32. ID ID
  33. Owner ID
  34. CorpOwned bool
  35. Model ID
  36. Name string
  37. ComputerControlled bool
  38. CombatMode ComputerCombatMode
  39. ComputedAttackAmount float32 // 1.0 for all fighters, 0.25 for 25%, etc.
  40. LandedOn ID
  41. InShip bool
  42. Hangers uint64
  43. Fighters uint64
  44. Shields uint64
  45. GenFighterTick uint64
  46. GenShieldTick uint64
  47. GenUpgrades uint64
  48. GenUpFighterAmount uint64
  49. GenUpFighterTurns uint64
  50. GenUpShieldAmount uint64
  51. GenUpShieldTurns uint64
  52. Holds uint64
  53. Ore uint64
  54. Org uint64
  55. Equ uint64
  56. People uint64
  57. Mines uint64
  58. TrackerMines uint64
  59. WarpDrive bool // Does this ship have a Warp Drive installed?
  60. }