Skip to content

Commit

Permalink
ASAT capture mission (#14359)
Browse files Browse the repository at this point in the history
* asat capture

* teleblocker

* repath phoron capture, all the other stuff

* teleblocker and time delay

* repath cap mission file

* mech count wrangle
  • Loading branch information
Lumipharon authored Nov 3, 2023
1 parent 9af9092 commit 93744d0
Show file tree
Hide file tree
Showing 10 changed files with 238 additions and 191 deletions.
198 changes: 108 additions & 90 deletions _maps/map_files/Lawanka_Outpost/LawankaOutpost.dmm

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions code/datums/gamemodes/campaign/faction_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ GLOBAL_LIST_INIT(campaign_mission_pool, list(
FACTION_TERRAGOV = list(
/datum/campaign_mission/tdm = 10,
/datum/campaign_mission/destroy_mission/fire_support_raid = 15,
/datum/campaign_mission/capture_mission = 15,
/datum/campaign_mission/capture_mission/phoron_capture = 15,
/datum/campaign_mission/tdm/mech_wars = 12,
/datum/campaign_mission/destroy_mission/supply_raid = 15,
/datum/campaign_mission/destroy_mission/base_rescue = 12,
),
FACTION_SOM = list(
/datum/campaign_mission/tdm/lv624 = 10,
/datum/campaign_mission/destroy_mission/fire_support_raid/som = 15,
/datum/campaign_mission/capture_mission = 15,
/datum/campaign_mission/tdm/mech_wars/som = 12,
/datum/campaign_mission/destroy_mission/supply_raid/som = 15,
/datum/campaign_mission/capture_mission/asat = 12,
),
))

Expand Down
70 changes: 29 additions & 41 deletions code/datums/gamemodes/campaign/missions/asat_capture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@
/datum/campaign_mission/capture_mission/asat
name = "ASAT capture"
mission_icon = "asat_capture"
map_name = "Orion Outpost"
map_file = '_maps/map_files/Campaign maps/jungle_outpost/jungle_outpost.dmm'
max_game_time = 20 MINUTES
map_name = "Lawanka outpost"
map_file = '_maps/map_files/Lawanka_Outpost/LawankaOutpost.dmm'
map_traits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_RAIN = TRUE)
map_light_colours = list(LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN)
mission_flags = MISSION_DISALLOW_TELEPORT
shutter_open_delay = list(
MISSION_STARTING_FACTION = 90 SECONDS,
MISSION_HOSTILE_FACTION = 0,
)
victory_point_rewards = list(
MISSION_OUTCOME_MAJOR_VICTORY = list(3, 0),
MISSION_OUTCOME_MAJOR_VICTORY = list(2, 0),
MISSION_OUTCOME_MINOR_VICTORY = list(1, 0),
MISSION_OUTCOME_DRAW = list(0, 0),
MISSION_OUTCOME_MINOR_LOSS = list(0, 1),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 3),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 2),
)
attrition_point_rewards = list(
MISSION_OUTCOME_MAJOR_VICTORY = list(10, 0),
MISSION_OUTCOME_MINOR_VICTORY = list(10, 0),
MISSION_OUTCOME_MINOR_VICTORY = list(5, 0),
MISSION_OUTCOME_DRAW = list(0, 0),
MISSION_OUTCOME_MINOR_LOSS = list(0, 25),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 30),
MISSION_OUTCOME_MINOR_LOSS = list(0, 10),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 15),
)
intro_message = list(
MISSION_STARTING_FACTION = "Locate and recover all ASAT systems in the AO before the enemy has time to respond.",
MISSION_HOSTILE_FACTION = "Protect all ASAT systems in the AO from the SOM attack.",
)

starting_faction_mission_brief = "A TGMC ASAT battery has been detected in this location. It forms part if their space defense grid across the planet and so is a valuable installation to them. \
Although the destruction of this site is unlikely to weaken their space defenses appreciably, \
the capture of these weapons would provide us with a unique opportunity to bypass parts of their own ship defenses. \
Expand All @@ -30,61 +39,40 @@
starting_faction_additional_rewards = "Additional ICC support, ability to counteract TGMC drop pod usage"
hostile_faction_additional_rewards = "Preserve the ability to use drop pods uncontested"

