Skip to content

Commit

Permalink
Lets admins set system clear objectives and refactors extended missio…
Browse files Browse the repository at this point in the history
…n code (#2531)
  • Loading branch information
Bokkiewokkie authored Oct 17, 2023
1 parent 459d470 commit ae25330
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
20 changes: 15 additions & 5 deletions nsv13/code/controllers/subsystem/overmap_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ SUBSYSTEM_DEF(overmap_mode)
for(var/datum/overmap_objective/O in mode.objectives)
O.ignore_check = TRUE //We no longer care about checking these objective against completion

/* This doesn't work and I don't have the time to refactor all of it right now so on the TODO pile it goes!
var/list/extension_pool = subtypesof(/datum/overmap_objective)
var/players = get_active_player_count(TRUE, TRUE, FALSE) //Number of living, non-AFK players including non-humanoids
for(var/datum/overmap_objective/O in extension_pool)
Expand All @@ -322,6 +323,12 @@ SUBSYSTEM_DEF(overmap_mode)
else
message_admins("No additional objective candidates! Defaulting to tickets")
mode.objectives += new /datum/overmap_objective/tickets
*/

if(get_active_player_count(TRUE,TRUE,FALSE) > 4)
mode.objectives += new /datum/overmap_objective/clear_system/rubicon
else
mode.objectives += new /datum/overmap_objective/tickets

instance_objectives()

Expand Down Expand Up @@ -501,7 +508,7 @@ SUBSYSTEM_DEF(overmap_mode)
/datum/overmap_objective/custom
name = "Custom"

/datum/overmap_objective/custom/New(var/passed_input) //Receive the string and make it brief/desc
/datum/overmap_objective/custom/New(passed_input) //Receive the string and make it brief/desc
.=..()
desc = passed_input
brief = passed_input
Expand Down Expand Up @@ -560,7 +567,7 @@ SUBSYSTEM_DEF(overmap_mode)
message_admins("Post Initilisation Overmap Gamemode Changes Not Currently Supported") //SoonTM
return
var/list/gamemode_pool = subtypesof(/datum/overmap_gamemode)
var/datum/overmap_gamemode/S = input("Select Overmap Gamemode", "Change Overmap Gamemode") as null|anything in gamemode_pool
var/datum/overmap_gamemode/S = input(usr, "Select Overmap Gamemode", "Change Overmap Gamemode") as null|anything in gamemode_pool
if(isnull(S))
return
if(SSovermap_mode.mode_initialised)
Expand All @@ -572,11 +579,14 @@ SUBSYSTEM_DEF(overmap_mode)
message_admins("[key_name_admin(usr)] has changed the overmap gamemode to [initial(S.name)]")
return
if("add_objective")
var/list/objectives_pool = subtypesof(/datum/overmap_objective)
var/datum/overmap_objective/S = input("Select objective to add", "Add Objective") as null|anything in objectives_pool
var/list/objectives_pool = (subtypesof(/datum/overmap_objective) - /datum/overmap_objective/custom)
var/datum/overmap_objective/S = input(usr, "Select objective to add", "Add Objective") as null|anything in objectives_pool
if(isnull(S))
return
SSovermap_mode.mode.objectives += new S()
var/extra
if(ispath(S,/datum/overmap_objective/clear_system))
extra = input(usr, "Select a target system", "Select System") as null|anything in SSstar_system.systems
SSovermap_mode.mode.objectives += new S(extra)
SSovermap_mode.instance_objectives()
return
if("add_custom_objective")
Expand Down
13 changes: 13 additions & 0 deletions nsv13/code/game/gamemodes/overmap/objectives/rubicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
var/system_name
var/datum/star_system/target_system

/datum/overmap_objective/clear_system/New(datum/star_system/passed_input)
.=..()
if(passed_input)
system_name = passed_input.name
if(!system_name)
for(var/datum/star_system/S in SSstar_system.neutral_zone_systems)
if(S.hidden)
continue
if(length(S.enemies_in_system))
system_name = S.name
break
continue

/datum/overmap_objective/clear_system/instance()
.=..()
desc = "Defeat all enemies in the [system_name] system"
Expand Down

0 comments on commit ae25330

Please sign in to comment.