Files
CHOMPStation2/code/modules/gamemaster/controller.dm
Neerti 337ef499a1 Cleans Up WIP Event System + New Grid Check For It
Separates the 'count and assess everything' stuff to it's own datum, called the metric datum, which I plan to add on to in the future to make counting and metrics easier.
Makes decision process a bit more weight-based, will probably continue tweaking later.
Makes the admin debug UI have links to change settings easily.
Adds replacement for grid check event, which works similar to the old one, but is now based on a physical machine in the game world, that Engineering can hack to make the event end faster, if so desired.  Note that the machine is not mapped in, and won't be mapped in until the event system is ready for launch.
Adds grid_check variables to SMESes and APCs to make them stop doing work without draining the battery.
Grid checks in the new system are caused by a "power spike" which originates from the engine and will cause bad things, should no grid checker machine be connected to the power-net.  These power spikes occur when the GM decides that a grid check is a good event to have.
The grid checker can be built and deconstructed using the standard machine construction methods.
2016-10-05 21:40:07 -04:00

80 lines
2.8 KiB
Plaintext

/client/proc/show_gm_status()
set category = "Debug"
set name = "Show GM Status"
set desc = "Shows you what the GM is thinking. If only that existed in real life..."
game_master.interact(usr)
/datum/game_master/proc/interact(var/client/user)
if(!user)
return
var/HTML = "<html><head><title>Game Master AI</title></head><body>"
HTML += "<a href='?src=\ref[src];toggle_time_restrictions=1'>\[Toggle Time Restrictions\]</a> | \
<a href='?src=\ref[src];suspend=1'>\[Toggle GM\]</a> | \
<a href='?src=\ref[src];force_choose_event=1'>\[Force Event Decision\]</a><br>"
HTML += "Status: [pre_action_checks() ? "Ready" : "Suppressed"]<br><br>"
HTML += "Staleness: [staleness] <a href='?src=\ref[src];adjust_staleness=1'>\[Adjust\]</a><br>"
HTML += "Danger: [danger] <a href='?src=\ref[src];adjust_danger=1'>\[Adjust\]</a><br><br>"
HTML += "Actions available;<br>"
for(var/datum/gm_action/action in available_actions)
if(action.enabled == FALSE)
continue
HTML += "[action.name] ([english_list(action.departments)]) (weight: [action.get_weight()])<br>"
HTML += "<br>"
HTML += "All living mobs activity: [metric.assess_all_living_mobs()]%<br>"
HTML += "All ghost activity: [metric.assess_all_dead_mobs()]%<br>"
HTML += "<br>"
HTML += "Departmental activity;<br>"
for(var/department in metric.departments)
HTML += " [department] : [metric.assess_department(department)]%<br>"
HTML += "<br>"
HTML += "Activity of players;<br>"
for(var/mob/player in player_list)
HTML += " [player] ([player.key]) : [metric.assess_player_activity(player)]%<br>"
HTML +="</body></html>"
user << browse(HTML, "window=log;size=400x450;border=1;can_resize=1;can_close=1;can_minimize=1")
/datum/game_master/Topic(href, href_list)
if(..())
return
if(!is_admin(usr))
message_admins("[usr] has attempted to modify the Game Master values without being an admin.")
return
if(href_list["toggle_time_restrictions"])
ignore_time_restrictions = !ignore_time_restrictions
message_admins("GM event time restrictions was [ignore_time_restrictions ? "dis" : "en"]abled by [usr.key].")
if(href_list["force_choose_event"])
start_action()
message_admins("[usr.key] forced the Game Master to choose an event immediately.")
if(href_list["suspend"])
suspended = !suspended
message_admins("GM was [suspended ? "dis" : "en"]abled by [usr.key].")
if(href_list["adjust_staleness"])
var/amount = input(usr, "How much staleness should be added or subtracted?", "Game Master") as null|num
if(amount)
adjust_staleness(amount)
message_admins("GM staleness was adjusted by [amount] by [usr.key].")
if(href_list["adjust_danger"])
var/amount = input(usr, "How much danger should be added or subtracted?", "Game Master") as null|num
if(amount)
adjust_danger(amount)
message_admins("GM danger was adjusted by [amount] by [usr.key].")
interact(usr) // To refresh the UI.