objectives_total = 5
min_capture_amount = 3

/datum/campaign_mission/capture_mission/asat/load_pre_mission_bonuses()
. = ..()
for(var/obj/effect/landmark/campaign/mech_spawner/mech_spawner AS in GLOB.campaign_mech_spawners[hostile_faction])
if(mech_spawner.type != /obj/effect/landmark/campaign/mech_spawner/light)
continue
var/new_mech = mech_spawner.spawn_mech()
GLOB.campaign_structures += new_mech
RegisterSignal(new_mech, COMSIG_QDELETING, TYPE_PROC_REF(/datum/campaign_mission, remove_mission_object))
return
spawn_mech(hostile_faction, 0, 0, 3)
spawn_mech(starting_faction, 0, 2)

/datum/campaign_mission/capture_mission/asat/load_objective_description()
starting_faction_objective_description = "Major Victory:Capture all [objectives_total] ASAT systems.[min_capture_amount ? " Minor Victory: Capture at least [min_capture_amount] ASAT systems." : ""]"
hostile_faction_objective_description = "Major Victory:Prevent the capture of all [objectives_total] ASAT systems.[min_capture_amount ? " Minor Victory: Prevent the capture of atleast [min_capture_amount] ASAT systems." : ""]"

/datum/campaign_mission/capture_mission/asat/check_mission_progress()
if(outcome)
return TRUE

if(!game_timer)
return FALSE

if(!max_time_reached && objectives_remaining) //todo: maybe a check in case both teams wipe each other out at the same time...
return FALSE

if(capture_count[MISSION_STARTING_FACTION] >= objectives_total)
message_admins("Mission finished: [MISSION_OUTCOME_MAJOR_VICTORY]")
outcome = MISSION_OUTCOME_MAJOR_VICTORY
else if(min_capture_amount && (capture_count[MISSION_STARTING_FACTION] >= min_capture_amount))
message_admins("Mission finished: [MISSION_OUTCOME_MINOR_VICTORY]")
outcome = MISSION_OUTCOME_MINOR_VICTORY
else if(capture_count[MISSION_STARTING_FACTION] > 0)
message_admins("Mission finished: [MISSION_OUTCOME_MINOR_LOSS]")
outcome = MISSION_OUTCOME_MINOR_LOSS
else
message_admins("Mission finished: [MISSION_OUTCOME_MAJOR_LOSS]")
outcome = MISSION_OUTCOME_MAJOR_LOSS

return TRUE

/datum/campaign_mission/capture_mission/asat/apply_major_victory()
. = ..()
var/datum/faction_stats/som_team = mode.stat_list[starting_faction]
som_team.add_asset(/datum/campaign_asset/droppod_disable)
som_team.add_asset(/datum/campaign_asset/bonus_job/icc)
som_team.add_asset(/datum/campaign_asset/bonus_job/icc)

/datum/campaign_mission/capture_mission/asat/apply_minor_victory()
. = ..()
var/datum/faction_stats/som_team = mode.stat_list[starting_faction]
som_team.add_asset(/datum/campaign_asset/droppod_disable)
som_team.add_asset(/datum/campaign_asset/bonus_job/icc)

/datum/campaign_mission/capture_mission/asat/apply_minor_loss()
. = ..()
var/datum/faction_stats/tgmc_team = mode.stat_list[hostile_faction]
tgmc_team.add_asset(/datum/campaign_asset/equipment/power_armor)

/datum/campaign_mission/capture_mission/asat/apply_major_loss()
. = ..()
var/datum/faction_stats/tgmc_team = mode.stat_list[hostile_faction]
tgmc_team.add_asset(/datum/campaign_asset/equipment/power_armor)

/datum/campaign_mission/capture_mission/asat/objective_reward_bonus()
return
5 changes: 3 additions & 2 deletions code/datums/gamemodes/campaign/missions/base_rescue.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
mission_flags = MISSION_DISALLOW_TELEPORT
map_name = "NT site B-403"
map_file = '_maps/map_files/Campaign maps/nt_base/nt_base.dmm'
map_traits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_RAIN = TRUE)
map_light_colours = list(LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN)
map_traits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_SNOWSTORM = TRUE)
map_light_colours = list(COLOR_MISSION_BLUE, COLOR_MISSION_BLUE, COLOR_MISSION_BLUE, COLOR_MISSION_BLUE)
map_light_levels = list(225, 150, 100, 75)
objectives_total = 1
min_destruction_amount = 1
shutter_open_delay = list(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,7 @@
//Loot capture mission
/datum/campaign_mission/capture_mission
name = "Phoron retrieval"
mission_icon = "phoron_raid"
map_name = "Jungle outpost SR-422"
map_file = '_maps/map_files/Campaign maps/jungle_outpost/jungle_outpost.dmm'
map_traits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_RAIN = TRUE)
map_light_colours = list(LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN)
name = "BASE CAPTURE MISSION"
max_game_time = 12 MINUTES
mission_flags = MISSION_DISALLOW_DROPPODS|MISSION_DISALLOW_TELEPORT
victory_point_rewards = list(
MISSION_OUTCOME_MAJOR_VICTORY = list(3, 0),
MISSION_OUTCOME_MINOR_VICTORY = list(1, 0),
MISSION_OUTCOME_DRAW = list(0, 0),
MISSION_OUTCOME_MINOR_LOSS = list(0, 1),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 3),
)
attrition_point_rewards = list(
MISSION_OUTCOME_MAJOR_VICTORY = list(10, 0),
MISSION_OUTCOME_MINOR_VICTORY = list(5, 0),
MISSION_OUTCOME_DRAW = list(0, 0),
MISSION_OUTCOME_MINOR_LOSS = list(0, 10),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 15),
)
intro_message = list(
MISSION_STARTING_FACTION = "Locate and extract all phoron crates in the ao before the enemy does.",
MISSION_HOSTILE_FACTION = "Locate and extract all phoron crates in the ao before the enemy does.",
)
starting_faction_mission_brief = "Hostile forces have been building a stock pile of valuable phoron in this location. \
Before they have the chance to ship it out, your forces are being sent to intercept and liberate these supplies to hamper the enemy's war effort. \
Hostile forces will likely be aiming to evacuate as much phoron out of the ao as well. Get to the phoron first and fulton out as much as you can."
hostile_faction_mission_brief = "Enemy forces are moving to steal a stockpile of valuable phoron. \
Send in your forces to fulton out the phoron as quickly as possible, before they can get to it first."
starting_faction_additional_rewards = "Additional supplies for every phoron crate captured"
hostile_faction_additional_rewards = "Additional supplies for every phoron crate captured"
///Total number of objectives at round start
var/objectives_total = 11
///number of targets to capture for a minor victory
Expand Down Expand Up @@ -98,23 +67,7 @@
outcome = MISSION_OUTCOME_DRAW
return TRUE

/datum/campaign_mission/capture_mission/apply_major_victory()
. = ..()
objective_reward_bonus()

/datum/campaign_mission/capture_mission/apply_minor_victory()
. = ..()
objective_reward_bonus()

/datum/campaign_mission/capture_mission/apply_minor_loss()
. = ..()
objective_reward_bonus()

/datum/campaign_mission/capture_mission/apply_major_loss()
. = ..()
objective_reward_bonus()

/datum/campaign_mission/capture_mission/apply_draw()
/datum/campaign_mission/capture_mission/apply_outcome()
. = ..()
objective_reward_bonus()

Expand Down Expand Up @@ -152,8 +105,8 @@

///The addition rewards for capturing objectives, regardless of outcome
/datum/campaign_mission/capture_mission/proc/objective_reward_bonus()
var/starting_team_bonus = capture_count[MISSION_STARTING_FACTION] * 4
var/hostile_team_bonus = capture_count[MISSION_HOSTILE_FACTION] * 2
var/starting_team_bonus = capture_count[MISSION_STARTING_FACTION] * 3
var/hostile_team_bonus = capture_count[MISSION_HOSTILE_FACTION] * 3

