Merge branch 'master' into overhaul-event-mob-selection

This commit is contained in:
mochi
2020-07-20 07:01:11 +02:00
204 changed files with 38138 additions and 282212 deletions
+13 -13
View File
@@ -212,38 +212,38 @@ SUBSYSTEM_DEF(events)
if(href_list["toggle_report"])
report_at_round_end = !report_at_round_end
admin_log_and_message_admins("has [report_at_round_end ? "enabled" : "disabled"] the round end event report.")
log_and_message_admins("has [report_at_round_end ? "enabled" : "disabled"] the round end event report.")
else if(href_list["dec_timer"])
var/datum/event_container/EC = locate(href_list["event"])
var/decrease = (60 * RaiseToPower(10, text2num(href_list["dec_timer"])))
EC.next_event_time -= decrease
admin_log_and_message_admins("decreased timer for [GLOB.severity_to_string[EC.severity]] events by [decrease/600] minute(s).")
log_and_message_admins("decreased timer for [GLOB.severity_to_string[EC.severity]] events by [decrease/600] minute(s).")
else if(href_list["inc_timer"])
var/datum/event_container/EC = locate(href_list["event"])
var/increase = (60 * RaiseToPower(10, text2num(href_list["inc_timer"])))
EC.next_event_time += increase
admin_log_and_message_admins("increased timer for [GLOB.severity_to_string[EC.severity]] events by [increase/600] minute(s).")
log_and_message_admins("increased timer for [GLOB.severity_to_string[EC.severity]] events by [increase/600] minute(s).")
else if(href_list["select_event"])
var/datum/event_container/EC = locate(href_list["select_event"])
var/datum/event_meta/EM = EC.SelectEvent()
if(EM)
admin_log_and_message_admins("has queued the [GLOB.severity_to_string[EC.severity]] event '[EM.name]'.")
log_and_message_admins("has queued the [GLOB.severity_to_string[EC.severity]] event '[EM.name]'.")
else if(href_list["pause"])
var/datum/event_container/EC = locate(href_list["pause"])
EC.delayed = !EC.delayed
admin_log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [GLOB.severity_to_string[EC.severity]] events.")
log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [GLOB.severity_to_string[EC.severity]] events.")
else if(href_list["interval"])
var/delay = input("Enter delay modifier. A value less than one means events fire more often, higher than one less often.", "Set Interval Modifier") as num|null
if(delay && delay > 0)
var/datum/event_container/EC = locate(href_list["interval"])
EC.delay_modifier = delay
admin_log_and_message_admins("has set the interval modifier for [GLOB.severity_to_string[EC.severity]] events to [EC.delay_modifier].")
log_and_message_admins("has set the interval modifier for [GLOB.severity_to_string[EC.severity]] events to [EC.delay_modifier].")
else if(href_list["stop"])
if(alert("Stopping an event may have unintended side-effects. Continue?","Stopping Event!","Yes","No") != "Yes")
return
var/datum/event/E = locate(href_list["stop"])
var/datum/event_meta/EM = E.event_meta
admin_log_and_message_admins("has stopped the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
log_and_message_admins("has stopped the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
E.kill()
else if(href_list["view_events"])
selected_event_container = locate(href_list["view_events"])
@@ -265,23 +265,23 @@ SUBSYSTEM_DEF(events)
var/datum/event_meta/EM = locate(href_list["set_weight"])
EM.weight = weight
if(EM != new_event)
admin_log_and_message_admins("has changed the weight of the [GLOB.severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].")
log_and_message_admins("has changed the weight of the [GLOB.severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].")
else if(href_list["toggle_oneshot"])
var/datum/event_meta/EM = locate(href_list["toggle_oneshot"])
EM.one_shot = !EM.one_shot
if(EM != new_event)
admin_log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
else if(href_list["toggle_enabled"])
var/datum/event_meta/EM = locate(href_list["toggle_enabled"])
EM.enabled = !EM.enabled
admin_log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
else if(href_list["remove"])
if(alert("This will remove the event from rotation. Continue?","Removing Event!","Yes","No") != "Yes")
return
var/datum/event_meta/EM = locate(href_list["remove"])
var/datum/event_container/EC = locate(href_list["EC"])
EC.available_events -= EM
admin_log_and_message_admins("has removed the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
log_and_message_admins("has removed the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.")
else if(href_list["add"])
if(!new_event.name || !new_event.event_type)
return
@@ -289,12 +289,12 @@ SUBSYSTEM_DEF(events)
return
new_event.severity = selected_event_container.severity
selected_event_container.available_events += new_event
admin_log_and_message_admins("has added \a [GLOB.severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].")
log_and_message_admins("has added \a [GLOB.severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].")
new_event = new
else if(href_list["clear"])
var/datum/event_container/EC = locate(href_list["clear"])
if(EC.next_event)
admin_log_and_message_admins("has dequeued the [GLOB.severity_to_string[EC.severity]] event '[EC.next_event.name]'.")
log_and_message_admins("has dequeued the [GLOB.severity_to_string[EC.severity]] event '[EC.next_event.name]'.")
EC.next_event = null
Interact(usr)
+12 -2
View File
@@ -19,8 +19,18 @@ SUBSYSTEM_DEF(icon_smooth)
can_fire = 0
/datum/controller/subsystem/icon_smooth/Initialize()
smooth_zlevel(1,TRUE)
smooth_zlevel(2,TRUE)
log_startup_progress("Smoothing atoms...")
// Smooth EVERYTHING in the world
for(var/turf/T in world)
if(T.smooth)
smooth_icon(T)
for(var/A in T)
var/atom/AA = A
if(AA.smooth)
smooth_icon(AA)
CHECK_TICK
// Incase any new atoms were added to the smoothing queue for whatever reason
var/queue = smooth_queue
smooth_queue = list()
for(var/V in queue)
+1 -1
View File
@@ -42,7 +42,7 @@ SUBSYSTEM_DEF(machines)
while(currentrun.len)
var/obj/O = currentrun[currentrun.len]
currentrun.len--
if(O)
if(O && !QDELETED(O))
var/datum/powernet/newPN = new() // create a new powernet...
propagate_network(O, newPN)//... and propagate it to the other side of the cable
+41 -8
View File
@@ -11,24 +11,57 @@ SUBSYSTEM_DEF(mapping)
createRandomZlevel()
// Seed space ruins
if(!config.disable_space_ruins)
var/timer = start_watch()
log_startup_progress("Creating random space levels...")
seedRuins(list(level_name_to_num(EMPTY_AREA)), rand(0, 3), /area/space, GLOB.space_ruins_templates)
log_startup_progress("Loaded random space levels in [stop_watch(timer)]s.")
// load in extra levels of space ruins
var/load_zlevels_timer = start_watch()
log_startup_progress("Creating random space levels...")
var/num_extra_space = rand(config.extra_space_ruin_levels_min, config.extra_space_ruin_levels_max)
for(var/i = 1, i <= num_extra_space, i++)
var/zlev = GLOB.space_manager.add_new_zlevel("[EMPTY_AREA] #[i]", linkage = CROSSLINKED, traits = list(REACHABLE))
seedRuins(list(zlev), rand(0, 3), /area/space, GLOB.space_ruins_templates)
GLOB.space_manager.add_new_zlevel("Ruin Area #[i]", linkage = CROSSLINKED, traits = list(REACHABLE, SPAWN_RUINS))
log_startup_progress("Loaded random space levels in [stop_watch(load_zlevels_timer)]s.")
// Now spawn ruins, random budget between 20 and 30 for all zlevels combined.
// While this may seem like a high number, the amount of ruin Z levels can be anywhere between 3 and 7.
// Note that this budget is not split evenly accross all zlevels
log_startup_progress("Seeding ruins...")
var/seed_ruins_timer = start_watch()
seedRuins(levels_by_trait(SPAWN_RUINS), rand(20, 30), /area/space, GLOB.space_ruins_templates)
log_startup_progress("Successfully seeded ruins in [stop_watch(seed_ruins_timer)]s.")
// Makes a blank space level for the sake of randomness
GLOB.space_manager.add_new_zlevel("Empty Area", linkage = CROSSLINKED, traits = list(REACHABLE))
// Setup the Z-level linkage
GLOB.space_manager.do_transition_setup()
// Spawn Lavaland ruins and rivers.
log_startup_progress("Populating lavaland...")
var/lavaland_setup_timer = start_watch()
seedRuins(list(level_name_to_num(MINING)), config.lavaland_budget, /area/lavaland/surface/outdoors/unexplored, GLOB.lava_ruins_templates)
spawn_rivers(list(level_name_to_num(MINING)))
log_startup_progress("Successfully populated lavaland in [stop_watch(lavaland_setup_timer)]s.")
// Now we make a list of areas for teleport locs
// TOOD: Make these locs into lists on the SS itself, not globs
for(var/area/AR in world)
if(AR.no_teleportlocs)
continue
if(GLOB.teleportlocs[AR.name])
continue
var/turf/picked = safepick(get_area_turfs(AR.type))
if(picked && is_station_level(picked.z))
GLOB.teleportlocs[AR.name] = AR
GLOB.teleportlocs = sortAssoc(GLOB.teleportlocs)
for(var/area/AR in world)
if(GLOB.ghostteleportlocs[AR.name])
continue
var/list/turfs = get_area_turfs(AR.type)
if(turfs.len)
GLOB.ghostteleportlocs[AR.name] = AR
GLOB.ghostteleportlocs = sortAssoc(GLOB.ghostteleportlocs)
return ..()
+21 -2
View File
@@ -180,7 +180,14 @@ SUBSYSTEM_DEF(ticker)
current_state = GAME_STATE_PLAYING
Master.SetRunLevel(RUNLEVEL_GAME)
callHook("roundstart")
// Generate the list of playable AI cores in the world
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
if(S.name != "AI")
continue
if(locate(/mob/living) in S.loc)
continue
GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S))
//here to initialize the random events nicely at round start
setup_economy()
@@ -279,10 +286,22 @@ SUBSYSTEM_DEF(ticker)
for(var/mob/new_player/N in GLOB.mob_list)
if(N.client)
N.new_player_panel_proc()
// Now that every other piece of the round has initialized, lets setup player job scaling
var/playercount = length(GLOB.clients)
var/highpop_trigger = 80
if(playercount >= highpop_trigger)
log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - loading highpop job config")
SSjobs.LoadJobs("config/jobs_highpop.txt")
else
log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - keeping standard job config")
#ifdef UNIT_TESTS
RunUnitTests()
#endif
return 1
return TRUE
/datum/controller/subsystem/ticker/proc/station_explosion_cinematic(station_missed = 0, override = null)
if(cinematic)
@@ -1,8 +1,8 @@
GLOBAL_REAL(SSmentor_tickets, /datum/controller/subsystem/tickets/mentor_tickets)
/datum/controller/subsystem/tickets/mentor_tickets/New()
NEW_SS_GLOBAL(SSmentor_tickets);
PreInit();
NEW_SS_GLOBAL(SSmentor_tickets)
PreInit()
/datum/controller/subsystem/tickets/mentor_tickets
name = "Mentor Tickets"
@@ -15,7 +15,7 @@ GLOBAL_REAL(SSmentor_tickets, /datum/controller/subsystem/tickets/mentor_tickets
message_mentorTicket(msg)
/datum/controller/subsystem/tickets/mentor_tickets/Initialize()
close_messages = list("<font color='red' size='3'><b>- [ticket_name] Closed -</b></font>",
"<span class='boldmessage'>Please try to be as descriptive as possible in mentor helps. Mentors do not know the full situation you're in and need more information to give you a helpful response.</span>",
close_messages = list("<font color='red' size='3'><b>- [ticket_name] Closed -</b></font>",
"<span class='boldmessage'>Please try to be as descriptive as possible in mentor helps. Mentors do not know the full situation you're in and need more information to give you a helpful response.</span>",
"<span class='[span_class]'>Your [ticket_name] has now been closed.</span>")
return ..()
+10 -10
View File
@@ -20,16 +20,16 @@ SUBSYSTEM_DEF(tickets)
init_order = INIT_ORDER_TICKETS
wait = 300
priority = FIRE_PRIORITY_TICKETS
flags = SS_BACKGROUND
var/list/allTickets = list() //make it here because someone might ahelp before the system has initialized
var/ticketCounter = 1
/datum/controller/subsystem/tickets/Initialize()
close_messages = list("<font color='red' size='4'><b>- [ticket_name] Rejected! -</b></font>",
"<span class='boldmessage'>Please try to be calm, clear, and descriptive in admin helps, do not assume the staff member has seen any related events, and clearly state the names of anybody you are reporting. If you asked a question, please ensure it was clear what you were asking.</span>",
"<span class='boldmessage'>Please try to be calm, clear, and descriptive in admin helps, do not assume the staff member has seen any related events, and clearly state the names of anybody you are reporting. If you asked a question, please ensure it was clear what you were asking.</span>",
"<span class='[span_class]'>Your [ticket_name] has now been closed.</span>")
return ..()
@@ -112,7 +112,7 @@ SUBSYSTEM_DEF(tickets)
message_staff("<span class='[span_class]'>[usr.client] / ([usr]) resolved [ticket_name] number [N]</span>")
to_chat_safe(returnClient(N), "<span class='[span_class]'>Your [ticket_name] has now been resolved.</span>")
return TRUE
/datum/controller/subsystem/tickets/proc/autoRespond(N)
if(!check_rights(R_ADMIN|R_MOD))
@@ -124,19 +124,19 @@ SUBSYSTEM_DEF(tickets)
if(alert(usr, "[T.ticketState == TICKET_OPEN ? "Another admin appears to already be handling this." : "This ticket is already marked as closed or resolved"] Are you sure you want to continue?", "Confirmation", "Yes", "No") != "Yes")
return
T.assignStaff(C)
var/response_phrases = list("Thanks" = "Thanks, have a Paradise day!",
var/response_phrases = list("Thanks" = "Thanks, have a Paradise day!",
"Handling It" = "The issue is being looked into, thanks.",
"Already Resolved" = "The problem has been resolved already.",
"Mentorhelp" = "Please redirect your question to Mentorhelp, as they are better experienced with these types of questions.",
"Happens Again" = "Thanks, let us know if it continues to happen.",
"Clear Cache" = "To fix a blank screen, please leave the game and clear your Byond Cache. To clear your Byond Cache, there is a Settings icon in the top right of the launcher. After you click that, go into the Games tab and hit the Clear Cache button. If the issue persists a few minutes after rejoining and doing this, please adminhelp again and state you cleared your cache." ,
"Clear Cache" = "To fix a blank screen, go to the 'Special Verbs' tab and press 'Reload UI Resources'. If that fails, clear your BYOND cache (instructions provided with 'Reload UI Resources'). If that still fails, please adminhelp again, stating you have already done the following." ,
"IC Issue" = "This is an In Character (IC) issue and will not be handled by admins. You could speak to Security, Internal Affairs, a Departmental Head, Nanotrasen Representetive, or any other relevant authority currently on station.",
"Reject" = "Reject",
"Man Up" = "Man Up",
"Appeal on the Forums" = "Appealing a ban must occur on the forums. Privately messaging, or adminhelping about your ban will not resolve it. To appeal your ban, please head to <a href='[config.banappeals]'>[config.banappeals]</a>"
)
var/sorted_responses = list()
for(var/key in response_phrases) //build a new list based on the short descriptive keys of the master list so we can send this as the input instead of the full paragraphs to the admin choosing which autoresponse
sorted_responses += key
@@ -351,7 +351,7 @@ UI STUFF
dat += "<tr><td>[T.content[i]]</td></tr>"
dat += "</table><br /><br />"
dat += "<a href='?src=[UID()];detailreopen=[T.ticketNum]'>Re-Open</a>[check_rights(R_ADMIN|R_MOD, 0) ? "<a href='?src=[UID()];autorespond=[T.ticketNum]'>Auto</a>": ""]<a href='?src=[UID()];detailresolve=[T.ticketNum]'>Resolve</a><br /><br />"
dat += "<a href='?src=[UID()];detailreopen=[T.ticketNum]'>Re-Open</a>[check_rights(R_ADMIN|R_MOD, 0) ? "<a href='?src=[UID()];autorespond=[T.ticketNum]'>Auto</a>": ""]<a href='?src=[UID()];detailresolve=[T.ticketNum]'>Resolve</a><br /><br />"
if(!T.staffAssigned)
dat += "No staff member assigned to this [ticket_name] - <a href='?src=[UID()];assignstaff=[T.ticketNum]'>Take Ticket</a><br />"
@@ -447,7 +447,7 @@ UI STUFF
return
if(closeTicket(indexNum))
showDetailUI(usr, indexNum)
if(href_list["detailreopen"])
var/indexNum = text2num(href_list["detailreopen"])
+38
View File
@@ -0,0 +1,38 @@
SUBSYSTEM_DEF(title)
name = "Title Screen"
flags = SS_NO_FIRE
init_order = INIT_ORDER_TITLE
/datum/controller/subsystem/title/Initialize()
var/list/provisional_title_screens = flist("config/title_screens/images/")
var/list/title_screens = list()
var/use_rare_screens = prob(1)
for(var/S in provisional_title_screens)
var/list/L = splittext(S,"+")
if(L.len == 1 && L[1] != "blank.png")
title_screens += S
else if(L.len > 1)
if(use_rare_screens && lowertext(L[1]) == "rare")
title_screens += S
else if(GLOB.using_map && (lowertext(L[1]) == lowertext(GLOB.using_map.name)))
title_screens += S
if(!isemptylist(title_screens))
if(length(title_screens) > 1)
for(var/S in title_screens)
var/list/L = splittext(S,".")
if(L.len != 2 || L[1] != "default")
continue
title_screens -= S
break
var/file_path = "config/title_screens/images/[pick(title_screens)]"
var/icon/icon = new(fcopy_rsc(file_path))
for(var/turf/unsimulated/wall/splashscreen/splash in world)
splash.icon = icon
return ..()
+1 -1
View File
@@ -367,7 +367,7 @@ SUBSYSTEM_DEF(vote)
var/votedesc = capitalize(mode)
if(mode == "custom")
votedesc += " ([question])"
admin_log_and_message_admins("cancelled the running [votedesc] vote.")
log_and_message_admins("cancelled the running [votedesc] vote.")
reset()
if("toggle_restart")
if(admin)