const SUP_RACE_ZERG = 0;
const SUP_RACE_TERRAN = 1;
const SUP_RACE_PROTOSS = 2;
const SUP_TYPE_AVAILABLE = 0;
const SUP_TYPE_USED = 1;
const SUP_TYPE_MAX = 2;
function SetPlayerSupply(player: TrgPlayer, race, type, amount) {
dwwrite_epd(EPD(0x582144) + (race) * 36 + (type) * 12 + (player), amount);
}
function GetPlayerSupply(player: TrgPlayer, race, type) {
return dwread_epd(EPD(0x582144) + (race) * 36 + (type) * 12 + (player));
}
function SetUnitSupplyProvided(ut : TrgUnit, amount) {
bwrite(0x6646C8 + ut * 1, amount);
}
function SetUnitSupplyRequired(ut : TrgUnit, amount) {
bwrite(0x663CE8 + ut * 1, amount);
}
function SetUnitMineralCost(ut : TrgUnit, amount) {
wwrite(0x663888 + ut * 2, amount);
}
function SetUnitGasCost(ut : TrgUnit, amount) {
wwrite(0x65FD00 + ut * 2, amount);
}
function SetUnitBuildTime(ut : TrgUnit, frames) {
wwrite(0x660428 + ut * 2, frames);
}
function SetWeaponCooldown(wt : Weapon, frames) {
bwrite(0x656FB8 + wt, frames);
}
function onPluginStart() {
SetPlayerSupply(P1, SUP_RACE_ZERG, SUP_TYPE_MAX, 1000);
SetPlayerSupply(P1, SUP_RACE_TERRAN, SUP_TYPE_MAX, 1000);
SetPlayerSupply(P1, SUP_RACE_PROTOSS, SUP_TYPE_MAX, 1000);
SetUnitSupplyRequired($U("Terran SCV"), 0);
SetUnitMineralCost($U("Terran SCV"), 0);
SetUnitBuildTime($U("Terran SCV"), 10);
SetUnitSupplyProvided($U("Terran Command Center"), 200);
SetUnitSupplyProvided($U("Terran SCV"), 200);
SetUnitSupplyProvided($U("Terran Ghost"), 200);
SetWeaponCooldown("C-10 Concussion Rifle", 0);
setcurpl(P1);
RawTrigger(
actions = list(
CreateUnit(1, "Terran Command Center", "Location 1", P1),
CreateUnit(2, "Terran SCV", "Location 2", P1),
CreateUnit(2, "Terran Ghost", "Location 2", P1),
SetResources(P1, Add, 100000, OreAndGas),
),
preserved = false,
);
}
function beforeTriggerExec() {
}
function afterTriggerExec() {
}