cs

package
v0.0.0-...-904e6d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WaypointTaskNone           = ""
	WaypointTaskTransport      = "Transport"
	WaypointTaskColonize       = "Colonize"
	WaypointTaskRemoteMining   = "RemoteMining"
	WaypointTaskMergeWithFleet = "MergeWithFleet"
	WaypointTaskScrapFleet     = "ScrapFleet"
	WaypointTaskLayMineField   = "LayMineField"
	WaypointTaskPatrol         = "Patrol"
	WaypointTaskRoute          = "Route"
	WaypointTaskTransferFleet  = "TransferFleet"
)
View Source
const (
	HullSlotTypeNone                = 0
	HullSlotTypeEngine HullSlotType = 1 << iota
	HullSlotTypeScanner
	HullSlotTypeMechanical
	HullSlotTypeBomb
	HullSlotTypeMining
	HullSlotTypeElectrical
	HullSlotTypeShield
	HullSlotTypeArmor
	HullSlotTypeCargo
	HullSlotTypeSpaceDock
	HullSlotTypeWeapon
	HullSlotTypeOrbital
	HullSlotTypeMineLayer

	HullSlotTypeOrbitalElectrical                = HullSlotTypeOrbital | HullSlotTypeElectrical
	HullSlotTypeShieldElectricalMechanical       = HullSlotTypeShield | HullSlotTypeElectrical | HullSlotTypeMechanical
	HullSlotTypeScannerElectricalMechanical      = HullSlotTypeScanner | HullSlotTypeElectrical | HullSlotTypeMechanical
	HullSlotTypeArmorScannerElectricalMechanical = HullSlotTypeArmor | HullSlotTypeScanner | HullSlotTypeElectrical | HullSlotTypeMechanical
	HullSlotTypeMineElectricalMechanical         = HullSlotTypeMineLayer | HullSlotTypeElectrical | HullSlotTypeMechanical
	HullSlotTypeShieldArmor                      = HullSlotTypeShield | HullSlotTypeArmor
	HullSlotTypeWeaponShield                     = HullSlotTypeShield | HullSlotTypeWeapon
	HullSlotTypeGeneral                          = HullSlotTypeScanner | HullSlotTypeMechanical | HullSlotTypeElectrical | HullSlotTypeShield | HullSlotTypeArmor | HullSlotTypeWeapon | HullSlotTypeMineLayer
)
View Source
const Indefinite = 0

time period to perform a task, like patrol

View Source
const Infinite = -1
View Source
const InfiniteGate = math.MaxInt32
View Source
const NoGate = -1
View Source
const NoScanner = -1
View Source
const None = 0

no target planet, player, etc

View Source
const PatrolRangeInfinite = 0

target fleets in any range when patrolling

View Source
const PatrolWarpSpeedAutomatic = 0

use automatic warp speed for patrols

View Source
const ReportAgeUnexplored = -1
View Source
const ScanWithZeroRange = 1
View Source
const StargateWarpSpeed = 11

warpspeed for using a stargate vs moving with warp drive

View Source
const (
	TagPurpose = "purpose"
)
View Source
const Unlimited = -1
View Source
const UnlimitedSpaceDock = -1
View Source
const Unowned = 0

Variables