modify_attrition_points(starting_team_bonus, hostile_team_bonus)
map_text_broadcast(starting_faction, "[starting_team_bonus] bonus attrition points awarded for the capture of [capture_count[MISSION_STARTING_FACTION]] objectives", "Bonus reward")
Expand Down
57 changes: 57 additions & 0 deletions code/datums/gamemodes/campaign/missions/phoron_capture.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//Loot capture mission
/datum/campaign_mission/capture_mission/phoron_capture
name = "Phoron retrieval"
mission_icon = "phoron_raid"
map_name = "Jungle outpost SR-422"
map_file = '_maps/map_files/Campaign maps/jungle_outpost/jungle_outpost.dmm'
map_traits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_RAIN = TRUE)
map_light_colours = list(LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN, LIGHT_COLOR_PALE_GREEN)
mission_flags = MISSION_DISALLOW_DROPPODS|MISSION_DISALLOW_TELEPORT
victory_point_rewards = list(
MISSION_OUTCOME_MAJOR_VICTORY = list(3, 0),
MISSION_OUTCOME_MINOR_VICTORY = list(1, 0),
MISSION_OUTCOME_DRAW = list(0, 0),
MISSION_OUTCOME_MINOR_LOSS = list(0, 1),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 3),
)
attrition_point_rewards = list(
MISSION_OUTCOME_MAJOR_VICTORY = list(10, 0),
MISSION_OUTCOME_MINOR_VICTORY = list(5, 0),
MISSION_OUTCOME_DRAW = list(0, 0),
MISSION_OUTCOME_MINOR_LOSS = list(0, 10),
MISSION_OUTCOME_MAJOR_LOSS = list(0, 15),
)
intro_message = list(
MISSION_STARTING_FACTION = "Locate and extract all phoron crates in the AO before the enemy does.",
MISSION_HOSTILE_FACTION = "Locate and extract all phoron crates in the AO before the enemy does.",
)
starting_faction_mission_brief = "Hostile forces have been building a stock pile of valuable phoron in this location. \
Before they have the chance to ship it out, your forces are being sent to intercept and liberate these supplies to hamper the enemy's war effort. \
Hostile forces will likely be aiming to evacuate as much phoron out of the AO as well. Get to the phoron first and fulton out as much as you can."
hostile_faction_mission_brief = "Enemy forces are moving to steal a stockpile of valuable phoron that we are transporting for a local union. \
Send in your forces to fulton out the phoron as quickly as possible, before they can get to it first."
starting_faction_additional_rewards = "Additional supplies for every phoron crate captured, and freelancer support"
hostile_faction_additional_rewards = "Additional supplies for every phoron crate captured and local support"
objectives_total = 11
min_capture_amount = 7

/datum/campaign_mission/capture_mission/phoron_capture/apply_major_victory()
. = ..()
var/datum/faction_stats/tgmc_team = mode.stat_list[starting_faction]
tgmc_team.add_asset(/datum/campaign_asset/mech/light)
tgmc_team.add_asset(/datum/campaign_asset/bonus_job/freelancer)

/datum/campaign_mission/capture_mission/phoron_capture/apply_minor_victory()
. = ..()
var/datum/faction_stats/tgmc_team = mode.stat_list[starting_faction]
tgmc_team.add_asset(/datum/campaign_asset/bonus_job/freelancer)

/datum/campaign_mission/capture_mission/phoron_capture/apply_minor_loss()
. = ..()
var/datum/faction_stats/som_team = mode.stat_list[hostile_faction]
som_team.add_asset(/datum/campaign_asset/attrition_modifier/local_approval)

/datum/campaign_mission/capture_mission/phoron_capture/apply_major_loss()
. = ..()
var/datum/faction_stats/som_team = mode.stat_list[hostile_faction]
som_team.add_asset(/datum/campaign_asset/attrition_modifier/local_approval)
22 changes: 22 additions & 0 deletions code/datums/gamemodes/campaign/rewards/attrition_mods.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@
attrition_mod = 0.2
ui_icon = "support_2"

/datum/campaign_asset/attrition_modifier/corporate_backing/reapply()
faction.add_asset(/datum/campaign_asset/attrition_modifier/corporate_directive)
remove_passive_effect()

/datum/campaign_asset/attrition_modifier/corporate_directive
name = "Corporate directive"
desc = "+30% passive Attrition Point gain"
detailed_desc = "Our mission goals have been realigned with ensuring that lawful megacorporate economic uplift programs can be reestablished. The corporations are now heavily support our efforts."
attrition_mod = 0.3
ui_icon = "support_3"

