Update PDA.dm

This commit is contained in:
Trilbyspaceclone
2019-04-15 23:43:36 -04:00
committed by GitHub
parent 05acb8c7a9
commit 5c0c8aa4c9
+60 -32
View File
@@ -391,7 +391,7 @@ GLOBAL_LIST_EMPTY(PDAs)
//BASIC FUNCTIONS===================================
if("Refresh")//Refresh, goes to the end of the proc.
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Toggle_Font")
//CODE REVISION 2
@@ -406,16 +406,19 @@ GLOBAL_LIST_EMPTY(PDAs)
font_mode = FONT_ORBITRON
if (MODE_VT)
font_mode = FONT_VT
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Change_Color")
var/new_color = input("Please enter a color name or hex value (Default is \'#808000\').",background_color)as color
background_color = new_color
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Toggle_Underline")
underline_flag = !underline_flag
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Return")//Return
if(mode<=9)
@@ -424,7 +427,8 @@ GLOBAL_LIST_EMPTY(PDAs)
mode = round(mode/10)
if(mode==4 || mode == 5)//Fix for cartridges. Redirects to hub.
mode = 0
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if ("Authenticate")//Checks for ID
id_check(U)
@@ -434,8 +438,9 @@ GLOBAL_LIST_EMPTY(PDAs)
if(istype(id, /obj/item/card/id/syndicate))
owner = id.registered_name
update_label()
playsound(src, 'sound/machines/terminal_processing.ogg', 50, 1)
addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/machines/terminal_success.ogg', 50, 1), 13)
if (!silent)
playsound(src, 'sound/machines/terminal_processing.ogg', 15, 1)
addtimer(CALLBACK(GLOBAL_PROC, .proc/playsound, src, 'sound/machines/terminal_success.ogg', 15, 1), 13)
if("Eject")//Ejects the cart, only done from hub.
if (!isnull(cartridge))
@@ -445,65 +450,76 @@ GLOBAL_LIST_EMPTY(PDAs)
cartridge.host_pda = null
cartridge = null
update_icon()
playsound(src, 'sound/machines/terminal_eject_disc.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_eject_disc.ogg', 15, 1)
//MENU FUNCTIONS===================================
if("0")//Hub
mode = 0
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("1")//Notes
mode = 1
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("2")//Messenger
mode = 2
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("21")//Read messeges
mode = 21
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("3")//Atmos scan
mode = 3
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("4")//Redirects to hub
mode = 0
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
//MAIN FUNCTIONS===================================
if("Light")
toggle_light()
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Medical Scan")
if(scanmode == PDA_SCANNER_MEDICAL)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_MEDICAL))
scanmode = PDA_SCANNER_MEDICAL
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Reagent Scan")
if(scanmode == PDA_SCANNER_REAGENT)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_REAGENT_SCANNER))
scanmode = PDA_SCANNER_REAGENT
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Halogen Counter")
if(scanmode == PDA_SCANNER_HALOGEN)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_ENGINE))
scanmode = PDA_SCANNER_HALOGEN
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Honk")
if ( !(last_noise && world.time < last_noise + 20) )
playsound(src, 'sound/items/bikehorn.ogg', 50, 1)
playsound(src, 'sound/items/bikehorn.ogg', 15, 1)
last_noise = world.time
if("Trombone")
if ( !(last_noise && world.time < last_noise + 20) )
playsound(src, 'sound/misc/sadtrombone.ogg', 50, 1)
playsound(src, 'sound/misc/sadtrombone.ogg', 15, 1)
last_noise = world.time
if("Gas Scan")
@@ -511,7 +527,8 @@ GLOBAL_LIST_EMPTY(PDAs)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_ATMOS))
scanmode = PDA_SCANNER_GAS
playsound(src, 'sound/machines/terminal_select.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_select.ogg', 15, 1)
if("Drone Phone")
var/alert_s = input(U,"Alert severity level","Ping Drones",null) as null|anything in list("Low","Medium","High","Critical")
@@ -520,7 +537,8 @@ GLOBAL_LIST_EMPTY(PDAs)
var/msg = "<span class='boldnotice'>NON-DRONE PING: [U.name]: [alert_s] priority alert in [A.name]!</span>"
_alert_drones(msg, TRUE, U)
to_chat(U, msg)
playsound(src, 'sound/machines/terminal_success.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_success.ogg', 15, 1)
//NOTEKEEPER FUNCTIONS===================================
@@ -672,7 +690,8 @@ GLOBAL_LIST_EMPTY(PDAs)
if (!signal.data["done"])
to_chat(user, "<span class='notice'>ERROR: Server isn't responding.</span>")
return
playsound(src, 'sound/machines/terminal_error.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_error.ogg', 15, 1)
var/target_text = signal.format_target()
// Log it in our logs
@@ -685,7 +704,8 @@ GLOBAL_LIST_EMPTY(PDAs)
// Log in the talk log
user.log_talk(message, LOG_PDA, tag="PDA: [initial(name)] to [target_text]")
to_chat(user, "<span class='info'>Message sent to [target_text]: \"[message]\"</span>")
playsound(src, 'sound/machines/terminal_success.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_success.ogg', 15, 1)
// Reset the photo
picture = null
last_text = world.time
@@ -696,7 +716,7 @@ GLOBAL_LIST_EMPTY(PDAs)
tnote += "<i><b>&larr; From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(signal.source)]'>[signal.data["name"]]</a> ([signal.data["job"]]):</b></i><br>[signal.format_message()]<br>"
if (!silent)
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
playsound(src, 'sound/machines/twobeep.ogg', 15, 1)
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
//Search for holder of the PDA.
var/mob/living/L = null
@@ -732,10 +752,12 @@ GLOBAL_LIST_EMPTY(PDAs)
if(id)
remove_id()
playsound(src, 'sound/machines/terminal_eject_disc.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_eject_disc.ogg', 15, 1)
else
remove_pen()
playsound(src, 'sound/machines/button4.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/button4.ogg', 15, 1)
/obj/item/pda/CtrlClick()
..()
@@ -811,7 +833,8 @@ GLOBAL_LIST_EMPTY(PDAs)
if(old_id)
user.put_in_hands(old_id)
update_icon()
playsound(src, 'sound/machines/button.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/button.ogg', 15, 1)
return TRUE
// access to status display signals
@@ -823,21 +846,24 @@ GLOBAL_LIST_EMPTY(PDAs)
cartridge.host_pda = src
to_chat(user, "<span class='notice'>You insert [cartridge] into [src].</span>")
update_icon()
playsound(src, 'sound/machines/button.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/button.ogg', 15, 1)
else if(istype(C, /obj/item/card/id))
var/obj/item/card/id/idcard = C
if(!idcard.registered_name)
to_chat(user, "<span class='warning'>\The [src] rejects the ID!</span>")
return
playsound(src, 'sound/machines/terminal_error.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_error.ogg', 15, 1)
if(!owner)
owner = idcard.registered_name
ownjob = idcard.assignment
update_label()
to_chat(user, "<span class='notice'>Card scanned.</span>")
playsound(src, 'sound/machines/terminal_success.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/terminal_success.ogg', 15, 1)
else
//Basic safety check. If either both objects are held by user or PDA is on ground and card is in hand.
if(((src in user.contents) || (isturf(loc) && in_range(src, user))) && (C in user.contents))
@@ -863,7 +889,8 @@ GLOBAL_LIST_EMPTY(PDAs)
to_chat(user, "<span class='notice'>You slide \the [C] into \the [src].</span>")
inserted_item = C
update_icon()
playsound(src, 'sound/machines/button.ogg', 50, 1)
if (!silent)
playsound(src, 'sound/machines/button.ogg', 15, 1)
else if(istype(C, /obj/item/photo))
var/obj/item/photo/P = C
@@ -1053,3 +1080,4 @@ GLOBAL_LIST_EMPTY(PDAs)
#undef PDA_SCANNER_HALOGEN
#undef PDA_SCANNER_GAS
#undef PDA_SPAM_DELAY