View Source
var (
	ErrInvalidHash         = errors.New("the encoded hash is not in the correct format")
	ErrIncompatibleVersion = errors.New("incompatible version of argon2")
)
View Source
var AINames = []string{
	"American",
	"Berserker",
	"Bulushi",
	"Crusher",
	"Ferret",
	"Golem",
	"Hawk",
	"Hicardi",
	"Hooveron",
	"House Cat",
	"Kurkonian",
	"Loraxoid",
	"Mensoid",
	"Nairnian",
	"Nee",
	"Rush",
	"Tritizoid",
	"Ubert",
}
View Source
var AlphaDrive8 = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Alpha Drive 8", NewCost(16, 0, 3, 28), TechRequirements{TechLevel: TechLevel{Propulsion: 7}}, 60, TechCategoryEngine), Mass: 17, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   8,
		FreeSpeed:    1,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			15,
			50,
			60,
			70,
			100,
			100,
			115,
			700,
			840,
		},
	},
}
View Source
var AlphaTorpedo = TechHullComponent{Tech: NewTech("Alpha Torpedo", NewCost(8, 3, 3, 4), TechRequirements{TechLevel: TechLevel{}}, 0, TechCategoryTorpedo),

	Mass:         25,
	Initiative:   0,
	Accuracy:     35,
	Power:        5,
	HullSlotType: HullSlotTypeWeapon,
	Range:        4,
}
View Source
var AnnihilatorBomb = TechHullComponent{Tech: NewTech("Annihilator Bomb", NewCost(1, 30, 0, 28), TechRequirements{TechLevel: TechLevel{Weapons: 26, Biotechnology: 17}}, 140, TechCategoryBomb),

	Mass:         50,
	Smart:        true,
	KillRate:     7.0,
	HullSlotType: HullSlotTypeBomb,
}
View Source
var AntiMatterGenerator = TechHullComponent{Tech: NewTech("Anti-Matter Generator", NewCost(8, 3, 3, 10), TechRequirements{TechLevel: TechLevel{Weapons: 12, Biotechnology: 7}, PRTRequired: IT}, 150, TechCategoryElectrical),

	Mass:           10,
	FuelGeneration: 50,
	FuelBonus:      200,
	HullSlotType:   HullSlotTypeElectrical,
}
View Source
var AntiMatterPulverizer = TechHullComponent{Tech: NewTech("Anti-Matter Pulverizer", NewCost(0, 22, 0, 27), TechRequirements{TechLevel: TechLevel{Weapons: 26}}, 220, TechCategoryBeamWeapon),

	Mass:         1,
	Initiative:   8,
	Power:        433,
	HullSlotType: HullSlotTypeWeapon,
	Range:        2,
}
View Source
var ArmageddonMissile = TechHullComponent{Tech: NewTech("Armageddon Missile", NewCost(67, 23, 16, 24), TechRequirements{TechLevel: TechLevel{Weapons: 24, Propulsion: 10}}, 100, TechCategoryTorpedo),

	Mass:               35,
	Initiative:         3,
	Accuracy:           30,
	CapitalShipMissile: true,
	Power:              525,
	HullSlotType:       HullSlotTypeWeapon,
	Range:              6,
}
View Source
var B17Bomber = TechHull{Tech: NewTech("B-17 Bomber", NewCost(55, 10, 10, 150), TechRequirements{TechLevel: TechLevel{Construction: 6}}, 180, TechCategoryShipHull),
	Type:         TechHullTypeBomber,
	Mass:         69,
	Armor:        175,
	FuelCapacity: 400,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{-0.5, 0}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
	},
}
View Source
var B52Bomber = TechHull{Tech: NewTech("B-52 Bomber", NewCost(90, 15, 10, 280), TechRequirements{TechLevel: TechLevel{Construction: 15}}, 200, TechCategoryShipHull),
	Type:         TechHullTypeBomber,
	FuelCapacity: 750,
	Armor:        450,
	Mass:         110,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{-0.5, -1}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{-0.5, 1}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{0.5, -0.5}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{0.5, 0.5}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 2},
		{Position: Vector{-0.5, 0}, Type: HullSlotTypeShield, Capacity: 2},
	},
}
View Source
var BatScanner = TechHullComponent{Tech: NewTech("Bat Scanner", NewCost(1, 0, 1, 1), TechRequirements{TechLevel: TechLevel{}}, 10, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         2,
	ScanRange:    ScanWithZeroRange,
}
View Source
var BattleComputer = TechHullComponent{Tech: NewTech("Battle Computer", NewCost(0, 0, 13, 5), TechRequirements{TechLevel: TechLevel{}}, 40, TechCategoryElectrical),

	Mass:            1,
	InitiativeBonus: 1,
	TorpedoBonus:    .2,
	HullSlotType:    HullSlotTypeElectrical,
}
View Source
var BattleCruiser = TechHull{Tech: NewTech("Battle Cruiser", NewCost(55, 8, 12, 120), TechRequirements{TechLevel: TechLevel{Construction: 9}, PRTRequired: WM}, 90, TechCategoryShipHull),
	Type:         TechHullTypeFighter,
	Mass:         120,
	Armor:        1000,
	Initiative:   5,
	FuelCapacity: 1400,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{-0.5, -0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 2},
		{Position: Vector{-0.5, 0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 2},
		{Position: Vector{0.5, -1}, Type: HullSlotTypeWeapon, Capacity: 3},
		{Position: Vector{0.5, 1}, Type: HullSlotTypeWeapon, Capacity: 3},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeShieldArmor, Capacity: 4},
	},
}
View Source
var BattleNexus = TechHullComponent{Tech: NewTech("Battle Nexus", NewCost(0, 0, 30, 15), TechRequirements{TechLevel: TechLevel{Energy: 10, Electronics: 19}}, 60, TechCategoryElectrical),

	Mass:            1,
	InitiativeBonus: 3,
	TorpedoBonus:    .5,
	HullSlotType:    HullSlotTypeElectrical,
}
View Source
var BattleSuperComputer = TechHullComponent{Tech: NewTech("Battle Super Computer", NewCost(0, 0, 25, 14), TechRequirements{TechLevel: TechLevel{Energy: 5, Electronics: 11}}, 50, TechCategoryElectrical),

	Mass:            1,
	InitiativeBonus: 2,
	TorpedoBonus:    .3,
	HullSlotType:    HullSlotTypeElectrical,
}
View Source
var Battleship = TechHull{Tech: NewTech("Battleship", NewCost(120, 25, 20, 225), TechRequirements{TechLevel: TechLevel{Construction: 13}}, 100, TechCategoryShipHull),
	Type:         TechHullTypeFighter,
	Mass:         222,
	Armor:        2000,
	Initiative:   10,
	FuelCapacity: 2800,
	Slots: []TechHullSlot{
		{Position: Vector{-2, 0}, Type: HullSlotTypeEngine, Capacity: 4, Required: true},
		{Position: Vector{2, 0}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{1, -0.5}, Type: HullSlotTypeShield, Capacity: 8},
		{Position: Vector{0, -1}, Type: HullSlotTypeWeapon, Capacity: 6},
		{Position: Vector{0, 1}, Type: HullSlotTypeWeapon, Capacity: 6},
		{Position: Vector{-1, -1.5}, Type: HullSlotTypeWeapon, Capacity: 2},
		{Position: Vector{-1, 1.5}, Type: HullSlotTypeWeapon, Capacity: 2},
		{Position: Vector{1, 0.5}, Type: HullSlotTypeWeapon, Capacity: 4},
		{Position: Vector{0, 0}, Type: HullSlotTypeArmor, Capacity: 6},
		{Position: Vector{-1, -0.5}, Type: HullSlotTypeElectrical, Capacity: 3},
		{Position: Vector{-1, 0.5}, Type: HullSlotTypeElectrical, Capacity: 3},
	},
}
View Source
var BeamDeflector = TechHullComponent{Tech: NewTech("Beam Deflector", NewCost(0, 0, 10, 8), TechRequirements{TechLevel: TechLevel{Energy: 6, Weapons: 6, Construction: 6, Electronics: 6}}, 80, TechCategoryMechanical),

	Mass:         1,
	HullSlotType: HullSlotTypeMechanical,
	BeamDefense:  .1,
}
View Source
var BearNeutrinoBarrier = TechHullComponent{Tech: NewTech("Bear Neutrino Barrier", NewCost(4, 0, 4, 8), TechRequirements{TechLevel: TechLevel{Energy: 10}}, 60, TechCategoryShield),

	Mass:         1,
	Shield:       100,
	HullSlotType: HullSlotTypeShield,
}
View Source
var BetaTorpedo = TechHullComponent{Tech: NewTech("Beta Torpedo", NewCost(18, 6, 4, 6), TechRequirements{TechLevel: TechLevel{Weapons: 5, Propulsion: 1}}, 10, TechCategoryTorpedo),

	Mass:         25,
	Initiative:   1,
	Accuracy:     45,
	Power:        12,
	HullSlotType: HullSlotTypeWeapon,
	Range:        4,
}
View Source
var BigMuthaCannon = TechHullComponent{Tech: NewTech("Big Mutha Cannon", NewCost(0, 36, 0, 23), TechRequirements{TechLevel: TechLevel{Weapons: 23}}, 200, TechCategoryBeamWeapon),

	Mass:           3,
	Initiative:     13,
	Gattling:       true,
	Power:          204,
	HitsAllTargets: true,
	HullSlotType:   HullSlotTypeWeapon,
	Range:          2,
}
View Source
var BlackCatBomb = TechHullComponent{Tech: NewTech("Black Cat Bomb", NewCost(1, 22, 0, 7), TechRequirements{TechLevel: TechLevel{Weapons: 5}}, 10, TechCategoryBomb),

	Mass:                 45,
	MinKillRate:          300,
	StructureDestroyRate: .4,
	KillRate:             .9,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var Blackjack = TechHullComponent{Tech: NewTech("Blackjack", NewCost(0, 16, 0, 7), TechRequirements{TechLevel: TechLevel{Weapons: 7}}, 40, TechCategoryBeamWeapon),

	Mass:         10,
	Initiative:   10,
	Power:        90,
	HullSlotType: HullSlotTypeWeapon,

	Range: 0,
}
View Source
var Bludgeon = TechHullComponent{Tech: NewTech("Bludgeon", NewCost(0, 22, 0, 9), TechRequirements{TechLevel: TechLevel{Weapons: 13}}, 100, TechCategoryBeamWeapon),

	Mass:         10,
	Initiative:   10,
	Power:        231,
	HullSlotType: HullSlotTypeWeapon,
	Range:        0,
}
View Source
var Blunderbuss = TechHullComponent{Tech: NewTech("Blunderbuss", NewCost(0, 30, 0, 13), TechRequirements{TechLevel: TechLevel{Weapons: 19}, PRTRequired: WM}, 160, TechCategoryBeamWeapon),

	Mass:         10,
	Initiative:   11,
	Power:        592,
	HullSlotType: HullSlotTypeWeapon,
	Range:        0,
}
View Source
var Carbonic = TechHullComponent{Tech: NewTech("Carbonic Armor", NewCost(5, 0, 0, 15), TechRequirements{TechLevel: TechLevel{Biotechnology: 4}}, 30, TechCategoryArmor),

	Mass:         25,
	Armor:        100,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var CargoPod = TechHullComponent{Tech: NewTech("Cargo Pod", NewCost(5, 0, 2, 10), TechRequirements{TechLevel: TechLevel{Construction: 3}}, 20, TechCategoryMechanical),

	Mass:         5,
	CargoBonus:   50,
	HullSlotType: HullSlotTypeMechanical,
}
View Source
var ChameleonScanner = TechHullComponent{Tech: NewTech("Chameleon Scanner", NewCost(4, 6, 4, 25), TechRequirements{TechLevel: TechLevel{Energy: 3, Electronics: 6}, PRTRequired: SS}, 70, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         6,
	ScanRange:    160,
	CloakUnits:   40,
	ScanRangePen: 45,
}
View Source
var CheetahScanner = TechHullComponent{Tech: NewTech("Cheetah Scanner", NewCost(3, 1, 13, 50), TechRequirements{TechLevel: TechLevel{Energy: 5, Electronics: 11}}, 120, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         4,
	ScanRange:    275,
}
View Source
var CherryBomb = TechHullComponent{Tech: NewTech("Cherry Bomb", NewCost(1, 25, 0, 11), TechRequirements{TechLevel: TechLevel{Weapons: 14}}, 40, TechCategoryBomb),

	Mass:                 52,
	MinKillRate:          300,
	StructureDestroyRate: 1.0,
	KillRate:             2.5,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var ColloidalPhaser = TechHullComponent{Tech: NewTech("Colloidal Phaser", NewCost(0, 14, 0, 18), TechRequirements{TechLevel: TechLevel{Weapons: 10}}, 70, TechCategoryBeamWeapon),

	Mass:         2,
	Initiative:   5,
	Power:        26,
	HullSlotType: HullSlotTypeWeapon,

	Range: 3,
}
View Source
var ColonizationModule = TechHullComponent{Tech: NewTech("Colonization Module", NewCost(11, 9, 9, 9), TechRequirements{TechLevel: TechLevel{}, PRTDenied: AR}, 0, TechCategoryMechanical),

	Mass:               32,
	ColonizationModule: true,
	HullSlotType:       HullSlotTypeMechanical,
}
View Source
var ColonyShip = TechHull{Tech: NewTech("Colony Ship", NewCost(9, 0, 13, 18), TechRequirements{TechLevel: TechLevel{}}, 160, TechCategoryShipHull),
	Type:              TechHullTypeColonizer,
	Mass:              20,
	Armor:             20,
	FuelCapacity:      200,
	CargoCapacity:     25,
	CargoSlotPosition: Vector{0, 0},
	CargoSlotSize:     Vector{1, 1},
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{1, 0}, Type: HullSlotTypeMechanical, Capacity: 1},
	},
}
View Source
var CompletePhaseShield = TechHullComponent{Tech: NewTech("Complete Phase Shield", NewCost(12, 0, 15, 20), TechRequirements{TechLevel: TechLevel{Energy: 22}}, 90, TechCategoryShield),

	Mass:         1,
	Shield:       500,
	HullSlotType: HullSlotTypeShield,
}
View Source
var CowHideShield = TechHullComponent{Tech: NewTech("Cow-hide Shield", NewCost(2, 0, 2, 5), TechRequirements{TechLevel: TechLevel{Energy: 3}}, 20, TechCategoryShield),

	Mass:         1,
	Shield:       40,
	HullSlotType: HullSlotTypeShield,
}
View Source
var Crobmnium = TechHullComponent{Tech: NewTech("Crobmnium", NewCost(6, 0, 0, 13), TechRequirements{TechLevel: TechLevel{Construction: 3}}, 20, TechCategoryArmor),

	Mass:         56,
	Armor:        75,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var CrobySharmor = TechHullComponent{Tech: NewTech("Croby Sharmor", NewCost(7, 0, 4, 15), TechRequirements{TechLevel: TechLevel{Energy: 7, Construction: 4}, PRTRequired: IS}, 40, TechCategoryShield),

	Mass:         10,
	Shield:       60,
	Armor:        65,
	HullSlotType: HullSlotTypeShield,
}
View Source
var Cruiser = TechHull{Tech: NewTech("Cruiser", NewCost(40, 5, 8, 85), TechRequirements{TechLevel: TechLevel{Construction: 9}}, 80, TechCategoryShipHull),
	Type:         TechHullTypeFighter,
	Mass:         90,
	Armor:        700,
	Initiative:   5,
	FuelCapacity: 600,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{-0.5, -0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{-0.5, 0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{0.5, -1}, Type: HullSlotTypeWeapon, Capacity: 2},
		{Position: Vector{0.5, 1}, Type: HullSlotTypeWeapon, Capacity: 2},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeGeneral, Capacity: 2},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeShieldArmor, Capacity: 2},
	},
}
View Source
var DNAScanner = TechHullComponent{Tech: NewTech("DNA Scanner", NewCost(1, 1, 1, 5), TechRequirements{TechLevel: TechLevel{Propulsion: 3, Biotechnology: 6}}, 40, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         2,
	ScanRange:    125,
}
View Source
var DaddyLongLegs7 = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Daddy Long Legs 7", NewCost(11, 0, 3, 12), TechRequirements{TechLevel: TechLevel{Propulsion: 5}}, 50, TechCategoryEngine), Mass: 13, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   7,
		FreeSpeed:    1,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			20,
			60,
			70,
			100,
			100,
			110,
			600,
			750,
			900,
		},
	},
}
View Source
var DeathStar = TechHull{Tech: NewTech("Death Star", NewCost(120, 80, 350, 750), TechRequirements{TechLevel: TechLevel{Construction: 17}, PRTRequired: AR}, 50, TechCategoryStarbaseHull),
	Type:                     TechHullTypeStarbase,
	SpaceDock:                UnlimitedSpaceDock,
	SpaceDockSlotPosition:    Vector{0, 0},
	SpaceDockSlotSize:        Vector{1, 1},
	Armor:                    1500,
	Initiative:               18,
	Starbase:                 true,
	RepairBonus:              .15,
	InnateScanRangePenFactor: .5,
	MaxPopulation:            3_000_000,
	Slots: []TechHullSlot{
		{Position: Vector{0, -1.5}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{-2, 1}, Type: HullSlotTypeWeapon, Capacity: 32},
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{2, 1}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{-1, 1}, Type: HullSlotTypeShield, Capacity: 20},
		{Position: Vector{1, -1}, Type: HullSlotTypeShield, Capacity: 20},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{-1, -2}, Type: HullSlotTypeWeapon, Capacity: 32},
		{Position: Vector{-1, 2}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{2, -1}, Type: HullSlotTypeWeapon, Capacity: 32},
		{Position: Vector{0, 1.4125}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{1, 1}, Type: HullSlotTypeShieldArmor, Capacity: 20},
		{Position: Vector{-2, -1}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{-1, -1}, Type: HullSlotTypeShieldArmor, Capacity: 20},
		{Position: Vector{1, -2}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{1, 2}, Type: HullSlotTypeWeapon, Capacity: 32},
	},
}
View Source
var DeltaTorpedo = TechHullComponent{Tech: NewTech("Delta Torpedo", NewCost(22, 8, 5, 8), TechRequirements{TechLevel: TechLevel{Weapons: 10, Propulsion: 2}}, 20, TechCategoryTorpedo),

	Mass:         25,
	Initiative:   1,
	Accuracy:     60,
	Power:        26,
	HullSlotType: HullSlotTypeWeapon,
	Range:        4,
}
View Source
var DepletedNeutronium = TechHullComponent{Tech: NewTech("Depleted Neutronium", NewCost(10, 0, 2, 28), TechRequirements{TechLevel: TechLevel{Construction: 10, Electronics: 3}, PRTRequired: SS}, 80, TechCategoryArmor),

	Mass:         50,
	Armor:        200,
	CloakUnits:   50,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var Destroyer = TechHull{Tech: NewTech("Destroyer", NewCost(15, 3, 5, 35), TechRequirements{TechLevel: TechLevel{Construction: 3}}, 70, TechCategoryShipHull),
	Type:           TechHullTypeFighter,
	Mass:           30,
	BuiltInScanner: true,
	Armor:          200,
	Initiative:     3,
	FuelCapacity:   280,
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{0.5, -1.5}, Type: HullSlotTypeWeapon, Capacity: 1},
		{Position: Vector{0.5, 1.5}, Type: HullSlotTypeWeapon, Capacity: 1},
		{Position: Vector{1, 0}, Type: HullSlotTypeGeneral, Capacity: 1},
		{Position: Vector{0, 0}, Type: HullSlotTypeArmor, Capacity: 2},
		{Position: Vector{-0.5, -1}, Type: HullSlotTypeMechanical, Capacity: 1},
		{Position: Vector{-0.5, 1}, Type: HullSlotTypeElectrical, Capacity: 1},
	},
}
View Source
var Disruptor = TechHullComponent{Tech: NewTech("Disruptor", NewCost(0, 16, 0, 20), TechRequirements{TechLevel: TechLevel{Weapons: 20}}, 170, TechCategoryBeamWeapon),

	Mass:         2,
	Initiative:   8,
	Power:        169,
	HullSlotType: HullSlotTypeWeapon,
	Range:        2,
}
View Source
var DolphinScanner = TechHullComponent{Tech: NewTech("Dolphin Scanner", NewCost(5, 5, 10, 40), TechRequirements{TechLevel: TechLevel{Energy: 5, Electronics: 10, Biotechnology: 4}, LRTsDenied: NAS}, 90, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         4,
	ScanRange:    220,
	ScanRangePen: 100,
}
View Source
var DoomsdayMissile = TechHullComponent{Tech: NewTech("Doomsday Missile", NewCost(60, 20, 13, 20), TechRequirements{TechLevel: TechLevel{Weapons: 20, Propulsion: 10}}, 90, TechCategoryTorpedo),

	Mass:               35,
	Initiative:         2,
	Accuracy:           25,
	CapitalShipMissile: true,
	Power:              280,
	HullSlotType:       HullSlotTypeWeapon,
	Range:              6,
}
View Source
var Dreadnought = TechHull{Tech: NewTech("Dreadnought", NewCost(140, 30, 25, 275), TechRequirements{TechLevel: TechLevel{Construction: 16}, PRTRequired: WM}, 110, TechCategoryShipHull),
	Type:         TechHullTypeFighter,
	Mass:         250,
	Armor:        4500,
	Initiative:   10,
	FuelCapacity: 4500,
	Slots: []TechHullSlot{
		{Position: Vector{-2, 0}, Type: HullSlotTypeEngine, Capacity: 5, Required: true},
		{Position: Vector{-2, -0.975}, Type: HullSlotTypeShieldArmor, Capacity: 4},
		{Position: Vector{-2, 0.975}, Type: HullSlotTypeShieldArmor, Capacity: 4},
		{Position: Vector{-1, -1.5}, Type: HullSlotTypeWeapon, Capacity: 6},
		{Position: Vector{-1, 1.5}, Type: HullSlotTypeWeapon, Capacity: 6},
		{Position: Vector{-1, -0.5}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{-1, 0.5}, Type: HullSlotTypeElectrical, Capacity: 4},
		{Position: Vector{0, -1}, Type: HullSlotTypeWeapon, Capacity: 8},
		{Position: Vector{0, 1}, Type: HullSlotTypeWeapon, Capacity: 8},
		{Position: Vector{0, 0}, Type: HullSlotTypeArmor, Capacity: 8},
		{Position: Vector{1, -0.5}, Type: HullSlotTypeWeaponShield, Capacity: 5},
		{Position: Vector{1, 0.5}, Type: HullSlotTypeWeaponShield, Capacity: 5},
		{Position: Vector{2, 0}, Type: HullSlotTypeGeneral, Capacity: 2},
	},
}
View Source
var EagleEyeScanner = TechHullComponent{Tech: NewTech("Eagle Eye Scanner", NewCost(3, 2, 21, 64), TechRequirements{TechLevel: TechLevel{Energy: 6, Electronics: 14}}, 140, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         3,
	ScanRange:    335,
}
View Source
var ElephantHideFortress = TechHullComponent{Tech: NewTech("Elephant Hide Fortress", NewCost(8, 0, 10, 15), TechRequirements{TechLevel: TechLevel{Energy: 18}}, 80, TechCategoryShield),

	Mass:         1,
	Shield:       300,
	HullSlotType: HullSlotTypeShield,
}
View Source
var ElephantScanner = TechHullComponent{Tech: NewTech("Elephant Scanner", NewCost(8, 5, 14, 70), TechRequirements{TechLevel: TechLevel{Energy: 6, Electronics: 16, Biotechnology: 7}, LRTsDenied: NAS}, 130, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         6,
	ScanRange:    300,
	ScanRangePen: 200,
}
View Source
var EnergyCapacitor = TechHullComponent{Tech: NewTech("Energy Capacitor", NewCost(0, 0, 8, 5), TechRequirements{TechLevel: TechLevel{Energy: 7, Electronics: 4}}, 110, TechCategoryElectrical),

	Mass:         1,
	BeamBonus:    .1,
	HullSlotType: HullSlotTypeElectrical,
}
View Source
var EnergyDampener = TechHullComponent{Tech: NewTech("Energy Dampener", NewCost(5, 10, 0, 50), TechRequirements{TechLevel: TechLevel{Energy: 14, Propulsion: 8}, PRTRequired: SD}, 130, TechCategoryElectrical),

	Mass:           2,
	ReduceMovement: 4,
	HullSlotType:   HullSlotTypeElectrical,
}
View Source
var EnrichedNeutronBomb = TechHullComponent{Tech: NewTech("Enriched Neutron Bomb", NewCost(1, 36, 0, 25), TechRequirements{TechLevel: TechLevel{Weapons: 15, Biotechnology: 12}}, 120, TechCategoryBomb),

	Mass:         64,
	Smart:        true,
	KillRate:     3.5,
	HullSlotType: HullSlotTypeBomb,
}
View Source
var EpsilonTorpedo = TechHullComponent{Tech: NewTech("Epsilon Torpedo", NewCost(30, 10, 6, 10), TechRequirements{TechLevel: TechLevel{Weapons: 14, Propulsion: 3}}, 30, TechCategoryTorpedo),

	Mass:         25,
	Initiative:   2,
	Accuracy:     65,
	Power:        48,
	HullSlotType: HullSlotTypeWeapon,
	Range:        5,
}
View Source
var FerretScanner = TechHullComponent{Tech: NewTech("Ferret Scanner", NewCost(2, 0, 8, 36), TechRequirements{TechLevel: TechLevel{Energy: 3, Electronics: 7, Biotechnology: 2}, LRTsDenied: NAS}, 80, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,

	Mass:         6,
	ScanRange:    185,
	ScanRangePen: 50,
}
View Source
var FieldedKelarium = TechHullComponent{Tech: NewTech("Fielded Kelarium", NewCost(10, 0, 2, 28), TechRequirements{TechLevel: TechLevel{Energy: 4, Construction: 10}, PRTRequired: IS}, 70, TechCategoryArmor),

	Mass:         50,
	Shield:       50,
	Armor:        175,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var FluxCapacitor = TechHullComponent{Tech: NewTech("Flux Capacitor", NewCost(0, 0, 8, 5), TechRequirements{TechLevel: TechLevel{Energy: 14, Electronics: 8}, PRTRequired: HE}, 120, TechCategoryElectrical),

	Mass:         1,
	BeamBonus:    .2,
	HullSlotType: HullSlotTypeElectrical,
}
View Source
var Frigate = TechHull{Tech: NewTech("Frigate", NewCost(4, 2, 5, 12), TechRequirements{TechLevel: TechLevel{Construction: 6}}, 60, TechCategoryShipHull),
	Type:           TechHullTypeFighter,
	Mass:           8,
	BuiltInScanner: true,
	Armor:          45,
	Initiative:     4,
	FuelCapacity:   125,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeScanner, Capacity: 1},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{-0.5, 0}, Type: HullSlotTypeShieldArmor, Capacity: 2},
	},
}
View Source
var FuelMizer = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Fuel Mizer", NewCost(8, 0, 0, 11), TechRequirements{TechLevel: TechLevel{Propulsion: 2}, LRTsRequired: IFE}, 30, TechCategoryEngine), Mass: 6, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   6,
		FreeSpeed:    4,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			35,
			120,
			175,
			235,
			360,
			420,
		},
	},
}
View Source
var FuelTank = TechHullComponent{Tech: NewTech("Fuel Tank", NewCost(5, 0, 0, 4), TechRequirements{TechLevel: TechLevel{}}, 40, TechCategoryMechanical),

	Mass:         3,
	FuelBonus:    250,
	HullSlotType: HullSlotTypeMechanical,
}
View Source
var FuelTransport = TechHull{Tech: NewTech("Fuel Transport", NewCost(10, 0, 5, 50), TechRequirements{TechLevel: TechLevel{Construction: 4}, PRTRequired: IS}, 260, TechCategoryShipHull),
	Type:           TechHullTypeFuelTransport,
	Mass:           12,
	Armor:          5,
	FuelCapacity:   750,
	FuelGeneration: 200,
	RepairBonus:    .05,
	Slots: []TechHullSlot{
		{Position: Vector{-0.5, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeShield, Capacity: 1},
	},
}
View Source
var GalaxyScoop = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Galaxy Scoop", NewCost(4, 2, 9, 12), TechRequirements{TechLevel: TechLevel{Energy: 5, Propulsion: 20}, LRTsRequired: IFE, LRTsDenied: NRSE}, 150, TechCategoryEngine), Mass: 8, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   10,
		FreeSpeed:    9,
		MaxSafeSpeed: 10,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			60,
		},
	},
}
View Source
var Galleon = TechHull{Tech: NewTech("Galleon", NewCost(70, 5, 5, 105), TechRequirements{TechLevel: TechLevel{Construction: 11}}, 140, TechCategoryShipHull),
	Type:              TechHullTypeMultiPurposeFreighter,
	Mass:              125,
	Armor:             900,
	Initiative:        4,
	FuelCapacity:      2500,
	CargoCapacity:     1000,
	CargoSlotPosition: Vector{-1, -0.5},
	CargoSlotSize:     Vector{2, 2},
	Slots: []TechHullSlot{
		{Position: Vector{-2, 0}, Type: HullSlotTypeEngine, Capacity: 4, Required: true},
		{Position: Vector{-0.5, -1.5}, Type: HullSlotTypeShieldArmor, Capacity: 2},
		{Position: Vector{-0.5, 1.5}, Type: HullSlotTypeShieldArmor, Capacity: 2},
		{Position: Vector{0.5, -1.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{0.5, 1.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{1, -0.5}, Type: HullSlotTypeMineElectricalMechanical, Capacity: 2},
		{Position: Vector{1, 0.5}, Type: HullSlotTypeMineElectricalMechanical, Capacity: 2},
		{Position: Vector{2, 0}, Type: HullSlotTypeScanner, Capacity: 2},
	},
}
View Source
var GatlingGun = TechHullComponent{Tech: NewTech("Gatling Gun", NewCost(0, 20, 0, 13), TechRequirements{TechLevel: TechLevel{Weapons: 11}}, 80, TechCategoryBeamWeapon),

	Mass:           3,
	Initiative:     12,
	Gattling:       true,
	Power:          31,
	HitsAllTargets: true,
	HullSlotType:   HullSlotTypeWeapon,
	Range:          2,
}
View Source
var GatlingNeutrinoCannon = TechHullComponent{Tech: NewTech("Gatling Neutrino Cannon", NewCost(0, 28, 0, 17), TechRequirements{TechLevel: TechLevel{Weapons: 17}, PRTRequired: WM}, 140, TechCategoryBeamWeapon),

	Mass:           3,
	Initiative:     13,
	Gattling:       true,
	Power:          80,
	HitsAllTargets: true,
	HullSlotType:   HullSlotTypeWeapon,
	Range:          2,
}
View Source
var GazelleScanner = TechHullComponent{Tech: NewTech("Gazelle Scanner", NewCost(4, 0, 5, 24), TechRequirements{TechLevel: TechLevel{Energy: 4, Electronics: 8}}, 100, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         5,
	ScanRange:    225,
}
View Source
var GorillaDelagator = TechHullComponent{Tech: NewTech("Gorilla Delagator", NewCost(5, 0, 6, 11), TechRequirements{TechLevel: TechLevel{Energy: 14}}, 70, TechCategoryShield),

	Mass:         1,
	Shield:       175,
	HullSlotType: HullSlotTypeShield,
}
View Source
var GravityTerraform11 = TechTerraform{Tech: NewTech("Gravity Terraform ±11", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Propulsion: 10, Biotechnology: 3}}, 100, TechCategoryTerraforming),
	Ability: 11,
	HabType: TerraformHabTypeGrav,
}
View Source
var GravityTerraform15 = TechTerraform{Tech: NewTech("Gravity Terraform ±15", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Propulsion: 16, Biotechnology: 4}}, 110, TechCategoryTerraforming),
	Ability: 15,
	HabType: TerraformHabTypeGrav,
}
View Source
var GravityTerraform3 = TechTerraform{Tech: NewTech("Gravity Terraform ±3", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Propulsion: 1, Biotechnology: 1}}, 80, TechCategoryTerraforming),
	Ability: 3,
	HabType: TerraformHabTypeGrav,
}
View Source
var GravityTerraform7 = TechTerraform{Tech: NewTech("Gravity Terraform ±7", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Propulsion: 5, Biotechnology: 2}}, 90, TechCategoryTerraforming),
	Ability: 7,
	HabType: TerraformHabTypeGrav,
}
View Source
var HabTypes = [3]HabType{
	Grav,
	Temp,
	Rad,
}
View Source
var HeavyBlaster = TechHullComponent{Tech: NewTech("Heavy Blaster", NewCost(0, 20, 0, 25), TechRequirements{TechLevel: TechLevel{Weapons: 16}}, 130, TechCategoryBeamWeapon),

	Mass:         2,
	Initiative:   5,
	Power:        66,
	HullSlotType: HullSlotTypeWeapon,
	Range:        3,
}
View Source
var HeavyDispenser110 = TechHullComponent{Tech: NewTech("Heavy Dispenser 110", NewCost(2, 20, 5, 50), TechRequirements{TechLevel: TechLevel{Energy: 9, Biotechnology: 5}, PRTRequired: SD}, 50, TechCategoryMineLayer),

	Mass:           15,
	MineFieldType:  MineFieldTypeHeavy,
	MineLayingRate: 110,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var HeavyDispenser200 = TechHullComponent{Tech: NewTech("Heavy Dispenser 200", NewCost(2, 45, 5, 90), TechRequirements{TechLevel: TechLevel{Energy: 14, Biotechnology: 7}, PRTRequired: SD}, 60, TechCategoryMineLayer),

	Mass:           20,
	MineFieldType:  MineFieldTypeHeavy,
	MineLayingRate: 200,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var HeavyDispenser50 = TechHullComponent{Tech: NewTech("Heavy Dispenser 50", NewCost(2, 20, 5, 50), TechRequirements{TechLevel: TechLevel{Energy: 5, Biotechnology: 3}, PRTRequired: SD}, 40, TechCategoryMineLayer),

	Mass:           10,
	MineFieldType:  MineFieldTypeHeavy,
	MineLayingRate: 50,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var Interspace10 = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Interspace-10", NewCost(18, 25, 10, 60), TechRequirements{TechLevel: TechLevel{Propulsion: 11}, LRTsRequired: NRSE}, 80, TechCategoryEngine), Mass: 25, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   10,
		FreeSpeed:    1,
		MaxSafeSpeed: 10,
		FuelUsage: [11]int{
			0,
			0,
			10,
			30,
			40,
			50,
			60,
			70,
			80,
			90,
			100,
		},
	},
}
View Source
var Jammer10 = TechHullComponent{Tech: NewTech("Jammer 10", NewCost(0, 0, 2, 6), TechRequirements{TechLevel: TechLevel{Energy: 2, Electronics: 6}, PRTRequired: IS}, 70, TechCategoryElectrical),

	Mass:           1,
	TorpedoJamming: .1,
	HullSlotType:   HullSlotTypeElectrical,
}
View Source
var Jammer20 = TechHullComponent{Tech: NewTech("Jammer 20", NewCost(1, 0, 5, 20), TechRequirements{TechLevel: TechLevel{Energy: 4, Electronics: 10}}, 80, TechCategoryElectrical),

	Mass:           1,
	TorpedoJamming: .2,
	HullSlotType:   HullSlotTypeElectrical,
}
View Source
var Jammer30 = TechHullComponent{Tech: NewTech("Jammer 30", NewCost(1, 0, 6, 20), TechRequirements{TechLevel: TechLevel{Energy: 8, Electronics: 16}}, 90, TechCategoryElectrical),

	Mass:           1,
	TorpedoJamming: .3,
	HullSlotType:   HullSlotTypeElectrical,
}
View Source
var Jammer50 = TechHullComponent{Tech: NewTech("Jammer 50", NewCost(2, 0, 7, 20), TechRequirements{TechLevel: TechLevel{Energy: 16, Electronics: 22}}, 100, TechCategoryElectrical),

	Mass:           1,
	TorpedoJamming: .5,
	HullSlotType:   HullSlotTypeElectrical,
}
View Source
var JihadMissile = TechHullComponent{Tech: NewTech("Jihad Missile", NewCost(37, 13, 9, 13), TechRequirements{TechLevel: TechLevel{Weapons: 12, Propulsion: 6}}, 70, TechCategoryTorpedo),

	Mass:               35,
	Accuracy:           20,
	CapitalShipMissile: true,
	Power:              85,
	HullSlotType:       HullSlotTypeWeapon,
	Range:              5,
}
View Source
var JuggernautMissile = TechHullComponent{Tech: NewTech("Juggernaut Missile", NewCost(48, 16, 11, 16), TechRequirements{TechLevel: TechLevel{Weapons: 16, Propulsion: 8}}, 80, TechCategoryTorpedo),

	Mass:               35,
	Initiative:         1,
	Accuracy:           20,
	CapitalShipMissile: true,
	Power:              150,
	HullSlotType:       HullSlotTypeWeapon,
	Range:              5,
}
View Source
var Kelarium = TechHullComponent{Tech: NewTech("Kelarium", NewCost(9, 1, 0, 25), TechRequirements{TechLevel: TechLevel{Construction: 9}}, 60, TechCategoryArmor),

	Mass:         50,
	Armor:        180,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var LBU17Bomb = TechHullComponent{Tech: NewTech("LBU-17 Bomb", NewCost(1, 15, 15, 7), TechRequirements{TechLevel: TechLevel{Weapons: 5, Electronics: 8}}, 50, TechCategoryBomb),

	Mass:                 30,
	StructureDestroyRate: 1.6,
	KillRate:             .2,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var LBU32Bomb = TechHullComponent{Tech: NewTech("LBU-32 Bomb", NewCost(1, 24, 15, 10), TechRequirements{TechLevel: TechLevel{Weapons: 10, Electronics: 10}}, 60, TechCategoryBomb),

	Mass:                 35,
	StructureDestroyRate: 2.8,
	KillRate:             .3,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var LBU74Bomb = TechHullComponent{Tech: NewTech("LBU-74 Bomb", NewCost(1, 33, 12, 14), TechRequirements{TechLevel: TechLevel{Weapons: 15, Electronics: 12}}, 70, TechCategoryBomb),

	Mass:                 45,
	StructureDestroyRate: 4.5,
	KillRate:             .4,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var LRTs = []LRT{
	IFE,
	TT,
	ARM,
	ISB,
	GR,
	UR,
	NRSE,
	OBRM,
	NAS,
	LSP,
	BET,
	RS,
	MA,
	CE,
}
View Source
var LadyFingerBomb = TechHullComponent{Tech: NewTech("Lady Finger Bomb", NewCost(1, 19, 0, 5), TechRequirements{TechLevel: TechLevel{Weapons: 2}}, 0, TechCategoryBomb),

	Mass:                 40,
	MinKillRate:          300,
	StructureDestroyRate: .2,
	KillRate:             .6,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var LargeFreighter = TechHull{Tech: NewTech("Large Freighter", NewCost(35, 0, 21, 100), TechRequirements{TechLevel: TechLevel{Construction: 8}}, 30, TechCategoryShipHull),
	Type:              TechHullTypeFreighter,
	Mass:              125,
	Armor:             150,
	FuelCapacity:      2600,
	CargoCapacity:     1200,
	CargoSlotPosition: Vector{-0.5, -0.5},
	CargoSlotSize:     Vector{2, 2},
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{1.5, -0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 2},
		{Position: Vector{1.5, 0.5}, Type: HullSlotTypeShieldArmor, Capacity: 2},
	},
}
View Source
var Laser = TechHullComponent{Tech: NewTech("Laser", NewCost(0, 6, 0, 5), TechRequirements{TechLevel: TechLevel{}}, 0, TechCategoryBeamWeapon),

	Mass:         1,
	Initiative:   9,
	Power:        10,
	HullSlotType: HullSlotTypeWeapon,

	Range: 1,
}
View Source
var LaserBattery = TechDefense{Tech: NewTech("Laser Battery", NewCost(5, 5, 5, 15), TechRequirements{TechLevel: TechLevel{Energy: 10}, PRTDenied: AR}, 20, TechCategoryPlanetaryDefense),
	Defense: Defense{DefenseCoverage: 2.39},
}
View Source
var LongHump6 = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Long Hump 6", NewCost(5, 0, 1, 6), TechRequirements{TechLevel: TechLevel{Propulsion: 3}}, 40, TechCategoryEngine), Mass: 9, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   6,
		FreeSpeed:    1,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			20,
			60,
			100,
			100,
			105,
			450,
			750,
			900,
			1080,
		},
	},
}
View Source
var M70Bomb = TechHullComponent{Tech: NewTech("M-70 Bomb", NewCost(1, 24, 0, 9), TechRequirements{TechLevel: TechLevel{Weapons: 8}}, 20, TechCategoryBomb),

	Mass:                 50,
	MinKillRate:          300,
	StructureDestroyRate: .6,
	KillRate:             1.2,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var M80Bomb = TechHullComponent{Tech: NewTech("M-80 Bomb", NewCost(1, 25, 0, 12), TechRequirements{TechLevel: TechLevel{Weapons: 11}}, 30, TechCategoryBomb),

	Mass:                 55,
	MinKillRate:          300,
	StructureDestroyRate: .7,
	KillRate:             1.7,
	HullSlotType:         HullSlotTypeBomb,
}
View Source
var ManeuveringJet = TechHullComponent{Tech: NewTech("Maneuvering Jet", NewCost(5, 0, 5, 10), TechRequirements{TechLevel: TechLevel{Energy: 2, Propulsion: 3}}, 60, TechCategoryMechanical),

	Mass:          5,
	MovementBonus: 1,
	HullSlotType:  HullSlotTypeMechanical,
}
View Source
var MarkIVBlaster = TechHullComponent{Tech: NewTech("Mark IV Blaster", NewCost(0, 12, 0, 15), TechRequirements{TechLevel: TechLevel{Weapons: 14}}, 110, TechCategoryBeamWeapon),

	Mass:         2,
	Initiative:   7,
	Power:        66,
	HullSlotType: HullSlotTypeWeapon,
	Range:        2,
}
View Source
var MassDriver5 = TechHullComponent{Tech: NewTech("Mass Driver 5", NewCost(24, 20, 20, 70), TechRequirements{TechLevel: TechLevel{Energy: 4}, PRTRequired: PP}, 70, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  5,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var MassDriver6 = TechHullComponent{Tech: NewTech("Mass Driver 6", NewCost(24, 20, 20, 144), TechRequirements{TechLevel: TechLevel{Energy: 7}, PRTRequired: PP}, 80, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  6,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var MassDriver7 = TechHullComponent{Tech: NewTech("Mass Driver 7", NewCost(100, 100, 100, 512), TechRequirements{TechLevel: TechLevel{Energy: 9}}, 90, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  7,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var MaxiMiner = TechHull{Tech: NewTech("Maxi-Miner", NewCost(32, 0, 6, 140), TechRequirements{TechLevel: TechLevel{Construction: 11}, LRTsDenied: OBRM}, 240, TechCategoryShipHull),
	Type:         TechHullTypeMiner,
	FuelCapacity: 850,
	Armor:        1400,
	Mass:         110,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 3, Required: true},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeArmorScannerElectricalMechanical, Capacity: 2},
		{Position: Vector{-0.5, -0.5}, Type: HullSlotTypeMining, Capacity: 4},
		{Position: Vector{0.5, -0.5}, Type: HullSlotTypeMining, Capacity: 1},
		{Position: Vector{-0.5, 0.5}, Type: HullSlotTypeMining, Capacity: 4},
		{Position: Vector{0.5, 0.5}, Type: HullSlotTypeMining, Capacity: 1},
	},
}
View Source
var MediumFreighter = TechHull{Tech: NewTech("Medium Freighter", NewCost(20, 0, 19, 40), TechRequirements{TechLevel: TechLevel{Construction: 3}}, 20, TechCategoryShipHull),
	Type:              TechHullTypeFreighter,
	Mass:              60,
	Armor:             50,
	FuelCapacity:      450,
	CargoCapacity:     210,
	CargoSlotPosition: Vector{-1, 0},
	CargoSlotSize:     Vector{2, 1},
	Slots: []TechHullSlot{
		{Position: Vector{-2, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{2, 0}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{1, 0}, Type: HullSlotTypeShieldArmor, Capacity: 1},
	},
}
View Source
var MegaDisruptor = TechHullComponent{Tech: NewTech("Mega Disruptor", NewCost(0, 30, 0, 33), TechRequirements{TechLevel: TechLevel{Weapons: 22}}, 190, TechCategoryBeamWeapon),

	Mass:         2,
	Initiative:   6,
	Power:        169,
	HullSlotType: HullSlotTypeWeapon,
	Range:        3,
}
View Source
var MetaMorph = TechHull{Tech: NewTech("Meta Morph", NewCost(50, 12, 12, 120), TechRequirements{TechLevel: TechLevel{Construction: 10}, PRTRequired: HE}, 310, TechCategoryShipHull),
	Type:              TechHullTypeMultiPurposeFreighter,
	Mass:              85,
	Armor:             500,
	Initiative:        2,
	FuelCapacity:      700,
	CargoCapacity:     500,
	CargoSlotPosition: Vector{0, -0.5},
	CargoSlotSize:     Vector{1, 2},
	Slots: []TechHullSlot{
		{Position: Vector{-2, 0}, Type: HullSlotTypeEngine, Capacity: 3, Required: true},
		{Position: Vector{-1, 0}, Type: HullSlotTypeGeneral, Capacity: 8},
		{Position: Vector{1, -0.5}, Type: HullSlotTypeGeneral, Capacity: 2},
		{Position: Vector{1, 0.5}, Type: HullSlotTypeGeneral, Capacity: 2},
		{Position: Vector{2, 0}, Type: HullSlotTypeGeneral, Capacity: 1},
		{Position: Vector{-1, -1}, Type: HullSlotTypeGeneral, Capacity: 2},
		{Position: Vector{-1, 1}, Type: HullSlotTypeGeneral, Capacity: 2},
	},
}
View Source
var MidgetMiner = TechHull{Tech: NewTech("Midget Miner", NewCost(10, 0, 3, 20), TechRequirements{TechLevel: TechLevel{}, LRTsRequired: ARM}, 210, TechCategoryShipHull),
	Type:         TechHullTypeMiner,
	FuelCapacity: 210,
	Armor:        100,
	Mass:         10,
	Slots: []TechHullSlot{
		{Position: Vector{-0.5, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeMining, Capacity: 2},
	},
}
View Source
var MineDispenser130 = TechHullComponent{Tech: NewTech("Mine Dispenser 130", NewCost(2, 18, 10, 80), TechRequirements{TechLevel: TechLevel{Energy: 6, Biotechnology: 12}, PRTRequired: SD}, 30, TechCategoryMineLayer),

	Mass:           30,
	MineFieldType:  MineFieldTypeStandard,
	MineLayingRate: 130,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var MineDispenser40 = TechHullComponent{Tech: NewTech("Mine Dispenser 40", NewCost(2, 9, 7, 40), TechRequirements{TechLevel: TechLevel{}, PRTRequired: SD}, 0, TechCategoryMineLayer),

	Mass:           25,
	MineFieldType:  MineFieldTypeStandard,
	MineLayingRate: 40,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var MineDispenser50 = TechHullComponent{Tech: NewTech("Mine Dispenser 50", NewCost(2, 12, 10, 55), TechRequirements{TechLevel: TechLevel{Energy: 2, Biotechnology: 4}}, 10, TechCategoryMineLayer),

	Mass:           30,
	MineFieldType:  MineFieldTypeStandard,
	MineLayingRate: 50,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var MineDispenser80 = TechHullComponent{Tech: NewTech("Mine Dispenser 80", NewCost(2, 12, 10, 65), TechRequirements{TechLevel: TechLevel{Energy: 3, Biotechnology: 7}, PRTRequired: SD}, 20, TechCategoryMineLayer),

	Mass:           30,
	MineFieldType:  MineFieldTypeStandard,
	MineLayingRate: 80,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var Miner = TechHull{Tech: NewTech("Miner", NewCost(32, 0, 6, 110), TechRequirements{TechLevel: TechLevel{Construction: 6}, LRTsRequired: ARM}, 230, TechCategoryShipHull),
	Type:         TechHullTypeMiner,
	FuelCapacity: 500,
	Armor:        475,
	Mass:         110,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeArmorScannerElectricalMechanical, Capacity: 2},
		{Position: Vector{-0.5, -0.5}, Type: HullSlotTypeMining, Capacity: 2},
		{Position: Vector{0.5, -0.5}, Type: HullSlotTypeMining, Capacity: 1},
		{Position: Vector{-0.5, 0.5}, Type: HullSlotTypeMining, Capacity: 2},
		{Position: Vector{0.5, 0.5}, Type: HullSlotTypeMining, Capacity: 1},
	},
}
View Source
var MiniBlaster = TechHullComponent{Tech: NewTech("Mini Blaster", NewCost(0, 10, 0, 9), TechRequirements{TechLevel: TechLevel{Weapons: 12}}, 90, TechCategoryBeamWeapon),

	Mass:         1,
	Initiative:   9,
	Power:        66,
	HullSlotType: HullSlotTypeWeapon,
	Range:        1,
}
View Source
var MiniBomber = TechHull{Tech: NewTech("Mini Bomber", NewCost(18, 5, 9, 32), TechRequirements{TechLevel: TechLevel{Construction: 1}}, 170, TechCategoryShipHull),
	Type:         TechHullTypeBomber,
	Mass:         28,
	Armor:        50,
	FuelCapacity: 120,
	Slots: []TechHullSlot{
		{Position: Vector{-0.5, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeBomb, Capacity: 2},
	},
}
View Source
var MiniColonyShip = TechHull{Tech: NewTech("Mini-Colony Ship", NewCost(2, 0, 2, 3), TechRequirements{TechLevel: TechLevel{}, PRTRequired: HE}, 150, TechCategoryShipHull),
	Type:              TechHullTypeColonizer,
	Mass:              8,
	Armor:             10,
	FuelCapacity:      150,
	CargoCapacity:     10,
	CargoSlotPosition: Vector{0, 0},
	CargoSlotSize:     Vector{1, 1},
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{1, 0}, Type: HullSlotTypeMechanical, Capacity: 1},
	},
}
View Source
var MiniGun = TechHullComponent{Tech: NewTech("Mini Gun", NewCost(0, 6, 0, 6), TechRequirements{TechLevel: TechLevel{Weapons: 5}, PRTRequired: IS}, 20, TechCategoryBeamWeapon),

	Mass:           3,
	Initiative:     12,
	Gattling:       true,
	Power:          16,
	HitsAllTargets: true,
	HullSlotType:   HullSlotTypeWeapon,

	Range: 2,
}
View Source
var MiniMineLayer = TechHull{Tech: NewTech("Mini Mine Layer", NewCost(8, 2, 5, 20), TechRequirements{TechLevel: TechLevel{}, PRTRequired: SD}, 280, TechCategoryShipHull),
	Type:                  TechHullTypeMineLayer,
	Mass:                  10,
	Armor:                 60,
	FuelCapacity:          400,
	MineLayingBonus:       1,
	ImmuneToOwnDetonation: true,
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{0, -0.5}, Type: HullSlotTypeMineLayer, Capacity: 2},
		{Position: Vector{0, 0.5125}, Type: HullSlotTypeMineLayer, Capacity: 2},
		{Position: Vector{1, 0}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
	},
}
View Source
var MiniMiner = TechHull{Tech: NewTech("Mini-Miner", NewCost(25, 0, 6, 50), TechRequirements{TechLevel: TechLevel{Construction: 2}}, 220, TechCategoryShipHull),
	Type:         TechHullTypeMiner,
	Mass:         80,
	Armor:        130,
	FuelCapacity: 210,
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{1, 0}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{0, -0.5}, Type: HullSlotTypeMining, Capacity: 1},
		{Position: Vector{0, 0.5}, Type: HullSlotTypeMining, Capacity: 1},
	},
}
View Source
var MissileBattery = TechDefense{Tech: NewTech("Missile Battery", NewCost(5, 5, 5, 15), TechRequirements{TechLevel: TechLevel{Energy: 5}, PRTDenied: AR}, 10, TechCategoryPlanetaryDefense),
	Defense: Defense{DefenseCoverage: 1.99},
}
View Source
var MoleScanner = TechHullComponent{Tech: NewTech("Mole Scanner", NewCost(2, 0, 2, 9), TechRequirements{TechLevel: TechLevel{Electronics: 4}}, 30, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,

	Mass:      2,
	ScanRange: 100,
}
View Source
var MoleSkinShield = TechHullComponent{Tech: NewTech("Mole-skin Shield", NewCost(1, 0, 1, 4), TechRequirements{TechLevel: TechLevel{}}, 10, TechCategoryShield),

	Mass:         1,
	Shield:       25,
	HullSlotType: HullSlotTypeShield,
}
View Source
var MyopicDisruptor = TechHullComponent{Tech: NewTech("Myopic Disruptor", NewCost(0, 14, 0, 12), TechRequirements{TechLevel: TechLevel{Weapons: 18}}, 150, TechCategoryBeamWeapon),

	Mass:         1,
	Initiative:   9,
	Power:        169,
	HullSlotType: HullSlotTypeWeapon,
	Range:        1,
}
View Source
var NeutronBomb = TechHullComponent{Tech: NewTech("Neutron Bomb", NewCost(1, 30, 0, 30), TechRequirements{TechLevel: TechLevel{Weapons: 10, Biotechnology: 10}}, 110, TechCategoryBomb),

	Mass:         57,
	Smart:        true,
	KillRate:     2.2,
	HullSlotType: HullSlotTypeBomb,
}
View Source
var NeutronShield = TechDefense{Tech: NewTech("Neutron Shield", NewCost(5, 5, 5, 15), TechRequirements{TechLevel: TechLevel{Energy: 23}, PRTDenied: AR}, 40, TechCategoryPlanetaryDefense),
	Defense: Defense{DefenseCoverage: 3.79},
}
View Source
var Neutronium = TechHullComponent{Tech: NewTech("Neutronium", NewCost(11, 2, 1, 30), TechRequirements{TechLevel: TechLevel{Construction: 12}}, 90, TechCategoryArmor),

	Mass:         45,
	Armor:        275,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var Nubian = TechHull{Tech: NewTech("Nubian", NewCost(75, 12, 12, 150), TechRequirements{TechLevel: TechLevel{Construction: 26}}, 300, TechCategoryShipHull),
	Type:         TechHullTypeFighter,
	FuelCapacity: 5000,
	Armor:        5000,
	Initiative:   2,
	Mass:         100,
	Slots: []TechHullSlot{
		{Position: Vector{-2, 0}, Type: HullSlotTypeEngine, Capacity: 3, Required: true},
		{Position: Vector{-2, -1}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{-2, 1}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{-1, -1.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{-1, 1.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{-1, -0.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{-1, 0.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{0, -1}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{0, 1}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{0, 0}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{1, -0.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{1, 0.5}, Type: HullSlotTypeGeneral, Capacity: 3},
		{Position: Vector{2, 0}, Type: HullSlotTypeGeneral, Capacity: 3},
	},
}
View Source
var OmegaTorpedo = TechHullComponent{Tech: NewTech("Omega Torpedo", NewCost(52, 18, 12, 18), TechRequirements{TechLevel: TechLevel{Weapons: 26, Propulsion: 6}}, 60, TechCategoryTorpedo),

	Mass:         25,
	Initiative:   4,
	Accuracy:     80,
	Power:        316,
	HullSlotType: HullSlotTypeWeapon,
	Range:        5,
}
View Source
var OrbitalAdjuster = TechHullComponent{Tech: NewTech("Orbital Adjuster", NewCost(25, 25, 25, 50), TechRequirements{TechLevel: TechLevel{Biotechnology: 6}, PRTRequired: CA}, 60, TechCategoryMineRobot),

	Mass:          80,
	CloakUnits:    25,
	TerraformRate: 1,
	HullSlotType:  HullSlotTypeMining,
}
View Source
var OrbitalConstructionModule = TechHullComponent{Tech: NewTech("Orbital Construction Module", NewCost(18, 13, 13, 18), TechRequirements{TechLevel: TechLevel{}, PRTRequired: AR}, 10, TechCategoryMechanical),

	Mass:                      50,
	MinKillRate:               2000,
	OrbitalConstructionModule: true,
	HullSlotType:              HullSlotTypeMechanical,
}
View Source
var OrbitalFort = TechHull{Tech: NewTech("Orbital Fort", NewCost(24, 0, 34, 80), TechRequirements{TechLevel: TechLevel{}}, 10, TechCategoryStarbaseHull),
	Type:                    TechHullTypeOrbitalFort,
	SpaceDock:               0,
	Armor:                   100,
	Initiative:              10,
	RangeBonus:              1,
	Starbase:                true,
	OrbitalConstructionHull: true,
	RepairBonus:             .03,
	MaxPopulation:           250_000,
	Slots: []TechHullSlot{
		{Position: Vector{0, 0}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{0, -1}, Type: HullSlotTypeWeapon, Capacity: 12},
		{Position: Vector{1, 0}, Type: HullSlotTypeShieldArmor, Capacity: 12},
		{Position: Vector{0, 1}, Type: HullSlotTypeWeapon, Capacity: 12},
		{Position: Vector{-1, 0}, Type: HullSlotTypeShieldArmor, Capacity: 12},
	},
}
View Source
var Organic = TechHullComponent{Tech: NewTech("Organic Armor", NewCost(0, 0, 6, 20), TechRequirements{TechLevel: TechLevel{Biotechnology: 7}}, 50, TechCategoryArmor),

	Mass:         15,
	Armor:        175,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var Overthruster = TechHullComponent{Tech: NewTech("Overthruster", NewCost(10, 0, 8, 20), TechRequirements{TechLevel: TechLevel{Energy: 5, Propulsion: 12}}, 70, TechCategoryMechanical),

	Mass:          5,
	MovementBonus: 2,
	HullSlotType:  HullSlotTypeMechanical,
}
View Source
var PRTs = [10]PRT{
	HE,
	SS,
	WM,
	CA,
	IS,
	SD,
	PP,
	IT,
	AR,
	JoaT,
}
View Source
var PeerlessBomb = TechHullComponent{Tech: NewTech("Peerless Bomb", NewCost(1, 33, 0, 32), TechRequirements{TechLevel: TechLevel{Weapons: 22, Biotechnology: 15}}, 130, TechCategoryBomb),

	Mass:         55,
	Smart:        true,
	KillRate:     5.0,
	HullSlotType: HullSlotTypeBomb,
}
View Source
var PeerlessScanner = TechHullComponent{Tech: NewTech("Peerless Scanner", NewCost(3, 2, 30, 90), TechRequirements{TechLevel: TechLevel{Energy: 7, Electronics: 24}}, 160, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,

	Mass:      4,
	ScanRange: 500,
}
View Source
var PhasedSapper = TechHullComponent{Tech: NewTech("Phased Sapper", NewCost(0, 0, 6, 16), TechRequirements{TechLevel: TechLevel{Energy: 8, Weapons: 15}}, 120, TechCategoryBeamWeapon),

	Mass:              1,
	Initiative:        14,
	DamageShieldsOnly: true,
	Power:             211,
	HullSlotType:      HullSlotTypeWeapon,
	Range:             3,
}
View Source
var PhaserBazooka = TechHullComponent{Tech: NewTech("Phaser Bazooka", NewCost(0, 8, 0, 11), TechRequirements{TechLevel: TechLevel{Weapons: 8}}, 50, TechCategoryBeamWeapon),

	Mass:         2,
	Initiative:   7,
	Power:        26,
	HullSlotType: HullSlotTypeWeapon,

	Range: 2,
}
View Source
var PickPocketScanner = TechHullComponent{Tech: NewTech("Pick Pocket Scanner", NewCost(8, 10, 6, 35), TechRequirements{TechLevel: TechLevel{Energy: 4, Electronics: 4, Biotechnology: 4}, PRTRequired: SS}, 60, TechCategoryScanner),

	HullSlotType:       HullSlotTypeScanner,
	Mass:               15,
	CanStealFleetCargo: true,
	ScanRange:          80,
}
View Source
var PlanetaryShield = TechDefense{Tech: NewTech("Planetary Shield", NewCost(5, 5, 5, 15), TechRequirements{TechLevel: TechLevel{Energy: 16}, PRTDenied: AR}, 30, TechCategoryPlanetaryDefense),
	Defense: Defense{DefenseCoverage: 2.99},
}
View Source
var PossumScanner = TechHullComponent{Tech: NewTech("Possum Scanner", NewCost(3, 0, 3, 18), TechRequirements{TechLevel: TechLevel{Electronics: 5}}, 50, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         3,
	ScanRange:    150,
}
View Source
var Privateer = TechHull{Tech: NewTech("Privateer", NewCost(50, 3, 3, 50), TechRequirements{TechLevel: TechLevel{Construction: 4}}, 120, TechCategoryShipHull),
	Type:              TechHullTypeMultiPurposeFreighter,
	Mass:              65,
	Armor:             150,
	Initiative:        3,
	FuelCapacity:      650,
	CargoCapacity:     250,
	CargoSlotPosition: Vector{-0.5, 0},
	CargoSlotSize:     Vector{2, 1},
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{1.5, -0.5}, Type: HullSlotTypeShieldArmor, Capacity: 2},
		{Position: Vector{1.5, 0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{0.5, -1}, Type: HullSlotTypeGeneral, Capacity: 1},
		{Position: Vector{0.5, 1}, Type: HullSlotTypeGeneral, Capacity: 1},
	},
}
View Source
var PulsedSapper = TechHullComponent{Tech: NewTech("Pulsed Sapper", NewCost(0, 0, 4, 12), TechRequirements{TechLevel: TechLevel{Energy: 5, Weapons: 9}}, 60, TechCategoryBeamWeapon),

	Mass:              1,
	Initiative:        14,
	DamageShieldsOnly: true,
	Power:             82,
	HullSlotType:      HullSlotTypeWeapon,

	Range: 3,
}
View Source
var QuickJump5 = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Quick Jump 5", NewCost(3, 0, 1, 3), TechRequirements{}, 20, TechCategoryEngine), Mass: 4, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   5,
		FreeSpeed:    1,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			25,
			100,
			100,
			100,
			180,
			500,
			800,
			900,
			1080,
		},
	},
}
View Source
var RNAScanner = TechHullComponent{Tech: NewTech("RNA Scanner", NewCost(1, 1, 2, 20), TechRequirements{TechLevel: TechLevel{Propulsion: 5, Biotechnology: 10}}, 110, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,

	Mass:      2,
	ScanRange: 230,
}
View Source
var RadiatingHydroRamScoop = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Radiating Hydro-Ram Scoop", NewCost(3, 2, 9, 8), TechRequirements{TechLevel: TechLevel{Energy: 2, Propulsion: 6}, LRTsDenied: NRSE}, 100, TechCategoryEngine), Mass: 10, HullSlotType: HullSlotTypeEngine, Radiating: true},
	Engine: Engine{
		IdealSpeed:   6,
		FreeSpeed:    6,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			165,
			375,
			600,
			720,
		},
	},
}
View Source
var RadiationTerraform11 = TechTerraform{Tech: NewTech("Radiation Terraform ±11", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Weapons: 10, Biotechnology: 3}}, 180, TechCategoryTerraforming),
	Ability: 11,
	HabType: TerraformHabTypeRad,
}
View Source
var RadiationTerraform15 = TechTerraform{Tech: NewTech("Radiation Terraform ±15", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Weapons: 16, Biotechnology: 4}}, 190, TechCategoryTerraforming),
	Ability: 15,
	HabType: TerraformHabTypeRad,
}
View Source
var RadiationTerraform3 = TechTerraform{Tech: NewTech("Radiation Terraform ±3", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Weapons: 1, Biotechnology: 1}}, 160, TechCategoryTerraforming),
	Ability: 3,
	HabType: TerraformHabTypeRad,
}
View Source
var RadiationTerraform7 = TechTerraform{Tech: NewTech("Radiation Terraform ±7", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Weapons: 5, Biotechnology: 2}}, 170, TechCategoryTerraforming),
	Ability: 7,
	HabType: TerraformHabTypeRad,
}
View Source
var RetroBomb = TechHullComponent{Tech: NewTech("Retro Bomb", NewCost(15, 15, 10, 50), TechRequirements{TechLevel: TechLevel{Weapons: 10, Biotechnology: 12}, PRTRequired: CA}, 80, TechCategoryBomb),

	Mass:            45,
	UnterraformRate: 1,
	HullSlotType:    HullSlotTypeBomb,
}
View Source
var RhinoScanner = TechHullComponent{Tech: NewTech("Rhino Scanner", NewCost(3, 0, 2, 3), TechRequirements{TechLevel: TechLevel{Electronics: 1}}, 20, TechCategoryScanner),

	HullSlotType: HullSlotTypeScanner,
	Mass:         5,
	ScanRange:    50,
}
View Source
var RhoTorpedo = TechHullComponent{Tech: NewTech("Rho Torpedo", NewCost(34, 12, 8, 12), TechRequirements{TechLevel: TechLevel{Weapons: 18, Propulsion: 4}}, 40, TechCategoryTorpedo),

	Mass:         25,
	Initiative:   2,
	Accuracy:     75,
	Power:        90,
	HullSlotType: HullSlotTypeWeapon,
	Range:        5,
}
View Source
var RobberBaronScanner = TechHullComponent{Tech: NewTech("Robber Baron Scanner", NewCost(10, 10, 10, 90), TechRequirements{TechLevel: TechLevel{Energy: 10, Electronics: 15, Biotechnology: 10}, PRTRequired: SS}, 150, TechCategoryScanner),

	HullSlotType:        HullSlotTypeScanner,
	Mass:                20,
	CanStealFleetCargo:  true,
	CanStealPlanetCargo: true,
	ScanRange:           220,
	ScanRangePen:        120,
}
View Source
var RoboMaxiMiner = TechHullComponent{Tech: NewTech("Robo-Maxi-Miner", NewCost(30, 0, 7, 100), TechRequirements{TechLevel: TechLevel{Construction: 7, Electronics: 4}, LRTsDenied: OBRM}, 10, TechCategoryMineRobot),

	Mass:         240,
	MiningRate:   18,
	HullSlotType: HullSlotTypeMining,
}
View Source
var RoboMidgetMiner = TechHullComponent{Tech: NewTech("Robo-Midget-Miner", NewCost(12, 0, 4, 44), TechRequirements{TechLevel: TechLevel{}, LRTsRequired: ARM}, 20, TechCategoryMineRobot),

	Mass:         80,
	MiningRate:   5,
	HullSlotType: HullSlotTypeMining,
}
View Source
var RoboMiner = TechHullComponent{Tech: NewTech("Robo-Miner", NewCost(30, 0, 7, 100), TechRequirements{TechLevel: TechLevel{Construction: 4, Electronics: 2}, LRTsDenied: OBRM}, 0, TechCategoryMineRobot),

	Mass:         240,
	MiningRate:   12,
	HullSlotType: HullSlotTypeMining,
}
View Source
var RoboMiniMiner = TechHullComponent{Tech: NewTech("Robo-Mini-Miner", NewCost(29, 0, 7, 96), TechRequirements{TechLevel: TechLevel{Construction: 2, Electronics: 1}}, 30, TechCategoryMineRobot),

	Mass:         240,
	MiningRate:   4,
	HullSlotType: HullSlotTypeMining,
}
View Source
var RoboSuperMiner = TechHullComponent{Tech: NewTech("Robo-Super-Miner", NewCost(30, 0, 7, 100), TechRequirements{TechLevel: TechLevel{Construction: 12, Electronics: 6}, LRTsDenied: OBRM}, 40, TechCategoryMineRobot),

	Mass:         240,
	MiningRate:   27,
	HullSlotType: HullSlotTypeMining,
}
View Source
var RoboUltraMiner = TechHullComponent{Tech: NewTech("Robo-Ultra-Miner", NewCost(14, 0, 4, 100), TechRequirements{TechLevel: TechLevel{Construction: 15, Electronics: 8}, LRTsRequired: ARM, LRTsDenied: OBRM}, 50, TechCategoryMineRobot),

	Mass:         80,
	MiningRate:   25,
	HullSlotType: HullSlotTypeMining,
}
View Source
var Rogue = TechHull{Tech: NewTech("Rogue", NewCost(80, 5, 5, 60), TechRequirements{TechLevel: TechLevel{Construction: 8}, PRTRequired: SS}, 130, TechCategoryShipHull),
	Type:              TechHullTypeMultiPurposeFreighter,
	Mass:              75,
	Armor:             450,
	Initiative:        4,
	FuelCapacity:      2250,
	CargoCapacity:     500,
	CargoSlotPosition: Vector{-0.75, -0.5},
	CargoSlotSize:     Vector{1.525, 2},
	Slots: []TechHullSlot{
		{Position: Vector{-1.75, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{0.75, 0}, Type: HullSlotTypeShieldArmor, Capacity: 3},
		{Position: Vector{0.75, -1}, Type: HullSlotTypeMineElectricalMechanical, Capacity: 2},
		{Position: Vector{1.75, 0}, Type: HullSlotTypeScanner, Capacity: 1},
		{Position: Vector{-0.25, -1.5}, Type: HullSlotTypeGeneral, Capacity: 2},
		{Position: Vector{-0.25, 1.5}, Type: HullSlotTypeGeneral, Capacity: 2},
		{Position: Vector{0.75, 1}, Type: HullSlotTypeMineElectricalMechanical, Capacity: 2},
		{Position: Vector{-1.25, -1.5}, Type: HullSlotTypeElectrical, Capacity: 1},
		{Position: Vector{-1.25, 1.5}, Type: HullSlotTypeElectrical, Capacity: 1},
	},
}
View Source
var SDI = TechDefense{Tech: NewTech("SDI", NewCost(5, 5, 5, 15), TechRequirements{PRTDenied: AR}, 0, TechCategoryPlanetaryDefense),
	Defense: Defense{DefenseCoverage: .99},
}
View Source
var Scoper150 = TechPlanetaryScanner{Tech: NewTech("Scoper 150", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Electronics: 3}, PRTDenied: AR}, 30, TechCategoryPlanetaryScanner),
	ScanRange:    150,
	ScanRangePen: 0,
}
View Source
var Scoper220 = TechPlanetaryScanner{Tech: NewTech("Scoper 220", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Electronics: 6}, PRTDenied: AR}, 40, TechCategoryPlanetaryScanner),
	ScanRange:    220,
	ScanRangePen: 0,
}
View Source
var Scoper280 = TechPlanetaryScanner{Tech: NewTech("Scoper 280", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Electronics: 8}, PRTDenied: AR}, 50, TechCategoryPlanetaryScanner),
	ScanRange:    280,
	ScanRangePen: 0,
}
View Source
var Scout = TechHull{Tech: NewTech("Scout", NewCost(4, 2, 4, 10), TechRequirements{TechLevel: TechLevel{}}, 50, TechCategoryShipHull),
	Type:           TechHullTypeScout,
	Mass:           8,
	BuiltInScanner: true,
	Armor:          20,
	Initiative:     1,
	FuelCapacity:   50,
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{1, 0}, Type: HullSlotTypeScanner, Capacity: 1},
		{Position: Vector{0, 0}, Type: HullSlotTypeGeneral, Capacity: 1},
	},
}
View Source
var SettlersDelight = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Settler's Delight", NewCost(1, 0, 1, 2), TechRequirements{PRTRequired: HE, HullsAllowed: []string{MiniColonyShip.Name}}, 10, TechCategoryEngine), Mass: 2, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   6,
		FreeSpeed:    6,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			150,
			275,
			480,
			576,
		},
	},
}

