Documentation
¶
Index ¶
- Constants
- Variables
- func AngleDistance(a, b float64) float64
- func ClampAngle(angle float64) float64
- func ClampAngle2Pi(angle float64) float64
- func EntityDistance(e1, e2 Entity) float64
- func GetGroupsForWeapon(w Weapon, weaponGroups [][]Weapon) []uint
- func HeadingPitchTowardPoint3D(source, target *geom3d.Vector3) (float64, float64)
- func InArray(array, search interface{}) bool
- func IsBetweenDegrees(start, end, mid float64) bool
- func IsBetweenRadians(start, end, mid float64) bool
- func IsEntityUnit(entity Entity) bool
- func IsWeaponInGroup(w Weapon, g uint, weaponGroups [][]Weapon) bool
- func ListMissionFilenames() ([]string, error)
- func NewBallisticWeapon(r *ModelBallisticWeaponResource, collisionRadius, collisionHeight float64, ...) (*BallisticWeapon, Projectile)
- func NewEnergyWeapon(r *ModelEnergyWeaponResource, collisionRadius, collisionHeight float64, ...) (*EnergyWeapon, Projectile)
- func NewMissileWeapon(r *ModelMissileWeaponResource, collisionRadius, collisionHeight float64, ...) (*MissileWeapon, Projectile)
- func PointInProximity(distance, srcX, srcY, tgtX, tgtY float64) bool
- func RandFloat64In(lo, hi float64) float64
- func TechBaseString(t TechBase) string
- func WeaponPosition3D(e Unit, weaponOffX, weaponOffY float64) *geom3d.Vector3
- type Ammo
- func (a *Ammo) AddAmmoBin(ammoType AmmoType, ammoTons float64, forWeapon Weapon) *AmmoBin
- func (a *Ammo) AmmoBinList() []*AmmoBin
- func (a *Ammo) CheckAmmo(forWeapon Weapon) int
- func (a *Ammo) ConsumeAmmo(forWeapon Weapon, consumeN int) *AmmoBin
- func (a *Ammo) GetAmmoBin(ammoType AmmoType, forWeapon Weapon) *AmmoBin
- type AmmoBin
- type AmmoType
- type BallisticWeapon
- func (w *BallisticWeapon) AmmoBin() *AmmoBin
- func (w *BallisticWeapon) AmmoPerTon() int
- func (w *BallisticWeapon) Audio() string
- func (w *BallisticWeapon) Classification() WeaponClassification
- func (w *BallisticWeapon) Clone() Weapon
- func (w *BallisticWeapon) Cooldown() float64
- func (w *BallisticWeapon) Damage() float64
- func (w *BallisticWeapon) DecreaseCooldown(decreaseBy float64)
- func (w *BallisticWeapon) Distance() float64
- func (w *BallisticWeapon) File() string
- func (w *BallisticWeapon) Heat() float64
- func (w *BallisticWeapon) MaxCooldown() float64
- func (w *BallisticWeapon) Name() string
- func (w *BallisticWeapon) Offset() *geom.Vector2
- func (w *BallisticWeapon) Parent() Entity
- func (w *BallisticWeapon) ProjectileCount() int
- func (w *BallisticWeapon) ProjectileDelay() float64
- func (w *BallisticWeapon) ProjectileSpread() float64
- func (w *BallisticWeapon) SetAmmoBin(ammoBin *AmmoBin)
- func (w *BallisticWeapon) ShortName() string
- func (w *BallisticWeapon) SpawnProjectile(angle, pitch float64, spawnedBy Unit) *Projectile
- func (w *BallisticWeapon) SpawnProjectileToward(target *geom3d.Vector3, spawnedBy Unit) *Projectile
- func (w *BallisticWeapon) Summary() string
- func (w *BallisticWeapon) Tech() TechBase
- func (w *BallisticWeapon) Tonnage() float64
- func (w *BallisticWeapon) TriggerCooldown()
- func (w *BallisticWeapon) Type() WeaponType
- func (w *BallisticWeapon) Velocity() float64
- type BasicEntity
- func (e *BasicEntity) Anchor() raycaster.SpriteAnchor
- func (e *BasicEntity) ApplyDamage(damage float64)
- func (e *BasicEntity) ArmorPoints() float64
- func (e *BasicEntity) Clone() Entity
- func (e *BasicEntity) CollisionHeight() float64
- func (e *BasicEntity) CollisionRadius() float64
- func (e *BasicEntity) Heading() float64
- func (e *BasicEntity) IsDestroyed() bool
- func (e *BasicEntity) MaxArmorPoints() float64
- func (e *BasicEntity) MaxStructurePoints() float64
- func (e *BasicEntity) Parent() Entity
- func (e *BasicEntity) Pitch() float64
- func (e *BasicEntity) Pos() *geom.Vector2
- func (e *BasicEntity) PosZ() float64
- func (e *BasicEntity) SetAnchor(anchor raycaster.SpriteAnchor)
- func (e *BasicEntity) SetArmorPoints(armor float64)
- func (e *BasicEntity) SetCollisionHeight(collisionHeight float64)
- func (e *BasicEntity) SetCollisionRadius(collisionRadius float64)
- func (e *BasicEntity) SetHeading(angle float64)
- func (e *BasicEntity) SetParent(parent Entity)
- func (e *BasicEntity) SetPitch(pitch float64)
- func (e *BasicEntity) SetPos(pos *geom.Vector2)
- func (e *BasicEntity) SetPosZ(posZ float64)
- func (e *BasicEntity) SetStructurePoints(structure float64)
- func (e *BasicEntity) SetVelocity(velocity float64)
- func (e *BasicEntity) SetVelocityZ(velocityZ float64)
- func (e *BasicEntity) StructurePoints() float64
- func (e *BasicEntity) Velocity() float64
- func (e *BasicEntity) VelocityZ() float64
- type Emplacement
- func (e *Emplacement) Clone() Entity
- func (e *Emplacement) CloneUnit() Unit
- func (e *Emplacement) Heat() float64
- func (e *Emplacement) HeatDissipation() float64
- func (e *Emplacement) MaxArmorPoints() float64
- func (e *Emplacement) MaxStructurePoints() float64
- func (e *Emplacement) Name() string
- func (e *Emplacement) Tonnage() float64
- func (e *Emplacement) TriggerWeapon(w Weapon) bool
- func (e *Emplacement) TurnRate() float64
- func (e *Emplacement) Update() bool
- func (e *Emplacement) Variant() string
- type EnergyWeapon
- func (w *EnergyWeapon) AmmoBin() *AmmoBin
- func (w *EnergyWeapon) AmmoPerTon() int
- func (w *EnergyWeapon) Audio() string
- func (w *EnergyWeapon) Classification() WeaponClassification
- func (w *EnergyWeapon) Clone() Weapon
- func (w *EnergyWeapon) Cooldown() float64
- func (w *EnergyWeapon) Damage() float64
- func (w *EnergyWeapon) DecreaseCooldown(decreaseBy float64)
- func (w *EnergyWeapon) Distance() float64
- func (w *EnergyWeapon) File() string
- func (w *EnergyWeapon) Heat() float64
- func (w *EnergyWeapon) MaxCooldown() float64
- func (w *EnergyWeapon) Name() string
- func (w *EnergyWeapon) Offset() *geom.Vector2
- func (w *EnergyWeapon) Parent() Entity
- func (w *EnergyWeapon) ProjectileCount() int
- func (w *EnergyWeapon) ProjectileDelay() float64
- func (w *EnergyWeapon) ProjectileSpread() float64
- func (w *EnergyWeapon) SetAmmoBin(ammoBin *AmmoBin)
- func (w *EnergyWeapon) ShortName() string
- func (w *EnergyWeapon) SpawnProjectile(angle, pitch float64, spawnedBy Unit) *Projectile
- func (w *EnergyWeapon) SpawnProjectileToward(target *geom3d.Vector3, spawnedBy Unit) *Projectile
- func (w *EnergyWeapon) Summary() string
- func (w *EnergyWeapon) Tech() TechBase
- func (w *EnergyWeapon) Tonnage() float64
- func (w *EnergyWeapon) TriggerCooldown()
- func (w *EnergyWeapon) Type() WeaponType
- func (w *EnergyWeapon) Velocity() float64
- type Entity
- type HeatSinkType
- type Infantry
- func (e *Infantry) Clone() Entity
- func (e *Infantry) CloneUnit() Unit
- func (e *Infantry) Heat() float64
- func (e *Infantry) HeatDissipation() float64
- func (e *Infantry) MaxArmorPoints() float64
- func (e *Infantry) MaxStructurePoints() float64
- func (e *Infantry) Name() string
- func (e *Infantry) Tonnage() float64
- func (e *Infantry) TriggerWeapon(w Weapon) bool
- func (e *Infantry) TurnRate() float64
- func (e *Infantry) Update() bool
- func (e *Infantry) Variant() string
- type Location
- type Map
- type MapClutter
- type MapFloorPathing
- type MapFlooring
- type MapGenerateLevels
- type MapGeneratePrefabs
- type MapLighting
- type MapSprite
- type MapSpriteFill
- type MapSpriteStamp
- type MapTexture
- type Mech
- func (e *Mech) Class() MechClass
- func (e *Mech) Clone() Entity
- func (e *Mech) CloneUnit() Unit
- func (e *Mech) MaxArmorPoints() float64
- func (e *Mech) MaxStructurePoints() float64
- func (e *Mech) Name() string
- func (e *Mech) SetPowered(powered UnitPowerStatus)
- func (e *Mech) Tonnage() float64
- func (e *Mech) Update() bool
- func (e *Mech) Variant() string
- type MechClass
- type MissileWeapon
- func (w *MissileWeapon) AmmoBin() *AmmoBin
- func (w *MissileWeapon) AmmoPerTon() int
- func (w *MissileWeapon) Audio() string
- func (w *MissileWeapon) Classification() WeaponClassification
- func (w *MissileWeapon) Clone() Weapon
- func (w *MissileWeapon) Cooldown() float64
- func (w *MissileWeapon) Damage() float64
- func (w *MissileWeapon) DecreaseCooldown(decreaseBy float64)
- func (w *MissileWeapon) Distance() float64
- func (w *MissileWeapon) File() string
- func (w *MissileWeapon) Heat() float64
- func (w *MissileWeapon) IsLockOn() bool
- func (w *MissileWeapon) IsLockOnLockRequired() bool
- func (w *MissileWeapon) LockOnGroupRadius() float64
- func (w *MissileWeapon) LockOnTurnRate() float64
- func (w *MissileWeapon) MaxCooldown() float64
- func (w *MissileWeapon) Name() string
- func (w *MissileWeapon) Offset() *geom.Vector2
- func (w *MissileWeapon) Parent() Entity
- func (w *MissileWeapon) ProjectileCount() int
- func (w *MissileWeapon) ProjectileDelay() float64
- func (w *MissileWeapon) ProjectileSpread() float64
- func (w *MissileWeapon) SetAmmoBin(ammoBin *AmmoBin)
- func (w *MissileWeapon) ShortName() string
- func (w *MissileWeapon) SpawnProjectile(angle, pitch float64, spawnedBy Unit) *Projectile
- func (w *MissileWeapon) SpawnProjectileToward(target *geom3d.Vector3, spawnedBy Unit) *Projectile
- func (w *MissileWeapon) Summary() string
- func (w *MissileWeapon) Tech() TechBase
- func (w *MissileWeapon) Tonnage() float64
- func (w *MissileWeapon) TriggerCooldown()
- func (w *MissileWeapon) Type() WeaponType
- func (w *MissileWeapon) Velocity() float64
- type Mission
- type MissionDestroyObjectives
- type MissionDropZone
- type MissionEmplacement
- type MissionInfantry
- type MissionMech
- type MissionNavDustoff
- type MissionNavObjectives
- type MissionNavVisit
- type MissionObjectives
- type MissionProtectObjectives
- type MissionVTOL
- type MissionVehicle
- type ModelAmmoType
- type ModelBallisticWeaponResource
- type ModelEffectResource
- type ModelEmplacementResource
- type ModelEnergyWeaponResource
- type ModelHeatSinkType
- type ModelInfantryResource
- type ModelLocation
- type ModelMechResource
- type ModelMissileWeaponLockOn
- type ModelMissileWeaponResource
- type ModelProjectileResource
- type ModelResourceAmmo
- type ModelResourceArmament
- type ModelResourceHeatSinks
- type ModelResourceImageSheet
- type ModelResources
- func (r *ModelResources) GetBallisticWeaponResource(weapon string) *ModelBallisticWeaponResource
- func (r *ModelResources) GetEmplacementResource(unit string) *ModelEmplacementResource
- func (r *ModelResources) GetEmplacementResourceList() []*ModelEmplacementResource
- func (r *ModelResources) GetEnergyWeaponResource(weapon string) *ModelEnergyWeaponResource
- func (r *ModelResources) GetInfantryResource(unit string) *ModelInfantryResource
- func (r *ModelResources) GetInfantryResourceList() []*ModelInfantryResource
- func (r *ModelResources) GetMechResource(unit string) *ModelMechResource
- func (r *ModelResources) GetMechResourceList() []*ModelMechResource
- func (r *ModelResources) GetMissileWeaponResource(weapon string) *ModelMissileWeaponResource
- func (r *ModelResources) GetVTOLResource(unit string) *ModelVTOLResource
- func (r *ModelResources) GetVTOLResourceList() []*ModelVTOLResource
- func (r *ModelResources) GetVehicleResource(unit string) *ModelVehicleResource
- func (r *ModelResources) GetVehicleResourceList() []*ModelVehicleResource
- type ModelTech
- type ModelVTOLResource
- type ModelVehicleResource
- type ModelWeaponType
- type NavObjective
- type NavPoint
- func (n *NavPoint) Image() *ebiten.Image
- func (n *NavPoint) Objective() NavObjective
- func (n *NavPoint) Pos() geom.Vector2
- func (n *NavPoint) SetImage(image *ebiten.Image)
- func (n *NavPoint) SetObjective(objective NavObjective)
- func (n *NavPoint) SetVisited(visited bool)
- func (n *NavPoint) Visited() bool
- type Projectile
- func (e *Projectile) Acceleration() float64
- func (e *Projectile) Anchor() raycaster.SpriteAnchor
- func (e *Projectile) ApplyDamage(damage float64)
- func (e *Projectile) ArmorPoints() float64
- func (e *Projectile) Clone() Entity
- func (e *Projectile) CockpitOffset() *geom.Vector2
- func (e *Projectile) CollisionHeight() float64
- func (e *Projectile) CollisionRadius() float64
- func (e *Projectile) Damage() float64
- func (e *Projectile) DecreaseLifespan(decreaseBy float64) float64
- func (e *Projectile) Destroy()
- func (e *Projectile) Heading() float64
- func (e *Projectile) InExtremeRange() bool
- func (e *Projectile) IsDestroyed() bool
- func (e *Projectile) Lifespan() float64
- func (e *Projectile) LockOnOffset() *geom3d.Vector3
- func (e *Projectile) MaxArmorPoints() float64
- func (e *Projectile) MaxStructurePoints() float64
- func (e *Projectile) MaxVelocity() float64
- func (e *Projectile) Parent() Entity
- func (e *Projectile) Pitch() float64
- func (e *Projectile) Pos() *geom.Vector2
- func (e *Projectile) PosZ() float64
- func (e *Projectile) SetAcceleration(acceleration float64)
- func (e *Projectile) SetAnchor(anchor raycaster.SpriteAnchor)
- func (e *Projectile) SetArmorPoints(armor float64)
- func (e *Projectile) SetCollisionHeight(collisionHeight float64)
- func (e *Projectile) SetCollisionRadius(collisionRadius float64)
- func (e *Projectile) SetHeading(angle float64)
- func (e *Projectile) SetMaxVelocity(maxVelocity float64)
- func (e *Projectile) SetParent(parent Entity)
- func (e *Projectile) SetPitch(pitch float64)
- func (e *Projectile) SetPos(pos *geom.Vector2)
- func (e *Projectile) SetPosZ(posZ float64)
- func (e *Projectile) SetStructurePoints(structure float64)
- func (e *Projectile) SetVelocity(velocity float64)
- func (e *Projectile) SetVelocityZ(velocityZ float64)
- func (e *Projectile) SetWeapon(weapon Weapon)
- func (e *Projectile) StructurePoints() float64
- func (e *Projectile) Velocity() float64
- func (e *Projectile) VelocityZ() float64
- func (e *Projectile) Weapon() Weapon
- type RegExp
- type SpriteAnchor
- type TechBase
- type Unit
- type UnitModel
- func (e *UnitModel) AddArmament(w Weapon)
- func (e *UnitModel) Ammunition() *Ammo
- func (e *UnitModel) Anchor() raycaster.SpriteAnchor
- func (e *UnitModel) ApplyDamage(damage float64)
- func (e *UnitModel) Armament() []Weapon
- func (e *UnitModel) ArmorPoints() float64
- func (e *UnitModel) CockpitOffset() *geom.Vector2
- func (e *UnitModel) CollisionHeight() float64
- func (e *UnitModel) CollisionRadius() float64
- func (e1 *UnitModel) DistanceToEntity(e2 Entity) float64
- func (e *UnitModel) HasTurret() bool
- func (e *UnitModel) Heading() float64
- func (e *UnitModel) Heat() float64
- func (e *UnitModel) HeatDissipation() float64
- func (e *UnitModel) ID() string
- func (e *UnitModel) IsDestroyed() bool
- func (e *UnitModel) IsPlayer() bool
- func (e *UnitModel) JumpJetDuration() float64
- func (e *UnitModel) JumpJetHeading() float64
- func (e *UnitModel) JumpJetVelocity() float64
- func (e *UnitModel) JumpJets() int
- func (e *UnitModel) JumpJetsActive() bool
- func (e *UnitModel) JumpJetsDirectional() bool
- func (e *UnitModel) MaxHeat() float64
- func (e *UnitModel) MaxJumpJetDuration() float64
- func (e *UnitModel) MaxVelocity() float64
- func (e *UnitModel) Objective() UnitObjective
- func (e *UnitModel) OverHeated() bool
- func (e *UnitModel) Parent() Entity
- func (e *UnitModel) Pitch() float64
- func (e *UnitModel) Pos() *geom.Vector2
- func (e *UnitModel) PosZ() float64
- func (e *UnitModel) Powered() UnitPowerStatus
- func (e *UnitModel) SetAnchor(anchor raycaster.SpriteAnchor)
- func (e *UnitModel) SetArmorPoints(armor float64)
- func (e *UnitModel) SetAsPlayer(isPlayer bool)
- func (e *UnitModel) SetCollisionHeight(collisionHeight float64)
- func (e *UnitModel) SetCollisionRadius(collisionRadius float64)
- func (e *UnitModel) SetHasTurret(hasTurret bool)
- func (e *UnitModel) SetHeading(angle float64)
- func (e *UnitModel) SetID(id string)
- func (e *UnitModel) SetJumpJetHeading(heading float64)
- func (e *UnitModel) SetJumpJetsActive(active bool)
- func (e *UnitModel) SetJumpJetsDirectional(isDirectional bool)
- func (e *UnitModel) SetObjective(objective UnitObjective)
- func (e *UnitModel) SetParent(parent Entity)
- func (e *UnitModel) SetPitch(pitch float64)
- func (e *UnitModel) SetPos(pos *geom.Vector2)
- func (e *UnitModel) SetPosZ(posZ float64)
- func (e *UnitModel) SetPowered(powered UnitPowerStatus)
- func (e *UnitModel) SetStructurePoints(structure float64)
- func (e *UnitModel) SetTarget(t Entity)
- func (e *UnitModel) SetTargetHeading(heading float64)
- func (e *UnitModel) SetTargetLock(lockPercent float64)
- func (e *UnitModel) SetTargetPitch(pitch float64)
- func (e *UnitModel) SetTargetTurretAngle(angle float64)
- func (e *UnitModel) SetTargetVelocity(tVelocity float64)
- func (e *UnitModel) SetTargetVelocityZ(tVelocityZ float64)
- func (e *UnitModel) SetTurretAngle(angle float64)
- func (e *UnitModel) SetVelocity(velocity float64)
- func (e *UnitModel) SetVelocityZ(velocityZ float64)
- func (e *UnitModel) StructurePoints() float64
- func (e *UnitModel) Target() Entity
- func (e *UnitModel) TargetLock() float64
- func (e *UnitModel) TargetVelocity() float64
- func (e *UnitModel) TargetVelocityZ() float64
- func (e *UnitModel) TriggerWeapon(w Weapon) bool
- func (e *UnitModel) TurnRate() float64
- func (e *UnitModel) TurretAngle() float64
- func (e *UnitModel) TurretRate() float64
- func (e *UnitModel) UnitType() UnitType
- func (e *UnitModel) Velocity() float64
- func (e *UnitModel) VelocityZ() float64
- type UnitObjective
- type UnitPowerStatus
- type UnitType
- type VTOL
- func (e *VTOL) Clone() Entity
- func (e *VTOL) CloneUnit() Unit
- func (e *VTOL) MaxArmorPoints() float64
- func (e *VTOL) MaxStructurePoints() float64
- func (e *VTOL) Name() string
- func (e *VTOL) SetTargetVelocityZ(tVelocityZ float64)
- func (e *VTOL) Tonnage() float64
- func (e *VTOL) Update() bool
- func (e *VTOL) Variant() string
- type Vehicle
- type Weapon
- type WeaponClassification
- type WeaponFireMode
- type WeaponType
Constants ¶
const ( MECH_POWER_ON_SECONDS float64 = 5.0 MECH_TURN_RATE_FACTOR float64 = (0.25 * geom.Pi) / TICKS_PER_SECOND MECH_TURRET_RATE_FACTOR float64 = 1.5 * MECH_TURN_RATE_FACTOR MECH_JUMP_JET_BOOST_PER_JET float64 = 10.0 / METERS_PER_UNIT / TICKS_PER_SECOND MECH_JUMP_JET_DELAY_SECONDS float64 = 5.0 MECH_JUMP_JET_RECHARGE_SECONDS float64 = 5.0 MECH_JUMP_JET_DIRECTIONAL_ANGLE float64 = geom.Pi / 8 )
const ( METERS_PER_UNIT float64 = 20 TICKS_PER_SECOND float64 = 60 SECONDS_PER_TICK float64 = 1 / TICKS_PER_SECOND VELOCITY_TO_KPH float64 = (METERS_PER_UNIT / 1000) * (TICKS_PER_SECOND * 60 * 60) KPH_TO_VELOCITY float64 = 1 / VELOCITY_TO_KPH GRAVITY_METERS_PSS float64 = 9.80665 GRAVITY_UNITS_PTT float64 = GRAVITY_METERS_PSS / METERS_PER_UNIT / (TICKS_PER_SECOND * TICKS_PER_SECOND) CEILING_JUMP float64 = 5.0 CEILING_VTOL float64 = 5.0 // TODO: set flight ceiling in map yaml )
const ( AMMO_NOT_APPLICABLE = iota AMMO_BALLISTIC AMMO_LRM AMMO_SRM AMMO_STREAK_SRM )
const ( MechResourceType string = "mechs" VehicleResourceType string = "vehicles" VTOLResourceType string = "vtols" InfantryResourceType string = "infantry" EmplacementResourceType string = "emplacements" ProjectilesResourceType string = "projectiles" EffectsResourceType string = "effects" EnergyResourceType string = "energy" MissileResourceType string = "missile" BallisticResourceType string = "ballistic" )
const (
UNIT_POWER_OFF_SECONDS float64 = 1.5
)
Variables ¶
var (
Randish *rand.Rand
)
Functions ¶
func AngleDistance ¶
func ClampAngle ¶
ClampAngle clamps the given angle in a range of -pi to pi
func ClampAngle2Pi ¶ added in v0.0.1
ClampAngle2Pi clamps the given in a range of 0 to 2*pi
func EntityDistance ¶
func GetGroupsForWeapon ¶
func IsBetweenDegrees ¶
func IsBetweenRadians ¶
func IsEntityUnit ¶
func ListMissionFilenames ¶
func NewBallisticWeapon ¶
func NewBallisticWeapon(r *ModelBallisticWeaponResource, collisionRadius, collisionHeight float64, offset *geom.Vector2, parent Entity) (*BallisticWeapon, Projectile)
func NewEnergyWeapon ¶
func NewEnergyWeapon(r *ModelEnergyWeaponResource, collisionRadius, collisionHeight float64, offset *geom.Vector2, parent Entity) (*EnergyWeapon, Projectile)
func NewMissileWeapon ¶
func NewMissileWeapon(r *ModelMissileWeaponResource, collisionRadius, collisionHeight float64, offset *geom.Vector2, onePxOffset *geom.Vector2, parent Entity) (*MissileWeapon, Projectile)
func PointInProximity ¶
func RandFloat64In ¶
func TechBaseString ¶
Types ¶
type Ammo ¶
type Ammo struct {
// contains filtered or unexported fields
}
func NewAmmoStock ¶
func NewAmmoStock() *Ammo
func (*Ammo) AddAmmoBin ¶
AddAmmoBin creates ammo bin or updates existing one for the same ammo type/weapon
func (*Ammo) AmmoBinList ¶
AmmoBinList returns the list of ammo bins
func (*Ammo) ConsumeAmmo ¶
ConsumeAmmo consumes the ammo count of weapon fired N times
type AmmoBin ¶
type AmmoBin struct {
// contains filtered or unexported fields
}
func (*AmmoBin) ConsumeAmmo ¶
ConsumeAmmo consumes the ammo count of weapon fired N times
type BallisticWeapon ¶
type BallisticWeapon struct { Resource *ModelBallisticWeaponResource // contains filtered or unexported fields }
func (*BallisticWeapon) AmmoBin ¶
func (w *BallisticWeapon) AmmoBin() *AmmoBin
func (*BallisticWeapon) AmmoPerTon ¶
func (w *BallisticWeapon) AmmoPerTon() int
func (*BallisticWeapon) Audio ¶
func (w *BallisticWeapon) Audio() string
func (*BallisticWeapon) Classification ¶
func (w *BallisticWeapon) Classification() WeaponClassification
func (*BallisticWeapon) Clone ¶
func (w *BallisticWeapon) Clone() Weapon
func (*BallisticWeapon) Cooldown ¶
func (w *BallisticWeapon) Cooldown() float64
func (*BallisticWeapon) Damage ¶
func (w *BallisticWeapon) Damage() float64
func (*BallisticWeapon) DecreaseCooldown ¶
func (w *BallisticWeapon) DecreaseCooldown(decreaseBy float64)
func (*BallisticWeapon) Distance ¶
func (w *BallisticWeapon) Distance() float64
func (*BallisticWeapon) File ¶
func (w *BallisticWeapon) File() string
func (*BallisticWeapon) Heat ¶
func (w *BallisticWeapon) Heat() float64
func (*BallisticWeapon) MaxCooldown ¶
func (w *BallisticWeapon) MaxCooldown() float64
func (*BallisticWeapon) Name ¶
func (w *BallisticWeapon) Name() string
func (*BallisticWeapon) Offset ¶
func (w *BallisticWeapon) Offset() *geom.Vector2
func (*BallisticWeapon) Parent ¶
func (w *BallisticWeapon) Parent() Entity
func (*BallisticWeapon) ProjectileCount ¶
func (w *BallisticWeapon) ProjectileCount() int
func (*BallisticWeapon) ProjectileDelay ¶
func (w *BallisticWeapon) ProjectileDelay() float64
func (*BallisticWeapon) ProjectileSpread ¶
func (w *BallisticWeapon) ProjectileSpread() float64
func (*BallisticWeapon) SetAmmoBin ¶
func (w *BallisticWeapon) SetAmmoBin(ammoBin *AmmoBin)
func (*BallisticWeapon) ShortName ¶
func (w *BallisticWeapon) ShortName() string
func (*BallisticWeapon) SpawnProjectile ¶
func (w *BallisticWeapon) SpawnProjectile(angle, pitch float64, spawnedBy Unit) *Projectile
func (*BallisticWeapon) SpawnProjectileToward ¶
func (w *BallisticWeapon) SpawnProjectileToward(target *geom3d.Vector3, spawnedBy Unit) *Projectile
func (*BallisticWeapon) Summary ¶ added in v0.0.1
func (w *BallisticWeapon) Summary() string
func (*BallisticWeapon) Tech ¶
func (w *BallisticWeapon) Tech() TechBase
func (*BallisticWeapon) Tonnage ¶
func (w *BallisticWeapon) Tonnage() float64
func (*BallisticWeapon) TriggerCooldown ¶
func (w *BallisticWeapon) TriggerCooldown()
func (*BallisticWeapon) Type ¶
func (w *BallisticWeapon) Type() WeaponType
func (*BallisticWeapon) Velocity ¶
func (w *BallisticWeapon) Velocity() float64
type BasicEntity ¶
type BasicEntity struct {
// contains filtered or unexported fields
}
func BasicCollisionEntity ¶
func BasicCollisionEntity(x, y, z float64, anchor raycaster.SpriteAnchor, collisionRadius, collisionHeight, hitPoints float64) *BasicEntity
func BasicVisualEntity ¶
func BasicVisualEntity(x, y, z float64, anchor raycaster.SpriteAnchor) *BasicEntity
func (*BasicEntity) Anchor ¶
func (e *BasicEntity) Anchor() raycaster.SpriteAnchor
func (*BasicEntity) ApplyDamage ¶
func (e *BasicEntity) ApplyDamage(damage float64)
func (*BasicEntity) ArmorPoints ¶
func (e *BasicEntity) ArmorPoints() float64
func (*BasicEntity) Clone ¶
func (e *BasicEntity) Clone() Entity
func (*BasicEntity) CollisionHeight ¶
func (e *BasicEntity) CollisionHeight() float64
func (*BasicEntity) CollisionRadius ¶
func (e *BasicEntity) CollisionRadius() float64
func (*BasicEntity) Heading ¶
func (e *BasicEntity) Heading() float64
func (*BasicEntity) IsDestroyed ¶
func (e *BasicEntity) IsDestroyed() bool
func (*BasicEntity) MaxArmorPoints ¶
func (e *BasicEntity) MaxArmorPoints() float64
func (*BasicEntity) MaxStructurePoints ¶
func (e *BasicEntity) MaxStructurePoints() float64
func (*BasicEntity) Parent ¶
func (e *BasicEntity) Parent() Entity
func (*BasicEntity) Pitch ¶
func (e *BasicEntity) Pitch() float64
func (*BasicEntity) Pos ¶
func (e *BasicEntity) Pos() *geom.Vector2
func (*BasicEntity) PosZ ¶
func (e *BasicEntity) PosZ() float64
func (*BasicEntity) SetAnchor ¶
func (e *BasicEntity) SetAnchor(anchor raycaster.SpriteAnchor)
func (*BasicEntity) SetArmorPoints ¶
func (e *BasicEntity) SetArmorPoints(armor float64)
func (*BasicEntity) SetCollisionHeight ¶
func (e *BasicEntity) SetCollisionHeight(collisionHeight float64)
func (*BasicEntity) SetCollisionRadius ¶
func (e *BasicEntity) SetCollisionRadius(collisionRadius float64)
func (*BasicEntity) SetHeading ¶
func (e *BasicEntity) SetHeading(angle float64)
func (*BasicEntity) SetParent ¶
func (e *BasicEntity) SetParent(parent Entity)
func (*BasicEntity) SetPitch ¶
func (e *BasicEntity) SetPitch(pitch float64)
func (*BasicEntity) SetPos ¶
func (e *BasicEntity) SetPos(pos *geom.Vector2)
func (*BasicEntity) SetPosZ ¶
func (e *BasicEntity) SetPosZ(posZ float64)
func (*BasicEntity) SetStructurePoints ¶
func (e *BasicEntity) SetStructurePoints(structure float64)
func (*BasicEntity) SetVelocity ¶
func (e *BasicEntity) SetVelocity(velocity float64)
func (*BasicEntity) SetVelocityZ ¶
func (e *BasicEntity) SetVelocityZ(velocityZ float64)
func (*BasicEntity) StructurePoints ¶
func (e *BasicEntity) StructurePoints() float64
func (*BasicEntity) Velocity ¶
func (e *BasicEntity) Velocity() float64
func (*BasicEntity) VelocityZ ¶
func (e *BasicEntity) VelocityZ() float64
type Emplacement ¶
type Emplacement struct { *UnitModel Resource *ModelEmplacementResource }
func NewEmplacement ¶
func NewEmplacement(r *ModelEmplacementResource, collisionRadius, collisionHeight float64, cockpitOffset *geom.Vector2) *Emplacement
func (*Emplacement) Clone ¶
func (e *Emplacement) Clone() Entity
func (*Emplacement) CloneUnit ¶
func (e *Emplacement) CloneUnit() Unit
func (*Emplacement) Heat ¶
func (e *Emplacement) Heat() float64
func (*Emplacement) HeatDissipation ¶
func (e *Emplacement) HeatDissipation() float64
func (*Emplacement) MaxArmorPoints ¶
func (e *Emplacement) MaxArmorPoints() float64
func (*Emplacement) MaxStructurePoints ¶
func (e *Emplacement) MaxStructurePoints() float64
func (*Emplacement) Name ¶
func (e *Emplacement) Name() string
func (*Emplacement) Tonnage ¶
func (e *Emplacement) Tonnage() float64
func (*Emplacement) TriggerWeapon ¶
func (e *Emplacement) TriggerWeapon(w Weapon) bool
func (*Emplacement) TurnRate ¶
func (e *Emplacement) TurnRate() float64
func (*Emplacement) Update ¶
func (e *Emplacement) Update() bool
func (*Emplacement) Variant ¶
func (e *Emplacement) Variant() string
type EnergyWeapon ¶
type EnergyWeapon struct { Resource *ModelEnergyWeaponResource // contains filtered or unexported fields }
func (*EnergyWeapon) AmmoBin ¶
func (w *EnergyWeapon) AmmoBin() *AmmoBin
func (*EnergyWeapon) AmmoPerTon ¶
func (w *EnergyWeapon) AmmoPerTon() int
func (*EnergyWeapon) Audio ¶
func (w *EnergyWeapon) Audio() string
func (*EnergyWeapon) Classification ¶
func (w *EnergyWeapon) Classification() WeaponClassification
func (*EnergyWeapon) Clone ¶
func (w *EnergyWeapon) Clone() Weapon
func (*EnergyWeapon) Cooldown ¶
func (w *EnergyWeapon) Cooldown() float64
func (*EnergyWeapon) Damage ¶
func (w *EnergyWeapon) Damage() float64
func (*EnergyWeapon) DecreaseCooldown ¶
func (w *EnergyWeapon) DecreaseCooldown(decreaseBy float64)
func (*EnergyWeapon) Distance ¶
func (w *EnergyWeapon) Distance() float64
func (*EnergyWeapon) File ¶
func (w *EnergyWeapon) File() string
func (*EnergyWeapon) Heat ¶
func (w *EnergyWeapon) Heat() float64
func (*EnergyWeapon) MaxCooldown ¶
func (w *EnergyWeapon) MaxCooldown() float64
func (*EnergyWeapon) Name ¶
func (w *EnergyWeapon) Name() string
func (*EnergyWeapon) Offset ¶
func (w *EnergyWeapon) Offset() *geom.Vector2
func (*EnergyWeapon) Parent ¶
func (w *EnergyWeapon) Parent() Entity
func (*EnergyWeapon) ProjectileCount ¶
func (w *EnergyWeapon) ProjectileCount() int
func (*EnergyWeapon) ProjectileDelay ¶
func (w *EnergyWeapon) ProjectileDelay() float64
func (*EnergyWeapon) ProjectileSpread ¶
func (w *EnergyWeapon) ProjectileSpread() float64
func (*EnergyWeapon) SetAmmoBin ¶
func (w *EnergyWeapon) SetAmmoBin(ammoBin *AmmoBin)
func (*EnergyWeapon) ShortName ¶
func (w *EnergyWeapon) ShortName() string
func (*EnergyWeapon) SpawnProjectile ¶
func (w *EnergyWeapon) SpawnProjectile(angle, pitch float64, spawnedBy Unit) *Projectile
func (*EnergyWeapon) SpawnProjectileToward ¶
func (w *EnergyWeapon) SpawnProjectileToward(target *geom3d.Vector3, spawnedBy Unit) *Projectile
func (*EnergyWeapon) Summary ¶ added in v0.0.1
func (w *EnergyWeapon) Summary() string
func (*EnergyWeapon) Tech ¶
func (w *EnergyWeapon) Tech() TechBase
func (*EnergyWeapon) Tonnage ¶
func (w *EnergyWeapon) Tonnage() float64
func (*EnergyWeapon) TriggerCooldown ¶
func (w *EnergyWeapon) TriggerCooldown()
func (*EnergyWeapon) Type ¶
func (w *EnergyWeapon) Type() WeaponType
func (*EnergyWeapon) Velocity ¶
func (w *EnergyWeapon) Velocity() float64
type Entity ¶
type Entity interface { Pos() *geom.Vector2 SetPos(*geom.Vector2) PosZ() float64 SetPosZ(float64) Anchor() raycaster.SpriteAnchor SetAnchor(raycaster.SpriteAnchor) Heading() float64 SetHeading(float64) Pitch() float64 SetPitch(float64) Velocity() float64 SetVelocity(float64) VelocityZ() float64 SetVelocityZ(float64) CollisionRadius() float64 SetCollisionRadius(float64) CollisionHeight() float64 SetCollisionHeight(float64) ApplyDamage(float64) ArmorPoints() float64 SetArmorPoints(float64) MaxArmorPoints() float64 StructurePoints() float64 SetStructurePoints(float64) MaxStructurePoints() float64 IsDestroyed() bool Clone() Entity Parent() Entity SetParent(Entity) }
type HeatSinkType ¶
type HeatSinkType int
const ( NONE HeatSinkType = iota // 0 SINGLE // 1 DOUBLE // 2 )
type Infantry ¶
type Infantry struct { *UnitModel Resource *ModelInfantryResource }
func NewInfantry ¶
func NewInfantry(r *ModelInfantryResource, collisionRadius, collisionHeight float64, cockpitOffset *geom.Vector2) *Infantry
func (*Infantry) HeatDissipation ¶
func (*Infantry) MaxArmorPoints ¶
func (*Infantry) MaxStructurePoints ¶
func (*Infantry) TriggerWeapon ¶
type Map ¶
type Map struct { NumRaycastLevels int `yaml:"numRaycastLevels"` Levels [][][]int `yaml:"levels"` GenerateLevels MapGenerateLevels `yaml:"generateLevels"` Lighting MapLighting `yaml:"lighting"` Textures map[int]MapTexture `yaml:"textures"` FloorBox MapTexture `yaml:"floorBox"` SkyBox MapTexture `yaml:"skyBox"` Flooring MapFlooring `yaml:"flooring"` Clutter []MapClutter `yaml:"clutter"` Sprites []MapSprite `yaml:"sprites"` SpriteFill []MapSpriteFill `yaml:"spriteFill"` SpriteStamps []MapSpriteStamp `yaml:"spriteStamps"` Seed int64 `yaml:"seed"` }
func (*Map) GetMapTexture ¶
func (m *Map) GetMapTexture(texIndex int) MapTexture
type MapClutter ¶
type MapFloorPathing ¶
type MapFlooring ¶
type MapFlooring struct { Default string `yaml:"default"` Pathing []MapFloorPathing `yaml:"pathing"` }
type MapGenerateLevels ¶
type MapGenerateLevels struct { MapSize [2]int `yaml:"mapSize"` BoundaryWall MapTexture `yaml:"boundaryWall"` Prefabs []MapGeneratePrefabs `yaml:"prefabs"` }
type MapGeneratePrefabs ¶
type MapLighting ¶
type MapSprite ¶
type MapSprite struct { Image string `yaml:"image"` Positions [][2]float64 `yaml:"positions"` ZPosition float64 `yaml:"zPosition"` CollisionPxRadius float64 `yaml:"collisionRadius"` CollisionPxHeight float64 `yaml:"collisionHeight"` HitPoints float64 `yaml:"hitPoints"` Scale float64 `default:"1.0" yaml:"scale,omitempty"` Anchor SpriteAnchor `yaml:"anchor"` Stamp string `yaml:"stamp"` }
type MapSpriteFill ¶
type MapSpriteStamp ¶
type MapTexture ¶
type MapTexture struct { Image string `yaml:"image"` SideX string `yaml:"sideX"` SideY string `yaml:"sideY"` }
func (MapTexture) GetImage ¶
func (m MapTexture) GetImage(side int) string
type Mech ¶
type Mech struct { *UnitModel Resource *ModelMechResource PowerOffTimer int PowerOnTimer int }
func NewMech ¶
func NewMech(r *ModelMechResource, collisionRadius, collisionHeight float64, cockpitOffset *geom.Vector2) *Mech
func (*Mech) MaxArmorPoints ¶
func (*Mech) MaxStructurePoints ¶
func (*Mech) SetPowered ¶
func (e *Mech) SetPowered(powered UnitPowerStatus)
type MissileWeapon ¶
type MissileWeapon struct { Resource *ModelMissileWeaponResource // contains filtered or unexported fields }
func (*MissileWeapon) AmmoBin ¶
func (w *MissileWeapon) AmmoBin() *AmmoBin
func (*MissileWeapon) AmmoPerTon ¶
func (w *MissileWeapon) AmmoPerTon() int
func (*MissileWeapon) Audio ¶
func (w *MissileWeapon) Audio() string
func (*MissileWeapon) Classification ¶
func (w *MissileWeapon) Classification() WeaponClassification
func (*MissileWeapon) Clone ¶
func (w *MissileWeapon) Clone() Weapon
func (*MissileWeapon) Cooldown ¶
func (w *MissileWeapon) Cooldown() float64
func (*MissileWeapon) Damage ¶
func (w *MissileWeapon) Damage() float64
func (*MissileWeapon) DecreaseCooldown ¶
func (w *MissileWeapon) DecreaseCooldown(decreaseBy float64)
func (*MissileWeapon) Distance ¶
func (w *MissileWeapon) Distance() float64
func (*MissileWeapon) File ¶
func (w *MissileWeapon) File() string
func (*MissileWeapon) Heat ¶
func (w *MissileWeapon) Heat() float64
func (*MissileWeapon) IsLockOn ¶
func (w *MissileWeapon) IsLockOn() bool
func (*MissileWeapon) IsLockOnLockRequired ¶
func (w *MissileWeapon) IsLockOnLockRequired() bool
func (*MissileWeapon) LockOnGroupRadius ¶
func (w *MissileWeapon) LockOnGroupRadius() float64
func (*MissileWeapon) LockOnTurnRate ¶
func (w *MissileWeapon) LockOnTurnRate() float64
func (*MissileWeapon) MaxCooldown ¶
func (w *MissileWeapon) MaxCooldown() float64
func (*MissileWeapon) Name ¶
func (w *MissileWeapon) Name() string
func (*MissileWeapon) Offset ¶
func (w *MissileWeapon) Offset() *geom.Vector2
func (*MissileWeapon) Parent ¶
func (w *MissileWeapon) Parent() Entity
func (*MissileWeapon) ProjectileCount ¶
func (w *MissileWeapon) ProjectileCount() int
func (*MissileWeapon) ProjectileDelay ¶
func (w *MissileWeapon) ProjectileDelay() float64
func (*MissileWeapon) ProjectileSpread ¶
func (w *MissileWeapon) ProjectileSpread() float64
func (*MissileWeapon) SetAmmoBin ¶
func (w *MissileWeapon) SetAmmoBin(ammoBin *AmmoBin)
func (*MissileWeapon) ShortName ¶
func (w *MissileWeapon) ShortName() string
func (*MissileWeapon) SpawnProjectile ¶
func (w *MissileWeapon) SpawnProjectile(angle, pitch float64, spawnedBy Unit) *Projectile
func (*MissileWeapon) SpawnProjectileToward ¶
func (w *MissileWeapon) SpawnProjectileToward(target *geom3d.Vector3, spawnedBy Unit) *Projectile
func (*MissileWeapon) Summary ¶ added in v0.0.1
func (w *MissileWeapon) Summary() string
func (*MissileWeapon) Tech ¶
func (w *MissileWeapon) Tech() TechBase
func (*MissileWeapon) Tonnage ¶
func (w *MissileWeapon) Tonnage() float64
func (*MissileWeapon) TriggerCooldown ¶
func (w *MissileWeapon) TriggerCooldown()
func (*MissileWeapon) Type ¶
func (w *MissileWeapon) Type() WeaponType
func (*MissileWeapon) Velocity ¶
func (w *MissileWeapon) Velocity() float64
type Mission ¶
type Mission struct { Title string `yaml:"title" validate:"required"` Briefing string `yaml:"briefing" validate:"required"` MapPath string `yaml:"map" validate:"required"` MusicPath string `yaml:"music"` DropZone *MissionDropZone `yaml:"dropZone" validate:"required"` Lighting *MapLighting `yaml:"lighting,omitempty"` FloorBox *MapTexture `yaml:"floorBox,omitempty"` SkyBox *MapTexture `yaml:"skyBox,omitempty"` Objectives *MissionObjectives `yaml:"objectives" validate:"required"` Mechs []MissionMech `yaml:"mechs"` Vehicles []MissionVehicle `yaml:"vehicles"` VTOLs []MissionVTOL `yaml:"vtols"` Infantry []MissionInfantry `yaml:"infantry"` Emplacements []MissionEmplacement `yaml:"emplacements"` // contains filtered or unexported fields }
func LoadMission ¶
type MissionDestroyObjectives ¶ added in v0.0.1
type MissionDropZone ¶
type MissionEmplacement ¶
type MissionInfantry ¶
type MissionMech ¶
type MissionNavDustoff ¶ added in v0.0.1
type MissionNavDustoff struct {
}type MissionNavObjectives ¶ added in v0.0.1
type MissionNavObjectives struct {}
type MissionNavVisit ¶ added in v0.0.1
type MissionNavVisit struct {
}type MissionObjectives ¶ added in v0.0.1
type MissionObjectives struct { Destroy []*MissionDestroyObjectives `yaml:"destroy"` Protect []*MissionProtectObjectives `yaml:"protect"` }
func (*MissionObjectives) Text ¶ added in v0.0.1
func (o *MissionObjectives) Text() string
type MissionProtectObjectives ¶ added in v0.0.1
type MissionProtectObjectives struct {
Unit string `yaml:"unit,omitempty"`
}
type MissionVTOL ¶
type MissionVehicle ¶
type ModelAmmoType ¶
type ModelAmmoType struct {
AmmoType
}
func (*ModelAmmoType) UnmarshalText ¶
func (t *ModelAmmoType) UnmarshalText(b []byte) error
Unmarshals into AmmoType
type ModelBallisticWeaponResource ¶
type ModelBallisticWeaponResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` ShortName string `yaml:"short" validate:"required"` Tech ModelTech `yaml:"tech" validate:"required"` Tonnage float64 `yaml:"tonnage" validate:"gt=0,lte=100"` Damage float64 `yaml:"damage" validate:"gt=0"` Heat float64 `yaml:"heat" validate:"gte=0"` Distance float64 `yaml:"distance" validate:"gt=0"` ExtremeDistance float64 `yaml:"extremeDistance" validate:"gte=0"` Velocity float64 `yaml:"velocity" validate:"gt=0"` Cooldown float64 `yaml:"cooldown" validate:"gt=0"` AmmoPerTon int `yaml:"ammoPerTon" validate:"gte=0"` ProjectileCount int `yaml:"projectileCount" validate:"gt=0"` ProjectileDelay float64 `yaml:"projectileDelay" validate:"gte=0"` ProjectileSpread float64 `yaml:"projectileSpread" validate:"gte=0"` Projectile *ModelProjectileResource `yaml:"projectile"` Audio string `yaml:"audio" validate:"required"` }
type ModelEffectResource ¶
type ModelEffectResource struct { Image string `yaml:"image" validate:"required"` ImageSheet *ModelResourceImageSheet `yaml:"imageSheet"` Scale float64 `yaml:"scale" validate:"gt=0"` Audio string `yaml:"audio" validate:"required"` RandAudio []string `yaml:"randAudio"` }
type ModelEmplacementResource ¶
type ModelEmplacementResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` Variant string `yaml:"variant" validate:"required"` Image string `yaml:"image" validate:"required"` ImageSheet *ModelResourceImageSheet `yaml:"imageSheet"` Tech ModelTech `yaml:"tech" validate:"required"` Height float64 `yaml:"height" validate:"gt=0"` HeightPxGap int `yaml:"heightPixelGap" validate:"gte=0"` Armor float64 `yaml:"armor" validate:"gte=0"` Structure float64 `yaml:"structure" validate:"gt=0"` CollisionPxRadius float64 `yaml:"collisionRadius" validate:"gt=0"` CollisionPxHeight float64 `yaml:"collisionHeight" validate:"gt=0"` CockpitPxOffset [2]float64 `yaml:"cockpitOffset" validate:"required"` Armament []*ModelResourceArmament `yaml:"armament"` Ammo []*ModelResourceAmmo `yaml:"ammo"` }
type ModelEnergyWeaponResource ¶
type ModelEnergyWeaponResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` ShortName string `yaml:"short" validate:"required"` Tech ModelTech `yaml:"tech" validate:"required"` Tonnage float64 `yaml:"tonnage" validate:"gt=0,lte=100"` Damage float64 `yaml:"damage" validate:"gt=0"` Heat float64 `yaml:"heat" validate:"gte=0"` Distance float64 `yaml:"distance" validate:"gt=0"` ExtremeDistance float64 `yaml:"extremeDistance" validate:"gte=0"` Velocity float64 `yaml:"velocity" validate:"gt=0"` Cooldown float64 `yaml:"cooldown" validate:"gt=0"` ProjectileCount int `yaml:"projectileCount" validate:"gt=0"` ProjectileDelay float64 `yaml:"projectileDelay" validate:"gte=0"` Projectile *ModelProjectileResource `yaml:"projectile"` Audio string `yaml:"audio" validate:"required"` }
type ModelHeatSinkType ¶
type ModelHeatSinkType struct {
HeatSinkType
}
func (*ModelHeatSinkType) UnmarshalText ¶
func (t *ModelHeatSinkType) UnmarshalText(b []byte) error
Unmarshals into HeatSinkType
type ModelInfantryResource ¶
type ModelInfantryResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` Variant string `yaml:"variant" validate:"required"` Image string `yaml:"image" validate:"required"` ImageSheet *ModelResourceImageSheet `yaml:"imageSheet"` Tech ModelTech `yaml:"tech" validate:"required"` Height float64 `yaml:"height" validate:"gt=0"` HeightPxGap int `yaml:"heightPixelGap" validate:"gte=0"` Speed float64 `yaml:"speed" validate:"gt=0,lte=250"` JumpJets int `yaml:"jumpJets" validate:"gte=0,lte=20"` Armor float64 `yaml:"armor" validate:"gte=0"` Structure float64 `yaml:"structure" validate:"gt=0"` CollisionPxRadius float64 `yaml:"collisionRadius" validate:"gt=0"` CollisionPxHeight float64 `yaml:"collisionHeight" validate:"gt=0"` CockpitPxOffset [2]float64 `yaml:"cockpitOffset" validate:"required"` Armament []*ModelResourceArmament `yaml:"armament"` Ammo []*ModelResourceAmmo `yaml:"ammo"` }
type ModelLocation ¶
type ModelLocation struct {
Location
}
func (*ModelLocation) UnmarshalText ¶
func (t *ModelLocation) UnmarshalText(b []byte) error
Unmarshals into Location
type ModelMechResource ¶
type ModelMechResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` Variant string `yaml:"variant" validate:"required"` Image string `yaml:"image" validate:"required"` Tech ModelTech `yaml:"tech" validate:"required"` Tonnage float64 `yaml:"tonnage" validate:"gt=0,lte=200"` Height float64 `yaml:"height" validate:"gt=0"` HeightPxGap int `yaml:"heightPixelGap" validate:"gte=0"` Speed float64 `yaml:"speed" validate:"gt=0,lte=250"` JumpJets int `yaml:"jumpJets" validate:"gte=0,lte=20"` Armor float64 `yaml:"armor" validate:"gte=0"` Structure float64 `yaml:"structure" validate:"gt=0"` CollisionPxRadius float64 `yaml:"collisionRadius" validate:"gt=0"` CollisionPxHeight float64 `yaml:"collisionHeight" validate:"gt=0"` CockpitPxOffset [2]float64 `yaml:"cockpitOffset" validate:"required"` HeatSinks *ModelResourceHeatSinks `yaml:"heatSinks"` Armament []*ModelResourceArmament `yaml:"armament"` Ammo []*ModelResourceAmmo `yaml:"ammo"` }
type ModelMissileWeaponResource ¶
type ModelMissileWeaponResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` ShortName string `yaml:"short" validate:"required"` Tech ModelTech `yaml:"tech" validate:"required"` Tonnage float64 `yaml:"tonnage" validate:"gt=0,lte=100"` Damage float64 `yaml:"damage" validate:"gt=0"` Heat float64 `yaml:"heat" validate:"gte=0"` Distance float64 `yaml:"distance" validate:"gt=0"` ExtremeDistance float64 `yaml:"extremeDistance" validate:"gte=0"` Velocity float64 `yaml:"velocity" validate:"gt=0"` Cooldown float64 `yaml:"cooldown" validate:"gt=0"` AmmoPerTon int `yaml:"ammoPerTon" validate:"gte=0"` ProjectileCount int `yaml:"projectileCount" validate:"gt=0"` ProjectileDelay float64 `yaml:"projectileDelay" validate:"gte=0"` Projectile *ModelProjectileResource `yaml:"projectile"` LockOn *ModelMissileWeaponLockOn `yaml:"lockOn,omitempty"` Audio string `yaml:"audio" validate:"required"` }
type ModelProjectileResource ¶
type ModelProjectileResource struct { Image string `yaml:"image" validate:"required"` ImageSheet *ModelResourceImageSheet `yaml:"imageSheet"` CollisionPxRadius float64 `yaml:"collisionRadius" validate:"gt=0"` CollisionPxHeight float64 `yaml:"collisionHeight" validate:"gt=0"` Scale float64 `yaml:"scale" validate:"gt=0"` ImpactEffect *ModelEffectResource `yaml:"impactEffect"` }
type ModelResourceAmmo ¶
type ModelResourceAmmo struct { Type ModelAmmoType `yaml:"type" validate:"required"` ForWeapon string `yaml:"forWeapon"` Tons float64 `yaml:"tons" validate:"gt=0"` }
type ModelResourceArmament ¶
type ModelResourceArmament struct { Weapon string `yaml:"weapon" validate:"required"` Type ModelWeaponType `yaml:"type" validate:"required"` Location ModelLocation `yaml:"location" validate:"required"` Offset [2]float64 `yaml:"offset" validate:"required"` }
type ModelResourceHeatSinks ¶
type ModelResourceHeatSinks struct { Quantity int `yaml:"quantity" validate:"gte=0"` Type ModelHeatSinkType `yaml:"type" validate:"required"` }
type ModelResourceImageSheet ¶
type ModelResources ¶
type ModelResources struct { Mechs map[string]*ModelMechResource Vehicles map[string]*ModelVehicleResource VTOLs map[string]*ModelVTOLResource Infantry map[string]*ModelInfantryResource Emplacements map[string]*ModelEmplacementResource EnergyWeapons map[string]*ModelEnergyWeaponResource MissileWeapons map[string]*ModelMissileWeaponResource BallisticWeapons map[string]*ModelBallisticWeaponResource }
func LoadModelResources ¶
func LoadModelResources() (*ModelResources, error)
func (*ModelResources) GetBallisticWeaponResource ¶
func (r *ModelResources) GetBallisticWeaponResource(weapon string) *ModelBallisticWeaponResource
func (*ModelResources) GetEmplacementResource ¶
func (r *ModelResources) GetEmplacementResource(unit string) *ModelEmplacementResource
func (*ModelResources) GetEmplacementResourceList ¶
func (r *ModelResources) GetEmplacementResourceList() []*ModelEmplacementResource
GetEmplacementResourceList gets emplacement resources as sorted list
func (*ModelResources) GetEnergyWeaponResource ¶
func (r *ModelResources) GetEnergyWeaponResource(weapon string) *ModelEnergyWeaponResource
func (*ModelResources) GetInfantryResource ¶
func (r *ModelResources) GetInfantryResource(unit string) *ModelInfantryResource
func (*ModelResources) GetInfantryResourceList ¶
func (r *ModelResources) GetInfantryResourceList() []*ModelInfantryResource
GetInfantryResourceList gets infantry resources as sorted list
func (*ModelResources) GetMechResource ¶
func (r *ModelResources) GetMechResource(unit string) *ModelMechResource
func (*ModelResources) GetMechResourceList ¶
func (r *ModelResources) GetMechResourceList() []*ModelMechResource
GetMechResourceList gets mech resources as sorted list
func (*ModelResources) GetMissileWeaponResource ¶
func (r *ModelResources) GetMissileWeaponResource(weapon string) *ModelMissileWeaponResource
func (*ModelResources) GetVTOLResource ¶
func (r *ModelResources) GetVTOLResource(unit string) *ModelVTOLResource
func (*ModelResources) GetVTOLResourceList ¶
func (r *ModelResources) GetVTOLResourceList() []*ModelVTOLResource
GetVTOLResourceList gets vtol resources as sorted list
func (*ModelResources) GetVehicleResource ¶
func (r *ModelResources) GetVehicleResource(unit string) *ModelVehicleResource
func (*ModelResources) GetVehicleResourceList ¶
func (r *ModelResources) GetVehicleResourceList() []*ModelVehicleResource
GetVehicleResourceList gets vehicle resources as sorted list
type ModelTech ¶
type ModelTech struct {
TechBase
}
func (*ModelTech) UnmarshalText ¶
Unmarshals into TechBase
type ModelVTOLResource ¶
type ModelVTOLResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` Variant string `yaml:"variant" validate:"required"` Image string `yaml:"image" validate:"required"` ImageSheet *ModelResourceImageSheet `yaml:"imageSheet"` Tech ModelTech `yaml:"tech" validate:"required"` Tonnage float64 `yaml:"tonnage" validate:"gt=0,lte=100"` Height float64 `yaml:"height" validate:"gt=0"` HeightPxGap int `yaml:"heightPixelGap" validate:"gte=0"` Speed float64 `yaml:"speed" validate:"gt=0,lte=250"` Armor float64 `yaml:"armor" validate:"gte=0"` Structure float64 `yaml:"structure" validate:"gt=0"` CollisionPxRadius float64 `yaml:"collisionRadius" validate:"gt=0"` CollisionPxHeight float64 `yaml:"collisionHeight" validate:"gt=0"` CockpitPxOffset [2]float64 `yaml:"cockpitOffset" validate:"required"` HeatSinks *ModelResourceHeatSinks `yaml:"heatSinks"` Armament []*ModelResourceArmament `yaml:"armament"` Ammo []*ModelResourceAmmo `yaml:"ammo"` }
type ModelVehicleResource ¶
type ModelVehicleResource struct { File string `yaml:"-"` Name string `yaml:"name" validate:"required"` Variant string `yaml:"variant" validate:"required"` Image string `yaml:"image" validate:"required"` ImageSheet *ModelResourceImageSheet `yaml:"imageSheet"` Tech ModelTech `yaml:"tech" validate:"required"` Tonnage float64 `yaml:"tonnage" validate:"gt=0,lte=200"` Height float64 `yaml:"height" validate:"gt=0"` HeightPxGap int `yaml:"heightPixelGap" validate:"gte=0"` Speed float64 `yaml:"speed" validate:"gt=0,lte=250"` Armor float64 `yaml:"armor" validate:"gte=0"` Structure float64 `yaml:"structure" validate:"gt=0"` CollisionPxRadius float64 `yaml:"collisionRadius" validate:"gt=0"` CollisionPxHeight float64 `yaml:"collisionHeight" validate:"gt=0"` CockpitPxOffset [2]float64 `yaml:"cockpitOffset" validate:"required"` HeatSinks *ModelResourceHeatSinks `yaml:"heatSinks"` Armament []*ModelResourceArmament `yaml:"armament"` Ammo []*ModelResourceAmmo `yaml:"ammo"` }
type ModelWeaponType ¶
type ModelWeaponType struct {
WeaponType
}
func (*ModelWeaponType) UnmarshalText ¶
func (t *ModelWeaponType) UnmarshalText(b []byte) error
Unmarshals into WeaponType
type NavPoint ¶
type NavPoint struct { // contains filtered or unexported fields }
func (*NavPoint) Objective ¶ added in v0.0.1
func (n *NavPoint) Objective() NavObjective
func (*NavPoint) SetObjective ¶ added in v0.0.1
func (n *NavPoint) SetObjective(objective NavObjective)
func (*NavPoint) SetVisited ¶
type Projectile ¶
type Projectile struct { Resource *ModelProjectileResource // contains filtered or unexported fields }
func NewProjectile ¶
func NewProjectile( r *ModelProjectileResource, damage, velocity, optimalLifespan, extremeLifespan, collisionRadius, collisionHeight float64, ) *Projectile
func (*Projectile) Acceleration ¶ added in v0.0.1
func (e *Projectile) Acceleration() float64
func (*Projectile) Anchor ¶
func (e *Projectile) Anchor() raycaster.SpriteAnchor
func (*Projectile) ApplyDamage ¶
func (e *Projectile) ApplyDamage(damage float64)
func (*Projectile) ArmorPoints ¶
func (e *Projectile) ArmorPoints() float64
func (*Projectile) Clone ¶
func (e *Projectile) Clone() Entity
func (*Projectile) CockpitOffset ¶
func (e *Projectile) CockpitOffset() *geom.Vector2
func (*Projectile) CollisionHeight ¶
func (e *Projectile) CollisionHeight() float64
func (*Projectile) CollisionRadius ¶
func (e *Projectile) CollisionRadius() float64
func (*Projectile) Damage ¶
func (e *Projectile) Damage() float64
func (*Projectile) DecreaseLifespan ¶
func (e *Projectile) DecreaseLifespan(decreaseBy float64) float64
func (*Projectile) Destroy ¶
func (e *Projectile) Destroy()
func (*Projectile) Heading ¶
func (e *Projectile) Heading() float64
func (*Projectile) InExtremeRange ¶
func (e *Projectile) InExtremeRange() bool
func (*Projectile) IsDestroyed ¶
func (e *Projectile) IsDestroyed() bool
func (*Projectile) Lifespan ¶
func (e *Projectile) Lifespan() float64
func (*Projectile) LockOnOffset ¶
func (e *Projectile) LockOnOffset() *geom3d.Vector3
func (*Projectile) MaxArmorPoints ¶
func (e *Projectile) MaxArmorPoints() float64
func (*Projectile) MaxStructurePoints ¶
func (e *Projectile) MaxStructurePoints() float64
func (*Projectile) MaxVelocity ¶ added in v0.0.1
func (e *Projectile) MaxVelocity() float64
func (*Projectile) Parent ¶
func (e *Projectile) Parent() Entity
func (*Projectile) Pitch ¶
func (e *Projectile) Pitch() float64
func (*Projectile) Pos ¶
func (e *Projectile) Pos() *geom.Vector2
func (*Projectile) PosZ ¶
func (e *Projectile) PosZ() float64
func (*Projectile) SetAcceleration ¶ added in v0.0.1
func (e *Projectile) SetAcceleration(acceleration float64)
func (*Projectile) SetAnchor ¶
func (e *Projectile) SetAnchor(anchor raycaster.SpriteAnchor)
func (*Projectile) SetArmorPoints ¶
func (e *Projectile) SetArmorPoints(armor float64)
func (*Projectile) SetCollisionHeight ¶
func (e *Projectile) SetCollisionHeight(collisionHeight float64)
func (*Projectile) SetCollisionRadius ¶
func (e *Projectile) SetCollisionRadius(collisionRadius float64)
func (*Projectile) SetHeading ¶
func (e *Projectile) SetHeading(angle float64)
func (*Projectile) SetMaxVelocity ¶ added in v0.0.1
func (e *Projectile) SetMaxVelocity(maxVelocity float64)
func (*Projectile) SetParent ¶
func (e *Projectile) SetParent(parent Entity)
func (*Projectile) SetPitch ¶
func (e *Projectile) SetPitch(pitch float64)
func (*Projectile) SetPos ¶
func (e *Projectile) SetPos(pos *geom.Vector2)
func (*Projectile) SetPosZ ¶
func (e *Projectile) SetPosZ(posZ float64)
func (*Projectile) SetStructurePoints ¶
func (e *Projectile) SetStructurePoints(structure float64)
func (*Projectile) SetVelocity ¶
func (e *Projectile) SetVelocity(velocity float64)
func (*Projectile) SetVelocityZ ¶
func (e *Projectile) SetVelocityZ(velocityZ float64)
func (*Projectile) SetWeapon ¶
func (e *Projectile) SetWeapon(weapon Weapon)
func (*Projectile) StructurePoints ¶
func (e *Projectile) StructurePoints() float64
func (*Projectile) Velocity ¶
func (e *Projectile) Velocity() float64
func (*Projectile) VelocityZ ¶
func (e *Projectile) VelocityZ() float64
func (*Projectile) Weapon ¶
func (e *Projectile) Weapon() Weapon
type RegExp ¶
func (*RegExp) UnmarshalText ¶
Unmarshals into compiled regex
type SpriteAnchor ¶
type SpriteAnchor struct {
raycaster.SpriteAnchor
}
func (*SpriteAnchor) UnmarshalText ¶
func (r *SpriteAnchor) UnmarshalText(b []byte) error
Unmarshals into raycaster.SpriteAnchor
type Unit ¶
type Unit interface { Entity ID() string SetID(string) Name() string Variant() string Tonnage() float64 UnitType() UnitType Heat() float64 MaxHeat() float64 HeatDissipation() float64 OverHeated() bool Powered() UnitPowerStatus SetPowered(UnitPowerStatus) TriggerWeapon(Weapon) bool Target() Entity SetTarget(Entity) TargetLock() float64 SetTargetLock(float64) TurnRate() float64 SetTargetHeading(float64) SetTargetPitch(float64) MaxVelocity() float64 TargetVelocity() float64 SetTargetVelocity(float64) TargetVelocityZ() float64 SetTargetVelocityZ(float64) Update() bool HasTurret() bool SetHasTurret(bool) TurretAngle() float64 SetTurretAngle(float64) TurretRate() float64 SetTargetTurretAngle(float64) CockpitOffset() *geom.Vector2 Ammunition() *Ammo Armament() []Weapon AddArmament(Weapon) JumpJets() int JumpJetsActive() bool SetJumpJetsActive(bool) JumpJetsDirectional() bool SetJumpJetsDirectional(bool) JumpJetHeading() float64 SetJumpJetHeading(float64) JumpJetVelocity() float64 JumpJetDuration() float64 MaxJumpJetDuration() float64 Objective() UnitObjective SetObjective(UnitObjective) SetAsPlayer(bool) IsPlayer() bool CloneUnit() Unit }
func EntityUnit ¶
type UnitModel ¶
type UnitModel struct {
// contains filtered or unexported fields
}
func (*UnitModel) AddArmament ¶
func (*UnitModel) Ammunition ¶
func (*UnitModel) ApplyDamage ¶
func (*UnitModel) ArmorPoints ¶
func (*UnitModel) CockpitOffset ¶
func (*UnitModel) CollisionHeight ¶
func (*UnitModel) CollisionRadius ¶
func (*UnitModel) DistanceToEntity ¶
func (*UnitModel) HeatDissipation ¶
func (*UnitModel) IsDestroyed ¶
func (*UnitModel) JumpJetDuration ¶
func (*UnitModel) JumpJetHeading ¶
func (*UnitModel) JumpJetVelocity ¶
func (*UnitModel) JumpJetsActive ¶
func (*UnitModel) JumpJetsDirectional ¶ added in v0.0.2
func (*UnitModel) MaxJumpJetDuration ¶
func (*UnitModel) MaxVelocity ¶
func (*UnitModel) Objective ¶ added in v0.0.1
func (e *UnitModel) Objective() UnitObjective
func (*UnitModel) OverHeated ¶
func (*UnitModel) Powered ¶
func (e *UnitModel) Powered() UnitPowerStatus
func (*UnitModel) SetArmorPoints ¶
func (*UnitModel) SetAsPlayer ¶
func (*UnitModel) SetCollisionHeight ¶
func (*UnitModel) SetCollisionRadius ¶
func (*UnitModel) SetHasTurret ¶
func (*UnitModel) SetHeading ¶
func (*UnitModel) SetJumpJetHeading ¶ added in v0.0.2
func (*UnitModel) SetJumpJetsActive ¶
func (*UnitModel) SetJumpJetsDirectional ¶ added in v0.0.2
func (*UnitModel) SetObjective ¶ added in v0.0.1
func (e *UnitModel) SetObjective(objective UnitObjective)
func (*UnitModel) SetPowered ¶
func (e *UnitModel) SetPowered(powered UnitPowerStatus)
func (*UnitModel) SetStructurePoints ¶
func (*UnitModel) SetTargetHeading ¶ added in v0.0.1
func (*UnitModel) SetTargetLock ¶
func (*UnitModel) SetTargetPitch ¶ added in v0.0.1
func (*UnitModel) SetTargetTurretAngle ¶ added in v0.0.1
func (*UnitModel) SetTargetVelocity ¶
func (*UnitModel) SetTargetVelocityZ ¶
func (*UnitModel) SetTurretAngle ¶
func (*UnitModel) SetVelocity ¶
func (*UnitModel) SetVelocityZ ¶
func (*UnitModel) StructurePoints ¶
func (*UnitModel) TargetLock ¶
func (*UnitModel) TargetVelocity ¶
func (*UnitModel) TargetVelocityZ ¶
func (*UnitModel) TriggerWeapon ¶
func (*UnitModel) TurretAngle ¶
func (*UnitModel) TurretRate ¶ added in v0.0.1
type UnitObjective ¶ added in v0.0.1
type UnitObjective int
const ( NonUnitObjective UnitObjective = iota DestroyUnitObjective ProtectUnitObjective )
type UnitPowerStatus ¶
type UnitPowerStatus int
const ( POWER_ON UnitPowerStatus = 1 POWER_OFF_MANUAL UnitPowerStatus = 0 POWER_OFF_HEAT UnitPowerStatus = -1 )
type VTOL ¶
type VTOL struct { *UnitModel Resource *ModelVTOLResource }
func NewVTOL ¶
func NewVTOL(r *ModelVTOLResource, collisionRadius, collisionHeight float64, cockpitOffset *geom.Vector2) *VTOL
func (*VTOL) MaxArmorPoints ¶
func (*VTOL) MaxStructurePoints ¶
func (*VTOL) SetTargetVelocityZ ¶
type Vehicle ¶
type Vehicle struct { *UnitModel Resource *ModelVehicleResource }
func NewVehicle ¶
func NewVehicle(r *ModelVehicleResource, collisionRadius, collisionHeight float64, cockpitOffset *geom.Vector2) *Vehicle
func (*Vehicle) MaxArmorPoints ¶
func (*Vehicle) MaxStructurePoints ¶
type Weapon ¶
type Weapon interface { File() string Name() string ShortName() string Summary() string Tech() TechBase Type() WeaponType Classification() WeaponClassification Tonnage() float64 Damage() float64 Heat() float64 Distance() float64 Velocity() float64 Cooldown() float64 MaxCooldown() float64 DecreaseCooldown(float64) TriggerCooldown() Offset() *geom.Vector2 AmmoPerTon() int AmmoBin() *AmmoBin SetAmmoBin(ammoBin *AmmoBin) ProjectileCount() int ProjectileDelay() float64 ProjectileSpread() float64 SpawnProjectile(angle, pitch float64, spawnedBy Unit) *Projectile SpawnProjectileToward(convergencePoint *geom3d.Vector3, spawnedBy Unit) *Projectile Audio() string Clone() Weapon Parent() Entity }
type WeaponClassification ¶
type WeaponClassification int
const ( WEAPON_CLASS_UNDEFINED WeaponClassification = iota ENERGY_LASER ENERGY_PPC ENERGY_FLAMER BALLISTIC_MACHINEGUN BALLISTIC_AUTOCANNON BALLISTIC_LBX_AC BALLISTIC_GAUSS MISSILE_LRM MISSILE_SRM )