Repository navigation
[Vanilla] Game
The Game object contains various functions returning or altering data about the current run.
Game:ModifyPowerGrid(amount)
Adds amount to the current grid level. Negative values decrease remaining grid power.
Game:GetPower() Returns the current grid power.
Game:GetTeamTurn() Returns either TEAM_PLAYER or TEAM_ENEMY, depending on whose turn it is.
Game:GetTurnCount() Returns the number of turns that have elapsed in the current mission. Often used in conjunction with GetCurrentMission().TurnLimit.
Game:IsMechClass(weaponId) Returns whether the weapon with the given ID is equippable by mechs (ie. not TechnoVek or Enemy).
Game:TriggerSound(soundPath) Plays a sound.
Game:GetEventCount(eventId) Returns the number of times a given event happened in the current mission. Valid event IDs are:
- EVENT_MOUNTAIN_DESTROYED
- EVENT_ENEMY_KILLED
- EVENT_SPAWNBLOCKED
- EVENT_REPAIR_PICKUP
- EVENT_REPAIR_UNDO
- EVENT_ACID_DESTROYED
Game:BlockNextTurn() Used in the tutorial mission. Seems to do nothing.
Game:GetCorp() Returns the table for the corporation corresponding to the current island. You can use Game:GetCorp().name to get its name, for instance.
Game:GetPawn(id) Returns the mech with the given ID. Works outside of missions.
Game:GetSector() Returns the number of the current island. Starts at 1. Going into the final island with 2 islands completed would make GetSector() return 3.
Game:AddWeapon(weapon) Adds the weapon with the given ID to the player's inventory.
Game:GetSquad() Returns the name of the squad the player is using.