TechEngines

View Source
var ShadowShield = TechHullComponent{Tech: NewTech("Shadow Shield", NewCost(3, 0, 3, 7), TechRequirements{TechLevel: TechLevel{Energy: 7, Electronics: 3}, PRTRequired: SS}, 50, TechCategoryShield),

	Mass:         2,
	Shield:       75,
	CloakUnits:   70,
	HullSlotType: HullSlotTypeShield,
}
View Source
var SmallFreighter = TechHull{Tech: NewTech("Small Freighter", NewCost(12, 0, 17, 20), TechRequirements{TechLevel: TechLevel{}}, 10, TechCategoryShipHull),
	Type:              TechHullTypeFreighter,
	Mass:              25,
	Armor:             25,
	FuelCapacity:      130,
	CargoCapacity:     70,
	CargoSlotPosition: Vector{-.5, 0},
	CargoSlotSize:     Vector{1, 1},
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{.5, 0}, Type: HullSlotTypeShieldArmor, Capacity: 1},
	},
}
View Source
var SmartBomb = TechHullComponent{Tech: NewTech("Smart Bomb", NewCost(1, 22, 0, 27), TechRequirements{TechLevel: TechLevel{Weapons: 5, Biotechnology: 7}}, 90, TechCategoryBomb),

	Mass:         50,
	Smart:        true,
	KillRate:     1.3,
	HullSlotType: HullSlotTypeBomb,
}
View Source
var Snooper320X = TechPlanetaryScanner{Tech: NewTech("Snooper 320X", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Energy: 3, Electronics: 10, Biotechnology: 3}, PRTDenied: AR, LRTsDenied: NAS}, 60, TechCategoryPlanetaryScanner),
	ScanRange:    320,
	ScanRangePen: 160,
}
View Source
var Snooper400X = TechPlanetaryScanner{Tech: NewTech("Snooper 400X", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Energy: 4, Electronics: 13, Biotechnology: 6}, PRTDenied: AR, LRTsDenied: NAS}, 70, TechCategoryPlanetaryScanner),
	ScanRange:    400,
	ScanRangePen: 200,
}
View Source
var Snooper500X = TechPlanetaryScanner{Tech: NewTech("Snooper 500X", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Energy: 5, Electronics: 16, Biotechnology: 7}, PRTDenied: AR, LRTsDenied: NAS}, 80, TechCategoryPlanetaryScanner),
	ScanRange:    500,
	ScanRangePen: 250,
}
View Source
var Snooper620X = TechPlanetaryScanner{Tech: NewTech("Snooper 620X", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Energy: 7, Electronics: 23, Biotechnology: 9}, PRTDenied: AR, LRTsDenied: NAS}, 90, TechCategoryPlanetaryScanner),
	ScanRange:    620,
	ScanRangePen: 310,
}
View Source
var SpaceDock = TechHull{Tech: NewTech("Space Dock", NewCost(40, 10, 50, 200), TechRequirements{TechLevel: TechLevel{Construction: 4}, LRTsRequired: ISB}, 20, TechCategoryStarbaseHull),
	Type:                  TechHullTypeStarbase,
	SpaceDock:             200,
	SpaceDockSlotPosition: Vector{-.125, -.125},
	SpaceDockSlotSize:     Vector{1.25, 1.25},
	SpaceDockSlotCircle:   true,
	Armor:                 250,
	Initiative:            12,
	RangeBonus:            1,
	Starbase:              true,
	RepairBonus:           .03,
	MaxPopulation:         500_000,
	Slots: []TechHullSlot{
		{Position: Vector{-1, -1}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{0, -1.5}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeShieldArmor, Capacity: 24},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{0, 1.5}, Type: HullSlotTypeShield, Capacity: 24},
		{Position: Vector{1, -1}, Type: HullSlotTypeElectrical, Capacity: 2},
		{Position: Vector{1, 1}, Type: HullSlotTypeElectrical, Capacity: 2},
		{Position: Vector{-1, 1}, Type: HullSlotTypeWeapon, Capacity: 16},
	},
}
View Source
var SpaceStation = TechHull{Tech: NewTech("Space Station", NewCost(120, 80, 250, 600), TechRequirements{TechLevel: TechLevel{}}, 30, TechCategoryStarbaseHull),
	Type:                  TechHullTypeStarbase,
	SpaceDock:             UnlimitedSpaceDock,
	SpaceDockSlotPosition: Vector{0, 0},
	SpaceDockSlotSize:     Vector{1, 1},
	Armor:                 500,
	Initiative:            14,
	RangeBonus:            1,
	Starbase:              true,
	RepairBonus:           .15,
	MaxPopulation:         1_000_000,
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{0.5, -2}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{-0.5, -2}, Type: HullSlotTypeShield, Capacity: 16},
		{Position: Vector{2, 0.5}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{-2, 0.5}, Type: HullSlotTypeShieldArmor, Capacity: 16},
		{Position: Vector{0.5, 2}, Type: HullSlotTypeShield, Capacity: 16},
		{Position: Vector{0, 1}, Type: HullSlotTypeElectrical, Capacity: 3},
		{Position: Vector{-0.5, 2}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{0, -1}, Type: HullSlotTypeElectrical, Capacity: 3},
		{Position: Vector{-2, -0.5}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{1, 0}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{2, -0.5}, Type: HullSlotTypeShieldArmor, Capacity: 16},
	},
}
View Source
var SpeedTrap20 = TechHullComponent{Tech: NewTech("Speed Trap 20", NewCost(29, 0, 12, 58), TechRequirements{TechLevel: TechLevel{Propulsion: 2, Biotechnology: 2}, PRTRequired: SD}, 70, TechCategoryMineLayer),

	Mass:           100,
	MineFieldType:  MineFieldTypeSpeedBump,
	MineLayingRate: 20,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var SpeedTrap30 = TechHullComponent{Tech: NewTech("Speed Trap 30", NewCost(32, 0, 14, 72), TechRequirements{TechLevel: TechLevel{Propulsion: 3, Biotechnology: 6}, PRTRequired: SD}, 80, TechCategoryMineLayer),

	Mass:           135,
	MineFieldType:  MineFieldTypeSpeedBump,
	MineLayingRate: 30,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var SpeedTrap50 = TechHullComponent{Tech: NewTech("Speed Trap 50", NewCost(40, 0, 15, 80), TechRequirements{TechLevel: TechLevel{Propulsion: 5, Biotechnology: 11}, PRTRequired: SD}, 90, TechCategoryMineLayer),

	Mass:           140,
	MineFieldType:  MineFieldTypeSpeedBump,
	MineLayingRate: 50,
	HullSlotType:   HullSlotTypeMineLayer,
}
View Source
var StandardRules = NewRules()
View Source
var Stargate100_250 = TechHullComponent{Tech: NewTech("Stargate 100-250", NewCost(50, 20, 20, 200), TechRequirements{TechLevel: TechLevel{Propulsion: 5, Construction: 5}, PRTDenied: HE}, 0, TechCategoryOrbital),

	Mass:         0,
	SafeHullMass: 100,
	MaxHullMass:  500,
	SafeRange:    250,
	MaxRange:     1250,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var Stargate100_Any = TechHullComponent{Tech: NewTech("Stargate 100-any", NewCost(50, 20, 20, 700), TechRequirements{TechLevel: TechLevel{Propulsion: 16, Construction: 12}, PRTRequired: IT, PRTDenied: HE}, 40, TechCategoryOrbital),

	Mass:         0,
	SafeHullMass: 100,
	MaxHullMass:  500,
	SafeRange:    InfiniteGate,
	MaxRange:     InfiniteGate,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var Stargate150_600 = TechHullComponent{Tech: NewTech("Stargate 150-600", NewCost(50, 20, 20, 500), TechRequirements{TechLevel: TechLevel{Propulsion: 11, Construction: 7}, PRTDenied: HE}, 20, TechCategoryOrbital),

	Mass:         0,
	SafeHullMass: 150,
	MaxHullMass:  750,
	SafeRange:    600,
	MaxRange:     3000,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var Stargate300_500 = TechHullComponent{Tech: NewTech("Stargate 300-500", NewCost(50, 20, 20, 600), TechRequirements{TechLevel: TechLevel{Propulsion: 9, Construction: 13}, PRTDenied: HE}, 30, TechCategoryOrbital),

	Mass:         0,
	SafeHullMass: 300,
	MaxHullMass:  1500,
	SafeRange:    500,
	MaxRange:     2500,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var StargateAny_300 = TechHullComponent{Tech: NewTech("Stargate any-300", NewCost(50, 20, 20, 250), TechRequirements{TechLevel: TechLevel{Propulsion: 6, Construction: 10}, PRTRequired: IT, PRTDenied: HE}, 10, TechCategoryOrbital),

	Mass:         0,
	SafeHullMass: InfiniteGate,
	MaxHullMass:  InfiniteGate,
	SafeRange:    300,
	MaxRange:     1500,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var StargateAny_800 = TechHullComponent{Tech: NewTech("Stargate any-800", NewCost(50, 20, 20, 700), TechRequirements{TechLevel: TechLevel{Propulsion: 12, Construction: 18}, PRTRequired: IT, PRTDenied: HE}, 50, TechCategoryOrbital),

	Mass:         0,
	SafeHullMass: InfiniteGate,
	MaxHullMass:  InfiniteGate,
	SafeRange:    800,
	MaxRange:     4000,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var StargateAny_Any = TechHullComponent{Tech: NewTech("Stargate any-any", NewCost(50, 20, 20, 800), TechRequirements{TechLevel: TechLevel{Propulsion: 19, Construction: 24}, PRTRequired: IT, PRTDenied: HE}, 60, TechCategoryOrbital),

	Mass:         0,
	SafeHullMass: InfiniteGate,
	MaxHullMass:  InfiniteGate,
	SafeRange:    InfiniteGate,
	MaxRange:     InfiniteGate,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var StaticTechStore = TechStore{
	Engines:           TechEngines(),
	PlanetaryScanners: TechPlanetaryScanners(),
	Terraforms:        TechTerraforms(),
	Defenses:          TechDefenses(),
	HullComponents:    TechHullComponents(),
	Hulls:             TechHulls(),
}

simple static tech store

View Source
var StealthBomber = TechHull{Tech: NewTech("Stealth Bomber", NewCost(55, 10, 15, 175), TechRequirements{TechLevel: TechLevel{Construction: 8}, PRTRequired: SS}, 190, TechCategoryShipHull),
	Type:         TechHullTypeBomber,
	FuelCapacity: 750,
	Armor:        225,
	Mass:         70,
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{0, -0.5}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{0, 0.5}, Type: HullSlotTypeBomb, Capacity: 4},
		{Position: Vector{1, -0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 1},
		{Position: Vector{1, 0.5}, Type: HullSlotTypeElectrical, Capacity: 3},
	},
}
View Source
var StealthCloak = TechHullComponent{Tech: NewTech("Stealth Cloak", NewCost(2, 0, 2, 5), TechRequirements{TechLevel: TechLevel{Energy: 2, Electronics: 5}}, 10, TechCategoryElectrical),

	Mass:         2,
	CloakUnits:   70,
	HullSlotType: HullSlotTypeElectrical,
}
View Source
var StreamingPulverizer = TechHullComponent{Tech: NewTech("Streaming Pulverizer", NewCost(0, 20, 0, 16), TechRequirements{TechLevel: TechLevel{Weapons: 24}}, 210, TechCategoryBeamWeapon),

	Mass:         1,
	Initiative:   9,
	Power:        433,
	HullSlotType: HullSlotTypeWeapon,
	Range:        1,
}
View Source
var Strobnium = TechHullComponent{Tech: NewTech("Strobnium", NewCost(8, 0, 0, 18), TechRequirements{TechLevel: TechLevel{Construction: 6}}, 40, TechCategoryArmor),

	Mass:         54,
	Armor:        120,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var SubGalacticFuelScoop = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Sub-Galactic Fuel Scoop", NewCost(4, 4, 7, 12), TechRequirements{TechLevel: TechLevel{Energy: 2, Propulsion: 8}, LRTsDenied: NRSE}, 110, TechCategoryEngine), Mass: 20, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   7,
		FreeSpeed:    5,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			0,
			85,
			105,
			210,
			380,
			456,
		},
	},
}
View Source
var SuperCargoPod = TechHullComponent{Tech: NewTech("Super Cargo Pod", NewCost(8, 0, 2, 15), TechRequirements{TechLevel: TechLevel{Energy: 3, Construction: 8}}, 30, TechCategoryMechanical),

	Mass:         7,
	CargoBonus:   100,
	HullSlotType: HullSlotTypeMechanical,
}
View Source
var SuperDriver8 = TechHullComponent{Tech: NewTech("Super Driver 8", NewCost(24, 20, 20, 256), TechRequirements{TechLevel: TechLevel{Energy: 11}, PRTRequired: PP}, 100, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  8,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var SuperDriver9 = TechHullComponent{Tech: NewTech("Super Driver 9", NewCost(24, 20, 20, 324), TechRequirements{TechLevel: TechLevel{Energy: 13}, PRTRequired: PP}, 110, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  9,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var SuperFreighter = TechHull{Tech: NewTech("Super Freighter", NewCost(35, 0, 21, 100), TechRequirements{TechLevel: TechLevel{Construction: 13}, PRTRequired: IS}, 40, TechCategoryShipHull),
	Type:              TechHullTypeFreighter,
	Mass:              175,
	Armor:             400,
	FuelCapacity:      8000,
	CargoCapacity:     3000,
	CargoSlotPosition: Vector{-0.5, -1},
	CargoSlotSize:     Vector{2, 2.975},
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 3, Required: true},
		{Position: Vector{1.5, -1}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 3},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeShieldArmor, Capacity: 5},
		{Position: Vector{1.5, 0.975}, Type: HullSlotTypeElectrical, Capacity: 2},
	},
}
View Source
var SuperFuelTank = TechHullComponent{Tech: NewTech("Super Fuel Tank", NewCost(8, 0, 0, 8), TechRequirements{TechLevel: TechLevel{Energy: 6, Propulsion: 4, Construction: 14}}, 50, TechCategoryMechanical),

	Mass:         8,
	FuelBonus:    500,
	HullSlotType: HullSlotTypeMechanical,
}
View Source
var SuperFuelXport = TechHull{Tech: NewTech("Super Fuel Xport", NewCost(20, 0, 8, 70), TechRequirements{TechLevel: TechLevel{Construction: 7}}, 270, TechCategoryShipHull),
	Type:           TechHullTypeFuelTransport,
	Mass:           111,
	Armor:          12,
	FuelCapacity:   2250,
	FuelGeneration: 200,
	RepairBonus:    .1,
	Slots: []TechHullSlot{
		{Position: Vector{-1, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{0, 0}, Type: HullSlotTypeShield, Capacity: 2},
		{Position: Vector{1, 0}, Type: HullSlotTypeScanner, Capacity: 1},
	},
}
View Source
var SuperMineLayer = TechHull{Tech: NewTech("Super Mine Layer", NewCost(20, 3, 9, 30), TechRequirements{TechLevel: TechLevel{Construction: 15}, PRTRequired: SD}, 290, TechCategoryShipHull),
	Type:                  TechHullTypeMineLayer,
	FuelCapacity:          2200,
	Armor:                 1200,
	Mass:                  30,
	MineLayingBonus:       1,
	ImmuneToOwnDetonation: true,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 1, Required: true},
		{Position: Vector{-0.5, -0.5}, Type: HullSlotTypeMineLayer, Capacity: 8},
		{Position: Vector{-0.5, 0.5}, Type: HullSlotTypeMineLayer, Capacity: 8},
		{Position: Vector{0.5, 0}, Type: HullSlotTypeShieldArmor, Capacity: 4},
		{Position: Vector{1.5, -0.5}, Type: HullSlotTypeScannerElectricalMechanical, Capacity: 3},
		{Position: Vector{1.5, 0.5}, Type: HullSlotTypeMineElectricalMechanical, Capacity: 3},
	},
}
View Source
var SuperStealthCloak = TechHullComponent{Tech: NewTech("Super-Stealth Cloak", NewCost(8, 0, 8, 15), TechRequirements{TechLevel: TechLevel{Energy: 4, Electronics: 10}}, 20, TechCategoryElectrical),

	Mass:         3,
	CloakUnits:   140,
	HullSlotType: HullSlotTypeElectrical,
}
View Source
var Superlatanium = TechHullComponent{Tech: NewTech("Superlatanium", NewCost(25, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Construction: 24}}, 110, TechCategoryArmor),

	Mass:         30,
	Armor:        1500,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var SyncroSapper = TechHullComponent{Tech: NewTech("Syncro Sapper", NewCost(0, 0, 8, 21), TechRequirements{TechLevel: TechLevel{Energy: 11, Weapons: 21}}, 180, TechCategoryBeamWeapon),

	Mass:              1,
	Initiative:        14,
	DamageShieldsOnly: true,
	Power:             541,
	HullSlotType:      HullSlotTypeWeapon,
	Range:             3,
}
View Source
var TachyonDetector = TechHullComponent{Tech: NewTech("Tachyon Detector", NewCost(1, 5, 0, 70), TechRequirements{TechLevel: TechLevel{Energy: 8, Electronics: 14}, PRTRequired: IS}, 140, TechCategoryElectrical),

	Mass:           1,
	ReduceCloaking: true,
	HullSlotType:   HullSlotTypeElectrical,
}
View Source
var TempTerraform11 = TechTerraform{Tech: NewTech("Temp Terraform ±11", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Energy: 10, Biotechnology: 3}}, 140, TechCategoryTerraforming),
	Ability: 11,
	HabType: TerraformHabTypeTemp,
}
View Source
var TempTerraform15 = TechTerraform{Tech: NewTech("Temp Terraform ±15", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Energy: 16, Biotechnology: 4}}, 150, TechCategoryTerraforming),
	Ability: 15,
	HabType: TerraformHabTypeTemp,
}
View Source
var TempTerraform3 = TechTerraform{Tech: NewTech("Temp Terraform ±3", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Energy: 1, Biotechnology: 1}}, 120, TechCategoryTerraforming),
	Ability: 3,
	HabType: TerraformHabTypeTemp,
}
View Source
var TempTerraform7 = TechTerraform{Tech: NewTech("Temp Terraform ±7", NewCost(0, 0, 0, 100), TechRequirements{TechLevel: TechLevel{Energy: 5, Biotechnology: 2}}, 130, TechCategoryTerraforming),
	Ability: 7,
	HabType: TerraformHabTypeTemp,
}
View Source
var TotalTerraform10 = TechTerraform{Tech: NewTech("Total Terraform ±10", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{Biotechnology: 9}, LRTsRequired: TT}, 30, TechCategoryTerraforming),
	Ability: 10,
	HabType: TerraformHabTypeAll,
}
View Source
var TotalTerraform15 = TechTerraform{Tech: NewTech("Total Terraform ±15", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{Biotechnology: 13}, LRTsRequired: TT}, 40, TechCategoryTerraforming),
	Ability: 15,
	HabType: TerraformHabTypeAll,
}
View Source
var TotalTerraform20 = TechTerraform{Tech: NewTech("Total Terraform ±20", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{Biotechnology: 17}, LRTsRequired: TT}, 50, TechCategoryTerraforming),
	Ability: 20,
	HabType: TerraformHabTypeAll,
}
View Source
var TotalTerraform25 = TechTerraform{Tech: NewTech("Total Terraform ±25", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{Biotechnology: 22}, LRTsRequired: TT}, 60, TechCategoryTerraforming),
	Ability: 25,
	HabType: TerraformHabTypeAll,
}
View Source
var TotalTerraform3 = TechTerraform{Tech: NewTech("Total Terraform ±3", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{}, LRTsRequired: TT}, 0, TechCategoryTerraforming),
	Ability: 3,
	HabType: TerraformHabTypeAll,
}
View Source
var TotalTerraform30 = TechTerraform{Tech: NewTech("Total Terraform ±30", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{Biotechnology: 25}, LRTsRequired: TT}, 70, TechCategoryTerraforming),
	Ability: 30,
	HabType: TerraformHabTypeAll,
}
View Source
var TotalTerraform5 = TechTerraform{Tech: NewTech("Total Terraform ±5", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{Biotechnology: 3}, LRTsRequired: TT}, 10, TechCategoryTerraforming),
	Ability: 5,
	HabType: TerraformHabTypeAll,
}
View Source
var TotalTerraform7 = TechTerraform{Tech: NewTech("Total Terraform ±7", NewCost(0, 0, 0, 70), TechRequirements{TechLevel: TechLevel{Biotechnology: 6}, LRTsRequired: TT}, 20, TechCategoryTerraforming),
	Ability: 7,
	HabType: TerraformHabTypeAll,
}
View Source
var TransGalacticDrive = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Trans-Galactic Drive", NewCost(20, 20, 9, 50), TechRequirements{TechLevel: TechLevel{Propulsion: 9}}, 70, TechCategoryEngine), Mass: 25, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   9,
		FreeSpeed:    1,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			15,
			35,
			45,
			55,
			70,
			80,
			90,
			100,
			120,
		},
	},
}
View Source
var TransGalacticFuelScoop = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Trans-Galactic Fuel Scoop", NewCost(5, 4, 12, 18), TechRequirements{TechLevel: TechLevel{Energy: 3, Propulsion: 9}, LRTsDenied: NRSE}, 120, TechCategoryEngine), Mass: 19, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   8,
		FreeSpeed:    6,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			88,
			100,
			145,
			174,
		},
	},
}
View Source
var TransGalacticMizerScoop = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Trans-Galactic Mizer Scoop", NewCost(5, 2, 13, 11), TechRequirements{TechLevel: TechLevel{Energy: 4, Propulsion: 16}, LRTsDenied: NRSE}, 140, TechCategoryEngine), Mass: 11, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   10,
		FreeSpeed:    8,
		MaxSafeSpeed: 10,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			70,
			84,
		},
	},
}
View Source
var TransGalacticSuperScoop = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Trans-Galactic Super Scoop", NewCost(6, 4, 16, 24), TechRequirements{TechLevel: TechLevel{Energy: 4, Propulsion: 12}, LRTsDenied: NRSE}, 130, TechCategoryEngine), Mass: 18, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   9,
		FreeSpeed:    7,
		MaxSafeSpeed: 9,
		FuelUsage: [11]int{
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			65,
			90,
			108,
		},
	},
}
View Source
var TransStar10 = TechEngine{
	TechHullComponent: TechHullComponent{Tech: NewTech("Trans-Star 10", NewCost(3, 0, 3, 10), TechRequirements{TechLevel: TechLevel{Propulsion: 23}}, 90, TechCategoryEngine), Mass: 5, HullSlotType: HullSlotTypeEngine},
	Engine: Engine{
		IdealSpeed:   10,
		FreeSpeed:    1,
		MaxSafeSpeed: 10,
		FuelUsage: [11]int{
			0,
			0,
			5,
			15,
			20,
			25,
			30,
			35,
			40,
			45,
			50,
		},
	},
}
View Source
var TransportCloaking = TechHullComponent{Tech: NewTech("Transport Cloaking", NewCost(2, 0, 2, 3), TechRequirements{TechLevel: TechLevel{}, PRTRequired: SS}, 0, TechCategoryElectrical),

	Mass:             1,
	CloakUnarmedOnly: true,
	CloakUnits:       300,
	HullSlotType:     HullSlotTypeElectrical,
}
View Source
var Tritanium = TechHullComponent{Tech: NewTech("Tritanium", NewCost(5, 0, 0, 9), TechRequirements{TechLevel: TechLevel{}}, 10, TechCategoryArmor),

	Mass:         60,
	Armor:        50,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var UltraDriver10 = TechHullComponent{Tech: NewTech("Ultra Driver 10", NewCost(100, 100, 100, 968), TechRequirements{TechLevel: TechLevel{Energy: 15}}, 120, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  10,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var UltraDriver11 = TechHullComponent{Tech: NewTech("Ultra Driver 11", NewCost(24, 20, 20, 484), TechRequirements{TechLevel: TechLevel{Energy: 17}, PRTRequired: PP}, 130, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  11,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var UltraDriver12 = TechHullComponent{Tech: NewTech("Ultra Driver 12", NewCost(24, 20, 20, 576), TechRequirements{TechLevel: TechLevel{Energy: 20}, PRTRequired: PP}, 140, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  12,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var UltraDriver13 = TechHullComponent{Tech: NewTech("Ultra Driver 13", NewCost(24, 20, 20, 676), TechRequirements{TechLevel: TechLevel{Energy: 24}, PRTRequired: PP}, 150, TechCategoryOrbital),

	Mass:         0,
	PacketSpeed:  13,
	HullSlotType: HullSlotTypeOrbital,
}
View Source
var UltraMiner = TechHull{Tech: NewTech("Ultra-Miner", NewCost(30, 0, 6, 130), TechRequirements{TechLevel: TechLevel{Construction: 14}, LRTsRequired: ARM}, 250, TechCategoryShipHull),
	Type:         TechHullTypeMiner,
	FuelCapacity: 1300,
	Armor:        1500,
	Mass:         100,
	Slots: []TechHullSlot{
		{Position: Vector{-1.5, 0}, Type: HullSlotTypeEngine, Capacity: 2, Required: true},
		{Position: Vector{1.5, 0}, Type: HullSlotTypeArmorScannerElectricalMechanical, Capacity: 3},
		{Position: Vector{-0.5, -0.5}, Type: HullSlotTypeMining, Capacity: 4},
		{Position: Vector{0.5, -0.5}, Type: HullSlotTypeMining, Capacity: 2},
		{Position: Vector{-0.5, 0.5}, Type: HullSlotTypeMining, Capacity: 4},
		{Position: Vector{0.5, 0.5}, Type: HullSlotTypeMining, Capacity: 2},
	},
}
View Source
var UltraStation = TechHull{Tech: NewTech("Ultra Station", NewCost(120, 80, 300, 600), TechRequirements{TechLevel: TechLevel{Construction: 12}, LRTsRequired: ISB}, 40, TechCategoryStarbaseHull),
	Type:                     TechHullTypeStarbase,
	SpaceDock:                UnlimitedSpaceDock,
	SpaceDockSlotPosition:    Vector{0, 0},
	SpaceDockSlotSize:        Vector{1, 1},
	Armor:                    1000,
	Initiative:               16,
	Starbase:                 true,
	RepairBonus:              .15,
	InnateScanRangePenFactor: .5,
	MaxPopulation:            2_000_000,
	Slots: []TechHullSlot{
		{Position: Vector{0, -1}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{-2, 0.5}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{-1, 0}, Type: HullSlotTypeElectrical, Capacity: 3},
		{Position: Vector{2, 0.5}, Type: HullSlotTypeWeapon, Capacity: 6},
		{Position: Vector{-1, 1}, Type: HullSlotTypeShield, Capacity: 20},
		{Position: Vector{1, -1}, Type: HullSlotTypeShield, Capacity: 20},
		{Position: Vector{1, 0}, Type: HullSlotTypeElectrical, Capacity: 3},
		{Position: Vector{-0.5, -2}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{-0.5, 2}, Type: HullSlotTypeElectrical, Capacity: 3},
		{Position: Vector{2, -0.5}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{0, 1}, Type: HullSlotTypeOrbitalElectrical, Capacity: 1},
		{Position: Vector{1, 1}, Type: HullSlotTypeShieldArmor, Capacity: 20},
		{Position: Vector{-2, -0.5}, Type: HullSlotTypeWeapon, Capacity: 16},
		{Position: Vector{-1, -1}, Type: HullSlotTypeShieldArmor, Capacity: 20},
		{Position: Vector{0.5, -2}, Type: HullSlotTypeElectrical, Capacity: 3},
		{Position: Vector{0.5, 2}, Type: HullSlotTypeWeapon, Capacity: 16},
	},
}
View Source
var UltraStealthCloak = TechHullComponent{Tech: NewTech("Ultra-Stealth Cloak", NewCost(10, 0, 10, 25), TechRequirements{TechLevel: TechLevel{Energy: 10, Electronics: 12}, PRTRequired: SS}, 30, TechCategoryElectrical),

	Mass:         5,
	CloakUnits:   540,
	HullSlotType: HullSlotTypeElectrical,
}
View Source
var UpsilonTorpedo = TechHullComponent{Tech: NewTech("Upsilon Torpedo", NewCost(40, 14, 9, 15), TechRequirements{TechLevel: TechLevel{Weapons: 22, Propulsion: 5}}, 50, TechCategoryTorpedo),

	Mass:         25,
	Initiative:   3,
	Accuracy:     75,
	Power:        169,
	HullSlotType: HullSlotTypeWeapon,
	Range:        5,
}
View Source
var Valanium = TechHullComponent{Tech: NewTech("Valanium", NewCost(15, 0, 0, 50), TechRequirements{TechLevel: TechLevel{Construction: 16}}, 100, TechCategoryArmor),

	Mass:         40,
	Armor:        500,
	HullSlotType: HullSlotTypeArmor,
}
View Source
var Viewer50 = TechPlanetaryScanner{Tech: NewTech("Viewer 50", NewCost(10, 10, 70, 100), TechRequirements{PRTDenied: AR}, 0, TechCategoryPlanetaryScanner),
	ScanRange:    50,
	ScanRangePen: 0,
}
View Source
var Viewer90 = TechPlanetaryScanner{Tech: NewTech("Viewer 90", NewCost(10, 10, 70, 100), TechRequirements{TechLevel: TechLevel{Electronics: 1}, PRTDenied: AR}, 1, TechCategoryPlanetaryScanner),
	ScanRange:    90,
	ScanRangePen: 0,
}
View Source
var WolverineDiffuseShield = TechHullComponent{Tech: NewTech("Wolverine Diffuse Shield", NewCost(3, 0, 3, 6), TechRequirements{TechLevel: TechLevel{Energy: 6}}, 30, TechCategoryShield),

	Mass:         1,
	Shield:       60,
	HullSlotType: HullSlotTypeShield,
}
View Source
var XRayLaser = TechHullComponent{Tech: NewTech("X-Ray Laser", NewCost(0, 6, 0, 6), TechRequirements{TechLevel: TechLevel{Weapons: 3}}, 10, TechCategoryBeamWeapon),

	Mass:         1,
	Initiative:   9,
	Power:        16,
	HullSlotType: HullSlotTypeWeapon,

	Range: 1,
}
View Source
var YakimoraLightPhaser = TechHullComponent{Tech: NewTech("Yakimora Light Phaser", NewCost(0, 8, 0, 7), TechRequirements{TechLevel: TechLevel{Weapons: 6}}, 30, TechCategoryBeamWeapon),

	Mass:         1,
	Initiative:   9,
	Power:        26,
	HullSlotType: HullSlotTypeWeapon,

	Range: 1,
}

Functions

func AbsInt

func AbsInt(num int) int

func Clamp

func Clamp(value, min, max int) int

func ClampFloat64

func ClampFloat64(value, min, max float64) float64

func MaxInt

func MaxInt(nums ...int) int

func MinFloat64

func MinFloat64(nums ...float64) float64

func MinInt

func MinInt(nums ...int) int

func NewBomber

func NewBomber(rules *Rules) bomber

func NewResearcher

func NewResearcher(rules *Rules) researcher

Types

type AIDifficulty

type AIDifficulty string
const (
	AIDifficultyNone   AIDifficulty = ""
	AIDifficultyEasy   AIDifficulty = "Easy"
	AIDifficultyNormal AIDifficulty = "Normal"
	AIDifficultyHard   AIDifficulty = "Hard"
)

type BattleAttackWho

type BattleAttackWho string
const (
	BattleAttackWhoEnemies            BattleAttackWho = "Enemies"
	BattleAttackWhoEnemiesAndNeutrals BattleAttackWho = "EnemiesAndNeutrals"
	BattleAttackWhoEveryone           BattleAttackWho = "Everyone"
)

type BattlePlan

type BattlePlan struct {
	Num             int             `json:"num"`
	Name            string          `json:"name"`
	PrimaryTarget   BattleTarget    `json:"primaryTarget"`
	SecondaryTarget BattleTarget    `json:"secondaryTarget"`
	Tactic          BattleTactic    `json:"tactic"`
	AttackWho       BattleAttackWho `json:"attackWho"`
	DumpCargo       bool            `json:"dumpCargo"`
}

func (*BattlePlan) Validate

func (plan *BattlePlan) Validate(player *Player) error

validate this battle plan

type BattleRecord

type BattleRecord struct {
	Num             int                          `json:"num,omitempty"`
	PlanetNum       int                          `json:"planetNum,omitempty"`
	Position        Vector                       `json:"position,omitempty"`
	Tokens          []BattleRecordToken          `json:"tokens,omitempty"`
	ActionsPerRound [][]BattleRecordTokenAction  `json:"actionsPerRound,omitempty"`
	DestroyedTokens []BattleRecordDestroyedToken `json:"destroyedTokens,omitempty"`
	Stats           BattleRecordStats            `json:"stats,omitempty"`
}

BattleRecord is a recording of a single battle.

func RunTestBattle

func RunTestBattle(players []*Player, fleets []*Fleet) *BattleRecord

Function to allow server to run test battles

type BattleRecordDestroyedToken

type BattleRecordDestroyedToken struct {
	Num       int `json:"num,omitempty"`
	PlayerNum int `json:"playerNum,omitempty"`
	DesignNum int `json:"designNum,omitempty"`
	Quantity  int `json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

type BattleRecordStats

type BattleRecordStats struct {
	NumPlayers             int           `json:"numPlayers,omitempty"`
	NumShipsByPlayer       map[int]int   `json:"numShipsByPlayer,omitempty"`
	ShipsDestroyedByPlayer map[int]int   `json:"shipsDestroyedByPlayer,omitempty"`
	DamageTakenByPlayer    map[int]int   `json:"damageTakenByPlayer,omitempty"`
	CargoLostByPlayer      map[int]Cargo `json:"cargoLostByPlayer,omitempty"`
}

type BattleRecordToken

type BattleRecordToken struct {
	Num              int             `json:"num,omitempty"`
	PlayerNum        int             `json:"playerNum,omitempty"`
	DesignNum        int             `json:"designNum,omitempty"`
	Position         BattleVector    `json:"position,omitempty"`
	Initiative       int             `json:"initiative,omitempty"`
	Movement         int             `json:"movement,omitempty"`
	StartingQuantity int             `json:"startingQuantity,omitempty"`
	Tactic           BattleTactic    `json:"tactic,omitempty"`
	PrimaryTarget    BattleTarget    `json:"primaryTarget,omitempty"`
	SecondaryTarget  BattleTarget    `json:"secondaryTarget,omitempty"`
	AttackWho        BattleAttackWho `json:"attackWho,omitempty"`
}

A token on a battle board

type BattleRecordTokenAction

type BattleRecordTokenAction struct {
	Type              BattleRecordTokenActionType `json:"type,omitempty"`
	TokenNum          int                         `json:"tokenNum,omitempty"`
	Round             int                         `json:"round,omitempty"`
	From              BattleVector                `json:"from,omitempty"`
	To                BattleVector                `json:"to,omitempty"`
	Slot              int                         `json:"slot,omitempty"`
	TargetNum         int                         `json:"targetNum,omitempty"`
	Target            *ShipToken                  `json:"target,omitempty"`
	TokensDestroyed   int                         `json:"tokensDestroyed,omitempty"`
	DamageDoneShields int                         `json:"damageDoneShields,omitempty"`
	DamageDoneArmor   int                         `json:"damageDoneArmor,omitempty"`
	TorpedoHits       int                         `json:"torpedoHits,omitempty"`
	TorpedoMisses     int                         `json:"torpedoMisses,omitempty"`
}

BattleRecordTokenAction represents an action for a token in a battle.

func (BattleRecordTokenAction) String

func (a BattleRecordTokenAction) String() string

type BattleRecordTokenActionType

type BattleRecordTokenActionType int
const (
	TokenActionFire BattleRecordTokenActionType = iota
	TokenActionBeamFire
	TokenActionTorpedoFire
	TokenActionMove
	TokenActionRanAway
)

func (BattleRecordTokenActionType) String

type BattleTactic

type BattleTactic string
const (
	// RUN AWAY!
	BattleTacticDisengage BattleTactic = "Disengage"
	// MaximizeDamage until we are damaged, then disengage
	BattleTacticDisengageIfChallenged BattleTactic = "DisengageIfChallenged"
	// If in range of enemy weapons, move away. Only fire if cornered or if from a safe range
	BattleTacticMinimizeDamageToSelf BattleTactic = "MinimizeDamageToSelf"
	BattleTacticMaximizeNetDamage    BattleTactic = "MaximizeNetDamage"
	BattleTacticMaximizeDamageRatio  BattleTactic = "MaximizeDamageRatio"
	BattleTacticMaximizeDamage       BattleTactic = "MaximizeDamage"
)

type BattleTarget

type BattleTarget string
const (
	BattleTargetNone              BattleTarget = ""
	BattleTargetAny               BattleTarget = "Any"
	BattleTargetStarbase          BattleTarget = "Starbase"
	BattleTargetArmedShips        BattleTarget = "ArmedShips"
	BattleTargetBombersFreighters BattleTarget = "BombersFreighters"
	BattleTargetUnarmedShips      BattleTarget = "UnarmedShips"
	BattleTargetFuelTransports    BattleTarget = "FuelTransports"
	BattleTargetFreighters        BattleTarget = "Freighters"
)

type BattleVector

type BattleVector struct {
	X int `json:"x"`
	Y int `json:"y"`
}
var BattleVectorDown BattleVector = BattleVector{0, -1}
var BattleVectorDownLeft BattleVector = BattleVector{-1, -1}
var BattleVectorDownRight BattleVector = BattleVector{1, -1}
var BattleVectorLeft BattleVector = BattleVector{-1, 0}
var BattleVectorRight BattleVector = BattleVector{1, 0}
var BattleVectorUp BattleVector = BattleVector{0, 1}
var BattleVectorUpLeft BattleVector = BattleVector{-1, 1}
var BattleVectorUpRight BattleVector = BattleVector{1, 1}

func (BattleVector) Add

type Bitmask

type Bitmask uint32

type Bomb

type Bomb struct {
	Quantity             int     `json:"quantity,omitempty"`
	KillRate             float64 `json:"killRate,omitempty"`
	MinKillRate          int     `json:"minKillRate,omitempty"`
	StructureDestroyRate float64 `json:"structureDestroyRate,omitempty"`
	UnterraformRate      int     `json:"unterraformRate,omitempty"`
}

type Cargo

type Cargo struct {
	Ironium   int `json:"ironium,omitempty"`
	Boranium  int `json:"boranium,omitempty"`
	Germanium int `json:"germanium,omitempty"`
	Colonists int `json:"colonists,omitempty"`
}

Cargo represents minerals and colonists that are in cargo holds, salvage, mineral packets, or on planets.

func (Cargo) Add

func (c Cargo) Add(other Cargo) Cargo

func (*Cargo) AddAmount

func (c *Cargo) AddAmount(cargoType CargoType, transferAmount int) *Cargo

func (Cargo) AddCostMinerals

func (c Cargo) AddCostMinerals(other Cost) Cargo

func (Cargo) AddMineral

func (c Cargo) AddMineral(other Mineral) Cargo

func (Cargo) CanTransfer

func (c Cargo) CanTransfer(transferAmount Cargo) bool

return true if this cargo can have transferAmount taken from it

func (Cargo) CanTransferAmount

func (c Cargo) CanTransferAmount(cargoType CargoType, transferAmount int) bool

func (Cargo) GetAmount

func (c Cargo) GetAmount(t CargoType) int

get the amount for a type of cargo

func (Cargo) GreatestMineralType

func (c Cargo) GreatestMineralType() CargoType

get the mineral with the highest amount

func (Cargo) HasColonists

func (c Cargo) HasColonists() bool

func (Cargo) HasMinerals

func (c Cargo) HasMinerals() bool

func (Cargo) MinZero

func (c Cargo) MinZero() Cargo

return this cargo with a minimum of zero for each value

func (Cargo) Multiply

func (c Cargo) Multiply(product float64) Cargo

func (Cargo) Negative

func (c Cargo) Negative() Cargo

func (Cargo) PrettyString

func (c Cargo) PrettyString() string

func (Cargo) Subtract

func (c Cargo) Subtract(other Cargo) Cargo

func (*Cargo) SubtractAmount

func (c *Cargo) SubtractAmount(cargoType CargoType, transferAmount int) *Cargo

func (Cargo) ToCost

func (c Cargo) ToCost() Cost

func (Cargo) ToMineral

func (c Cargo) ToMineral() Mineral

func (Cargo) Total

func (c Cargo) Total() int

func (Cargo) WithCargo

func (c Cargo) WithCargo(t CargoType, amount int) Cargo

get the amount for a type of cargo

func (Cargo) WithPopulation

func (c Cargo) WithPopulation(amount int) Cargo

type CargoTransferRequest

type CargoTransferRequest struct {
	Cargo
	Fuel int `json:"fuel,omitempty"`
}

func (CargoTransferRequest) Negative

type CargoType

type CargoType int
const (
	Ironium CargoType = iota
	Boranium
	Germanium
	Colonists
	Fuel
)

func (CargoType) String

func (c CargoType) String() string

type Cleaner

type Cleaner interface {
	RemovePlayerDesignIntels(game *FullGame)
	AddScannerToInnateScannerPlanets(game *FullGame)
	AddRandomArtifactsToPlanets(game *FullGame)
	ResetHomeworldBaseHab(game *FullGame)
	FixMineralConc(game *FullGame)
}

func NewCleaner

func NewCleaner() Cleaner

type CometSize

type CometSize string
const (
	CometSmall  CometSize = "Small"
	CometMedium CometSize = "Medium"
	CometLarge  CometSize = "Large"
	CometHuge   CometSize = "Huge"
)

type CometStats

type CometStats struct {
	AllMinerals              int     `json:"minMinerals,omitempty"`
	AllRandomMinerals        int     `json:"randomMinerals,omitempty"`
	BonusMinerals            int     `json:"bonusMinerals,omitempty"`
	BonusRandomMinerals      int     `json:"bonusRandomMinerals,omitempty"`
	BonusMinConcentration    int     `json:"minConcentrationBonus,omitempty"`
	BonusRandomConcentration int     `json:"randomConcentrationBonus,omitempty"`
	BonusAffectsMinerals     int     `json:"affectsMinerals,omitempty"`
	MinTerraform             int     `json:"minTerraform,omitempty"`
	RandomTerraform          int     `json:"randomTerraform,omitempty"`
	AffectsHabs              int     `json:"affectsHabs,omitempty"`
	PopKilledPercent         float64 `json:"popKilledPercent,omitempty"`
}

each type of comet has stats for minerals added to each mineral type as well as some additional mineral types that get bonuses

type CompletionEstimator

type CompletionEstimator interface {
	// get the estimated years to build one item with minerals on hand and some yearly mineral/resource output
	GetYearsToBuildOne(item ProductionQueueItem, cost Cost, mineralsOnHand Mineral, yearlyAvailableToSpend Cost) int

	// get a ProductionQueue with estimates filled in
	GetProductionWithEstimates(rules *Rules, player *Player, planet Planet) ([]ProductionQueueItem, int)
}

The CompletionEstimator is used for populating completion estimates in a planet's production queue

func NewCompletionEstimator

func NewCompletionEstimator() CompletionEstimator

type Cost

type Cost struct {
	Ironium   int `json:"ironium,omitempty"`
	Boranium  int `json:"boranium,omitempty"`
	Germanium int `json:"germanium,omitempty"`
	Resources int `json:"resources,omitempty"`
}

A Cost represents minerals and resources required to build something, i.e. a mine, factory, or ship

func FromMineral

func FromMineral(m Mineral) Cost

func FromMineralAndResources

func FromMineralAndResources(m Mineral, resources int) Cost

func NewCost

func NewCost(
	ironium int,
	boranium int,
	germanium int,
	resources int,
) Cost

func (Cost) Add

func (c Cost) Add(other Cost) Cost

func (Cost) AddCargoMinerals

func (c Cost) AddCargoMinerals(other Cargo) Cost

func (Cost) Divide

func (a Cost) Divide(b Cost) float64

func (Cost) DivideByMineral

func (a Cost) DivideByMineral(b Mineral) float64

divide a cost by a mineral. This will tell us if we have enough minerals to build some item

func (Cost) MinZero

func (c Cost) MinZero() Cost

return this cost with a minimum of zero for each value

func (Cost) Minus

func (c Cost) Minus(other Cost) Cost

func (Cost) MinusMineral

func (c Cost) MinusMineral(other Mineral) Cost

func (Cost) MultiplyFloat64

func (c Cost) MultiplyFloat64(factor float64) Cost

func (Cost) MultiplyInt

func (c Cost) MultiplyInt(factor int) Cost

func (Cost) Negate

func (c Cost) Negate() Cost

func (Cost) NumBuildable

func (available Cost) NumBuildable(cost Cost) int

determine how many times and item costing cost can be built by available resources

func (Cost) ToCargo

func (c Cost) ToCargo() Cargo

func (Cost) ToMineral

func (c Cost) ToMineral() Mineral

func (Cost) Total

func (c Cost) Total() int

type CostCalculator

type CostCalculator interface {
	StarbaseUpgradeCost(design, newDesign *ShipDesign) Cost
	CostOfOne(player *Player, item ProductionQueueItem) (Cost, error)
}

The CostCalculator interface is used to calculate costs of single items or starbase upgrades This is used by planetary production and estimating production queue completion

func NewCostCalculator

func NewCostCalculator() CostCalculator

type DBObject

type DBObject struct {
	ID        int64     `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Every object stored in the database has an ID and a create/update timestamp. Though the cs package doesn't deal with the database, they are still part of the models

type Defense

type Defense struct {
	DefenseCoverage float64 `json:"defenseCoverage,omitempty"`
}

type Density

type Density string
const (
	DensitySparse Density = "Sparse"
	DensityNormal Density = "Normal"
	DensityDense  Density = "Dense"
	DensityPacked Density = "Packed"
)

type Engine

type Engine struct {
	IdealSpeed   int     `json:"idealSpeed,omitempty"`
	FreeSpeed    int     `json:"freeSpeed,omitempty"`
	MaxSafeSpeed int     `json:"maxSafeSpeed,omitempty"`
	FuelUsage    [11]int `json:"fuelUsage,omitempty"`
}

type Fleet

type Fleet struct {
	MapObject
	FleetOrders
	PlanetNum         int         `json:"planetNum"` // for starbase fleets that are owned by a planet
	BaseName          string      `json:"baseName"`
	Cargo             Cargo       `json:"cargo,omitempty"`
	Fuel              int         `json:"fuel"`
	Age               int         `json:"age"`
	Tokens            []ShipToken `json:"tokens"`
	Heading           Vector      `json:"heading,omitempty"`
	WarpSpeed         int         `json:"warpSpeed,omitempty"`
	PreviousPosition  *Vector     `json:"previousPosition,omitempty"`
	OrbitingPlanetNum int         `json:"orbitingPlanetNum,omitempty"`
	Starbase          bool        `json:"starbase,omitempty"`
	Spec              FleetSpec   `json:"spec,omitempty"`
	// contains filtered or unexported fields
}

Fleets are player owned collections of ships. Fleets have a slice of Tokens, one for each unique design in the fleet. Fleets also have orders that can be updated by the player, in the form of waypoints and the battle plan. Fleets are one of the commandable MapObjects in the game.

func (*Fleet) GetFuelCost

func (fleet *Fleet) GetFuelCost(player *Player, warpSpeed int, distance float64) int

Get the Fuel cost for this fleet to travel a certain distance at a certain speed

func (*Fleet) Idle

func (f *Fleet) Idle() bool

func (*Fleet) InjectDesigns

func (f *Fleet) InjectDesigns(designs []*ShipDesign) error

inject designs into tokens so all the various Compute* functions work

func (*Fleet) Orbiting

func (f *Fleet) Orbiting() bool

func (*Fleet) Rename

func (f *Fleet) Rename(name string)

func (*Fleet) String

func (f *Fleet) String() string

type FleetIntel

type FleetIntel struct {
	MapObjectIntel
	PlanetIntelID     int64       `json:"-,omitempty"` // for starbase fleets that are owned by a planet
	Heading           Vector      `json:"heading,omitempty"`
	OrbitingPlanetNum int         `json:"orbitingPlanetNum,omitempty"`
	WarpSpeed         int         `json:"warpSpeed,omitempty"`
	Mass              int         `json:"mass,omitempty"`
	Cargo             Cargo       `json:"cargo,omitempty"`
	CargoDiscovered   bool        `json:"cargoDiscovered,omitempty"`
	Freighter         bool        `json:"freighter,omitempty"`
	Tokens            []ShipToken `json:"tokens,omitempty"`
}

func (*FleetIntel) String

func (f *FleetIntel) String() string

type FleetOrders

type FleetOrders struct {
	Waypoints     []Waypoint   `json:"waypoints"`
	RepeatOrders  bool         `json:"repeatOrders,omitempty"`
	BattlePlanNum int          `json:"battlePlanNum,omitempty"`
	Purpose       FleetPurpose `json:"purpose,omitempty"`
}

type FleetPurpose

type FleetPurpose string
const (
	FleetPurposeNone              FleetPurpose = ""
	FleetPurposeScout             FleetPurpose = "Scout"
	FleetPurposeColonizer         FleetPurpose = "Colonizer"
	FleetPurposeBomber            FleetPurpose = "Bomber"
	FleetPurposeFighter           FleetPurpose = "Fighter"
	FleetPurposeCapitalShip       FleetPurpose = "CapitalShip"
	FleetPurposeFreighter         FleetPurpose = "Freighter"
	FleetPurposeColonistFreighter FleetPurpose = "ColonistFreighter"
	FleetPurposeArmedFreighter    FleetPurpose = "ArmedFreighter"
	FleetPurposeMineLayer         FleetPurpose = "MineLayer"
	FleetPurposeMiner             FleetPurpose = "Miner"
	FleetPurposeTerraformer       FleetPurpose = "Terraformer"
	FleetPurposeInvader           FleetPurpose = "Invader"
)

func FleetPurposeFromShipDesignPurpose

func FleetPurposeFromShipDesignPurpose(purpose ShipDesignPurpose) FleetPurpose

type FleetSpec

type FleetSpec struct {
	ShipDesignSpec
	BaseCloakedCargo int                        `json:"baseCloakedCargo"`
	BasePacketSpeed  int                        `json:"basePacketSpeed"`
	HasMassDriver    bool                       `json:"hasMassDriver,omitempty"`
	HasStargate      bool                       `json:"hasStargate,omitempty"`
	MassDriver       string                     `json:"massDriver,omitempty"`
	MassEmpty        int                        `json:"massEmpty"`
	MaxHullMass      int                        `json:"maxHullMass,omitempty"`
	MaxRange         int                        `json:"maxRange,omitempty"`
	Purposes         map[ShipDesignPurpose]bool `json:"purposes"`
	SafeHullMass     int                        `json:"safeHullMass,omitempty"`
	SafeRange        int                        `json:"safeRange,omitempty"`
	Stargate         string                     `json:"stargate,omitempty"`
	TotalShips       int                        `json:"totalShips"`
}

func ComputeFleetSpec

func ComputeFleetSpec(rules *Rules, player *Player, fleet *Fleet) FleetSpec

compute all the computable values of this fleet (cargo capacity, armor, mass)

type FullGame

type FullGame struct {
	*Game
	*Universe
	*TechStore
	Players []*Player `json:"players,omitempty"`
}

A game with players and a universe, used in universe and turn generation

func (*FullGame) IsSinglePlayer

func (g *FullGame) IsSinglePlayer() bool

return true if this is a single player game

type FullPlayer

type FullPlayer struct {
	Player
	PlayerMapObjects
}

a player and all mapobjects the player owns this is used by the UI when loading a player's game

type Game

type Game struct {
	DBObject
	HostID                       int64             `json:"hostId"`
	Name                         string            `json:"name" header:"Name"`
	State                        GameState         `json:"state"`
	Public                       bool              `json:"public,omitempty"`
	Hash                         string            `json:"hash"`
	Size                         Size              `json:"size"`
	Density                      Density           `json:"density"`
	PlayerPositions              PlayerPositions   `json:"playerPositions"`
	RandomEvents                 bool              `json:"randomEvents,omitempty"`
	ComputerPlayersFormAlliances bool              `json:"computerPlayersFormAlliances,omitempty"`
	PublicPlayerScores           bool              `json:"publicPlayerScores,omitempty"`
	MaxMinerals                  bool              `json:"maxMinerals,omitempty"`
	AcceleratedPlay              bool              `json:"acceleratedPlay,omitempty"`
	StartMode                    GameStartMode     `json:"startMode,omitempty"`
	QuickStartTurns              int               `json:"quickStartTurns,omitempty"`
	OpenPlayerSlots              int               `json:"openPlayerSlots,omitempty"`
	NumPlayers                   int               `json:"numPlayers,omitempty"`
	VictoryConditions            VictoryConditions `json:"victoryConditions"`
	Seed                         int64             `json:"seed"`
	Rules                        Rules             `json:"rules"`
	Area                         Vector            `json:"area,omitempty"`
	Year                         int               `json:"year,omitempty"`
	VictorDeclared               bool              `json:"victorDeclared"`
}

The Game itself tracks some settings, the Rules, the Host and the current state (year/victory declared) All other parts of a Game are stored in the Universe

func NewGame

func NewGame() *Game

func (*Game) GenerateHash

func (g *Game) GenerateHash(salt string) string

generate an invite hash for this game

func (*Game) String

func (g *Game) String() string

func (*Game) WithSettings

func (g *Game) WithSettings(settings GameSettings) *Game

update the game with new settings

func (*Game) YearsPassed

func (g *Game) YearsPassed() int

type GameDBObject

type GameDBObject struct {
	ID        int64     `json:"id"`
	GameID    int64     `json:"gameId"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

A GameObject is a database object that is associated with a game

type GameSettings

type GameSettings struct {
	Name                         string            `json:"name"`
	Public                       bool              `json:"public"`
	QuickStartTurns              int               `json:"quickStartTurns"`
	Size                         Size              `json:"size"`
	Density                      Density           `json:"density"`
	PlayerPositions              PlayerPositions   `json:"playerPositions"`
	RandomEvents                 bool              `json:"randomEvents"`
	ComputerPlayersFormAlliances bool              `json:"computerPlayersFormAlliances"`
	PublicPlayerScores           bool              `json:"publicPlayerScores"`
	MaxMinerals                  bool              `json:"maxMinerals"`
	AcceleratedPlay              bool              `json:"acceleratedPlay,omitempty"`
	StartMode                    GameStartMode     `json:"startMode"`
	VictoryConditions            VictoryConditions `json:"victoryConditions"`
	Players                      []NewGamePlayer   `json:"players,omitempty"`
	Rules                        *Rules            `json:"rules,omitempty"`
	TechStore                    *TechStore        `json:"techStore,omitempty"`
}

The settings for a new game, only used during game setup

func NewGameSettings

func NewGameSettings() *GameSettings

create a new GameSettings object for the default game

func (*GameSettings) IsSinglePlayer

func (settings *GameSettings) IsSinglePlayer() bool

func (*GameSettings) WithAIPlayer

func (settings *GameSettings) WithAIPlayer(aiDifficulty AIDifficulty, defaultHullSet int) *GameSettings

Add an AI player

func (*GameSettings) WithAIPlayerRace

func (settings *GameSettings) WithAIPlayerRace(race Race, aiDifficulty AIDifficulty, defaultHullSet int) *GameSettings

func (*GameSettings) WithDensity

func (settings *GameSettings) WithDensity(density Density) *GameSettings

func (*GameSettings) WithHost

func (settings *GameSettings) WithHost(race Race) *GameSettings

add a host to this game

func (*GameSettings) WithName

func (settings *GameSettings) WithName(name string) *GameSettings

set the name to this game

func (*GameSettings) WithOpenPlayerSlot

func (settings *GameSettings) WithOpenPlayerSlot() *GameSettings

Add a player slot open to any players

func (*GameSettings) WithPublicPlayerScores

func (settings *GameSettings) WithPublicPlayerScores(publicPlayerScores bool) *GameSettings

func (*GameSettings) WithSize

func (settings *GameSettings) WithSize(size Size) *GameSettings

type GameStartMode

type GameStartMode string
const (
	GameStartModeNormal   GameStartMode = ""
	GameStartModeMidGame  GameStartMode = "MidGame"
	GameStartModeLateGame GameStartMode = "LateGame"
	GameStartModeEndGame  GameStartMode = "EndGame"
)

type GameState

type GameState string
const (
	GameStateSetup               GameState = "Setup"
	GameStateGeneratingUniverse  GameState = "GeneratingUniverse"
	GameStateWaitingForPlayers   GameState = "WaitingForPlayers"
	GameStateGeneratingTurn      GameState = "GeneratingTurn"
	GameStateGeneratingTurnError GameState = "GeneratingTurnError"
)

type GameWithPlayers

type GameWithPlayers struct {
	Game
	Players []PlayerStatus `json:"players,omitempty"`
}

A game with a list of player statuses

func (*GameWithPlayers) IsSinglePlayer

func (g *GameWithPlayers) IsSinglePlayer() bool

return true if this is a single player game

type Gamer

type Gamer interface {

	// game creation
	CreateGame(hostID int64, settings GameSettings) *Game
	NewPlayer(userID int64, race Race, rules *Rules) *Player

	// universe/turn generation
	GenerateUniverse(game *Game, players []*Player) (*Universe, error)
	SubmitTurn(player *Player)
	GenerateTurn(game *Game, universe *Universe, players []*Player) error
	CheckAllPlayersSubmitted(players []*Player) bool

	// helper functions
	ComputeSpecs(game *FullGame) error
}

external interface for creating/interacting with games

func NewGamer

func NewGamer() Gamer

type Hab

type Hab struct {
	Grav int `json:"grav,omitempty"`
	Temp int `json:"temp,omitempty"`
	Rad  int `json:"rad,omitempty"`
}

Represents a habitability point for a planet. Values range from 1 to 99

func HabFromInts

func HabFromInts(hab [3]int) Hab

func (Hab) Add

func (h Hab) Add(other Hab) Hab

func (Hab) Clamp

func (h Hab) Clamp(min, max int) Hab

func (Hab) Get

func (h Hab) Get(habType HabType) int

func (*Hab) Set

func (h *Hab) Set(habType HabType, value int) *Hab

func (Hab) String

func (h Hab) String() string

func (Hab) Subtract

func (h Hab) Subtract(other Hab) Hab

type HabType

type HabType int
const (
	Grav HabType = iota
	Temp
	Rad
)

func (HabType) String

func (h HabType) String() string

type HullSlotType

type HullSlotType Bitmask

func (HullSlotType) String

func (hst HullSlotType) String() string

type Intel

type Intel struct {
	Name      string `json:"name"`
	Num       int    `json:"num"`
	PlayerNum int    `json:"playerNum"`
	ReportAge int    `json:"reportAge"`
}

func (*Intel) Owned

func (intel *Intel) Owned() bool

func (*Intel) String

func (intel *Intel) String() string

type LRT

type LRT Bitmask
const (
	// Only used for TechRequirements
	LRTNone = 0

	// Improved Fuel Efficiency
	IFE LRT = 1 << (iota - 1)

	// Total Terraforming
	TT

	// Advanced Remote Mining
	ARM

	// Improved Starbases
	ISB

	// Generalized Research
	GR

	// Ultimate Recycling
	UR

	// No Ramscoop Engines
	NRSE

	// Only Basic Remote Mining
	OBRM

	// No Advanced Scanners
	NAS

	// Low Starting Population
	LSP

	// Bleeding Edge Technology
	BET

	// Regenerating Shields
	RS

	// Mineral Alchemy
	MA

	// Cheap Engines
	CE
)

type LRTSpec

type LRTSpec struct {
	LRT                           LRT             `json:"lrt,omitempty"`
	StartingFleets                []StartingFleet `json:"startingFleets,omitempty"`
	PointCost                     int             `json:"pointCost,omitempty"`
	StartingTechLevels            TechLevel       `json:"startingTechLevels,omitempty"`
	TechCostOffset                TechCostOffset  `json:"techCostOffset,omitempty"`
	NewTechCostFactorOffset       float64         `json:"newTechCostFactorOffset,omitempty"`
	MiniaturizationMax            float64         `json:"miniaturizationMax,omitempty"`
	MiniaturizationPerLevel       float64         `json:"miniaturizationPerLevel,omitempty"`
	NoAdvancedScanners            bool            `json:"noAdvancedScanners,omitempty"`
	ScanRangeFactorOffset         float64         `json:"scanRangeFactorOffset,omitempty"`
	FuelEfficiencyOffset          float64         `json:"fuelEfficiencyOffset,omitempty"`
	MaxPopulationOffset           float64         `json:"maxPopulationOffset,omitempty"`
	TerraformCostOffset           Cost            `json:"terraformCostOffset,omitempty"`
	MineralAlchemyCostOffset      int             `json:"mineralAlchemyCostOffset,omitempty"`
	ScrapMineralOffset            float64         `json:"scrapMineralOffset,omitempty"`
	ScrapMineralOffsetStarbase    float64         `json:"scrapMineralOffsetStarbase,omitempty"`
	ScrapResourcesOffset          float64         `json:"scrapResourcesOffset,omitempty"`
	ScrapResourcesOffsetStarbase  float64         `json:"scrapResourcesOffsetStarbase,omitempty"`
	StartingPopulationFactorDelta float64         `json:"startingPopulationFactorDelta,omitempty"`
	StarbaseBuiltInCloakUnits     int             `json:"starbaseBuiltInCloakUnits,omitempty"`
	StarbaseCostFactorOffset      float64         `json:"starbaseCostFactorOffset,omitempty"`
	ResearchFactorOffset          float64         `json:"researchFactorOffset,omitempty"`
	ResearchSplashDamage          float64         `json:"researchSplashDamage,omitempty"`
	ShieldStrengthFactorOffset    float64         `json:"shieldStrengthFactorOffset,omitempty"`
	ShieldRegenerationRateOffset  float64         `json:"shieldRegenerationRateOffset,omitempty"`
	ArmorStrengthFactorOffset     float64         `json:"armorStrengthFactorOffset,omitempty"`
	EngineFailureRateOffset       float64         `json:"engineFailureRateOffset,omitempty"`
	EngineReliableSpeed           int             `json:"engineReliableSpeed,omitempty"`
}

type MapObject

type MapObject struct {
	GameDBObject
	Type      MapObjectType `json:"type"`
	Dirty     bool          `json:"-"`
	Delete    bool          `json:"-"`
	Position  Vector        `json:"position"`
	Num       int           `json:"num"`
	PlayerNum int           `json:"playerNum"`
	Name      string        `json:"name"`
	Tags      Tags          `json:"tags"`
}

Each object in the universe is a MapObject. MapObjects have a unique Num (and often a PlayerNum for player owned map objects), as well as a Position in space.

func (*MapObject) GetTag

func (mo *MapObject) GetTag(key string) string

func (*MapObject) MarkDirty

func (mo *MapObject) MarkDirty()

func (*MapObject) Owned

func (mo *MapObject) Owned() bool

func (*MapObject) OwnedBy

func (mo *MapObject) OwnedBy(num int) bool

func (*MapObject) SetTag

func (mo *MapObject) SetTag(key, value string)

func (*MapObject) String

func (mo *MapObject) String() string

type MapObjectIntel

type MapObjectIntel struct {
	Intel
	Type     MapObjectType `json:"type"`
	Position Vector        `json:"position"`
}

type MapObjectType

type MapObjectType string
const (
	MapObjectTypeNone          MapObjectType = ""
	MapObjectTypePlanet        MapObjectType = "Planet"
	MapObjectTypeFleet         MapObjectType = "Fleet"
	MapObjectTypeWormhole      MapObjectType = "Wormhole"
	MapObjectTypeMineField     MapObjectType = "MineField"
	MapObjectTypeMysteryTrader MapObjectType = "MysteryTrader"
	MapObjectTypeSalvage       MapObjectType = "Salvage"
	MapObjectTypeMineralPacket MapObjectType = "MineralPacket"
)

type MergeFleetOrder

type MergeFleetOrder struct {
	Source       *Fleet      `json:"source,omitempty"`
	Dest         *Fleet      `json:"dest,omitempty"`
	SourceTokens []ShipToken `json:"splitTokens,omitempty"`
	DestTokens   []ShipToken `json:"destTokens,omitempty"`
}

A MergeFleetOrder is for moving tokens between two fleets TODO: not yet implemented

type Messager

type Messager interface {
	// contains filtered or unexported methods
}

type MineField

type MineField struct {
	MapObject
	MineFieldOrders
	MineFieldType MineFieldType `json:"mineFieldType"`
	NumMines      int           `json:"numMines"`
	Spec          MineFieldSpec `json:"spec"`
}

func (*MineField) Radius

func (mf *MineField) Radius() float64

The radius of a minefield is the sqrt of its mines

type MineFieldIntel

type MineFieldIntel struct {
	MapObjectIntel
	NumMines      int           `json:"numMines"`
	MineFieldType MineFieldType `json:"mineFieldType"`
	Spec          MineFieldSpec `json:"spec"`
}

func (*MineFieldIntel) String

func (f *MineFieldIntel) String() string

type MineFieldOrders

type MineFieldOrders struct {
	Detonate bool `json:"detonate,omitempty"`
}

type MineFieldSpec

type MineFieldSpec struct {
	Radius    float64 `json:"radius"`
	DecayRate int     `json:"decayRate"`
}

type MineFieldStats

type MineFieldStats struct {
	MinDamagePerFleetRS int     `json:"minDamagePerFleetRS"`
	DamagePerEngineRS   int     `json:"damagePerEngineRS"`
	MaxSpeed            int     `json:"maxSpeed"`
	ChanceOfHit         float64 `json:"chanceOfHit"`
	MinDamagePerFleet   int     `json:"minDamagePerFleet"`
	DamagePerEngine     int     `json:"damagePerEngine"`
	SweepFactor         float64 `json:"sweepFactor"`
	MinDecay            int     `json:"minDecay"`
	CanDetonate         bool    `json:"canDetonate"`
}

type MineFieldType

type MineFieldType string
const (
	MineFieldTypeStandard  MineFieldType = "Standard"
	MineFieldTypeHeavy     MineFieldType = "Heavy"
	MineFieldTypeSpeedBump MineFieldType = "SpeedBump"
)

type MineLayingRateByMineType

type MineLayingRateByMineType struct {
}

type Mineral

type Mineral struct {
	Ironium   int `json:"ironium,omitempty"`
	Boranium  int `json:"boranium,omitempty"`
	Germanium int `json:"germanium,omitempty"`
}

Minerals are mined from planets and turned into Cargo

func NewMineral

func NewMineral(values [3]int) Mineral

func (Mineral) Add

func (m Mineral) Add(m2 Mineral) Mineral

add two minerals

func (Mineral) AddInt

func (m Mineral) AddInt(num int) Mineral

add an int to all components of the mineral

func (Mineral) Clamp

func (m Mineral) Clamp(min, max int) Mineral

func (Mineral) GreatestType

func (c Mineral) GreatestType() CargoType

func (Mineral) Minus

func (m Mineral) Minus(m2 Mineral) Mineral

subtract two minerals

func (Mineral) MinusCost

func (m Mineral) MinusCost(m2 Cost) Mineral

subtract the mineral components of a Cost

func (Mineral) MultiplyFloat64

func (c Mineral) MultiplyFloat64(factor float64) Mineral

func (Mineral) PrettyString

func (c Mineral) PrettyString() string

func (Mineral) String

func (m Mineral) String() string

func (Mineral) ToCargo

func (m Mineral) ToCargo() Cargo

convert a mineral to a cargo

func (Mineral) ToCost

func (m Mineral) ToCost() Cost

convert a mineral to a cost

func (Mineral) ToSlice

func (m Mineral) ToSlice() [3]int

func (Mineral) Total

func (m Mineral) Total() int

type MineralPacket

type MineralPacket struct {
	MapObject
	TargetPlanetNum int    `json:"targetPlanetNum,omitempty"`
	Cargo           Cargo  `json:"cargo,omitempty"`
	WarpSpeed       int    `json:"warpSpeed"`
	SafeWarpSpeed   int    `json:"safeWarpSpeed,omitempty"`
	Heading         Vector `json:"heading"`
	ScanRange       int    `json:"scanRange"`
	ScanRangePen    int    `json:"scanRangePen"`
	// contains filtered or unexported fields
}

Starbases with Packet Throwers can build mineral packets and fling them at other planets.

type MineralPacketDamage

type MineralPacketDamage struct {
	Killed            int `json:"killed,omitempty"`
	DefensesDestroyed int `json:"defensesDestroyed,omitempty"`
	Uncaught          int `json:"uncaught,omitempty"`
}

type MineralPacketIntel

type MineralPacketIntel struct {
	MapObjectIntel
	WarpSpeed       int    `json:"warpSpeed,omitempty"`
	Heading         Vector `json:"heading"`
	Cargo           Cargo  `json:"cargo,omitempty"`
	TargetPlanetNum int    `json:"targetPlanetNum,omitempty"`
}

func (*MineralPacketIntel) String

func (f *MineralPacketIntel) String() string

type MiniaturizationSpec

type MiniaturizationSpec struct {
	NewTechCostFactor       float64 `json:"newTechCostFactor,omitempty"`
	MiniaturizationMax      float64 `json:"miniaturizationMax,omitempty"`
	MiniaturizationPerLevel float64 `json:"miniaturizationPerLevel,omitempty"`
}

type MysteryTrader

type MysteryTrader struct {
	MapObject
	Heading   Vector            `json:"heading,omitempty"`
	WarpSpeed int               `json:"warpSpeed,omitempty"`
	Spec      MysteryTraderSpec `json:"spec,omitempty"`
}

The mystery trader travels through space and gives a boon to any player that gives it a fleet full of minerals TODO: not yet implemented

type MysteryTraderIntel

type MysteryTraderIntel struct {
	MapObjectIntel
	WarpSpeed int    `json:"warpSpeed,omitempty"`
	Heading   Vector `json:"heading"`
}

type MysteryTraderSpec

type MysteryTraderSpec struct {
}

type NewGamePlayer

type NewGamePlayer struct {
	Type           NewGamePlayerType `json:"type,omitempty"`
	AIDifficulty   AIDifficulty      `json:"aiDifficulty,omitempty"`
	Color          string            `json:"color,omitempty"`
	DefaultHullSet int               `json:"hullSetNum,omitempty"`
	Race           Race              `json:"race,omitempty"`
}

A new player in a game, only used during game setup

type NewGamePlayerType

type NewGamePlayerType string
const (
	NewGamePlayerTypeHost  NewGamePlayerType = "Host"
	NewGamePlayerTypeGuest NewGamePlayerType = "Guest"
	NewGamePlayerTypeOpen  NewGamePlayerType = "Open"
	NewGamePlayerTypeAI    NewGamePlayerType = "AI"
)

type NextResearchField

type NextResearchField string
const (
	NextResearchFieldSameField     NextResearchField = "SameField"
	NextResearchFieldEnergy        NextResearchField = "Energy"
	NextResearchFieldWeapons       NextResearchField = "Weapons"
	NextResearchFieldPropulsion    NextResearchField = "Propulsion"
	NextResearchFieldConstruction  NextResearchField = "Construction"
	NextResearchFieldElectronics   NextResearchField = "Electronics"
	NextResearchFieldBiotechnology NextResearchField = "Biotechnology"
	NextResearchFieldLowestField   NextResearchField = "LowestField"
)

type Orderer

type Orderer interface {
	UpdatePlayerOrders(player *Player, playerPlanets []*Planet, order PlayerOrders, rules *Rules)
	UpdatePlanetOrders(rules *Rules, player *Player, planet *Planet, orders PlanetOrders) error
	UpdateFleetOrders(player *Player, fleet *Fleet, orders FleetOrders)
	UpdateMineFieldOrders(player *Player, minefield *MineField, orders MineFieldOrders)
	TransferFleetCargo(rules *Rules, player, destPlayer *Player, source, dest *Fleet, transferAmount CargoTransferRequest) error
	TransferPlanetCargo(rules *Rules, player *Player, source *Fleet, dest *Planet, transferAmount CargoTransferRequest) error
	TransferSalvageCargo(rules *Rules, player *Player, source *Fleet, dest *Salvage, nextSalvageNum int, transferAmount CargoTransferRequest) (*Salvage, error)
	SplitFleet(rules *Rules, player *Player, playerFleets []*Fleet, request SplitFleetRequest) (source, dest *Fleet, err error)
	SplitAll(rules *Rules, player *Player, playerFleets []*Fleet, source *Fleet) ([]*Fleet, error)
	Merge(rules *Rules, player *Player, fleets []*Fleet) (*Fleet, error)
}

The Orderer interface is used to handle any game logic with updating orders. This is used for updating planet and fleet psecs after cargo transfer, splitting and merging fleets, updating research, etc.

func NewOrderer

func NewOrderer() Orderer

type PRT

type PRT string
const (
	/// This is only for tech requirements
	PRTNone PRT = ""

	/// Hyper Expansion
	HE PRT = "HE"

	/// Super Stealth
	SS PRT = "SS"

	/// Warmonger
	WM PRT = "WM"

	/// Claim Adjuster
	CA PRT = "CA"

	/// Inner Strength
	IS PRT = "IS"

	/// Space Demolition
	SD PRT = "SD"

	/// Packet Physics
	PP PRT = "PP"

	/// Interstellar Traveler
	IT PRT = "IT"

	/// Alternate Reality
	AR PRT = "AR"

	/// Jack of All Trades
	JoaT PRT = "JoaT"
)

type PRTSpec

type PRTSpec struct {
	PRT                              PRT              `json:"prt,omitempty"`
	PointCost                        int              `json:"pointCost,omitempty"`
	StartingTechLevels               TechLevel        `json:"startingTechLevels,omitempty"`
	StartingPlanets                  []StartingPlanet `json:"startingPlanets,omitempty"`
	TechCostOffset                   TechCostOffset   `json:"techCostOffset,omitempty"`
	MineralsPerSingleMineralPacket   int              `json:"mineralsPerSingleMineralPacket,omitempty"`
	MineralsPerMixedMineralPacket    int              `json:"mineralsPerMixedMineralPacket,omitempty"`
	PacketResourceCost               int              `json:"packetResourceCost,omitempty"`
	PacketMineralCostFactor          float64          `json:"packetMineralCostFactor,omitempty"`
	PacketReceiverFactor             float64          `json:"packetReceiverFactor,omitempty"`
	PacketDecayFactor                float64          `json:"packetDecayFactor,omitempty"`
	PacketOverSafeWarpPenalty        int              `json:"packetOverSafeWarpPenalty,omitempty"`
	PacketBuiltInScanner             bool             `json:"packetBuiltInScanner,omitempty"`
	DetectPacketDestinationStarbases bool             `json:"detectPacketDestinationStarbases,omitempty"`
	DetectAllPackets                 bool             `json:"detectAllPackets,omitempty"`
	PacketTerraformChance            float64          `json:"packetTerraformChance,omitempty"`
	PacketPermaformChance            float64          `json:"packetPermaformChance,omitempty"`
	PacketPermaTerraformSizeUnit     int              `json:"packetPermaTerraformSizeUnit,omitempty"`
	CanGateCargo                     bool             `json:"canGateCargo,omitempty"`
	CanDetectStargatePlanets         bool             `json:"canDetectStargatePlanets,omitempty"`
	ShipsVanishInVoid                bool             `json:"shipsVanishInVoid,omitempty"`
	BuiltInScannerMultiplier         int              `json:"builtInScannerMultiplier,omitempty"`
	TechsCostExtraLevel              int              `json:"techsCostExtraLevel,omitempty"`
	FreighterGrowthFactor            float64          `json:"freighterGrowthFactor,omitempty"`
	GrowthFactor                     float64          `json:"growthFactor,omitempty"`
	MaxPopulationOffset              float64          `json:"maxPopulationOffset,omitempty"`
	BuiltInCloakUnits                int              `json:"builtInCloakUnits,omitempty"`
	StealsResearch                   StealsResearch   `json:"stealsResearch,omitempty"`
	FreeCargoCloaking                bool             `json:"freeCargoCloaking,omitempty"`
	MineFieldsAreScanners            bool             `json:"mineFieldsAreScanners,omitempty"`
	MineFieldRateMoveFactor          float64          `json:"mineFieldRateMoveFactor,omitempty"`
	MineFieldSafeWarpBonus           int              `json:"mineFieldSafeWarpBonus,omitempty"`
	MineFieldMinDecayFactor          float64          `json:"mineFieldMinDecayFactor,omitempty"`
	MineFieldBaseDecayRate           float64          `json:"mineFieldBaseDecayRate,omitempty"`
	MineFieldPlanetDecayRate         float64          `json:"mineFieldPlanetDecayRate,omitempty"`
	MineFieldMaxDecayRate            float64          `json:"mineFieldMaxDecayRate,omitempty"`
	CanDetonateMineFields            bool             `json:"canDetonateMineFields,omitempty"`
	MineFieldDetonateDecayRate       float64          `json:"mineFieldDetonateDecayRate,omitempty"`
	DiscoverDesignOnScan             bool             `json:"discoverDesignOnScan,omitempty"`
	CanRemoteMineOwnPlanets          bool             `json:"canRemoteMineOwnPlanets,omitempty"`
	InvasionAttackBonus              float64          `json:"invasionAttackBonus,omitempty"`
	InvasionDefendBonus              float64          `json:"invasionDefendBonus,omitempty"`
	MovementBonus                    int              `json:"movementBonus,omitempty"`
	Instaforming                     bool             `json:"instaforming,omitempty"`
	PermaformChance                  float64          `json:"permaformChance,omitempty"`
	PermaformPopulation              int              `json:"permaformPopulation,omitempty"`
	RepairFactor                     float64          `json:"repairFactor,omitempty"`
	StarbaseRepairFactor             float64          `json:"starbaseRepairFactor,omitempty"`
	StarbaseCostFactor               float64          `json:"starbaseCostFactor,omitempty"`
	InnateMining                     bool             `json:"innateMining,omitempty"`
	InnateResources                  bool             `json:"innateResources,omitempty"`
	InnateScanner                    bool             `json:"innateScanner,omitempty"`
	InnatePopulationFactor           float64          `json:"innatePopulationFactor,omitempty"`
	CanBuildDefenses                 bool             `json:"canBuildDefenses,omitempty"`
	LivesOnStarbases                 bool             `json:"livesOnStarbases,omitempty"`
}

type Planet

type Planet struct {
	MapObject
	PlanetOrders
	Hab                  Hab        `json:"hab,omitempty"`
	BaseHab              Hab        `json:"baseHab,omitempty"`
	TerraformedAmount    Hab        `json:"terraformedAmount,omitempty"`
	MineralConcentration Mineral    `json:"mineralConcentration,omitempty"`
	MineYears            Mineral    `json:"mineYears,omitempty"`
	Cargo                Cargo      `json:"cargo,omitempty"`
	Mines                int        `json:"mines,omitempty"`
	Factories            int        `json:"factories,omitempty"`
	Defenses             int        `json:"defenses,omitempty"`
	Homeworld            bool       `json:"homeworld,omitempty"`
	Scanner              bool       `json:"scanner,omitempty"`
	Spec                 PlanetSpec `json:"spec,omitempty"`
	RandomArtifact       bool       `json:"-"`
	Starbase             *Fleet     `json:"-"`
	// contains filtered or unexported fields
}

Planets are the only static and constant MapObject. They don't move and they can't be destroyed. Players also start the game knowing all planet names and locations. I suppose these should have been named Stars, since they represent a star system, ah well..

func NewPlanet

func NewPlanet() *Planet

func (*Planet) CanBuild

func (p *Planet) CanBuild(mass int) bool

true if this planet can build a ship with a given mass

func (*Planet) PopulateProductionQueueDesigns

func (p *Planet) PopulateProductionQueueDesigns(player *Player) error

add designs to each production queue item

func (*Planet) PopulateProductionQueueEstimates

func (p *Planet) PopulateProductionQueueEstimates(rules *Rules, player *Player)

populate the costs of each item in the planet production queue

func (*Planet) PopulateStarbaseDesign

func (p *Planet) PopulateStarbaseDesign(player *Player) error

populate a starbase design for a planet

func (*Planet) String

func (p *Planet) String() string

func (*Planet) WithCargo

func (p *Planet) WithCargo(cargo Cargo) *Planet

func (*Planet) WithMineYears

func (p *Planet) WithMineYears(mineYears Mineral) *Planet

func (*Planet) WithMineralConcentration

func (p *Planet) WithMineralConcentration(mineralConcentration Mineral) *Planet

func (*Planet) WithMines

func (p *Planet) WithMines(mines int) *Planet

func (*Planet) WithNum

func (p *Planet) WithNum(num int) *Planet

func (*Planet) WithPlayerNum

func (p *Planet) WithPlayerNum(playerNum int) *Planet

func (*Planet) WithScanner

func (p *Planet) WithScanner(scanner bool) *Planet

type PlanetIntel

type PlanetIntel struct {
	MapObjectIntel
	Hab                           Hab         `json:"hab,omitempty"`
	BaseHab                       Hab         `json:"baseHab,omitempty"`
	MineralConcentration          Mineral     `json:"mineralConcentration,omitempty"`
	Starbase                      *FleetIntel `json:"starbase,omitempty"`
	Cargo                         Cargo       `json:"cargo,omitempty"`
	CargoDiscovered               bool        `json:"cargoDiscovered,omitempty"`
	PlanetHabitability            int         `json:"planetHabitability,omitempty"`
	PlanetHabitabilityTerraformed int         `json:"planetHabitabilityTerraformed,omitempty"`
	Spec                          PlanetSpec  `json:"spec,omitempty"`
}

func (*PlanetIntel) Explored

func (intel *PlanetIntel) Explored() bool

true if we have explored this planet

func (*PlanetIntel) String

func (p *PlanetIntel) String() string

func (*PlanetIntel) Unexplored

func (intel *PlanetIntel) Unexplored() bool

true if we haven't explored this planet

type PlanetOrders

type PlanetOrders struct {
	ContributesOnlyLeftoverToResearch bool                  `json:"contributesOnlyLeftoverToResearch,omitempty"`
	ProductionQueue                   []ProductionQueueItem `json:"productionQueue,omitempty"`
	RouteTargetType                   MapObjectType         `json:"routeTargetType,omitempty"`
	RouteTargetNum                    int                   `json:"routeTargetNum,omitempty"`
	RouteTargetPlayerNum              int                   `json:"routeTargetPlayerNum,omitempty"`
	PacketTargetNum                   int                   `json:"packetTargetNum,omitempty"`
	PacketSpeed                       int                   `json:"packetSpeed,omitempty"`
}

type PlanetSpec

type PlanetSpec struct {
	PlanetStarbaseSpec
	CanTerraform                              bool    `json:"canTerraform,omitempty"`
	Defense                                   string  `json:"defense,omitempty"`
	DefenseCoverage                           float64 `json:"defenseCoverage,omitempty"`
	DefenseCoverageSmart                      float64 `json:"defenseCoverageSmart,omitempty"`
	GrowthAmount                              int     `json:"growthAmount,omitempty"`
	Habitability                              int     `json:"habitability,omitempty"`
	MaxDefenses                               int     `json:"maxDefenses,omitempty"`
	MaxFactories                              int     `json:"maxFactories,omitempty"`
	MaxMines                                  int     `json:"maxMines,omitempty"`
	MaxPopulation                             int     `json:"maxPopulation,omitempty"`
	MaxPossibleFactories                      int     `json:"maxPossibleFactories,omitempty"`
	MaxPossibleMines                          int     `json:"maxPossibleMines,omitempty"`
	MiningOutput                              Mineral `json:"miningOutput,omitempty"`
	Population                                int     `json:"population,omitempty"`
	PopulationDensity                         float64 `json:"populationDensity,omitempty"`
	ResourcesPerYear                          int     `json:"resourcesPerYear,omitempty"`
	ResourcesPerYearAvailable                 int     `json:"resourcesPerYearAvailable,omitempty"`
	ResourcesPerYearResearch                  int     `json:"resourcesPerYearResearch,omitempty"`
	ResourcesPerYearResearchEstimatedLeftover int     `json:"resourcesPerYearResearchEstimatedLeftover,omitempty"`
	Scanner                                   string  `json:"scanner,omitempty"`
	ScanRange                                 int     `json:"scanRange,omitempty"`
	ScanRangePen                              int     `json:"scanRangePen,omitempty"`
	TerraformAmount                           Hab     `json:"terraformAmount,omitempty"`
	MinTerraformAmount                        Hab     `json:"minTerraformAmount,omitempty"`
	TerraformedHabitability                   int     `json:"terraformedHabitability,omitempty"`
	Contested                                 bool    `json:"contested,omitempty"`
}

type PlanetStarbaseSpec

type PlanetStarbaseSpec struct {
	HasMassDriver      bool   `json:"hasMassDriver,omitempty"`
	HasStarbase        bool   `json:"hasStarbase,omitempty"`
	HasStargate        bool   `json:"hasStargate,omitempty"`
	StarbaseDesignName string `json:"starbaseDesignName,omitempty"`
	StarbaseDesignNum  int    `json:"starbaseDesignNum,omitempty"`
	DockCapacity       int    `json:"dockCapacity,omitempty"`
	BasePacketSpeed    int    `json:"basePacketSpeed,omitempty"`
	SafePacketSpeed    int    `json:"safePacketSpeed,omitempty"`
	SafeHullMass       int    `json:"safeHullMass,omitempty"`
	SafeRange          int    `json:"safeRange,omitempty"`
	MaxRange           int    `json:"maxRange,omitempty"`
	MaxHullMass        int    `json:"maxHullMass,omitempty"`
	Stargate           string `json:"stargate,omitempty"`
	MassDriver         string `json:"massDriver,omitempty"`
}

type Player

type Player struct {
	GameDBObject
	PlayerOrders
	PlayerIntels
	PlayerPlans
	UserID                    int64                `json:"userId,omitempty"`
	Name                      string               `json:"name,omitempty"`
	Num                       int                  `json:"num,omitempty"`
	Ready                     bool                 `json:"ready"`
	AIControlled              bool                 `json:"aiControlled,omitempty"`
	Guest                     bool                 `json:"guest,omitempty"`
	SubmittedTurn             bool                 `json:"submittedTurn"`
	Color                     string               `json:"color,omitempty"`
	DefaultHullSet            int                  `json:"defaultHullSet,omitempty"`
	Race                      Race                 `json:"race,omitempty"`
	TechLevels                TechLevel            `json:"techLevels,omitempty"`
	TechLevelsSpent           TechLevel            `json:"techLevelsSpent,omitempty"`
	ResearchSpentLastYear     int                  `json:"researchSpentLastYear,omitempty"`
	Relations                 []PlayerRelationship `json:"relations,omitempty"`
	Messages                  []PlayerMessage      `json:"messages,omitempty"`
	Designs                   []*ShipDesign        `json:"designs,omitempty"`
	ScoreHistory              []PlayerScore        `json:"scoreHistory"`
	AchievedVictoryConditions Bitmask              `json:"achievedVictoryConditions,omitempty"`
	Victor                    bool                 `json:"victor"`
	Stats                     *PlayerStats         `json:"stats,omitempty"`
	Spec                      PlayerSpec           `json:"spec,omitempty"`
	// contains filtered or unexported fields
}

A Player contains all intel, messages, tech levels, and research orders for a single empire in the game. It is tied to a single User (or no user, for AI)

func NewPlayer

func NewPlayer(userID int64, race *Race) *Player

create a new player with an existing race. The race will be copied for the player

func (*Player) CanLearnTech

func (p *Player) CanLearnTech(tech *Tech) bool

func (*Player) GetDesign

func (p *Player) GetDesign(num int) *ShipDesign

Get a player ShipDesign, or nil if no design found

func (*Player) GetDesignByName

func (p *Player) GetDesignByName(name string) *ShipDesign

Get a player ShipDesign, or nil if no design found

func (*Player) GetForeignDesign

func (p *Player) GetForeignDesign(playerNum int, num int) *ShipDesignIntel

Get a ShipDesignIntel, or nil if no design found

func (*Player) GetLatestDesign

func (p *Player) GetLatestDesign(purpose ShipDesignPurpose) *ShipDesign

get the latest ship design by purpose

func (*Player) GetNextBattlePlanNum

func (p *Player) GetNextBattlePlanNum() int

get the next BattlePlan number to use

func (*Player) GetNextDesignNum

func (p *Player) GetNextDesignNum(designs []*ShipDesign) int

get the next design number to use

func (*Player) GetNextProductionPlanNum

func (p *Player) GetNextProductionPlanNum() int

get the next ProductionPlan number to use

func (*Player) GetNextTransportPlanNum

func (p *Player) GetNextTransportPlanNum() int

get the next TransportPlan number to use

func (*Player) GetResearchCost

func (p *Player) GetResearchCost(rules *Rules, techLevel TechLevel) int

return the cost, in resources, it will take to reach this tech level

func (*Player) GetScore

func (p *Player) GetScore() PlayerScore

return the most recent PlayerScore or an empty score if there is no score history

func (*Player) HasTech

func (p *Player) HasTech(tech *Tech) bool

return true if the player currently has this tech

func (*Player) InjectDesigns

func (p *Player) InjectDesigns(fleets []*Fleet) error

inject player designs into tokens for a slice of fleets

func (*Player) IsEnemy

func (p *Player) IsEnemy(playerNum int) bool

func (*Player) IsFriend

func (p *Player) IsFriend(playerNum int) bool

func (*Player) IsNeutral

func (p *Player) IsNeutral(playerNum int) bool

func (*Player) String

func (p *Player) String() string

func (*Player) WithAIControlled

func (p *Player) WithAIControlled(aiControlled bool) *Player

func (*Player) WithNextResearchField

func (p *Player) WithNextResearchField(field NextResearchField) *Player

func (*Player) WithNum

func (p *Player) WithNum(num int) *Player

func (*Player) WithResearching

func (p *Player) WithResearching(field TechField) *Player

func (*Player) WithTechLevels

func (p *Player) WithTechLevels(tl TechLevel) *Player

func (*Player) WithTechLevelsSpent

func (p *Player) WithTechLevelsSpent(tl TechLevel) *Player

type PlayerIntel

type PlayerIntel struct {
	Name           string `json:"name,omitempty"`
	Num            int    `json:"num,omitempty"`
	Color          string `json:"color,omitempty"`
	Seen           bool   `json:"seen,omitempty"`
	RaceName       string `json:"raceName,omitempty"`
	RacePluralName string `json:"racePluralName,omitempty"`
}

type PlayerIntels

type PlayerIntels struct {
	BattleRecords       []BattleRecord       `json:"battleRecords,omitempty"`
	PlayerIntels        []PlayerIntel        `json:"playerIntels,omitempty"`
	ScoreIntels         []ScoreIntel         `json:"scoreIntels,omitempty"`
	PlanetIntels        []PlanetIntel        `json:"planetIntels,omitempty"`
	FleetIntels         []FleetIntel         `json:"fleetIntels,omitempty"`
	StarbaseIntels      []FleetIntel         `json:"starbaseIntels,omitempty"`
	ShipDesignIntels    []ShipDesignIntel    `json:"shipDesignIntels,omitempty"`
	MineralPacketIntels []MineralPacketIntel `json:"mineralPacketIntels,omitempty"`
	MineFieldIntels     []MineFieldIntel     `json:"mineFieldIntels,omitempty"`
	WormholeIntels      []WormholeIntel      `json:"wormholeIntels,omitempty"`
	MysteryTraderIntels []MysteryTraderIntel `json:"mysteryTraderIntels,omitempty"`
	SalvageIntels       []SalvageIntel       `json:"salvageIntels,omitempty"`
}

type PlayerMapObjects

type PlayerMapObjects struct {
	Planets        []*Planet        `json:"planets"`
	Fleets         []*Fleet         `json:"fleets"`
	Starbases      []*Fleet         `json:"starbases"`
	MineFields     []*MineField     `json:"mineFields"`
	MineralPackets []*MineralPacket `json:"mineralPackets"`
}

All mapobjects that a player can issue commands to

type PlayerMessage

type PlayerMessage struct {
	Type            PlayerMessageType       `json:"type,omitempty"`
	Text            string                  `json:"text,omitempty"`
	TargetNum       int                     `json:"targetNum,omitempty"`
	TargetPlayerNum int                     `json:"targetPlayerNum,omitempty"`
	BattleNum       int                     `json:"battleNum,omitempty"`
	TargetType      PlayerMessageTargetType `json:"targetType,omitempty"`
	Spec            PlayerMessageSpec       `json:"spec,omitempty"`
}

Throughout a turn various events will result in messages being sent to players. Messages have a type and a target (the target is focused in the UI when you click the Goto button) Messages also have a Spec that is used to store specific numbers for the UI to display on the message.

type PlayerMessageSpec

type PlayerMessageSpec struct {
	Amount          int                     `json:"amount,omitempty"`
	PrevAmount      int                     `json:"prevAmount,omitempty"`
	SourcePlayerNum int                     `json:"sourcePlayerNum,omitempty"`
	DestPlayerNum   int                     `json:"destPlayerNum,omitempty"`
	Name            string                  `json:"name,omitempty"`
	Cost            *Cost                   `json:"cost,omitempty"`
	QueueItemType   QueueItemType           `json:"queueItemType,omitempty"`
	Field           TechField               `json:"field,omitempty"`
	NextField       TechField               `json:"nextField,omitempty"`
	TechGained      string                  `json:"techGained,omitempty"`
	LostTargetType  MapObjectType           `json:"lostTargetType,omitempty"`
	Battle          BattleRecordStats       `json:"battle,omitempty"`
	Comet           *PlayerMessageSpecComet `json:"comet,omitempty"`
}

The PlayerMessageSpec contains data specific to each message, like the amount of mines built of the field of research leveled up in.

type PlayerMessageSpecComet

type PlayerMessageSpecComet struct {
	Size                          CometSize `json:"size,omitempty"`
	MineralsAdded                 Mineral   `json:"mineralsAdded,omitempty"`
	MineralConcentrationIncreased Mineral   `json:"mineralConcentrationIncreased,omitempty"`
	HabChanged                    Hab       `json:"habChanged,omitempty"`
	ColonistsKilled               int       `json:"colonistsKilled,omitempty"`
}

type PlayerMessageTargetType

type PlayerMessageTargetType string
const (
	TargetNone          PlayerMessageTargetType = ""
	TargetPlanet        PlayerMessageTargetType = "Planet"
	TargetFleet         PlayerMessageTargetType = "Fleet"
	TargetWormhole      PlayerMessageTargetType = "Wormhole"
	TargetMineField     PlayerMessageTargetType = "MineField"
	TargetMysteryTrader PlayerMessageTargetType = "MysteryTrader"
	TargetMineralPacket PlayerMessageTargetType = "MineralPacket"
	TargetBattle        PlayerMessageTargetType = "Battle"
)

type PlayerMessageType

type PlayerMessageType int
const (
	PlayerMessageNone PlayerMessageType = iota
	PlayerMessageInfo
	PlayerMessageError
	PlayerMessageHomePlanet
	PlayerMessagePlayerDiscovery
	PlayerMessagePlanetDiscovery
	PlayerMessagePlanetProductionQueueEmpty
	PlayerMessagePlanetProductionQueueComplete
	PlayerMessageBuiltMineralAlchemy
	PlayerMessageBuiltMine
	PlayerMessageBuiltFactory
	PlayerMessageBuiltDefense
	PlayerMessageBuiltShip
	PlayerMessageBuiltStarbase
	PlayerMessageBuiltScanner
	PlayerMessageBuiltMineralPacket
	PlayerMessageBuiltTerraform
	PlayerMessageFleetOrdersComplete
	PlayerMessageFleetEngineFailure
	PlayerMessageFleetOutOfFuel
	PlayerMessageFleetGeneratedFuel
	PlayerMessageFleetScrapped
	PlayerMessageFleetMerged
	PlayerMessageFleetInvalidMergeNotFleet
	PlayerMessageFleetInvalidMergeUnowned
	PlayerMessageFleetPatrolTargeted
	PlayerMessageFleetInvalidRouteNotFriendlyPlanet
	PlayerMessageFleetInvalidRouteNotPlanet
	PlayerMessageFleetInvalidRouteNoRouteTarget
	PlayerMessageFleetInvalidTransport
	PlayerMessageFleetRoute
	PlayerMessageInvalid
	PlayerMessagePlanetColonized
	PlayerMessageGainTechLevel
	PlayerMessageMyPlanetBombed
	PlayerMessageMyPlanetRetroBombed
	PlayerMessageEnemyPlanetBombed
	PlayerMessageEnemyPlanetRetroBombed
	PlayerMessageMyPlanetInvaded
	PlayerMessageEnemyPlanetInvaded
	PlayerMessageBattle
	PlayerMessageCargoTransferred
	PlayerMessageMinesSwept
	PlayerMessageMinesLaid
	PlayerMessageMineFieldHit
	PlayerMessageFleetDumpedCargo
	PlayerMessageFleetStargateDamaged
	PlayerMessageMineralPacketCaught
	PlayerMessageMineralPacketDamage
	PlayerMessageMineralPacketLanded
	PlayerMessageMineralPacketDiscovered
	PlayerMessageMineralPacketTargettingPlayerDiscovered
	PlayerMessageVictor
	PlayerMessageFleetReproduce
	PlayerMessageRandomMineralDeposit
	PlayerMessagePermaform
	PlayerMessageInstaform
	PlayerMessagePacketTerraform
	PlayerMessagePacketPermaform
	PlayerMessageRemoteMined
	PlayerMessageTechGained
	PlayerMessageFleetTargetLost
	PlayerMessageFleetRadiatingEngineDieoff
	PlayerMessagePlanetDiedOff
	PlayerMessagePlanetEmptied
	PlayerMessagePlanetDiscoveryHabitable
	PlayerMessagePlanetDiscoveryTerraformable
	PlayerMessagePlanetDiscoveryUninhabitable
	PlayerMessageBuildInvalidItem
	PlayerMessageBuildMineralPacketNoMassDriver
	PlayerMessageBuildMineralPacketNoTarget
	PlayerMessagePlanetPopulationDecreased
	PlayerMessagePlanetPopulationDecreasedOvercrowding
	PlayerMessagePlayerDead
	PlayerMessagePlayerNoPlanets
	PlayerMessageCometStrike
	PlayerMessageCometStrikeMyPlanet
	PlayerMessageFleetShipExceededSafeSpeed
	PlayerMessageBonusResearchArtifact
	PlayerMessageFleetTransferGiven
	PlayerMessageFleetTransferGivenFailed
	PlayerMessageFleetTransferGivenFailedColonists
	PlayerMessageFleetTransferGivenRefused
	PlayerMessageFleetTransferReceived
	PlayerMessageFleetTransferReceivedFailed
	PlayerMessageFleetTransferReceivedRefused
	PlayerMessageTechLevelGainedInvasion
	PlayerMessageTechLevelGainedScrapFleet
	PlayerMessageTechLevelGainedBattle
	PlayerMessageFleetDieoff
)

type PlayerOrders

type PlayerOrders struct {
	Researching       TechField         `json:"researching,omitempty"`
	NextResearchField NextResearchField `json:"nextResearchField,omitempty"`
	ResearchAmount    int               `json:"researchAmount,omitempty"`
}

type PlayerPlans

type PlayerPlans struct {
	ProductionPlans []ProductionPlan `json:"productionPlans,omitempty"`
	BattlePlans     []BattlePlan     `json:"battlePlans,omitempty"`
	TransportPlans  []TransportPlan  `json:"transportPlans,omitempty"`
}

type PlayerPositions

type PlayerPositions string
const (
	PlayerPositionsClose    PlayerPositions = "Close"
	PlayerPositionsModerate PlayerPositions = "Moderate"
	PlayerPositionsFarther  PlayerPositions = "Farther"
	PlayerPositionsDistant  PlayerPositions = "Distant"
)

type PlayerRelation

type PlayerRelation string
const (
	PlayerRelationNeutral PlayerRelation = "Neutral"
	PlayerRelationFriend  PlayerRelation = "Friend"
	PlayerRelationEnemy   PlayerRelation = "Enemy"
)

type PlayerRelationship

type PlayerRelationship struct {
	Relation PlayerRelation `json:"relation"`
	ShareMap bool           `json:"shareMap,omitempty"`
}

type PlayerScore

type PlayerScore struct {
	Planets                   int     `json:"planets"`
	Starbases                 int     `json:"starbases"`
	UnarmedShips              int     `json:"unarmedShips"`
	EscortShips               int     `json:"escortShips"`
	CapitalShips              int     `json:"capitalShips"`
	TechLevels                int     `json:"techLevels"`
	Resources                 int     `json:"resources"`
	Score                     int     `json:"score"`
	Rank                      int     `json:"rank"`
	AchievedVictoryConditions Bitmask `json:"achievedVictoryConditions"`
}

type PlayerSpec

type PlayerSpec struct {
	PlanetaryScanner                  TechPlanetaryScanner                `json:"planetaryScanner,omitempty"`
	Defense                           TechDefense                         `json:"defense,omitempty"`
	Terraform                         map[TerraformHabType]*TechTerraform `json:"terraform,omitempty"`
	ResourcesPerYear                  int                                 `json:"resourcesPerYear,omitempty"`
	ResourcesPerYearResearch          int                                 `json:"resourcesPerYearResearch,omitempty"`
	ResourcesPerYearResearchEstimated int                                 `json:"resourcesPerYearResearchEstimated,omitempty"`
	CurrentResearchCost               int                                 `json:"currentResearchCost,omitempty"`
}

type PlayerStats

type PlayerStats struct {
	FleetsBuilt      int `json:"fleetsBuilt,omitempty"`
	StarbasesBuilt   int `json:"starbasesBuilt,omitempty"`
	TokensBuilt      int `json:"tokensBuilt,omitempty"`
	PlanetsColonized int `json:"planetsColonized,omitempty"`
}

type PlayerStatus

type PlayerStatus struct {
	UpdatedAt     *time.Time `json:"updatedAt,omitempty"`
	UserID        int64      `json:"userId,omitempty"`
	Name          string     `json:"name,omitempty"`
	Num           int        `json:"num,omitempty"`
	Ready         bool       `json:"ready,omitempty"`
	AIControlled  bool       `json:"aiControlled,omitempty"`
	Guest         bool       `json:"guest,omitempty"`
	SubmittedTurn bool       `json:"submittedTurn,omitempty"`
	Color         string     `json:"color,omitempty"`
	Victor        bool       `json:"victor,omitempty"`
}

type ProductionPlan

type ProductionPlan struct {
	Num                               int                  `json:"num"`
	Name                              string               `json:"name"`
	Items                             []ProductionPlanItem `json:"items"`
	ContributesOnlyLeftoverToResearch bool                 `json:"contributesOnlyLeftoverToResearch,omitempty"`
}

func (*ProductionPlan) Apply

func (plan *ProductionPlan) Apply(planet *Planet)

Apply a production plan to a planet

func (*ProductionPlan) Validate

func (plan *ProductionPlan) Validate(player *Player) error

validate this production plan

type ProductionPlanItem

type ProductionPlanItem struct {
	Type      QueueItemType `json:"type"`
	DesignNum int           `json:"designNum"`
	Quantity  int           `json:"quantity"`
}

type ProductionQueueItem

type ProductionQueueItem struct {
	QueueItemCompletionEstimate
	Type      QueueItemType `json:"type"`
	DesignNum int           `json:"designNum,omitempty"`
	Quantity  int           `json:"quantity"`
	Allocated Cost          `json:"allocated"`
	Tags      Tags          `json:"tags"`
	// contains filtered or unexported fields
}

func NewProductionQueueItemShip

func NewProductionQueueItemShip(quantity int, design *ShipDesign) *ProductionQueueItem

func (*ProductionQueueItem) GetTag

func (item *ProductionQueueItem) GetTag(key string) string

func (*ProductionQueueItem) SetDesign

func (item *ProductionQueueItem) SetDesign(design *ShipDesign)

func (*ProductionQueueItem) String

func (item *ProductionQueueItem) String() string

func (*ProductionQueueItem) WithTag

func (item *ProductionQueueItem) WithTag(key, value string) *ProductionQueueItem

type QueueItemCompletionEstimate

type QueueItemCompletionEstimate struct {
	Skipped         bool `json:"skipped,omitempty"`
	YearsToBuildOne int  `json:"yearsToBuildOne,omitempty"`
	YearsToBuildAll int  `json:"yearsToBuildAll,omitempty"`
	YearsToSkipAuto int  `json:"yearsToSkipAuto,omitempty"`
}

type QueueItemType

type QueueItemType string
const (
	QueueItemTypeIroniumMineralPacket   QueueItemType = "IroniumMineralPacket"
	QueueItemTypeBoraniumMineralPacket  QueueItemType = "BoraniumMineralPacket"
	QueueItemTypeGermaniumMineralPacket QueueItemType = "GermaniumMineralPacket"
	QueueItemTypeMixedMineralPacket     QueueItemType = "MixedMineralPacket"
	QueueItemTypeFactory                QueueItemType = "Factory"
	QueueItemTypeMine                   QueueItemType = "Mine"
	QueueItemTypeDefenses               QueueItemType = "Defenses"
	QueueItemTypeMineralAlchemy         QueueItemType = "MineralAlchemy"
	QueueItemTypeTerraformEnvironment   QueueItemType = "TerraformEnvironment"
	QueueItemTypeAutoMines              QueueItemType = "AutoMines"
	QueueItemTypeAutoFactories          QueueItemType = "AutoFactories"
	QueueItemTypeAutoDefenses           QueueItemType = "AutoDefenses"
	QueueItemTypeAutoMineralAlchemy     QueueItemType = "AutoMineralAlchemy"
	QueueItemTypeAutoMinTerraform       QueueItemType = "AutoMinTerraform"
	QueueItemTypeAutoMaxTerraform       QueueItemType = "AutoMaxTerraform"
	QueueItemTypeAutoMineralPacket      QueueItemType = "AutoMineralPacket"
	QueueItemTypeShipToken              QueueItemType = "ShipToken"
	QueueItemTypeStarbase               QueueItemType = "Starbase"
	QueueItemTypePlanetaryScanner       QueueItemType = "PlanetaryScanner"
)

func (QueueItemType) IsAuto

func (t QueueItemType) IsAuto() bool

true if this is an auto type

func (QueueItemType) IsPacket

func (t QueueItemType) IsPacket() bool

true if this is an auto type

func (QueueItemType) IsTerraform

func (t QueueItemType) IsTerraform() bool

true if this is a terraform type

type Race

type Race struct {
	DBObject
	UserID                int64                 `json:"userId,omitempty"`
	Name                  string                `json:"name,omitempty"`
	PluralName            string                `json:"pluralName,omitempty"`
	SpendLeftoverPointsOn SpendLeftoverPointsOn `json:"spendLeftoverPointsOn,omitempty"`
	PRT                   PRT                   `json:"prt,omitempty"`
	LRTs                  Bitmask               `json:"lrts,omitempty"`
	HabLow                Hab                   `json:"habLow,omitempty"`
	HabHigh               Hab                   `json:"habHigh,omitempty"`
	GrowthRate            int                   `json:"growthRate,omitempty"`
	PopEfficiency         int                   `json:"popEfficiency,omitempty"`
	FactoryOutput         int                   `json:"factoryOutput,omitempty"`
	FactoryCost           int                   `json:"factoryCost,omitempty"`
	NumFactories          int                   `json:"numFactories,omitempty"`
	FactoriesCostLess     bool                  `json:"factoriesCostLess,omitempty"`
	ImmuneGrav            bool                  `json:"immuneGrav,omitempty"`
	ImmuneTemp            bool                  `json:"immuneTemp,omitempty"`
	ImmuneRad             bool                  `json:"immuneRad,omitempty"`
	MineOutput            int                   `json:"mineOutput,omitempty"`
	MineCost              int                   `json:"mineCost,omitempty"`
	NumMines              int                   `json:"numMines,omitempty"`
	ResearchCost          ResearchCost          `json:"researchCost,omitempty"`
	TechsStartHigh        bool                  `json:"techsStartHigh,omitempty"`
	Spec                  RaceSpec              `json:"spec,omitempty"`
}

A user can have multiple races stored in the database. Each time a game is created, a Race is copied into the Player object and stored separately (so changes to the User's race don't impact running games)

func ARs

func ARs() Race

func CAs

func CAs() Race

func HEs

func HEs() Race

func Humanoids

func Humanoids() Race

func ISs

func ISs() Race

func ITs

func ITs() Race

func Insectoids

func Insectoids() Race

func JoaTs

func JoaTs() Race

func NewRace

func NewRace() *Race

func PPs

func PPs() Race

func Rabbitoids

func Rabbitoids() Race

func SDs

func SDs() Race

func SSs

func SSs() Race

func WMs

func WMs() Race

func (*Race) ComputeRacePoints

func (race *Race) ComputeRacePoints(startingPoints int) int

func (*Race) GetPlanetHabitability

func (r *Race) GetPlanetHabitability(hab Hab) int

get this planet's habitabiliity from -45 to 100

func (*Race) HabCenter

func (r *Race) HabCenter() Hab

func (*Race) HabWidth

func (r *Race) HabWidth() Hab

func (*Race) HasLRT

func (r *Race) HasLRT(lrt LRT) bool

func (*Race) IsImmune

func (r *Race) IsImmune(habType HabType) bool

func (*Race) String

func (r *Race) String() string

func (*Race) WithGrowthRate

func (r *Race) WithGrowthRate(growthRate int) *Race

func (*Race) WithLRT

func (r *Race) WithLRT(lrt LRT) *Race

func (Race) WithName

func (r Race) WithName(name string) Race

func (*Race) WithPRT

func (r *Race) WithPRT(prt PRT) *Race

func (*Race) WithPluralName

func (r *Race) WithPluralName(pluralname string) *Race

func (*Race) WithSpec

func (r *Race) WithSpec(rules *Rules) *Race

func (*Race) WithUserID

func (r *Race) WithUserID(userID int64) *Race

type RaceSpec

type RaceSpec struct {
	MiniaturizationSpec
	ScannerSpec
	HabCenter                        Hab                    `json:"habCenter,omitempty"`
	Costs                            map[QueueItemType]Cost `json:"costs,omitempty"`
	StartingTechLevels               TechLevel              `json:"startingTechLevels,omitempty"`
	StartingPlanets                  []StartingPlanet       `json:"startingPlanets,omitempty"`
	TechCostOffset                   TechCostOffset         `json:"techCostOffset,omitempty"`
	MineralsPerSingleMineralPacket   int                    `json:"mineralsPerSingleMineralPacket,omitempty"`
	MineralsPerMixedMineralPacket    int                    `json:"mineralsPerMixedMineralPacket,omitempty"`
	PacketResourceCost               int                    `json:"packetResourceCost,omitempty"`
	PacketMineralCostFactor          float64                `json:"packetMineralCostFactor,omitempty"`
	PacketReceiverFactor             float64                `json:"packetReceiverFactor,omitempty"`
	PacketDecayFactor                float64                `json:"packetDecayFactor,omitempty"`
	PacketOverSafeWarpPenalty        int                    `json:"packetOverSafeWarpPenalty,omitempty"`
	PacketBuiltInScanner             bool                   `json:"packetBuiltInScanner,omitempty"`
	DetectPacketDestinationStarbases bool                   `json:"detectPacketDestinationStarbases,omitempty"`
	DetectAllPackets                 bool                   `json:"detectAllPackets,omitempty"`
	PacketTerraformChance            float64                `json:"packetTerraformChance,omitempty"`
	PacketPermaformChance            float64                `json:"packetPermaformChance,omitempty"`
	PacketPermaTerraformSizeUnit     int                    `json:"packetPermaTerraformSizeUnit,omitempty"`
	CanGateCargo                     bool                   `json:"canGateCargo,omitempty"`
	CanDetectStargatePlanets         bool                   `json:"canDetectStargatePlanets,omitempty"`
	ShipsVanishInVoid                bool                   `json:"shipsVanishInVoid,omitempty"`
	TechsCostExtraLevel              int                    `json:"techsCostExtraLevel,omitempty"`
	FreighterGrowthFactor            float64                `json:"freighterGrowthFactor,omitempty"`
	GrowthFactor                     float64                `json:"growthFactor,omitempty"`
	MaxPopulationOffset              float64                `json:"maxPopulationOffset,omitempty"`
	BuiltInCloakUnits                int                    `json:"builtInCloakUnits,omitempty"`
	StealsResearch                   StealsResearch         `json:"stealsResearch,omitempty"`
	FreeCargoCloaking                bool                   `json:"freeCargoCloaking,omitempty"`
	MineFieldsAreScanners            bool                   `json:"mineFieldsAreScanners,omitempty"`
	MineFieldRateMoveFactor          float64                `json:"mineFieldRateMoveFactor,omitempty"`
	MineFieldSafeWarpBonus           int                    `json:"mineFieldSafeWarpBonus,omitempty"`
	MineFieldMinDecayFactor          float64                `json:"mineFieldMinDecayFactor,omitempty"`
	MineFieldBaseDecayRate           float64                `json:"mineFieldBaseDecayRate,omitempty"`
	MineFieldPlanetDecayRate         float64                `json:"mineFieldPlanetDecayRate,omitempty"`
	MineFieldMaxDecayRate            float64                `json:"mineFieldMaxDecayRate,omitempty"`
	CanDetonateMineFields            bool                   `json:"canDetonateMineFields,omitempty"`
	MineFieldDetonateDecayRate       float64                `json:"mineFieldDetonateDecayRate,omitempty"`
	DiscoverDesignOnScan             bool                   `json:"discoverDesignOnScan,omitempty"`
	CanRemoteMineOwnPlanets          bool                   `json:"canRemoteMineOwnPlanets,omitempty"`
	InvasionAttackBonus              float64                `json:"invasionAttackBonus,omitempty"`
	InvasionDefendBonus              float64                `json:"invasionDefendBonus,omitempty"`
	MovementBonus                    int                    `json:"movementBonus,omitempty"`
	Instaforming                     bool                   `json:"instaforming,omitempty"`
	PermaformChance                  float64                `json:"permaformChance,omitempty"`
	PermaformPopulation              int                    `json:"permaformPopulation,omitempty"`
	RepairFactor                     float64                `json:"repairFactor,omitempty"`
	StarbaseRepairFactor             float64                `json:"starbaseRepairFactor,omitempty"`
	InnateMining                     bool                   `json:"innateMining,omitempty"`
	InnateResources                  bool                   `json:"innateResources,omitempty"`
	InnateScanner                    bool                   `json:"innateScanner,omitempty"`
	InnatePopulationFactor           float64                `json:"innatePopulationFactor,omitempty"`
	CanBuildDefenses                 bool                   `json:"canBuildDefenses,omitempty"`
	LivesOnStarbases                 bool                   `json:"livesOnStarbases,omitempty"`
	FuelEfficiencyOffset             float64                `json:"fuelEfficiencyOffset,omitempty"`
	TerraformCostOffset              Cost                   `json:"terraformCostOffset,omitempty"`
	MineralAlchemyCostOffset         int                    `json:"mineralAlchemyCostOffset,omitempty"`
	ScrapMineralOffset               float64                `json:"scrapMineralOffset,omitempty"`
	ScrapMineralOffsetStarbase       float64                `json:"scrapMineralOffsetStarbase,omitempty"`
	ScrapResourcesOffset             float64                `json:"scrapResourcesOffset,omitempty"`
	ScrapResourcesOffsetStarbase     float64                `json:"scrapResourcesOffsetStarbase,omitempty"`
	StartingPopulationFactor         float64                `json:"startingPopulationFactor,omitempty"`
	StarbaseBuiltInCloakUnits        int                    `json:"starbaseBuiltInCloakUnits,omitempty"`
	StarbaseCostFactor               float64                `json:"starbaseCostFactor,omitempty"`
	ResearchFactor                   float64                `json:"researchFactor,omitempty"`
	ResearchSplashDamage             float64                `json:"researchSplashDamage,omitempty"`
	ArmorStrengthFactor              float64                `json:"armorStrengthFactor,omitempty"`
	ShieldStrengthFactor             float64                `json:"shieldStrengthFactor,omitempty"`
	ShieldRegenerationRate           float64                `json:"shieldRegenerationRate,omitempty"`
	EngineFailureRate                float64                `json:"engineFailureRate,omitempty"`
	EngineReliableSpeed              int                    `json:"engineReliableSpeed,omitempty"`
}

type RandomCometSize

type RandomCometSize int
const (
	RandomCometSizeSmall RandomCometSize = iota
	RandomCometSizeMedium
	RandomCometSizeLarge
	RandomCometSizeHuge
)

type RandomEvent

type RandomEvent string
const (
	RandomEventComet           RandomEvent = "Comet"
	RandomEventMineralDeposit  RandomEvent = "MineralDeposit"
	RandomEventPlanetaryChange RandomEvent = "PlanetaryChange"
	RandomEventAncientArtifact RandomEvent = "AncientArtifact"
	RandomEventMysteryTrader   RandomEvent = "MysteryTrader"
)

type RandomEventType

type RandomEventType int
const (
	RandomEventTypeComet RandomEventType = iota
	RandomEventTypeMineralDeposit
	RandomEventTypePlanetaryChange
	RandomEventTypeAncientArtifact
	RandomEventTypeMysteryTrader
)

type Rect

type Rect struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Width  float64 `json:"width,omitempty"`
	Height float64 `json:"height,omitempty"`
}

func (Rect) Center

func (rect Rect) Center() Vector

func (Rect) PointInRectangle

func (rect Rect) PointInRectangle(point Vector) bool

func (Rect) PointInRotatedRectangle

func (rect Rect) PointInRotatedRectangle(point Vector, rectAngle float64) bool

type RepairRate

type RepairRate string
const (
	RepairRateNone              RepairRate = "None"
	RepairRateMoving            RepairRate = "Moving"
	RepairRateStopped           RepairRate = "Stopped"
	RepairRateOrbiting          RepairRate = "Orbiting"
	RepairRateOrbitingOwnPlanet RepairRate = "OrbitingOwnPlanet"
	RepairRateStarbase          RepairRate = "Starbase"
)

type ResearchCost

type ResearchCost struct {
	Energy        ResearchCostLevel `json:"energy,omitempty"`
	Weapons       ResearchCostLevel `json:"weapons,omitempty"`
	Propulsion    ResearchCostLevel `json:"propulsion,omitempty"`
	Construction  ResearchCostLevel `json:"construction,omitempty"`
	Electronics   ResearchCostLevel `json:"electronics,omitempty"`
	Biotechnology ResearchCostLevel `json:"biotechnology,omitempty"`
}

func (ResearchCost) Get

type ResearchCostLevel

type ResearchCostLevel string
const (
	ResearchCostExtra    ResearchCostLevel = "Extra"
	ResearchCostStandard ResearchCostLevel = "Standard"
	ResearchCostLess     ResearchCostLevel = "Less"
)

type Rules

type Rules struct {
	ID                                        int64                               `json:"id"`
	CreatedAt                                 time.Time                           `json:"createdAt"`
	UpdatedAt                                 time.Time                           `json:"updatedAt"`
	GameID                                    int64                               `json:"gameId"`
	TachyonCloakReduction                     int                                 `json:"tachyonCloakReduction"`
	MaxPopulation                             int                                 `json:"maxPopulation"`
	MinMaxPopulationPercent                   float64                             `json:"minMaxPopulationPercent"`
	PopulationOvercrowdDieoffRate             float64                             `json:"populationOvercrowdDieoffRate"`
	PopulationOvercrowdDieoffRateMax          float64                             `json:"populationOvercrowdDieoffRateMax"`
	PopulationScannerError                    float64                             `json:"populationScannerError"`
	SmartDefenseCoverageFactor                float64                             `json:"smartDefenseCoverageFactor"`
	InvasionDefenseCoverageFactor             float64                             `json:"invasionDefenseCoverageFactor"`
	NumBattleRounds                           int                                 `json:"numBattleRounds"`
	MovesToRunAway                            int                                 `json:"movesToRunAway"`
	BeamRangeDropoff                          float64                             `json:"beamRangeDropoff"`
	TorpedoSplashDamage                       float64                             `json:"torpedoSplashDamage"`
	SalvageDecayRate                          float64                             `json:"salvageDecayRate"`
	SalvageDecayMin                           int                                 `json:"salvageDecayMin"`
	MineFieldCloak                            int                                 `json:"mineFieldCloak"`
	StargateMaxRangeFactor                    int                                 `json:"stargateMaxRangeFactor"`
	StargateMaxHullMassFactor                 int                                 `json:"stargateMaxHullMassFactor"`
	FleetSafeSpeedExplosionChance             float64                             `json:"fleetSafeSpeedExplosionChance"`
	RandomEventChances                        map[RandomEvent]float64             `json:"randomEventChances"`
	RandomMineralDepositBonusRange            [2]int                              `json:"randomMineralDepositBonusRange"`
	RandomArtifactResearchBonusRange          [2]int                              `json:"randomArtifactResearchBonusRange"`
	RandomCometMinYear                        int                                 `json:"randomCometMinYear,omitempty"`
	RandomCometMinYearPlayerWorld             int                                 `json:"randomCometMinYearPlayerWorld,omitempty"`
	CometStatsBySize                          map[CometSize]CometStats            `json:"cometStatsBySize,omitempty"`
	WormholeCloak                             int                                 `json:"wormholeCloak"`
	WormholeMinPlanetDistance                 int                                 `json:"wormholeMinDistance"`
	WormholeStatsByStability                  map[WormholeStability]WormholeStats `json:"wormholeStatsByStability"`
	WormholePairsForSize                      map[Size]int                        `json:"wormholePairsForSize"`
	MineFieldStatsByType                      map[MineFieldType]MineFieldStats    `json:"mineFieldStatsByType"`
	RepairRates                               map[RepairRate]float64              `json:"repairRates"`
	MaxPlayers                                int                                 `json:"maxPlayers"`
	StartingYear                              int                                 `json:"startingYear"`
	ShowPublicScoresAfterYears                int                                 `json:"showPublicScoresAfterYears"`
	PlanetMinDistance                         int                                 `json:"planetMinDistance"`
	MaxExtraWorldDistance                     int                                 `json:"maxExtraWorldDistance"`
	MinExtraWorldDistance                     int                                 `json:"minExtraWorldDistance"`
	MinHomeworldMineralConcentration          int                                 `json:"minHomeworldMineralConcentration"`
	MinExtraPlanetMineralConcentration        int                                 `json:"minExtraPlanetMineralConcentration"`
	MinHab                                    int                                 `json:"minHab"`
	MaxHab                                    int                                 `json:"maxHab"`
	MinMineralConcentration                   int                                 `json:"minMineralConcentration"`
	MaxMineralConcentration                   int                                 `json:"maxMineralConcentration"`
	MinStartingMineralConcentration           int                                 `json:"minStartingMineralConcentration"`
	MaxStartingMineralConcentration           int                                 `json:"maxStartingMineralConcentration"`
	HighRadMineralConcentrationBonusThreshold int                                 `json:"highRadGermaniumBonusThreshold"`
	RadiatingImmune                           int                                 `json:"radiatingImmune"`
	MaxStartingMineralSurface                 int                                 `json:"maxStartingMineralSurface"`
	MinStartingMineralSurface                 int                                 `json:"minStartingMineralSurface"`
	MineralDecayFactor                        int                                 `json:"mineralDecayFactor"`
	RemoteMiningMineOutput                    int                                 `json:"remoteMiningMineOutput"`
	StartingMines                             int                                 `json:"startingMines"`
	StartingFactories                         int                                 `json:"startingFactories"`
	StartingDefenses                          int                                 `json:"startingDefenses"`
	RaceStartingPoints                        int                                 `json:"raceStartingPoints"`
	ScrapMineralAmount                        float64                             `json:"scrapMineralAmount"`
	ScrapResourceAmount                       float64                             `json:"scrapResourceAmount"`
	FactoryCostGermanium                      int                                 `json:"factoryCostGermanium"`
	DefenseCost                               Cost                                `json:"defenseCost"`
	MineralAlchemyCost                        int                                 `json:"mineralAlchemyCost"`
	PlanetaryScannerCost                      Cost                                `json:"planetaryScannerCost"`
	TerraformCost                             Cost                                `json:"terraformCost"`
	StarbaseComponentCostFactor               float64                             `json:"starbaseComponentCostFactor"`
	SalvageFromBattleFactor                   float64                             `json:"salvageFromBattleFactor"`
	TechTradeChance                           float64                             `json:"techTradeChance"`
	PacketDecayRate                           map[int]float64                     `json:"packetDecayRate"`
	MaxTechLevel                              int                                 `json:"maxTechLevel"`
	TechBaseCost                              []int                               `json:"techBaseCost"`
	PRTSpecs                                  map[PRT]PRTSpec                     `json:"prtSpecs"`
	LRTSpecs                                  map[LRT]LRTSpec                     `json:"lrtSpecs"`
	TechsID                                   int64                               `json:"techsId"`
	// contains filtered or unexported fields
}

The Rules struct contains all the various constants and configuration values that determine how the game mechanics work. These are designed to be unique per game, if desired. Currently for testing, all games just use the default rule set.

func NewRules

func NewRules() Rules

func NewRulesWithSeed

func NewRulesWithSeed(seed int64) Rules

func (*Rules) GetArea

func (rules *Rules) GetArea(size Size) (Vector, error)

Get the area of a universe based on size

func (*Rules) GetNumPlanets

func (rules *Rules) GetNumPlanets(size Size, density Density) (int, error)

Get the number of planets for a universe based on size and density

func (*Rules) ResetSeed

func (r *Rules) ResetSeed(seed int64)

Seed the random number generator with the rules Seed value This should be called after deserializing This can be used to generate the same world repeatedly (hopefully)

func (*Rules) SetTechStore

func (r *Rules) SetTechStore(techStore *TechStore) *Rules

type Salvage

type Salvage struct {
	MapObject
	Cargo Cargo `json:"cargo,omitempty"`
}

type SalvageIntel

type SalvageIntel struct {
	MapObjectIntel
	Cargo Cargo `json:"cargo,omitempty"`
}

func (*SalvageIntel) String

func (f *SalvageIntel) String() string

type ScannerSpec

type ScannerSpec struct {
	BuiltInScannerMultiplier int     `json:"builtInScannerMultiplier,omitempty"`
	NoAdvancedScanners       bool    `json:"noAdvancedScanners,omitempty"`
	ScanRangeFactor          float64 `json:"scanRangeFactor,omitempty"`
}

type ScoreIntel

type ScoreIntel struct {
	ScoreHistory []PlayerScore `json:"scoreHistory"`
}

type ShipDesign

type ShipDesign struct {
	GameDBObject
	Num               int               `json:"num,omitempty"`
	PlayerNum         int               `json:"playerNum"`
	OriginalPlayerNum int               `json:"originalPlayerNum"`
	Name              string            `json:"name"`
	Dirty             bool              `json:"-"`
	Version           int               `json:"version"`
	Hull              string            `json:"hull"`
	HullSetNumber     int               `json:"hullSetNumber"`
	CannotDelete      bool              `json:"cannotDelete,omitempty"`
	Slots             []ShipDesignSlot  `json:"slots"`
	Purpose           ShipDesignPurpose `json:"purpose,omitempty"`
	Spec              ShipDesignSpec    `json:"spec"`
	Delete            bool              // used by the AI to mark a design for deletion
}

Fleets are made up of ships, and each ship has a design. Players start with designs created during universe generation, and they can add new designs in the UI. Deleting a design deletes all fleets associated with it.

func DesignShip

func DesignShip(techStore *TechStore, hull *TechHull, name string, player *Player, num int, hullSetNumber int, purpose ShipDesignPurpose, fleetPurpose FleetPurpose) *ShipDesign

func NewShipDesign

func NewShipDesign(player *Player, num int) *ShipDesign

func (*ShipDesign) MarkDirty

func (sd *ShipDesign) MarkDirty()

func (*ShipDesign) SlotsEqual

func (d *ShipDesign) SlotsEqual(other *ShipDesign) bool

compare two ship design's slots and return true if they are equal

func (*ShipDesign) Validate

func (sd *ShipDesign) Validate(rules *Rules, player *Player) error

validate that this ship design is available to the player

func (*ShipDesign) WithHull

func (sd *ShipDesign) WithHull(hull string) *ShipDesign

func (*ShipDesign) WithHullSetNumber

func (sd *ShipDesign) WithHullSetNumber(num int) *ShipDesign

func (*ShipDesign) WithName

func (sd *ShipDesign) WithName(name string) *ShipDesign

func (*ShipDesign) WithPurpose

func (sd *ShipDesign) WithPurpose(purpose ShipDesignPurpose) *ShipDesign

func (*ShipDesign) WithSlots

func (sd *ShipDesign) WithSlots(slots []ShipDesignSlot) *ShipDesign

func (*ShipDesign) WithSpec

func (sd *ShipDesign) WithSpec(rules *Rules, player *Player) *ShipDesign

Compute the spec for this ShipDesign. This function is mostly for universe generation and tests

type ShipDesignIntel

type ShipDesignIntel struct {
	Intel
	Hull          string           `json:"hull,omitempty"`
	HullSetNumber int              `json:"hullSetNumber,omitempty"`
	Version       int              `json:"version,omitempty"`
	Slots         []ShipDesignSlot `json:"slots,omitempty"`
	Spec          ShipDesignSpec   `json:"spec,omitempty"`
}

func (*ShipDesignIntel) String

func (d *ShipDesignIntel) String() string

type ShipDesignPurpose

type ShipDesignPurpose string
const (
	ShipDesignPurposeNone                  ShipDesignPurpose = ""
	ShipDesignPurposeScout                 ShipDesignPurpose = "Scout"
	ShipDesignPurposeColonizer             ShipDesignPurpose = "Colonizer"
	ShipDesignPurposeBomber                ShipDesignPurpose = "Bomber"
	ShipDesignPurposeStructureBomber       ShipDesignPurpose = "StructureBomber"
	ShipDesignPurposeSmartBomber           ShipDesignPurpose = "SmartBomber"
	ShipDesignPurposeFighter               ShipDesignPurpose = "Fighter"
	ShipDesignPurposeFighterScout          ShipDesignPurpose = "FighterScout"
	ShipDesignPurposeCapitalShip           ShipDesignPurpose = "CapitalShip"
	ShipDesignPurposeFreighter             ShipDesignPurpose = "Freighter"
	ShipDesignPurposeColonistFreighter     ShipDesignPurpose = "ColonistFreighter"
	ShipDesignPurposeFuelFreighter         ShipDesignPurpose = "FuelFreighter"
	ShipDesignPurposeMultiPurposeFreighter ShipDesignPurpose = "MultiPurposeFreighter"
	ShipDesignPurposeArmedFreighter        ShipDesignPurpose = "ArmedFreighter"
	ShipDesignPurposeMiner                 ShipDesignPurpose = "Miner"
	ShipDesignPurposeTerraformer           ShipDesignPurpose = "Terraformer"
	ShipDesignPurposeDamageMineLayer       ShipDesignPurpose = "DamageMineLayer"
	ShipDesignPurposeSpeedMineLayer        ShipDesignPurpose = "SpeedMineLayer"
	ShipDesignPurposeStarbase              ShipDesignPurpose = "Starbase"
	ShipDesignPurposeFuelDepot             ShipDesignPurpose = "FuelDepot"
	ShipDesignPurposeStarbaseQuarter       ShipDesignPurpose = "StarbaseQuarter"
	ShipDesignPurposeStarbaseHalf          ShipDesignPurpose = "StarbaseHalf"
	ShipDesignPurposePacketThrower         ShipDesignPurpose = "PacketThrower"
	ShipDesignPurposeStargater             ShipDesignPurpose = "Stargater"
	ShipDesignPurposeFort                  ShipDesignPurpose = "Fort"
	ShipDesignPurposeStarterColony         ShipDesignPurpose = "StarterColony"
)

type ShipDesignSlot

type ShipDesignSlot struct {
	HullComponent string `json:"hullComponent"`
	HullSlotIndex int    `json:"hullSlotIndex"`
	Quantity      int    `json:"quantity"`
}

type ShipDesignSpec

type ShipDesignSpec struct {
	HullType                  TechHullType          `json:"hullType,omitempty"`
	Engine                    Engine                `json:"engine,omitempty"`
	NumEngines                int                   `json:"numEngines,omitempty"`
	Cost                      Cost                  `json:"cost,omitempty"`
	TechLevel                 TechLevel             `json:"techLevel,omitempty"`
	Mass                      int                   `json:"mass,omitempty"`
	Armor                     int                   `json:"armor,omitempty"`
	FuelCapacity              int                   `json:"fuelCapacity,omitempty"`
	FuelGeneration            int                   `json:"fuelGeneration,omitempty"`
	CargoCapacity             int                   `json:"cargoCapacity,omitempty"`
	CloakUnits                int                   `json:"cloakUnits,omitempty"`
	ScanRange                 int                   `json:"scanRange,omitempty"`
	ScanRangePen              int                   `json:"scanRangePen,omitempty"`
	InnateScanRangePenFactor  float64               `json:"innateScanRangePenFactor,omitempty"`
	RepairBonus               float64               `json:"repairBonus,omitempty"`
	TorpedoInaccuracyFactor   float64               `json:"torpedoInaccuracyFactor,omitempty"`
	TorpedoJamming            float64               `json:"torpedoJamming,omitempty"`
	BeamBonus                 float64               `json:"beamBonus,omitempty"`
	BeamDefense               float64               `json:"beamDefense,omitempty"`
	Initiative                int                   `json:"initiative,omitempty"`
	Movement                  int                   `json:"movement,omitempty"`
	ReduceMovement            int                   `json:"reduceMovement,omitempty"`
	PowerRating               int                   `json:"powerRating,omitempty"`
	Bomber                    bool                  `json:"bomber,omitempty"`
	Bombs                     []Bomb                `json:"bombs,omitempty"`
	SmartBombs                []Bomb                `json:"smartBombs,omitempty"`
	RetroBombs                []Bomb                `json:"retroBombs,omitempty"`
	Scanner                   bool                  `json:"scanner,omitempty"`
	ImmuneToOwnDetonation     bool                  `json:"immuneToOwnDetonation,omitempty"`
	MineLayingRateByMineType  map[MineFieldType]int `json:"mineLayingRateByMineType,omitempty"`
	Shields                   int                   `json:"shields,omitempty"`
	Colonizer                 bool                  `json:"colonizer,omitempty"`
	Starbase                  bool                  `json:"starbase,omitempty"`
	CanLayMines               bool                  `json:"canLayMines,omitempty"`
	SpaceDock                 int                   `json:"spaceDock,omitempty"`
	MiningRate                int                   `json:"miningRate,omitempty"`
	TerraformRate             int                   `json:"terraformRate,omitempty"`
	MineSweep                 int                   `json:"mineSweep,omitempty"`
	CloakPercent              int                   `json:"cloakPercent,omitempty"`
	CloakPercentFullCargo     int                   `json:"cloakPercentFullCargo,omitempty"`
	ReduceCloaking            float64               `json:"reduceCloaking,omitempty"`
	CanStealFleetCargo        bool                  `json:"canStealFleetCargo,omitempty"`
	CanStealPlanetCargo       bool                  `json:"canStealPlanetCargo,omitempty"`
	OrbitalConstructionModule bool                  `json:"orbitalConstructionModule,omitempty"`
	HasWeapons                bool                  `json:"hasWeapons,omitempty"`
	WeaponSlots               []ShipDesignSlot      `json:"weaponSlots,omitempty"`
	Stargate                  string                `json:"stargate,omitempty"`
	SafeHullMass              int                   `json:"safeHullMass,omitempty"`
	SafeRange                 int                   `json:"safeRange,omitempty"`
	MaxHullMass               int                   `json:"maxHullMass,omitempty"`
	MaxRange                  int                   `json:"maxRange,omitempty"`
	MassDriver                string                `json:"massDriver,omitempty"`
	SafePacketSpeed           int                   `json:"safePacketSpeed,omitempty"`
	BasePacketSpeed           int                   `json:"basePacketSpeed,omitempty"`
	AdditionalMassDrivers     int                   `json:"additionalMassDrivers,omitempty"`
	MaxPopulation             int                   `json:"maxPopulation,omitempty"`
	Radiating                 bool                  `json:"radiating,omitempty"`
	NumInstances              int                   `json:"numInstances,omitempty"`
	NumBuilt                  int                   `json:"numBuilt,omitempty"`
	EstimatedRange            int                   `json:"estimatedRange,omitempty"`
	EstimatedRangeFull        int                   `json:"estimatedRangeFull,omitempty"`
}

func ComputeShipDesignSpec

func ComputeShipDesignSpec(rules *Rules, techLevels TechLevel, raceSpec RaceSpec, design *ShipDesign) ShipDesignSpec

type ShipToken

type ShipToken struct {
	DesignNum       int     `json:"designNum,omitempty"`
	Quantity        int     `json:"quantity,omitempty"`
	Damage          float64 `json:"damage,omitempty"`
	QuantityDamaged int     `json:"quantityDamaged,omitempty"`
	// contains filtered or unexported fields
}

A Fleet contains multiple ShipTokens, each of which have a design and a quantity.

type Size

type Size string
const (
	SizeTiny       Size = "Tiny"
	SizeTinyWide   Size = "TinyWide"
	SizeSmall      Size = "Small"
	SizeSmallWide  Size = "SmallWide"
	SizeMedium     Size = "Medium"
	SizeMediumWide Size = "MediumWide"
	SizeLarge      Size = "Large"
	SizeLargeWide  Size = "LargeWide"
	SizeHuge       Size = "Huge"
	SizeHugeWide   Size = "HugeWide"
)

type SpendLeftoverPointsOn

type SpendLeftoverPointsOn string
const (
	SpendLeftoverPointsOnSurfaceMinerals       SpendLeftoverPointsOn = "SurfaceMinerals"
	SpendLeftoverPointsOnMineralConcentrations SpendLeftoverPointsOn = "MineralConcentrations"
	SpendLeftoverPointsOnMines                 SpendLeftoverPointsOn = "Mines"
	SpendLeftoverPointsOnFactories             SpendLeftoverPointsOn = "Factories"
	SpendLeftoverPointsOnDefenses              SpendLeftoverPointsOn = "Defenses"
)

type SplitFleetOrder

type SplitFleetOrder struct {
	Source      *Fleet      `json:"source,omitempty"`
	SplitTokens []ShipToken `json:"splitTokens,omitempty"`
}

A SplitFleetOrder is for splitting tokens off of single fleet to form a second new fleet TODO: not yet implemented

type SplitFleetRequest

type SplitFleetRequest struct {
	// The source fleet to split tokens from
	Source *Fleet `json:"sourcefleet,omitempty"`
	// an optional destination fleet to give tokens to. If nil a new fleet will be crated
	Dest *Fleet `json:"destfleet,omitempty"`

	// a matching slice of source and dest tokens that only differ in token.Quantity
	SourceTokens []ShipToken `json:"sourceTokens,omitempty"`
	DestTokens   []ShipToken `json:"destTokens,omitempty"`

	// the amount of cargo to transfer from the source fleet to the dest when splitting
	TransferAmount CargoTransferRequest `json:"transferAmount,omitempty"`
}

type StartingFleet

type StartingFleet struct {
	Name          string            `json:"name,omitempty"`
	HullName      StartingFleetHull `json:"hullName,omitempty"`
	HullSetNumber uint              `json:"hullSetNumber,omitempty"`
	Purpose       ShipDesignPurpose `json:"purpose,omitempty"`
}

type StartingFleetHull

type StartingFleetHull string
const (
	StartingFleetHullColonyShip      StartingFleetHull = "Colony Ship"
	StartingFleetHullDestroyer       StartingFleetHull = "Destroyer"
	StartingFleetHullMediumFreighter StartingFleetHull = "Medium Freighter"
	StartingFleetHullMiniColonyShip  StartingFleetHull = "Mini-Colony Ship"
	StartingFleetHullMiniMineLayer   StartingFleetHull = "Mini Mine Layer"
	StartingFleetHullMiniMiner       StartingFleetHull = "Mini-Miner"
	StartingFleetHullMidgetMiner     StartingFleetHull = "Midget-Miner"
	StartingFleetHullPrivateer       StartingFleetHull = "Privateer"
	StartingFleetHullScout           StartingFleetHull = "Scout"
)

type StartingPlanet

type StartingPlanet struct {
	Population         int             `json:"population,omitempty"`
	HabPenaltyFactor   float64         `json:"habPenaltyFactor,omitempty"`
	HasStargate        bool            `json:"hasStargate,omitempty"`
	HasMassDriver      bool            `json:"hasMassDriver,omitempty"`
	StarbaseDesignName string          `json:"starbaseDesignName,omitempty"`
	StarbaseHull       string          `json:"starbaseHull,omitempty"`
	StartingFleets     []StartingFleet `json:"startingFleets,omitempty"`
}

type StealsResearch

type StealsResearch struct {
	Energy        float64 `json:"energy,omitempty"`
	Weapons       float64 `json:"weapons,omitempty"`
	Propulsion    float64 `json:"propulsion,omitempty"`
	Construction  float64 `json:"construction,omitempty"`
	Electronics   float64 `json:"electronics,omitempty"`
	Biotechnology float64 `json:"biotechnology,omitempty"`
}

type Tags

type Tags map[string]string

type Tech

type Tech struct {
	Name         string           `json:"name"`
	Cost         Cost             `json:"cost"`
	Requirements TechRequirements `json:"requirements" `
	Ranking      int              `json:"ranking,omitempty"`
	Category     TechCategory     `json:"category,omitempty"`
}

func NewTech

func NewTech(name string, cost Cost, requirements TechRequirements, ranking int, category TechCategory) Tech

func (*Tech) GetPlayerCost

func (t *Tech) GetPlayerCost(techLevels TechLevel, spec MiniaturizationSpec) Cost

func (*Tech) String

func (t *Tech) String() string

type TechCategory

type TechCategory string
const (
	TechCategoryArmor            TechCategory = "Armor"
	TechCategoryBeamWeapon       TechCategory = "BeamWeapon"
	TechCategoryBomb             TechCategory = "Bomb"
	TechCategoryElectrical       TechCategory = "Electrical"
	TechCategoryEngine           TechCategory = "Engine"
	TechCategoryMechanical       TechCategory = "Mechanical"
	TechCategoryMineLayer        TechCategory = "MineLayer"
	TechCategoryMineRobot        TechCategory = "MineRobot"
	TechCategoryOrbital          TechCategory = "Orbital"
	TechCategoryPlanetaryScanner TechCategory = "PlanetaryScanner"
	TechCategoryPlanetaryDefense TechCategory = "PlanetaryDefense"
	TechCategoryScanner          TechCategory = "Scanner"
	TechCategoryShield           TechCategory = "Shield"
	TechCategoryShipHull         TechCategory = "ShipHull"
	TechCategoryStarbaseHull     TechCategory = "StarbaseHull"
	TechCategoryTerraforming     TechCategory = "Terraforming"
	TechCategoryTorpedo          TechCategory = "Torpedo"
)

type TechCostOffset

type TechCostOffset struct {
	Engine           float64 `json:"engine,omitempty"`
	BeamWeapon       float64 `json:"beamWeapon,omitempty"`
	Torpedo          float64 `json:"torpedo,omitempty"`
	Bomb             float64 `json:"bomb,omitempty"`
	PlanetaryDefense float64 `json:"planetaryDefense,omitempty"`
}

type TechDefense

type TechDefense struct {
	Tech
	Defense
}

func TechDefenses

func TechDefenses() []TechDefense

func (*TechDefense) String

func (t *TechDefense) String() string

type TechEngine

type TechEngine struct {
	TechHullComponent
	Engine
}

func TechEngines

func TechEngines() []TechEngine

func (*TechEngine) String

func (t *TechEngine) String() string

type TechField

type TechField string
const (
	TechFieldNone TechField = ""
	Energy        TechField = "Energy"
	Weapons       TechField = "Weapons"
	Propulsion    TechField = "Propulsion"
	Construction  TechField = "Construction"
	Electronics   TechField = "Electronics"
	Biotechnology TechField = "Biotechnology"
)

type TechFinder

type TechFinder interface {
	GetBestPlanetaryScanner(player *Player) *TechPlanetaryScanner
	GetBestDefense(player *Player) *TechDefense
	GetBestTerraform(player *Player, terraformHabType TerraformHabType) *TechTerraform
	GetBestScanner(player *Player) *TechHullComponent
	GetBestEngine(player *Player, hull *TechHull, purpose FleetPurpose) *TechEngine
	GetBestMineLayer(player *Player, mineFieldType MineFieldType) *TechHullComponent
	GetEngine(name string) *TechEngine
	GetTech(name string) interface{}
	GetHull(name string) *TechHull
	GetHullsByType(techHullType TechHullType) []*TechHull
	GetHullComponent(name string) *TechHullComponent
	GetHullComponentsByCategory(category TechCategory) []TechHullComponent
}

func NewTechStore

func NewTechStore() TechFinder

type TechHull

type TechHull struct {
	Tech
	Type                     TechHullType   `json:"type,omitempty"`
	Mass                     int            `json:"mass,omitempty"`
	Armor                    int            `json:"armor,omitempty"`
	FuelCapacity             int            `json:"fuelCapacity,omitempty"`
	FuelGeneration           int            `json:"fuelGeneration,omitempty"`
	CargoCapacity            int            `json:"cargoCapacity,omitempty"`
	CargoSlotPosition        Vector         `json:"cargoSlotPosition,omitempty"`
	CargoSlotSize            Vector         `json:"cargoSlotSize,omitempty"`
	CargoSlotCircle          bool           `json:"cargoSlotCircle,omitempty"`
	SpaceDock                int            `json:"spaceDock,omitempty"`
	SpaceDockSlotPosition    Vector         `json:"spaceDockSlotPosition,omitempty"`
	SpaceDockSlotSize        Vector         `json:"spaceDockSlotSize,omitempty"`
	SpaceDockSlotCircle      bool           `json:"spaceDockSlotCircle,omitempty"`
	MineLayingBonus          float64        `json:"mineLayingBonus,omitempty"`
	BuiltInScanner           bool           `json:"builtInScanner,omitempty"`
	Initiative               int            `json:"initiative,omitempty"`
	RepairBonus              float64        `json:"repairBonus,omitempty"`
	ImmuneToOwnDetonation    bool           `json:"immuneToOwnDetonation,omitempty"`
	RangeBonus               int            `json:"rangeBonus,omitempty"`
	Starbase                 bool           `json:"starbase,omitempty"`
	OrbitalConstructionHull  bool           `json:"orbitalConstructionHull,omitempty"`
	DoubleMineEfficiency     bool           `json:"doubleMineEfficiency,omitempty"`
	MaxPopulation            int            `json:"maxPopulation,omitempty"`
	InnateScanRangePenFactor float64        `json:"innateScanRangePenFactor,omitempty"`
	Slots                    []TechHullSlot `json:"slots,omitempty"`
}

func TechHulls

func TechHulls() []TechHull

func (*TechHull) String

func (t *TechHull) String() string

type TechHullComponent

type TechHullComponent struct {
	Tech
	HullSlotType              HullSlotType  `json:"hullSlotType"`
	Mass                      int           `json:"mass,omitempty"`
	ScanRange                 int           `json:"scanRange,omitempty"`
	ScanRangePen              int           `json:"scanRangePen,omitempty"`
	SafeHullMass              int           `json:"safeHullMass,omitempty"`
	SafeRange                 int           `json:"safeRange,omitempty"`
	MaxHullMass               int           `json:"maxHullMass,omitempty"`
	MaxRange                  int           `json:"maxRange,omitempty"`
	Radiating                 bool          `json:"radiating,omitempty"`
	PacketSpeed               int           `json:"packetSpeed,omitempty"`
	CloakUnits                int           `json:"cloakUnits,omitempty"`
	TerraformRate             int           `json:"terraformRate,omitempty"`
	MiningRate                int           `json:"miningRate,omitempty"`
	KillRate                  float64       `json:"killRate,omitempty"`
	MinKillRate               int           `json:"minKillRate,omitempty"`
	StructureDestroyRate      float64       `json:"structureDestroyRate,omitempty"`
	UnterraformRate           int           `json:"unterraformRate,omitempty"`
	Smart                     bool          `json:"smart,omitempty"`
	CanStealFleetCargo        bool          `json:"canStealFleetCargo,omitempty"`
	CanStealPlanetCargo       bool          `json:"canStealPlanetCargo,omitempty"`
	Armor                     int           `json:"armor,omitempty"`
	Shield                    int           `json:"shield,omitempty"`
	TorpedoBonus              float64       `json:"torpedoBonus,omitempty"`
	InitiativeBonus           int           `json:"initiativeBonus,omitempty"`
	BeamBonus                 float64       `json:"beamBonus,omitempty"`
	ReduceMovement            int           `json:"reduceMovement,omitempty"`
	TorpedoJamming            float64       `json:"torpedoJamming,omitempty"`
	ReduceCloaking            bool          `json:"reduceCloaking,omitempty"`
	CloakUnarmedOnly          bool          `json:"cloakUnarmedOnly,omitempty"`
	MineFieldType             MineFieldType `json:"mineFieldType,omitempty"`
	MineLayingRate            int           `json:"mineLayingRate,omitempty"`
	BeamDefense               float64       `json:"beamDefense,omitempty"`
	CargoBonus                int           `json:"cargoBonus,omitempty"`
	ColonizationModule        bool          `json:"colonizationModule,omitempty"`
	FuelBonus                 int           `json:"fuelBonus,omitempty"`
	FuelGeneration            int           `json:"fuelGeneration,omitempty"`
	MovementBonus             int           `json:"movementBonus,omitempty"`
	OrbitalConstructionModule bool          `json:"orbitalConstructionModule,omitempty"`
	Power                     int           `json:"power,omitempty"`
	Range                     int           `json:"range,omitempty"`
	Initiative                int           `json:"initiative,omitempty"`
	Gattling                  bool          `json:"gattling,omitempty"`
	HitsAllTargets            bool          `json:"hitsAllTargets,omitempty"`
	DamageShieldsOnly         bool          `json:"damageShieldsOnly,omitempty"`
	Accuracy                  int           `json:"accuracy,omitempty"`
	CapitalShipMissile        bool          `json:"capitalShipMissile,omitempty"`
}

func TechHullComponents

func TechHullComponents() []TechHullComponent

func (*TechHullComponent) String

func (t *TechHullComponent) String() string

type TechHullSlot

type TechHullSlot struct {
	Type     HullSlotType `json:"type"`
	Capacity int          `json:"capacity"`
	Required bool         `json:"required,omitempty"`
	Position Vector       `json:"position"`
}

type TechHullType

type TechHullType string
const (
	TechHullTypeScout                 TechHullType = "Scout"
	TechHullTypeColonizer             TechHullType = "Colonizer"
	TechHullTypeBomber                TechHullType = "Bomber"
	TechHullTypeFighter               TechHullType = "Fighter"
	TechHullTypeCapitalShip           TechHullType = "CapitalShip"
	TechHullTypeFreighter             TechHullType = "Freighter"
	TechHullTypeMultiPurposeFreighter TechHullType = "MultiPurposeFreighter"
	TechHullTypeFuelTransport         TechHullType = "FuelTransport"
	TechHullTypeMiner                 TechHullType = "Miner"
	TechHullTypeMineLayer             TechHullType = "MineLayer"
	TechHullTypeStarbase              TechHullType = "Starbase"
	TechHullTypeOrbitalFort           TechHullType = "OrbitalFort"
)

func (TechHullType) IsAttackHull

func (t TechHullType) IsAttackHull() bool

func (TechHullType) IsBomber

func (t TechHullType) IsBomber() bool

type TechLevel

type TechLevel struct {
	Energy        int `json:"energy,omitempty"`
	Weapons       int `json:"weapons,omitempty"`
	Propulsion    int `json:"propulsion,omitempty"`
	Construction  int `json:"construction,omitempty"`
	Electronics   int `json:"electronics,omitempty"`
	Biotechnology int `json:"biotechnology,omitempty"`
}

Represents a TechLevel the player has or a tech requires, or the amount of research spent on each tech level

func (TechLevel) Add

func (tl TechLevel) Add(other TechLevel) TechLevel

add a tech level to this one

func (TechLevel) Get

func (tl TechLevel) Get(field TechField) int

func (TechLevel) HasRequiredLevels

func (tl TechLevel) HasRequiredLevels(required TechLevel) bool

return true if this techlevel has the required techlevels for a requirements

func (TechLevel) LevelsAbove

func (tl TechLevel) LevelsAbove(other TechLevel) int

Get the mininum levels above this tech i.e. if we just are a starter humanoid and just gained prop 5 level ({ 3, 3, 6, 3, 3}) we are 0 levels above the Radiating Hyrdo-Ram Scoop returns maxInt if the tech is all 0

func (TechLevel) LevelsAboveField

func (tl TechLevel) LevelsAboveField(other TechLevel, field TechField) int

LevelsAboveField returns the levels we are above a tech in a given field, or MaxInt if the field requirement is 0

func (TechLevel) Lowest

func (tl TechLevel) Lowest() TechField

func (TechLevel) Max

func (tl TechLevel) Max(tl2 TechLevel) TechLevel

func (TechLevel) Min

func (tl TechLevel) Min() int

return the minimum tech level

func (TechLevel) MinZero

func (tl TechLevel) MinZero() TechLevel

return this TechLevel with a minimum of zero for each value

func (TechLevel) Minus

func (tl TechLevel) Minus(tl2 TechLevel) TechLevel

func (*TechLevel) Set

func (tl *TechLevel) Set(field TechField, level int)

func (TechLevel) Sum

func (tl TechLevel) Sum() int

return the sum of all tech levels

type TechPlanetaryScanner

type TechPlanetaryScanner struct {
	Tech
	ScanRange    int `json:"scanRange,omitempty"`
	ScanRangePen int `json:"scanRangePen,omitempty"`
}

func TechPlanetaryScanners

func TechPlanetaryScanners() []TechPlanetaryScanner

func (*TechPlanetaryScanner) String

func (t *TechPlanetaryScanner) String() string

type TechRequirements

type TechRequirements struct {
	TechLevel
	PRTDenied    PRT      `json:"prtDenied,omitempty"`
	LRTsRequired LRT      `json:"lrtsRequired,omitempty"`
	LRTsDenied   LRT      `json:"lrtsDenied,omitempty"`
	PRTRequired  PRT      `json:"prtRequired,omitempty"`
	HullsAllowed []string `json:"hullsAllowed,omitempty"`
	HullsDenied  []string `json:"hullsDenied,omitempty"`
}

type TechStore

type TechStore struct {
	Engines           []TechEngine           `json:"engines"`
	PlanetaryScanners []TechPlanetaryScanner `json:"planetaryScanners"`
	Terraforms        []TechTerraform        `json:"terraforms"`
	Defenses          []TechDefense          `json:"defenses"`
	HullComponents    []TechHullComponent    `json:"hullComponents"`
	Hulls             []TechHull             `json:"hulls,omitempty"`
	// contains filtered or unexported fields
}

The TechStore contains all techs in the game. Eventually these will be user modifyable and referenced per game, but for now all games use the StaticTechStore, which contains the default Stars! techs.

func (*TechStore) GetBestArmor

func (store *TechStore) GetBestArmor(player *Player) *TechHullComponent

get the best armor for a player

func (*TechStore) GetBestBattleComputer

func (store *TechStore) GetBestBattleComputer(player *Player) *TechHullComponent

get the best player's battle computer

func (*TechStore) GetBestBeamWeapon

func (store *TechStore) GetBestBeamWeapon(player *Player) *TechHullComponent

get the best beam weapon for a player

func (*TechStore) GetBestBomb

func (store *TechStore) GetBestBomb(player *Player) *TechHullComponent

get the best regular bomb for a player

func (*TechStore) GetBestCargoPod

func (store *TechStore) GetBestCargoPod(player *Player) *TechHullComponent

func (*TechStore) GetBestColonizationModule

func (store *TechStore) GetBestColonizationModule(player *Player) *TechHullComponent

get the best fuel tank for a player

func (*TechStore) GetBestDefense

func (store *TechStore) GetBestDefense(player *Player) *TechDefense

get the best defense for a player

func (*TechStore) GetBestEngine

func (store *TechStore) GetBestEngine(player *Player, hull *TechHull, purpose FleetPurpose) *TechEngine

get the best engine for a player

func (*TechStore) GetBestFuelTank

func (store *TechStore) GetBestFuelTank(player *Player) *TechHullComponent

get the best fuel tank for a player

func (*TechStore) GetBestMineLayer

func (store *TechStore) GetBestMineLayer(player *Player, mineFieldType MineFieldType) *TechHullComponent

get the player's best mine layer by type

func (*TechStore) GetBestMiningRobot

func (store *TechStore) GetBestMiningRobot(player *Player) *TechHullComponent

get the best player's mining robot

func (*TechStore) GetBestPacketThrower

func (store *TechStore) GetBestPacketThrower(player *Player) *TechHullComponent

get the player's best packet thrower

func (*TechStore) GetBestPlanetaryScanner

func (store *TechStore) GetBestPlanetaryScanner(player *Player) *TechPlanetaryScanner

get the best planetary scanner for a player

func (*TechStore) GetBestSapper

func (store *TechStore) GetBestSapper(player *Player) *TechHullComponent

get the best sapper for a player

func (*TechStore) GetBestScanner

func (store *TechStore) GetBestScanner(player *Player) *TechHullComponent

get the best scanner for a player

func (*TechStore) GetBestShield

func (store *TechStore) GetBestShield(player *Player) *TechHullComponent

get the best shield for a player

func (*TechStore) GetBestSmartBomb

func (store *TechStore) GetBestSmartBomb(player *Player) *TechHullComponent

get the best smart bomb for a player

func (*TechStore) GetBestStargate

func (store *TechStore) GetBestStargate(player *Player) *TechHullComponent

get the player's best packet thrower

func (*TechStore) GetBestStructureBomb

func (store *TechStore) GetBestStructureBomb(player *Player) *TechHullComponent

get the best regular structure only bomb for a player

func (*TechStore) GetBestTerraform

func (store *TechStore) GetBestTerraform(player *Player, terraformHabType TerraformHabType) (bestTech *TechTerraform)

get the best terraform for a player

func (*TechStore) GetBestTorpedo

func (store *TechStore) GetBestTorpedo(player *Player) *TechHullComponent

get the best torpedo for a player

func (*TechStore) GetEngine

func (store *TechStore) GetEngine(name string) *TechEngine

func (*TechStore) GetHull

func (store *TechStore) GetHull(name string) *TechHull

func (*TechStore) GetHullComponent

func (store *TechStore) GetHullComponent(name string) *TechHullComponent

func (*TechStore) GetHullComponentsByCategory

func (store *TechStore) GetHullComponentsByCategory(category TechCategory) []TechHullComponent

get all techs by category

func (*TechStore) GetHullsByType

func (store *TechStore) GetHullsByType(techHullType TechHullType) []*TechHull

func (*TechStore) GetTech

func (store *TechStore) GetTech(name string) interface{}

func (*TechStore) GetTechsJustGained

func (store *TechStore) GetTechsJustGained(player *Player, field TechField) []*Tech

func (*TechStore) Init

func (store *TechStore) Init()

type TechTerraform

type TechTerraform struct {
	Tech
	Ability int              `json:"ability,omitempty"`
	HabType TerraformHabType `json:"habType,omitempty"`
}

func TechTerraforms

func TechTerraforms() []TechTerraform

func (*TechTerraform) String

func (t *TechTerraform) String() string

type TerraformHabType

type TerraformHabType string
const (
	TerraformHabTypeNone TerraformHabType = ""
	TerraformHabTypeGrav TerraformHabType = "Grav"
	TerraformHabTypeTemp TerraformHabType = "Temp"
	TerraformHabTypeRad  TerraformHabType = "Rad"
	TerraformHabTypeAll  TerraformHabType = "All"
)

func FromHabType

func FromHabType(habType HabType) TerraformHabType

type TerraformResult

type TerraformResult struct {
	Type      HabType
	Direction int
}

func (TerraformResult) Terraformed

func (t TerraformResult) Terraformed() bool

type Terraformer

type Terraformer interface {
	PermaformOneStep(planet *Planet, player *Player, habType HabType) TerraformResult
	TerraformOneStep(planet *Planet, player *Player, terraformer *Player, reverse bool) TerraformResult
	GetBestTerraform(planet *Planet, player *Player, terraformer *Player) *HabType
	// contains filtered or unexported methods
}

The Terraformer interface handles terraforming planets

func NewTerraformer

func NewTerraformer() Terraformer

type TransportPlan

type TransportPlan struct {
	Num   int                    `json:"num"`
	Name  string                 `json:"name"`
	Tasks WaypointTransportTasks `json:"tasks,omitempty"`
}

func (*TransportPlan) Validate

func (plan *TransportPlan) Validate(player *Player) error

validate this transport plan

type Universe

type Universe struct {
	Planets        []*Planet        `json:"planets,omitempty"`
	Fleets         []*Fleet         `json:"fleets,omitempty"`
	Starbases      []*Fleet         `json:"starbases,omitempty"`
	Wormholes      []*Wormhole      `json:"wormholes,omitempty"`
	MineralPackets []*MineralPacket `json:"mineralPackets,omitempty"`
	MineFields     []*MineField     `json:"mineFields,omitempty"`
	MysteryTraders []*MysteryTrader `json:"mysteryTraders,omitempty"`
	Salvages       []*Salvage       `json:"salvage,omitempty"`
	// contains filtered or unexported fields
}

The Universe represents all the objects that occupy space in the game universe. The Universe is used by the turn generator to lookup objects in space

func NewUniverse

func NewUniverse(rules *Rules) Universe

func (*Universe) GetPlayerMapObjects

func (u *Universe) GetPlayerMapObjects(playerNum int) PlayerMapObjects

get all commandable map objects for a player

type UniverseGenerator

type UniverseGenerator interface {
	Generate() (*Universe, error)
	Area() Vector
}

The UniverseGenerator generates a new universe based on some game settings and players.

func NewUniverseGenerator

func NewUniverseGenerator(game *Game, players []*Player) UniverseGenerator

type User

type User struct {
	DBObject
	Username      string     `json:"username" header:"Username"`
	Password      string     `json:"password"`
	Email         string     `json:"email"`
	Role          UserRole   `json:"role"`
	Banned        bool       `json:"banned"`
	Verified      bool       `json:"verified"`
	GameID        int64      `json:"gameId,omitempty"`
	PlayerNum     int        `json:"playerNum,omitempty"`
	LastLogin     *time.Time `json:"lastLogin,omitempty"`
	DiscordID     *string    `json:"discordId,omitempty"`
	DiscordAvatar *string    `json:"discordAvatar,omitempty"`
}

A User corresponds to a human logged into craig-stars. This might not actually belong in the cs package, but I didn't feel like breaking it out into a new package.

func NewDiscordUser

func NewDiscordUser(username string, discordID string, discordAvatar string) (*User, error)

func NewGuestUser

func NewGuestUser(username string, gameID int64, playerNum int) *User

create a new guest user for a game. This user will have an invite link generated for their username

func NewUser

func NewUser(username string, password string, email string, role UserRole) (*User, error)

func (*User) ComparePassword

func (u *User) ComparePassword(password string) (match bool, err error)

func (*User) GenerateHash

func (u *User) GenerateHash(salt string)

generate an invite hash for this user based on id and store it in the user password

func (*User) IsDiscordUser

func (u *User) IsDiscordUser() bool

func (*User) IsGuest

func (u *User) IsGuest() bool

type UserRole

type UserRole string
const (
	RoleNone  UserRole = ""
	RoleUser  UserRole = "user"
	RoleAdmin UserRole = "admin"
	RoleGuest UserRole = "guest"
)

func UserRoleFromString

func UserRoleFromString(role string) UserRole

type Vector

type Vector struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

A simple 2D vector with handy functions for moving things in space, calculating distance, etc Many of these functions were taken from Godot source, thanks Godot folks.

func (Vector) Add

func (v1 Vector) Add(v2 Vector) Vector

func (Vector) DistanceSquaredTo

func (v Vector) DistanceSquaredTo(to Vector) float64

func (Vector) DistanceTo

func (v Vector) DistanceTo(to Vector) float64

func (Vector) Dot

func (v Vector) Dot(other Vector) float64

func (Vector) Length

func (v Vector) Length() float64

func (Vector) LengthSquared

func (v Vector) LengthSquared() float64

func (Vector) Normalized

func (v Vector) Normalized() Vector

func (Vector) Round

func (v Vector) Round() Vector

func (Vector) Scale

func (v Vector) Scale(scale float64) Vector

func (Vector) String

func (v Vector) String() string

func (Vector) Subtract

func (minuend Vector) Subtract(subtrahend Vector) Vector

type VictoryCondition

type VictoryCondition Bitmask
const (
	VictoryConditionNone                        = 0
	VictoryConditionOwnPlanets VictoryCondition = 1 << (iota - 1)
	VictoryConditionAttainTechLevels
	VictoryConditionExceedsScore
	VictoryConditionExceedsSecondPlaceScore
	VictoryConditionProductionCapacity
	VictoryConditionOwnCapitalShips
	VictoryConditionHighestScoreAfterYears
)

type VictoryConditions

type VictoryConditions struct {
	Conditions               Bitmask `json:"conditions"`
	NumCriteriaRequired      int     `json:"numCriteriaRequired"`
	YearsPassed              int     `json:"yearsPassed"`
	OwnPlanets               int     `json:"ownPlanets"`
	AttainTechLevel          int     `json:"attainTechLevel"`
	AttainTechLevelNumFields int     `json:"attainTechLevelNumFields"`
	ExceedsScore             int     `json:"exceedsScore"`
	ExceedsSecondPlaceScore  int     `json:"exceedsSecondPlaceScore"`
	ProductionCapacity       int     `json:"productionCapacity"`
	OwnCapitalShips          int     `json:"ownCapitalShips"`
	HighestScoreAfterYears   int     `json:"highestScoreAfterYears"`
}

type Waypoint

type Waypoint struct {
	Position             Vector                 `json:"position"`
	WarpSpeed            int                    `json:"warpSpeed"`
	EstFuelUsage         int                    `json:"estFuelUsage,omitempty"`
	Task                 WaypointTask           `json:"task"`
	TransportTasks       WaypointTransportTasks `json:"transportTasks,omitempty"`
	WaitAtWaypoint       bool                   `json:"waitAtWaypoint,omitempty"`
	LayMineFieldDuration int                    `json:"layMineFieldDuration,omitempty"`
	PatrolRange          int                    `json:"patrolRange,omitempty"`
	PatrolWarpSpeed      int                    `json:"patrolWarpSpeed,omitempty"`
	TargetType           MapObjectType          `json:"targetType,omitempty"`
	TargetNum            int                    `json:"targetNum,omitempty"`
	TargetPlayerNum      int                    `json:"targetPlayerNum,omitempty"`
	TargetName           string                 `json:"targetName,omitempty"`
	TransferToPlayer     int                    `json:"transferToPlayer,omitempty"`
	PartiallyComplete    bool                   `json:"partiallyComplete,omitempty"`
	// contains filtered or unexported fields
}

func NewFleetWaypoint

func NewFleetWaypoint(position Vector, num int, playerNum int, name string, warpSpeed int) Waypoint

func NewPlanetWaypoint

func NewPlanetWaypoint(position Vector, num int, name string, warpSpeed int) Waypoint

func NewPositionWaypoint

func NewPositionWaypoint(position Vector, warpSpeed int) Waypoint

func (Waypoint) WithTask

func (wp Waypoint) WithTask(task WaypointTask) Waypoint

func (Waypoint) WithTransportTasks

func (wp Waypoint) WithTransportTasks(transportTasks WaypointTransportTasks) Waypoint

type WaypointTask

type WaypointTask string

type WaypointTaskTransportAction

type WaypointTaskTransportAction string
const (
	// No transport task for the specified cargo.
	TransportActionNone WaypointTaskTransportAction = ""

	// (fuel only) Load or unload fuel until the fleet carries only the exact amount
	// needed to reach the next waypoint. You can use this task to send a fleet
	// loaded with fuel to rescue a stranded fleet. The rescue fleet will transfer
	// only the amount of fuel it can spare without stranding itself.
	TransportActionLoadOptimal WaypointTaskTransportAction = "LoadOptimal"

	// Load as much of the specified cargo as the fleet can hold.
	TransportActionLoadAll WaypointTaskTransportAction = "LoadAll"

	// Unload all the specified cargo at the waypoint.
	TransportActionUnloadAll WaypointTaskTransportAction = "UnloadAll"

	// Load the amount specified only if there is room in the hold.
	TransportActionLoadAmount WaypointTaskTransportAction = "LoadAmount"

	// Unload the amount specified only if the fleet is carrying that amount.
	TransportActionUnloadAmount WaypointTaskTransportAction = "UnloadAmount"

	// Loads up to the specified portion of the cargo hold subject to amount available at waypoint and room left in hold.
	TransportActionFillPercent WaypointTaskTransportAction = "FillPercent"

	// Remain at the waypoint until exactly X % of the hold is filled.
	TransportActionWaitForPercent WaypointTaskTransportAction = "WaitForPercent"

	// (minerals and colonists only) This command waits until all other loads and unloads are complete,
	// then loads as many colonists or amount of a mineral as will fit in the remaining space. For example,
	// setting Load All Germanium, Load Dunnage Ironium, will load all the Germanium that is available,
	// then as much Ironium as possible. If more than one dunnage cargo is specified, they are loaded in
	// the order of Ironium, Boranium, Germanium, and Colonists.
	TransportActionLoadDunnage WaypointTaskTransportAction = "LoadDunnage"

	// Load or unload the cargo until the amount on board is the amount specified.
	// If less than the specified cargo is available, the fleet will not move on.
	TransportActionSetAmountTo WaypointTaskTransportAction = "SetAmountTo"

	// Load or unload the cargo until the amount at the waypoint is the amount specified.
	// This order is always carried out to the best of the fleet’s ability that turn but does not prevent the fleet from moving on.
	TransportActionSetWaypointTo WaypointTaskTransportAction = "SetWaypointTo"
)

type WaypointTransportTask

type WaypointTransportTask struct {
	Amount int                         `json:"amount,omitempty"`
	Action WaypointTaskTransportAction `json:"action,omitempty"`
}

type WaypointTransportTasks

type WaypointTransportTasks struct {
	Fuel      WaypointTransportTask `json:"fuel"`
	Ironium   WaypointTransportTask `json:"ironium"`
	Boranium  WaypointTransportTask `json:"boranium"`
	Germanium WaypointTransportTask `json:"germanium"`
	Colonists WaypointTransportTask `json:"colonists"`
}

type Wormhole

type Wormhole struct {
	MapObject
	DestinationNum   int               `json:"destinationNum,omitempty"`
	Stability        WormholeStability `json:"stability,omitempty"`
	YearsAtStability int               `json:"yearsAtStability,omitempty"`
	Spec             WormholeSpec      `json:"spec,omitempty"`
}

func (*Wormhole) String

func (w *Wormhole) String() string

type WormholeIntel

type WormholeIntel struct {
	MapObjectIntel
	DestinationNum int               `json:"destinationNum,omitempty"`
	Stability      WormholeStability `json:"stability,omitempty"`
}

type WormholeSpec

type WormholeSpec struct {
	Stats WormholeStats
}

type WormholeStability

type WormholeStability string
const (
	WormholeStabilityNone              WormholeStability = ""
	WormholeStabilityRockSolid         WormholeStability = "RockSolid"
	WormholeStabilityStable            WormholeStability = "Stable"
	WormholeStabilityMostlyStable      WormholeStability = "MostlyStable"
	WormholeStabilityAverage           WormholeStability = "Average"
	WormholeStabilitySlightlyVolatile  WormholeStability = "SlightlyVolatile"
	WormholeStabilityVolatile          WormholeStability = "Volatile"
	WormholeStabilityExtremelyVolatile WormholeStability = "ExtremelyVolatile"
)

type WormholeStats

type WormholeStats struct {
	YearsToDegrade int     `json:"yearsToDegrade"`
	ChanceToJump   float64 `json:"chanceToJump"`
	JiggleDistance int     `json:"jiggleDistance"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL