mod.game
A few reads and actions on the running match.
mod.game.cash()
Section titled “mod.game.cash()”client
Your cash now.
Returns number?
mod.every(5, function() local c = mod.game.cash() if c then mod.log("cash", c) endend)mod.game.best_tier()
Section titled “mod.game.best_tier()”client
Your best missile tier this run.
Returns number?
mod.on("tier_up", function() mod.log("best tier", mod.game.best_tier())end)mod.game.charges(weaponId)
Section titled “mod.game.charges(weaponId)”client
How many charges of a superweapon you hold. "ion" works.
| Parameter | Type | |
|---|---|---|
weaponId |
string |
A superweapon id. |
Returns number?
mod.on("weapon_fired", function() mod.log("ion charges", mod.game.charges("ion"))end)mod.game.give_charge(weapon, n)
Section titled “mod.game.give_charge(weapon, n)”server
Gives every player n charges of a superweapon. Negative takes them away.
| Parameter | Type | |
|---|---|---|
weapon |
string |
A superweapon id. |
n |
number |
Whole number, -99 to 99. |
Raises
unknown superweapon 'n must be a whole number
mod.on("silo_broken", function() mod.game.give_charge("sunlance", 1)end)mod.game.toast(text, kind?)
Section titled “mod.game.toast(text, kind?)”server + client
A banner message. From the server it goes to everyone; from the client, to you.
| Parameter | Type | |
|---|---|---|
text |
string |
60 characters at most. |
kind |
string? |
Passed to clients; the banner looks the same. |
Raises
toast text must be 60 characters or fewer
mod.on("island_wiped", function() mod.game.toast("ISLAND WIPED")end)