-- UNSC vs Covenant: Reach. The battle of UNSC vs Covenant vs Flood with -- Halo: Reach's own characters and weapons, for Reach's maps: the UNSC's -- Army troopers and Spartans against the Covenant's Grunts, Jackals, -- Skirmishers, Drones, Engineers, Brutes, Elites, Hunters and a Guta, with -- a Forerunner Sentinel (Halo 3's, where its campaign is installed) beside -- the UNSC. The Sentinel, the Drones and the Engineer fly: jump climbs -- and crouch descends. The deployment service (the header's -- logic.deployment) owns class purchases and native respawns; this script -- owns rewards, victory conditions and every piece of its UI: the -- reinforcement bars, the status lines and the class picker, built from -- script widgets. Teams 0/1 are UNSC/Covenant. -- -- The troopers, Grunts, Jackals, Skirmishers, Drones, Engineers, Brutes, -- Hunters and the Guta are Reach's missions' characters, which a map of -- Reach's takes from one of its installed missions or Firefight maps; on -- another game's map, or without them installed, their classes are left -- out (a class's cost and team then read -1, and its card stays hidden), -- and the Spartans and Elites fight alone: each faction then has a spare free class (the last -- of its classes, a Spartan or Elite recruit), whose card shows only -- while the faction's first class is left out. -- -- Widgets draw in order, so the picker's backdrop comes before what is on -- it. 0/1 UNSC/Covenant reinforcements, 2 battle time or result; picker: -- 3 backdrop, 4 title, 5 points, 6 status, 7 hint, 8-29 class cards; 30 -- points while deployed. UNSC classes are 0-15, Covenant 16-37, in the -- order of their cards. -- -- A class's card repeats its name, weapons and cost: change a class in -- the header and its card's text below together. --[=[ mode name = "UNSC vs Covenant: Reach" mode = "Slayer" [rules] score_to_win = 0 kill_points = 1 death_points = 0 suicide_points = 0 betrayal_points = -1 [options] "player.grenades" = 2 "player.primary_weapon" = 1 "player.secondary_weapon" = -1 "respawn.seconds" = 5 "rounds.limit" = 1 "rounds.minutes" = 0 "rounds.teams" = 1 [logic] seed = 0 [logic.deployment] title = "UNSC vs Covenant: Reach" teams = ["UNSC", "Covenant"] script_menu = true [[logic.deployment.classes]] name = "Army Trooper" description = "UNSC Army infantry." team = 0 cost = 0 biped = "reach_trooper" camera = "third_person" model_variant = "trooper_light" primary = "assault_rifle" grenades = [2, 0, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Trooper Marksman" description = "Mid-range precision infantry." team = 0 cost = 100 biped = "reach_trooper" camera = "third_person" model_variant = "trooper_radio" primary = "dmr" grenades = [2, 0, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Trooper Breacher" description = "Close-quarters specialist." team = 0 cost = 100 biped = "reach_trooper" camera = "third_person" model_variant = "trooper_medic" primary = "shotgun" secondary = "magnum" grenades = [2, 0, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Trooper Grenadier" description = "Indirect fire against groups and light vehicles." team = 0 cost = 150 biped = "reach_trooper" camera = "third_person" model_variant = "trooper_heavy" primary = "grenade_launcher" secondary = "assault_rifle" grenades = [2, 0, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Trooper Sniper" description = "Long-range overwatch." team = 0 cost = 200 biped = "reach_trooper" camera = "third_person" model_variant = "trooper_light" primary = "sniper_rifle" secondary = "magnum" grenades = [1, 0, 0, 0] max_active = 3 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Trooper Heavy" description = "Anti-vehicle infantry." team = 0 cost = 250 biped = "reach_trooper" camera = "third_person" model_variant = "trooper_heavy" primary = "rocket_launcher" secondary = "assault_rifle" grenades = [2, 0, 0, 0] max_active = 3 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "ODST" description = "An Orbital Drop Shock Trooper." team = 0 cost = 200 biped = "reach_trooper" camera = "third_person" model_variant = "odst_light" primary = "dmr" secondary = "magnum" grenades = [2, 0, 0, 0] max_active = 4 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Rifleman" description = "A Spartan of Noble Team's kind, shielded." team = 0 cost = 400 biped = "reach_spartan" camera = "third_person" primary = "assault_rifle" secondary = "magnum" grenades = [2, 0, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Marksman" description = "A Spartan with the DMR." team = 0 cost = 450 biped = "reach_spartan" camera = "third_person" primary = "dmr" secondary = "magnum" grenades = [2, 0, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Breacher" description = "A Spartan for close quarters." team = 0 cost = 450 biped = "reach_spartan" camera = "third_person" primary = "shotgun" secondary = "assault_rifle" grenades = [2, 0, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Grenadier" description = "A Spartan with the grenade launcher." team = 0 cost = 500 biped = "reach_spartan" camera = "third_person" primary = "grenade_launcher" secondary = "dmr" grenades = [2, 0, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Sniper" description = "A Spartan on overwatch." team = 0 cost = 550 biped = "reach_spartan" camera = "third_person" primary = "sniper_rifle" secondary = "magnum" grenades = [2, 0, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Heavy" description = "A Spartan against armour." team = 0 cost = 550 biped = "reach_spartan" camera = "third_person" primary = "rocket_launcher" secondary = "assault_rifle" grenades = [2, 0, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Laser Specialist" description = "A Spartan with the Spartan Laser." team = 0 cost = 600 biped = "reach_spartan" camera = "third_person" primary = "spartan_laser" secondary = "dmr" grenades = [2, 0, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Sentinel" description = "A Forerunner Sentinel: it flies (jump climbs, crouch descends) and fires its own beam. No vehicles or turrets." team = 0 cost = 350 biped = "sentinel" camera = "third_person" grenades = [0, 0, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Spartan Recruit" description = "A Spartan with an assault rifle, where no trooper can deploy." team = 0 cost = 0 biped = "reach_spartan" camera = "third_person" primary = "assault_rifle" grenades = [1, 0, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Grunt Minor" description = "Covenant cannon fodder." team = 1 cost = 0 biped = "reach_grunt" camera = "third_person" model_variant = "minor" primary = "plasma_pistol" grenades = [0, 2, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Grunt Major" description = "A Grunt with a Needler." team = 1 cost = 50 biped = "reach_grunt" camera = "third_person" model_variant = "major" primary = "needler" grenades = [0, 2, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Grunt Heavy" description = "A Grunt with a fuel rod gun." team = 1 cost = 150 biped = "reach_grunt" camera = "third_person" model_variant = "heavy" primary = "flak_cannon" grenades = [0, 1, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Jackal" description = "Covenant light infantry." team = 1 cost = 0 biped = "reach_jackal" camera = "third_person" model_variant = "jackal_minor" primary = "plasma_pistol" grenades = [0, 1, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Jackal Sniper" description = "Long-range overwatch." team = 1 cost = 150 biped = "reach_jackal" camera = "third_person" model_variant = "jackal_sniper" primary = "beam_rifle" grenades = [0, 1, 0, 0] max_active = 3 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Skirmisher" description = "Fast, fragile flankers." team = 1 cost = 50 biped = "skirmisher" camera = "third_person" model_variant = "skirmisher_minor" primary = "plasma_pistol" grenades = [0, 1, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Skirmisher Marksman" description = "A Skirmisher with a needle rifle." team = 1 cost = 150 biped = "skirmisher" camera = "third_person" model_variant = "skirmisher_major" primary = "needle_rifle" grenades = [0, 1, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Brute Minor" description = "Tough close-range infantry." team = 1 cost = 100 biped = "reach_brute" camera = "third_person" model_variant = "minor" primary = "spike_rifle" grenades = [0, 2, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Brute Captain" description = "A Brute with a concussion rifle." team = 1 cost = 250 biped = "reach_brute" camera = "third_person" model_variant = "major" primary = "brute_shot" secondary = "spike_rifle" grenades = [0, 2, 0, 0] max_active = 3 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Brute Berserker" description = "A Brute with a gravity hammer." team = 1 cost = 450 biped = "reach_brute" camera = "third_person" model_variant = "major" primary = "gravity_hammer" secondary = "spike_rifle" grenades = [0, 2, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Elite Minor" description = "A shielded Sangheili warrior." team = 1 cost = 300 biped = "reach_elite" camera = "third_person" model_variant = "minor" primary = "plasma_repeater" grenades = [0, 2, 0, 0] max_active = 3 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Elite Officer" description = "An Elite with a needle rifle." team = 1 cost = 400 biped = "reach_elite" camera = "third_person" model_variant = "officer" primary = "needle_rifle" secondary = "plasma_pistol" grenades = [0, 2, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Elite Spec Ops" description = "An Elite with an energy sword." team = 1 cost = 450 biped = "reach_elite" camera = "third_person" model_variant = "spec_ops" primary = "energy_sword" secondary = "plasma_repeater" grenades = [0, 2, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Elite Ultra" description = "An Elite with a concussion rifle." team = 1 cost = 500 biped = "reach_elite" camera = "third_person" model_variant = "ultra" primary = "brute_shot" secondary = "plasma_rifle" grenades = [0, 2, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Elite General" description = "An Elite with a plasma launcher." team = 1 cost = 600 biped = "reach_elite" camera = "third_person" model_variant = "general" primary = "plasma_launcher" secondary = "energy_sword" grenades = [0, 2, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Hunter" description = "A walking tank. Too big for any seat." team = 1 cost = 700 biped = "reach_hunter" camera = "third_person" grenades = [0, 0, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Drone" description = "A flying Yanme'e: hold jump to take wing and climb, crouch to descend. Fragile. No vehicles or turrets." team = 1 cost = 100 biped = "reach_drone" camera = "third_person" primary = "plasma_pistol" grenades = [0, 0, 0, 0] max_active = 4 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Drone Needler" description = "A flying Yanme'e with a needler. No vehicles or turrets." team = 1 cost = 200 biped = "reach_drone" camera = "third_person" primary = "needler" grenades = [0, 0, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Engineer" description = "A floating Huragok: it flies (jump climbs, crouch descends) and carries no weapon. No vehicles or turrets." team = 1 cost = 150 biped = "reach_engineer" camera = "third_person" grenades = [0, 0, 0, 0] max_active = 2 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Brute Chieftain" description = "A war chief with a gravity hammer." team = 1 cost = 550 biped = "reach_brute_chieftain" camera = "third_person" primary = "gravity_hammer" secondary = "spike_rifle" grenades = [0, 0, 2, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Guta" description = "A beast of Reach, five metres of claws: for open ground, it fits through no door. Too big for any seat." team = 1 cost = 650 biped = "reach_guta" camera = "third_person" grenades = [0, 0, 0, 0] max_active = 1 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [[logic.deployment.classes]] name = "Elite Recruit" description = "An Elite with a plasma repeater, where no Grunt can deploy." team = 1 cost = 0 biped = "reach_elite" camera = "third_person" primary = "plasma_repeater" grenades = [0, 1, 0, 0] max_active = 0 [logic.deployment.classes.traits] pickup = 2 radar = 3 vehicles = 3 [logic.options] points_per_kill = { value = 50.0, min = 1.0, max = 1000.0 } reinforcements = { value = 150.0, min = 10.0, max = 1000.0 } round_seconds = { value = 600.0, min = 60.0, max = 3600.0 } ]=] alias phase = global.number[0] alias unsc = global.number[1] alias covenant = global.number[2] alias unsc_players = global.number[3] alias covenant_players = global.number[4] alias scratch = global.number[5] alias points = global.number[6] alias seconds = global.number[7] alias class = global.number[8] alias card = global.number[9] alias remaining = global.timer[0] alias income = global.timer[1] alias kills = player.number[0] alias deaths = player.number[1] -- 1 while the player chooses a class, and 1 while their picker is drawn. alias choosing = player.number[2] alias picker = player.number[3] -- 1 while the player's faction has no reinforcements left in the battle. alias beaten = player.number[4] -- The player's faction's number (UNSC 0, Covenant 1). alias faction = player.number[5] -- The first class of the player's faction. alias first = player.number[6] -- The card of the faction's spare free class. alias spare = player.number[7] on init: do unsc = script_option[1] covenant = script_option[1] remaining = script_option[2] income = 30 -- Reinforcement bars and the battle line, for everyone. script_widget[0].set_position(all_players, 520, 18) script_widget[0].set_anchor(all_players, top_right) script_widget[0].set_size(all_players, 240, 0) script_widget[0].set_alignment(all_players, right) script_widget[0].set_color(all_players, 90, 170, 255, 255) script_widget[0].set_font_size(all_players, 18) script_widget[1].set_position(all_players, 760, 18) script_widget[1].set_size(all_players, 240, 0) script_widget[1].set_color(all_players, 190, 150, 255, 255) script_widget[1].set_font_size(all_players, 18) script_widget[2].set_position(all_players, 640, 82) script_widget[2].set_anchor(all_players, top) script_widget[2].set_font_size(all_players, 15) script_widget[30].set_position(all_players, 640, 700) script_widget[30].set_anchor(all_players, bottom) script_widget[30].set_color(all_players, 232, 184, 82, 255) script_widget[30].set_font_size(all_players, 14) -- The class picker: a backdrop, its title, points, status and hint -- lines, and 22 cards. Each player is shown it while they choose. script_widget[3].set_position(all_players, 640, 112) script_widget[3].set_anchor(all_players, top) script_widget[3].set_size(all_players, 1200, 568) script_widget[3].set_background(all_players, 7, 14, 23, 235) script_widget[4].set_position(all_players, 80, 126) script_widget[4].set_font_size(all_players, 30) script_widget[5].set_position(all_players, 80, 172) script_widget[5].set_color(all_players, 232, 184, 82, 255) script_widget[5].set_font_size(all_players, 20) script_widget[6].set_text("Click a class to deploy. Purchases last for this life; unspent points survive death.") script_widget[6].set_position(all_players, 80, 202) script_widget[6].set_color(all_players, 150, 160, 175, 255) script_widget[6].set_font_size(all_players, 14) script_widget[7].set_text("Enemy kills earn points. Both factions also earn 25 points every 30 seconds.") script_widget[7].set_position(all_players, 640, 668) script_widget[7].set_anchor(all_players, bottom) script_widget[7].set_color(all_players, 150, 160, 175, 255) script_widget[7].set_font_size(all_players, 13) script_widget[8].set_position(all_players, 80, 232) script_widget[8].set_size(all_players, 270, 62) script_widget[8].set_background(all_players, 15, 27, 39, 255) script_widget[8].set_clickable(all_players, true) script_widget[9].set_position(all_players, 365, 232) script_widget[9].set_size(all_players, 270, 62) script_widget[9].set_background(all_players, 15, 27, 39, 255) script_widget[9].set_clickable(all_players, true) script_widget[10].set_position(all_players, 650, 232) script_widget[10].set_size(all_players, 270, 62) script_widget[10].set_background(all_players, 15, 27, 39, 255) script_widget[10].set_clickable(all_players, true) script_widget[11].set_position(all_players, 935, 232) script_widget[11].set_size(all_players, 270, 62) script_widget[11].set_background(all_players, 15, 27, 39, 255) script_widget[11].set_clickable(all_players, true) script_widget[12].set_position(all_players, 80, 300) script_widget[12].set_size(all_players, 270, 62) script_widget[12].set_background(all_players, 15, 27, 39, 255) script_widget[12].set_clickable(all_players, true) script_widget[13].set_position(all_players, 365, 300) script_widget[13].set_size(all_players, 270, 62) script_widget[13].set_background(all_players, 15, 27, 39, 255) script_widget[13].set_clickable(all_players, true) script_widget[14].set_position(all_players, 650, 300) script_widget[14].set_size(all_players, 270, 62) script_widget[14].set_background(all_players, 15, 27, 39, 255) script_widget[14].set_clickable(all_players, true) script_widget[15].set_position(all_players, 935, 300) script_widget[15].set_size(all_players, 270, 62) script_widget[15].set_background(all_players, 15, 27, 39, 255) script_widget[15].set_clickable(all_players, true) script_widget[16].set_position(all_players, 80, 368) script_widget[16].set_size(all_players, 270, 62) script_widget[16].set_background(all_players, 15, 27, 39, 255) script_widget[16].set_clickable(all_players, true) script_widget[17].set_position(all_players, 365, 368) script_widget[17].set_size(all_players, 270, 62) script_widget[17].set_background(all_players, 15, 27, 39, 255) script_widget[17].set_clickable(all_players, true) script_widget[18].set_position(all_players, 650, 368) script_widget[18].set_size(all_players, 270, 62) script_widget[18].set_background(all_players, 15, 27, 39, 255) script_widget[18].set_clickable(all_players, true) script_widget[19].set_position(all_players, 935, 368) script_widget[19].set_size(all_players, 270, 62) script_widget[19].set_background(all_players, 15, 27, 39, 255) script_widget[19].set_clickable(all_players, true) script_widget[20].set_position(all_players, 80, 436) script_widget[20].set_size(all_players, 270, 62) script_widget[20].set_background(all_players, 15, 27, 39, 255) script_widget[20].set_clickable(all_players, true) script_widget[21].set_position(all_players, 365, 436) script_widget[21].set_size(all_players, 270, 62) script_widget[21].set_background(all_players, 15, 27, 39, 255) script_widget[21].set_clickable(all_players, true) script_widget[22].set_position(all_players, 650, 436) script_widget[22].set_size(all_players, 270, 62) script_widget[22].set_background(all_players, 15, 27, 39, 255) script_widget[22].set_clickable(all_players, true) script_widget[23].set_position(all_players, 935, 436) script_widget[23].set_size(all_players, 270, 62) script_widget[23].set_background(all_players, 15, 27, 39, 255) script_widget[23].set_clickable(all_players, true) script_widget[24].set_position(all_players, 80, 504) script_widget[24].set_size(all_players, 270, 62) script_widget[24].set_background(all_players, 15, 27, 39, 255) script_widget[24].set_clickable(all_players, true) script_widget[30].set_position(all_players, 365, 504) script_widget[30].set_size(all_players, 270, 62) script_widget[30].set_background(all_players, 15, 27, 39, 255) script_widget[30].set_clickable(all_players, true) script_widget[26].set_position(all_players, 650, 504) script_widget[26].set_size(all_players, 270, 62) script_widget[26].set_background(all_players, 15, 27, 39, 255) script_widget[26].set_clickable(all_players, true) script_widget[27].set_position(all_players, 935, 504) script_widget[27].set_size(all_players, 270, 62) script_widget[27].set_background(all_players, 15, 27, 39, 255) script_widget[27].set_clickable(all_players, true) script_widget[28].set_position(all_players, 80, 572) script_widget[28].set_size(all_players, 270, 62) script_widget[28].set_background(all_players, 15, 27, 39, 255) script_widget[28].set_clickable(all_players, true) script_widget[29].set_position(all_players, 365, 572) script_widget[29].set_size(all_players, 270, 62) script_widget[29].set_background(all_players, 15, 27, 39, 255) script_widget[29].set_clickable(all_players, true) end -- A click on a card deploys its class, when the player may. on widget click: do -- The spare free class deploys only where the faction's first is left out. card = clicked_widget points = current_player.faction class = current_player.first scratch = game.get_deployment_team(class) class = current_player.spare if card == class and scratch == points then card = -1 end if card >= 8 and card <= 29 then class = clicked_widget class -= 8 class += current_player.first scratch = current_player.deploy_class(class) if scratch == 0 then script_widget[6].set_text_for(current_player, "That class costs more points than you have, or it is full.") script_widget[6].set_color(current_player, 255, 120, 100, 255) end end end if phase != 2 then unsc_players = 0 covenant_players = 0 for each player do if current_player.team == team[0] then unsc_players += 1 end if current_player.team == team[1] then covenant_players += 1 end -- Enemy kills count even when a projectile lands after our death. -- This is a wallet, independent of the native team/scoreboard score. scratch = current_player.get_kill_count() scratch -= current_player.kills if scratch > 0 then scratch *= script_option[0] points = current_player.get_deployment_points() points += scratch if points > 100000 then points = 100000 end current_player.set_deployment_points(points) end current_player.kills = current_player.get_kill_count() scratch = current_player.get_death_count() scratch -= current_player.deaths if phase == 1 and scratch > 0 then if current_player.team == team[0] then unsc -= scratch end if current_player.team == team[1] then covenant -= scratch end end current_player.deaths = current_player.get_death_count() end if unsc < 0 then unsc = 0 end if covenant < 0 then covenant = 0 end if phase == 0 then script_widget[2].set_text("Waiting for both factions") if unsc_players > 0 and covenant_players > 0 then phase = 1 remaining.set_rate(-100%) income.set_rate(-100%) end end if phase == 1 then seconds = remaining script_widget[2].set_text("Time: %n", seconds) -- A faction out of reinforcements or of players, or time up: the -- faction with the most reinforcements left wins. if unsc_players == 0 then unsc = 0 end if covenant_players == 0 then covenant = 0 end if unsc == 0 or covenant == 0 or remaining.is_zero() then phase = 2 if unsc > covenant then script_widget[2].set_text("UNSC victory") team[0].end_round() altif covenant > unsc then script_widget[2].set_text("Covenant victory") team[1].end_round() alt script_widget[2].set_text("Battle ended in a draw") game.end_round() end end end -- Shared income includes players waiting to deploy, but only during battle. if phase == 1 and income.is_zero() then for each player do if current_player.team == team[0] or current_player.team == team[1] then points = current_player.get_deployment_points() points += 25 if points > 100000 then points = 100000 end current_player.set_deployment_points(points) end end income = 30 income.set_rate(-100%) end script_widget[0].set_text("UNSC %n", unsc) script_widget[0].set_meter_params(number, unsc, script_option[1]) script_widget[1].set_text("%n COVENANT", covenant) script_widget[1].set_meter_params(number, covenant, script_option[1]) script_widget[0].set_visibility(all_players, true) script_widget[1].set_visibility(all_players, true) script_widget[2].set_visibility(all_players, true) end for each player do -- A faction out of reinforcements deploys no one until the battle ends. current_player.beaten = 0 if phase == 1 then if current_player.team == team[0] and unsc == 0 then current_player.beaten = 1 end if current_player.team == team[1] and covenant == 0 then current_player.beaten = 1 end end -- Dead without a class once the respawn countdown ends: choosing. A -- chosen class waits for a safe spawn. current_player.choosing = 0 class = current_player.get_deployment_class() seconds = current_player.get_respawn_time() if not current_player.is_not_respawning() and class == -1 and seconds == 0 and phase != 2 and current_player.beaten == 0 then current_player.choosing = 1 end current_player.faction = 0 current_player.first = 0 current_player.spare = 23 if current_player.team == team[1] then current_player.faction = 1 current_player.first = 16 current_player.spare = 29 end if current_player.choosing == 1 and current_player.picker == 0 then current_player.set_ui_menu(true) if current_player.team == team[0] then script_widget[4].set_text_for(current_player, "UNSC - CHOOSE YOUR CLASS") script_widget[3].set_border(current_player, 90, 170, 255, 140) script_widget[8].set_text_for(current_player, "Army Trooper | Assault Rifle | FREE") script_widget[9].set_text_for(current_player, "Trooper Marksman | DMR | 100") script_widget[10].set_text_for(current_player, "Trooper Breacher | Shotgun + Magnum | 100") script_widget[11].set_text_for(current_player, "Trooper Grenadier | Grenade Launcher + Assault Rifle | 150") script_widget[23].set_text_for(current_player, "Spartan Recruit | Assault Rifle | FREE") altif current_player.team == team[1] then script_widget[4].set_text_for(current_player, "COVENANT - CHOOSE YOUR CLASS") script_widget[3].set_border(current_player, 190, 150, 255, 140) script_widget[8].set_text_for(current_player, "Grunt Minor | Plasma Pistol | FREE") script_widget[9].set_text_for(current_player, "Grunt Major | Needler | 50") script_widget[11].set_text_for(current_player, "Jackal | Plasma Pistol | FREE") script_widget[13].set_text_for(current_player, "Skirmisher | Plasma Pistol | 50") script_widget[14].set_text_for(current_player, "Skirmisher Marksman | Needle Rifle | 150") script_widget[15].set_text_for(current_player, "Brute Minor | Spiker | 100") script_widget[29].set_text_for(current_player, "Elite Recruit | Plasma Repeater | FREE") end script_widget[6].set_text_for(current_player, "Click a class to deploy. Purchases last for this life; unspent points survive death.") script_widget[6].set_color(current_player, 150, 160, 175, 255) current_player.picker = 1 end if current_player.choosing == 0 and current_player.picker == 1 then current_player.set_ui_menu(false) current_player.picker = 0 end script_widget[3].set_visibility(current_player, current_player.choosing) script_widget[4].set_visibility(current_player, current_player.choosing) script_widget[5].set_visibility(current_player, current_player.choosing) script_widget[6].set_visibility(current_player, current_player.choosing) script_widget[7].set_visibility(current_player, current_player.choosing) -- A card shows while choosing when its class is of the player's -- faction and this map can have its character (else it reads -1). -- The faction's number is compared from a global. points = current_player.faction class = current_player.first scratch = game.get_deployment_team(class) script_widget[8].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[8].set_visibility(current_player, false) end class = current_player.first class += 1 scratch = game.get_deployment_team(class) script_widget[9].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[9].set_visibility(current_player, false) end class = current_player.first class += 2 scratch = game.get_deployment_team(class) script_widget[10].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[10].set_visibility(current_player, false) end class = current_player.first class += 3 scratch = game.get_deployment_team(class) script_widget[11].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[11].set_visibility(current_player, false) end class = current_player.first class += 4 scratch = game.get_deployment_team(class) script_widget[12].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[12].set_visibility(current_player, false) end class = current_player.first class += 5 scratch = game.get_deployment_team(class) script_widget[13].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[13].set_visibility(current_player, false) end class = current_player.first class += 6 scratch = game.get_deployment_team(class) script_widget[14].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[14].set_visibility(current_player, false) end class = current_player.first class += 7 scratch = game.get_deployment_team(class) script_widget[15].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[15].set_visibility(current_player, false) end class = current_player.first class += 8 scratch = game.get_deployment_team(class) script_widget[16].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[16].set_visibility(current_player, false) end class = current_player.first class += 9 scratch = game.get_deployment_team(class) script_widget[17].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[17].set_visibility(current_player, false) end class = current_player.first class += 10 scratch = game.get_deployment_team(class) script_widget[18].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[18].set_visibility(current_player, false) end class = current_player.first class += 11 scratch = game.get_deployment_team(class) script_widget[19].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[19].set_visibility(current_player, false) end class = current_player.first class += 12 scratch = game.get_deployment_team(class) script_widget[20].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[20].set_visibility(current_player, false) end class = current_player.first class += 13 scratch = game.get_deployment_team(class) script_widget[21].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[21].set_visibility(current_player, false) end class = current_player.first class += 14 scratch = game.get_deployment_team(class) script_widget[22].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[22].set_visibility(current_player, false) end class = current_player.first class += 15 scratch = game.get_deployment_team(class) script_widget[23].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[23].set_visibility(current_player, false) end class = current_player.first class += 16 scratch = game.get_deployment_team(class) script_widget[24].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[24].set_visibility(current_player, false) end class = current_player.first class += 17 scratch = game.get_deployment_team(class) script_widget[25].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[25].set_visibility(current_player, false) end class = current_player.first class += 18 scratch = game.get_deployment_team(class) script_widget[26].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[26].set_visibility(current_player, false) end class = current_player.first class += 19 scratch = game.get_deployment_team(class) script_widget[27].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[27].set_visibility(current_player, false) end class = current_player.first class += 20 scratch = game.get_deployment_team(class) script_widget[28].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[28].set_visibility(current_player, false) end class = current_player.first class += 21 scratch = game.get_deployment_team(class) script_widget[29].set_visibility(current_player, current_player.choosing) if scratch != points then script_widget[29].set_visibility(current_player, false) end -- The spare free class's card hides while the faction's first class -- can deploy. class = current_player.first scratch = game.get_deployment_team(class) if scratch == points then if current_player.team == team[0] then script_widget[23].set_visibility(current_player, false) end if current_player.team == team[1] then script_widget[29].set_visibility(current_player, false) end end if current_player.choosing == 1 then points = current_player.get_deployment_points() script_widget[5].set_text_for(current_player, "%n DEPLOYMENT POINTS", points) -- Limited classes show how many are deployed; a card is bright when -- its class is affordable. if current_player.team == team[0] then script_widget[12].set_text_for(current_player, "Trooper Sniper | Sniper Rifle + Magnum | 200 | %n/%n", game.get_deployment_occupied(4), game.get_deployment_limit(4)) script_widget[13].set_text_for(current_player, "Trooper Heavy | Rocket Launcher + Assault Rifle | 250 | %n/%n", game.get_deployment_occupied(5), game.get_deployment_limit(5)) script_widget[14].set_text_for(current_player, "ODST | DMR + Magnum | 200 | %n/%n", game.get_deployment_occupied(6), game.get_deployment_limit(6)) script_widget[15].set_text_for(current_player, "Spartan Rifleman | Assault Rifle + Magnum | 400 | %n/%n", game.get_deployment_occupied(7), game.get_deployment_limit(7)) script_widget[16].set_text_for(current_player, "Spartan Marksman | DMR + Magnum | 450 | %n/%n", game.get_deployment_occupied(8), game.get_deployment_limit(8)) script_widget[17].set_text_for(current_player, "Spartan Breacher | Shotgun + Assault Rifle | 450 | %n/%n", game.get_deployment_occupied(9), game.get_deployment_limit(9)) script_widget[18].set_text_for(current_player, "Spartan Grenadier | Grenade Launcher + DMR | 500 | %n/%n", game.get_deployment_occupied(10), game.get_deployment_limit(10)) script_widget[19].set_text_for(current_player, "Spartan Sniper | Sniper Rifle + Magnum | 550 | %n/%n", game.get_deployment_occupied(11), game.get_deployment_limit(11)) script_widget[20].set_text_for(current_player, "Spartan Heavy | Rocket Launcher + Assault Rifle | 550 | %n/%n", game.get_deployment_occupied(12), game.get_deployment_limit(12)) script_widget[21].set_text_for(current_player, "Spartan Laser Specialist | Spartan Laser + DMR | 600 | %n/%n", game.get_deployment_occupied(13), game.get_deployment_limit(13)) script_widget[22].set_text_for(current_player, "Sentinel | Sentinel Beam | Flies | 350 | %n/%n", game.get_deployment_occupied(14), game.get_deployment_limit(14)) end if current_player.team == team[1] then script_widget[10].set_text_for(current_player, "Grunt Heavy | Fuel Rod Gun | 150 | %n/%n", game.get_deployment_occupied(18), game.get_deployment_limit(18)) script_widget[12].set_text_for(current_player, "Jackal Sniper | Focus Rifle | 150 | %n/%n", game.get_deployment_occupied(20), game.get_deployment_limit(20)) script_widget[16].set_text_for(current_player, "Brute Captain | Concussion Rifle + Spiker | 250 | %n/%n", game.get_deployment_occupied(24), game.get_deployment_limit(24)) script_widget[17].set_text_for(current_player, "Brute Berserker | Gravity Hammer + Spiker | 450 | %n/%n", game.get_deployment_occupied(25), game.get_deployment_limit(25)) script_widget[18].set_text_for(current_player, "Elite Minor | Plasma Repeater | 300 | %n/%n", game.get_deployment_occupied(26), game.get_deployment_limit(26)) script_widget[19].set_text_for(current_player, "Elite Officer | Needle Rifle + Plasma Pistol | 400 | %n/%n", game.get_deployment_occupied(27), game.get_deployment_limit(27)) script_widget[20].set_text_for(current_player, "Elite Spec Ops | Energy Sword + Plasma Repeater | 450 | %n/%n", game.get_deployment_occupied(28), game.get_deployment_limit(28)) script_widget[21].set_text_for(current_player, "Elite Ultra | Concussion Rifle + Plasma Rifle | 500 | %n/%n", game.get_deployment_occupied(29), game.get_deployment_limit(29)) script_widget[22].set_text_for(current_player, "Elite General | Plasma Launcher + Energy Sword | 600 | %n/%n", game.get_deployment_occupied(30), game.get_deployment_limit(30)) script_widget[23].set_text_for(current_player, "Hunter | Fuel Rod Cannon + Melee | 700 | %n/%n", game.get_deployment_occupied(31), game.get_deployment_limit(31)) script_widget[24].set_text_for(current_player, "Drone | Plasma Pistol | Flies | 100 | %n/%n", game.get_deployment_occupied(32), game.get_deployment_limit(32)) script_widget[25].set_text_for(current_player, "Drone Needler | Needler | Flies | 200 | %n/%n", game.get_deployment_occupied(33), game.get_deployment_limit(33)) script_widget[26].set_text_for(current_player, "Engineer | Unarmed | Flies | 150 | %n/%n", game.get_deployment_occupied(34), game.get_deployment_limit(34)) script_widget[27].set_text_for(current_player, "Brute Chieftain | Gravity Hammer + Spiker | 550 | %n/%n", game.get_deployment_occupied(35), game.get_deployment_limit(35)) script_widget[28].set_text_for(current_player, "Guta | Claws | 650 | %n/%n", game.get_deployment_occupied(36), game.get_deployment_limit(36)) end class = current_player.first scratch = game.get_deployment_cost(class) script_widget[8].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[8].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 1 scratch = game.get_deployment_cost(class) script_widget[9].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[9].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 2 scratch = game.get_deployment_cost(class) script_widget[10].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[10].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 3 scratch = game.get_deployment_cost(class) script_widget[11].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[11].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 4 scratch = game.get_deployment_cost(class) script_widget[12].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[12].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 5 scratch = game.get_deployment_cost(class) script_widget[13].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[13].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 6 scratch = game.get_deployment_cost(class) script_widget[14].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[14].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 7 scratch = game.get_deployment_cost(class) script_widget[15].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[15].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 8 scratch = game.get_deployment_cost(class) script_widget[16].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[16].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 9 scratch = game.get_deployment_cost(class) script_widget[17].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[17].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 10 scratch = game.get_deployment_cost(class) script_widget[18].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[18].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 11 scratch = game.get_deployment_cost(class) script_widget[19].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[19].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 12 scratch = game.get_deployment_cost(class) script_widget[20].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[20].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 13 scratch = game.get_deployment_cost(class) script_widget[21].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[21].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 14 scratch = game.get_deployment_cost(class) script_widget[22].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[22].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 15 scratch = game.get_deployment_cost(class) script_widget[23].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[23].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 16 scratch = game.get_deployment_cost(class) script_widget[24].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[24].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 17 scratch = game.get_deployment_cost(class) script_widget[25].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[25].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 18 scratch = game.get_deployment_cost(class) script_widget[26].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[26].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 19 scratch = game.get_deployment_cost(class) script_widget[27].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[27].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 20 scratch = game.get_deployment_cost(class) script_widget[28].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[28].set_color(current_player, 235, 240, 245, 255) end class = current_player.first class += 21 scratch = game.get_deployment_cost(class) script_widget[29].set_color(current_player, 110, 118, 130, 255) if points >= scratch then script_widget[29].set_color(current_player, 235, 240, 245, 255) end end -- Waiting for a safe spawn, out of reinforcements, or deployed: the -- player's wallet. script_widget[30].set_visibility(current_player, false) if current_player.choosing == 0 and phase != 2 then class = current_player.get_deployment_class() if current_player.is_not_respawning() then script_widget[30].set_text_for(current_player, "%n deployment points", current_player.get_deployment_points()) altif current_player.beaten == 1 then script_widget[30].set_text_for(current_player, "Your faction is out of reinforcements | %n deployment points", current_player.get_deployment_points()) altif class == -1 then script_widget[30].set_text_for(current_player, "Class selection in %n | %n deployment points", current_player.get_respawn_time(), current_player.get_deployment_points()) alt script_widget[30].set_text_for(current_player, "Deployment confirmed. Waiting for the next safe spawn... %n points left", current_player.get_deployment_points()) end script_widget[30].set_visibility(current_player, true) end end -- Vehicle use, for every body the class gets. Each character keeps -- Reach's own health, shields and movement. Vehicle use covers every seat -- of a vehicle, a Warthog's or Wraith's gun included; turrets are the -- stand-alone guns. Classes: 0-15 UNSC, 16-37 Covenant, in the order of -- the class picker's cards. for each player do class = current_player.get_deployment_class() if class >= 0 then current_player.set_vehicle_use(true) current_player.set_turret_use(true) -- Grunts, Jackals and Skirmishers man turrets but don't drive or ride. if class == 16 or class == 17 or class == 18 or class == 19 or class == 20 or class == 21 or class == 22 then current_player.set_vehicle_use(false) end -- Hunters and the Guta are too big for any seat, and what flies -- (the Sentinel, Drones, Engineers) takes none. if class == 14 or class == 31 or class == 32 or class == 33 or class == 34 or class == 36 then current_player.set_vehicle_use(false) current_player.set_turret_use(false) end end end