This commit is contained in:
LetterN
2021-10-28 17:34:52 +08:00
parent 49940c373e
commit f7b898a2a9
346 changed files with 13714 additions and 8493 deletions
+6
View File
@@ -417,6 +417,12 @@
///from /obj/machinery/obj_break(damage_flag): (damage_flag)
#define COMSIG_MACHINERY_BROKEN "machinery_broken"
// /obj/machinery/power/supermatter_crystal signals
/// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM delam reaches the point of sounding alarms
#define COMSIG_SUPERMATTER_DELAM_START_ALARM "sm_delam_start_alarm"
/// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM sounds an audible alarm
#define COMSIG_SUPERMATTER_DELAM_ALARM "sm_delam_alarm"
// /obj/item signals
#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
#define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //from base of obj/item/attack_self(): (/mob)
+18 -11
View File
@@ -48,32 +48,39 @@
#define MC_CHARGE "CHARGE"
#define MC_AI "AI"
#define MC_SENSORS "SENSORS"
#define MC_SIGNALER "SIGNALER"
//NTNet stuff, for modular computers
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
#define NTNET_COMMUNICATION 3 // Communication (messaging)
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
#define NTNET_SOFTWAREDOWNLOAD 1 // Downloads of software from NTNet
#define NTNET_PEERTOPEER 2 // P2P transfers of files between devices
#define NTNET_COMMUNICATION 3 // Communication (messaging)
#define NTNET_SYSTEMCONTROL 4 // Control of various systems, RCon, air alarm control, etc.
//NTNet transfer speeds, used when downloading/uploading a file/program.
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
#define NTNETSPEED_LOWSIGNAL 0.5 // GQ/s transfer speed when the device is wirelessly connected and on Low signal
#define NTNETSPEED_HIGHSIGNAL 1 // GQ/s transfer speed when the device is wirelessly connected and on High signal
#define NTNETSPEED_ETHERNET 2 // GQ/s transfer speed when the device is using wired connection
//Caps for NTNet logging. Less than 10 would make logging useless anyway, more than 500 may make the log browser too laggy. Defaults to 100 unless user changes it.
#define MAX_NTNET_LOGS 300
#define MIN_NTNET_LOGS 10
//Program bitflags
#define PROGRAM_ALL (~0)
#define PROGRAM_CONSOLE (1<<0)
#define PROGRAM_LAPTOP (1<<1)
#define PROGRAM_TABLET (1<<2)
#define PROGRAM_ALL (~0)
#define PROGRAM_CONSOLE (1<<0)
#define PROGRAM_LAPTOP (1<<1)
#define PROGRAM_TABLET (1<<2)
//Program states
#define PROGRAM_STATE_KILLED 0
#define PROGRAM_STATE_BACKGROUND 1
#define PROGRAM_STATE_ACTIVE 2
//Program categories
#define PROGRAM_CATEGORY_CREW "Crew"
#define PROGRAM_CATEGORY_ENGI "Engineering"
#define PROGRAM_CATEGORY_ROBO "Robotics"
#define PROGRAM_CATEGORY_SUPL "Supply"
#define PROGRAM_CATEGORY_MISC "Other"
#define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2
+1
View File
@@ -323,6 +323,7 @@ GLOBAL_LIST_INIT(pda_reskins, list(PDA_SKIN_CLASSIC = 'icons/obj/pda.dmi', PDA_S
#define FIRST_DIAG_STEP 1
#define SECOND_DIAG_STEP 2
#define DEADCHAT_ANNOUNCEMENT "announcement"
#define DEADCHAT_ARRIVALRATTLE "arrivalrattle"
#define DEADCHAT_DEATHRATTLE "deathrattle"
#define DEADCHAT_REGULAR "regular-deadchat"
@@ -0,0 +1,3 @@
PROCESSING_SUBSYSTEM_DEF(sound_loops)
name = "Sound Loops"
priority = FIRE_PRIORITY_SOUND_LOOPS
+1 -1
View File
@@ -125,7 +125,7 @@
// Append radio icon if from a virtual speaker
if (extra_classes.Find("virtual-speaker"))
var/image/r_icon = image('icons/UI_Icons/chat/chat_icons.dmi', icon_state = "radio")
var/image/r_icon = image('icons/ui_icons/chat/chat_icons.dmi', icon_state = "radio")
text = "\icon[r_icon]&nbsp;" + text
// We dim italicized text to make it more distinguishable from regular text
+47 -34
View File
@@ -1,21 +1,21 @@
/*
output_atoms (list of atoms) The destination(s) for the sounds
output_atoms (list of atoms) The destination(s) for the sounds
mid_sounds (list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end.
mid_length (num) The length to wait between playing mid_sounds
mid_sounds (list or soundfile) Since this can be either a list or a single soundfile you can have random sounds. May contain further lists but must contain a soundfile at the end.
mid_length (num) The length to wait between playing mid_sounds
start_sound (soundfile) Played before starting the mid_sounds loop
start_length (num) How long to wait before starting the main loop after playing start_sound
start_sound (soundfile) Played before starting the mid_sounds loop
start_length (num) How long to wait before starting the main loop after playing start_sound
end_sound (soundfile) The sound played after the main loop has concluded
end_sound (soundfile) The sound played after the main loop has concluded
chance (num) Chance per loop to play a mid_sound
volume (num) Sound output volume
max_loops (num) The max amount of loops to run for.
direct (bool) If true plays directly to provided atoms instead of from them
chance (num) Chance per loop to play a mid_sound
volume (num) Sound output volume
max_loops (num) The max amount of loops to run for.
direct (bool) If true plays directly to provided atoms instead of from them
*/
/datum/looping_sound
var/list/atom/output_atoms
var/atom/parent
var/mid_sounds
var/mid_length
///Override for volume of start sound
@@ -34,38 +34,46 @@
var/falloff_exponent
var/timerid
var/falloff_distance
var/skip_starting_sounds = FALSE
var/loop_started = FALSE
/datum/looping_sound/New(list/_output_atoms=list(), start_immediately=FALSE, _direct=FALSE)
/datum/looping_sound/New(_parent, start_immediately=FALSE, _direct=FALSE, _skip_starting_sounds = FALSE)
if(!mid_sounds)
WARNING("A looping sound datum was created without sounds to play.")
return
output_atoms = _output_atoms
set_parent(_parent)
direct = _direct
skip_starting_sounds = _skip_starting_sounds
if(start_immediately)
start()
/datum/looping_sound/Destroy()
stop()
output_atoms = null
stop(TRUE)
return ..()
/datum/looping_sound/proc/start(atom/add_thing)
if(add_thing)
output_atoms |= add_thing
/datum/looping_sound/proc/start(on_behalf_of)
if(on_behalf_of)
set_parent(on_behalf_of)
if(timerid)
return
on_start()
/datum/looping_sound/proc/stop(atom/remove_thing)
if(remove_thing)
output_atoms -= remove_thing
/datum/looping_sound/proc/stop(null_parent)
if(null_parent)
set_parent(null)
if(!timerid)
return
on_stop()
deltimer(timerid)
deltimer(timerid, SSsound_loops)
timerid = null
loop_started = FALSE
/datum/looping_sound/proc/start_sound_loop()
loop_started = TRUE
sound_loop()
timerid = addtimer(CALLBACK(src, .proc/sound_loop, world.time), mid_length, TIMER_CLIENT_TIME | TIMER_STOPPABLE | TIMER_LOOP | TIMER_DELETE_ME, SSsound_loops)
/datum/looping_sound/proc/sound_loop(starttime)
if(max_loops && world.time >= starttime + mid_length * max_loops)
@@ -73,21 +81,15 @@
return
if(!chance || prob(chance))
play(get_sound(starttime))
if(!timerid)
timerid = addtimer(CALLBACK(src, .proc/sound_loop, world.time), mid_length, TIMER_CLIENT_TIME | TIMER_STOPPABLE | TIMER_LOOP)
/datum/looping_sound/proc/play(soundfile, volume_override)
var/list/atoms_cache = output_atoms
var/sound/S = sound(soundfile)
if(direct)
S.channel = SSsounds.random_available_channel()
S.volume = volume_override || volume //Use volume as fallback if theres no override
for(var/i in 1 to atoms_cache.len)
var/atom/thing = atoms_cache[i]
if(direct)
SEND_SOUND(thing, S)
else
playsound(thing, S, volume, vary, extra_range, falloff_exponent = falloff_exponent, falloff_distance = falloff_distance)
SEND_SOUND(parent, S)
else
playsound(parent, S, volume, vary, extra_range, falloff_exponent = falloff_exponent, falloff_distance = falloff_distance)
/datum/looping_sound/proc/get_sound(starttime, _mid_sounds)
. = _mid_sounds || mid_sounds
@@ -96,11 +98,22 @@
/datum/looping_sound/proc/on_start()
var/start_wait = 0
if(start_sound)
if(start_sound && !skip_starting_sounds)
play(start_sound, start_volume)
start_wait = start_length
addtimer(CALLBACK(src, .proc/sound_loop), start_wait, TIMER_CLIENT_TIME)
timerid = addtimer(CALLBACK(src, .proc/start_sound_loop), start_wait, TIMER_CLIENT_TIME | TIMER_DELETE_ME | TIMER_STOPPABLE, SSsound_loops)
/datum/looping_sound/proc/on_stop()
if(end_sound)
if(end_sound && loop_started)
play(end_sound, end_volume)
/datum/looping_sound/proc/set_parent(new_parent)
if(parent)
UnregisterSignal(parent, COMSIG_PARENT_QDELETING)
parent = new_parent
if(parent)
RegisterSignal(parent, COMSIG_PARENT_QDELETING, .proc/handle_parent_del)
/datum/looping_sound/proc/handle_parent_del(datum/source)
SIGNAL_HANDLER
set_parent(null)
+11 -2
View File
@@ -48,8 +48,17 @@
continue
var/atom/movable/thing = i
thing.Crossed(src)
//
////////////////////////////////////////
/**
* meant for movement with zero side effects. only use for objects that are supposed to move "invisibly" (like camera mobs or ghosts)
* if you want something to move onto a tile with a beartrap or recycler or tripmine or mouse without that object knowing about it at all, use this
* most of the time you want forceMove()
*/
/atom/movable/proc/abstract_move(atom/new_loc)
var/atom/old_loc = loc
// move_stacks++
loc = new_loc
Moved(old_loc)
/atom/movable/Move(atom/newloc, direct, glide_size_override = 0)
var/atom/movable/pullee = pulling
+3 -1
View File
@@ -193,7 +193,9 @@ GLOBAL_LIST_INIT(reverseradiochannels, list(
var/frequency = 0
var/transmission_method
var/list/data
var/logging_data
/datum/signal/New(data, transmission_method = TRANSMISSION_RADIO)
/datum/signal/New(data, transmission_method = TRANSMISSION_RADIO, logging_data = null)
src.data = data || list()
src.transmission_method = transmission_method
src.logging_data = logging_data
+77 -32
View File
@@ -44,6 +44,7 @@
/obj/machinery/computer/communications/Initialize()
. = ..()
GLOB.shuttle_caller_list += src
AddComponent(/datum/component/gps, "Secured Communications Signal")
/// Are we NOT a silicon, AND we're logged in as the captain?
/obj/machinery/computer/communications/proc/authenticated_as_non_silicon_captain(mob/user)
@@ -79,13 +80,11 @@
if (obj_flags & EMAGGED)
return
obj_flags |= EMAGGED
SSshuttle.shuttle_purchase_requirements_met |= "emagged"
if (authenticated)
authorize_access = get_all_accesses()
to_chat(user, "<span class='danger'>You scramble the communication routing circuits!</span>")
to_chat(user, span_danger("You scramble the communication routing circuits!"))
playsound(src, 'sound/machines/terminal_alert.ogg', 50, FALSE)
SSshuttle.shuttle_purchase_requirements_met["emagged"] = TRUE
return
/obj/machinery/computer/communications/ui_act(action, list/params)
var/static/list/approved_states = list(STATE_BUYING_SHUTTLE, STATE_CHANGING_STATUS, STATE_MAIN, STATE_MESSAGES)
@@ -104,6 +103,7 @@
if ("answerMessage")
if (!authenticated(usr))
return
var/answer_index = params["answer"]
var/message_index = params["message"]
@@ -136,11 +136,11 @@
var/obj/item/held_item = usr.get_active_held_item()
var/obj/item/card/id/id_card = held_item?.GetID()
if (!istype(id_card))
to_chat(usr, "<span class='warning'>You need to swipe your ID!</span>")
to_chat(usr, span_warning("You need to swipe your ID!"))
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE)
return
if (!(ACCESS_CAPTAIN in id_card.access))
to_chat(usr, "<span class='warning'>You are not authorized to do this!</span>")
to_chat(usr, span_warning("You are not authorized to do this!"))
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE)
return
@@ -152,26 +152,28 @@
set_security_level(new_sec_level)
to_chat(usr, "<span class='notice'>Authorization confirmed. Modifying security level.</span>")
to_chat(usr, span_notice("Authorization confirmed. Modifying security level."))
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
// Only notify people if an actual change happened
log_game("[key_name(usr)] has changed the security level to [params["newSecurityLevel"]] with [src] at [AREACOORD(usr)].")
message_admins("[ADMIN_LOOKUPFLW(usr)] has changed the security level to [params["newSecurityLevel"]] with [src] at [AREACOORD(usr)].")
deadchat_broadcast(" has changed the security level to [params["newSecurityLevel"]] with [src] at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" has changed the security level to [params["newSecurityLevel"]] with [src] at [span_name("[get_area_name(usr, TRUE)]")].", usr, src.loc, message_type=DEADCHAT_ANNOUNCEMENT)
alert_level_tick += 1
if ("deleteMessage")
if (!authenticated(usr))
return
var/message_index = params["message"]
if(!isnum(message_index))
message_admins("[ADMIN_LOOKUPFLW(usr)] provided an invalid index type when deleting a message on [src] [ADMIN_JMP(src)]. This should not happen. Please check with a maintainer and/or consult tgui logs.")
CRASH("Non-numeric index provided when deleting comms console message.")
var/message_index = text2num(params["message"])
if (!message_index)
return
LAZYREMOVE(messages, LAZYACCESS(messages, message_index))
if ("emergency_meeting")
if(!(SSevents.holidays && SSevents.holidays[APRIL_FOOLS]))
return
if (!authenticated_as_silicon_or_captain(usr))
return
// emergency_meeting(usr)
if ("makePriorityAnnouncement")
if (!authenticated_as_silicon_or_captain(usr))
return
@@ -188,32 +190,36 @@
var/emagged = obj_flags & EMAGGED
if (emagged)
message_syndicate(message, usr)
to_chat(usr, "<span class='danger'>SYSERR @l(19833)of(transmit.dm): !@$ MESSAGE TRANSMITTED TO SYNDICATE COMMAND.</span>")
to_chat(usr, span_danger("SYSERR @l(19833)of(transmit.dm): !@$ MESSAGE TRANSMITTED TO SYNDICATE COMMAND."))
else
message_centcom(message, usr)
to_chat(usr, "<span class='notice'>Message transmitted to Central Command.</span>")
to_chat(usr, span_notice("Message transmitted to Central Command."))
var/associates = emagged ? "the Syndicate": "CentCom"
usr.log_talk(message, LOG_SAY, tag = "message to [associates]")
deadchat_broadcast(" has messaged [associates], \"[message]\" at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" has messaged [associates], \"[message]\" at [span_name("[get_area_name(usr, TRUE)]")].", usr, src.loc, message_type = DEADCHAT_ANNOUNCEMENT)
COOLDOWN_START(src, important_action_cooldown, IMPORTANT_ACTION_COOLDOWN)
if ("purchaseShuttle")
var/can_buy_shuttles_or_fail_reason = can_buy_shuttles(usr)
if (can_buy_shuttles_or_fail_reason != TRUE)
if (can_buy_shuttles_or_fail_reason != FALSE)
to_chat(usr, "<span class='alert'>[can_buy_shuttles_or_fail_reason]</span>")
to_chat(usr, span_alert("[can_buy_shuttles_or_fail_reason]"))
return
var/list/shuttles = flatten_list(SSmapping.shuttle_templates)
var/datum/map_template/shuttle/shuttle = locate(params["shuttle"]) in shuttles
if (!istype(shuttle))
return
// if (!can_purchase_this_shuttle(shuttle))
// return
if (!shuttle.prerequisites_met())
to_chat(usr, "<span class='alert'>You have not met the requirements for purchasing this shuttle.</span>")
to_chat(usr, span_alert("You have not met the requirements for purchasing this shuttle."))
return
var/datum/bank_account/bank_account = SSeconomy.get_dep_account(ACCOUNT_CAR)
if (bank_account.account_balance < shuttle.credit_cost)
return
SSshuttle.shuttle_purchased = SHUTTLEPURCHASE_PURCHASED
// for(var/datum/round_event_control/shuttle_insurance/insurance_event in SSevents.control)
// insurance_event.weight *= 20
SSshuttle.unload_preview()
SSshuttle.existing_shuttle = SSshuttle.emergency
SSshuttle.action_load(shuttle, replace = TRUE)
@@ -235,7 +241,7 @@
return
var/reason = trim(html_encode(params["reason"]), MAX_MESSAGE_LEN)
nuke_request(reason, usr)
to_chat(usr, "<span class='notice'>Request sent.</span>")
to_chat(usr, span_notice("Request sent."))
usr.log_message("has requested the nuclear codes from CentCom with reason \"[reason]\"", LOG_SAY)
priority_announce("The codes for the on-station nuclear self-destruct have been requested by [usr]. Confirmation or denial of this request will be sent shortly.", "Nuclear Self-Destruct Codes Requested", "commandreport")
playsound(src, 'sound/machines/terminal_prompt.ogg', 50, FALSE)
@@ -245,7 +251,7 @@
return
if (!(obj_flags & EMAGGED))
return
to_chat(usr, "<span class='notice'>Backup routing data restored.</span>")
to_chat(usr, span_notice("Backup routing data restored."))
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
obj_flags &= ~EMAGGED
if ("sendToOtherSector")
@@ -256,7 +262,7 @@
if (!COOLDOWN_FINISHED(src, important_action_cooldown))
return
var/message = trim(html_encode(params["message"]), MAX_MESSAGE_LEN)
var/message = trim(params["message"], MAX_MESSAGE_LEN)
if (!message)
return
@@ -268,12 +274,13 @@
var/network_name = CONFIG_GET(string/cross_comms_network)
if (network_name)
payload["network"] = network_name
payload["sender_ckey"] = usr.ckey
send2otherserver(station_name(), message, "Comms_Console", destination == "all" ? null : list(destination), additional_data = payload)
send2otherserver(html_decode(station_name()), message, "Comms_Console", destination == "all" ? null : list(destination), additional_data = payload)
minor_announce(message, title = "Outgoing message to allied station")
usr.log_talk(message, LOG_SAY, tag = "message to the other server")
message_admins("[ADMIN_LOOKUPFLW(usr)] has sent a message to the other server\[s].")
deadchat_broadcast(" has sent an outgoing message to the other station(s).</span>", "<span class='bold'>[usr.real_name]", usr)
deadchat_broadcast(" has sent an outgoing message to the other station(s).</span>", usr, src.loc, message_type = DEADCHAT_ANNOUNCEMENT)
COOLDOWN_START(src, important_action_cooldown, IMPORTANT_ACTION_COOLDOWN)
if ("setState")
@@ -315,7 +322,7 @@
authenticated = TRUE
authorize_access = get_all_accesses()
authorize_name = "Unknown"
to_chat(usr, "<span class='warning'>[src] lets out a quiet alarm as its login is overridden.</span>")
to_chat(usr, span_warning("[src] lets out a quiet alarm as its login is overridden."))
playsound(src, 'sound/machines/terminal_alert.ogg', 25, FALSE)
else if(isliving(usr))
var/mob/living/L = usr
@@ -334,22 +341,36 @@
revoke_maint_all_access()
log_game("[key_name(usr)] disabled emergency maintenance access.")
message_admins("[ADMIN_LOOKUPFLW(usr)] disabled emergency maintenance access.")
deadchat_broadcast(" disabled emergency maintenance access at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" disabled emergency maintenance access at [span_name("[get_area_name(usr, TRUE)]")].", usr, src.loc, message_type = DEADCHAT_ANNOUNCEMENT)
else
make_maint_all_access()
log_game("[key_name(usr)] enabled emergency maintenance access.")
message_admins("[ADMIN_LOOKUPFLW(usr)] enabled emergency maintenance access.")
deadchat_broadcast(" enabled emergency maintenance access at <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[usr.real_name]</span>", usr)
deadchat_broadcast(" enabled emergency maintenance access at [span_name("[get_area_name(usr, TRUE)]")].", usr, src.loc, message_type = DEADCHAT_ANNOUNCEMENT)
/obj/machinery/computer/communications/ui_data(mob/user)
var/list/data = list(
"authenticated" = FALSE,
"emagged" = FALSE,
"hasConnection" = has_communication(),
)
var/ui_state = issilicon(user) ? cyborg_state : state
var/has_connection = has_communication()
data["hasConnection"] = has_connection
// if(!SSjob.assigned_captain && !SSjob.safe_code_requested && SSid_access.spare_id_safe_code && has_connection)
// data["canRequestSafeCode"] = TRUE
// data["safeCodeDeliveryWait"] = 0
// else
// data["canRequestSafeCode"] = FALSE
// if(SSjob.safe_code_timer_id && has_connection)
// data["safeCodeDeliveryWait"] = timeleft(SSjob.safe_code_timer_id)
// data["safeCodeDeliveryArea"] = get_area(SSjob.safe_code_request_loc)
// else
// data["safeCodeDeliveryWait"] = 0
// data["safeCodeDeliveryArea"] = null
if (authenticated || issilicon(user))
data["authenticated"] = TRUE
data["canLogOut"] = !issilicon(user)
@@ -371,16 +392,17 @@
data["importantActionReady"] = COOLDOWN_FINISHED(src, important_action_cooldown)
data["shuttleCalled"] = FALSE
data["shuttleLastCalled"] = FALSE
data["aprilFools"] = SSevents.holidays && SSevents.holidays[APRIL_FOOLS]
data["alertLevel"] = NUM2SECLEVEL(GLOB.security_level)
data["authorizeName"] = authorize_name
data["canLogOut"] = !issilicon(user)
data["shuttleCanEvacOrFailReason"] = SSshuttle.canEvac(user, TRUE)
data["shuttleCanEvacOrFailReason"] = SSshuttle.canEvac(user)
if (authenticated_as_non_silicon_captain(user))
data["canRequestNuke"] = TRUE
if (authenticated_as_non_silicon_command(user))
data["canMessageAssociates"] = TRUE
if (can_send_messages_to_other_sectors(user))
data["canSendToSectors"] = TRUE
@@ -428,8 +450,13 @@
for (var/shuttle_id in SSmapping.shuttle_templates)
var/datum/map_template/shuttle/shuttle_template = SSmapping.shuttle_templates[shuttle_id]
if (!shuttle_template.can_be_bought || shuttle_template.credit_cost == INFINITY)
if (shuttle_template.credit_cost == INFINITY)
continue
if (!shuttle_template.can_be_bought)
continue
shuttles += list(list(
"name" = shuttle_template.name,
"description" = shuttle_template.description,
@@ -478,6 +505,7 @@
return FALSE
if (!authenticated_as_non_silicon_captain(user))
return FALSE
if (SSshuttle.emergency.mode != SHUTTLE_RECALL && SSshuttle.emergency.mode != SHUTTLE_IDLE)
return "The shuttle is already in transit."
if (SSshuttle.shuttle_purchased == SHUTTLEPURCHASE_PURCHASED)
@@ -492,21 +520,38 @@
return length(CONFIG_GET(keyed_list/cross_server)) > 0
/**
* Call an emergency meeting
*
* Comm Console wrapper for the Communications subsystem wrapper for the call_emergency_meeting world proc.
* Checks to make sure the proc can be called, and handles relevant feedback, logging and timing.
* See the SScommunications proc definition for more detail, in short, teleports the entire crew to
* the bridge for a meetup. Should only really happen during april fools.
* Arguments:
* * user - Mob who called the meeting
*/
/obj/machinery/computer/communications/proc/emergency_meeting(mob/living/user)
// if(!SScommunications.can_make_emergency_meeting(user))
// to_chat(user, span_alert("The emergency meeting button doesn't seem to work right now. Please stand by."))
// return
// SScommunications.emergency_meeting(user)
// deadchat_broadcast(" called an emergency meeting from [span_name("[get_area_name(usr, TRUE)]")].", span_name("[user.real_name]"), user, message_type=DEADCHAT_ANNOUNCEMENT)
/obj/machinery/computer/communications/proc/make_announcement(mob/living/user)
var/is_ai = issilicon(user)
if(!SScommunications.can_announce(user, is_ai))
to_chat(user, "<span class='alert'>Intercomms recharging. Please stand by.</span>")
to_chat(user, span_alert("Intercomms recharging. Please stand by."))
return
var/input = stripped_input(user, "Please choose a message to announce to the station crew.", "What?")
if(!input || !user.canUseTopic(src, !issilicon(usr)))
return
if(!(user.can_speak())) //No more cheating, mime/random mute guy!
input = "..."
to_chat(user, "<span class='warning'>You find yourself unable to speak.</span>")
to_chat(user, span_warning("You find yourself unable to speak."))
else
input = user.treat_message(input) //Adds slurs and so on. Someone should make this use languages too.
SScommunications.make_announcement(user, is_ai, input)
deadchat_broadcast(" made a priority announcement from <span class='name'>[get_area_name(usr, TRUE)]</span>.", "<span class='name'>[user.real_name]</span>", user)
deadchat_broadcast(" made a priority announcement from [span_name("[get_area_name(usr, TRUE)]")].", user, src.loc, message_type=DEADCHAT_ANNOUNCEMENT)
/obj/machinery/computer/communications/proc/post_status(command, data1, data2)
+205 -344
View File
@@ -1,3 +1,5 @@
#define AHELP_FIRST_MESSAGE "Please adminhelp before leaving the round, even if there are no administrators online!"
/*
* Cryogenic refrigeration unit. Basically a despawner.
* Stealing a lot of concepts/code from sleepers due to massive laziness.
@@ -5,170 +7,71 @@
* since time_entered, which is world.time when the occupant moves in.
* ~ Zuhayr
*/
GLOBAL_LIST_EMPTY(cryopod_computers)
//Main cryopod console.
/obj/machinery/computer/cryopod
name = "cryogenic oversight console"
desc = "An interface between crew and the cryogenic storage oversight systems."
icon = 'icons/obj/Cryogenic2.dmi'
icon = 'icons/obj/machines/cryopod.dmi'
icon_state = "cellconsole_1"
circuit = /obj/item/circuitboard/cryopodcontrol
icon_keyboard = null
// circuit = /obj/item/circuitboard/cryopodcontrol
density = FALSE
interaction_flags_machine = INTERACT_MACHINE_OFFLINE
req_one_access = list(ACCESS_HEADS, ACCESS_ARMORY) //Heads of staff or the warden can go here to claim recover items from their department that people went were cryodormed with.
req_one_access = list(ACCESS_HEADS, ACCESS_ARMORY) // Heads of staff or the warden can go here to claim recover items from their department that people went were cryodormed with.
var/mode = null
var/menu = 1 //Which menu screen to display
//Used for logging people entering cryosleep and important items they are carrying.
// Used for logging people entering cryosleep and important items they are carrying.
var/list/frozen_crew = list()
var/list/obj/stored_packages = list()
var/allow_items = TRUE
var/storage_type = "crewmembers"
var/storage_name = "Cryogenic Oversight Control"
/obj/machinery/computer/cryopod/deconstruct()
/obj/machinery/computer/cryopod/Initialize()
. = ..()
for(var/i in stored_packages)
var/obj/O = i
O.forceMove(drop_location())
GLOB.cryopod_computers += src
/obj/machinery/computer/cryopod/attack_ai()
attack_hand()
/obj/machinery/computer/cryopod/Destroy()
GLOB.cryopod_computers -= src
return ..()
/obj/machinery/computer/cryopod/ui_interact(mob/user = usr)
if(!is_operational())
/obj/machinery/computer/cryopod/update_icon_state()
if(stat & (NOPOWER|BROKEN))
icon_state = "cellconsole"
return ..()
icon_state = "cellconsole_1"
return ..()
/obj/machinery/computer/cryopod/ui_interact(mob/user, datum/tgui/ui)
if(stat & (NOPOWER|BROKEN))
return
user.set_machine(src)
add_fingerprint(user)
var/dat = ""
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CryopodConsole", name)
ui.open()
dat += "<h2>Welcome, [user.real_name].</h2><hr/>"
dat += "<br><br>"
/obj/machinery/computer/cryopod/ui_data(mob/user)
var/list/data = list()
data["frozen_crew"] = frozen_crew
switch(src.menu)
if(1)
dat += "<a href='byond://?src=[REF(src)];menu=2'>View crew storage log</a><br><br>"
if(allow_items)
dat += "<a href='byond://?src=[REF(src)];menu=3'>View objects storage log</a><br><br>"
dat += "<a href='byond://?src=[REF(src)];item=1'>Recover object</a><br><br>"
dat += "<a href='byond://?src=[REF(src)];allitems=1'>Recover all objects</a><br>"
if(2)
dat += "<a href='byond://?src=[REF(src)];menu=1'><< Back</a><br><br>"
dat += "<h3>Recently stored Crew</h3><br/><hr/><br/>"
if(!frozen_crew.len)
dat += "There has been no storage usage at this terminal.<br/>"
else
for(var/person in frozen_crew)
dat += "[person]<br/>"
dat += "<hr/>"
if(3)
dat += "<a href='byond://?src=[REF(src)];menu=1'><< Back</a><br><br>"
dat += "<h3>Recently stored objects</h3><br/><hr/><br/>"
if(!stored_packages.len)
dat += "There has been no storage usage at this terminal.<br/>"
else
for(var/obj/O in stored_packages)
dat += "[O.name]<br/>"
dat += "<hr/>"
var/obj/item/card/id/id_card
var/datum/bank_account/current_user
if(isliving(user))
var/mob/living/person = user
id_card = person.get_idcard()
if(id_card?.registered_account)
current_user = id_card.registered_account
if(current_user)
data["account_name"] = current_user.account_holder
var/datum/browser/popup = new(user, "cryopod_console", "Cryogenic System Control")
popup.set_content(dat)
popup.open()
return data
/obj/machinery/computer/cryopod/Topic(href, href_list)
if(..())
return TRUE
var/mob/user = usr
add_fingerprint(user)
if(href_list["item"])
if(!allowed(user) && !(obj_flags & EMAGGED))
to_chat(user, "<span class='warning'>Access Denied.</span>")
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
updateUsrDialog()
return
if(!allow_items)
return
if(stored_packages.len == 0)
to_chat(user, "<span class='notice'>There is nothing to recover from storage.</span>")
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
updateUsrDialog()
return
var/obj/I = tgui_input_list(user, "Please choose which object to retrieve.","Object recovery", stored_packages)
playsound(src, "terminal_type", 25, 0)
if(!I)
return
if(!(I in stored_packages))
to_chat(user, "<span class='notice'>\The [I] is no longer in storage.</span>")
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
updateUsrDialog()
return
visible_message("<span class='notice'>The console beeps happily as it disgorges \the [I].</span>")
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
I.forceMove(drop_location())
if(user && Adjacent(user) && user.can_hold_items())
user.put_in_hands(I)
stored_packages -= I
updateUsrDialog()
else if(href_list["allitems"])
playsound(src, "terminal_type", 25, 0)
if(!allowed(user) && !(obj_flags & EMAGGED))
to_chat(user, "<span class='warning'>Access Denied.</span>")
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
updateUsrDialog()
return
if(!allow_items)
return
if(stored_packages.len == 0)
to_chat(user, "<span class='notice'>There is nothing to recover from storage.</span>")
playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0)
return
visible_message("<span class='notice'>The console beeps happily as it disgorges the desired objects.</span>")
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
for(var/obj/O in stored_packages)
O.forceMove(get_turf(src))
stored_packages.Cut()
updateUsrDialog()
else if (href_list["menu"])
src.menu = text2num(href_list["menu"])
playsound(src, "terminal_type", 25, 0)
updateUsrDialog()
ui_interact(usr)
updateUsrDialog()
return
/obj/item/circuitboard/cryopodcontrol
name = "Circuit board (Cryogenic Oversight Console)"
build_path = "/obj/machinery/computer/cryopod"
/obj/machinery/computer/cryopod/contents_explosion()
return
/obj/machinery/computer/cryopod/contents_explosion()
return //don't blow everyone's shit up.
/// The box
/obj/item/storage/box/blue/cryostorage_items
w_class = WEIGHT_CLASS_HUGE
//Cryopods themselves.
// Cryopods themselves.
/obj/machinery/cryopod
name = "cryogenic freezer"
desc = "Suited for Cyborgs and Humanoids, the pod is a safe place for personnel affected by the Space Sleep Disorder to get some rest."
@@ -181,47 +84,55 @@
var/on_store_message = "has entered long-term storage."
var/on_store_name = "Cryogenic Oversight"
// 15 minutes-ish safe period before being despawned.
var/time_till_despawn = 15 * 600 // This is reduced by 90% if a player manually enters cryo
var/despawn_world_time = null // Used to keep track of the safe period.
/// Time until despawn when a mob enters a cryopod. You cannot other people in pods unless they're catatonic.
var/time_till_despawn = 30 SECONDS
/// Cooldown for when it's now safe to try an despawn the player.
COOLDOWN_DECLARE(despawn_world_time)
var/obj/machinery/computer/cryopod/control_computer
var/item_storage_type = /obj/item/storage/box/blue/cryostorage_items //with how storage components work this can be anything the player can open or anything with a storage component.
var/last_no_computer_message = 0
///Weakref to our controller
var/datum/weakref/control_computer_weakref
COOLDOWN_DECLARE(last_no_computer_message)
/obj/machinery/cryopod/Initialize(mapload)
. = ..()
/obj/machinery/cryopod/Initialize()
..()
return INITIALIZE_HINT_LATELOAD //Gotta populate the cryopod computer GLOB first
/obj/machinery/cryopod/LateInitialize()
update_icon()
find_control_computer(mapload)
find_control_computer()
// This is not a good situation
/obj/machinery/cryopod/Destroy()
control_computer_weakref = null
return ..()
/obj/machinery/cryopod/proc/find_control_computer(urgent = FALSE)
for(var/obj/machinery/computer/cryopod/C in get_area(src))
control_computer = C
if(C)
return C
break
for(var/cryo_console as anything in GLOB.cryopod_computers)
var/obj/machinery/computer/cryopod/console = cryo_console
if(get_area(console) == get_area(src))
control_computer_weakref = WEAKREF(console)
break
// Don't send messages unless we *need* the computer, and less than five minutes have passed since last time we messaged
if(!control_computer && urgent && last_no_computer_message + 5*60*10 < world.time)
if(!control_computer_weakref && urgent && COOLDOWN_FINISHED(src, last_no_computer_message))
COOLDOWN_START(src, last_no_computer_message, 5 MINUTES)
log_admin("Cryopod in [get_area(src)] could not find control computer!")
message_admins("Cryopod in [get_area(src)] could not find control computer!")
last_no_computer_message = world.time
return control_computer != null
return control_computer_weakref != null
/obj/machinery/cryopod/close_machine(mob/user)
if(!control_computer)
/obj/machinery/cryopod/close_machine(atom/movable/target)
if(!control_computer_weakref)
find_control_computer(TRUE)
if((isnull(user) || istype(user)) && state_open && !panel_open)
..(user)
if((isnull(target) || isliving(target)) && state_open && !panel_open)
..(target)
var/mob/living/mob_occupant = occupant
investigate_log("Cryogenics machine closed with occupant [key_name(occupant)] by user [key_name(user)].", INVESTIGATE_CRYOGENICS)
investigate_log("Cryogenics machine closed with occupant [key_name(occupant)] by user [key_name(target)].", INVESTIGATE_CRYOGENICS)
if(mob_occupant && mob_occupant.stat != DEAD)
to_chat(occupant, "<span class='boldnotice'>You feel cool air surround you. You go numb as your senses turn inward.</span>")
if(mob_occupant.client)//if they're logged in
despawn_world_time = world.time + (time_till_despawn * 0.1)
else
despawn_world_time = world.time + time_till_despawn
to_chat(occupant, span_notice("<b>You feel cool air surround you. You go numb as your senses turn inward.</b>"))
COOLDOWN_START(src, despawn_world_time, time_till_despawn)
icon_state = "cryopod"
/obj/machinery/cryopod/open_machine()
@@ -234,8 +145,8 @@
/obj/machinery/cryopod/container_resist(mob/living/user)
investigate_log("Cryogenics machine container resisted by [key_name(user)] with occupant [key_name(occupant)].", INVESTIGATE_CRYOGENICS)
visible_message("<span class='notice'>[occupant] emerges from [src]!</span>",
"<span class='notice'>You climb out of [src]!</span>")
visible_message(span_notice("[occupant] emerges from [src]!"),
span_notice("You climb out of [src]!"))
open_machine()
/obj/machinery/cryopod/relaymove(mob/user)
@@ -246,205 +157,151 @@
return
var/mob/living/mob_occupant = occupant
if(mob_occupant)
// Eject dead people
if(mob_occupant.stat == DEAD)
open_machine()
if(mob_occupant.stat == DEAD)
open_machine()
if(!(world.time > despawn_world_time + 100))//+ 10 seconds
return
if(!mob_occupant.client && COOLDOWN_FINISHED(src, despawn_world_time))
if(!control_computer_weakref)
find_control_computer(urgent = TRUE)
if(!mob_occupant.client && mob_occupant.stat < 2) //Occupant is living and has no client.
if(!control_computer)
find_control_computer(urgent = TRUE)//better hope you found it this time
despawn_occupant()
despawn_occupant()
/obj/machinery/cryopod/proc/handle_objectives()
var/mob/living/mob_occupant = occupant
// Update any existing objectives involving this mob.
for(var/datum/objective/objective in GLOB.objectives)
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(istype(objective,/datum/objective/mutiny) && objective.target == mob_occupant.mind)
objective.team.objectives -= objective
qdel(objective)
for(var/datum/mind/mind in objective.team.members)
to_chat(mind.current, "<BR>[span_userdanger("Your target is no longer within reach. Objective removed!")]")
mind.announce_objectives()
else if(istype(objective.target) && objective.target == mob_occupant.mind)
if(istype(objective, /datum/objective/contract))
var/datum/antagonist/traitor/affected_traitor = objective.owner.has_antag_datum(/datum/antagonist/traitor)
var/datum/contractor_hub/affected_contractor_hub = affected_traitor.contractor_hub
for(var/datum/syndicate_contract/affected_contract as anything in affected_contractor_hub.assigned_contracts)
if(affected_contract.contract == objective)
affected_contract.generate(affected_contractor_hub.assigned_targets)
affected_contractor_hub.assigned_targets.Add(affected_contract.contract.target)
to_chat(objective.owner.current, "<BR>[span_userdanger("Contract target out of reach. Contract rerolled.")]")
break
else
var/old_target = objective.target
objective.target = null
if(!objective)
return
objective.find_target()
if(!objective.target && objective.owner)
to_chat(objective.owner.current, "<BR>[span_userdanger("Your target is no longer within reach. Objective removed!")]")
for(var/datum/antagonist/antag in objective.owner.antag_datums)
antag.objectives -= objective
if (!objective.team)
objective.update_explanation_text()
objective.owner.announce_objectives()
to_chat(objective.owner.current, "<BR>[span_userdanger("You get the feeling your target is no longer within reach. Time for Plan [pick("A","B","C","D","X","Y","Z")]. Objectives updated!")]")
else
var/list/objectivestoupdate
for(var/datum/mind/objective_owner in objective.get_owners())
to_chat(objective_owner.current, "<BR>[span_userdanger("You get the feeling your target is no longer within reach. Time for Plan [pick("A","B","C","D","X","Y","Z")]. Objectives updated!")]")
for(var/datum/objective/update_target_objective in objective_owner.get_all_objectives())
LAZYADD(objectivestoupdate, update_target_objective)
objectivestoupdate += objective.team.objectives
for(var/datum/objective/update_objective in objectivestoupdate)
if(update_objective.target != old_target || !istype(update_objective,objective.type))
continue
update_objective.target = objective.target
update_objective.update_explanation_text()
to_chat(objective.owner.current, "<BR>[span_userdanger("You get the feeling your target is no longer within reach. Time for Plan [pick("A","B","C","D","X","Y","Z")]. Objectives updated!")]")
update_objective.owner.announce_objectives()
qdel(objective)
/obj/machinery/cryopod/proc/should_preserve_item(obj/item/item)
for(var/datum/objective_item/steal/possible_item in GLOB.possible_items)
if(istype(item, possible_item.targetitem))
return TRUE
return FALSE
// This function can not be undone; do not call this unless you are sure
/obj/machinery/cryopod/proc/despawn_occupant()
if(!control_computer)
find_control_computer()
var/mob/living/mob_occupant = occupant
var/list/crew_member = list()
var/list/obj/item/storing = list()
var/list/obj/item/destroying = list()
var/list/obj/item/destroy_later = list()
investigate_log("Despawning [key_name(mob_occupant)].", INVESTIGATE_CRYOGENICS)
var/atom/target_store = (control_computer?.allow_items && control_computer) || src //the double control computer check makes it return the control computer.
var/drop_to_ground = !istype(target_store, /obj/machinery/computer/cryopod)
var/mind_identity = mob_occupant.mind?.name
var/occupant_identity = mob_occupant.real_name
if(iscyborg(mob_occupant))
var/mob/living/silicon/robot/R = mob_occupant
if(R.mmi?.brain)
destroy_later += R.mmi
destroy_later += R.mmi.brain
for(var/i in R.module)
if(!isitem(i))
destroying += i
continue
var/obj/item/I = i
// let's be honest we only care about the trash bag don't beat around the bush
if(SEND_SIGNAL(I, COMSIG_CONTAINS_STORAGE))
storing += I.contents
for(var/atom/movable/AM in I.contents)
AM.forceMove(src)
R.module.remove_module(I, TRUE)
else
if(ishuman(mob_occupant))
var/mob/living/carbon/human/H = mob_occupant
if(H.mind && H.client && H.client.prefs && H == H.mind.original_character)
H.SaveTCGCards()
var/list/gear = list()
if(iscarbon(mob_occupant)) // sorry simp-le-mobs deserve no mercy
var/mob/living/carbon/C = mob_occupant
gear = C.get_all_gear()
for(var/i in gear)
var/obj/item/I = i
I.forceMove(src)
if(!istype(I))
destroying += I
continue
if(I.item_flags & (DROPDEL | ABSTRACT))
destroying += I
continue
if(HAS_TRAIT(I, TRAIT_NODROP))
destroying += I
continue
// WEE WOO SNOWFLAKE TIME
if(istype(I, /obj/item/pda))
var/obj/item/pda/P = I
if((P.owner == mind_identity) || (P.owner == occupant_identity))
destroying += P
else
storing += P
else if(istype(I, /obj/item/card/id))
var/obj/item/card/id/idcard = I
if((idcard.registered_name == mind_identity) || (idcard.registered_name == occupant_identity))
destroying += idcard
else
storing += idcard
else
storing += I
// get rid of mobs
for(var/mob/living/L in mob_occupant.GetAllContents() - mob_occupant)
L.forceMove(drop_location())
if(storing.len)
var/obj/O = new item_storage_type
O.name = "cryogenic retrieval package: [mob_occupant.real_name]"
for(var/i in storing)
var/obj/item/I = i
I.forceMove(O)
O.forceMove(drop_to_ground? target_store.drop_location() : target_store)
if((target_store == control_computer) && !drop_to_ground)
control_computer.stored_packages += O
QDEL_LIST(destroying)
//Update any existing objectives involving this mob.
for(var/i in GLOB.objectives)
var/datum/objective/O = i
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(istype(O,/datum/objective/mutiny) && O.target == mob_occupant.mind)
qdel(O)
else if(O.target && istype(O.target, /datum/mind))
if(O.target != mob_occupant.mind)
continue
if(O.check_midround_completion())
continue
if(O.owner && O.owner.current)
to_chat(O.owner.current, "<BR><span class='userdanger'>You get the feeling your target is no longer within reach. Time for Plan [pick("A","B","C","D","X","Y","Z")]. Objectives updated!</span>")
O.target = null
spawn(10) //This should ideally fire after the occupant is deleted.
if(!O)
return
O.find_target()
O.update_explanation_text()
if(!(O.target))
qdel(O)
crew_member["name"] = mob_occupant.real_name
if(mob_occupant.mind)
//Handle job slot/tater cleanup.
if(mob_occupant.mind.assigned_role)
var/job = mob_occupant.mind.assigned_role
SSjob.FreeRole(job)
// Handle job slot/tater cleanup.
var/job = mob_occupant.mind.assigned_role
crew_member["job"] = job
SSjob.FreeRole(job)
// if(LAZYLEN(mob_occupant.mind.objectives))
// mob_occupant.mind.objectives.Cut()
mob_occupant.mind.special_role = null
else
crew_member["job"] = "N/A"
// Delete them from datacore.
var/announce_rank = null
for(var/datum/data/record/R in GLOB.data_core.medical)
if((R.fields["name"] == mob_occupant.real_name))
qdel(R)
for(var/datum/data/record/T in GLOB.data_core.security)
if((T.fields["name"] == mob_occupant.real_name))
qdel(T)
for(var/datum/data/record/G in GLOB.data_core.general)
if((G.fields["name"] == mob_occupant.real_name))
announce_rank = G.fields["rank"]
qdel(G)
for(var/datum/data/record/medical_record as anything in GLOB.data_core.medical)
if(medical_record.fields["name"] == mob_occupant.real_name)
qdel(medical_record)
for(var/datum/data/record/security_record as anything in GLOB.data_core.security)
if(security_record.fields["name"] == mob_occupant.real_name)
qdel(security_record)
for(var/datum/data/record/general_record as anything in GLOB.data_core.general)
if(general_record.fields["name"] == mob_occupant.real_name)
announce_rank = general_record.fields["rank"]
qdel(general_record)
for(var/obj/machinery/computer/cloning/cloner in world)
for(var/datum/data/record/R in cloner.records)
if(R.fields["name"] == mob_occupant.real_name)
cloner.records.Remove(R)
//Make an announcement and log the person entering storage.
if(control_computer)
control_computer.frozen_crew += "[mob_occupant.real_name]"
var/obj/machinery/computer/cryopod/control_computer = control_computer_weakref?.resolve()
if(!control_computer)
control_computer_weakref = null
else
control_computer.frozen_crew += list(crew_member)
// Make an announcement and log the person entering storage.
if(GLOB.announcement_systems.len)
var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems)
announcer.announce("CRYOSTORAGE", mob_occupant.real_name, announce_rank, list())
visible_message("<span class='notice'>\The [src] hums and hisses as it moves [mob_occupant.real_name] into storage.</span>")
// Ghost and delete the mob.
var/mob/dead/observer/G = mob_occupant.get_ghost(TRUE)
if(G)
G.voluntary_ghosted = TRUE
else
mob_occupant.ghostize(FALSE, penalize = TRUE, voluntary = TRUE, cryo = TRUE)
visible_message(span_notice("[src] hums and hisses as it moves [mob_occupant.real_name] into storage."))
for(var/obj/item/item_content as anything in mob_occupant)
if(!istype(item_content) || HAS_TRAIT(item_content, TRAIT_NODROP))
continue
mob_occupant.transferItemToLoc(item_content, drop_location(), force = TRUE, silent = TRUE)
handle_objectives()
QDEL_NULL(occupant)
QDEL_LIST(destroy_later)
open_machine()
name = initial(name)
/obj/machinery/cryopod/MouseDrop_T(mob/living/target, mob/user)
if(!istype(target) || user.incapacitated() || !target.Adjacent(user) || !Adjacent(user) || !ismob(target) || (!ishuman(user) && !iscyborg(user)) || !istype(user.loc, /turf) || target.buckled)
if(!istype(target) || !can_interact(user) || !target.Adjacent(user) || !ismob(target) || isanimal(target) || !istype(user.loc, /turf) || target.buckled)
return
if(occupant)
to_chat(user, "<span class='boldnotice'>The cryo pod is already occupied!</span>")
to_chat(user, span_notice("[src] is already occupied!"))
return
if(target.stat == DEAD)
to_chat(user, "<span class='notice'>Dead people can not be put into cryo.</span>")
to_chat(user, span_notice("Dead people can not be put into cryo."))
return
if(target.client && user != target)
if(target.key && user != target)
if(iscyborg(target))
to_chat(user, "<span class='danger'>You can't put [target] into [src]. They're online.</span>")
to_chat(user, span_danger("You can't put [target] into [src]. [target.p_theyre(capitalized = TRUE)] online."))
else
to_chat(user, "<span class='danger'>You can't put [target] into [src]. They're conscious.</span>")
to_chat(user, span_danger("You can't put [target] into [src]. [target.p_theyre(capitalized = TRUE)] conscious."))
return
else if(target.client)
if(tgui_alert(target,"Would you like to enter cryosleep?",,list("Yes","No")) == "No")
return
var/generic_plsnoleave_message = " Please adminhelp before leaving the round, even if there are no administrators online!"
if(target == user && (tgalert(target, "Would you like to enter cryosleep?", "Enter Cryopod?", "Yes", "No") != "Yes"))
return
if(target == user && world.time - target.client.cryo_warned > 5 MINUTES)//if we haven't warned them in the last 5 minutes
if(target == user)
var/list/caught_string
var/addendum = ""
if(target.mind.assigned_role in GLOB.command_positions)
@@ -462,30 +319,34 @@
LAZYADD(caught_string, "Revolutionary")
if(caught_string)
tgui_alert(target, "You're a [english_list(caught_string)]![generic_plsnoleave_message][addendum]")
tgui_alert(target, "You're a [english_list(caught_string)]! [AHELP_FIRST_MESSAGE][addendum]")
target.client.cryo_warned = world.time
return
if(!target || user.incapacitated() || !target.Adjacent(user) || !Adjacent(user) || (!ishuman(user) && !iscyborg(user)) || !istype(user.loc, /turf) || target.buckled)
if(!istype(target) || !can_interact(user) || !target.Adjacent(user) || !ismob(target) || isanimal(target) || !istype(user.loc, /turf) || target.buckled)
return
//rerun the checks in case of shenanigans
if(target == user)
visible_message("[user] starts climbing into the cryo pod.")
else
visible_message("[user] starts putting [target] into the cryo pod.")
// rerun the checks in case of shenanigans
if(occupant)
to_chat(user, "<span class='boldnotice'>\The [src] is in use.</span>")
to_chat(user, span_notice("[src] is already occupied!"))
return
close_machine(target)
to_chat(target, "<span class='boldnotice'>If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.</span>")
name = "[name] ([occupant.name])"
log_admin("<span class='notice'>[key_name(target)] entered a stasis pod.</span>")
message_admins("[key_name_admin(target)] entered a stasis pod. (<A HREF='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
if(target == user)
visible_message("<span class='infoplain'>[user] starts climbing into the cryo pod.</span>")
else
visible_message("<span class='infoplain'>[user] starts putting [target] into the cryo pod.</span>")
to_chat(target, span_warning("<b>If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.</b>"))
log_admin("[key_name(target)] entered a stasis pod.")
message_admins("[key_name_admin(target)] entered a stasis pod. [ADMIN_JMP(src)]")
add_fingerprint(target)
//Attacks/effects.
close_machine(target)
name = "[name] ([target.name])"
// Attacks/effects.
/obj/machinery/cryopod/blob_act()
return //Sorta gamey, but we don't really want these to be destroyed.
return // Sorta gamey, but we don't really want these to be destroyed.
#undef AHELP_FIRST_MESSAGE
+101 -51
View File
@@ -1,8 +1,8 @@
/* Holograms!
* Contains:
* Holopad
* Hologram
* Other stuff
* Holopad
* Hologram
* Other stuff
*/
/*
@@ -24,7 +24,6 @@ Possible to do for anyone motivated enough:
* Holopad
*/
GLOBAL_LIST_EMPTY(network_holopads)
#define HOLOPAD_PASSIVE_POWER_USAGE 1
#define HOLOGRAM_POWER_USAGE 2
@@ -32,6 +31,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
name = "holopad"
desc = "It's a floor-mounted device for projecting holographic images."
icon_state = "holopad0"
base_icon_state = "holopad"
layer = LOW_OBJ_LAYER
plane = FLOOR_PLANE
flags_1 = HEAR_1
@@ -70,7 +70,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
var/obj/effect/overlay/holo_pad_hologram/replay_holo
/// Calls will be automatically answered after a couple rings, here for debugging
var/static/force_answer_call = FALSE
// var/static/list/holopads = list()
var/static/list/holopads = list()
var/obj/effect/overlay/holoray/ray
var/ringing = FALSE
var/offset = FALSE
@@ -107,26 +107,47 @@ GLOBAL_LIST_EMPTY(network_holopads)
new_disk.forceMove(src)
disk = new_disk
/obj/machinery/holopad/tutorial/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
/obj/machinery/holopad/Moved(atom/OldLoc, Dir)
. = ..()
if(!loc)
return
// move any relevant holograms, basically non-AI, and rays with the pad
if(replay_holo)
replay_holo.abstract_move(loc)
for(var/i in holorays)
var/obj/effect/overlay/holoray/ray = holorays[i]
ray.abstract_move(loc)
var/list/non_call_masters = masters?.Copy()
for(var/datum/holocall/holocall as anything in holo_calls)
if(!holocall.user || !LAZYACCESS(masters, holocall.user))
continue
non_call_masters -= holocall.user
// moving the eye moves the holo which updates the ray too
holocall.eye.setLoc(locate(clamp(x + (holocall.hologram.x - OldLoc.x), 1, world.maxx), clamp(y + (holocall.hologram.y - OldLoc.y), 1, world.maxy), z))
for(var/mob/living/holo_master as anything in non_call_masters)
var/obj/effect/holo = masters[holo_master]
update_holoray(holo_master, holo.loc)
/obj/machinery/holopad/tutorial/attack_hand(mob/user, list/modifiers)
if(!istype(user))
return
if(user.incapacitated() || !is_operational())
return
if(replay_mode)
replay_stop()
else if(disk && disk.record)
else if(disk?.record)
replay_start()
/obj/machinery/holopad/tutorial/HasProximity(atom/movable/AM)
if (!isliving(AM))
return
if(!replay_mode && (disk && disk.record))
if(!replay_mode && (disk?.record))
replay_start()
/obj/machinery/holopad/Initialize()
. = ..()
if(on_network)
GLOB.network_holopads += src
holopads += src
/obj/machinery/holopad/Destroy()
if(outgoing_call)
@@ -146,7 +167,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
QDEL_NULL(disk)
GLOB.network_holopads -= src
holopads -= src
return ..()
/obj/machinery/holopad/power_change()
@@ -172,8 +193,10 @@ GLOBAL_LIST_EMPTY(network_holopads)
/obj/machinery/holopad/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
. += "<span class='notice'>The status display reads: Current projection range: <b>[holo_range]</b> units.</span>"
if(isAI(user))
. += span_notice("The status display reads: Current projection range: <b>[holo_range]</b> units. Use :h to speak through the projection. Right-click to project or cancel a projection. Alt-click to hangup all active and incomming calls. Ctrl-click to end projection without jumping to your last location.")
else if(in_range(user, src) || isobserver(user))
. += span_notice("The status display reads: Current projection range: <b>[holo_range]</b> units.")
/obj/machinery/holopad/attackby(obj/item/P, mob/user, params)
if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P))
@@ -190,11 +213,11 @@ GLOBAL_LIST_EMPTY(network_holopads)
if(istype(P,/obj/item/disk/holodisk))
if(disk)
to_chat(user,"<span class='warning'>There's already a disk inside [src]!</span>")
to_chat(user,span_warning("There's already a disk inside [src]!"))
return
if (!user.transferItemToLoc(P,src))
return
to_chat(user,"<span class='notice'>You insert [P] into [src].</span>")
to_chat(user,span_notice("You insert [P] into [src]."))
disk = P
return
@@ -242,24 +265,29 @@ GLOBAL_LIST_EMPTY(network_holopads)
switch(action)
if("AIrequest")
if(isAI(usr))
var/mob/living/silicon/ai/ai_user = usr
ai_user.eyeobj.setLoc(get_turf(src))
to_chat(usr, span_info("AIs can not request AI presence. Jumping instead."))
return
if(last_request + 200 < world.time)
last_request = world.time
to_chat(usr, "<span class='info'>You requested an AI's presence.</span>")
to_chat(usr, span_info("You requested an AI's presence."))
var/area/area = get_area(src)
for(var/mob/living/silicon/ai/AI in GLOB.silicon_mobs)
if(!AI.client)
continue
to_chat(AI, "<span class='info'>Your presence is requested at <a href='?src=[REF(AI)];jumptoholopad=[REF(src)]'>\the [area]</a>.</span>")
to_chat(AI, span_info("Your presence is requested at <a href='?src=[REF(AI)];jumptoholopad=[REF(src)]'>\the [area]</a>.</span>")) // <a href='?src=[REF(AI)];project_to_holopad=[REF(src)]'>Project Hologram?</a>"))
return TRUE
else
to_chat(usr, "<span class='info'>A request for AI presence was already sent recently.</span>")
to_chat(usr, span_info("A request for AI presence was already sent recently."))
return
if("holocall")
if(outgoing_call)
return
if(usr.loc == loc)
var/list/callnames = list()
for(var/I in GLOB.network_holopads)
for(var/I in holopads)
var/area/A = get_area(I)
if(A)
LAZYADD(callnames[A], I)
@@ -274,7 +302,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
calling = TRUE
return TRUE
else
to_chat(usr, "<span class='warning'>You must stand on the holopad to make a call!</span>")
to_chat(usr, span_warning("You must stand on the holopad to make a call!"))
if("connectcall")
var/datum/holocall/call_to_connect = locate(params["holopad"]) in holo_calls
if(!QDELETED(call_to_connect))
@@ -285,6 +313,12 @@ GLOBAL_LIST_EMPTY(network_holopads)
if(!QDELETED(call_to_disconnect))
call_to_disconnect.Disconnect(src)
return TRUE
if("rejectall")
for(var/datum/holocall/call_to_reject as anything in holo_calls)
if(call_to_reject.connected_holopad == src) // do not kill the current connection
continue
call_to_reject.Disconnect(src)
return TRUE
if("disk_eject")
if(disk && !replay_mode)
disk.forceMove(drop_location())
@@ -327,14 +361,13 @@ GLOBAL_LIST_EMPTY(network_holopads)
return TRUE
/**
* hangup_all_calls: Disconnects all current holocalls from the holopad
*/
* hangup_all_calls: Disconnects all current holocalls from the holopad
*/
/obj/machinery/holopad/proc/hangup_all_calls()
for(var/I in holo_calls)
var/datum/holocall/HC = I
HC.Disconnect(src)
//do not allow AIs to answer calls or people will use it to meta the AI sattelite
/obj/machinery/holopad/attack_ai(mob/living/silicon/ai/user)
if (!istype(user))
return
@@ -343,12 +376,25 @@ GLOBAL_LIST_EMPTY(network_holopads)
/*There are pretty much only three ways to interact here.
I don't need to check for client since they're clicking on an object.
This may change in the future but for now will suffice.*/
if(user.eyeobj.loc != src.loc)//Set client eye on the object if it's not already.
user.eyeobj.setLoc(get_turf(src))
else if(!LAZYLEN(masters) || !masters[user])//If there is no hologram, possibly make one.
if(!LAZYLEN(masters) || !masters[user])//If there is no hologram, possibly make one.
activate_holo(user)
else//If there is a hologram, remove it.
else//If there is a hologram, remove it, and jump to your last location.
clear_holo(user)
// if(user.lastloc)//only jump to your last location if your lastloc is set, which only sets if you projected from a request message.
// user.eyeobj.setLoc(user.lastloc)
// user.lastloc = null
/obj/machinery/holopad/AICtrlClick(mob/living/silicon/ai/user)
if (!istype(user))
return
if (!on_network)
return
if(!LAZYLEN(masters) || !masters[user])//If there is no hologram, then this button does nothing.
return
else//If there is a hologram, remove it, but dont jump to your last location.
// user.lastloc = null
clear_holo(user)
return
/obj/machinery/holopad/process()
if(LAZYLEN(masters))
@@ -378,25 +424,26 @@ GLOBAL_LIST_EMPTY(network_holopads)
if(outgoing_call)
HC.Disconnect(src)//can't answer calls while calling
else
playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring!
playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring!
ringing = TRUE
update_icon()
update_appearance()
/obj/machinery/holopad/proc/activate_holo(mob/living/user)
var/mob/living/silicon/ai/AI = user
if(!istype(AI))
AI = null
if(is_operational() && (!AI || AI.eyeobj.loc == loc))//If the projector has power and client eye is on it
if (AI && istype(AI.current, /obj/machinery/holopad))
to_chat(user, "<span class='danger'>ERROR:</span> \black Image feed in progress.")
if(is_operational())//If the projector has power
if(AI && istype(AI.current, /obj/machinery/holopad))
to_chat(user, "[span_danger("ERROR:")] \black Image feed in progress.")
return
var/obj/effect/overlay/holo_pad_hologram/Hologram = new(loc)//Spawn a blank effect at the location.
if(AI)
Hologram.icon = AI.holo_icon
else //make it like real life
AI.eyeobj.setLoc(get_turf(src)) //ensure the AI camera moves to the holopad
else //make it like real life
Hologram.icon = user.icon
Hologram.icon_state = user.icon_state
Hologram.copy_overlays(user, TRUE)
@@ -407,17 +454,17 @@ GLOBAL_LIST_EMPTY(network_holopads)
Hologram.mouse_opacity = MOUSE_OPACITY_TRANSPARENT//So you can't click on it.
Hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
Hologram.setAnchored(TRUE)//So space wind cannot drag it.
Hologram.set_anchored(TRUE)//So space wind cannot drag it.
Hologram.name = "[user.name] (Hologram)"//If someone decides to right click.
Hologram.set_light(2) //hologram lighting
Hologram.set_light(2) //hologram lighting
move_hologram()
set_holo(user, Hologram)
visible_message("<span class='notice'>A holographic image of [user] flickers to life before your eyes!</span>")
visible_message(span_notice("A holographic image of [user] flickers to life before your eyes!"))
return Hologram
else
to_chat(user, "<span class='danger'>ERROR:</span> Unable to project hologram.")
to_chat(user, "[span_danger("ERROR:")] Unable to project hologram.")
/*This is the proc for special two-way communication between AI and holopad/people talking near holopad.
For the other part of the code, check silicon say.dm. Particularly robot talk.*/
@@ -430,10 +477,13 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
for(var/I in holo_calls)
var/datum/holocall/HC = I
if(HC.connected_holopad == src && speaker != HC.hologram)
HC.user.Hear(message, speaker, message_language, raw_message, radio_freq, spans, message_mods)
if(HC.connected_holopad == src)
if(speaker == HC.hologram && HC.user.client?.prefs.chat_on_map)
HC.user.create_chat_message(speaker, message_language, raw_message, spans)
else
HC.user.Hear(message, speaker, message_language, raw_message, radio_freq, spans, message_mods)
if(outgoing_call && speaker == outgoing_call.user)
if(outgoing_call?.hologram && speaker == outgoing_call.user)
outgoing_call.hologram.say(raw_message)
if(record_mode && speaker == record_user)
@@ -447,16 +497,15 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
set_light(2)
else
set_light(0)
update_icon()
update_appearance()
/obj/machinery/holopad/update_icon_state()
var/total_users = LAZYLEN(masters) + LAZYLEN(holo_calls)
if(ringing)
icon_state = "holopad_ringing"
else if(total_users || replay_mode)
icon_state = "holopad1"
else
icon_state = "holopad0"
icon_state = "[base_icon_state]_ringing"
return ..()
icon_state = "[base_icon_state][(total_users || replay_mode) ? 1 : 0]"
return ..()
/obj/machinery/holopad/proc/set_holo(mob/living/user, obj/effect/overlay/holo_pad_hologram/h)
LAZYSET(masters, user, h)
@@ -488,7 +537,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
var/obj/effect/overlay/holo_pad_hologram/h = masters[holo_owner]
if(!h || h.HC) //Holocalls can't change source.
return FALSE
for(var/pad in GLOB.network_holopads)
for(var/pad in holopads)
var/obj/machinery/holopad/another = pad
if(another == src)
continue
@@ -524,7 +573,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
else
transfered = TRUE
//All is good.
holo.forceMove(new_turf)
holo.abstract_move(new_turf)
if(!transfered)
update_holoray(user,new_turf)
return TRUE
@@ -565,10 +614,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
holder.selected_language = record.language
Hologram.mouse_opacity = MOUSE_OPACITY_TRANSPARENT//So you can't click on it.
Hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
Hologram.setAnchored(TRUE)//So space wind cannot drag it.
Hologram.set_anchored(TRUE)//So space wind cannot drag it.
Hologram.name = "[record.caller_name] (Hologram)"//If someone decides to right click.
Hologram.set_light(2) //hologram lighting
visible_message("<span class='notice'>A holographic image of [record.caller_name] flickers to life before your eyes!</span>")
Hologram.set_light(2) //hologram lighting
visible_message(span_notice("A holographic image of [record.caller_name] flickers to life before your eyes!"))
return Hologram
/obj/machinery/holopad/proc/replay_start()
@@ -661,7 +710,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
record_user = null
/obj/machinery/holopad/proc/record_clear()
if(disk && disk.record)
if(disk?.record)
QDEL_NULL(disk.record)
/obj/effect/overlay/holo_pad_hologram
@@ -673,6 +722,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
Impersonation = null
if(!QDELETED(HC))
HC.Disconnect(HC.calling_holopad)
HC = null
return ..()
/obj/effect/overlay/holo_pad_hologram/Process_Spacemove(movement_dir = 0)
+3 -1
View File
@@ -52,6 +52,8 @@
var/author_ckey
var/icon_generated = FALSE
var/icon/generated_icon
///boolean that blocks persistence from saving it. enabled from printing copies, because we do not want to save copies.
var/no_save = FALSE
// Painting overlay offset when framed
var/framed_offset_x = 11
@@ -370,7 +372,7 @@
update_icon()
/obj/structure/sign/painting/proc/save_persistent()
if(!persistence_id || !current_canvas)
if(!persistence_id || !current_canvas || current_canvas.no_save)
return
if(sanitize_filename(persistence_id) != persistence_id)
stack_trace("Invalid persistence_id - [persistence_id]")
+82 -44
View File
@@ -1,3 +1,5 @@
#define MAX_NOTICES 5
/obj/structure/noticeboard
name = "notice board"
desc = "A board for pinning important notices upon."
@@ -7,8 +9,25 @@
density = FALSE
anchored = TRUE
max_integrity = 150
/// Current number of a pinned notices
var/notices = 0
/obj/structure/noticeboard/directional/north
dir = SOUTH
pixel_y = 32
/obj/structure/noticeboard/directional/south
dir = NORTH
pixel_y = -32
/obj/structure/noticeboard/directional/east
dir = WEST
pixel_x = 32
/obj/structure/noticeboard/directional/west
dir = EAST
pixel_x = -32
/obj/structure/noticeboard/Initialize(mapload)
. = ..()
@@ -16,7 +35,7 @@
return
for(var/obj/item/I in loc)
if(notices > 4)
if(notices >= MAX_NOTICES)
break
if(istype(I, /obj/item/paper))
I.forceMove(src)
@@ -27,67 +46,84 @@
/obj/structure/noticeboard/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/paper) || istype(O, /obj/item/photo))
if(!allowed(user))
to_chat(user, "<span class='info'>You are not authorized to add notices</span>")
to_chat(user, span_warning("You are not authorized to add notices!"))
return
if(notices < 5)
if(notices < MAX_NOTICES)
if(!user.transferItemToLoc(O, src))
return
notices++
icon_state = "nboard0[notices]"
to_chat(user, "<span class='notice'>You pin the [O] to the noticeboard.</span>")
to_chat(user, span_notice("You pin the [O] to the noticeboard."))
else
to_chat(user, "<span class='notice'>The notice board is full</span>")
to_chat(user, span_warning("The notice board is full!"))
else
return ..()
/obj/structure/noticeboard/interact(mob/user)
ui_interact(user)
/obj/structure/noticeboard/ui_state(mob/user)
return GLOB.physical_state
/obj/structure/noticeboard/ui_interact(mob/user)
/obj/structure/noticeboard/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "NoticeBoard", name)
ui.open()
/obj/structure/noticeboard/ui_data(mob/user)
var/list/data = list()
data["allowed"] = allowed(user)
data["items"] = list()
for(var/obj/item/content in contents)
var/list/content_data = list(
name = content.name,
ref = REF(content)
)
data["items"] += list(content_data)
return data
/obj/structure/noticeboard/ui_act(action, params)
. = ..()
var/auth = allowed(user)
var/dat = "<B>[name]</B><BR>"
for(var/obj/item/P in src)
if(istype(P, /obj/item/paper))
dat += "<A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A> [auth ? "<A href='?src=[REF(src)];write=[REF(P)]'>Write</A> <A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A>" : ""]<BR>"
else
dat += "<A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A> [auth ? "<A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A>" : ""]<BR>"
user << browse("<HEAD><TITLE>Notices</TITLE></HEAD>[dat]","window=noticeboard")
onclose(user, "noticeboard")
if(.)
return
/obj/structure/noticeboard/Topic(href, href_list)
..()
usr.set_machine(src)
if(href_list["remove"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/I = locate(href_list["remove"]) in contents
if(istype(I) && I.loc == src)
I.forceMove(usr.loc)
usr.put_in_hands(I)
notices--
icon_state = "nboard0[notices]"
var/obj/item/item = locate(params["ref"]) in contents
if(!istype(item) || item.loc != src)
return
if(href_list["write"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/P = locate(href_list["write"]) in contents
if(istype(P) && P.loc == src)
var/obj/item/I = usr.is_holding_item_of_type(/obj/item/pen)
if(I)
add_fingerprint(usr)
P.attackby(I, usr)
var/mob/user = usr
switch(action)
if("examine")
if(istype(item, /obj/item/paper))
item.ui_interact(user)
else
to_chat(usr, "<span class='notice'>You'll need something to write with!</span>")
user.examinate(item)
return TRUE
if("remove")
if(!allowed(user))
return
remove_item(item, user)
return TRUE
if(href_list["read"])
var/obj/item/I = locate(href_list["read"]) in contents
if(istype(I) && I.loc == src)
usr.examinate(I)
/**
* Removes an item from the notice board
*
* Arguments:
* * item - The item that is to be removed
* * user - The mob that is trying to get the item removed, if there is one
*/
/obj/structure/noticeboard/proc/remove_item(obj/item/item, mob/user)
item.forceMove(drop_location())
if(user)
user.put_in_hands(item)
balloon_alert(user, "removed from board")
notices--
icon_state = "nboard0[notices]"
/obj/structure/noticeboard/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal (loc, 1)
new /obj/item/stack/sheet/iron (loc, 1)
for(var/obj/item/content in contents)
remove_item(content)
qdel(src)
// Notice boards for the heads of staff (plus the qm)
@@ -131,3 +167,5 @@
name = "Staff Notice Board"
desc = "Important notices from the heads of staff."
req_access = list(ACCESS_HEADS)
#undef MAX_NOTICES
@@ -5,7 +5,14 @@
var/title = "Untitled Conversation"
var/datum/computer_file/program/chatclient/operator // "Administrator" of this channel. Creator starts as channel's operator,
var/list/messages = list()
var/list/clients = list()
///chat clients who are active or minimized
var/list/active_clients = list()
///chat clients who have exited out of the program.
var/list/offline_clients = list()
///clients muted by operator
var/list/muted_clients = list()
//if a channel is strong, it cannot be renamed or deleted.
var/strong = FALSE
var/password
var/static/ntnrc_uid = 0
@@ -22,6 +29,8 @@
/datum/ntnet_conversation/Destroy()
if(SSnetworks.station_network)
SSnetworks.station_network.chat_channels.Remove(src)
for(var/datum/computer_file/program/chatclient/chatterbox in (active_clients | offline_clients | muted_clients))
purge_client(chatterbox)
return ..()
/datum/ntnet_conversation/proc/add_message(message, username)
@@ -38,39 +47,70 @@
return
messages = messages.Copy(messages.len-50 ,0)
/datum/ntnet_conversation/proc/add_client(datum/computer_file/program/chatclient/C)
if(!istype(C))
/datum/ntnet_conversation/proc/add_client(datum/computer_file/program/chatclient/new_user, silent = FALSE)
if(!istype(new_user))
return
clients.Add(C)
add_status_message("[C.username] has joined the channel.")
new_user.conversations |= src
active_clients.Add(new_user)
if(!silent)
add_status_message("[new_user.username] has joined the channel.")
// No operator, so we assume the channel was empty. Assign this user as operator.
if(!operator)
changeop(C)
changeop(new_user)
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/C)
if(!istype(C) || !(C in clients))
//Clear all of our references to a client, used for client deletion
/datum/ntnet_conversation/proc/purge_client(datum/computer_file/program/chatclient/forget)
remove_client(forget)
muted_clients -= forget
offline_clients -= forget
forget.conversations -= src
/datum/ntnet_conversation/proc/remove_client(datum/computer_file/program/chatclient/leaving)
if(!istype(leaving))
return
clients.Remove(C)
add_status_message("[C.username] has left the channel.")
if(leaving in active_clients)
active_clients.Remove(leaving)
add_status_message("[leaving.username] has left the channel.")
// Channel operator left, pick new operator
if(C == operator)
if(leaving == operator)
operator = null
if(clients.len)
var/datum/computer_file/program/chatclient/newop = pick(clients)
if(active_clients.len)
var/datum/computer_file/program/chatclient/newop = pick(active_clients)
changeop(newop)
/datum/ntnet_conversation/proc/go_offline(datum/computer_file/program/chatclient/offline)
if(!istype(offline) || !(offline in active_clients))
return
active_clients.Remove(offline)
offline_clients.Add(offline)
/datum/ntnet_conversation/proc/mute_user(datum/computer_file/program/chatclient/op, datum/computer_file/program/chatclient/muted)
if(operator != op) //sanity even if the person shouldn't be able to see the mute button
return
if(muted in muted_clients)
muted_clients.Remove(muted)
muted.computer.alert_call(muted, "You have been unmuted from [title]!", 'sound/machines/ping.ogg')
else
muted_clients.Add(muted)
muted.computer.alert_call(muted, "You have been muted from [title]!")
/datum/ntnet_conversation/proc/ping_user(datum/computer_file/program/chatclient/pinger, datum/computer_file/program/chatclient/pinged)
if(pinger in muted_clients) //oh my god fuck off
return
add_status_message("[pinger.username] pinged [pinged.username].")
pinged.computer.alert_call(pinged, "You have been pinged in [title] by [pinger.username]!", 'sound/machines/ping.ogg')
/datum/ntnet_conversation/proc/changeop(datum/computer_file/program/chatclient/newop)
if(istype(newop))
operator = newop
add_status_message("Channel operator status transferred to [newop.username].")
/datum/ntnet_conversation/proc/change_title(newtitle, datum/computer_file/program/chatclient/client)
if(operator != client)
return FALSE // Not Authorised
/datum/ntnet_conversation/proc/change_title(newtitle, datum/computer_file/program/chatclient/renamer)
if(operator != renamer || strong)
return FALSE // Not Authorised or channel cannot be editted
add_status_message("[client.username] has changed channel title from [title] to [newtitle]")
add_status_message("[renamer.username] has changed channel title from [title] to [newtitle]")
title = newtitle
#undef MAX_CHANNELS
@@ -39,7 +39,7 @@
. += "It has a slot installed for an intelliCard which contains: [ai_slot.stored_card.name]"
else
. += "It has a slot installed for an intelliCard, which appears to be occupied."
. += "<span class='info'>Alt-click to eject the intelliCard.</span>"
. += span_info("Alt-click to eject the intelliCard.")
else
. += "It has a slot installed for an intelliCard."
@@ -55,7 +55,7 @@
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]."
else
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied."
. += "<span class='info'>Alt-click [src] to eject the identification card[multiple_cards ? "s":""].</span>"
. += span_info("Alt-click [src] to eject the identification card[multiple_cards ? "s":""].")
else
. += "It has [multiple_slots ? "two slots" : "a slot"] installed for identification cards."
@@ -63,4 +63,4 @@
if(printer_slot)
. += "It has a printer installed."
if(user_is_adjacent)
. += "The printer's paper levels are at: [printer_slot.stored_paper]/[printer_slot.max_paper].</span>"
. += "The printer's paper levels are at: [printer_slot.stored_paper]/[printer_slot.max_paper].</span>]"
@@ -3,19 +3,19 @@
return FALSE
if(H.w_class > max_hardware_size)
to_chat(user, "<span class='warning'>This component is too large for \the [src]!</span>")
to_chat(user, span_warning("This component is too large for \the [src]!"))
return FALSE
if(H.expansion_hw)
if(LAZYLEN(expansion_bays) >= max_bays)
to_chat(user, "<span class='warning'>All of the computer's expansion bays are filled.</span>")
to_chat(user, span_warning("All of the computer's expansion bays are filled."))
return FALSE
if(LAZYACCESS(expansion_bays, H.device_type))
to_chat(user, "<span class='warning'>The computer immediately ejects /the [H] and flashes an error: \"Hardware Address Conflict\".</span>")
to_chat(user, span_warning("The computer immediately ejects /the [H] and flashes an error: \"Hardware Address Conflict\"."))
return FALSE
if(all_components[H.device_type])
to_chat(user, "<span class='warning'>This computer's hardware slot is already occupied by \the [all_components[H.device_type]].</span>")
to_chat(user, span_warning("This computer's hardware slot is already occupied by \the [all_components[H.device_type]]."))
return FALSE
return TRUE
@@ -32,7 +32,7 @@
LAZYSET(expansion_bays, H.device_type, H)
all_components[H.device_type] = H
to_chat(user, "<span class='notice'>You install \the [H] into \the [src].</span>")
to_chat(user, span_notice("You install \the [H] into \the [src]."))
H.holder = src
H.forceMove(src)
H.on_install(src, user)
@@ -47,14 +47,14 @@
LAZYREMOVE(expansion_bays, H.device_type)
all_components.Remove(H.device_type)
to_chat(user, "<span class='notice'>You remove \the [H] from \the [src].</span>")
to_chat(user, span_notice("You remove \the [H] from \the [src]."))
H.forceMove(get_turf(src))
H.holder = null
H.on_remove(src, user)
if(enabled && !use_power())
shutdown_computer()
update_icon()
update_appearance()
return TRUE
@@ -18,7 +18,7 @@
/obj/item/modular_computer/proc/break_apart()
if(!(flags_1 & NODECONSTRUCT_1))
physical.visible_message("<span class='notice'>\The [src] breaks apart!</span>")
physical.visible_message(span_notice("\The [src] breaks apart!"))
var/turf/newloc = get_turf(src)
new /obj/item/stack/sheet/metal(newloc, round(steel_sheet_cost/2))
for(var/C in all_components)
@@ -16,7 +16,7 @@
if(cell.use(amount * GLOB.CELLRATE))
return TRUE
else // Discharge the cell anyway.
cell.use(min(amount*GLOB.CELLRATE, cell.charge))
cell.use(min(amount * GLOB.CELLRATE, cell.charge))
return FALSE
return FALSE
@@ -13,6 +13,10 @@
ui.close()
return
// if(HAS_TRAIT(user, TRAIT_CHUNKYFINGERS))
// to_chat(user, span_warning("Your fingers are too big to use this right now!"))
// return
// Robots don't really need to see the screen, their wireless connection works as long as computer is on.
if(!screen_on && !issilicon(user))
if(ui)
@@ -30,7 +34,7 @@
// This screen simply lists available programs and user may select them.
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
if(!hard_drive || !hard_drive.stored_files || !hard_drive.stored_files.len)
to_chat(user, "<span class='danger'>\The [src] beeps three times, it's screen displaying a \"DISK ERROR\" warning.</span>")
to_chat(user, span_danger("\The [src] beeps three times, it's screen displaying a \"DISK ERROR\" warning."))
return // No HDD, No HDD files list or no stored files. Something is very broken.
ui = SStgui.try_update_ui(user, src, ui)
@@ -111,7 +115,7 @@
active_program.program_state = PROGRAM_STATE_BACKGROUND // Should close any existing UIs
active_program = null
update_icon()
update_appearance()
if(user && istype(user))
ui_interact(user) // Re-open the UI on this computer. It should show the main screen now.
if("eject_pen")
@@ -132,7 +136,7 @@
return
P.kill_program(forced = TRUE)
to_chat(user, "<span class='notice'>Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed.</span>")
to_chat(user, span_notice("Program [P.filename].[P.filetype] with PID [rand(100,999)] has been killed."))
if("PC_runprogram")
var/prog = params["name"]
@@ -142,7 +146,7 @@
P = hard_drive.find_file_by_name(prog)
if(!P || !istype(P)) // Program not found or it's not executable program.
to_chat(user, "<span class='danger'>\The [src]'s screen shows \"I/O ERROR - Unable to run program\" warning.</span>")
to_chat(user, span_danger("\The [src]'s screen shows \"I/O ERROR - Unable to run program\" warning."))
return
P.computer = src
@@ -156,22 +160,22 @@
active_program = P
P.alert_pending = FALSE
idle_threads.Remove(P)
update_icon()
update_appearance()
return
var/obj/item/computer_hardware/processor_unit/PU = all_components[MC_CPU]
if(idle_threads.len > PU.max_idle_programs)
to_chat(user, "<span class='danger'>\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error.</span>")
to_chat(user, span_danger("\The [src] displays a \"Maximal CPU load reached. Unable to run another program.\" error."))
return
if(P.requires_ntnet && !get_ntnet_status(P.requires_ntnet_feature)) // The program requires NTNet connection, but we are not connected to NTNet.
to_chat(user, "<span class='danger'>\The [src]'s screen shows \"Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning.</span>")
to_chat(user, span_danger("\The [src]'s screen shows \"Unable to connect to NTNet. Please retry. If problem persists contact your system administrator.\" warning."))
return
if(P.run_program(user))
active_program = P
P.alert_pending = FALSE
update_icon()
update_appearance()
return 1
if("PC_toggle_light")
@@ -185,7 +189,7 @@
if(!new_color)
return
if(color_hex2num(new_color) < 200) //Colors too dark are rejected
to_chat(user, "<span class='warning'>That color is too dark! Choose a lighter one.</span>")
to_chat(user, span_warning("That color is too dark! Choose a lighter one."))
new_color = null
return set_flashlight_color(new_color)
@@ -17,8 +17,8 @@
// No running around with open laptops in hands.
item_flags = SLOWS_WHILE_IN_HAND
screen_on = FALSE // Starts closed
var/start_open = TRUE // unless this var is set to 1
screen_on = FALSE // Starts closed
var/start_open = TRUE // unless this var is set to 1
var/icon_state_closed = "laptop-closed"
var/w_class_open = WEIGHT_CLASS_BULKY
var/slowdown_open = TRUE
@@ -44,15 +44,14 @@
/obj/item/modular_computer/laptop/update_icon_state()
if(!screen_on)
icon_state = icon_state_closed
else
. = ..()
return
return ..()
/obj/item/modular_computer/laptop/update_overlays()
if(screen_on)
return ..()
else
if(!screen_on)
cut_overlays()
icon_state = icon_state_closed
return
return ..()
/obj/item/modular_computer/laptop/attack_self(mob/user)
if(!screen_on)
@@ -68,7 +67,8 @@
try_toggle_open(usr)
/obj/item/modular_computer/laptop/MouseDrop(obj/over_object, src_location, over_location)
if(istype(over_object, /atom/movable/screen/inventory/hand) || over_object == usr)
. = ..()
if(istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
var/mob/M = usr
@@ -103,17 +103,17 @@
/obj/item/modular_computer/laptop/proc/toggle_open(mob/living/user=null)
if(screen_on)
to_chat(user, "<span class='notice'>You close \the [src].</span>")
to_chat(user, span_notice("You close \the [src]."))
slowdown = initial(slowdown)
w_class = initial(w_class)
else
to_chat(user, "<span class='notice'>You open \the [src].</span>")
to_chat(user, span_notice("You open \the [src]."))
slowdown = slowdown_open
w_class = w_class_open
screen_on = !screen_on
display_overlays = screen_on
update_icon()
update_appearance()
@@ -38,7 +38,7 @@
integrity_failure = machinery_computer.integrity_failure
base_active_power_usage = machinery_computer.base_active_power_usage
base_idle_power_usage = machinery_computer.base_idle_power_usage
machinery_computer.RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, /atom/proc/update_icon) //when we update_icon, also update the computer
machinery_computer.RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, /obj/machinery/modular_computer/proc/relay_icon_update) //when we update_icon, also update the computer
/obj/item/modular_computer/processor/relay_qdel()
qdel(machinery_computer)
@@ -47,7 +47,7 @@
if(!machinery_computer)
return
..()
machinery_computer.update_icon()
machinery_computer.update_appearance()
return
/obj/item/modular_computer/processor/attack_ghost(mob/user)
@@ -57,4 +57,4 @@
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext)
return
playsound(src, 'sound/machines/twobeep_high.ogg', 50, TRUE)
machinery_computer.visible_message("<span class='notice'>The [src] displays a [caller.filedesc] notification: [alerttext]</span>")
machinery_computer.visible_message(span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
@@ -2,9 +2,10 @@
name = "tablet computer"
icon = 'icons/obj/modular_tablet.dmi'
icon_state = "tablet-red"
icon_state_unpowered = "tablet"
icon_state_powered = "tablet"
icon_state_unpowered = "tablet-red"
icon_state_powered = "tablet-red"
icon_state_menu = "menu"
base_icon_state = "tablet"
// worn_icon_state = "tablet"
hardware_flag = PROGRAM_TABLET
max_hardware_size = 1
@@ -80,12 +81,12 @@
/obj/item/modular_computer/tablet/ui_data(mob/user)
. = ..()
.["PC_showpeneject"] = inserted_item ? 1 : 0
/obj/item/modular_computer/tablet/update_icon_state()
if(has_variants)
if(!finish_color)
finish_color = pick("red","blue","brown","green","black")
icon_state = icon_state_powered = icon_state_unpowered = "tablet-[finish_color]"
finish_color = pick("red", "blue", "brown", "green", "black")
icon_state = icon_state_powered = icon_state_unpowered = "[base_icon_state]-[finish_color]"
return ..()
/obj/item/modular_computer/tablet/syndicate_contract_uplink
name = "contractor tablet"
@@ -102,6 +103,8 @@
/// Given to Nuke Ops members.
/obj/item/modular_computer/tablet/nukeops
icon_state = "tablet-syndicate"
icon_state_powered = "tablet-syndicate"
icon_state_unpowered = "tablet-syndicate"
comp_light_luminosity = 6.3
has_variants = FALSE
device_theme = "syndicate"
@@ -109,15 +112,18 @@
/obj/item/modular_computer/tablet/nukeops/emag_act(mob/user)
if(!enabled)
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
to_chat(user, span_warning("You'd need to turn the [src] on first."))
return FALSE
to_chat(user, "<span class='notice'>You swipe \the [src]. It's screen briefly shows a message reading \"MEMORY CODE INJECTION DETECTED AND SUCCESSFULLY QUARANTINED\".</span>")
to_chat(user, span_notice("You swipe \the [src]. It's screen briefly shows a message reading \"MEMORY CODE INJECTION DETECTED AND SUCCESSFULLY QUARANTINED\"."))
return FALSE
/// Borg Built-in tablet interface
/obj/item/modular_computer/tablet/integrated
name = "modular interface"
icon_state = "tablet-silicon"
icon_state_powered = "tablet-silicon"
icon_state_unpowered = "tablet-silicon"
base_icon_state = "tablet-silicon"
has_light = FALSE //tablet light button actually enables/disables the borg lamp
comp_light_luminosity = 0
has_variants = FALSE
@@ -198,11 +204,13 @@
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext) //Yeah, we're checking alert_able. No, you don't get to make alerts that the user can't silence.
return
borgo.playsound_local(src, sound, 50, TRUE)
to_chat(borgo, "<span class='notice'>The [src] displays a [caller.filedesc] notification: [alerttext]</span>")
to_chat(borgo, span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
/obj/item/modular_computer/tablet/integrated/syndicate
icon_state = "tablet-silicon-syndicate"
icon_state_powered = "tablet-silicon-syndicate"
icon_state_unpowered = "tablet-silicon-syndicate"
device_theme = "syndicate"
@@ -20,6 +20,17 @@
install_component(new /obj/item/computer_hardware/card_slot)
install_component(new /obj/item/computer_hardware/printer/mini)
/obj/item/modular_computer/tablet/preset/science/Initialize()
. = ..()
var/obj/item/computer_hardware/hard_drive/small/hard_drive = new
install_component(new /obj/item/computer_hardware/processor_unit/small)
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
install_component(hard_drive)
install_component(new /obj/item/computer_hardware/card_slot)
install_component(new /obj/item/computer_hardware/network_card)
install_component(new /obj/item/computer_hardware/radio_card)
hard_drive.store_file(new /datum/computer_file/program/signaler)
/obj/item/modular_computer/tablet/preset/cargo/Initialize()
. = ..()
var/obj/item/computer_hardware/hard_drive/small/hard_drive = new
@@ -30,17 +41,38 @@
install_component(new /obj/item/computer_hardware/network_card)
install_component(new /obj/item/computer_hardware/printer/mini)
// hard_drive.store_file(new /datum/computer_file/program/shipping)
var/datum/computer_file/program/chatclient/chatprogram
chatprogram = new
hard_drive.store_file(chatprogram)
chatprogram.username = get_cargochat_username()
/obj/item/modular_computer/tablet/preset/cargo/proc/get_cargochat_username()
return "cargonian_[rand(1,999)]"
/obj/item/modular_computer/tablet/preset/cargo/quartermaster/get_cargochat_username()
return "quartermaster"
/obj/item/modular_computer/tablet/preset/advanced/atmos/Initialize() //This will be defunct and will be replaced when NtOS PDAs are done
. = ..()
install_component(new /obj/item/computer_hardware/sensorpackage)
/obj/item/modular_computer/tablet/preset/advanced/engineering/Initialize()
. = ..()
var/obj/item/computer_hardware/hard_drive/small/hard_drive = find_hardware_by_name("solid state drive")
hard_drive.store_file(new /datum/computer_file/program/supermatter_monitor)
/obj/item/modular_computer/tablet/preset/advanced/command/Initialize()
. = ..()
var/obj/item/computer_hardware/hard_drive/small/hard_drive = find_hardware_by_name("solid state drive")
install_component(new /obj/item/computer_hardware/sensorpackage)
install_component(new /obj/item/computer_hardware/card_slot/secondary)
hard_drive.store_file(new /datum/computer_file/program/budgetorders)
// hard_drive.store_file(new /datum/computer_file/program/science)
/obj/item/modular_computer/tablet/preset/advanced/command/engineering/Initialize()
. = ..()
var/obj/item/computer_hardware/hard_drive/small/hard_drive = find_hardware_by_name("solid state drive")
hard_drive.store_file(new /datum/computer_file/program/supermatter_monitor)
/// Given by the syndicate as part of the contract uplink bundle - loads in the Contractor Uplink.
/obj/item/modular_computer/tablet/syndicate_contract_uplink/preset/uplink/Initialize()
@@ -26,8 +26,6 @@
/obj/machinery/modular_computer/console/preset/proc/install_programs()
return
// ===== ENGINEERING CONSOLE =====
/obj/machinery/modular_computer/console/preset/engineering
console_department = "Engineering"
@@ -45,6 +43,7 @@
console_department = "Research"
name = "research director's console"
desc = "A stationary computer. This one comes preloaded with research programs."
_has_second_id_slot = TRUE
_has_ai = TRUE
/obj/machinery/modular_computer/console/preset/research/install_programs()
@@ -84,6 +83,18 @@
hard_drive.store_file(new/datum/computer_file/program/job_management())
hard_drive.store_file(new/datum/computer_file/program/crew_manifest())
/obj/machinery/modular_computer/console/preset/id/centcom
desc = "A stationary computer. This one comes preloaded with CentCom identification modification programs."
/obj/machinery/modular_computer/console/preset/id/centcom/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
var/datum/computer_file/program/card_mod/card_mod_centcom = new /datum/computer_file/program/card_mod()
card_mod_centcom.is_centcom = TRUE
hard_drive.store_file(new /datum/computer_file/program/chatclient())
hard_drive.store_file(card_mod_centcom)
hard_drive.store_file(new /datum/computer_file/program/job_management())
hard_drive.store_file(new /datum/computer_file/program/crew_manifest())
// ===== CIVILIAN CONSOLE =====
/obj/machinery/modular_computer/console/preset/civilian
console_department = "Civilian"
@@ -94,3 +105,79 @@
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/chatclient())
hard_drive.store_file(new/datum/computer_file/program/arcade())
// curator
/obj/machinery/modular_computer/console/preset/curator
console_department = "Civilian"
name = "curator console"
desc = "A stationary computer. This one comes preloaded with art programs."
_has_printer = TRUE
/obj/machinery/modular_computer/console/preset/curator/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
hard_drive.store_file(new/datum/computer_file/program/portrait_printer())
// ===== CARGO CHAT CONSOLES =====
/obj/machinery/modular_computer/console/preset/cargochat
name = "cargo chatroom console"
desc = "A stationary computer. This one comes preloaded with a chatroom for your cargo requests."
///chat client installed on this computer, just helpful for linking all the computers
var/datum/computer_file/program/chatclient/chatprogram
/obj/machinery/modular_computer/console/preset/cargochat/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
chatprogram = new
chatprogram.computer = cpu
hard_drive.store_file(chatprogram)
chatprogram.username = "[lowertext(console_department)]_department"
chatprogram.program_state = PROGRAM_STATE_ACTIVE
cpu.active_program = chatprogram
//ONE PER MAP PLEASE, IT MAKES A CARGOBUS FOR EACH ONE OF THESE
/obj/machinery/modular_computer/console/preset/cargochat/cargo
console_department = "Cargo"
name = "department chatroom console"
desc = "A stationary computer. This one comes preloaded with a chatroom for incoming cargo requests. You may moderate it from this computer."
/obj/machinery/modular_computer/console/preset/cargochat/cargo/install_programs()
var/obj/item/computer_hardware/hard_drive/hard_drive = cpu.all_components[MC_HDD]
//adding chat, setting it as the active window immediately
chatprogram = new
chatprogram.computer = cpu
hard_drive.store_file(chatprogram)
chatprogram.program_state = PROGRAM_STATE_ACTIVE
cpu.active_program = chatprogram
//setting up chat
chatprogram.username = "cargo_requests_operator"
var/datum/ntnet_conversation/cargochat = new
cargochat.operator = chatprogram //adding operator before joining the chat prevents an unnecessary message about switching op from showing
cargochat.add_client(chatprogram)
cargochat.title = "#cargobus"
cargochat.strong = TRUE
chatprogram.active_channel = cargochat.id
/obj/machinery/modular_computer/console/preset/cargochat/cargo/LateInitialize()
. = ..()
var/datum/ntnet_conversation/cargochat = SSnetworks.station_network.get_chat_channel_by_id(chatprogram.active_channel)
for(var/obj/machinery/modular_computer/console/preset/cargochat/cargochat_console in GLOB.machines)
if(cargochat_console == src)
continue
cargochat_console.chatprogram.active_channel = chatprogram.active_channel
cargochat.add_client(cargochat_console.chatprogram, silent = TRUE)
/obj/machinery/modular_computer/console/preset/cargochat/service
console_department = "Service"
/obj/machinery/modular_computer/console/preset/cargochat/engineering
console_department = "Engineering"
/obj/machinery/modular_computer/console/preset/cargochat/science
console_department = "Science"
/obj/machinery/modular_computer/console/preset/cargochat/security
console_department = "Security"
/obj/machinery/modular_computer/console/preset/cargochat/medical
console_department = "Medical"
@@ -4,28 +4,41 @@
name = "modular computer"
desc = "An advanced computer."
use_power = IDLE_POWER_USE
idle_power_usage = 5
var/hardware_flag = 0 // A flag that describes this device type
var/last_power_usage = 0 // Power usage during last tick
// Modular computers can run on various devices. Each DEVICE (Laptop, Console, Tablet,..)
// must have it's own DMI file. Icon states must be called exactly the same in all files, but may look differently
// If you create a program which is limited to Laptops and Consoles you don't have to add it's icon_state overlay for Tablets too, for example.
icon = null
icon_state = null
var/icon_state_unpowered = null // Icon state when the computer is turned off.
var/icon_state_powered = null // Icon state when the computer is turned on.
var/screen_icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
var/screen_icon_screensaver = "standby" // Icon state overlay when the computer is powered, but not 'switched on'.
var/max_hardware_size = 0 // Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed.
var/steel_sheet_cost = 10 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
var/light_strength = 0 // Light luminosity when turned on
var/base_active_power_usage = 100 // Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too.
var/base_idle_power_usage = 10 // Power usage when the computer is idle and screen is off (currently only applies to laptops)
var/obj/item/modular_computer/processor/cpu = null // CPU that handles most logic while this type only handles power and other specific things.
use_power = IDLE_POWER_USE
idle_power_usage = 5
///A flag that describes this device type
var/hardware_flag = 0
///Power usage during last tick
var/last_power_usage = 0
///Icon state when the computer is turned off.
var/icon_state_unpowered = null
///Icon state when the computer is turned on.
var/icon_state_powered = null
///Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
var/screen_icon_state_menu = "menu"
///Icon state overlay when the computer is powered, but not 'switched on'.
var/screen_icon_screensaver = "standby"
///Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed.
var/max_hardware_size = 0
///Amount of steel sheets refunded when disassembling an empty frame of this computer.
var/steel_sheet_cost = 10
///Light luminosity when turned on
var/light_strength = 0
///Power usage when the computer is open (screen is active) and can be interacted with. Remember hardware can use power too.
var/base_active_power_usage = 100
///Power usage when the computer is idle and screen is off (currently only applies to laptops)
var/base_idle_power_usage = 10
///CPU that handles most logic while this type only handles power and other specific things.
var/obj/item/modular_computer/processor/cpu = null
/obj/machinery/modular_computer/Initialize()
. = ..()
@@ -48,32 +61,35 @@
cpu.attack_ghost(user)
/obj/machinery/modular_computer/emag_act(mob/user)
. = ..()
if(!cpu)
to_chat(user, "<span class='warning'>You'd need to turn the [src] on first.</span>")
to_chat(user, span_warning("You'd need to turn the [src] on first."))
return FALSE
return (cpu.emag_act(user))
/obj/machinery/modular_computer/update_icon()
cut_overlays()
icon_state = icon_state_powered
/obj/machinery/modular_computer/update_appearance(updates)
. = ..()
set_light(cpu?.enabled ? light_strength : 0)
if(!cpu || !cpu.enabled)
/obj/machinery/modular_computer/update_icon_state()
icon_state = (cpu?.enabled || (!(stat & NOPOWER) && cpu?.use_power())) ? icon_state_powered : icon_state_unpowered
return ..()
/obj/machinery/modular_computer/update_overlays()
. = ..()
if(!cpu?.enabled)
if (!(stat & NOPOWER) && (cpu?.use_power()))
add_overlay(screen_icon_screensaver)
else
icon_state = icon_state_unpowered
set_light(0)
. += screen_icon_screensaver
else
set_light(light_strength)
if(cpu.active_program)
add_overlay(cpu.active_program.program_icon_state ? cpu.active_program.program_icon_state : screen_icon_state_menu)
else
add_overlay(screen_icon_state_menu)
. += cpu.active_program?.program_icon_state || screen_icon_state_menu
if(cpu && cpu.obj_integrity <= cpu.integrity_failure * cpu.max_integrity)
add_overlay("bsod")
add_overlay("broken")
. += "bsod"
. += "broken"
/// Eats the "source" arg because update_icon actually expects args now.
/obj/machinery/modular_computer/proc/relay_icon_update(datum/source, updates, updated)
SIGNAL_HANDLER
return update_icon(updates)
/obj/machinery/modular_computer/AltClick(mob/user)
if(cpu)
@@ -98,17 +114,17 @@
/obj/machinery/modular_computer/proc/power_failure(malfunction = 0)
var/obj/item/computer_hardware/battery/battery_module = cpu.all_components[MC_CELL]
if(cpu?.enabled) // Shut down the computer
visible_message("<span class='danger'>\The [src]'s screen flickers [battery_module ? "\"BATTERY [malfunction ? "MALFUNCTION" : "CRITICAL"]\"" : "\"EXTERNAL POWER LOSS\""] warning as it shuts down unexpectedly.</span>")
visible_message(span_danger("\The [src]'s screen flickers [battery_module ? "\"BATTERY [malfunction ? "MALFUNCTION" : "CRITICAL"]\"" : "\"EXTERNAL POWER LOSS\""] warning as it shuts down unexpectedly."))
if(cpu)
cpu.shutdown_computer(0)
stat |= NOPOWER
update_icon()
set_machine_stat(stat | NOPOWER)
update_appearance()
// Modular computers can have battery in them, we handle power in previous proc, so prevent this from messing it up for us.
/obj/machinery/modular_computer/power_change()
if(cpu?.use_power()) // If MC_CPU still has a power source, PC wouldn't go offline.
stat &= ~NOPOWER
update_icon()
set_machine_stat(stat & ~NOPOWER)
update_appearance()
return
. = ..()
@@ -116,7 +132,7 @@
if(cpu)
return cpu.screwdriver_act(user, tool)
/obj/machinery/modular_computer/attackby(obj/item/W as obj, mob/user)
/obj/machinery/modular_computer/attackby(obj/item/W as obj, mob/living/user)
if (user.a_intent == INTENT_HELP && cpu && !(flags_1 & NODECONSTRUCT_1))
return cpu.attackby(W, user)
return ..()
@@ -126,15 +142,16 @@
// Minor explosions are mostly mitigitated by casing.
/obj/machinery/modular_computer/ex_act(severity)
if(cpu)
cpu.ex_act(severity)
// switch(severity)
// if(EXPLODE_DEVASTATE)
// SSexplosions.high_mov_atom += cpu
// if(EXPLODE_HEAVY)
// SSexplosions.med_mov_atom += cpu
// if(EXPLODE_LIGHT)
// SSexplosions.low_mov_atom += cpu
..()
return cpu.ex_act(severity)
// switch(severity)
// if(EXPLODE_DEVASTATE)
// SSexplosions.high_mov_atom += cpu
// if(EXPLODE_HEAVY)
// SSexplosions.med_mov_atom += cpu
// if(EXPLODE_LIGHT)
// SSexplosions.low_mov_atom += cpu
return ..()
// EMPs are similar to explosions, but don't cause physical damage to the casing. Instead they screw up the components
/obj/machinery/modular_computer/emp_act(severity)
@@ -16,7 +16,8 @@
light_strength = 2
max_integrity = 300
integrity_failure = 0.5
var/console_department = "" // Used in New() to set network tag according to our area.
///Used in New() to set network tag according to our area.
var/console_department = ""
/obj/machinery/modular_computer/console/buildable/Initialize()
. = ..()
@@ -52,4 +53,4 @@
network_card.identification_string = "Unknown Console"
if(cpu)
cpu.screen_on = 1
update_icon()
update_appearance()
@@ -1,11 +1,11 @@
/datum/computer_file
var/filename = "NewFile" // Placeholder. No spacebars
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
var/size = 1 // File size in GQ. Integers only!
var/obj/item/computer_hardware/hard_drive/holder // Holder that contains this file.
var/unsendable = FALSE // Whether the file may be sent to someone via NTNet transfer or other means.
var/undeletable = FALSE // Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc.
var/uid // UID of this file
var/filename = "NewFile" // Placeholder. No spacebars
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
var/size = 1 // File size in GQ. Integers only!
var/obj/item/computer_hardware/hard_drive/holder // Holder that contains this file.
var/unsendable = FALSE // Whether the file may be sent to someone via NTNet transfer or other means.
var/undeletable = FALSE // Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc.
var/uid // UID of this file
var/static/file_uid = 0
/datum/computer_file/New()
@@ -1,10 +1,10 @@
// /data/ files store data in string format.
// They don't contain other logic for now.
/datum/computer_file/data
var/stored_data = "" // Stored data in string format.
var/stored_data = "" // Stored data in string format.
filetype = "DAT"
var/block_size = 250
var/do_not_edit = 0 // Whether the user will be reminded that the file probably shouldn't be edited.
var/do_not_edit = 0 // Whether the user will be reminded that the file probably shouldn't be edited.
/datum/computer_file/data/clone()
var/datum/computer_file/data/temp = ..()
@@ -15,6 +15,8 @@
var/filedesc = "Unknown Program"
/// Short description of this program's function.
var/extended_desc = "N/A"
/// Category in the NTDownloader.
var/category = PROGRAM_CATEGORY_MISC
/// Program-specific screen icon state
var/program_icon_state = null
/// Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes.
@@ -25,10 +27,10 @@
var/ntnet_status = 1
/// Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL
var/usage_flags = PROGRAM_ALL
/// Whether the program can be downloaded from NTNet. Set to 0 to disable.
var/available_on_ntnet = 1
/// Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
var/available_on_syndinet = 0
/// Whether the program can be downloaded from NTNet. Set to FALSE to disable.
var/available_on_ntnet = TRUE
/// Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to TRUE to enable.
var/available_on_syndinet = FALSE
/// Name of the tgui interface
var/tgui_id
/// Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /icons/program_icons. Be careful not to use too large images!
@@ -64,7 +66,7 @@
// Relays icon update to the computer.
/datum/computer_file/program/proc/update_computer_icon()
if(computer)
computer.update_icon()
computer.update_appearance()
// Attempts to create a log in global ntnet datum. Returns 1 on success, 0 on fail.
/datum/computer_file/program/proc/generate_network_log(text)
@@ -72,10 +74,25 @@
return computer.add_log(text)
return 0
/**
*Runs when the device is used to attack an atom in non-combat mode.
*
*Simulates using the device to read or scan something. Tap is called by the computer during pre_attack
*and sends us all of the related info. If we return TRUE, the computer will stop the attack process
*there. What we do with the info is up to us, but we should only return TRUE if we actually perform
*an action of some sort.
*Arguments:
*A is the atom being tapped
*user is the person making the attack action
*params is anything the pre_attack() proc had in the same-named variable.
*/
/datum/computer_file/program/proc/tap(atom/A, mob/living/user, params)
return FALSE
/datum/computer_file/program/proc/is_supported_by_hardware(hardware_flag = 0, loud = 0, mob/user = null)
if(!(hardware_flag & usage_flags))
if(loud && computer && user)
to_chat(user, "<span class='danger'>\The [computer] flashes a \"Hardware Error - Incompatible software\" warning.</span>")
to_chat(user, span_danger("\The [computer] flashes a \"Hardware Error - Incompatible software\" warning."))
return FALSE
return TRUE
@@ -109,7 +126,7 @@
if(!access_to_check) // No required_access, allow it.
return TRUE
if(!transfer && computer && (computer.obj_flags & EMAGGED)) //emags can bypass the execution locks but not the download ones.
if(!transfer && computer && (computer.obj_flags & EMAGGED)) //emags can bypass the execution locks but not the download ones.
return TRUE
if(IsAdminGhost(user))
@@ -127,14 +144,14 @@
if(!D)
if(loud)
to_chat(user, "<span class='danger'>\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.</span>")
to_chat(user, span_danger("\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning."))
return FALSE
access = D.GetAccess()
if(access_to_check in access)
return TRUE
if(loud)
to_chat(user, "<span class='danger'>\The [computer] flashes an \"Access Denied\" warning.</span>")
to_chat(user, span_danger("\The [computer] flashes an \"Access Denied\" warning."))
return FALSE
// This attempts to retrieve header data for UIs. If implementing completely new device of different type than existing ones
@@ -219,7 +236,7 @@
program_state = PROGRAM_STATE_BACKGROUND // Should close any existing UIs
computer.active_program = null
computer.update_icon()
computer.update_appearance()
ui.close()
if(user && istype(user))
@@ -13,6 +13,6 @@
/datum/computer_file/program/proc/event_networkfailure(background)
kill_program(forced = TRUE)
if(background)
computer.visible_message("<span class='danger'>\The [computer]'s screen displays a \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error</span>")
computer.visible_message(span_danger("\The [computer]'s screen displays a \"Process [filename].[filetype] (PID [rand(100,999)]) terminated - Network Error\" error"))
else
computer.visible_message("<span class='danger'>\The [computer]'s screen briefly freezes and then shows \"NETWORK ERROR - NTNet connection lost. Please retry. If problem persists contact your system administrator.\" error.</span>")
computer.visible_message(span_danger("\The [computer]'s screen briefly freezes and then shows \"NETWORK ERROR - NTNet connection lost. Please retry. If problem persists contact your system administrator.\" error."))
@@ -1,6 +1,7 @@
/datum/computer_file/program/aidiag
filename = "aidiag"
filedesc = "NT FRK"
category = PROGRAM_CATEGORY_ROBO
program_icon_state = "generic"
extended_desc = "Firmware Restoration Kit, capable of reconstructing damaged AI systems. Requires direct AI connection via intellicard slot."
size = 12
@@ -55,7 +56,7 @@
/datum/computer_file/program/aidiag/process_tick()
. = ..()
if(!restoring) //Put the check here so we don't check for an ai all the time
if(!restoring) //Put the check here so we don't check for an ai all the time
return
var/obj/item/aicard/cardhold = get_ai(2)
@@ -64,7 +65,7 @@
var/mob/living/silicon/ai/A = get_ai()
if(!A || !cardhold)
restoring = FALSE // If the AI was removed, stop the restoration sequence.
restoring = FALSE // If the AI was removed, stop the restoration sequence.
if(ai_slot)
ai_slot.locked = FALSE
return
@@ -84,7 +85,7 @@
if(A.health >= 0 && A.stat == DEAD)
A.revive(full_heal = FALSE, admin_revive = FALSE)
cardhold.update_icon()
cardhold.update_appearance()
// Finished restoring
if(A.health >= 100)
@@ -1,6 +1,7 @@
/datum/computer_file/program/contract_uplink
filename = "contractor uplink"
filedesc = "Syndicate Contractor Uplink"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "assign"
extended_desc = "A standard, Syndicate issued system for handling important contracts while on the field."
size = 10
@@ -91,9 +92,9 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.put_in_hands(crystals))
to_chat(H, "<span class='notice'>Your payment materializes into your hands!</span>")
to_chat(H, span_notice("Your payment materializes into your hands!"))
else
to_chat(user, "<span class='notice'>Your payment materializes onto the floor.</span>")
to_chat(user, span_notice("Your payment materializes onto the floor."))
hard_drive.traitor_data.contractor_hub.contract_TC_payed_out += hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem
hard_drive.traitor_data.contractor_hub.contract_TC_to_redeem = 0
@@ -164,6 +165,11 @@
))
for (var/datum/syndicate_contract/contract in traitor_data.contractor_hub.assigned_contracts)
if(!contract.contract)
stack_trace("Syndiate contract with null contract objective found in [traitor_data.owner]'s contractor hub!")
contract.status = CONTRACT_STATUS_ABORTED
continue
data["contracts"] += list(list(
"target" = contract.contract.target,
"target_rank" = contract.target_rank,
@@ -1,6 +1,7 @@
/datum/computer_file/program/ntnet_dos
filename = "ntn_dos"
filedesc = "DoS Traffic Generator"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "hostile"
extended_desc = "This advanced script can perform denial of service attacks against NTNet quantum relays. The system administrator will probably notice this. Multiple devices can run this program together against same relay for increased effect"
size = 20
@@ -1,6 +1,7 @@
/datum/computer_file/program/revelation
filename = "revelation"
filedesc = "Revelation"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "hostile"
extended_desc = "This virus can destroy hard drive of system it is executed on. It may be obfuscated to look like another non-malicious program. Once armed, it will destroy the system upon next execution."
size = 13
@@ -20,13 +21,13 @@
if(computer)
if(istype(computer, /obj/item/modular_computer/tablet/integrated)) //If this is a borg's integrated tablet
var/obj/item/modular_computer/tablet/integrated/modularInterface = computer
to_chat(modularInterface.borgo,"<span class='userdanger'>SYSTEM PURGE DETECTED/</span>")
to_chat(modularInterface.borgo,span_userdanger("SYSTEM PURGE DETECTED/"))
addtimer(CALLBACK(modularInterface.borgo, /mob/living/silicon/robot/.proc/death), 2 SECONDS, TIMER_UNIQUE)
return
computer.visible_message("<span class='notice'>\The [computer]'s screen brightly flashes and loud electrical buzzing is heard.</span>")
computer.visible_message(span_notice("\The [computer]'s screen brightly flashes and loud electrical buzzing is heard."))
computer.enabled = FALSE
computer.update_icon()
computer.update_appearance()
var/obj/item/computer_hardware/hard_drive/hard_drive = computer.all_components[MC_HDD]
var/obj/item/computer_hardware/battery/battery_module = computer.all_components[MC_CELL]
var/obj/item/computer_hardware/recharger/recharger = computer.all_components[MC_CHARGE]
@@ -34,13 +35,13 @@
computer.take_damage(25, BRUTE, 0, 0)
if(battery_module && prob(25))
qdel(battery_module)
computer.visible_message("<span class='notice'>\The [computer]'s battery explodes in rain of sparks.</span>")
computer.visible_message(span_notice("\The [computer]'s battery explodes in rain of sparks."))
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
spark_system.start()
if(recharger && prob(50))
qdel(recharger)
computer.visible_message("<span class='notice'>\The [computer]'s recharger explodes in rain of sparks.</span>")
computer.visible_message(span_notice("\The [computer]'s recharger explodes in rain of sparks."))
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread
spark_system.start()
@@ -32,7 +32,7 @@
game_active = FALSE
program_icon_state = "arcade_off"
if(istype(computer))
computer.update_icon()
computer.update_appearance()
ticket_count += 1
// user?.mind?.adjust_experience(/datum/skill/gaming, 50)
sleep(10)
@@ -42,7 +42,7 @@
game_active = FALSE
program_icon_state = "arcade_off"
if(istype(computer))
computer.update_icon()
computer.update_appearance()
// user?.mind?.adjust_experience(/datum/skill/gaming, 10)
sleep(10)
@@ -150,20 +150,20 @@
return TRUE
if("Dispense_Tickets")
if(!printer)
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to redeem tickets.</span>")
to_chat(usr, span_notice("Hardware error: A printer is required to redeem tickets."))
return
if(printer.stored_paper <= 0)
to_chat(usr, "<span class='notice'>Hardware error: Printer is out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer is out of paper."))
return
else
computer.visible_message("<span class='notice'>\The [computer] prints out paper.</span>")
computer.visible_message(span_notice("\The [computer] prints out paper."))
if(ticket_count >= 1)
new /obj/item/stack/arcadeticket((get_turf(computer)), 1)
to_chat(usr, "<span class='notice'>[src] dispenses a ticket!</span>")
to_chat(usr, span_notice("[computer] dispenses a ticket!"))
ticket_count -= 1
printer.stored_paper -= 1
else
to_chat(usr, "<span class='notice'>You don't have any stored tickets!</span>")
to_chat(usr, span_notice("You don't have any stored tickets!"))
return TRUE
if("Start_Game")
game_active = TRUE
@@ -175,4 +175,4 @@
boss_id = rand(1,6)
pause_state = FALSE
if(istype(computer))
computer.update_icon()
computer.update_appearance()
@@ -1,6 +1,7 @@
/datum/computer_file/program/atmosscan
filename = "atmosscan"
filedesc = "AtmoZphere"
category = PROGRAM_CATEGORY_ENGI
program_icon_state = "air"
extended_desc = "A small built-in sensor reads out the atmospheric conditions around the device."
size = 4
@@ -12,7 +13,7 @@
if (!.)
return
if(!computer?.get_modular_computer_part(MC_SENSORS)) //Giving a clue to users why the program is spitting out zeros.
to_chat(user, "<span class='warning'>\The [computer] flashes an error: \"hardware\\sensorpackage\\startup.bin -- file not found\".</span>")
to_chat(user, span_warning("\The [computer] flashes an error: \"hardware\\sensorpackage\\startup.bin -- file not found\"."))
/datum/computer_file/program/atmosscan/ui_data(mob/user)
@@ -1,6 +1,7 @@
/datum/computer_file/program/borg_monitor
filename = "siliconnect"
filedesc = "SiliConnect"
category = PROGRAM_CATEGORY_ROBO
ui_header = "borg_mon.gif"
program_icon_state = "generic"
extended_desc = "This program allows for remote monitoring of station cyborgs."
@@ -9,6 +10,70 @@
size = 5
tgui_id = "NtosCyborgRemoteMonitor"
program_icon = "project-diagram"
var/emagged = FALSE ///Bool of if this app has already been emagged
var/list/loglist = list() ///A list to copy a borg's IC log list into
var/mob/living/silicon/robot/DL_source ///reference of a borg if we're downloading a log, or null if not.
var/DL_progress = -1 ///Progress of current download, 0 to 100, -1 for no current download
/datum/computer_file/program/borg_monitor/Destroy()
loglist = null
DL_source = null
return ..()
/datum/computer_file/program/borg_monitor/kill_program(forced = FALSE)
loglist = null //Not everything is saved if you close an app
DL_source = null
DL_progress = 0
return ..()
/datum/computer_file/program/borg_monitor/run_emag()
if(emagged)
return FALSE
emagged = TRUE
return TRUE
/datum/computer_file/program/borg_monitor/tap(atom/A, mob/living/user, params)
var/mob/living/silicon/robot/borgo = A
if(!istype(borgo) || !borgo.modularInterface)
return FALSE
DL_source = borgo
DL_progress = 0
var/username = "unknown user"
var/obj/item/card/id/stored_card = computer.GetID()
if(istype(stored_card) && stored_card.registered_name)
username = "user [stored_card.registered_name]"
to_chat(borgo, span_userdanger("Request received from [username] for the system log file. Upload in progress."))//Damning evidence may be contained, so warn the borg
borgo.logevent("File request by [username]: /var/logs/syslog")
return TRUE
/datum/computer_file/program/borg_monitor/process_tick()
if(!DL_source)
DL_progress = -1
return
var/turf/here = get_turf(computer)
var/turf/there = get_turf(DL_source)
if(!here.Adjacent(there))//If someone walked away, cancel the download
to_chat(DL_source, span_danger("Log upload failed: general connection error."))//Let the borg know the upload stopped
DL_source = null
DL_progress = -1
return
if(DL_progress == 100)
if(!DL_source || !DL_source.modularInterface) //sanity check, in case the borg or their modular tablet poofs somehow
loglist = list("System log of unit [DL_source.name]")
loglist += "Error -- Download corrupted."
else
loglist = DL_source.modularInterface.borglog.Copy()
loglist.Insert(1,"System log of unit [DL_source.name]")
DL_progress = -1
DL_source = null
for(var/datum/tgui/window in SStgui.open_uis_by_src[REF(src)])
window.send_full_update()
return
DL_progress += 25
/datum/computer_file/program/borg_monitor/ui_data(mob/user)
var/list/data = get_header_data()
@@ -32,15 +97,22 @@
var/list/cyborg_data = list(
name = R.name,
integ = round((R.health + 100) / 2), //mob heath is -100 to 100, we want to scale that to 0 - 100
locked_down = R.locked_down,
status = R.stat,
shell_discon = shell,
charge = R.cell ? round(R.cell.percent()) : null,
module = R.module ? "[R.module.name] Module" : "No Module Detected",
module = R.module ? "[R.module.name] Model" : "No Model Detected",
upgrades = upgrade,
ref = REF(R)
)
data["cyborgs"] += list(cyborg_data)
data["DL_progress"] = DL_progress
return data
/datum/computer_file/program/borg_monitor/ui_static_data(mob/user)
var/list/data = list()
data["borglog"] = loglist
return data
/datum/computer_file/program/borg_monitor/ui_act(action, params)
@@ -57,16 +129,16 @@
if(!ID)
return
if(R.stat == DEAD) //Dead borgs will listen to you no longer
to_chat(usr, "<span class='warn'>Error -- Could not open a connection to unit:[R]</span>")
to_chat(usr, span_warning("Error -- Could not open a connection to unit:[R]"))
var/message = stripped_input(usr, message = "Enter message to be sent to remote cyborg.", title = "Send Message")
if(!message)
return
to_chat(R, "<br><br><span class='notice'>Message from [ID] -- \"[message]\"</span><br>")
to_chat(R, "<br><br>[span_notice("Message from [ID] -- \"[message]\"")]<br>")
to_chat(usr, "Message sent to [R]: [message]")
R.logevent("Message from [ID] -- \"[message]\"")
SEND_SOUND(R, 'sound/machines/twobeep_high.ogg')
if(R.connected_ai)
to_chat(R.connected_ai, "<br><br><span class='notice'>Message from [ID] to [R] -- \"[message]\"</span><br>")
to_chat(R.connected_ai, "<br><br>[span_notice("Message from [ID] to [R] -- \"[message]\"")]<br>")
SEND_SOUND(R.connected_ai, 'sound/machines/twobeep_high.ogg')
usr.log_talk(message, LOG_PDA, tag="Cyborg Monitor Program: ID name \"[ID]\" to [R]")
@@ -82,12 +154,15 @@
/datum/computer_file/program/borg_monitor/proc/checkID()
var/obj/item/card/id/ID = computer.GetID()
if(!ID)
if(emagged)
return "STDERR:UNDF"
return FALSE
return ID.registered_name
/datum/computer_file/program/borg_monitor/syndicate
filename = "roboverlord"
filedesc = "Roboverlord"
category = PROGRAM_CATEGORY_ROBO
ui_header = "borg_mon.gif"
program_icon_state = "generic"
extended_desc = "This program allows for remote monitoring of mission-assigned cyborgs."
@@ -97,6 +172,9 @@
transfer_access = null
tgui_id = "NtosCyborgRemoteMonitorSyndicate"
/datum/computer_file/program/borg_monitor/syndicate/run_emag()
return FALSE
/datum/computer_file/program/borg_monitor/syndicate/evaluate_borg(mob/living/silicon/robot/R)
if((get_turf(computer)).z != (get_turf(R)).z)
return FALSE
@@ -1,6 +1,7 @@
/datum/computer_file/program/bounty_board
filename = "bountyboard"
filedesc = "Bounty Board Request Network"
category = PROGRAM_CATEGORY_SUPL
program_icon_state = "bountyboard"
extended_desc = "A multi-platform network for placing requests across the station, with payment across the network being possible.."
requires_ntnet = TRUE
@@ -1,41 +1,50 @@
/datum/computer_file/program/budgetorders
filename = "orderapp"
filedesc = "NT IRN"
// category = PROGRAM_CATEGORY_SUPL
category = PROGRAM_CATEGORY_SUPL
program_icon_state = "request"
extended_desc = "Nanotrasen Internal Requisition Network interface for supply purchasing using a department budget account."
requires_ntnet = TRUE
transfer_access = ACCESS_HEADS
usage_flags = PROGRAM_LAPTOP | PROGRAM_TABLET
size = 20
tgui_id = "NtosCargo"
///Are you actually placing orders with it?
var/requestonly = TRUE
///Can the tablet see or buy illegal stuff?
var/contraband_view = FALSE
var/contraband = FALSE
///Is it being bought from a personal account, or is it being done via a budget/cargo?
var/self_paid = FALSE
///Can this console approve purchase requests?
var/can_approve_requests = FALSE
///What do we say when the shuttle moves with living beings on it.
var/safety_warning = "For safety reasons, the automated supply shuttle \
cannot transport live organisms, human remains, classified nuclear weaponry, \
homing beacons or machinery housing any form of artificial intelligence."
var/safety_warning = "For safety and ethical reasons, the automated supply shuttle \
cannot transport live organisms, human remains, classified nuclear weaponry, mail, \
homing beacons, unstable eigenstates or machinery housing any form of artificial intelligence."
///If you're being raided by pirates, what do you tell the crew?
var/blockade_warning = "Bluespace instability detected. Shuttle movement impossible."
///The name of the shuttle template being used as the cargo shuttle. 'supply' is default and contains critical code. Don't change this unless you know what you're doing.
var/cargo_shuttle = "supply"
///The docking port called when returning to the station.
var/docking_home = "supply_home"
///The docking port called when leaving the station.
var/docking_away = "supply_away"
///If this console can loan the cargo shuttle. Set to false to disable.
var/stationcargo = TRUE
///The account this console processes and displays. Independent from the account the shuttle processes.
var/cargo_account = ACCOUNT_CAR
/datum/computer_file/program/budgetorders/proc/get_export_categories()
. = EXPORT_CARGO
/datum/computer_file/program/budgetorders/run_emag()
if(!contraband_view)
contraband_view = TRUE
if(!contraband)
contraband = TRUE
return TRUE
/datum/computer_file/program/budgetorders/proc/is_visible_pack(mob/user, paccess_to_check, list/access, contraband)
if(issilicon(user)) //Borgs can't buy things.
return FALSE
if((computer.obj_flags & EMAGGED) || contraband_view)
if(computer.obj_flags & EMAGGED)
return TRUE
else if(contraband) //Hide contrband when non-emagged.
return FALSE
@@ -64,11 +73,11 @@
. = ..()
var/list/data = get_header_data()
data["location"] = SSshuttle.supply.getStatusText()
var/datum/bank_account/buyer = SSeconomy.get_dep_account(ACCOUNT_CAR)
var/datum/bank_account/buyer = SSeconomy.get_dep_account(cargo_account)
var/obj/item/computer_hardware/card_slot/card_slot = computer.all_components[MC_CARD]
var/obj/item/card/id/id_card = card_slot?.GetID()
if(id_card?.registered_account)
if(ACCESS_HEADS in id_card.access)
if((ACCESS_HEADS in id_card.access) || (ACCESS_QM in id_card.access))
requestonly = FALSE
buyer = SSeconomy.get_dep_account(id_card.registered_account.account_job.paycheck_department)
can_approve_requests = TRUE
@@ -85,14 +94,14 @@
data["supplies"] = list()
for(var/pack in SSshuttle.supply_packs)
var/datum/supply_pack/P = SSshuttle.supply_packs[pack]
if(!is_visible_pack(usr, P.access , null, P.contraband))
if(!is_visible_pack(usr, P.access , null, P.contraband) || P.hidden)
continue
if(!data["supplies"][P.group])
data["supplies"][P.group] = list(
"name" = P.group,
"packs" = list()
)
if(((P.hidden || P.contraband) && !contraband_view) || (P.special && !P.special_enabled) || P.DropPodOnly)
if((P.hidden && (P.contraband && !contraband) || (P.special && !P.special_enabled) || P.DropPodOnly))
continue
data["supplies"][P.group]["packs"] += list(list(
"name" = P.name,
@@ -105,7 +114,7 @@
//Data regarding the User's capability to buy things.
data["has_id"] = id_card
data["away"] = SSshuttle.supply.getDockedId() == "supply_away"
data["away"] = SSshuttle.supply.getDockedId() == docking_away
data["self_paid"] = self_paid
data["docked"] = SSshuttle.supply.mode == SHUTTLE_IDLE
data["loan"] = !!SSshuttle.shuttle_loan
@@ -153,15 +162,15 @@
if(SSshuttle.supplyBlocked)
computer.say(blockade_warning)
return
if(SSshuttle.supply.getDockedId() == "supply_home")
if(SSshuttle.supply.getDockedId() == docking_home)
SSshuttle.supply.export_categories = get_export_categories()
SSshuttle.moveShuttle("supply", "supply_away", TRUE)
SSshuttle.moveShuttle(cargo_shuttle, docking_away, TRUE)
computer.say("The supply shuttle is departing.")
computer.investigate_log("[key_name(usr)] sent the supply shuttle away.", INVESTIGATE_CARGO)
else
computer.investigate_log("[key_name(usr)] called the supply shuttle.", INVESTIGATE_CARGO)
computer.say("The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.")
SSshuttle.moveShuttle("supply", "supply_home", TRUE)
SSshuttle.moveShuttle(cargo_shuttle, docking_home, TRUE)
. = TRUE
if("loan")
if(!SSshuttle.shuttle_loan)
@@ -171,7 +180,9 @@
return
else if(SSshuttle.supply.mode != SHUTTLE_IDLE)
return
else if(SSshuttle.supply.getDockedId() != "supply_away")
else if(SSshuttle.supply.getDockedId() != docking_away)
return
else if(stationcargo != TRUE)
return
else
SSshuttle.shuttle_loan.loan_shuttle()
@@ -184,7 +195,7 @@
var/datum/supply_pack/pack = SSshuttle.supply_packs[id]
if(!istype(pack))
return
if(((pack.hidden || pack.contraband) && !contraband_view) || pack.DropPodOnly)
if((pack.hidden && (pack.contraband && !contraband) || pack.DropPodOnly))
return
var/name = "*None Provided*"
@@ -273,7 +284,7 @@
self_paid = !self_paid
. = TRUE
if(.)
post_signal("supply")
post_signal(cargo_shuttle)
/datum/computer_file/program/budgetorders/proc/post_signal(command)
@@ -9,6 +9,7 @@
/datum/computer_file/program/card_mod
filename = "plexagonidwriter"
filedesc = "Plexagon Access Management"
category = PROGRAM_CATEGORY_CREW
program_icon_state = "id"
extended_desc = "Program for programming employee ID cards to access parts of the station."
transfer_access = ACCESS_HEADS
@@ -1,6 +1,7 @@
/datum/computer_file/program/shipping
filename = "shipping"
filedesc = "GrandArk Exporter"
category = PROGRAM_CATEGORY_SUPL
program_icon_state = "shipping"
extended_desc = "A combination printer/scanner app that enables modular computers to print barcodes for easy scanning and shipping."
size = 6
@@ -8,8 +9,12 @@
program_icon = "tags"
///Account used for creating barcodes.
var/datum/bank_account/payments_acc
///The amount which the tagger will receive for the sale.
var/percent_cut = 20
///The person who tagged this will receive the sale value multiplied by this number.
var/cut_multiplier = 0.5
///Maximum value for cut_multiplier.
var/cut_max = 0.5
///Minimum value for cut_multiplier.
var/cut_min = 0.01
/datum/computer_file/program/shipping/ui_data(mob/user)
var/list/data = get_header_data()
@@ -22,7 +27,7 @@
data["paperamt"] = printer ? "[printer.stored_paper] / [printer.max_paper]" : null
data["card_owner"] = card_slot?.stored_card ? id_card.registered_name : "No Card Inserted."
data["current_user"] = payments_acc ? payments_acc.account_holder : null
data["barcode_split"] = percent_cut
data["barcode_split"] = cut_multiplier * 100
return data
/datum/computer_file/program/shipping/ui_act(action, list/params)
@@ -54,20 +59,20 @@
if("resetid")
payments_acc = null
if("setsplit")
var/potential_cut = tgui_input_num(usr, "How much would you like to payout to the registered card?","Percentage Profit")
percent_cut = potential_cut ? clamp(round(potential_cut, 1), 1, 50) : 20
var/potential_cut = input("How much would you like to pay out to the registered card?","Percentage Profit ([round(cut_min*100)]% - [round(cut_max*100)]%)") as num|null
cut_multiplier = potential_cut ? clamp(round(potential_cut/100, cut_min), cut_min, cut_max) : initial(cut_multiplier)
if("print")
if(!printer)
to_chat(usr, "<span class='notice'>Hardware error: A printer is required to print barcodes.</span>")
to_chat(usr, span_notice("Hardware error: A printer is required to print barcodes."))
return
if(printer.stored_paper <= 0)
to_chat(usr, "<span class='notice'>Hardware error: Printer is out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer is out of paper."))
return
if(!payments_acc)
to_chat(usr, "<span class='notice'>Software error: Please set a current user first.</span>")
to_chat(usr, span_notice("Software error: Please set a current user first."))
return
var/obj/item/barcode/barcode = new /obj/item/barcode(get_turf(ui_host()))
barcode.payments_acc = payments_acc
barcode.percent_cut = percent_cut
barcode.cut_multiplier = cut_multiplier
printer.stored_paper--
to_chat(usr, "<span class='notice'>The computer prints out a barcode.</span>")
to_chat(usr, span_notice("The computer prints out a barcode."))
@@ -1,6 +1,7 @@
/datum/computer_file/program/crew_manifest
filename = "plexagoncrew"
filedesc = "Plexagon Crew List"
category = PROGRAM_CATEGORY_CREW
program_icon_state = "id"
extended_desc = "Program for viewing and printing the current crew manifest"
transfer_access = ACCESS_HEADS
@@ -11,7 +12,7 @@
/datum/computer_file/program/crew_manifest/ui_static_data(mob/user)
var/list/data = list()
data["manifest"] = GLOB.data_core.get_manifest_tg()
data["manifest"] = GLOB.data_core.get_manifest()
return data
/datum/computer_file/program/crew_manifest/ui_data(mob/user)
@@ -44,7 +45,7 @@
[GLOB.data_core ? GLOB.data_core.get_manifest() : ""]
"}
if(!printer.print_text(contents,text("crew manifest ([])", STATION_TIME_TIMESTAMP("hh:mm:ss", world.time))))
to_chat(usr, "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>")
to_chat(usr, span_notice("Hardware error: Printer was unable to print the file. It may be out of paper."))
return
else
computer.visible_message("<span class='notice'>\The [computer] prints out a paper.</span>")
computer.visible_message(span_notice("\The [computer] prints out a paper."))
@@ -38,14 +38,27 @@
return
RHDD.remove_file(file)
return TRUE
if("PRG_rename")
if("PRG_renamefile")
if(!HDD)
return
var/datum/computer_file/file = HDD.find_file_by_name(params["name"])
if(!file)
return
var/newname = params["new_name"]
if(!newname)
var/newname = reject_bad_name(params["new_name"])
if(!newname || newname != params["new_name"])
playsound(computer, 'sound/machines/terminal_error.ogg', 25, FALSE)
return
file.filename = newname
return TRUE
if("PRG_usbrenamefile")
if(!RHDD)
return
var/datum/computer_file/file = RHDD.find_file_by_name(params["name"])
if(!file)
return
var/newname = reject_bad_name(params["new_name"])
if(!newname || newname != params["new_name"])
playsound(computer, 'sound/machines/terminal_error.ogg', 25, FALSE)
return
file.filename = newname
return TRUE
@@ -1,6 +1,10 @@
/// The time since the last job opening was created
// GLOBAL_VAR_INIT(time_last_changed_position, 0)
/datum/computer_file/program/job_management
filename = "plexagoncore"
filedesc = "Plexagon HR Core"
category = PROGRAM_CATEGORY_CREW
program_icon_state = "id"
extended_desc = "Program for viewing and changing job slot avalibility."
transfer_access = ACCESS_HEADS
@@ -35,21 +39,25 @@
change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)
/datum/computer_file/program/job_management/proc/can_open_job(datum/job/job)
if(!(job?.title in blacklisted))
if((job.total_positions <= length(GLOB.player_list) * (max_relative_positions / 100)))
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] < 0))
return TRUE
if(job?.title in blacklisted)
return FALSE
if((job.total_positions <= length(GLOB.player_list) * (max_relative_positions / 100)))
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] < 0))
return TRUE
return FALSE
/datum/computer_file/program/job_management/proc/can_close_job(datum/job/job)
if(!(job?.title in blacklisted))
if(job.total_positions > job.current_positions)
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] > 0))
return TRUE
if(job?.title in blacklisted)
return FALSE
if(job.total_positions > job.current_positions)
var/delta = (world.time / 10) - GLOB.time_last_changed_position
if((change_position_cooldown < delta) || (opened_positions[job.title] > 0))
return TRUE
return FALSE
/datum/computer_file/program/job_management/ui_act(action, params, datum/tgui/ui)
. = ..()
if(.)
@@ -68,9 +76,10 @@
if(!j || !can_open_job(j))
return
if(opened_positions[edit_job_target] >= 0)
GLOB.time_last_changed_position = world.time / 10 // global cd
GLOB.time_last_changed_position = world.time / 10
j.total_positions++
opened_positions[edit_job_target]++
log_game("[key_name(usr)] opened a [j.title] job position, for a total of [j.total_positions] open job slots.")
playsound(computer, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
return TRUE
if("PRG_close_job")
@@ -83,21 +92,23 @@
GLOB.time_last_changed_position = world.time / 10
j.total_positions--
opened_positions[edit_job_target]--
log_game("[key_name(usr)] closed a [j.title] job position, leaving [j.total_positions] open job slots.")
playsound(computer, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
return TRUE
if("PRG_priority")
if(length(SSjob.prioritized_jobs) >= 5)
return
var/priority_target = params["target"]
var/datum/job/j = SSjob.GetJob(priority_target)
if(!j)
if(!j || (job?.title in blacklisted))
return
if(j.total_positions <= j.current_positions)
return
if(j in SSjob.prioritized_jobs)
SSjob.prioritized_jobs -= j
else
SSjob.prioritized_jobs += j
if(length(SSjob.prioritized_jobs) < 5)
SSjob.prioritized_jobs += j
else
computer.say("Error: CentCom employment protocols restrict prioritising more than 5 jobs.")
playsound(computer, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
return TRUE
@@ -22,6 +22,13 @@
var/emagged = FALSE
var/list/main_repo
var/list/antag_repo
var/list/show_categories = list(
PROGRAM_CATEGORY_CREW,
PROGRAM_CATEGORY_ENGI,
PROGRAM_CATEGORY_ROBO,
PROGRAM_CATEGORY_SUPL,
PROGRAM_CATEGORY_MISC,
)
/datum/computer_file/program/ntnetdownload/run_program()
. = ..()
@@ -146,39 +153,29 @@
var/obj/item/computer_hardware/hard_drive/hard_drive = my_computer.all_components[MC_HDD]
data["disk_size"] = hard_drive.max_capacity
data["disk_used"] = hard_drive.used_capacity
var/list/all_entries[0]
for(var/A in main_repo)
var/datum/computer_file/program/P = A
// Only those programs our user can run will show in the list
if(hard_drive.find_file_by_name(P.filename))
continue
all_entries.Add(list(list(
data["emagged"] = emagged
var/list/repo = antag_repo | main_repo
var/list/program_categories = list()
for(var/I in repo)
var/datum/computer_file/program/P = I
if(!(P.category in program_categories))
program_categories.Add(P.category)
data["programs"] += list(list(
"icon" = P.program_icon,
"filename" = P.filename,
"filedesc" = P.filedesc,
"fileinfo" = P.extended_desc,
"compatibility" = check_compatibility(P),
"category" = P.category,
"installed" = !!hard_drive.find_file_by_name(P.filename),
"compatible" = check_compatibility(P),
"size" = P.size,
"access" = P.can_run(user,transfer = 1, access = access)
)))
data["hackedavailable"] = FALSE
if(emagged) // If we are running on emagged computer we have access to some "bonus" software
var/list/hacked_programs[0]
for(var/S in antag_repo)
var/datum/computer_file/program/P = S
if(hard_drive.find_file_by_name(P.filename))
continue
data["hackedavailable"] = TRUE
hacked_programs.Add(list(list(
"filename" = P.filename,
"filedesc" = P.filedesc,
"fileinfo" = P.extended_desc,
"compatibility" = check_compatibility(P),
"size" = P.size,
"access" = TRUE,
)))
data["hacked_programs"] = hacked_programs
"access" = emagged && P.available_on_syndinet ? TRUE : P.can_run(user,transfer = 1, access = access),
"verifiedsource" = P.available_on_ntnet,
))
data["downloadable_programs"] = all_entries
data["categories"] = show_categories & program_categories
return data
@@ -186,8 +183,8 @@
var/hardflag = computer.hardware_flag
if(P?.is_supported_by_hardware(hardflag,0))
return "Compatible"
return "Incompatible!"
return TRUE
return FALSE
/datum/computer_file/program/ntnetdownload/kill_program(forced)
abort_file_download()
@@ -1,11 +1,12 @@
/datum/computer_file/program/ntnetmonitor
filename = "wirecarp"
filedesc = "WireCarp"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "comm_monitor"
extended_desc = "This program monitors stationwide NTNet network, provides access to logging systems, and allows for configuration changes"
size = 12
requires_ntnet = TRUE
required_access = ACCESS_NETWORK //NETWORK CONTROL IS A MORE SECURE PROGRAM.
required_access = ACCESS_NETWORK //NETWORK CONTROL IS A MORE SECURE PROGRAM.
available_on_ntnet = TRUE
tgui_id = "NtosNetMonitor"
program_icon = "network-wired"
@@ -1,25 +1,36 @@
/datum/computer_file/program/chatclient
filename = "ntnrc_client"
filedesc = "Chat Client"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "command"
extended_desc = "This program allows communication over NTNRC network"
size = 8
requires_ntnet = 1
requires_ntnet = TRUE
requires_ntnet_feature = NTNET_COMMUNICATION
ui_header = "ntnrc_idle.gif"
available_on_ntnet = 1
available_on_ntnet = TRUE
tgui_id = "NtosNetChat"
program_icon = "comment-alt"
var/last_message // Used to generate the toolbar icon
alert_able = TRUE
var/last_message // Used to generate the toolbar icon
var/username
var/active_channel
var/list/channel_history = list()
var/operator_mode = FALSE // Channel operator mode
var/netadmin_mode = FALSE // Administrator mode (invisible to other users + bypasses passwords)
var/operator_mode = FALSE // Channel operator mode
var/netadmin_mode = FALSE // Administrator mode (invisible to other users + bypasses passwords)
//A list of all the converstations we're a part of
var/list/datum/ntnet_conversation/conversations = list()
/datum/computer_file/program/chatclient/New()
username = "DefaultUser[rand(100, 999)]"
/datum/computer_file/program/chatclient/Destroy()
for(var/datum/ntnet_conversation/discussion as anything in conversations)
discussion.purge_client(src)
conversations.Cut()
return ..()
/datum/computer_file/program/chatclient/ui_act(action, params)
. = ..()
if(.)
@@ -36,7 +47,7 @@
var/message = reject_bad_text(params["message"])
if(!message)
return
if(channel.password && !(src in channel.clients))
if(channel.password && (!(src in channel.active_clients) && !(src in channel.offline_clients)))
if(channel.password == message)
channel.add_client(src)
return TRUE
@@ -56,7 +67,7 @@
active_channel = new_target
channel = SSnetworks.station_network.get_chat_channel_by_id(new_target)
if(!(src in channel.clients) && !channel.password)
if((!(src in channel.active_clients) && !(src in channel.offline_clients)) && !channel.password)
channel.add_client(src)
return TRUE
if("PRG_leavechannel")
@@ -89,12 +100,12 @@
return TRUE
if("PRG_changename")
var/newname = sanitize(params["new_name"])
if(!newname)
newname = replacetext(newname, " ", "_")
if(!newname || newname == username)
return
for(var/C in SSnetworks.station_network.chat_channels)
var/datum/ntnet_conversation/chan = C
if(src in chan.clients)
chan.add_status_message("[username] is now known as [newname].")
for(var/datum/ntnet_conversation/anychannel as anything in SSnetworks.station_network.chat_channels)
if(src in anychannel.active_clients)
anychannel.add_status_message("[username] is now known as [newname].")
username = newname
return TRUE
if("PRG_savelog")
@@ -117,9 +128,9 @@
// This program shouldn't even be runnable without computer.
CRASH("Var computer is null!")
if(!hard_drive)
computer.visible_message("<span class='warning'>\The [computer] shows an \"I/O Error - Hard drive connection error\" warning.</span>")
else // In 99.9% cases this will mean our HDD is full
computer.visible_message("<span class='warning'>\The [computer] shows an \"I/O Error - Hard drive may be full. Please free some space and try again. Required space: [logfile.size]GQ\" warning.</span>")
computer.visible_message(span_warning("\The [computer] shows an \"I/O Error - Hard drive connection error\" warning."))
else // In 99.9% cases this will mean our HDD is full
computer.visible_message(span_warning("\The [computer] shows an \"I/O Error - Hard drive may be full. Please free some space and try again. Required space: [logfile.size]GQ\" warning."))
return TRUE
if("PRG_renamechannel")
if(!authed)
@@ -145,6 +156,18 @@
channel.password = new_password
return TRUE
if("PRG_mute_user")
if(!authed)
return
var/datum/computer_file/program/chatclient/muted = locate(params["ref"]) in channel.active_clients + channel.offline_clients
channel.mute_user(src, muted)
return TRUE
if("PRG_ping_user")
if(!authed)
return
var/datum/computer_file/program/chatclient/pinged = locate(params["ref"]) in channel.active_clients + channel.offline_clients
channel.ping_user(src, pinged)
return TRUE
/datum/computer_file/program/chatclient/process_tick()
. = ..()
@@ -162,10 +185,19 @@
else
ui_header = "ntnrc_idle.gif"
/datum/computer_file/program/chatclient/run_program(mob/living/user)
. = ..()
if(!.)
return
for(var/datum/ntnet_conversation/channel as anything in SSnetworks.station_network.chat_channels)
if(src in channel.offline_clients)
channel.offline_clients.Remove(src)
channel.active_clients.Add(src)
/datum/computer_file/program/chatclient/kill_program(forced = FALSE)
for(var/C in SSnetworks.station_network.chat_channels)
var/datum/ntnet_conversation/channel = C
channel.remove_client(src)
for(var/datum/ntnet_conversation/channel as anything in SSnetworks.station_network.chat_channels)
channel.go_offline(src)
active_channel = null
..()
/datum/computer_file/program/chatclient/ui_static_data(mob/user)
@@ -192,6 +224,7 @@
data["all_channels"] = all_channels
data["active_channel"] = active_channel
data["selfref"] = REF(src) //used to verify who is you, as usernames can be copied.
data["username"] = username
data["adminmode"] = netadmin_mode
var/datum/ntnet_conversation/channel = SSnetworks.station_network.get_chat_channel_by_id(active_channel)
@@ -203,21 +236,25 @@
if(netadmin_mode)
authed = TRUE
var/list/clients = list()
for(var/C in channel.clients)
if(C == src)
for(var/datum/computer_file/program/chatclient/channel_client as anything in channel.active_clients + channel.offline_clients)
if(channel_client == src)
authed = TRUE
var/datum/computer_file/program/chatclient/cl = C
clients.Add(list(list(
"name" = cl.username
"name" = channel_client.username,
"status" = channel_client.program_state,
"muted" = (channel_client in channel.muted_clients),
"operator" = channel.operator == channel_client,
"ref" = REF(channel_client)
)))
data["authed"] = authed
//no fishing for ui data allowed
if(authed)
data["strong"] = channel.strong
data["clients"] = clients
var/list/messages = list()
for(var/M in channel.messages)
for(var/message in channel.messages)
messages.Add(list(list(
"msg" = M
"msg" = message
)))
data["messages"] = messages
data["is_operator"] = (channel.operator == src) || netadmin_mode
@@ -0,0 +1,83 @@
///how much paper it takes from the printer to create a canvas.
#define CANVAS_PAPER_COST 10
/**
* ## portrait printer!
*
* Program that lets the curator browse all of the portraits in the database
* They are free to print them out as they please.
*/
/datum/computer_file/program/portrait_printer
filename = "PortraitPrinter"
filedesc = "Marlowe Treeby's Art Galaxy"
category = PROGRAM_CATEGORY_CREW
program_icon_state = "dummy"
extended_desc = "This program connects to a Spinward Sector community art site for viewing and printing art."
transfer_access = ACCESS_LIBRARY
usage_flags = PROGRAM_CONSOLE
requires_ntnet = TRUE
size = 9
tgui_id = "NtosPortraitPrinter"
program_icon = "paint-brush"
/datum/computer_file/program/portrait_printer/ui_data(mob/user)
var/list/data = list()
data["library"] = SSpersistence.paintings["library"] ? SSpersistence.paintings["library"] : 0
data["library_secure"] = SSpersistence.paintings["library_secure"] ? SSpersistence.paintings["library_secure"] : 0
data["library_private"] = SSpersistence.paintings["library_private"] ? SSpersistence.paintings["library_private"] : 0 //i'm gonna regret this, won't i?
return data
/datum/computer_file/program/portrait_printer/ui_assets(mob/user)
return list(
get_asset_datum(/datum/asset/simple/portraits/library),
get_asset_datum(/datum/asset/simple/portraits/library_secure),
get_asset_datum(/datum/asset/simple/portraits/library_private)
)
/datum/computer_file/program/portrait_printer/ui_act(action, params)
. = ..()
if(.)
return
//printer check!
var/obj/item/computer_hardware/printer/printer
if(computer)
printer = computer.all_components[MC_PRINT]
if(!printer)
to_chat(usr, span_notice("Hardware error: A printer is required to print a canvas."))
return
if(printer.stored_paper < CANVAS_PAPER_COST)
to_chat(usr, span_notice("Printing error: Your printer needs at least [CANVAS_PAPER_COST] paper to print a canvas."))
return
printer.stored_paper -= CANVAS_PAPER_COST
//canvas printing!
var/list/tab2key = list(TAB_LIBRARY = "library", TAB_SECURE = "library_secure", TAB_PRIVATE = "library_private")
var/folder = tab2key[params["tab"]]
var/list/current_list = SSpersistence.paintings[folder]
var/list/chosen_portrait = current_list[params["selected"]]
var/author = chosen_portrait["author"]
var/title = chosen_portrait["title"]
var/png = "data/paintings/[folder]/[chosen_portrait["md5"]].png"
var/icon/art_icon = new(png)
var/obj/item/canvas/printed_canvas
var/art_width = art_icon.Width()
var/art_height = art_icon.Height()
for(var/canvas_type in typesof(/obj/item/canvas))
printed_canvas = canvas_type
if(initial(printed_canvas.width) == art_width && initial(printed_canvas.height) == art_height)
printed_canvas = new canvas_type(get_turf(computer.physical))
break
printed_canvas.fill_grid_from_icon(art_icon)
printed_canvas.generated_icon = art_icon
printed_canvas.icon_generated = TRUE
printed_canvas.finalized = TRUE
printed_canvas.painting_name = title
printed_canvas.author_ckey = author
printed_canvas.name = "painting - [title]"
///this is a copy of something that is already in the database- it should not be able to be saved.
printed_canvas.no_save = TRUE
printed_canvas.update_icon()
to_chat(usr, span_notice("You have printed [title] onto a new canvas."))
playsound(computer.physical, 'sound/items/poster_being_created.ogg', 100, TRUE)
@@ -3,6 +3,7 @@
/datum/computer_file/program/power_monitor
filename = "ampcheck"
filedesc = "AmpCheck"
category = PROGRAM_CATEGORY_ENGI
program_icon_state = "power_monitor"
extended_desc = "This program connects to sensors around the station to provide information about electrical systems"
ui_header = "power_norm.gif"
@@ -1,6 +1,7 @@
/datum/computer_file/program/radar //generic parent that handles most of the process
filename = "genericfinder"
filedesc = "debug_finder"
category = PROGRAM_CATEGORY_CREW
ui_header = "borg_mon.gif" //DEBUG -- new icon before PR
program_icon_state = "radarntos"
requires_ntnet = TRUE
@@ -15,7 +16,7 @@
var/atom/selected
///Used to store when the next scan is available. Updated by the scan() proc.
var/next_scan = 0
///Used to keep track of the last value program_icon_state was set to, to prevent constant unnecessary update_icon() calls
///Used to keep track of the last value program_icon_state was set to, to prevent constant unnecessary update_appearance() calls
var/last_icon_state = ""
///Used by the tgui interface, themed NT or Syndicate.
var/arrowstyle = "ntosradarpointer.png"
@@ -174,7 +175,7 @@
if(!trackable(signal))
program_icon_state = "[initial(program_icon_state)]lost"
if(last_icon_state != program_icon_state)
computer.update_icon()
computer.update_appearance()
last_icon_state = program_icon_state
return
@@ -192,7 +193,7 @@
program_icon_state = "[initial(program_icon_state)]far"
if(last_icon_state != program_icon_state)
computer.update_icon()
computer.update_appearance()
last_icon_state = program_icon_state
computer.setDir(get_dir(here_turf, target_turf))
@@ -241,13 +242,12 @@
/datum/computer_file/program/radar/lifeline/trackable(mob/living/carbon/human/humanoid)
if(!humanoid || !istype(humanoid))
return FALSE
if(..() && istype(humanoid.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/uniform = humanoid.w_uniform
if(!uniform.has_sensor || (uniform.sensor_mode < SENSOR_COORDS)) // Suit sensors must be on maximum.
return FALSE
return TRUE
if(..())
if (istype(humanoid.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/uniform = humanoid.w_uniform
if(uniform.has_sensor && uniform.sensor_mode >= SENSOR_COORDS) // Suit sensors must be on maximum
return TRUE
return FALSE
////////////////////////
//Nuke Disk Finder App//
@@ -257,6 +257,7 @@
/datum/computer_file/program/radar/fission360
filename = "fission360"
filedesc = "Fission360"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "radarsyndicate"
extended_desc = "This program allows for tracking of nuclear authorization disks and warheads."
requires_ntnet = FALSE
@@ -2,6 +2,7 @@
/datum/computer_file/program/robocontrol
filename = "botkeeper"
filedesc = "BotKeeper"
category = PROGRAM_CATEGORY_ROBO
program_icon_state = "robot"
extended_desc = "A remote controller used for giving basic commands to non-sentient robots."
transfer_access = null
@@ -1,6 +1,7 @@
/datum/computer_file/program/robotact
filename = "robotact"
filedesc = "RoboTact"
category = PROGRAM_CATEGORY_ROBO
extended_desc = "A built-in app for cyborg self-management and diagnostics."
ui_header = "robotact.gif" //DEBUG -- new icon before PR
program_icon_state = "command"
@@ -22,7 +23,7 @@
/datum/computer_file/program/robotact/run_program(mob/living/user)
if(!istype(computer, /obj/item/modular_computer/tablet/integrated))
to_chat(user, "<span class='warning'>A warning flashes across \the [computer]: Device Incompatible.</span>")
to_chat(user, span_warning("A warning flashes across \the [computer]: Device Incompatible."))
return FALSE
. = ..()
if(.)
@@ -39,7 +40,7 @@
var/mob/living/silicon/robot/borgo = tablet.borgo
data["name"] = borgo.name
data["designation"] = borgo.designation //Borgo module type
data["designation"] = borgo.designation //Borgo model type
data["masterAI"] = borgo.connected_ai //Master AI
var/charge = 0
@@ -62,7 +63,7 @@
data["cover"] = "[borgo.locked? "LOCKED":"UNLOCKED"]"
//Ability to move. FAULT if lockdown wire is cut, DISABLED if borg locked, ENABLED otherwise
data["locomotion"] = "[borgo.wires.is_cut(WIRE_LOCKDOWN)?"FAULT":"[borgo.locked_down?"DISABLED":"ENABLED"]"]"
//Module wire. FAULT if cut, NOMINAL otherwise
//Model wire. FAULT if cut, NOMINAL otherwise
data["wireModule"] = "[borgo.wires.is_cut(WIRE_RESET_MODULE)?"FAULT":"NOMINAL"]"
//DEBUG -- Camera(net) wire. FAULT if cut (or no cameranet camera), DISABLED if pulse-disabled, NOMINAL otherwise
data["wireCamera"] = "[!borgo.builtInCamera || borgo.wires.is_cut(WIRE_CAMERA)?"FAULT":"[borgo.builtInCamera.can_use()?"NOMINAL":"DISABLED"]"]"
@@ -110,7 +111,7 @@
if("alertPower")
if(borgo.stat == CONSCIOUS)
if(!borgo.cell || !borgo.cell.charge)
borgo.visible_message("<span class='notice'>The power warning light on <span class='name'>[borgo]</span> flashes urgently.</span>", \
borgo.visible_message(span_notice("The power warning light on [span_name("[borgo]")] flashes urgently."), \
"You announce you are operating in low power mode.")
playsound(borgo, 'sound/machines/buzz-two.ogg', 50, FALSE)
@@ -3,6 +3,7 @@
/datum/computer_file/program/secureye
filename = "secureye"
filedesc = "SecurEye"
category = PROGRAM_CATEGORY_MISC
ui_header = "borg_mon.gif"
program_icon_state = "generic"
extended_desc = "This program allows access to standard security camera networks."
@@ -0,0 +1,83 @@
/datum/computer_file/program/signaler
filename = "signaler"
filedesc = "SignalCommander"
category = PROGRAM_CATEGORY_MISC
program_icon_state = "signal"
extended_desc = "A small built-in frequency app that sends out signaller signals with the appropriate hardware."
size = 2
tgui_id = "NtosSignaler"
program_icon = "satellite-dish"
usage_flags = PROGRAM_TABLET | PROGRAM_LAPTOP
///What is the saved signal frequency?
var/signal_frequency = FREQ_SIGNALER
/// What is the saved signal code?
var/signal_code = DEFAULT_SIGNALER_CODE
/// Radio connection datum used by signalers.
var/datum/radio_frequency/radio_connection
/datum/computer_file/program/signaler/run_program(mob/living/user)
. = ..()
if (!.)
return
if(!computer?.get_modular_computer_part(MC_SIGNALER)) //Giving a clue to users why the program is spitting out zeros.
to_chat(user, span_warning("\The [computer] flashes an error: \"hardware\\signal_hardware\\startup.bin -- file not found\"."))
/datum/computer_file/program/signaler/ui_data(mob/user)
var/list/data = get_header_data()
var/obj/item/computer_hardware/radio_card/sensor = computer?.get_modular_computer_part(MC_SIGNALER)
if(sensor?.check_functionality())
data["frequency"] = signal_frequency
data["code"] = signal_code
data["minFrequency"] = MIN_FREE_FREQ
data["maxFrequency"] = MAX_FREE_FREQ
return data
/datum/computer_file/program/signaler/ui_act(action, list/params)
. = ..()
if(.)
return
var/obj/item/computer_hardware/radio_card/sensor = computer?.get_modular_computer_part(MC_SIGNALER)
if(!(sensor?.check_functionality()))
playsound(src, 'sound/machines/scanbuzz.ogg', 100, FALSE)
return
switch(action)
if("signal")
INVOKE_ASYNC(src, .proc/signal)
. = TRUE
if("freq")
signal_frequency = unformat_frequency(params["freq"])
signal_frequency = sanitize_frequency(signal_frequency, TRUE)
set_frequency(signal_frequency)
. = TRUE
if("code")
signal_code = text2num(params["code"])
signal_code = round(signal_code)
. = TRUE
if("reset")
if(params["reset"] == "freq")
signal_frequency = initial(signal_frequency)
else
signal_code = initial(signal_code)
. = TRUE
/datum/computer_file/program/signaler/proc/signal()
if(!radio_connection)
return
var/time = time2text(world.realtime,"hh:mm:ss")
var/turf/T = get_turf(src)
var/logging_data
if(usr)
logging_data = "[time] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(signal_frequency)]/[signal_code]"
GLOB.lastsignalers.Add(logging_data)
var/datum/signal/signal = new(list("code" = signal_code), logging_data = logging_data)
radio_connection.post_signal(src, signal)
/datum/computer_file/program/signaler/proc/set_frequency(new_frequency)
SSradio.remove_object(src, signal_frequency)
signal_frequency = new_frequency
radio_connection = SSradio.add_object(src, signal_frequency, RADIO_SIGNALER)
return
@@ -1,6 +1,7 @@
/datum/computer_file/program/supermatter_monitor
filename = "ntcims"
filedesc = "NT CIMS"
category = PROGRAM_CATEGORY_ENGI
ui_header = "smmon_0.gif"
program_icon_state = "smmon_0"
extended_desc = "Crystal Integrity Monitoring System, connects to specially calibrated supermatter sensors to provide information on the status of supermatter-based engines."
@@ -12,7 +13,7 @@
alert_able = TRUE
var/last_status = SUPERMATTER_INACTIVE
var/list/supermatters
var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal.
var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal.
/datum/computer_file/program/supermatter_monitor/Destroy()
clear_signals()
@@ -27,7 +28,7 @@
ui_header = "smmon_[last_status].gif"
program_icon_state = "smmon_[last_status]"
if(istype(computer))
computer.update_icon()
computer.update_appearance()
/datum/computer_file/program/supermatter_monitor/run_program(mob/living/user)
. = ..(user)
@@ -36,11 +37,15 @@
refresh()
/datum/computer_file/program/supermatter_monitor/kill_program(forced = FALSE)
for(var/supermatter in supermatters)
clear_supermatter(supermatter)
supermatters = null
..()
// Refreshes list of active supermatter crystals
/datum/computer_file/program/supermatter_monitor/proc/refresh()
for(var/supermatter in supermatters)
clear_supermatter(supermatter)
supermatters = list()
var/turf/T = get_turf(ui_host())
if(!T)
@@ -50,9 +55,7 @@
if (!isturf(S.loc) || !(is_station_level(S.z) || is_mining_level(S.z) || S.z == T.z))
continue
supermatters.Add(S)
if(!(active in supermatters))
active = null
RegisterSignal(S, COMSIG_PARENT_QDELETING, .proc/react_to_del)
/datum/computer_file/program/supermatter_monitor/proc/get_status()
. = SUPERMATTER_INACTIVE
@@ -67,9 +70,9 @@
* the signal and exit.
*/
/datum/computer_file/program/supermatter_monitor/proc/set_signals()
// if(active)
// RegisterSignal(active, COMSIG_SUPERMATTER_DELAM_ALARM, .proc/send_alert, override = TRUE)
// RegisterSignal(active, COMSIG_SUPERMATTER_DELAM_START_ALARM, .proc/send_start_alert, override = TRUE)
if(active)
RegisterSignal(active, COMSIG_SUPERMATTER_DELAM_ALARM, .proc/send_alert, override = TRUE)
RegisterSignal(active, COMSIG_SUPERMATTER_DELAM_START_ALARM, .proc/send_start_alert, override = TRUE)
/**
* Removes the signal listener for Supermatter delaminations from the selected supermatter.
@@ -77,9 +80,9 @@
* Pretty much does what it says.
*/
/datum/computer_file/program/supermatter_monitor/proc/clear_signals()
// if(active)
// UnregisterSignal(active, COMSIG_SUPERMATTER_DELAM_ALARM)
// UnregisterSignal(active, COMSIG_SUPERMATTER_DELAM_START_ALARM)
if(active)
UnregisterSignal(active, COMSIG_SUPERMATTER_DELAM_ALARM)
UnregisterSignal(active, COMSIG_SUPERMATTER_DELAM_START_ALARM)
/**
* Sends an SM delam alert to the computer.
@@ -90,6 +93,7 @@
* the supermatter probably don't need constant beeping to distract them.
*/
/datum/computer_file/program/supermatter_monitor/proc/send_alert()
SIGNAL_HANDLER
if(!computer.get_ntnet_status())
return
if(computer.active_program != src)
@@ -106,12 +110,13 @@
* minimized or closed to avoid double-notifications.
*/
/datum/computer_file/program/supermatter_monitor/proc/send_start_alert()
SIGNAL_HANDLER
if(!computer.get_ntnet_status())
return
if(computer.active_program == src)
computer.alert_call(src, "Crystal delamination in progress!")
/datum/computer_file/program/supermatter_monitor/ui_data()
/datum/computer_file/program/supermatter_monitor/ui_data(mob/user)
var/list/data = get_header_data()
if(istype(active))
@@ -125,30 +130,9 @@
active = null
return
data["active"] = TRUE
data["SM_integrity"] = active.get_integrity()
data["SM_power"] = active.power
data["SM_ambienttemp"] = air.return_temperature()
data["SM_ambientpressure"] = air.return_pressure()
//data["SM_EPR"] = round((air.total_moles / air.group_multiplier) / 23.1, 0.01)
var/list/gasdata = list()
data += active.ui_data()
data["singlecrystal"] = FALSE
if(air.total_moles())
for(var/gasid in air.get_gases())
var/amount = air.get_moles(gasid)
if(amount)
gasdata.Add(list(list(
"name"= GLOB.gas_data.names[gasid],
"amount" = round(100*amount/air.total_moles(),0.01))))
else
for(var/gasid in air.get_gases())
gasdata.Add(list(list(
"name"= GLOB.gas_data.names[gasid],
"amount" = 0)))
data["gases"] = gasdata
else
var/list/SMS = list()
for(var/obj/machinery/power/supermatter_crystal/S in supermatters)
@@ -185,3 +169,13 @@
active = S
set_signals()
return TRUE
/datum/computer_file/program/supermatter_monitor/proc/react_to_del(datum/source)
SIGNAL_HANDLER
clear_supermatter(source)
/datum/computer_file/program/supermatter_monitor/proc/clear_supermatter(matter)
supermatters -= matter
if(matter == active)
active = null
UnregisterSignal(matter, COMSIG_PARENT_QDELETING)
@@ -4,22 +4,34 @@
icon = 'icons/obj/module.dmi'
icon_state = "std_mod"
w_class = WEIGHT_CLASS_TINY // w_class limits which devices can contain this component.
w_class = WEIGHT_CLASS_TINY // w_class limits which devices can contain this component.
// 1: PDAs/Tablets, 2: Laptops, 3-4: Consoles only
var/obj/item/modular_computer/holder = null
// Computer that holds this hardware, if any.
var/power_usage = 0 // If the hardware uses extra power, change this.
var/enabled = TRUE // If the hardware is turned off set this to 0.
var/critical = FALSE // Prevent disabling for important component, like the CPU.
var/can_install = TRUE // Prevents direct installation of removable media.
var/expansion_hw = FALSE // Hardware that fits into expansion bays.
var/removable = TRUE // Whether the hardware is removable or not.
var/damage = 0 // Current damage level
var/max_damage = 100 // Maximal damage level.
var/damage_malfunction = 20 // "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
var/damage_failure = 50 // "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
var/malfunction_probability = 10// Chance of malfunction when the component is damaged
// If the hardware uses extra power, change this.
var/power_usage = 0
// If the hardware is turned off set this to 0.
var/enabled = TRUE
// Prevent disabling for important component, like the CPU.
var/critical = FALSE
// Prevents direct installation of removable media.
var/can_install = TRUE
// Hardware that fits into expansion bays.
var/expansion_hw = FALSE
// Whether the hardware is removable or not.
var/removable = TRUE
// Current damage level
var/damage = 0
// Maximal damage level.
var/max_damage = 100
// "Malfunction" threshold. When damage exceeds this value the hardware piece will semi-randomly fail and do !!FUN!! things
var/damage_malfunction = 20
// "Failure" threshold. When damage exceeds this value the hardware piece will not work at all.
var/damage_failure = 50
// Chance of malfunction when the component is damaged
var/malfunction_probability = 10
// What define is used to qualify this piece of hardware? Important for upgraded versions of the same hardware.
var/device_type
/obj/item/computer_hardware/New(obj/L)
@@ -38,10 +50,10 @@
if(istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/S = I
if(obj_integrity == max_integrity)
to_chat(user, "<span class='warning'>\The [src] doesn't seem to require repairs.</span>")
to_chat(user, span_warning("\The [src] doesn't seem to require repairs."))
return 1
if(S.use(1))
to_chat(user, "<span class='notice'>You patch up \the [src] with a bit of \the [I].</span>")
to_chat(user, span_notice("You patch up \the [src] with a bit of \the [I]."))
obj_integrity = min(obj_integrity + 10, max_integrity)
return 1
@@ -78,11 +90,11 @@
/obj/item/computer_hardware/examine(mob/user)
. = ..()
if(damage > damage_failure)
. += "<span class='danger'>It seems to be severely damaged!</span>"
. += span_danger("It seems to be severely damaged!")
else if(damage > damage_malfunction)
. += "<span class='warning'>It seems to be damaged!</span>"
. += span_warning("It seems to be damaged!")
else if(damage)
. += "<span class='notice'>It seems to be slightly damaged.</span>"
. += span_notice("It seems to be slightly damaged.")
// Component-side compatibility check.
/obj/item/computer_hardware/proc/can_install(obj/item/modular_computer/M, mob/living/user = null)
@@ -93,8 +105,9 @@
return
// Called when component is removed from PC.
/obj/item/computer_hardware/proc/on_remove(obj/item/modular_computer/M, mob/living/user = null)
try_eject(forced = TRUE)
/obj/item/computer_hardware/proc/on_remove(obj/item/modular_computer/M, mob/living/user)
if(M.physical || !QDELETED(M))
try_eject(forced = TRUE)
// Called when someone tries to insert something in it - paper in printer, card in card reader, etc.
/obj/item/computer_hardware/proc/try_insert(obj/item/I, mob/living/user = null)
@@ -7,13 +7,14 @@
device_type = MC_AI
expansion_hw = TRUE
var/obj/item/aicard/stored_card = null
var/obj/item/aicard/stored_card
var/locked = FALSE
/obj/item/computer_hardware/ai_slot/handle_atom_del(atom/A)
if(A == stored_card)
try_eject(forced = TRUE)
. = ..()
///What happens when the intellicard is removed (or deleted) from the module, through try_eject() or not.
/obj/item/computer_hardware/ai_slot/Exited(atom/movable/gone, direction)
if(stored_card == gone)
stored_card = null
return ..()
/obj/item/computer_hardware/ai_slot/examine(mob/user)
. = ..()
@@ -28,34 +29,33 @@
return FALSE
if(stored_card)
to_chat(user, "<span class='warning'>You try to insert \the [I] into \the [src], but the slot is occupied.</span>")
to_chat(user, span_warning("You try to insert \the [I] into \the [src], but the slot is occupied."))
return FALSE
if(user && !user.transferItemToLoc(I, src))
return FALSE
stored_card = I
to_chat(user, "<span class='notice'>You insert \the [I] into \the [src].</span>")
to_chat(user, span_notice("You insert \the [I] into \the [src]."))
return TRUE
/obj/item/computer_hardware/ai_slot/try_eject(mob/living/user = null, forced = FALSE)
if(!stored_card)
to_chat(user, "<span class='warning'>There is no card in \the [src].</span>")
to_chat(user, span_warning("There is no card in \the [src]."))
return FALSE
if(locked && !forced)
to_chat(user, "<span class='warning'>Safeties prevent you from removing the card until reconstruction is complete...</span>")
to_chat(user, span_warning("Safeties prevent you from removing the card until reconstruction is complete..."))
return FALSE
if(stored_card)
to_chat(user, "<span class='notice'>You remove [stored_card] from [src].</span>")
to_chat(user, span_notice("You remove [stored_card] from [src]."))
locked = FALSE
if(user)
if(Adjacent(user))
user.put_in_hands(stored_card)
else
stored_card.forceMove(drop_location())
stored_card = null
return TRUE
return FALSE
@@ -64,6 +64,6 @@
if(..())
return
if(I.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
to_chat(user, span_notice("You press down on the manual eject button with \the [I]."))
try_eject(user, TRUE)
return
@@ -4,25 +4,28 @@
icon_state = "cell_con"
critical = 1
malfunction_probability = 1
var/obj/item/stock_parts/cell/battery = null
var/obj/item/stock_parts/cell/battery
device_type = MC_CELL
/obj/item/computer_hardware/battery/get_cell()
return battery
/obj/item/computer_hardware/battery/New(loc, battery_type = null)
/obj/item/computer_hardware/battery/Initialize(mapload, battery_type)
. = ..()
if(battery_type)
battery = new battery_type(src)
..()
/obj/item/computer_hardware/battery/Destroy()
. = ..()
QDEL_NULL(battery)
battery = null
return ..()
/obj/item/computer_hardware/battery/handle_atom_del(atom/A)
if(A == battery)
try_eject(forced = TRUE)
. = ..()
///What happens when the battery is removed (or deleted) from the module, through try_eject() or not.
/obj/item/computer_hardware/battery/Exited(atom/movable/gone, direction)
if(battery == gone)
battery = null
if(holder?.enabled && !holder.use_power())
holder.shutdown_computer()
return ..()
/obj/item/computer_hardware/battery/try_insert(obj/item/I, mob/living/user = null)
if(!holder)
@@ -32,46 +35,33 @@
return FALSE
if(battery)
to_chat(user, "<span class='warning'>You try to connect \the [I] to \the [src], but its connectors are occupied.</span>")
to_chat(user, span_warning("You try to connect \the [I] to \the [src], but its connectors are occupied."))
return FALSE
if(I.w_class > holder.max_hardware_size)
to_chat(user, "<span class='warning'>This power cell is too large for \the [holder]!</span>")
to_chat(user, span_warning("This power cell is too large for \the [holder]!"))
return FALSE
if(user && !user.transferItemToLoc(I, src))
return FALSE
battery = I
to_chat(user, "<span class='notice'>You connect \the [I] to \the [src].</span>")
to_chat(user, span_notice("You connect \the [I] to \the [src]."))
return TRUE
/obj/item/computer_hardware/battery/try_eject(mob/living/user = null, forced = FALSE)
/obj/item/computer_hardware/battery/try_eject(mob/living/user, forced = FALSE)
if(!battery)
to_chat(user, "<span class='warning'>There is no power cell connected to \the [src].</span>")
to_chat(user, span_warning("There is no power cell connected to \the [src]."))
return FALSE
else
if(user)
user.put_in_hands(battery)
to_chat(user, span_notice("You detach \the [battery] from \the [src]."))
else
battery.forceMove(drop_location())
to_chat(user, "<span class='notice'>You detach \the [battery] from \the [src].</span>")
battery = null
if(holder)
if(holder.enabled && !holder.use_power())
holder.shutdown_computer()
return TRUE
/obj/item/stock_parts/cell/computer
name = "standard battery"
desc = "A standard power cell, commonly seen in high-end portable microcomputers or low-end laptops."
@@ -80,7 +70,6 @@
w_class = WEIGHT_CLASS_TINY
maxcharge = 750
/obj/item/stock_parts/cell/computer/advanced
name = "advanced battery"
desc = "An advanced power cell, often used in most laptops. It is too large to be fitted into smaller devices."
@@ -1,17 +1,31 @@
/obj/item/computer_hardware/card_slot
name = "primary RFID card module" // \improper breaks the find_hardware_by_name proc
name = "primary RFID card module" // \improper breaks the find_hardware_by_name proc
desc = "A module allowing this computer to read or write data on ID cards. Necessary for some programs to run properly."
power_usage = 10 //W
icon_state = "card_mini"
w_class = WEIGHT_CLASS_TINY
device_type = MC_CARD
var/obj/item/card/id/stored_card = null
var/obj/item/card/id/stored_card
/obj/item/computer_hardware/card_slot/handle_atom_del(atom/A)
if(A == stored_card)
try_eject(null, TRUE)
. = ..()
///What happens when the ID card is removed (or deleted) from the module, through try_eject() or not.
/obj/item/computer_hardware/card_slot/Exited(atom/movable/gone, direction)
if(stored_card == gone)
stored_card = null
if(holder)
if(holder.active_program)
holder.active_program.event_idremoved(0)
for(var/p in holder.idle_threads)
var/datum/computer_file/program/computer_program = p
computer_program.event_idremoved(1)
holder.update_slot_icon()
if(ishuman(holder.loc))
var/mob/living/carbon/human/human_wearer = holder.loc
if(human_wearer.wear_id == holder)
human_wearer.sec_hud_set_ID()
return ..()
/obj/item/computer_hardware/card_slot/Destroy()
try_eject(forced = TRUE)
@@ -47,6 +61,11 @@
if(stored_card)
return FALSE
// item instead of player is checked so telekinesis will still work if the item itself is close
if(!in_range(src, I))
return FALSE
if(user)
if(!user.transferItemToLoc(I, src))
return FALSE
@@ -54,38 +73,32 @@
I.forceMove(src)
stored_card = I
to_chat(user, "<span class='notice'>You insert \the [I] into \the [expansion_hw ? "secondary":"primary"] [src].</span>")
to_chat(user, span_notice("You insert \the [I] into \the [expansion_hw ? "secondary":"primary"] [src]."))
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.sec_hud_set_ID()
var/holder_loc = holder.loc
if(ishuman(holder_loc))
var/mob/living/carbon/human/human_wearer = holder_loc
if(human_wearer.wear_id == holder)
human_wearer.sec_hud_set_ID()
holder.update_slot_icon()
return TRUE
/obj/item/computer_hardware/card_slot/try_eject(mob/living/user = null, forced = FALSE)
if(!stored_card)
to_chat(user, "<span class='warning'>There are no cards in \the [src].</span>")
to_chat(user, span_warning("There are no cards in \the [src]."))
return FALSE
if(user)
if(user && !issilicon(user) && in_range(src, user))
user.put_in_hands(stored_card)
else
stored_card.forceMove(drop_location())
stored_card = null
if(holder)
if(holder.active_program)
holder.active_program.event_idremoved(0)
for(var/p in holder.idle_threads)
var/datum/computer_file/program/computer_program = p
computer_program.event_idremoved(1)
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
human_user.sec_hud_set_ID()
to_chat(user, "<span class='notice'>You remove the card from \the [src].</span>")
to_chat(user, span_notice("You remove the card from \the [src]."))
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
return TRUE
/obj/item/computer_hardware/card_slot/attackby(obj/item/I, mob/living/user)
@@ -93,11 +106,11 @@
return
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(stored_card)
to_chat(user, "<span class='notice'>You press down on the manual eject button with \the [I].</span>")
to_chat(user, span_notice("You press down on the manual eject button with \the [I]."))
try_eject(user)
return
swap_slot()
to_chat(user, "<span class='notice'>You adjust the connecter to fit into [expansion_hw ? "an expansion bay" : "the primary ID bay"].</span>")
to_chat(user, span_notice("You adjust the connecter to fit into [expansion_hw ? "an expansion bay" : "the primary ID bay"]."))
/**
*Swaps the card_slot hardware between using the dedicated card slot bay on a computer, and using an expansion bay.
@@ -8,19 +8,19 @@
device_type = MC_HDD
var/max_capacity = 128
var/used_capacity = 0
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
var/list/stored_files = list() // List of stored files on this drive. DO NOT MODIFY DIRECTLY!
/obj/item/computer_hardware/hard_drive/on_remove(obj/item/modular_computer/MC, mob/user)
MC.shutdown_computer()
/obj/item/computer_hardware/hard_drive/proc/install_default_programs()
store_file(new/datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new/datum/computer_file/program/ntnetdownload(src)) // NTNet Downloader Utility, allows users to download more software from NTNet repository
store_file(new/datum/computer_file/program/filemanager(src)) // File manager, allows text editor functions and basic file manipulation.
store_file(new/datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new/datum/computer_file/program/ntnetdownload(src)) // NTNet Downloader Utility, allows users to download more software from NTNet repository
store_file(new/datum/computer_file/program/filemanager(src)) // File manager, allows text editor functions and basic file manipulation.
/obj/item/computer_hardware/hard_drive/examine(user)
. = ..()
. += "<span class='notice'>It has [max_capacity] GQ of storage capacity.</span>"
. += span_notice("It has [max_capacity] GQ of storage capacity.")
/obj/item/computer_hardware/hard_drive/diagnostics(mob/user)
..()
@@ -117,7 +117,7 @@
return null
/obj/item/computer_hardware/hard_drive/Destroy()
stored_files = null
QDEL_LIST(stored_files)
return ..()
/obj/item/computer_hardware/hard_drive/Initialize()
@@ -129,7 +129,7 @@
name = "advanced hard disk drive"
desc = "A hybrid HDD, for use in higher grade computers where balance between power efficiency and capacity is desired."
max_capacity = 256
power_usage = 50 // Hybrid, medium capacity and medium power storage
power_usage = 50 // Hybrid, medium capacity and medium power storage
icon_state = "harddisk_mini"
w_class = WEIGHT_CLASS_SMALL
@@ -137,7 +137,7 @@
name = "super hard disk drive"
desc = "A high capacity HDD, for use in cluster storage solutions where capacity is more important than power efficiency."
max_capacity = 512
power_usage = 100 // High-capacity but uses lots of power, shortening battery life. Best used with APC link.
power_usage = 100 // High-capacity but uses lots of power, shortening battery life. Best used with APC link.
icon_state = "harddisk_mini"
w_class = WEIGHT_CLASS_SMALL
@@ -161,8 +161,8 @@
// For borg integrated tablets. No downloader.
/obj/item/computer_hardware/hard_drive/small/integrated/install_default_programs()
store_file(new /datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new /datum/computer_file/program/filemanager(src)) // File manager, allows text editor functions and basic file manipulation.
store_file(new /datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new /datum/computer_file/program/filemanager(src)) // File manager, allows text editor functions and basic file manipulation.
store_file(new /datum/computer_file/program/robotact(src))
@@ -3,8 +3,9 @@
desc = "A basic wireless network card for usage with standard NTNet frequencies."
power_usage = 50
icon_state = "radio_mini"
var/identification_id = null // Identification ID. Technically MAC address of this device. Can't be changed by user.
var/identification_string = "" // Identification string, technically nickname seen in the network. Can be set by user.
// network_id = NETWORK_CARDS // Network we are on
var/hardware_id = null // Identification ID. Technically MAC address of this device. Can't be changed by user.
var/identification_string = "" // Identification string, technically nickname seen in the network. Can be set by user.
var/long_range = 0
var/ethernet = 0 // Hard-wired, therefore always on, ignores NTNet wireless checks.
malfunction_probability = 1
@@ -13,7 +14,7 @@
/obj/item/computer_hardware/network_card/diagnostics(mob/user)
..()
to_chat(user, "NIX Unique ID: [identification_id]")
to_chat(user, "NIX Unique ID: [hardware_id]")
to_chat(user, "NIX User Tag: [identification_string]")
to_chat(user, "Supported protocols:")
to_chat(user, "511.m SFS (Subspace) - Standard Frequency Spread")
@@ -24,11 +25,11 @@
/obj/item/computer_hardware/network_card/New(l)
..()
identification_id = ntnet_card_uid++
hardware_id = ntnet_card_uid++
// Returns a string identifier of this network card
/obj/item/computer_hardware/network_card/proc/get_network_tag()
return "[identification_string] (NID [identification_id])"
return "[identification_string] (NID [hardware_id])"
// 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection
/obj/item/computer_hardware/network_card/proc/get_signal(specific_action = 0)
@@ -11,11 +11,11 @@
/obj/item/computer_hardware/printer/diagnostics(mob/living/user)
..()
to_chat(user, "<span class='notice'>Paper level: [stored_paper]/[max_paper].</span>")
to_chat(user, span_notice("Paper level: [stored_paper]/[max_paper]."))
/obj/item/computer_hardware/printer/examine(mob/user)
. = ..()
. += "<span class='notice'>Paper level: [stored_paper]/[max_paper].</span>"
. += span_notice("Paper level: [stored_paper]/[max_paper].")
/obj/item/computer_hardware/printer/proc/print_text(text_to_print, paper_title = "")
@@ -33,7 +33,7 @@
P.info = text_to_print
if(paper_title)
P.name = paper_title
P.update_icon()
P.update_appearance()
stored_paper--
P = null
return TRUE
@@ -41,12 +41,12 @@
/obj/item/computer_hardware/printer/try_insert(obj/item/I, mob/living/user = null)
if(istype(I, /obj/item/paper))
if(stored_paper >= max_paper)
to_chat(user, "<span class='warning'>You try to add \the [I] into [src], but its paper bin is full!</span>")
to_chat(user, span_warning("You try to add \the [I] into [src], but its paper bin is full!"))
return FALSE
if(user && !user.temporarilyRemoveItemFromInventory(I))
return FALSE
to_chat(user, "<span class='notice'>You insert \the [I] into [src]'s paper recycler.</span>")
to_chat(user, span_notice("You insert \the [I] into [src]'s paper recycler."))
qdel(I)
stored_paper++
return TRUE
@@ -55,7 +55,7 @@
/obj/item/computer_hardware/recharger/wired/can_install(obj/item/modular_computer/M, mob/living/user = null)
if(ismachinery(M.physical) && M.physical.anchored)
return ..()
to_chat(user, "<span class='warning'>\The [src] is incompatible with portable computers!</span>")
to_chat(user, span_warning("\The [src] is incompatible with portable computers!"))
return FALSE
/obj/item/computer_hardware/recharger/wired/use_power(amount, charging=0)
@@ -96,3 +96,4 @@
/obj/item/computer_hardware/recharger/lambda/use_power(amount, charging=0)
return 1
@@ -6,3 +6,12 @@
w_class = WEIGHT_CLASS_TINY
device_type = MC_SENSORS
expansion_hw = TRUE
/obj/item/computer_hardware/radio_card
name = "integrated radio card"
desc = "An integrated signaling assembly for computers to send an outgoing frequency signal. Required by certain programs."
icon_state = "signal_card"
w_class = WEIGHT_CLASS_TINY
device_type = MC_SIGNALER
expansion_hw = TRUE
power_usage = 10
+14 -14
View File
@@ -13,19 +13,19 @@
var/obj/item/modular_computer/tablet/fabricated_tablet = null
// Utility vars
var/state = 0 // 0: Select device type, 1: Select loadout, 2: Payment, 3: Thankyou screen
var/devtype = 0 // 0: None(unselected), 1: Laptop, 2: Tablet
var/total_price = 0 // Price of currently vended device.
var/state = 0 // 0: Select device type, 1: Select loadout, 2: Payment, 3: Thankyou screen
var/devtype = 0 // 0: None(unselected), 1: Laptop, 2: Tablet
var/total_price = 0 // Price of currently vended device.
var/credits = 0
// Device loadout
var/dev_cpu = 1 // 1: Default, 2: Upgraded
var/dev_battery = 1 // 1: Default, 2: Upgraded, 3: Advanced
var/dev_disk = 1 // 1: Default, 2: Upgraded, 3: Advanced
var/dev_netcard = 0 // 0: None, 1: Basic, 2: Long-Range
var/dev_apc_recharger = 0 // 0: None, 1: Standard (LAPTOP ONLY)
var/dev_printer = 0 // 0: None, 1: Standard
var/dev_card = 0 // 0: None, 1: Standard
var/dev_cpu = 1 // 1: Default, 2: Upgraded
var/dev_battery = 1 // 1: Default, 2: Upgraded, 3: Advanced
var/dev_disk = 1 // 1: Default, 2: Upgraded, 3: Advanced
var/dev_netcard = 0 // 0: None, 1: Basic, 2: Long-Range
var/dev_apc_recharger = 0 // 0: None, 1: Standard (LAPTOP ONLY)
var/dev_printer = 0 // 0: None, 1: Standard
var/dev_card = 0 // 0: None, 1: Standard
// Removes all traces of old order and allows you to begin configuration from scratch.
/obj/machinery/lapvend/proc/reset_order()
@@ -48,7 +48,7 @@
// Recalculates the price and optionally even fabricates the device.
/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = FALSE)
total_price = 0
if(devtype == 1) // Laptop, generally cheaper to make it accessible for most station roles
if(devtype == 1) // Laptop, generally cheaper to make it accessible for most station roles
var/obj/item/computer_hardware/battery/battery_module = null
if(fabricate)
fabricated_laptop = new /obj/item/modular_computer/laptop/buildable(src)
@@ -111,7 +111,7 @@
fabricated_laptop.install_component(new /obj/item/computer_hardware/card_slot/secondary)
return total_price
else if(devtype == 2) // Tablet, more expensive, not everyone could probably afford this.
else if(devtype == 2) // Tablet, more expensive, not everyone could probably afford this.
var/obj/item/computer_hardware/battery/battery_module = null
if(fabricate)
fabricated_tablet = new(src)
@@ -241,13 +241,13 @@
if(!user.temporarilyRemoveItemFromInventory(c))
return
credits += c.value
visible_message("<span class='info'><span class='name'>[user]</span> inserts [c.value] cr into [src].</span>")
visible_message(span_info("[span_name("[user]")] inserts [c.value] cr into [src]."))
qdel(c)
return
else if(istype(I, /obj/item/holochip))
var/obj/item/holochip/HC = I
credits += HC.credits
visible_message("<span class='info'>[user] inserts a [HC.credits] cr holocredit chip into [src].</span>")
visible_message(span_info("[user] inserts a [HC.credits] cr holocredit chip into [src]."))
qdel(HC)
return
else if(istype(I, /obj/item/card/id))
+161 -87
View File
@@ -1,127 +1,201 @@
/**
* Clipboard
*/
/obj/item/clipboard
name = "clipboard"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "clipboard"
item_state = "clipboard"
// inhand_icon_state = "clipboard"
// worn_icon_state = "clipboard"
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 7
var/obj/item/pen/haspen //The stored pen.
var/obj/item/paper/toppaper //The topmost piece of paper.
slot_flags = ITEM_SLOT_BELT
resistance_flags = FLAMMABLE
/// The stored pen
var/obj/item/pen/pen
/// Is the pen integrated?
var/integrated_pen = FALSE
/**
* Weakref of the topmost piece of paper
*
* This is used for the paper displayed on the clipboard's icon
* and it is the one attacked, when attacking the clipboard.
* (As you can't organise contents directly in BYOND)
*/
var/datum/weakref/toppaper_ref
/obj/item/clipboard/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins putting [user.p_their()] head into the clip of \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS//the clipboard's clip is very strong. industrial duty. can kill a man easily.
user.visible_message(span_suicide("[user] begins putting [user.p_their()] head into the clip of \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS //The clipboard's clip is very strong. Industrial duty. Can kill a man easily.
/obj/item/clipboard/Initialize()
update_icon()
update_appearance()
. = ..()
/obj/item/clipboard/Destroy()
QDEL_NULL(haspen)
QDEL_NULL(toppaper) //let movable/Destroy handle the rest
QDEL_NULL(pen)
return ..()
/obj/item/clipboard/examine()
. = ..()
if(!integrated_pen && pen)
. += span_notice("Alt-click to remove [pen].")
var/obj/item/paper/toppaper = toppaper_ref?.resolve()
if(toppaper)
. += span_notice("Right-click to remove [toppaper].")
/// Take out the topmost paper
/obj/item/clipboard/proc/remove_paper(obj/item/paper/paper, mob/user)
if(!istype(paper))
return
paper.forceMove(user.loc)
user.put_in_hands(paper)
to_chat(user, span_notice("You remove [paper] from [src]."))
var/obj/item/paper/toppaper = toppaper_ref?.resolve()
if(paper == toppaper)
UnregisterSignal(toppaper, COMSIG_ATOM_UPDATED_ICON)
toppaper_ref = null
var/obj/item/paper/newtop = locate(/obj/item/paper) in src
if(newtop && (newtop != paper))
toppaper_ref = WEAKREF(newtop)
else
toppaper_ref = null
update_icon()
/obj/item/clipboard/proc/remove_pen(mob/user)
pen.forceMove(user.loc)
user.put_in_hands(pen)
to_chat(user, span_notice("You remove [pen] from [src]."))
pen = null
update_icon()
/obj/item/clipboard/AltClick(mob/user)
..()
if(pen)
if(integrated_pen)
to_chat(user, span_warning("You can't seem to find a way to remove [src]'s [pen]."))
else
remove_pen(user)
/obj/item/clipboard/update_overlays()
. = ..()
var/obj/item/paper/toppaper = toppaper_ref?.resolve()
if(toppaper)
. += toppaper.icon_state
. += toppaper.overlays
if(haspen)
if(pen)
. += "clipboard_pen"
. += "clipboard_over"
/obj/item/clipboard/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/paper))
if(!user.transferItemToLoc(W, src))
/obj/item/clipboard/attack_hand(mob/user, act_intent)
if(act_intent != INTENT_HELP)
var/obj/item/paper/toppaper = toppaper_ref?.resolve()
remove_paper(toppaper, user)
return TRUE
. = ..()
/obj/item/clipboard/attackby(obj/item/weapon, mob/user, params)
var/obj/item/paper/toppaper = toppaper_ref?.resolve()
if(istype(weapon, /obj/item/paper))
//Add paper into the clipboard
if(!user.transferItemToLoc(weapon, src))
return
toppaper = W
to_chat(user, "<span class='notice'>You clip the paper onto \the [src].</span>")
update_icon()
if(toppaper)
UnregisterSignal(toppaper, COMSIG_ATOM_UPDATED_ICON)
RegisterSignal(weapon, COMSIG_ATOM_UPDATED_ICON, .proc/on_top_paper_change)
toppaper_ref = WEAKREF(weapon)
to_chat(user, span_notice("You clip [weapon] onto [src]."))
else if(istype(weapon, /obj/item/pen) && !pen)
//Add a pen into the clipboard, attack (write) if there is already one
if(!usr.transferItemToLoc(weapon, src))
return
pen = weapon
to_chat(usr, span_notice("You slot [weapon] into [src]."))
else if(toppaper)
toppaper.attackby(user.get_active_held_item(), user)
update_icon()
update_appearance()
/obj/item/clipboard/attack_self(mob/user)
var/dat = "<title>Clipboard</title>"
if(haspen)
dat += "<A href='?src=[REF(src)];pen=1'>Remove Pen</A><BR><HR>"
else
dat += "<A href='?src=[REF(src)];addpen=1'>Add Pen</A><BR><HR>"
//The topmost paper. You can't organise contents directly in byond, so this is what we're stuck with. -Pete
if(toppaper)
var/obj/item/paper/P = toppaper
dat += "<A href='?src=[REF(src)];write=[REF(P)]'>Write</A> <A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A> - <A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A><BR><HR>"
for(P in src)
if(P == toppaper)
continue
dat += "<A href='?src=[REF(src)];write=[REF(P)]'>Write</A> <A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A> <A href='?src=[REF(src)];top=[REF(P)]'>Move to top</A> - <A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A><BR>"
user << browse(dat, "window=clipboard")
onclose(user, "clipboard")
add_fingerprint(usr)
ui_interact(user)
return
/obj/item/clipboard/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Clipboard")
ui.open()
/obj/item/clipboard/Topic(href, href_list)
..()
if(usr.stat != CONSCIOUS || usr.restrained()) //HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED))
/obj/item/clipboard/ui_data(mob/user)
// prepare data for TGUI
var/list/data = list()
data["pen"] = "[pen]"
data["integrated_pen"] = integrated_pen
var/obj/item/paper/toppaper = toppaper_ref?.resolve()
data["top_paper"] = "[toppaper]"
data["top_paper_ref"] = "[REF(toppaper)]"
data["paper"] = list()
data["paper_ref"] = list()
for(var/obj/item/paper/paper in src)
if(paper == toppaper)
continue
data["paper"] += "[paper]"
data["paper_ref"] += "[REF(paper)]"
return data
/obj/item/clipboard/ui_act(action, params)
. = ..()
if(.)
return
if(usr.contents.Find(src))
if(usr.stat != CONSCIOUS || usr.restrained())
return
if(href_list["pen"])
if(haspen)
haspen.forceMove(usr.loc)
usr.put_in_hands(haspen)
haspen = null
switch(action)
// Take the pen out
if("remove_pen")
if(pen)
if(!integrated_pen)
remove_pen(usr)
else
to_chat(usr, span_warning("You can't seem to find a way to remove [src]'s [pen]."))
. = TRUE
// Take paper out
if("remove_paper")
var/obj/item/paper/paper = locate(params["ref"]) in src
if(istype(paper))
remove_paper(paper, usr)
. = TRUE
// Look at (or edit) the paper
if("edit_paper")
var/obj/item/paper/paper = locate(params["ref"]) in src
if(istype(paper))
paper.ui_interact(usr)
update_icon()
. = TRUE
// Move paper to the top
if("move_top_paper")
var/obj/item/paper/paper = locate(params["ref"]) in src
if(istype(paper))
toppaper_ref = WEAKREF(paper)
to_chat(usr, span_notice("You move [paper] to the top."))
update_icon()
. = TRUE
// Rename the paper (it's a verb)
if("rename_paper")
var/obj/item/paper/paper = locate(params["ref"]) in src
if(istype(paper))
paper.rename()
update_icon()
. = TRUE
if(href_list["addpen"])
if(!haspen)
var/obj/item/held = usr.get_active_held_item()
if(istype(held, /obj/item/pen))
var/obj/item/pen/W = held
if(!usr.transferItemToLoc(W, src))
return
haspen = W
to_chat(usr, "<span class='notice'>You slot [W] into [src].</span>")
if(href_list["write"])
var/obj/item/P = locate(href_list["write"]) in src
if(istype(P))
if(usr.get_active_held_item())
P.attackby(usr.get_active_held_item(), usr)
if(href_list["remove"])
var/obj/item/P = locate(href_list["remove"]) in src
if(istype(P))
P.forceMove(usr.loc)
usr.put_in_hands(P)
if(P == toppaper)
toppaper = null
var/obj/item/paper/newtop = locate(/obj/item/paper) in src
if(newtop && (newtop != P))
toppaper = newtop
else
toppaper = null
if(href_list["read"])
var/obj/item/paper/P = locate(href_list["read"]) in src
if(istype(P))
usr.examinate(P)
if(href_list["top"])
var/obj/item/P = locate(href_list["top"]) in src
if(istype(P))
toppaper = P
to_chat(usr, "<span class='notice'>You move [P.name] to the top.</span>")
//Update everything
attack_self(usr)
update_icon()
/**
* This is a simple proc to handle calling update_icon() upon receiving the top paper's `COMSIG_ATOM_UPDATE_APPEARANCE`.
*/
/obj/item/clipboard/proc/on_top_paper_change()
SIGNAL_HANDLER
update_appearance()
@@ -628,6 +628,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
//Tells the engi team to get their butt in gear
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
if(damage_archived < warning_point) //If damage_archive is under the warning point, this is the very first cycle that we've reached said point.
SEND_SIGNAL(src, COMSIG_SUPERMATTER_DELAM_START_ALARM)
if((REALTIMEOFDAY - lastwarning) / 10 >= WARNING_DELAY)
alarm()
@@ -635,6 +637,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
if(damage > emergency_point)
// it's bad, LETS YELL
radio.talk_into(src, "[emergency_alert] Integrity: [get_integrity()]%", common_channel, list(SPAN_YELL))
SEND_SIGNAL(src, COMSIG_SUPERMATTER_DELAM_ALARM)
lastwarning = REALTIMEOFDAY
if(!has_reached_emergency)
investigate_log("has reached the emergency point for the first time.", INVESTIGATE_SUPERMATTER)
@@ -642,6 +645,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
has_reached_emergency = TRUE
else if(damage >= damage_archived) // The damage is still going up
radio.talk_into(src, "[warning_alert] Integrity: [get_integrity()]%", engineering_channel)
SEND_SIGNAL(src, COMSIG_SUPERMATTER_DELAM_ALARM)
lastwarning = REALTIMEOFDAY - (WARNING_DELAY * 5)
else // Phew, we're safe
@@ -372,11 +372,11 @@
/obj/machinery/bci_implanter/update_overlays()
var/list/overlays = ..()
if ((machine_stat & MAINT) || panel_open)
if ((stat & MAINT) || panel_open)
overlays += "maint"
return overlays
if (machine_stat & (NOPOWER|BROKEN))
if (stat & (NOPOWER|BROKEN))
return overlays
if (busy || locked)
@@ -448,9 +448,9 @@
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
/obj/machinery/bci_implanter/proc/start_process()
if (machine_stat & (NOPOWER|BROKEN))
if (stat & (NOPOWER|BROKEN))
return
if ((machine_stat & MAINT) || panel_open)
if ((stat & MAINT) || panel_open)
return
if (!occupant || busy)
return
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 291 B

+2
View File
@@ -2946,11 +2946,13 @@
#include "code\modules\modular_computers\file_system\programs\ntdownloader.dm"
#include "code\modules\modular_computers\file_system\programs\ntmonitor.dm"
#include "code\modules\modular_computers\file_system\programs\ntnrc_client.dm"
#include "code\modules\modular_computers\file_system\programs\portrait_printer.dm"
#include "code\modules\modular_computers\file_system\programs\powermonitor.dm"
#include "code\modules\modular_computers\file_system\programs\radar.dm"
#include "code\modules\modular_computers\file_system\programs\robocontrol.dm"
#include "code\modules\modular_computers\file_system\programs\robotact.dm"
#include "code\modules\modular_computers\file_system\programs\secureye.dm"
#include "code\modules\modular_computers\file_system\programs\signaler.dm"
#include "code\modules\modular_computers\file_system\programs\sm_monitor.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\contract_uplink.dm"
#include "code\modules\modular_computers\file_system\programs\antagonist\dos.dm"
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -4,7 +4,7 @@ const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.js";
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);

Some files were not shown because too many files have changed in this diff Show More