//native support
/datum/campaign_asset/attrition_modifier/local_approval
name = "Indigenous approval"
Expand All @@ -62,6 +73,17 @@
attrition_mod = 0.2
ui_icon = "support_2"

/datum/campaign_asset/attrition_modifier/local_backing/reapply()
faction.add_asset(/datum/campaign_asset/attrition_modifier/local_uprising)
remove_passive_effect()

/datum/campaign_asset/attrition_modifier/local_uprising
name = "Indigenous uprising"
desc = "+30% passive Attrition Point gain"
detailed_desc = "Signficiant portions of the local population now actively oppose our enemy as well as supporting our forces. Large swathes of the planet can be considered friendly territory."
attrition_mod = 0.3
ui_icon = "support_3"

/datum/campaign_asset/attrition_modifier/malus_standard
name = "Degraded supply lines"
desc = "-20% passive Attrition Point gain"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
name = "phoron crate objective"
icon = 'icons/obj/structures/campaign_structures.dmi'
icon_state = "orebox_phoron"
mission_types = list(/datum/campaign_mission/capture_mission)
mission_types = list(/datum/campaign_mission/capture_mission/phoron_capture)
spawn_object = /obj/structure/campaign_objective/capture_objective/fultonable

/obj/structure/campaign_objective/capture_objective/fultonable
Expand Down Expand Up @@ -219,6 +219,13 @@
icon = 'icons/obj/structures/campaign_structures.dmi'
icon_state = "asat"
desc = "A sophisticated surface to space missile system designed for attacking orbiting satellites or spacecraft."
capture_delay = 45 SECONDS
capture_flags = CAPTURE_OBJECTIVE_RECAPTURABLE
owning_faction = FACTION_TERRAGOV //this could have a coded solution, but the mission is tgmc specific
///owning faction
var/faction = FACTION_TERRAGOV

/obj/structure/campaign_objective/capture_objective/fultonable/asat_system/capture_check(mob/living/user)
//This is a 'defend' objective. The defending faction can't actually claim it for themselves, just decap it.
if((user.faction == faction) && !capturing_faction && !owning_faction)
user.balloon_alert(user, "Defend this objective!")
return FALSE
return ..()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
icon = 'icons/obj/structures/campaign/tele_blocker.dmi'
icon_state = "tele_blocker"
pixel_x = -16
mission_types = list(/datum/campaign_mission/destroy_mission/supply_raid/som, /datum/campaign_mission/destroy_mission/fire_support_raid/som)
mission_types = list(/datum/campaign_mission/destroy_mission/supply_raid/som, /datum/campaign_mission/destroy_mission/fire_support_raid/som, /datum/campaign_mission/capture_mission/asat)
spawn_object = /obj/structure/campaign_deployblocker

/obj/structure/campaign_deployblocker
Expand Down
3 changes: 2 additions & 1 deletion tgmc.dme
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,14 @@
#include "code\datums\gamemodes\campaign\missions\airbase_raid.dm"
#include "code\datums\gamemodes\campaign\missions\asat_capture.dm"
#include "code\datums\gamemodes\campaign\missions\base_rescue.dm"
#include "code\datums\gamemodes\campaign\missions\capture_mission.dm"
#include "code\datums\gamemodes\campaign\missions\comm_uplink.dm"
#include "code\datums\gamemodes\campaign\missions\destroy_mission.dm"
#include "code\datums\gamemodes\campaign\missions\final_mission.dm"
#include "code\datums\gamemodes\campaign\missions\fire_support_raid.dm"
#include "code\datums\gamemodes\campaign\missions\loot_capture.dm"
#include "code\datums\gamemodes\campaign\missions\mech_wars.dm"
#include "code\datums\gamemodes\campaign\missions\patrol_mission.dm"
#include "code\datums\gamemodes\campaign\missions\phoron_capture.dm"
#include "code\datums\gamemodes\campaign\missions\raiding_base.dm"
#include "code\datums\gamemodes\campaign\missions\spearhead_assault.dm"
#include "code\datums\gamemodes\campaign\missions\supply_raid.dm"
Expand Down

0 comments on commit 93744d0

Please sign in to comment.