Skip to content

Commit

Permalink
Station Goals (tgstation#20009)
Browse files Browse the repository at this point in the history
* goals initial

* Revamps Meteor Shield
Minor UI touchups.
Fixes DNA Vault completion check.

* Allows admins to varedit goal completion.
Does not clear dna probe on upload.

* Missed icons and template.

* Spelling, proper attackby returns

* Meteor shield emag effect only works when it's active.

* Admin panel for station goals.

* Some visual feedback and spans.

* Announcement now shows the goal name.

* Fixes

* Fixes and adminlog

* Tgui build

* Moves the information to intercept report except for admin spawned ones.
AnturK authored and optimumtact committed Sep 7, 2016

Verified

This commit was signed with the committer’s verified signature. The key has expired.
1 parent 5dcf9c9 commit d225d48
Showing 23 changed files with 1,057 additions and 20 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
@@ -529,3 +529,5 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
// Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
#define MAX_NTNET_LOGS 300
#define MIN_NTNET_LOGS 10
//TODO Move to a pref
#define STATION_GOAL_BUDGET 1
4 changes: 2 additions & 2 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
@@ -23,5 +23,5 @@ var/global/list/apcs_list = list() //list of all Area Power Controller machi
var/global/list/tracked_implants = list() //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented...
var/global/list/poi_list = list() //list of points of interest for observe/follow
var/global/list/pinpointer_list = list() //list of all pinpointers. Used to change stuff they are pointing to all at once.
// A list of all zombie_infection organs, for any mass "animation"
var/global/list/zombie_infection_list = list()
var/global/list/zombie_infection_list = list() // A list of all zombie_infection organs, for any mass "animation"
var/global/list/meteor_list = list() // List of all meteors.
3 changes: 2 additions & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
@@ -55,7 +55,6 @@ var/datum/subsystem/ticker/ticker

var/maprotatechecked = 0


/datum/subsystem/ticker/New()
NEW_SS_GLOBAL(ticker)

@@ -443,6 +442,8 @@ var/datum/subsystem/ticker/ticker
for(var/i in total_antagonists)
log_game("[i]s[total_antagonists[i]].")

mode.declare_station_goal_completion()

//Adds the del() log to world.log in a format condensable by the runtime condenser found in tools
if(SSgarbage.didntgc.len)
var/dellog = ""
31 changes: 31 additions & 0 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
@@ -41,6 +41,8 @@
var/const/waittime_l = 600
var/const/waittime_h = 1800 // started at 1800

var/list/datum/station_goal/station_goals = list()


/datum/game_mode/proc/announce() //Shows the gamemode's name and a fast description.
world << "<b>The gamemode is: <span class='[announce_span]'>[name]</span>!</b>"
@@ -87,6 +89,7 @@
if(report)
spawn (rand(waittime_l, waittime_h))
send_intercept(0)
generate_station_goals()
start_state = new /datum/station_state()
start_state.count(1)
return 1
@@ -279,6 +282,12 @@
for(var/V in possible_modes)
intercepttext += i_text.build(V)

if(station_goals.len)
intercepttext += "<b>Special Orders for [station_name()]:</b>"
for(var/datum/station_goal/G in station_goals)
G.on_report()
intercepttext += G.get_report()

print_command_report(intercepttext, "Central Command Status Summary")
priority_announce("A summary has been copied and printed to all communications consoles.", "Enemy communication intercepted. Security level elevated.", 'sound/AI/intercept.ogg')
if(security_level < SEC_LEVEL_BLUE)
@@ -532,3 +541,25 @@
ticker.mode.remove_gangster(newborgie, 0, remove_bosses=1)
ticker.mode.remove_hog_follower(newborgie, 0)
remove_servant_of_ratvar(newborgie.current, TRUE)


/datum/game_mode/proc/generate_station_goals()
var/list/possible = list()
for(var/T in subtypesof(/datum/station_goal))
var/datum/station_goal/G = T
if(config_tag in initial(G.gamemode_blacklist))
continue
//if(num_players() < initial(G.required_crew))
// continue
possible += T
var/goal_weights = 0
while(possible.len && goal_weights < STATION_GOAL_BUDGET)
var/datum/station_goal/picked = pick_n_take(possible)
goal_weights += initial(picked.weight)
station_goals += new picked


/datum/game_mode/proc/declare_station_goal_completion()
for(var/V in station_goals)
var/datum/station_goal/G = V
G.print_result()
2 changes: 2 additions & 0 deletions code/game/gamemodes/meteor/meteors.dm
Original file line number Diff line number Diff line change
@@ -118,11 +118,13 @@
get_hit()

/obj/effect/meteor/Destroy()
meteor_list -= src
walk(src,0) //this cancels the walk_towards() proc
. = ..()

/obj/effect/meteor/New()
..()
meteor_list += src
if(SSaugury)
SSaugury.register_doom(src, threat)
SpinAnimation()
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
@@ -145,6 +145,7 @@ var/list/admin_verbs_debug = list(
/client/proc/cmd_display_del_log,
/client/proc/reset_latejoin_spawns,
/client/proc/create_outfits,
/client/proc/modify_goals,
/client/proc/debug_huds,
/client/proc/map_template_load,
/client/proc/map_template_upload,
17 changes: 17 additions & 0 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
@@ -2255,3 +2255,20 @@
SD.r_code = code
message_admins("[key_name_admin(usr)] has set the self-destruct \
code to \"[code]\".")

else if(href_list["add_station_goal"])
if(!check_rights(R_ADMIN))
return
var/list/type_choices = typesof(/datum/station_goal)
var/picked = input("Choose goal type") in type_choices|null
if(!picked)
return
var/datum/station_goal/G = new picked()
if(picked == /datum/station_goal)
var/newname = input("Enter goal name:") as text
G.name = newname
var/description = input("Enter centcom message contents:") as message
G.report_message = description
message_admins("[key_name(usr)] created \"[G.name]\" station goal.")
ticker.mode.station_goals += G
modify_goals()
16 changes: 16 additions & 0 deletions code/modules/admin/verbs/randomverbs.dm
Original file line number Diff line number Diff line change
@@ -1137,3 +1137,19 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits
H.regenerate_icons()

#undef ON_PURRBATION

/client/proc/modify_goals()
set category = "Debug"
set name = "Modify station goals"

if(!check_rights(R_ADMIN))
return

holder.modify_goals()

/datum/admins/proc/modify_goals()
var/dat = ""
for(var/datum/station_goal/S in ticker.mode.station_goals)
dat += "[S.name] - <a href='?src=\ref[S];announce=1'>Announce</a> | <a href='?src=\ref[S];remove=1'>Remove</a><br>"
dat += "<br><a href='?src=\ref[src];add_station_goal=1'>Add New Goal</a>"
usr << browse(dat, "window=goals;size=400x400")
2 changes: 1 addition & 1 deletion code/modules/cargo/console.dm
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@
"name" = P.group,
"packs" = list()
)
if((P.hidden && !emagged) || (P.contraband && !contraband))
if((P.hidden && !emagged) || (P.contraband && !contraband) || (P.special && !P.special_enabled))
continue
data["supplies"][P.group]["packs"] += list(list(
"name" = P.name,
59 changes: 58 additions & 1 deletion code/modules/cargo/packs.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/supply_pack
datum/supply_pack
var/name = "Crate"
var/group = ""
var/hidden = FALSE
@@ -9,6 +9,8 @@
var/crate_name = "crate"
var/crate_type = /obj/structure/closet/crate
var/dangerous = FALSE // Should we message admins?
var/special = FALSE //Event/Station Goals/Admin enabled packs
var/special_enabled = FALSE

/datum/supply_pack/proc/generate(turf/T)
var/obj/structure/closet/crate/C = new crate_type(T)
@@ -1532,3 +1534,58 @@
/obj/item/toy/crayon/rainbow,
/obj/item/toy/crayon/rainbow)
crate_name= "art supply crate"


/datum/supply_pack/misc/bsa
name = "Bluespace Artillery Parts"
cost = 15000
special = TRUE
contains = list(/obj/item/weapon/circuitboard/machine/bsa/front,
/obj/item/weapon/circuitboard/machine/bsa/middle,
/obj/item/weapon/circuitboard/machine/bsa/back,
/obj/item/weapon/circuitboard/machine/computer/bsa_control
)
crate_name= "bluespace artillery parts crate"

/datum/supply_pack/misc/dna_vault
name = "DNA Vault Parts"
cost = 12000
special = TRUE
contains = list(
/obj/item/weapon/circuitboard/machine/dna_vault
)
crate_name= "dna vault parts crate"

/datum/supply_pack/misc/dna_probes
name = "DNA Vault Samplers"
cost = 3000
special = TRUE
contains = list(/obj/item/device/dna_probe,
/obj/item/device/dna_probe,
/obj/item/device/dna_probe,
/obj/item/device/dna_probe,
/obj/item/device/dna_probe
)
crate_name= "dna samplers crate"


/datum/supply_pack/misc/shield_sat
name = "Shield Generator Satellite"
cost = 3000
special = TRUE
contains = list(
/obj/machinery/satellite/meteor_shield,
/obj/machinery/satellite/meteor_shield,
/obj/machinery/satellite/meteor_shield
)
crate_name= "shield sat crate"


/datum/supply_pack/misc/shield_sat_control
name = "Shield System Control Board"
cost = 5000
special = TRUE
contains = list(
/obj/item/weapon/circuitboard/machine/computer/sat_control
)
crate_name= "shield control board crate"
Loading

0 comments on commit d225d48

Please sign in to comment.