Raw model (for completeness)
{
"meta": {
"id": "0820889d-1367-47e6-911c-57856a315be8",
"sha1": "f83caa0f6da6445dc9c097b52e59521390ff2341",
"sha256": "967c68c7daf1997ab6f49fc2c269bc8786e66d96f1e27a31ee5be327cd85bd03",
"filenames": [
"aow_2.1_code_16.09.2014_fix.pk3"
],
"additional": {
"engines": [
"ZDOOM"
],
"iwad": [],
"filename": null,
"added": "2014-09-19 20:04:49",
"locked": false,
"canDownload": true,
"adult": false,
"hidden": false,
"name": null,
"description": null,
"maps": null,
"graphicOverrides": null,
"screenshots": null,
"palettes": null,
"categories": null
},
"flags": {
"locked": false,
"canDownload": true,
"adult": false,
"hidden": false
},
"added": "2014-09-19 20:04:49",
"file": {
"type": "PK3",
"size": 146421,
"url": "https://wadarchive2.nyc3.digitaloceanspaces.com/f83caa0f6da6445dc9c097b52e59521390ff2341/f83caa0f6da6445dc9c097b52e59521390ff2341.pk3.gz",
"corrupt": false
},
"content": {
"counts": {
"endoom": 0,
"graphics": 0,
"lumps": 41,
"maps": 0,
"palettes": 0
},
"engines_guess": [
"ZDOOM"
]
},
"text_files": [
{
"source": "pk3",
"name": "actors/weapons/AmmoInfantry.txt",
"contents": "// All ammunition definitions, defined as the ammo expended to operate a weapon,\n// and whose values are safe to change without breaking operation of the weapon.\n// This document does not include definitions for \"decorate token\" ammo; those\n// will be found in the document the weapon relies on.\n// [Dusk] Are all of these really necessary?\n\n////Bullet Weapons////\n\n//9x19mm Bullets; 9mm Beretta/SMG.\nactor NewClipAmmo : Ammo {\n\tInventory.Amount 50\n\tInventory.MaxAmount 400\n\tAmmo.BackpackAmount 50\n\tAmmo.BackpackMaxAmount 400\n}\n\n//5.56x45mm Bullets; Machinegun/Gatling Gun\nactor MachineGunAmmo : Ammo {\n\tinventory.amount 50\n\tinventory.maxamount 400\n\tammo.backpackamount 50\n\tammo.backpackmaxamount 400\n}\n\n//7.62x51mm Bullets/40mm HE Grenades; Rifle\nactor RifleAmmo : Ammo {\n\tinventory.amount 10\n\tinventory.maxamount 50\n\tammo.backpackamount 10\n\tammo.backpackmaxamount 50\n}\n\nactor RifleGrenadeAmmo : Ammo {\n\tinventory.amount 2\n\tinventory.maxamount 8\n\tammo.backpackamount 2\n\tammo.backpackmaxamount 8\n}\n\n//.416 Remington Magnum; Sniper Rifle\nactor SniperAmmo : Ammo {\n\tinventory.amount 8\n\tinventory.maxamount 40\n\tammo.backpackamount 8\n\tammo.backpackmaxamount 40\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\n//Magical revolver invisible death ray bullets from space; Blood Revolver\nactor BloodRevolverAmmo : Ammo {\n\t+IGNORESKILL\n\tInventory.Amount 1\n\tInventory.MaxAmount 3\n\tAmmo.BackpackAmount 0\n\tAmmo.BackpackMaxAmount 3\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\n//12-gauge Shotshells; Shotgun/Doubleshotgun\nactor ShotgunAmmo : Ammo {\n\tinventory.amount 8\n\tinventory.maxamount 50\n\tammo.backpackamount 8\n\tammo.backpackmaxamount 50\n}\n\n////Explosive Weapons////\n\n//M67 Fragmentation Grenades;\n// [Dusk] These are dropped by the frag grenade `weapon`.\nactor FragGrenadeAmmo : Ammo {\n\tInventory.PickupMessage \"Picked up a frag grenade.\"\n\tInventory.Amount 1\n\tInventory.MaxAmount 1\n\tAmmo.BackpackAmount 1\n\tAmmo.BackpackMaxAmount 1\n\tScale 0.25\n\tStates {\n\tSpawn:\n\t\tFRGP A -1\n\t\tstop\n\t}\n}\n\n//40mm HEDP Grenades; Grenade Launcher\nactor GrenadeAmmo : Ammo {\n\t Inventory.Amount 8\n\t Inventory.MaxAmount 40\n\t Ammo.BackpackAmount 8\n\t Ammo.BackpackMaxAmount 40\n\t states {\n\t Spawn:\n\t\tTNT1 A 0\n\t\tstop\n\t }\n}\n\n//AM Guided Missiles; Missile Launcher\nactor MissileAmmo : Ammo {\n\t+IGNORESKILL\n\tinventory.amount 2\n\tinventory.maxamount 15\n\tammo.backpackamount 2\n\tammo.backpackmaxamount 15\n}\n\n//50mm/80mm Howitzer Shells; Artillery Gun\nactor ArtilleryShellAmmo : Ammo {\n\tInventory.Amount 4\n\tInventory.MaxAmount 30\n\tAmmo.BackpackAmount 4\n\tAmmo.BackpackMaxAmount 30\n}\n\n//Artillery-Class Plasma Battery Charge; Plasma Cannon (Yes, all of its damage is actually Explosive/Fire)\nactor PlasmaCannonAmmo : Ammo {\n\tinventory.amount 0\n\tinventory.maxamount 10\n\tammo.backpackamount 1\n\tammo.backpackmaxamount 10\n\t+IGNORESKILL\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\n////Laser Weapons////\n\n//Laser Battery Charge; Laser Rifle\nactor LaserRifleAmmo : Ammo {\n\tinventory.amount 20\n\tinventory.maxamount 200\n\tammo.backpackamount 20\n\tammo.backpackmaxamount 200\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\n//Super-High Density Laser Battery Charge; Laser Chaingun\nactor LaserChaingunAmmo : Ammo {\n\tinventory.amount 50\n\tinventory.maxamount 400\n\tammo.backpackamount 50\n\tammo.backpackmaxamount 400\n\tstates {\n\tSpawn:\n\t\tCELL A -1\n\t\tstop\n\t}\n}\n\n//Dual-Purpose Gauss Slugs; Gauss Rifle\nactor GaussRifleAmmo : Ammo {\n\tinventory.amount 8\n\tinventory.maxamount 40\n\tammo.backpackamount 8\n\tammo.backpackmaxamount 40\n}\n\n//Voltlandian Electric-Bird Extract (Geneporium); Shock Rifle\n// [Dusk] heh\nactor GeneporiumCharge : Ammo {\n\tinventory.amount 30\n\tinventory.maxamount 200\n\tammo.backpackamount 30\n\tammo.backpackmaxamount 200\n}\n\n//UAC Plasma Cell Charge; Plasma Rifle\nactor PlasmaRifleAmmo : Ammo {\n\tinventory.amount 40\n\tinventory.maxamount 300\n\tammo.backpackamount 40\n\tammo.backpackmaxamount 300\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\n////Weaponized Flame Weapons////\n\n//Flammable Aerosol Mix/Phosphorus Incendiary Grenades; Flamethrower\nactor FlamerAmmo : Ammo {\n\tinventory.amount 50\n\tinventory.maxamount 400\n\tammo.backpackamount 50\n\tammo.backpackmaxamount 400\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\nactor PhosphorusGrenadeAmmo : Ammo {\n\tinventory.amount 1\n\tinventory.maxamount 4\n\tammo.backpackamount 1\n\tammo.backpackmaxamount 4\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\n//Heavily Compressed Magical Hydrogen Pellets; Combustion Autorifle\nactor FA21CalAmmo : Ammo {\n\t+IGNORESKILL\n\tinventory.amount 30\n\tinventory.maxamount 120\n\tammo.backpackamount 30\n\tammo.backpackmaxamount 120\n}\n\n////Weaponized Tiberium Weapons////\n\n//Tiberium-Explosive .21 Cal Darts; Tiberium Automatic Rifle\nactor TE21CalAmmo : Ammo {\n\t+IGNORESKILL\n\tinventory.amount 30\n\tinventory.maxamount 120\n\tammo.backpackamount 30\n\tammo.backpackmaxamount 120\n}\n\n//Tiberium Particulate/Tiberium-Explosive Grenades; Chemical Sprayer\nactor ChemicalAmmo : Ammo {\n\tinventory.amount 50\n\tinventory.maxamount 400\n\tammo.backpackamount 50\n\tammo.backpackmaxamount 400\n}\n\nactor ChemicalGrenadeAmmo : Ammo {\n\tinventory.amount 1\n\tinventory.maxamount 4\n\tammo.backpackamount 1\n\tammo.backpackmaxamount 4\n}\n\n////Others And Inventory////\n\n//Personal Cloak Field Generator Power; Stealth Laser Rifle\nactor StealthCharge : Ammo {\n\t+IGNORESKILL\n\tinventory.amount 0\n\tinventory.maxamount 100\n\tammo.backpackamount 10\n\tammo.backpackmaxamount 100\n}\n\n//Timespace... Magic; Time Gun\nactor TimeGunAmmo : Ammo {\n\t+IGNORESKILL\n\tinventory.amount 175\n\tinventory.maxamount 175\n\tammo.backpackamount 0\n\tammo.backpackmaxamount 175\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\n//Chronobow Ammo\nactor ChronoBolt : Ammo {\n\tInventory.Amount 4\n\tInventory.MaxAmount 25\n\tammo.backpackamount 4\n\tAmmo.BackpackMaxAmount 25\n}\n\n//Flash Grenades\nactor FlashbangGrenadeAmmo : Ammo\n{\n\tInventory.PickupMessage \"Picked up a flashbang grenade.\"\n\tInventory.Amount 1\n\tInventory.MaxAmount 1\n\tAmmo.BackpackAmount 1\n\tAmmo.BackpackMaxAmount 1\n\tScale 0.15\n\tStates {\n\tSpawn:\n\t\tFLSH X -1\n\t\tstop\n\t}\n}\n\n//Karasawa Ammo\nActor KSawaCell : Ammo\n{\n Inventory.Amount 8\n Inventory.MaxAmount 60\n Ammo.BackpackAmount 8\n Ammo.BackpackMaxAmount 60\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n }\n}\n\n////Weaponized Flame Weapons////\n\n//Nail Machinegun Ammo/Nail Bombs; Nail Machinegun\nActor Nails : Ammo\n{\n Inventory.Amount 40\n Inventory.MaxAmount 250\n Ammo.BackpackAmount 40\n Ammo.BackpackMaxAmount 250\n States\n {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\nactor NailBombs : Ammo {\n\tinventory.amount 1\n\tinventory.maxamount 4\n\tammo.backpackamount 1\n\tammo.backpackmaxamount 4\n\tstates {\n\tSpawn:\n\t\tTNT1 A 0\n\t\tstop\n\t}\n}\n\nACTOR BoltCharge : Ammo {\n Inventory.Amount 1\n Inventory.MaxAmount 4\n Ammo.BackpackAmount 1\n Ammo.BackpackMaxAmount 4\n States\n {\n Spawn:\n TNT1 A 0\n\t\tstop\n }\n}\n\nActor DesertEagleAmmo : Ammo {\n Inventory.amount 16\n Inventory.maxamount 100\n Ammo.backpackamount 16\n Ammo.backpackmaxamount 100\n States\n {\n Spawn:\n TNT1 A 0\n Stop\n }\n}"
},
{
"source": "pk3",
"name": "acs_source/aow2scrp.txt",
"contents": "/****************************************************************************************************\n ** All Out War 2: The Second Coming ACS script **\n ** Credit to VoltlocK for originally creating the engine **\n ** With modifications by Eruanna, Dusk and the Omega team **\n ** **\n ** You may use portions of this script in your project as long as you give credit where credit is **\n ** due. Please don't be lame and just copy-paste any of this and call it your own. Thanks! **\n ****************************************************************************************************/\n\n// Tag legend:\n// [SP] == Eruanna\n// [NG] == Tiger\n\n#include \"zcommon.acs\"\n#library \"aow2scrp.acs\"\n#import \"modcvars.acs\"\n\n#define MAX_NORMAL_WEAPONS 22\n\n#define TEAM_NONE 255\n\n// [Dusk] intel HudMessage coords\n#define INTEL_XPOS 0.5\n#define INTEL_YPOS 0.055\n#define INTEL_YPOS2 0.0475\n\n// [Dusk] rank stuff\n#define RANK_PRIVATE 0\n#define RANK_CORPORAL 1\n#define RANK_SERGEANT 2\n#define RANK_MASTERSGT 3\n#define RANK_OFFICER 4\n#define RANK_LIEUTENANT 5\n#define RANK_MAJOR 6\n#define RANK_COMMANDO 7\n\n// [Dusk] these determine xp requirements for level-up\n#define XPREQ_CORPORAL 250\n#define XPREQ_SERGEANT 500\n#define XPREQ_MASTERSGT 1000\n#define XPREQ_OFFICER 1500\n#define XPREQ_LIEUTENANT 2000\n#define XPREQ_MAJOR 2500\n#define XPREQ_COMMANDO 3250\n\n// class ids\n#define CLASS_NONE 0\n#define CLASS_GUNMAN 1\n#define CLASS_ENGINEER 2\n#define CLASS_MINIGUNNER 3\n#define CLASS_TECHNICIAN 4\n#define CLASS_FLAMER 5\n#define CLASS_RIFLEMAN 6\n#define CLASS_MACHINEGUNNER 7\n#define CLASS_GRENADIER 8\n#define CLASS_ROCKETEER 9\n#define CLASS_STEALTH 10\n#define CLASS_GAUSSGUNNER 11\n#define CLASS_CHEMWARRIOR 12\n#define CLASS_SHOCKTROOPER 13\n#define CLASS_COMMANDO 14\n#define CLASS_SHOTGUNNER 15\n#define CLASS_SUICIDEBOMBER 16\n#define CLASS_SNIPER 17\n#define CLASS_UTILITYGUY 18\n#define CLASS_DEMOEXPERT 19\n#define CLASS_MEDIC 20\n#define CLASS_LASERCHAINGUNNER 21\n#define CLASS_JUMPJET 22\n#define CLASS_TIBRIFLE 23\n#define CLASS_DOUBLESHOTGUNNER 24\n#define CLASS_PLASMAGUNNER 25\n#define CLASS_ARTILLERY 26\n#define CLASS_TIMECOP 27\n#define CLASS_HARVESTER 28\n#define CLASS_ADVHARVESTER 29\n\n// mech ids\n#define MECH_ORCA 0\n#define MECH_RAVEN 1\n#define MECH_WOLVERINE 2\n#define MECH_MADCAT 3\n#define MECH_TITAN 4\n#define MECH_GUARDIAN 5\n// #define MECH_SCAVENGER 6\n\n// event scripts\n#define ACTION_DESTROY_BARRACKS 0\n#define ACTION_DESTROY_REFINERY 1\n#define ACTION_DESTROY_PLANT 2\n#define ACTION_DESTROY_FACTORY 3\n#define ACTION_DESTROY_OBELISK 4\n#define ACTION_DESTROY_REPAIR 5\n#define ACTION_SUDDENDEATH 6\n\n#define HM_1TIC 1872 // (1/35) * 2^16\n#define HM_2TICS 3745 // (2/35) * 2^16\n#define HM_3TICS 5617 // (3/35) * 2^16\n#define HM_4TICS 7489 // (4/35) * 2^16\n#define HM_5TICS 9362 // (5/35) * 2^16\n\n#define HP_BARRACKS 20000\n#define HP_REFINERY 30000\n#define HP_PLANT 20000\n#define HP_FACTORY 30000\n#define HP_REPAIR 15000\n#define HP_OBELISK 15000\n#define HP_MINIREF 6500\n#define HP_REGENS 10000\n#define HP_PORTAL 3000\n\n#define BUILDING_ALL -1\n\n#define BUILDING_BARRACKS 0\n#define BUILDING_REFINERY 1\n#define BUILDING_RESCENTRE 2\n#define BUILDING_FACTORY 3\n#define BUILDING_REPAIR 4\n#define BUILDING_OBELISK 5\n#define BUILDING_MINIREF 6\n#define BUILDING_HPREGEN 7 // deprecated\n#define BUILDING_HEALTHREGEN 7\n#define BUILDING_AMMOREGEN 8\n#define BUILDING_PORTAL 9\n\n// TODO: move these to 1000+ range\n#define TID_BARRACKS_BLUE 101\n#define TID_BARRACKS_RED 201\n#define TID_REFINERY_BLUE 103\n#define TID_REFINERY_RED 203\n#define TID_RESCENTRE_BLUE 105\n#define TID_RESCENTRE_RED 205\n#define TID_FACTORY_BLUE 107\n#define TID_FACTORY_RED 207\n#define TID_REPAIR_BLUE 109\n#define TID_REPAIR_RED 209\n#define TID_OBELISK_BLUE 114\n#define TID_OBELISK_RED 214\n#define TID_CRATE 401\n#define TID_TIBERIUM 402\n#define TID_TICKETCOUNTER_BLUE 410\n#define TID_TICKETCOUNTER_RED 411\n#define TID_MINIREF_BLUE 901\n#define TID_MINIREF_RED 900\n#define TID_HEALTHREGEN_BLUE 903\n#define TID_HEALTHREGEN_RED 902\n#define TID_AMMOREGEN_BLUE 905\n#define TID_AMMOREGEN_RED 904\n\n// new tids\n#define TID_PORTAL_BLUE1 1500\n#define TID_PORTAL_BLUE2 1501\n#define TID_PORTAL_RED1 1502\n#define TID_PORTAL_RED2 1503\n#define TID_PORTAL_TELEDEST 1504\n// 1504 - 1505\n#define TID_PORTAL_FX 1508\n// 1508 - 1511\n\t// 1512 - 1519 is free\n#define TID_MARINE 1520\n// 1520 - 1544\n\n// TODO: populate this list\n#define SC_PORTAL_TIDREQUEST 935\n#define SC_PORTAL_INIT 936\n#define SC_PORTAL_FUNCTION 937\n#define SC_MARINE_INIT 938\n#define SC_MARINE_COMPENSATION 939\n#define SC_MARINE_STATS 967\n#define SC_MARINE_DEATH 968\n\n// how many points does researching stuff give you?\n// Also used for miniref and utility-built ammo/health regens\n#define POINTS_RESEARCH 12\n\n// largest crate number, bump this every time new crates are added\n#define MAX_CRATE 68\n\n#define MAX_MARINES 24\n\nbool Bots[MAX_MARINES];\n\nint BaseTIDs[18] = {\n\tTID_BARRACKS_BLUE, TID_BARRACKS_RED,\n\tTID_REFINERY_BLUE, TID_REFINERY_RED,\n\tTID_RESCENTRE_BLUE, TID_RESCENTRE_RED,\n\tTID_FACTORY_BLUE, TID_FACTORY_RED,\n\tTID_REPAIR_BLUE, TID_REPAIR_RED,\n\tTID_OBELISK_BLUE, TID_OBELISK_RED,\n\tTID_MINIREF_BLUE, TID_MINIREF_RED,\n\tTID_HEALTHREGEN_BLUE, TID_HEALTHREGEN_RED,\n\tTID_AMMOREGEN_BLUE, TID_AMMOREGEN_RED\n};\n\nstr TeamNames[2] = {\"Blue\", \"Red\"};\n\nint Developer;\nint DeveloperSafetyLock;\nint ConnectionEpoch;\n\nint EventScripts;\n\nint GameMode;\nint BodycountTimelimit;\n\nint Flags[3];\n\nint Credits[33];\nint Experience[32];\nint Rank[32];\nstr RankTitles[8];\nint PlayersTeam[33];\nbool IsAdmin[33];\nbool Surrender[32];\nint LastSurrenderTime[32];\n\nint FirstBlood;\n\n// [SP] Keep track of when player joins game for purposes of team balance\nint StartTime[33];\nint PlayerNeedsSwitched;\n\n// [SP] Plasma cannon tracking\nint LastPurchasedCannon[33];\nint LastPurchasedBeacon[3];\nint NumPlasmaCannons[3];\nint MaxCannonsPerTeam;\nint CannonPurchaseDelay;\n\n// [SP] Time Cop tracking\nint LastPurchasedTimeCop[33];\nint NumTimeCops[3];\nint MaxTimeCopsPerTeam;\n\nint TimedC4Delay;\n\nint UsePortals = 1;\n// [Dusk] this is used to determine which portal is alive *and* active\n// a portal is considered inactive when it has no destinaton\nint Portals[4] = {0};\n// used to determine when a player has teleported in the last 18 tics. prevents teleporting multiple times.\nint HasTeleported[32];\n\nint LastMenu[33] = {0}; // [SP] This is to fix double-pressing on mech switches, causing a huge cost to the buyer.\n\n// [SP] Current Console Player IDX (client-side only)\n// Defaults to -1, this will be the \"server\" - anytime ConsolePlayer is -1\n// it means the client-side script did not execute, therefore this is the server.\nint ConsolePlayer = -1;\n\n//Bases\nbool GotRefinery[2];\nbool GotBarracks[2];\nbool GotFactory[2];\nbool GotPlant[2];\nbool GotRepair[2];\nbool GotObelisk[2];\nint MiniRefinery[2];\nint RefineryHealth[2];\nint BarracksHealth[2];\nint FactoryHealth[2];\nint PlantHealth[2];\nint RepairHealth[2];\nint ObeliskHealth[2];\nint MiniRefHealth[2];\nint GlobalMedicHealth[2];\nint GlobalAmmoHealth[2];\nint BaseLeft[2];\n\nint BaseHUDUpdate;\nint NextTicketUpdate;\nint LastAttackMessage;\nint LastTickets[2];\nint LastClientRequest;\nint MaxTurretDistance = 2500;\nint MinEnemyTurretDistance = 1500;\n\nint SurrenderWaitTime = 20;\n\n//RESEARCHES!!!!!!!!\nbool EnhancedRefining[2]; //Increases profits from harvesting by $50 //Costs $2000\nbool AdvancedMechResearch[2]; //Enables purchase of Juggernaut, Titan and MadCat //Costs $2000\nint GlobalMedic[2]; //Builds a Team Health Regeneration Cache //Costs $2250\nint GlobalAmmo[2]; //Builds a Team Ammo Regeneration Cache //Costs $2250\nbool AdvancedTurrets[2]; //Allows construction of high level Turrets //Costs $2000\nbool MoreTurrets[2]; //Increases Turret cap by 10 //Costs $2000\nint MaxTurrets[2] = {15, 15};\n\nint GuardianLimit;\n\nint StartCredits;\nint CreditFlow;\nint CreditFlowPower;\nint CreditFragAward;\nint CreditAwardTime;\nint CreditAwardAmount;\nint CreditRepairAmount;\n\nbool MechEnabled;\nbool GettingMech[2];\nbool SuddenDeath = False;\nbool TicketPool = False;\nint Tickets[2];\nint StartingTickets;\nint TournamentMode;\nint BeaconPurchaseDelay;\n\nint TeamStayTime;\nbool TeamUnbalanceCompensation[2];\n\nbool RedBeaconCooldown = False;\nbool BlueBeaconCooldown = False;\nint RedBeaconTime = 300;\nint BlueBeaconTime = 300;\n\nint GameOver;\n\nbool CrateTime = True;\n\nint PlayerSpeeds[32];\nint MechGetter[2]; // which player is in the hanger?\n\nint PlasmaCooldownTime; // plasma cannon cooldown time (CVar)\nint PlasmaCooldown[32]; // same for plasma cannon (internal)\n\nint MaxRazorWire = 20;\nint MaxProxy = 50;\nint MaxMechs = 5; // mini-ravens\nint MaxCrates = 15;\n\nint RepairBonus[32];\nint MedicBonus[32];\nint MedicBonusNeed;\nint AIMarines[2] = {0}; // compensation-spawned only\n\nint AIMarineCount = 0; // how many AI marines are there overall?\n\nint CrateNumber = 0; // crate logic\n\nstr NormalWeaponNames[MAX_NORMAL_WEAPONS] = {\n\t\"ArtilleryCannon\",\n\t\"ChemicalSprayer\",\n\t\"DoubleShotgun\",\n\t\"EagerBeaver\",\n\t\"Flamer\",\n\t\"GatlingGun\",\n\t\"GaussRifle\",\n\t\"Grenade_Launcher\",\n\t\"Knife\",\n\t\"LaserChaingun\",\n\t\"LaserRifle\",\n\t\"MachineGun\",\n\t\"MissileLauncher\",\n\t\"PlasmaCannon\",\n\t\"PlasmaGun\",\n\t\"Rifle\",\n\t\"ShockRifle\",\n\t\"Boomstick\",\n\t\"SniperRifle\",\n\t\"SubMachineGun\",\n\t\"TiberiumAutorifle\",\n\t\"TimeGun\"\n};\n\n#include \"a_functions.acs\"\n#include \"a_armor.acs\"\n#include \"a_monies.acs\"\n#include \"a_xp.acs\"\n\n#include \"a_admin.acs\"\n#include \"a_basehud.acs\"\n#include \"a_bases.acs\"\n#include \"a_botmarines.acs\"\n#include \"a_bots.acs\"\n#include \"a_clientfx.acs\"\n#include \"a_clssc.acs\"\n#include \"a_core.acs\"\n#include \"a_crate.acs\"\n#include \"a_death.acs\"\n#include \"a_dmgovertime.acs\"\n#include \"a_donate.acs\"\n#include \"a_hud.acs\"\n#include \"a_items.acs\"\n#include \"a_mechs.acs\"\n#include \"a_menu.acs\"\n#include \"a_misc.acs\"\n#include \"a_netscripts.acs\"\n#include \"a_opendeck.acs\"\n#include \"a_portal.acs\"\n#include \"a_regen.acs\"\n#include \"a_repfac.acs\"\n#include \"a_repair.acs\"\n#include \"a_respc.acs\"\n#include \"a_spawnroom.acs\"\n#include \"a_stealth.acs\"\n#include \"a_surrender.acs\"\n#include \"a_suddendeath.acs\"\n#include \"a_teambalance.acs\"\n#include \"a_timegun.acs\"\n#include \"a_tiberium.acs\"\n#include \"a_util.acs\"\n#include \"a_wchk.acs\""
},
{
"source": "pk3",
"name": "acs_source/a_admin.txt",
"contents": "// [SP] NOTICE: This is an administrator 'puke' script. USE WITH CARE! This can be abused very easily.\nscript 401 (int Player,int Action)\n{\n\tSetActivator(3800 + Player);\n\tswitch(Action)\n\t{\n\tcase 3:\n\t\tif ( ThingCount(T_NONE,3800 + Player) == 0 ) {\n\t\t\tLog(s:\"Error: Player #\",d:Player,s:\" not found!\");\n\t\t\tterminate;\n\t\t}\n\t\tif (PlayerIsBot (Player)) {\n\t\t\tLog (s:\"Error: Player #\", d:Player, s:\" \\\"\", n:Player+1, s:\"\\c-\\\" is a bot.\");\n\t\t\tterminate;\n\t\t}\n\t\t//Player_SetTeam(255);\n\t\tSetPlayerProperty(0,1,1);\n\t\tSetPlayerProperty(0,1,2);\n\t\tSetPlayerProperty(0,1,3);\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold (n:0, s:\"\\c- becomes an \\cGadministrator\";\n\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 2.0, 1.0);\n\t\tLog(s:\"*** \\caWARNING!\\c- Game Master mode activated for \",n:Player+1,s:\" \\c-(IDX \",d:Player,s:\") - this has been logged in the server console.\");\n\t\tLog(s:\"*** To deactivate this mode, you (or target) must either spectate or call a_exit in console.\");\n\t\tLog(s:\"*** Please don't abuse this! Do what you need to do, then exit this mode immediately.\");\n\t\tGiveInventory(\"AdministratorSwitch\",1);\n\t\tIsAdmin[Player] = true;\n\t\tGiveInventory (\"IsAdmin\", 1);\n\t\tbreak;\n\tcase 1:\n\t\tif ( ThingCount(T_NONE,3800 + Player) == 0 )\n\t\t{\n\t\t\tLog(s:\"Player \",d:Player,s:\" not found!\");\n\t\t\tterminate;\n\t\t}\n\t\tif ( PlayerTeam() == 0 )\n\t\t{\n\t\t\tLog(s:\"Player \",d:Player,s:\" named \",n:0,s:\" is already on Blue.\");\n\t\t\tterminate;\n\t\t}\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessage (n:Player, s:\"\\c- has been forced to\\n\\cKchange team\\c- by an \\cQadmin.\";\n\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\t\tPlayer_SetTeam(0);\n\t\tLog(n:0,s:\" forced to change to Blue by admin.\");\n\t\tdelay(1);\n\t\tTeleport(70);\n\t\tGiveInventory(\"HasClass\",1);\n\t\tACS_ExecuteAlways(95,0,0,0,0);\n\t\tTakeInventory(\"IsRed\",1);\n\t\tGiveInventory(\"IsBlue\",1);\n\t\tStartTime[Player] = -0x7FFFFFFF;\n\t\tbreak;\n\tcase 2:\n\t\tif ( ThingCount(T_NONE,3800 + Player) == 0 )\n\t\t{\n\t\t\tLog(s:\"Player \",d:Player,s:\" not found!\");\n\t\t\tterminate;\n\t\t}\n\t\tif ( PlayerTeam() == 1 )\n\t\t{\n\t\t\tLog(s:\"Player \",d:Player,s:\" named \",n:0,s:\" is already on Red.\");\n\t\t\tterminate;\n\t\t}\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessage (n:Player, s:\"\\c- has been forced to\\n\\cKchange team\\c- by an \\cQadmin.\";\n\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\t\tPlayer_SetTeam(1);\n\t\tLog(n:0,s:\" forced to change to Red by admin.\");\n\t\tdelay(1);\n\t\tTeleport(71);\n\t\tGiveInventory(\"HasClass\",1);\n\t\tACS_ExecuteAlways(95,0,0,0,0);\n\t\tTakeInventory(\"IsBlue\",1);\n\t\tGiveInventory(\"IsRed\",1);\n\t\tStartTime[Player] = -0x7FFFFFFF;\n\t\tbreak;\n\tcase 0:\n\t\tswitch(Player)\n\t\t{\n\t\tcase 3:\n\t\t\tLog(s:\"Usage: gamemaster <IDX> (use 'playerinfo' to get IDX numbers)\");\n\t\tcase 1:\n\t\t\tLog(s:\"Usage: forceblue <IDX> (use 'playerinfo' to get IDX numbers)\");\n\t\tcase 2:\n\t\t\tLog(s:\"Usage: forcered <IDX> (use 'playerinfo' to get IDX numbers)\");\n\t\tdefault:\n\t\t\tLog(s:\"Please don't puke this script directly! Use the provided ccmd's - it's for your sanity's own good!\");\n\t\t}\n\tdefault:\n\t\tLog(s:\"Unknown action!\");\n\t}\n}\nscript 402 (int Arg1, int Arg2, int Arg3) NET\n{\n\tif ( IsAdmin[PlayerNumber()] == false )\n\t\tterminate;\n\tswitch(Arg1)\n\t{\n\tcase 0:\n\t\t// help!\n\t\tbreak;\n\tcase 1:\n\t\t// Warp\n\t\t/*Spawn(\"TeleportDest\",Arg2<<16,Arg3<<16,0,6003);\n\t\tdelay(1);\n\t\tTeleport_NoFog(6003);\n\t\tdelay(1);\n\t\tThing_Remove(6003);*/\n\t\t// [Dusk] this should be more reliable\n\t\tSetActorPosition (0, arg2<<16, arg3<<16, 0, false);\n\t\tbreak;\n\tcase 2:\n\t\t// Teleport to spot\n\t\tif (arg2 <= 0) {\n\t\t\tHudMessage (s:\"Usage: a_teleport <tid>\\n\",\n\t\t\t\ts:\"TIDs of interest:\\n\",\n\t\t\t\ts:\"1: blue base\\t\\t2: red base\\n\",\n\t\t\t\ts:\"70: blue spawn room\\t71: red spawn room\\n\",\n\t\t\t\ts:\"108: blue wf hanger\\t208: red wf hanger\\n\",\n\t\t\t\ts:\"110: blue mech room\\t210: red mech room\\n\",\n\t\t\t\ts:\"111: blue res room\\t211: red res room\\n\"; HUDMSG_PLAIN|HUDMSG_LOG, 9000, 0, 0, 0, 0);\n\t\t\tHudMessage (s:\"\"; HUDMSG_PLAIN, 9000, 0, 0, 0, 0.1);\n\t\t\tterminate;\n\t\t}\n\t\tTeleport_NoFog(Arg2);\n\t\tbreak;\n\tcase 3:\n\t\t// Activate crate\n\t\tACS_ExecuteAlways (309, 0, Arg2, Arg3);\n\t\tbreak;\n\tcase 4:\n\tcase 5:\n\t\tbreak;\n\tcase 6:\n\t\t// Toggle berserk\n\t\tif (CheckInventory (\"PowerBerserk\")) {\n\t\t\tTakeInventory (\"PowerBerserk\", 1);\n\t\t\tdelay (5);\n\t\t\tTakeInventory (\"PowerBerserkHue\", 1);\n\t\t\tdelay (3);\n\t\t\tGiveInventory (\"RedHueRemover\", 1);\n\t\t} else {\n\t\t\tGiveInventory (\"BerserkSwitch\", 1);\n\t\t\tdelay (5);\n\t\t\tGiveInventory (\"BerserkHue\", 1);\n\t\t}\n\t\tbreak;\n\tcase 7:\n\t\t// Instant resign\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tTeleport(71);\n\t\telse\n\t\t\tTeleport(70);\n\t\tACS_ExecuteAlways (95, 0);\n\t\tbreak;\n\tcase 8:\n\t\t// Give beacon item\n\t\tGiveInventory(\"BeaconItem\",1);\n\t\tbreak;\n\tcase 9:\n\t\t// Become Admin Player Again - or remove it\n\t\tif (CheckInventory(\"PowerAdministrator\")) {\n\t\t\tTakeInventory(\"PowerAdministrator\",1);\n\t\t\tSetPlayerProperty(0,0,1);\n\t\t\tSetPlayerProperty(0,0,2);\n\t\t\tSetPlayerProperty(0,0,3);\n\t\t} else {\n\t\t\tGiveInventory(\"AdministratorSwitch\",1);\n\t\t\tSetPlayerProperty(0,1,1);\n\t\t\tSetPlayerProperty(0,1,2);\n\t\t\tSetPlayerProperty(0,1,3);\n\t\t}\n\t\tbreak;\n\tcase 10:\n\t\t// Set Team\n\t\tPlayer_SetTeam(Arg2);\n\t\tif (Arg2 == TEAM_BLUE) {\n\t\t\tTakeInventory(\"IsRed\",1);\n\t\t\tGiveInventory(\"IsBlue\",1);\n\t\t} else {\n\t\t\tGiveInventory(\"IsRed\",1);\n\t\t\tTakeInventory(\"IsBlue\",1);\n\t\t}\n\t\tbreak;\n\tcase 11:\n\t\t// Give utility gun\n\t\tGiveInventory (\"RepairGun\", 1);\n\t\tGiveInventory (\"UtilityGun\", 1);\n\t\tbreak;\n\tcase 12:\n\t\t// Set speed\n\t\tSetActorProperty(0, APROP_SPEED, 0.01 * Arg2);\n\t\tbreak;\n\tcase 13:\n\t\t// Admin pistol - rotate fire\n\t\tif (CheckInventory (\"AdminPistolRotation\") == 2)\n\t\t\tTakeInventory (\"AdminPistolRotation\", 2);\n\t\telse\n\t\t\tGiveInventory (\"AdminPistolRotation\", 1);\n\n\t\tswitch (CheckInventory (\"AdminPistolRotation\")) {\n\t\tcase 0:\n\t\t\tHudMessage (s:\"Normal mode\";\n\t\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 1.0, 0.5);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tHudMessage (s:\"\\cJRepair / Disarm mode\";\n\t\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 1.0, 0.5);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tHudMessage (s:\"Deconstruction mode\";\n\t\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 1.0, 0.5);\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\tcase 14:\n\t\t// Open Deck\n\t\tGiveInventory (\"CrateChooser\", 1);\n\t\tbreak;\n\tcase 15:\n\t\t// Notarget\n\t\tSetActorProperty (0, APROP_NoTarget, !GetActorProperty (0, APROP_NoTarget));\n\t\tbreak;\n\tcase 16:\n\t\t// Exit admin mode\n\t\tSetPlayerProperty (0, 0, 1);\n\t\tSetPlayerProperty (0, 0, 2);\n\t\tSetPlayerProperty (0, 0, 3);\n\t\tSetActorProperty (0, APROP_NoTarget, 0);\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold (s:\"Admin \", n:0, s:\"\\c- becomes a regular player again.\";\n\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 2.0, 1.0);\n\t\tLog (n:0, s:\" (#\", d:PlayerNumber(), s:\") exits admin mode.\");\n\t\tIsAdmin[PlayerNumber()] = false;\n\t\tACS_ExecuteAlways (96, 0, 1-PlayerTeam()); // teleport to spawn room\n\t\tdelay (5);\n\t\tACS_ExecuteAlways (95, 0); // resign\n\t\tbreak;\n\tcase 17:\n\t\t// Set health\n\t\tif (arg2 <= 0) break;\n\t\tSetActorProperty (0, APROP_Health, Arg2);\n\t\tbreak;\n\tcase 18:\n\t\t// Fly\n\t\tif (CheckInventory (\"PowerFlight\"))\n\t\t\tTakeInventory (\"PowerFlight\", 1);\n\t\telse\n\t\t\tGiveInventory (\"AdminFlight\", 1);\n\t\tbreak;\n\tdefault:\n\t\tLog(s:\"Unknown action!\");\n\t}\n}\n\n// TEAM SHUFFLE\n// -- only use for the grossest cases of team stack\nscript 403 (void) {\n\tlog (s:\"[SHUFFLE] Countdown begins.\");\n\tfor (int i = 10; i > 0; i--) {\n\t\tSetFont (\"BIGFONT\");\n\t\tAmbientSound (\"beacon/nukebeep\", 127);\n\t\tHudMessageBold (s:\"WARNING: Server admin has called \\cRteam shuffle!!\\n\\n\\cRALL PLAYERS\\cG will switch to random teams in \\cK\", d:i;\n\t\t\tHUDMSG_FADEOUT, 2150, CR_RED, 0.5, 0.3, 0.75, 1.0);\n\t\tdelay (35);\n\t}\n\n\tAmbientSound (\"nuke/boom\", 127);\n\tint max = PlayerCount()/2;\n\tint b, r, t;\n\tstr name;\n\tint c;\n\tlog (s:\"[SHUFFLE] Begin of team shuffle.\");\n\t// first knock out start times of everybody - we don't want team switcher to interfere here\n\tfor (i = 0; i <= 31; i++) if (PlayerInGame (i)) StartTime[i] = -0x7FFFFFFF;\n\n\tfor (i = 0; i <= 31; i++) {\n\t\tif (!PlayerInGame (i)) continue;\n\n\t\t// don't interfere gamemasters, they're here to do something important\n\t\tif (!IsAdmin [i]) {\n\t\t\tt = random (TEAM_BLUE, TEAM_RED);\n\t\t\t// keep teams even\n\t\t\tif (t == TEAM_BLUE && b >= max) t = TEAM_RED;\n\t\t\telse if (t == TEAM_RED && r >= max) t = TEAM_BLUE;\n\t\t} else t = GetPlayerInfo (i, PLAYERINFO_TEAM);\n\n\t\tif (t) {name=\"Red\"; r++;} else {name=\"Blue\"; b++;}\n\n\t\tSetActivator (3800+i);\n\t\tif (GetPlayerInfo (i, PLAYERINFO_TEAM) == t) {\n\t\t\tlog (s:\"[SHUFFLE] Player \", d:0, s:\" \\\"\", n:0, s:\"\\c-\\\" remains on \", s:name, s:\".\");\n\t\t\tc = 0;\n\t\t} else {\n\t\t\tlog (s:\"[SHUFFLE] Player \", d:0, s:\" \\\"\", n:0, s:\"\\c-\\\" changes to \", s:name, s:\".\");\n\t\t\tPlayer_SetTeam (t);\n\t\t\tc = 1;\n\t\t}\n\n\t\tif (!IsAdmin [i]) {\n\t\t\tif (!CheckInventory (\"IsInSpawnRoom\") || c) Teleport (70 + PlayerTeam());\n\t\t\tACS_ExecuteAlways (95, 0, 0, TRUE);\n\t\t}\n\n\t\tdelay (5);\n\t}\n\n\tSetActivator (-1);\n\tHudMessageBold (s:\"Shuffle complete. Game on!\"; HUDMSG_FADEOUT, 0, CR_GREEN, 0.5, 0.3, 3.5, 1.0);\n\tlog (s:\"[SHUFFLE] Shuffle complete.\");\n}\n\n// ERROR: SCRIPT NOT FOUND >:V\n// developer mode: activates all researches, knocks out money limits...\n// basically I got tired of going past limits when testing stuff.\n\nscript 404 (void) {\n\t// This is a dangerous script. RCON must call it twice, if it ever does that...\n\tif (Timer() > DeveloperSafetyLock) {\n\t\tDeveloperSafetyLock = Timer() + 10*35;\n\t\tLog (s:\"Call activatedeveloper again to activate deverloper mode.\");\n\t\tLog (s:\"WARNING: THIS WILL MAKE ALL PLAYERS GAMEMASTER! DO NOT USE IN PUBLIC GAMES!\");\n\t\tterminate;\n\t}\n\n\tDeveloper = true;\n\n\tSetFont (\"BIGFONT\");\n\tHudMessageBold (s:\"DEVELOPER MODE ACTIVATED\\n\\nALL PLAYERS ARE NOW GAMEMASTERS\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_BLUE, 0.5, 0.45, 2.0, 1.0);\n\tLog(s:\"*** \\caWARNING!\\c- Developer mode active. ALL players are now gamemasters.\");\n\n\tfor (int i = 0; i <= 1; i++) {\n\t\tEnhancedRefining[i] = true;\n\t\tAdvancedMechResearch[i] = true;\n\t\tAdvancedTurrets[i] = true;\n\t\tMoreTurrets[i] = true;\n\t\tMaxTurrets[i] = 1000000;\n\t}\n\n\t// disable limits and delays\n\tConsoleCommand (\"set aow_c4limit -1\");\n\tConsoleCommand (\"set aow_guardianlimit 32\");\n\tConsoleCommand (\"set aow_teamstaytime -1\");\n\tConsoleCommand (\"set aow_maxcannonsperteam -1\");\n\tConsoleCommand (\"set aow_plasmacooldown -1\");\n\tConsoleCommand (\"set aow_beaconpurchasedelay -1\");\n\tConsoleCommand (\"set aow_maxtimecopsperteam -1\");\n\n\t// make everybody gamemaster, but don't morph them\n\tfor (i = 0; i <= 31; i++) IsAdmin[i] = true;\n}"
},
{
"source": "pk3",
"name": "acs_source/a_armor.txt",
"contents": "// All Out War 2 armour manipulation scripts\n// Credit to VoltlocK for originally creating the engine\n// With modifications by Eruanna, Dusk and the Omega Team\n\n// You may use portions of this script in your project as long as you give credit where credit is\n// due. Please don't be lame and just copy-paste any of this and call it your own. Thanks!\n\n// NOTE: AGF_ADDITIVE means subtractive if n < 0!\n#define NOCHANGE 255\n#define ARMOD_NOCHANGE 0\n#define ARMOD_FIRE 1\n#define ARMOD_CHEM 2\n#define ARMOD_LASER 3\n#define ARMOD_EXPLO 4\n#define ARMOD_BULLET 5\n#define ARMOD_NONE 7\n#define AGF_ADDITIVE 8\n#define AGF_DONTSUBTRACT 16\n#define AGF_DONTADD 32\nfunction int GetArmorGrade (void) {\n\tif (CheckInventory (\"PowerGrade5Armor\")) return 5;\n\tif (CheckInventory (\"PowerGrade4Armor\")) return 4;\n\tif (CheckInventory (\"PowerGrade3Armor\")) return 3;\n\tif (CheckInventory (\"PowerGrade2Armor\")) return 2;\n\tif (CheckInventory (\"PowerGrade1Armor\")) return 1;\n\tif (CheckInventory (\"PowerGrade-1Armor\")) return -1;\n\treturn 0;\n}\n\nfunction int GetArmorModifier (void) {\n\tif (CheckInventory (\"PowerFireProof\")) return ARMOD_FIRE;\n\tif (CheckInventory (\"PowerChemicalProof\")) return ARMOD_CHEM;\n\tif (CheckInventory (\"PowerExplosiveResistance\")) return ARMOD_EXPLO;\n\tif (CheckInventory (\"PowerLaserResistance\")) return ARMOD_LASER;\n\tif (CheckInventory (\"PowerBulletResistance\")) return ARMOD_BULLET;\n\treturn 0;\n}\n\nfunction void SetArmorGrade (int n, int mod) {\n\tint debug = GetCVar (\"aow_debugarmor\");\n\tif (debug) {\n\t\tLog (s:\"SetArmorGrade called with arguments \", d:n, s:\" and \", d:mod);\n\t\tif (mod & AGF_ADDITIVE) Log (s:\"AGF_ADDITIVE set\");\n\t\tif (mod & AGF_DONTADD) Log (s:\"AGF_DONTADD set\");\n\t\tif (mod & AGF_DONTSUBTRACT) Log (s:\"AGF_DONTSUBTRACT set\");\n\t}\n\n\tint grade = GetArmorGrade ();\n\n\tif (n != NOCHANGE) {\n\t\tif (mod & AGF_ADDITIVE) {\n\t\t\tif (debug) Log (s:\"SetArmorGrade: AGF_ADDITIVE is set. n = \", d:grade, s:\" + \", d:n);\n\t\t\tn += grade;\n\t\t} else {\n\t\t\t// armour upgrade\n\t\t\tif (CheckInventory (\"HasArmorUpgrade\")) {\n\t\t\t\tif (debug) Log (s:\"SetArmorGrade: Player has armor upgrade n = \", d:n+1);\n\t\t\t\tn++;\n\t\t\t}\n\t\t}\n\n\t\tif (n > 5) n = 5;\n\t\tif (n < 0) {\n\t\t\t// don't go to -1 with AGF_ADDITIVE\n\t\t\tif (mod & AGF_ADDITIVE)\n\t\t\t\tn = 0;\n\t\t\telse\n\t\t\t\tn = -1;\n\t\t}\n\n\t\tif ((mod & AGF_DONTSUBTRACT && n <= grade) || (mod & AGF_DONTADD && n >= grade)) {\n\t\t\tif (debug) Log (s:\"SetArmorGrade: AGF_DONTSUBTRACT or AGF_DONTADD vetos grade change.\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (debug) Log (s:\"Final armor grade: \", d:n);\n\t\tif (grade != n) {\n\t\t\tCheckAndRemove (\"PowerGrade5Armor\");\n\t\t\tCheckAndRemove (\"PowerGrade4Armor\");\n\t\t\tCheckAndRemove (\"PowerGrade3Armor\");\n\t\t\tCheckAndRemove (\"PowerGrade2Armor\");\n\t\t\tCheckAndRemove (\"PowerGrade1Armor\");\n\t\t\tCheckAndRemove (\"PowerGrade-1Armor\");\n\t\t\tswitch (n) {\n\t\t\t\tcase 5: GiveInventory (\"Grade5Armor\", 1); break;\n\t\t\t\tcase 4: GiveInventory (\"Grade4Armor\", 1); break;\n\t\t\t\tcase 3: GiveInventory (\"Grade3Armor\", 1); break;\n\t\t\t\tcase 2: GiveInventory (\"Grade2Armor\", 1); break;\n\t\t\t\tcase 1: GiveInventory (\"Grade1Armor\", 1); break;\n\t\t\t\tcase -1: GiveInventory (\"Grade-1Armor\", 1); break;\n\t\t\t}\n\n\t\t\tif (n == 5) {\n\t\t\t\tSetFont (\"SMALLFONT\");\n\t\t\t\tHudMessageBold (n:0, s:\"\\c- has \\cKGrade 5 Armor!\";\n\t\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t\t}\n\t\t}\n\t}\n\n\t// rid the flags now\n\tif (mod >= 32) mod -= 32;\n\tif (mod >= 16) mod -= 16;\n\tif (mod >= 8) mod -= 8;\n\n\tif (mod != ARMOD_NOCHANGE) {\n\t\tCheckAndRemove (\"PowerFireProof\");\n\t\tCheckAndRemove (\"PowerChemicalProof\");\n\t\tCheckAndRemove (\"PowerBulletResistance\");\n\t\tCheckAndRemove (\"PowerExplosiveResistance\");\n\t\tCheckAndRemove (\"PowerLaserResistance\");\n\n\t\tswitch (mod) {\n\t\t\tcase ARMOD_FIRE: GiveInventory (\"FireProof\", 1); break;\n\t\t\tcase ARMOD_CHEM: GiveInventory (\"ChemicalProof\", 1); break;\n\t\t\tcase ARMOD_EXPLO: GiveInventory (\"ExplosiveResistance\", 1); break;\n\t\t\tcase ARMOD_LASER: GiveInventory (\"LaserResistance\", 1); break;\n\t\t\tcase ARMOD_BULLET: GiveInventory (\"BulletResistance\", 1); break;\n\t\t}\n\t}\n}\n\n// for testing and decorate (ai marines, et al)\nscript 985 (int grade, int mod) {SetArmorGrade (grade, mod);}\n\n// [DEBUG] ARMOR DISPLAY\nint ArmorNames[13] = {\"PowerGrade1Armor\", \"PowerGrade2Armor\", \"PowerGrade3Armor\", \"PowerGrade4Armor\", \"PowerGrade5Armor\",\n\t\"PowerGrade-1Armor\", \"PowerFireProof\", \"PowerChemicalProof\", \"PowerExplosiveResistance\", \"PowerLaserResistance\",\n\t\"PowerBulletResistance\", \"PowerChemicalResistance\", \"PowerGrade2ArmorFactoryPower\"};\nint ArmorValuesFist[13] = {0.9, 0.8, 0.7, 0.6, 0.5, 1.2,\n\t1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.9};\nint ArmorValuesBullet[13] = {0.9, 0.8, 0.7, 0.6, 0.5, 1.2,\n\t1.0, 1.0, 1.0, 1.0, 0.5, 1.0, 0.9};\nint ArmorValuesExplo[13] = {0.9, 0.8, 0.7, 0.6, 0.5, 1.2,\n\t1.0, 1.0, 0.5, 2.0, 2.0, 1.0, 0.9};\nint ArmorValuesAntiArmor[13] = {0.9, 0.8, 0.7, 0.6, 0.5, 1.2,\n\t1.0, 1.0, 0.5, 2.0, 1.0, 1.0, 0.9};\nint ArmorValuesFire[13] = {0.9, 0.8, 0.7, 0.6, 0.5, 1.2,\n\t0.0, 2.0, 1.0, 1.0, 1.0, 2.0, 0.9};\nint ArmorValuesChem[13] = {0.9, 0.8, 0.7, 0.6, 0.5, 1.2,\n\t2.0, 0.0, 1.0, 1.0, 1.0, 0.5, 0.9};\nint ArmorValuesLaser[13] = {0.9, 0.8, 0.7, 0.6, 0.5, 1.2,\n\t1.0, 1.0, 2.0, 0.5, 2.0, 1.0, 0.9};\n\nscript 981 (void) NET CLIENTSIDE {\n\tint fist, bullet, explo, antiarmor, fire, chem, laser;\n\n\tif (CheckInventory (\"IsMech\")) {\n\t\tfist = 0.35;\n\t\tbullet = 0.8;\n\t\texplo = 1.35;\n\t\tantiarmor = 2.0;\n\t\tfire = 1.25;\n\t\tchem = 1.75;\n\t\tlaser = 1.0;\n\t} else {\n\t\tfist = 1.0;\n\t\tbullet = 1.0;\n\t\texplo = 1.0;\n\t\tantiarmor = 1.0;\n\t\tfire = 1.0;\n\t\tif (CheckInventory (\"PowerBerserk\"))\n\t\t\tchem = 2.25;\n\t\telse\n\t\t\tchem = 1.0;\n\t\tlaser = 1.0;\n\t}\n\n\tfor (int i = 0; i < 13; i++) {\n\t\tif (CheckInventory (ArmorNames[i])) {\n\t\t\tfist = FixedMul (fist, ArmorValuesFist[i]);\n\t\t\tbullet = FixedMul (bullet, ArmorValuesBullet[i]);\n\t\t\texplo = FixedMul (explo, ArmorValuesExplo[i]);\n\t\t\tantiarmor = FixedMul (antiarmor, ArmorValuesAntiArmor[i]);\n\t\t\tfire = FixedMul (fire, ArmorValuesFire[i]);\n\t\t\tchem = FixedMul (chem, ArmorValuesChem[i]);\n\t\t\tlaser = FixedMul (laser, ArmorValuesLaser[i]);\n\t\t}\n\t}\n\n\tLog (s:\"CURRENT DAMAGE FACTORS: \\cj\", f:fist,\n\t s:\" \\cu\", f:bullet,\n\t s:\" \\cg\", f:fire,\n\t s:\" \\cd\", f:chem,\n\t s:\" \\cn\", f:laser,\n\t s:\" \\cf\", f:explo,\n\t s:\" \\ci\", f:antiarmor);\n}\n\nscript 920 (int modtype) {\n\tGiveInventory (\"IsChangingArmor\", 1);\n\tACS_ExecuteAlways (922, 0, modtype);\n\n\tint n = 5;\n\n\twhile (n > 0) {\n\t\tif (GetHealth() <= 0) terminate;\n\t\tdelay (35);\n\t\tn--;\n\t}\n\n\tTakeInventory (\"IsChangingArmor\", 1);\n\tActivatorSound (\"misc/armor_pkup\", 127);\n\tSetArmorGrade (NOCHANGE, modtype);\n}\n\nscript 922 (int modtype) CLIENTSIDE {\n\tif (PlayerNumber() != ConsolePlayer) terminate;\n\n\tTakeInventory (\"ArmorChangeProgress\", 175);\n\n\tint n = 175;\n\twhile (n > 0) {\n\t\tif (GetHealth() <= 0) terminate;\n\t\tGiveInventory (\"ArmorChangeProgress\", 1);\n\t\tdelay (1);\n\t\tn--;\n\t}\n\n\tTakeInventory (\"ArmorChangeProgress\", 175);\n}"
},
{
"source": "pk3",
"name": "acs_source/a_basehud.txt",
"contents": "// BUILDING HUD CODE\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * [Dusk] This script has been vastly changed, no longer does it govern\n * building healths but instead updates the speed properties of terminals\n * and yells at clients to update when needed. The old system was just\n * redundancy galore.\n *\n * It could be improved even further to not use copy/paste code but that's\n * something for a later date...\n */\n\nscript 930 (int what, int team) {\n\tint LastHealth, perc;\n\tint tid, maxhp, exists;\n\tint u = false;\n\tint a = (what == BUILDING_ALL);\n\n\tif (what == BUILDING_BARRACKS || a) {\n\t\ttid = TID_BARRACKS_BLUE + team*100;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_BARRACKS + GotBarracks[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_REFINERY || a) {\n\t\ttid = TID_REFINERY_BLUE + team*100;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_REFINERY + GotRefinery[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_RESCENTRE || a) {\n\t\ttid = TID_RESCENTRE_BLUE + team*100;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_PLANT + GotPlant[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_FACTORY || a) {\n\t\ttid = TID_FACTORY_BLUE + team*100;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_FACTORY + GotFactory[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_REPAIR || a) {\n\t\ttid = TID_REPAIR_BLUE + team*100;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_REPAIR + GotRepair[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_OBELISK || a) {\n\t\ttid = TID_OBELISK_BLUE + team*100;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_OBELISK + GotObelisk[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_MINIREF || a) {\n\t\ttid = TID_MINIREF_BLUE - team;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_MINIREF + MiniRefinery[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_HEALTHREGEN || a) {\n\t\ttid = TID_HEALTHREGEN_BLUE - team;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_REGENS + GlobalMedic[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_AMMOREGEN || a) {\n\t\ttid = TID_AMMOREGEN_BLUE - team;\n\t\tLastHealth = GetActorSpeed (tid);\n\t\tperc = GetActorHealth (tid) * 99 / HP_REGENS + GlobalAmmo[1-team];\n\t\tif (perc < 0) perc = 0;\n\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t}\n\n\tif (what == BUILDING_PORTAL || a) {\n\t\t// [Dusk] we can't tell from the building index which\n\t\t// portal end is changing. Update both.\n\t\tfor (int i = 0; i <= 1; i++) {\n\t\t\tint idx = i + 2*team;\n\n\t\t\ttid = TID_PORTAL_BLUE1 + idx;\n\t\t\tLastHealth = GetActorSpeed (tid);\n\t\t\tperc = GetActorHealth (tid) * 99 / HP_PORTAL + Portals[idx];\n\t\t\tif (perc < 0) perc = 0;\n\t\t\tif (perc != LastHealth) {SetActorSpeed (tid, perc); u = true;}\n\t\t}\n\t}\n\n\tif (u) ACS_ExecuteAlways (931, 0); // tell clients to update the hud\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * This part of the code actually causes the HUD to show up. As clients are\n * not aware of mobjs' healths, the above script sets the speed properties to\n * desired percentage values - these are used instead.\n *\n * Script 945 is a daemon script executed by the client-side script 943 - see\n * a_clientfx.acs for these scripts. Script 931 is called by the server to\n * tell clients to update the HUD. This way, updates to the hud are instant.\n */\n\nscript 931 (void) NET CLIENTSIDE BaseHUDUpdate = 1;\nscript 945 (void) NET CLIENTSIDE {\n\tdelay (5);\n\n\t// for the first three seconds, update the hud every second\n\t// the speed information of terminals doesn't travel instantly...\n\tDisplayBuildingHud ();\n\tfor (int i = 0; i <= 2; i++) {\n\t\tdelay (35);\n\t\tDisplayBuildingHud ();\n\t}\n\n\t// begin idle loop. whenever we are told to update\n\t// the hud, do so.\n\twhile (1) {\n\t\tif (BaseHudUpdate) {\n\t\t\tDisplayBuildingHud ();\n\t\t\tBaseHudUpdate = false;\n\t\t}\n\t\tdelay (1);\n\t}\n\trestart;\n}\n\nfunction void DisplayBuildingHud (void) {\n\tSetFont (\"SMALLFONT\");\n\tHudMessageBold (s:ExistsBuilding (101), s:\"Barracks\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (101)), d:GetActorSpeed (101), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (103), s:\"Refinery\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (103)), d:GetActorSpeed (103), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (105), s:\"Research Centre\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (105)), d:GetActorSpeed (105), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (107), s:\"War Factory\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (107)), d:GetActorSpeed (107), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (114), s:\"Obelisk of Light\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (114)), d:GetActorSpeed (114), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen (109), s:\"++\", s:ExistsBuilding (109), s:\"Repair Facility\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (109)), d:GetActorSpeed (109), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen (903), s:\"++\", s:ExistsBuilding (903), s:\"HP Regen\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (903)), d:GetActorSpeed (903), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen (905), s:\"++\", s:ExistsBuilding (905), s:\"Ammo Regen\\cc: \",\n\t\ts:ColorCodeHealth (GetActorSpeed (905)), d:GetActorSpeed (905), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen(901), s:\"++\", s:ExistsBuilding (901), s:\"Mini Refinery\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (901)), d:GetActorSpeed (901), s:\"\\cc%\\n\",\n\t\ts:PortalLinkColor (TEAM_BLUE, 0), s:\"++\", s:PortalLinkColor (TEAM_BLUE, 1), s:\"Portal\\cc: \",\n\t\ts:ColorCodeHealth(PortalHealth (TID_PORTAL_BLUE1)), d:PortalHealth (TID_PORTAL_BLUE1), s:\"\\cc% / \",\n\t\ts:ColorCodeHealth(PortalHealth (TID_PORTAL_BLUE2)), d:PortalHealth (TID_PORTAL_BLUE2), s:\"\\cc%\";\n\t\tHUDMSG_PLAIN, 8850, CR_BLUE, 0.012, 0.52, 0.0);\n\n\tHudMessageBold (s:ExistsBuilding (201), s:\"Barracks\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (201)), d:GetActorSpeed (201), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (203), s:\"Refinery\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (203)), d:GetActorSpeed (203), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (205), s:\"Research Centre\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (205)), d:GetActorSpeed (205), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (207), s:\"War Factory\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (207)), d:GetActorSpeed (207), s:\"\\cc%\\n\",\n\t\ts:ExistsBuilding (214), s:\"Obelisk of Light\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (214)), d:GetActorSpeed (214), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen (209), s:\"++\", s:ExistsBuilding (209), s:\"Repair Facility\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (209)), d:GetActorSpeed (209), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen (902), s:\"++\", s:ExistsBuilding (902), s:\"HP Regen\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (902)), d:GetActorSpeed (902), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen (904), s:\"++\", s:ExistsBuilding (904), s:\"Ammo Regen\\cc: \",\n\t\ts:ColorCodeHealth (GetActorSpeed (904)), d:GetActorSpeed (904), s:\"\\cc%\\n\",\n\t\ts:ExistsBuildingGreen(900), s:\"++\", s:ExistsBuilding (900), s:\"Mini Refinery\\cc: \",\n\t\ts:ColorCodeHealth(GetActorSpeed (900)), d:GetActorSpeed (900), s:\"\\cc%\\n\",\n\t\ts:PortalLinkColor (TEAM_RED, 0), s:\"++\", s:PortalLinkColor (TEAM_RED, 1), s:\"Portal\\cc: \",\n\t\ts:ColorCodeHealth(PortalHealth (TID_PORTAL_RED1)), d:PortalHealth (TID_PORTAL_RED1), s:\"\\cc% / \",\n\t\ts:ColorCodeHealth(PortalHealth (TID_PORTAL_RED2)), d:PortalHealth (TID_PORTAL_RED2), s:\"\\cc%\";\n\t\tHUDMSG_PLAIN, 8851, CR_RED, 0.012, 0.74, 0.0);\n\n\tint bluelives = GetActorSpeed (TID_TICKETCOUNTER_BLUE);\n\tint redlives = GetActorSpeed (TID_TICKETCOUNTER_RED);\n\tif (GetCVar (\"aow_forcelivehud\") || bluelives || redlives) {\n\t\tint startlives = GetActorAngle (TID_TICKETCOUNTER_BLUE);\n\t\tSetFont (\"SMALLFONT\");\n\t\tHudMessageBold (\n\t\t\ts:\"\\cHLives\\cC: \", s:FractionColor (bluelives, startlives), d:bluelives,\n\t\t\ts:\"\\n\\cGLives\\cC: \", s:FractionColor (redlives, startlives), d:redlives;\n\t\t\tHUDMSG_PLAIN, 8852, CR_BLUE, 0.012, 0.4, 0.0);\n\t}\n}\n\nfunction int PortalHealth (int t) {\n\tif (!ThingCount (T_NONE, t)) return 0;\n\tint s = GetActorSpeed (t);\n\tif (s < 0) return 0;\n\treturn s;\n}\n\nfunction str PortalLinkColor (int team, int teamcolor) {\n\tint t1 = TID_PORTAL_BLUE1 + 2*team;\n\tint t2 = TID_PORTAL_BLUE2 + 2*team;\n\tint exists = ThingCount (T_NONE, t1) && ThingCount (T_NONE, t2);\n\tif (exists) {\n\t\tif (!teamcolor) return \"\\cD\";\n\t\tif (team == TEAM_BLUE) return \"\\cH\";\n\t\treturn \"\\cG\";\n\t}\n\treturn \"\\cM\";\n}\n\nfunction str ColorCodeHealth(int Percentage)\n{\n\tif (Percentage == 100) // 100%\n\t\treturn \"\\cq\";\n\telse if (Percentage > 75) // healthy\n\t\treturn \"\\cd\";\n\telse if (Percentage > 50) // moderate\n\t\treturn \"\\cf\";\n\telse if (Percentage > 25) // low\n\t\treturn \"\\ci\";\n\telse if (Percentage > 0) // critical\n\t\treturn \"\\cr\";\n\treturn \"\\cm\"; //destroyed\n}\n\nfunction str ExistsBuilding (int tid) {\n\tif (tid <= 199 || (tid >= 900 && tid % 2 == 1)) {\n\t\tif (GetActorSpeed (tid) > 0)\n\t\t\treturn \"\\cH\";\n\t\telse\n\t\t\treturn \"\\cM\";\n\t} else {\n\t\tif (GetActorSpeed (tid) > 0)\n\t\t\treturn \"\\cG\";\n\t\telse\n\t\t\treturn \"\\cM\";\n\t}\n\n\treturn \"\\cU\";\n}\n\nfunction str ExistsBuildingGreen (int tid) {\n\tif (GetActorSpeed (tid) > 0)\n\t\treturn \"\\cD\";\n\treturn \"\\cM\";\n}"
},
{
"source": "pk3",
"name": "acs_source/a_bases.txt",
"contents": "//---------------------------BLUE BARRACKS DEATH\nscript 101 (VOID)\n{\n\tThing_Destroy(100,0);\n\tThing_Destroy(101,0);\n\tACS_ExecuteAlways(99, 0, TEAM_BLUE);\n\tGotBarracks[1] = False;\n\tBaseLeft[1]--;\n\tSetLineTexture(1,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tSetLineTexture(3,SIDE_FRONT,TEXTURE_MIDDLE,\"MCT3\");\n\tReddenSector (1);\n\tReddenSector (2);\n\n\tSetFont(\"BIGFONT\");\n\tHudMessageBold(s:\"The \\chBlue Barracks\\cd has been destroyed!!\"; HUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Blue Barracks.\");\n\tAwardBuildingDestruction (TEAM_RED, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_BARRACKS, TEAM_BLUE);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_BARRACKS, TEAM_BLUE);\n}\n\n//---------------------------BLUE REFINERY DEATH\nscript 102 (VOID)\n{\n\tThing_Destroy(102,0);\n\tThing_Destroy(103,0);\n\tACS_ExecuteAlways(99, 0, TEAM_BLUE);\n\tGotRefinery[1] = False;\n\tBaseLeft[1]--;\n\tSetLineTexture(5,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tReddenSector (5);\n\n\tSetFont(\"BIGFONT\");\n\n\tHudMessageBold(s:\"The \\chBlue Refinery\\cd has been destroyed!!\"; HUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Blue Refinery.\");\n\tAwardBuildingDestruction (TEAM_RED, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_REFINERY, TEAM_BLUE);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_REFINERY, TEAM_BLUE);\n}\n\n//---------------------------BLUE POWERPLANT DEATH\nscript 103 (void) {\n\tThing_Destroy(104,0);\n\tThing_Remove(104);\n\tThing_Destroy(105,0);\n\tACS_ExecuteAlways(99, 0, TEAM_BLUE);\n\tGotPlant[1] = False;\n\tBaseLeft[1]--;\n\tSetLineTexture(7,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tSetLineTexture(3,SIDE_FRONT,TEXTURE_MIDDLE,\"MCT3\");\n\tReddenSector (7);\n\tReddenSector (2);\n\n\tSetFont(\"BIGFONT\");\n\n\tHudMessageBold(s:\"The \\chBLUE Research Centre\\cd has been destroyed!!\";\n\t\tHUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Blue Research Centre.\");\n\tAwardBuildingDestruction (TEAM_RED, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_RESCENTRE, TEAM_BLUE);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_PLANT, TEAM_BLUE);\n}\n\n//---------------------------BLUE WAR FACTORY DEATH\nscript 104 (VOID)\n{\n\tThing_Destroy(106,0);\n\tThing_Destroy(107,0);\n\tACS_ExecuteAlways(99, 0, TEAM_BLUE);\n\tGotFactory[1] = False;\n\tBaseLeft[1]--;\n\tSetLineTexture(9,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tReddenSector (9);\n\tReddenSector (10);\n\n\tSetFont(\"BIGFONT\");\n\n\tHudMessageBold(s:\"The \\chBlue WarFactory\\cd has been destroyed!!\"; HUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Blue War Factory.\");\n\tAwardBuildingDestruction (TEAM_RED, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_FACTORY, TEAM_BLUE);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_FACTORY, TEAM_BLUE);\n}\n\n//---------------------------BLUE REPAIR FACILITY DEATH\nscript 105 (VOID)\n{\n\t//Thing_Remove(109);\n\tBaseHUDUpdate = 1;\n\tGotRepair[1] = False;\n\tReddenSector (13);\n\tReddenSector (14);\n\tSetActorProperty(109,APROP_Health,0);\n\n\t// SetFont(\"BIGFONT\");\n\t// HudMessageBold(s:\"The \\chBlue Repair Facility\\cd has been destroyed!!\";\n\t// \tHUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_REPAIR, TEAM_BLUE);\n\tSetFont (\"SMALLFONT\");\n\tHudMessageBold (n:0, s:\"\\cJ has destroyed\\cJ\\nthe \\cNBlue \\cFRepair Facility!\";\n\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Blue Repair Facility.\");\n\tACS_ExecuteAlways (930, 0, BUILDING_REPAIR, TEAM_BLUE);\n\tAwardBuildingDestruction (TEAM_RED, true);\n}\n\n//---------------------------BLUE OBELISK DEATH\nscript 114 (VOID)\n{\n\tThing_Destroy(114,0);\n\tThing_Destroy(115,0);\n\tACS_ExecuteAlways(99, 0, TEAM_BLUE);\n\tGotObelisk[1] = False;\n\tBaseLeft[1]--;\n\tReddenSector (19);\n\tSetLineTexture(11,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\n\tSetFont(\"BIGFONT\");\n\n\tHudMessageBold(s:\"The \\chBlue Obelisk\\cd has been destroyed!!\"; HUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Blue Obelisk.\");\n\tAwardBuildingDestruction (TEAM_RED, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_OBELISK, TEAM_BLUE);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_OBELISK, TEAM_BLUE);\n}\n\n//---------------------------RED BARRACKS DEATH\nscript 201 (VOID)\n{\n\tThing_Destroy(200,0);\n\tThing_Destroy(201,0);\n\tACS_ExecuteAlways (99, 0, TEAM_RED);\n\n\tGotBarracks[0] = False;\n\tBaseLeft[0]--;\n\n\tSetLineTexture(2,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tSetLineTexture(4,SIDE_FRONT,TEXTURE_MIDDLE,\"MCT3\");\n\n\tReddenSector (3);\n\tReddenSector (4);\n\n\tSetFont(\"BIGFONT\");\n\tHudMessageBold(s:\"The \\cgRED Barracks\\cd has been destroyed!!\"; HUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Red Barracks.\");\n\tAwardBuildingDestruction (TEAM_BLUE, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_BARRACKS, TEAM_RED);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_BARRACKS, TEAM_RED);\n}\n\n//---------------------------RED REFINERY DEATH\nscript 202 (VOID)\n{\n\tThing_Destroy(202,0);\n\tThing_Destroy(203,0);\n\tACS_ExecuteAlways(99, 0, TEAM_RED);\n\tGotRefinery[0] = False;\n\tBaseLeft[0]--;\n\tSetLineTexture(6,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tReddenSector (6);\n\n\tSetFont(\"BIGFONT\");\n\n\tHudMessageBold(s:\"The \\cgRed Refinery\\cd has been destroyed!!\"; HUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Red Refinery.\");\n\tAwardBuildingDestruction (TEAM_BLUE, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_REFINERY, TEAM_RED);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_REFINERY, TEAM_RED);\n}\n\n//---------------------------RED POWERPLANT DEATH\nscript 203 (VOID)\n{\n\tThing_Destroy(204,0);\n\tThing_Destroy(205,0);\n\tACS_ExecuteAlways(99, 0, TEAM_RED);\n\tGotPlant[0] = False;\n\tBaseLeft[0]--;\n\tSetLineTexture(8,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tSetLineTexture(4,SIDE_FRONT,TEXTURE_MIDDLE,\"MCT3\");\n\tReddenSector (8);\n\tReddenSector (4);\n\n\tSetFont(\"BIGFONT\");\n\tHudMessageBold(s:\"The \\cgRED Research Centre\\cd has been destroyed!!\";\n\t\tHUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Red Research Centre.\");\n\tAwardBuildingDestruction (TEAM_BLUE, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_RESCENTRE, TEAM_RED);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_PLANT, TEAM_RED);\n}\n\n//---------------------------RED WAR FACTORY DEATH\nscript 204 (VOID)\n{\n\tThing_Destroy(206,0);\n\tThing_Destroy(207,0);\n\tACS_ExecuteAlways(99, 0, TEAM_RED);\n\tGotFactory[0] = False;\n\tBaseLeft[0]--;\n\tSetLineTexture(10,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\tReddenSector (11);\n\tReddenSector (12);\n\tACS_ExecuteAlways (930, 0, BUILDING_FACTORY, TEAM_RED);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_FACTORY, TEAM_RED);\n\n\tSetFont(\"BIGFONT\");\n\n\tHudMessageBold(s:\"The \\cgRed War Factory\\cd has been destroyed!!\";\n\t\tHUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Red War Factory.\");\n\tAwardBuildingDestruction (TEAM_BLUE, false);\n}\n\n//---------------------------RED REPAIR FACILITY DEATH\nscript 205 (VOID) {\n\tBaseHUDUpdate = 1;\n\tGotRepair[0] = False;\n\tReddenSector (15);\n\tReddenSector (16);\n\tSetActorProperty(209,APROP_Health,0);\n\n\t/*SetFont(\"BIGFONT\");\n\tHudMessageBold(s:\"The \\cgRed Repair Facility\\cd has been destroyed!!\";\n\t\tHUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);*/\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_REPAIR, TEAM_RED);\n\tACS_ExecuteAlways (930, 0, BUILDING_REPAIR, TEAM_RED);\n\tSetFont (\"SMALLFONT\");\n\tHudMessageBold (n:0, s:\"\\cJ has destroyed\\cJ\\nthe \\cARed \\cFRepair Facility!\";\n\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Red Repair Facility.\");\n\tAwardBuildingDestruction (TEAM_BLUE, true);\n}\n\n//---------------------------RED OBELISK DEATH\nscript 214 (VOID)\n{\n\tThing_Destroy(214,0);\n\tThing_Destroy(215,0);\n\tACS_ExecuteAlways(99, 0, TEAM_RED);\n\tGotObelisk[0] = False;\n\tBaseLeft[0]--;\n\tReddenSector (20);\n\tSetLineTexture(12,SIDE_FRONT,TEXTURE_BOTTOM,\"MCT2\");\n\n\tSetFont(\"BIGFONT\");\n\n\tHudMessageBold(s:\"The \\cgRed Obelisk\\cd has been destroyed!!\";\n\t\tHUDMSG_FADEOUT, 0, CR_Green, 0.5, 0.7, 2.0, 1.0);\n\tLog(n:0, s:\" destroys Red Obelisk.\");\n\tAwardBuildingDestruction (TEAM_BLUE, false);\n\tACS_ExecuteAlways (930, 0, BUILDING_OBELISK, TEAM_RED);\n\tif (EventScripts) ACS_ExecuteAlways (960, 0, ACTION_DESTROY_OBELISK, TEAM_RED);\n}\n\nscript 97 (int Structure, int Team) CLIENTSIDE {\n\t// stfu during degeneration\n\tif (SuddenDeath && GetCVar (\"aow_degeneration\")) terminate;\n\n\tif ( Timer() > LastAttackMessage+35*15 ) {\n\t\tif(Structure == 1 && Team == 0)\n\t\t\tAmbientSound(\"red/barracks\",255);\n\t\tif(Structure == 2 && Team == 0)\n\t\t\tAmbientSound(\"red/refinery\",255);\n\t\tif(Structure == 3 && Team == 0)\n\t\t\tAmbientSound(\"red/powerplant\",255);\n\t\tif(Structure == 4 && Team == 0)\n\t\t\tAmbientSound(\"red/factory\",255);\n\t\tif(Structure == 6 && Team == 0)\n\t\t\tAmbientSound(\"red/obelisk\",255);\n\t\tif(Structure == 1 && Team == 1)\n\t\t\tAmbientSound(\"blue/barracks\",255);\n\t\tif(Structure == 2 && Team == 1)\n\t\t\tAmbientSound(\"blue/refinery\",255);\n\t\tif(Structure == 3 && Team == 1)\n\t\t\tAmbientSound(\"blue/powerplant\",255);\n\t\tif(Structure == 4 && Team == 1)\n\t\t\tAmbientSound(\"blue/factory\",255);\n\t\tif(Structure == 6 && Team == 1)\n\t\t\tAmbientSound(\"blue/obelisk\",255);\n\t\tLastAttackMessage = Timer();\n\t}\n}\n\nscript 99 (int team) NET CLIENTSIDE {\n\tif (team == TEAM_RED) {\n\t\tAmbientSound(\"red/destroyed\",255);\n\t\tAmbientSound(\"red/destroyed\",255);\n\t} else {\n\t\tAmbientSound(\"blue/destroyed\",255);\n\t\tAmbientSound(\"blue/destroyed\",255);\n\t}\n}\n\n// btos call this to cause external damage\nscript 652 (int tid, int damage) {\n\tSetActivatorToTarget (0);\n\tThing_Damage (tid, damage, 0);\n}\n\nfunction void AwardBuildingDestruction (int team, int small) {\n\tint activator = ActivatorTID();\n\tfor (int k = 0; k <= 31; k++) {\n\t\tif (PlayerInGame(k) && GetPlayerInfo(k,PLAYERINFO_TEAM) == Team) {\n\t\t\tSetActivator(3800+k);\n\t\t\tACS_ExecuteAlways (318,0);\n\t\t\tGiveCredits (-1, 500);\n\t\t}\n\t}\n\n\t// restore activator for point awarding\n\tSetActivator (activator);\n\n\t// no latent functions in functions\n\tACS_ExecuteAlways (653, 0, team, small);\n}\n\nscript 653 (int team, int small) {\n\tif (BaseLeft [team] <= 0) {\n\t\tGameOver = true;\n\t\tConsoleCommand (\"pointlimit 1\");\n\t\tdelay (5);\n\t}\n\n\tint d = 0;\n\tint points;\n\n\t// Count difference, but don't let it be negative.\n\t// Give static 40 on minor structure deaths\n\tif (!small) {\n\t\tint ratio;\n\t\tif (BaseLeft[team])\n\t\t\tratio = (BaseLeft[1-team] << 16) / BaseLeft[team];\n\t\telse\n\t\t\tratio = 1.0;\n\n\t\tif (team == TEAM_RED)\n\t\t\td = BlueScore () - RedScore ();\n\t\telse\n\t\t\td = RedScore () - BlueScore ();\n\n\t\tif (d < 0)\n\t\t\tpoints = 0;\n\t\telse\n\t\t\tpoints = (ratio * (d+GetCVAR (\"aow_buildingpoints\"))) >> 16;\n\t} else {\n\t\tpoints = 40;\n\t}\n\n\tTeam_GivePoints (team, points, false);\n}"
},
{
"source": "pk3",
"name": "acs_source/a_botmarines.txt",
"contents": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * All Out War 2 AI marine scripts\n * Credit to VoltlocK for originally creating the engine\n * With modifications by Eruanna, Dusk and the Omega Team\n *\n * You may use portions of this script in your project as long as you give\n * credit where credit is due. Please don't be lame and just copy-paste any\n * of this and call it your own. Thanks!\n */\n\n/* Get a free slot ID. Make sure you actually spawn one marine with the tid\n * (and ONLY one) when you do this! Marines will, however, call this by\n * themselves if you do not do so beforehand.\n */\nfunction int AI_RequestID (void) {\n\tint tid;\n\tint i = 0;\n\twhile (Bots[i] && i < MAX_MARINES)\n\t\ti++;\n\n\tif (i >= MAX_MARINES) {\n\t\tLog (s:\"AI_RequestID: Too many AI marines!\");\n\t\treturn -1;\n\t}\n\n\tAIMarineCount++;\n\tBots[i] = true;\n\treturn i;\n}\n\nfunction bool AI_ClearMarine (int i) {\n\tif (!Bots[i]) {\n\t\tLog (s:\"AI_ClearMarine: Marine \", d:i, s:\" doesn't exist.\");\n\t\treturn false;\n\t}\n\n\tAIMarineCount--;\n\tBots[i] = false;\n\n\t// death script calls this as well\n\tif (GetActorHealth (TID_MARINE + i) > 0)\n\t\tSetActorState (TID_MARINE + i, \"Dismiss\");\n\n\t// clear the TID\n\tThing_ChangeTID (TID_MARINE + i, 0);\n\treturn true;\n}\n\n// What team is a marine on?\nfunction int AI_GetTeam (int i) {\n\tif (!Bots[i]) {\n\t\tLog (s:\"AI_GetTeam: Tried to get the team of non-existant marine #\", d:i, s:\"!\");\n\t\treturn -1;\n\t}\n\n\treturn CheckActorInventory (TID_MARINE + i, \"IsRed\");\n}\n\n// Was the marine spawned by compensation?\nfunction int AI_IsCompensation (int i) {\n\tif (!Bots[i]) {\n\t\tLog (s:\"AI_GetCompensation: Tried to get the compensation status of non-existant marine #\", d:i, s:\"!\");\n\t\treturn -1;\n\t}\n\n\treturn CheckActorInventory (TID_MARINE + i, \"IsCompensationMarine\");\n}\n\n// Init a marine\nscript SC_MARINE_INIT (void) {\n\tGiveInventory (\"IsAIMarine\", 1);\n\n\t// if we haven't got an ID already, get one\n\tif (ActivatorTID() == 0) {\n\t\tint i = AI_RequestID ();\n\t\tif (i != -1)\n\t\t\tThing_ChangeTID (0, TID_MARINE + i);\n\t\telse\n\t\t\tThing_Remove (0); // oh gn0 we hit the limit!\n\t}\n\n\tSetThingSpecial (0, ACS_ExecuteAlways, SC_MARINE_DEATH, 0, ActivatorTID()-TID_MARINE);\n}\n\n// ==== TEAM UNBALANCE COMPENSATION\n// [Dusk] There are clearly unbalanced teams, and the game has already started. Even despite\n// we try balance teams via the switcher, surplus remains. Therefore, the weaker team is\n// put on on compensation and give them AI marines. We keep doing this until teams are\n// balanced out.\nfunction void AI_ManageCompensation (void) {\n\tif (Timer() <= 5*30*35 || GetCVar (\"aow_nocompensation\")) return;\n\tint n;\n\n\t// recalculate AI marine needs\n\tif (RedCount() > BlueCount() + 1 + (RedCount() > 7) && BlueCount() != 0)\n\t\tAIMarines[TEAM_BLUE] = RedCount() - (BlueCount() + 1 + (RedCount() > 7));\n\telse if (AIMarines[TEAM_BLUE] > 0)\n\t\tAIMarines[TEAM_BLUE] = 0;\n\n\tif (BlueCount() > RedCount() + 1 + (BlueCount() > 7) && RedCount() != 0)\n\t\tAIMarines[TEAM_RED] = BlueCount() - RedCount() + 1 + (BlueCount() > 7);\n\telse if (AIMarines[TEAM_RED] > 0)\n\t\tAIMarines[TEAM_RED] = 0;\n\n\t// make sure teams have the right amount of marines\n\tACS_ExecuteAlways (SC_MARINE_COMPENSATION, 0, TEAM_BLUE);\n\tACS_ExecuteAlways (SC_MARINE_COMPENSATION, 0, TEAM_RED);\n}\n\nscript SC_MARINE_COMPENSATION (int team) {\n\tint AICount;\n\tint AISpawner;\n\tint spottid;\n\n\tfor (int i = 0; i < MAX_MARINES; i++) {\n\t\tif (!Bots[i]) continue;\n\t\tif (AI_GetTeam (i) == team && AI_IsCompensation (i)) AICount++;\n\t}\n\n\tif (team == TEAM_BLUE)\n\t\tspottid = TID_REPAIR_BLUE;\n\telse\n\t\tspottid = TID_REPAIR_RED;\n\n\tint delta = AICount - AIMarines[team];\n\ti = 0;\n\tif (delta == 0)\n\t\tterminate;\n\telse if (delta > 0) {\n\t\t// Too many marines - send one of them home\n\t\tlog (s:\"Compensation: Removing \", d:delta, s:\" marines from \", s:TeamNames[team], s:\".\");\n\t\twhile (i < MAX_MARINES && delta > 0) {\n\t\t\tif (!Bots[i]) {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (AI_IsCompensation (i) && AI_GetTeam (i) == team) {\n\t\t\t\t// found one!\n\t\t\t\tAI_ClearMarine (i);\n\t\t\t\tdelta--;\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\t} else {\n\t\twhile (AICount < AIMarines[team]) {\n\t\t\ti = AI_RequestID ();\n\t\t\tif (i == -1) break;\n\n\t\t\tint spawned = 0;\n\t\t\tint tries = 5;\n\t\t\tint fail = 1;\n\t\t\twhile (tries > 0 && !spawned) {\n\t\t\t\t// spawn the marine initially onto the repair facility\n\t\t\t\tspawned = SpawnSpotForced (AISpawner, spottid, TID_MARINE + i, 0);\n\t\t\t\tif (spawned) {\n\t\t\t\t\tAICount += spawned;\n\n\t\t\t\t\tdelay (1);\n\n\t\t\t\t\t// flag the marine as compensation\n\t\t\t\t\tGiveActorInventory (TID_MARINE + i, \"IsCompensationMarine\", 1);\n\n\t\t\t\t\t// move the newly-spawned bot to a random spawn in the base, but\n\t\t\t\t\t// only spawn fog at the destination. don't want teleport fogs\n\t\t\t\t\t// to randomly appear in the repair facility\n\t\t\t\t\tTeleportOther (TID_MARINE + i, team+1, false);\n\t\t\t\t\tSpawnSpotForced (\"TeleportFog\", TID_MARINE + i, 0, 0);\n\t\t\t\t} else {\n\t\t\t\t\tfail = 0;\n\t\t\t\t\ttries--;\n\t\t\t\t}\n\n\t\t\t\tdelay (35);\n\t\t\t}\n\n\t\t\t// something's seriously wrong...\n\t\t\tif (fail) {\n\t\t\t\tLog (s:\"Compensation: Couldn't spawn marines to \", s:TeamNames[team], s:\"!\");\n\t\t\t\tterminate;\n\t\t\t}\n\t\t}\n\n\t\tlog (s:\"Compensation: \", d:-delta, s:\" marines spawned for \", s:TeamNames[team], s:\".\");\n\t}\n}\n\n// AI marine bounty\nscript SC_MARINE_DEATH (int i) {\n\t// no matter what happened to the marine, the slot needs to\n\t// be cleared now that it's dead. save it's team first,\n\t// we can't get it after the slot's clear\n\tint AITeam = AI_GetTeam (i);\n\tAI_ClearMarine (i);\n\n\tif (ActivatorTID() < 3800 || ActivatorTID() > 3831) terminate;\n\tif (PlayerTeam() == AITeam) terminate;\n\tLocalAmbientSound (\"game/boink\", 127);\n\tAddExperience (50);\n\tAddCredits (Credits[PlayerNumber()+1], CreditFragAward);\n\tTakeTickets (AITeam, 1);\n\n\tTeam_GivePoints (PlayerTeam(), 2, false);\n}\n\n// Dumps known information about AI marines\nscript SC_MARINE_STATS (void) {\n\tfor (int i = 0; i < MAX_MARINES; i++) {\n\t\tif (!Bots[i]) {\n\t\t\tLog (s:\"Marine \", d:i, s:\": -\");\n\t\t\tcontinue;\n\t\t}\n\n\t\tint compensation = \"\";\n\t\tif (AI_IsCompensation (i)) {compensation = \" (compensation)\";}\n\n\t\tLog (s:\"Marine \", d:i, s:\": \", s:TeamNames[AI_GetTeam (i)], s:compensation);\n\t}\n}"
},
{
"source": "pk3",
"name": "acs_source/a_bots.txt",
"contents": "// BOT SUPPORT\nint BotClassCosts[13] = {0, 400, 200, 450, 550, 600, 550, 400, 600, 600, 1000, 650, 800};\nint BotClassNumbers[13] = {20, 22, 54, 24, 27, 33, 34, 53, 61, 35, 36, 44, 60};\nint BotClassBarDependencies[13] = {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\nint BotClassPlantDependencies[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1};\n\nscript 888 ENTER {\n\tif (!PlayerIsBot(PlayerNumber())) terminate;\n\tACS_ExecuteAlways(92,0,0,0,0);\n\tint chance = random(0,100);\n\tdelay (35);\n\n\tGiveInventory(\"PurchaseToken\",1);\n\n\tdelay (10);\n\n\tint i; int team = 1-PlayerTeam();\n\tint max = 12; int x;\n\tif (!GotPlant[Team]) max = 8;\n\tif (!GotBarracks[Team]) max = 2;\n\n\t// PrintBold (n:0, s:\"\\c-: I have \\cQ$\\cD\", d:Credits[PlayerNumber()+1]);\n\n\t// [Dusk] save some computing time - see if we can only afford an ssg\n\tif (Credits[PlayerNumber()+1] < 400) {\n\t\tif (Credits[PlayerNumber()+1] >= 200)\n\t\t\ti = 2;\n\t\telse\n\t\t\ti = 0; // if not, pick gunman\n\t} else {\n\t\twhile (x < 5) {\n\t\t\ti = random(0, max);\n\t\t\tif ((GotBarracks[Team] || !BotClassBarDependencies[i]) &&\n\t\t\t\t(GotPlant[Team] || !BotClassPlantDependencies[i]) &&\n\t\t\t\tCredits[PlayerNumber()+1] >= BotClassCosts[i])\n\t\t\t\tbreak;\n\t\t\tx++;\n\t\t}\n\n\t\t// [Dusk] can't decide? simple logic solves the problem.\n\t\tif (x == 5) {\n\t\t\tif (Credits[PlayerNumber()+1] >= 200)\n\t\t\t\ti = 2;\n\t\t\telse\n\t\t\t\ti = 0;\n\t\t}\n\t}\n\n\tACS_ExecuteAlways (BotClassNumbers[i], 0, team);\n}\n\nscript 889 RESPAWN {\n\tACS_ExecuteAlways(888, 0);\n}"
},
{
"source": "pk3",
"name": "acs_source/a_clientfx.txt",
"contents": "// Clientside effects and designation actors\nint ChemSmokers[32];\n\nscript 943 OPEN CLIENTSIDE {\n\t// [SP] This script allows clients to keep track of what player# they are\n\tConsoleCommand (\"puke 944\");\n\n\tdelay (5);\n\n\t// get outside the spawn room\n\tif (!PlayerInGame (PlayerNumber ()))\n\t\tConsoleCommand (\"puke 940\");\n\n\tdelay (5);\n\n\t// effects + hud\n\tConsoleCommand (\"puke 366\");\n\n\t// bodycount clock\n\t// ConsoleCommand (\"puke 368\");\n\n\t// building HUD\n\tConsoleCommand (\"puke 945\");\n}\n\nscript 944 (void) NET CLIENTSIDE {ConsolePlayer = PlayerNumber();}\nscript 946 (void) NET CLIENTSIDE {Log(s:\"I am player \", d:ConsolePlayer, s:\" named \", n:0);}\n\nscript 366 (void) NET CLIENTSIDE {\n\tif (PlayerIsBot(PlayerNumber())) terminate;\n\tif (ConsolePlayer == -1) terminate;\n\n\t// if (GetCVAR (\"aow_nofriendinfo\") <= 0) ConsoleCommand (\"set aow_nofriendinfo 0\");\n\n\tint teammate, i;\n\twhile (1) {\n\t\tdelay (32);\n\t\tSpawnSpotForced (\"TiberiumChemSmoke\", 402, 0, 0);\n\n\t\t// display smoke on tib-carrying players\n\t\tfor (i = 0; i <= 31; i++) {\n\t\t\tif (CheckActorInventory (3800+i, \"TiberiumCrystal\") && !ChemSmokers[i])\n\t\t\t\tACS_ExecuteAlways (355, 0, i, 0);\n\t\t}\n\n\t\t// see friendly stealths\n\t\tfor (i = 0; i <= 31; i++) {\n\t\t\tteammate = GetPlayerInfo (i, PLAYERINFO_TEAM) == GetPlayerInfo (ConsolePlayer, PLAYERINFO_TEAM);\n\t\t\tif (!PlayerInGame (ConsolePlayer)) teammate = 1; // spects\n\t\t\tif (CheckActorProperty (3800+i, APROP_RenderStyle, STYLE_None) && teammate && i != ConsolePlayer)\n\t\t\t\tACS_ExecuteAlways (355, 0, i, 1);\n\t\t}\n\n\t\t// jumpjet fire\n\t\tfor (i = 0; i <= 31; i++) {\n\t\t\tif (CheckActorInventory (3800+i, \"JumpjetSwitch\") && !ChemSmokers[i])\n\t\t\t\tACS_ExecuteAlways (355, 0, i, 2);\n\t\t}\n\t}\n}\n\nscript 355 (int i, int what) CLIENTSIDE {\n\tint x;\n\tswitch (what) {\n\tcase 0:\n\t\t// chem smoke for tiberium players\n\n\t\t// no double running\n\t\tif (ChemSmokers[i]) terminate;\n\t\tChemSmokers[i] = 1;\n\n\t\tfor (x = 0; x < 5; x++) {\n\t\t\tif (!CheckActorInventory (3800+i, \"TiberiumCrystal\")) {ChemSmokers[i] = 0; terminate;}\n\t\t\tSpawnSpotForced (\"TiberiumChemSmokePlayer\", 3800+i, 0, GetActorAngle(3800+i)>>8);\n\t\t\tdelay (6);\n\t\t}\n\t\tChemSmokers[i] = 0;\n\t\tbreak;\n\tcase 1:\n\t\t// visible friendly stealths\n\t\tSetActorProperty (3800+i, APROP_RenderStyle, STYLE_Translucent);\n\t\tSetActorProperty (3800+i, APROP_Alpha, 0.4);\n\t\tfor (x = 0; x < 6; x++) {\n\t\t\tif (!CheckActorProperty (3800+i, APROP_RenderStyle, STYLE_Translucent)) terminate;\n\t\t\tif (CheckActorInventory (3800+i, \"StealthMode\") != 1) terminate;\n\t\t\tSetActorProperty (3800+i, APROP_Alpha, 0.4 + (random(0,10) << 16)/10); // flicker a bit :P\n\t\t\tdelay (5);\n\t\t}\n\t\tSetActorProperty (3800+i, APROP_RenderStyle, STYLE_None);\n\t\tSetActorProperty (3800+i, APROP_Alpha, 0.0);\n\t\tbreak;\n\tcase 2:\n\t\t// jumpjet fire\n\t\t// ChemSmokers[] is used here as well - no conflicts can happen since no\n\t\t// player can be harvester and have jumpjet at the same time.\n\t\tif (ChemSmokers[i]) terminate;\n\t\tChemSmokers[i] = 1;\n\n\t\tfor (x = 0; x < 10; x++) {\n\t\t\tif (!CheckActorInventory (3800+i, \"JumpjetSwitch\")) {ChemSmokers[i] = 0; terminate;}\n\t\t\tSpawnSpotForced (\"JumpjetFire\", 3800+i, 0, GetActorAngle(3800+i)>>8);\n\t\t\tdelay (3);\n\t\t}\n\t\tChemSmokers[i] = 0;\n\t\tbreak;\n\t}\n}\n\nscript 400 OPEN CLIENTSIDE {\n\twhile (1) {\n\t\tif (!GetCVAR (\"hud_scale\"))\n\t\t\tConsoleCommand(\"set hud_scale true\");\n\t\tdelay(1);\n\t}\n}"
},
{
"source": "pk3",
"name": "acs_source/a_clssc.txt",
"contents": "// All Out War 2 Class purchase scripts\n// Credit to VoltlocK for originally creating the engine\n// With modifications by Eruanna, Dusk and the Omega Team\n\n// You may use portions of this script in your project as long as you give credit where credit is\n// due. Please don't be lame and just copy-paste any of this and call it your own. Thanks!\n\n//---------------------------GUNMAN\nscript 20 (int Team) {\n\tint cost = 0; int speed = 1.0;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS01\", cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tDisplayTick();\n\tSpendCredits(Credits[PlayerNumber()+1], 0);\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfgunman!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"NewClipAmmo\",160);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory (\"TimedC4\", 1);\n\tGiveInventory (\"TimedC4Count\", 1);\n\tSetFragGrenades (1);\n\tGiveInventory(\"SubMachineGun\",1);\n\tSetWeapon(\"SubMachineGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_GUNMAN);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Gunman.\");\n}\n\n//---------------------------ENGINEER\nscript 21 (int Team) {\n\tint cost = 0; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS02\", cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tDisplayTick();\n\tSpendCredits(Credits[PlayerNumber()+1], 0);\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are an \\cfEngineer!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"NewClipAmmo\",120);\n\tGiveInventory(\"Handgun\",1);\n\tSetFragGrenades (1);\n\tGiveInventory (\"EnhancedTimedC4\",1);\n\tGiveInventory (\"TimedC4\",1);\n\tGiveInventory (\"TimedC4Count\",1);\n\tGiveInventory(\"RepairGun\",1);\n\tSetWeapon(\"RepairGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_ENGINEER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Engineer.\");\n}\n\n//---------------------------MINIGUNNER\nscript 22 (int Team) {\n\tint cost = 400; int speed = 0.7;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS03\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfMinigunner!\"; HUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tSetFont (\"SMALLFONT\");\n\tHudMessage(s:\"Use \\cfAlt-Fire\\cd for \\cjAnti-Mech attack\\cd!\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.6, 3.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tSetArmorGrade (1, ARMOD_NOCHANGE);\n\tGiveInventory(\"NewClipAmmo\",90);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"SubMachineGun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tSetFragGrenades (2);\n\tGiveInventory(\"GatlingGun\",1);\n\tGiveInventory(\"MachineGunAmmo\",400);\n\tSetWeapon(\"GatlingGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_MINIGUNNER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes minigunner.\");\n}\n\n//---------------------------TECHNICIAN\nscript 23 (int Team) {\n\tint cost = 200; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS04\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfTechnician!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0, APROP_SPEED, 0.8);\n\tSetArmorGrade (1, ARMOD_NOCHANGE);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tGiveInventory(\"NewClipAmmo\",90);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"EnhancedTimedC4\",1);\n\tGiveInventory(\"TimedC4\",2);\n\tGiveInventory(\"TimedC4Count\",2);\n\tGiveInventory (\"ProxyMine\", 4);\n\tGiveInventory (\"ProxyMineCount\", 4);\n\tSetFragGrenades (2);\n\tGiveInventory(\"SubMachineGun\",1);\n\tGiveInventory(\"RepairGunUpgrade\",1);\n\tGiveInventory(\"RepairGun\",1);\n\tSetWeapon(\"RepairGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_TECHNICIAN);\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Technician.\");\n}\n\n//---------------------------FLAMER\nscript 24 (int Team) {\n\tint cost = 450; int speed = 0.7;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS05\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 450);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfFlamethrower!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (1, ARMOD_FIRE);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"NewClipAmmo\",120);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tSetFragGrenades (2);\n\tGiveInventory(\"Flamer\",1);\n\tGiveInventory(\"FlamerAmmo\",400);\n\tGiveInventory(\"PhosphorusGrenadeAmmo\",4);\n\tSetWeapon(\"Flamer\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_FLAMER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Flamethrower.\");\n}\n\n//---------------------------RIFLEMAN\nscript 25 (int Team) {\n\tint cost = 200; int speed = 0.9;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS06\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfRifleman!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (1, ARMOD_NOCHANGE);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tGiveInventory(\"NewClipAmmo\", 90);\n\tGiveInventory(\"Handgun\", 1);\n\tGiveInventory(\"TimedC4\", 1);\n\tGiveInventory(\"TimedC4Count\", 1);\n\tGiveInventory(\"FragGrenade\", 1);\n\tGiveInventory(\"FragGrenadeAmmo\", 1);\n\tACS_ExecuteAlways(91, 0);\n\tGiveInventory(\"Rifle\", 1);\n\tGiveInventory(\"RifleAmmo\", 30);\n\tGiveInventory(\"RifleGrenadeAmmo\", 4);\n\tSetWeapon(\"Rifle\");\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_RIFLEMAN);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Rifleman.\");\n}\n\n//---------------------------SUPPORT / MACHINE GUNNER\nscript 26 (int Team) {\n\tint cost = 300; int speed = 0.9;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS07\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are \\cfMachine Gunner!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (1, ARMOD_NOCHANGE);\n\tGiveInventory(\"HasClass\", 1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"NewClipAmmo\", 90);\n\tGiveInventory(\"Handgun\", 1);\n\tGiveInventory(\"SubMachineGun\", 1);\n\tGiveInventory(\"TimedC4\", 1);\n\tGiveInventory(\"TimedC4Count\", 1);\n\tGiveInventory(\"MachineGunAmmo\", 160);\n\tGiveInventory(\"FragGrenade\", 1);\n\tSetAmmoCapacity(\"FragGrenadeAmmo\", 2);\n\tGiveInventory(\"FragGrenadeAmmo\", 2);\n\tACS_ExecuteAlways(91, 0);\n\tGiveInventory(\"MachineGun\", 1);\n\tSetWeapon(\"MachineGun\");\n\n\tGiveInventory(\"SpawnInvulnerability\", 1);\n\tGiveInventory (\"ClassID\", CLASS_MACHINEGUNNER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes machine gunner.\");\n}\n\n//---------------------------GRENADIER\nscript 27 (int Team) {\n\tint cost = 550; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS08\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfGrenadier!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_EXPLO);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"Rifle\",1);\n\tGiveInventory(\"RifleAmmo\",20);\n\tGiveInventory(\"RifleGrenadeAmmo\",2);\n\tSetFragGrenades (4);\n\n\tGiveInventory(\"Grenade_Launcher\",1);\n\tGiveInventory(\"GrenadeAmmo\",40);\n\tSetWeapon(\"Grenade_Launcher\");\n\n\tACS_ExecuteAlways(91,0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_GRENADIER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Grenadier.\");\n}\n\n//---------------------------ROCKET SOLDIER\nscript 28 (int Team) {\n\tint cost = 500; int speed = 0.75;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS09\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfRocket Soldier!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_EXPLO);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"HighUpgrade\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"EnhancedTimedC4\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"Rifle\",1);\n\tGiveInventory(\"RifleAmmo\",20);\n\tGiveInventory(\"RifleGrenadeAmmo\",2);\n\tGiveInventory(\"MissileAmmo\",30);\n\tSetFragGrenades (2);\n\tGiveInventory(\"MissileLauncher\",1);\n\tSetWeapon(\"MissileLauncher\");\n\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_ROCKETEER);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Rocket Soldier.\");\n\n\tACS_ExecuteAlways (961, 0, Team);\n}\n\n//---------------------------STEALTH TROOPER\nscript 29 (int Team) {\n\tint cost = 600; int speed = 0.95;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS10\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfStealth Trooper!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Use Alt-Fire to toggle \\ccStealth.\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetArmorGrade (-1, ARMOD_NOCHANGE);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetActorProperty(0,APROP_DeathSound,\"stealth/death\");\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"LaserRifleAmmo\",200);\n\tGiveInventory(\"FragGrenade\",1);\n\tGiveInventory(\"FragGrenadeAmmo\",1);\n\tGiveInventory(\"StealthLaserRifle\",1);\n\tGiveInventory(\"Knife\",1);\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_STEALTH);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\n\t// [Dusk] workaround for stealth knife sound..\n\tdelay (1);\n\tSetWeapon(\"StealthLaserRifle\");\n\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes stealth trooper.\");\n\n\tDelay(35*6);\n\tActivatorSound(\"misc/stealth\",255);\n}\n\n//---------------------------GAUSS GUNNER\nscript 33 (int Team) {\n\tint cost = 600; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS11\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfGauss Gunner!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tSetFont (\"SMALLFONT\");\n\tHudMessage(s:\"Use \\cfAlt-Fire\\cd for \\cjAnti-Mech attack\\cd!\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.6, 3.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_LASER);\n\tGiveInventory(\"HasClass\", 1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"Rifle\",1);\n\tGiveInventory(\"RifleAmmo\",40);\n\tGiveInventory(\"RifleGrenadeAmmo\",0);\n\tGiveInventory(\"GaussRifleAmmo\",50);\n\tGiveInventory(\"FragGrenade\",1);\n\tSetAmmoCapacity(\"FragGrenadeAmmo\",2);\n\tGiveInventory(\"FragGrenadeAmmo\",2);\n\tGiveInventory(\"GaussRifle\",1);\n\tSetWeapon(\"GaussRifle\");\n\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_GAUSSGUNNER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes gauss gunner.\");\n}\n\n//---------------------------CHEM WARRIOR\nscript 34 (int Team) {\n\tint cost = 550; int speed = 0.7;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS12\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",275);\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfChem Warrior!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_CHEM);\n\tGiveInventory(\"NewClipAmmo\",90);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"SubMachineGun\",1);\n\tGiveInventory(\"ChemicalAmmo\",200);\n\tGiveInventory(\"ChemicalGrenadeAmmo\",4);\n\tGiveInventory(\"FragGrenade\",1);\n\tSetAmmoCapacity(\"FragGrenadeAmmo\",2);\n\tGiveInventory(\"FragGrenadeAmmo\",2);\n\tACS_ExecuteAlways (91,0);\n\tGiveInventory(\"ChemicalSprayer\",1);\n\tSetWeapon(\"ChemicalSprayer\");\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_CHEMWARRIOR);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Chem warrior.\");\n\tDelay(35*6);\n\tActivatorSound(\"misc/chem\",255);\n}\n\n//---------------------------SHOCK TROOPER\nscript 35 (int Team) {\n\tint cost = 600; int speed = 0.7;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!CheckPlant(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS13\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",300);\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfShock Trooper!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_LASER);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"SubMachineGun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"FragGrenade\",1);\n\tSetAmmoCapacity(\"FragGrenadeAmmo\",2);\n\tGiveInventory(\"FragGrenadeAmmo\",2);\n\tGiveInventory(\"ShockRifle\",1);\n\tGiveInventory(\"GeneporiumCharge\",400);\n\tSetWeapon(\"ShockRifle\");\n\t//Check for RANK to give awards\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_SHOCKTROOPER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Shock Trooper.\");\n\tDelay(35*6);\n\tActivatorSound(\"misc/volt\", 255);\n}\n\n//---------------------------COMMANDO\nscript 36 (int Team) {\n\tint cost = 1000; int speed = 0.85;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!CheckPlant(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS14\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are the \\cfCommando!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\tSETFONT (\"SMALLFONT\");\n\tif(Team == 0)\n\t\tHudMessageBold (s:\"\\cGWarning: \\cARed\\cJ Commando in-field!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\telse\n\t\tHudMessageBold (s:\"\\cGWarning: \\cNBlue\\cJ Commando in-field!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tGiveInventory(\"HasClass\",1);\n\n\tCheckAndRemove (\"HasArmorUpgrade\");\n\tGiveInventory (\"HighUpgrade\", 1);\n\tGiveInventory(\"IsCommando\",1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tSetArmorGrade (2, ARMOD_NOCHANGE);\n\tGiveInventory(\"NewClipAmmo\",120);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"EnhancedTimedC4\",1);\n\tGiveInventory(\"TimedC4\", 2);\n\tGiveInventory(\"TimedC4Count\", 2);\n\tGiveInventory(\"MissileLauncher\",1);\n\tGiveInventory(\"MissileAmmo\",15);\n\tGiveInventory(\"GatlingGun\",1);\n\tGiveInventory(\"MachineGunAmmo\",200);\n\tGiveInventory(\"Rifle\",1);\n\tGiveInventory(\"RifleAmmo\",20);\n\tGiveInventory(\"RifleGrenadeAmmo\",4);\n\tGiveInventory(\"GaussRifle\",1);\n\tGiveInventory(\"GaussRifleAmmo\",15);\n\tSetFragGrenades (4);\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_COMMANDO);\n\tACS_ExecuteAlways(91,0,0,0,0);\n\n\tSetWeapon(\"GaussRifle\");\n\n\tACS_ExecuteAlways (961, 0, Team);\n\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Commando.\");\n\tDelay(35*6);\n\tActivatorSound(\"misc/commando\",255);\n}\n\n//---------------------------PLASMA CANNON\nscript 37 (int Team)\n{\n\tint cost = 1500;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!CheckPlant(Team)) terminate;\n\tif (!CheckPlasmaCooldown()) terminate;\n\n\tif(CheckInventory(\"PlasmaCannon\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You already have a \\cnPlasma Cannon\\cr!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (NumPlasmaCannons[Team] >= MaxCannonsPerTeam && MaxCannonsPerTeam != -1) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"Your team already has too many of those!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (Timer() < CannonPurchaseDelay) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\t//int mins = (CannonPurchaseDelay - Timer())/(35*60);\n\t\t//int secs = 59 - (Timer()/35)%60;\n\n\t\tHudMessage(s:\"You must wait \\cF\", d:(CannonPurchaseDelay - Timer()) / 60,\n\t\t\ts:\" seconds\\nbefore you can get one of these!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (!IsSecondPress(\"WEAP01\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tLastPurchasedCannon[PlayerNumber()+1] = Timer();\n\tNumPlasmaCannons[Team]++;\n\n\tDisplayTick();\n\tSetFont (\"BIGFONT\");\n\tHudMessage(s:\"You got \\cnPlasma Cannon!\"; HUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\tSetFont (\"SMALLFONT\");\n\tif(Team == 0)\n\t\tHudMessageBold (s:\"\\cGWarning: \\cARed\\cJ player has \\cNPlasma Cannon!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\telse\n\t\tHudMessageBold (s:\"\\cGWarning: \\cNBlue\\cJ player has \\cNPlasma Cannon!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\tGiveInventory(\"PlasmaCannon\",1);\n\tGiveInventory(\"PlasmaCannonAmmo\",10);\n\tSetWeapon(\"PlasmaCannon\");\n\tLog(n:0, s:\" purchases Plasma Cannon.\");\n\tRecountPlasma();\n}\n\n//---------------------------SHOTGUNNER\nscript 38 (int Team) {\n\tint cost = 0; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS15\", cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 0);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfshotgunner!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"ShotgunAmmo\",50);\n\tSetFragGrenades (1);\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"Boomstick\",1);\n\tSetWeapon(\"Boomstick\");\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_SHOTGUNNER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Shotgunner.\");\n}\n\n//---------------------------SUICIDE BOMBER\nscript 62 (int Team) {\n\tint cost = 1750; int speed = 1.0;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS16\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\tTakeInventory(\"PurchaseToken\", 1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cFSuicide Bomber!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Use the switch to explode violently.\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\tSetFont (\"SMALLFONT\");\n\tif(Team == 0)\n\t\tHudMessageBold (s:\"\\cGWarning: \\cARed\\cJ Suicide Bomber in-field!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\telse\n\t\tHudMessageBold (s:\"\\cGWarning: \\cNBlue\\cJ Suicide Bomber in-field!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tGiveInventory(\"HasClass\", 1);\n\tGiveInventory(\"HighUpgrade\", 1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tGiveInventory(\"BombPack\",1);\n\tSetWeapon(\"BombPack\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_SUICIDEBOMBER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" goes nuts and becomes Suicide Bomber.\");\n\t// [Dusk] after two seconds, call SetWeapon() again. Lagged users with Commando\n\t// rank may not be able to get it on the first SetWeapon().\n\tdelay(35*2);\n\tSetWeapon(\"BombPack\");\n\n\tdelay(35*4);\n\tActivatorSound(\"misc/commando\",255);\n}\n\n//---------------------------SNIPER\nscript 40 (int Team) {\n\tint cost = 750; int speed = 0.675;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!CheckPlant(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS17\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\", 1);\n\tSpendCredits(Credits[PlayerNumber()+1], 750);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfSniper!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (1, ARMOD_NOCHANGE);\n\tGiveInventory(\"HasClass\", 1);\n\tGiveInventory(\"IsSniper\", 500);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"SniperAmmo\",50);\n\tSetFragGrenades (2);\n\n\t//Check for RANK to give awards\n\tACS_ExecuteAlways(91,0,0,0,0);\n\n\tGiveInventory(\"SniperRifle\",1);\n\tSetWeapon(\"SniperRifle\");\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_SNIPER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Sniper.\");\n\n\tDelay(35*6);\n\tActivatorSound(\"misc/sniper\",255);\n}\n\n//---------------------------UTILITY GUY\nscript 41 (int Team) {\n\tint cost = 650; int speed = 0.75;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS18\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\", 1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are an \\cfUtility Guy!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Use \\cFAlt-Fire\\cD for \\cNitem selection menu!\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_NOCHANGE);\n\tGiveInventory(\"HasClass\", 1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"HighUpgrade\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"EnhancedTimedC4\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"RepairGun\",1);\n\tSetFragGrenades (2);\n\tGiveInventory(\"UtilityGun\", 1);\n\tGiveInventory(\"Utility_Ammo\", 75);\n\n\t//Check for RANK to give awards\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_UTILITYGUY);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Utility Guy.\");\n\n\tdelay (35);\n\tSetWeapon(\"UtilityGun\");\n}\n\n//---------------------------DEMO EXPERT\nscript 42 (int Team) {\n\tint cost = 550; int speed = 0.75;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS19\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\", 1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfDemolitions Expert!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetArmorGrade (2, ARMOD_EXPLO);\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tGiveInventory(\"HighUpgrade\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"HasClass\", 1);\n\tGiveInventory(\"Refunds\", 275);\n\tGiveInventory (\"EnhancedTimedC4\", 1);\n\tGiveInventory (\"TimedC4\", 4);\n\tGiveInventory (\"TimedC4Count\", 4);\n\tGiveInventory (\"ProxyMine\", 6);\n\tGiveInventory (\"ProxyMineCount\", 6);\n\tGiveInventory (\"RemoteC4\", 1);\n\tGiveInventory (\"RemoteC4Ammo\", 5);\n\tGiveInventory(\"Boomstick\",1);\n\tGiveInventory(\"ShotgunAmmo\",50);\n\tSetFragGrenades (4);\n\tGiveInventory(\"BombSquadGun\",1);\n\tSetWeapon(\"BombSquadGun\");\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_DEMOEXPERT);\n\n\t//Check for RANK to give awards\n\tACS_ExecuteAlways(91, 0);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Demo Expert.\");\n}\n\n// FIELD MEDIC\nscript 43 (int Team) {\n\tint cost = 300; int speed = 0.85;\n\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS20\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfField Medic!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Your regeneration will be carried to mechs.\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_CHEM);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory (\"ClassID\", CLASS_MEDIC);\n\tGiveInventory(\"Refunds\", cost/2);\n\tGiveInventory(\"IsMedic\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory (\"HealingRadiusItem\", 1);\n\tGiveInventory (\"HealingRadiusCount\", 1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"Boomstick\",1);\n\tGiveInventory(\"ShotgunAmmo\",50);\n\tSetFragGrenades (2);\n\tACS_ExecuteAlways(91, 0);\n\tGiveInventory(\"HealGun\",1);\n\tSetWeapon(\"HealGun\");\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\t// Medic regeneration\n\tACS_ExecuteAlways(352, 0);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Medic.\");\n}\n\n//---------------------------LASER CHAINGUNNER\nscript 44 (int Team) {\n\tint cost = 650; int speed = 0.75;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!CheckPlant(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS21\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfLaser Chaingunner!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_LASER);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tGiveInventory(\"HighUpgrade\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tSetFragGrenades (2);\n\tGiveInventory(\"LaserChaingun\",1);\n\tGiveInventory(\"LaserChaingunAmmo\",400);\n\tSetWeapon(\"LaserChaingun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_LASERCHAINGUNNER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Laser Chaingunner.\");\n}\n\n//---------------------------T-E 21cal RIFLE\nscript 49 (int Team)\n{\n\tint cost = 300;\n\tif (MitigateDoublePress()) terminate;\n\n\tif (CheckInventory(\"TiberiumAutorifleWeak\") || CheckInventory(\"TiberiumAutorifle\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You already have a \\cdTiberium Autorifle!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (!IsSecondPress(\"WEAP02\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 300);\n\tDisplayTick();\n\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You got the \\cqTiberium Autorifle!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t// GiveInventory(\"Refunds\", 100);\n\tGiveInventory(\"TiberiumAutorifleWeak\", 1);\n\tGiveInventory(\"TE21CalAmmo\", 200);\n\tSetWeapon(\"TiberiumAutorifleWeak\");\n\tLog(n:0, s:\" purchases Tiberium Autorifle.\");\n}\n\n//---------------------------CHAINSAW (was flashbangs)\nscript 50 (int Team) {\n\tint cost = 250;\n\tif (MitigateDoublePress()) terminate;\n\tif (CheckInventory(\"EagerBeaver\")) {\n\t\tDisplayCross ();\n\t\tSetFont (\"BIGFONT\");\n\t\tHudMessage (s:\"You already have the \\cfChainsaw!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (!IsSecondPress(\"WEAP03\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory (\"PurchaseToken\", 1);\n\tSpendCredits (Credits[PlayerNumber()+1], cost);\n\tDisplayTick ();\n\n\tSetFont (\"BIGFONT\");\n\tHudMessage(s:\"You got the \\cfChainsaw!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Use Alt-Fire to throw the chainsaw!\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\tGiveInventory (\"EagerBeaver\", 1);\n\tSetWeapon (\"EagerBeaver\");\n\tLog (n:0, s:\" purchases Chainsaw.\");\n}\n\n// ARTILLERY CANNON\nscript 51 (int Team) {\n\tint cost = 550;\n\tif (MitigateDoublePress()) terminate;\n\tif(CheckInventory(\"ArtilleryCannon\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You already have an \\cKArtillery Cannon!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (!IsSecondPress(\"WEAP04\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You got the \\ckArtillery Cannon!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Use Alt-Fire for \\cFAnti-Mech shells!\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\t// GiveInventory(\"Refunds\", 200);\n\tGiveInventory (\"ArtilleryCannon\", 1);\n\tGiveInventory (\"ArtilleryShellAmmo\", 40);\n\tSetWeapon (\"ArtilleryCannon\");\n\tLog(n:0, s:\" purchases artillery cannon.\");\n}\n\n//---------------------------JUMPJET\nscript 52 (int Team) {\n\tint cost = 600; int speed = 0.65;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS23\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfJumpJet Infantry!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Use Alt-Fire to activate JumpJet\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_NOCHANGE);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"NewClipAmmo\",90);\n\tGiveInventory(\"Handgun\",1);\n\tSetFragGrenades (2);\n\tGiveInventory(\"MachineGunAmmo\",400);\n\tGiveInventory(\"JumpJetFuel\",100);\n\tGiveInventory(\"JumpJetGatlingGun\",1);\n\tSetWeapon(\"JumpJetGatlingGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_JUMPJET);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes jumpjet infantry.\");\n}\n\n//---------------------------TIBERIUM AUTORIFLEMAN\nscript 53 (int Team) {\n\tint cost = 400; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS24\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfTiberium Autorifleman!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (1, ARMOD_CHEM);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tGiveInventory(\"NewClipAmmo\",90);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"TE21CalAmmo\",200);\n\tSetFragGrenades (2);\n\tGiveInventory(\"TiberiumAutorifle\",1);\n\tSetWeapon(\"TiberiumAutorifle\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_TIBRIFLE);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Tiberium autorifleman.\");\n}\n\n//---------------------------DOUBLE SHOTGUNNER\nscript 54 (int Team) {\n\tint cost = 200; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS25\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfSuper Shotgunner!\"; HUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (1, ARMOD_NOCHANGE);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tGiveInventory(\"NewClipAmmo\",90);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"ShotgunAmmo\",50);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tSetFragGrenades (1);\n\tACS_ExecuteAlways(91, 0);\n\tGiveInventory(\"DoubleShotgun\",1);\n\tSetWeapon(\"DoubleShotgun\");\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_DOUBLESHOTGUNNER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes super shotgunner.\");\n}\n\n//-------------------- BLUE TEAM SUPERWEAPON\n//---------------------------ION CANNON BEACON\nscript 55 (int Team) {\n\tif (PlayerTeam() == TEAM_RED) {\n\t\t// [Dusk] this message should never be displayed in casual games\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"What the \\cRfuck\\c- are you doing here?\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tint cost = 1750;\n\tif (MitigateDoublePress()) terminate;\n\n\tif(CheckInventory(\"IonCannonBeacon\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You already have the \\cnIon Cannon Beacon\\cr!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tBlueBeaconTime=BeaconPurchaseDelay-(Timer()-LastPurchasedBeacon[1])/35;\n\tif (BlueBeaconTime <= 0)\n\t\tBlueBeaconCooldown = false;\n\telse\n\t\tBlueBeaconCooldown = true;\n\n\tif(BlueBeaconCooldown) {\n\t\tint mins = BlueBeaconTime/60 - Timer()/(35*60);\n\t\tint secs = 59 - (Timer()/35)%60;\n\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You must wait \\cF\", d:BlueBeaconTime, s:\" seconds\\nbefore you can get one of these!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (!IsSecondPress(\"WEAP05\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\tLastPurchasedBeacon[1] = Timer();\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 1750);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You got the \\cnIon Cannon Beacon!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 2.0, 1.0);\n\tSetFont (\"SMALLFONT\");\n\tHudMessage(s:\"Place this in front of an \\cAenemy MCT\\cJ and guard\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_WHITE, 0.5, 0.6, 5.0, 1.0);\n\tHudMessage(s:\"it for \\cU60 seconds\\cJ for \\cKcertain destruction!\";\n\t\tHUDMSG_FADEOUT, 1880+PlayerNumber(), CR_WHITE, 0.5, 0.625, 5.0, 1.0);\n\n\tHudMessageBold (s:\"\\cGWarning: \\cNBlue\\cJ player has \\cNIon Cannon Beacon!!\";\n\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\tGiveInventory(\"IonCannonBeacon\",1);\n\tSetWeapon(\"IonCannonBeacon\");\n\n\tBlueBeaconCooldown = True;\n\tLog(n:0, s:\" purchases Ion Cannon Beacon.\");\n}\n\n//-------------------- RED TEAM SUPERWEAPON\n//---------------------------NUCLEAR STRIKE BEACON\nscript 56 (int Team) {\n\tif (PlayerTeam() == TEAM_BLUE) {\n\t\t// [Dusk] this message should never be displayed in casual games\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"What the fuck are you doing here?\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tint cost = 1750;\n\tif ( MitigateDoublePress() ) terminate;\n\n\tRedBeaconCooldown = true;\n\tRedBeaconTime = BeaconPurchaseDelay-(Timer()-LastPurchasedBeacon[2])/35;\n\tif (RedBeaconTime <= 0)\n\t\tRedBeaconCooldown = false;\n\n\tif(CheckInventory(\"NuclearStrikeBeacon\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You already have the \\ckNuclear Strike Beacon\\cr!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif(RedBeaconCooldown) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You must wait \\cF\", d:RedBeaconTime, s:\" seconds\\nbefore you can get one of these!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (!IsSecondPress(\"WEAP06\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tLastPurchasedBeacon[2] = Timer();\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 1750);\n\tDisplayTick();\n\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You got the \\cANuclear Strike Beacon!\"; HUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 2.0, 1.0);\n\tSetFont (\"SMALLFONT\");\n\tHudMessage(s:\"Place this in front of an \\cAenemy MCT\\cJ and guard\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_WHITE, 0.5, 0.6, 5.0, 1.0);\n\tHudMessage(s:\"it for \\cU60 seconds\\cJ for \\cKcertain destruction!\";\n\t\tHUDMSG_FADEOUT, 1880+PlayerNumber(), CR_WHITE, 0.5, 0.625, 5.0, 1.0);\n\tHudMessageBold (s:\"\\cGWarning: \\cARed\\cJ player has \\cANuclear Strike Beacon!!\";\n\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\tGiveInventory (\"NuclearStrikeBeacon\", 1);\n\tSetWeapon (\"NuclearStrikeBeacon\");\n\n\tRedBeaconCooldown = True;\n\tLog(n:0, s:\" purchases Nuclear Strike Beacon.\");\n}\n\n//---------------------------ARMOUR/DAMAGE UPGRADE\nscript 57 (int Team) {\n\tint cost = 250;\n\tif (MitigateDoublePress()) terminate;\n\n\tif (CheckInventory (\"IsCommando\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage (s:\"no u :I\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif(CheckInventory(\"HasArmorUpgrade\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage (s:\"You already have this \\ccupgrade!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (!IsSecondPress(\"UPGR01\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You got the \\ckarmor upgrade!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"You can no longer pilot mechs.\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\tGiveInventory(\"Refunds\", 200);\n\tGiveInventory(\"HasArmorUpgrade\", 1);\n\tGiveInventory(\"HighUpgrade\", 1);\n\tSetArmorGrade (1, AGF_ADDITIVE);\n\tLog(n:0, s:\" purchases armour/damage upgrade.\");\n}\n\n//---------------------------PLASMA GUNNER\nscript 60 (int Team) {\n\tint cost = 800; int speed = 0.7;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!CheckPlant(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS26\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 800);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfPlasma Gunner!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_LASER);\n\tGiveInventory(\"HighUpgrade\",1);\n\tGiveInventory(\"NewClipAmmo\",90);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"PlasmaRifleAmmo\",200);\n\tGiveInventory(\"EnhancedTimedC4\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tSetFragGrenades (2);\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_PLASMAGUNNER);\n\tGiveInventory(\"PlasmaGun\",1);\n\tSetWeapon(\"PlasmaGun\");\n\n\tACS_ExecuteAlways(91, 0);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Plasma Gunner.\");\n}\n\n// ARTILLERY SOLDIER\nscript 61 (int Team) {\n\tint cost = 600; int speed = 0.7;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS27\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are an \\cfArtillery Soldier!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\tHudMessage(s:\"Use Alt-Fire for \\cFAnti-Mech shells!\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.5, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (2, ARMOD_EXPLO);\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\",cost/2);\n\tGiveInventory(\"IsArtillerySoldier\",1);\n\tGiveInventory(\"HighUpgrade\",1);\n\tGiveInventory(\"NewClipAmmo\",60);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"EnhancedTimedC4\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tGiveInventory(\"Rifle\",1);\n\tGiveInventory(\"RifleAmmo\",20);\n\tGiveInventory(\"RifleGrenadeAmmo\",2);\n\tGiveInventory(\"ArtilleryShellAmmo\",30);\n\tSetFragGrenades (2);\n\tGiveInventory(\"ArtilleryCannon\",1);\n\tSetWeapon(\"ArtilleryCannon\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_ARTILLERY);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes artillery soldier.\");\n}\n\n//---------------------------TIME COP\nscript 39 (int Team) {\n\tint cost = 2000; int speed = 0.9;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckBarracks(team)) terminate;\n\tif (!CheckPlant(team)) terminate;\n\tif (MaxTimeCopsPerTeam > 0 && NumTimeCops[team] >= MaxTimeCopsPerTeam) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tif (MaxTimeCopsPerTeam == 1) {\n\t\t\tHudMessage(s:\"You already have a time cop in-field!\";\n\t\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\t} else {\n\t\t\tHudMessage(s:\"You already have \", d:NumTimeCops[team], s:\" time cops in-field!\";\n\t\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\t}\n\n\t\tif (GetLevelInfo (LEVELINFO_LEVELNUM) == 20)\n\t\t\tThrustThing((VectorAngle(GetActorVelX(0), GetActorVelY(0)) >> 8) + 128, 25, 0, 0);\n\t\tterminate;\n\t}\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS29\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are the \\cFTime Cop!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\tSETFONT (\"SMALLFONT\");\n\tif(Team == 0)\n\t\tHudMessageBold (s:\"\\cGWarning: \\cARed\\cJ TIME COP in-field!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\telse\n\t\tHudMessageBold (s:\"\\cGWarning: \\cNBlue\\cJ TIME COP in-field!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\tSetActorProperty (0, APROP_SPEED, speed);\n\tSetArmorGrade (2, ARMOD_NOCHANGE);\n\tGiveInventory (\"HasClass\", 1);\n\tGiveInventory (\"HighUpgrade\", 1);\n\tGiveInventory (\"Refunds\", cost/2);\n\tGiveInventory (\"NewClipAmmo\", 120);\n\tGiveInventory (\"Handgun\", 1);\n\tGiveInventory (\"EnhancedTimedC4\", 1);\n\tGiveInventory (\"TimedC4\", 2);\n\tGiveInventory (\"TimedC4Count\", 2);\n\tSetFragGrenades (4);\n\tGiveInventory (\"SpawnInvulnerability\", 1);\n\tGiveInventory (\"ClassID\", CLASS_TIMECOP);\n\tGiveInventory(\"MachineGunAmmo\", 50);\n\tGiveInventory(\"MachineGun\", 1);\n\tGiveInventory (\"TimeGun\", 1);\n\tGiveInventory (\"TimeGunAmmo\", 100);\n\tSetWeapon (\"TimeGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog (n:0, s:\" becomes Time Cop.\");\n\tRecountTimeCops();\n\n\tDelay(35*6);\n\tActivatorSound(\"misc/commando\",255);\n}\n\n//---------------------------TIBERIUM HARVESTER //Advanced\nscript 63 (int Team) {\n\tint cost = 750; int speed = 0.8;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckRefinery(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS30\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tGiveInventory(\"HasClass\",1);\n\tGiveInventory(\"Refunds\", cost/2);\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 750);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are an \\cfAdvanced Tiberium Harvester!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.4, 2.0, 1.0);\n\tHudMessage(s:\"Pick-up \\cctiberium crystals \\cdand\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.6, 2.0, 1.0);\n\tHudMessage(s:\"return them to your \\ccrefinery \\cdfor cash!\";\n\t\tHUDMSG_FADEOUT, 1880+PlayerNumber(), CR_GREEN, 0.5, 0.65, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (1, ARMOD_CHEM);\n\tGiveInventory(\"HighUpgrade\",1);\n\tGiveInventory(\"IsHarvester\",1);\n\tGiveInventory(\"TiberiumProof\",1);\n\tGiveInventory(\"Grade0Damage\",1);\n\tGiveInventory(\"NewClipAmmo\",200);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tSetFragGrenades (2);\n\tGiveInventory(\"MachineGunAmmo\",160);\n\tGiveInventory(\"SubMachineGun\",1);\n\tGiveInventory(\"MachineGun\",1);\n\tSetWeapon(\"MachineGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_ADVHARVESTER);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes advanced Tiberium Harvester.\");\n\tDelay(35*6);\n\tActivatorSound(\"misc/chem\",255);\n}\n\n//---------------------------TIBERIUM HARVESTER //Free\nscript 64 (int Team) {\n\tint cost = 0; int speed = 0.65;\n\tif (MitigateDoublePress()) terminate;\n\tif (!CheckRefinery(Team)) terminate;\n\tif (!IsResigned()) terminate;\n\tif (!IsSecondPress(\"CLSS28\", cost)) terminate;\n\tif (!CheckCredits(cost)) terminate;\n\n\tGiveInventory(\"HasClass\",1);\n\tTakeInventory(\"PurchaseToken\",1);\n\tSpendCredits(Credits[PlayerNumber()+1], 0);\n\tDisplayTick();\n\tSETFONT(\"BigFont\");\n\tHudMessage(s:\"You are a \\cfTiberium Harvester!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.4, 2.0, 1.0);\n\tHudMessage(s:\"Pick-up \\cctiberium crystals \\cdand\";\n\t\tHUDMSG_FADEOUT, 1840+PlayerNumber(), CR_GREEN, 0.5, 0.6, 2.0, 1.0);\n\tHudMessage(s:\"return them to your \\ccrefinery \\cdfor cash!\";\n\t\tHUDMSG_FADEOUT, 1880+PlayerNumber(), CR_GREEN, 0.5, 0.65, 2.0, 1.0);\n\n\t//Set Statistics\n\tSetActorProperty(0,APROP_SPEED,speed);\n\tSetArmorGrade (0, ARMOD_CHEM);\n\tGiveInventory(\"IsHarvester\",1);\n\tGiveInventory(\"TiberiumProof\",1);\n\tGiveInventory(\"Grade0Damage\",1);\n\tGiveInventory(\"NewClipAmmo\",200);\n\tGiveInventory(\"Handgun\",1);\n\tGiveInventory(\"TimedC4\",1);\n\tGiveInventory(\"TimedC4Count\",1);\n\tSetFragGrenades (1);\n\tGiveInventory(\"SubMachineGun\",1);\n\tGiveInventory(\"SpawnInvulnerability\",1);\n\tGiveInventory (\"ClassID\", CLASS_HARVESTER);\n\tSetWeapon(\"SubMachineGun\");\n\tACS_ExecuteAlways(91, 0);\n\n\tACS_ExecuteAlways (961, 0, Team);\n\tPlayerSpeeds[PlayerNumber()] = speed;\n\tLog(n:0, s:\" becomes Tiberium harvester.\");\n\tDelay(35*6);\n\tActivatorSound(\"misc/chem\",255);\n}\n\nscript 961 (int team) {\n\tint tries, i;\n\tbool failed = true;\n\tif (GetLevelInfo (LEVELINFO_LEVELNUM) == 20 || GetLevelInfo (LEVELINFO_LEVELNUM) == 21) {\n\t\tfor (i = 0; i <= 9; i++) {\n\t\t\tif (Teleport_NoStop (1+(1-team), 0)) {\n\t\t\t\tfailed = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (i = 0; i <= 9; i++) {\n\t\t\tif (Teleport (1+(1-team))) {\n\t\t\t\tfailed = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (failed) {\n\t\tHudMessage (s:\"In-field teleportation \\cAfailed\\cJ - use the\\n\\cDTeleport back to Field\\cJ -terminal\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS2, 5.0, 1.0);\n\t\t\tterminate;\n\t} else TakeInventory (\"IsInSpawnRoom\", 1);\n}"
},
{
"source": "pk3",
"name": "acs_source/a_core.txt",
"contents": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * All Out War 2 core mechanism scripts\n * Credit to VoltlocK for originally creating the engine\n * With modifications by Eruanna, Dusk and the Omega Team\n *\n * You may use portions of this script in your project as long as you give\n * credit where credit is due. Please don't be lame and just copy-paste any\n * of this and call it your own. Thanks!\n */\n\nscript 999 OPEN {\n\tRankTitles[0] = \"Private\";\n\tRankTitles[1] = \"Corporal\";\n\tRankTitles[2] = \"Sergeant\";\n\tRankTitles[3] = \"Master Sgt.\";\n\tRankTitles[4] = \"Officer\";\n\tRankTitles[5] = \"Lieutenant\";\n\tRankTitles[6] = \"Major\";\n\tRankTitles[7] = \"Commando\";\n\n\tif (GetCVar(\"aow_disablemechs\") == 0)\n\t\tConsoleCommand(\"set aow_mechs 1\");\n\telse\n\t\tConsoleCommand(\"set aow_mechs 0\");\n\n\t//Red\n\tGotRefinery[0] = True;\n\tGotBarracks[0] = True;\n\tGotFactory[0] = True;\n\tGotPlant[0] = True;\n\tGotRepair[0] = True;\n\tGotObelisk[0] = True;\n\tBaseLeft[0] = 5;\n\t//Blue\n\tGotRefinery[1] = True;\n\tGotBarracks[1] = True;\n\tGotFactory[1] = True;\n\tGotPlant[1] = True;\n\tGotRepair[1] = True;\n\tGotObelisk[1] = True;\n\tBaseLeft[1] = 5;\n\n\tif(GetCVAR(\"aow_tickets\") <= 1 && TicketPool == False)\n\t\tConsoleCommand(\"set aow_tickets 75\");\n\telse if(GetCVAR(\"aow_tickets\") <= 100 && TicketPool == True)\n\t\tConsoleCommand(\"set aow_tickets 250\");\n\tStartingTickets = GetCVAR(\"aow_tickets\");\n\n\tTickets[0] = StartingTickets;\n\tTickets[1] = StartingTickets;\n\n\tSetLineSpecial(159,80,342,0,0,0,0);\n\n\tdelay (5);\n\n\tSpawnSpotForced (\"CrateMapMarker\", TID_CRATE, 0, 0);\n\tSpawnSpotForced (\"TiberiumMapMarker\", TID_TIBERIUM, 0, 0);\n\n\tdelay (5);\n\t// wf unavailability\n\tif (!ThingCount (T_NONE, 107) && !ThingCount (T_NONE, 207)) {\n\t\tGotFactory[0] = 0;\n\t\tGotFactory[1] = 0;\n\t\tTeam_GivePoints (TEAM_RED, 1, 0);\n\t\tTeam_GivePoints (TEAM_BLUE, 1, 0);\n\t}\n\n\tACS_ExecuteAlways (930, 0, BUILDING_ALL, TEAM_RED);\n\tACS_ExecuteAlways (930, 0, BUILDING_ALL, TEAM_BLUE);\n\n\t// [Dusk] If ticket pool is enabled, spawn ticket counters. These counters\n\t// are used to inform clients about ticket values, since the left-hand\n\t// hud is client-sided. \"Physically\", the ticket counters are map spots\n\t// spawned at the respective team's Repair Facilities. The counters'\n\t// angle tells the starting ticket amount, their speed tells the current\n\t// ticket amount.\n\tSpawnSpotForced (\"MapSpot\", 109, TID_TICKETCOUNTER_BLUE, 0);\n\tSpawnSpotForced (\"MapSpot\", 209, TID_TICKETCOUNTER_RED, 0);\n\tSetActorAngle (TID_TICKETCOUNTER_BLUE, StartingTickets);\n\tSetActorAngle (TID_TICKETCOUNTER_RED, StartingTickets);\n\tif (TicketPool) {\n\t\tSetActorSpeed (TID_TICKETCOUNTER_BLUE, StartingTickets);\n\t\tSetActorSpeed (TID_TICKETCOUNTER_RED, StartingTickets);\n\t} else {\n\t\tSetActorSpeed (TID_TICKETCOUNTER_BLUE, 0);\n\t\tSetActorSpeed (TID_TICKETCOUNTER_RED, 0);\n\t}\n\n\t// Activate developer mode if the proper cvar is set.\n\tif (GetCVAR (\"aow_developer\")) {\n\t\tDeveloperSafetyLock = 0x7FFFFFFF;\n\t\tACS_ExecuteAlways (404, 0);\n\t}\n}\n\n// Server settings\nscript 599 OPEN {\n\tdelay (1);\n\n\t// ==================================\n\t// DMFLAGS\n\tif (!GetCVAR (\"sv_doubleammo\")) ConsoleCommand (\"sv_doubleammo 1\");\n\tif (!GetCVAR (\"sv_nofov\")) ConsoleCommand (\"sv_nofov 1\");\n\tif (!GetCVAR (\"alwaysapplydmflags\")) ConsoleCommand (\"alwaysapplydmflags 1\");\n\tif (!GetCVAR (\"sv_weapondrop\")) ConsoleCommand (\"sv_weapondrop 1\");\n\tif (!GetCVAR (\"sv_itemrespawn\")) ConsoleCommand (\"sv_itemrespawn 1\");\n\tif (!GetCVAR (\"compat_limited_airmovement\")) ConsoleCommand (\"compat_limited_airmovement 1\");\n\n\t// [Dusk] the engine assumes that players stay dead for at least a second\n\tif (GetCVAR (\"compat_instantrespawn\")) ConsoleCommand (\"compat_instantrespawn 0\");\n\n\t// [Dusk] enforce no pointlimit until game is considered over. Pointlimit is used\n\t// to end the game when needed. We don't want this script to conflict it at any\n\t// given time.\n\tif (!GameOver && GetCVAR(\"pointlimit\") != 0) ConsoleCommand(\"pointlimit 0\");\n\n\t// ==================================\n\t// CUSTOM CVARS\n\t// w/ sanity checks\n\tif (!GetCVAR (\"aow_credflow\")) ConsoleCommand (\"set aow_credflow 4\");\n\tif (GetCVAR (\"aow_startcredits\") <= 0) ConsoleCommand (\"set aow_startcredits 300\");\n\tif (GetCVAR (\"aow_creditfrag\") <= 0) ConsoleCommand (\"set aow_creditfrag 50\");\n\tif (GetCVAR (\"aow_bonusamount\") <= 0) ConsoleCommand (\"set aow_bonusamount 300\");\n\tif (GetCVAR (\"aow_bonustime\") <= 0) ConsoleCommand (\"set aow_bonustime 5\");\n\tif (GetCVAR (\"aow_medicbonusneed\") <= 0) ConsoleCommand (\"set aow_medicbonusneed 175\");\n\tif (GetCVAR (\"aow_repairbonus\") <= 0) ConsoleCommand (\"set aow_repairbonus 1\");\n\tif (GetCVAR (\"aow_guardianlimit\") <= 0) ConsoleCommand (\"set aow_guardianlimit 2\");\n\tif (GetCVAR (\"aow_ticketpool\") <= 0) ConsoleCommand (\"set aow_ticketpool 0\");\n\t//[SP]How long you can stay on a team before you are never switched.\n\tif (GetCVAR (\"aow_teamstaytime\") <= 0) ConsoleCommand(\"set aow_teamstaytime 2\");\n\n\t// Plasma Cannon initial delay\n\tif (!GetCVAR (\"aow_plasmapurchasedelay\")) ConsoleCommand(\"set aow_plasmapurchasedelay 5\");\n\t//[SP]Maximum number of plasma cannons per team. (Set to -1 for unlimited)\n\tif (!GetCVAR (\"aow_maxcannonsperteam\")) ConsoleCommand(\"set aow_maxcannonsperteam 4\");\n\t// [Dusk] Time (in minutes) to determine plasma cannon cooldown. Use -1 to disable\n\tif (!GetCVAR (\"aow_plasmacooldown\")) ConsoleCommand(\"set aow_plasmacooldown 3\");\n\n\t//[SP]How long you have to wait to buy a new superweapon beacon. (Minutes) (Set to -1 to disable wait)\n\tif (!GetCVAR (\"aow_beaconpurchasedelay\"))ConsoleCommand(\"set aow_beaconpurchasedelay 5\");\n\n\t// [SP]Maximum number of time cops per team. (Set to -1 for unlimited)\n\tif (!GetCVAR (\"aow_maxtimecopsperteam\")) ConsoleCommand(\"set aow_maxtimecopsperteam 1\");\n\n\t// [Dusk] How many minutes until Timed C4 can be used. (-1 to disable)\n\tif (!GetCVAR (\"aow_c4delay\")) ConsoleCommand(\"set aow_c4delay 5\");\n\n\t//[SP] Time (in minutes) before sudden death.\n\t// [Dusk] changed default to 45, -1 means immediate\n\tif (GetCVAR (\"aow_suddendeathtime\") == 0) ConsoleCommand(\"set aow_suddendeathtime 45\");\n\n\t// [Dusk] Sudden death degeneration\n\tif (GetCVAR (\"aow_degeneration\") <= 0) ConsoleCommand(\"set aow_degeneration 0\");\n\tif (GetCVAR (\"aow_degenerationinterval\") <= 0) ConsoleCommand(\"set aow_degenerationinterval 10\");\n\n\tif (GetCVAR (\"aow_tournamentmode\") <= 0) ConsoleCommand(\"set aow_tournamentmode 0\");\n\tif (GetCVAR (\"aow_disablemechs\") <= 0) ConsoleCommand(\"set aow_disablemechs 0\");\n\tif (GetCVAR (\"aow_surrendermode\") <= 0) ConsoleCommand(\"set aow_surrendermode 0\");\n\n\t// [Dusk] How much score does destroying a building award you, in addition to difference?\n\tif (GetCVAR (\"aow_buildingpoints\") <= 0) ConsoleCommand (\"set aow_buildingpoints 125\");\n\n\t// TODO: get rid of these variables and replace with direct GetCVAR calls\n\tStartCredits = GetCVAR(\"aow_startcredits\");\n\tCreditFlow = GetCVAR(\"aow_credflow\");\n\tCreditFlowPower = GetCVAR(\"aow_powercredflow\");\n\tCreditFragAward = GetCVAR(\"aow_creditfrag\");\n\tCreditAwardTime = GetCVAR(\"aow_bonustime\");\n\tCreditAwardAmount = GetCVAR(\"aow_bonusamount\");\n\tCreditRepairAmount = GetCVAR(\"aow_repairbonus\");\n\tGuardianLimit = GetCVAR(\"aow_guardianlimit\");\n\tMechEnabled = GetCVAR(\"aow_mechs\");\n\tTicketPool = GetCVAR(\"aow_ticketpool\");\n\tTeamStayTime = GetCVAR(\"aow_teamstaytime\");\n\tCannonPurchaseDelay = GetCVAR(\"aow_plasmapurchasedelay\") * 35 * 60;\n\tMaxCannonsPerTeam = GetCVAR(\"aow_maxcannonsperteam\");\n\tMaxTimeCopsPerTeam = GetCVAR(\"aow_maxtimecopsperteam\");\n\tTournamentMode = GetCVAR(\"aow_tournamentmode\");\n\tBeaconPurchaseDelay = GetCVAR(\"aow_beaconpurchasedelay\") * 60;\n\tPlasmaCooldownTime = GetCVAR(\"aow_plasmacooldown\") * 35 * 60;\n\tTimedC4Delay = GetCVar (\"aow_c4delay\");\n\tMedicBonusNeed = GetCVAR(\"aow_medicbonusneed\");\n\n\tdelay(35*5);\n\trestart;\n}\n\n// credit flow\nscript 4 OPEN {\n\tint i, p, redflow, blueflow;\n\twhile (1) {\n\t\tp = 25;\n\t\tif (GotPlant[0] == 1) p += 25;\n\t\tif (GotRefinery[0] == 1) p += 50;\n\t\tif (MiniRefinery[0] == 1) p += 75;\n\t\tredflow = (CreditFlow * p) / 100;\n\n\t\tp = 25;\n\t\tif (GotPlant[1] == 1) p += 25;\n\t\tif (GotRefinery[1] == 1) p += 50;\n\t\tif (MiniRefinery[1] == 1) p += 75;\n\t\tblueflow = (CreditFlow * p) / 100;\n\n\t\tfor (i = 0; i < 32; i++) {\n\t\t\tif (PlayerInGame(i) && GetActorProperty (3800+i, APROP_HEALTH) > 0 && !IsAdmin[i]) {\n\t\t\t\tif (GetPlayerInfo (i, PLAYERINFO_TEAM) == TEAM_RED)\n\t\t\t\t\tGiveCredits (i, redflow);\n\t\t\t\telse if (GetPlayerInfo (i, PLAYERINFO_TEAM) == TEAM_BLUE)\n\t\t\t\t\tGiveCredits (i, blueflow);\n\t\t\t}\n\t\t}\n\n\t\tdelay (35);\n\t}\n}\n\n//Setting Player scripts\nscript 10 RESPAWN {\n\tif (StartTime[PlayerNumber()] == 0) InitPlayer();\n\n\tGiveInventory(\"Ingame\",1);\n\tGiveInventory(\"IsInSpawnRoom\", 1);\n\tif(PlayerTeam() == TEAM_BLUE) {\n\t\tGiveInventory (\"BlueTeamArmor\",1);\n\t\tGiveInventory (\"IsBlue\",1);\n\t\tTakeInventory (\"RedTeamArmor\",1);\n\t\tTakeInventory (\"IsRed\",1);\n\t}\n\telse if(PlayerTeam() == TEAM_RED)\n\t{\n\t\tGiveInventory (\"RedTeamArmor\",1);\n\t\tGiveInventory (\"IsRed\",1);\n\t\tTakeInventory (\"BlueTeamArmor\",1);\n\t\tTakeInventory (\"IsBlue\",1);\n\t}\n\n\tThing_ChangeTID (0, PlayerNumber()+3800);\n\n\tif(GetPlayerInfo(PlayerNumber(),PLAYERINFO_GENDER) == 1) {\n\t\tSetActorProperty(0,APROP_DeathSound,\"female/death\");\n\t\tGiveInventory(\"IsFemale\",1);\n\t}\n\n\tACS_ExecuteAlways (97, 0);\n\tSetWeapon (\"Unarmed\");\n}\n\nscript 11 ENTER {\n\tdelay(5);\n\tInitPlayer();\n\n\tGiveInventory(\"Ingame\",1);\n\tGiveInventory(\"IsInSpawnRoom\", 1);\n\tif(PlayerTeam() == TEAM_BLUE)\n\t{\n\t\tGiveInventory(\"BlueTeamArmor\",1);\n\t\tGiveInventory(\"IsBlue\",1);\n\t}\n\telse if(PlayerTeam() == TEAM_RED)\n\t{\n\t\tGiveInventory(\"RedTeamArmor\",1);\n\t\tGiveInventory(\"IsRed\",1);\n\t}\n\n\tThing_ChangeTID(0,PlayerNumber()+3800);\n\n\tif(GetPlayerInfo(PlayerNumber(),PLAYERINFO_GENDER) == 1)\n\t{\n\t\tSetActorProperty(0,APROP_DeathSound,\"female/death\");\n\t\tGiveInventory(\"IsFemale\",1);\n\t}\n\n\tdelay(5);\n\tACS_ExecuteAlways (5, 0); // display credits/exp HUD\n\tACS_ExecuteAlways (92, 0);\n\n\t// If we're in developer mode, make him gamemaster.\n\tif (Developer) {\n\t\tIsAdmin[PlayerNumber()] = true;\n\n\t\tSetFont (\"BIGFONT\");\n\t\tHudMessage(s:\"This game is in developer mode. You have gamemaster access.\";\n\t\t\tHUDMSG_FADEINOUT, 0, CR_BLUE, 0.5, 0.2, 7.0, 0.5, 1.0);\n\t}\n}\n\n //--------------------------START UP MESSAGES\nscript 301 ENTER CLIENTSIDE {\n\tSetFont (\"BIGFONT\");\n\tHudMessage(s:\"Welcome to \\cFAll Out War 2!\";\n\t\tHUDMSG_FADEINOUT, 0, CR_WHITE, 0.5, 0.3, 7.0, 0.5, 1.0);\n\tSetFont (\"SMALLFONT\");\n\tHudMessage (s:\"Type \\cFAOWHelp\\cJ in console for information on how to play!\";\n\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.5, 0.45, 7.0, 1.0);\n\tHudMessage (s:\"See \\cFOptions \\cN-> \\cFCustomise Controls\\c- for keybinds\";\n\t\tHUDMSG_FADEOUT, 0, CR_WHITE, 0.5, 0.5, 7.0, 1.0);\n\n\tdelay (20);\n\tLocalAmbientSound (\"voltlock/welcome\", 127);\n}\n\nScript 8 (int Gone) DISCONNECT {\n\tIsAdmin[Gone] = false;\n\tSetCreditsSilent(Credits[Gone+1], 0);\n\tExperience[Gone] = 0;\n\tRank[Gone] = RANK_PRIVATE;\n\tSurrender[Gone] = 0;\n\tPlasmaCooldown[Gone] = 0;\n\tStartTime[Gone] = 0;\n\n\tif (MechGetter[0] == Gone && GettingMech[0])\n\t\tGettingMech[0] = 0;\n\telse if (MechGetter[1] == Gone && GettingMech[1])\n\t\tGettingMech[1] = 0;\n\n\tif (Surrender[Gone]) {\n\t\tSurrender[Gone] = false;\n\t\tif (PlayersTeam[Gone] == TEAM_RED) {\n\t\t\tHudMessageBold (s:\"\\cD\", d:SurrenderCount (TEAM_RED), s:\"\\cQ/\\cD\", d:RedCount(), s:\" \",\n\t\t\t\ts:\"\\cJof \\cARed Team\\cJ\\n have voted to surrender\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t} else if (PlayersTeam[Gone] == TEAM_BLUE) {\n\t\t\tHudMessageBold (s:\"\\cD\", d:SurrenderCount (TEAM_BLUE), s:\"\\cQ/\\cD\", d:BlueCount(), s:\" \",\n\t\t\t\ts:\"\\cJof \\cNBlue Team\\cJ\\n have voted to surrender\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t}\n\t}\n\telse // % of players surrendering could now be higher. Al demands a recount!\n\t\tACS_Execute(751, 0);\n}\n\nscript 303 OPEN {\n\t// these maps are too small to have portals\n\tdelay (5);\n\tint levelnum = GetLevelInfo (LEVELINFO_LEVELNUM);\n\tif (levelnum == 2) {UsePortals = 0;}\n\tif (levelnum == 4) {UsePortals = 0;}\n\tif (levelnum == 7) {UsePortals = 0;}\n\tif (levelnum == 15) {UsePortals = 0;}\n}\n\nfunction void InitPlayer (void) {\n\tSetCreditsSilent(Credits[PlayerNumber()+1], StartCredits);\n\tExperience[PlayerNumber()] = 0;\n\tRank[PlayerNumber()] = RANK_PRIVATE;\n\tSurrender[PlayerNumber()] = False;\n\tPlayersTeam[PlayerNumber()+1] = PlayerTeam();\n\tStartTime[PlayerNumber()]=Timer();\n\tHasTeleported[PlayerNumber()] = false;\n\tRepairBonus[PlayerNumber()] = 0;\n\tMedicBonus[PlayerNumber()] = 0;\n}"
},
{
"source": "pk3",
"name": "acs_source/a_crate.txt",
"contents": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * All Out War 2 powerup crate-related scripts\n * Credit to VoltlocK for originally creating the engine\n * With modifications by Eruanna, Dusk and the Omega Team\n *\n * You may use portions of this script in your project as long as you give\n * credit where credit is due. Please don't be lame and just copy-paste any\n * of this and call it your own. Thanks!\n */\n\nscript 312 OPEN {\n\twhile (1) {\n\t\tCrateNumber += random (0, MAX_CRATE);\n\t\tCrateNumber %= MAX_CRATE;\n\t\tCrateNumber++;\n\t\tdelay (35);\n\t}\n\trestart;\n}\n\nscript 309 (int Crate, int Override) {\n\t// Crate determines which crate is given, 0 means random\n\t// Override means whether all limits should be overridden. Open Deck needs this.\n\tint i;\n\tif (!Crate) {\n\t\t// Crate = random(1, MAX_CRATE);\n\t\tCrate = CrateNumber;\n\t\tOverride = false;\n\n\t\t// bump the value to keep two simultaneous\n\t\t// crates from having the same effect\n\t\tCrateNumber += random (0, MAX_CRATE);\n\t\tCrateNumber %= MAX_CRATE;\n\t\tCrateNumber++;\n\t}\n\n\tswitch (crate) {\n\tcase 1:\n\tcase 17:\n\t\tif (GetArmorGrade () >= 5 && !Override) {crate = 0; restart;}\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cKArmor upgraded!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/armr\",255);\n\t\tSetArmorGrade (1, AGF_ADDITIVE|ARMOD_NOCHANGE);\n\t\tLog(n:0, s:\" gets Armor Upgrade crate.\");\n\t\tbreak;\n\tcase 2:\n\t\tSetFont (\"SMALLFONT\");\n\t\tAmbientSound (\"powerup/base\", 127);\n\t\tLog (n:0, s:\" gets Base Miracle.\");\n\t\tif(PlayerTeam() == TEAM_RED) {\n\t\t\tHudMessageBold (s:\"\\cARed Team\\cJ got \\cDBase Miracle!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\t\tif (GotBarracks[0]) SetActorHealth (201, GetActorSpawnHealth (201));\n\t\t\tif (GotRefinery[0]) SetActorHealth (203, GetActorSpawnHealth (203));\n\t\t\tif (GotPlant[0]) SetActorHealth (205, GetActorSpawnHealth (205));\n\t\t\tif (GotFactory[0]) SetActorHealth (207, GetActorSpawnHealth (207));\n \t\t\tif (GotObelisk[0]) SetActorHealth (214, GetActorSpawnHealth (214));\n\t\t} else if(PlayerTeam() == TEAM_BLUE) {\n\t\t\tHudMessageBold (s:\"\\cNBlue Team\\cJ got \\cDBase Miracle!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t\tif (GotBarracks[1]) SetActorHealth (101, GetActorSpawnHealth (101));\n\t\t\tif (GotRefinery[1]) SetActorHealth (103, GetActorSpawnHealth (103));\n\t\t\tif (GotPlant[1]) SetActorHealth (105, GetActorSpawnHealth (105));\n\t\t\tif (GotFactory[1]) SetActorHealth (107, GetActorSpawnHealth (107));\n \t\t\tif (GotObelisk[1]) SetActorHealth (114, GetActorSpawnHealth (114));\n\t\t}\n\t\tACS_ExecuteAlways (930, 0, BUILDING_ALL, PlayerTeam());\n\t\tHudMessage (s:\"\\cDBase miracle!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tbreak;\n\tcase 3:\n\tcase 21:\n\t\tif ((CheckInventory (\"ChemicalArmor\") || CheckInventory (\"PowerChemicalProof\")) && !Override) {\n\t\t\tcrate = 1; // armor upgrade\n\t\t\trestart;\n\t\t}\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cDChemical proof!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/chem\",255);\n\t\tLocalAmbientSound (\"misc/armor_pkup\", 127);\n\t\tGiveInventory (\"ChemicalArmor\", 1);\n\t\tLog(n:0, s:\" gets Chem Proof.\");\n\t\tbreak;\n\tcase 4:\n\tcase 22:\n\t\tif (CheckInventory (\"PowerFirepowerUpgrade\") && !Override) {crate = 0; restart;}\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cKFirepower upgraded!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/dama\",255);\n\t\tGiveInventory(\"FirepowerUpgrade\",1);\n\t\tLog(n:0, s:\" gets FirePower Upgrade crate.\");\n\t\tbreak;\n\tcase 5:\n\tcase 16:\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"You got extra \\cQ$\\cD\", d:CreditAwardAmount, s:\"!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/cred\",255);\n\t\tDelay(4);\n\t\tLocalAmbientSound(\"powerup/credsound\",255);\n\t\tAddCreditsSilent(Credits[PlayerNumber()+1], CreditAwardAmount);\n\t\tLog(n:0, s:\" gets Bonus Credits Crate.\");\n\t\tbreak;\n\tcase 6:\n\tcase 23:\n\t\tif (Rank[PlayerNumber()] >= RANK_COMMANDO && !Override) {crate = 0; restart;}\n\t\tSetFont(\"SMALLFONT\");\n\t\tLog(n:0, s:\" gets Bonus XP crate.\");\n\t\tHudMessage (s:\"\\cJYou got \\cD250 \\cQXP\\cJ!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/exp\",255);\n\n\t\tfor (i = 0; i < 5; i++) {\n\t\t\tDelay(5);\n\t\t\tLocalAmbientSound(\"c4/use\",255);\n\t\t\tAddExperience (50);\n\t\t}\n\t\tbreak;\n\tcase 7:\n\tcase 18:\n\t\tif ((CheckInventory (\"FireArmor\") || CheckInventory (\"PowerFireProof\")) && !Override) {\n\t\t\tcrate = 1; // armor upgrade\n\t\t\trestart;\n\t\t}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cKFire proof!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/fire\",255);\n\t\tLocalAmbientSound (\"misc/armor_pkup\", 127);\n\t\tGiveInventory (\"FireArmor\", 1);\n\t\tLog(n:0, s:\" gets Fire Proof crate.\");\n\t\tbreak;\n\tcase 8:\n\tcase 24:\n\t\tif (!Override && (CheckInventory(\"StealthLaserRifle\") || CheckInventory (\"Knife\"))) {\n\t\t\tcrate = 0; restart;\n\t\t}\n\n\t\tif (!Override && (CheckInventory(\"PowerInvisibility\"))) {\n\t\t\tcrate = 0; restart;\n\t\t}\n\t\tLocalAmbientSound(\"powerup/invi\",255);\n\t\tLocalAmbientSound(\"powerup/invisound\",255);\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed player\\cJ got \\cUStealth Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"\\cNBlue player\\cJ got \\cUStealth Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tSetArmorGrade (-1, AGF_ADDITIVE|ARMOD_NOCHANGE);\n\t\tGiveInventory (\"StealthLaserRifle\", 1);\n\t\tGiveInventory (\"LaserRifleAmmo\", 100);\n\t\tSetActorProperty(0,APROP_DeathSound,\"stealth/death\");\n\t\tLog(n:0, s:\" gets Stealth crate.\");\n\n\t\tHudMessage (s:\"\\cUStealth rifle!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tdelay (2*35);\n\t\tHudMessage (s:\"\\cJUse the rifle's \\cKAlt-Fire\\cJ\\nto toggle \\cUstealth!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tbreak;\n\tcase 9:\n\tcase 25:\n\t\tif (CheckInventory (\"PowerInvulnerable\") && !Override) {crate = 0; restart;}\n\t\tif (TournamentMode) {crate = 0; restart;}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tLocalAmbientSound(\"powerup/iron\", 255);\n\t\tLocalAmbientSound(\"powerup/invisound\", 255);\n\t\tGiveInventory(\"IronCurtain\", 1);\n\t\tLog (n:0, s:\" gets Iron Curtain.\");\n\n\t\tif (PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed player\\cJ got \\cCIron Curtain!!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse if (PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"\\cNBlue player\\cJ got \\cCIron Curtain!!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tHudMessage (s:\"\\cCIron curtain!!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tbreak;\n\tcase 10:\n\tcase 26:\n\tcase 36:\n\t\tif (CheckInventory (\"IsKamikaze\") && !Override) {crate = 0; restart;}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tif (TournamentMode) { // [SP] This crate is forbidden in tournament mode\n\t\t\tACS_ExecuteAlways(309, 0);\n\t\t\tterminate;\n\t\t}\n\t\tLocalAmbientSound(\"powerup/kama\",255);\n\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"Some crazy ass \\cARed player\\cJ got\\nthe \\cKKamikaze Crate!!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"Some crazy ass \\cNBlue player\\cJ got\\nthe \\cKKamikaze Crate!!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\tHudMessage (s:\"\\cKKamikaze!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tGiveInventory(\"IsKamikaze\",1);\n\t\tLog(n:0, s:\" gets Kamikaze.\");\n\t\tbreak;\n\tcase 11:\n\tcase 27:\n\t\tSetFont(\"SMALLFONT\");\n\t\tif (!Override && (CrateTime || CheckInventory(\"PlasmaCannon\"))) {\n\t\t\tACS_ExecuteAlways(309, 0);\n\t\t\tterminate;\n\t\t}\n\t\tLocalAmbientSound(\"powerup/plas\",255);\n\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed player\\cJ got \\cNPlasma Cannon Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"\\cNBlue player\\cJ got \\cNPlasma Cannon Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tHudMessage (s:\"\\cNPlasma Cannon!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tGiveInventory(\"PlasmaCannon\",1);\n\t\tGiveInventory(\"PlasmaCannonAmmo\",10);\n\t\tRecountPlasma ();\n\t\tLog(n:0, s:\" gets Plasma Cannon.\");\n\t\tbreak;\n\tcase 12:\n\tcase 19:\n\t\tif (!CheckInventory (\"HasClass\") && !Override) {crate = 0; restart;}\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessage(s:\"RESIGNED\"; HUDMSG_FADEOUT, 240+PlayerNumber(), CR_DarkRed, 0.5, 0.35, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/resi\",255);\n\t\tSetFont(\"SMALLFONT\");\n\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tTeleport(71);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tTeleport(70);\n\n\t\tACS_ExecuteAlways(95, 0);\n\t\tLog(n:0, s:\" gets Resign Crate.\");\n\t\tbreak;\n\tcase 13:\n\tcase 20:\n\t\tSetFont(\"SMALLFONT\");\n\n\t\tif (!Override) {\n\t\t\tif (CheckInventory (\"PowerSpeedUpgrade\")) {crate = 0; restart;}\n\n\t\t\t// this crate ruins stealth due to speed trails\n\t\t\tif (CheckInventory (\"StealthLaserRifle\") || CheckInventory (\"Knife\")) {crate = 0; restart;}\n\n\t\t\t// also blurspheres\n\t\t\tif (CheckInventory (\"PowerInvisibility\")) {crate = 0; restart;}\n\t\t}\n\n\t\tLocalAmbientSound(\"powerup/sped\",255);\n\t\tHudMessage (s:\"\\cDSpeed upgraded!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tGiveInventory(\"SpeedUpgrade\",1);\n\t\tLog(n:0, s:\" gets Speed Upgrade.\");\n\t\tbreak;\n\tcase 14:\n\tcase 28:\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cJYou lost \\cQ$\\cD\", d:CreditAwardAmount;\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/stol\",255);\n\t\tDelay(4);\n\t\tLocalAmbientSound(\"powerup/stolsound\",255);\n\t\tTakeCreditsSilent(Experience[PlayerNumber()+1], CreditAwardAmount);\n\t\tLog(n:0, s:\" gets Credits Stolen.\");\n\t\tbreak;\n\tcase 15:\n\t\tif (CheckInventory (\"TimeGun\") && !Override) {crate = 0; restart;}\n\n\t\tLocalAmbientSound (\"powerup/time\", 127);\n\t\tLocalAmbientSound (\"misc/timewarp\", 64);\n\n\t\tSetFont (\"SMALLFONT\");\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed player\\cJ got \\cITime Gun Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"\\cNBlue player\\cJ got \\cITime Gun Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tGiveInventory(\"TimeGunAmmo\",30);\n\t\tGiveInventory(\"TimeGun\",1);\n\n\t\tHudMessage (s:\"You got the \\cITime Gun!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tLog(n:0, s:\" gets Time Gun Crate.\");\n\t\tRecountTimeCops ();\n\t\tbreak;\n\tcase 29:\n\tcase 30:\n\tcase 31:\n\tcase 32:\n\tcase 33:\n\tcase 34:\n\tcase 56:\n\t\t// [Dusk] high rank dudes get less of these\n\t\tif (Rank[PlayerNumber()] >= RANK_LIEUTENANT && !random (0, 2)) {Crate = 0; restart;}\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessage(s:\"BOMB CRATE!\"; HUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tif (GetCVar (\"aow_oldbombcrate\")) {\n\t\t\tAmbientSound(\"weapons/rocklx\",255);\n\t\t\tSetFont (\"SMALLFONT\");\n\t\t\tHudMessageBold (s:\"Some poor bugga got the bomb crate\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t\tLog (n:0, s:\" gets bomb crate and goes boom boom.\");\n\t\t\tGiveInventory (\"IsBombCrate\", 1);\n\t\t\tdelay(1);\n\t\t\tThing_Destroy (ActivatorTID(), 1); // death state spawns big boom\n\t\t\tterminate;\n\t\t}\n\n\t\tSetFont (\"SMALLFONT\");\n\t\tHudMessageBold (n:0, s:\" is gonna blow!!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tif (PlayerTeam() == TEAM_BLUE)\n\t\t\tGiveInventory (\"BombCrateFXGiverBlue\", 1);\n\t\telse\n\t\t\tGiveInventory (\"BombCrateFXGiverRed\", 1);\n\n\t\tActivatorSound (\"powerup/bomb\", 127);\n\n\t\tfor (i = 0; i <= 3; i++) {\n\t\t\tif (GetHealth() <= 0) {\n\t\t\t\tFadeTo (0, 0, 0, 0, 1.0);\n\t\t\t\tterminate;\n\t\t\t}\n\n\t\t\t// CancelFade () doesn't work online\n\t\t\tif (PlayerTeam() == TEAM_BLUE)\n\t\t\t\tFadeTo (0, 0, 255, i*0.1, 1.0);\n\t\t\telse\n\t\t\t\tFadeTo (255, 128, 0, i*0.1, 1.0);\n\n\t\t\tdelay (35);\n\t\t}\n\n\t\tif (PlayerTeam() == TEAM_BLUE)\n\t\t\tFadeTo (0, 0, 255, 0.48, 0.8);\n\t\telse\n\t\t\tFadeTo (255, 128, 0, 0.48, 0.8);\n\n\t\tdelay (28);\n\t\tFadeTo (0, 0, 0, 0, 1.0);\n\t\tif (!CheckInventory (\"IsInSpawnRoom\")) GiveInventory (\"IsKamikaze\", 1);\n\t\tdelay (1);\n\t\tThing_Destroy (ActivatorTID(), 1);\n\t\tterminate;\n\tcase 35:\n\t\tSetFont(\"SMALLFONT\");\n\t\tif(CrateTime == True)\n\t\t{\n\t\t\tACS_ExecuteAlways(309, 0);\n\t\t\tterminate;\n\t\t}\n\t\tAmbientSound(\"weapons/rocklx\",255);\n\t\tAmbientSound(\"powerup/crsh\",255);\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t{\n\t\t\tHudMessageBold (s:\"Poor \\cARed Team\\cJ got \\cRBase Crasher\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t\tThing_Damage(201,4000,0);\n\t\t\tThing_Damage(203,4000,0);\n\t\t\tThing_Damage(205,4000,0);\n\t\t\tThing_Damage(207,4000,0);\n\t\t\tThing_Damage(214,2500,0);\n\t\t}\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t{\n\t\t\tHudMessageBold (s:\"Poor \\cNBlue Team\\cJ got \\cRBase Crasher\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t\tThing_Damage(101,4000,0);\n\t\t\tThing_Damage(103,4000,0);\n\t\t\tThing_Damage(105,4000,0);\n\t\t\tThing_Damage(107,4000,0);\n\t\t\tThing_Damage(114,2500,0);\n\t\t}\n\t\tHudMessage (s:\"\\cRBase crasher!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tACS_ExecuteAlways (930, 0, BUILDING_ALL, PlayerTeam()); // update the hud\n\t\tbreak;\n\tcase 37:\n\tcase 38:\n\t\tif (CheckInventory (\"UtilityGun\") && !Override) {crate = 0; restart;}\n\t\tSetFont(\"SMALLFONT\");\n\t\tGiveInventory(\"UtilityGun\", 75);\n\t\tGiveInventory(\"Utility_Ammo\", 75);\n\t\tLog(n:0, s:\" gets Utility Gun crate.\");\n\t\tHudMessage (s:\"You got the \\cKUtility Gun!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tdelay (2*35);\n\t\tHudMessage (s:\"Use \\cFAlt-Fire\\cJ for \\cNitem selection menu!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tbreak;\n\tcase 39:\n\tcase 40:\n\t\tif ((CheckInventory (\"LaserArmor\") || CheckInventory (\"PowerLaserResistance\")) && !Override) {\n\t\t\tcrate = 1; // armor upgrade\n\t\t\trestart;\n\t\t}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cNLaser resistance!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/resistlaser\", 127);\n\t\tLocalAmbientSound (\"misc/armor_pkup\", 127);\n\t\tGiveInventory (\"LaserArmor\", 1);\n\t\tLog(n:0, s:\" gets Laser Resistance.\");\n\t\tbreak;\n\tcase 41:\n\tcase 42:\n\t\tif ((CheckInventory (\"ExplosionArmor\") || CheckInventory (\"PowerExplosiveResistance\")) && !Override) {\n\t\t\tcrate = 1; // armor upgrade\n\t\t\trestart;\n\t\t}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cIExplosive resistance!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/resistexplosive\", 127);\n\t\tLocalAmbientSound (\"misc/armor_pkup\", 127);\n\t\tGiveInventory (\"ExplosionArmor\", 1);\n\t\tLog(n:0, s:\" gets Explosive Resistance.\");\n\t\tbreak;\n\tcase 43:\n\tcase 44:\n\t\tif ((CheckInventory (\"BulletArmor\") || CheckInventory (\"PowerBulletResistance\")) && !Override) {\n\t\t\tcrate = 1; // armor upgrade\n\t\t\trestart;\n\t\t}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cUBulletproof Vest!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound(\"powerup/resistbullet\",255);\n\t\tLocalAmbientSound (\"misc/armor_pkup\", 127);\n\t\tGiveInventory (\"BulletArmor\", 1);\n\t\tLog(n:0, s:\" gets Bulletproof Vest.\");\n\t\tbreak;\n\tcase 45:\n\t\tif (!Override && (CrateTime || CheckInventory(\"IsMech\") || !MechEnabled || CheckInventory (\"GuardianPowerup\"))) {\n\t\t\tcrate = 0; restart;\n\t\t}\n\n\t\tLog(n:0, s:\" gets Guardian crate.\");\n\t\tGiveInventory(\"GuardianPowerup\",1);\n\t\tGiveInventory(\"FlamerAmmo\", 200);\n\t\tGiveInventory(\"NukeAmmo\", 1);\n\n\t\tLocalAmbientSound (\"switch/lrm\", 127);\n\n\t\tSetFont (\"SMALLFONT\");\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed player\\cJ got \\cKGuardian Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"\\cNBlue player\\cJ got \\cKGuardian Crate!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tHudMessage (s:\"\\cJGuardian suit!\\nPress \\cF\", k:\"invuse\", s:\"\\cJ to enter\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\tbreak;\n\tcase 46:\n\t\tif (CrateTime || CheckInventory(\"IsMech\") || CheckInventory(\"PowerBerserk\")) {\n\t\t\tcrate = 0; restart;\n\t\t}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tGiveInventory (\"BerserkSwitch\", 1);\n\t\tdelay (5);\n\t\tGiveInventory (\"BerserkHue\", 1);\n\n\t\tSetFont (\"SMALLFONT\");\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed player\\cJ got \\cGBerserk!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"\\cNBlue player\\cJ got \\cGBerserk!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tHudMessage (s:\"\\cGBerserk!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLog(n:0, s:\" gets Berserk Crate.\");\n\t\tbreak;\n\tcase 47:\n\tcase 48:\n\t\tif (CheckInventory (\"HealingRadiusItem\") && !Override) {crate = 0; restart;}\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cAHealing Radius!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tGiveInventory(\"HealingRadiusItem\",1);\n\t\tACS_ExecuteAlways (352, 0);\n\t\tLog(n:0, s:\" gets Healing Radius crate.\");\n\t\tbreak;\n\tcase 49:\n\tcase 50:\n\t\tfor (int k = 0; k<32; k++) {\n\t\t\tif ( PlayerInGame(k) && GetPlayerInfo(k,PLAYERINFO_TEAM) == PlayerTeam() )\n\t\t\t{\n\t\t\t\tif ( GetActorProperty(3800+k,APROP_Health) < GetActorProperty(3800+k,APROP_SpawnHealth) )\n\t\t\t\t\tSetActorProperty(3800+k,APROP_Health,GetActorProperty(3800+k,APROP_SpawnHealth));\n\t\t\t}\n\t\t}\n\n\t\tLog(n:0, s:\" gets Team Revival crate.\");\n\n\t\tSetFont (\"SMALLFONT\");\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed Team\\cJ got \\cATeam Revival!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tHudMessageBold (s:\"\\cNBlue Team\\cJ got \\cATeam Revival!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tHudMessage (s:\"\\cATeam revival!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tbreak;\n\tcase 51:\n\tcase 52:\n\t\tif (!Override && CheckInventory (\"EagerBeaver\")) {crate = 0; restart;}\n\t\tSetFont (\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cKA chainsaw! Find some meat!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tGiveInventory (\"EagerBeaver\", 1);\n\t\tLog(n:0, s:\" gets Chainsaw crate.\");\n\n\t\t// [Dusk] The chainsaw replaces unarmed, therefore\n\t\t// if we use the fists, switch to the chainsaw.\n\t\tif (CheckWeapon (\"Unarmed\"))\n\t\t\tSetWeapon (\"EagerBeaver\");\n\t\telse\n\t\t\tLocalAmbientSound (\"weapons/sawup\", 127);\n\n\t\tTakeInventory (\"Unarmed\", 1);\n\t\tbreak;\n\tcase 53:\n\tcase 54:\n\t\tif (!Override && CheckInventory(\"MarineBeaconItem\")) {crate = 0; restart;}\n\t\tif (AIMarineCount >= MAX_MARINES) {crate = 0; restart;}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cFMarine Beacon!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tGiveInventory(\"MarineBeaconItem\",1);\n\t\tACS_ExecuteAlways (352, 0);\n\t\tLog(n:0, s:\" gets Marine Beacon.\");\n\t\tbreak;\n\tcase 55:\n\t\tif (Timer() < 10*60*35 || CheckInventory (\"CrateChooser\") || TournamentMode) {\n\t\t\tif (!Override) {Crate = 0; restart;}\n\t\t}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tif (PlayerTeam() == TEAM_RED)\n\t\t\tHudMessageBold (s:\"\\cARed player\\cJ got \\cKOpen Deck!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\telse\n\t\t\tHudMessageBold (s:\"\\cNBlue player\\cJ got \\cKOpen Deck!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tHudMessage (s:\"\\cKOPEN DECK!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\n\t\tLocalAmbientSound (\"powerup/invisound\", 127);\n\t\tGiveInventory (\"CrateChooser\", 1);\n\t\tLog (n:0, s:\" gets Open Deck.\");\n\t\tbreak;\n\tcase 57:\n\tcase 58:\n\t\tSetFont(\"SMALLFONT\");\n\t\tGiveInventory (\"ThermalCloakingTime\", 90);\n\t\tACS_ExecuteAlways(953, 0);\n\t\tLog(n:0, s:\" gets Thermal Cloaking.\");\n\t\tHudMessage (s:\"\\cUThermal cloaking!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tdelay (35);\n\t\tHudMessage (s:\"Turrets cannot see you for 90 seconds\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tbreak;\n\tcase 59:\n\tcase 60:\n\t\t// high rank dudes get less of these\n\t\tif (Rank[PlayerNumber()] >= RANK_LIEUTENANT && !random (0, 2)) {Crate = 0; restart;}\n\t\tif (CheckInventory (\"IsMech\")) {crate = 0; restart;}\n\t\tSetFont (\"BIGFONT\");\n\t\tHudMessage (s:\"Disarm crate!\"; HUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\tSetFont (\"SMALLFONT\");\n\t\tHudMessageBold (s:\"Somebody went and lost all of his weapons.\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLog (n:0, s:\" gets disarm crate.\");\n\n\t\tCheckAndRemove (\"Boomstick\");\n\t\tCheckAndRemove (\"DoubleShotgun\");\n\t\tCheckAndRemove (\"Rifle\");\n\t\tCheckAndRemove (\"GaussRifle\");\n\t\tCheckAndRemove (\"Grenade_Launcher\");\n\t\tCheckAndRemove (\"StealthLaserRifle\");\n\t\tCheckAndRemove (\"LaserRifle\");\n\t\tCheckAndRemove (\"TimeGun\");\n\t\tCheckAndRemove (\"MissileLauncher\");\n\t\tCheckAndRemove (\"CrateChooser\");\n\t\tCheckAndRemove (\"LaserChaingun\");\n\t\tCheckAndRemove (\"UtilityGun\");\n\t\tCheckAndRemove (\"PlasmaCannon\");\n\t\tCheckAndRemove (\"ArtilleryCannon\");\n\t\tCheckAndRemove (\"ChemicalSprayer\");\n\t\tCheckAndRemove (\"TiberiumAutorifleWeak\");\n\t\tCheckAndRemove (\"TiberiumAutorifle\");\n\t\tCheckAndRemove (\"FragGrenade\");\n\t\tCheckAndRemove (\"RepairGunUpgrade\");\n\t\tif (Rank[PlayerNumber()] != RANK_COMMANDO) CheckAndRemove (\"RepairGun\");\n\t\tCheckAndRemove (\"HealGun\");\n\t\tCheckAndRemove (\"BombSquadGun\");\n\t\tCheckAndRemove (\"SubMachineGun\");\n\t\tCheckAndRemove (\"Flamer\");\n\t\tCheckAndRemove (\"ShockRifle\");\n\t\tCheckAndRemove (\"SniperRifle\");\n\t\tCheckAndRemove (\"SniperRifleWeak\");\n\t\tCheckAndRemove (\"PlasmaGun\");\n\t\tCheckAndRemove (\"MachineGun\");\n\t\tCheckAndRemove (\"GatlingGun\");\n\t\tCheckAndRemove (\"JumpjetGatlingGun\");\n\n\t\tif (CheckInventory (\"EagerBeaver\")) {\n\t\t\tTakeInventory (\"EagerBeaver\", 1);\n\t\t\tGiveInventory (\"Unarmed\", 1);\n\t\t}\n\n\t\tif (CheckInventory (\"Knife\"))\n\t\t\tSetWeapon (\"Knife\");\n\t\telse\n\t\t\tSetWeapon (\"Handgun\");\n\n\t\tSetActorSpeed (0, 1.0);\n\t\tPlayerSpeeds[PlayerNumber()] = 1.0;\n\n\t\tGiveCredits (-1, CheckInventory (\"Refunds\"));\n\t\tTakeInventory (\"Refunds\", CheckInventory (\"Refunds\"));\n\t\tSpawnSpotForced (\"TeleportFog\", 0, 0, 0);\n\t\tdelay (15);\n\t\tActivatorSound (\"heavy/argh\", 127);\n\t\tbreak;\n\tcase 61:\n\tcase 62:\n\t\tif (CheckInventory(\"PowerFatigue\")) {crate = 0; restart;}\n\n\t\t// this crate ruins stealth due to speed trails\n\t\tif (CheckInventory (\"StealthLaserRifle\") || CheckInventory (\"Knife\")) {\n\t\t\tCrate = 0; restart;\n\t\t}\n\n\t\tif (CheckInventory (\"PowerInvisibility\")) {\n\t\t\tCrate = 0; restart;\n\t\t}\n\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cAFatigue!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t//LocalAmbientSound(\"powerup/downsped\",255);\n\t\tGiveInventory(\"SpeedDowngrade\",1);\n\t\tLog(n:0, s:\" gets Fatigue crate.\");\n\t\tbreak;\n\tcase 63:\n\tcase 64:\n\t\tif (CheckInventory (\"RemoteC4\") && !Override) {\n\t\t\tACS_ExecuteAlways(309, 0);\n\t\t\tterminate;\n\t\t}\n\t\tSetFont (\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cFRemote C4!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tLocalAmbientSound (\"c4/remote\", 127);\n\t\tGiveInventory (\"RemoteC4\", 1);\n\t\tGiveInventory (\"RemoteC4Ammo\", 5);\n\t\tLog(n:0, s:\" gets Remote C4 crate.\");\n\t\tbreak;\n\tcase 65:\n\tcase 66:\n\t\tif (!Override) {\n\t\t\t// stealth just breaks this\n\t\t\tif (CheckInventory (\"StealthLaserRifle\") || CheckInventory (\"Knife\")) {\n\t\t\t\tcrate = 0;\n\t\t\t\trestart;\n\t\t\t}\n\n\t\t\t// no duplicates\n\t\t\tif (CheckInventory (\"PowerInvisibility\")) {\n\t\t\t\tcrate = 0;\n\t\t\t\trestart;\n\t\t\t}\n\t\t}\n\n\t\tSetFont (\"SMALLFONT\");\n\t\tHudMessage (s:\"\\cFPartial Invisibility!\";\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\tGiveInventory (\"BlurSphere\", 1);\n\t\tLog (n:0, s:\" gets Partial Invisibility crate.\");\n\t\tbreak;\n\tcase 67:\n\tcase 68:\n\t\tstr RandomWeapon = -1;\n\t\tstr x;\n\n\t\t// Try determine a random weapon the player doesn't have.\n\t\tfor (i = 0; i <= 7; i++) {\n\t\t\tx = NormalWeaponNames[random (0, MAX_NORMAL_WEAPONS-1)];\n\t\t\tif (!CheckInventory (x)) {\n\t\t\t\tRandomWeapon = x;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (RandomWeapon != -1) {\n\t\t\tLocalAmbientSound (\"misc/w_pkup\", 127);\n\t\t\tHudMessage (s:\"\\cFRandom Weapon!\\nYou get a \\cF\", s:RandomWeapon;\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\n\t\t\tGiveInventory (RandomWeapon, 1);\n\t\t} else {\n\t\t\t// could not find a weapon the player doesn't have. reroll\n\t\t\tCrate = 0;\n\t\t\trestart;\n\t\t}\n\t}\n}\n\n// THERMAL CLOAKING\nscript 953 (void) {\n\tint k = 0;\n\tSetPlayerProperty(0,1,PROP_NOTARGET);\n\twhile (CheckInventory (\"ThermalCloakingTime\") > 0)\n\t{\n\t\tk = CheckInventory (\"ThermalCloakingTime\");\n\t\tSetFont(\"SMALLFONT\");\n\t\tHudMessage(s:\"Thermal Cloaking: \",d:k,s:\" seconds remaining\";\n\t\t\t0,8600+PlayerNumber(),CR_GOLD,1.0,0.0,2.0);\n\t\tdelay(35);\n\t\tTakeInventory (\"ThermalCloakingTime\", 1);\n\t}\n\tSetPlayerProperty(0,0,PROP_NOTARGET);\n\tHudMessage(s:\"WARNING! Thermal Cloaking: 0 seconds remaining\";\n\t\tHUDMSG_FADEOUT,8600+PlayerNumber(),CR_RED,1.0,0.0,5.0,2.0);\n}\n\nscript 966 (void) CLIENTSIDE {\n\t// [Dusk] Don't display this actor for the player who's currently\n\t// getting the bomb crate - said player gets a fade instead.\n\tif (ACS_ExecuteWithResult (651, 0) == ConsolePlayer) {\n\t\tSetActorState (0, \"Clear\");\n\t\tterminate;\n\t}\n\n\tif (ACS_ExecuteWithResult (964, 3) <= 0) {\n\t\tSetActorState (0, \"Clear\");\n\t\tterminate;\n\t}\n\n\tint x = ACS_ExecuteWithResult (964, 0);\n\tint y = ACS_ExecuteWithResult (964, 1);\n\tint z = ACS_ExecuteWithResult (964, 2);\n\tSetActorPosition (0, x, y, z, 0);\n}\n\n// target information\nscript 964 (int type, int value) {\n\tSetActivatorToTarget (0);\n\tSetResultValue (0);\n\tswitch (type) {\n\tcase 0: SetResultValue (GetActorX (0)); break;\n\tcase 1: SetResultValue (GetActorY (0)); break;\n\tcase 2: SetResultValue (GetActorZ (0)); break;\n\tcase 3: SetResultValue (GetHealth ()); break;\n\tcase 4: SetResultValue (GetActorAngle (0)); break;\n\tcase 5: SetResultValue (ActivatorTID ()); break;\n\tcase 6: SetPlayerProperty (0, value, PROP_FROZEN); break;\n\tcase 7: SetPlayerProperty (0, value, PROP_TOTALLYFROZEN); break;\n\tcase 8: SetResultValue (CheckInventory (value)); break;\n\tcase 9: SetResultValue (PlayerNumber ()); break;\n\t}\n}"
},
{
"source": "pk3",
"name": "acs_source/a_death.txt",
"contents": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * All Out War 2 death script\n * Credit to VoltlocK for originally creating the engine\n * With modifications by Eruanna, Dusk and the Omega Team\n *\n * You may use portions of this script in your project as long as you give\n * credit where credit is due. Please don't be lame and just copy-paste any\n * of this and call it your own. Thanks!\n */\n\n// death script: victim POV\nscript 994 DEATH {\n\tThing_ChangeTID (0, 9999);\n\tTakeInventory (\"ThermalCloakingTime\", 90);\n\tTakeInventory (\"InUtilMenu\", 1);\n\tSetPlayerProperty (0, 0, PROP_FROZEN);\n\tSetPlayerProperty (0, 0, PROP_TOTALLYFROZEN);\n\n\t// tiberium dropped by dead harvesters\n\tif (CheckInventory (\"TiberiumCrystal\") && !CheckInventory (\"IsInSpawnRoom\"))\n\t\tSpawnSpotForced (\"TiberiumCrystalDropped\", 0, 0, 0);\n\n\t// bomb pack disarm sound\n\tif (CheckWeapon (\"BombPack\") && !CheckInventory (\"IsTerrorist\")) ActivatorSound (\"c4/disarm\", 127);\n\n\t// activate plasma cannon cooldown, if player had a plasma cannon\n\tif (CheckInventory (\"PlasmaCannon\")) PlasmaCooldown[PlayerNumber()] = Timer() + PlasmaCooldownTime;\n\n\t// how much is this thing worth?\n\tint points = 1;\n\tif (CheckInventory (\"IsMech\")) {\n\t\tif (CheckInventory (\"OrcaWeapons\") ||\n\t\t\tCheckInventory (\"RavenWeapons\")) {\n\n\t\t\tpoints = 3;\n\t\t} else if (CheckInventory (\"WolverineWeapons\") ||\n\t\t\tCheckInventory (\"MadCatWeapons\") ||\n\t\t\tCheckInventory (\"TitanWeapons\") ||\n\t\t\tCheckInventory (\"GuardianWeapons\")) {\n\n\t\t\tpoints = 4;\n\t\t}\n\t}\n\n\t// were we on a spree?\n\tint killer_t = ACS_ExecuteWithResult (964, 5);\n\tint killer_p = ACS_ExecuteWithResult (964, 9);\n\t//Log (n:0, s:\"\\c-: I am \", d:ActivatorTID(), s:\" and was killed by \", d:killer_t, s:\" (\", n:killer_p+1, s:\")\");\n\tif (CheckInventory (\"SpreeCount\") >= 5) {\n\t\tSetFont (\"SMALLFONT\");\n\t\tif (killer_p != PlayerNumber() && killer_p != -1) {\n\t\t\t// killed by a player\n\t\t\tHudMessageBold (n:0, s:\"\\c-'s killing spree was ended by \", n:killer_p+1, s:\".\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t} else if (killer_t == 115) {\n\t\t\t// killed by blue obelisk\n\t\t\tHudMessageBold (n:0, s:\"\\c-'s killing spree was ended by the \\chBlue Obelisk\\c-.\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t} else if (killer_t == 215) {\n\t\t\t// killed by red obelisk\n\t\t\tHudMessageBold (n:0, s:\"\\c-'s killing spree was ended by the \\cgRed Obelisk\\c-.\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t} else if (killer_p == PlayerNumber ()) {\n\t\t\t// killed by something (self, env. kills, etc)\n\t\t\tHudMessageBold (n:0, s:\"\\c- was lookin' good until he tripped over a log!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t}\n\t}\n\n\t/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\t * KILLER POV STARTS HERE\n\t */\n\n\tint n0 = PlayerNumber();\n\tint t0 = PlayerTeam();\n\tSetActivatorToTarget (0);\n\tif ((ActivatorTID () < 3800 || ActivatorTID () > 3831) && ActivatorTID () != 9999) terminate;\n\n\tint n1 = PlayerNumber();\n\tint t1 = PlayerTeam();\n\n\t// remove tickets from the victim team\n\tTakeTickets (t0, points);\n\n\t// no points for suicides\n\tif (n0 != n1 && n1 != -1) {\n\t\tGivePoints (2*points);\n\t\tACS_ExecuteAlways (931, 0);\n\n\t\tLocalAmbientSound (\"game/boink\", 127);\n\t\tGiveCredits (-1, CreditFragAward);\n\t\tAddExperience (50);\n\n\t\tdelay (5);\n\n\t\tif (!FirstBlood) {\n\t\t\t// we got first blood!\n\t\t\tFirstBlood = true;\n\n\t\t\tHudMessageBold (n:0, s:\"\\c- gets first blood!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t}\n\n\t\t// check sprees\n\t\tGiveInventory (\"SpreeCount\", 1);\n\t\tSetFont (\"SMALLFONT\");\n\t\tswitch (CheckInventory (\"SpreeCount\")) {\n\t\tcase 5:\n\t\t\tHudMessageBold (n:0, s:\"\\c- is on a killing spree!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tHudMessageBold (n:0, s:\"\\c- is on a rampage!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t\tbreak;\n\t\tcase 15:\n\t\t\tHudMessageBold (n:0, s:\"\\c- is dominating!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_TAN,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t\tbreak;\n\t\tcase 20:\n\t\t\tHudMessageBold (n:0, s:\"\\c- is unstoppable!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_YELLOW,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t\tbreak;\n\t\tcase 25:\n\t\t\tHudMessageBold (n:0, s:\"\\c- is Godlike!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_ORANGE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t\tbreak;\n\t\tcase 30:\n\t\t\tHudMessageBold (n:0, s:\"\\c- is Wicked Sick!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_RED,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tACS_ExecuteAlways (992, 0);\n}\n\n// Guardian stomp health\nscript 923 (void) {\n\tSetActivatorToTarget (0);\n\tif (!CheckWeapon (\"GuardianWeapons\")) terminate;\n\tSetHealth (GetHealth () + 100);\n\tif (GetHealth () > GetSpawnHealth ()) SetHealth (GetSpawnHealth ());\n}\n\n// [SP] Fragging a monster\nScript 947 (int Amount) {\n\tif (ActivatorTID() >= 3800 && ActivatorTID() <= 3831) {\n\t\tLocalAmbientSound(\"game/boink\",255);\n\t\tAddExperience(10 * Amount);\n\t\tAddCredits(Credits[PlayerNumber()+1], 15 * Amount);\n\t}\n}"
},
{
"source": "pk3",
"name": "acs_source/a_dmgovertime.txt",
"contents": "//Player burnt and is burning script, unfortunately the killer who set the player alight is not awarded for this.\nscript 360 (void) {\n\tdelay (1);\n\n\tif (CheckInventory(\"CrispyPlayer\")) terminate;\n\n\tGiveInventory(\"CrispyPlayer\",1);\n\tint n = 10;\n\twhile (n > 0 && GetHealth() > 1) {\n\t\tThing_Damage2 (0, 1, \"FireSpecial\");\n\t\tdelay(5);\n\t\tn--;\n\t}\n\n\tTakeInventory(\"CrispyPlayer\",1);\n}\n\n//Player poisoned and is burning script, unfortunately the killer who set the player alight is not awarded for this.\nscript 361 (void) {\n\tdelay(1);\n\n\tif (CheckInventory(\"CrispyPlayer2\")) terminate;\n\n\tGiveInventory(\"CrispyPlayer2\", 1);\n\tint n = 20;\n\twhile (n > 0 && GetHealth() > 1) {\n\t\tThing_Damage2 (0, 1, \"ChemicalSpecial\");\n\t\tdelay(8);\n\t\tn--;\n\t}\n\tTakeInventory (\"CrispyPlayer2\", 1);\n}"
},
{
"source": "pk3",
"name": "acs_source/a_donate.txt",
"contents": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * All Out War 2 donation script\n * Credit to VoltlocK for originally creating the engine\n * With modifications by Eruanna, Dusk and the Omega Team\n *\n * You may use portions of this script in your project as long as you give\n * credit where credit is due. Please don't be lame and just copy-paste any\n * of this and call it your own. Thanks!\n */\n\nint Donor[32];\n\nFunction int DonateCredits (int Player, int NewCredits) {\n\tCredits[PlayerNumber()+1] -= NewCredits;\n\tif(Credits[PlayerNumber()+1] < 0)\n\t\tCredits[PlayerNumber()+1] = 0;\n\n\tCredits[CheckInventory(\"DonationName\")+1] += NewCredits;\n\n\t// int donor = PlayerNumber()+1;\n\tLocalAmbientSound(\"powerup/stolsound\",255);\n\n\tSETFONT(\"SMALLFONT\");\n\tHudMessage(s:\"You have donated \\cf$\",d:NewCredits,s:\"\\cd to \", n:CheckInventory(\"DonationName\")+1;\n\t\tHUDMSG_FADEOUT, 480+PlayerNumber(), CR_Green, 0.5, 0.55, 2.0, 1.0);\n\n\tDonor[CheckInventory(\"DonationName\")] = PlayerNumber(); // used in the message to the donatee\n\tGiveActorInventory (3800+CheckInventory(\"DonationName\"), \"DonationMessage\", 1);\n\n\treturn NewCredits;\n}\n\nfunction void ShowCurrentDonationMenu (void)\n{\n\tint DonationName = CheckInventory(\"DonationName\");\n\n\tif (DonationName > 31)\n\t\tTakeInventory(\"DonationName\", 31);\n\n\tint color = CR_BLUE;\n\tif (PlayerTeam() == TEAM_RED) color = CR_RED;\n\n\tSETFONT(\"DoomFont\");\n\tHudMessage(s:\"\\cJ== Make a donation!\",\n\ts:\"\\n\\cFChange Name \\cK-> \\cI\", k:\"DonationName\",\n\ts:\"\\n\\cFDonate \\cQ$\\cD100 \\cK-> \\cI\", k:\"DonationGive\",\n\ts:\"\\n\\n\", n:DonationName+1, s:\"\\n\\cKCredits: \\cQ$\\cD\", d:Credits[DonationName+1],\n\ts:\"\\n\\cKHealth: \", d:GetActorHealth (3800+DonationName), s:\" / \", d:GetActorSpawnHealth (3800+DonationName),\n\ts:\"\\n\\cK\", s:DisplayName (DonationName);\n\t\tHUDMSG_PLAIN, 6000+PlayerNumber(), color, -0.65, 0.65, 1.15);\n}\n\n//Donations\nscript 333 (void) NET\n{\n\tif(CheckInventory(\"DonateMenu\") == 0)\n\t\tterminate;\n\n\tif(CheckInventory(\"InGame\") == 0)\n\t\tterminate;\n\n\tShowCurrentDonationMenu();\n\n\tdelay(35);\n\trestart;\n\n}\n\nscript 334 (int Which) NET {\n\tint CheckValid = 1;\n\n\tif(CheckInventory(\"InGame\") == 0)\n\t\tterminate;\n\n\tif(Which == 1 && CheckInventory(\"DonateMenu\") == 1)\n\t{\n\t\tGiveInventory(\"DonationName\",1);\n\t\twhile ( CheckValid )\n\t\t{\n\t\t\tif ( GetPlayerInfo(0+CheckInventory(\"DonationName\"),PLAYERINFO_TEAM) != PlayerTeam() )\n\t\t\t\tGiveInventory(\"DonationName\",1);\n\t\t\telse\n\t\t\t\tCheckValid = 0;\n\t\t\tif ( CheckInventory(\"DonationName\") > 32 )\n\t\t\t\tTakeInventory(\"DonationName\",100);\n\t\t}\n\t\tShowCurrentDonationMenu();\n\t}\n\telse if(Which == 2 && CheckInventory(\"DonateMenu\") == 1)\n\t{\n\t\tif(GetPlayerInfo(0+CheckInventory(\"DonationName\"),PLAYERINFO_TEAM) != PlayerTeam()) {\n\t\t\tSETFONT(\"BigFont\");\n\t\t\tHudMessage(s:\"That player is not on your team!!\";\n\t\t\t\tHUDMSG_FADEOUT, 480+PlayerNumber(), CR_DarkRed, 0.5, 0.55, 2.0, 1.0);\n\t\t\tterminate;\n\t\t}\n\n\t\tif (CheckInventory(\"DonationName\") == PlayerNumber()) {\n\t\t\tSETFONT(\"BigFont\");\n\t\t\tHudMessage(s:\"You cannot donate to yourself!\";\n\t\t\t\tHUDMSG_FADEOUT, 480+PlayerNumber(), CR_DarkRed, 0.5, 0.55, 2.0, 1.0);\n\t\t\tterminate;\n\t\t}\n\n\t\tif (Credits[PlayerNumber()+1] < 100) {\n\t\t\tSETFONT(\"BigFont\");\n\t\t\tHudMessage(s:\"You can't afford this!\";\n\t\t\t\tHUDMSG_FADEOUT, 480+PlayerNumber(), CR_DarkRed, 0.5, 0.55, 2.0, 1.0);\n\t\t\tterminate;\n\t\t}\n\t\tDonateCredits(CheckInventory(\"DonationName\"), 100);\n\t}\n\telse if(Which == 3)\n\t{\n\t\tSETFONT(\"SMALLFONT\");\n\t\tHudMessage(s:\"You have been donated \\cf$100\"; HUDMSG_FADEOUT, 480+PlayerNumber(), CR_Green, 0.5, 0.55, 2.0, 1.0);\n\t}\n}\n\nscript 335 (void) NET\n{\n\tint CheckValid = 1;\n\n\tif(CheckInventory(\"InGame\") == 0)\n\t\tterminate;\n\n\tif(CheckInventory(\"DonateMenu\") == 1)\n\t{\n\t\tTakeInventory(\"DonateMenu\",1);\n\t\tHudMessage(s:\"\"; HUDMSG_PLAIN, 6000+PlayerNumber(), CR_Green, 0.0, 0.2, 0.4); // clear donation menu\n\t\tterminate;\n\t}\n\telse\n\t{\n\t\tGiveInventory(\"DonateMenu\",1);\n\t\twhile (CheckValid) {\n\t\t\tif (GetPlayerInfo(0+CheckInventory(\"DonationName\"),PLAYERINFO_TEAM) != PlayerTeam())\n\t\t\t\tGiveInventory(\"DonationName\", 1);\n\t\t\telse\n\t\t\t\tCheckValid = 0;\n\t\t\tif (CheckInventory(\"DonationName\") > 31)\n\t\t\t\tTakeInventory(\"DonationName\", 31);\n\t\t}\n\t\tShowCurrentDonationMenu();\n\t\tACS_ExecuteAlways(333, 0);\n\t}\n}"
},
{
"source": "pk3",
"name": "acs_source/a_functions.txt",
"contents": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * All Out War 2 miscallenous script functions\n * Credit to VoltlocK for originally creating the engine\n * With modifications by Eruanna, Dusk and the Omega Team\n *\n * You may use portions of this script in your project as long as you give\n * credit where credit is due. Please don't be lame and just copy-paste any\n * of this and call it your own. Thanks!\n */\n\n// MATH FUNCTIONS\nfunction int abs (int n) {if (n<0) return -n; return n;}\nfunction int msqr (int n) {return n*n;}\n\n// [SP] This came from the ZDoom wiki\nfunction int sqrt(int number)\n{\n\tif(number <= 3)\n\t{\n\t\tif(number > 0)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tint oldAns = number >> 1, // initial guess\n\t newAns = (oldAns + number / oldAns) >> 1; // first iteration\n\n\t// main iterative method\n\twhile(newAns < oldAns) {\n\t\toldAns = newAns;\n\t\tnewAns = (oldAns + number / oldAns) >> 1;\n\t}\n\n\treturn oldAns;\n}\n\n// [Dusk] check functions\n\n// [Dusk] returns 1 if player has $price money, discount taken into account\n// if not, prints the error message and returns 0\nfunction int CheckCredits(int price) {\n\tif (IsAdmin[PlayerNumber()]) return 1;\n\tprice = ACS_ExecuteWithResult (330, price);\n\n\tif(Credits[PlayerNumber()+1] < price) {\n\t\tTakeInventory(\"PurchaseToken\",1);\n\t\tLocalAmbientSound(\"misc/funds\",255);\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You need \\cQ$\\cD\", d:price-Credits[PlayerNumber()+1], s:\"\\c- more to purchase this!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\n\t\tif (GetLevelInfo (LEVELINFO_LEVELNUM) == 20 || GetLevelInfo (LEVELINFO_LEVELNUM) == 21)\n\t\t\tThrustThing((VectorAngle(GetActorVelX(0), GetActorVelY(0)) >> 8) + 128, 25, 0, 0);\n\t\treturn 0;\n\t}\n\n\treturn 1;\n}\n\n// [Dusk] returns 1 if player has no class, 0 of they have, along with error message\nfunction int IsResigned(void) {\n\tif (CheckInventory (\"HasClass\") == 0)\n\t\treturn 1;\n\n\tError (\"You need to resign first!\");\n\n\tif (GetLevelInfo (LEVELINFO_LEVELNUM) == 20 || GetLevelInfo (LEVELINFO_LEVELNUM) == 21)\n\t\tThrustThing((VectorAngle(GetActorVelX(0), GetActorVelY(0)) >> 8) + 128, 25, 0, 0);\n\n\treturn 0;\n}\n\n// [Dusk] returns 1 if player is pressing this button the second time\nfunction int IsSecondPress(str StatCard, int price) {\n\t// AOW20 skips this check for classes\n\tif ((GetLevelInfo (LEVELINFO_LEVELNUM) == 20 || GetLevelInfo (LEVELINFO_LEVELNUM) == 21) && (\n\t\tStatCard != \"WEAP01\" && StatCard != \"WEAP02\" &&\n\t\tStatCard != \"WEAP03\" && StatCard != \"WEAP04\" &&\n\t\tStatCard != \"WEAP05\" && StatCard != \"WEAP06\")) {return 1;}\n\n\tif (!CheckInventory(\"PurchaseToken\")) {\n\t\tACS_ExecuteWithResult (330, price);\n\t\tSetFont(StatCard);\n\t\tHudMessage(s:\"a\";\n\t\t\tHUDMSG_FADEOUT, 2100+PlayerNumber(), CR_Green, 0.25, 0.25, 3.0, 2.0);\n\t\tACS_ExecuteAlways (956, 0);\n\t\treturn 0;\n\t} else {\n\t\t// [Dusk] clear the card out once the class is purchased\n\t\tHudMessage(s:\"\"; HUDMSG_PLAIN, 2100+PlayerNumber(), CR_UNTRANSLATED, 0.0, 0.0, 0.01);\n\t}\n\treturn 1;\n}\n\n// this bit is in its own script because custom functions cannot use latent functions\nscript 956 (void) {\n\tGiveInventory(\"PurchaseToken\",1);\n\tDelay(35*1);\n\tTakeInventory(\"PurchaseToken\",1);\n\tterminate;\n}\n\n// [Dusk] tick display function\nfunction void DisplayTick (void) {\n\tLocalAmbientSound (\"c4/use\", 255);\n\t// SETFONT(\"TICK\");\n\t// HudMessage(s:\"a\"; HUDMSG_FADEOUT, 2100+PlayerNumber(), CR_DarkRed, 0.5, 0.5, 2.0, 1.0);\n}\n\nfunction void DisplayCross (void) {\n\tLocalAmbientSound (\"misc/nope\", 127);\n\t// SETFONT(\"NOENTRY\");\n\t// HudMessage(s:\"a\"; HUDMSG_FADEOUT, 2100+PlayerNumber(), CR_DarkRed, 0.5, 0.5, 2.0, 1.0);\n}\n\n// [Dusk] Barracks check\nfunction int CheckBarracks (int Team) {\n\tif (IsAdmin[PlayerNumber()]) return 1;\n\tif (!GotBarracks[Team]) {\n\t\tError (\"Your \\cFbarracks\\c- has been destroyed!\");\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n// [Dusk] Research Centre check\nfunction int CheckPlant (int Team) {\n\tif (IsAdmin[PlayerNumber()]) return 1;\n\tif (!GotPlant[Team]) {\n\t\tError (\"Your \\cFresearch centre\\c- has been destroyed!\");\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n// [Dusk] Refinery check\nfunction int CheckRefinery (int Team) {\n\tif (IsAdmin[PlayerNumber()]) return 1;\n\tif (!GotRefinery[Team]) {\n\t\tError (\"Your \\cFrefinery\\c- has been destroyed!\");\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n// [Dusk] War Factory check\nfunction int CheckFactory (int Team) {\n\tif (IsAdmin[PlayerNumber()]) return 1;\n\tif (!GotFactory[Team]) {\n\t\tError (\"Your \\cFwar factory\\c- has been destroyed!\");\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n// [Dusk] Check for free hangers\nfunction int CheckFreeHanger (int Team) {\n\tif (GettingMech[Team]) {\n\t\tError (\"There is another mech in the hanger!\");\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n// [Dusk] Check for advanced mech research\nfunction int CheckAdvMechResearch (int Team) {\n\tif (IsAdmin[PlayerNumber()]) return 1;\n\tif (!AdvancedMechResearch[Team]) {\n\t\tError (\"You need to research \\cfadvanced mechs\\c- first!\");\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n// [Dusk] Check for plasma cooldown\nfunction int CheckPlasmaCooldown (void) {\n\tint wait;\n\tif (IsAdmin[PlayerNumber()]) return 1;\n\tif (PlasmaCooldown[PlayerNumber()] > Timer()) {\n\t\twait = (PlasmaCooldown[PlayerNumber()] - Timer()) / 35;\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage(s:\"You must wait \\cF\", d:wait, s:\" seconds\\c- before\\n\",\n\t\t\ts:\"purchasing another \\cNplasma cannon!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_RED, 0.5, 0.45, 2.0, 1.0);\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\nfunction void GiveInventoryBold (str what, int amount) {\n\tfor (int i = 3800; i < 3800+PlayerCount(); i++) {\n\t\tGiveActorInventory (i, what, amount);\n\t}\n}\n\n// [Dusk] not really a function but I don't know where else to categorize this o_O\nscript 356 (void)\n{\n\tif(PlayerTeam() == TEAM_RED)\n\t\tSetResultValue(1);\n\telse if(PlayerTeam() == TEAM_BLUE)\n\t\tSetResultValue(0);\n}\n\nscript 336 (int Invert) {\n\tif (Invert == 0)\n\t{\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tSetResultValue(0);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tSetResultValue(1);\n\t}\n\telse\n\t{\n\t\tif(PlayerTeam() == TEAM_RED)\n\t\t\tSetResultValue(1);\n\t\telse if(PlayerTeam() == TEAM_BLUE)\n\t\t\tSetResultValue(0);\n\t}\n}\n\nfunction bool MitigateDoublePress(void)\n{\n\tif ( Timer() - LastMenu[PlayerNumber()+1] < 5 )\n\t\treturn true; // [SP] This is to fix the \"double cost\" bug\n\tLastMenu[PlayerNumber()+1] = Timer();\n\treturn false;\n}\n\nfunction int SurrenderCount (int team) {\n\tint count = 0;\n\tfor (int i = 0; i <= 31; i++) {\n\t\tif (PlayerInGame(i) && GetPlayerInfo (i, PLAYERINFO_TEAM) == team && Surrender[i]) count++;\n\t}\n\treturn count;\n}\n\n// freezes all players\nfunction void FreezeBold (void) {\n\tfor (int i = 0; i <= 31; i++) {\n\t\tif (PlayerInGame(i) && !IsAdmin[i]) {\n\t\t\tSetPlayerProperty (i, PROP_TOTALLYFROZEN, true);\n\t\t\tSetActorProperty (3800+i, APROP_Invulnerable, true);\n\t\t}\n\t}\n}\n\n// reverse action for above\nfunction void DefrostBold (void) {\n\tfor (int i = 0; i <= 31; i++) {\n\t\tif (PlayerInGame(i) && !IsAdmin[i]) {\n\t\t\tSetPlayerProperty (i, PROP_TOTALLYFROZEN, false);\n\t\t\tSetActorProperty (3800+i, APROP_Invulnerable, false);\n\t\t}\n\t}\n}\n\n// refreshes time cop limit\nfunction void RecountTimeCops (void) {\n\tNumTimeCops[0] = 0; NumTimeCops[1] = 0;\n\tfor (int i = 0; i <= 31; i++) {\n\t\tif (!PlayerInGame(i)) continue;\n\t\tif (CheckActorInventory(3800+i, \"TimeGun\")) {\n\t\t\tif (GetPlayerInfo (i, PLAYERINFO_TEAM) == TEAM_RED)\n\t\t\t\tNumTimeCops[0]++;\n\t\t\telse if (GetPlayerInfo (i, PLAYERINFO_TEAM) == TEAM_BLUE)\n\t\t\t\tNumTimeCops[1]++;\n\t\t}\n\t}\n}\n\n// refreshes plasma limit\nfunction void RecountPlasma (void) {\n\tNumPlasmaCannons[0] = 0; NumPlasmaCannons[1] = 0;\n\tfor (int i = 0; i <= 31; i++) {\n\t\tif (!PlayerInGame(i)) continue;\n\t\tif (CheckActorInventory(3800+i, \"PlasmaCannon\")) {\n\t\t\tif (GetPlayerInfo (i, PLAYERINFO_TEAM) == TEAM_RED)\n\t\t\t\tNumPlasmaCannons[0]++;\n\t\t\telse if (GetPlayerInfo (i, PLAYERINFO_TEAM) == TEAM_BLUE)\n\t\t\t\tNumPlasmaCannons[1]++;\n\t\t}\n\t}\n}\n\n// checks tickets and ends the game if tickets are out\n// activator is assumed to be the killer!\nfunction void TakeTickets (int team, int count) {\n\tif (!SuddenDeath && !TicketPool) return;\n\n\tTickets[team] -= count;\n\n\t// inform clients of the new ticket values by changing the counters'\n\t// speed. clients use these speeds to display ticket values.\n\tif (GetActorSpeed (TID_TICKETCOUNTER_RED) != Tickets[TEAM_RED])\n\t\tSetActorSpeed (TID_TICKETCOUNTER_RED, Tickets[TEAM_RED]);\n\tif (GetActorSpeed (TID_TICKETCOUNTER_BLUE) != Tickets[TEAM_BLUE])\n\t\tSetActorSpeed (TID_TICKETCOUNTER_BLUE, Tickets[TEAM_BLUE]);\n\n\t// tell clients to update the hud\n\tACS_ExecuteAlways (931, 0);\n\n\t// handle ticket loss\n\tint d;\n\tif (Tickets[TEAM_BLUE] <= 0) {\n\t\td = BlueScore () - RedScore ();\n\t\tif (d < 0) d = 0;\n\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold (s:\"\\cHBlue Team\\cJ loses out of ticket loss\";\n\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.5, 0.3, 2.0, 1.0);\n\t\tLog(s:\"Blue loses out of ticket loss\");\n\n\t\tGameOver = true;\n\t\tConsoleCommand (\"pointlimit 1\");\n\t\tTeam_GivePoints (TEAM_RED, d+50, 0);\n\t} else if (Tickets[TEAM_RED] <= 0) {\n\t\td = RedScore () - BlueScore ();\n\t\tif (d < 0) d = 0;\n\n\t\tSetFont(\"BIGFONT\");\n\t\tHudMessageBold (s:\"\\cGRed Team\\cJ loses out of ticket loss\";\n\t\t\tHUDMSG_FADEOUT, 0, CR_YELLOW, 0.5, 0.3, 2.0, 1.0);\n\t\tLog(s:\"Red loses out of ticket loss\");\n\n\t\tGameOver = true;\n\t\tConsoleCommand (\"pointlimit 1\");\n\t\tTeam_GivePoints (TEAM_BLUE, d+50, 0);\n\t}\n}\n\n// returns color code\nfunction str FractionColor (int perc, int max) {\n\tif (perc == max)\n\t\treturn \"\\cQ\";\n\telse if ((perc*4)/3 >= max) // 75%\n\t\treturn \"\\cD\";\n\telse if (perc*2 >= max) // 50%\n\t\treturn \"\\cF\";\n\telse if (perc*4 >= max) // 25%\n\t\treturn \"\\cI\";\n\telse if (perc > 0) // 24-1%\n\t\treturn \"\\cR\";\n\treturn \"\\cM\"; // 0%\n}\n\n// shortcuts\nfunction void SetFragGrenades (int grenades) {\n\tif (!CheckInventory (\"FragGrenade\"))\n\t\tGiveInventory (\"FragGrenade\", 1);\n\tSetAmmoCapacity (\"FragGrenadeAmmo\", grenades);\n\tif (CheckInventory (\"FragGrenadeAmmo\") < grenades) {\n\t\tGiveInventory (\"FragGrenadeAmmo\", grenades);\n\t} else if (CheckInventory (\"FragGrenadeAmmo\") > grenades) {\n\t\tTakeInventory (\"FragGrenadeAmmo\", 10);\n\t\tGiveInventory (\"FragGrenadeAmmo\", grenades);\n\t}\n}\n\nfunction int GetHealth (void) {return GetActorProperty (0, APROP_HEALTH);}\nfunction void SetHealth (int hp) {SetActorProperty (0, APROP_HEALTH, hp);}\nfunction int GetActorHealth (int tid) {return GetActorProperty (tid, APROP_HEALTH);}\nfunction void SetActorHealth (int tid, int hp) {SetActorProperty (tid, APROP_HEALTH, hp);}\nfunction int GetSpawnHealth (void) {return GetActorProperty (0, APROP_SPAWNHEALTH);}\nfunction void SetSpawnHealth (int shp) {SetActorProperty (0, APROP_SPAWNHEALTH, shp);}\nfunction int GetActorSpawnHealth (int tid) {return GetActorProperty (tid, APROP_SPAWNHEALTH);}\nfunction void SetActorSpawnHealth (int tid, int shp) {SetActorProperty (tid, APROP_SPAWNHEALTH, shp);}\nfunction int GetSpeed (void) {return GetActorProperty (0, APROP_SPEED);}\nfunction void SetSpeed (int value) {SetActorProperty (0, APROP_SPEED, value);}\nfunction int GetActorSpeed (int tid) {return GetActorProperty (tid, APROP_SPEED);}\nfunction void SetActorSpeed (int tid, int value) {SetActorProperty (tid, APROP_SPEED, value);}\nfunction int LevelNumber (void) {return GetLevelInfo (LEVELINFO_LEVELNUM);}\nfunction void GivePoints (int p) {Team_GivePoints (PlayerTeam(), p, false);}\n\n// returns the `display name` of the player with id pn\n// NOTE: this function must cater for client-side acs!\nfunction str DisplayName (int pn) {\n\tint tid = 3800+pn;\n\tif (pn < 0 || pn > 31) tid = ActivatorTID();\n\n\tif (CheckActorInventory (tid, \"IsMech\")) {\n\t\tif (CheckActorInventory (tid, \"OrcaWeapons\")) return\"\\cCOrca\";\n\t\tif (CheckActorInventory (tid, \"RavenWeapons\")) return\"\\cCRaven\";\n\t\tif (CheckActorInventory (tid, \"WolverineWeapons\")) return\"\\cCWolverine\";\n\t\tif (CheckActorInventory (tid, \"MadCatWeapons\")) return\"\\cCMadCat\";\n\t\tif (CheckActorInventory (tid, \"TitanWeapons\")) return\"\\cCTitan\";\n\t\tif (CheckActorInventory (tid, \"GuardianWeapons\")) return\"\\cCGuardian\";\n\t} else if (CheckActorInventory (tid, \"PowerBerserk\")) {\n\t\treturn \"\\cGBerserker\";\n\t} else if (CheckActorInventory (tid, \"IsAdmin\")) {\n\t\treturn \"\\cJAdministrator\";\n\t}\n\n\tswitch (CheckActorInventory (tid, \"ClassID\")) {\n\t\tcase CLASS_NONE: return \"No class\";\n\t\tcase CLASS_GUNMAN: return \"Gunman\";\n\t\tcase CLASS_ENGINEER: return \"Engineer\";\n\t\tcase CLASS_MINIGUNNER: return \"Minigunner\";\n\t\tcase CLASS_TECHNICIAN: return \"Technician\";\n\t\tcase CLASS_FLAMER: return \"Flamethrower\";\n\t\tcase CLASS_RIFLEMAN: return \"Rifleman\";\n\t\tcase CLASS_MACHINEGUNNER: return \"Machinegunner\";\n\t\tcase CLASS_GRENADIER: return \"Grenadier\";\n\t\tcase CLASS_ROCKETEER: return \"Rocket soldier\";\n\t\tcase CLASS_STEALTH: return \"Stealth trooper\";\n\t\tcase CLASS_GAUSSGUNNER: return \"Gauss gunner\";\n\t\tcase CLASS_CHEMWARRIOR: return \"Chem warrior\";\n\t\tcase CLASS_SHOCKTROOPER: return \"Shock trooper\";\n\t\tcase CLASS_COMMANDO: return \"Commando\";\n\t\tcase CLASS_SHOTGUNNER: return \"Shotgunner\";\n\t\tcase CLASS_SUICIDEBOMBER: return \"Suicide bomber\";\n\t\tcase CLASS_SNIPER: return \"Sniper\";\n\t\tcase CLASS_UTILITYGUY: return \"Utility guy\";\n\t\tcase CLASS_DEMOEXPERT: return \"Demo expert\";\n\t\tcase CLASS_MEDIC: return \"Field Medic\";\n\t\tcase CLASS_LASERCHAINGUNNER: return \"Laser chaingunner\";\n\t\tcase CLASS_JUMPJET: return \"Jumpjet infantry\";\n\t\tcase CLASS_TIBRIFLE: return \"Tiberium autorifleman\";\n\t\tcase CLASS_DOUBLESHOTGUNNER: return \"Double shotgunner\";\n\t\tcase CLASS_PLASMAGUNNER: return \"Plasma gunner\";\n\t\tcase CLASS_ARTILLERY: return \"Artillery soldier\";\n\t\tcase CLASS_TIMECOP: return \"Time cop\";\n\t\tcase CLASS_HARVESTER: return \"Tiberium harvester\";\n\t\tcase CLASS_ADVHARVESTER: return \"Adv. Tiberium harvester\";\n\t}\n\n\treturn \"missingno.\";\n}\n\nfunction int SetInventory (str item, int count) {\n\tint n = count - CheckInventory (item);\n\tif (n > 0)\n\t\tGiveInventory (item, n);\n\telse if (n < 0)\n\t\tTakeInventory (item, -n);\n\n\treturn n;\n}\n\nfunction int SetActorInventory (int tid, str item, int count) {\n\tint n = count - CheckActorInventory (tid, item);\n\tif (n > 0)\n\t\tGiveActorInventory (tid, item, n);\n\telse if (n < 0)\n\t\tTakeActorInventory (tid, item, -1*n);\n\n\treturn n;\n}\n\n// [Dusk] counts how many guardians you have\nfunction int GuardianCount (void) {\n\tint n;\n\tfor (int i = 0; i <= 31; i++) {\n\t\tif (GetPlayerInfo (i, PLAYERINFO_TEAM) == PlayerTeam() &&\n\t\tCheckActorInventory (3800+i, \"PowerGuardian\"))\n\t\t\tn++;\n\t}\n\treturn n;\n}\n\nfunction void Error (str text) {\n\tLocalAmbientSound (\"misc/nope\", 127);\n\tSetFont (\"BIGFONT\");\n\tHudMessage (s:text; HUDMSG_FADEOUT, 240+PlayerNumber(), CR_DarkRed, 0.5, 0.45, 2.0, 1.0);\n}\n\nfunction void ReddenSector (int tag) {Sector_SetColor (tag, 255, 150, 150);}"
},
{
"source": "pk3",
"name": "acs_source/a_hud.txt",
"contents": "// All Out War 2 HUD scripts\n// Credit to VoltlocK for originally creating the engine\n// With modifications by Eruanna, Dusk and the Omega Team\n\n// You may use portions of this script in your project as long as you give credit where credit is\n// due. Please don't be lame and just copy-paste any of this and call it your own. Thanks!\n\n// display credits/experience, manage self-heal\nscript 5 RESPAWN {\n\twhile (PlayerInGame (PlayerNumber()) && GetHealth() > 0) {\n\t\tShowStatus();\n\n\t\tif (GetHealth () <= GetSpawnHealth ()-50 && !CheckInventory(\"IsMech\") &&\n\t\t\t!CheckInventory(\"SelfHealCooldown\") && !CheckInventory(\"PowerBerserk\")) {\n\t\t\tGiveInventory (\"SelfHealCooldown\",1);\n\t\t\tGiveInventory (\"SelfHealItem\",1);\n\t\t\tSetFont (\"SMALLFONT\");\n\t\t\tHudMessage (s:\"\\cKSelf-applied medical attention\\cJ is available\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t}\n\n\t\tdelay (35);\n\t\tif (!CheckWeapon(\"StealthLaserRifle\") && !CheckWeapon(\"Knife\"))\n\t\t\tACS_ExecuteAlways (310, 0, 3);\n\t}\n}\n\nfunction void ShowStatus(void) {\n\tSetFont (\"SMALLFONT\");\n\tHudMessage(s:\"\\cNCredits: \\cQ$\\cD\", d:Credits[PlayerNumber()+1],\n\t\ts:\"\\n\", s:\"\\cNExperience: \\cD\",d:Experience[PlayerNumber()], s:\"\\cQ/\\cD\",d:GetExpNeed(), s:\" XP\",\n\t\ts:\"\\n\", s:RankTitles[Rank[PlayerNumber()]];\n\t\tHUDMSG_PLAIN, 50+PlayerNumber(), CR_WHITE, -0.685, -0.805, 1.5);\n\n\tSetFont (GetRankPic());\n\tHudMessage(s:\"a\";\n\t\tHUDMSG_PLAIN, 5000+PlayerNumber(), CR_LIGHTBLUE, -0.92, -0.78, 1.5);\n\n\tSetFont (\"DOOMFONT\");\n}\n\nscript 111 (int what) {\n\tint amount;\n\tswitch (what) {\n\tcase 0:\n\t\t// donation message\n\t\tSetFont (\"SMALLFONT\");\n\t\tHudMessage (s:\"You have been donated \\cQ$\\cD100\\cJ\\nby \", n:Donor[PlayerNumber()]+1;\n\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\tINTEL_XPOS, INTEL_YPOS2, 2.0, 1.0);\n\t\tbreak;\n\t}\n}"
},
{
"source": "pk3",
"name": "acs_source/a_items.txt",
"contents": "// All Out War 2 Inventory item scripts\n// Credit to VoltlocK for originally creating the AOW2 engine,\n// with modifications by Eruanna, Dusk and the Omega Team\n\n// You may use portions of this script in your project as long as you give credit where credit is\n// due. Please don't be lame and just copy-paste any of this and call it your own. Thanks!\n\nscript 951 (int action, int team) {\n\tswitch (action) {\n\tcase 0:\n\t\t// deploy superweapon beacon\n\t\tif (ActivatorTID() < 3800 || ActivatorTID() > 3831) terminate;\n\t\tif (!CheckInventory (\"BeaconUseToken\")) {\n\t\t\tGiveInventory (\"BeaconUseToken\", 1);\n\t\t\tActivatorSound (\"beacon/safetylock\", 80);\n\t\t\tSetFont (\"BIGFONT\");\n\t\t\tHudMessage (s:\"BEACON SAFETY LOCK DISENGAGED\";\n\t\t\t\tHUDMSG_FADEOUT, 0, CR_RED,\n\t\t\t\t0.1, 0.95, 2.0, 0.25);\n\t\t\tdelay (2*35);\n\t\t\tTakeInventory (\"BeaconUseToken\", 1);\n\t\t\tterminate;\n\t\t}\n\n\t\tTakeInventory (\"BeaconUseToken\", 1);\n\t\tSetPlayerProperty (0, 1, PROP_TOTALLYFROZEN);\n\t\tfor (int i = 0; i < 175; i += 5) {\n\t\t\tif (GetHealth () <= 0) terminate;\n\t\t\tdelay (5);\n\t\t}\n\n\t\tif (ActivatorTID() < 3800 || ActivatorTID() > 3831) terminate;\n\n\t\tif (team == TEAM_BLUE)\n\t\t\tSpawnProjectile (ActivatorTID(), \"IonBeaconThrown\", 0, 0, -5, 1, 0);\n\t\telse\n\t\t\tSpawnProjectile (ActivatorTID(), \"NukeBeaconThrown\", 0, 0, -5, 1, 0);\n\t\tSetPlayerProperty (0, 0, PROP_TOTALLYFROZEN);\n\t\tbreak;\n\tcase 1:\n\t\t// remote c4\n\t\tGiveInventory (\"RemoteC4Thrower\", 1);\n\t\tdelay (1);\n\t\tSetWeapon (\"RemoteC4Thrower\");\n\t\tbreak;\n\tcase 2:\n\t\t// refill c4\n\t\tif (CheckInventory (\"RemoteC4Count\") > 0) SetInventory (\"RemoteC4\", CheckInventory (\"RemoteC4Count\"));\n\t\tif (CheckInventory (\"ProxyMineCount\") > 0) SetInventory (\"ProxyMine\", CheckInventory (\"ProxyMineCount\"));\n\t\tif (CheckInventory (\"TimedC4Count\") > 0) SetInventory (\"TimedC4\", CheckInventory (\"TimedC4Count\"));\n\t\tTakeInventory (\"RemoteC4Detonator\", CheckInventory (\"RemoteC4Detonator\"));\n\t\tbreak;\n\tcase 3:\n\t\t// marine beacon summons a marine\n\t\tint x, y, x0, y0, z, yays;\n\t\tstr marine = \"BlueBackup\";\n\t\tif (team == TEAM_RED) marine = \"RedBackup\";\n\t\tx0 = GetActorX (0);\n\t\ty0 = GetActorY (0);\n\t\tz = GetActorZ (0) + 32.0;\n\n\t\t// first try straight above\n\t\tx = x0; y = y0;\n\t\tyays = Spawn (marine, x, y, z);\n\t\tif (yays) {Spawn (\"TeleportFog\", x, y, z); SetActorState (0, \"Done\"); terminate;}\n\n\t\t// a bit to north\n\t\tx = x0; y = y0 + 64.0;\n\t\tyays = Spawn (marine, x, y, z);\n\t\tif (yays) {Spawn (\"TeleportFog\", x, y, z); SetActorState (0, \"Done\"); terminate;}\n\n\t\t// east\n\t\tx = x0 + 64.0; y = y0;\n\t\tyays = Spawn (marine, x, y, z);\n\t\tif (yays) {Spawn (\"TeleportFog\", x, y, z); SetActorState (0, \"Done\"); terminate;}\n\n\t\t// south\n\t\tx = x0; y = y0 - 64.0;\n\t\tyays = Spawn (marine, x, y, z);\n\t\tif (yays) {Spawn (\"TeleportFog\", x, y, z); SetActorState (0, \"Done\"); terminate;}\n\n\t\t// west\n\t\tx = x0 - 64.0; y = y0;\n\t\tyays = Spawn (marine, x, y, z);\n\t\tif (yays) {Spawn (\"TeleportFog\", x, y, z); SetActorState (0, \"Done\"); terminate;}\n\n\t\t// if success, beacon is put to Done state, if failure, it will call this again after 35 ticks\n\t\tbreak;\n\tcase 4:\n\t\t// use selfheal\n\t\tif (CheckInventory (\"SelfHeal\")) terminate;\n\t\tGiveInventory (\"SelfHeal\", 1);\n\t\tdelay (1);\n\t\tSetWeapon (\"SelfHeal\");\n\t\tbreak;\n\t}\n}\n\n// HEALING RADIUS\n#define HEALRAD_RANGE 128\n#define HEALRAD_AMOUNT 10\n#define HEALRAD_DELAY 5\nint IsBeingHealed[32];\nscript 952 (int action, int i) {\n\tint shp;\n\tint n;\n\tswitch (action) {\n\tcase 0:\n\t\tfor (i = 0; i <= 31; i++) {\n\t\t\tif (GetActorHealth (3800+i) < GetActorSpawnHealth (3800+i) && !CheckActorInventory (3800+i, \"IsMech\")) {\n\t\t\t\tif (CheckActorDistance (0, 3800+i, HEALRAD_RANGE))\n\t\t\t\t\tACS_ExecuteAlways (952, 0, 1, i);\n\t\t\t}\n\t\t}\n\t\tbreak;\n\tcase 1:\n\t\tif (IsBeingHealed[i]) terminate;\n\t\tIsBeingHealed[i] = true;\n\t\tshp = GetActorSpawnHealth (3800+i);\n\t\tn = GetActorHealth (3800+i);\n\t\twhile (n < shp && n > 0 && CheckActorDistance (0, 3800+i, HEALRAD_RANGE)) {\n\t\t\tn += HEALRAD_AMOUNT; if (n > shp) n = shp;\n\t\t\tSetActorHealth (3800+i, n);\n\t\t\tdelay (HEALRAD_DELAY);\n\t\t\tn = GetActorHealth (3800+i);\n\t\t}\n\t\tIsBeingHealed[i] = false;\n\t\tbreak;\n\t}\n}"
},
{
"source": "pk3",
"name": "acs_source/a_mechs.txt",
"contents": "// All Out War 2 Mech scripts\n// Credit to VoltlocK for originally creating the engine\n// With modifications by Eruanna, Dusk and the Omega Team\n\n// You may use portions of this script in your project as long as you give credit where credit is\n// due. Please don't be lame and just copy-paste any of this and call it your own. Thanks!\n\nfunction void MECH_PushArmorMod (void) {\n\tSetInventory (\"StoredArmorModifier\", GetArmorModifier ());\n\tSetArmorGrade (NOCHANGE, ARMOD_NONE);\n}\n\nfunction void MECH_PopArmorMod (void) {\n\tint mod = CheckInventory (\"StoredArmorModifier\");\n\tTakeInventory (\"StoredArmorModifier\", mod);\n\tSetArmorGrade (NOCHANGE, mod);\n}\n\nscript 45 (void) {ACS_Execute (80, 0, MECH_WOLVERINE);}\nscript 46 (void) {ACS_Execute (80, 0, MECH_TITAN);}\nscript 47 (void) {ACS_Execute (80, 0, MECH_RAVEN);}\nscript 48 (void) {ACS_Execute (80, 0, MECH_MADCAT);}\nscript 58 (void) {ACS_Execute (80, 0, MECH_ORCA);}\nscript 59 (void) {ACS_Execute (80, 0, MECH_GUARDIAN);}\n\n// global mech purchase script\nscript 80 (int mech) {\n\tint cost;\n\tstr card, morph, nicename, ammo;\n\n\tint dest = 108;\n\tint mapspot = 6000;\n\tint door = 10;\n\tif (PlayerTeam() == TEAM_RED) {\n\t\tdest = 208;\n\t\tmapspot = 6001;\n\t\tdoor = 12;\n\t}\n\n\tif (mech == MECH_ORCA) {\n\t\tcost = 900;\n\t\tcard = \"MECH05\";\n\t\tmorph = \"OrcaSwitch\";\n\t\tnicename = \"Orca\";\n\t\tammo = \"OrcaAmmoPackage\";\n\t} else if (mech == MECH_RAVEN) {\n\t\tcost = 1200;\n\t\tcard = \"MECH03\";\n\t\tmorph = \"RavenSwitch\";\n\t\tnicename = \"Raven\";\n\t\tammo = \"RavenAmmoPackage\";\n\t} else if (mech == MECH_WOLVERINE) {\n\t\tcost = 1250;\n\t\tcard = \"MECH01\";\n\t\tmorph = \"WolverineSwitch\";\n\t\tnicename = \"Wolverine\";\n\t\tammo = \"WolverineAmmoPackage\";\n\t} else if (mech == MECH_MADCAT) {\n\t\tcost = 1750;\n\t\tcard = \"MECH04\";\n\t\tmorph = \"MadcatSwitch\";\n\t\tnicename = \"Mad Cat\";\n\t\tammo = \"MadcatAmmoPackage\";\n\t} else if (mech == MECH_TITAN) {\n\t\tcost = 2000;\n\t\tcard = \"MECH02\";\n\t\tmorph = \"TitanSwitch\";\n\t\tnicename = \"Titan\";\n\t\tammo = \"TitanAmmoPackage\";\n\t}\n\telse if (mech == MECH_GUARDIAN) {\n\t\tcost = 3000;\n\t\tcard = \"MECH06\";\n\t\tmorph = \"GuardianSwitch\";\n\t\tnicename = \"Guardian\";\n\t\tammo = \"GuardianAmmoPackage\";\n\t}\n\n\tif (MitigateDoublePress()) terminate;\n\n\tif (!CheckFactory (!PlayerTeam())) terminate;\n\n\tif (mech == MECH_GUARDIAN && GuardianCount() >= GuardianLimit && !IsAdmin[PlayerNumber()]) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage (s:\"\\cfAt limit!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_DarkRed, 0.5, 0.45, 2.0, 1.0);\n\t\tterminate;\n\t}\n\n\tif (mech >= MECH_MADCAT && mech <= MECH_GUARDIAN) {\n\t\tif (!CheckAdvMechResearch (!PlayerTeam())) terminate;\n\t}\n\n\tif (!CheckFreeHanger (PlayerTeam())) terminate;\n\tif (!IsSecondPress (card, cost)) terminate;\n\tif (!CheckCredits (cost)) terminate;\n\tTakeInventory (\"PurchaseToken\",1);\n\n\tif (!Teleport(dest)) {\n\t\tSpawnSpotForced (\"AntiUtilityExplosionLarge\", dest, 0, 0);\n\t\tdelay (5);\n\n\t\t// try again. If we /still/ can't, there isn't much we can do\n\t\tif (!Teleport (dest)) {\n\t\t\tDisplayCross();\n\t\t\tSetFont (\"BIGFONT\");\n\t\t\tHudMessage(s:\"\\cRSomething weird is going on in the hanger...\";\n\t\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\t\t\tterminate;\n\t\t}\n\t}\n\n\tSetSpeed (1.0);\n\tdelay (1);\n\n\tif (CheckInventory (\"JumpjetSwitch\")) GiveInventory (\"JumpjetDeactivate\", 1);\n\n\t// [Dusk] if the player is still in a menu, get him out of it\n\tCheckAndRemove (\"InUtilMenu\");\n\n\tGiveInventory (\"IsMech\", 1);\n\tGiveInventory (morph, 1);\n\tGiveInventory (ammo, 1);\n\tSetThingSpecial (0, ACS_ExecuteAlways, 317, 0, PlayerTeam());\n\n\tSpendCredits(Credits[PlayerNumber()+1], cost);\n\tDisplayTick();\n\tSetFont (\"BIGFONT\");\n\tHudMessage(s:\"You are now a \\cF\", s:nicename, s:\"!\";\n\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_WHITE, 0.5, 0.45, 2.0, 1.0);\n\n\t// extra notes\n\tif (mech == MECH_GUARDIAN)\n\t\tHudMessage(s:\"Upon ejecting, the suit \\ckself-destructs.\";\n\t\t\tHUDMSG_FADEOUT, 1860+PlayerNumber(), CR_WHITE, 0.45, 0.5, 2.0, 1.0);\n\t/*else if (mech == MECH_SCAVENGER)\n\t\tHudMessage(s:\"Find \\cDTiberium Crystals\\c- and bring them to \\cQRefinery!\";\n\t\t\tHUDMSG_FADEOUT, 1860+PlayerNumber(), CR_WHITE, 0.45, 0.5, 2.0, 1.0);*/\n\tMechGetter[PlayerTeam()] = PlayerNumber();\n\n\t// alert for heavy mechs\n\tif (mech >= MECH_MADCAT && mech <= MECH_GUARDIAN) {\n\t\tSetFont (\"SMALLFONT\");\n\t\tif (PlayerTeam() == TEAM_RED) {\n\t\t\tHudMessageBold (s:\"\\cGWarning: \\cARed\\cJ \", s:nicename, s:\" in-field!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t} else {\n\t\t\tHudMessageBold (s:\"\\cGWarning: \\cNBlue\\cJ \", s:nicename, s:\" in-field!\";\n\t\t\t\tHUDMSG_FADEOUT, 15000, CR_WHITE,\n\t\t\t\tINTEL_XPOS, INTEL_YPOS, 2.0, 1.0);\n\t\t}\n\t}\n\n\tLog (n:0, s:\" pilots \", s:nicename, s:\".\");\n\n\tSetPlayerProperty (0, 1, PROP_TOTALLYFROZEN);\n\tGettingMech[PlayerTeam()] = true;\n\tTagWait (door);\n\n\t// lagging clients don't seem to have their angle changed properly online\n\tSetActorAngle (0, GetActorAngle (dest));\n\tdelay (18);\n\tSetActorAngle (0, GetActorAngle (dest));\n\tdelay (18);\n\tSetActorAngle (0, GetActorAngle (dest));\n\tdelay (35);\n\n\tDoor_Open (door, 64);\n\n\tTagWait (door);\n\n\t//[NG] This will thrust the player out of the hanger.\n\tThrustThing (GetActorAngle (dest) >> 8, 35, 1, 0);\n\tdelay (35);\n\n\tSetPlayerProperty (0, 0, PROP_FROZEN);\n\tSetPlayerProperty (0, 0, PROP_TOTALLYFROZEN);\n\tActivatorSound (\"mech/start\", 127);\n\n\t// store which armor modifier does the player have and take it from the actual mech\n\tMECH_PushArmorMod ();\n\n\tSetFont (\"BIGFONT\");\n\tif (mech == MECH_GUARDIAN)\n\t\tHudMessage (s:\"Powersuit online!\";\n\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\telse if (mech == MECH_ORCA)\n\t\tHudMessage (s:\"Gunship online!\";\n\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\telse\n\t\tHudMessage (s:\"Mech online!\";\n\t\t\tHUDMSG_FADEOUT, 1800+PlayerNumber(), CR_GREEN, 0.5, 0.45, 2.0, 1.0);\n\n\tACS_ExecuteAlways (315, 0); // display mech HUD\n\n\tint tid = 6000;\n\tif (PlayerTeam() == TEAM_BLUE) tid = 6001;\n\n\tint x0 = GetActorX (tid);\n\tint y0 = GetActorY (tid);\n\tint z = GetActorZ (tid);\n\tint x1, x2, y1, y2;\n\tint d = 64.0;\n\tint angle = GetActorAngle (tid);\n\tx1 = x0 + FixedMul (sin (angle + 0.5), d);\n\ty1 = y0 + FixedMul (cos (angle + 0.5), d);\n\tx2 = x0 + FixedMul (sin (angle + 0.0), d);\n\ty2 = y0 + FixedMul (cos (angle + 0.0), d);\n\tSpawn (\"AntiUtilityExplosion\", x0, y0, z);\n\tSpawn (\"AntiUtilityExplosion\", x1, y1, z);\n\tSpawn (\"AntiUtilityExplosion\", x2, y2, z);\n\n\tDoor_Close (door, 64);\n\n\tTagWait(door);\n\tGettingMech[PlayerTeam()] = false;\n}\n\n// frag bounty\nscript 317 (int team) {\n\tif (team == PlayerTeam()) terminate;\n\tGiveCredits (-1, 200);\n\tAddExperience (150);\n}\n\n//Mech Weapon Switching\nscript 314 (void) {\n\tif (!CheckInventory (\"IsMech\")) terminate;\n\tif (CheckInventory (\"WolverineWeapons\")) {\n\t\tif(CheckInventory(\"Wolverine-WhatWeapon\") == 0)\n\t\t{\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\",1);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfPulse Cannon\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/pulse\",128);\n\t\t} else if(CheckInventory(\"Wolverine-WhatWeapon\") == 1) {\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\",1);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfMinigun\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/minigun\",128);\n\t\t} else {\n\t\t\tTakeInventory(\"Wolverine-WhatWeapon\",3);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfLRM-10\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/lrm\",128);\n\t\t}\n\t}\n\n\tif (CheckInventory (\"TitanWeapons\")) {\n\t\tif(CheckInventory(\"Wolverine-WhatWeapon\") == 0)\n\t\t{\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\",1);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfDual Flamethrowers\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/flamer\",128);\n\t\t}\n\t\telse if(CheckInventory(\"Wolverine-WhatWeapon\") == 1)\n\t\t{\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\",1);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfLRM-20\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/lrm\",128);\n\t\t}\n\t\telse //if(CheckInventory(\"Wolverine-WhatWeapon\") == 2)\n\t\t{\n\t\t\tTakeInventory(\"Wolverine-WhatWeapon\",3);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cf100mm Cannon\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/80mm\",128);\n\t\t}\n\t}\n\n\tif (CheckInventory (\"MadCatWeapons\")) {\n\t\tif(CheckInventory(\"Wolverine-WhatWeapon\") == 0)\n\t\t{\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\",1);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfDual Shock Autorifles\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/minigun\",128);\n\t\t}\n\t\telse if(CheckInventory(\"Wolverine-WhatWeapon\") == 1)\n\t\t{\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\",1);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfLRM-20\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/lrm\",128);\n\t\t}\n\t\telse {\n\t\t\tTakeInventory(\"Wolverine-WhatWeapon\",3);\n\t\t\tSetFont(\"DOOMFONT\");\n\t\t\tHudMessage(s:\"\\cfDual Shock Cannon\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/pulse\",128);\n\t\t}\n\t}\n\n\tif (CheckInventory (\"GuardianWeapons\")) {\n\t\tSetFont (\"SMALLFONT\");\n\t\tif (!CheckInventory(\"Wolverine-WhatWeapon\")) {\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\",1);\n\t\t\tHudMessage(s:\"\\cfSRM-15\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/lrm\",128);\n\t\t} else if (CheckInventory(\"Wolverine-WhatWeapon\") == 1) {\n\t\t\tGiveInventory (\"Wolverine-WhatWeapon\", 1);\n\t\t\tHudMessage(s:\"\\cfFlak Minigun\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/minigun\",128);\n\t\t} else if (CheckInventory(\"Wolverine-WhatWeapon\") == 2) {\n\t\t\tGiveInventory(\"Wolverine-WhatWeapon\", 1);\n\t\t\tif (PlayerTeam() == TEAM_RED)\n\t\t\t\tHudMessage(s:\"\\cfMini-nuke artillery\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\telse\n\t\t\t\tHudMessage(s:\"\\cfIon-bomb artillery\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/80mm\",128);\n\t\t} else {\n\t\t\tTakeInventory(\"Wolverine-WhatWeapon\", 3);\n\t\t\tHudMessage(s:\"Twin Mass Drivers\"; HUDMSG_FADEOUT, 0, CR_Gold, 0.5, 0.8, 1.0, 0.5);\n\t\t\tActivatorSound(\"switch/lrm\",128);\n\t\t}\n\t}\n}\n\n//Mech HUD\nscript 315 (void) NET CLIENTSIDE {\n\tif (!CheckInventory (\"IsMech\")) terminate;\n\n\tSetFont (\"SMALLFONT\");\n\t//Wolverine\n\tif (CheckWeapon(\"WolverineWeapons\")) {\n\t\tHudMessage(s:MechHudColor(0, \"Reload-LRM\"), s:\"LRM-10:\\n\",\n\t\t\ts:MechHudColor(1, \"\"), s:\"PULSE:\\n\",\n\t\t\ts:MechHudColor(2, \"\"), s:\"MINIGUN: \";\n\t\t\tHUDMSG_PLAIN, 0, CR_Gold, 0.8, 0.7, 0.2);\n\n\t\tHudMessage(d:CheckInventory(\"MechRocketAmmo\"),\n\t\t\ts:\"\\n-\\n\",d:CheckInventory(\"Wolverine-MinigunAmmo\");\n\t\t\tHUDMSG_PLAIN, 0, CR_White, 0.85, 0.7, 0.2);\n\t\tdelay(2);\n\t\trestart;\n\t}\n\telse if (CheckWeapon (\"MadCatWeapons\")) {\n\t\tHudMessage(s:MechHudColor(0, \"Reload-ShockCannon\"), s:\"SHOCK CANNON:\\n\",\n\t\t\ts:MechHudColor(1, \"\"), s:\"SHOCK RIFLE:\\n\",\n\t\t\ts:MechHudColor(2, \"Reload-LRM\"), s:\"LRM-20:\\n\";\n\t\t\tHUDMSG_PLAIN, 0, CR_Gold, 0.8, 0.7, 0.2);\n\t\tHudMessage(s:\"-\",\n\t\t\ts:\"\\n\",d:CheckInventory(\"GeneporiumCharge\"),\n\t\t\ts:\"\\n\",d:CheckInventory(\"MechRocketAmmo\");\n\t\t\tHUDMSG_PLAIN, 0, CR_White, 0.85, 0.7, 0.2);\n\t\tdelay(2);\n\t\trestart;\n\t}\n\telse if (CheckWeapon(\"TitanWeapons\")) {\n\t\tHudMessage(s:MechHudColor(0, \"Reload-80mm\"), s:\"100MM:\\n\",\n\t\t\ts:MechHudColor(1, \"\"), s:\"FLAMER:\\n\",\n\t\t\ts:MechHudColor(2, \"Reload-LRM\"), s:\"LRM-20: \";\n\t\t\tHUDMSG_PLAIN, 0, CR_Gold, 0.8, 0.7, 0.2);\n\t\tHudMessage(d:CheckInventory(\"Titan-80mmAmmo\"),\n\t\t\ts:\"\\n\",d:CheckInventory(\"Titan-FlamerAmmo\"),\n\t\t\ts:\"\\n\",d:CheckInventory(\"MechRocketAmmo\");\n\t\t\tHUDMSG_PLAIN, 0, CR_White, 0.85, 0.7, 0.2);\n\t\tdelay(2);\n\t\trestart;\n\t}\n\telse if (CheckWeapon (\"GuardianWeapons\")) {\n\t\tstr nukename = \"NUKE\";\n\t\tif (PlayerTeam() == TEAM_BLUE) nukename = \"ION BOMB\";\n\n\t\tHudMessage(s:MechHudColor(0, \"Reload-80mm\"), s:\"80MM:\\n\",\n\t\t\ts:MechHudColor(1, \"Reload-LRM\"), s:\"SRM-15:\\n\",\n\t\t\ts:MechHudColor(2, \"\"), s:\"FLAK:\\n\",\n\t\t\ts:MechHudColor(3, \"Reload-Nuke\"), s:nukename, s:\":\";\n\t\t\tHUDMSG_PLAIN, 0, CR_Gold, 0.8, 0.7, 0.2);\n\t\tHudMessage(d:CheckInventory(\"ArtilleryShellAmmo\"),\n\t\t\ts:\"\\n\", d:CheckInventory(\"ShortRangeMissileAmmo\"),\n\t\t\ts:\"\\n\", d:CheckInventory(\"MachineGunAmmo\"),\n\t\t\ts:\"\\n\", d:CheckInventory(\"NukeAmmo\");\n\t\t\tHUDMSG_PLAIN, 0, CR_White, 0.85, 0.7, 0.2);\n\t\tdelay(2);\n\t\trestart;\n\t}\n}\n\nfunction str MechHudColor (int weapon, str cooldownitem) {\n\tif (CheckInventory(cooldownitem)) {\n\t\tif (CheckInventory(\"Wolverine-WhatWeapon\") == weapon)\n\t\t\treturn \"\\cA\";\n\t\treturn \"\\cG\";\n\t} else {\n\t\tif (CheckInventory(\"Wolverine-WhatWeapon\") == weapon)\n\t\t\treturn \"\\cD\";\n\t\treturn \"\\cQ\";\n\t}\n\treturn \"\";\n}\n\n//EJECT MECH\nscript 697 (void) {\n\tint MechType = 1;\n\tif (CheckInventory (\"RavenWeapons\")) MechType = 1;\n\tif (CheckInventory (\"MadCatWeapons\")) MechType = 2;\n\tif (CheckInventory (\"WolverineWeapons\")) MechType = 3;\n\tif (CheckInventory (\"TitanWeapons\")) MechType = 4;\n\tif (CheckInventory (\"OrcaWeapons\")) MechType = 5;\n\tif (CheckInventory (\"GuardianWeapons\")) MechType = 6;\n\n\tint x = GetActorX (0);\n\tint y = GetActorY (0);\n\tint z = GetActorZ (0);\n\tint angle = GetActorAngle (ActivatorTID());\n\n\t//Raven\n\tif (MechType == 1) {\n\t\tif(GetActorProperty(0,APROP_Health) >= 1000)\n\t\t\tSpawn (\"EjectedRaven\", x, y, z, 0, angle);\n\t\telse\n\t\t\tSpawn (\"DamagedRaven\", x, y, z, 0, angle);\n\t}\n\n\t// Mad Cat\n\tif (MechType == 2) {\n\t\tif(GetActorProperty(0,APROP_Health) >= 2000)\n\t\t\tSpawn (\"EjectedMadCat\", x, y, z, 0, angle);\n\t\telse\n\t\t\tSpawn (\"DamagedMadCat\", x, y, z, 0, angle);\n\t}\n\n\t//Wolverine\n\tif(MechType == 3) {\n\t\tif(GetActorProperty(0,APROP_Health) >= 1500)\n\t\t\tSpawn (\"EjectedWolverine\", x, y, z, 0, angle);\n\t\telse\n\t\t\tSpawn (\"DamagedWolverine\", x, y, z, 0, angle);\n\t}\n\n\t//Titan\n\tif(MechType == 4)\n\t{\n\t\tif (GetActorProperty(0,APROP_Health) >= 2500)\n\t\t\tSpawn (\"EjectedTitan\", x, y, z, 0, angle);\n\t\telse\n\t\t\tSpawn (\"DamagedTitan\", x, y, z, 0, angle);\n\t}\n\n\t//Orca\n\tif(MechType == 5) SpawnSpotFacing (\"EjectedOrcaSpawner\", 3800+PlayerNumber(), 0);\n\n\t// Guardian\n\tif (MechType == 6) SpawnSpotFacing (\"EjectedGuardian\", 3800+PlayerNumber(), 0);\n\n\tUnMorphActor(0,0);\n\n\tdelay (5);\n\n\tSetActorProperty (0, APROP_Invulnerable, false);\n\tSetPlayerProperty (0, 0, 3);\n\tCheckAndRemove (\"MechEjectButton\");\n\tACS_ExecuteAlways (10, 0);\n\tTakeInventory (\"IsMech\", 1);\n\tMECH_PopArmorMod ();\n\n\tdelay (1);\n\n\tTakeInventory (\"IsInSpawnRoom\", 1);\n\tSetPlayerProperty (0, false, PROP_FROZEN);\n\tSetSpeed (PlayerSpeeds[PlayerNumber()]);\n}\n\n// Get in Mech animation\nscript 699 (void) {\n\tdelay (1);\n\tSetActorState (0, \"Spawn2\");\n\n\t// [Dusk] if the player is still in a menu, get him out of it\n\tCheckAndRemove (\"InUtilMenu\");\n}\n\n// Activates weapon reload.\nscript 319 (int Weapon, int ReloadTime) {\n\tif (Weapon == 1) {\n\t\tGiveInventory (\"Reload-LRM\", 1);\n\t\tdelay (35*ReloadTime-1);\n\t\tActivatorSound (\"lrm/reload\",127);\n\t\tActivatorSound (\"lrm/reload\",127);\n\t\tdelay (20);\n\t\tTakeInventory (\"Reload-LRM\", 1);\n\t}\n\n\tif(Weapon == 2) {\n\t\tGiveInventory (\"Reload-ShockCannon\", 1);\n\t\tdelay(35*ReloadTime-1);\n\t\tActivatorSound(\"ppc/reload\",255);\n\t\tActivatorSound(\"ppc/reload\",128);\n\t\tSetFont(\"DOOMFONT\");\n\t\tdelay (20);\n\t\tTakeInventory(\"Reload-ShockCannon\",1);\n\t}\n\n\tif(Weapon == 3) {\n\t\tGiveInventory(\"Reload-80mm\", 1);\n\t\tdelay(35*ReloadTime-1);\n\t\tActivatorSound(\"artillery/reload\", 255);\n\t\tActivatorSound(\"artillery/reload\", 128);\n\t\tSetFont(\"DOOMFONT\");\n\t\tdelay(20);\n\t\tTakeInventory(\"Reload-80mm\", 1);\n\t}\n\n\tif(Weapon == 4) {\n\t\tGiveInventory (\"Reload-Plasma\",1);\n\t\tdelay(35*ReloadTime-1);\n\t\tActivatorSound (\"ppc/reload\",255);\n\t\tActivatorSound (\"ppc/reload\",128);\n\t\tdelay(20);\n\t\tTakeInventory (\"Reload-Plasma\",1);\n\t}\n\n\tif(Weapon == 5) {\n\t\tGiveInventory(\"Reload-Artillery\",1);\n\t\tdelay(35*ReloadTime-1);\n\t\tActivatorSound(\"lrm/reload\",255);\n\t\tActivatorSound(\"lrm/reload\",128);\n\t\tdelay(20);\n\t\tTakeInventory(\"Reload-Artillery\",1);\n\t}\n\n\tif(Weapon == 6) {\n\t\tGiveInventory (\"Reload-Nuke\", 1);\n\t\tdelay(35*ReloadTime-1);\n\t\tActivatorSound(\"artillery/reload\",255);\n\t\tActivatorSound(\"artillery/reload\",128);\n\t\tdelay(20);\n\t\tTakeInventory (\"Reload-Nuke\", 1);\n\t}\n}\n\nscript 332 (void) CLIENTSIDE {\n\twhile (CheckInventory(\"IsMech\")) {\n\t\tif (GetHealth () <= GetSpawnHealth()/10) {\n\t\t\tSETFONT(\"BigFont\");\n\t\t\tHudMessage(s:\"\\cR== Health Level Critical ==\"; HUDMSG_PLAIN, 0, CR_Green, 0.5, 0.59, 0.75);\n\t\t\tHudMessage(s:\"\\cFPrepare to Eject\"; HUDMSG_PLAIN, 0, CR_Green, 0.5, 0.63, 0.75);\n\t\t}\n\t\tdelay (35*5);\n\t}\n}\n\n// check if you can enter an ejected mech\nscript 353 (void) {\n\tint r = 1;\n\tif(CheckInventory (\"HighUpgrade\"))\n\t\tr = 0;\n\telse if (CheckInventory (\"IsMech\")) //[SP] disallow other mech pickups\n\t\tr = 0;\n\n\tSetResultValue (r);\n\t// push the armor modifier so that it doesn't actually affect the mech\n\tif (r) MECH_PushArmorMod ();\n}\n\n// [Dusk] thrusts the player with the specified angle if they are in a mech\n// Meant to be used in maps to block areas off from mechs\nscript 150 (int angle) {\n\tif (CheckInventory (\"IsMech\")) {\n\t\tDisplayCross();\n\t\tSETFONT(\"BigFont\");\n\t\tHudMessage (s:\"You can't go there in a mech!\";\n\t\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_DarkRed, 0.5, 0.45, 2.0, 1.0);\n\t\tThrustThing (angle, 40, 1, 0);\n\t}\n}\n\n// [Dusk] we're activating a used mech - set the hp to half\nscript 359 (void) {\n\tdelay (5);\n\tSetHealth (GetSpawnHealth()/2);\n}\n\n// Tiger's hanger stuff\nscript 84 (void) {\n\t// is this really necessary?\n\t/* DisplayCross ();\n\tSetFont (\"BIGFONT\");\n\tHudMessage(s:\"You can't go into the Hanger!\";\n\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_DarkRed, 0.5, 0.45, 2.0, 1.0); */\n}\n\nscript 86 (int x) {\n\tif (LineSide ()) terminate;\n\tDisplayCross ();\n\tSetFont (\"BIGFONT\");\n\tHudMessage (s:\"You can't enter here!\";\n\t\tHUDMSG_FADEOUT, 240+PlayerNumber(), CR_DarkRed, 0.5, 0.45, 2.0, 1.0);\n\n\tif (!CheckInventory(\"IsMech\"))\n\t\tThrustThing (GetActorAngle(6000 + x) >> 8, 35, 1, 0);\n\telse\n\t\tThrustThing (GetActorAngle(6000 + x) >> 8, 20, 0, 0);\n}\n\n// duplicates..\nscript 85 (void) {ACS_ExecuteAlways (84, 0);}\nscript 88 (void) {ACS_ExecuteAlways (86, 0, 1);}\nscript 89 (void) {} // dummy - present because maps actually call this. even though it was empty"
},
{
"source": "pk3",
"name": "acs_source/a_menu.txt",
"contents": "// ---------------------------------\n// UTILITY GUN MENU\n// ---------------------------------\n\nint MenuSelection[2], MenuHorPos;\n\n// SERVER INTERACTION\n// Script #970 - server prepares client to utility menu usage\n// Utility gun AltFire calls this to activate the menu\nscript 970 (void) {\n\tActivatorSound (\"switch/pulse\", 127);\n\n\tint team = 1-PlayerTeam();\n\tGiveInventory (\"InUtilMenu\", 1);\n\tGiveInventory (\"CannotBuild\", 1);\n\n\t// give information on what we have\n\tTakeInventory (\"GotAdvTurrets\", 1);\n\tTakeInventory (\"GotMoreTurrets\", 1);\n\tTakeInventory (\"GoingToUtilMenu\", 1);\n\tTakeInventory (\"Utility_Percent\", 100);\n\tif (AdvancedTurrets[team])\n\t\tGiveInventory (\"GotAdvTurrets\", 1);\n\tif (MoreTurrets[team])\n\t\tGiveInventory (\"GotMoreTurrets\", 1);\n\tif (!MechEnabled)\n\t\tGiveInventory (\"NoMechs\", 1);\n\tif (UsePortals)\n\t\tGiveInventory (\"PortalsEnabled\", 1);\n\n\t// activate the menu\n\tGiveInventory (\"UtilityMenuActivator\", 1);\n\n\t// freeze the player for the duration of menu usage\n\tSetPlayerProperty (0, 1, PROP_FROZEN);\n}\n\n// Script #969 - server receives selection from utility guy\nscript 969 (int sel0, int sel1) NET {\n\tint pn = PlayerNumber();\n\tif (!CheckInventory (\"InUtilMenu\")) terminate;\n\tLocalAmbientSound (\"menu/dismiss\", 127);\n\tActivatorSound (\"switch/pulse\", 127);\n\n\tTakeInventory (\"MenuSelection\", 3);\n\tTakeInventory (\"MenuSelection2\", 10);\n\tGiveInventory (\"MenuSelection\", sel0);\n\tGiveInventory (\"MenuSelection2\", sel1);\n\n\t// HACK: determine if the player is allowed to build\n\t// THIS CHECK IS ONLY A HINT AND SHOULD NOT BE RELIED UPON\n\tif (\t(sel0 != 2 || sel1 < 4 || AdvancedTurrets[1-PlayerTeam()] == 1) &&\n\t\t(sel0 != 1 || sel1 < 6 || MechEnabled) &&\n\t\t(sel0 != 2 || (sel1 == 2 || sel1 == 3) || TurretLimit() < TurretLimitMax()) &&\n\t\t(sel0 != 2 || sel1 != 2 || MineLimit() < 50) &&\n\t\t(sel0 != 2 || sel1 != 3 || MiniRavenLimit() < 5) &&\n\t\t(sel0 != 3 || sel1 != 0 || RazorWireLimit() < 20) &&\n\t\t(sel0 != 3 || sel1 != 2 || UsePortals)){\n\t\tTakeInventory (\"CannotBuild\", 1);\n\t}\n\n\t// release the player out of the menu\n\tdelay (8);\n\tTakeInventory (\"InUtilMenu\", 1);\n\tSetPlayerProperty (0, 0, PROP_FROZEN);\n\n\tif (Developer) GiveInventory (\"Utility_Percent\", 75);\n}\n\n// MENU LOOP\nscript 965 (void) CLIENTSIDE {\n\tDisplayUtilHud();\n\tLocalAmbientSound (\"menu/prompt\", 127);\n\n\tint MenuEpoch = Timer() + 20;\n\tdelay (10);\n\n\tint buttons, lethimbuild;\n\twhile (CheckInventory (\"InUtilMenu\")) {\n\t\tbuttons = GetPlayerInput (PlayerNumber(), INPUT_BUTTONS);\n\n\t\tif (buttons & BT_FORWARD) {MoveMenuCursorVertical (true); delay (5);}\n\t\tif (buttons & BT_BACK) {MoveMenuCursorVertical (false); delay (5);}\n\t\tif (buttons & BT_MOVERIGHT) {MoveMenuCursorHorizontal (true); delay (5);}\n\t\tif (buttons & BT_MOVELEFT) {MoveMenuCursorHorizontal (false); delay (5);}\n\t\tif (buttons & BT_ATTACK || buttons & BT_ALTATTACK || GetActorProperty (0, APROP_HEALTH) <= 0) {\n\t\t\tlethimbuild =\n\t\t\t(MenuSelection[0] != 2 || MenuSelection[1] < 4 || (CheckInventory (\"GotAdvTurrets\") == 1)) &&\n\t\t\t(MenuSelection[0] != 1 || MenuSelection[1] < 5 || (CheckInventory (\"NoMechs\") == 0)) &&\n\t\t\t(MenuSelection[0] != 3 || MenuSelection[1] != 2 || (CheckInventory (\"PortalsEnabled\")));\n\n\t\t\tif ((!(buttons & BT_ATTACK) || lethimbuild || GetActorProperty (0, APROP_HEALTH) <= 0) && Timer() > MenuEpoch) {\n\t\t\t\tSetCvar (\"x_utilselection0\", MenuSelection[0]);\n\t\t\t\tSetCvar (\"x_utilselection1\", MenuSelection[1]);\n\t\t\t\tConsoleCommand (\"puke -969 $x_utilselection0 $x_utilselection1\");\n\t\t\t\tdelay (15);\n\t\t\t} else\n\t\t\t\tdelay (5);\n\t\t}\n\t\tdelay (1);\n\t}\n\n\tfor (int i = 1; i <= 4; i++) HudMessage (s:\"\"; HUDMSG_PLAIN, i, CR_UNTRANSLATED, 0.0, 0.0, 0.01);\n}\n\n// [Dusk] Cursor moves up/down\nfunction void MoveMenuCursorVertical (bool up) {\n\tif (PlayerNumber() != ConsolePlayer) {return;}\n\n\tLocalAmbientSound (\"menu/cursor\", 127);\n\tint levelnum = GetLevelInfo (LEVELINFO_LEVELNUM);\n\tint max = 3; str item = 0;\n\n\tif (MenuHorPos) {\n\t\titem = 1;\n\t\tswitch (MenuSelection[0]) {\n\t\t\tcase 0: max = 5; break;\n\t\t\tcase 1: max = 7; break;\n\t\t\tcase 2: max = 7; break;\n\t\t\tcase 3: max = 9; break;\n\t\t}\n\t} else\n\t\tMenuSelection[1] = 0;\n\n\tif (!up) {\n\t\tif (MenuSelection[item] == max)\n\t\t\tMenuSelection[item] = 0;\n\t\telse\n\t\t\tMenuSelection[item]++;\n\t} else {\n\t\tif (MenuSelection[item] == 0)\n\t\t\tMenuSelection[item] = max;\n\t\telse\n\t\t\tMenuSelection[item]--;\n\t}\n\tDisplayUtilHud();\n}\n\n// [Dusk] Cursor moves right/left\nfunction void MoveMenuCursorHorizontal (bool right) {\n\tif (PlayerNumber() != ConsolePlayer) {return;}\n\n\tif (right != MenuHorPos)\n\t\tLocalAmbientSound (\"menu/cursor\", 127);\n\n\tif (right && !MenuHorPos)\n\t\tMenuHorPos = 1;\n\telse if (!right && MenuHorPos)\n\t\tMenuHorPos = 0;\n\tDisplayUtilHud();\n}\n\n#define UMENU_X1 -0.7215\n#define UMENU_Y1 -0.2225\n#define UMENU_X2 -0.7075\n#define UMENU_Y2 -0.275\n#define UMENU_X3 -0.81\n#define UMENU_Y3 -0.275\n#define UMENU_X4 -0.7\n#define UMENU_Y4 -0.425\n\nfunction void DisplayUtilHud (void) {\n\tHudMessage (s:\"\\cFUTILITY GUN\";\n\t\tHUDMSG_PLAIN, 1, CR_UNTRANSLATED, UMENU_X1, UMENU_Y1, 0.0);\n\tHudMessage (s:UtilMenuItemColor(0, 0), s:\"CACHES\\n\",\n\t\ts:UtilMenuItemColor(0, 1), s:\"PICKUPS\\n\",\n\t\ts:UtilMenuItemColor(0, 2), s:\"DEFENSES\\n\",\n\t\ts:UtilMenuItemColor(0, 3), s:\"GEOMETRY\\n\";\n\t\tHUDMSG_PLAIN, 2, CR_UNTRANSLATED, UMENU_X2, UMENU_Y2, 0.0);\n\n\tint levelnum = GetLevelInfo (LEVELINFO_LEVELNUM);\n\tswitch (MenuSelection[0]) {\n\t\tcase 0:\n\t\t\tHudMessage (s:UtilMenuItemColor(1, 0), s:\"AMMO CACHE\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 1), s:\"MEDICAL CACHE\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 2), s:\"SUPER CACHE\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 3), s:\"MINI-REFINERY\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 4), s:\"HP REGEN\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 5), s:\"AMMO REGEN\\n\";\n\t\t\t\tHUDMSG_PLAIN, 3, CR_UNTRANSLATED, UMENU_X3, UMENU_Y3, 0.0);\n\n\t\t\tswitch (MenuSelection[1]) {\n\t\t\t\tcase 0:\n\t\t\t\t\tHudMessage (s:\"\\cFAmmo Cache\\n\",\n\t\t\t\t\t\ts:\"Dispenses backpacks.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0 \\cJ(free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD6.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD400 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tHudMessage (s:\"\\cFMedical Cache\\n\",\n\t\t\t\t\t\ts:\"Dispenses stimpacks.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0 \\cJ(free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD6.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD300 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tHudMessage (s:\"\\cFSuper Cache\\n\",\n\t\t\t\t\t\ts:\"Dispenses stimpacks and\\n\",\n\t\t\t\t\t\ts:\"backpacks.\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0 \\cJ(free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD14 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD800 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tHudMessage (s:\"\\cFMini-Refinery\\n\",\n\t\t\t\t\t\ts:\"Enhances credit flow.\\n\",\n\t\t\t\t\t\ts:\"Must be built into a\\n\",\n\t\t\t\t\t\ts:\"Tiberium field.\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD2250\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD36 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD6,500 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tHudMessage (s:\"\\cFGlobal Health Regen\\n\",\n\t\t\t\t\t\ts:\"Provides 1HP/sec health\\n\",\n\t\t\t\t\t\ts:\"regeration for your team.\\n\",\n\t\t\t\t\t\ts:\"Must be built into the\\n\",\n\t\t\t\t\t\ts:\"Repair Facility.\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD2250\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD36 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD10,000 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tHudMessage (s:\"\\cFGlobal Ammo Regen\\n\",\n\t\t\t\t\t\ts:\"Provides slow ammunition\\n\",\n\t\t\t\t\t\ts:\"regeneration for your\\n\",\n\t\t\t\t\t\ts:\"team. Must be built into\\n\",\n\t\t\t\t\t\ts:\"the Repair Facility.\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD2250\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD36 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD10,000 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tHudMessage (s:UtilMenuItemColor(1, 0), s:\"C4 BOX\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 1), s:\"FULL REFILL\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 2), s:\"RIFLE\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 3), s:\"MACHINE GUN\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 4), s:\"FIREPROOF\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 5), s:\"CHEMPROOF\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 6), s:\"RAVEN\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 7), s:\"WOLVERINE\\n\";\n\t\t\t\tHUDMSG_PLAIN, 3, CR_UNTRANSLATED, UMENU_X3, UMENU_Y3, 0.0);\n\n\t\t\tswitch (MenuSelection[1]) {\n\t\t\t\tcase 0:\n\t\t\t\t\tHudMessage (s:\"\\cFC4 Box\\n\",\n\t\t\t\t\t\ts:\"A box filled with various\\n\",\n\t\t\t\t\t\ts:\"C4 bombs. Refills all of the\\n\",\n\t\t\t\t\t\ts:\"picker's timed C4, remote C4\\n\",\n\t\t\t\t\t\ts:\"bombs and proxy mines.\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0 \\cJ(free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD6 \\cQseconds\\n\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tHudMessage (s:\"\\cFFull refill pack\\n\",\n\t\t\t\t\t\ts:\"A backpack into which\\n\",\n\t\t\t\t\t\ts:\"has been compressed enough\\n\",\n\t\t\t\t\t\ts:\"ammunition to refill all of\\n\",\n\t\t\t\t\t\ts:\"its picker's weapons.\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0 \\cJ(free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD7 \\cQseconds\\n\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tHudMessage (s:\"\\cFRifle pack\\n\",\n\t\t\t\t\t\ts:\"A standard issue military\\n\",\n\t\t\t\t\t\ts:\"rifle capable of shooting\\n\",\n\t\t\t\t\t\ts:\"grenades.\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0 \\cJ(free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD4.5 \\cQseconds\\n\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tHudMessage (s:\"\\cFMachine gun pack\\n\",\n\t\t\t\t\t\ts:\"A standard issue machine\\n\",\n\t\t\t\t\t\ts:\"gun capable of tap firing.\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0 \\cJ(free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD6 \\cQseconds\\n\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tHudMessage (s:\"\\cFFireproof armor\\n\",\n\t\t\t\t\t\ts:\"Gives the user total\\n\",\n\t\t\t\t\t\ts:\"immunity against\\n\",\n\t\t\t\t\t\ts:\"fire-based attacks\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD100\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD9 \\cQseconds\\n\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tHudMessage (s:\"\\cFChemicalproof armor\\n\",\n\t\t\t\t\t\ts:\"Gives the user total\\n\",\n\t\t\t\t\t\ts:\"immunity against\\n\",\n\t\t\t\t\t\ts:\"chemical-based attacks\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD100\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD9 \\cQseconds\\n\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tif (!CheckInventory (\"NoMechs\")) {\n\t\t\t\t\t\tHudMessage (s:\"\\cFRaven mech\\n\",\n\t\t\t\t\t\t\ts:\"A basic, fast mech armed\\n\",\n\t\t\t\t\t\t\ts:\"with LRM-5:s and an AC2\\n\",\n\t\t\t\t\t\t\ts:\"rotary gun.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD1400\\n\",\n\t\t\t\t\t\t\ts:\"\\cFBuild time: \\cD18 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cFHealth: \\cD2000 \\cQHP\\n\";\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tHudMessage (s:\"\\cKRaven mech\\n\",\n\t\t\t\t\t\t\ts:\"\\cUA basic, fast mech armed\\n\",\n\t\t\t\t\t\t\ts:\"\\cUwith LRM-5:s and an AC2\\n\",\n\t\t\t\t\t\t\ts:\"\\cUrotary gun.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cUCost: $1400\\n\",\n\t\t\t\t\t\t\ts:\"\\cUBuild time: 18 seconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cUHealth: 2000 HP\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cAMechs have been disabled!\\n\";\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tif (!CheckInventory (\"NoMechs\")) {\n\t\t\t\t\t\tHudMessage (s:\"\\cFWolverine mech\\n\",\n\t\t\t\t\t\t\ts:\"A more powerful but slower\\n\",\n\t\t\t\t\t\t\ts:\"mech with LRM-10:s, a\\n\",\n\t\t\t\t\t\t\ts:\"flamer and a pulse cannon.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD1600\\n\",\n\t\t\t\t\t\t\ts:\"\\cFBuild time: \\cD18 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cFHealth: \\cD2000 \\cQHP\\n\";\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tHudMessage (s:\"\\cKWolverine mech\\n\",\n\t\t\t\t\t\t\ts:\"\\cUA more powerful but slower\\n\",\n\t\t\t\t\t\t\ts:\"\\cUmech with LRM-10:s, a\\n\",\n\t\t\t\t\t\t\ts:\"\\cUflamer and a pulse cannon.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cUCost: $1600\\n\",\n\t\t\t\t\t\t\ts:\"\\cUBuild time: 18 seconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cUHealth: 2000 HP\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cAMechs have been disabled!\\n\";\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tHudMessage (s:UtilMenuItemColor(1, 0), s:\"GUN TURRET\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 1), s:\"MECH TURRET\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 2), s:\"PROXY MINES\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 3), s:\"MINI-RAVEN\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 4), s:\"KLAXON TURRET\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 5), s:\"RIFLE TURRET\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 6), s:\"REPAIR TURRET\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 7), s:\"ARTILLERY TURRET\\n\";\n\t\t\t\tHUDMSG_PLAIN, 3, CR_UNTRANSLATED, UMENU_X3, UMENU_Y3, 0.0);\n\n\t\t\tswitch (MenuSelection[1]) {\n\t\t\t\tcase 0:\n\t\t\t\t\tHudMessage (s:\"\\cFGun turret\\n\",\n\t\t\t\t\t\ts:\"Basic gattling gun-armed\\n\",\n\t\t\t\t\t\ts:\"turret that shoots at\\n\",\n\t\t\t\t\t\ts:\"enemies on sight.\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD50\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD3.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD250 \\cQHP\\n\",\n\t\t\t\t\t\ts:LimitColour(0, 2), s:\"Limit: \", s:LimitColour(0, 0), d:TurretLimit(), s:LimitColour(0, 1),\n\t\t\t\t\t\t\ts:\"/\", s:LimitColour(0, 0), d:TurretLimitMax(),\n\t\t\t\t\t\ts:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tHudMessage (s:\"\\cFAnti-mech turret\\n\",\n\t\t\t\t\t\ts:\"Turret armed with heavy,\\n\",\n\t\t\t\t\t\ts:\"metal-tearing bullets made\\n\",\n\t\t\t\t\t\ts:\"for defeding against mechs.\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD80\\cJ\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD3.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD500 \\cQHP\\n\",\n\t\t\t\t\t\ts:LimitColour(0, 2), s:\"Limit: \", s:LimitColour(0, 0), d:TurretLimit(), s:LimitColour(0, 1),\n\t\t\t\t\t\t\ts:\"/\", s:LimitColour(0, 0), d:TurretLimitMax(),\n\t\t\t\t\t\ts:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tHudMessage (s:\"\\cF5x Proxy Mine\\n\",\n\t\t\t\t\t\ts:\"Proxy C4 -mines that\\n\",\n\t\t\t\t\t\ts:\"explode when enemies run\\n\",\n\t\t\t\t\t\ts:\"over them. Limit of 50.\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD80\\cJ\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD3.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD300 \\cQHP\\n\",\n\t\t\t\t\t\ts:LimitColour(1, 2), s:\"Limit: \", s:LimitColour(1, 0), d:MineLimit(), s:LimitColour(1, 1),\n\t\t\t\t\t\t\ts:\"/\", s:LimitColour(1, 0), d:50;\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tHudMessage (s:\"\\cFMini-Raven companion\\n\",\n\t\t\t\t\t\ts:\"A mini-version of the Raven\\n\",\n\t\t\t\t\t\ts:\"with AI. Patrols the base \\n\",\n\t\t\t\t\t\ts:\"and follows teammates.\\n\",\n\t\t\t\t\t\ts:\"Limit of five.\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD150\\cJ\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD12 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD750 \\cQHP\\n\",\n\t\t\t\t\t\ts:LimitColour(2, 2), s:\"Limit: \", s:LimitColour(2, 0), d:MiniRavenLimit(), s:LimitColour(2, 1),\n\t\t\t\t\t\t\ts:\"/\", s:LimitColour(2, 0), d:5,\n\t\t\t\t\t\ts:OutOfRangeWarning();\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tif (CheckInventory (\"GotAdvTurrets\")) {\n\t\t\t\t\t\tHudMessage (s:\"\\cFAdvanced Gun turret\\n\",\n\t\t\t\t\t\t\ts:\"An advanced, stronger\\n\",\n\t\t\t\t\t\t\ts:\"version of the gun turret\\n\",\n\t\t\t\t\t\t\ts:\"with a klaxon alarm. Best\\n\",\n\t\t\t\t\t\t\ts:\"used indoors.\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD100\\cJ\\n\",\n\t\t\t\t\t\t\ts:\"\\cFBuild time: \\cD3.5 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cFHealth: \\cD250 \\cQHP\\n\",\n\t\t\t\t\t\t\ts:LimitColour(0, 2), s:\"Limit: \", s:LimitColour(0, 0), d:TurretLimit(),\n\t\t\t\t\t\t\t\ts:LimitColour(0, 1), s:\"/\", s:LimitColour(0, 0), d:TurretLimitMax(),\n\t\t\t\t\t\t\ts:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tHudMessage (s:\"\\cMAdvanced Gun turret\\n\",\n\t\t\t\t\t\t\ts:\"\\cUAn advanced, stronger\\n\",\n\t\t\t\t\t\t\ts:\"\\cUversion of the gun turret\\n\",\n\t\t\t\t\t\t\ts:\"\\cUwith a klaxon alarm. Best\\n\",\n\t\t\t\t\t\t\ts:\"\\cUused indoors.\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cUCost: $100\\n\",\n\t\t\t\t\t\t\ts:\"\\cUBuild time: 3.5 seconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cUHealth: 250 HP\\n\",\n\t\t\t\t\t\t\ts:\"\\cULimit: \", d:TurretLimit(), s:\"/\", d:TurretLimitMax(), s:\"\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cKYou need to research\\n\",\n\t\t\t\t\t\t\ts:\"\\cFAdvanced Turrets \\cKbefore\\n\",\n\t\t\t\t\t\t\ts:\"\\cKyou can build this!\", s:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tif (CheckInventory (\"GotAdvTurrets\")) {\n\t\t\t\t\t\tHudMessage (s:\"\\cFPrecision turret\\n\",\n\t\t\t\t\t\t\ts:\"A variant of the gun turret\\n\",\n\t\t\t\t\t\t\ts:\"that shoots accurate shots\\n\",\n\t\t\t\t\t\t\ts:\"with a lesser rate of fire.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD125\\cJ\\n\",\n\t\t\t\t\t\t\ts:\"\\cFBuild time: \\cD3.5 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cFHealth: \\cD300 \\cQHP\\n\",\n\t\t\t\t\t\t\ts:LimitColour(0, 2), s:\"Limit: \", s:LimitColour(0, 0), d:TurretLimit(),\n\t\t\t\t\t\t\t\ts:LimitColour(0, 1), s:\"/\", s:LimitColour(0, 0), d:TurretLimitMax(),\n\t\t\t\t\t\t\ts:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tHudMessage (s:\"\\cMPrecision turret\\n\",\n\t\t\t\t\t\t\ts:\"\\cUA variant of the gun turret\\n\",\n\t\t\t\t\t\t\ts:\"\\cUthat shoots accurate shots\\n\",\n\t\t\t\t\t\t\ts:\"\\cUwith a lesser rate of fire.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cUCost: $125\\n\",\n\t\t\t\t\t\t\ts:\"\\cUBuild time: 3.5 seconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cUHealth: 300 HP\\n\",\n\t\t\t\t\t\t\ts:\"\\cULimit: \", d:TurretLimit(), s:\"/\", d:TurretLimitMax(), s:\"\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cKYou need to research\\n\",\n\t\t\t\t\t\t\ts:\"\\cFAdvanced Turrets \\cKbefore\\n\",\n\t\t\t\t\t\t\ts:\"\\cKyou can build this!\", s:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tif (CheckInventory (\"GotAdvTurrets\")) {\n\t\t\t\t\t\tHudMessage (s:\"\\cFRepair turret\\n\",\n\t\t\t\t\t\t\ts:\"A gun turret with a repair\\n\",\n\t\t\t\t\t\t\ts:\"gun. Place in front of MCTs\\n\",\n\t\t\t\t\t\t\ts:\"for automatic repairing.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD125\\cJ\\n\",\n\t\t\t\t\t\t\ts:\"\\cFBuild time: \\cD3.5 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cFHealth: \\cD500 \\cQHP\\n\",\n\t\t\t\t\t\t\ts:LimitColour(0, 2), s:\"Limit: \", s:LimitColour(0, 0), d:TurretLimit(),\n\t\t\t\t\t\t\t\ts:LimitColour(0, 1), s:\"/\", s:LimitColour(0, 0), d:TurretLimitMax(),\n\t\t\t\t\t\t\ts:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tHudMessage (s:\"\\cMRepair turret\\n\",\n\t\t\t\t\t\t\ts:\"\\cUA gun turret with a repair\\n\",\n\t\t\t\t\t\t\ts:\"\\cUgun. Place in front of MCTs\\n\",\n\t\t\t\t\t\t\ts:\"\\cUfor automatic repairing.\\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cUCost: $125\\n\",\n\t\t\t\t\t\t\ts:\"\\cUBuild time: 3.5 seconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cUHealth: 500 HP\\n\",\n\t\t\t\t\t\t\ts:\"\\cULimit: \", d:TurretLimit(), s:\"/\", d:TurretLimitMax(), s:\"\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cKYou need to research\\n\",\n\t\t\t\t\t\t\ts:\"\\cFAdvanced Turrets \\cKbefore\\n\",\n\t\t\t\t\t\t\ts:\"\\cKyou can build this!\", s:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tif (CheckInventory (\"GotAdvTurrets\")) {\n\t\t\t\t\t\tHudMessage (s:\"\\cFArtillery turret\\n\",\n\t\t\t\t\t\t\ts:\"An anti-mech turret with\\n\",\n\t\t\t\t\t\t\ts:\"80mm shells. Won't react to\\n\",\n\t\t\t\t\t\t\ts:\"infantry. Best used on high\\n\",\n\t\t\t\t\t\t\ts:\"spots. Takes two turret slots.\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD200\\cJ\\n\",\n\t\t\t\t\t\t\ts:\"\\cFBuild time: \\cD3.5 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cFHealth: \\cD400 \\cQHP\\n\",\n\t\t\t\t\t\t\ts:LimitColour(0, 2), s:\"Limit: \", s:LimitColour(0, 0), d:TurretLimit(),\n\t\t\t\t\t\t\t\ts:LimitColour(0, 1), s:\"/\", s:LimitColour(0, 0), d:TurretLimitMax(),\n\t\t\t\t\t\t\ts:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tHudMessage (s:\"\\cMArtillery turret\\n\",\n\t\t\t\t\t\t\ts:\"\\cUAn anti-mech turret with\\n\",\n\t\t\t\t\t\t\ts:\"\\cU80mm shells. Won't react to\\n\",\n\t\t\t\t\t\t\ts:\"\\cUinfantry. Best used on high\\n\",\n\t\t\t\t\t\t\ts:\"\\cUspots. Takes two turret slots.\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cUCost: $200\\n\",\n\t\t\t\t\t\t\ts:\"\\cUBuild time: 3.5 seconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cUHealth: 400 HP\\n\",\n\t\t\t\t\t\t\ts:\"\\cULimit: \", d:TurretLimit(), s:\"/\", d:TurretLimitMax(), s:\"\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cKYou need to research\\n\",\n\t\t\t\t\t\t\ts:\"\\cFAdvanced Turrets \\cKbefore\\n\",\n\t\t\t\t\t\t\ts:\"\\cKyou can build this!\", s:TurretsAtLimitWarning(), s:OutOfRangeWarning();\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t// s:UtilMenuItemColor(1, 3), s:\"BARREL\\n\",\n\t\t\tHudMessage (s:UtilMenuItemColor(1, 0), s:\"RAZOR WIRE\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 1), s:\"SANDBAG WALL\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 2), s:\"PORTAL\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 3), s:\"PLATFORM\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 4), s:\"1 STEP UP\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 5), s:\"1 STEP FORWARD\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 6), s:\"1 STEP DOWN\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 7), s:\"3 STEPS UP\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 8), s:\"3 STEPS FORWARD\\n\",\n\t\t\t\ts:UtilMenuItemColor(1, 9), s:\"3 STEPS DOWN\\n\";\n\t\t\t\tHUDMSG_PLAIN, 3, CR_UNTRANSLATED, UMENU_X3, UMENU_Y3, 0.0);\n\n\t\t\tswitch (MenuSelection[1]) {\n\t\t\t\tcase 0:\n\t\t\t\t\tHudMessage (s:\"\\cFRazor wire\\n\",\n\t\t\t\t\t\ts:\"Four meters of razor\\n\",\n\t\t\t\t\t\ts:\"wire that damages enemies\\n\",\n\t\t\t\t\t\ts:\"who run through it.\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD6 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD400 \\cQHP\\n\",\n\t\t\t\t\t\ts:LimitColour(3, 2), s:\"Limit: \", s:LimitColour(3, 0), d:RazorWireLimit(),\n\t\t\t\t\t\t\ts:LimitColour(3, 1), s:\"/\", s:LimitColour(3, 0), d:20;\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tHudMessage (s:\"\\cFSandbag wall\\n\",\n\t\t\t\t\t\ts:\"Big, blocking, solid wall\\n\",\n\t\t\t\t\t\ts:\"made of sandbags. 'Nuff\\n\",\n\t\t\t\t\t\ts:\"said.\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD750 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tif (CheckInventory (\"PortalsEnabled\")) {\n\t\t\t\t\t\tHudMessage (s:\"\\cFPortal\\n\",\n\t\t\t\t\t\t\ts:\"Want a buildable two-way\\n\",\n\t\t\t\t\t\t\ts:\"teleport? Just make two of\\n\",\n\t\t\t\t\t\t\ts:\"these and you're set. \\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD250\\cJ\\n\",\n\t\t\t\t\t\t\ts:\"\\cFBuild time: \\cD18 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cFHealth: \\cD2,000 \\cQHP\\n\",\n\t\t\t\t\t\t\ts:\"\\cFMax distance: \\cD5,000 units\\n\",\n\t\t\t\t\t\t\ts:LimitColour(4, 2), s:\"Limit: \", s:LimitColour(4, 0), d:PortalLimit(),\n\t\t\t\t\t\t\t\ts:LimitColour(4, 1), s:\"/\", s:LimitColour(4, 0), d:2, s:\" (one pair)\";\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tHudMessage (s:\"\\cKPortal\\n\",\n\t\t\t\t\t\t\ts:\"\\cUWant a buildable two-way\\n\",\n\t\t\t\t\t\t\ts:\"\\cUteleport? Just make two of\\n\",\n\t\t\t\t\t\t\ts:\"\\cUthese and you're set. \\n\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cUCost: \\cQ$\\cD250\\cJ\\n\",\n\t\t\t\t\t\t\ts:\"\\cUBuild time: \\cD18 \\cQseconds\\n\",\n\t\t\t\t\t\t\ts:\"\\cUHealth: \\cD2,000 \\cQHP\\n\",\n\t\t\t\t\t\t\ts:\"\\cUMax distance: \\cD5,000 units\\n\",\n\t\t\t\t\t\t\ts:\"\\cULimit: 0 / 2 (one pair)\\n\\n\",\n\t\t\t\t\t\t\ts:\"\\cKThis map does not support\\n\\cKportals!\";\n\t\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t/*case 3:\n\t\t\t\t\tHudMessage (s:\"\\cFBarrel\\n\",\n\t\t\t\t\t\ts:\"A large metal barrel full\\n\",\n\t\t\t\t\t\ts:\"of green, radioactive and\\n\",\n\t\t\t\t\t\ts:\"\\cgHIGHLY\\c- explosive goo.\\n\",\n\t\t\t\t\t\ts:\"Useful for ambushing...\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD6 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD400 \\cQHP\\n\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;*/\n\t\t\t\tcase 3:\n\t\t\t\t\tHudMessage (s:\"\\cFFloating platform\\n\",\n\t\t\t\t\t\ts:\"Large floating platform\\n\",\n\t\t\t\t\t\ts:\"on what you can build\\n\",\n\t\t\t\t\t\ts:\"other items, such as\\n\",\n\t\t\t\t\t\ts:\"turrets and caches.\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD150\\cJ\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD18 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD2,000 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tHudMessage (s:\"\\cF1 step up\\n\",\n\t\t\t\t\t\ts:\"One step upwards.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD1.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD200 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tHudMessage (s:\"\\cF1 step straight\\n\",\n\t\t\t\t\t\ts:\"One step straight.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD1.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD200 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tHudMessage (s:\"\\cF1 step down\\n\",\n\t\t\t\t\t\ts:\"One step downwards.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD1.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD200 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tHudMessage (s:\"\\cF3 steps up\\n\",\n\t\t\t\t\t\ts:\"Three steps upwards.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD1.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD200 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tHudMessage (s:\"\\cF3 steps straight\\n\",\n\t\t\t\t\t\ts:\"Three steps straight.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD1.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD200 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\tHudMessage (s:\"\\cF3 steps down\\n\",\n\t\t\t\t\t\ts:\"Three steps downwards.\\n\\n\\n\\n\\n\",\n\t\t\t\t\t\ts:\"\\cFCost: \\cQ$\\cD0\\cJ (free)\\n\",\n\t\t\t\t\t\ts:\"\\cFBuild time: \\cD1.5 \\cQseconds\\n\",\n\t\t\t\t\t\ts:\"\\cFHealth: \\cD200 \\cQHP\";\n\t\t\t\t\t\tHUDMSG_PLAIN, 4, CR_WHITE, UMENU_X4, UMENU_Y4, 0.0);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tHudMessage (s:\"\"; HUDMSG_PLAIN, 3, CR_UNTRANSLATED, 0.0, 0.0, 0.01);\n\t\t\tbreak;\n\t}\n}\n\nfunction str UtilMenuItemColor (int i, int j) {\n\tif (!i && MenuSelection[0] == j) {\n\t\tif (!MenuHorPos) {\n\t\t\treturn \"\\cD\";\n\t\t} else {\n\t\t\treturn \"\\cJ\";\n\t\t}\n\t}\n\n\tif (!i && MenuSelection[0] != j && !MenuHorPos)\n\t\treturn \"\\cQ\";\n\n\t// [Dusk] special case for unresearched adv. turrets\n\tif (MenuSelection[0] == 2 && !CheckInventory (\"GotAdvTurrets\") && j >= 4 && i) {\n\t\tif (MenuHorPos && MenuSelection[1] == j)\n\t\t\treturn \"\\cU\";\n\t\telse\n\t\t\treturn \"\\cM\";\n\t}\n\n\t// [Dusk] special case for disabled mechs\n\tif (MenuSelection[0] == 1 && CheckInventory (\"NoMechs\") && j >= 6 && i) {\n\t\tif (MenuHorPos && MenuSelection[1] == j)\n\t\t\treturn \"\\cU\";\n\t\telse\n\t\t\treturn \"\\cM\";\n\t}\n\n\t// [Dusk] special case for portals in maps which they're not allowed in\n\tif (MenuSelection[0] == 3 && !CheckInventory (\"PortalsEnabled\") && j == 2 && i) {\n\t\tif (MenuHorPos && MenuSelection[1] == j)\n\t\t\treturn \"\\cU\";\n\t\telse\n\t\t\treturn \"\\cM\";\n\t}\n\n\tif (i && MenuSelection[1] == j) {\n\t\tif (MenuHorPos)\n\t\t\treturn \"\\cD\";\n\t\telse\n\t\t\treturn \"\\cJ\";\n\t}\n\n\tif (i && MenuSelection[1] != j && MenuHorPos) {\n\t\treturn \"\\cQ\";\n\t}\n\n\treturn \"\\cU\";\n}\n\nfunction int TurretLimit (void) {\n\tint limit;\n\tif (PlayerTeam() == TEAM_BLUE) {\n\t\tlimit += ThingCountName (\"Utility_GunTurretBlue\", 0);\n\t\tlimit += ThingCountName (\"Utility_MechTurretBlue\", 0);\n\t\tlimit += ThingCountName (\"Utility_KlaxonBlue\", 0);\n\t\tlimit += ThingCountName (\"Utility_PrecisionTurretBlue\", 0);\n\t\tlimit += ThingCountName (\"Utility_RepairGunTurretBlue\", 0);\n\t\tlimit += ThingCountName (\"Utility_ArtilleryTurretBlue\", 0) * 2;\n\t} else if (PlayerTeam() == TEAM_RED) {\n\t\tlimit += ThingCountName (\"Utility_GunTurretRed\", 0);\n\t\tlimit += ThingCountName (\"Utility_MechTurretRed\", 0);\n\t\tlimit += ThingCountName (\"Utility_KlaxonRed\", 0);\n\t\tlimit += ThingCountName (\"Utility_PrecisionTurretRed\", 0);\n\t\tlimit += ThingCountName (\"Utility_RepairGunTurretRed\", 0);\n\t\tlimit += ThingCountName (\"Utility_ArtilleryTurretRed\", 0) * 2;\n\t}\n\treturn limit;\n}\n\nfunction int MineLimit (void) {\n\tint limit;\n\tif (PlayerTeam() == TEAM_BLUE) {\n\t\tlimit = ThingCountName (\"ProxyMineBlue\", 0);\n\t} else if (PlayerTeam() == TEAM_RED) {\n\t\tlimit = ThingCountName (\"ProxyMineRed\", 0);\n\t}\n\treturn limit;\n}\n\nfunction int MiniRavenLimit (void) {\n\tint limit;\n\tif (PlayerTeam() == TEAM_BLUE) {\n\t\tlimit = ThingCountName (\"Utility_MiniRavenBlue\", 0);\n\t} else if (PlayerTeam() == TEAM_RED) {\n\t\tlimit = ThingCountName (\"Utility_MiniRavenRed\", 0);\n\t}\n\treturn limit;\n}\n\nfunction int TurretLimitMax(void) {\n\tint limit = 15;\n\tif (CheckInventory (\"GotMoreTurrets\"))\n\t\tlimit = 20;\n\treturn limit;\n}\n\nfunction int RazorWireLimit (void) {\n\tint limit;\n\tif (PlayerTeam() == TEAM_BLUE) {\n\t\tlimit = ThingCountName (\"Utility_RazorWireBlue\", 0);\n\t} else if (PlayerTeam() == TEAM_RED) {\n\t\tlimit = ThingCountName (\"Utility_RazorWire\", 0);\n\t}\n\treturn limit;\n}\n\nfunction int PortalLimit (void) {\n\tint limit;\n\tif (PlayerTeam() == TEAM_BLUE) {\n\t\tlimit = ThingCountName (\"Utility_PortalBlue\", 0);\n\t} else if (PlayerTeam() == TEAM_RED) {\n\t\tlimit = ThingCountName (\"Utility_PortalRed\", 0);\n\t}\n\treturn limit;\n}\n\nfunction str OutOfRangeWarning (void) {\n\tif (CheckInventory (\"UtilityOutOfRange\")) {\n\t\treturn \"\\n\\n\\cKYou are too far from\\n\\cKbase to build this!\";\n\t}\n\treturn \"\";\n}\n\nfunction str TurretsAtLimitWarning (void) {\n\tif (!CheckInventory (\"GotMoreTurrets\") && TurretLimit() >= 30) {\n\t\treturn \"\\n\\n\\cKAt limit - research\\n\\cFMore Turrets\\cK to build more!\";\n\t}\n\treturn \"\";\n}\n\nfunction str LimitColour (int type, int style) {\n\tstr green, red;\n\tswitch (style) {\n\tcase 0: green = \"\\cD\"; red = \"\\cG\"; break;\n\tcase 1: green = \"\\cQ\"; red = \"\\cR\"; break;\n\tcase 2: green = \"\\cF\"; red = \"\\cG\"; break;\n\t}\n\n\tswitch (type) {\n\tcase 0:\n\t\t// turret\n\t\tif (TurretLimit() >= TurretLimitMax()) return red;\n\t\tbreak;\n\tcase 1:\n\t\t// mine\n\t\tif (MineLimit() >= 50) return red;\n\t\tbreak;\n\tcase 2:\n\t\t// birdie\n\t\tif (MiniRavenLimit() >= 5) return red;\n\t\tbreak;\n\tcase 3:\n\t\t// razorwire\n\t\tif (RazorWireLimit() >= 20) return red;\n\t\tbreak;\n\tcase 4:\n\t\t// portal\n\t\tif (PortalLimit() >= 2) return red;\n\t\tbreak;\n\t}\n\treturn green;\n}"
}
]
},
"maps": []
}