-- Conquest: two teams fight over the map's territories for tickets, in -- squads and classes, and choose where to deploy on the map seen from -- above. -- -- Tickets: each team starts with as many as the tickets option. Every -- death costs its team one (a revive gives it back), and while one team -- holds more territories than the other, the other loses one every few -- seconds. A team out of tickets loses; when the time runs out, the team -- with more wins. -- -- Territories are Halo 3's own (the Territories game type's, on every -- map that has them): stand in one to capture it. -- -- Squads: every player is in a squad of up to four of their team. -- -- Deploying: while you wait to respawn, the deployment map shows the -- battle from above, with the territories in their holders' colours and -- your teammates where they are (your squad in green). Choose a class and -- where to deploy: your team's own spawn points (HQ), a territory your -- team holds, a squad mate who has been out of combat for five seconds, or -- your squad's beacon. You may choose while the countdown runs; you deploy -- as it ends. -- -- Classes (the abilities are the game mode ability keys: X, 2, 3 and H, -- or the D-pad's right, left and down): -- Assault (battle rifle): three grenades, and a quarter more health. -- Medic (assault rifle): spawns with a regenerator (Use equipment), and -- Ability 1 deploys another (45 s). Hold Ability 3 over a fallen -- teammate's body (a cross shows it to the team) for two seconds to -- revive them there, as the class they were. -- Support (SMG and shotgun): Ability 1 drops an ammunition case that -- refills the weapons of teammates beside it (30 s; on a map without -- the case, the teammates beside you, and you, are refilled at once); -- Ability 2 gives them an overshield (25 s). -- Engineer (rocket launcher): spawns with a trip mine; Ability 1 -- deploys a power drain (45 s); hold Ability 3 in or beside a vehicle -- to repair it while it still stands. -- Recon (sniper rifle): Ability 1 hides you for 8 seconds (30 s); -- Ability 2 marks the enemy in your sights for your team for 10 -- seconds; Ability 3 plants your squad's spawn beacon (a radar jammer, -- 30 s), which the enemy can destroy. -- Only Engineers pick up rocket launchers, Spartan lasers, fuel rod guns -- and missile pods, and only Recons sniper and beam rifles. --[=[ mode name = "Conquest" mode = "Territories" [rules] score_to_win = 0 kill_points = 0 death_points = 0 suicide_points = 0 betrayal_points = 0 [options] "mode.capture" = 10 "mode.lock_on_capture" = 0 "mode.one_sided" = 0 "mode.sudden_death" = 0 "respawn.seconds" = 10 "rounds.limit" = 1 "rounds.minutes" = 0 "rounds.teams" = 1 [logic] scripted_round_end = true [logic.options] bleed_seconds = { value = 3.0, min = 1.0, max = 30.0 } death_cost = { value = 1.0, min = 0.0, max = 10.0 } round_seconds = { value = 1800.0, min = 60.0, max = 3600.0 } squad_size = { value = 4.0, min = 2.0, max = 8.0 } squad_spawn_seconds = { value = 5.0, min = 0.0, max = 30.0 } tickets = { value = 250.0, min = 10.0, max = 2000.0 } [[logic.megalo_traits]] camouflage = 4 [logic.deployment] title = "Conquest" teams = ["Red", "Blue"] [[logic.deployment.classes]] name = "Assault" description = "Battle rifle, more grenades and more health." team = 0 cost = 0 biped = "spartan" primary = "battle_rifle" secondary = "magnum" grenades = [3, 0, 0, 0] health = 1.25 max_active = 0 [[logic.deployment.classes]] name = "Medic" description = "Revives fallen teammates and deploys regenerators." team = 0 cost = 0 biped = "spartan" primary = "assault_rifle" secondary = "magnum" grenades = [2, 0, 0, 0] max_active = 0 [[logic.deployment.classes]] name = "Support" description = "Drops ammunition and gives teammates overshields." team = 0 cost = 0 biped = "spartan" primary = "smg" secondary = "shotgun" grenades = [2, 0, 0, 0] max_active = 0 [[logic.deployment.classes]] name = "Engineer" description = "Rockets, trip mines and power drains; repairs vehicles." team = 0 cost = 0 biped = "spartan" primary = "rocket_launcher" secondary = "smg" grenades = [1, 0, 0, 0] max_active = 3 [[logic.deployment.classes]] name = "Recon" description = "Sniper rifle, camouflage, marked targets and a spawn beacon." team = 0 cost = 0 biped = "spartan" primary = "sniper_rifle" secondary = "magnum" grenades = [1, 0, 0, 0] max_active = 2 [[logic.deployment.classes]] name = "Assault" description = "Battle rifle, more grenades and more health." team = 1 cost = 0 biped = "spartan" primary = "battle_rifle" secondary = "magnum" grenades = [3, 0, 0, 0] health = 1.25 max_active = 0 [[logic.deployment.classes]] name = "Medic" description = "Revives fallen teammates and deploys regenerators." team = 1 cost = 0 biped = "spartan" primary = "assault_rifle" secondary = "magnum" grenades = [2, 0, 0, 0] max_active = 0 [[logic.deployment.classes]] name = "Support" description = "Drops ammunition and gives teammates overshields." team = 1 cost = 0 biped = "spartan" primary = "smg" secondary = "shotgun" grenades = [2, 0, 0, 0] max_active = 0 [[logic.deployment.classes]] name = "Engineer" description = "Rockets, trip mines and power drains; repairs vehicles." team = 1 cost = 0 biped = "spartan" primary = "rocket_launcher" secondary = "smg" grenades = [1, 0, 0, 0] max_active = 3 [[logic.deployment.classes]] name = "Recon" description = "Sniper rifle, camouflage, marked targets and a spawn beacon." team = 1 cost = 0 biped = "spartan" primary = "sniper_rifle" secondary = "magnum" grenades = [1, 0, 0, 0] max_active = 2 ]=] enum Kind assault medic support engineer recon end -- A player's class this life (its number among its team's five), whether -- this life's rules are set, whether a medic revived them, whether they -- hold a revive, a number shown, and their squad. alias kind = player.number[0] alias living = player.number[1] alias revived = player.number[2] alias holding = player.number[3] alias seconds = player.number[4] alias squad = player.number[5] -- Their body that fell, the enemy they marked, what they deployed and -- their beacon; whom they revive, and the team their squad is in. alias body = player.object[0] alias marked = player.object[1] alias deployed = player.object[2] alias beacon = player.object[3] alias reviving = player.player[0] alias home = player.team[0] -- Ability 1's cooldown; Ability 2's (Recon: the mark's time left); the -- camouflage left (Recon) or the next repair (Engineer); a revive (Medic) -- or the beacon's cooldown (Recon). alias cooldown = player.timer[0] alias cooldown_2 = player.timer[1] alias effect = player.timer[2] alias hold = player.timer[3] -- A beacon's hits from the enemy. alias hits = object.number[0] -- 0 waiting for both teams, 1 playing, 2 over. alias phase = global.number[0] alias red = global.number[1] alias blue = global.number[2] alias red_held = global.number[3] alias blue_held = global.number[4] alias count = global.number[5] alias candidate = global.number[6] alias distance = global.number[7] alias fit = global.number[8] alias health = global.number[9] alias class = global.number[10] alias result = global.number[11] alias target = global.object[0] alias fallen = global.object[1] alias actor = global.player[0] alias other = global.player[1] alias holder = global.team[0] alias bleed = global.timer[0] alias remaining = global.timer[1] alias ammo_pulse = global.timer[2] -- The weapons a new life may not pick up (the other classes'), and its -- equipment. function class_rules() current_player.set_weapon_pickup(all, 1) if current_player.kind != Kind.engineer then current_player.set_weapon_pickup(rocket_launcher, 0) current_player.set_weapon_pickup(spartan_laser, 0) current_player.set_weapon_pickup(fuel_rod_gun, 0) current_player.set_weapon_pickup(missile_pod, 0) end if current_player.kind != Kind.recon then current_player.set_weapon_pickup(sniper_rifle, 0) current_player.set_weapon_pickup(beam_rifle, 0) end if current_player.kind == Kind.medic then current_player.give_equipment(regenerator) end if current_player.kind == Kind.engineer then current_player.give_equipment(trip_mine) end end on init: do red = script_option[5] blue = script_option[5] bleed = script_option[0] remaining = script_option[2] ammo_pulse.set_rate(-100%) -- Blue's and Red's tickets either side of the top's middle, the -- territories below them. script_widget[0].set_position(all_players, 628, 18) script_widget[0].set_anchor(all_players, top_right) script_widget[0].set_size(all_players, 250, 0) script_widget[0].set_alignment(all_players, right) script_widget[0].set_color(all_players, 90, 170, 255, 255) script_widget[0].set_background(all_players, 8, 16, 28, 170) script_widget[0].set_font_size(all_players, 18) script_widget[1].set_position(all_players, 652, 18) script_widget[1].set_size(all_players, 250, 0) script_widget[1].set_color(all_players, 255, 100, 100, 255) script_widget[1].set_background(all_players, 8, 16, 28, 170) script_widget[1].set_font_size(all_players, 18) script_widget[2].set_position(all_players, 640, 84) script_widget[2].set_anchor(all_players, top) script_widget[2].set_font_size(all_players, 14) -- The class (widget 3: the class picker writes its name there), its -- abilities and the squad at the right, above Halo 3's score. script_widget[3].set_position(all_players, 1240, 474) script_widget[3].set_anchor(all_players, bottom_right) script_widget[3].set_alignment(all_players, right) script_widget[3].set_font_size(all_players, 18) script_widget[3].set_color(all_players, 255, 210, 90, 255) script_widget[4].set_position(all_players, 1240, 502) script_widget[4].set_anchor(all_players, bottom_right) script_widget[4].set_alignment(all_players, right) script_widget[5].set_position(all_players, 1240, 528) script_widget[5].set_anchor(all_players, bottom_right) script_widget[5].set_alignment(all_players, right) script_widget[6].set_position(all_players, 1240, 554) script_widget[6].set_anchor(all_players, bottom_right) script_widget[6].set_alignment(all_players, right) script_widget[6].set_color(all_players, 132, 222, 120, 255) end on object death: do current_player.living = 0 current_player.holding = 0 current_player.body = killed_object killed_object.set_deploy_point(no_team) -- The team sees where its fallen lie. killed_object.set_waypoint_icon(dead_teammate) killed_object.set_waypoint_visibility(current_player.team) if phase == 1 then if current_player.team == team[0] then red -= script_option[1] end if current_player.team == team[1] then blue -= script_option[1] end end end on button press: do actor = current_player if current_player.is_not_respawning() then if current_player.kind == Kind.medic and pressed_button == button.ability_1 and current_player.cooldown.is_zero() then current_player.deployed.delete() current_player.deployed = current_player.biped.place_at_me(regenerator, "regenerator", none, 10, 0, 2, none) current_player.cooldown = 45 current_player.cooldown.set_rate(-100%) end if current_player.kind == Kind.support and pressed_button == button.ability_1 and current_player.cooldown.is_zero() then current_player.deployed.delete() current_player.deployed = current_player.biped.place_at_me("objects/gear/human/military/case_ap_turret/case_ap_turret", "ammo_case", none, 10, 0, 2, none) -- A map without the case: the teammates beside you, and you, -- take their ammunition at once. if current_player.deployed == no_object then for each player do if current_player.is_not_respawning() and current_player.team == actor.team then distance = current_player.biped.get_distance_to(actor.biped) if distance <= 25 then current_player.refill_ammo() end end end end current_player.cooldown = 30 current_player.cooldown.set_rate(-100%) end if current_player.kind == Kind.support and pressed_button == button.ability_2 and current_player.cooldown_2.is_zero() then for each player do if current_player.is_not_respawning() and current_player.team == actor.team then distance = current_player.biped.get_distance_to(actor.biped) if distance <= 25 then current_player.biped.shields = 200 end end end current_player.cooldown_2 = 25 current_player.cooldown_2.set_rate(-100%) end if current_player.kind == Kind.engineer and pressed_button == button.ability_1 and current_player.cooldown.is_zero() then current_player.deployed.delete() current_player.deployed = current_player.biped.place_at_me(power_drainer, "power_drain", none, 15, 0, 2, none) current_player.cooldown = 45 current_player.cooldown.set_rate(-100%) end if current_player.kind == Kind.recon and pressed_button == button.ability_1 and current_player.cooldown.is_zero() then current_player.effect = 8 current_player.effect.set_rate(-100%) current_player.cooldown = 30 current_player.cooldown.set_rate(-100%) end -- Recon marks the enemy in their sights: a body or a vehicle that -- is no teammate's. if current_player.kind == Kind.recon and pressed_button == button.ability_2 then target = current_player.get_crosshair_target() fit = 0 if target.is_of_type(biped) or target.is_of_type(vehicle) then fit = 1 end for each player do if current_player.team == actor.team and current_player.biped == target then fit = 0 end end if fit == 1 then current_player.marked.set_waypoint_visibility(no_one) current_player.marked = target target.set_waypoint_icon(bullseye) target.set_waypoint_priority(blink) target.set_waypoint_visibility(current_player.team) current_player.cooldown_2 = 10 current_player.cooldown_2.set_rate(-100%) end end -- Recon plants their squad's beacon at their feet: a place to -- deploy for the squad (or the team, without one). if current_player.kind == Kind.recon and pressed_button == button.ability_3 and current_player.hold.is_zero() then current_player.beacon.delete() current_player.beacon = current_player.biped.place_at_me(radar_jammer, "beacon", none, 10, 0, 2, none) current_player.beacon.hits = 0 current_player.beacon.set_deploy_point(current_player.team, current_player.squad) current_player.beacon.set_waypoint_icon(flag) current_player.beacon.set_waypoint_visibility(current_player.team) current_player.hold = 30 current_player.hold.set_rate(-100%) end end end -- Ten hits from the enemy destroy a beacon. on object damaged: do actor = current_player target = current_object if actor != no_player then for each player do if current_player.beacon == target and current_player.team != actor.team then target.hits += 1 if target.hits >= 10 then target.delete() current_player.beacon = no_object end end end end end if phase != 2 then -- Squads: a player new to their team joins its first squad with room. for each player do if current_player.home != current_player.team then current_player.home = current_player.team current_player.set_squad(0) end end for each player do current_player.squad = current_player.get_squad() if current_player.squad == 0 then actor = current_player candidate = 1 -- A squad is full or not: the next one, at most once a player. for each player do count = 0 for each player do if current_player != actor and current_player.team == actor.team then result = current_player.get_squad() if result == candidate then count += 1 end end end if count >= script_option[3] then candidate += 1 end end actor.set_squad(candidate) actor.squad = candidate end end -- Territories: a team deploys at those it holds (the objects with a -- zone of their own are the territories' markers). red_held = team[0].get_territory_count() blue_held = team[1].get_territory_count() for each object do if current_object.shape_contains(current_object) then holder = current_object.get_territory_owner() current_object.set_deploy_point(holder) end end -- A squad deploys beside its players who are out of combat. for each player do target = current_player.biped if current_player.is_not_respawning() and current_player.squad > 0 then count = current_player.get_time_out_of_combat() if count >= script_option[4] then target.set_deploy_point(current_player.team, current_player.squad) alt target.set_deploy_point(no_team) end end end if phase == 0 then script_widget[2].set_text("Waiting for Red and Blue players") if team[0].has_any_players() and team[1].has_any_players() then phase = 1 bleed.set_rate(-100%) remaining.set_rate(-100%) end end if phase == 1 then -- The team holding fewer territories bleeds tickets. if bleed.is_zero() then if red_held > blue_held then blue -= 1 end if blue_held > red_held then red -= 1 end bleed = script_option[0] end if red < 0 then red = 0 end if blue < 0 then blue = 0 end count = remaining script_widget[2].set_text("Territories: Red %n, Blue %n | %n s left", red_held, blue_held, count) if red == 0 or blue == 0 or remaining.is_zero() then phase = 2 if red > blue then script_widget[2].set_text("Red wins Conquest") team[0].end_round() end if blue > red then script_widget[2].set_text("Blue wins Conquest") team[1].end_round() end if red == blue then script_widget[2].set_text("Conquest is a draw") game.end_round() end end end end for each player do actor = current_player -- A new life: its class's rules and gear. Back from a revive, the body -- that fell goes, and the next life deploys as the player chooses. if current_player.is_not_respawning() and current_player.living == 0 then current_player.living = 1 current_player.kind = current_player.get_deployment_class() current_player.kind %= 5 class_rules() current_player.body.set_waypoint_visibility(no_one) if current_player.revived == 1 then current_player.body.delete() current_player.set_primary_respawn_object(no_object) end current_player.body = no_object current_player.revived = 0 current_player.effect = 0 end if current_player.kind == Kind.recon and not current_player.effect.is_zero() then current_player.apply_traits(script_traits[0]) end if current_player.kind == Kind.recon and current_player.cooldown_2.is_zero() then current_player.marked.set_waypoint_visibility(no_one) current_player.marked = no_object end -- Medics revive the teammate whose body they hold Ability 3 over, for -- two seconds; the team has its ticket back. other = no_player if current_player.kind == Kind.medic and current_player.is_not_respawning() and current_player.is_button_held(button.ability_3) then for each player do fallen = current_player.body if not current_player.is_not_respawning() and current_player.team == actor.team and current_player.revived == 0 and fallen != no_object then distance = fallen.get_distance_to(actor.biped) if distance <= 15 then other = current_player end end end end if other == no_player then current_player.holding = 0 alt if current_player.holding == 0 or current_player.reviving != other then current_player.holding = 1 current_player.reviving = other current_player.hold = 2 current_player.hold.set_rate(-100%) end if current_player.hold.is_zero() then current_player.holding = 0 class = other.get_last_deployment_class() result = other.deploy_class(class) other.revived = 1 other.set_primary_respawn_object(other.body) other.set_respawn_time(0) if phase == 1 and other.team == team[0] then red += script_option[1] end if phase == 1 and other.team == team[1] then blue += script_option[1] end end end -- Engineers repair the vehicles beside them while they hold Ability -- 3: 5% twice a second, while the vehicle stands. if current_player.kind == Kind.engineer and current_player.is_not_respawning() and current_player.is_button_held(button.ability_3) and current_player.effect.is_zero() then current_player.effect = 1 current_player.effect.set_rate(-200%) for each object do if current_object.is_of_type(vehicle) then distance = current_object.get_distance_to(actor.biped) health = current_object.health if distance <= 30 and health > 0 and health < 100 then health += 5 if health > 100 then health = 100 end current_object.health = health end end end end end -- Ammunition cases refill the weapons of the teammates beside them. if ammo_pulse.is_zero() then for each player do actor = current_player target = current_player.deployed if current_player.kind == Kind.support and target != no_object then for each player do if current_player.is_not_respawning() and current_player.team == actor.team then distance = current_player.biped.get_distance_to(target) if distance <= 25 then current_player.refill_ammo() end end end end end ammo_pulse = 3 ammo_pulse.set_rate(-100%) end script_widget[0].set_text("Blue %n", blue) script_widget[0].set_meter_params(number, blue, script_option[5]) script_widget[1].set_text("Red %n", red) script_widget[1].set_meter_params(number, red, script_option[5]) script_widget[0].set_visibility(all_players, true) script_widget[1].set_visibility(all_players, true) script_widget[2].set_visibility(all_players, true) for each player do current_player.seconds = current_player.cooldown if current_player.kind == Kind.assault then script_widget[4].set_text_for(current_player, "Three grenades, more health") script_widget[5].set_text_for(current_player, "") end if current_player.kind == Kind.medic then script_widget[4].set_text_for(current_player, "Regenerator: ready") if not current_player.cooldown.is_zero() then script_widget[4].set_text_for(current_player, "Regenerator: %n s", current_player.seconds) end script_widget[5].set_text_for(current_player, "Hold Ability 3 over the fallen to revive") if current_player.holding == 1 then script_widget[5].set_text_for(current_player, "Reviving...") end end if current_player.kind == Kind.support then script_widget[4].set_text_for(current_player, "Ammunition case: ready") if not current_player.cooldown.is_zero() then script_widget[4].set_text_for(current_player, "Ammunition case: %n s", current_player.seconds) end current_player.seconds = current_player.cooldown_2 script_widget[5].set_text_for(current_player, "Overshield: ready") if not current_player.cooldown_2.is_zero() then script_widget[5].set_text_for(current_player, "Overshield: %n s", current_player.seconds) end end if current_player.kind == Kind.engineer then script_widget[4].set_text_for(current_player, "Power drain: ready") if not current_player.cooldown.is_zero() then script_widget[4].set_text_for(current_player, "Power drain: %n s", current_player.seconds) end script_widget[5].set_text_for(current_player, "Hold Ability 3 to repair vehicles") end if current_player.kind == Kind.recon then script_widget[4].set_text_for(current_player, "Camouflage: ready") if not current_player.cooldown.is_zero() then script_widget[4].set_text_for(current_player, "Camouflage: %n s", current_player.seconds) end current_player.seconds = current_player.hold script_widget[5].set_text_for(current_player, "Ability 2 marks a target, Ability 3 plants a beacon") if not current_player.hold.is_zero() then script_widget[5].set_text_for(current_player, "Beacon: %n s", current_player.seconds) end end script_widget[6].set_text_for(current_player, "Squad %n", current_player.squad) -- The class while alive; the deployment map shows the rest while -- waiting. if current_player.is_not_respawning() then script_widget[3].set_visibility(current_player, true) script_widget[4].set_visibility(current_player, true) script_widget[5].set_visibility(current_player, true) script_widget[6].set_visibility(current_player, true) alt script_widget[3].set_visibility(current_player, false) script_widget[4].set_visibility(current_player, false) script_widget[5].set_visibility(current_player, false) script_widget[6].set_visibility(current_player, false) end end