Skip to content

Commit

Permalink
Campaign vehicle scaling (#16307)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumipharon authored Jul 10, 2024
1 parent 84de87e commit 7d559ed
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 8 deletions.
4 changes: 4 additions & 0 deletions code/datums/gamemodes/campaign/campaign_mission.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@
if(!mech_faction)
return
var/total_count = (heavy_mech + medium_mech + light_mech)
if(!total_count)
return
for(var/obj/effect/landmark/campaign/vehicle_spawner/mech/mech_spawner AS in GLOB.campaign_mech_spawners[mech_faction])
if(!heavy_mech && !medium_mech && !light_mech)
break
Expand All @@ -548,6 +550,8 @@
/datum/campaign_mission/proc/spawn_tank(tank_faction, quantity, override_message)
if(!tank_faction)
return
if(!quantity)
return
var/remaining_count = quantity
for(var/obj/effect/landmark/campaign/vehicle_spawner/tank/tank_spawner AS in GLOB.campaign_tank_spawners[tank_faction])
if(!remaining_count)
Expand Down
31 changes: 28 additions & 3 deletions code/datums/gamemodes/campaign/missions/asat_capture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,37 @@

/datum/campaign_mission/capture_mission/asat/load_pre_mission_bonuses()
. = ..()
spawn_mech(hostile_faction, 0, 0, 5)
spawn_mech(starting_faction, 0, 1, 1)

var/datum/faction_stats/attacking_team = mode.stat_list[starting_faction]
attacking_team.add_asset(/datum/campaign_asset/asset_disabler/som_cas/instant)

var/tanks_to_spawn = 0
var/mechs_to_spawn = 0
var/current_pop = length(GLOB.clients)
switch(current_pop)
if(0 to 59)
tanks_to_spawn = 0
if(60 to 75)
tanks_to_spawn = 1
if(76 to 90)
tanks_to_spawn = 2
else
tanks_to_spawn = 3

switch(current_pop)
if(0 to 39)
mechs_to_spawn = 0
if(40 to 49)
mechs_to_spawn = 2
if(50 to 79)
mechs_to_spawn = 3
else
mechs_to_spawn = 4

spawn_tank(starting_faction, tanks_to_spawn)
spawn_tank(hostile_faction, tanks_to_spawn)
spawn_mech(hostile_faction, 0, 0, mechs_to_spawn)
spawn_mech(starting_faction, 0, 0, max(0, mechs_to_spawn - 1))

/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 [objectives_total - min_capture_amount + 1] ASAT systems." : ""]"
Expand Down
31 changes: 28 additions & 3 deletions code/datums/gamemodes/campaign/missions/base_rescue.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,38 @@

/datum/campaign_mission/destroy_mission/base_rescue/load_pre_mission_bonuses()
. = ..()
spawn_mech(attacking_faction, 0, 0, 4)
spawn_mech(defending_faction, 0, 0, 2)

var/datum/faction_stats/defending_team = mode.stat_list[defending_faction]
defending_team.add_asset(/datum/campaign_asset/asset_disabler/tgmc_cas/instant)
defending_team.add_asset(/datum/campaign_asset/asset_disabler/tgmc_mortar/instant)

var/tanks_to_spawn = 0
var/mechs_to_spawn = 0
var/current_pop = length(GLOB.clients)
switch(current_pop)
if(0 to 59)
tanks_to_spawn = 0
if(60 to 75)
tanks_to_spawn = 1
if(76 to 90)
tanks_to_spawn = 2
else
tanks_to_spawn = 3

switch(current_pop)
if(0 to 39)
mechs_to_spawn = 1
if(40 to 49)
mechs_to_spawn = 2
if(50 to 79)
mechs_to_spawn = 3
else
mechs_to_spawn = 4

spawn_tank(attacking_faction, tanks_to_spawn)
spawn_tank(defending_faction, tanks_to_spawn)
spawn_mech(attacking_faction, 0, 0, mechs_to_spawn)
spawn_mech(defending_faction, 0, 0, max(0, mechs_to_spawn - 1))

/datum/campaign_mission/destroy_mission/base_rescue/load_mission_brief()
starting_faction_mission_brief = "NanoTrasen has issues an emergency request for assistance at an isolated medical facility located in the Western Ayolan Ranges. \
SOM forces are rapidly approaching the facility, which is currently on emergency lockdown. \
Expand Down
30 changes: 28 additions & 2 deletions code/datums/gamemodes/campaign/missions/raiding_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,40 @@
items += "Beacons remaining: [beacons_remaining]"

/datum/campaign_mission/raiding_base/load_pre_mission_bonuses()
spawn_mech(starting_faction, 0, 0, 3)
spawn_mech(hostile_faction, 0, 2)
new /obj/item/storage/box/crate/loot/materials_pack(get_turf(pick(GLOB.campaign_reward_spawners[hostile_faction])))
for(var/i = 1 to beacons_remaining)
new /obj/item/explosive/plastique(get_turf(pick(GLOB.campaign_reward_spawners[hostile_faction])))
new /obj/item/explosive/plastique(get_turf(pick(GLOB.campaign_reward_spawners[hostile_faction])))
new beacon_type(get_turf(pick(GLOB.campaign_reward_spawners[starting_faction])))

var/tanks_to_spawn = 0
var/mechs_to_spawn = 0
var/current_pop = length(GLOB.clients)
switch(current_pop)
if(0 to 59)
tanks_to_spawn = 0
if(60 to 75)
tanks_to_spawn = 1
if(76 to 90)
tanks_to_spawn = 2
else
tanks_to_spawn = 3

switch(current_pop)
if(0 to 39)
mechs_to_spawn = 1
if(40 to 49)
mechs_to_spawn = 2
if(50 to 79)
mechs_to_spawn = 3
else
mechs_to_spawn = 4

spawn_tank(starting_faction, tanks_to_spawn)
spawn_tank(hostile_faction, tanks_to_spawn)
spawn_mech(hostile_faction, 0, 0, mechs_to_spawn)
spawn_mech(starting_faction, 0, 0, max(0, mechs_to_spawn - 1))

/datum/campaign_mission/raiding_base/start_mission()
. = ..()
RegisterSignal(SSdcs, COMSIG_GLOB_CAMPAIGN_OB_BEACON_ACTIVATION, PROC_REF(beacon_placed))
Expand Down

0 comments on commit 7d559ed

Please sign in to comment.