mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Merge branch 'master' into ss-alarms
This commit is contained in:
@@ -224,6 +224,8 @@ var/list/admin_verbs_snpc = list(
|
||||
var/list/admin_verbs_ticket = list(
|
||||
/client/proc/openAdminTicketUI,
|
||||
/client/proc/toggleticketlogs,
|
||||
/client/proc/openMentorTicketUI,
|
||||
/client/proc/toggleMentorTicketLogs,
|
||||
/client/proc/resolveAllAdminTickets,
|
||||
/client/proc/resolveAllMentorTickets
|
||||
)
|
||||
@@ -926,10 +928,10 @@ var/list/admin_verbs_ticket = list(
|
||||
to_chat(usr, "You now will get admin log messages.")
|
||||
|
||||
/client/proc/toggleMentorTicketLogs()
|
||||
set name = "Toggle Mentor Ticket Messgaes"
|
||||
set name = "Toggle Mentor Ticket Messages"
|
||||
set category = "Preferences"
|
||||
|
||||
if(!check_rights(R_MENTOR))
|
||||
if(!check_rights(R_MENTOR|R_ADMIN))
|
||||
return
|
||||
|
||||
prefs.toggles ^= CHAT_NO_MENTORTICKETLOGS
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
set name = "Open Mentor Ticket Interface"
|
||||
set category = "Admin"
|
||||
|
||||
if(!holder || !check_rights(R_MENTOR))
|
||||
if(!holder || !check_rights(R_MENTOR|R_ADMIN))
|
||||
return
|
||||
|
||||
SSmentor_tickets.showUI(usr)
|
||||
|
||||
@@ -137,12 +137,12 @@
|
||||
end()
|
||||
|
||||
endedAt = world.time
|
||||
event_manager.active_events -= src
|
||||
event_manager.event_complete(src)
|
||||
SSevents.active_events -= src
|
||||
SSevents.event_complete(src)
|
||||
|
||||
/datum/event/New(var/datum/event_meta/EM)
|
||||
// event needs to be responsible for this, as stuff like APLUs currently make their own events for curious reasons
|
||||
event_manager.active_events += src
|
||||
SSevents.active_events += src
|
||||
|
||||
if(!EM)
|
||||
EM = new /datum/event_meta(EVENT_LEVEL_MAJOR, "Unknown, Most likely admin called", src.type)
|
||||
|
||||
@@ -1,412 +0,0 @@
|
||||
/datum/event_manager
|
||||
var/window_x = 700
|
||||
var/window_y = 600
|
||||
var/report_at_round_end = 0
|
||||
var/table_options = " align='center'"
|
||||
var/head_options = " style='font-weight:bold;'"
|
||||
var/row_options1 = " width='85px'"
|
||||
var/row_options2 = " width='260px'"
|
||||
var/row_options3 = " width='150px'"
|
||||
var/datum/event_container/selected_event_container = null
|
||||
|
||||
var/list/datum/event/active_events = list()
|
||||
var/list/datum/event/finished_events = list()
|
||||
|
||||
var/list/datum/event/allEvents
|
||||
var/list/datum/event_container/event_containers = list(
|
||||
EVENT_LEVEL_MUNDANE = new/datum/event_container/mundane,
|
||||
EVENT_LEVEL_MODERATE = new/datum/event_container/moderate,
|
||||
EVENT_LEVEL_MAJOR = new/datum/event_container/major
|
||||
)
|
||||
|
||||
var/datum/event_meta/new_event = new
|
||||
|
||||
/datum/event_manager/New()
|
||||
allEvents = subtypesof(/datum/event)
|
||||
|
||||
/datum/event_manager/proc/process()
|
||||
for(var/datum/event/E in event_manager.active_events)
|
||||
E.process()
|
||||
|
||||
for(var/i = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
|
||||
var/list/datum/event_container/EC = event_containers[i]
|
||||
EC.process()
|
||||
|
||||
/datum/event_manager/proc/event_complete(var/datum/event/E)
|
||||
if(!E.event_meta) // datum/event is used here and there for random reasons, maintaining "backwards compatibility"
|
||||
log_debug("Event of '[E.type]' with missing meta-data has completed.")
|
||||
return
|
||||
|
||||
finished_events += E
|
||||
|
||||
var/theseverity
|
||||
|
||||
if(!E.severity)
|
||||
theseverity = EVENT_LEVEL_MODERATE
|
||||
|
||||
if(!E.severity == EVENT_LEVEL_MUNDANE && !E.severity == EVENT_LEVEL_MODERATE && !E.severity == EVENT_LEVEL_MAJOR)
|
||||
theseverity = EVENT_LEVEL_MODERATE //just to be careful
|
||||
|
||||
if(E.severity)
|
||||
theseverity = E.severity
|
||||
|
||||
// Add the event back to the list of available events
|
||||
var/datum/event_container/EC = event_containers[theseverity]
|
||||
var/datum/event_meta/EM = E.event_meta
|
||||
EC.available_events += EM
|
||||
|
||||
log_debug("Event '[EM.name]' has completed at [station_time_timestamp()].")
|
||||
|
||||
/datum/event_manager/proc/delay_events(var/severity, var/delay)
|
||||
var/list/datum/event_container/EC = event_containers[severity]
|
||||
EC.next_event_time += delay
|
||||
|
||||
/datum/event_manager/proc/Interact(var/mob/living/user)
|
||||
|
||||
var/html = GetInteractWindow()
|
||||
|
||||
var/datum/browser/popup = new(user, "event_manager", "Event Manager", window_x, window_y)
|
||||
popup.set_content(html)
|
||||
popup.open()
|
||||
|
||||
/datum/event_manager/proc/RoundEnd()
|
||||
if(!report_at_round_end)
|
||||
return
|
||||
|
||||
to_chat(world, "<br><br><br><font size=3><b>Random Events This Round:</b></font>")
|
||||
for(var/datum/event/E in active_events|finished_events)
|
||||
var/datum/event_meta/EM = E.event_meta
|
||||
if(EM.name == "Nothing")
|
||||
continue
|
||||
var/message = "'[EM.name]' began at [station_time_timestamp("hh:mm:ss", E.startedAt)] "
|
||||
if(E.isRunning)
|
||||
message += "and is still running."
|
||||
else
|
||||
if(E.endedAt - E.startedAt > MinutesToTicks(5)) // Only mention end time if the entire duration was more than 5 minutes
|
||||
message += "and ended at [station_time_timestamp("hh:mm:ss", E.endedAt)]."
|
||||
else
|
||||
message += "and ran to completion."
|
||||
|
||||
to_chat(world, message)
|
||||
|
||||
/datum/event_manager/proc/GetInteractWindow()
|
||||
var/html = "<A align='right' href='?src=[UID()];refresh=1'>Refresh</A>"
|
||||
|
||||
if(selected_event_container)
|
||||
var/event_time = max(0, selected_event_container.next_event_time - world.time)
|
||||
html += "<A align='right' href='?src=[UID()];back=1'>Back</A><br>"
|
||||
html += "Time till start: [round(event_time / 600, 0.1)]<br>"
|
||||
html += "<div class='block'>"
|
||||
html += "<h2>Available [severity_to_string[selected_event_container.severity]] Events (queued & running events will not be displayed)</h2>"
|
||||
html += "<table[table_options]>"
|
||||
html += "<tr[head_options]><td[row_options2]>Name </td><td>Weight </td><td>MinWeight </td><td>MaxWeight </td><td>OneShot </td><td>Enabled </td><td><span class='alert'>CurrWeight </span></td><td>Remove</td></tr>"
|
||||
for(var/datum/event_meta/EM in selected_event_container.available_events)
|
||||
html += "<tr>"
|
||||
html += "<td>[EM.name]</td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];set_weight=\ref[EM]'>[EM.weight]</A></td>"
|
||||
html += "<td>[EM.min_weight]</td>"
|
||||
html += "<td>[EM.max_weight]</td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];toggle_oneshot=\ref[EM]'>[EM.one_shot]</A></td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];toggle_enabled=\ref[EM]'>[EM.enabled]</A></td>"
|
||||
html += "<td><span class='alert'>[EM.get_weight(number_active_with_role())]</span></td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];remove=\ref[EM];EC=\ref[selected_event_container]'>Remove</A></td>"
|
||||
html += "</tr>"
|
||||
html += "</table>"
|
||||
html += "</div>"
|
||||
|
||||
html += "<div class='block'>"
|
||||
html += "<h2>Add Event</h2>"
|
||||
html += "<table[table_options]>"
|
||||
html += "<tr [head_options]><td[row_options2]>Name</td><td[row_options2]>Type</td><td[row_options1]>Weight</td><td[row_options1]>OneShot</td></tr>"
|
||||
html += "<tr>"
|
||||
html += "<td><A align='right' href='?src=[UID()];set_name=\ref[new_event]'>[new_event.name ? new_event.name : "Enter Event"]</A></td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];set_type=\ref[new_event]'>[new_event.event_type ? new_event.event_type : "Select Type"]</A></td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];set_weight=\ref[new_event]'>[new_event.weight ? new_event.weight : 0]</A></td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];toggle_oneshot=\ref[new_event]'>[new_event.one_shot]</A></td>"
|
||||
html += "</tr>"
|
||||
html += "</table>"
|
||||
html += "<A align='right' href='?src=[UID()];add=\ref[selected_event_container]'>Add</A><br>"
|
||||
html += "</div>"
|
||||
else
|
||||
html += "<A align='right' href='?src=[UID()];toggle_report=1'>Round End Report: [report_at_round_end ? "On": "Off"]</A><br>"
|
||||
html += "<div class='block'>"
|
||||
html += "<h2>Event Start</h2>"
|
||||
|
||||
html += "<table[table_options]>"
|
||||
html += "<tr[head_options]><td[row_options1]>Severity</td><td[row_options1]>Starts At</td><td[row_options1]>Starts In</td><td[row_options3]>Adjust Start</td><td[row_options1]>Pause</td><td[row_options1]>Interval Mod</td></tr>"
|
||||
for(var/severity = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
|
||||
var/datum/event_container/EC = event_containers[severity]
|
||||
var/next_event_at = max(0, EC.next_event_time - world.time)
|
||||
html += "<tr>"
|
||||
html += "<td>[severity_to_string[severity]]</td>"
|
||||
html += "<td>[station_time_timestamp("hh:mm:ss", max(EC.next_event_time, world.time))]</td>"
|
||||
html += "<td>[round(next_event_at / 600, 0.1)]</td>"
|
||||
html += "<td>"
|
||||
html += "<A align='right' href='?src=[UID()];dec_timer=2;event=\ref[EC]'>--</A>"
|
||||
html += "<A align='right' href='?src=[UID()];dec_timer=1;event=\ref[EC]'>-</A>"
|
||||
html += "<A align='right' href='?src=[UID()];inc_timer=1;event=\ref[EC]'>+</A>"
|
||||
html += "<A align='right' href='?src=[UID()];inc_timer=2;event=\ref[EC]'>++</A>"
|
||||
html += "</td>"
|
||||
html += "<td>"
|
||||
html += "<A align='right' href='?src=[UID()];pause=\ref[EC]'>[EC.delayed ? "Resume" : "Pause"]</A>"
|
||||
html += "</td>"
|
||||
html += "<td>"
|
||||
html += "<A align='right' href='?src=[UID()];interval=\ref[EC]'>[EC.delay_modifier]</A>"
|
||||
html += "</td>"
|
||||
html += "</tr>"
|
||||
html += "</table>"
|
||||
html += "</div>"
|
||||
|
||||
html += "<div class='block'>"
|
||||
html += "<h2>Next Event</h2>"
|
||||
html += "<table[table_options]>"
|
||||
html += "<tr[head_options]><td[row_options1]>Severity</td><td[row_options2]>Name</td><td[row_options3]>Event Rotation</td><td>Clear</td></tr>"
|
||||
for(var/severity = EVENT_LEVEL_MUNDANE to EVENT_LEVEL_MAJOR)
|
||||
var/datum/event_container/EC = event_containers[severity]
|
||||
var/datum/event_meta/EM = EC.next_event
|
||||
html += "<tr>"
|
||||
html += "<td>[severity_to_string[severity]]</td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];select_event=\ref[EC]'>[EM ? EM.name : "Random"]</A></td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];view_events=\ref[EC]'>View</A></td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];clear=\ref[EC]'>Clear</A></td>"
|
||||
html += "</tr>"
|
||||
html += "</table>"
|
||||
html += "</div>"
|
||||
|
||||
html += "<div class='block'>"
|
||||
html += "<h2>Running Events</h2>"
|
||||
html += "Estimated times, affected by master controller delays."
|
||||
html += "<table[table_options]>"
|
||||
html += "<tr[head_options]><td[row_options1]>Severity</td><td[row_options2]>Name</td><td[row_options1]>Ends At</td><td[row_options1]>Ends In</td><td[row_options3]>Stop</td></tr>"
|
||||
for(var/datum/event/E in active_events)
|
||||
if(!E.event_meta)
|
||||
continue
|
||||
var/datum/event_meta/EM = E.event_meta
|
||||
var/ends_at = E.startedAt + (E.lastProcessAt() * 20) // A best estimate, based on how often the manager processes
|
||||
var/ends_in = max(0, round((ends_at - world.time) / 600, 0.1))
|
||||
var/no_end = E.noAutoEnd
|
||||
html += "<tr>"
|
||||
html += "<td>[severity_to_string[EM.severity]]</td>"
|
||||
html += "<td>[EM.name]</td>"
|
||||
html += "<td>[no_end ? "N/A" : station_time_timestamp("hh:mm:ss", ends_at)]</td>"
|
||||
html += "<td>[no_end ? "N/A" : ends_in]</td>"
|
||||
html += "<td><A align='right' href='?src=[UID()];stop=\ref[E]'>Stop</A></td>"
|
||||
html += "</tr>"
|
||||
html += "</table>"
|
||||
html += "</div>"
|
||||
|
||||
return html
|
||||
|
||||
/datum/event_manager/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
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.")
|
||||
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 [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 [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 [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 [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 [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 [severity_to_string[EM.severity]] event '[EM.name]'.")
|
||||
E.kill()
|
||||
else if(href_list["view_events"])
|
||||
selected_event_container = locate(href_list["view_events"])
|
||||
else if(href_list["back"])
|
||||
selected_event_container = null
|
||||
else if(href_list["set_name"])
|
||||
var/name = input("Enter event name.", "Set Name") as text|null
|
||||
if(name)
|
||||
var/datum/event_meta/EM = locate(href_list["set_name"])
|
||||
EM.name = name
|
||||
else if(href_list["set_type"])
|
||||
var/type = input("Select event type.", "Select") as null|anything in allEvents
|
||||
if(type)
|
||||
var/datum/event_meta/EM = locate(href_list["set_type"])
|
||||
EM.event_type = type
|
||||
else if(href_list["set_weight"])
|
||||
var/weight = input("Enter weight. A higher value means higher chance for the event of being selected.", "Set Weight") as num|null
|
||||
if(weight && weight > 0)
|
||||
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 [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 [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 [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 [severity_to_string[EM.severity]] event '[EM.name]'.")
|
||||
else if(href_list["add"])
|
||||
if(!new_event.name || !new_event.event_type)
|
||||
return
|
||||
if(alert("This will add a new event to the rotation. Continue?","Add Event!","Yes","No") != "Yes")
|
||||
return
|
||||
new_event.severity = selected_event_container.severity
|
||||
selected_event_container.available_events += new_event
|
||||
admin_log_and_message_admins("has added \a [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 [severity_to_string[EC.severity]] event '[EC.next_event.name]'.")
|
||||
EC.next_event = null
|
||||
|
||||
Interact(usr)
|
||||
|
||||
/client/proc/forceEvent(var/type in event_manager.allEvents)
|
||||
set name = "Trigger Event (Debug Only)"
|
||||
set category = "Debug"
|
||||
|
||||
if(!holder)
|
||||
return
|
||||
|
||||
if(ispath(type))
|
||||
new type(new /datum/event_meta(EVENT_LEVEL_MAJOR))
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
|
||||
/client/proc/event_manager_panel()
|
||||
set name = "Event Manager Panel"
|
||||
set category = "Event"
|
||||
if(event_manager)
|
||||
event_manager.Interact(usr)
|
||||
feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
|
||||
var/area/candidate = null
|
||||
|
||||
var/list/safe_areas = list(
|
||||
/area/turret_protected/ai,
|
||||
/area/turret_protected/ai_upload,
|
||||
/area/engine,
|
||||
/area/solar,
|
||||
/area/holodeck,
|
||||
/area/shuttle/arrival,
|
||||
/area/shuttle/escape,
|
||||
/area/shuttle/escape_pod1/station,
|
||||
/area/shuttle/escape_pod2/station,
|
||||
/area/shuttle/escape_pod3/station,
|
||||
/area/shuttle/escape_pod5/station,
|
||||
/area/shuttle/specops/station,
|
||||
/area/shuttle/prison/station,
|
||||
/area/shuttle/administration/station
|
||||
)
|
||||
|
||||
//These are needed because /area/engine has to be removed from the list, but we still want these areas to get fucked up.
|
||||
var/list/danger_areas = list(
|
||||
/area/engine/break_room,
|
||||
/area/engine/chiefs_office)
|
||||
|
||||
var/list/event_areas = list()
|
||||
|
||||
for(var/areapath in the_station_areas)
|
||||
event_areas += typesof(areapath)
|
||||
for(var/areapath in safe_areas)
|
||||
event_areas -= typesof(areapath)
|
||||
for(var/areapath in danger_areas)
|
||||
event_areas += typesof(areapath)
|
||||
|
||||
while(event_areas.len > 0)
|
||||
var/list/event_turfs = null
|
||||
candidate = locate(pick_n_take(event_areas))
|
||||
event_turfs = get_area_turfs(candidate)
|
||||
if(event_turfs.len > 0)
|
||||
break
|
||||
|
||||
return candidate
|
||||
|
||||
/datum/event/proc/num_players()
|
||||
var/players = 0
|
||||
for(var/mob/living/carbon/human/P in GLOB.player_list)
|
||||
if(P.client)
|
||||
players++
|
||||
return players
|
||||
|
||||
// Returns how many characters are currently active(not logged out, not AFK for more than 10 minutes)
|
||||
// with a specific role.
|
||||
// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
|
||||
/proc/number_active_with_role()
|
||||
var/list/active_with_role = list()
|
||||
active_with_role["Engineer"] = 0
|
||||
active_with_role["Medical"] = 0
|
||||
active_with_role["Security"] = 0
|
||||
active_with_role["Scientist"] = 0
|
||||
active_with_role["AI"] = 0
|
||||
active_with_role["Cyborg"] = 0
|
||||
active_with_role["Janitor"] = 0
|
||||
active_with_role["Botanist"] = 0
|
||||
active_with_role["Any"] = GLOB.player_list.len
|
||||
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
|
||||
continue
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
|
||||
active_with_role["Engineer"]++
|
||||
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
|
||||
active_with_role["Engineer"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
|
||||
active_with_role["Medical"]++
|
||||
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
|
||||
active_with_role["Medical"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
|
||||
active_with_role["Security"]++
|
||||
if(M.mind.assigned_role in security_positions)
|
||||
active_with_role["Security"]++
|
||||
|
||||
if(M.mind.assigned_role in list("Research Director", "Scientist"))
|
||||
active_with_role["Scientist"]++
|
||||
|
||||
if(M.mind.assigned_role == "AI")
|
||||
active_with_role["AI"]++
|
||||
|
||||
if(M.mind.assigned_role == "Cyborg")
|
||||
active_with_role["Cyborg"]++
|
||||
|
||||
if(M.mind.assigned_role == "Janitor")
|
||||
active_with_role["Janitor"]++
|
||||
|
||||
if(M.mind.assigned_role == "Botanist")
|
||||
active_with_role["Botanist"]++
|
||||
|
||||
return active_with_role
|
||||
@@ -0,0 +1,120 @@
|
||||
|
||||
/client/proc/forceEvent(var/type in SSevents.allEvents)
|
||||
set name = "Trigger Event (Debug Only)"
|
||||
set category = "Debug"
|
||||
|
||||
if(!holder)
|
||||
return
|
||||
|
||||
if(ispath(type))
|
||||
new type(new /datum/event_meta(EVENT_LEVEL_MAJOR))
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
|
||||
/client/proc/event_manager_panel()
|
||||
set name = "Event Manager Panel"
|
||||
set category = "Event"
|
||||
if(SSevents)
|
||||
SSevents.Interact(usr)
|
||||
feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
|
||||
var/area/candidate = null
|
||||
|
||||
var/list/safe_areas = list(
|
||||
/area/turret_protected/ai,
|
||||
/area/turret_protected/ai_upload,
|
||||
/area/engine,
|
||||
/area/solar,
|
||||
/area/holodeck,
|
||||
/area/shuttle/arrival,
|
||||
/area/shuttle/escape,
|
||||
/area/shuttle/escape_pod1/station,
|
||||
/area/shuttle/escape_pod2/station,
|
||||
/area/shuttle/escape_pod3/station,
|
||||
/area/shuttle/escape_pod5/station,
|
||||
/area/shuttle/specops/station,
|
||||
/area/shuttle/prison/station,
|
||||
/area/shuttle/administration/station
|
||||
)
|
||||
|
||||
//These are needed because /area/engine has to be removed from the list, but we still want these areas to get fucked up.
|
||||
var/list/danger_areas = list(
|
||||
/area/engine/break_room,
|
||||
/area/engine/chiefs_office)
|
||||
|
||||
var/list/event_areas = list()
|
||||
|
||||
for(var/areapath in the_station_areas)
|
||||
event_areas += typesof(areapath)
|
||||
for(var/areapath in safe_areas)
|
||||
event_areas -= typesof(areapath)
|
||||
for(var/areapath in danger_areas)
|
||||
event_areas += typesof(areapath)
|
||||
|
||||
while(event_areas.len > 0)
|
||||
var/list/event_turfs = null
|
||||
candidate = locate(pick_n_take(event_areas))
|
||||
event_turfs = get_area_turfs(candidate)
|
||||
if(event_turfs.len > 0)
|
||||
break
|
||||
|
||||
return candidate
|
||||
|
||||
// Returns how many characters are currently active(not logged out, not AFK for more than 10 minutes)
|
||||
// with a specific role.
|
||||
// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
|
||||
/proc/number_active_with_role()
|
||||
var/list/active_with_role = list()
|
||||
active_with_role["Engineer"] = 0
|
||||
active_with_role["Medical"] = 0
|
||||
active_with_role["Security"] = 0
|
||||
active_with_role["Scientist"] = 0
|
||||
active_with_role["AI"] = 0
|
||||
active_with_role["Cyborg"] = 0
|
||||
active_with_role["Janitor"] = 0
|
||||
active_with_role["Botanist"] = 0
|
||||
active_with_role["Any"] = GLOB.player_list.len
|
||||
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
|
||||
continue
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
|
||||
active_with_role["Engineer"]++
|
||||
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
|
||||
active_with_role["Engineer"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
|
||||
active_with_role["Medical"]++
|
||||
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
|
||||
active_with_role["Medical"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
|
||||
active_with_role["Security"]++
|
||||
if(M.mind.assigned_role in security_positions)
|
||||
active_with_role["Security"]++
|
||||
|
||||
if(M.mind.assigned_role in list("Research Director", "Scientist"))
|
||||
active_with_role["Scientist"]++
|
||||
|
||||
if(M.mind.assigned_role == "AI")
|
||||
active_with_role["AI"]++
|
||||
|
||||
if(M.mind.assigned_role == "Cyborg")
|
||||
active_with_role["Cyborg"]++
|
||||
|
||||
if(M.mind.assigned_role == "Janitor")
|
||||
active_with_role["Janitor"]++
|
||||
|
||||
if(M.mind.assigned_role == "Botanist")
|
||||
active_with_role["Botanist"]++
|
||||
|
||||
return active_with_role
|
||||
|
||||
/datum/event/proc/num_players()
|
||||
var/players = 0
|
||||
for(var/mob/living/carbon/human/P in GLOB.player_list)
|
||||
if(P.client)
|
||||
players++
|
||||
return players
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/datum/event/falsealarm/announce()
|
||||
var/weight = pickweight(list(EVENT_LEVEL_MUNDANE = 60, EVENT_LEVEL_MODERATE = 30, EVENT_LEVEL_MAJOR = 10))
|
||||
var/datum/event_container/container = event_manager.event_containers[weight]
|
||||
var/datum/event_container/container = SSevents.event_containers[weight]
|
||||
var/datum/event/E = container.acquire_event()
|
||||
var/datum/event/Event = new E
|
||||
message_admins("False Alarm: [Event]")
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/datum/event/wizard/ghost //The spook is real
|
||||
|
||||
/datum/event/wizard/ghost/start()
|
||||
var/msg = "<span class='warning'>You suddenly feel extremely obvious...</span>"
|
||||
set_observer_default_invisibility(0, msg)
|
||||
@@ -345,9 +345,9 @@
|
||||
if(!istype(H)) return
|
||||
|
||||
H.celebrate()
|
||||
if(!holiday_master.holidays)
|
||||
holiday_master.holidays = list()
|
||||
holiday_master.holidays[H.name] = H
|
||||
if(!SSholiday.holidays)
|
||||
SSholiday.holidays = list()
|
||||
SSholiday.holidays[H.name] = H
|
||||
|
||||
//update our hub status
|
||||
world.update_status()
|
||||
|
||||
@@ -701,8 +701,7 @@
|
||||
H.nutrition -= 20
|
||||
H.adjustToxLoss(-3)
|
||||
var/turf/T = get_turf(H)
|
||||
T.add_vomit_floor(H)
|
||||
playsound(H, 'sound/effects/splat.ogg', 50, 1)
|
||||
T.add_vomit_floor()
|
||||
else
|
||||
visible_message("<span class='warning'>[src] flickers and fails, due to bluespace interference!</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
var/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness
|
||||
|
||||
GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
|
||||
/mob/dead/observer
|
||||
name = "ghost"
|
||||
desc = "It's a g-g-g-g-ghooooost!" //jinkies!
|
||||
@@ -29,6 +31,8 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
|
||||
var/ghost_orbit = GHOST_ORBIT_CIRCLE
|
||||
|
||||
/mob/dead/observer/New(var/mob/body=null, var/flags=1)
|
||||
set_invisibility(GLOB.observer_default_invisibility)
|
||||
|
||||
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
|
||||
see_invisible = SEE_INVISIBLE_OBSERVER_AI_EYE
|
||||
see_in_dark = 100
|
||||
@@ -384,7 +388,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
to_chat(usr, "AntagHud Toggled OFF")
|
||||
M.antagHUD = 0
|
||||
|
||||
/mob/dead/observer/proc/dead_tele(A in ghostteleportlocs)
|
||||
/mob/dead/observer/proc/dead_tele()
|
||||
set category = "Ghost"
|
||||
set name = "Teleport"
|
||||
set desc= "Teleport to a location"
|
||||
@@ -397,6 +401,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
spawn(30)
|
||||
usr.verbs += /mob/dead/observer/proc/dead_tele
|
||||
|
||||
var/area/A = input("Area to jump to", "BOOYEA") as null|anything in ghostteleportlocs
|
||||
var/area/thearea = ghostteleportlocs[A]
|
||||
if(!thearea) return
|
||||
|
||||
@@ -410,13 +415,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
usr.forceMove(pick(L))
|
||||
following = null
|
||||
|
||||
/mob/dead/observer/verb/follow(input in getmobs())
|
||||
/mob/dead/observer/verb/follow()
|
||||
set category = "Ghost"
|
||||
set name = "Orbit" // "Haunt"
|
||||
set desc = "Follow and orbit a mob."
|
||||
|
||||
var/target = getmobs()[input]
|
||||
if(!target) return
|
||||
var/list/mobs = getpois(skip_mindless=1)
|
||||
var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs
|
||||
var/mob/target = mobs[input]
|
||||
ManualFollow(target)
|
||||
|
||||
// This is the ghost's follow verb with an argument
|
||||
@@ -484,24 +490,29 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
update_following()
|
||||
return ..()
|
||||
|
||||
/mob/dead/observer/verb/jumptomob(target in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak
|
||||
/mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak
|
||||
set category = "Ghost"
|
||||
set name = "Jump to Mob"
|
||||
set desc = "Teleport to a mob"
|
||||
|
||||
if(istype(usr, /mob/dead/observer)) //Make sure they're an observer!
|
||||
if(isobserver(usr)) //Make sure they're an observer!
|
||||
var/list/dest = list() //List of possible destinations (mobs)
|
||||
var/target = null //Chosen target.
|
||||
|
||||
if(!target)//Make sure we actually have a target
|
||||
dest += getpois(mobs_only=1) //Fill list, prompt user with list
|
||||
target = input("Please, select a mob!", "Jump to Mob", null, null) as null|anything in dest
|
||||
|
||||
if(!target) //Make sure we actually have a target
|
||||
return
|
||||
else
|
||||
var/mob/M = getmobs()[target] //Destination mob
|
||||
var/mob/M = dest[target] //Destination mob
|
||||
var/mob/A = src //Source mob
|
||||
var/turf/T = get_turf(M) //Turf of the destination mob
|
||||
|
||||
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
|
||||
forceMove(T)
|
||||
following = null
|
||||
A.forceMove(T)
|
||||
else
|
||||
to_chat(src, "This mob is not located in the game world.")
|
||||
to_chat(A, "This mob is not located in the game world.")
|
||||
|
||||
|
||||
/* Now a spell. See spells.dm
|
||||
@@ -742,6 +753,26 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/is_literate()
|
||||
return TRUE
|
||||
|
||||
/mob/dead/observer/proc/set_invisibility(value)
|
||||
invisibility = value
|
||||
if(!value)
|
||||
set_light(1, 2)
|
||||
else
|
||||
set_light(0, 0)
|
||||
|
||||
/mob/dead/observer/vv_edit_var(var_name, var_value)
|
||||
. = ..()
|
||||
if(var_name == "invisibility")
|
||||
set_invisibility(invisibility) // updates light
|
||||
|
||||
/proc/set_observer_default_invisibility(amount, message=null)
|
||||
for(var/mob/dead/observer/G in GLOB.player_list)
|
||||
G.set_invisibility(amount)
|
||||
if(message)
|
||||
to_chat(G, message)
|
||||
GLOB.observer_default_invisibility = amount
|
||||
|
||||
/mob/dead/observer/proc/open_spawners_menu()
|
||||
set name = "Mob spawners menu"
|
||||
set desc = "See all currently available ghost spawners"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
. = src.say_dead(message)
|
||||
|
||||
|
||||
/mob/dead/observer/emote(var/act, var/type, var/message)
|
||||
/mob/dead/observer/emote(act, type, message, force)
|
||||
message = sanitize(copytext(message, 1, MAX_MESSAGE_LEN))
|
||||
|
||||
if(!message)
|
||||
|
||||
@@ -2,15 +2,20 @@
|
||||
|
||||
//Emote Cooldown System (it's so simple!)
|
||||
/mob/proc/handle_emote_CD(cooldown = EMOTE_COOLDOWN)
|
||||
if(emote_cd == 2) return 1 // Cooldown emotes were disabled by an admin, prevent use
|
||||
if(src.emote_cd == 1) return 1 // Already on CD, prevent use
|
||||
if(emote_cd == 3) //Spam those emotes
|
||||
return FALSE
|
||||
if(emote_cd == 2) // Cooldown emotes were disabled by an admin, prevent use
|
||||
return TRUE
|
||||
if(emote_cd == 1) // Already on CD, prevent use
|
||||
return TRUE
|
||||
|
||||
src.emote_cd = 1 // Starting cooldown
|
||||
emote_cd = TRUE // Starting cooldown
|
||||
spawn(cooldown)
|
||||
if(emote_cd == 2) return 1 // Don't reset if cooldown emotes were disabled by an admin during the cooldown
|
||||
src.emote_cd = 0 // Cooldown complete, ready for more!
|
||||
if(emote_cd == 2)
|
||||
return TRUE // Don't reset if cooldown emotes were disabled by an admin during the cooldown
|
||||
emote_cd = FALSE // Cooldown complete, ready for more!
|
||||
return FALSE // Proceed with emote
|
||||
|
||||
return 0 // Proceed with emote
|
||||
//--FalseIncarnate
|
||||
|
||||
/mob/proc/handle_emote_param(var/target, var/not_self, var/vicinity, var/return_mob) //Only returns not null if the target param is valid.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/alien/humanoid/emote(var/act,var/m_type=1,var/message = null)
|
||||
/mob/living/carbon/alien/humanoid/emote(act, m_type = 1, message = null, force)
|
||||
var/param = null
|
||||
if(findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
@@ -25,7 +25,7 @@
|
||||
if("flip")
|
||||
on_CD = handle_emote_CD()
|
||||
|
||||
if(on_CD)
|
||||
if(!force && on_CD == 1)
|
||||
return
|
||||
|
||||
switch(act)
|
||||
@@ -138,4 +138,4 @@
|
||||
playsound(src.loc, 'sound/voice/hiss1.ogg', 30, 1, 1)
|
||||
if(act == "gnarl")
|
||||
playsound(src.loc, 'sound/voice/hiss4.ogg', 30, 1, 1)
|
||||
..(act, m_type, message)
|
||||
..()
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/alien/larva/emote(var/act,var/m_type=1,var/message = null)
|
||||
/mob/living/carbon/alien/larva/emote(act, m_type = 1, message = null, force)
|
||||
var/param = null
|
||||
if(findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/brain/emote(var/act,var/m_type=1,var/message = null)
|
||||
/mob/living/carbon/brain/emote(act,m_type = 1, message = null, force)
|
||||
if(!(container && istype(container, /obj/item/mmi)))//No MMI, no emotes
|
||||
return
|
||||
|
||||
@@ -48,4 +48,4 @@
|
||||
to_chat(src, "alarm, alert, notice, flash,blink, whistle, beep, boop")
|
||||
|
||||
if(message && !stat)
|
||||
..(act, m_type, message)
|
||||
..()
|
||||
@@ -109,7 +109,7 @@
|
||||
adjustBruteLoss(3)
|
||||
else
|
||||
if(T)
|
||||
T.add_vomit_floor(src)
|
||||
T.add_vomit_floor()
|
||||
nutrition -= lost_nutrition
|
||||
if(stun)
|
||||
adjustToxLoss(-3)
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
/mob/living/carbon/human/death(gibbed)
|
||||
if(can_die() && !gibbed && deathgasp_on_death)
|
||||
emote("deathgasp") //let the world KNOW WE ARE DEAD
|
||||
emote("deathgasp", force = TRUE) //let the world KNOW WE ARE DEAD
|
||||
|
||||
// Only execute the below if we successfully died
|
||||
. = ..(gibbed)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/human/emote(var/act,var/m_type=1,var/message = null,var/force)
|
||||
/mob/living/carbon/human/emote(act, m_type = 1, message = null, force)
|
||||
|
||||
if((stat == DEAD) || (status_flags & FAKEDEATH))
|
||||
return // No screaming bodies
|
||||
@@ -13,22 +13,22 @@
|
||||
if(muzzled)
|
||||
var/obj/item/clothing/mask/muzzle/M = wear_mask
|
||||
if(M.mute == MUZZLE_MUTE_NONE)
|
||||
muzzled = 0 //Not all muzzles block sound
|
||||
muzzled = FALSE //Not all muzzles block sound
|
||||
if(!can_speak())
|
||||
muzzled = 1
|
||||
muzzled = TRUE
|
||||
//var/m_type = 1
|
||||
|
||||
for(var/obj/item/implant/I in src)
|
||||
if(I.implanted)
|
||||
I.trigger(act, src)
|
||||
I.trigger(act, src, force)
|
||||
|
||||
var/miming = 0
|
||||
var/miming = FALSE
|
||||
if(mind)
|
||||
miming = mind.miming
|
||||
|
||||
//Emote Cooldown System (it's so simple!)
|
||||
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
var/on_CD = 0
|
||||
//handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
var/on_CD = FALSE
|
||||
act = lowertext(act)
|
||||
switch(act)
|
||||
//Cooldown-inducing emotes
|
||||
@@ -61,16 +61,16 @@
|
||||
else
|
||||
return
|
||||
if("squish", "squishes")
|
||||
var/found_slime_bodypart = 0
|
||||
var/found_slime_bodypart = FALSE
|
||||
|
||||
if(isslimeperson(src)) //Only Slime People can squish
|
||||
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm'
|
||||
found_slime_bodypart = 1
|
||||
found_slime_bodypart = TRUE
|
||||
else
|
||||
for(var/obj/item/organ/external/L in bodyparts) // if your limbs are squishy you can squish too!
|
||||
if(istype(L.dna.species, /datum/species/slime))
|
||||
on_CD = handle_emote_CD()
|
||||
found_slime_bodypart = 1
|
||||
found_slime_bodypart = TRUE
|
||||
break
|
||||
|
||||
if(!found_slime_bodypart) //Everyone else fails, skip the emote attempt
|
||||
@@ -118,9 +118,9 @@
|
||||
on_CD = handle_emote_CD()
|
||||
//Everything else, including typos of the above emotes
|
||||
else
|
||||
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
|
||||
on_CD = FALSE //If it doesn't induce the cooldown, we won't check for the cooldown
|
||||
|
||||
if(on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
if(!force && on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
return // Suppress emote, you're still cooling off.
|
||||
|
||||
switch(act)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/slime/emote(act, m_type = 1, message = null)
|
||||
/mob/living/carbon/slime/emote(act, m_type = 1, message = null, force)
|
||||
if(findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
//param = copytext(act, t1 + 1, length(act) + 1)
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
SetLoseBreath(0)
|
||||
|
||||
if(!gibbed && deathgasp_on_death)
|
||||
emote("deathgasp")
|
||||
emote("deathgasp", force = TRUE)
|
||||
|
||||
if(mind && suiciding)
|
||||
mind.suicided = TRUE
|
||||
|
||||
@@ -275,7 +275,7 @@ proc/get_radio_key_from_channel(var/channel)
|
||||
/mob/living/proc/GetVoice()
|
||||
return name
|
||||
|
||||
/mob/living/emote(var/act, var/type, var/message) //emote code is terrible, this is so that anything that isn't already snowflaked to shit can call the parent and handle emoting sanely
|
||||
/mob/living/emote(act, type, message, force) //emote code is terrible, this is so that anything that isn't already snowflaked to shit can call the parent and handle emoting sanely
|
||||
if(client)
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
to_chat(src, "<span class='danger'>You cannot speak in IC (Muted).</span>")
|
||||
@@ -284,7 +284,7 @@ proc/get_radio_key_from_channel(var/channel)
|
||||
if(stat)
|
||||
return 0
|
||||
|
||||
if(..(act, type, message))
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(act && type && message) //parent call
|
||||
@@ -306,7 +306,8 @@ proc/get_radio_key_from_channel(var/channel)
|
||||
return 1
|
||||
|
||||
else //everything else failed, emote is probably invalid
|
||||
if(act == "help") return //except help, because help is handled individually
|
||||
if(act == "help")
|
||||
return //except help, because help is handled individually
|
||||
to_chat(src, "<span class='notice'>Unusable emote '[act]'. Say *help for a list.</span>")
|
||||
|
||||
/mob/living/whisper(message as text)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/silicon/emote(var/act, var/m_type=1, var/message = null)
|
||||
/mob/living/silicon/emote(act, m_type=1, message = null, force)
|
||||
var/param = null
|
||||
if(findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
@@ -6,7 +6,7 @@
|
||||
act = copytext(act, 1, t1)
|
||||
|
||||
//Emote Cooldown System (it's so simple!)
|
||||
// proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
//handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
var/on_CD = 0
|
||||
act = lowertext(act)
|
||||
switch(act)
|
||||
@@ -20,7 +20,7 @@
|
||||
else
|
||||
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
|
||||
|
||||
if(on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
if(!force && on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
return // Suppress emote, you're still cooling off.
|
||||
//--FalseIncarnate
|
||||
|
||||
@@ -78,4 +78,4 @@
|
||||
if("help")
|
||||
to_chat(src, "yes, no, beep, ping, buzz, scream, buzz2")
|
||||
|
||||
..(act, m_type, message)
|
||||
..()
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/mob/living/silicon/pai/emote(var/act, var/m_type=1, var/message = null)
|
||||
..(act, m_type, message)
|
||||
@@ -57,12 +57,6 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
usr << browse(null, "window=findPai")
|
||||
|
||||
|
||||
if(candidate)
|
||||
if(candidate.key && usr.key && candidate.key != usr.key)
|
||||
message_admins("Warning: possible href exploit by [key_name(usr)] (paiController/Topic, candidate and usr are different mobs)")
|
||||
log_debug("Warning: possible href exploit by [key_name(usr)] (paiController/Topic, candidate and usr are different mobs)")
|
||||
return
|
||||
|
||||
if("signup" in href_list)
|
||||
var/mob/dead/observer/O = locate(href_list["signup"])
|
||||
if(!O)
|
||||
@@ -75,6 +69,11 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
recruitWindow(O)
|
||||
return
|
||||
|
||||
if(candidate)
|
||||
if(candidate.key && usr.key && candidate.key != usr.key)
|
||||
message_admins("Warning: possible href exploit by [key_name(usr)] (paiController/Topic, candidate and usr are different mobs)")
|
||||
log_debug("Warning: possible href exploit by [key_name(usr)] (paiController/Topic, candidate and usr are different mobs)")
|
||||
return
|
||||
|
||||
if(href_list["new"])
|
||||
var/option = href_list["option"]
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
/mob/living/silicon/robot/death(gibbed)
|
||||
if(can_die())
|
||||
if(!gibbed && deathgasp_on_death)
|
||||
emote("deathgasp")
|
||||
emote("deathgasp", force = TRUE)
|
||||
|
||||
if(module)
|
||||
module.handle_death(gibbed)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/silicon/robot/emote(var/act, var/m_type=1, var/message = null)
|
||||
/mob/living/silicon/robot/emote(act, m_type=1, message = null, force)
|
||||
var/param = null
|
||||
if(findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
@@ -6,7 +6,7 @@
|
||||
act = copytext(act, 1, t1)
|
||||
|
||||
//Emote Cooldown System (it's so simple!)
|
||||
//proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
//handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
var/on_CD = 0
|
||||
act = lowertext(act)
|
||||
switch(act)
|
||||
@@ -17,7 +17,7 @@
|
||||
else
|
||||
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
|
||||
|
||||
if(on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
if(!force && on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
return // Suppress emote, you're still cooling off.
|
||||
//--FalseIncarnate
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
if("help")
|
||||
to_chat(src, "salute, bow-(none)/mob, clap, flap, aflap, twitch, twitches, nod, deathgasp, glare-(none)/mob, stare-(none)/mob, look,\n law, halt")
|
||||
|
||||
..(act, m_type, message)
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/verb/powerwarn()
|
||||
set category = "Robot Commands"
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
return
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/ai/emote(var/act, var/type, var/message)
|
||||
/mob/living/silicon/ai/emote(act, type, message, force)
|
||||
var/obj/machinery/hologram/holopad/T = current
|
||||
if(istype(T) && T.masters[src])//Is the AI using a holopad?
|
||||
src.holopad_emote(message)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/simple_animal/bot/emote(act, m_type=1, message = null)
|
||||
/mob/living/simple_animal/bot/emote(act, m_type = 1, message = null, force)
|
||||
var/param = null
|
||||
if(findtext(act, "-", 1, null))
|
||||
var/t1 = findtext(act, "-", 1, null)
|
||||
@@ -9,7 +9,7 @@
|
||||
act = copytext(act,1,length(act))
|
||||
|
||||
//Emote Cooldown System (it's so simple!)
|
||||
//proc/handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
//handle_emote_CD() located in [code\modules\mob\emote.dm]
|
||||
var/on_CD = 0
|
||||
act = lowertext(act)
|
||||
switch(act)
|
||||
@@ -22,7 +22,7 @@
|
||||
else
|
||||
on_CD = 0 //If it doesn't induce the cooldown, we won't check for the cooldown
|
||||
|
||||
if(on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
if(!force && on_CD == 1) // Check if we need to suppress the emote attempt.
|
||||
return // Suppress emote, you're still cooling off.
|
||||
//--FalseIncarnate
|
||||
|
||||
@@ -71,4 +71,4 @@
|
||||
|
||||
if("help")
|
||||
to_chat(src, "scream(s), yes, no, beep, buzz, ping")
|
||||
..(act, m_type, message)
|
||||
..()
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
stop_automated_movement = 1
|
||||
walk_to(src,movement_target,0,3)
|
||||
|
||||
/mob/living/simple_animal/pet/cat/emote(act, m_type=1, message = null)
|
||||
/mob/living/simple_animal/pet/cat/emote(act, m_type = 1, message = null, force)
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
@@ -163,9 +163,9 @@
|
||||
else
|
||||
on_CD = 0
|
||||
|
||||
if(on_CD == 1)
|
||||
if(!force && on_CD == 1)
|
||||
return
|
||||
|
||||
|
||||
switch(act)
|
||||
if("meow")
|
||||
message = "<B>[src]</B> [pick(emote_hear)]!"
|
||||
@@ -225,9 +225,9 @@
|
||||
maxHealth = 50
|
||||
harm_intent_damage = 10
|
||||
butcher_results = list(
|
||||
/obj/item/organ/internal/brain = 1,
|
||||
/obj/item/organ/internal/heart = 1,
|
||||
/obj/item/reagent_containers/food/snacks/birthdaycakeslice = 3,
|
||||
/obj/item/organ/internal/brain = 1,
|
||||
/obj/item/organ/internal/heart = 1,
|
||||
/obj/item/reagent_containers/food/snacks/birthdaycakeslice = 3,
|
||||
/obj/item/reagent_containers/food/snacks/meat/slab = 2
|
||||
)
|
||||
response_harm = "takes a bite out of"
|
||||
|
||||
@@ -368,7 +368,7 @@
|
||||
name = "Definitely Not [real_name]"
|
||||
desc = "That's Definitely Not [real_name]"
|
||||
valid = 1
|
||||
|
||||
|
||||
if(/obj/item/clothing/head/beret/centcom/officer, /obj/item/clothing/head/beret/centcom/officer/navy)
|
||||
name = "Blueshield [real_name]"
|
||||
desc = "Will stand by you until the bitter end."
|
||||
@@ -407,7 +407,7 @@
|
||||
playsound(src, yelp_sound, 75, 1)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/pet/corgi/emote(act, m_type=1, message = null)
|
||||
/mob/living/simple_animal/pet/corgi/emote(act, m_type = 1, message = null, force)
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
@@ -421,9 +421,9 @@
|
||||
else
|
||||
on_CD = 0
|
||||
|
||||
if(on_CD == 1)
|
||||
if(!force && on_CD == 1)
|
||||
return
|
||||
|
||||
|
||||
switch(act)
|
||||
if("bark")
|
||||
message = "<B>[src]</B> [pick(src.speak_emote)]!"
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
/datum/action/innate/diona/merge/Activate()
|
||||
var/mob/living/simple_animal/diona/user = owner
|
||||
user.merge()
|
||||
|
||||
|
||||
/datum/action/innate/diona/evolve
|
||||
name = "Evolve"
|
||||
icon_icon = 'icons/obj/cloning.dmi'
|
||||
@@ -109,7 +109,7 @@
|
||||
forceMove(M)
|
||||
else
|
||||
get_scooped(M)
|
||||
else
|
||||
else
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/diona/proc/merge()
|
||||
@@ -151,7 +151,7 @@
|
||||
to_chat(loc, "You feel a pang of loss as [src] splits away from your biomass.")
|
||||
to_chat(src, "You wiggle out of the depths of [loc]'s biomass and plop to the ground.")
|
||||
forceMove(T)
|
||||
|
||||
|
||||
var/hasMobs = FALSE
|
||||
for(var/atom/A in D.contents)
|
||||
if(istype(A, /mob/) || istype(A, /obj/item/holder))
|
||||
@@ -163,9 +163,9 @@
|
||||
return TRUE
|
||||
|
||||
/mob/living/simple_animal/diona/proc/evolve()
|
||||
if(stat != CONSCIOUS)
|
||||
if(stat != CONSCIOUS)
|
||||
return FALSE
|
||||
|
||||
|
||||
if(donors.len < evolve_donors)
|
||||
to_chat(src, "<span class='warning'>You need more blood in order to ascend to a new state of consciousness...</span>")
|
||||
return FALSE
|
||||
@@ -176,7 +176,7 @@
|
||||
|
||||
if(isdiona(loc) && !split()) //if it's merged with diona, needs to able to split before evolving
|
||||
return FALSE
|
||||
|
||||
|
||||
visible_message("<span class='danger'>[src] begins to shift and quiver, and erupts in a shower of shed bark as it splits into a tangle of nearly a dozen new dionaea.</span>","<span class='danger'>You begin to shift and quiver, feeling your awareness splinter. All at once, we consume our stored nutrients to surge with growth, splitting into a tangle of at least a dozen new dionaea. We have attained our gestalt form.</span>")
|
||||
|
||||
var/mob/living/carbon/human/diona/adult = new(get_turf(loc))
|
||||
@@ -202,14 +202,14 @@
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/mob/living/simple_animal/diona/proc/steal_blood()
|
||||
if(stat != CONSCIOUS)
|
||||
/mob/living/simple_animal/diona/proc/steal_blood()
|
||||
if(stat != CONSCIOUS)
|
||||
return FALSE
|
||||
|
||||
|
||||
var/list/choices = list()
|
||||
for(var/mob/living/carbon/human/H in oview(1,src))
|
||||
if(Adjacent(H) && H.dna && !(NO_BLOOD in H.dna.species.species_traits))
|
||||
choices += H
|
||||
choices += H
|
||||
|
||||
if(!choices.len)
|
||||
to_chat(src, "<span class='warning'>No suitable blood donors nearby.</span>")
|
||||
@@ -260,7 +260,7 @@
|
||||
to_chat(src, "<span class='warning'>You don't have any hands!</span>")
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/diona/emote(act, m_type=1, message = null)
|
||||
/mob/living/simple_animal/diona/emote(act, m_type = 1, message = null, force)
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
else
|
||||
on_CD = 0
|
||||
|
||||
if(on_CD == 1)
|
||||
if(!force && on_CD == 1)
|
||||
return
|
||||
|
||||
switch(act) //IMPORTANT: Emotes MUST NOT CONFLICT anywhere along the chain.
|
||||
@@ -283,4 +283,4 @@
|
||||
if("help")
|
||||
to_chat(src, "scream, chirp")
|
||||
|
||||
..(act, m_type, message)
|
||||
..()
|
||||
@@ -109,7 +109,7 @@
|
||||
if(client)
|
||||
client.time_died_as_mouse = world.time
|
||||
|
||||
/mob/living/simple_animal/mouse/emote(act, m_type=1, message = null)
|
||||
/mob/living/simple_animal/mouse/emote(act, m_type = 1, message = null, force)
|
||||
if(stat != CONSCIOUS)
|
||||
return
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
else
|
||||
on_CD = 0
|
||||
|
||||
if(on_CD == 1)
|
||||
if(!force && on_CD == 1)
|
||||
return
|
||||
|
||||
switch(act)
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
adjustBruteLoss(20)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/emote(var/act, var/m_type=1, var/message = null)
|
||||
/mob/living/simple_animal/emote(act, m_type = 1, message = null, force)
|
||||
if(stat)
|
||||
return
|
||||
act = lowertext(act)
|
||||
@@ -269,7 +269,7 @@
|
||||
if("help")
|
||||
to_chat(src, "scream")
|
||||
|
||||
..(act, m_type, message)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj)
|
||||
|
||||
@@ -1176,12 +1176,11 @@ var/list/slot_equipment_priority = list( \
|
||||
if(green)
|
||||
if(!no_text)
|
||||
visible_message("<span class='warning'>[src] vomits up some green goo!</span>","<span class='warning'>You vomit up some green goo!</span>")
|
||||
new /obj/effect/decal/cleanable/vomit/green(location)
|
||||
location.add_vomit_floor(FALSE, TRUE)
|
||||
else
|
||||
if(!no_text)
|
||||
visible_message("<span class='warning'>[src] pukes all over [p_them()]self!</span>","<span class='warning'>You puke all over yourself!</span>")
|
||||
location.add_vomit_floor(src, 1)
|
||||
playsound(location, 'sound/effects/splat.ogg', 50, 1)
|
||||
location.add_vomit_floor(TRUE)
|
||||
|
||||
/mob/proc/AddSpell(obj/effect/proc_holder/spell/S)
|
||||
mob_spell_list += S
|
||||
@@ -1299,6 +1298,7 @@ var/list/slot_equipment_priority = list( \
|
||||
.["Show player panel"] = "?_src_=vars;mob_player_panel=[UID()]"
|
||||
|
||||
.["Give Spell"] = "?_src_=vars;give_spell=[UID()]"
|
||||
.["Give Martial Art"] = "?_src_=vars;givemartialart=[UID()]"
|
||||
.["Give Disease"] = "?_src_=vars;give_disease=[UID()]"
|
||||
.["Toggle Godmode"] = "?_src_=vars;godmode=[UID()]"
|
||||
.["Toggle Build Mode"] = "?_src_=vars;build_mode=[UID()]"
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
return verb
|
||||
|
||||
|
||||
/mob/proc/emote(var/act, var/type, var/message)
|
||||
/mob/proc/emote(act, type, message, force)
|
||||
if(act == "me")
|
||||
return custom_emote(type, message)
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
var/current = prefix_locations[i] // ["Common", keypos]
|
||||
|
||||
// There are a few things that will make us want to ignore all other languages in - namely, HIVEMIND languages.
|
||||
var/datum/language/L = current[1]
|
||||
var/datum/language/L = current[1]
|
||||
if(L && L.flags & HIVEMIND)
|
||||
. = new /datum/multilingual_say_piece(L, trim(strip_prefixes(message)))
|
||||
break
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
/obj/item/paper/attack_self(mob/living/user as mob)
|
||||
user.examinate(src)
|
||||
if(rigged && (holiday_master.holidays && holiday_master.holidays[APRIL_FOOLS]))
|
||||
if(rigged && (SSholiday.holidays && SSholiday.holidays[APRIL_FOOLS]))
|
||||
if(spam_flag == 0)
|
||||
spam_flag = 1
|
||||
playsound(loc, 'sound/items/bikehorn.ogg', 50, 1)
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
papers.Remove(P)
|
||||
else
|
||||
P = new /obj/item/paper
|
||||
if(holiday_master.holidays && holiday_master.holidays[APRIL_FOOLS])
|
||||
if(SSholiday.holidays && SSholiday.holidays[APRIL_FOOLS])
|
||||
if(prob(30))
|
||||
P.info = "<font face=\"[P.crayonfont]\" color=\"red\"><b>HONK HONK HONK HONK HONK HONK HONK<br>HOOOOOOOOOOOOOOOOOOOOOONK<br>APRIL FOOLS</b></font>"
|
||||
P.rigged = 1
|
||||
|
||||
@@ -1353,6 +1353,11 @@
|
||||
L.broken(0, 1)
|
||||
stoplag()
|
||||
|
||||
/obj/machinery/power/apc/proc/null_charge()
|
||||
for(var/obj/machinery/light/L in area)
|
||||
L.broken(0, 1)
|
||||
stoplag()
|
||||
|
||||
/obj/machinery/power/apc/proc/setsubsystem(val)
|
||||
if(cell && cell.charge > 0)
|
||||
return (val==1) ? 0 : val
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
return
|
||||
if(M.mind && M.mind.changeling && M.mind.changeling.regenerating) //no messing with changeling's fake death
|
||||
return
|
||||
M.visible_message("<B>[M]</B> seizes up and falls limp, [M.p_their()] eyes dead and lifeless...") //so you can't trigger deathgasp emote on people. Edge case, but necessary.
|
||||
M.emote("deathgasp")
|
||||
M.status_flags |= FAKEDEATH
|
||||
M.update_stat("fakedeath reagent")
|
||||
M.med_hud_set_health()
|
||||
|
||||
@@ -905,8 +905,7 @@
|
||||
|
||||
/datum/reagent/vomit/reaction_turf(turf/T, volume)
|
||||
if(volume >= 5 && !isspaceturf(T))
|
||||
new /obj/effect/decal/cleanable/vomit(T)
|
||||
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
|
||||
T.add_vomit_floor()
|
||||
|
||||
/datum/reagent/greenvomit
|
||||
name = "Green vomit"
|
||||
@@ -918,8 +917,7 @@
|
||||
|
||||
/datum/reagent/greenvomit/reaction_turf(turf/T, volume)
|
||||
if(volume >= 5 && !isspaceturf(T))
|
||||
new /obj/effect/decal/cleanable/vomit/green(T)
|
||||
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
|
||||
T.add_vomit_floor(FALSE, TRUE)
|
||||
|
||||
////Lavaland Flora Reagents////
|
||||
|
||||
|
||||
@@ -90,22 +90,13 @@ var/ert_request_answered = FALSE
|
||||
return 0
|
||||
|
||||
var/index = 1
|
||||
var/ert_spawn_seconds = 120
|
||||
spawn(ert_spawn_seconds * 10) // to account for spawn() using deciseconds
|
||||
var/list/unspawnable_ert = list()
|
||||
for(var/mob/M in response_team_members)
|
||||
if(M)
|
||||
unspawnable_ert |= M
|
||||
if(unspawnable_ert.len)
|
||||
message_admins("ERT SPAWN: The following ERT members could not be spawned within [ert_spawn_seconds] seconds:")
|
||||
for(var/mob/M in unspawnable_ert)
|
||||
message_admins("- Unspawned ERT: [ADMIN_FULLMONTY(M)]")
|
||||
for(var/mob/M in response_team_members)
|
||||
if(index > emergencyresponseteamspawn.len)
|
||||
index = 1
|
||||
|
||||
if(!M || !M.client)
|
||||
continue
|
||||
log_debug("Spawning as ERT: [M.ckey] ([M])")
|
||||
var/client/C = M.client
|
||||
var/mob/living/new_commando = C.create_response_team(emergencyresponseteamspawn[index])
|
||||
if(!M || !new_commando)
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
change_meteor_chance(0.5)
|
||||
|
||||
/obj/machinery/satellite/meteor_shield/proc/change_meteor_chance(mod)
|
||||
for(var/datum/event_container/container in event_manager.event_containers)
|
||||
for(var/datum/event_container/container in SSevents.event_containers)
|
||||
for(var/datum/event_meta/M in container.available_events)
|
||||
if(M.event_type == /datum/event/meteor_wave)
|
||||
M.weight *= mod
|
||||
|
||||
Reference in New Issue
Block a user