mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-16 18:36:54 +01:00
Merge remote-tracking branch 'upstream/master' into rain
This commit is contained in:
@@ -35,6 +35,8 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(
|
||||
|
||||
#define isspaceturf(A) (istype(A, /turf/open/space))
|
||||
|
||||
#define iscloudturf(A) (istype(A, /turf/open/chasm/cloud))
|
||||
|
||||
#define isfloorturf(A) (istype(A, /turf/open/floor))
|
||||
|
||||
#define isclosedturf(A) (istype(A, /turf/closed))
|
||||
|
||||
@@ -142,6 +142,7 @@
|
||||
#define TRAIT_NORUNNING "norunning" // You walk!
|
||||
#define TRAIT_NOMARROW "nomarrow" // You don't make blood, with chemicals or nanites.
|
||||
#define TRAIT_NOPULSE "nopulse" // Your heart doesn't beat.
|
||||
#define TRAIT_EXEMPT_HEALTH_EVENTS "exempt-health-events"
|
||||
|
||||
//non-mob traits
|
||||
#define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it
|
||||
@@ -220,6 +221,7 @@
|
||||
#define ABSTRACT_ITEM_TRAIT "abstract-item"
|
||||
#define STATUS_EFFECT_TRAIT "status-effect"
|
||||
#define ROUNDSTART_TRAIT "roundstart" //cannot be removed without admin intervention
|
||||
#define GHOSTROLE_TRAIT "ghostrole"
|
||||
|
||||
// unique trait sources, still defines
|
||||
#define STATUE_MUTE "statue"
|
||||
|
||||
@@ -47,13 +47,20 @@
|
||||
if(!prob(50))
|
||||
return
|
||||
radiation_pulse(parent, strength, RAD_DISTANCE_COEFFICIENT*2, FALSE, can_contaminate)
|
||||
|
||||
if(!hl3_release_date)
|
||||
return
|
||||
strength -= strength / hl3_release_date
|
||||
if(strength <= RAD_BACKGROUND_RADIATION)
|
||||
addtimer(CALLBACK(src, .proc/check_dissipate), 5 SECONDS)
|
||||
return PROCESS_KILL
|
||||
|
||||
/datum/component/radioactive/proc/check_dissipate()
|
||||
if(strength <= RAD_BACKGROUND_RADIATION)
|
||||
qdel(src)
|
||||
return
|
||||
if(!(datum_flags & DF_ISPROCESSING)) // keep going
|
||||
START_PROCESSING(SSradiation, src)
|
||||
|
||||
|
||||
/datum/component/radioactive/proc/glow_loop(atom/movable/master)
|
||||
var/filter = master.get_filter("rad_glow")
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#define SHORT 5/7
|
||||
#define TALL 7/5
|
||||
|
||||
/datum/element/squish
|
||||
element_flags = ELEMENT_DETACH
|
||||
|
||||
/datum/element/squish/Attach(datum/target, duration)
|
||||
. = ..()
|
||||
if(!iscarbon(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
|
||||
var/mob/living/carbon/C = target
|
||||
var/was_lying = (C.lying != 0)
|
||||
addtimer(CALLBACK(src, .proc/Detach, C, was_lying), duration)
|
||||
|
||||
C.transform = C.transform.Scale(TALL, SHORT)
|
||||
|
||||
/datum/element/squish/Detach(mob/living/carbon/C, was_lying)
|
||||
. = ..()
|
||||
if(istype(C))
|
||||
var/is_lying = (C.lying != 0)
|
||||
if(was_lying == is_lying)
|
||||
C.transform = C.transform.Scale(SHORT, TALL)
|
||||
else
|
||||
C.transform = C.transform.Scale(TALL, SHORT)
|
||||
|
||||
#undef SHORT
|
||||
#undef TALL
|
||||
+7
-1
@@ -471,7 +471,7 @@
|
||||
else
|
||||
target_antag = target
|
||||
|
||||
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "maroon", "debrain", "protect", "destroy", "prevent", "hijack", "escape", "survive", "martyr", "steal", "download", "nuclear", "capture", "absorb", "noncon", "custom")
|
||||
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "maroon", "debrain", "protect", "destroy", "prevent", "hijack", "escape", "survive", "martyr", "heirloom", "steal", "download", "nuclear", "capture", "absorb", "noncon", "custom")
|
||||
if (!new_obj_type)
|
||||
return
|
||||
|
||||
@@ -541,6 +541,12 @@
|
||||
new_objective = new /datum/objective/nuclear
|
||||
new_objective.owner = src
|
||||
|
||||
if ("heirloom")
|
||||
new_objective = new /datum/objective/hoard/heirloom
|
||||
new_objective.owner = src
|
||||
var/datum/objective/hoard/heirloom/heirloom = new_objective
|
||||
heirloom.find_target()
|
||||
|
||||
if ("steal")
|
||||
if (!istype(objective, /datum/objective/steal))
|
||||
new_objective = new /datum/objective/steal
|
||||
|
||||
@@ -259,11 +259,13 @@
|
||||
if(is_centcom_level(player.z))
|
||||
living_players -= player // We don't autotator people in CentCom
|
||||
continue
|
||||
if(is_away_level(player.z))
|
||||
living_players -= player //We also don't autotator people in exiled roles / VR
|
||||
continue
|
||||
if(player.mind && (player.mind.special_role || player.mind.antag_datums?.len > 0))
|
||||
living_players -= player // We don't autotator people with roles already
|
||||
continue
|
||||
if(ishuman(player))
|
||||
var/mob/living/carbon/human/H = player
|
||||
if(HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS))
|
||||
living_players -= player //We also don't fucking give ghost roles traitor. Yes I'm using the exempt health events trait given to ghost roles to do this, because piggyback ftw.
|
||||
|
||||
/datum/dynamic_ruleset/midround/autotraitor/ready(forced = FALSE)
|
||||
if (required_candidates > living_players.len)
|
||||
|
||||
@@ -894,7 +894,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
|
||||
/datum/objective/hoard/proc/set_target(obj/item/I)
|
||||
if(I)
|
||||
hoarded_item = I
|
||||
explanation_text = "Keep [I] on your person at all times."
|
||||
explanation_text = "Steal and keep [I] heirloom on your person at all times."
|
||||
return hoarded_item
|
||||
else
|
||||
explanation_text = "Free objective"
|
||||
|
||||
@@ -21,6 +21,7 @@ Buildable meters
|
||||
level = 2
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
var/RPD_type
|
||||
var/disposable = TRUE
|
||||
|
||||
/obj/item/pipe/directional
|
||||
RPD_type = PIPE_UNARY
|
||||
@@ -232,3 +233,28 @@ Buildable meters
|
||||
/obj/item/pipe_meter/proc/setAttachLayer(new_layer = PIPING_LAYER_DEFAULT)
|
||||
piping_layer = new_layer
|
||||
PIPING_LAYER_DOUBLE_SHIFT(src, piping_layer)
|
||||
|
||||
/obj/item/pipe/bluespace
|
||||
pipe_type = /obj/machinery/atmospherics/pipe/bluespace
|
||||
var/bluespace_network_name = "default"
|
||||
icon_state = "bluespace"
|
||||
disposable = FALSE
|
||||
|
||||
/obj/item/pipe/bluespace/Initialize(mapload, _pipe_type, _dir, obj/machinery/atmospherics/make_from)
|
||||
. = ..()
|
||||
pipe_type = /obj/machinery/atmospherics/pipe/bluespace
|
||||
icon_state = "bluespace"
|
||||
disposable = FALSE
|
||||
|
||||
/obj/item/pipe/bluespace/attack_self(mob/user)
|
||||
var/new_name = input(user, "Enter identifier for bluespace pipe network", "bluespace pipe", bluespace_network_name) as text|null
|
||||
if(!isnull(new_name))
|
||||
bluespace_network_name = new_name
|
||||
|
||||
/obj/item/pipe/bluespace/make_from_existing(obj/machinery/atmospherics/pipe/bluespace/make_from)
|
||||
bluespace_network_name = make_from.bluespace_network_name
|
||||
return ..()
|
||||
|
||||
/obj/item/pipe/bluespace/build_pipe(obj/machinery/atmospherics/pipe/bluespace/A)
|
||||
A.bluespace_network_name = bluespace_network_name
|
||||
return ..()
|
||||
|
||||
@@ -9,7 +9,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
#define NO_NEW_MESSAGE 0
|
||||
#define NORMAL_MESSAGE_PRIORITY 1
|
||||
#define HIGH_MESSAGE_PRIORITY 2
|
||||
#define EXTREME_MESSAGE_PRIORITY 3 // not implemented, will probably require some hacking... everything needs to have a hidden feature in this game.
|
||||
#define EXTREME_MESSAGE_PRIORITY 3 // is implimented, does require hacking. everything needs to have a hidden feature in this game.
|
||||
|
||||
/obj/machinery/requests_console
|
||||
name = "requests console"
|
||||
@@ -47,9 +47,9 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
var/announceAuth = FALSE //Will be set to 1 when you authenticate yourself for announcements
|
||||
var/msgVerified = "" //Will contain the name of the person who verified it
|
||||
var/msgStamped = "" //If a message is stamped, this will contain the stamp name
|
||||
var/message = "";
|
||||
var/dpt = ""; //the department which will be receiving the message
|
||||
var/priority = -1 ; //Priority of the message being sent
|
||||
var/message = ""
|
||||
var/dpt = "" //the department which will be receiving the message
|
||||
var/priority = NORMAL_MESSAGE_PRIORITY //Priority of the message being sent. why is the default -1??
|
||||
var/obj/item/radio/Radio
|
||||
var/emergency //If an emergency has been called by this device. Acts as both a cooldown and lets the responder know where it the emergency was triggered from
|
||||
var/receive_ore_updates = FALSE //If ore redemption machines will send an update when it receives new ores.
|
||||
@@ -64,13 +64,14 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
if(stat & NOPOWER)
|
||||
set_light(0)
|
||||
else
|
||||
set_light(1.4,0.7,"#34D352")//green light
|
||||
set_light(1.4, 0.7, "#34D352")//green light
|
||||
|
||||
if(open)
|
||||
if(!hackState)
|
||||
icon_state="req_comp_open"
|
||||
else
|
||||
icon_state="req_comp_rewired"
|
||||
else if(stat & NOPOWER)
|
||||
else if(CHECK_BITFIELD(stat, NOPOWER))
|
||||
if(icon_state != "req_comp_off")
|
||||
icon_state = "req_comp_off"
|
||||
else
|
||||
@@ -121,7 +122,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
GLOB.req_console_information += department
|
||||
|
||||
Radio = new /obj/item/radio(src)
|
||||
Radio.listening = 0
|
||||
Radio.listening = FALSE
|
||||
|
||||
/obj/machinery/requests_console/Destroy()
|
||||
QDEL_NULL(Radio)
|
||||
@@ -130,164 +131,173 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
|
||||
/obj/machinery/requests_console/ui_interact(mob/user)
|
||||
. = ..()
|
||||
if(open) //no.
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
if(!open)
|
||||
switch(screen)
|
||||
if(1) //req. assistance
|
||||
dat += "Which department do you need assistance from?<BR><BR>"
|
||||
dat += "<table width='100%'>"
|
||||
for(var/dpt in GLOB.req_console_assistance)
|
||||
if (dpt != department)
|
||||
dat += "<tr>"
|
||||
dat += "<td width='55%'>[dpt]</td>"
|
||||
dat += "<td width='45%'><A href='?src=[REF(src)];write=[ckey(dpt)]'>Normal</A> <A href='?src=[REF(src)];write=[ckey(dpt)];priority=2'>High</A>"
|
||||
if(hackState)
|
||||
dat += "<A href='?src=[REF(src)];write=[ckey(dpt)];priority=3'>EXTREME</A>"
|
||||
dat += "</td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
dat += "<BR><A href='?src=[REF(src)];setScreen=0'><< Back</A><BR>"
|
||||
switch(screen)
|
||||
if(1) //req. assistance
|
||||
dat += "Which department do you need assistance from?<br><br>"
|
||||
dat += "<table width='100%'>"
|
||||
for(var/dpt in GLOB.req_console_assistance)
|
||||
if(dpt == department)
|
||||
continue
|
||||
dat += "<tr>"
|
||||
dat += "<td width='55%'>[dpt]</td>"
|
||||
dat += "<td width='45%'>"
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=1'>Normal</a>"
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=2'>High</a>"
|
||||
if(hackState)
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=3'>EXTREME</a>"
|
||||
dat += "</td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
dat += "<br><A href='?src=[REF(src)];setScreen=0'><< Back</A><br>"
|
||||
|
||||
if(2) //req. supplies
|
||||
dat += "Which department do you need supplies from?<BR><BR>"
|
||||
dat += "<table width='100%'>"
|
||||
for(var/dpt in GLOB.req_console_supplies)
|
||||
if (dpt != department)
|
||||
dat += "<tr>"
|
||||
dat += "<td width='55%'>[dpt]</td>"
|
||||
dat += "<td width='45%'><A href='?src=[REF(src)];write=[ckey(dpt)]'>Normal</A> <A href='?src=[REF(src)];write=[ckey(dpt)];priority=2'>High</A>"
|
||||
if(hackState)
|
||||
dat += "<A href='?src=[REF(src)];write=[ckey(dpt)];priority=3'>EXTREME</A>"
|
||||
dat += "</td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
dat += "<BR><A href='?src=[REF(src)];setScreen=0'><< Back</A><BR>"
|
||||
if(2) //req. supplies
|
||||
dat += "Which department do you need supplies from?<br><br>"
|
||||
dat += "<table width='100%'>"
|
||||
for(var/dpt in GLOB.req_console_supplies)
|
||||
if(dpt == department)
|
||||
continue
|
||||
|
||||
if(3) //relay information
|
||||
dat += "Which department would you like to send information to?<BR><BR>"
|
||||
dat += "<table width='100%'>"
|
||||
for(var/dpt in GLOB.req_console_information)
|
||||
if (dpt != department)
|
||||
dat += "<tr>"
|
||||
dat += "<td width='55%'>[dpt]</td>"
|
||||
dat += "<td width='45%'><A href='?src=[REF(src)];write=[ckey(dpt)]'>Normal</A> <A href='?src=[REF(src)];write=[ckey(dpt)];priority=2'>High</A>"
|
||||
if(hackState)
|
||||
dat += "<A href='?src=[REF(src)];write=[ckey(dpt)];priority=3'>EXTREME</A>"
|
||||
dat += "</td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
dat += "<BR><A href='?src=[REF(src)];setScreen=0'><< Back</A><BR>"
|
||||
dat += "<tr>"
|
||||
dat += "<td width='55%'>[dpt]</td>"
|
||||
dat += "<td width='45%'>"
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=1'>Normal</a>"
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=2'>High</a>"
|
||||
if(hackState)
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=3'>EXTREME</a>"
|
||||
dat += "</td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
dat += "<br><A href='?src=[REF(src)];setScreen=0'><< Back</A><br>"
|
||||
|
||||
if(6) //sent successfully
|
||||
dat += "<span class='good'>Message sent.</span><BR><BR>"
|
||||
dat += "<A href='?src=[REF(src)];setScreen=0'>Continue</A><BR>"
|
||||
if(3) //relay information
|
||||
dat += "Which department would you like to send information to?<br><br>"
|
||||
dat += "<table width='100%'>"
|
||||
for(var/dpt in GLOB.req_console_information)
|
||||
if(dpt == department)
|
||||
continue
|
||||
dat += "<tr>"
|
||||
dat += "<td width='55%'>[dpt]</td>"
|
||||
dat += "<td width='45%'>"
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=1'>Normal</a>"
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=2'>High</a>"
|
||||
if(hackState)
|
||||
dat += "<a href='?src=[REF(src)];write=[ckey(dpt)];priority=3'>EXTREME</a>"
|
||||
dat += "</td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
dat += "<br><a href='?src=[REF(src)];setScreen=0'><< Back</a><br>"
|
||||
|
||||
if(7) //unsuccessful; not sent
|
||||
dat += "<span class='bad'>An error occurred.</span><BR><BR>"
|
||||
dat += "<A href='?src=[REF(src)];setScreen=0'>Continue</A><BR>"
|
||||
if(6) //sent successfully
|
||||
dat += "<span class='good'>Message sent.</span><br><br>"
|
||||
dat += "<a href='?src=[REF(src)];setScreen=0'>Continue</a><br>"
|
||||
|
||||
if(8) //view messages
|
||||
for (var/obj/machinery/requests_console/Console in GLOB.allConsoles)
|
||||
if (Console.department == department)
|
||||
Console.newmessagepriority = NO_NEW_MESSAGE
|
||||
Console.update_icon()
|
||||
if(7) //unsuccessful; not sent
|
||||
dat += "<span class='bad'>An error occurred.</span><br><br>"
|
||||
dat += "<a href='?src=[REF(src)];setScreen=0'>Continue</a><br>"
|
||||
|
||||
newmessagepriority = NO_NEW_MESSAGE
|
||||
update_icon()
|
||||
var/messageComposite = ""
|
||||
for(var/msg in messages) // This puts more recent messages at the *top*, where they belong.
|
||||
messageComposite = "<div class='block'>[msg]</div>" + messageComposite
|
||||
dat += messageComposite
|
||||
dat += "<BR><A href='?src=[REF(src)];setScreen=0'><< Back to Main Menu</A><BR>"
|
||||
if(8) //view messages
|
||||
for(var/obj/machinery/requests_console/Console in GLOB.allConsoles)
|
||||
if(Console.department == department)
|
||||
Console.newmessagepriority = NO_NEW_MESSAGE
|
||||
Console.update_icon()
|
||||
|
||||
if(9) //authentication before sending
|
||||
dat += "<B>Message Authentication</B><BR><BR>"
|
||||
dat += "<b>Message for [dpt]: </b>[message]<BR><BR>"
|
||||
dat += "<div class='notice'>You may authenticate your message now by scanning your ID or your stamp</div><BR>"
|
||||
dat += "<b>Validated by:</b> [msgVerified ? msgVerified : "<i>Not Validated</i>"]<br>"
|
||||
dat += "<b>Stamped by:</b> [msgStamped ? msgStamped : "<i>Not Stamped</i>"]<br><br>"
|
||||
dat += "<A href='?src=[REF(src)];department=[dpt]'>Send Message</A><BR>"
|
||||
dat += "<BR><A href='?src=[REF(src)];setScreen=0'><< Discard Message</A><BR>"
|
||||
newmessagepriority = NO_NEW_MESSAGE
|
||||
update_icon()
|
||||
var/messageComposite = ""
|
||||
for(var/msg in messages) // This puts more recent messages at the *top*, where they belong.
|
||||
messageComposite = "<div class='block'>[msg]</div>" + messageComposite
|
||||
dat += messageComposite
|
||||
dat += "<br><a href='?src=[REF(src)];setScreen=0'><< Back to Main Menu</a><br>"
|
||||
|
||||
if(10) //send announcement
|
||||
dat += "<h3>Station-wide Announcement</h3>"
|
||||
if(announceAuth)
|
||||
dat += "<div class='notice'>Authentication accepted</div><BR>"
|
||||
else
|
||||
dat += "<div class='notice'>Swipe your card to authenticate yourself</div><BR>"
|
||||
dat += "<b>Message: </b>[message ? message : "<i>No Message</i>"]<BR>"
|
||||
dat += "<A href='?src=[REF(src)];writeAnnouncement=1'>[message ? "Edit" : "Write"] Message</A><BR><BR>"
|
||||
if ((announceAuth || IsAdminGhost(user)) && message)
|
||||
dat += "<A href='?src=[REF(src)];sendAnnouncement=1'>Announce Message</A><BR>"
|
||||
else
|
||||
dat += "<span class='linkOff'>Announce Message</span><BR>"
|
||||
dat += "<BR><A href='?src=[REF(src)];setScreen=0'><< Back</A><BR>"
|
||||
if(9) //authentication before sending
|
||||
dat += "<b>Message Authentication</b> <br><br>"
|
||||
dat += "<b>Message for [dpt]:</b> [message] <br><br>"
|
||||
dat += "<div class='notice'>You may authenticate your message now by scanning your ID or your stamp</div> <br>"
|
||||
|
||||
dat += "<b>Validated by:</b> [msgVerified ? "<span class='good'><b>[msgVerified]</b></span>" : "<i>Not Validated</i>"] <br>"
|
||||
dat += "<b>Stamped by:</b> [msgStamped ? "<span class='boldnotice'>[msgStamped]</span>" : "<i>Not Stamped</i>"] <br><br>"
|
||||
|
||||
dat += "<a href='?src=[REF(src)];department=[dpt]'>Send Message</a> <br><br>"
|
||||
dat += "<a href='?src=[REF(src)];setScreen=0'><< Discard Message</a> <br>"
|
||||
|
||||
else //main menu
|
||||
screen = 0
|
||||
announceAuth = FALSE
|
||||
if (newmessagepriority == NORMAL_MESSAGE_PRIORITY)
|
||||
dat += "<div class='notice'>There are new messages</div><BR>"
|
||||
if (newmessagepriority == HIGH_MESSAGE_PRIORITY)
|
||||
dat += "<div class='notice'>There are new <b>PRIORITY</b> messages</div><BR>"
|
||||
if (newmessagepriority == EXTREME_MESSAGE_PRIORITY)
|
||||
dat += "<div class='notice'>There are new <b>EXTREME PRIORITY</b> messages</div><BR>"
|
||||
dat += "<A href='?src=[REF(src)];setScreen=8'>View Messages</A><BR><BR>"
|
||||
if(10) //send announcement
|
||||
dat += "<h3>Station-wide Announcement</h3>"
|
||||
if(announceAuth)
|
||||
dat += "<div class='notice'>Authentication accepted</div><br>"
|
||||
else
|
||||
dat += "<div class='notice'>Swipe your card to authenticate yourself</div> <br>"
|
||||
dat += "<b>Message: </b>[message ? message : "<i>No Message</i>"] <br>"
|
||||
dat += "<a href='?src=[REF(src)];writeAnnouncement=1'>[message ? "Edit" : "Write"] Message</a> <br><br>"
|
||||
if((announceAuth || IsAdminGhost(user)) && message)
|
||||
dat += "<a href='?src=[REF(src)];sendAnnouncement=1'>Announce Message</a> <br>"
|
||||
else
|
||||
dat += "<span class='linkOff'>Announce Message</span> <br>"
|
||||
dat += "<br><a href='?src=[REF(src)];setScreen=0'><< Back</a> <br>"
|
||||
|
||||
dat += "<A href='?src=[REF(src)];setScreen=1'>Request Assistance</A><BR>"
|
||||
dat += "<A href='?src=[REF(src)];setScreen=2'>Request Supplies</A><BR>"
|
||||
dat += "<A href='?src=[REF(src)];setScreen=3'>Relay Anonymous Information</A><BR><BR>"
|
||||
else //main menu
|
||||
screen = 0
|
||||
announceAuth = FALSE
|
||||
if(newmessagepriority == NORMAL_MESSAGE_PRIORITY)
|
||||
dat += "<div class='notice'>There are new messages</div><br>"
|
||||
if(newmessagepriority == HIGH_MESSAGE_PRIORITY)
|
||||
dat += "<div class='notice'>There are new <b>PRIORITY</b> messages</div><br>"
|
||||
if(newmessagepriority == EXTREME_MESSAGE_PRIORITY)
|
||||
dat += "<div class='notice'>There are new <b>EXTREME PRIORITY</b> messages</div><br>"
|
||||
|
||||
if(!emergency)
|
||||
dat += "<A href='?src=[REF(src)];emergency=1'>Emergency: Security</A><BR>"
|
||||
dat += "<A href='?src=[REF(src)];emergency=2'>Emergency: Engineering</A><BR>"
|
||||
dat += "<A href='?src=[REF(src)];emergency=3'>Emergency: Medical</A><BR><BR>"
|
||||
else
|
||||
dat += "<B><font color='red'>[emergency] has been dispatched to this location.</font></B><BR><BR>"
|
||||
dat += "<a href='?src=[REF(src)];setScreen=8'>View Messages</a> <br><br>"
|
||||
|
||||
if(announcementConsole)
|
||||
dat += "<A href='?src=[REF(src)];setScreen=10'>Send Station-wide Announcement</A><BR><BR>"
|
||||
if (silent)
|
||||
dat += "Speaker <A href='?src=[REF(src)];setSilent=0'>OFF</A>"
|
||||
else
|
||||
dat += "Speaker <A href='?src=[REF(src)];setSilent=1'>ON</A>"
|
||||
var/datum/browser/popup = new(user, "req_console", "[department] Requests Console", 450, 440)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return
|
||||
dat += "<a href='?src=[REF(src)];setScreen=1'>Request Assistance</a> <br>"
|
||||
dat += "<a href='?src=[REF(src)];setScreen=2'>Request Supplies</a> <br>"
|
||||
dat += "<a href='?src=[REF(src)];setScreen=3'>Relay Anonymous Information</a> <br><br>"
|
||||
|
||||
if(!emergency)
|
||||
dat += "<a href='?src=[REF(src)];emergency=1'>Emergency: Security</a> <br>"
|
||||
dat += "<a href='?src=[REF(src)];emergency=2'>Emergency: Engineering</a> <br>"
|
||||
dat += "<a href='?src=[REF(src)];emergency=3'>Emergency: Medical</a> <br><br>"
|
||||
else
|
||||
dat += "<b><div class='bad'>[emergency] has been dispatched to this location.</div></b> <br><br>"
|
||||
|
||||
if(announcementConsole)
|
||||
dat += "<a href='?src=[REF(src)];setScreen=10'>Send Station-wide Announcement</a> <br><br>"
|
||||
if(silent)
|
||||
dat += "Speaker <a href='?src=[REF(src)];setSilent=0'>OFF</a>"
|
||||
else
|
||||
dat += "Speaker <a href='?src=[REF(src)];setSilent=1'>ON</a>"
|
||||
|
||||
var/datum/browser/popup = new(user, "req_console", "[department] Requests Console", 450, 440)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/requests_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
if(href_list["write"])
|
||||
dpt = ckey(reject_bad_text(href_list["write"])) //write contains the string of the receiving department's name
|
||||
var/new_message = stripped_input(usr, "Write your message:", "Awaiting Input", "", MAX_MESSAGE_LEN)
|
||||
if(new_message)
|
||||
message = new_message
|
||||
screen = 9
|
||||
if (text2num(href_list["priority"]) < 2)
|
||||
priority = -1
|
||||
else
|
||||
priority = text2num(href_list["priority"])
|
||||
priority = text2num(href_list["priority"])
|
||||
else
|
||||
dpt = "";
|
||||
msgVerified = ""
|
||||
msgStamped = ""
|
||||
screen = 0
|
||||
priority = -1
|
||||
priority = NORMAL_MESSAGE_PRIORITY //:salt:
|
||||
|
||||
if(href_list["writeAnnouncement"])
|
||||
var/new_message = reject_bad_text(stripped_input(usr, "Write your message:", "Awaiting Input", "", MAX_MESSAGE_LEN))
|
||||
if(new_message)
|
||||
message = new_message
|
||||
if (text2num(href_list["priority"]) < 2)
|
||||
priority = -1
|
||||
else
|
||||
priority = text2num(href_list["priority"])
|
||||
priority = text2num(href_list["priority"])
|
||||
else
|
||||
message = ""
|
||||
announceAuth = FALSE
|
||||
@@ -295,106 +305,116 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
|
||||
if(href_list["sendAnnouncement"])
|
||||
if(!announcementConsole)
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(isliving(usr))
|
||||
var/mob/living/L = usr
|
||||
message = L.treat_message(message)
|
||||
minor_announce(message, "[department] Announcement:")
|
||||
GLOB.news_network.SubmitArticle(message, department, "Station Announcements", null)
|
||||
usr.log_talk(message, LOG_SAY, tag="station announcement from [src]")
|
||||
usr.log_talk(message, LOG_SAY, tag = "station announcement from [src]")
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] has made a station announcement from [src] at [AREACOORD(usr)].")
|
||||
announceAuth = FALSE
|
||||
message = ""
|
||||
screen = 0
|
||||
|
||||
if(href_list["emergency"])
|
||||
if(!emergency)
|
||||
var/radio_freq
|
||||
switch(text2num(href_list["emergency"]))
|
||||
if(1) //Security
|
||||
radio_freq = FREQ_SECURITY
|
||||
emergency = "Security"
|
||||
if(2) //Engineering
|
||||
radio_freq = FREQ_ENGINEERING
|
||||
emergency = "Engineering"
|
||||
if(3) //Medical
|
||||
radio_freq = FREQ_MEDICAL
|
||||
emergency = "Medical"
|
||||
if(radio_freq)
|
||||
Radio.set_frequency(radio_freq)
|
||||
Radio.talk_into(src,"[emergency] emergency in [department]!!",radio_freq)
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/clear_emergency), 3000)
|
||||
if(emergency) //already has an emergency? do not continue
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if( href_list["department"] && message )
|
||||
var/log_msg = message
|
||||
var/radio_freq
|
||||
switch(text2num(href_list["emergency"]))
|
||||
if(1) //Security
|
||||
radio_freq = FREQ_SECURITY
|
||||
emergency = "Security"
|
||||
if(2) //Engineering
|
||||
radio_freq = FREQ_ENGINEERING
|
||||
emergency = "Engineering"
|
||||
if(3) //Medical
|
||||
radio_freq = FREQ_MEDICAL
|
||||
emergency = "Medical"
|
||||
if(radio_freq)
|
||||
Radio.set_frequency(radio_freq)
|
||||
Radio.talk_into(src, "[emergency] emergency in [department]!!", radio_freq)
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/clear_emergency), 5 MINUTES)
|
||||
|
||||
if(href_list["department"] && message)
|
||||
var/sending = message
|
||||
sending += "<br>"
|
||||
if (msgVerified)
|
||||
sending += msgVerified
|
||||
sending += "<br>"
|
||||
if (msgStamped)
|
||||
sending += msgStamped
|
||||
sending += "<br>"
|
||||
screen = 7 //if it's successful, this will get overrwritten (7 = unsufccessfull, 6 = successfull)
|
||||
if (sending)
|
||||
var/pass = FALSE
|
||||
var/datum/data_rc_msg/log = new(href_list["department"], department, log_msg, msgStamped, msgVerified, priority)
|
||||
for (var/obj/machinery/telecomms/message_server/MS in GLOB.telecomms_list)
|
||||
if (MS.toggled)
|
||||
MS.rc_msgs += log
|
||||
pass = TRUE
|
||||
if(msgVerified)
|
||||
sending += "<span class='good'><b>[msgVerified]</b></span> <br>"
|
||||
if(msgStamped)
|
||||
sending += "<span class='boldnotice'>[msgStamped]</span> <br>"
|
||||
//so you're telling me is you cheated, by making fail happen, then quickly replacing it with 6
|
||||
|
||||
if(pass)
|
||||
var/radio_freq = 0
|
||||
switch(href_list["department"])
|
||||
if("bridge")
|
||||
radio_freq = FREQ_COMMAND
|
||||
if("medbay")
|
||||
radio_freq = FREQ_MEDICAL
|
||||
if("science")
|
||||
radio_freq = FREQ_SCIENCE
|
||||
if("engineering")
|
||||
radio_freq = FREQ_ENGINEERING
|
||||
if("security")
|
||||
radio_freq = FREQ_SECURITY
|
||||
if("cargobay" || "mining")
|
||||
radio_freq = FREQ_SUPPLY
|
||||
Radio.set_frequency(radio_freq)
|
||||
var/authentic
|
||||
if(msgVerified || msgStamped)
|
||||
authentic = " (Authenticated)"
|
||||
var/workingServer = FALSE
|
||||
var/datum/data_rc_msg/log = new(href_list["department"], department, message, msgStamped, msgVerified, priority)
|
||||
for(var/obj/machinery/telecomms/message_server/MS in GLOB.telecomms_list)
|
||||
if(MS.on) //on does the calculations. why would this server still work even though the apc is off??
|
||||
LAZYADD(MS.rc_msgs, log)
|
||||
workingServer = TRUE
|
||||
|
||||
var/alert = ""
|
||||
for (var/obj/machinery/requests_console/Console in GLOB.allConsoles)
|
||||
if (ckey(Console.department) == ckey(href_list["department"]))
|
||||
switch(priority)
|
||||
if(2) //High priority
|
||||
alert = "PRIORITY Alert in [department][authentic]"
|
||||
Console.createmessage(src, alert, sending, 2, 1)
|
||||
if(3) // Extreme Priority
|
||||
alert = "EXTREME PRIORITY Alert from [department][authentic]"
|
||||
Console.createmessage(src, alert , sending, 3, 1)
|
||||
else // Normal priority
|
||||
alert = "Message from [department][authentic]"
|
||||
Console.createmessage(src, alert , sending, 1, 1)
|
||||
screen = 6
|
||||
if(!workingServer)
|
||||
screen = 7
|
||||
say("NOTICE: No server detected! Please contact your local engineering team.")
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(radio_freq)
|
||||
Radio.talk_into(src, "[alert]: <i>[message]</i>", radio_freq)
|
||||
var/radio_freq = 0
|
||||
switch(href_list["department"])
|
||||
if("bridge")
|
||||
radio_freq = FREQ_COMMAND
|
||||
if("medbay")
|
||||
radio_freq = FREQ_MEDICAL
|
||||
if("science")
|
||||
radio_freq = FREQ_SCIENCE
|
||||
if("engineering")
|
||||
radio_freq = FREQ_ENGINEERING
|
||||
if("security")
|
||||
radio_freq = FREQ_SECURITY
|
||||
if("cargobay" || "mining")
|
||||
radio_freq = FREQ_SUPPLY
|
||||
Radio.set_frequency(radio_freq)
|
||||
|
||||
switch(priority)
|
||||
if(2)
|
||||
messages += "<span class='bad'>High Priority</span><BR><b>To:</b> [dpt]<BR>[sending]"
|
||||
else
|
||||
messages += "<b>To: [dpt]</b><BR>[sending]"
|
||||
var/authentic = ""
|
||||
if(msgVerified || msgStamped)
|
||||
authentic = " (Authenticated)"
|
||||
|
||||
var/alert = ""
|
||||
for(var/obj/machinery/requests_console/C in GLOB.allConsoles)
|
||||
if(ckey(C.department) != ckey(href_list["department"]))
|
||||
continue
|
||||
switch(priority)
|
||||
if(HIGH_MESSAGE_PRIORITY) //High priority
|
||||
alert = "PRIORITY Alert from [department][authentic]"
|
||||
C.createmessage(src, alert, sending, HIGH_MESSAGE_PRIORITY)
|
||||
if(EXTREME_MESSAGE_PRIORITY) // Extreme Priority
|
||||
alert = "EXTREME PRIORITY Alert from [department][authentic]"
|
||||
C.createmessage(src, alert, sending, EXTREME_MESSAGE_PRIORITY)
|
||||
else // Normal priority
|
||||
alert = "Message from [department][authentic]"
|
||||
C.createmessage(src, alert, sending, NORMAL_MESSAGE_PRIORITY)
|
||||
screen = 6 //if it ever gets here that means (c.department == href_ls["dept"])
|
||||
|
||||
if(radio_freq)
|
||||
Radio.talk_into(src, "[alert]: <i>[message]</i>", radio_freq)
|
||||
//log to (this)
|
||||
switch(priority)
|
||||
if(HIGH_MESSAGE_PRIORITY)
|
||||
messages += "<span class='bad'>High Priority</span><br><b>To:</b> [dpt]<br>[sending]"
|
||||
if(EXTREME_MESSAGE_PRIORITY)
|
||||
messages += "<span class='bad'>!!!Extreme Priority!!!</span><br><b>To:</b> [dpt]<br>[sending]"
|
||||
else
|
||||
say("NOTICE: No server detected!")
|
||||
messages += "<b>To:</b> [dpt]<br>[sending]"
|
||||
|
||||
|
||||
//Handle screen switching
|
||||
switch(text2num(href_list["setScreen"]))
|
||||
if(null) //skip
|
||||
updateUsrDialog()
|
||||
return
|
||||
if(1) //req. assistance
|
||||
screen = 1
|
||||
if(2) //req. supplies
|
||||
@@ -422,16 +442,14 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
msgVerified = ""
|
||||
msgStamped = ""
|
||||
message = ""
|
||||
priority = -1
|
||||
priority = NORMAL_MESSAGE_PRIORITY // :salt:
|
||||
screen = 0
|
||||
|
||||
//Handle silencing the console
|
||||
switch( href_list["setSilent"] )
|
||||
if(null) //skip
|
||||
if("1")
|
||||
silent = TRUE
|
||||
else
|
||||
silent = FALSE
|
||||
if(href_list["setSilent"] == "1")
|
||||
silent = TRUE
|
||||
else
|
||||
silent = FALSE
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -456,32 +474,32 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
linkedsender = source
|
||||
capitalize(title)
|
||||
switch(priority)
|
||||
if(2) //High priority
|
||||
if(HIGH_MESSAGE_PRIORITY) //High priority
|
||||
if(newmessagepriority < HIGH_MESSAGE_PRIORITY)
|
||||
newmessagepriority = HIGH_MESSAGE_PRIORITY
|
||||
update_icon()
|
||||
if(!silent)
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
say(title)
|
||||
messages += "<span class='bad'>High Priority</span><BR><b>From:</b> [linkedsender]<BR>[message]"
|
||||
messages += "<span class='bad'>High Priority</span><br><b>From:</b> [linkedsender]<br>[message]" //the fuck is this not being sent
|
||||
|
||||
if(3) // Extreme Priority
|
||||
if(EXTREME_MESSAGE_PRIORITY) // Extreme Priority
|
||||
if(newmessagepriority < EXTREME_MESSAGE_PRIORITY)
|
||||
newmessagepriority = EXTREME_MESSAGE_PRIORITY
|
||||
update_icon()
|
||||
if(1)
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
say(title)
|
||||
messages += "<span class='bad'>!!!Extreme Priority!!!</span><BR><b>From:</b> [linkedsender]<BR>[message]"
|
||||
//we ignore the silent option because this is !!!IMPORTANT!!!
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
say(title)
|
||||
messages += "<span class='bad'><b>!!!Extreme Priority!!!</span></b><br><b>From:</b> [linkedsender]<br>[message]"
|
||||
|
||||
else // Normal priority
|
||||
if(newmessagepriority < NORMAL_MESSAGE_PRIORITY)
|
||||
newmessagepriority = NORMAL_MESSAGE_PRIORITY
|
||||
update_icon()
|
||||
if(!src.silent)
|
||||
if(!silent)
|
||||
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
||||
say(title)
|
||||
messages += "<b>From:</b> [linkedsender]<BR>[message]"
|
||||
messages += "<b>From:</b> [linkedsender]<br>[message]"
|
||||
|
||||
/obj/machinery/requests_console/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/crowbar))
|
||||
@@ -505,23 +523,26 @@ GLOBAL_LIST_EMPTY(allConsoles)
|
||||
to_chat(user, "<span class='warning'>You must open the maintenance panel first!</span>")
|
||||
return
|
||||
|
||||
var/obj/item/card/id/ID = O.GetID()
|
||||
if(ID)
|
||||
if(istype(O, /obj/item/card/id))
|
||||
var/obj/item/card/id/ID = O.GetID()
|
||||
if(!ID)
|
||||
return
|
||||
if(screen == 9)
|
||||
msgVerified = "<font color='green'><b>Verified by [ID.registered_name] ([ID.assignment])</b></font>"
|
||||
msgVerified = "Verified by [ID.registered_name] ([ID.assignment])"
|
||||
updateUsrDialog()
|
||||
if(screen == 10)
|
||||
if (ACCESS_RC_ANNOUNCE in ID.access)
|
||||
if(ACCESS_RC_ANNOUNCE in ID.access)
|
||||
announceAuth = TRUE
|
||||
else
|
||||
announceAuth = FALSE
|
||||
to_chat(user, "<span class='warning'>You are not authorized to send announcements!</span>")
|
||||
updateUsrDialog()
|
||||
return
|
||||
if (istype(O, /obj/item/stamp))
|
||||
|
||||
if(istype(O, /obj/item/stamp))
|
||||
if(screen == 9)
|
||||
var/obj/item/stamp/T = O
|
||||
msgStamped = "<span class='boldnotice'>Stamped with the [T.name]</span>"
|
||||
msgStamped = "Stamped with the [T.name]"
|
||||
updateUsrDialog()
|
||||
return
|
||||
return ..()
|
||||
|
||||
@@ -1,215 +1,164 @@
|
||||
|
||||
/*
|
||||
The log console for viewing the entire telecomms
|
||||
network log
|
||||
*/
|
||||
|
||||
/obj/machinery/computer/telecomms/server
|
||||
name = "telecommunications server monitoring console"
|
||||
icon_screen = "comm_logs"
|
||||
desc = "Has full access to all details and record of the telecommunications network it's monitoring."
|
||||
circuit = /obj/item/circuitboard/computer/comm_server
|
||||
req_access = list(ACCESS_TCOMSAT)
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/servers = list() // the servers located by the computer
|
||||
var/obj/machinery/telecomms/server/SelectedServer
|
||||
var/list/machinelist = list() // the servers located by the computer
|
||||
var/obj/machinery/telecomms/server/SelectedMachine = null
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
var/temp = "" // temporary feedback messages
|
||||
var/notice = ""
|
||||
var/universal_translate = FALSE // set to TRUE(1) if it can translate nonhuman speech
|
||||
|
||||
var/universal_translate = 0 // set to 1 if it can translate nonhuman speech
|
||||
/obj/machinery/computer/telecomms/server/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tcommsserver", "Telecomms Server Monitor", 575, 400, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
req_access = list(ACCESS_TCOMSAT)
|
||||
circuit = /obj/item/circuitboard/computer/comm_server
|
||||
/obj/machinery/computer/telecomms/server/ui_data(mob/user)
|
||||
var/list/data_out = list()
|
||||
data_out["network"] = network
|
||||
data_out["notice"] = notice
|
||||
|
||||
/obj/machinery/computer/telecomms/server/ui_interact(mob/user)
|
||||
. = ..()
|
||||
var/dat = "<TITLE>Telecommunication Server Monitor</TITLE><center><b>Telecommunications Server Monitor</b></center>"
|
||||
data_out["servers"] = list()
|
||||
for(var/obj/machinery/telecomms/server/T in machinelist)
|
||||
var/list/data = list(
|
||||
name = T.name,
|
||||
id = T.id,
|
||||
ref = REF(T)
|
||||
)
|
||||
data_out["servers"] += list(data)
|
||||
data_out["servers"] = sortList(data_out["servers"]) //a-z sort
|
||||
|
||||
switch(screen)
|
||||
if(!SelectedMachine) //null is bad.
|
||||
data_out["selected"] = null //but in js, null is good.
|
||||
return data_out
|
||||
|
||||
data_out["selected"] = list(
|
||||
name = SelectedMachine.name,
|
||||
id = SelectedMachine.id,
|
||||
status = SelectedMachine.on,
|
||||
traffic = SelectedMachine.totaltraffic, //note: total traffic, not traffic!
|
||||
ref = REF(SelectedMachine)
|
||||
)
|
||||
data_out["selected_logs"] = list()
|
||||
|
||||
// --- Main Menu ---
|
||||
if(!LAZYLEN(SelectedMachine.log_entries))
|
||||
return data_out
|
||||
|
||||
for(var/datum/comm_log_entry/C in SelectedMachine.log_entries)
|
||||
var/list/data = list()
|
||||
data["name"] = C.name //name of the file
|
||||
data["ref"] = REF(C)
|
||||
data["input_type"] = C.input_type //type of input ("Speech File" | "Execution Error").
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<br>Current Network: <a href='?src=[REF(src)];network=1'>[network]</a><br>"
|
||||
if(servers.len)
|
||||
dat += "<br>Detected Telecommunication Servers:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
dat += "<li><a href='?src=[REF(src)];viewserver=[T.id]'>[REF(T)] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=[REF(src)];operation=release'>\[Flush Buffer\]</a>"
|
||||
if(C.input_type == "Speech File") //there is a reason why this is not a switch.
|
||||
data["source"] = list(
|
||||
name = C.parameters["name"], //name of the mob | obj
|
||||
job = C.parameters["job"] //job of the mob | obj
|
||||
)
|
||||
|
||||
// -- Determine race of orator --
|
||||
var/mobtype = C.parameters["mobtype"]
|
||||
var/race // The actual race of the mob
|
||||
|
||||
if(ispath(mobtype, /mob/living/carbon/human) || ispath(mobtype, /mob/living/brain))
|
||||
race = "Humanoid"
|
||||
else if(ispath(mobtype, /mob/living/simple_animal/slime))
|
||||
race = "Slime" // NT knows a lot about slimes, but not aliens. Can identify slimes
|
||||
else if(ispath(mobtype, /mob/living/carbon/monkey))
|
||||
race = "Monkey"
|
||||
else if(ispath(mobtype, /mob/living/silicon) || C.parameters["job"] == "AI")
|
||||
race = "Artificial Life" // sometimes M gets deleted prematurely for AIs... just check the job
|
||||
else if(isobj(mobtype))
|
||||
race = "Machinery"
|
||||
else if(ispath(mobtype, /mob/living/simple_animal))
|
||||
race = "Domestic Animal"
|
||||
else
|
||||
dat += "<br>No servers detected. Scan for servers: <a href='?src=[REF(src)];operation=scan'>\[Scan\]</a>"
|
||||
race = "Unidentifiable"
|
||||
|
||||
data["race"] = race
|
||||
// based on [/atom/movable/proc/lang_treat]
|
||||
var/message = C.parameters["message"]
|
||||
var/language = C.parameters["language"]
|
||||
|
||||
// --- Viewing Server ---
|
||||
if(universal_translate || user.has_language(language))
|
||||
message = message
|
||||
else if(!user.has_language(language))
|
||||
var/datum/language/D = GLOB.language_datum_instances[language]
|
||||
message = D.scramble(message)
|
||||
else if(language)
|
||||
message = "(unintelligible)"
|
||||
|
||||
if(1)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=[REF(src)];operation=mainmenu'>\[Main Menu\]</a> <a href='?src=[REF(src)];operation=refresh'>\[Refresh\]</a></center>"
|
||||
dat += "<br>Current Network: [network]"
|
||||
dat += "<br>Selected Server: [SelectedServer.id]"
|
||||
data["message"] = message
|
||||
|
||||
if(SelectedServer.totaltraffic >= 1024)
|
||||
dat += "<br>Total recorded traffic: [round(SelectedServer.totaltraffic / 1024)] Terrabytes<br><br>"
|
||||
else
|
||||
dat += "<br>Total recorded traffic: [SelectedServer.totaltraffic] Gigabytes<br><br>"
|
||||
else if(C.input_type == "Execution Error")
|
||||
data["message"] = C.parameters["message"]
|
||||
else
|
||||
data["message"] = "(unintelligible)"
|
||||
|
||||
data_out["selected_logs"] += list(data)
|
||||
return data_out
|
||||
|
||||
dat += "Stored Logs: <ol>"
|
||||
|
||||
var/i = 0
|
||||
for(var/datum/comm_log_entry/C in SelectedServer.log_entries)
|
||||
i++
|
||||
|
||||
|
||||
// If the log is a speech file
|
||||
if(C.input_type == "Speech File")
|
||||
dat += "<li><font color = #008F00>[C.name]</font> <font color = #FF0000><a href='?src=[REF(src)];delete=[i]'>\[X\]</a></font><br>"
|
||||
|
||||
// -- Determine race of orator --
|
||||
|
||||
var/mobtype = C.parameters["mobtype"]
|
||||
var/race // The actual race of the mob
|
||||
|
||||
if(ispath(mobtype, /mob/living/carbon/human) || ispath(mobtype, /mob/living/brain))
|
||||
race = "Humanoid"
|
||||
|
||||
// NT knows a lot about slimes, but not aliens. Can identify slimes
|
||||
else if(ispath(mobtype, /mob/living/simple_animal/slime))
|
||||
race = "Slime"
|
||||
|
||||
else if(ispath(mobtype, /mob/living/carbon/monkey))
|
||||
race = "Monkey"
|
||||
|
||||
// sometimes M gets deleted prematurely for AIs... just check the job
|
||||
else if(ispath(mobtype, /mob/living/silicon) || C.parameters["job"] == "AI")
|
||||
race = "Artificial Life"
|
||||
|
||||
else if(isobj(mobtype))
|
||||
race = "Machinery"
|
||||
|
||||
else if(ispath(mobtype, ))
|
||||
race = "Domestic Animal"
|
||||
|
||||
else
|
||||
race = "<i>Unidentifiable</i>"
|
||||
|
||||
dat += "<u><font color = #18743E>Data type</font></u>: [C.input_type]<br>"
|
||||
dat += "<u><font color = #18743E>Source</font></u>: [C.parameters["name"]] (Job: [C.parameters["job"]])<br>"
|
||||
dat += "<u><font color = #18743E>Class</font></u>: [race]<br>"
|
||||
var/message = C.parameters["message"]
|
||||
var/language = C.parameters["language"]
|
||||
|
||||
// based on [/atom/movable/proc/lang_treat]
|
||||
if (universal_translate || user.has_language(language))
|
||||
message = "\"[message]\""
|
||||
else if (!user.has_language(language))
|
||||
var/datum/language/D = GLOB.language_datum_instances[language]
|
||||
message = "\"[D.scramble(message)]\""
|
||||
else if (language)
|
||||
message = "<i>(unintelligible)</i>"
|
||||
|
||||
dat += "<u><font color = #18743E>Contents</font></u>: [message]<br>"
|
||||
dat += "</li><br>"
|
||||
|
||||
else if(C.input_type == "Execution Error")
|
||||
dat += "<li><font color = #990000>[C.name]</font> <a href='?src=[REF(src)];delete=[i]'>\[X\]</a><br>"
|
||||
dat += "<u><font color = #787700>Error</font></u>: \"[C.parameters["message"]]\"<br>"
|
||||
dat += "</li><br>"
|
||||
|
||||
else
|
||||
dat += "<li><font color = #000099>[C.name]</font> <a href='?src=[REF(src)];delete=[i]'>\[X\]</a><br>"
|
||||
dat += "<u><font color = #18743E>Data type</font></u>: [C.input_type]<br>"
|
||||
dat += "<u><font color = #18743E>Contents</font></u>: <i>(unintelligible)</i><br>"
|
||||
dat += "</li><br>"
|
||||
|
||||
|
||||
dat += "</ol>"
|
||||
|
||||
|
||||
|
||||
user << browse(dat, "window=comm_monitor;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/server/Topic(href, href_list)
|
||||
/obj/machinery/computer/telecomms/server/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["viewserver"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
if(T.id == href_list["viewserver"])
|
||||
SelectedServer = T
|
||||
break
|
||||
|
||||
if(href_list["operation"])
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
servers = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("scan")
|
||||
if(servers.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/server/T in urange(25, src))
|
||||
if(T.network == network)
|
||||
servers.Add(T)
|
||||
|
||||
if(!servers.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [servers.len] SERVERS PROBED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
if(href_list["delete"])
|
||||
|
||||
if(!src.allowed(usr) && !(obj_flags & EMAGGED))
|
||||
to_chat(usr, "<span class='danger'>ACCESS DENIED.</span>")
|
||||
switch(action)
|
||||
if("mainmenu")
|
||||
SelectedMachine = null
|
||||
notice = ""
|
||||
return
|
||||
if("release")
|
||||
machinelist = list()
|
||||
notice = ""
|
||||
return
|
||||
if("network") //network change, flush the selected machine and buffer
|
||||
var/newnet = sanitize(sanitize_text(params["value"], network))
|
||||
if(length(newnet) > 15) //i'm looking at you, you href fuckers
|
||||
notice = "FAILED: Network tag string too lengthy"
|
||||
return
|
||||
network = newnet
|
||||
SelectedMachine = null
|
||||
machinelist = list()
|
||||
return
|
||||
if("probe")
|
||||
if(LAZYLEN(machinelist) > 0)
|
||||
notice = "FAILED: Cannot probe when buffer full"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/telecomms/T in GLOB.telecomms_list) //telecomms just went global!
|
||||
if(T.network == network)
|
||||
LAZYADD(machinelist, T)
|
||||
|
||||
if(SelectedServer)
|
||||
if(!LAZYLEN(machinelist))
|
||||
notice = "FAILED: Unable to locate network entities in \[[network]\]"
|
||||
return
|
||||
if("viewmachine")
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
if(T.id == params["value"])
|
||||
SelectedMachine = T
|
||||
break
|
||||
if("delete")
|
||||
if(!src.allowed(usr) && !CHECK_BITFIELD(obj_flags, EMAGGED))
|
||||
to_chat(usr, "<span class='danger'>ACCESS DENIED.</span>")
|
||||
return
|
||||
|
||||
var/datum/comm_log_entry/D = SelectedServer.log_entries[text2num(href_list["delete"])]
|
||||
|
||||
temp = "<font color = #336699>- DELETED ENTRY: [D.name] -</font color>"
|
||||
|
||||
SelectedServer.log_entries.Remove(D)
|
||||
if(!SelectedMachine)
|
||||
notice = "ALERT: No server detected. Server may be nonresponsive."
|
||||
return
|
||||
var/datum/comm_log_entry/D = locate(params["value"])
|
||||
if(!istype(D))
|
||||
notice = "NOTICE: Object not found"
|
||||
return
|
||||
notice = "Deleted entry: [D.name]"
|
||||
LAZYREMOVE(SelectedMachine.log_entries, D)
|
||||
qdel(D)
|
||||
|
||||
else
|
||||
temp = "<font color = #D70B00>- FAILED: NO SELECTED MACHINE -</font color>"
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
|
||||
if(newnet && ((usr in range(1, src)) || issilicon(usr)))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
|
||||
network = newnet
|
||||
screen = 0
|
||||
servers = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/server/attackby()
|
||||
. = ..()
|
||||
updateUsrDialog()
|
||||
@@ -3,239 +3,360 @@
|
||||
Lets you read PDA and request console messages.
|
||||
*/
|
||||
|
||||
#define LINKED_SERVER_NONRESPONSIVE (!linkedServer || (linkedServer.stat & (NOPOWER|BROKEN)))
|
||||
|
||||
// The monitor itself.
|
||||
/obj/machinery/computer/message_monitor
|
||||
name = "message monitor console"
|
||||
desc = "Used to monitor the crew's PDA messages, as well as request console messages."
|
||||
icon_screen = "comm_logs"
|
||||
circuit = /obj/item/circuitboard/computer/message_monitor
|
||||
//Server linked to.
|
||||
|
||||
//Servers, and server linked to.
|
||||
var/network = "tcommsat" // the network to probe
|
||||
var/list/machinelist = list() // the servers located by the computer
|
||||
var/obj/machinery/telecomms/message_server/linkedServer = null
|
||||
|
||||
//Sparks effect - For emag
|
||||
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
|
||||
|
||||
//Messages - Saves me time if I want to change something.
|
||||
var/noserver = "<span class='alert'>ALERT: No server detected.</span>"
|
||||
var/incorrectkey = "<span class='warning'>ALERT: Incorrect decryption key!</span>"
|
||||
var/defaultmsg = "<span class='notice'>Welcome. Please select an option.</span>"
|
||||
var/rebootmsg = "<span class='warning'>%$&(�: Critical %$$@ Error // !RestArting! <lOadiNg backUp iNput ouTput> - ?pLeaSe wAit!</span>"
|
||||
var/noserver = "ALERT: No server detected. Server may be nonresponsive."
|
||||
var/incorrectkey = "ALERT: Incorrect decryption key!"
|
||||
var/rebootmsg = "%$�(�:SYS&EM INTRN@L ACfES VIOL�TIa█ DEtE₡TED! Ree3ARcinG A█ BAaKUP RdST�RE PbINT \[0xcff32ca/ - PLfASE aAIT"
|
||||
|
||||
//Computer properties
|
||||
var/screen = 0 // 0 = Main menu, 1 = Message Logs, 2 = Hacked screen, 3 = Custom Message
|
||||
var/hacking = FALSE // Is it being hacked into by the AI/Cyborg
|
||||
var/message = "<span class='notice'>System bootup complete. Please select an option.</span>" // The message that shows on the main menu.
|
||||
var/auth = FALSE // Are they authenticated?
|
||||
var/optioncount = 7
|
||||
var/message = "" // The message that shows on the main menu.
|
||||
var/auth = FALSE // Are they authenticated?
|
||||
|
||||
// Custom Message Properties
|
||||
var/customsender = "System Administrator"
|
||||
var/obj/item/pda/customrecepient = null
|
||||
var/customsender = "System Administrator"
|
||||
var/customjob = "Admin"
|
||||
var/custommessage = "This is a test, please ignore."
|
||||
|
||||
light_color = LIGHT_COLOR_GREEN
|
||||
|
||||
/obj/machinery/computer/message_monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE,\
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "telepdalog", name, 727, 510, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/message_monitor/ui_static_data(mob/user)
|
||||
var/list/data_out = list()
|
||||
|
||||
if(!linkedServer || !auth) // no need building this if the usr isn't authenticated
|
||||
return data_out
|
||||
|
||||
data_out["recon_logs"] = list()
|
||||
var/i1 = 0
|
||||
for(var/datum/data_rc_msg/rc in linkedServer.rc_msgs)
|
||||
i1++
|
||||
if(i1 > 3000)
|
||||
break
|
||||
var/list/data = list(
|
||||
sender = rc.send_dpt,
|
||||
recipient = rc.rec_dpt,
|
||||
message = rc.message,
|
||||
stamp = rc.stamp,
|
||||
auth = rc.id_auth,
|
||||
priority = rc.priority,
|
||||
ref = REF(rc)
|
||||
)
|
||||
data_out["recon_logs"] += list(data)
|
||||
|
||||
data_out["message_logs"] = list()
|
||||
var/i2 = 0
|
||||
for(var/datum/data_pda_msg/pda in linkedServer.pda_msgs)
|
||||
i2++
|
||||
if(i2 > 3000)
|
||||
break
|
||||
var/list/data = list(
|
||||
sender = pda.sender,
|
||||
recipient = pda.recipient,
|
||||
message = pda.message,
|
||||
picture = pda.picture ? TRUE : FALSE,
|
||||
ref = REF(pda)
|
||||
)
|
||||
data_out["message_logs"] += list(data)
|
||||
|
||||
return data_out
|
||||
|
||||
/obj/machinery/computer/message_monitor/ui_data(mob/user)
|
||||
var/list/data_out = list()
|
||||
|
||||
data_out["notice"] = message
|
||||
data_out["authenticated"] = auth
|
||||
data_out["network"] = network
|
||||
|
||||
var/mob/living/silicon/S = user
|
||||
if(istype(S) && S.hack_software)
|
||||
data_out["canhack"] = TRUE
|
||||
|
||||
data_out["hacking"] = (hacking || CHECK_BITFIELD(obj_flags, EMAGGED))
|
||||
if(hacking)
|
||||
data_out["borg"] = ((isAI(user) || iscyborg(user)) && !CHECK_BITFIELD(obj_flags, EMAGGED)) //even borgs can't read emag
|
||||
return data_out
|
||||
|
||||
data_out["servers"] = list()
|
||||
for(var/obj/machinery/telecomms/message_server/T in machinelist)
|
||||
var/list/data = list(
|
||||
name = T.name,
|
||||
id = T.id,
|
||||
ref = REF(T)
|
||||
)
|
||||
data_out["servers"] += list(data) // This /might/ cause an oom. Too bad!
|
||||
data_out["servers"] = sortList(data_out["servers"]) //a-z sort
|
||||
|
||||
data_out["fake_message"] = list(
|
||||
sender = customsender,
|
||||
job = customjob,
|
||||
message = custommessage,
|
||||
recepient = (customrecepient ? "[customrecepient.owner] ([customrecepient.ownjob])" : null)
|
||||
)
|
||||
|
||||
if(!linkedServer)
|
||||
data_out["selected"] = null
|
||||
return data_out
|
||||
|
||||
data_out["selected"] = list(
|
||||
name = linkedServer.name,
|
||||
id = linkedServer.id,
|
||||
ref = REF(linkedServer),
|
||||
status = (linkedServer.on && (linkedServer.toggled != FALSE)) // returns true if server is running
|
||||
)
|
||||
return data_out
|
||||
|
||||
/obj/machinery/computer/message_monitor/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("mainmenu") //deselect
|
||||
linkedServer = null
|
||||
auth = FALSE
|
||||
message = ""
|
||||
return
|
||||
if("release") //release server listing
|
||||
machinelist = list()
|
||||
message = ""
|
||||
return
|
||||
if("network") //network change, flush the selected machine and buffer, and de-auth them, if blank, return default
|
||||
var/newnet = sanitize(sanitize_text(params["value"], network))
|
||||
if(length(newnet) > 15) //i'm looking at you, you href fuckers
|
||||
message = "FAILED: Network tag string too lengthy"
|
||||
return
|
||||
network = newnet
|
||||
linkedServer = null
|
||||
machinelist = list()
|
||||
auth = FALSE
|
||||
message = "NOTICE: Network change detected. Server disconnected, please re-authenticate."
|
||||
return
|
||||
if("probe") //probe network for the pda serbs
|
||||
if(LAZYLEN(machinelist) > 0)
|
||||
message = "FAILED: Cannot probe when buffer full"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/telecomms/message_server/T in GLOB.telecomms_list)
|
||||
if(T.network == network)
|
||||
LAZYADD(machinelist, T)
|
||||
|
||||
if(!LAZYLEN(machinelist))
|
||||
message = "FAILED: Unable to locate network entities in \[[network]\]"
|
||||
return
|
||||
if("viewmachine") //selected but not authorized
|
||||
for(var/obj/machinery/telecomms/message_server/T in machinelist)
|
||||
if(T.id == params["value"])
|
||||
linkedServer = T
|
||||
break
|
||||
|
||||
if("auth")
|
||||
if(!(linkedServer.on && (linkedServer.toggled != FALSE)))
|
||||
message = noserver
|
||||
return
|
||||
if(auth)
|
||||
auth = FALSE
|
||||
update_static_data(usr) //make sure it's cleared!
|
||||
return
|
||||
var/dkey = stripped_input(usr, "Please enter the decryption key.")
|
||||
if(dkey && dkey == "")
|
||||
return
|
||||
if(linkedServer.decryptkey == dkey)
|
||||
auth = TRUE
|
||||
else
|
||||
message = incorrectkey
|
||||
update_static_data(usr)
|
||||
if("change_auth")
|
||||
if(!auth)
|
||||
message = "WARNING: Auth failed! Please log in to change the password!"
|
||||
return
|
||||
else if(!(linkedServer.on && (linkedServer.toggled != FALSE)))
|
||||
message = noserver
|
||||
return
|
||||
|
||||
var/dkey = stripped_input(usr, "Please enter the old decryption key.")
|
||||
if(dkey && dkey != "")
|
||||
if(linkedServer.decryptkey == dkey)
|
||||
var/newkey = stripped_input(usr, "Please enter the new key (3 - 20 characters max):")
|
||||
if(!ISINRANGE(length(newkey), 3, 20))
|
||||
message = "NOTICE: Decryption key length too long/short!"
|
||||
return
|
||||
if(newkey && newkey != "")
|
||||
linkedServer.decryptkey = newkey
|
||||
message = "NOTICE: Decryption key set."
|
||||
return
|
||||
message = incorrectkey
|
||||
|
||||
if("hack")
|
||||
if(!(linkedServer.on && (linkedServer.toggled != FALSE)))
|
||||
message = noserver
|
||||
return
|
||||
|
||||
var/mob/living/silicon/S = usr
|
||||
if(istype(S) && S.hack_software)
|
||||
hacking = TRUE
|
||||
//Time it takes to bruteforce is dependant on the password length.
|
||||
addtimer(CALLBACK(src, .proc/BruteForce, usr), (10 SECONDS) * length(linkedServer.decryptkey))
|
||||
|
||||
if("del_log")
|
||||
if(!auth)
|
||||
message = "WARNING: Auth failed! Delete aborted!"
|
||||
return
|
||||
else if(!(linkedServer.on && (linkedServer.toggled != FALSE)))
|
||||
message = noserver
|
||||
return
|
||||
|
||||
var/datum/data_ref = locate(params["ref"])
|
||||
if(istype(data_ref, /datum/data_rc_msg))
|
||||
LAZYREMOVE(linkedServer.rc_msgs, data_ref)
|
||||
message = "NOTICE: Log Deleted!"
|
||||
else if(istype(data_ref, /datum/data_pda_msg))
|
||||
LAZYREMOVE(linkedServer.pda_msgs, data_ref)
|
||||
message = "NOTICE: Log Deleted!"
|
||||
else
|
||||
message = "NOTICE: Log not found! It may have already been deleted"
|
||||
update_static_data(usr)
|
||||
|
||||
if("clear_log")
|
||||
if(!auth)
|
||||
message = "WARNING: Auth failed! Delete aborted!"
|
||||
return
|
||||
else if(!(linkedServer.on && (linkedServer.toggled != FALSE)))
|
||||
message = noserver
|
||||
return
|
||||
|
||||
var/what = params["value"]
|
||||
if(what == "pda_logs")
|
||||
linkedServer.pda_msgs = list()
|
||||
if(what == "rc_msgs")
|
||||
linkedServer.rc_msgs = list()
|
||||
update_static_data(usr)
|
||||
if("fake")
|
||||
if(!auth)
|
||||
message = "WARNING: Auth failed!"
|
||||
return
|
||||
else if(!(linkedServer.on && (linkedServer.toggled != FALSE)))
|
||||
message = noserver
|
||||
return
|
||||
|
||||
if("reset" in params)
|
||||
ResetMessage()
|
||||
return
|
||||
if("send" in params)
|
||||
if(isnull(customrecepient))
|
||||
message = "NOTICE: No recepient selected!"
|
||||
return
|
||||
if(length(custommessage) <= 0 || custommessage == "")
|
||||
message = "NOTICE: No message entered!"
|
||||
return
|
||||
if(length(customjob) <= 0 || customjob == "")
|
||||
customjob = "Admin"
|
||||
return
|
||||
if(length(customsender) <= 0 || customsender == "")
|
||||
customsender = "UNKNOWN"
|
||||
//sanitize text!!!
|
||||
var/datum/signal/subspace/pda/signal = new(src, list(
|
||||
"name" = sanitize(customsender),
|
||||
"job" = sanitize(customjob),
|
||||
"message" = sanitize(custommessage),
|
||||
"emojis" = TRUE,
|
||||
"targets" = list("[customrecepient.owner] ([customrecepient.ownjob])")
|
||||
))
|
||||
// this will log the signal and transmit it to the target
|
||||
linkedServer.receive_information(signal, null)
|
||||
usr.log_message("(PDA: [name] | [usr.real_name]) sent \"[sanitize(custommessage)]\" to [signal.format_target()]", LOG_PDA)
|
||||
message = ""
|
||||
return
|
||||
// Do not check if it's blank yet
|
||||
// But do check if it's above our set limit (for people who manualy send hrefs at us!)
|
||||
if("sender" in params)
|
||||
var/S = params["sender"]
|
||||
if(length(S) > MAX_NAME_LEN)
|
||||
message = "FAILED: Job string too lengthy"
|
||||
return
|
||||
customsender = S
|
||||
return
|
||||
if("job" in params)
|
||||
var/J = params["job"]
|
||||
if(length(J) > 100)
|
||||
message = "FAILED: Job string too lengthy"
|
||||
return
|
||||
|
||||
customjob = J
|
||||
return
|
||||
if("message" in params)
|
||||
var/M = params["message"]
|
||||
if(length(M) > MAX_MESSAGE_LEN)
|
||||
message = "FAILED: Message string too lengthy"
|
||||
return
|
||||
custommessage = M
|
||||
return
|
||||
|
||||
if("recepient" in params)
|
||||
// Get out list of viable PDAs
|
||||
var/list/obj/item/pda/sendPDAs = get_viewable_pdas()
|
||||
if(GLOB.PDAs && LAZYLEN(GLOB.PDAs) > 0)
|
||||
customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs)
|
||||
else
|
||||
customrecepient = null
|
||||
return
|
||||
if("refresh")
|
||||
update_static_data(usr)
|
||||
|
||||
/obj/machinery/computer/message_monitor/attackby(obj/item/O, mob/living/user, params)
|
||||
if(istype(O, /obj/item/screwdriver) && (obj_flags & EMAGGED))
|
||||
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
|
||||
if(istype(O, /obj/item/screwdriver) && CHECK_BITFIELD(obj_flags, EMAGGED))
|
||||
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
|
||||
//Why this though, you should make it emag to a board level. (i wont do it)
|
||||
to_chat(user, "<span class='warning'>It is too hot to mess with!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/message_monitor/emag_act(mob/user)
|
||||
if(obj_flags & EMAGGED)
|
||||
. = ..()
|
||||
if(CHECK_BITFIELD(obj_flags, EMAGGED))
|
||||
return
|
||||
if(!isnull(linkedServer))
|
||||
obj_flags |= EMAGGED
|
||||
screen = 2
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.start()
|
||||
var/obj/item/paper/monitorkey/MK = new(loc, linkedServer)
|
||||
// Will help make emagging the console not so easy to get away with.
|
||||
MK.info += "<br><br><font color='red'>�%@%(*$%&(�&?*(%&�/{}</font>"
|
||||
var/time = 100 * length(linkedServer.decryptkey)
|
||||
addtimer(CALLBACK(src, .proc/UnmagConsole), time)
|
||||
message = rebootmsg
|
||||
else
|
||||
if(isnull(linkedServer))
|
||||
to_chat(user, "<span class='notice'>A no server error appears on the screen.</span>")
|
||||
return
|
||||
ENABLE_BITFIELD(obj_flags, EMAGGED)
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.start()
|
||||
var/obj/item/paper/monitorkey/MK = new(loc, linkedServer)
|
||||
// Will help make emagging the console not so easy to get away with.
|
||||
MK.info += "<br><br><font color='red'>�%@%(*$%&(�&?*(%&�/{}</font>"
|
||||
addtimer(CALLBACK(src, .proc/UnmagConsole), (10 SECONDS) * length(linkedServer.decryptkey))
|
||||
//message = rebootmsg
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/message_monitor/New()
|
||||
. = ..()
|
||||
GLOB.telecomms_list += src
|
||||
|
||||
/obj/machinery/computer/message_monitor/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/machinery/computer/message_monitor/LateInitialize()
|
||||
//Is the server isn't linked to a server, and there's a server available, default it to the first one in the list.
|
||||
if(!linkedServer)
|
||||
for(var/obj/machinery/telecomms/message_server/S in GLOB.telecomms_list)
|
||||
linkedServer = S
|
||||
break
|
||||
|
||||
/obj/machinery/computer/message_monitor/Destroy()
|
||||
GLOB.telecomms_list -= src
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/computer/message_monitor/ui_interact(mob/living/user)
|
||||
. = ..()
|
||||
//If the computer is being hacked or is emagged, display the reboot message.
|
||||
if(hacking || (obj_flags & EMAGGED))
|
||||
message = rebootmsg
|
||||
var/dat = "<center><font color='blue'[message]</font></center>"
|
||||
|
||||
if(auth)
|
||||
dat += "<h4><dd><A href='?src=[REF(src)];auth=1'>	<font color='green'>\[Authenticated\]</font></a>	/"
|
||||
dat += " Server Power: <A href='?src=[REF(src)];active=1'>[linkedServer && linkedServer.toggled ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</a></h4>"
|
||||
else
|
||||
dat += "<h4><dd><A href='?src=[REF(src)];auth=1'>	<font color='red'>\[Unauthenticated\]</font></a>	/"
|
||||
dat += " Server Power: <u>[linkedServer && linkedServer.toggled ? "<font color='green'>\[On\]</font>":"<font color='red'>\[Off\]</font>"]</u></h4>"
|
||||
|
||||
if(hacking || (obj_flags & EMAGGED))
|
||||
screen = 2
|
||||
else if(!auth || LINKED_SERVER_NONRESPONSIVE)
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
screen = 0
|
||||
|
||||
switch(screen)
|
||||
//Main menu
|
||||
if(0)
|
||||
//	 = TAB
|
||||
var/i = 0
|
||||
dat += "<dd><A href='?src=[REF(src)];find=1'>	[++i]. Link To A Server</a></dd>"
|
||||
if(auth)
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
dat += "<dd><A>	ERROR: Server not found!</A><br></dd>"
|
||||
else
|
||||
dat += "<dd><A href='?src=[REF(src)];view_logs=1'>	[++i]. View Message Logs </a><br></dd>"
|
||||
dat += "<dd><A href='?src=[REF(src)];view_requests=1'>	[++i]. View Request Console Logs </a></br></dd>"
|
||||
dat += "<dd><A href='?src=[REF(src)];clear_logs=1'>	[++i]. Clear Message Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=[REF(src)];clear_requests=1'>	[++i]. Clear Request Console Logs</a><br></dd>"
|
||||
dat += "<dd><A href='?src=[REF(src)];pass=1'>	[++i]. Set Custom Key</a><br></dd>"
|
||||
dat += "<dd><A href='?src=[REF(src)];msg=1'>	[++i]. Send Admin Message</a><br></dd>"
|
||||
else
|
||||
for(var/n = ++i; n <= optioncount; n++)
|
||||
dat += "<dd><font color='blue'>	[n]. ---------------</font><br></dd>"
|
||||
var/mob/living/silicon/S = usr
|
||||
if(istype(S) && S.hack_software)
|
||||
//Malf/Traitor AIs can bruteforce into the system to gain the Key.
|
||||
dat += "<dd><A href='?src=[REF(src)];hack=1'><i><font color='Red'>*&@#. Bruteforce Key</font></i></font></a><br></dd>"
|
||||
else
|
||||
dat += "<br>"
|
||||
|
||||
//Bottom message
|
||||
if(!auth)
|
||||
dat += "<br><hr><dd><span class='notice'>Please authenticate with the server in order to show additional options.</span>"
|
||||
else
|
||||
dat += "<br><hr><dd><span class='warning'>Reg, #514 forbids sending messages to a Head of Staff containing Erotic Rendering Properties.</span>"
|
||||
|
||||
//Message Logs
|
||||
if(1)
|
||||
var/index = 0
|
||||
dat += "<center><A href='?src=[REF(src)];back=1'>Back</a> - <A href='?src=[REF(src)];refresh=1'>Refresh</a></center><hr>"
|
||||
dat += "<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sender</th><th width='15%'>Recipient</th><th width='300px' word-wrap: break-word>Message</th></tr>"
|
||||
for(var/datum/data_pda_msg/pda in linkedServer.pda_msgs)
|
||||
index++
|
||||
if(index > 3000)
|
||||
break
|
||||
// Del - Sender - Recepient - Message
|
||||
// X - Al Green - Your Mom - WHAT UP!?
|
||||
dat += "<tr><td width = '5%'><center><A href='?src=[REF(src)];delete_logs=[REF(pda)]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[pda.sender]</td><td width='15%'>[pda.recipient]</td><td width='300px'>[pda.message][pda.picture ? " <a href='byond://?src=[REF(pda)];photo=1'>(Photo)</a>":""]</td></tr>"
|
||||
dat += "</table>"
|
||||
//Hacking screen.
|
||||
if(2)
|
||||
if(isAI(user) || iscyborg(user))
|
||||
dat += "Brute-forcing for server key.<br> It will take 20 seconds for every character that the password has."
|
||||
dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time."
|
||||
else
|
||||
//It's the same message as the one above but in binary. Because robots understand binary and humans don't... well I thought it was clever.
|
||||
dat += {"01000010011100100111010101110100011001010010110<br>
|
||||
10110011001101111011100100110001101101001011011100110011<br>
|
||||
10010000001100110011011110111001000100000011100110110010<br>
|
||||
10111001001110110011001010111001000100000011010110110010<br>
|
||||
10111100100101110001000000100100101110100001000000111011<br>
|
||||
10110100101101100011011000010000001110100011000010110101<br>
|
||||
10110010100100000001100100011000000100000011100110110010<br>
|
||||
10110001101101111011011100110010001110011001000000110011<br>
|
||||
00110111101110010001000000110010101110110011001010111001<br>
|
||||
00111100100100000011000110110100001100001011100100110000<br>
|
||||
10110001101110100011001010111001000100000011101000110100<br>
|
||||
00110000101110100001000000111010001101000011001010010000<br>
|
||||
00111000001100001011100110111001101110111011011110111001<br>
|
||||
00110010000100000011010000110000101110011001011100010000<br>
|
||||
00100100101101110001000000111010001101000011001010010000<br>
|
||||
00110110101100101011000010110111001110100011010010110110<br>
|
||||
10110010100101100001000000111010001101000011010010111001<br>
|
||||
10010000001100011011011110110111001110011011011110110110<br>
|
||||
00110010100100000011000110110000101101110001000000111001<br>
|
||||
00110010101110110011001010110000101101100001000000111100<br>
|
||||
10110111101110101011100100010000001110100011100100111010<br>
|
||||
10110010100100000011010010110111001110100011001010110111<br>
|
||||
00111010001101001011011110110111001110011001000000110100<br>
|
||||
10110011000100000011110010110111101110101001000000110110<br>
|
||||
00110010101110100001000000111001101101111011011010110010<br>
|
||||
10110111101101110011001010010000001100001011000110110001<br>
|
||||
10110010101110011011100110010000001101001011101000010111<br>
|
||||
00010000001001101011000010110101101100101001000000111001<br>
|
||||
10111010101110010011001010010000001101110011011110010000<br>
|
||||
00110100001110101011011010110000101101110011100110010000<br>
|
||||
00110010101101110011101000110010101110010001000000111010<br>
|
||||
00110100001100101001000000111001001101111011011110110110<br>
|
||||
10010000001100100011101010111001001101001011011100110011<br>
|
||||
10010000001110100011010000110000101110100001000000111010<br>
|
||||
001101001011011010110010100101110"}
|
||||
|
||||
//Fake messages
|
||||
if(3)
|
||||
dat += "<center><A href='?src=[REF(src)];back=1'>Back</a> - <A href='?src=[REF(src)];Reset=1'>Reset</a></center><hr>"
|
||||
|
||||
dat += {"<table border='1' width='100%'>
|
||||
<tr><td width='20%'><A href='?src=[REF(src)];select=Sender'>Sender</a></td>
|
||||
<td width='20%'><A href='?src=[REF(src)];select=RecJob'>Sender's Job</a></td>
|
||||
<td width='20%'><A href='?src=[REF(src)];select=Recepient'>Recipient</a></td>
|
||||
<td width='300px' word-wrap: break-word><A href='?src=[REF(src)];select=Message'>Message</a></td></tr>"}
|
||||
//Sender - Sender's Job - Recepient - Message
|
||||
//Al Green- Your Dad - Your Mom - WHAT UP!?
|
||||
|
||||
dat += {"<tr><td width='20%'>[customsender]</td>
|
||||
<td width='20%'>[customjob]</td>
|
||||
<td width='20%'>[customrecepient ? customrecepient.owner : "NONE"]</td>
|
||||
<td width='300px'>[custommessage]</td></tr>"}
|
||||
dat += "</table><br><center><A href='?src=[REF(src)];select=Send'>Send</a>"
|
||||
|
||||
//Request Console Logs
|
||||
if(4)
|
||||
|
||||
var/index = 0
|
||||
/* data_rc_msg
|
||||
X - 5%
|
||||
var/rec_dpt = "Unspecified" //name of the person - 15%
|
||||
var/send_dpt = "Unspecified" //name of the sender- 15%
|
||||
var/message = "Blank" //transferred message - 300px
|
||||
var/stamp = "Unstamped" - 15%
|
||||
var/id_auth = "Unauthenticated" - 15%
|
||||
var/priority = "Normal" - 10%
|
||||
*/
|
||||
dat += "<center><A href='?src=[REF(src)];back=1'>Back</a> - <A href='?src=[REF(src)];refresh=1'>Refresh</a></center><hr>"
|
||||
dat += {"<table border='1' width='100%'><tr><th width = '5%'>X</th><th width='15%'>Sending Dep.</th><th width='15%'>Receiving Dep.</th>
|
||||
<th width='300px' word-wrap: break-word>Message</th><th width='15%'>Stamp</th><th width='15%'>ID Auth.</th><th width='15%'>Priority.</th></tr>"}
|
||||
for(var/datum/data_rc_msg/rc in linkedServer.rc_msgs)
|
||||
index++
|
||||
if(index > 3000)
|
||||
break
|
||||
// Del - Sender - Recepient - Message
|
||||
// X - Al Green - Your Mom - WHAT UP!?
|
||||
dat += {"<tr><td width = '5%'><center><A href='?src=[REF(src)];delete_requests=[REF(rc)]' style='color: rgb(255,0,0)'>X</a></center></td><td width='15%'>[rc.send_dpt]</td>
|
||||
<td width='15%'>[rc.rec_dpt]</td><td width='300px'>[rc.message]</td><td width='15%'>[rc.stamp]</td><td width='15%'>[rc.id_auth]</td><td width='15%'>[rc.priority]</td></tr>"}
|
||||
dat += "</table>"
|
||||
|
||||
message = defaultmsg
|
||||
var/datum/browser/popup = new(user, "hologram_console", name, 700, 700)
|
||||
popup.set_content(dat)
|
||||
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/message_monitor/proc/BruteForce(mob/user)
|
||||
if(isnull(linkedServer))
|
||||
to_chat(user, "<span class='warning'>Could not complete brute-force: Linked Server Disconnected!</span>")
|
||||
@@ -243,10 +364,11 @@
|
||||
var/currentKey = linkedServer.decryptkey
|
||||
to_chat(user, "<span class='warning'>Brute-force completed! The key is '[currentKey]'.</span>")
|
||||
hacking = FALSE
|
||||
screen = 0 // Return the screen back to normal
|
||||
message = ""
|
||||
|
||||
/obj/machinery/computer/message_monitor/proc/UnmagConsole()
|
||||
obj_flags &= ~EMAGGED
|
||||
DISABLE_BITFIELD(obj_flags, EMAGGED)
|
||||
message = ""
|
||||
|
||||
/obj/machinery/computer/message_monitor/proc/ResetMessage()
|
||||
customsender = "System Administrator"
|
||||
@@ -254,199 +376,12 @@
|
||||
custommessage = "This is a test, please ignore."
|
||||
customjob = "Admin"
|
||||
|
||||
/obj/machinery/computer/message_monitor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr))
|
||||
//Authenticate
|
||||
if (href_list["auth"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
auth = FALSE
|
||||
screen = 0
|
||||
else
|
||||
var/dkey = trim(input(usr, "Please enter the decryption key.") as text|null)
|
||||
if(dkey && dkey != "")
|
||||
if(linkedServer.decryptkey == dkey)
|
||||
auth = TRUE
|
||||
else
|
||||
message = incorrectkey
|
||||
|
||||
//Turn the server on/off.
|
||||
if (href_list["active"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
linkedServer.toggled = !linkedServer.toggled
|
||||
//Find a server
|
||||
if (href_list["find"])
|
||||
var/list/message_servers = list()
|
||||
for (var/obj/machinery/telecomms/message_server/M in GLOB.telecomms_list)
|
||||
message_servers += M
|
||||
|
||||
if(message_servers.len > 1)
|
||||
linkedServer = input(usr, "Please select a server.", "Select a server.", null) as null|anything in message_servers
|
||||
message = "<span class='alert'>NOTICE: Server selected.</span>"
|
||||
else if(message_servers.len > 0)
|
||||
linkedServer = message_servers[1]
|
||||
message = "<span class='notice'>NOTICE: Only Single Server Detected - Server selected.</span>"
|
||||
else
|
||||
message = noserver
|
||||
|
||||
//View the logs - KEY REQUIRED
|
||||
if (href_list["view_logs"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
screen = 1
|
||||
|
||||
//Clears the logs - KEY REQUIRED
|
||||
if (href_list["clear_logs"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
linkedServer.pda_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Clears the request console logs - KEY REQUIRED
|
||||
if (href_list["clear_requests"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
linkedServer.rc_msgs = list()
|
||||
message = "<span class='notice'>NOTICE: Logs cleared.</span>"
|
||||
//Change the password - KEY REQUIRED
|
||||
if (href_list["pass"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
var/dkey = stripped_input(usr, "Please enter the decryption key.")
|
||||
if(dkey && dkey != "")
|
||||
if(linkedServer.decryptkey == dkey)
|
||||
var/newkey = trim(input(usr,"Please enter the new key (3 - 16 characters max):"))
|
||||
if(length(newkey) <= 3)
|
||||
message = "<span class='notice'>NOTICE: Decryption key too short!</span>"
|
||||
else if(length(newkey) > 16)
|
||||
message = "<span class='notice'>NOTICE: Decryption key too long!</span>"
|
||||
else if(newkey && newkey != "")
|
||||
linkedServer.decryptkey = newkey
|
||||
message = "<span class='notice'>NOTICE: Decryption key set.</span>"
|
||||
else
|
||||
message = incorrectkey
|
||||
|
||||
//Hack the Console to get the password
|
||||
if (href_list["hack"])
|
||||
var/mob/living/silicon/S = usr
|
||||
if(istype(S) && S.hack_software)
|
||||
hacking = TRUE
|
||||
screen = 2
|
||||
//Time it takes to bruteforce is dependant on the password length.
|
||||
spawn(100*length(linkedServer.decryptkey))
|
||||
if(src && linkedServer && usr)
|
||||
BruteForce(usr)
|
||||
//Delete the log.
|
||||
if (href_list["delete_logs"])
|
||||
//Are they on the view logs screen?
|
||||
if(screen == 1)
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else //if(istype(href_list["delete_logs"], /datum/data_pda_msg))
|
||||
linkedServer.pda_msgs -= locate(href_list["delete_logs"])
|
||||
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//Delete the request console log.
|
||||
if (href_list["delete_requests"])
|
||||
//Are they on the view logs screen?
|
||||
if(screen == 4)
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else //if(istype(href_list["delete_logs"], /datum/data_pda_msg))
|
||||
linkedServer.rc_msgs -= locate(href_list["delete_requests"])
|
||||
message = "<span class='notice'>NOTICE: Log Deleted!</span>"
|
||||
//Create a custom message
|
||||
if (href_list["msg"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
screen = 3
|
||||
//Fake messaging selection - KEY REQUIRED
|
||||
if (href_list["select"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
screen = 0
|
||||
else
|
||||
switch(href_list["select"])
|
||||
|
||||
//Reset
|
||||
if("Reset")
|
||||
ResetMessage()
|
||||
|
||||
//Select Your Name
|
||||
if("Sender")
|
||||
customsender = stripped_input(usr, "Please enter the sender's name.") || customsender
|
||||
|
||||
//Select Receiver
|
||||
if("Recepient")
|
||||
//Get out list of viable PDAs
|
||||
var/list/obj/item/pda/sendPDAs = get_viewable_pdas()
|
||||
if(GLOB.PDAs && GLOB.PDAs.len > 0)
|
||||
customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs)
|
||||
else
|
||||
customrecepient = null
|
||||
|
||||
//Enter custom job
|
||||
if("RecJob")
|
||||
customjob = stripped_input(usr, "Please enter the sender's job.") || customjob
|
||||
|
||||
//Enter message
|
||||
if("Message")
|
||||
custommessage = stripped_input(usr, "Please enter your message.") || custommessage
|
||||
|
||||
//Send message
|
||||
if("Send")
|
||||
if(isnull(customsender) || customsender == "")
|
||||
customsender = "UNKNOWN"
|
||||
|
||||
if(isnull(customrecepient))
|
||||
message = "<span class='notice'>NOTICE: No recepient selected!</span>"
|
||||
return attack_hand(usr)
|
||||
|
||||
if(isnull(custommessage) || custommessage == "")
|
||||
message = "<span class='notice'>NOTICE: No message entered!</span>"
|
||||
return attack_hand(usr)
|
||||
|
||||
var/datum/signal/subspace/pda/signal = new(src, list(
|
||||
"name" = "[customsender]",
|
||||
"job" = "[customjob]",
|
||||
"message" = custommessage,
|
||||
"emoji_message" = emoji_parse(custommessage),
|
||||
"targets" = list("[customrecepient.owner] ([customrecepient.ownjob])")
|
||||
))
|
||||
// this will log the signal and transmit it to the target
|
||||
linkedServer.receive_information(signal, null)
|
||||
usr.log_message("(PDA: [name]) sent \"[custommessage]\" to [signal.format_target()]", LOG_PDA)
|
||||
|
||||
|
||||
//Request Console Logs - KEY REQUIRED
|
||||
if(href_list["view_requests"])
|
||||
if(LINKED_SERVER_NONRESPONSIVE)
|
||||
message = noserver
|
||||
else if(auth)
|
||||
screen = 4
|
||||
|
||||
if (href_list["back"])
|
||||
screen = 0
|
||||
|
||||
return attack_hand(usr)
|
||||
|
||||
#undef LINKED_SERVER_NONRESPONSIVE
|
||||
|
||||
/obj/item/paper/monitorkey
|
||||
name = "monitor decryption key"
|
||||
|
||||
/obj/item/paper/monitorkey/Initialize(mapload, obj/machinery/telecomms/message_server/server)
|
||||
..()
|
||||
if (server)
|
||||
if(server)
|
||||
print(server)
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
else
|
||||
@@ -458,7 +393,7 @@
|
||||
add_overlay("paper_words")
|
||||
|
||||
/obj/item/paper/monitorkey/LateInitialize()
|
||||
for (var/obj/machinery/telecomms/message_server/server in GLOB.telecomms_list)
|
||||
if (server.decryptkey)
|
||||
for(var/obj/machinery/telecomms/message_server/server in GLOB.telecomms_list)
|
||||
if(server.decryptkey)
|
||||
print(server)
|
||||
break
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
Telecomms monitor tracks the overall trafficing of a telecommunications network
|
||||
and displays a heirarchy of linked machines.
|
||||
@@ -10,117 +9,98 @@
|
||||
icon_screen = "comm_monitor"
|
||||
desc = "Monitors the details of the telecommunications network it's synced with."
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/machinelist = list() // the machines located by the computer
|
||||
var/obj/machinery/telecomms/SelectedMachine
|
||||
var/obj/machinery/telecomms/SelectedMachine = null
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
var/notice = ""
|
||||
|
||||
var/temp = "" // temporary feedback messages
|
||||
circuit = /obj/item/circuitboard/computer/comm_monitor
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/ui_interact(mob/user)
|
||||
. = ..()
|
||||
var/dat = "<TITLE>Telecommunications Monitor</TITLE><center><b>Telecommunications Monitor</b></center>"
|
||||
/obj/machinery/computer/telecomms/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE,\
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
switch(screen)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "telemonitor", name, 575, 400, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/ui_data(mob/user)
|
||||
var/list/data_out = list()
|
||||
data_out["network"] = network
|
||||
data_out["notice"] = notice
|
||||
|
||||
// --- Main Menu ---
|
||||
data_out["servers"] = list()
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
var/list/data = list(
|
||||
name = T.name,
|
||||
id = T.id,
|
||||
ref = REF(T)
|
||||
)
|
||||
data_out["servers"] += list(data)
|
||||
data_out["servers"] = sortList(data_out["servers"])
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br><br>"
|
||||
dat += "<br>Current Network: <a href='?src=[REF(src)];network=1'>[network]</a><br>"
|
||||
if(machinelist.len)
|
||||
dat += "<br>Detected Network Entities:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
dat += "<li><a href='?src=[REF(src)];viewmachine=[T.id]'>[REF(T)] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=[REF(src)];operation=release'>\[Flush Buffer\]</a>"
|
||||
else
|
||||
dat += "<a href='?src=[REF(src)];operation=probe'>\[Probe Network\]</a>"
|
||||
if(!SelectedMachine) //null is bad.
|
||||
data_out["selected"] = null //but in js, null is good.
|
||||
return data_out
|
||||
|
||||
data_out["selected"] = list(
|
||||
name = SelectedMachine.name,
|
||||
id = SelectedMachine.id,
|
||||
status = SelectedMachine.on,
|
||||
traffic = SelectedMachine.traffic,
|
||||
netspeed = SelectedMachine.netspeed,
|
||||
freq_listening = SelectedMachine.freq_listening,
|
||||
long_range_link = SelectedMachine.long_range_link,
|
||||
ref = REF(SelectedMachine)
|
||||
)
|
||||
data_out["selected_servers"] = list()
|
||||
for(var/obj/machinery/telecomms/T in SelectedMachine.links)
|
||||
if(!T.hide)
|
||||
var/list/data = list(
|
||||
name = T.name,
|
||||
id = T.id,
|
||||
ref = REF(T)
|
||||
)
|
||||
data_out["selected_servers"] += list(data)
|
||||
|
||||
return data_out
|
||||
|
||||
// --- Viewing Machine ---
|
||||
|
||||
if(1)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=[REF(src)];operation=mainmenu'>\[Main Menu\]</a></center>"
|
||||
dat += "<br>Current Network: [network]<br>"
|
||||
dat += "Selected Network Entity: [SelectedMachine.name] ([SelectedMachine.id])<br>"
|
||||
dat += "Linked Entities: <ol>"
|
||||
for(var/obj/machinery/telecomms/T in SelectedMachine.links)
|
||||
if(!T.hide)
|
||||
dat += "<li><a href='?src=[REF(src)];viewmachine=[T.id]'>[REF(T.id)] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ol>"
|
||||
|
||||
|
||||
|
||||
user << browse(dat, "window=comm_monitor;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/Topic(href, href_list)
|
||||
/obj/machinery/computer/telecomms/monitor/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("mainmenu")
|
||||
SelectedMachine = null
|
||||
notice = ""
|
||||
return
|
||||
if("release")
|
||||
machinelist = list()
|
||||
notice = ""
|
||||
return
|
||||
if("network") //network change, flush the selected machine and buffer
|
||||
var/newnet = sanitize(sanitize_text(params["value"], network))
|
||||
if(length(newnet) > 15) //i'm looking at you, you href fuckers
|
||||
notice = "FAILED: Network tag string too lengthy"
|
||||
return
|
||||
network = newnet
|
||||
SelectedMachine = null
|
||||
machinelist = list()
|
||||
return
|
||||
if("probe")
|
||||
if(LAZYLEN(machinelist) > 0)
|
||||
notice = "FAILED: Cannot probe when buffer full"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/telecomms/T in GLOB.telecomms_list)
|
||||
if(T.network == network)
|
||||
LAZYADD(machinelist, T)
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["viewmachine"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
if(T.id == href_list["viewmachine"])
|
||||
SelectedMachine = T
|
||||
break
|
||||
|
||||
if(href_list["operation"])
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
machinelist = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("probe")
|
||||
if(machinelist.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/T in urange(25, src))
|
||||
if(T.network == network)
|
||||
machinelist.Add(T)
|
||||
|
||||
if(!machinelist.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE NETWORK ENTITIES IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [machinelist.len] ENTITIES LOCATED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
if(newnet && ((usr in range(1, src)) || issilicon(usr)))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
network = newnet
|
||||
screen = 0
|
||||
machinelist = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/attackby()
|
||||
. = ..()
|
||||
updateUsrDialog()
|
||||
if(!LAZYLEN(machinelist))
|
||||
notice = "FAILED: Unable to locate network entities in \[[network]\]"
|
||||
return
|
||||
if("viewmachine")
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
if(T.id == params["value"])
|
||||
SelectedMachine = T
|
||||
break
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
var/temp = "" // output message
|
||||
|
||||
/obj/machinery/telecomms/attackby(obj/item/P, mob/user, params)
|
||||
|
||||
var/icon_closed = initial(icon_state)
|
||||
var/icon_open = "[initial(icon_state)]_o"
|
||||
|
||||
if(!on)
|
||||
icon_closed = "[initial(icon_state)]_off"
|
||||
icon_open = "[initial(icon_state)]_o_off"
|
||||
@@ -27,78 +27,240 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/telecomms/ui_interact(mob/user)
|
||||
. = ..()
|
||||
// You need a multitool to use this, or be silicon
|
||||
if(!issilicon(user))
|
||||
// istype returns false if the value is null
|
||||
if(!istype(user.get_active_held_item(), /obj/item/multitool))
|
||||
return
|
||||
/obj/machinery/telecomms/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE,\
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
if(!canInteract(user))
|
||||
if(ui)
|
||||
ui.close() //haha no.
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "teleinteract", "[name] Access", 520, 500, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/telecomms/ui_data(mob/user)
|
||||
. = list() //cpypaste from the vending bus
|
||||
.["notice"] = temp
|
||||
.["multitool"] = FALSE
|
||||
var/obj/item/multitool/P = get_multitool(user)
|
||||
var/dat
|
||||
dat = "<font face = \"Courier\"><HEAD><TITLE>[name]</TITLE></HEAD><center><H3>[name] Access</H3></center>"
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<br>Power Status: <a href='?src=[REF(src)];input=toggle'>[toggled ? "On" : "Off"]</a>"
|
||||
if(on && toggled)
|
||||
if(id != "" && id)
|
||||
dat += "<br>Identification String: <a href='?src=[REF(src)];input=id'>[id]</a>"
|
||||
else
|
||||
dat += "<br>Identification String: <a href='?src=[REF(src)];input=id'>NULL</a>"
|
||||
dat += "<br>Network: <a href='?src=[REF(src)];input=network'>[network]</a>"
|
||||
dat += "<br>Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]"
|
||||
if(hide)
|
||||
dat += "<br>Shadow Link: ACTIVE</a>"
|
||||
if(P)
|
||||
.["multitool"] = TRUE
|
||||
.["multitool_buf"] = null //to clean the list!
|
||||
var/obj/machinery/telecomms/T = P.buffer
|
||||
if(istype(T))
|
||||
.["multitool_buf"] = list(
|
||||
name = T.name,
|
||||
id = T.id
|
||||
)
|
||||
|
||||
//Show additional options for certain machines.
|
||||
dat += Options_Menu()
|
||||
.["machine"] = list()
|
||||
.["machine"]["power"] = toggled
|
||||
.["machine"]["id"] = id
|
||||
.["machine"]["network"] = network
|
||||
.["machine"]["prefab"] = LAZYLEN(autolinkers) ? TRUE : FALSE
|
||||
.["machine"]["hidden"] = hide
|
||||
|
||||
dat += "<br>Linked Network Entities: <ol>"
|
||||
.["links"] = list()
|
||||
for(var/obj/machinery/telecomms/T in links)
|
||||
if(T.hide && !hide)
|
||||
continue
|
||||
var/list/data = list(
|
||||
name = T.name,
|
||||
id = T.id,
|
||||
ref = REF(T)
|
||||
)
|
||||
.["links"] += list(data)
|
||||
|
||||
var/i = 0
|
||||
for(var/obj/machinery/telecomms/T in links)
|
||||
i++
|
||||
if(T.hide && !hide)
|
||||
continue
|
||||
dat += "<li>[REF(T)] [T.name] ([T.id]) <a href='?src=[REF(src)];unlink=[i]'>\[X\]</a></li>"
|
||||
dat += "</ol>"
|
||||
.["freq_listening"] = freq_listening
|
||||
|
||||
dat += "<br>Filtering Frequencies: "
|
||||
/obj/machinery/telecomms/relay/ui_data(mob/user)
|
||||
. = ..()
|
||||
.["machine"]["isrelay"] = TRUE
|
||||
.["machine"]["broadcast"] = broadcasting
|
||||
.["machine"]["receiving"] = receiving
|
||||
|
||||
i = 0
|
||||
if(length(freq_listening))
|
||||
for(var/x in freq_listening)
|
||||
i++
|
||||
if(i < length(freq_listening))
|
||||
dat += "[format_frequency(x)] GHz<a href='?src=[REF(src)];delete=[x]'>\[X\]</a>; "
|
||||
else
|
||||
dat += "[format_frequency(x)] GHz<a href='?src=[REF(src)];delete=[x]'>\[X\]</a>"
|
||||
else
|
||||
dat += "NONE"
|
||||
/obj/machinery/telecomms/bus/ui_data(mob/user)
|
||||
. = ..()
|
||||
.["machine"]["isbus"] = TRUE
|
||||
.["machine"]["chang_frequency"] = change_frequency
|
||||
.["machine"]["chang_freq_value"] = change_freq_value
|
||||
|
||||
dat += "<br> <a href='?src=[REF(src)];input=freq'>\[Add Filter\]</a>"
|
||||
dat += "<hr>"
|
||||
|
||||
if(P)
|
||||
var/obj/machinery/telecomms/T = P.buffer
|
||||
if(istype(T))
|
||||
dat += "<br><br>MULTITOOL BUFFER: [T] ([T.id]) <a href='?src=[REF(src)];link=1'>\[Link\]</a> <a href='?src=[REF(src)];flush=1'>\[Flush\]"
|
||||
else
|
||||
dat += "<br><br>MULTITOOL BUFFER: <a href='?src=[REF(src)];buffer=1'>\[Add Machine\]</a>"
|
||||
|
||||
dat += "</font>"
|
||||
/obj/machinery/telecomms/ui_act(action, params, datum/tgui/ui)
|
||||
if(!canInteract(usr))
|
||||
if(ui)
|
||||
ui.close() //haha no.
|
||||
return
|
||||
temp = ""
|
||||
user << browse(dat, "window=tcommachine;size=520x500;can_resize=0")
|
||||
onclose(user, "tcommachine")
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("toggle")
|
||||
toggled = !toggled
|
||||
temp = "-% [src.name] has been [toggled ? "activated" : "deactivated"]. %-"
|
||||
update_power()
|
||||
return
|
||||
if("machine")
|
||||
if("id" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
//if the text is blank, return the id it was using
|
||||
var/newid = sanitize_text(reject_bad_text(params["id"]), id) // reject_bad_text can return null!
|
||||
if(length(newid) > 255)
|
||||
temp = "-% Too many characters in new id tag. %-"
|
||||
return
|
||||
temp = "-% New ID assigned: \"[newid]\". %-"
|
||||
id = newid
|
||||
return
|
||||
if("network" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
var/newnet = sanitize(sanitize_text(params["network"], network))
|
||||
if(length(newnet) > 15)
|
||||
temp = "-% Too many characters in new network tag. %-"
|
||||
return
|
||||
network = newnet
|
||||
links = list()
|
||||
temp = "-% New network tag assigned: \"[network]\" %-"
|
||||
return
|
||||
if("multitool")
|
||||
var/obj/item/multitool/P = get_multitool(usr)
|
||||
if("Link" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
if(!istype(P))
|
||||
temp = "-% Unable to acquire buffer %-"
|
||||
return
|
||||
|
||||
var/obj/machinery/telecomms/T = P.buffer
|
||||
if(!istype(T) || T == src)
|
||||
temp = "-% Unable to acquire buffer %-"
|
||||
return
|
||||
|
||||
if(!(src in T.links))
|
||||
LAZYADD(T.links, src)
|
||||
|
||||
if(!(T in links))
|
||||
LAZYADD(links, T)
|
||||
temp = "-% Successfully linked with [REF(T)] [T.name] %-"
|
||||
|
||||
if("Flush" in params)
|
||||
if(!istype(P))
|
||||
temp = "-% Unable to acquire multitool %-"
|
||||
return
|
||||
|
||||
temp = "-% Buffer successfully flushed. %-"
|
||||
P.buffer = null
|
||||
|
||||
if("Add" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
if(!istype(P))
|
||||
temp = "-% Unable to acquire multitool %-"
|
||||
return
|
||||
|
||||
P.buffer = src
|
||||
temp = "% Successfully stored [REF(P.buffer)] [P.buffer.name] in buffer %-"
|
||||
|
||||
if("unlink")
|
||||
var/obj/machinery/telecomms/T = locate(params["value"])
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
if(!istype(T))
|
||||
temp = "-% Unable to locate machine to unlink from, try again. %-"
|
||||
return
|
||||
|
||||
temp = "-% Removed [REF(T)] [T.name] from linked entities. %-"
|
||||
if(T.links) //lazyrem makes blank list null, which is good but some might cause runtime ee's
|
||||
T.links.Remove(src)
|
||||
links.Remove(T)
|
||||
if("freq")
|
||||
if("add" in params)
|
||||
var/newfreq = input("Specify a new frequency to filter (GHz). Decimals assigned automatically.", src.name, null) as null|num
|
||||
if(!canAccess(usr) || !newfreq || isnull(newfreq))
|
||||
return
|
||||
|
||||
if(findtext(num2text(newfreq), ".")) // did they not read the text?
|
||||
newfreq *= 10 // shift the decimal one place
|
||||
|
||||
newfreq = sanitize_frequency(newfreq, TRUE) //sanitize
|
||||
if(newfreq == FREQ_SYNDICATE)
|
||||
temp = "-% Error: Interference preventing filtering frequency: \"[newfreq] GHz\" %-"
|
||||
return
|
||||
if(newfreq in freq_listening)
|
||||
temp = "-% Error: Frequency already filtered %-"
|
||||
return
|
||||
|
||||
LAZYADD(freq_listening, newfreq)
|
||||
temp = "-% New frequency filter assigned: \"[newfreq] GHz\" %-"
|
||||
|
||||
if("remove" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
var/x = text2num(params["remove"])
|
||||
temp = "-% Removed frequency filter [x] %-"
|
||||
freq_listening.Remove(x)
|
||||
|
||||
/obj/machinery/telecomms/relay/ui_act(action, params)
|
||||
..()
|
||||
switch(action)
|
||||
if("relay")
|
||||
if("broadcast" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
broadcasting = !broadcasting
|
||||
temp = "-% Broadcasting mode changed. %-"
|
||||
return
|
||||
if("receiving" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
receiving = !receiving
|
||||
temp = "-% Receiving mode changed. %-"
|
||||
|
||||
/obj/machinery/telecomms/bus/ui_act(action, params)
|
||||
..()
|
||||
switch(action)
|
||||
if("frequency")
|
||||
if("toggle" in params)
|
||||
if(!canAccess(usr))
|
||||
return
|
||||
change_frequency = !change_frequency
|
||||
return
|
||||
if("adjust" in params)
|
||||
var/newfreq = text2num(params["adjust"])
|
||||
if(!canAccess(usr) || !newfreq)
|
||||
return
|
||||
// this should return true, unless the href is handcrafted
|
||||
if(findtext(num2text(newfreq), "."))
|
||||
newfreq *= 10 // shift the decimal one place
|
||||
|
||||
newfreq = sanitize_frequency(newfreq, TRUE)
|
||||
if(newfreq == FREQ_SYNDICATE)
|
||||
temp = "-% Error: Interference preventing filtering frequency: \"[newfreq] GHz\" %-"
|
||||
return
|
||||
|
||||
change_freq_value = newfreq
|
||||
temp = "-% New frequency to change to assigned: \"[newfreq] GHz\" %-"
|
||||
return
|
||||
|
||||
// Check if the user can use it.
|
||||
/obj/machinery/telecomms/proc/canInteract(mob/user)
|
||||
if(issilicon(user) || istype(user.get_active_held_item(), /obj/item/multitool))
|
||||
return TRUE
|
||||
return FALSE
|
||||
// Check if the user is nearby and has a multitool.
|
||||
/obj/machinery/telecomms/proc/canAccess(mob/user)
|
||||
if(issilicon(user) || in_range(user, src))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// Returns a multitool from a user depending on their mobtype.
|
||||
|
||||
/obj/machinery/telecomms/proc/get_multitool(mob/user)
|
||||
|
||||
var/obj/item/multitool/P = null
|
||||
// Let's double check
|
||||
if(!issilicon(user) && istype(user.get_active_held_item(), /obj/item/multitool))
|
||||
P = user.get_active_held_item()
|
||||
if(!canInteract(user))
|
||||
return null
|
||||
var/obj/item/multitool/P = user.get_active_held_item()
|
||||
// Is the ref not a null? and is it the actual type?
|
||||
if(istype(P))
|
||||
return P
|
||||
else if(isAI(user))
|
||||
var/mob/living/silicon/ai/U = user
|
||||
P = U.aiMulti
|
||||
@@ -106,170 +268,3 @@
|
||||
if(istype(user.get_active_held_item(), /obj/item/multitool))
|
||||
P = user.get_active_held_item()
|
||||
return P
|
||||
|
||||
// Additional Options for certain machines. Use this when you want to add an option to a specific machine.
|
||||
// Example of how to use below.
|
||||
|
||||
/obj/machinery/telecomms/proc/Options_Menu()
|
||||
return ""
|
||||
|
||||
// The topic for Additional Options. Use this for checking href links for your specific option.
|
||||
// Example of how to use below.
|
||||
/obj/machinery/telecomms/proc/Options_Topic(href, href_list)
|
||||
return
|
||||
|
||||
// RELAY
|
||||
|
||||
/obj/machinery/telecomms/relay/Options_Menu()
|
||||
var/dat = ""
|
||||
dat += "<br>Broadcasting: <A href='?src=[REF(src)];broadcast=1'>[broadcasting ? "YES" : "NO"]</a>"
|
||||
dat += "<br>Receiving: <A href='?src=[REF(src)];receive=1'>[receiving ? "YES" : "NO"]</a>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/telecomms/relay/Options_Topic(href, href_list)
|
||||
|
||||
if(href_list["receive"])
|
||||
receiving = !receiving
|
||||
temp = "<font color = #666633>-% Receiving mode changed. %-</font color>"
|
||||
if(href_list["broadcast"])
|
||||
broadcasting = !broadcasting
|
||||
temp = "<font color = #666633>-% Broadcasting mode changed. %-</font color>"
|
||||
|
||||
// BUS
|
||||
|
||||
/obj/machinery/telecomms/bus/Options_Menu()
|
||||
var/dat = "<br>Change Signal Frequency: <A href='?src=[REF(src)];change_freq=1'>[change_frequency ? "YES ([change_frequency])" : "NO"]</a>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/telecomms/bus/Options_Topic(href, href_list)
|
||||
|
||||
if(href_list["change_freq"])
|
||||
|
||||
var/newfreq = input(usr, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", src, network) as null|num
|
||||
if(canAccess(usr))
|
||||
if(newfreq)
|
||||
if(findtext(num2text(newfreq), "."))
|
||||
newfreq *= 10 // shift the decimal one place
|
||||
if(newfreq < 10000)
|
||||
change_frequency = newfreq
|
||||
temp = "<font color = #666633>-% New frequency to change to assigned: \"[newfreq] GHz\" %-</font color>"
|
||||
else
|
||||
change_frequency = 0
|
||||
temp = "<font color = #666633>-% Frequency changing deactivated %-</font color>"
|
||||
|
||||
|
||||
/obj/machinery/telecomms/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(!issilicon(usr))
|
||||
if(!istype(usr.get_active_held_item(), /obj/item/multitool))
|
||||
return
|
||||
|
||||
var/obj/item/multitool/P = get_multitool(usr)
|
||||
|
||||
if(href_list["input"])
|
||||
switch(href_list["input"])
|
||||
|
||||
if("toggle")
|
||||
|
||||
toggled = !toggled
|
||||
temp = "<font color = #666633>-% [src] has been [toggled ? "activated" : "deactivated"].</font color>"
|
||||
update_power()
|
||||
|
||||
|
||||
if("id")
|
||||
var/newid = reject_bad_text(stripped_input(usr, "Specify the new ID for this machine", src, id, MAX_MESSAGE_LEN))
|
||||
if(newid && canAccess(usr))
|
||||
id = newid
|
||||
temp = "<font color = #666633>-% New ID assigned: \"[id]\" %-</font color>"
|
||||
|
||||
if("network")
|
||||
var/newnet = stripped_input(usr, "Specify the new network for this machine. This will break all current links.", src, network)
|
||||
if(newnet && canAccess(usr))
|
||||
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #666633>-% Too many characters in new network tag %-</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/T in links)
|
||||
T.links.Remove(src)
|
||||
|
||||
network = newnet
|
||||
links = list()
|
||||
temp = "<font color = #666633>-% New network tag assigned: \"[network]\" %-</font color>"
|
||||
|
||||
|
||||
if("freq")
|
||||
var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num
|
||||
if(newfreq && canAccess(usr))
|
||||
if(findtext(num2text(newfreq), "."))
|
||||
newfreq *= 10 // shift the decimal one place
|
||||
if(newfreq == FREQ_SYNDICATE)
|
||||
temp = "<font color = #FF0000>-% Error: Interference preventing filtering frequency: \"[newfreq] GHz\" %-</font color>"
|
||||
else
|
||||
if(!(newfreq in freq_listening) && newfreq < 10000)
|
||||
freq_listening.Add(newfreq)
|
||||
temp = "<font color = #666633>-% New frequency filter assigned: \"[newfreq] GHz\" %-</font color>"
|
||||
|
||||
if(href_list["delete"])
|
||||
|
||||
// changed the layout about to workaround a pesky runtime -- Doohl
|
||||
|
||||
var/x = text2num(href_list["delete"])
|
||||
temp = "<font color = #666633>-% Removed frequency filter [x] %-</font color>"
|
||||
freq_listening.Remove(x)
|
||||
|
||||
if(href_list["unlink"])
|
||||
|
||||
if(text2num(href_list["unlink"]) <= length(links))
|
||||
var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])]
|
||||
if(T)
|
||||
temp = "<font color = #666633>-% Removed [REF(T)] [T.name] from linked entities. %-</font color>"
|
||||
|
||||
// Remove link entries from both T and src.
|
||||
|
||||
if(T.links)
|
||||
T.links.Remove(src)
|
||||
links.Remove(T)
|
||||
|
||||
else
|
||||
temp = "<font color = #666633>-% Unable to locate machine to unlink from, try again. %-</font color>"
|
||||
|
||||
if(href_list["link"])
|
||||
|
||||
if(P)
|
||||
var/obj/machinery/telecomms/T = P.buffer
|
||||
if(istype(T) && T != src)
|
||||
if(!(src in T.links))
|
||||
T.links += src
|
||||
|
||||
if(!(T in links))
|
||||
links += T
|
||||
|
||||
temp = "<font color = #666633>-% Successfully linked with [REF(T)] [T.name] %-</font color>"
|
||||
|
||||
else
|
||||
temp = "<font color = #666633>-% Unable to acquire buffer %-</font color>"
|
||||
|
||||
if(href_list["buffer"])
|
||||
|
||||
P.buffer = src
|
||||
temp = "<font color = #666633>-% Successfully stored [REF(P.buffer)] [P.buffer.name] in buffer %-</font color>"
|
||||
|
||||
|
||||
if(href_list["flush"])
|
||||
|
||||
temp = "<font color = #666633>-% Buffer successfully flushed. %-</font color>"
|
||||
P.buffer = null
|
||||
|
||||
Options_Topic(href, href_list)
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/telecomms/proc/canAccess(mob/user)
|
||||
if(issilicon(user) || in_range(user, src))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -17,14 +17,15 @@
|
||||
idle_power_usage = 50
|
||||
netspeed = 40
|
||||
circuit = /obj/item/circuitboard/machine/telecomms/bus
|
||||
var/change_frequency = 0
|
||||
var/change_frequency = FALSE
|
||||
var/change_freq_value = 0
|
||||
|
||||
/obj/machinery/telecomms/bus/receive_information(datum/signal/subspace/signal, obj/machinery/telecomms/machine_from)
|
||||
if(!istype(signal) || !is_freq_listening(signal))
|
||||
return
|
||||
|
||||
if(change_frequency && signal.frequency != FREQ_SYNDICATE)
|
||||
signal.frequency = change_frequency
|
||||
if(change_frequency && (change_freq_value && signal.frequency != FREQ_SYNDICATE))
|
||||
signal.frequency = change_freq_value
|
||||
|
||||
if(!istype(machine_from, /obj/machinery/telecomms/processor) && machine_from != src) // Signal must be ready (stupid assuming machine), let's send it
|
||||
// send to one linked processor unit
|
||||
@@ -32,7 +33,7 @@
|
||||
return
|
||||
|
||||
// Try sending it!
|
||||
var/list/try_send = list(signal.server_type, /obj/machinery/telecomms/hub, /obj/machinery/telecomms/broadcaster, /obj/machinery/telecomms/bus)
|
||||
var/list/try_send = list(signal.server_type, /obj/machinery/telecomms/hub, /obj/machinery/telecomms/broadcaster)
|
||||
|
||||
for(var/send in try_send)
|
||||
if(relay_information(signal, send))
|
||||
|
||||
@@ -39,5 +39,5 @@
|
||||
network = "tcommsat"
|
||||
autolinkers = list("hub", "relay", "s_relay", "m_relay", "r_relay", "h_relay", "science", "medical",
|
||||
"supply", "service", "common", "command", "engineering", "security",
|
||||
"receiverA", "receiverB", "broadcasterA", "broadcasterB")
|
||||
"receiverA", "receiverB", "broadcasterA", "broadcasterB", "autorelay")
|
||||
|
||||
|
||||
@@ -141,11 +141,16 @@
|
||||
..()
|
||||
if(href_list["photo"])
|
||||
var/mob/M = usr
|
||||
M << browse_rsc(picture.picture_image, "pda_photo.png")
|
||||
M << browse("<html><head><title>PDA Photo</title></head>" \
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='pda_photo.png' width='192' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "</body></html>", "window=pdaphoto;size=[picture.psize_x]x[picture.psize_y];can-close=true")
|
||||
|
||||
M << browse_rsc(picture.picture_image, "pda_photo.png")
|
||||
|
||||
var/dat = "<div style='overflow: hidden; margin :0; text-align: center'>"
|
||||
dat += "<img src='pda_photo.png' width='192' style='-ms-interpolation-mode:nearest-neighbor' />"
|
||||
dat += "</div>"
|
||||
|
||||
var/datum/browser/popup = new(M, "pdaphoto", "PDA Photo", picture.psize_x, picture.psize_y)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
onclose(M, "pdaphoto")
|
||||
|
||||
/datum/data_rc_msg
|
||||
|
||||
@@ -49,6 +49,11 @@
|
||||
/obj/machinery/telecomms/relay/preset
|
||||
network = "tcommsat"
|
||||
|
||||
/obj/machinery/telecomms/relay/Initialize(mapload)
|
||||
. = ..()
|
||||
if(autolinkers.len) //We want lateloaded presets to autolink (lateloaded aways/ruins/shuttles)
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/machinery/telecomms/relay/preset/station
|
||||
id = "Station Relay"
|
||||
autolinkers = list("s_relay")
|
||||
@@ -74,3 +79,8 @@
|
||||
icon = 'icons/obj/clockwork_objects.dmi'
|
||||
hide = TRUE
|
||||
autolinkers = list("h_relay")
|
||||
|
||||
//Generic preset relay
|
||||
/obj/machinery/telecomms/relay/preset/auto
|
||||
hide = TRUE
|
||||
autolinkers = list("autorelay")
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
totaltraffic += traffic // add current traffic to total traffic
|
||||
|
||||
// Delete particularly old logs
|
||||
if (log_entries.len >= 400)
|
||||
if(LAZYLEN(log_entries) >= 400) //[list].len is not safe
|
||||
log_entries.Cut(1, 2)
|
||||
|
||||
var/datum/comm_log_entry/log = new
|
||||
|
||||
@@ -107,6 +107,7 @@ GLOBAL_LIST_EMPTY(telecomms_list)
|
||||
for(var/x in autolinkers)
|
||||
if(x in T.autolinkers)
|
||||
links |= T
|
||||
T.links |= src
|
||||
|
||||
/obj/machinery/telecomms/update_icon()
|
||||
if(on)
|
||||
@@ -121,9 +122,9 @@ GLOBAL_LIST_EMPTY(telecomms_list)
|
||||
icon_state = "[initial(icon_state)]_off"
|
||||
|
||||
/obj/machinery/telecomms/proc/update_power()
|
||||
|
||||
if(toggled)
|
||||
if(stat & (BROKEN|NOPOWER|EMPED)) // if powered, on. if not powered, off. if too damaged, off
|
||||
// if powered, on. if not powered, off. if too damaged, off
|
||||
if(CHECK_BITFIELD(stat, (BROKEN | NOPOWER | EMPED)))
|
||||
on = FALSE
|
||||
else
|
||||
on = TRUE
|
||||
@@ -141,11 +142,11 @@ GLOBAL_LIST_EMPTY(telecomms_list)
|
||||
|
||||
/obj/machinery/telecomms/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
if(CHECK_BITFIELD(., EMP_PROTECT_SELF))
|
||||
return
|
||||
if(prob(100/severity))
|
||||
if(!(stat & EMPED))
|
||||
stat |= EMPED
|
||||
var/duration = (300 * 10)/severity
|
||||
if(prob(100 / severity))
|
||||
if(!CHECK_BITFIELD(stat, EMPED))
|
||||
ENABLE_BITFIELD(stat, EMPED)
|
||||
var/duration = (300 * 10) / severity
|
||||
spawn(rand(duration - 20, duration + 20)) // Takes a long time for the machines to reboot.
|
||||
stat &= ~EMPED
|
||||
DISABLE_BITFIELD(stat, EMPED)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
|
||||
move_resist = INFINITY
|
||||
obj_flags = 0
|
||||
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
|
||||
|
||||
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
|
||||
return
|
||||
|
||||
@@ -347,12 +347,14 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
. = FALSE
|
||||
|
||||
if((mode & DESTROY_MODE) && istype(A, /obj/item/pipe) || istype(A, /obj/structure/disposalconstruct) || istype(A, /obj/structure/c_transit_tube) || istype(A, /obj/structure/c_transit_tube_pod) || istype(A, /obj/item/pipe_meter))
|
||||
to_chat(user, "<span class='notice'>You start destroying a pipe...</span>")
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
|
||||
if(do_after(user, destroy_speed, target = A))
|
||||
activate()
|
||||
qdel(A)
|
||||
return
|
||||
var/obj/item/pipe/P = A
|
||||
if(!istype(P) || P.disposable)
|
||||
to_chat(user, "<span class='notice'>You start destroying a pipe...</span>")
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
|
||||
if(do_after(user, destroy_speed, target = A))
|
||||
activate()
|
||||
qdel(A)
|
||||
return
|
||||
|
||||
if((mode & PAINT_MODE))
|
||||
if(istype(A, /obj/machinery/atmospherics/pipe) && !istype(A, /obj/machinery/atmospherics/pipe/layer_manifold))
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
new/obj/structure/fluff/empty_terrarium(get_turf(src))
|
||||
return ..()
|
||||
|
||||
/obj/effect/mob_spawn/human/seed_vault/special(mob/living/carbon/human/new_spawn)
|
||||
ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
|
||||
//Ash walker eggs: Spawns in ash walker dens in lavaland. Ghosts become unbreathing lizards that worship the Necropolis and are advised to retrieve corpses to create more ash walkers.
|
||||
|
||||
/obj/effect/mob_spawn/human/ash_walker
|
||||
@@ -262,6 +264,9 @@
|
||||
new/obj/structure/fluff/empty_cryostasis_sleeper(get_turf(src))
|
||||
return ..()
|
||||
|
||||
/obj/effect/mob_spawn/human/hermit/special(mob/living/carbon/human/new_spawn)
|
||||
ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
|
||||
|
||||
//Broken rejuvenation pod: Spawns in animal hospitals in lavaland. Ghosts become disoriented interns and are advised to search for help.
|
||||
/obj/effect/mob_spawn/human/doctor/alive/lavaland
|
||||
name = "broken rejuvenation pod"
|
||||
@@ -371,6 +376,9 @@
|
||||
new/obj/structure/fluff/empty_sleeper/syndicate(get_turf(src))
|
||||
..()
|
||||
|
||||
/obj/effect/mob_spawn/human/hotel_staff/special(mob/living/carbon/human/new_spawn)
|
||||
ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
|
||||
|
||||
/obj/effect/mob_spawn/human/demonic_friend
|
||||
name = "Essence of friendship"
|
||||
desc = "Oh boy! Oh boy! A friend!"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
has_starlight = FALSE
|
||||
else
|
||||
for(var/turf/T in view(3, src))
|
||||
if(isspaceturf(T))
|
||||
if(isspaceturf(T) || iscloudturf(T))
|
||||
has_starlight = TRUE
|
||||
break
|
||||
if(has_starlight && anchored)
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
GLOBAL_LIST_EMPTY(bluespace_pipe_networks)
|
||||
/obj/machinery/atmospherics/pipe/bluespace
|
||||
name = "bluespace pipe"
|
||||
desc = "Transmits gas across large distances of space. Developed using bluespace technology."
|
||||
icon = 'icons/obj/atmospherics/pipes/bluespace.dmi'
|
||||
icon_state = "map"
|
||||
pipe_state = "bluespace"
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
device_type = UNARY
|
||||
can_buckle = FALSE
|
||||
construction_type = /obj/item/pipe/bluespace
|
||||
var/bluespace_network_name
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/New()
|
||||
icon_state = "pipe"
|
||||
if(bluespace_network_name) // in case someone maps one in for some reason
|
||||
if(!GLOB.bluespace_pipe_networks[bluespace_network_name])
|
||||
GLOB.bluespace_pipe_networks[bluespace_network_name] = list()
|
||||
GLOB.bluespace_pipe_networks[bluespace_network_name] |= src
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/on_construction()
|
||||
. = ..()
|
||||
if(bluespace_network_name)
|
||||
if(!GLOB.bluespace_pipe_networks[bluespace_network_name])
|
||||
GLOB.bluespace_pipe_networks[bluespace_network_name] = list()
|
||||
GLOB.bluespace_pipe_networks[bluespace_network_name] |= src
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/Destroy()
|
||||
if(GLOB.bluespace_pipe_networks[bluespace_network_name])
|
||||
GLOB.bluespace_pipe_networks[bluespace_network_name] -= src
|
||||
for(var/p in GLOB.bluespace_pipe_networks[bluespace_network_name])
|
||||
var/obj/machinery/atmospherics/pipe/bluespace/P = p
|
||||
QDEL_NULL(P.parent)
|
||||
P.build_network()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/examine(user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>This one is connected to the \"[html_encode(bluespace_network_name)]\" network.</span>"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/SetInitDirections()
|
||||
initialize_directions = dir
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/pipeline_expansion()
|
||||
return ..() + GLOB.bluespace_pipe_networks[bluespace_network_name] - src
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/hide()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/update_icon(showpipe)
|
||||
underlays.Cut()
|
||||
|
||||
var/turf/T = loc
|
||||
if(level == 2 || !T.intact)
|
||||
showpipe = TRUE
|
||||
plane = GAME_PLANE
|
||||
else
|
||||
showpipe = FALSE
|
||||
plane = FLOOR_PLANE
|
||||
|
||||
if(!showpipe)
|
||||
return //no need to update the pipes if they aren't showing
|
||||
|
||||
var/connected = 0 //Direction bitset
|
||||
|
||||
for(var/i in 1 to device_type) //adds intact pieces
|
||||
if(nodes[i])
|
||||
var/obj/machinery/atmospherics/node = nodes[i]
|
||||
var/image/img = get_pipe_underlay("pipe_intact", get_dir(src, node), node.pipe_color)
|
||||
underlays += img
|
||||
connected |= img.dir
|
||||
|
||||
for(var/direction in GLOB.cardinals)
|
||||
if((initialize_directions & direction) && !(connected & direction))
|
||||
underlays += get_pipe_underlay("pipe_exposed", direction)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/paint()
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/proc/get_pipe_underlay(state, dir, color = null)
|
||||
if(color)
|
||||
. = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir, color)
|
||||
else
|
||||
. = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir)
|
||||
@@ -0,0 +1,110 @@
|
||||
// welcome to the jungle, we got fun and games
|
||||
|
||||
//areas
|
||||
|
||||
/area/awaymission/jungleresort
|
||||
name = "Jungle Resort"
|
||||
icon_state = "awaycontent30"
|
||||
requires_power = FALSE
|
||||
|
||||
//objects
|
||||
|
||||
/obj/item/paper/crumpled/awaymissions/jungleresort/notice
|
||||
name = "Resort Notice"
|
||||
info = "Due to unforeseen circumstances and the disappearance of several resort employees and visitors, the resort shall be closed to the public until further notice. - <i>Resort Manager Joe Lawrence</i.>"
|
||||
|
||||
/obj/item/melee/chainofcommand/jungle
|
||||
name = "treasure hunter's whip"
|
||||
desc = "The tool of a fallen treasure hunter, old and outdated, it still stings like hell to be hit by."
|
||||
hitsound = 'sound/weapons/whip.ogg'
|
||||
icon_state = "whip"
|
||||
|
||||
/obj/item/clothing/suit/hooded/wintercoat/captain/jungle
|
||||
armor = list("melee" = 5, "bullet" = 5, "laser" = 5, "energy" = 0, "bomb" = 0, "bio" = 10, "rad" = 0, "fire" = 0, "acid" = 0)
|
||||
|
||||
/obj/item/clothing/head/rice_hat/cursed // this was a stupid idea lmao
|
||||
name = "cursed rice hat"
|
||||
desc = "Welcome to the rice fields, motherfucker. This particular one seems to give you second thoughts about wearing it."
|
||||
|
||||
/obj/item/clothing/head/rice_hat/cursed/equipped(mob/M, slot)
|
||||
. = ..()
|
||||
if (slot == SLOT_HEAD)
|
||||
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
|
||||
else
|
||||
UnregisterSignal(M, COMSIG_MOB_SAY)
|
||||
|
||||
/obj/item/clothing/head/rice_hat/cursed/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, SHAMEBRERO_TRAIT)
|
||||
|
||||
/obj/item/clothing/head/rice_hat/cursed/proc/handle_speech(datum/source, list/speech_args)
|
||||
var/message = speech_args[SPEECH_MESSAGE]
|
||||
if(message[1] != "*")
|
||||
var/list/temp_message = splittext(message, " ")
|
||||
var/list/pick_list = list()
|
||||
for(var/i in 1 to temp_message.len)
|
||||
pick_list += i
|
||||
for(var/i in 1 to abs(temp_message.len/3))
|
||||
var/H = pick(pick_list)
|
||||
if(findtext(temp_message[H], "*") || findtext(temp_message[H], ";") || findtext(temp_message[H], ":"))
|
||||
continue
|
||||
temp_message[H] = ninjaspeak(temp_message[H])
|
||||
pick_list -= H
|
||||
message = temp_message.Join(" ")
|
||||
|
||||
//The Alternate speech mod is now the main one.
|
||||
message = replacetext(message, "l", "r")
|
||||
message = replacetext(message, "rr", "ru")
|
||||
message = replacetext(message, "v", "b")
|
||||
message = replacetext(message, "f", "hu")
|
||||
message = replacetext(message, "'t", "")
|
||||
message = replacetext(message, "t ", "to ")
|
||||
message = replacetext(message, " I ", " ai ")
|
||||
message = replacetext(message, "th", "z")
|
||||
message = replacetext(message, "is", "izu")
|
||||
message = replacetext(message, "ziz", "zis")
|
||||
message = replacetext(message, "se", "su")
|
||||
message = replacetext(message, "br", "bur")
|
||||
message = replacetext(message, "ry", "ri")
|
||||
message = replacetext(message, "you", "yuu")
|
||||
message = replacetext(message, "ck", "cku")
|
||||
message = replacetext(message, "eu", "uu")
|
||||
message = replacetext(message, "ow", "au")
|
||||
message = replacetext(message, "are", "aa")
|
||||
message = replacetext(message, "ay", "ayu")
|
||||
message = replacetext(message, "ea", "ii")
|
||||
message = replacetext(message, "ch", "chi")
|
||||
message = replacetext(message, "than", "sen")
|
||||
message = replacetext(message, ".", "")
|
||||
message = lowertext(message)
|
||||
speech_args[SPEECH_MESSAGE] = message
|
||||
|
||||
//turfs
|
||||
|
||||
/turf/open/water/jungle
|
||||
initial_gas_mix = "o2=22;n2=82;TEMP=293.15"
|
||||
|
||||
/turf/open/floor/plating/dirt/jungle
|
||||
initial_gas_mix = "o2=22;n2=82;TEMP=293.15"
|
||||
|
||||
/turf/open/floor/plating/dirt/dark/jungle
|
||||
initial_gas_mix = "o2=22;n2=82;TEMP=293.15"
|
||||
|
||||
/turf/closed/mineral/random/labormineral/jungle
|
||||
baseturfs = /turf/open/floor/plating/asteroid
|
||||
turf_type = /turf/open/floor/plating/asteroid
|
||||
|
||||
//mobs
|
||||
|
||||
/mob/living/carbon/monkey/punpun/curiousgorge
|
||||
name = "Curious Gorge"
|
||||
pet_monkey_names = list("Curious Gorge", "Jungle Gorge", "Jungah Joe", "Mr. Monke")
|
||||
rare_pet_monkey_names = list("Sun Mukong", "Monkey Kong")
|
||||
|
||||
/mob/living/simple_animal/hostile/jungle/leaper/boss
|
||||
health = 550
|
||||
name = "Froggerosa"
|
||||
|
||||
/mob/living/simple_animal/hostile/gorilla/jungle
|
||||
tame = 1
|
||||
faction = list("neutral")
|
||||
@@ -37,6 +37,8 @@
|
||||
continue
|
||||
if(!H.client)
|
||||
continue
|
||||
if(HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS))
|
||||
continue
|
||||
if(H.stat == DEAD)
|
||||
continue
|
||||
if(HAS_TRAIT(H, TRAIT_VIRUSIMMUNE)) //Don't pick someone who's virus immune, only for it to not do anything.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/datum/round_event/heart_attack/start()
|
||||
var/list/heart_attack_contestants = list()
|
||||
for(var/mob/living/carbon/human/H in shuffle(GLOB.player_list))
|
||||
if(!H.client || H.z != SSmapping.station_start || H.stat == DEAD || H.InCritical() || !H.can_heartattack() || H.has_status_effect(STATUS_EFFECT_EXERCISED) || (/datum/disease/heart_failure in H.diseases) || H.undergoing_cardiac_arrest())
|
||||
if(!H.client || H.z != SSmapping.station_start || H.stat == DEAD || H.InCritical() || !H.can_heartattack() || H.has_status_effect(STATUS_EFFECT_EXERCISED) || (/datum/disease/heart_failure in H.diseases) || H.undergoing_cardiac_arrest() || HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS))
|
||||
continue
|
||||
if(H.satiety <= -60) //Multiple junk food items recently
|
||||
heart_attack_contestants[H] = 3
|
||||
|
||||
@@ -35,4 +35,6 @@
|
||||
/datum/hallucination/delusion,
|
||||
/datum/hallucination/oh_yeah)
|
||||
for(var/mob/living/carbon/C in GLOB.alive_mob_list)
|
||||
new picked_hallucination(C, TRUE)
|
||||
if(HAS_TRAIT(C,TRAIT_EXEMPT_HEALTH_EVENTS))
|
||||
continue
|
||||
new picked_hallucination(C, TRUE)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
continue
|
||||
if(H.z != SSmapping.station_start) //Let's not fucking give Appendicitis to ghost roles or people not on station, shall we?
|
||||
continue
|
||||
if(HAS_TRAIT(H,TRAIT_EXEMPT_HEALTH_EVENTS)) //Do they have the trait that makes them exempt from health conditions?
|
||||
continue
|
||||
if(!H.getorgan(/obj/item/organ/appendix)) //Don't give the disease to some who lacks it, only for it to be auto-cured
|
||||
continue
|
||||
if(!(MOB_ORGANIC & H.mob_biotypes)) //biotype sleeper bugs strike again, once again making appendicitis pick a target that can't take it
|
||||
|
||||
@@ -1,86 +1,96 @@
|
||||
|
||||
/////////////////////////////////////////
|
||||
//////////////Blue Space/////////////////
|
||||
/////////////////////////////////////////
|
||||
|
||||
/datum/design/beacon
|
||||
name = "Tracking Beacon"
|
||||
desc = "A blue space tracking beacon."
|
||||
id = "beacon"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 150, MAT_GLASS = 100)
|
||||
build_path = /obj/item/beacon
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO | DEPARTMENTAL_FLAG_SECURITY
|
||||
|
||||
/datum/design/bag_holding
|
||||
name = "Bag of Holding"
|
||||
desc = "A backpack that opens into a localized pocket of bluespace."
|
||||
id = "bag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/satchel_holding
|
||||
name = "Satchel of Holding"
|
||||
desc = "A satchel that opens into a localized pocket of bluespace."
|
||||
id = "satchel_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding/satchel
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/biobag_holding
|
||||
name = "Bio Bag of Holding"
|
||||
desc = "A chemical holding thingy. Mostly used for xenobiology."
|
||||
id = "biobag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 1500, MAT_DIAMOND = 750, MAT_URANIUM = 250, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/storage/bag/bio/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/bluespace_crystal
|
||||
name = "Artificial Bluespace Crystal"
|
||||
desc = "A small blue crystal with mystical properties."
|
||||
id = "bluespace_crystal"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_DIAMOND = 1500, MAT_PLASMA = 1500)
|
||||
build_path = /obj/item/stack/ore/bluespace_crystal/artificial
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/telesci_gps
|
||||
name = "GPS Device"
|
||||
desc = "Little thingie that can track its position at all times."
|
||||
id = "telesci_gps"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 500, MAT_GLASS = 1000)
|
||||
build_path = /obj/item/gps
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/desynchronizer
|
||||
name = "Desynchronizer"
|
||||
desc = "A device that can desynchronize the user from spacetime."
|
||||
id = "desynchronizer"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 1000, MAT_GLASS = 500, MAT_SILVER = 1500, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/desynchronizer
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/miningsatchel_holding
|
||||
name = "Mining Satchel of Holding"
|
||||
desc = "A mining satchel that can hold an infinite amount of ores."
|
||||
id = "minerbag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 250, MAT_URANIUM = 500) //quite cheap, for more convenience
|
||||
build_path = /obj/item/storage/bag/ore/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/////////////////////////////////////////
|
||||
//////////////Blue Space/////////////////
|
||||
/////////////////////////////////////////
|
||||
|
||||
/datum/design/beacon
|
||||
name = "Tracking Beacon"
|
||||
desc = "A blue space tracking beacon."
|
||||
id = "beacon"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 150, MAT_GLASS = 100)
|
||||
build_path = /obj/item/beacon
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO | DEPARTMENTAL_FLAG_SECURITY
|
||||
|
||||
/datum/design/bag_holding
|
||||
name = "Bag of Holding"
|
||||
desc = "A backpack that opens into a localized pocket of bluespace."
|
||||
id = "bag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/satchel_holding
|
||||
name = "Satchel of Holding"
|
||||
desc = "A satchel that opens into a localized pocket of bluespace."
|
||||
id = "satchel_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 3000, MAT_DIAMOND = 1500, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/storage/backpack/holding/satchel
|
||||
category = list("Bluespace Designs")
|
||||
dangerous_construction = TRUE
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/biobag_holding
|
||||
name = "Bio Bag of Holding"
|
||||
desc = "A chemical holding thingy. Mostly used for xenobiology."
|
||||
id = "biobag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 1500, MAT_DIAMOND = 750, MAT_URANIUM = 250, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/storage/bag/bio/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/bluespace_crystal
|
||||
name = "Artificial Bluespace Crystal"
|
||||
desc = "A small blue crystal with mystical properties."
|
||||
id = "bluespace_crystal"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_DIAMOND = 1500, MAT_PLASMA = 1500)
|
||||
build_path = /obj/item/stack/ore/bluespace_crystal/artificial
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/telesci_gps
|
||||
name = "GPS Device"
|
||||
desc = "Little thingie that can track its position at all times."
|
||||
id = "telesci_gps"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 500, MAT_GLASS = 1000)
|
||||
build_path = /obj/item/gps
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/desynchronizer
|
||||
name = "Desynchronizer"
|
||||
desc = "A device that can desynchronize the user from spacetime."
|
||||
id = "desynchronizer"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 1000, MAT_GLASS = 500, MAT_SILVER = 1500, MAT_BLUESPACE = 1000)
|
||||
build_path = /obj/item/desynchronizer
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE
|
||||
|
||||
/datum/design/miningsatchel_holding
|
||||
name = "Mining Satchel of Holding"
|
||||
desc = "A mining satchel that can hold an infinite amount of ores."
|
||||
id = "minerbag_holding"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 250, MAT_URANIUM = 500) //quite cheap, for more convenience
|
||||
build_path = /obj/item/storage/bag/ore/holding
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_CARGO
|
||||
|
||||
/datum/design/bluespace_pipe
|
||||
name = "Bluespace Pipe"
|
||||
desc = "A pipe that teleports gases."
|
||||
id = "bluespace_pipe"
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_GOLD = 1000, MAT_DIAMOND = 750, MAT_URANIUM = 250, MAT_BLUESPACE = 2000)
|
||||
build_path = /obj/item/pipe/bluespace
|
||||
category = list("Bluespace Designs")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
display_name = "Bluespace Travel"
|
||||
description = "Application of Bluespace for static teleportation technology."
|
||||
prereq_ids = list("adv_power", "adv_bluespace")
|
||||
design_ids = list("tele_station", "tele_hub", "quantumpad", "quantum_keycard", "launchpad", "launchpad_console", "teleconsole", "roastingstick")
|
||||
design_ids = list("tele_station", "tele_hub", "quantumpad", "quantum_keycard", "launchpad", "launchpad_console", "teleconsole", "roastingstick", "bluespace_pipe")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500)
|
||||
export_price = 5000
|
||||
|
||||
|
||||
@@ -74,14 +74,6 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
|
||||
var/obj/item/vending_refill/refill_canister = null //The type of refill canisters used by this machine
|
||||
|
||||
//tilting stuff
|
||||
var/tilted = FALSE
|
||||
var/tiltable = TRUE
|
||||
var/squish_damage = 75
|
||||
var/forcecrit = 0
|
||||
var/num_shards = 7
|
||||
var/list/pinned_mobs = list()
|
||||
|
||||
//hyper economy stuff
|
||||
var/credits = 0
|
||||
var/baseprice = 0
|
||||
@@ -110,7 +102,6 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
power_change()
|
||||
|
||||
/obj/machinery/vending/Destroy()
|
||||
unbuckle_all_mobs(TRUE)
|
||||
QDEL_NULL(wires)
|
||||
QDEL_NULL(coin)
|
||||
QDEL_NULL(bill)
|
||||
@@ -239,7 +230,6 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
/obj/machinery/vending/wrench_act(mob/living/user, obj/item/I)
|
||||
if(panel_open)
|
||||
default_unfasten_wrench(user, I, time = 60)
|
||||
unbuckle_all_mobs(TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/vending/screwdriver_act(mob/living/user, obj/item/I)
|
||||
@@ -317,133 +307,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
to_chat(user, "<span class='notice'>There's nothing to restock!</span>")
|
||||
return
|
||||
else
|
||||
. = ..()
|
||||
if(tiltable && !tilted && I.force)
|
||||
switch(rand(1, 100))
|
||||
if(1 to 5)
|
||||
freebie(user, 3)
|
||||
if(6 to 15)
|
||||
freebie(user, 2)
|
||||
if(16 to 25)
|
||||
freebie(user, 1)
|
||||
if(76 to 90)
|
||||
tilt(user)
|
||||
if(91 to 100)
|
||||
tilt(user, crit=TRUE)
|
||||
|
||||
/obj/machinery/vending/proc/freebie(mob/fatty, freebies)
|
||||
visible_message("<span class='notice'>[src] yields [freebies > 1 ? "several free goodies" : "a free goody"]!</span>")
|
||||
|
||||
for(var/i in 1 to freebies)
|
||||
playsound(src, 'sound/items/vending.ogg', 50, TRUE, extrarange = -3)
|
||||
for(var/datum/data/vending_product/R in shuffle(product_records))
|
||||
|
||||
if(R.amount <= 0) //Try to use a record that actually has something to dump.
|
||||
continue
|
||||
var/dump_path = R.product_path
|
||||
if(!dump_path)
|
||||
continue
|
||||
|
||||
R.amount--
|
||||
new dump_path(get_turf(src))
|
||||
break
|
||||
|
||||
/obj/machinery/vending/proc/tilt(mob/fatty, crit=FALSE)
|
||||
visible_message("<span class='danger'>[src] tips over!</span>")
|
||||
tilted = TRUE
|
||||
layer = ABOVE_MOB_LAYER
|
||||
|
||||
var/crit_case
|
||||
if(crit)
|
||||
crit_case = rand(1,5)
|
||||
|
||||
if(forcecrit)
|
||||
crit_case = forcecrit
|
||||
|
||||
if(in_range(fatty, src))
|
||||
for(var/mob/living/L in get_turf(fatty))
|
||||
var/mob/living/carbon/C = L
|
||||
|
||||
if(istype(C))
|
||||
var/crit_rebate = 0 // lessen the normal damage we deal for some of the crits
|
||||
|
||||
if(crit_case != 5) // the head asplode case has its own description
|
||||
C.visible_message("<span class='danger'>[C] is crushed by [src]!</span>", \
|
||||
"<span class='userdanger'>You are crushed by [src]!</span>")
|
||||
|
||||
switch(crit_case) // only carbons can have the fun crits
|
||||
if(1) // shatter their legs and bleed 'em
|
||||
crit_rebate = 60
|
||||
C.bleed(150)
|
||||
var/obj/item/bodypart/l_leg/l = C.get_bodypart(BODY_ZONE_L_LEG)
|
||||
if(l)
|
||||
l.receive_damage(brute=200, updating_health=TRUE)
|
||||
var/obj/item/bodypart/r_leg/r = C.get_bodypart(BODY_ZONE_R_LEG)
|
||||
if(r)
|
||||
r.receive_damage(brute=200, updating_health=TRUE)
|
||||
if(l || r)
|
||||
C.visible_message("<span class='danger'>[C]'s legs shatter with a sickening crunch!</span>", \
|
||||
"<span class='userdanger'>Your legs shatter with a sickening crunch!</span>")
|
||||
if(2) // pin them beneath the machine until someone untilts it
|
||||
forceMove(get_turf(C))
|
||||
buckle_mob(C, force=TRUE)
|
||||
C.visible_message("<span class='danger'>[C] is pinned underneath [src]!</span>", \
|
||||
"<span class='userdanger'>You are pinned down by [src]!</span>")
|
||||
if(3) // glass candy
|
||||
crit_rebate = 50
|
||||
for(var/i = 0, i < num_shards, i++)
|
||||
var/obj/item/shard/shard = new /obj/item/shard(get_turf(C))
|
||||
shard.embedding = shard.embedding.setRating(embed_chance = 100)
|
||||
C.hitby(shard, skipcatch = TRUE, hitpush = FALSE)
|
||||
shard.embedding = shard.embedding.setRating(embed_chance = EMBED_CHANCE)
|
||||
if(4) // paralyze this binch
|
||||
// the new paraplegic gets like 4 lines of losing their legs so skip them
|
||||
visible_message("<span class='danger'>[C]'s spinal cord is obliterated with a sickening crunch!</span>", ignored_mobs = list(C))
|
||||
C.gain_trauma(/datum/brain_trauma/severe/paralysis/paraplegic)
|
||||
if(5) // skull squish!
|
||||
var/obj/item/bodypart/head/O = C.get_bodypart(BODY_ZONE_HEAD)
|
||||
if(O)
|
||||
C.visible_message("<span class='danger'>[O] explodes in a shower of gore beneath [src]!</span>", \
|
||||
"<span class='userdanger'>Oh f-</span>")
|
||||
O.dismember()
|
||||
O.drop_organs()
|
||||
qdel(O)
|
||||
new /obj/effect/gibspawner/human/bodypartless(get_turf(C))
|
||||
C.apply_damage(max(0, squish_damage - crit_rebate), BRUTE)
|
||||
C.AddElement(/datum/element/squish, 60 SECONDS)
|
||||
else
|
||||
L.visible_message("<span class='danger'>[L] is crushed by [src]!</span>", \
|
||||
"<span class='userdanger'>You are crushed by [src]!</span>")
|
||||
L.apply_damage(squish_damage, BRUTE)
|
||||
if(crit_case)
|
||||
L.apply_damage(squish_damage, BRUTE)
|
||||
|
||||
//L.Paralyze(60) We don't have paralyze, too bad.
|
||||
L.Stun(60, TRUE, TRUE)
|
||||
L.Knockdown(60)
|
||||
L.emote("scream")
|
||||
playsound(L, 'sound/effects/blobattack.ogg', 40, TRUE)
|
||||
playsound(L, 'sound/effects/splat.ogg', 50, TRUE)
|
||||
|
||||
var/matrix/M = matrix()
|
||||
M.Turn(pick(90, 270))
|
||||
transform = M
|
||||
|
||||
if(get_turf(fatty) != get_turf(src))
|
||||
throw_at(get_turf(fatty), 1, 1, spin=FALSE)
|
||||
|
||||
/obj/machinery/vending/proc/untilt(mob/user)
|
||||
user.visible_message("<span class='notice'>[user] rights [src].", \
|
||||
"<span class='notice'>You right [src].")
|
||||
|
||||
unbuckle_all_mobs(TRUE)
|
||||
|
||||
tilted = FALSE
|
||||
layer = initial(layer)
|
||||
|
||||
var/matrix/M = matrix()
|
||||
M.Turn(0)
|
||||
transform = M
|
||||
return ..()
|
||||
|
||||
/obj/machinery/vending/exchange_parts(mob/user, obj/item/storage/part_replacer/W)
|
||||
if(!istype(W))
|
||||
@@ -481,11 +345,6 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
if(seconds_electrified && !(stat & NOPOWER))
|
||||
if(shock(user, 100))
|
||||
return
|
||||
if(tilted && !user.buckled)
|
||||
to_chat(user, "<span class='notice'>You begin righting \the [src].")
|
||||
if(do_after(user, 50, target=src))
|
||||
untilt(user)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/vending/ui_interact(mob/user)
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
armor = list("melee" = 100, "bullet" = 100, "laser" = 100, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50)
|
||||
resistance_flags = FIRE_PROOF
|
||||
refill_canister = /obj/item/vending_refill/wallmed
|
||||
tiltable = FALSE
|
||||
|
||||
/obj/item/vending_refill/wallmed
|
||||
machine_name = "NanoMed"
|
||||
|
||||
Reference in New Issue
Block a user