Ohkay
This commit is contained in:
+113
-106
@@ -1,107 +1,114 @@
|
||||
// channel numbers for power
|
||||
#define EQUIP 1
|
||||
#define LIGHT 2
|
||||
#define ENVIRON 3
|
||||
#define TOTAL 4 //for total power used only
|
||||
#define STATIC_EQUIP 5
|
||||
#define STATIC_LIGHT 6
|
||||
#define STATIC_ENVIRON 7
|
||||
|
||||
//Power use
|
||||
#define NO_POWER_USE 0
|
||||
#define IDLE_POWER_USE 1
|
||||
#define ACTIVE_POWER_USE 2
|
||||
|
||||
|
||||
//bitflags for door switches.
|
||||
#define OPEN (1<<0)
|
||||
#define IDSCAN (1<<1)
|
||||
#define BOLTS (1<<2)
|
||||
#define SHOCK (1<<3)
|
||||
#define SAFE (1<<4)
|
||||
|
||||
//used in design to specify which machine can build it
|
||||
#define IMPRINTER (1<<0) //For circuits. Uses glass/chemicals.
|
||||
#define PROTOLATHE (1<<1) //New stuff. Uses glass/metal/chemicals
|
||||
#define AUTOLATHE (1<<2) //Uses glass/metal only.
|
||||
#define CRAFTLATHE (1<<3) //Uses fuck if I know. For use eventually.
|
||||
#define MECHFAB (1<<4) //Remember, objects utilising this flag should have construction_time and construction_cost vars.
|
||||
#define BIOGENERATOR (1<<5) //Uses biomass
|
||||
#define LIMBGROWER (1<<6) //Uses synthetic flesh
|
||||
#define SMELTER (1<<7) //uses various minerals
|
||||
#define AUTOYLATHE (1<<8) // CITADEL ADD
|
||||
#define NANITE_COMPILER (1<<9) //Prints nanite disks
|
||||
#define AUTOBOTTLER (1<<10) //Uses booze, for printing
|
||||
//Note: More then one of these can be added to a design but imprinter and lathe designs are incompatable.
|
||||
|
||||
//Modular computer/NTNet defines
|
||||
|
||||
//Modular computer part defines
|
||||
#define MC_CPU "CPU"
|
||||
#define MC_HDD "HDD"
|
||||
#define MC_SDD "SDD"
|
||||
#define MC_CARD "CARD"
|
||||
#define MC_NET "NET"
|
||||
#define MC_PRINT "PRINT"
|
||||
#define MC_CELL "CELL"
|
||||
#define MC_CHARGE "CHARGE"
|
||||
#define MC_AI "AI"
|
||||
|
||||
//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.
|
||||
|
||||
//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
|
||||
|
||||
//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)
|
||||
//Program states
|
||||
#define PROGRAM_STATE_KILLED 0
|
||||
#define PROGRAM_STATE_BACKGROUND 1
|
||||
#define PROGRAM_STATE_ACTIVE 2
|
||||
|
||||
#define FIREDOOR_OPEN 1
|
||||
#define FIREDOOR_CLOSED 2
|
||||
|
||||
|
||||
|
||||
// These are used by supermatter and supermatter monitor program, mostly for UI updating purposes. Higher should always be worse!
|
||||
#define SUPERMATTER_ERROR -1 // Unknown status, shouldn't happen but just in case.
|
||||
#define SUPERMATTER_INACTIVE 0 // No or minimal energy
|
||||
#define SUPERMATTER_NORMAL 1 // Normal operation
|
||||
#define SUPERMATTER_NOTIFY 2 // Ambient temp > 80% of CRITICAL_TEMPERATURE
|
||||
#define SUPERMATTER_WARNING 3 // Ambient temp > CRITICAL_TEMPERATURE OR integrity damaged
|
||||
#define SUPERMATTER_DANGER 4 // Integrity < 50%
|
||||
#define SUPERMATTER_EMERGENCY 5 // Integrity < 25%
|
||||
#define SUPERMATTER_DELAMINATING 6 // Pretty obvious.
|
||||
|
||||
//Nuclear bomb stuff
|
||||
#define NUKESTATE_INTACT 5
|
||||
#define NUKESTATE_UNSCREWED 4
|
||||
#define NUKESTATE_PANEL_REMOVED 3
|
||||
#define NUKESTATE_WELDED 2
|
||||
#define NUKESTATE_CORE_EXPOSED 1
|
||||
#define NUKESTATE_CORE_REMOVED 0
|
||||
|
||||
#define NUKE_OFF_LOCKED 0
|
||||
#define NUKE_OFF_UNLOCKED 1
|
||||
#define NUKE_ON_TIMING 2
|
||||
#define NUKE_ON_EXPLODING 3
|
||||
|
||||
|
||||
//these flags are used to tell the DNA modifier if a plant gene cannot be extracted or modified.
|
||||
#define PLANT_GENE_REMOVABLE (1<<0)
|
||||
// channel numbers for power
|
||||
#define EQUIP 1
|
||||
#define LIGHT 2
|
||||
#define ENVIRON 3
|
||||
#define TOTAL 4 //for total power used only
|
||||
#define STATIC_EQUIP 5
|
||||
#define STATIC_LIGHT 6
|
||||
#define STATIC_ENVIRON 7
|
||||
|
||||
//Power use
|
||||
#define NO_POWER_USE 0
|
||||
#define IDLE_POWER_USE 1
|
||||
#define ACTIVE_POWER_USE 2
|
||||
|
||||
|
||||
//bitflags for door switches.
|
||||
#define OPEN (1<<0)
|
||||
#define IDSCAN (1<<1)
|
||||
#define BOLTS (1<<2)
|
||||
#define SHOCK (1<<3)
|
||||
#define SAFE (1<<4)
|
||||
|
||||
//used in design to specify which machine can build it
|
||||
#define IMPRINTER (1<<0) //For circuits. Uses glass/chemicals.
|
||||
#define PROTOLATHE (1<<1) //New stuff. Uses glass/metal/chemicals
|
||||
#define AUTOLATHE (1<<2) //Uses glass/metal only.
|
||||
#define CRAFTLATHE (1<<3) //Uses fuck if I know. For use eventually.
|
||||
#define MECHFAB (1<<4) //Remember, objects utilising this flag should have construction_time and construction_cost vars.
|
||||
#define BIOGENERATOR (1<<5) //Uses biomass
|
||||
#define LIMBGROWER (1<<6) //Uses synthetic flesh
|
||||
#define SMELTER (1<<7) //uses various minerals
|
||||
#define AUTOYLATHE (1<<8) // CITADEL ADD
|
||||
#define NANITE_COMPILER (1<<9) //Prints nanite disks
|
||||
#define AUTOBOTTLER (1<<10) //Uses booze, for printing
|
||||
//Note: More then one of these can be added to a design but imprinter and lathe designs are incompatable.
|
||||
|
||||
//Modular computer/NTNet defines
|
||||
|
||||
//Modular computer part defines
|
||||
#define MC_CPU "CPU"
|
||||
#define MC_HDD "HDD"
|
||||
#define MC_SDD "SDD"
|
||||
#define MC_CARD "CARD"
|
||||
#define MC_NET "NET"
|
||||
#define MC_PRINT "PRINT"
|
||||
#define MC_CELL "CELL"
|
||||
#define MC_CHARGE "CHARGE"
|
||||
#define MC_AI "AI"
|
||||
|
||||
//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.
|
||||
|
||||
//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
|
||||
|
||||
//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)
|
||||
//Program states
|
||||
#define PROGRAM_STATE_KILLED 0
|
||||
#define PROGRAM_STATE_BACKGROUND 1
|
||||
#define PROGRAM_STATE_ACTIVE 2
|
||||
|
||||
#define FIREDOOR_OPEN 1
|
||||
#define FIREDOOR_CLOSED 2
|
||||
|
||||
|
||||
|
||||
// These are used by supermatter and supermatter monitor program, mostly for UI updating purposes. Higher should always be worse!
|
||||
#define SUPERMATTER_ERROR -1 // Unknown status, shouldn't happen but just in case.
|
||||
#define SUPERMATTER_INACTIVE 0 // No or minimal energy
|
||||
#define SUPERMATTER_NORMAL 1 // Normal operation
|
||||
#define SUPERMATTER_NOTIFY 2 // Ambient temp > 80% of CRITICAL_TEMPERATURE
|
||||
#define SUPERMATTER_WARNING 3 // Ambient temp > CRITICAL_TEMPERATURE OR integrity damaged
|
||||
#define SUPERMATTER_DANGER 4 // Integrity < 50%
|
||||
#define SUPERMATTER_EMERGENCY 5 // Integrity < 25%
|
||||
#define SUPERMATTER_DELAMINATING 6 // Pretty obvious.
|
||||
|
||||
//Nuclear bomb stuff
|
||||
#define NUKESTATE_INTACT 5
|
||||
#define NUKESTATE_UNSCREWED 4
|
||||
#define NUKESTATE_PANEL_REMOVED 3
|
||||
#define NUKESTATE_WELDED 2
|
||||
#define NUKESTATE_CORE_EXPOSED 1
|
||||
#define NUKESTATE_CORE_REMOVED 0
|
||||
|
||||
#define NUKEUI_AWAIT_DISK 0
|
||||
#define NUKEUI_AWAIT_CODE 1
|
||||
#define NUKEUI_AWAIT_TIMER 2
|
||||
#define NUKEUI_AWAIT_ARM 3
|
||||
#define NUKEUI_TIMING 4
|
||||
#define NUKEUI_EXPLODED 5
|
||||
|
||||
#define NUKE_OFF_LOCKED 0
|
||||
#define NUKE_OFF_UNLOCKED 1
|
||||
#define NUKE_ON_TIMING 2
|
||||
#define NUKE_ON_EXPLODING 3
|
||||
|
||||
|
||||
//these flags are used to tell the DNA modifier if a plant gene cannot be extracted or modified.
|
||||
#define PLANT_GENE_REMOVABLE (1<<0)
|
||||
#define PLANT_GENE_EXTRACTABLE (1<<1)
|
||||
@@ -165,6 +165,11 @@
|
||||
/proc/start_log(log)
|
||||
WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------")
|
||||
|
||||
/* ui logging */
|
||||
|
||||
/proc/log_tgui(text)
|
||||
WRITE_LOG(GLOB.tgui_log, text)
|
||||
|
||||
/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */
|
||||
/proc/shutdown_logging()
|
||||
rustg_log_close_all()
|
||||
|
||||
@@ -1547,3 +1547,47 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
return -1
|
||||
else
|
||||
return 0
|
||||
|
||||
// Converts browser keycodes to BYOND keycodes.
|
||||
/proc/browser_keycode_to_byond(keycode)
|
||||
keycode = text2num(keycode)
|
||||
switch(keycode)
|
||||
// letters and numbers
|
||||
if(65 to 90, 48 to 57)
|
||||
return ascii2text(keycode)
|
||||
if(17)
|
||||
return "Ctrl"
|
||||
if(18)
|
||||
return "Alt"
|
||||
if(16)
|
||||
return "Shift"
|
||||
if(37)
|
||||
return "West"
|
||||
if(38)
|
||||
return "North"
|
||||
if(39)
|
||||
return "East"
|
||||
if(40)
|
||||
return "South"
|
||||
if(45)
|
||||
return "Insert"
|
||||
if(46)
|
||||
return "Delete"
|
||||
if(36)
|
||||
return "Northwest"
|
||||
if(35)
|
||||
return "Southwest"
|
||||
if(33)
|
||||
return "Northeast"
|
||||
if(34)
|
||||
return "Southeast"
|
||||
if(112 to 123)
|
||||
return "F[keycode-111]"
|
||||
if(96 to 105)
|
||||
return "Numpad[keycode-96]"
|
||||
if(188)
|
||||
return ","
|
||||
if(190)
|
||||
return "."
|
||||
if(189)
|
||||
return "-"
|
||||
+67
-64
@@ -1,64 +1,67 @@
|
||||
GLOBAL_VAR(log_directory)
|
||||
GLOBAL_PROTECT(log_directory)
|
||||
GLOBAL_VAR(world_game_log)
|
||||
GLOBAL_PROTECT(world_game_log)
|
||||
GLOBAL_VAR(world_runtime_log)
|
||||
GLOBAL_PROTECT(world_runtime_log)
|
||||
GLOBAL_VAR(world_qdel_log)
|
||||
GLOBAL_PROTECT(world_qdel_log)
|
||||
GLOBAL_VAR(world_attack_log)
|
||||
GLOBAL_PROTECT(world_attack_log)
|
||||
GLOBAL_VAR(world_href_log)
|
||||
GLOBAL_PROTECT(world_href_log)
|
||||
GLOBAL_VAR(round_id)
|
||||
GLOBAL_PROTECT(round_id)
|
||||
GLOBAL_VAR(config_error_log)
|
||||
GLOBAL_PROTECT(config_error_log)
|
||||
GLOBAL_VAR(sql_error_log)
|
||||
GLOBAL_PROTECT(sql_error_log)
|
||||
GLOBAL_VAR(world_pda_log)
|
||||
GLOBAL_PROTECT(world_pda_log)
|
||||
GLOBAL_VAR(world_telecomms_log)
|
||||
GLOBAL_PROTECT(world_telecomms_log)
|
||||
GLOBAL_VAR(world_manifest_log)
|
||||
GLOBAL_PROTECT(world_manifest_log)
|
||||
GLOBAL_VAR(query_debug_log)
|
||||
GLOBAL_PROTECT(query_debug_log)
|
||||
GLOBAL_VAR(world_job_debug_log)
|
||||
GLOBAL_PROTECT(world_job_debug_log)
|
||||
GLOBAL_VAR(world_virus_log)
|
||||
GLOBAL_PROTECT(world_virus_log)
|
||||
GLOBAL_VAR(world_map_error_log)
|
||||
GLOBAL_PROTECT(world_map_error_log)
|
||||
GLOBAL_VAR(subsystem_log)
|
||||
GLOBAL_PROTECT(subsystem_log)
|
||||
|
||||
GLOBAL_LIST_EMPTY(bombers)
|
||||
GLOBAL_PROTECT(bombers)
|
||||
GLOBAL_LIST_EMPTY(admin_log)
|
||||
GLOBAL_PROTECT(admin_log)
|
||||
GLOBAL_LIST_EMPTY(lastsignalers) //keeps last 100 signals here in format: "[src] used [REF(src)] @ location [src.loc]: [freq]/[code]"
|
||||
GLOBAL_PROTECT(lastsignalers)
|
||||
GLOBAL_LIST_EMPTY(lawchanges) //Stores who uploaded laws to which silicon-based lifeform, and what the law was
|
||||
GLOBAL_PROTECT(lawchanges)
|
||||
|
||||
GLOBAL_LIST_EMPTY(combatlog)
|
||||
GLOBAL_PROTECT(combatlog)
|
||||
GLOBAL_LIST_EMPTY(IClog)
|
||||
GLOBAL_PROTECT(IClog)
|
||||
GLOBAL_LIST_EMPTY(OOClog)
|
||||
GLOBAL_PROTECT(OOClog)
|
||||
GLOBAL_LIST_EMPTY(adminlog)
|
||||
GLOBAL_PROTECT(adminlog)
|
||||
|
||||
GLOBAL_LIST_EMPTY(active_turfs_startlist)
|
||||
|
||||
/////Picture logging
|
||||
GLOBAL_VAR(picture_log_directory)
|
||||
GLOBAL_PROTECT(picture_log_directory)
|
||||
|
||||
GLOBAL_VAR_INIT(picture_logging_id, 1)
|
||||
GLOBAL_PROTECT(picture_logging_id)
|
||||
GLOBAL_VAR(picture_logging_prefix)
|
||||
GLOBAL_PROTECT(picture_logging_prefix)
|
||||
/////
|
||||
GLOBAL_VAR(log_directory)
|
||||
GLOBAL_PROTECT(log_directory)
|
||||
GLOBAL_VAR(world_game_log)
|
||||
GLOBAL_PROTECT(world_game_log)
|
||||
GLOBAL_VAR(world_runtime_log)
|
||||
GLOBAL_PROTECT(world_runtime_log)
|
||||
GLOBAL_VAR(world_qdel_log)
|
||||
GLOBAL_PROTECT(world_qdel_log)
|
||||
GLOBAL_VAR(world_attack_log)
|
||||
GLOBAL_PROTECT(world_attack_log)
|
||||
GLOBAL_VAR(world_href_log)
|
||||
GLOBAL_PROTECT(world_href_log)
|
||||
GLOBAL_VAR(round_id)
|
||||
GLOBAL_PROTECT(round_id)
|
||||
GLOBAL_VAR(config_error_log)
|
||||
GLOBAL_PROTECT(config_error_log)
|
||||
GLOBAL_VAR(sql_error_log)
|
||||
GLOBAL_PROTECT(sql_error_log)
|
||||
GLOBAL_VAR(world_pda_log)
|
||||
GLOBAL_PROTECT(world_pda_log)
|
||||
GLOBAL_VAR(world_telecomms_log)
|
||||
GLOBAL_PROTECT(world_telecomms_log)
|
||||
GLOBAL_VAR(world_manifest_log)
|
||||
GLOBAL_PROTECT(world_manifest_log)
|
||||
GLOBAL_VAR(query_debug_log)
|
||||
GLOBAL_PROTECT(query_debug_log)
|
||||
GLOBAL_VAR(world_job_debug_log)
|
||||
GLOBAL_PROTECT(world_job_debug_log)
|
||||
GLOBAL_VAR(world_virus_log)
|
||||
GLOBAL_PROTECT(world_virus_log)
|
||||
GLOBAL_VAR(world_map_error_log)
|
||||
GLOBAL_PROTECT(world_map_error_log)
|
||||
GLOBAL_VAR(subsystem_log)
|
||||
GLOBAL_PROTECT(subsystem_log)
|
||||
|
||||
GLOBAL_LIST_EMPTY(bombers)
|
||||
GLOBAL_PROTECT(bombers)
|
||||
GLOBAL_LIST_EMPTY(admin_log)
|
||||
GLOBAL_PROTECT(admin_log)
|
||||
GLOBAL_LIST_EMPTY(lastsignalers) //keeps last 100 signals here in format: "[src] used [REF(src)] @ location [src.loc]: [freq]/[code]"
|
||||
GLOBAL_PROTECT(lastsignalers)
|
||||
GLOBAL_LIST_EMPTY(lawchanges) //Stores who uploaded laws to which silicon-based lifeform, and what the law was
|
||||
GLOBAL_PROTECT(lawchanges)
|
||||
|
||||
GLOBAL_VAR(tgui_log)
|
||||
GLOBAL_PROTECT(tgui_log)
|
||||
|
||||
GLOBAL_LIST_EMPTY(combatlog)
|
||||
GLOBAL_PROTECT(combatlog)
|
||||
GLOBAL_LIST_EMPTY(IClog)
|
||||
GLOBAL_PROTECT(IClog)
|
||||
GLOBAL_LIST_EMPTY(OOClog)
|
||||
GLOBAL_PROTECT(OOClog)
|
||||
GLOBAL_LIST_EMPTY(adminlog)
|
||||
GLOBAL_PROTECT(adminlog)
|
||||
|
||||
GLOBAL_LIST_EMPTY(active_turfs_startlist)
|
||||
|
||||
/////Picture logging
|
||||
GLOBAL_VAR(picture_log_directory)
|
||||
GLOBAL_PROTECT(picture_log_directory)
|
||||
|
||||
GLOBAL_VAR_INIT(picture_logging_id, 1)
|
||||
GLOBAL_PROTECT(picture_logging_id)
|
||||
GLOBAL_VAR(picture_logging_prefix)
|
||||
GLOBAL_PROTECT(picture_logging_prefix)
|
||||
/////
|
||||
|
||||
+2
-8
@@ -140,10 +140,7 @@
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
|
||||
if(locked)
|
||||
bolt_raise(usr)
|
||||
else
|
||||
bolt_drop(usr)
|
||||
toggle_bolt(usr)
|
||||
|
||||
/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
|
||||
if(obj_flags & EMAGGED)
|
||||
@@ -165,10 +162,7 @@
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
|
||||
if(!emergency)
|
||||
emergency_on(usr)
|
||||
else
|
||||
emergency_off(usr)
|
||||
toggle_emergency(usr)
|
||||
|
||||
/* APC */
|
||||
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
|
||||
|
||||
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
var/basehtml // The HTML base used for all UIs.
|
||||
|
||||
/datum/controller/subsystem/tgui/PreInit()
|
||||
basehtml = file2text('tgui/tgui.html')
|
||||
basehtml = file2text('tgui-next/packages/tgui/public/tgui-main.html')
|
||||
|
||||
/datum/controller/subsystem/tgui/Shutdown()
|
||||
close_all_uis()
|
||||
|
||||
@@ -25,6 +25,7 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
var/unlock_code
|
||||
var/failsafe_code
|
||||
var/datum/ui_state/checkstate
|
||||
var/compact_mode = FALSE
|
||||
|
||||
/datum/component/uplink/Initialize(_owner, _lockable = TRUE, _enabled = FALSE, datum/game_mode/_gamemode, starting_tc = 20, datum/ui_state/_checkstate)
|
||||
if(!isitem(parent))
|
||||
@@ -121,7 +122,7 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
active = TRUE
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "uplink", name, 450, 750, master_ui, state)
|
||||
ui = new(user, src, ui_key, "uplink", name, 620, 580, master_ui, state)
|
||||
ui.set_autoupdate(FALSE) // This UI is only ever opened by one person, and never is updated outside of user input.
|
||||
ui.set_style("syndicate")
|
||||
ui.open()
|
||||
@@ -138,22 +139,25 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
var/list/data = list()
|
||||
data["telecrystals"] = telecrystals
|
||||
data["lockable"] = lockable
|
||||
data["compact_mode"] = compact_mode
|
||||
return data
|
||||
|
||||
/datum/component/uplink/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["categories"] = list()
|
||||
for(var/category in uplink_items)
|
||||
var/list/cat = list(
|
||||
"name" = category,
|
||||
"items" = (category == selected_cat ? list() : null))
|
||||
if(category == selected_cat)
|
||||
for(var/item in uplink_items[category])
|
||||
var/datum/uplink_item/I = uplink_items[category][item]
|
||||
if(I.limited_stock == 0)
|
||||
continue
|
||||
if(I.restricted_roles.len)
|
||||
var/is_inaccessible = 1
|
||||
for(var/R in I.restricted_roles)
|
||||
if(R == user.mind.assigned_role)
|
||||
is_inaccessible = 0
|
||||
for(var/item in uplink_items[category])
|
||||
var/datum/uplink_item/I = uplink_items[category][item]
|
||||
if(I.limited_stock == 0)
|
||||
continue
|
||||
if(I.restricted_roles.len)
|
||||
var/is_inaccessible = TRUE
|
||||
for(var/R in I.restricted_roles)
|
||||
if(R == user.mind.assigned_role)
|
||||
is_inaccessible = FALSE
|
||||
if(is_inaccessible)
|
||||
continue
|
||||
cat["items"] += list(list(
|
||||
@@ -188,6 +192,8 @@ GLOBAL_LIST_EMPTY(uplinks)
|
||||
SStgui.close_uis(src)
|
||||
if("select")
|
||||
selected_cat = params["category"]
|
||||
if("compact_toggle")
|
||||
compact_mode = !compact_mode
|
||||
return TRUE
|
||||
|
||||
/datum/component/uplink/proc/MakePurchase(mob/user, datum/uplink_item/U)
|
||||
|
||||
@@ -1,148 +1,152 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Choking
|
||||
|
||||
Very very noticable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity tremendously.
|
||||
Moderate Level.
|
||||
|
||||
Bonus
|
||||
Inflicts spikes of oxyloss
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/choking
|
||||
|
||||
name = "Choking"
|
||||
desc = "The virus causes inflammation of the host's air conduits, leading to intermittent choking."
|
||||
stealth = -3
|
||||
resistance = -2
|
||||
stage_speed = -2
|
||||
transmittable = -4
|
||||
level = 3
|
||||
severity = 3
|
||||
base_message_chance = 15
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
threshold_desc = "<b>Stage Speed 8:</b> Causes choking more frequently.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/choking/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 8)
|
||||
symptom_delay_min = 7
|
||||
symptom_delay_max = 24
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
|
||||
/datum/symptom/choking/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You're having difficulty breathing.", "Your breathing becomes heavy.")]</span>")
|
||||
if(3, 4)
|
||||
if(!suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("Your windpipe feels like a straw.", "Your breathing becomes tremendously difficult.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>You feel very [pick("dizzy","woozy","faint")].</span>") //fake bloodloss messages
|
||||
Choke_stage_3_4(M, A)
|
||||
M.emote("gasp")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>[pick("You're choking!", "You can't breathe!")]</span>")
|
||||
Choke(M, A)
|
||||
M.emote("gasp")
|
||||
|
||||
/datum/symptom/choking/proc/Choke_stage_3_4(mob/living/M, datum/disease/advance/A)
|
||||
M.adjustOxyLoss(rand(6,13))
|
||||
return 1
|
||||
|
||||
/datum/symptom/choking/proc/Choke(mob/living/M, datum/disease/advance/A)
|
||||
M.adjustOxyLoss(rand(10,18))
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Asphyxiation
|
||||
|
||||
Very very noticable.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
|
||||
Bonus
|
||||
Inflicts large spikes of oxyloss
|
||||
Introduces Asphyxiating drugs to the system
|
||||
Causes cardiac arrest on dying victims.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/asphyxiation
|
||||
|
||||
name = "Acute respiratory distress syndrome"
|
||||
desc = "The virus causes shrinking of the host's lungs, causing severe asphyxiation. May also lead to heart attacks."
|
||||
stealth = -2
|
||||
resistance = -0
|
||||
stage_speed = -1
|
||||
transmittable = -2
|
||||
level = 7
|
||||
severity = 6
|
||||
base_message_chance = 15
|
||||
symptom_delay_min = 14
|
||||
symptom_delay_max = 30
|
||||
var/paralysis = FALSE
|
||||
threshold_desc = "<b>Stage Speed 8:</b> Additionally synthesizes pancuronium and sodium thiopental inside the host.<br>\
|
||||
<b>Transmission 8:</b> Doubles the damage caused by the symptom."
|
||||
|
||||
|
||||
/datum/symptom/asphyxiation/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 8)
|
||||
paralysis = TRUE
|
||||
if(A.properties["transmittable"] >= 8)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/asphyxiation/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(3, 4)
|
||||
to_chat(M, "<span class='warning'><b>[pick("Your windpipe feels thin.", "Your lungs feel small.")]</span>")
|
||||
Asphyxiate_stage_3_4(M, A)
|
||||
M.emote("gasp")
|
||||
if(5)
|
||||
to_chat(M, "<span class='userdanger'>[pick("Your lungs hurt!", "It hurts to breathe!")]</span>")
|
||||
Asphyxiate(M, A)
|
||||
M.emote("gasp")
|
||||
if(M.getOxyLoss() >= 120)
|
||||
M.visible_message("<span class='warning'>[M] stops breathing, as if their lungs have totally collapsed!</span>")
|
||||
Asphyxiate_death(M, A)
|
||||
return
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate_stage_3_4(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(10,15) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
return 1
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(15,21) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
if(paralysis)
|
||||
M.reagents.add_reagent_list(list(/datum/reagent/toxin/pancuronium = 3, /datum/reagent/toxin/sodium_thiopental = 3))
|
||||
return 1
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(25,35) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, get_damage/2)
|
||||
return 1
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Choking
|
||||
|
||||
Very very noticable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity tremendously.
|
||||
Moderate Level.
|
||||
|
||||
Bonus
|
||||
Inflicts spikes of oxyloss
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/choking
|
||||
|
||||
name = "Choking"
|
||||
desc = "The virus causes inflammation of the host's air conduits, leading to intermittent choking."
|
||||
stealth = -3
|
||||
resistance = -2
|
||||
stage_speed = -2
|
||||
transmittable = -4
|
||||
level = 3
|
||||
severity = 3
|
||||
base_message_chance = 15
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
threshold_desc = list(
|
||||
"Stage Speed 8" = "Causes choking more frequently.",
|
||||
"Stealth 4" = "The symptom remains hidden until active."
|
||||
)
|
||||
|
||||
/datum/symptom/choking/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 8)
|
||||
symptom_delay_min = 7
|
||||
symptom_delay_max = 24
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
|
||||
/datum/symptom/choking/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You're having difficulty breathing.", "Your breathing becomes heavy.")]</span>")
|
||||
if(3, 4)
|
||||
if(!suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("Your windpipe feels like a straw.", "Your breathing becomes tremendously difficult.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'>You feel very [pick("dizzy","woozy","faint")].</span>") //fake bloodloss messages
|
||||
Choke_stage_3_4(M, A)
|
||||
M.emote("gasp")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>[pick("You're choking!", "You can't breathe!")]</span>")
|
||||
Choke(M, A)
|
||||
M.emote("gasp")
|
||||
|
||||
/datum/symptom/choking/proc/Choke_stage_3_4(mob/living/M, datum/disease/advance/A)
|
||||
M.adjustOxyLoss(rand(6,13))
|
||||
return 1
|
||||
|
||||
/datum/symptom/choking/proc/Choke(mob/living/M, datum/disease/advance/A)
|
||||
M.adjustOxyLoss(rand(10,18))
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Asphyxiation
|
||||
|
||||
Very very noticable.
|
||||
Decreases stage speed.
|
||||
Decreases transmittablity.
|
||||
|
||||
Bonus
|
||||
Inflicts large spikes of oxyloss
|
||||
Introduces Asphyxiating drugs to the system
|
||||
Causes cardiac arrest on dying victims.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/asphyxiation
|
||||
|
||||
name = "Acute respiratory distress syndrome"
|
||||
desc = "The virus causes shrinking of the host's lungs, causing severe asphyxiation. May also lead to heart attacks."
|
||||
stealth = -2
|
||||
resistance = -0
|
||||
stage_speed = -1
|
||||
transmittable = -2
|
||||
level = 7
|
||||
severity = 6
|
||||
base_message_chance = 15
|
||||
symptom_delay_min = 14
|
||||
symptom_delay_max = 30
|
||||
var/paralysis = FALSE
|
||||
threshold_desc = list(
|
||||
"Stage Speed 8" = "Additionally synthesizes pancuronium and sodium thiopental inside the host.",
|
||||
"Transmission 8" = "Doubles the damage caused by the symptom."
|
||||
)
|
||||
|
||||
|
||||
/datum/symptom/asphyxiation/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 8)
|
||||
paralysis = TRUE
|
||||
if(A.properties["transmittable"] >= 8)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/asphyxiation/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(3, 4)
|
||||
to_chat(M, "<span class='warning'><b>[pick("Your windpipe feels thin.", "Your lungs feel small.")]</span>")
|
||||
Asphyxiate_stage_3_4(M, A)
|
||||
M.emote("gasp")
|
||||
if(5)
|
||||
to_chat(M, "<span class='userdanger'>[pick("Your lungs hurt!", "It hurts to breathe!")]</span>")
|
||||
Asphyxiate(M, A)
|
||||
M.emote("gasp")
|
||||
if(M.getOxyLoss() >= 120)
|
||||
M.visible_message("<span class='warning'>[M] stops breathing, as if their lungs have totally collapsed!</span>")
|
||||
Asphyxiate_death(M, A)
|
||||
return
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate_stage_3_4(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(10,15) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
return 1
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(15,21) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
if(paralysis)
|
||||
M.reagents.add_reagent_list(list(/datum/reagent/toxin/pancuronium = 3, /datum/reagent/toxin/sodium_thiopental = 3))
|
||||
return 1
|
||||
|
||||
/datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(25,35) * power
|
||||
M.adjustOxyLoss(get_damage)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, get_damage/2)
|
||||
return 1
|
||||
|
||||
@@ -1,61 +1,63 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Confusion
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Not very transmissibile.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Makes the affected mob be confused for short periods of time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/confusion
|
||||
|
||||
name = "Confusion"
|
||||
desc = "The virus interferes with the proper function of the neural system, leading to bouts of confusion and erratic movement."
|
||||
stealth = 1
|
||||
resistance = -1
|
||||
stage_speed = -3
|
||||
transmittable = 0
|
||||
level = 4
|
||||
severity = 2
|
||||
base_message_chance = 25
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
var/brain_damage = FALSE
|
||||
threshold_desc = "<b>Resistance 6:</b> Causes brain damage over time.<br>\
|
||||
<b>Transmission 6:</b> Increases confusion duration.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/confusion/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 6)
|
||||
brain_damage = TRUE
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
power = 1.5
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
|
||||
/datum/symptom/confusion/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("Your head hurts.", "Your mind blanks for a moment.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>You can't think straight!</span>")
|
||||
M.confused = min(100 * power, M.confused + 8)
|
||||
if(brain_damage)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3 * power, 80)
|
||||
M.updatehealth()
|
||||
|
||||
return
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Confusion
|
||||
|
||||
Little bit hidden.
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Not very transmissibile.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Makes the affected mob be confused for short periods of time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/confusion
|
||||
|
||||
name = "Confusion"
|
||||
desc = "The virus interferes with the proper function of the neural system, leading to bouts of confusion and erratic movement."
|
||||
stealth = 1
|
||||
resistance = -1
|
||||
stage_speed = -3
|
||||
transmittable = 0
|
||||
level = 4
|
||||
severity = 2
|
||||
base_message_chance = 25
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
var/brain_damage = FALSE
|
||||
threshold_desc = list(
|
||||
"Resistance 6" = "Causes brain damage over time.",
|
||||
"Transmission 6" = "Increases confusion duration and strength.",
|
||||
"Stealth 4" = "The symptom remains hidden until active.",
|
||||
)
|
||||
|
||||
/datum/symptom/confusion/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 6)
|
||||
brain_damage = TRUE
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
power = 1.5
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
|
||||
/datum/symptom/confusion/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("Your head hurts.", "Your mind blanks for a moment.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>You can't think straight!</span>")
|
||||
M.confused = min(100 * power, M.confused + 8)
|
||||
if(brain_damage)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3 * power, 80)
|
||||
M.updatehealth()
|
||||
|
||||
return
|
||||
|
||||
@@ -1,75 +1,76 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Coughing
|
||||
|
||||
Noticable.
|
||||
Little Resistance.
|
||||
Doesn't increase stage speed much.
|
||||
Transmissibile.
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Will force the affected mob to drop small items!
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/cough
|
||||
|
||||
name = "Cough"
|
||||
desc = "The virus irritates the throat of the host, causing occasional coughing."
|
||||
stealth = -1
|
||||
resistance = 3
|
||||
stage_speed = 1
|
||||
transmittable = 2
|
||||
level = 1
|
||||
severity = 1
|
||||
base_message_chance = 15
|
||||
symptom_delay_min = 2
|
||||
symptom_delay_max = 15
|
||||
var/infective = FALSE
|
||||
threshold_desc = "<b>Resistance 3:</b> Host will drop small items when coughing.<br>\
|
||||
<b>Resistance 10:</b> Occasionally causes coughing fits that stun the host.<br>\
|
||||
<b>Stage Speed 6:</b> Increases cough frequency.<br>\
|
||||
<b>If Airborne:</b> Coughing will infect bystanders.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/cough/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.spread_flags &= DISEASE_SPREAD_AIRBORNE) //infect bystanders
|
||||
infective = TRUE
|
||||
if(A.properties["resistance"] >= 3) //strong enough to drop items
|
||||
power = 1.5
|
||||
if(A.properties["resistance"] >= 10) //strong enough to stun (rarely)
|
||||
power = 2
|
||||
if(A.properties["stage_rate"] >= 6) //cough more often
|
||||
symptom_delay_max = 10
|
||||
|
||||
/datum/symptom/cough/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span notice='warning'>[pick("You swallow excess mucus.", "You lightly cough.")]</span>")
|
||||
else
|
||||
M.emote("cough")
|
||||
if(power >= 1.5)
|
||||
var/obj/item/I = M.get_active_held_item()
|
||||
if(I && I.w_class == WEIGHT_CLASS_TINY)
|
||||
M.dropItemToGround(I)
|
||||
if(power >= 2 && prob(10))
|
||||
to_chat(M, "<span notice='userdanger'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>")
|
||||
M.Stun(20)
|
||||
M.emote("cough")
|
||||
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 6)
|
||||
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 12)
|
||||
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 18)
|
||||
if(infective && M.CanSpreadAirborneDisease())
|
||||
A.spread(1)
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Coughing
|
||||
|
||||
Noticable.
|
||||
Little Resistance.
|
||||
Doesn't increase stage speed much.
|
||||
Transmissibile.
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Will force the affected mob to drop small items!
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/cough
|
||||
|
||||
name = "Cough"
|
||||
desc = "The virus irritates the throat of the host, causing occasional coughing."
|
||||
stealth = -1
|
||||
resistance = 3
|
||||
stage_speed = 1
|
||||
transmittable = 2
|
||||
level = 1
|
||||
severity = 1
|
||||
base_message_chance = 15
|
||||
symptom_delay_min = 2
|
||||
symptom_delay_max = 15
|
||||
var/infective = FALSE
|
||||
threshold_desc = list(
|
||||
"Resistance 11" = "The host will drop small items when coughing.",
|
||||
"Resistance 15" = "Occasionally causes coughing fits that stun the host. The extra coughs do not spread the virus.",
|
||||
"Stage Speed 6" = "Increases cough frequency.",
|
||||
"Transmission 7" = "Coughing will now infect bystanders up to 2 tiles away.",
|
||||
"Stealth 4" = "The symptom remains hidden until active.",
|
||||
)
|
||||
/datum/symptom/cough/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.spread_flags &= DISEASE_SPREAD_AIRBORNE) //infect bystanders
|
||||
infective = TRUE
|
||||
if(A.properties["resistance"] >= 3) //strong enough to drop items
|
||||
power = 1.5
|
||||
if(A.properties["resistance"] >= 10) //strong enough to stun (rarely)
|
||||
power = 2
|
||||
if(A.properties["stage_rate"] >= 6) //cough more often
|
||||
symptom_delay_max = 10
|
||||
|
||||
/datum/symptom/cough/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span notice='warning'>[pick("You swallow excess mucus.", "You lightly cough.")]</span>")
|
||||
else
|
||||
M.emote("cough")
|
||||
if(power >= 1.5)
|
||||
var/obj/item/I = M.get_active_held_item()
|
||||
if(I && I.w_class == WEIGHT_CLASS_TINY)
|
||||
M.dropItemToGround(I)
|
||||
if(power >= 2 && prob(10))
|
||||
to_chat(M, "<span notice='userdanger'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>")
|
||||
M.Stun(20)
|
||||
M.emote("cough")
|
||||
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 6)
|
||||
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 12)
|
||||
addtimer(CALLBACK(M, /mob/.proc/emote, "cough"), 18)
|
||||
if(infective && M.CanSpreadAirborneDisease())
|
||||
A.spread(1)
|
||||
|
||||
|
||||
@@ -1,59 +1,61 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Deafness
|
||||
|
||||
Slightly noticable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed slightly.
|
||||
Decreases transmittablity.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Causes intermittent loss of hearing.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/deafness
|
||||
|
||||
name = "Deafness"
|
||||
desc = "The virus causes inflammation of the eardrums, causing intermittent deafness."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = -1
|
||||
transmittable = -3
|
||||
level = 4
|
||||
severity = 4
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 80
|
||||
threshold_desc = "<b>Resistance 9:</b> Causes permanent deafness, instead of intermittent.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/deafness/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["resistance"] >= 9) //permanent deafness
|
||||
power = 2
|
||||
|
||||
/datum/symptom/deafness/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You hear a ringing in your ear.", "Your ears pop.")]</span>")
|
||||
if(5)
|
||||
if(power > 2)
|
||||
var/obj/item/organ/ears/ears = M.getorganslot(ORGAN_SLOT_EARS)
|
||||
if(istype(ears) && ears.damage < ears.maxHealth)
|
||||
to_chat(M, "<span class='userdanger'>Your ears pop painfully and start bleeding!</span>")
|
||||
ears.damage = max(ears.damage, ears.maxHealth)
|
||||
M.emote("scream")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>Your ears pop and begin ringing loudly!</span>")
|
||||
M.minimumDeafTicks(20)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Deafness
|
||||
|
||||
Slightly noticable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed slightly.
|
||||
Decreases transmittablity.
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Causes intermittent loss of hearing.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/deafness
|
||||
|
||||
name = "Deafness"
|
||||
desc = "The virus causes inflammation of the eardrums, causing intermittent deafness."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = -1
|
||||
transmittable = -3
|
||||
level = 4
|
||||
severity = 4
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 80
|
||||
threshold_desc = list(
|
||||
"Resistance 9" = "Causes permanent deafness, instead of intermittent.",
|
||||
"Stealth 4" = "The symptom remains hidden until active.",
|
||||
)
|
||||
|
||||
/datum/symptom/deafness/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["resistance"] >= 9) //permanent deafness
|
||||
power = 2
|
||||
|
||||
/datum/symptom/deafness/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You hear a ringing in your ear.", "Your ears pop.")]</span>")
|
||||
if(5)
|
||||
if(power > 2)
|
||||
var/obj/item/organ/ears/ears = M.getorganslot(ORGAN_SLOT_EARS)
|
||||
if(istype(ears) && ears.damage < ears.maxHealth)
|
||||
to_chat(M, "<span class='userdanger'>Your ears pop painfully and start bleeding!</span>")
|
||||
ears.damage = max(ears.damage, ears.maxHealth)
|
||||
M.emote("scream")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>Your ears pop and begin ringing loudly!</span>")
|
||||
M.minimumDeafTicks(20)
|
||||
|
||||
@@ -1,53 +1,55 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Dizziness
|
||||
|
||||
Hidden.
|
||||
Lowers resistance considerably.
|
||||
Decreases stage speed.
|
||||
Reduced transmittability
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Shakes the affected mob's screen for short periods.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/dizzy // Not the egg
|
||||
|
||||
name = "Dizziness"
|
||||
desc = "The virus causes inflammation of the vestibular system, leading to bouts of dizziness."
|
||||
resistance = -2
|
||||
stage_speed = -3
|
||||
transmittable = -1
|
||||
level = 4
|
||||
severity = 2
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 40
|
||||
threshold_desc = "<b>Transmission 6:</b> Also causes druggy vision.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/dizzy/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["transmittable"] >= 6) //druggy
|
||||
power = 2
|
||||
|
||||
/datum/symptom/dizzy/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel dizzy.", "Your head spins.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>A wave of dizziness washes over you!</span>")
|
||||
M.Dizzy(5)
|
||||
if(power >= 2)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Dizziness
|
||||
|
||||
Hidden.
|
||||
Lowers resistance considerably.
|
||||
Decreases stage speed.
|
||||
Reduced transmittability
|
||||
Intense Level.
|
||||
|
||||
Bonus
|
||||
Shakes the affected mob's screen for short periods.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/dizzy // Not the egg
|
||||
|
||||
name = "Dizziness"
|
||||
desc = "The virus causes inflammation of the vestibular system, leading to bouts of dizziness."
|
||||
resistance = -2
|
||||
stage_speed = -3
|
||||
transmittable = -1
|
||||
level = 4
|
||||
severity = 2
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 40
|
||||
threshold_desc = list(
|
||||
"Transmission 6" = "Also causes druggy vision.",
|
||||
"Stealth 4" = "The symptom remains hidden until active.",
|
||||
)
|
||||
|
||||
/datum/symptom/dizzy/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["transmittable"] >= 6) //druggy
|
||||
power = 2
|
||||
|
||||
/datum/symptom/dizzy/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel dizzy.", "Your head spins.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>A wave of dizziness washes over you!</span>")
|
||||
M.Dizzy(5)
|
||||
if(power >= 2)
|
||||
M.set_drugginess(5)
|
||||
@@ -1,60 +1,61 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Fever
|
||||
|
||||
No change to hidden.
|
||||
Increases resistance.
|
||||
Increases stage speed.
|
||||
Little transmittable.
|
||||
Low level.
|
||||
|
||||
Bonus
|
||||
Heats up your body.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/fever
|
||||
name = "Fever"
|
||||
desc = "The virus causes a febrile response from the host, raising its body temperature."
|
||||
stealth = 0
|
||||
resistance = 3
|
||||
stage_speed = 3
|
||||
transmittable = 2
|
||||
level = 2
|
||||
severity = 2
|
||||
base_message_chance = 20
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
var/unsafe = FALSE //over the heat threshold
|
||||
threshold_desc = "<b>Resistance 5:</b> Increases fever intensity, fever can overheat and harm the host.<br>\
|
||||
<b>Resistance 10:</b> Further increases fever intensity."
|
||||
|
||||
/datum/symptom/fever/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 5) //dangerous fever
|
||||
power = 1.5
|
||||
unsafe = TRUE
|
||||
if(A.properties["resistance"] >= 10)
|
||||
power = 2.5
|
||||
|
||||
/datum/symptom/fever/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(!unsafe || A.stage < 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel hot.", "You feel like you're burning.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>[pick("You feel too hot.", "You feel like your blood is boiling.")]</span>")
|
||||
if(M.bodytemperature < BODYTEMP_HEAT_DAMAGE_LIMIT || unsafe)
|
||||
Heat(M, A)
|
||||
|
||||
/datum/symptom/fever/proc/Heat(mob/living/M, datum/disease/advance/A)
|
||||
var/get_heat = 6 * power
|
||||
if(!unsafe)
|
||||
M.adjust_bodytemperature(get_heat * A.stage, 0, BODYTEMP_HEAT_DAMAGE_LIMIT - 1)
|
||||
else
|
||||
M.adjust_bodytemperature(get_heat * A.stage)
|
||||
return 1
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Fever
|
||||
|
||||
No change to hidden.
|
||||
Increases resistance.
|
||||
Increases stage speed.
|
||||
Little transmittable.
|
||||
Low level.
|
||||
|
||||
Bonus
|
||||
Heats up your body.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/fever
|
||||
name = "Fever"
|
||||
desc = "The virus causes a febrile response from the host, raising its body temperature."
|
||||
stealth = 0
|
||||
resistance = 3
|
||||
stage_speed = 3
|
||||
transmittable = 2
|
||||
level = 2
|
||||
severity = 2
|
||||
base_message_chance = 20
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
var/unsafe = FALSE //over the heat threshold
|
||||
threshold_desc = list(
|
||||
"Resistance 5" = "Increases fever intensity, fever can overheat and harm the host.",
|
||||
"Resistance 10" = "Further increases fever intensity.",
|
||||
)
|
||||
/datum/symptom/fever/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 5) //dangerous fever
|
||||
power = 1.5
|
||||
unsafe = TRUE
|
||||
if(A.properties["resistance"] >= 10)
|
||||
power = 2.5
|
||||
|
||||
/datum/symptom/fever/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(!unsafe || A.stage < 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel hot.", "You feel like you're burning.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>[pick("You feel too hot.", "You feel like your blood is boiling.")]</span>")
|
||||
if(M.bodytemperature < BODYTEMP_HEAT_DAMAGE_LIMIT || unsafe)
|
||||
Heat(M, A)
|
||||
|
||||
/datum/symptom/fever/proc/Heat(mob/living/M, datum/disease/advance/A)
|
||||
var/get_heat = 6 * power
|
||||
if(!unsafe)
|
||||
M.adjust_bodytemperature(get_heat * A.stage, 0, BODYTEMP_HEAT_DAMAGE_LIMIT - 1)
|
||||
else
|
||||
M.adjust_bodytemperature(get_heat * A.stage)
|
||||
return 1
|
||||
|
||||
@@ -29,11 +29,12 @@ Bonus
|
||||
symptom_delay_min = 20
|
||||
symptom_delay_max = 75
|
||||
var/infective = FALSE
|
||||
threshold_desc = "<b>Stage Speed 4:</b> Increases the intensity of the flames.<br>\
|
||||
<b>Stage Speed 8:</b> Further increases flame intensity.<br>\
|
||||
<b>Transmission 8:</b> Host will spread the virus through skin flakes when bursting into flame.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
threshold_desc = list(
|
||||
"Stage Speed 4" = "Increases the intensity of the flames.",
|
||||
"Stage Speed 8" = "Further increases flame intensity.",
|
||||
"Transmission 8" = "Host will spread the virus through skin flakes when bursting into flame.",
|
||||
"Stealth 4" = "The symptom remains hidden until active.",
|
||||
)
|
||||
/datum/symptom/fire/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
|
||||
@@ -1,130 +1,136 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Necrotizing Fasciitis (AKA Flesh-Eating Disease)
|
||||
|
||||
Very very noticable.
|
||||
Lowers resistance tremendously.
|
||||
No changes to stage speed.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Deals brute damage over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/flesh_eating
|
||||
|
||||
name = "Necrotizing Fasciitis"
|
||||
desc = "The virus aggressively attacks body cells, necrotizing tissues and organs."
|
||||
stealth = -3
|
||||
resistance = -4
|
||||
stage_speed = 0
|
||||
transmittable = -4
|
||||
level = 6
|
||||
severity = 5
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 60
|
||||
var/bleed = FALSE
|
||||
var/pain = FALSE
|
||||
threshold_desc = "<b>Resistance 7:</b> Host will bleed profusely during necrosis.<br>\
|
||||
<b>Transmission 8:</b> Causes extreme pain to the host, weakening it."
|
||||
|
||||
/datum/symptom/flesh_eating/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 7) //extra bleeding
|
||||
bleed = TRUE
|
||||
if(A.properties["transmittable"] >= 8) //extra stamina damage
|
||||
pain = TRUE
|
||||
|
||||
/datum/symptom/flesh_eating/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(2,3)
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='warning'>[pick("You feel a sudden pain across your body.", "Drops of blood appear suddenly on your skin.")]</span>")
|
||||
if(4,5)
|
||||
to_chat(M, "<span class='userdanger'>[pick("You cringe as a violent pain takes over your body.", "It feels like your body is eating itself inside out.", "IT HURTS.")]</span>")
|
||||
Flesheat(M, A)
|
||||
|
||||
/datum/symptom/flesh_eating/proc/Flesheat(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(15,25) * power
|
||||
M.adjustBruteLoss(get_damage)
|
||||
if(pain)
|
||||
M.adjustStaminaLoss(get_damage)
|
||||
if(bleed)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.bleed_rate += 5 * power
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Autophagocytosis (AKA Programmed mass cell death)
|
||||
|
||||
Very noticable.
|
||||
Lowers resistance.
|
||||
Fast stage speed.
|
||||
Decreases transmittablity.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Deals brute damage over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/flesh_death
|
||||
|
||||
name = "Autophagocytosis Necrosis"
|
||||
desc = "The virus rapidly consumes infected cells, leading to heavy and widespread damage."
|
||||
stealth = -2
|
||||
resistance = -2
|
||||
stage_speed = 1
|
||||
transmittable = -2
|
||||
level = 7
|
||||
severity = 6
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 3
|
||||
symptom_delay_max = 6
|
||||
var/chems = FALSE
|
||||
var/zombie = FALSE
|
||||
threshold_desc = "<b>Stage Speed 7:</b> Synthesizes Heparin and Lipolicide inside the host, causing increased bleeding and hunger.<br>\
|
||||
<b>Stealth 5:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/flesh_death/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 5)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["stage_rate"] >= 7) //bleeding and hunger
|
||||
chems = TRUE
|
||||
|
||||
/datum/symptom/flesh_death/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(2,3)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel your body break apart.", "Your skin rubs off like dust.")]</span>")
|
||||
if(4,5)
|
||||
if(prob(base_message_chance / 2)) //reduce spam
|
||||
to_chat(M, "<span class='userdanger'>[pick("You feel your muscles weakening.", "Some of your skin detaches itself.", "You feel sandy.")]</span>")
|
||||
Flesh_death(M, A)
|
||||
|
||||
/datum/symptom/flesh_death/proc/Flesh_death(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(6,10)
|
||||
M.adjustBruteLoss(get_damage)
|
||||
if(chems)
|
||||
M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2))
|
||||
if(zombie)
|
||||
M.reagents.add_reagent(/datum/reagent/romerol, 1)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Necrotizing Fasciitis (AKA Flesh-Eating Disease)
|
||||
|
||||
Very very noticable.
|
||||
Lowers resistance tremendously.
|
||||
No changes to stage speed.
|
||||
Decreases transmittablity temrendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Deals brute damage over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/flesh_eating
|
||||
|
||||
name = "Necrotizing Fasciitis"
|
||||
desc = "The virus aggressively attacks body cells, necrotizing tissues and organs."
|
||||
stealth = -3
|
||||
resistance = -4
|
||||
stage_speed = 0
|
||||
transmittable = -4
|
||||
level = 6
|
||||
severity = 5
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 60
|
||||
var/bleed = FALSE
|
||||
var/pain = FALSE
|
||||
threshold_desc = list(
|
||||
"Resistance 9" = "Doubles the intensity of the immolation effect, but reduces the frequency of all of this symptom's effects.",
|
||||
"Stage Speed 8" = "Increases explosion radius and explosion damage to the host when the host is wet.",
|
||||
"Transmission 8" = "Additionally synthesizes chlorine trifluoride and napalm inside the host. More chemicals are synthesized if the resistance 9 threshold has been met."
|
||||
)
|
||||
|
||||
/datum/symptom/flesh_eating/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 7) //extra bleeding
|
||||
bleed = TRUE
|
||||
if(A.properties["transmittable"] >= 8) //extra stamina damage
|
||||
pain = TRUE
|
||||
|
||||
/datum/symptom/flesh_eating/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(2,3)
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='warning'>[pick("You feel a sudden pain across your body.", "Drops of blood appear suddenly on your skin.")]</span>")
|
||||
if(4,5)
|
||||
to_chat(M, "<span class='userdanger'>[pick("You cringe as a violent pain takes over your body.", "It feels like your body is eating itself inside out.", "IT HURTS.")]</span>")
|
||||
Flesheat(M, A)
|
||||
|
||||
/datum/symptom/flesh_eating/proc/Flesheat(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(15,25) * power
|
||||
M.adjustBruteLoss(get_damage)
|
||||
if(pain)
|
||||
M.adjustStaminaLoss(get_damage)
|
||||
if(bleed)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.bleed_rate += 5 * power
|
||||
return 1
|
||||
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Autophagocytosis (AKA Programmed mass cell death)
|
||||
|
||||
Very noticable.
|
||||
Lowers resistance.
|
||||
Fast stage speed.
|
||||
Decreases transmittablity.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Deals brute damage over time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/flesh_death
|
||||
|
||||
name = "Autophagocytosis Necrosis"
|
||||
desc = "The virus rapidly consumes infected cells, leading to heavy and widespread damage."
|
||||
stealth = -2
|
||||
resistance = -2
|
||||
stage_speed = 1
|
||||
transmittable = -2
|
||||
level = 7
|
||||
severity = 6
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 3
|
||||
symptom_delay_max = 6
|
||||
var/chems = FALSE
|
||||
var/zombie = FALSE
|
||||
threshold_desc = list(
|
||||
"Stage Speed 7" = "Synthesizes Heparin and Lipolicide inside the host, causing increased bleeding and hunger.",
|
||||
"Stealth 5" = "The symptom remains hidden until active.",
|
||||
)
|
||||
|
||||
|
||||
/datum/symptom/flesh_death/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 5)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["stage_rate"] >= 7) //bleeding and hunger
|
||||
chems = TRUE
|
||||
|
||||
/datum/symptom/flesh_death/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(2,3)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel your body break apart.", "Your skin rubs off like dust.")]</span>")
|
||||
if(4,5)
|
||||
if(prob(base_message_chance / 2)) //reduce spam
|
||||
to_chat(M, "<span class='userdanger'>[pick("You feel your muscles weakening.", "Some of your skin detaches itself.", "You feel sandy.")]</span>")
|
||||
Flesh_death(M, A)
|
||||
|
||||
/datum/symptom/flesh_death/proc/Flesh_death(mob/living/M, datum/disease/advance/A)
|
||||
var/get_damage = rand(6,10)
|
||||
M.adjustBruteLoss(get_damage)
|
||||
if(chems)
|
||||
M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2))
|
||||
if(zombie)
|
||||
M.reagents.add_reagent(/datum/reagent/romerol, 1)
|
||||
return 1
|
||||
@@ -1,78 +1,81 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
DNA Saboteur
|
||||
|
||||
Very noticable.
|
||||
Lowers resistance tremendously.
|
||||
No changes to stage speed.
|
||||
Decreases transmittablity tremendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Cleans the DNA of a person and then randomly gives them a trait.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/genetic_mutation
|
||||
name = "Deoxyribonucleic Acid Saboteur"
|
||||
desc = "The virus bonds with the DNA of the host, causing damaging mutations until removed."
|
||||
stealth = -2
|
||||
resistance = -3
|
||||
stage_speed = 0
|
||||
transmittable = -3
|
||||
level = 6
|
||||
severity = 4
|
||||
var/list/possible_mutations
|
||||
var/archived_dna = null
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 60
|
||||
symptom_delay_max = 120
|
||||
var/no_reset = FALSE
|
||||
threshold_desc = "<b>Resistance 8:</b> Causes two harmful mutations at once.<br>\
|
||||
<b>Stage Speed 10:</b> Increases mutation frequency.<br>\
|
||||
<b>Stealth 5:</b> The mutations persist even if the virus is cured."
|
||||
|
||||
/datum/symptom/genetic_mutation/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/C = A.affected_mob
|
||||
if(!C.has_dna())
|
||||
return
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
to_chat(C, "<span class='warning'>[pick("Your skin feels itchy.", "You feel light headed.")]</span>")
|
||||
C.dna.remove_mutation_group(possible_mutations)
|
||||
for(var/i in 1 to power)
|
||||
C.randmut(possible_mutations)
|
||||
|
||||
// Archive their DNA before they were infected.
|
||||
/datum/symptom/genetic_mutation/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 5) //don't restore dna after curing
|
||||
no_reset = TRUE
|
||||
if(A.properties["stage_rate"] >= 10) //mutate more often
|
||||
symptom_delay_min = 20
|
||||
symptom_delay_max = 60
|
||||
if(A.properties["resistance"] >= 8) //mutate twice
|
||||
power = 2
|
||||
possible_mutations = (GLOB.bad_mutations | GLOB.not_good_mutations) - GLOB.mutations_list[RACEMUT]
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(M)
|
||||
if(!M.has_dna())
|
||||
return
|
||||
archived_dna = M.dna.struc_enzymes
|
||||
|
||||
// Give them back their old DNA when cured.
|
||||
/datum/symptom/genetic_mutation/End(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(!no_reset)
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(M && archived_dna)
|
||||
if(!M.has_dna())
|
||||
return
|
||||
M.dna.struc_enzymes = archived_dna
|
||||
M.domutcheck()
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
DNA Saboteur
|
||||
|
||||
Very noticable.
|
||||
Lowers resistance tremendously.
|
||||
No changes to stage speed.
|
||||
Decreases transmittablity tremendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Cleans the DNA of a person and then randomly gives them a trait.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/genetic_mutation
|
||||
name = "Deoxyribonucleic Acid Saboteur"
|
||||
desc = "The virus bonds with the DNA of the host, causing damaging mutations until removed."
|
||||
stealth = -2
|
||||
resistance = -3
|
||||
stage_speed = 0
|
||||
transmittable = -3
|
||||
level = 6
|
||||
severity = 4
|
||||
var/list/possible_mutations
|
||||
var/archived_dna = null
|
||||
base_message_chance = 50
|
||||
symptom_delay_min = 60
|
||||
symptom_delay_max = 120
|
||||
var/no_reset = FALSE
|
||||
threshold_desc = list(
|
||||
"Resistance 8" = "The negative and mildly negative mutations caused by the virus are mutadone-proof (but will still be undone when the virus is cured if the resistance 14 threshold is not met).",
|
||||
"Resistance 14" = "The host's genetic alterations are not undone when the virus is cured.",
|
||||
"Stage Speed 10" = "The virus activates dormant mutations at a much faster rate.",
|
||||
"Stealth 5" = "Only activates negative mutations in hosts."
|
||||
)
|
||||
|
||||
/datum/symptom/genetic_mutation/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/C = A.affected_mob
|
||||
if(!C.has_dna())
|
||||
return
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
to_chat(C, "<span class='warning'>[pick("Your skin feels itchy.", "You feel light headed.")]</span>")
|
||||
C.dna.remove_mutation_group(possible_mutations)
|
||||
for(var/i in 1 to power)
|
||||
C.randmut(possible_mutations)
|
||||
|
||||
// Archive their DNA before they were infected.
|
||||
/datum/symptom/genetic_mutation/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 5) //don't restore dna after curing
|
||||
no_reset = TRUE
|
||||
if(A.properties["stage_rate"] >= 10) //mutate more often
|
||||
symptom_delay_min = 20
|
||||
symptom_delay_max = 60
|
||||
if(A.properties["resistance"] >= 8) //mutate twice
|
||||
power = 2
|
||||
possible_mutations = (GLOB.bad_mutations | GLOB.not_good_mutations) - GLOB.mutations_list[RACEMUT]
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(M)
|
||||
if(!M.has_dna())
|
||||
return
|
||||
archived_dna = M.dna.struc_enzymes
|
||||
|
||||
// Give them back their old DNA when cured.
|
||||
/datum/symptom/genetic_mutation/End(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(!no_reset)
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(M && archived_dna)
|
||||
if(!M.has_dna())
|
||||
return
|
||||
M.dna.struc_enzymes = archived_dna
|
||||
M.domutcheck()
|
||||
|
||||
@@ -1,65 +1,67 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Hallucigen
|
||||
|
||||
Very noticable.
|
||||
Lowers resistance considerably.
|
||||
Decreases stage speed.
|
||||
Reduced transmittable.
|
||||
Critical Level.
|
||||
|
||||
Bonus
|
||||
Makes the affected mob be hallucinated for short periods of time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/hallucigen
|
||||
name = "Hallucigen"
|
||||
desc = "The virus stimulates the brain, causing occasional hallucinations."
|
||||
stealth = -2
|
||||
resistance = -3
|
||||
stage_speed = -3
|
||||
transmittable = -1
|
||||
level = 5
|
||||
severity = 2
|
||||
base_message_chance = 25
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 90
|
||||
var/fake_healthy = FALSE
|
||||
threshold_desc = "<b>Stage Speed 7:</b> Increases the amount of hallucinations.<br>\
|
||||
<b>Stealth 4:</b> The virus mimics positive symptoms.."
|
||||
|
||||
/datum/symptom/hallucigen/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4) //fake good symptom messages
|
||||
fake_healthy = TRUE
|
||||
base_message_chance = 50
|
||||
if(A.properties["stage_rate"] >= 7) //stronger hallucinations
|
||||
power = 2
|
||||
|
||||
/datum/symptom/hallucigen/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
var/list/healthy_messages = list("Your lungs feel great.", "You realize you haven't been breathing.", "You don't feel the need to breathe.",\
|
||||
"Your eyes feel great.", "You are now blinking manually.", "You don't feel the need to blink.")
|
||||
switch(A.stage)
|
||||
if(1, 2)
|
||||
if(prob(base_message_chance))
|
||||
if(!fake_healthy)
|
||||
to_chat(M, "<span class='notice'>[pick("Something appears in your peripheral vision, then winks out.", "You hear a faint whisper with no source.", "Your head aches.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='notice'>[pick(healthy_messages)]</span>")
|
||||
if(3, 4)
|
||||
if(prob(base_message_chance))
|
||||
if(!fake_healthy)
|
||||
to_chat(M, "<span class='danger'>[pick("Something is following you.", "You are being watched.", "You hear a whisper in your ear.", "Thumping footsteps slam toward you from nowhere.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='notice'>[pick(healthy_messages)]</span>")
|
||||
else
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='userdanger'>[pick("Oh, your head...", "Your head pounds.", "They're everywhere! Run!", "Something in the shadows...")]</span>")
|
||||
M.hallucination += (45 * power)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Hallucigen
|
||||
|
||||
Very noticable.
|
||||
Lowers resistance considerably.
|
||||
Decreases stage speed.
|
||||
Reduced transmittable.
|
||||
Critical Level.
|
||||
|
||||
Bonus
|
||||
Makes the affected mob be hallucinated for short periods of time.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/hallucigen
|
||||
name = "Hallucigen"
|
||||
desc = "The virus stimulates the brain, causing occasional hallucinations."
|
||||
stealth = -2
|
||||
resistance = -3
|
||||
stage_speed = -3
|
||||
transmittable = -1
|
||||
level = 5
|
||||
severity = 2
|
||||
base_message_chance = 25
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 90
|
||||
var/fake_healthy = FALSE
|
||||
threshold_desc = list(
|
||||
"Stage Speed 7" = "Increases the amount of hallucinations.",
|
||||
"Stealth 4" = "The virus mimics positive symptoms.",
|
||||
)
|
||||
|
||||
/datum/symptom/hallucigen/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4) //fake good symptom messages
|
||||
fake_healthy = TRUE
|
||||
base_message_chance = 50
|
||||
if(A.properties["stage_rate"] >= 7) //stronger hallucinations
|
||||
power = 2
|
||||
|
||||
/datum/symptom/hallucigen/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
var/list/healthy_messages = list("Your lungs feel great.", "You realize you haven't been breathing.", "You don't feel the need to breathe.",\
|
||||
"Your eyes feel great.", "You are now blinking manually.", "You don't feel the need to blink.")
|
||||
switch(A.stage)
|
||||
if(1, 2)
|
||||
if(prob(base_message_chance))
|
||||
if(!fake_healthy)
|
||||
to_chat(M, "<span class='notice'>[pick("Something appears in your peripheral vision, then winks out.", "You hear a faint whisper with no source.", "Your head aches.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='notice'>[pick(healthy_messages)]</span>")
|
||||
if(3, 4)
|
||||
if(prob(base_message_chance))
|
||||
if(!fake_healthy)
|
||||
to_chat(M, "<span class='danger'>[pick("Something is following you.", "You are being watched.", "You hear a whisper in your ear.", "Thumping footsteps slam toward you from nowhere.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='notice'>[pick(healthy_messages)]</span>")
|
||||
else
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='userdanger'>[pick("Oh, your head...", "Your head pounds.", "They're everywhere! Run!", "Something in the shadows...")]</span>")
|
||||
M.hallucination += (45 * power)
|
||||
|
||||
@@ -1,60 +1,62 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Headache
|
||||
|
||||
Noticable.
|
||||
Highly resistant.
|
||||
Increases stage speed.
|
||||
Not transmittable.
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Displays an annoying message!
|
||||
Should be used for buffing your disease.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/headache
|
||||
|
||||
name = "Headache"
|
||||
desc = "The virus causes inflammation inside the brain, causing constant headaches."
|
||||
stealth = -1
|
||||
resistance = 4
|
||||
stage_speed = 2
|
||||
transmittable = 0
|
||||
level = 1
|
||||
severity = 1
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 30
|
||||
threshold_desc = "<b>Stage Speed 6:</b> Headaches will cause severe pain, that weakens the host.<br>\
|
||||
<b>Stage Speed 9:</b> Headaches become less frequent but far more intense, preventing any action from the host.<br>\
|
||||
<b>Stealth 4:</b> Reduces headache frequency until later stages."
|
||||
|
||||
/datum/symptom/headache/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
base_message_chance = 50
|
||||
if(A.properties["stage_rate"] >= 6) //severe pain
|
||||
power = 2
|
||||
if(A.properties["stage_rate"] >= 9) //cluster headaches
|
||||
symptom_delay_min = 30
|
||||
symptom_delay_max = 60
|
||||
power = 3
|
||||
|
||||
/datum/symptom/headache/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(power < 2)
|
||||
if(prob(base_message_chance) || A.stage >=4)
|
||||
to_chat(M, "<span class='warning'>[pick("Your head hurts.", "Your head pounds.")]</span>")
|
||||
if(power >= 2 && A.stage >= 4)
|
||||
to_chat(M, "<span class='warning'>[pick("Your head hurts a lot.", "Your head pounds incessantly.")]</span>")
|
||||
M.adjustStaminaLoss(25)
|
||||
if(power >= 3 && A.stage >= 5)
|
||||
to_chat(M, "<span class='userdanger'>[pick("Your head hurts!", "You feel a burning knife inside your brain!", "A wave of pain fills your head!")]</span>")
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Headache
|
||||
|
||||
Noticable.
|
||||
Highly resistant.
|
||||
Increases stage speed.
|
||||
Not transmittable.
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Displays an annoying message!
|
||||
Should be used for buffing your disease.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/headache
|
||||
|
||||
name = "Headache"
|
||||
desc = "The virus causes inflammation inside the brain, causing constant headaches."
|
||||
stealth = -1
|
||||
resistance = 4
|
||||
stage_speed = 2
|
||||
transmittable = 0
|
||||
level = 1
|
||||
severity = 1
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 30
|
||||
threshold_desc = list(
|
||||
"Stage Speed 6" = "Headaches will cause severe pain, that weakens the host.",
|
||||
"Stage Speed 9" = "Headaches become less frequent but far more intense, preventing any action from the host.",
|
||||
"Stealth 4" = "Reduces headache frequency until later stages.",
|
||||
)
|
||||
|
||||
/datum/symptom/headache/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
base_message_chance = 50
|
||||
if(A.properties["stage_rate"] >= 6) //severe pain
|
||||
power = 2
|
||||
if(A.properties["stage_rate"] >= 9) //cluster headaches
|
||||
symptom_delay_min = 30
|
||||
symptom_delay_max = 60
|
||||
power = 3
|
||||
|
||||
/datum/symptom/headache/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(power < 2)
|
||||
if(prob(base_message_chance) || A.stage >=4)
|
||||
to_chat(M, "<span class='warning'>[pick("Your head hurts.", "Your head pounds.")]</span>")
|
||||
if(power >= 2 && A.stage >= 4)
|
||||
to_chat(M, "<span class='warning'>[pick("Your head hurts a lot.", "Your head pounds incessantly.")]</span>")
|
||||
M.adjustStaminaLoss(25)
|
||||
if(power >= 3 && A.stage >= 5)
|
||||
to_chat(M, "<span class='userdanger'>[pick("Your head hurts!", "You feel a burning knife inside your brain!", "A wave of pain fills your head!")]</span>")
|
||||
M.Stun(35)
|
||||
@@ -1,485 +1,497 @@
|
||||
/datum/symptom/heal
|
||||
name = "Basic Healing (does nothing)" //warning for adminspawn viruses
|
||||
desc = "You should not be seeing this."
|
||||
stealth = 0
|
||||
resistance = 0
|
||||
stage_speed = 0
|
||||
transmittable = 0
|
||||
level = 0 //not obtainable
|
||||
base_message_chance = 20 //here used for the overlays
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
var/passive_message = "" //random message to infected but not actively healing people
|
||||
threshold_desc = "<b>Stage Speed 6:</b> Doubles healing speed.<br>\
|
||||
<b>Stealth 4:</b> Healing will no longer be visible to onlookers."
|
||||
|
||||
/datum/symptom/heal/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 6) //stronger healing
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
var/effectiveness = CanHeal(A)
|
||||
if(!effectiveness)
|
||||
if(passive_message && prob(2) && passive_message_condition(M))
|
||||
to_chat(M, passive_message)
|
||||
return
|
||||
else
|
||||
Heal(M, A, effectiveness)
|
||||
return
|
||||
|
||||
/datum/symptom/heal/proc/CanHeal(datum/disease/advance/A)
|
||||
return power
|
||||
|
||||
/datum/symptom/heal/proc/Heal(mob/living/M, datum/disease/advance/A, actual_power)
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/proc/passive_message_condition(mob/living/M)
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/symptom/heal/starlight
|
||||
name = "Starlight Condensation"
|
||||
desc = "The virus reacts to direct starlight, producing regenerative chemicals. Works best against toxin-based damage."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 6
|
||||
passive_message = "<span class='notice'>You miss the feeling of starlight on your skin.</span>"
|
||||
var/nearspace_penalty = 0.3
|
||||
threshold_desc = "<b>Stage Speed 6:</b> Increases healing speed.<br>\
|
||||
<b>Transmission 6:</b> Removes penalty for only being close to space."
|
||||
|
||||
/datum/symptom/heal/starlight/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
nearspace_penalty = 1
|
||||
if(A.properties["stage_rate"] >= 6)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/starlight/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(istype(get_turf(M), /turf/open/space))
|
||||
return power
|
||||
else
|
||||
for(var/turf/T in view(M, 2))
|
||||
if(istype(T, /turf/open/space))
|
||||
return power * nearspace_penalty
|
||||
|
||||
/datum/symptom/heal/starlight/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = actual_power
|
||||
if(M.getToxLoss() && prob(5))
|
||||
to_chat(M, "<span class='notice'>Your skin tingles as the starlight seems to heal you.</span>")
|
||||
|
||||
M.adjustToxLoss(-(4 * heal_amt), forced = TRUE) //most effective on toxins
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/starlight/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss() || M.getToxLoss())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/chem
|
||||
name = "Toxolysis"
|
||||
stealth = 0
|
||||
resistance = -2
|
||||
stage_speed = 2
|
||||
transmittable = -2
|
||||
level = 7
|
||||
var/food_conversion = FALSE
|
||||
desc = "The virus rapidly breaks down any foreign chemicals in the bloodstream."
|
||||
threshold_desc = "<b>Resistance 7:</b> Increases chem removal speed.<br>\
|
||||
<b>Stage Speed 6:</b> Consumed chemicals nourish the host."
|
||||
|
||||
/datum/symptom/heal/chem/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 6)
|
||||
food_conversion = TRUE
|
||||
if(A.properties["resistance"] >= 7)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/chem/Heal(mob/living/M, datum/disease/advance/A, actual_power)
|
||||
for(var/E in M.reagents.reagent_list) //Not just toxins!
|
||||
var/datum/reagent/R = E
|
||||
M.reagents.remove_reagent(R.type, actual_power)
|
||||
if(food_conversion)
|
||||
M.nutrition += 0.3
|
||||
if(prob(2))
|
||||
to_chat(M, "<span class='notice'>You feel a mild warmth as your blood purifies itself.</span>")
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/symptom/heal/metabolism
|
||||
name = "Metabolic Boost"
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = 2
|
||||
transmittable = 1
|
||||
level = 7
|
||||
var/triple_metabolism = FALSE
|
||||
var/reduced_hunger = FALSE
|
||||
desc = "The virus causes the host's metabolism to accelerate rapidly, making them process chemicals twice as fast,\
|
||||
but also causing increased hunger."
|
||||
threshold_desc = "<b>Stealth 3:</b> Reduces hunger rate.<br>\
|
||||
<b>Stage Speed 10:</b> Chemical metabolization is tripled instead of doubled."
|
||||
|
||||
/datum/symptom/heal/metabolism/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 10)
|
||||
triple_metabolism = TRUE
|
||||
if(A.properties["stealth"] >= 3)
|
||||
reduced_hunger = TRUE
|
||||
|
||||
/datum/symptom/heal/metabolism/Heal(mob/living/carbon/C, datum/disease/advance/A, actual_power)
|
||||
if(!istype(C))
|
||||
return
|
||||
C.reagents.metabolize(C, can_overdose=TRUE) //this works even without a liver; it's intentional since the virus is metabolizing by itself
|
||||
if(triple_metabolism)
|
||||
C.reagents.metabolize(C, can_overdose=TRUE)
|
||||
C.overeatduration = max(C.overeatduration - 2, 0)
|
||||
var/lost_nutrition = 9 - (reduced_hunger * 5)
|
||||
C.nutrition = max(C.nutrition - (lost_nutrition * HUNGER_FACTOR), 0) //Hunger depletes at 10x the normal speed
|
||||
if(prob(2))
|
||||
to_chat(C, "<span class='notice'>You feel an odd gurgle in your stomach, as if it was working much faster than normal.</span>")
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/darkness
|
||||
name = "Nocturnal Regeneration"
|
||||
desc = "The virus is able to mend the host's flesh when in conditions of low light, repairing physical damage. More effective against brute damage."
|
||||
stealth = 2
|
||||
resistance = -1
|
||||
stage_speed = -2
|
||||
transmittable = -1
|
||||
level = 6
|
||||
passive_message = "<span class='notice'>You feel tingling on your skin as light passes over it.</span>"
|
||||
threshold_desc = "<b>Stage Speed 8:</b> Doubles healing speed."
|
||||
|
||||
/datum/symptom/heal/darkness/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 8)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/darkness/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/light_amount = 0
|
||||
if(isturf(M.loc)) //else, there's considered to be no light
|
||||
var/turf/T = M.loc
|
||||
light_amount = min(1,T.get_lumcount()) - 0.5
|
||||
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
|
||||
return power
|
||||
|
||||
/datum/symptom/heal/darkness/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 2 * actual_power
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>The darkness soothes and mends your wounds.</span>")
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len * 0.5)) //more effective on brute
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/darkness/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/coma
|
||||
name = "Regenerative Coma"
|
||||
desc = "The virus causes the host to fall into a death-like coma when severely damaged, then rapidly fixes the damage."
|
||||
stealth = 0
|
||||
resistance = 2
|
||||
stage_speed = -3
|
||||
transmittable = -2
|
||||
level = 8
|
||||
passive_message = "<span class='notice'>The pain from your wounds makes you feel oddly sleepy...</span>"
|
||||
var/deathgasp = FALSE
|
||||
var/stabilize = FALSE
|
||||
var/active_coma = FALSE //to prevent multiple coma procs
|
||||
threshold_desc = "<b>Stealth 2:</b> Host appears to die when falling into a coma.<br>\
|
||||
<b>Resistance 4:</b> The virus also stabilizes the host while they are in critical condition.<br>\
|
||||
<b>Stage Speed 7:</b> Increases healing speed."
|
||||
|
||||
/datum/symptom/heal/coma/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 7)
|
||||
power = 1.5
|
||||
if(A.properties["resistance"] >= 4)
|
||||
stabilize = TRUE
|
||||
if(A.properties["stealth"] >= 2)
|
||||
deathgasp = TRUE
|
||||
|
||||
/datum/symptom/heal/coma/on_stage_change(datum/disease/advance/A) //mostly copy+pasted from the code for self-respiration's TRAIT_NOBREATH stuff
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(A.stage >= 4 && stabilize)
|
||||
ADD_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
|
||||
else
|
||||
REMOVE_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/coma/End(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
REMOVE_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
|
||||
|
||||
/datum/symptom/heal/coma/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(HAS_TRAIT(M, TRAIT_DEATHCOMA))
|
||||
return power
|
||||
else if(M.IsUnconscious() || M.stat == UNCONSCIOUS)
|
||||
return power * 0.9
|
||||
else if(M.stat == SOFT_CRIT)
|
||||
return power * 0.5
|
||||
else if(M.IsSleeping())
|
||||
return power * 0.25
|
||||
else if(M.getBruteLoss() + M.getFireLoss() >= 70 && !active_coma)
|
||||
to_chat(M, "<span class='warning'>You feel yourself slip into a regenerative coma...</span>")
|
||||
active_coma = TRUE
|
||||
addtimer(CALLBACK(src, .proc/coma, M), 60)
|
||||
|
||||
/datum/symptom/heal/coma/proc/coma(mob/living/M)
|
||||
if(deathgasp)
|
||||
M.emote("deathgasp")
|
||||
M.fakedeath("regenerative_coma")
|
||||
M.update_stat()
|
||||
M.update_canmove()
|
||||
addtimer(CALLBACK(src, .proc/uncoma, M), 300)
|
||||
|
||||
/datum/symptom/heal/coma/proc/uncoma(mob/living/M)
|
||||
if(!active_coma)
|
||||
return
|
||||
active_coma = FALSE
|
||||
M.cure_fakedeath("regenerative_coma")
|
||||
M.update_stat()
|
||||
M.update_canmove()
|
||||
|
||||
/datum/symptom/heal/coma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 4 * actual_power
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(active_coma && M.getBruteLoss() + M.getFireLoss() == 0)
|
||||
uncoma(M)
|
||||
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/coma/passive_message_condition(mob/living/M)
|
||||
if((M.getBruteLoss() + M.getFireLoss()) > 30)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/water
|
||||
name = "Tissue Hydration"
|
||||
desc = "The virus uses excess water inside and outside the body to repair damaged tissue cells. More effective against burns."
|
||||
stealth = 0
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 6
|
||||
passive_message = "<span class='notice'>Your skin feels oddly dry...</span>"
|
||||
var/absorption_coeff = 1
|
||||
threshold_desc = "<b>Resistance 5:</b> Water is consumed at a much slower rate.<br>\
|
||||
<b>Stage Speed 7:</b> Increases healing speed."
|
||||
|
||||
/datum/symptom/heal/water/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 7)
|
||||
power = 2
|
||||
if(A.properties["stealth"] >= 2)
|
||||
absorption_coeff = 0.25
|
||||
|
||||
/datum/symptom/heal/water/CanHeal(datum/disease/advance/A)
|
||||
. = 0
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(M.fire_stacks < 0)
|
||||
M.fire_stacks = min(M.fire_stacks + 1 * absorption_coeff, 0)
|
||||
. += power
|
||||
if(M.reagents.has_reagent(/datum/reagent/water/holywater))
|
||||
M.reagents.remove_reagent(/datum/reagent/water/holywater, 0.5 * absorption_coeff)
|
||||
. += power * 0.75
|
||||
else if(M.reagents.has_reagent(/datum/reagent/water))
|
||||
M.reagents.remove_reagent(/datum/reagent/water, 0.5 * absorption_coeff)
|
||||
. += power * 0.5
|
||||
|
||||
/datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 2 * actual_power
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //more effective on burns
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel yourself absorbing the water around you to soothe your damaged skin.</span>")
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len * 0.5, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/water/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/plasma
|
||||
name = "Plasma Fixation"
|
||||
desc = "The virus draws plasma from the atmosphere and from inside the body to heal and stabilize body temperature."
|
||||
stealth = 0
|
||||
resistance = 3
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
passive_message = "<span class='notice'>You feel an odd attraction to plasma.</span>"
|
||||
var/temp_rate = 1
|
||||
threshold_desc = "<b>Transmission 6:</b> Increases temperature adjustment rate and heals toxin lovers.<br>\
|
||||
<b>Stage Speed 7:</b> Increases healing speed."
|
||||
|
||||
/datum/symptom/heal/plasma/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 7)
|
||||
power = 2
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
temp_rate = 4
|
||||
|
||||
/datum/symptom/heal/plasma/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/datum/gas_mixture/environment
|
||||
var/plasmamount
|
||||
|
||||
. = 0
|
||||
|
||||
if(M.loc)
|
||||
environment = M.loc.return_air()
|
||||
if(environment)
|
||||
plasmamount = environment.gases[/datum/gas/plasma]
|
||||
if(plasmamount && plasmamount > GLOB.meta_gas_visibility[/datum/gas/plasma]) //if there's enough plasma in the air to see
|
||||
. += power * 0.5
|
||||
if(M.reagents.has_reagent(/datum/reagent/toxin/plasma))
|
||||
. += power * 0.75
|
||||
|
||||
/datum/symptom/heal/plasma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 4 * actual_power
|
||||
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel yourself absorbing plasma inside and around you...</span>")
|
||||
|
||||
if(M.bodytemperature > BODYTEMP_NORMAL)
|
||||
M.adjust_bodytemperature(-20 * temp_rate * TEMPERATURE_DAMAGE_COEFFICIENT,BODYTEMP_NORMAL)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel less hot.</span>")
|
||||
else if(M.bodytemperature < (BODYTEMP_NORMAL + 1))
|
||||
M.adjust_bodytemperature(20 * temp_rate * TEMPERATURE_DAMAGE_COEFFICIENT,0,BODYTEMP_NORMAL)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel warmer.</span>")
|
||||
|
||||
M.adjustToxLoss(-heal_amt, forced = (temp_rate == 4))
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
if(!parts.len)
|
||||
return
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>The pain from your wounds fades rapidly.</span>")
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
|
||||
|
||||
/datum/symptom/heal/radiation
|
||||
name = "Radioactive Resonance"
|
||||
desc = "The virus uses radiation to fix damage through dna mutations."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = 2
|
||||
transmittable = -3
|
||||
level = 6
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
passive_message = "<span class='notice'>Your skin glows faintly for a moment.</span>"
|
||||
var/cellular_damage = FALSE
|
||||
threshold_desc = "<b>Transmission 6:</b> Additionally heals cellular damage and toxin lovers.<br>\
|
||||
<b>Resistance 7:</b> Increases healing speed."
|
||||
|
||||
/datum/symptom/heal/radiation/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 7)
|
||||
power = 2
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
cellular_damage = TRUE
|
||||
|
||||
/datum/symptom/heal/radiation/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(M.radiation)
|
||||
if(0)
|
||||
return FALSE
|
||||
if(1 to RAD_MOB_SAFE)
|
||||
return 0.25
|
||||
if(RAD_MOB_SAFE to RAD_BURN_THRESHOLD)
|
||||
return 0.5
|
||||
if(RAD_BURN_THRESHOLD to RAD_MOB_MUTATE)
|
||||
return 0.75
|
||||
if(RAD_MOB_MUTATE to RAD_MOB_KNOCKDOWN)
|
||||
return 1
|
||||
else
|
||||
return 1.5
|
||||
|
||||
/datum/symptom/heal/radiation/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = actual_power
|
||||
|
||||
if(cellular_damage)
|
||||
M.adjustCloneLoss(-heal_amt * 0.5)
|
||||
|
||||
M.adjustToxLoss(-(2 * heal_amt), forced = cellular_damage)
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
if(prob(4))
|
||||
to_chat(M, "<span class='notice'>Your skin glows faintly, and you feel your wounds mending themselves.</span>")
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
/datum/symptom/heal
|
||||
name = "Basic Healing (does nothing)" //warning for adminspawn viruses
|
||||
desc = "You should not be seeing this."
|
||||
stealth = 0
|
||||
resistance = 0
|
||||
stage_speed = 0
|
||||
transmittable = 0
|
||||
level = 0 //not obtainable
|
||||
base_message_chance = 20 //here used for the overlays
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
var/passive_message = "" //random message to infected but not actively healing people
|
||||
threshold_desc = list(
|
||||
"Stage Speed 6" = "Doubles healing speed.",
|
||||
"Stealth 4" = "Healing will no longer be visible to onlookers.",
|
||||
)
|
||||
/datum/symptom/heal/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 6) //stronger healing
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
var/effectiveness = CanHeal(A)
|
||||
if(!effectiveness)
|
||||
if(passive_message && prob(2) && passive_message_condition(M))
|
||||
to_chat(M, passive_message)
|
||||
return
|
||||
else
|
||||
Heal(M, A, effectiveness)
|
||||
return
|
||||
|
||||
/datum/symptom/heal/proc/CanHeal(datum/disease/advance/A)
|
||||
return power
|
||||
|
||||
/datum/symptom/heal/proc/Heal(mob/living/M, datum/disease/advance/A, actual_power)
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/proc/passive_message_condition(mob/living/M)
|
||||
return TRUE
|
||||
|
||||
|
||||
/datum/symptom/heal/starlight
|
||||
name = "Starlight Condensation"
|
||||
desc = "The virus reacts to direct starlight, producing regenerative chemicals. Works best against toxin-based damage."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 6
|
||||
passive_message = "<span class='notice'>You miss the feeling of starlight on your skin.</span>"
|
||||
var/nearspace_penalty = 0.3
|
||||
threshold_desc = list(
|
||||
"Stage Speed 6" = "Increases healing speed.",
|
||||
"Transmission 6" = "Removes penalty for only being close to space.",
|
||||
)
|
||||
|
||||
/datum/symptom/heal/starlight/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
nearspace_penalty = 1
|
||||
if(A.properties["stage_rate"] >= 6)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/starlight/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(istype(get_turf(M), /turf/open/space))
|
||||
return power
|
||||
else
|
||||
for(var/turf/T in view(M, 2))
|
||||
if(istype(T, /turf/open/space))
|
||||
return power * nearspace_penalty
|
||||
|
||||
/datum/symptom/heal/starlight/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = actual_power
|
||||
if(M.getToxLoss() && prob(5))
|
||||
to_chat(M, "<span class='notice'>Your skin tingles as the starlight seems to heal you.</span>")
|
||||
|
||||
M.adjustToxLoss(-(4 * heal_amt), forced = TRUE) //most effective on toxins
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/starlight/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss() || M.getToxLoss())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/chem
|
||||
name = "Toxolysis"
|
||||
stealth = 0
|
||||
resistance = -2
|
||||
stage_speed = 2
|
||||
transmittable = -2
|
||||
level = 7
|
||||
var/food_conversion = FALSE
|
||||
desc = "The virus rapidly breaks down any foreign chemicals in the bloodstream."
|
||||
threshold_desc = list(
|
||||
"Resistance 7" = "Increases chem removal speed.",
|
||||
"Stage Speed 6" = "Consumed chemicals nourish the host.",
|
||||
)
|
||||
|
||||
/datum/symptom/heal/chem/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 6)
|
||||
food_conversion = TRUE
|
||||
if(A.properties["resistance"] >= 7)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/chem/Heal(mob/living/M, datum/disease/advance/A, actual_power)
|
||||
for(var/E in M.reagents.reagent_list) //Not just toxins!
|
||||
var/datum/reagent/R = E
|
||||
M.reagents.remove_reagent(R.type, actual_power)
|
||||
if(food_conversion)
|
||||
M.nutrition += 0.3
|
||||
if(prob(2))
|
||||
to_chat(M, "<span class='notice'>You feel a mild warmth as your blood purifies itself.</span>")
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/symptom/heal/metabolism
|
||||
name = "Metabolic Boost"
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = 2
|
||||
transmittable = 1
|
||||
level = 7
|
||||
var/triple_metabolism = FALSE
|
||||
var/reduced_hunger = FALSE
|
||||
desc = "The virus causes the host's metabolism to accelerate rapidly, making them process chemicals twice as fast,\
|
||||
but also causing increased hunger."
|
||||
threshold_desc = list(
|
||||
"Stealth 3" = "Reduces hunger rate.",
|
||||
"Stage Speed 10" = "Chemical metabolization is tripled instead of doubled.",
|
||||
)
|
||||
/datum/symptom/heal/metabolism/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 10)
|
||||
triple_metabolism = TRUE
|
||||
if(A.properties["stealth"] >= 3)
|
||||
reduced_hunger = TRUE
|
||||
|
||||
/datum/symptom/heal/metabolism/Heal(mob/living/carbon/C, datum/disease/advance/A, actual_power)
|
||||
if(!istype(C))
|
||||
return
|
||||
C.reagents.metabolize(C, can_overdose=TRUE) //this works even without a liver; it's intentional since the virus is metabolizing by itself
|
||||
if(triple_metabolism)
|
||||
C.reagents.metabolize(C, can_overdose=TRUE)
|
||||
C.overeatduration = max(C.overeatduration - 2, 0)
|
||||
var/lost_nutrition = 9 - (reduced_hunger * 5)
|
||||
C.nutrition = max(C.nutrition - (lost_nutrition * HUNGER_FACTOR), 0) //Hunger depletes at 10x the normal speed
|
||||
if(prob(2))
|
||||
to_chat(C, "<span class='notice'>You feel an odd gurgle in your stomach, as if it was working much faster than normal.</span>")
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/darkness
|
||||
name = "Nocturnal Regeneration"
|
||||
desc = "The virus is able to mend the host's flesh when in conditions of low light, repairing physical damage. More effective against brute damage."
|
||||
stealth = 2
|
||||
resistance = -1
|
||||
stage_speed = -2
|
||||
transmittable = -1
|
||||
level = 6
|
||||
passive_message = "<span class='notice'>You feel tingling on your skin as light passes over it.</span>"
|
||||
threshold_desc = list(
|
||||
"Stage Speed 8" = "Doubles healing speed.",
|
||||
)
|
||||
/datum/symptom/heal/darkness/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 8)
|
||||
power = 2
|
||||
|
||||
/datum/symptom/heal/darkness/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/light_amount = 0
|
||||
if(isturf(M.loc)) //else, there's considered to be no light
|
||||
var/turf/T = M.loc
|
||||
light_amount = min(1,T.get_lumcount()) - 0.5
|
||||
if(light_amount < SHADOW_SPECIES_LIGHT_THRESHOLD)
|
||||
return power
|
||||
|
||||
/datum/symptom/heal/darkness/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 2 * actual_power
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>The darkness soothes and mends your wounds.</span>")
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len * 0.5)) //more effective on brute
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/darkness/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/coma
|
||||
name = "Regenerative Coma"
|
||||
desc = "The virus causes the host to fall into a death-like coma when severely damaged, then rapidly fixes the damage."
|
||||
stealth = 0
|
||||
resistance = 2
|
||||
stage_speed = -3
|
||||
transmittable = -2
|
||||
level = 8
|
||||
passive_message = "<span class='notice'>The pain from your wounds makes you feel oddly sleepy...</span>"
|
||||
var/deathgasp = FALSE
|
||||
var/stabilize = FALSE
|
||||
var/active_coma = FALSE //to prevent multiple coma procs
|
||||
threshold_desc = list(
|
||||
"Stealth 2" = "Host appears to die when falling into a coma.",
|
||||
"Resistance 4" = "The virus also stabilizes the host while they are in critical condition.",
|
||||
"Stage Speed 7" = "Increases healing speed.",
|
||||
)
|
||||
|
||||
/datum/symptom/heal/coma/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 7)
|
||||
power = 1.5
|
||||
if(A.properties["resistance"] >= 4)
|
||||
stabilize = TRUE
|
||||
if(A.properties["stealth"] >= 2)
|
||||
deathgasp = TRUE
|
||||
|
||||
/datum/symptom/heal/coma/on_stage_change(datum/disease/advance/A) //mostly copy+pasted from the code for self-respiration's TRAIT_NOBREATH stuff
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(A.stage >= 4 && stabilize)
|
||||
ADD_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
|
||||
else
|
||||
REMOVE_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/heal/coma/End(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
REMOVE_TRAIT(A.affected_mob, TRAIT_NOCRITDAMAGE, DISEASE_TRAIT)
|
||||
|
||||
/datum/symptom/heal/coma/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(HAS_TRAIT(M, TRAIT_DEATHCOMA))
|
||||
return power
|
||||
else if(M.IsUnconscious() || M.stat == UNCONSCIOUS)
|
||||
return power * 0.9
|
||||
else if(M.stat == SOFT_CRIT)
|
||||
return power * 0.5
|
||||
else if(M.IsSleeping())
|
||||
return power * 0.25
|
||||
else if(M.getBruteLoss() + M.getFireLoss() >= 70 && !active_coma)
|
||||
to_chat(M, "<span class='warning'>You feel yourself slip into a regenerative coma...</span>")
|
||||
active_coma = TRUE
|
||||
addtimer(CALLBACK(src, .proc/coma, M), 60)
|
||||
|
||||
/datum/symptom/heal/coma/proc/coma(mob/living/M)
|
||||
if(deathgasp)
|
||||
M.emote("deathgasp")
|
||||
M.fakedeath("regenerative_coma")
|
||||
M.update_stat()
|
||||
M.update_canmove()
|
||||
addtimer(CALLBACK(src, .proc/uncoma, M), 300)
|
||||
|
||||
/datum/symptom/heal/coma/proc/uncoma(mob/living/M)
|
||||
if(!active_coma)
|
||||
return
|
||||
active_coma = FALSE
|
||||
M.cure_fakedeath("regenerative_coma")
|
||||
M.update_stat()
|
||||
M.update_canmove()
|
||||
|
||||
/datum/symptom/heal/coma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 4 * actual_power
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
if(active_coma && M.getBruteLoss() + M.getFireLoss() == 0)
|
||||
uncoma(M)
|
||||
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/coma/passive_message_condition(mob/living/M)
|
||||
if((M.getBruteLoss() + M.getFireLoss()) > 30)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/water
|
||||
name = "Tissue Hydration"
|
||||
desc = "The virus uses excess water inside and outside the body to repair damaged tissue cells. More effective against burns."
|
||||
stealth = 0
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 6
|
||||
passive_message = "<span class='notice'>Your skin feels oddly dry...</span>"
|
||||
var/absorption_coeff = 1
|
||||
threshold_desc = list(
|
||||
"Resistance 5" = "Water is consumed at a much slower rate.",
|
||||
"Stage Speed 7" = "Increases healing speed.",
|
||||
)
|
||||
|
||||
/datum/symptom/heal/water/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 7)
|
||||
power = 2
|
||||
if(A.properties["stealth"] >= 2)
|
||||
absorption_coeff = 0.25
|
||||
|
||||
/datum/symptom/heal/water/CanHeal(datum/disease/advance/A)
|
||||
. = 0
|
||||
var/mob/living/M = A.affected_mob
|
||||
if(M.fire_stacks < 0)
|
||||
M.fire_stacks = min(M.fire_stacks + 1 * absorption_coeff, 0)
|
||||
. += power
|
||||
if(M.reagents.has_reagent(/datum/reagent/water/holywater))
|
||||
M.reagents.remove_reagent(/datum/reagent/water/holywater, 0.5 * absorption_coeff)
|
||||
. += power * 0.75
|
||||
else if(M.reagents.has_reagent(/datum/reagent/water))
|
||||
M.reagents.remove_reagent(/datum/reagent/water, 0.5 * absorption_coeff)
|
||||
. += power * 0.5
|
||||
|
||||
/datum/symptom/heal/water/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 2 * actual_power
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1) //more effective on burns
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel yourself absorbing the water around you to soothe your damaged skin.</span>")
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len * 0.5, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
|
||||
return 1
|
||||
|
||||
/datum/symptom/heal/water/passive_message_condition(mob/living/M)
|
||||
if(M.getBruteLoss() || M.getFireLoss())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/symptom/heal/plasma
|
||||
name = "Plasma Fixation"
|
||||
desc = "The virus draws plasma from the atmosphere and from inside the body to heal and stabilize body temperature."
|
||||
stealth = 0
|
||||
resistance = 3
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 8
|
||||
passive_message = "<span class='notice'>You feel an odd attraction to plasma.</span>"
|
||||
var/temp_rate = 1
|
||||
threshold_desc = list(
|
||||
"Transmission 6" = "Additionally increases temperature adjustment rate and heals those who love toxins",
|
||||
"Resistance 7" = "Increases healing speed.",
|
||||
)
|
||||
/datum/symptom/heal/plasma/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 7)
|
||||
power = 2
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
temp_rate = 4
|
||||
|
||||
/datum/symptom/heal/plasma/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/datum/gas_mixture/environment
|
||||
var/plasmamount
|
||||
|
||||
. = 0
|
||||
|
||||
if(M.loc)
|
||||
environment = M.loc.return_air()
|
||||
if(environment)
|
||||
plasmamount = environment.gases[/datum/gas/plasma]
|
||||
if(plasmamount && plasmamount > GLOB.meta_gas_visibility[/datum/gas/plasma]) //if there's enough plasma in the air to see
|
||||
. += power * 0.5
|
||||
if(M.reagents.has_reagent(/datum/reagent/toxin/plasma))
|
||||
. += power * 0.75
|
||||
|
||||
/datum/symptom/heal/plasma/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = 4 * actual_power
|
||||
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel yourself absorbing plasma inside and around you...</span>")
|
||||
|
||||
if(M.bodytemperature > BODYTEMP_NORMAL)
|
||||
M.adjust_bodytemperature(-20 * temp_rate * TEMPERATURE_DAMAGE_COEFFICIENT,BODYTEMP_NORMAL)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel less hot.</span>")
|
||||
else if(M.bodytemperature < (BODYTEMP_NORMAL + 1))
|
||||
M.adjust_bodytemperature(20 * temp_rate * TEMPERATURE_DAMAGE_COEFFICIENT,0,BODYTEMP_NORMAL)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You feel warmer.</span>")
|
||||
|
||||
M.adjustToxLoss(-heal_amt, forced = (temp_rate == 4))
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
if(!parts.len)
|
||||
return
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>The pain from your wounds fades rapidly.</span>")
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
|
||||
|
||||
/datum/symptom/heal/radiation
|
||||
name = "Radioactive Resonance"
|
||||
desc = "The virus uses radiation to fix damage through dna mutations."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = 2
|
||||
transmittable = -3
|
||||
level = 6
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
passive_message = "<span class='notice'>Your skin glows faintly for a moment.</span>"
|
||||
var/cellular_damage = FALSE
|
||||
threshold_desc = "<b>Transmission 6:</b> Additionally heals cellular damage and toxin lovers.<br>\
|
||||
<b>Resistance 7:</b> Increases healing speed."
|
||||
|
||||
/datum/symptom/heal/radiation/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 7)
|
||||
power = 2
|
||||
if(A.properties["transmittable"] >= 6)
|
||||
cellular_damage = TRUE
|
||||
|
||||
/datum/symptom/heal/radiation/CanHeal(datum/disease/advance/A)
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(M.radiation)
|
||||
if(0)
|
||||
return FALSE
|
||||
if(1 to RAD_MOB_SAFE)
|
||||
return 0.25
|
||||
if(RAD_MOB_SAFE to RAD_BURN_THRESHOLD)
|
||||
return 0.5
|
||||
if(RAD_BURN_THRESHOLD to RAD_MOB_MUTATE)
|
||||
return 0.75
|
||||
if(RAD_MOB_MUTATE to RAD_MOB_KNOCKDOWN)
|
||||
return 1
|
||||
else
|
||||
return 1.5
|
||||
|
||||
/datum/symptom/heal/radiation/Heal(mob/living/carbon/M, datum/disease/advance/A, actual_power)
|
||||
var/heal_amt = actual_power
|
||||
|
||||
if(cellular_damage)
|
||||
M.adjustCloneLoss(-heal_amt * 0.5)
|
||||
|
||||
M.adjustToxLoss(-(2 * heal_amt), forced = cellular_damage)
|
||||
|
||||
var/list/parts = M.get_damaged_bodyparts(1,1)
|
||||
|
||||
if(!parts.len)
|
||||
return
|
||||
|
||||
if(prob(4))
|
||||
to_chat(M, "<span class='notice'>Your skin glows faintly, and you feel your wounds mending themselves.</span>")
|
||||
|
||||
for(var/obj/item/bodypart/L in parts)
|
||||
if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len))
|
||||
M.update_damage_overlays()
|
||||
return 1
|
||||
|
||||
@@ -1,54 +1,56 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Itching
|
||||
|
||||
Not noticable or unnoticable.
|
||||
Resistant.
|
||||
Increases stage speed.
|
||||
Little transmissibility.
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Displays an annoying message!
|
||||
Should be used for buffing your disease.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/itching
|
||||
|
||||
name = "Itching"
|
||||
desc = "The virus irritates the skin, causing itching."
|
||||
stealth = 0
|
||||
resistance = 3
|
||||
stage_speed = 3
|
||||
transmittable = 1
|
||||
level = 1
|
||||
severity = 1
|
||||
symptom_delay_min = 5
|
||||
symptom_delay_max = 25
|
||||
var/scratch = FALSE
|
||||
threshold_desc = "<b>Transmission 6:</b> Increases frequency of itching.<br>\
|
||||
<b>Stage Speed 7:</b> The host will scrath itself when itching, causing superficial damage."
|
||||
|
||||
/datum/symptom/itching/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["transmittable"] >= 6) //itch more often
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 4
|
||||
if(A.properties["stage_rate"] >= 7) //scratch
|
||||
scratch = TRUE
|
||||
|
||||
/datum/symptom/itching/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
var/picked_bodypart = pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
|
||||
var/obj/item/bodypart/bodypart = M.get_bodypart(picked_bodypart)
|
||||
if(bodypart && bodypart.status == BODYPART_ORGANIC && !bodypart.is_pseudopart) //robotic limbs will mean less scratching overall
|
||||
var/can_scratch = scratch && !M.incapacitated() && get_location_accessible(M, picked_bodypart)
|
||||
M.visible_message("[can_scratch ? "<span class='warning'>[M] scratches [M.p_their()] [bodypart.name].</span>" : ""]", "<span class='warning'>Your [bodypart.name] itches. [can_scratch ? " You scratch it." : ""]</span>")
|
||||
if(can_scratch)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Itching
|
||||
|
||||
Not noticable or unnoticable.
|
||||
Resistant.
|
||||
Increases stage speed.
|
||||
Little transmissibility.
|
||||
Low Level.
|
||||
|
||||
BONUS
|
||||
Displays an annoying message!
|
||||
Should be used for buffing your disease.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/itching
|
||||
|
||||
name = "Itching"
|
||||
desc = "The virus irritates the skin, causing itching."
|
||||
stealth = 0
|
||||
resistance = 3
|
||||
stage_speed = 3
|
||||
transmittable = 1
|
||||
level = 1
|
||||
severity = 1
|
||||
symptom_delay_min = 5
|
||||
symptom_delay_max = 25
|
||||
var/scratch = FALSE
|
||||
threshold_desc = list(
|
||||
"Transmission 6" = "Increases frequency of itching.",
|
||||
"Stage Speed 7" = "The host will scrath itself when itching, causing superficial damage.",
|
||||
)
|
||||
|
||||
/datum/symptom/itching/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["transmittable"] >= 6) //itch more often
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 4
|
||||
if(A.properties["stage_rate"] >= 7) //scratch
|
||||
scratch = TRUE
|
||||
|
||||
/datum/symptom/itching/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
var/picked_bodypart = pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
|
||||
var/obj/item/bodypart/bodypart = M.get_bodypart(picked_bodypart)
|
||||
if(bodypart && bodypart.status == BODYPART_ORGANIC && !bodypart.is_pseudopart) //robotic limbs will mean less scratching overall
|
||||
var/can_scratch = scratch && !M.incapacitated() && get_location_accessible(M, picked_bodypart)
|
||||
M.visible_message("[can_scratch ? "<span class='warning'>[M] scratches [M.p_their()] [bodypart.name].</span>" : ""]", "<span class='warning'>Your [bodypart.name] itches. [can_scratch ? " You scratch it." : ""]</span>")
|
||||
if(can_scratch)
|
||||
bodypart.receive_damage(0.5)
|
||||
@@ -10,8 +10,10 @@
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
var/reverse_boost = FALSE
|
||||
threshold_desc = "<b>Transmission 5:</b> Increases the virus' growth rate while nanites are present.<br>\
|
||||
<b>Stage Speed 7:</b> Increases the replication boost."
|
||||
threshold_desc = list(
|
||||
"Transmission 5" = "Increases the virus' growth rate while nanites are present.",
|
||||
"Stage Speed 7" = "Increases the replication boost."
|
||||
)
|
||||
|
||||
/datum/symptom/nano_boost/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
@@ -42,8 +44,10 @@
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
var/reverse_boost = FALSE
|
||||
threshold_desc = "<b>Stage Speed 5:</b> Increases the virus' growth rate while nanites are present.<br>\
|
||||
<b>Resistance 7:</b> Severely increases the rate at which the nanites are destroyed."
|
||||
threshold_desc = list(
|
||||
"Stage Speed 5" = "Increases the virus' growth rate while nanites are present.",
|
||||
"Resistance 7" = "Severely increases the rate at which the nanites are destroyed."
|
||||
)
|
||||
|
||||
/datum/symptom/nano_destroy/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
|
||||
@@ -26,8 +26,10 @@ Bonus
|
||||
var/sleep_level = 0
|
||||
var/sleepy_ticks = 0
|
||||
var/stamina = FALSE
|
||||
threshold_desc = "<b>Transmission 7:</b> Also relaxes the muscles, weakening and slowing the host.<br>\
|
||||
<b>Resistance 10:</b> Causes narcolepsy more often, increasing the chance of the host falling asleep."
|
||||
threshold_desc = list(
|
||||
"Transmission 4" = "Causes the host to periodically emit a yawn that spreads the virus in a manner similar to that of a sneeze.",
|
||||
"Stage Speed 10" = "Causes narcolepsy more often, increasing the chance of the host falling asleep.",
|
||||
)
|
||||
|
||||
/datum/symptom/narcolepsy/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
|
||||
@@ -1,68 +1,70 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Self-Respiration
|
||||
|
||||
Slightly hidden.
|
||||
Lowers resistance significantly.
|
||||
Decreases stage speed significantly.
|
||||
Decreases transmittablity tremendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
The body generates salbutamol.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/oxygen
|
||||
|
||||
name = "Self-Respiration"
|
||||
desc = "The virus rapidly synthesizes oxygen, effectively removing the need for breathing."
|
||||
stealth = 1
|
||||
resistance = -3
|
||||
stage_speed = -3
|
||||
transmittable = -4
|
||||
level = 6
|
||||
base_message_chance = 5
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
var/regenerate_blood = FALSE
|
||||
threshold_desc = "<b>Resistance 8:</b>Additionally regenerates lost blood.<br>"
|
||||
|
||||
/datum/symptom/oxygen/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 8) //blood regeneration
|
||||
regenerate_blood = TRUE
|
||||
|
||||
/datum/symptom/oxygen/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
M.adjustOxyLoss(-7, 0)
|
||||
M.losebreath = max(0, M.losebreath - 4)
|
||||
if(regenerate_blood && M.blood_volume < (BLOOD_VOLUME_NORMAL * M.blood_ratio))
|
||||
M.blood_volume += 1
|
||||
else
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='notice'>[pick("Your lungs feel great.", "You realize you haven't been breathing.", "You don't feel the need to breathe.")]</span>")
|
||||
return
|
||||
|
||||
/datum/symptom/oxygen/on_stage_change(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(A.stage >= 4)
|
||||
ADD_TRAIT(M, TRAIT_NOBREATH, DISEASE_TRAIT)
|
||||
else
|
||||
REMOVE_TRAIT(M, TRAIT_NOBREATH, DISEASE_TRAIT)
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/oxygen/End(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.stage >= 4)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Self-Respiration
|
||||
|
||||
Slightly hidden.
|
||||
Lowers resistance significantly.
|
||||
Decreases stage speed significantly.
|
||||
Decreases transmittablity tremendously.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
The body generates salbutamol.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/oxygen
|
||||
|
||||
name = "Self-Respiration"
|
||||
desc = "The virus rapidly synthesizes oxygen, effectively removing the need for breathing."
|
||||
stealth = 1
|
||||
resistance = -3
|
||||
stage_speed = -3
|
||||
transmittable = -4
|
||||
level = 6
|
||||
base_message_chance = 5
|
||||
symptom_delay_min = 1
|
||||
symptom_delay_max = 1
|
||||
var/regenerate_blood = FALSE
|
||||
threshold_desc = list(
|
||||
"Resistance 8" = "Additionally regenerates lost blood."
|
||||
)
|
||||
|
||||
/datum/symptom/oxygen/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["resistance"] >= 8) //blood regeneration
|
||||
regenerate_blood = TRUE
|
||||
|
||||
/datum/symptom/oxygen/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(4, 5)
|
||||
M.adjustOxyLoss(-7, 0)
|
||||
M.losebreath = max(0, M.losebreath - 4)
|
||||
if(regenerate_blood && M.blood_volume < (BLOOD_VOLUME_NORMAL * M.blood_ratio))
|
||||
M.blood_volume += 1
|
||||
else
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='notice'>[pick("Your lungs feel great.", "You realize you haven't been breathing.", "You don't feel the need to breathe.")]</span>")
|
||||
return
|
||||
|
||||
/datum/symptom/oxygen/on_stage_change(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return FALSE
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(A.stage >= 4)
|
||||
ADD_TRAIT(M, TRAIT_NOBREATH, DISEASE_TRAIT)
|
||||
else
|
||||
REMOVE_TRAIT(M, TRAIT_NOBREATH, DISEASE_TRAIT)
|
||||
return TRUE
|
||||
|
||||
/datum/symptom/oxygen/End(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.stage >= 4)
|
||||
REMOVE_TRAIT(A.affected_mob, TRAIT_NOBREATH, DISEASE_TRAIT)
|
||||
@@ -11,9 +11,11 @@
|
||||
var/purge_alcohol = FALSE
|
||||
var/trauma_heal_mild = FALSE
|
||||
var/trauma_heal_severe = FALSE
|
||||
threshold_desc = "<b>Resistance 6:</b> Heals minor brain traumas.<br>\
|
||||
<b>Resistance 9:</b> Heals severe brain traumas.<br>\
|
||||
<b>Transmission 8:</b> Purges alcohol in the bloodstream."
|
||||
threshold_desc = list(
|
||||
"Resistance 6" = "Heals minor brain traumas.",
|
||||
"Resistance 9" = "Heals severe brain traumas.",
|
||||
"Transmission 8" = "Purges alcohol in the bloodstream.",
|
||||
)
|
||||
|
||||
/datum/symptom/mind_restoration/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
|
||||
@@ -1,59 +1,61 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Shivering
|
||||
|
||||
No change to hidden.
|
||||
Increases resistance.
|
||||
Increases stage speed.
|
||||
Little transmittable.
|
||||
Low level.
|
||||
|
||||
Bonus
|
||||
Cools down your body.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/shivering
|
||||
name = "Shivering"
|
||||
desc = "The virus inhibits the body's thermoregulation, cooling the body down."
|
||||
stealth = 0
|
||||
resistance = 2
|
||||
stage_speed = 2
|
||||
transmittable = 2
|
||||
level = 2
|
||||
severity = 2
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
var/unsafe = FALSE //over the cold threshold
|
||||
threshold_desc = "<b>Stage Speed 5:</b> Increases cooling speed; the host can fall below safe temperature levels.<br>\
|
||||
<b>Stage Speed 10:</b> Further increases cooling speed."
|
||||
|
||||
/datum/symptom/fever/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 5) //dangerous cold
|
||||
power = 1.5
|
||||
unsafe = TRUE
|
||||
if(A.properties["stage_rate"] >= 10)
|
||||
power = 2.5
|
||||
|
||||
/datum/symptom/shivering/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(!unsafe || A.stage < 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel cold.", "You shiver.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>[pick("You feel your blood run cold.", "You feel ice in your veins.", "You feel like you can't heat up.", "You shiver violently." )]</span>")
|
||||
if(M.bodytemperature > BODYTEMP_COLD_DAMAGE_LIMIT || unsafe)
|
||||
Chill(M, A)
|
||||
|
||||
/datum/symptom/shivering/proc/Chill(mob/living/M, datum/disease/advance/A)
|
||||
var/get_cold = 6 * power
|
||||
var/limit = BODYTEMP_COLD_DAMAGE_LIMIT + 1
|
||||
if(unsafe)
|
||||
limit = 0
|
||||
M.adjust_bodytemperature(-get_cold * A.stage, limit)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Shivering
|
||||
|
||||
No change to hidden.
|
||||
Increases resistance.
|
||||
Increases stage speed.
|
||||
Little transmittable.
|
||||
Low level.
|
||||
|
||||
Bonus
|
||||
Cools down your body.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/shivering
|
||||
name = "Shivering"
|
||||
desc = "The virus inhibits the body's thermoregulation, cooling the body down."
|
||||
stealth = 0
|
||||
resistance = 2
|
||||
stage_speed = 2
|
||||
transmittable = 2
|
||||
level = 2
|
||||
severity = 2
|
||||
symptom_delay_min = 10
|
||||
symptom_delay_max = 30
|
||||
var/unsafe = FALSE //over the cold threshold
|
||||
threshold_desc = list(
|
||||
"Stage Speed 5" = "Increases cooling speed,; the host can fall below safe temperature levels.",
|
||||
"Stage Speed 10" = "Further increases cooling speed."
|
||||
)
|
||||
|
||||
/datum/symptom/fever/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stage_rate"] >= 5) //dangerous cold
|
||||
power = 1.5
|
||||
unsafe = TRUE
|
||||
if(A.properties["stage_rate"] >= 10)
|
||||
power = 2.5
|
||||
|
||||
/datum/symptom/shivering/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
if(!unsafe || A.stage < 4)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel cold.", "You shiver.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>[pick("You feel your blood run cold.", "You feel ice in your veins.", "You feel like you can't heat up.", "You shiver violently." )]</span>")
|
||||
if(M.bodytemperature > BODYTEMP_COLD_DAMAGE_LIMIT || unsafe)
|
||||
Chill(M, A)
|
||||
|
||||
/datum/symptom/shivering/proc/Chill(mob/living/M, datum/disease/advance/A)
|
||||
var/get_cold = 6 * power
|
||||
var/limit = BODYTEMP_COLD_DAMAGE_LIMIT + 1
|
||||
if(unsafe)
|
||||
limit = 0
|
||||
M.adjust_bodytemperature(-get_cold * A.stage, limit)
|
||||
return 1
|
||||
@@ -1,52 +1,54 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Sneezing
|
||||
|
||||
Very Noticable.
|
||||
Increases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Very transmissible.
|
||||
Low Level.
|
||||
|
||||
Bonus
|
||||
Forces a spread type of AIRBORNE
|
||||
with extra range!
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/sneeze
|
||||
name = "Sneezing"
|
||||
desc = "The virus causes irritation of the nasal cavity, making the host sneeze occasionally."
|
||||
stealth = -2
|
||||
resistance = 3
|
||||
stage_speed = 0
|
||||
transmittable = 4
|
||||
level = 1
|
||||
severity = 1
|
||||
symptom_delay_min = 5
|
||||
symptom_delay_max = 35
|
||||
threshold_desc = "<b>Transmission 9:</b> Increases sneezing range, spreading the virus over a larger area.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/sneeze/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["transmittable"] >= 9) //longer spread range
|
||||
power = 2
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
|
||||
/datum/symptom/sneeze/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3)
|
||||
if(!suppress_warning)
|
||||
M.emote("sniff")
|
||||
else
|
||||
M.emote("sneeze")
|
||||
if(M.CanSpreadAirborneDisease()) //don't spread germs if they covered their mouth
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Sneezing
|
||||
|
||||
Very Noticable.
|
||||
Increases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Very transmissible.
|
||||
Low Level.
|
||||
|
||||
Bonus
|
||||
Forces a spread type of AIRBORNE
|
||||
with extra range!
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/sneeze
|
||||
name = "Sneezing"
|
||||
desc = "The virus causes irritation of the nasal cavity, making the host sneeze occasionally."
|
||||
stealth = -2
|
||||
resistance = 3
|
||||
stage_speed = 0
|
||||
transmittable = 4
|
||||
level = 1
|
||||
severity = 1
|
||||
symptom_delay_min = 5
|
||||
symptom_delay_max = 35
|
||||
threshold_desc = list(
|
||||
"Transmission 9" = "Increases sneezing range, spreading the virus over 6 meter cone instead of over a 4 meter cone.",
|
||||
"Stealth 4" = "The symptom remains hidden until active.",
|
||||
)
|
||||
|
||||
/datum/symptom/sneeze/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["transmittable"] >= 9) //longer spread range
|
||||
power = 2
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
|
||||
/datum/symptom/sneeze/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3)
|
||||
if(!suppress_warning)
|
||||
M.emote("sniff")
|
||||
else
|
||||
M.emote("sneeze")
|
||||
if(M.CanSpreadAirborneDisease()) //don't spread germs if they covered their mouth
|
||||
A.spread(4 + power)
|
||||
@@ -29,9 +29,10 @@ Bonus
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 80
|
||||
var/remove_eyes = FALSE
|
||||
threshold_desc = "<b>Resistance 12:</b> Weakens extraocular muscles, eventually leading to complete detachment of the eyes.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
threshold_desc = list(
|
||||
"Resistance 12" = "Weakens extraocular muscles, eventually leading to complete detachment of the eyes.",
|
||||
"Stealth 4" = "The symptom remains hidden until active.",
|
||||
)
|
||||
/datum/symptom/visionloss/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
|
||||
@@ -1,81 +1,83 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Voice Change
|
||||
|
||||
Noticeable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Increased transmittable.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Changes the voice of the affected mob. Causing confusion in communication.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/voice_change
|
||||
|
||||
name = "Voice Change"
|
||||
desc = "The virus alters the pitch and tone of the host's vocal cords, changing how their voice sounds."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = -2
|
||||
transmittable = 2
|
||||
level = 6
|
||||
severity = 2
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 60
|
||||
symptom_delay_max = 120
|
||||
var/scramble_language = FALSE
|
||||
var/datum/language/current_language
|
||||
var/datum/language_holder/original_language
|
||||
threshold_desc = "<b>Transmission 14:</b> The host's language center of the brain is damaged, leading to complete inability to speak or understand any language.<br>\
|
||||
<b>Stage Speed 7:</b> Changes voice more often.<br>\
|
||||
<b>Stealth 3:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/voice_change/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 3)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["stage_rate"] >= 7) //faster change of voice
|
||||
base_message_chance = 25
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 85
|
||||
if(A.properties["transmittable"] >= 14) //random language
|
||||
scramble_language = TRUE
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/datum/language_holder/mob_language = M.get_language_holder()
|
||||
original_language = mob_language.copy()
|
||||
|
||||
/datum/symptom/voice_change/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("Your throat hurts.", "You clear your throat.")]</span>")
|
||||
else
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.SetSpecialVoice(H.dna.species.random_name(H.gender))
|
||||
if(scramble_language)
|
||||
H.remove_language(current_language)
|
||||
current_language = pick(subtypesof(/datum/language) - /datum/language/common)
|
||||
H.grant_language(current_language)
|
||||
var/datum/language_holder/mob_language = H.get_language_holder()
|
||||
mob_language.only_speaks_language = current_language
|
||||
|
||||
/datum/symptom/voice_change/End(datum/disease/advance/A)
|
||||
..()
|
||||
if(ishuman(A.affected_mob))
|
||||
var/mob/living/carbon/human/H = A.affected_mob
|
||||
H.UnsetSpecialVoice()
|
||||
if(scramble_language)
|
||||
var/mob/living/M = A.affected_mob
|
||||
M.copy_known_languages_from(original_language, TRUE)
|
||||
current_language = null
|
||||
QDEL_NULL(original_language)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Voice Change
|
||||
|
||||
Noticeable.
|
||||
Lowers resistance.
|
||||
Decreases stage speed.
|
||||
Increased transmittable.
|
||||
Fatal Level.
|
||||
|
||||
Bonus
|
||||
Changes the voice of the affected mob. Causing confusion in communication.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/voice_change
|
||||
|
||||
name = "Voice Change"
|
||||
desc = "The virus alters the pitch and tone of the host's vocal cords, changing how their voice sounds."
|
||||
stealth = -1
|
||||
resistance = -2
|
||||
stage_speed = -2
|
||||
transmittable = 2
|
||||
level = 6
|
||||
severity = 2
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 60
|
||||
symptom_delay_max = 120
|
||||
var/scramble_language = FALSE
|
||||
var/datum/language/current_language
|
||||
var/datum/language_holder/original_language
|
||||
threshold_desc = list(
|
||||
"Transmission 14" = "The host's language center of the brain is damaged, leading to complete inability to speak or understand any language.",
|
||||
"Stage Speed 7" = "Changes voice more often.",
|
||||
"Stealth 3" = "The symptom remains hidden until active."
|
||||
)
|
||||
|
||||
/datum/symptom/voice_change/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 3)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["stage_rate"] >= 7) //faster change of voice
|
||||
base_message_chance = 25
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 85
|
||||
if(A.properties["transmittable"] >= 14) //random language
|
||||
scramble_language = TRUE
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/datum/language_holder/mob_language = M.get_language_holder()
|
||||
original_language = mob_language.copy()
|
||||
|
||||
/datum/symptom/voice_change/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/carbon/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("Your throat hurts.", "You clear your throat.")]</span>")
|
||||
else
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
H.SetSpecialVoice(H.dna.species.random_name(H.gender))
|
||||
if(scramble_language)
|
||||
H.remove_language(current_language)
|
||||
current_language = pick(subtypesof(/datum/language) - /datum/language/common)
|
||||
H.grant_language(current_language)
|
||||
var/datum/language_holder/mob_language = H.get_language_holder()
|
||||
mob_language.only_speaks_language = current_language
|
||||
|
||||
/datum/symptom/voice_change/End(datum/disease/advance/A)
|
||||
..()
|
||||
if(ishuman(A.affected_mob))
|
||||
var/mob/living/carbon/human/H = A.affected_mob
|
||||
H.UnsetSpecialVoice()
|
||||
if(scramble_language)
|
||||
var/mob/living/M = A.affected_mob
|
||||
M.copy_known_languages_from(original_language, TRUE)
|
||||
current_language = null
|
||||
QDEL_NULL(original_language)
|
||||
|
||||
@@ -1,63 +1,65 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Little transmissibility.
|
||||
Medium Level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit!
|
||||
Meaning your disease can spread via
|
||||
people walking on vomit.
|
||||
Makes the affected mob lose nutrition and
|
||||
heal toxin damage.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit
|
||||
|
||||
name = "Vomiting"
|
||||
desc = "The virus causes nausea and irritates the stomach, causing occasional vomit."
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 3
|
||||
severity = 3
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 80
|
||||
var/vomit_blood = FALSE
|
||||
var/proj_vomit = 0
|
||||
threshold_desc = "<b>Resistance 7:</b> Host will vomit blood, causing internal damage.<br>\
|
||||
<b>Transmission 7:</b> Host will projectile vomit, increasing vomiting range.<br>\
|
||||
<b>Stealth 4:</b> The symptom remains hidden until active."
|
||||
|
||||
/datum/symptom/vomit/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["resistance"] >= 7) //blood vomit
|
||||
vomit_blood = TRUE
|
||||
if(A.properties["transmittable"] >= 7) //projectile vomit
|
||||
proj_vomit = 5
|
||||
|
||||
/datum/symptom/vomit/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel nauseated.", "You feel like you're going to throw up!")]</span>")
|
||||
else
|
||||
vomit(M)
|
||||
|
||||
/datum/symptom/vomit/proc/vomit(mob/living/carbon/M)
|
||||
M.vomit(20, vomit_blood, distance = proj_vomit)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Vomiting
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Doesn't increase stage speed.
|
||||
Little transmissibility.
|
||||
Medium Level.
|
||||
|
||||
Bonus
|
||||
Forces the affected mob to vomit!
|
||||
Meaning your disease can spread via
|
||||
people walking on vomit.
|
||||
Makes the affected mob lose nutrition and
|
||||
heal toxin damage.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/vomit
|
||||
|
||||
name = "Vomiting"
|
||||
desc = "The virus causes nausea and irritates the stomach, causing occasional vomit."
|
||||
stealth = -2
|
||||
resistance = -1
|
||||
stage_speed = 0
|
||||
transmittable = 1
|
||||
level = 3
|
||||
severity = 3
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 25
|
||||
symptom_delay_max = 80
|
||||
var/vomit_blood = FALSE
|
||||
var/proj_vomit = 0
|
||||
threshold_desc = list(
|
||||
"Resistance 7" = "Host will vomit blood, causing internal damage.",
|
||||
"Transmission 7" = "Host will projectile vomit, increasing vomiting range.",
|
||||
"Stealth 4" = "The symptom remains hidden until active."
|
||||
)
|
||||
|
||||
/datum/symptom/vomit/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4)
|
||||
suppress_warning = TRUE
|
||||
if(A.properties["resistance"] >= 7) //blood vomit
|
||||
vomit_blood = TRUE
|
||||
if(A.properties["transmittable"] >= 7) //projectile vomit
|
||||
proj_vomit = 5
|
||||
|
||||
/datum/symptom/vomit/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance) && !suppress_warning)
|
||||
to_chat(M, "<span class='warning'>[pick("You feel nauseated.", "You feel like you're going to throw up!")]</span>")
|
||||
else
|
||||
vomit(M)
|
||||
|
||||
/datum/symptom/vomit/proc/vomit(mob/living/carbon/M)
|
||||
M.vomit(20, vomit_blood, distance = proj_vomit)
|
||||
|
||||
@@ -1,51 +1,53 @@
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Weight Loss
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Decreases stage speed.
|
||||
Reduced Transmittable.
|
||||
High level.
|
||||
|
||||
Bonus
|
||||
Decreases the weight of the mob,
|
||||
forcing it to be skinny.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/weight_loss
|
||||
|
||||
name = "Weight Loss"
|
||||
desc = "The virus mutates the host's metabolism, making it almost unable to gain nutrition from food."
|
||||
stealth = -2
|
||||
resistance = 2
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 3
|
||||
severity = 3
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 45
|
||||
threshold_desc = "<b>Stealth 4:</b> The symptom is less noticeable."
|
||||
|
||||
/datum/symptom/weight_loss/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4) //warn less often
|
||||
base_message_chance = 25
|
||||
|
||||
/datum/symptom/weight_loss/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='warning'>[pick("You feel hungry.", "You crave for food.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'><i>[pick("So hungry...", "You'd kill someone for a bite of food...", "Hunger cramps seize you...")]</i></span>")
|
||||
M.overeatduration = max(M.overeatduration - 100, 0)
|
||||
/*
|
||||
//////////////////////////////////////
|
||||
|
||||
Weight Loss
|
||||
|
||||
Very Very Noticable.
|
||||
Decreases resistance.
|
||||
Decreases stage speed.
|
||||
Reduced Transmittable.
|
||||
High level.
|
||||
|
||||
Bonus
|
||||
Decreases the weight of the mob,
|
||||
forcing it to be skinny.
|
||||
|
||||
//////////////////////////////////////
|
||||
*/
|
||||
|
||||
/datum/symptom/weight_loss
|
||||
|
||||
name = "Weight Loss"
|
||||
desc = "The virus mutates the host's metabolism, making it almost unable to gain nutrition from food."
|
||||
stealth = -2
|
||||
resistance = 2
|
||||
stage_speed = -2
|
||||
transmittable = -2
|
||||
level = 3
|
||||
severity = 3
|
||||
base_message_chance = 100
|
||||
symptom_delay_min = 15
|
||||
symptom_delay_max = 45
|
||||
threshold_desc = list(
|
||||
"Stealth 4" = "The symptom is less noticeable."
|
||||
)
|
||||
|
||||
/datum/symptom/weight_loss/Start(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
if(A.properties["stealth"] >= 4) //warn less often
|
||||
base_message_chance = 25
|
||||
|
||||
/datum/symptom/weight_loss/Activate(datum/disease/advance/A)
|
||||
if(!..())
|
||||
return
|
||||
var/mob/living/M = A.affected_mob
|
||||
switch(A.stage)
|
||||
if(1, 2, 3, 4)
|
||||
if(prob(base_message_chance))
|
||||
to_chat(M, "<span class='warning'>[pick("You feel hungry.", "You crave for food.")]</span>")
|
||||
else
|
||||
to_chat(M, "<span class='warning'><i>[pick("So hungry...", "You'd kill someone for a bite of food...", "Hunger cramps seize you...")]</i></span>")
|
||||
M.overeatduration = max(M.overeatduration - 100, 0)
|
||||
M.nutrition = max(M.nutrition - 100, 0)
|
||||
@@ -1,54 +1,58 @@
|
||||
/datum/spawners_menu
|
||||
var/mob/dead/observer/owner
|
||||
|
||||
/datum/spawners_menu/New(mob/dead/observer/new_owner)
|
||||
if(!istype(new_owner))
|
||||
qdel(src)
|
||||
owner = new_owner
|
||||
|
||||
/datum/spawners_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "spawners_menu", "Spawners Menu", 700, 600, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/datum/spawners_menu/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["spawners"] = list()
|
||||
for(var/spawner in GLOB.mob_spawners)
|
||||
var/list/this = list()
|
||||
this["name"] = spawner
|
||||
this["desc"] = ""
|
||||
this["refs"] = list()
|
||||
for(var/spawner_obj in GLOB.mob_spawners[spawner])
|
||||
this["refs"] += "[REF(spawner_obj)]"
|
||||
if(!this["desc"])
|
||||
if(istype(spawner_obj, /obj/effect/mob_spawn))
|
||||
var/obj/effect/mob_spawn/MS = spawner_obj
|
||||
this["desc"] = MS.flavour_text
|
||||
else
|
||||
var/obj/O = spawner_obj
|
||||
this["desc"] = O.desc
|
||||
this["amount_left"] = LAZYLEN(GLOB.mob_spawners[spawner])
|
||||
data["spawners"] += list(this)
|
||||
|
||||
return data
|
||||
|
||||
/datum/spawners_menu/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/spawner_ref = pick(GLOB.mob_spawners[params["name"]])
|
||||
var/obj/effect/mob_spawn/MS = locate(spawner_ref) in GLOB.poi_list
|
||||
if(!MS)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("jump")
|
||||
if(MS)
|
||||
owner.forceMove(get_turf(MS))
|
||||
. = TRUE
|
||||
if("spawn")
|
||||
if(MS)
|
||||
MS.attack_ghost(owner)
|
||||
/datum/spawners_menu
|
||||
var/mob/dead/observer/owner
|
||||
|
||||
/datum/spawners_menu/New(mob/dead/observer/new_owner)
|
||||
if(!istype(new_owner))
|
||||
qdel(src)
|
||||
owner = new_owner
|
||||
|
||||
/datum/spawners_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.observer_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "spawners_menu", "Spawners Menu", 700, 600, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/datum/spawners_menu/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["spawners"] = list()
|
||||
for(var/spawner in GLOB.mob_spawners)
|
||||
var/list/this = list()
|
||||
this["name"] = spawner
|
||||
this["short_desc"] = ""
|
||||
this["flavor_text"] = ""
|
||||
this["important_warning"] = ""
|
||||
this["refs"] = list()
|
||||
for(var/spawner_obj in GLOB.mob_spawners[spawner])
|
||||
this["refs"] += "[REF(spawner_obj)]"
|
||||
if(!this["desc"])
|
||||
if(istype(spawner_obj, /obj/effect/mob_spawn))
|
||||
var/obj/effect/mob_spawn/MS = spawner_obj
|
||||
this["short_desc"] = MS.short_desc
|
||||
this["flavor_text"] = MS.flavour_text
|
||||
this["important_info"] = MS.important_info
|
||||
else
|
||||
var/obj/O = spawner_obj
|
||||
this["desc"] = O.desc
|
||||
this["amount_left"] = LAZYLEN(GLOB.mob_spawners[spawner])
|
||||
data["spawners"] += list(this)
|
||||
|
||||
return data
|
||||
|
||||
/datum/spawners_menu/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/spawner_ref = pick(GLOB.mob_spawners[params["name"]])
|
||||
var/obj/effect/mob_spawn/MS = locate(spawner_ref) in GLOB.poi_list
|
||||
if(!MS)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("jump")
|
||||
if(MS)
|
||||
owner.forceMove(get_turf(MS))
|
||||
. = TRUE
|
||||
if("spawn")
|
||||
if(MS)
|
||||
MS.attack_ghost(owner)
|
||||
. = TRUE
|
||||
@@ -215,8 +215,8 @@
|
||||
/datum/wires/ui_interact(mob/user, ui_key = "wires", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "wires", "[holder.name] wires", 350, 150 + wires.len * 30, master_ui, state)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "wires", "[holder.name] Wires", 350, 150 + wires.len * 30, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/datum/wires/ui_data(mob/user)
|
||||
|
||||
@@ -113,6 +113,11 @@ Class Procs:
|
||||
var/atom/movable/occupant = null
|
||||
var/speed_process = FALSE // Process as fast as possible?
|
||||
var/obj/item/circuitboard/circuit // Circuit to be created and inserted when the machinery is created
|
||||
// For storing and overriding ui id and dimensions
|
||||
var/tgui_id // ID of TGUI interface
|
||||
var/ui_style // ID of custom TGUI style (optional)
|
||||
var/ui_x
|
||||
var/ui_y
|
||||
|
||||
var/interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE
|
||||
|
||||
|
||||
@@ -46,34 +46,37 @@
|
||||
new /obj/item/stack/spacecash/c200(drop_location()) // will autostack
|
||||
playsound(src.loc, 'sound/items/poster_being_created.ogg', 100, 1)
|
||||
SSshuttle.points -= 200
|
||||
if(next_warning < world.time && prob(15))
|
||||
var/area/A = get_area(loc)
|
||||
var/message = "Unauthorized credit withdrawal underway in [A.map_name]!!"
|
||||
radio.talk_into(src, message, radio_channel)
|
||||
next_warning = world.time + minimum_time_between_warnings
|
||||
if(next_warning < world.time && prob(15))
|
||||
var/area/A = get_area(loc)
|
||||
var/message = "Unauthorized credit withdrawal underway in [A.map_name]!!"
|
||||
radio.talk_into(src, message, radio_channel)
|
||||
next_warning = world.time + minimum_time_between_warnings
|
||||
|
||||
/obj/machinery/computer/bank_machine/ui_interact(mob/user)
|
||||
. = ..()
|
||||
var/dat = "[station_name()] secure vault. Authorized personnel only.<br>"
|
||||
dat += "Current Balance: [SSshuttle.points] credits.<br>"
|
||||
if(!siphoning)
|
||||
dat += "<A href='?src=[REF(src)];siphon=1'>Siphon Credits</A><br>"
|
||||
else
|
||||
dat += "<A href='?src=[REF(src)];halt=1'>Halt Credit Siphon</A><br>"
|
||||
/obj/machinery/computer/bank_machine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "bank_machine", name, 320, 165, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
dat += "<a href='?src=[REF(user)];mach_close=computer'>Close</a>"
|
||||
/obj/machinery/computer/bank_machine/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["current_balance"] = SSshuttle.points
|
||||
data["siphoning"] = siphoning
|
||||
data["station_name"] = station_name()
|
||||
|
||||
var/datum/browser/popup = new(user, "computer", "Bank Vault", 300, 200)
|
||||
popup.set_content("<center>[dat]</center>")
|
||||
popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
|
||||
popup.open()
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/bank_machine/Topic(href, href_list)
|
||||
/obj/machinery/computer/bank_machine/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["siphon"])
|
||||
say("Siphon of station credits has begun!")
|
||||
siphoning = TRUE
|
||||
if(href_list["halt"])
|
||||
say("Station credit withdrawal halted.")
|
||||
siphoning = FALSE
|
||||
|
||||
switch(action)
|
||||
if("siphon")
|
||||
say("Siphon of station credits has begun!")
|
||||
siphoning = TRUE
|
||||
. = TRUE
|
||||
if("halt")
|
||||
say("Station credit withdrawal halted.")
|
||||
siphoning = FALSE
|
||||
. = TRUE
|
||||
|
||||
@@ -1,128 +1,123 @@
|
||||
#define MENU_OPERATION 1
|
||||
#define MENU_SURGERIES 2
|
||||
|
||||
/obj/machinery/computer/operating
|
||||
name = "operating computer"
|
||||
desc = "Monitors patient vitals and displays surgery steps. Can be loaded with surgery disks to perform experimental procedures."
|
||||
icon_screen = "crew"
|
||||
icon_keyboard = "med_key"
|
||||
circuit = /obj/item/circuitboard/computer/operating
|
||||
var/mob/living/carbon/human/patient
|
||||
var/obj/structure/table/optable/table
|
||||
var/list/advanced_surgeries = list()
|
||||
var/datum/techweb/linked_techweb
|
||||
var/menu = MENU_OPERATION
|
||||
light_color = LIGHT_COLOR_BLUE
|
||||
|
||||
/obj/machinery/computer/operating/Initialize()
|
||||
. = ..()
|
||||
linked_techweb = SSresearch.science_tech
|
||||
find_table()
|
||||
|
||||
/obj/machinery/computer/operating/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/disk/surgery))
|
||||
user.visible_message("[user] begins to load \the [O] in \the [src]...",
|
||||
"You begin to load a surgery protocol from \the [O]...",
|
||||
"You hear the chatter of a floppy drive.")
|
||||
var/obj/item/disk/surgery/D = O
|
||||
if(do_after(user, 10, target = src))
|
||||
advanced_surgeries |= D.surgeries
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/operating/proc/sync_surgeries()
|
||||
for(var/i in linked_techweb.researched_designs)
|
||||
var/datum/design/surgery/D = SSresearch.techweb_design_by_id(i)
|
||||
if(!istype(D))
|
||||
continue
|
||||
advanced_surgeries |= D.surgery
|
||||
|
||||
/obj/machinery/computer/operating/proc/find_table()
|
||||
for(var/direction in GLOB.cardinals)
|
||||
table = locate(/obj/structure/table/optable, get_step(src, direction))
|
||||
if(table)
|
||||
table.computer = src
|
||||
break
|
||||
|
||||
/obj/machinery/computer/operating/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "operating_computer", name, 350, 470, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/operating/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["table"] = table
|
||||
if(table)
|
||||
data["menu"] = menu
|
||||
|
||||
var/list/surgeries = list()
|
||||
for(var/X in advanced_surgeries)
|
||||
var/datum/surgery/S = X
|
||||
var/list/surgery = list()
|
||||
surgery["name"] = initial(S.name)
|
||||
surgery["desc"] = initial(S.desc)
|
||||
surgeries += list(surgery)
|
||||
data["surgeries"] = surgeries
|
||||
|
||||
data["patient"] = list()
|
||||
if(table.check_patient())
|
||||
patient = table.patient
|
||||
switch(patient.stat)
|
||||
if(CONSCIOUS)
|
||||
data["patient"]["stat"] = "Conscious"
|
||||
data["patient"]["statstate"] = "good"
|
||||
if(SOFT_CRIT)
|
||||
data["patient"]["stat"] = "Conscious"
|
||||
data["patient"]["statstate"] = "average"
|
||||
if(UNCONSCIOUS)
|
||||
data["patient"]["stat"] = "Unconscious"
|
||||
data["patient"]["statstate"] = "average"
|
||||
if(DEAD)
|
||||
data["patient"]["stat"] = "Dead"
|
||||
data["patient"]["statstate"] = "bad"
|
||||
data["patient"]["health"] = patient.health
|
||||
data["patient"]["blood_type"] = patient.dna.blood_type
|
||||
data["patient"]["maxHealth"] = patient.maxHealth
|
||||
data["patient"]["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
data["patient"]["bruteLoss"] = patient.getBruteLoss()
|
||||
data["patient"]["fireLoss"] = patient.getFireLoss()
|
||||
data["patient"]["toxLoss"] = patient.getToxLoss()
|
||||
data["patient"]["oxyLoss"] = patient.getOxyLoss()
|
||||
if(patient.surgeries.len)
|
||||
data["procedures"] = list()
|
||||
for(var/datum/surgery/procedure in patient.surgeries)
|
||||
var/datum/surgery_step/surgery_step = procedure.get_surgery_step()
|
||||
var/chems_needed = surgery_step.get_chem_list()
|
||||
var/alternative_step
|
||||
var/alt_chems_needed = ""
|
||||
if(surgery_step.repeatable)
|
||||
var/datum/surgery_step/next_step = procedure.get_surgery_next_step()
|
||||
if(next_step)
|
||||
alternative_step = capitalize(next_step.name)
|
||||
alt_chems_needed = next_step.get_chem_list()
|
||||
else
|
||||
alternative_step = "Finish operation"
|
||||
data["procedures"] += list(list(
|
||||
"name" = capitalize(procedure.name),
|
||||
"next_step" = capitalize(surgery_step.name),
|
||||
"chems_needed" = chems_needed,
|
||||
"alternative_step" = alternative_step,
|
||||
"alt_chems_needed" = alt_chems_needed
|
||||
))
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/operating/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("change_menu")
|
||||
menu = text2num(params["menu"])
|
||||
. = TRUE
|
||||
if("sync")
|
||||
sync_surgeries()
|
||||
. = TRUE
|
||||
. = TRUE
|
||||
|
||||
#undef MENU_OPERATION
|
||||
#undef MENU_SURGERIES
|
||||
#define MENU_OPERATION 1
|
||||
#define MENU_SURGERIES 2
|
||||
|
||||
/obj/machinery/computer/operating
|
||||
name = "operating computer"
|
||||
desc = "Monitors patient vitals and displays surgery steps. Can be loaded with surgery disks to perform experimental procedures."
|
||||
icon_screen = "crew"
|
||||
icon_keyboard = "med_key"
|
||||
circuit = /obj/item/circuitboard/computer/operating
|
||||
var/mob/living/carbon/human/patient
|
||||
var/obj/structure/table/optable/table
|
||||
var/list/advanced_surgeries = list()
|
||||
var/datum/techweb/linked_techweb
|
||||
light_color = LIGHT_COLOR_BLUE
|
||||
|
||||
/obj/machinery/computer/operating/Initialize()
|
||||
. = ..()
|
||||
linked_techweb = SSresearch.science_tech
|
||||
find_table()
|
||||
|
||||
/obj/machinery/computer/operating/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, /obj/item/disk/surgery))
|
||||
user.visible_message("[user] begins to load \the [O] in \the [src]...",
|
||||
"You begin to load a surgery protocol from \the [O]...",
|
||||
"You hear the chatter of a floppy drive.")
|
||||
var/obj/item/disk/surgery/D = O
|
||||
if(do_after(user, 10, target = src))
|
||||
advanced_surgeries |= D.surgeries
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/operating/proc/sync_surgeries()
|
||||
for(var/i in linked_techweb.researched_designs)
|
||||
var/datum/design/surgery/D = SSresearch.techweb_design_by_id(i)
|
||||
if(!istype(D))
|
||||
continue
|
||||
advanced_surgeries |= D.surgery
|
||||
|
||||
/obj/machinery/computer/operating/proc/find_table()
|
||||
for(var/direction in GLOB.cardinals)
|
||||
table = locate(/obj/structure/table/optable, get_step(src, direction))
|
||||
if(table)
|
||||
table.computer = src
|
||||
break
|
||||
|
||||
/obj/machinery/computer/operating/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "operating_computer", name, 350, 470, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/operating/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["table"] = table
|
||||
if(table)
|
||||
var/list/surgeries = list()
|
||||
for(var/X in advanced_surgeries)
|
||||
var/datum/surgery/S = X
|
||||
var/list/surgery = list()
|
||||
surgery["name"] = initial(S.name)
|
||||
surgery["desc"] = initial(S.desc)
|
||||
surgeries += list(surgery)
|
||||
data["surgeries"] = surgeries
|
||||
if(table.check_patient())
|
||||
data["patient"] = list()
|
||||
patient = table.patient
|
||||
switch(patient.stat)
|
||||
if(CONSCIOUS)
|
||||
data["patient"]["stat"] = "Conscious"
|
||||
data["patient"]["statstate"] = "good"
|
||||
if(SOFT_CRIT)
|
||||
data["patient"]["stat"] = "Conscious"
|
||||
data["patient"]["statstate"] = "average"
|
||||
if(UNCONSCIOUS)
|
||||
data["patient"]["stat"] = "Unconscious"
|
||||
data["patient"]["statstate"] = "average"
|
||||
if(DEAD)
|
||||
data["patient"]["stat"] = "Dead"
|
||||
data["patient"]["statstate"] = "bad"
|
||||
data["patient"]["health"] = patient.health
|
||||
data["patient"]["blood_type"] = patient.dna.blood_type
|
||||
data["patient"]["maxHealth"] = patient.maxHealth
|
||||
data["patient"]["minHealth"] = HEALTH_THRESHOLD_DEAD
|
||||
data["patient"]["bruteLoss"] = patient.getBruteLoss()
|
||||
data["patient"]["fireLoss"] = patient.getFireLoss()
|
||||
data["patient"]["toxLoss"] = patient.getToxLoss()
|
||||
data["patient"]["oxyLoss"] = patient.getOxyLoss()
|
||||
if(patient.surgeries.len)
|
||||
data["procedures"] = list()
|
||||
for(var/datum/surgery/procedure in patient.surgeries)
|
||||
var/datum/surgery_step/surgery_step = procedure.get_surgery_step()
|
||||
var/chems_needed = surgery_step.get_chem_list()
|
||||
var/alternative_step
|
||||
var/alt_chems_needed = ""
|
||||
if(surgery_step.repeatable)
|
||||
var/datum/surgery_step/next_step = procedure.get_surgery_next_step()
|
||||
if(next_step)
|
||||
alternative_step = capitalize(next_step.name)
|
||||
alt_chems_needed = next_step.get_chem_list()
|
||||
else
|
||||
alternative_step = "Finish operation"
|
||||
data["procedures"] += list(list(
|
||||
"name" = capitalize(procedure.name),
|
||||
"next_step" = capitalize(surgery_step.name),
|
||||
"chems_needed" = chems_needed,
|
||||
"alternative_step" = alternative_step,
|
||||
"alt_chems_needed" = alt_chems_needed
|
||||
))
|
||||
else
|
||||
data["patient"] = null
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/operating/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("sync")
|
||||
sync_surgeries()
|
||||
. = TRUE
|
||||
. = TRUE
|
||||
|
||||
#undef MENU_OPERATION
|
||||
#undef MENU_SURGERIES
|
||||
|
||||
@@ -1,98 +1,99 @@
|
||||
/obj/machinery/computer/station_alert
|
||||
name = "station alert console"
|
||||
desc = "Used to access the station's automated alert system."
|
||||
icon_screen = "alert:0"
|
||||
icon_keyboard = "atmos_key"
|
||||
circuit = /obj/item/circuitboard/computer/stationalert
|
||||
var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list())
|
||||
|
||||
light_color = LIGHT_COLOR_CYAN
|
||||
|
||||
/obj/machinery/computer/station_alert/Initialize()
|
||||
. = ..()
|
||||
GLOB.alert_consoles += src
|
||||
|
||||
/obj/machinery/computer/station_alert/Destroy()
|
||||
GLOB.alert_consoles -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/station_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "station_alert", name, 300, 500, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/station_alert/ui_data(mob/user)
|
||||
. = list()
|
||||
|
||||
.["alarms"] = list()
|
||||
for(var/class in alarms)
|
||||
.["alarms"][class] = list()
|
||||
for(var/area in alarms[class])
|
||||
.["alarms"][class] += area
|
||||
|
||||
/obj/machinery/computer/station_alert/proc/triggerAlarm(class, area/A, O, obj/source)
|
||||
if(source.z != z)
|
||||
return
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
|
||||
var/list/L = alarms[class]
|
||||
for(var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/sources = alarm[3]
|
||||
if (!(source in sources))
|
||||
sources += source
|
||||
return 1
|
||||
var/obj/machinery/camera/C = null
|
||||
var/list/CL = null
|
||||
if(O && islist(O))
|
||||
CL = O
|
||||
if (CL.len == 1)
|
||||
C = CL[1]
|
||||
else if(O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C ? C : O), list(source))
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/station_alert/proc/cancelAlarm(class, area/A, obj/origin)
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
var/list/L = alarms[class]
|
||||
var/cleared = 0
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/srcs = alarm[3]
|
||||
if (origin in srcs)
|
||||
srcs -= origin
|
||||
if (srcs.len == 0)
|
||||
cleared = 1
|
||||
L -= I
|
||||
return !cleared
|
||||
|
||||
/obj/machinery/computer/station_alert/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
var/overlay_state = icon_screen
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
add_overlay("[icon_keyboard]_off")
|
||||
return
|
||||
add_overlay(icon_keyboard)
|
||||
var/active_alarms = FALSE
|
||||
for(var/cat in alarms)
|
||||
var/list/L = alarms[cat]
|
||||
if(L.len)
|
||||
active_alarms = TRUE
|
||||
if(active_alarms)
|
||||
overlay_state = "alert:2"
|
||||
add_overlay("alert:2")
|
||||
else
|
||||
overlay_state = "alert:0"
|
||||
add_overlay("alert:0")
|
||||
SSvis_overlays.add_vis_overlay(src, icon, overlay_state, layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, overlay_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir, alpha=128)
|
||||
/obj/machinery/computer/station_alert
|
||||
name = "station alert console"
|
||||
desc = "Used to access the station's automated alert system."
|
||||
icon_screen = "alert:0"
|
||||
icon_keyboard = "atmos_key"
|
||||
circuit = /obj/item/circuitboard/computer/stationalert
|
||||
var/alarms = list("Fire" = list(), "Atmosphere" = list(), "Power" = list())
|
||||
|
||||
light_color = LIGHT_COLOR_CYAN
|
||||
|
||||
/obj/machinery/computer/station_alert/Initialize()
|
||||
. = ..()
|
||||
GLOB.alert_consoles += src
|
||||
|
||||
/obj/machinery/computer/station_alert/Destroy()
|
||||
GLOB.alert_consoles -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/station_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "station_alert", name, 325, 500, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/station_alert/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["alarms"] = list()
|
||||
for(var/class in alarms)
|
||||
data["alarms"][class] = list()
|
||||
for(var/area in alarms[class])
|
||||
data["alarms"][class] += area
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/station_alert/proc/triggerAlarm(class, area/A, O, obj/source)
|
||||
if(source.z != z)
|
||||
return
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
|
||||
var/list/L = alarms[class]
|
||||
for(var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/sources = alarm[3]
|
||||
if (!(source in sources))
|
||||
sources += source
|
||||
return 1
|
||||
var/obj/machinery/camera/C = null
|
||||
var/list/CL = null
|
||||
if(O && islist(O))
|
||||
CL = O
|
||||
if (CL.len == 1)
|
||||
C = CL[1]
|
||||
else if(O && istype(O, /obj/machinery/camera))
|
||||
C = O
|
||||
L[A.name] = list(A, (C ? C : O), list(source))
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/station_alert/proc/cancelAlarm(class, area/A, obj/origin)
|
||||
if(stat & (BROKEN))
|
||||
return
|
||||
var/list/L = alarms[class]
|
||||
var/cleared = 0
|
||||
for (var/I in L)
|
||||
if (I == A.name)
|
||||
var/list/alarm = L[I]
|
||||
var/list/srcs = alarm[3]
|
||||
if (origin in srcs)
|
||||
srcs -= origin
|
||||
if (srcs.len == 0)
|
||||
cleared = 1
|
||||
L -= I
|
||||
return !cleared
|
||||
|
||||
/obj/machinery/computer/station_alert/update_icon()
|
||||
..()
|
||||
cut_overlays()
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
var/overlay_state = icon_screen
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
add_overlay("[icon_keyboard]_off")
|
||||
return
|
||||
add_overlay(icon_keyboard)
|
||||
var/active_alarms = FALSE
|
||||
for(var/cat in alarms)
|
||||
var/list/L = alarms[cat]
|
||||
if(L.len)
|
||||
active_alarms = TRUE
|
||||
if(active_alarms)
|
||||
overlay_state = "alert:2"
|
||||
add_overlay("alert:2")
|
||||
else
|
||||
overlay_state = "alert:0"
|
||||
add_overlay("alert:0")
|
||||
SSvis_overlays.add_vis_overlay(src, icon, overlay_state, layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, overlay_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir, alpha=128)
|
||||
|
||||
@@ -1434,7 +1434,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ai_airlock", name, 550, 456, master_ui, state)
|
||||
ui = new(user, src, ui_key, "ai_airlock", name, 500, 390, master_ui, state)
|
||||
ui.open()
|
||||
return TRUE
|
||||
|
||||
@@ -1503,83 +1503,24 @@
|
||||
if("shock-perm")
|
||||
shock_perm(usr)
|
||||
. = TRUE
|
||||
if("idscan-on")
|
||||
if(wires.is_cut(WIRE_IDSCAN))
|
||||
to_chat(usr, "You can't enable IdScan - The IdScan wire has been cut.")
|
||||
else if(src.aiDisabledIdScanner)
|
||||
aiDisabledIdScanner = FALSE
|
||||
else
|
||||
to_chat(usr, "The IdScan feature is not disabled.")
|
||||
if("idscan-toggle")
|
||||
aiDisabledIdScanner = !aiDisabledIdScanner
|
||||
. = TRUE
|
||||
if("idscan-off")
|
||||
if(wires.is_cut(WIRE_IDSCAN))
|
||||
to_chat(usr, "The IdScan wire has been cut - So, you can't disable it, but it is already disabled anyways.")
|
||||
else if(aiDisabledIdScanner)
|
||||
to_chat(usr, "You've already disabled the IdScan feature.")
|
||||
else
|
||||
aiDisabledIdScanner = TRUE
|
||||
if("emergency-toggle")
|
||||
toggle_emergency(usr)
|
||||
. = TRUE
|
||||
if("emergency-on")
|
||||
emergency_on(usr)
|
||||
if("bolt-toggle")
|
||||
toggle_bolt(usr)
|
||||
. = TRUE
|
||||
if("emergency-off")
|
||||
emergency_off(usr)
|
||||
if("light-toggle")
|
||||
lights = !lights
|
||||
update_icon()
|
||||
. = TRUE
|
||||
if("bolt-raise")
|
||||
bolt_raise(usr)
|
||||
if("safe-toggle")
|
||||
safe = !safe
|
||||
. = TRUE
|
||||
if("bolt-drop")
|
||||
bolt_drop(usr)
|
||||
. = TRUE
|
||||
if("light-on")
|
||||
if(wires.is_cut(WIRE_LIGHT))
|
||||
to_chat(usr, "Control to door bolt lights has been severed.")
|
||||
else if (!src.lights)
|
||||
lights = TRUE
|
||||
update_icon()
|
||||
else
|
||||
to_chat(usr, text("Door bolt lights are already enabled!"))
|
||||
. = TRUE
|
||||
if("light-off")
|
||||
if(wires.is_cut(WIRE_LIGHT))
|
||||
to_chat(usr, "Control to door bolt lights has been severed.")
|
||||
else if (lights)
|
||||
lights = FALSE
|
||||
update_icon()
|
||||
else
|
||||
to_chat(usr, "Door bolt lights are already disabled!")
|
||||
. = TRUE
|
||||
if("safe-on")
|
||||
if(wires.is_cut(WIRE_SAFETY))
|
||||
to_chat(usr, "Control to door sensors is disabled.")
|
||||
else if (!src.safe)
|
||||
safe = TRUE
|
||||
else
|
||||
to_chat(usr, "Firmware reports safeties already in place.")
|
||||
. = TRUE
|
||||
if("safe-off")
|
||||
if(wires.is_cut(WIRE_SAFETY))
|
||||
to_chat(usr, "Control to door sensors is disabled.")
|
||||
else if (safe)
|
||||
safe = FALSE
|
||||
else
|
||||
to_chat(usr, "Firmware reports safeties already overridden.")
|
||||
. = TRUE
|
||||
if("speed-on")
|
||||
if(wires.is_cut(WIRE_TIMING))
|
||||
to_chat(usr, "Control to door timing circuitry has been severed.")
|
||||
else if (!src.normalspeed)
|
||||
normalspeed = 1
|
||||
else
|
||||
to_chat(usr,"Door timing circuitry currently operating normally.")
|
||||
. = TRUE
|
||||
if("speed-off")
|
||||
if(wires.is_cut(WIRE_TIMING))
|
||||
to_chat(usr, "Control to door timing circuitry has been severed.")
|
||||
else if (normalspeed)
|
||||
normalspeed = 0
|
||||
else
|
||||
to_chat(usr, "Door timing circuitry already accelerated.")
|
||||
if("speed-toggle")
|
||||
normalspeed = !normalspeed
|
||||
|
||||
. = TRUE
|
||||
if("open-close")
|
||||
@@ -1617,45 +1558,26 @@
|
||||
log_combat(user, src, "electrified")
|
||||
set_electrified(ELECTRIFIED_PERMANENT)
|
||||
|
||||
/obj/machinery/door/airlock/proc/emergency_on(mob/user)
|
||||
if(!user_allowed(user))
|
||||
return
|
||||
if (!emergency)
|
||||
emergency = TRUE
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "Emergency access is already enabled!")
|
||||
|
||||
/obj/machinery/door/airlock/proc/emergency_off(mob/user)
|
||||
if(!user_allowed(user))
|
||||
return
|
||||
if (emergency)
|
||||
emergency = FALSE
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "Emergency access is already disabled!")
|
||||
|
||||
/obj/machinery/door/airlock/proc/bolt_raise(mob/user)
|
||||
/obj/machinery/door/airlock/proc/toggle_bolt(mob/user)
|
||||
if(!user_allowed(user))
|
||||
return
|
||||
if(wires.is_cut(WIRE_BOLTS))
|
||||
to_chat(user, "The door bolt drop wire is cut - you can't raise the door bolts")
|
||||
else if(!src.locked)
|
||||
to_chat(user, "The door bolts are already up")
|
||||
else
|
||||
if(src.hasPower())
|
||||
unbolt()
|
||||
to_chat(user, "<span class='warning'>The door bolt drop wire is cut - you can't toggle the door bolts.</span>")
|
||||
return
|
||||
if(locked)
|
||||
if(!hasPower())
|
||||
to_chat(user, "<span class='warning'>The door has no power - you can't raise the door bolts.</span>")
|
||||
else
|
||||
to_chat(user, "Cannot raise door bolts due to power failure")
|
||||
|
||||
/obj/machinery/door/airlock/proc/bolt_drop(mob/user)
|
||||
if(!user_allowed(user))
|
||||
return
|
||||
if(wires.is_cut(WIRE_BOLTS))
|
||||
to_chat(user, "You can't drop the door bolts - The door bolt dropping wire has been cut.")
|
||||
unbolt()
|
||||
else
|
||||
bolt()
|
||||
|
||||
/obj/machinery/door/airlock/proc/toggle_emergency(mob/user)
|
||||
if(!user_allowed(user))
|
||||
return
|
||||
emergency = !emergency
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/door/airlock/proc/user_toggle_open(mob/user)
|
||||
if(!user_allowed(user))
|
||||
return
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
|
||||
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "airlock_electronics", name, 975, 420, master_ui, state)
|
||||
ui = new(user, src, ui_key, "airlock_electronics", name, 420, 485, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/electronics/airlock/ui_data()
|
||||
@@ -43,13 +43,16 @@
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("clear")
|
||||
if("clear_all")
|
||||
accesses = list()
|
||||
one_access = 0
|
||||
. = TRUE
|
||||
if("one_access")
|
||||
one_access = !one_access
|
||||
. = TRUE
|
||||
if("grant_all")
|
||||
accesses = get_all_accesses()
|
||||
. = TRUE
|
||||
if("set")
|
||||
var/access = text2num(params["access"])
|
||||
if (!(access in accesses))
|
||||
|
||||
@@ -1,256 +1,256 @@
|
||||
#define CHARS_PER_LINE 5
|
||||
#define FONT_SIZE "5pt"
|
||||
#define FONT_COLOR "#09f"
|
||||
#define FONT_STYLE "Arial Black"
|
||||
#define MAX_TIMER 9000
|
||||
|
||||
#define PRESET_SHORT 1200
|
||||
#define PRESET_MEDIUM 1800
|
||||
#define PRESET_LONG 3000
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Brig Door control displays.
|
||||
// Description: This is a controls the timer for the brig doors, displays the timer on itself and
|
||||
// has a popup window when used, allowing to set the timer.
|
||||
// Code Notes: Combination of old brigdoor.dm code from rev4407 and the status_display.dm code
|
||||
// Date: 01/September/2010
|
||||
// Programmer: Veryinky
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/obj/machinery/door_timer
|
||||
name = "door timer"
|
||||
icon = 'icons/obj/status_display.dmi'
|
||||
icon_state = "frame"
|
||||
desc = "A remote control for a door."
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
density = FALSE
|
||||
var/id = null // id of linked machinery/lockers
|
||||
|
||||
var/activation_time = 0
|
||||
var/timer_duration = 0
|
||||
|
||||
var/timing = FALSE // boolean, true/1 timer is on, false/0 means it's not timing
|
||||
var/list/obj/machinery/targets = list()
|
||||
var/obj/item/radio/Radio //needed to send messages to sec radio
|
||||
|
||||
maptext_height = 26
|
||||
maptext_width = 32
|
||||
|
||||
/obj/machinery/door_timer/Initialize()
|
||||
. = ..()
|
||||
|
||||
Radio = new/obj/item/radio(src)
|
||||
Radio.listening = 0
|
||||
|
||||
/obj/machinery/door_timer/Initialize()
|
||||
. = ..()
|
||||
if(id != null)
|
||||
for(var/obj/machinery/door/window/brigdoor/M in urange(20, src))
|
||||
if (M.id == id)
|
||||
targets += M
|
||||
|
||||
for(var/obj/machinery/flasher/F in urange(20, src))
|
||||
if(F.id == id)
|
||||
targets += F
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in urange(20, src))
|
||||
if(C.id == id)
|
||||
targets += C
|
||||
|
||||
if(!targets.len)
|
||||
stat |= BROKEN
|
||||
update_icon()
|
||||
|
||||
|
||||
//Main door timer loop, if it's timing and time is >0 reduce time by 1.
|
||||
// if it's less than 0, open door, reset timer
|
||||
// update the door_timer window and the icon
|
||||
/obj/machinery/door_timer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(timing)
|
||||
if(world.realtime - activation_time >= timer_duration)
|
||||
timer_end() // open doors, reset timer, clear status screen
|
||||
update_icon()
|
||||
|
||||
// has the door power sitatuation changed, if so update icon.
|
||||
/obj/machinery/door_timer/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
// open/closedoor checks if door_timer has power, if so it checks if the
|
||||
// linked door is open/closed (by density) then opens it/closes it.
|
||||
/obj/machinery/door_timer/proc/timer_start()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
activation_time = world.realtime
|
||||
timing = TRUE
|
||||
|
||||
for(var/obj/machinery/door/window/brigdoor/door in targets)
|
||||
if(door.density)
|
||||
continue
|
||||
INVOKE_ASYNC(door, /obj/machinery/door/window/brigdoor.proc/close)
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in targets)
|
||||
if(C.broken)
|
||||
continue
|
||||
if(C.opened && !C.close())
|
||||
continue
|
||||
C.locked = TRUE
|
||||
C.update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/door_timer/proc/timer_end(forced = FALSE)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
if(!forced)
|
||||
Radio.set_frequency(FREQ_SECURITY)
|
||||
Radio.talk_into(src, "Timer has expired. Releasing prisoner.", FREQ_SECURITY)
|
||||
|
||||
timing = FALSE
|
||||
activation_time = null
|
||||
set_timer(0)
|
||||
update_icon()
|
||||
|
||||
for(var/obj/machinery/door/window/brigdoor/door in targets)
|
||||
if(!door.density)
|
||||
continue
|
||||
INVOKE_ASYNC(door, /obj/machinery/door/window/brigdoor.proc/open)
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in targets)
|
||||
if(C.broken)
|
||||
continue
|
||||
if(C.opened)
|
||||
continue
|
||||
C.locked = FALSE
|
||||
C.update_icon()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/door_timer/proc/time_left(seconds = FALSE)
|
||||
. = max(0,timer_duration - (activation_time ? world.realtime - activation_time : 0))
|
||||
if(seconds)
|
||||
. /= 10
|
||||
|
||||
/obj/machinery/door_timer/proc/set_timer(value)
|
||||
var/new_time = CLAMP(value,0,MAX_TIMER)
|
||||
. = new_time == timer_duration //return 1 on no change
|
||||
timer_duration = new_time
|
||||
|
||||
/obj/machinery/door_timer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "brig_timer", name, 300, 200, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
//icon update function
|
||||
// if NOPOWER, display blank
|
||||
// if BROKEN, display blue screen of death icon AI uses
|
||||
// if timing=true, run update display function
|
||||
/obj/machinery/door_timer/update_icon()
|
||||
if(stat & (NOPOWER))
|
||||
icon_state = "frame"
|
||||
return
|
||||
|
||||
if(stat & (BROKEN))
|
||||
set_picture("ai_bsod")
|
||||
return
|
||||
|
||||
if(timing)
|
||||
var/disp1 = id
|
||||
var/time_left = time_left(seconds = TRUE)
|
||||
var/disp2 = "[add_zero(num2text((time_left / 60) % 60),2)]~[add_zero(num2text(time_left % 60), 2)]"
|
||||
if(length(disp2) > CHARS_PER_LINE)
|
||||
disp2 = "Error"
|
||||
update_display(disp1, disp2)
|
||||
else
|
||||
if(maptext)
|
||||
maptext = ""
|
||||
return
|
||||
|
||||
|
||||
// Adds an icon in case the screen is broken/off, stolen from status_display.dm
|
||||
/obj/machinery/door_timer/proc/set_picture(state)
|
||||
if(maptext)
|
||||
maptext = ""
|
||||
cut_overlays()
|
||||
add_overlay(mutable_appearance('icons/obj/status_display.dmi', state))
|
||||
|
||||
|
||||
//Checks to see if there's 1 line or 2, adds text-icons-numbers/letters over display
|
||||
// Stolen from status_display
|
||||
/obj/machinery/door_timer/proc/update_display(line1, line2)
|
||||
var/new_text = {"<div style="font-size:[FONT_SIZE];color:[FONT_COLOR];font:'[FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
|
||||
if(maptext != new_text)
|
||||
maptext = new_text
|
||||
|
||||
/obj/machinery/door_timer/ui_data()
|
||||
var/list/data = list()
|
||||
var/time_left = time_left(seconds = TRUE)
|
||||
data["seconds"] = round(time_left % 60)
|
||||
data["minutes"] = round((time_left - data["seconds"]) / 60)
|
||||
data["timing"] = timing
|
||||
data["flash_charging"] = FALSE
|
||||
for(var/obj/machinery/flasher/F in targets)
|
||||
if(F.last_flash && (F.last_flash + 150) > world.time)
|
||||
data["flash_charging"] = TRUE
|
||||
break
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/door_timer/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, "<span class='warning'>Access denied.</span>")
|
||||
return FALSE
|
||||
|
||||
switch(action)
|
||||
if("time")
|
||||
var/value = text2num(params["adjust"])
|
||||
if(value)
|
||||
. = set_timer(time_left()+value)
|
||||
if("start")
|
||||
timer_start()
|
||||
if("stop")
|
||||
timer_end(forced = TRUE)
|
||||
if("flash")
|
||||
for(var/obj/machinery/flasher/F in targets)
|
||||
F.flash()
|
||||
if("preset")
|
||||
var/preset = params["preset"]
|
||||
var/preset_time = time_left()
|
||||
switch(preset)
|
||||
if("short")
|
||||
preset_time = PRESET_SHORT
|
||||
if("medium")
|
||||
preset_time = PRESET_MEDIUM
|
||||
if("long")
|
||||
preset_time = PRESET_LONG
|
||||
. = set_timer(preset_time)
|
||||
if(timing)
|
||||
activation_time = world.realtime
|
||||
else
|
||||
. = FALSE
|
||||
|
||||
|
||||
#undef PRESET_SHORT
|
||||
#undef PRESET_MEDIUM
|
||||
#undef PRESET_LONG
|
||||
|
||||
#undef MAX_TIMER
|
||||
#undef FONT_SIZE
|
||||
#undef FONT_COLOR
|
||||
#undef FONT_STYLE
|
||||
#undef CHARS_PER_LINE
|
||||
#define CHARS_PER_LINE 5
|
||||
#define FONT_SIZE "5pt"
|
||||
#define FONT_COLOR "#09f"
|
||||
#define FONT_STYLE "Arial Black"
|
||||
#define MAX_TIMER 9000
|
||||
|
||||
#define PRESET_SHORT 1200
|
||||
#define PRESET_MEDIUM 1800
|
||||
#define PRESET_LONG 3000
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Brig Door control displays.
|
||||
// Description: This is a controls the timer for the brig doors, displays the timer on itself and
|
||||
// has a popup window when used, allowing to set the timer.
|
||||
// Code Notes: Combination of old brigdoor.dm code from rev4407 and the status_display.dm code
|
||||
// Date: 01/September/2010
|
||||
// Programmer: Veryinky
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/obj/machinery/door_timer
|
||||
name = "door timer"
|
||||
icon = 'icons/obj/status_display.dmi'
|
||||
icon_state = "frame"
|
||||
desc = "A remote control for a door."
|
||||
req_access = list(ACCESS_SECURITY)
|
||||
density = FALSE
|
||||
var/id = null // id of linked machinery/lockers
|
||||
|
||||
var/activation_time = 0
|
||||
var/timer_duration = 0
|
||||
|
||||
var/timing = FALSE // boolean, true/1 timer is on, false/0 means it's not timing
|
||||
var/list/obj/machinery/targets = list()
|
||||
var/obj/item/radio/Radio //needed to send messages to sec radio
|
||||
|
||||
maptext_height = 26
|
||||
maptext_width = 32
|
||||
|
||||
/obj/machinery/door_timer/Initialize()
|
||||
. = ..()
|
||||
|
||||
Radio = new/obj/item/radio(src)
|
||||
Radio.listening = 0
|
||||
|
||||
/obj/machinery/door_timer/Initialize()
|
||||
. = ..()
|
||||
if(id != null)
|
||||
for(var/obj/machinery/door/window/brigdoor/M in urange(20, src))
|
||||
if (M.id == id)
|
||||
targets += M
|
||||
|
||||
for(var/obj/machinery/flasher/F in urange(20, src))
|
||||
if(F.id == id)
|
||||
targets += F
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in urange(20, src))
|
||||
if(C.id == id)
|
||||
targets += C
|
||||
|
||||
if(!targets.len)
|
||||
stat |= BROKEN
|
||||
update_icon()
|
||||
|
||||
|
||||
//Main door timer loop, if it's timing and time is >0 reduce time by 1.
|
||||
// if it's less than 0, open door, reset timer
|
||||
// update the door_timer window and the icon
|
||||
/obj/machinery/door_timer/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(timing)
|
||||
if(world.realtime - activation_time >= timer_duration)
|
||||
timer_end() // open doors, reset timer, clear status screen
|
||||
update_icon()
|
||||
|
||||
// has the door power sitatuation changed, if so update icon.
|
||||
/obj/machinery/door_timer/power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
// open/closedoor checks if door_timer has power, if so it checks if the
|
||||
// linked door is open/closed (by density) then opens it/closes it.
|
||||
/obj/machinery/door_timer/proc/timer_start()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
activation_time = world.realtime
|
||||
timing = TRUE
|
||||
|
||||
for(var/obj/machinery/door/window/brigdoor/door in targets)
|
||||
if(door.density)
|
||||
continue
|
||||
INVOKE_ASYNC(door, /obj/machinery/door/window/brigdoor.proc/close)
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in targets)
|
||||
if(C.broken)
|
||||
continue
|
||||
if(C.opened && !C.close())
|
||||
continue
|
||||
C.locked = TRUE
|
||||
C.update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/door_timer/proc/timer_end(forced = FALSE)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
|
||||
if(!forced)
|
||||
Radio.set_frequency(FREQ_SECURITY)
|
||||
Radio.talk_into(src, "Timer has expired. Releasing prisoner.", FREQ_SECURITY)
|
||||
|
||||
timing = FALSE
|
||||
activation_time = null
|
||||
set_timer(0)
|
||||
update_icon()
|
||||
|
||||
for(var/obj/machinery/door/window/brigdoor/door in targets)
|
||||
if(!door.density)
|
||||
continue
|
||||
INVOKE_ASYNC(door, /obj/machinery/door/window/brigdoor.proc/open)
|
||||
|
||||
for(var/obj/structure/closet/secure_closet/brig/C in targets)
|
||||
if(C.broken)
|
||||
continue
|
||||
if(C.opened)
|
||||
continue
|
||||
C.locked = FALSE
|
||||
C.update_icon()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/door_timer/proc/time_left(seconds = FALSE)
|
||||
. = max(0,timer_duration - (activation_time ? world.realtime - activation_time : 0))
|
||||
if(seconds)
|
||||
. /= 10
|
||||
|
||||
/obj/machinery/door_timer/proc/set_timer(value)
|
||||
var/new_time = CLAMP(value,0,MAX_TIMER)
|
||||
. = new_time == timer_duration //return 1 on no change
|
||||
timer_duration = new_time
|
||||
|
||||
/obj/machinery/door_timer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "brig_timer", name, 300, 138, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
//icon update function
|
||||
// if NOPOWER, display blank
|
||||
// if BROKEN, display blue screen of death icon AI uses
|
||||
// if timing=true, run update display function
|
||||
/obj/machinery/door_timer/update_icon()
|
||||
if(stat & (NOPOWER))
|
||||
icon_state = "frame"
|
||||
return
|
||||
|
||||
if(stat & (BROKEN))
|
||||
set_picture("ai_bsod")
|
||||
return
|
||||
|
||||
if(timing)
|
||||
var/disp1 = id
|
||||
var/time_left = time_left(seconds = TRUE)
|
||||
var/disp2 = "[add_zero(num2text((time_left / 60) % 60),2)]~[add_zero(num2text(time_left % 60), 2)]"
|
||||
if(length(disp2) > CHARS_PER_LINE)
|
||||
disp2 = "Error"
|
||||
update_display(disp1, disp2)
|
||||
else
|
||||
if(maptext)
|
||||
maptext = ""
|
||||
return
|
||||
|
||||
|
||||
// Adds an icon in case the screen is broken/off, stolen from status_display.dm
|
||||
/obj/machinery/door_timer/proc/set_picture(state)
|
||||
if(maptext)
|
||||
maptext = ""
|
||||
cut_overlays()
|
||||
add_overlay(mutable_appearance('icons/obj/status_display.dmi', state))
|
||||
|
||||
|
||||
//Checks to see if there's 1 line or 2, adds text-icons-numbers/letters over display
|
||||
// Stolen from status_display
|
||||
/obj/machinery/door_timer/proc/update_display(line1, line2)
|
||||
var/new_text = {"<div style="font-size:[FONT_SIZE];color:[FONT_COLOR];font:'[FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
|
||||
if(maptext != new_text)
|
||||
maptext = new_text
|
||||
|
||||
/obj/machinery/door_timer/ui_data()
|
||||
var/list/data = list()
|
||||
var/time_left = time_left(seconds = TRUE)
|
||||
data["seconds"] = round(time_left % 60)
|
||||
data["minutes"] = round((time_left - data["seconds"]) / 60)
|
||||
data["timing"] = timing
|
||||
data["flash_charging"] = FALSE
|
||||
for(var/obj/machinery/flasher/F in targets)
|
||||
if(F.last_flash && (F.last_flash + 150) > world.time)
|
||||
data["flash_charging"] = TRUE
|
||||
break
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/door_timer/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, "<span class='warning'>Access denied.</span>")
|
||||
return FALSE
|
||||
|
||||
switch(action)
|
||||
if("time")
|
||||
var/value = text2num(params["adjust"])
|
||||
if(value)
|
||||
. = set_timer(time_left()+value)
|
||||
if("start")
|
||||
timer_start()
|
||||
if("stop")
|
||||
timer_end(forced = TRUE)
|
||||
if("flash")
|
||||
for(var/obj/machinery/flasher/F in targets)
|
||||
F.flash()
|
||||
if("preset")
|
||||
var/preset = params["preset"]
|
||||
var/preset_time = time_left()
|
||||
switch(preset)
|
||||
if("short")
|
||||
preset_time = PRESET_SHORT
|
||||
if("medium")
|
||||
preset_time = PRESET_MEDIUM
|
||||
if("long")
|
||||
preset_time = PRESET_LONG
|
||||
. = set_timer(preset_time)
|
||||
if(timing)
|
||||
activation_time = world.realtime
|
||||
else
|
||||
. = FALSE
|
||||
|
||||
|
||||
#undef PRESET_SHORT
|
||||
#undef PRESET_MEDIUM
|
||||
#undef PRESET_LONG
|
||||
|
||||
#undef MAX_TIMER
|
||||
#undef FONT_SIZE
|
||||
#undef FONT_COLOR
|
||||
#undef FONT_STYLE
|
||||
#undef CHARS_PER_LINE
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "gulag_item_reclaimer", name, 455, 440, master_ui, state)
|
||||
ui = new(user, src, ui_key, "gulag_item_reclaimer", name, 300, 400, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/gulag_item_reclaimer/ui_data(mob/user)
|
||||
|
||||
@@ -1,443 +1,453 @@
|
||||
// SUIT STORAGE UNIT /////////////////
|
||||
/obj/machinery/suit_storage_unit
|
||||
name = "suit storage unit"
|
||||
desc = "An industrial unit made to hold and decontaminate irradiated equipment. It comes with a built-in UV cauterization mechanism. A small warning label advises that organic matter should not be placed into the unit."
|
||||
icon = 'icons/obj/machines/suit_storage.dmi'
|
||||
icon_state = "close"
|
||||
density = TRUE
|
||||
max_integrity = 250
|
||||
|
||||
var/obj/item/clothing/suit/space/suit = null
|
||||
var/obj/item/clothing/head/helmet/space/helmet = null
|
||||
var/obj/item/clothing/mask/mask = null
|
||||
var/obj/item/storage = null
|
||||
|
||||
var/suit_type = null
|
||||
var/helmet_type = null
|
||||
var/mask_type = null
|
||||
var/storage_type = null
|
||||
|
||||
state_open = FALSE
|
||||
var/locked = FALSE
|
||||
panel_open = FALSE
|
||||
var/safeties = TRUE
|
||||
|
||||
var/uv = FALSE
|
||||
var/uv_super = FALSE
|
||||
var/uv_cycles = 6
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/suit_storage_unit/standard_unit
|
||||
suit_type = /obj/item/clothing/suit/space/eva
|
||||
helmet_type = /obj/item/clothing/head/helmet/space/eva
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/captain
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/captain
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/captain
|
||||
|
||||
/obj/machinery/suit_storage_unit/engine
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots
|
||||
|
||||
/obj/machinery/suit_storage_unit/ce
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/elite
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots/advance
|
||||
|
||||
/obj/machinery/suit_storage_unit/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/security
|
||||
|
||||
/obj/machinery/suit_storage_unit/hos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security/hos
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/internals/oxygen
|
||||
|
||||
/obj/machinery/suit_storage_unit/atmos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/atmos
|
||||
mask_type = /obj/item/clothing/mask/gas
|
||||
storage_type = /obj/item/watertank/atmos
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining
|
||||
suit_type = /obj/item/clothing/suit/hooded/explorer/standard
|
||||
mask_type = /obj/item/clothing/mask/gas/explorer
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining/eva
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/mining
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/cmo
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/medical
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/rd
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/rd
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/syndicate
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/syndi
|
||||
mask_type = /obj/item/clothing/mask/gas/syndicate
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/harness
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/command
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/sec
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/engineer
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/engi
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/medical
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/med
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/radsuit
|
||||
name = "radiation suit storage unit"
|
||||
suit_type = /obj/item/clothing/suit/radiation
|
||||
helmet_type = /obj/item/clothing/head/radiation
|
||||
storage_type = /obj/item/geiger_counter
|
||||
|
||||
/obj/machinery/suit_storage_unit/open
|
||||
state_open = TRUE
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/suit_storage_unit/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/suit_storage_unit(src)
|
||||
if(suit_type)
|
||||
suit = new suit_type(src)
|
||||
if(helmet_type)
|
||||
helmet = new helmet_type(src)
|
||||
if(mask_type)
|
||||
mask = new mask_type(src)
|
||||
if(storage_type)
|
||||
storage = new storage_type(src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/Destroy()
|
||||
QDEL_NULL(suit)
|
||||
QDEL_NULL(helmet)
|
||||
QDEL_NULL(mask)
|
||||
QDEL_NULL(storage)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(uv)
|
||||
if(uv_super)
|
||||
add_overlay("super")
|
||||
else if(occupant)
|
||||
add_overlay("uvhuman")
|
||||
else
|
||||
add_overlay("uv")
|
||||
else if(state_open)
|
||||
if(stat & BROKEN)
|
||||
add_overlay("broken")
|
||||
else
|
||||
add_overlay("open")
|
||||
if(suit)
|
||||
add_overlay("suit")
|
||||
if(helmet)
|
||||
add_overlay("helm")
|
||||
if(storage)
|
||||
add_overlay("storage")
|
||||
else if(occupant)
|
||||
add_overlay("human")
|
||||
|
||||
/obj/machinery/suit_storage_unit/power_change()
|
||||
..()
|
||||
if(!is_operational() && state_open)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/dump_contents()
|
||||
dropContents()
|
||||
helmet = null
|
||||
suit = null
|
||||
mask = null
|
||||
storage = null
|
||||
occupant = null
|
||||
|
||||
/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
open_machine()
|
||||
dump_contents()
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/suit_storage_unit/MouseDrop_T(atom/A, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !Adjacent(A) || !isliving(A))
|
||||
return
|
||||
var/mob/living/target = A
|
||||
if(!state_open)
|
||||
to_chat(user, "<span class='warning'>The unit's doors are shut!</span>")
|
||||
return
|
||||
if(!is_operational())
|
||||
to_chat(user, "<span class='warning'>The unit is not operational!</span>")
|
||||
return
|
||||
if(occupant || helmet || suit || storage)
|
||||
to_chat(user, "<span class='warning'>It's too cluttered inside to fit in!</span>")
|
||||
return
|
||||
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] starts squeezing into [src]!</span>", "<span class='notice'>You start working your way into [src]...</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] starts shoving [target] into [src]!</span>", "<span class='userdanger'>[user] starts shoving you into [src]!</span>")
|
||||
|
||||
if(do_mob(user, target, 30))
|
||||
if(occupant || helmet || suit || storage)
|
||||
return
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] slips into [src] and closes the door behind [user.p_them()]!</span>", "<span class=notice'>You slip into [src]'s cramped space and shut its door.</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] pushes [target] into [src] and shuts its door!<span>", "<span class='userdanger'>[user] shoves you into [src] and shuts the door!</span>")
|
||||
close_machine(target)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/cook()
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(uv_cycles)
|
||||
uv_cycles--
|
||||
uv = TRUE
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
if(occupant)
|
||||
if(uv_super)
|
||||
mob_occupant.adjustFireLoss(rand(20, 36))
|
||||
else
|
||||
mob_occupant.adjustFireLoss(rand(10, 16))
|
||||
mob_occupant.emote("scream")
|
||||
addtimer(CALLBACK(src, .proc/cook), 50)
|
||||
else
|
||||
uv_cycles = initial(uv_cycles)
|
||||
uv = FALSE
|
||||
locked = FALSE
|
||||
if(uv_super)
|
||||
visible_message("<span class='warning'>[src]'s door creaks open with a loud whining noise. A cloud of foul black smoke escapes from its chamber.</span>")
|
||||
playsound(src, 'sound/machines/airlock_alien_prying.ogg', 50, 1)
|
||||
helmet = null
|
||||
qdel(helmet)
|
||||
suit = null
|
||||
qdel(suit) // Delete everything but the occupant.
|
||||
mask = null
|
||||
qdel(mask)
|
||||
storage = null
|
||||
qdel(storage)
|
||||
// The wires get damaged too.
|
||||
wires.cut_all()
|
||||
else
|
||||
if(!occupant)
|
||||
visible_message("<span class='notice'>[src]'s door slides open. The glowing yellow lights dim to a gentle green.</span>")
|
||||
else
|
||||
visible_message("<span class='warning'>[src]'s door slides open, barraging you with the nauseating smell of charred flesh.</span>")
|
||||
mob_occupant.radiation = 0
|
||||
playsound(src, 'sound/machines/airlockclose.ogg', 25, 1)
|
||||
var/list/things_to_clear = list() //Done this way since using GetAllContents on the SSU itself would include circuitry and such.
|
||||
if(suit)
|
||||
things_to_clear += suit
|
||||
things_to_clear += suit.GetAllContents()
|
||||
if(helmet)
|
||||
things_to_clear += helmet
|
||||
things_to_clear += helmet.GetAllContents()
|
||||
if(mask)
|
||||
things_to_clear += mask
|
||||
things_to_clear += mask.GetAllContents()
|
||||
if(storage)
|
||||
things_to_clear += storage
|
||||
things_to_clear += storage.GetAllContents()
|
||||
if(occupant)
|
||||
things_to_clear += occupant
|
||||
things_to_clear += occupant.GetAllContents()
|
||||
for(var/atom/movable/AM in things_to_clear) //Scorches away blood and forensic evidence, although the SSU itself is unaffected
|
||||
SEND_SIGNAL(AM, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRONG)
|
||||
AM.clean_blood()
|
||||
AM.fingerprints = list()
|
||||
var/datum/component/radioactive/contamination = AM.GetComponent(/datum/component/radioactive)
|
||||
if(contamination)
|
||||
qdel(contamination)
|
||||
open_machine(FALSE)
|
||||
if(occupant)
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/shock(mob/user, prb)
|
||||
if(!prob(prb))
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(electrocute_mob(user, src, src, 1, TRUE))
|
||||
return 1
|
||||
|
||||
/obj/machinery/suit_storage_unit/relaymove(mob/user)
|
||||
if(locked)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
return
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/container_resist(mob/living/user)
|
||||
if(!locked)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
add_fingerprint(user)
|
||||
if(locked)
|
||||
visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors...</span>")
|
||||
addtimer(CALLBACK(src, .proc/resist_open, user), 300)
|
||||
else
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/resist_open(mob/user)
|
||||
if(!state_open && occupant && (user in src) && user.stat == 0) // Check they're still here.
|
||||
visible_message("<span class='notice'>You see [user] burst out of [src]!</span>", \
|
||||
"<span class='notice'>You escape the cramped confines of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/suit_storage_unit/attackby(obj/item/I, mob/user, params)
|
||||
if(state_open && is_operational())
|
||||
if(istype(I, /obj/item/clothing/head/mob_holder))
|
||||
to_chat(user, "<span class='warning'>You can't quite fit that in while you hold it!</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/clothing/suit))
|
||||
if(suit)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a suit!.</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
suit = I
|
||||
else if(istype(I, /obj/item/clothing/head))
|
||||
if(helmet)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a helmet!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
helmet = I
|
||||
else if(istype(I, /obj/item/clothing/mask))
|
||||
if(mask)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a mask!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
mask = I
|
||||
else
|
||||
if(storage)
|
||||
to_chat(user, "<span class='warning'>The auxiliary storage compartment is full!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
storage = I
|
||||
|
||||
visible_message("<span class='notice'>[user] inserts [I] into [src]</span>", "<span class='notice'>You load [I] into [src].</span>")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(panel_open && is_wire_tool(I))
|
||||
wires.interact(user)
|
||||
return
|
||||
if(!state_open)
|
||||
if(default_deconstruction_screwdriver(user, "panel", "close", I))
|
||||
return
|
||||
if(default_pry_open(I))
|
||||
dump_contents()
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_data()
|
||||
var/list/data = list()
|
||||
data["locked"] = locked
|
||||
data["open"] = state_open
|
||||
data["safeties"] = safeties
|
||||
data["uv_active"] = uv
|
||||
data["uv_super"] = uv_super
|
||||
if(helmet)
|
||||
data["helmet"] = helmet.name
|
||||
if(suit)
|
||||
data["suit"] = suit.name
|
||||
if(mask)
|
||||
data["mask"] = mask.name
|
||||
if(storage)
|
||||
data["storage"] = storage.name
|
||||
if(occupant)
|
||||
data["occupied"] = 1
|
||||
return data
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_act(action, params)
|
||||
if(..() || uv)
|
||||
return
|
||||
switch(action)
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine(0)
|
||||
if(occupant)
|
||||
dump_contents() // Dump out contents if someone is in there.
|
||||
. = TRUE
|
||||
if("lock")
|
||||
if(state_open)
|
||||
return
|
||||
locked = !locked
|
||||
. = TRUE
|
||||
if("uv")
|
||||
if(occupant && safeties)
|
||||
return
|
||||
else if(!helmet && !mask && !suit && !storage && !occupant)
|
||||
return
|
||||
else
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
to_chat(mob_occupant, "<span class='userdanger'>[src]'s confines grow warm, then hot, then scorching. You're being burned [!mob_occupant.stat ? "alive" : "away"]!</span>")
|
||||
cook()
|
||||
. = TRUE
|
||||
if("dispense")
|
||||
if(!state_open)
|
||||
return
|
||||
|
||||
var/static/list/valid_items = list("helmet", "suit", "mask", "storage")
|
||||
var/item_name = params["item"]
|
||||
if(item_name in valid_items)
|
||||
var/obj/item/I = vars[item_name]
|
||||
vars[item_name] = null
|
||||
if(I)
|
||||
I.forceMove(loc)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
// SUIT STORAGE UNIT /////////////////
|
||||
/obj/machinery/suit_storage_unit
|
||||
name = "suit storage unit"
|
||||
desc = "An industrial unit made to hold and decontaminate irradiated equipment. It comes with a built-in UV cauterization mechanism. A small warning label advises that organic matter should not be placed into the unit."
|
||||
icon = 'icons/obj/machines/suit_storage.dmi'
|
||||
icon_state = "close"
|
||||
density = TRUE
|
||||
max_integrity = 250
|
||||
|
||||
var/obj/item/clothing/suit/space/suit = null
|
||||
var/obj/item/clothing/head/helmet/space/helmet = null
|
||||
var/obj/item/clothing/mask/mask = null
|
||||
var/obj/item/storage = null
|
||||
|
||||
var/suit_type = null
|
||||
var/helmet_type = null
|
||||
var/mask_type = null
|
||||
var/storage_type = null
|
||||
|
||||
state_open = FALSE
|
||||
var/locked = FALSE
|
||||
panel_open = FALSE
|
||||
var/safeties = TRUE
|
||||
|
||||
var/uv = FALSE
|
||||
var/uv_super = FALSE
|
||||
var/uv_cycles = 6
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/suit_storage_unit/standard_unit
|
||||
suit_type = /obj/item/clothing/suit/space/eva
|
||||
helmet_type = /obj/item/clothing/head/helmet/space/eva
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/captain
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/captain
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/captain
|
||||
|
||||
/obj/machinery/suit_storage_unit/engine
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots
|
||||
|
||||
/obj/machinery/suit_storage_unit/ce
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/elite
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots/advance
|
||||
|
||||
/obj/machinery/suit_storage_unit/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/security
|
||||
|
||||
/obj/machinery/suit_storage_unit/hos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security/hos
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/internals/oxygen
|
||||
|
||||
/obj/machinery/suit_storage_unit/atmos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/atmos
|
||||
mask_type = /obj/item/clothing/mask/gas
|
||||
storage_type = /obj/item/watertank/atmos
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining
|
||||
suit_type = /obj/item/clothing/suit/hooded/explorer/standard
|
||||
mask_type = /obj/item/clothing/mask/gas/explorer
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining/eva
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/mining
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/cmo
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/medical
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/rd
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/rd
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/syndicate
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/syndi
|
||||
mask_type = /obj/item/clothing/mask/gas/syndicate
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/harness
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/command
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/sec
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/engineer
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/engi
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/medical
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/med
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/radsuit
|
||||
name = "radiation suit storage unit"
|
||||
suit_type = /obj/item/clothing/suit/radiation
|
||||
helmet_type = /obj/item/clothing/head/radiation
|
||||
storage_type = /obj/item/geiger_counter
|
||||
|
||||
/obj/machinery/suit_storage_unit/open
|
||||
state_open = TRUE
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/suit_storage_unit/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/suit_storage_unit(src)
|
||||
if(suit_type)
|
||||
suit = new suit_type(src)
|
||||
if(helmet_type)
|
||||
helmet = new helmet_type(src)
|
||||
if(mask_type)
|
||||
mask = new mask_type(src)
|
||||
if(storage_type)
|
||||
storage = new storage_type(src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/Destroy()
|
||||
QDEL_NULL(suit)
|
||||
QDEL_NULL(helmet)
|
||||
QDEL_NULL(mask)
|
||||
QDEL_NULL(storage)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(uv)
|
||||
if(uv_super)
|
||||
add_overlay("super")
|
||||
else if(occupant)
|
||||
add_overlay("uvhuman")
|
||||
else
|
||||
add_overlay("uv")
|
||||
else if(state_open)
|
||||
if(stat & BROKEN)
|
||||
add_overlay("broken")
|
||||
else
|
||||
add_overlay("open")
|
||||
if(suit)
|
||||
add_overlay("suit")
|
||||
if(helmet)
|
||||
add_overlay("helm")
|
||||
if(storage)
|
||||
add_overlay("storage")
|
||||
else if(occupant)
|
||||
add_overlay("human")
|
||||
|
||||
/obj/machinery/suit_storage_unit/power_change()
|
||||
..()
|
||||
if(!is_operational() && state_open)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/dump_contents()
|
||||
dropContents()
|
||||
helmet = null
|
||||
suit = null
|
||||
mask = null
|
||||
storage = null
|
||||
occupant = null
|
||||
|
||||
/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
open_machine()
|
||||
dump_contents()
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/suit_storage_unit/MouseDrop_T(atom/A, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !Adjacent(A) || !isliving(A))
|
||||
return
|
||||
var/mob/living/target = A
|
||||
if(!state_open)
|
||||
to_chat(user, "<span class='warning'>The unit's doors are shut!</span>")
|
||||
return
|
||||
if(!is_operational())
|
||||
to_chat(user, "<span class='warning'>The unit is not operational!</span>")
|
||||
return
|
||||
if(occupant || helmet || suit || storage)
|
||||
to_chat(user, "<span class='warning'>It's too cluttered inside to fit in!</span>")
|
||||
return
|
||||
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] starts squeezing into [src]!</span>", "<span class='notice'>You start working your way into [src]...</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] starts shoving [target] into [src]!</span>", "<span class='userdanger'>[user] starts shoving you into [src]!</span>")
|
||||
|
||||
if(do_mob(user, target, 30))
|
||||
if(occupant || helmet || suit || storage)
|
||||
return
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] slips into [src] and closes the door behind [user.p_them()]!</span>", "<span class=notice'>You slip into [src]'s cramped space and shut its door.</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] pushes [target] into [src] and shuts its door!<span>", "<span class='userdanger'>[user] shoves you into [src] and shuts the door!</span>")
|
||||
close_machine(target)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/cook()
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(uv_cycles)
|
||||
uv_cycles--
|
||||
uv = TRUE
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
if(occupant)
|
||||
if(uv_super)
|
||||
mob_occupant.adjustFireLoss(rand(20, 36))
|
||||
else
|
||||
mob_occupant.adjustFireLoss(rand(10, 16))
|
||||
mob_occupant.emote("scream")
|
||||
addtimer(CALLBACK(src, .proc/cook), 50)
|
||||
else
|
||||
uv_cycles = initial(uv_cycles)
|
||||
uv = FALSE
|
||||
locked = FALSE
|
||||
if(uv_super)
|
||||
visible_message("<span class='warning'>[src]'s door creaks open with a loud whining noise. A cloud of foul black smoke escapes from its chamber.</span>")
|
||||
playsound(src, 'sound/machines/airlock_alien_prying.ogg', 50, 1)
|
||||
helmet = null
|
||||
qdel(helmet)
|
||||
suit = null
|
||||
qdel(suit) // Delete everything but the occupant.
|
||||
mask = null
|
||||
qdel(mask)
|
||||
storage = null
|
||||
qdel(storage)
|
||||
// The wires get damaged too.
|
||||
wires.cut_all()
|
||||
else
|
||||
if(!occupant)
|
||||
visible_message("<span class='notice'>[src]'s door slides open. The glowing yellow lights dim to a gentle green.</span>")
|
||||
else
|
||||
visible_message("<span class='warning'>[src]'s door slides open, barraging you with the nauseating smell of charred flesh.</span>")
|
||||
mob_occupant.radiation = 0
|
||||
playsound(src, 'sound/machines/airlockclose.ogg', 25, 1)
|
||||
var/list/things_to_clear = list() //Done this way since using GetAllContents on the SSU itself would include circuitry and such.
|
||||
if(suit)
|
||||
things_to_clear += suit
|
||||
things_to_clear += suit.GetAllContents()
|
||||
if(helmet)
|
||||
things_to_clear += helmet
|
||||
things_to_clear += helmet.GetAllContents()
|
||||
if(mask)
|
||||
things_to_clear += mask
|
||||
things_to_clear += mask.GetAllContents()
|
||||
if(storage)
|
||||
things_to_clear += storage
|
||||
things_to_clear += storage.GetAllContents()
|
||||
if(occupant)
|
||||
things_to_clear += occupant
|
||||
things_to_clear += occupant.GetAllContents()
|
||||
for(var/atom/movable/AM in things_to_clear) //Scorches away blood and forensic evidence, although the SSU itself is unaffected
|
||||
SEND_SIGNAL(AM, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRONG)
|
||||
AM.clean_blood()
|
||||
AM.fingerprints = list()
|
||||
var/datum/component/radioactive/contamination = AM.GetComponent(/datum/component/radioactive)
|
||||
if(contamination)
|
||||
qdel(contamination)
|
||||
open_machine(FALSE)
|
||||
if(occupant)
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/shock(mob/user, prb)
|
||||
if(!prob(prb))
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(electrocute_mob(user, src, src, 1, TRUE))
|
||||
return 1
|
||||
|
||||
/obj/machinery/suit_storage_unit/relaymove(mob/user)
|
||||
if(locked)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
return
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/container_resist(mob/living/user)
|
||||
if(!locked)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
add_fingerprint(user)
|
||||
if(locked)
|
||||
visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors...</span>")
|
||||
addtimer(CALLBACK(src, .proc/resist_open, user), 300)
|
||||
else
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/resist_open(mob/user)
|
||||
if(!state_open && occupant && (user in src) && user.stat == 0) // Check they're still here.
|
||||
visible_message("<span class='notice'>You see [user] burst out of [src]!</span>", \
|
||||
"<span class='notice'>You escape the cramped confines of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/suit_storage_unit/attackby(obj/item/I, mob/user, params)
|
||||
if(state_open && is_operational())
|
||||
if(istype(I, /obj/item/clothing/head/mob_holder))
|
||||
to_chat(user, "<span class='warning'>You can't quite fit that in while you hold it!</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/clothing/suit))
|
||||
if(suit)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a suit!.</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
suit = I
|
||||
else if(istype(I, /obj/item/clothing/head))
|
||||
if(helmet)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a helmet!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
helmet = I
|
||||
else if(istype(I, /obj/item/clothing/mask))
|
||||
if(mask)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a mask!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
mask = I
|
||||
else
|
||||
if(storage)
|
||||
to_chat(user, "<span class='warning'>The auxiliary storage compartment is full!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
storage = I
|
||||
|
||||
visible_message("<span class='notice'>[user] inserts [I] into [src]</span>", "<span class='notice'>You load [I] into [src].</span>")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(panel_open && is_wire_tool(I))
|
||||
wires.interact(user)
|
||||
return
|
||||
if(!state_open)
|
||||
if(default_deconstruction_screwdriver(user, "panel", "close", I))
|
||||
return
|
||||
if(default_pry_open(I))
|
||||
dump_contents()
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_data()
|
||||
var/list/data = list()
|
||||
data["locked"] = locked
|
||||
data["open"] = state_open
|
||||
data["safeties"] = safeties
|
||||
data["uv_active"] = uv
|
||||
data["uv_super"] = uv_super
|
||||
if(helmet)
|
||||
data["helmet"] = helmet.name
|
||||
else
|
||||
data["helmet"] = null
|
||||
if(suit)
|
||||
data["suit"] = suit.name
|
||||
else
|
||||
data["suit"] = null
|
||||
if(mask)
|
||||
data["mask"] = mask.name
|
||||
else
|
||||
data["mask"] = null
|
||||
if(storage)
|
||||
data["storage"] = storage.name
|
||||
else
|
||||
data["storage"] = null
|
||||
if(occupant)
|
||||
data["occupied"] = TRUE
|
||||
else
|
||||
data["occupied"] = FALSE
|
||||
return data
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_act(action, params)
|
||||
if(..() || uv)
|
||||
return
|
||||
switch(action)
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine(0)
|
||||
if(occupant)
|
||||
dump_contents() // Dump out contents if someone is in there.
|
||||
. = TRUE
|
||||
if("lock")
|
||||
if(state_open)
|
||||
return
|
||||
locked = !locked
|
||||
. = TRUE
|
||||
if("uv")
|
||||
if(occupant && safeties)
|
||||
return
|
||||
else if(!helmet && !mask && !suit && !storage && !occupant)
|
||||
return
|
||||
else
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
to_chat(mob_occupant, "<span class='userdanger'>[src]'s confines grow warm, then hot, then scorching. You're being burned [!mob_occupant.stat ? "alive" : "away"]!</span>")
|
||||
cook()
|
||||
. = TRUE
|
||||
if("dispense")
|
||||
if(!state_open)
|
||||
return
|
||||
|
||||
var/static/list/valid_items = list("helmet", "suit", "mask", "storage")
|
||||
var/item_name = params["item"]
|
||||
if(item_name in valid_items)
|
||||
var/obj/item/I = vars[item_name]
|
||||
vars[item_name] = null
|
||||
if(I)
|
||||
I.forceMove(loc)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
/obj/machinery/computer/mech_bay_power_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "mech_bay_power_console", "Mech Bay Power Control Console", 400, 170, master_ui, state)
|
||||
ui = new(user, src, ui_key, "mech_bay_power_console", "Mech Bay Power Control Console", 400, 200, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/mech_bay_power_console/ui_act(action, params)
|
||||
@@ -96,7 +96,7 @@
|
||||
if(recharge_port && !QDELETED(recharge_port))
|
||||
data["recharge_port"] = list("mech" = null)
|
||||
if(recharge_port.recharging_mech && !QDELETED(recharge_port.recharging_mech))
|
||||
data["recharge_port"]["mech"] = list("health" = recharge_port.recharging_mech.obj_integrity, "maxhealth" = recharge_port.recharging_mech.max_integrity, "cell" = null)
|
||||
data["recharge_port"]["mech"] = list("health" = recharge_port.recharging_mech.obj_integrity, "maxhealth" = recharge_port.recharging_mech.max_integrity, "cell" = null, "name" = recharge_port.recharging_mech.name,)
|
||||
if(recharge_port.recharging_mech.cell && !QDELETED(recharge_port.recharging_mech.cell))
|
||||
data["recharge_port"]["mech"]["cell"] = list(
|
||||
"critfail" = recharge_port.recharging_mech.cell.crit_fail,
|
||||
|
||||
@@ -246,7 +246,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/pipes)
|
||||
assets.send(user)
|
||||
|
||||
ui = new(user, src, ui_key, "rpd", name, 300, 550, master_ui, state)
|
||||
ui = new(user, src, ui_key, "rpd", name, 425, 472, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/pipe_dispenser/ui_data(mob/user)
|
||||
@@ -313,9 +313,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
playeffect = FALSE
|
||||
if("mode")
|
||||
var/n = text2num(params["mode"])
|
||||
if(n == 2 && !(mode&1) && !(mode&2))
|
||||
mode |= 3
|
||||
else if(mode&n)
|
||||
if(mode & n)
|
||||
mode &= ~n
|
||||
else
|
||||
mode |= n
|
||||
@@ -324,6 +322,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
|
||||
spark_system.start()
|
||||
effectcooldown = world.time + 100
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
return TRUE
|
||||
|
||||
/obj/item/pipe_dispenser/pre_attack(atom/A, mob/user)
|
||||
if(!user.IsAdvancedToolUser() || istype(A, /turf/open/space/transit))
|
||||
|
||||
@@ -1,228 +1,226 @@
|
||||
GLOBAL_LIST_EMPTY(GPS_list)
|
||||
/obj/item/gps
|
||||
name = "global positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
obj_flags = UNIQUE_RENAME
|
||||
var/gpstag = "COM0"
|
||||
var/emped = FALSE
|
||||
var/tracking = TRUE
|
||||
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
|
||||
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
|
||||
|
||||
/obj/item/gps/examine(mob/user)
|
||||
. = ..()
|
||||
var/turf/curr = get_turf(src)
|
||||
. += "The screen says: [get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
|
||||
|
||||
/obj/item/gps/Initialize()
|
||||
. = ..()
|
||||
GLOB.GPS_list += src
|
||||
name = "global positioning system ([gpstag])"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/Destroy()
|
||||
GLOB.GPS_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped = TRUE
|
||||
cut_overlay("working")
|
||||
add_overlay("emp")
|
||||
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
|
||||
SStgui.close_uis(src) //Close the UI control if it is open.
|
||||
|
||||
/obj/item/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
cut_overlay("emp")
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
toggletracking(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/gps/proc/toggletracking(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
to_chat(user, "It's busted!")
|
||||
return
|
||||
if(tracking)
|
||||
cut_overlay("working")
|
||||
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
|
||||
tracking = FALSE
|
||||
else
|
||||
add_overlay("working")
|
||||
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
|
||||
tracking = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
if(emped)
|
||||
to_chat(user, "[src] fizzles weakly.")
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
|
||||
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
|
||||
ui.open()
|
||||
|
||||
ui.set_autoupdate(state = updating)
|
||||
|
||||
|
||||
/obj/item/gps/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = tracking
|
||||
data["tag"] = gpstag
|
||||
data["updating"] = updating
|
||||
data["globalmode"] = global_mode
|
||||
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
|
||||
return data
|
||||
|
||||
var/turf/curr = get_turf(src)
|
||||
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/gps/G = gps
|
||||
if(G.emped || !G.tracking || G == src)
|
||||
continue
|
||||
var/turf/pos = get_turf(G)
|
||||
if(!global_mode && pos.z != curr.z)
|
||||
continue
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["area"] = get_area_name(G, TRUE)
|
||||
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
|
||||
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
|
||||
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
|
||||
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
|
||||
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
|
||||
if(!direction)
|
||||
direction = "CENTER"
|
||||
signal["degrees"] = "N/A"
|
||||
signal["direction"] = direction
|
||||
|
||||
signals += list(signal) //Add this signal to the list of signals
|
||||
data["signals"] = signals
|
||||
return data
|
||||
|
||||
|
||||
|
||||
/obj/item/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
gpstag = a
|
||||
. = TRUE
|
||||
name = "global positioning system ([gpstag])"
|
||||
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
|
||||
/obj/item/gps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
|
||||
/obj/item/gps/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/cyborg
|
||||
icon_state = "gps-b"
|
||||
gpstag = "BORG0"
|
||||
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
|
||||
|
||||
/obj/item/gps/cyborg/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
|
||||
|
||||
/obj/item/gps/internal
|
||||
icon_state = null
|
||||
item_flags = ABSTRACT
|
||||
gpstag = "Eerie Signal"
|
||||
desc = "Report to a coder immediately."
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
var/obj/item/implant/gps/implant
|
||||
|
||||
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/gps/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/internal/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINER"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/internal/base
|
||||
gpstag = "NT_AUX"
|
||||
desc = "A homing signal from Nanotrasen's mining base."
|
||||
|
||||
/obj/item/gps/visible_debug
|
||||
name = "visible GPS"
|
||||
gpstag = "ADMIN"
|
||||
desc = "This admin-spawn GPS unit leaves the coordinates visible \
|
||||
on any turf that it passes over, for debugging. Especially useful \
|
||||
for marking the area around the transition edges."
|
||||
var/list/turf/tagged
|
||||
|
||||
/obj/item/gps/visible_debug/Initialize()
|
||||
. = ..()
|
||||
tagged = list()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/gps/visible_debug/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
// I assume it's faster to color,tag and OR the turf in, rather
|
||||
// then checking if its there
|
||||
T.color = RANDOM_COLOUR
|
||||
T.maptext = "[T.x],[T.y],[T.z]"
|
||||
tagged |= T
|
||||
|
||||
/obj/item/gps/visible_debug/proc/clear()
|
||||
while(tagged.len)
|
||||
var/turf/T = pop(tagged)
|
||||
T.color = initial(T.color)
|
||||
T.maptext = initial(T.maptext)
|
||||
|
||||
/obj/item/gps/visible_debug/Destroy()
|
||||
if(tagged)
|
||||
clear()
|
||||
tagged = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
. = ..()
|
||||
GLOBAL_LIST_EMPTY(GPS_list)
|
||||
/obj/item/gps
|
||||
name = "global positioning system"
|
||||
desc = "Helping lost spacemen find their way through the planets since 2016."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "gps-c"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
obj_flags = UNIQUE_RENAME
|
||||
var/gpstag = "COM0"
|
||||
var/emped = FALSE
|
||||
var/tracking = TRUE
|
||||
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
|
||||
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
|
||||
|
||||
/obj/item/gps/examine(mob/user)
|
||||
. = ..()
|
||||
var/turf/curr = get_turf(src)
|
||||
. += "The screen says: [get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
|
||||
|
||||
/obj/item/gps/Initialize()
|
||||
. = ..()
|
||||
GLOB.GPS_list += src
|
||||
name = "global positioning system ([gpstag])"
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/Destroy()
|
||||
GLOB.GPS_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped = TRUE
|
||||
cut_overlay("working")
|
||||
add_overlay("emp")
|
||||
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
|
||||
SStgui.close_uis(src) //Close the UI control if it is open.
|
||||
|
||||
/obj/item/gps/proc/reboot()
|
||||
emped = FALSE
|
||||
cut_overlay("emp")
|
||||
add_overlay("working")
|
||||
|
||||
/obj/item/gps/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return
|
||||
toggletracking(user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/gps/proc/toggletracking(mob/user)
|
||||
if(!user.canUseTopic(src, BE_CLOSE))
|
||||
return //user not valid to use gps
|
||||
if(emped)
|
||||
to_chat(user, "It's busted!")
|
||||
return
|
||||
if(tracking)
|
||||
cut_overlay("working")
|
||||
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
|
||||
tracking = FALSE
|
||||
else
|
||||
add_overlay("working")
|
||||
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
|
||||
tracking = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
if(emped)
|
||||
to_chat(user, "[src] fizzles weakly.")
|
||||
return
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
// Variable window height, depending on how many GPS units there are
|
||||
// to show, clamped to relatively safe range.
|
||||
var/gps_window_height = CLAMP(325 + GLOB.GPS_list.len * 14, 325, 700)
|
||||
ui = new(user, src, ui_key, "gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
|
||||
ui.open()
|
||||
|
||||
ui.set_autoupdate(state = updating)
|
||||
|
||||
|
||||
/obj/item/gps/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = tracking
|
||||
data["tag"] = gpstag
|
||||
data["updating"] = updating
|
||||
data["globalmode"] = global_mode
|
||||
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
|
||||
return data
|
||||
|
||||
var/turf/curr = get_turf(src)
|
||||
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
|
||||
data["currentArea"] = "[get_area_name(curr, TRUE)]"
|
||||
data["currentCoords"] = "[curr.x], [curr.y], [curr.z]"
|
||||
|
||||
var/list/signals = list()
|
||||
data["signals"] = list()
|
||||
|
||||
for(var/gps in GLOB.GPS_list)
|
||||
var/obj/item/gps/G = gps
|
||||
if(G.emped || !G.tracking || G == src)
|
||||
continue
|
||||
var/turf/pos = get_turf(G)
|
||||
if(!global_mode && pos.z != curr.z)
|
||||
continue
|
||||
var/list/signal = list()
|
||||
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
|
||||
signal["coords"] = "[pos.x], [pos.y], [pos.z]"
|
||||
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
|
||||
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
|
||||
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
|
||||
|
||||
signals += list(signal) //Add this signal to the list of signals
|
||||
data["signals"] = signals
|
||||
return data
|
||||
|
||||
|
||||
|
||||
/obj/item/gps/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("rename")
|
||||
var/a = input("Please enter desired tag.", name, gpstag) as text
|
||||
a = copytext(sanitize(a), 1, 20)
|
||||
gpstag = a
|
||||
. = TRUE
|
||||
name = "global positioning system ([gpstag])"
|
||||
|
||||
if("power")
|
||||
toggletracking(usr)
|
||||
. = TRUE
|
||||
if("updating")
|
||||
updating = !updating
|
||||
. = TRUE
|
||||
if("globalmode")
|
||||
global_mode = !global_mode
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/item/gps/science
|
||||
icon_state = "gps-s"
|
||||
gpstag = "SCI0"
|
||||
|
||||
/obj/item/gps/engineering
|
||||
icon_state = "gps-e"
|
||||
gpstag = "ENG0"
|
||||
|
||||
/obj/item/gps/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINE0"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/cyborg
|
||||
icon_state = "gps-b"
|
||||
gpstag = "BORG0"
|
||||
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
|
||||
|
||||
/obj/item/gps/cyborg/Initialize()
|
||||
. = ..()
|
||||
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
|
||||
|
||||
/obj/item/gps/internal
|
||||
icon_state = null
|
||||
item_flags = ABSTRACT
|
||||
gpstag = "Eerie Signal"
|
||||
desc = "Report to a coder immediately."
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
var/obj/item/implant/gps/implant
|
||||
|
||||
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/gps/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/gps/internal/mining
|
||||
icon_state = "gps-m"
|
||||
gpstag = "MINER"
|
||||
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
|
||||
|
||||
/obj/item/gps/internal/base
|
||||
gpstag = "NT_AUX"
|
||||
desc = "A homing signal from Nanotrasen's mining base."
|
||||
|
||||
/obj/item/gps/visible_debug
|
||||
name = "visible GPS"
|
||||
gpstag = "ADMIN"
|
||||
desc = "This admin-spawn GPS unit leaves the coordinates visible \
|
||||
on any turf that it passes over, for debugging. Especially useful \
|
||||
for marking the area around the transition edges."
|
||||
var/list/turf/tagged
|
||||
|
||||
/obj/item/gps/visible_debug/Initialize()
|
||||
. = ..()
|
||||
tagged = list()
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
|
||||
/obj/item/gps/visible_debug/process()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
// I assume it's faster to color,tag and OR the turf in, rather
|
||||
// then checking if its there
|
||||
T.color = RANDOM_COLOUR
|
||||
T.maptext = "[T.x],[T.y],[T.z]"
|
||||
tagged |= T
|
||||
|
||||
/obj/item/gps/visible_debug/proc/clear()
|
||||
while(tagged.len)
|
||||
var/turf/T = pop(tagged)
|
||||
T.color = initial(T.color)
|
||||
T.maptext = initial(T.maptext)
|
||||
|
||||
/obj/item/gps/visible_debug/Destroy()
|
||||
if(tagged)
|
||||
clear()
|
||||
tagged = null
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
. = ..()
|
||||
|
||||
@@ -1,429 +1,436 @@
|
||||
/obj/item/radio
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
name = "station bounced radio"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
desc = "A basic handheld radio that communicates with local telecommunication networks."
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
flags_1 = CONDUCT_1 | HEAR_1
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
materials = list(MAT_METAL=75, MAT_GLASS=25)
|
||||
obj_flags = USES_TGUI
|
||||
|
||||
var/on = TRUE
|
||||
var/frequency = FREQ_COMMON
|
||||
var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
|
||||
var/emped = 0 // Tracks the number of EMPs currently stacked.
|
||||
|
||||
var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
|
||||
var/listening = TRUE // Whether the radio is currently receiving.
|
||||
var/prison_radio = FALSE // If true, the transmit wire starts cut.
|
||||
var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
|
||||
var/freerange = FALSE // If true, the radio has access to the full spectrum.
|
||||
var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
|
||||
var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
|
||||
var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
|
||||
var/use_command = FALSE // If true, broadcasts will be large and BOLD.
|
||||
var/command = FALSE // If true, use_command can be toggled at will.
|
||||
var/commandspan = SPAN_COMMAND //allow us to set what the fuck we want for headsets
|
||||
|
||||
// Encryption key handling
|
||||
var/obj/item/encryptionkey/keyslot
|
||||
var/translate_binary = FALSE // If true, can hear the special binary channel.
|
||||
var/independent = FALSE // If true, can say/hear on the special CentCom channel.
|
||||
var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
|
||||
var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
|
||||
var/list/secure_radio_connections
|
||||
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
/obj/item/radio/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/radio/proc/set_frequency(new_frequency)
|
||||
SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
|
||||
remove_radio(src, frequency)
|
||||
frequency = add_radio(src, new_frequency)
|
||||
|
||||
/obj/item/radio/proc/recalculateChannels()
|
||||
channels = list()
|
||||
translate_binary = FALSE
|
||||
syndie = FALSE
|
||||
independent = FALSE
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(!(ch_name in channels))
|
||||
channels[ch_name] = keyslot.channels[ch_name]
|
||||
|
||||
if(keyslot.translate_binary)
|
||||
translate_binary = TRUE
|
||||
if(keyslot.syndie)
|
||||
syndie = TRUE
|
||||
if(keyslot.independent)
|
||||
independent = TRUE
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
|
||||
qdel(keyslot)
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
syndie = 1
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/Destroy()
|
||||
remove_radio_all(src) //Just to be sure
|
||||
QDEL_NULL(wires)
|
||||
QDEL_NULL(keyslot)
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/Initialize()
|
||||
wires = new /datum/wires/radio(src)
|
||||
if(prison_radio)
|
||||
wires.cut(WIRE_TX) // OH GOD WHY
|
||||
secure_radio_connections = new
|
||||
. = ..()
|
||||
frequency = sanitize_frequency(frequency, freerange)
|
||||
set_frequency(frequency)
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
|
||||
|
||||
/obj/item/radio/interact(mob/user)
|
||||
if(unscrewed && !isAI(user))
|
||||
wires.interact(user)
|
||||
add_fingerprint(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/radio/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["broadcasting"] = broadcasting
|
||||
data["listening"] = listening
|
||||
data["frequency"] = frequency
|
||||
data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
|
||||
data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
|
||||
data["freqlock"] = freqlock
|
||||
data["channels"] = list()
|
||||
for(var/channel in channels)
|
||||
data["channels"][channel] = channels[channel] & FREQ_LISTENING
|
||||
data["command"] = command
|
||||
data["useCommand"] = use_command
|
||||
data["subspace"] = subspace_transmission
|
||||
data["subspaceSwitchable"] = subspace_switchable
|
||||
data["headset"] = istype(src, /obj/item/radio/headset)
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/radio/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("frequency")
|
||||
if(freqlock)
|
||||
return
|
||||
var/tune = params["tune"]
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(tune == "input")
|
||||
var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
|
||||
var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
|
||||
tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
|
||||
if(!isnull(tune) && !..())
|
||||
if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
|
||||
// allow typing 144.7 to get 1447
|
||||
tune *= 10
|
||||
. = TRUE
|
||||
else if(adjust)
|
||||
tune = frequency + adjust * 10
|
||||
. = TRUE
|
||||
else if(text2num(tune) != null)
|
||||
tune = tune * 10
|
||||
. = TRUE
|
||||
if(.)
|
||||
set_frequency(sanitize_frequency(tune, freerange))
|
||||
if("listen")
|
||||
listening = !listening
|
||||
. = TRUE
|
||||
if("broadcast")
|
||||
broadcasting = !broadcasting
|
||||
. = TRUE
|
||||
if("channel")
|
||||
var/channel = params["channel"]
|
||||
if(!(channel in channels))
|
||||
return
|
||||
if(channels[channel] & FREQ_LISTENING)
|
||||
channels[channel] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[channel] |= FREQ_LISTENING
|
||||
. = TRUE
|
||||
if("command")
|
||||
use_command = !use_command
|
||||
. = TRUE
|
||||
if("subspace")
|
||||
if(subspace_switchable)
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(!subspace_transmission)
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
. = TRUE
|
||||
|
||||
/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!spans)
|
||||
spans = list(M.speech_span)
|
||||
if(!language)
|
||||
language = M.get_default_language()
|
||||
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!on)
|
||||
return // the device has to be on
|
||||
if(!M || !message)
|
||||
return
|
||||
if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
|
||||
return
|
||||
if(!M.IsVocal())
|
||||
return
|
||||
|
||||
if(use_command)
|
||||
spans |= commandspan
|
||||
|
||||
/*
|
||||
Roughly speaking, radios attempt to make a subspace transmission (which
|
||||
is received, processed, and rebroadcast by the telecomms satellite) and
|
||||
if that fails, they send a mundane radio transmission.
|
||||
|
||||
Headsets cannot send/receive mundane transmissions, only subspace.
|
||||
Syndicate radios can hear transmissions on all well-known frequencies.
|
||||
CentCom radios can hear the CentCom frequency no matter what.
|
||||
*/
|
||||
|
||||
// From the channel, determine the frequency and get a reference to it.
|
||||
var/freq
|
||||
if(channel && channels && channels.len > 0)
|
||||
if(channel == MODE_DEPARTMENT)
|
||||
channel = channels[1]
|
||||
freq = secure_radio_connections[channel]
|
||||
if (!channels[channel]) // if the channel is turned off, don't broadcast
|
||||
return
|
||||
else
|
||||
freq = frequency
|
||||
channel = null
|
||||
|
||||
// Nearby active jammers severely gibberish the message
|
||||
var/turf/position = get_turf(src)
|
||||
for(var/obj/item/jammer/jammer in GLOB.active_jammers)
|
||||
var/turf/jammer_turf = get_turf(jammer)
|
||||
if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
|
||||
message = Gibberish(message,100)
|
||||
break
|
||||
|
||||
// Determine the identity information which will be attached to the signal.
|
||||
var/atom/movable/virtualspeaker/speaker = new(null, M, src)
|
||||
|
||||
// Construct the signal
|
||||
var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
|
||||
|
||||
// Independent radios, on the CentCom frequency, reach all independent radios
|
||||
if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_SUPERSPACE
|
||||
signal.levels = list(0) // reaches all Z-levels
|
||||
signal.broadcast()
|
||||
return
|
||||
|
||||
// All radios make an attempt to use the subspace system first
|
||||
signal.send_to_receivers()
|
||||
|
||||
// If the radio is subspace-only, that's all it can do
|
||||
if (subspace_transmission)
|
||||
return
|
||||
|
||||
// Non-subspace radios will check in a couple of seconds, and if the signal
|
||||
// was never received, send a mundane broadcast (no headsets).
|
||||
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
|
||||
|
||||
/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
|
||||
var/turf/T = get_turf(src)
|
||||
if (signal.data["done"] && (T.z in signal.levels))
|
||||
return
|
||||
|
||||
// Okay, the signal was never processed, send a mundane broadcast.
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
signal.levels = list(T.z)
|
||||
signal.broadcast()
|
||||
|
||||
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
. = ..()
|
||||
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
|
||||
return
|
||||
|
||||
if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
|
||||
// radios don't pick up whispers very well
|
||||
raw_message = stars(raw_message)
|
||||
else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
|
||||
// try to avoid being heard double
|
||||
if (loc == speaker && ismob(speaker))
|
||||
var/mob/M = speaker
|
||||
var/idx = M.get_held_index_of_item(src)
|
||||
// left hands are odd slots
|
||||
if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
|
||||
return
|
||||
|
||||
talk_into(speaker, raw_message, , spans, language=message_language)
|
||||
|
||||
// Checks if this radio can receive on the given frequency.
|
||||
/obj/item/radio/proc/can_receive(freq, level)
|
||||
// deny checks
|
||||
if (!on || !listening || wires.is_cut(WIRE_RX))
|
||||
return FALSE
|
||||
if (freq == FREQ_SYNDICATE && !syndie)
|
||||
return FALSE
|
||||
if (freq == FREQ_CENTCOM)
|
||||
return independent // hard-ignores the z-level check
|
||||
if (!(0 in level))
|
||||
var/turf/position = get_turf(src)
|
||||
if(!position || !(position.z in level))
|
||||
return FALSE
|
||||
|
||||
// allow checks: are we listening on that frequency?
|
||||
if (freq == frequency)
|
||||
return TRUE
|
||||
for(var/ch_name in channels)
|
||||
if(channels[ch_name] & FREQ_LISTENING)
|
||||
//the GLOB.radiochannels list is located in communications.dm
|
||||
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/item/radio/examine(mob/user)
|
||||
. = ..()
|
||||
if (unscrewed)
|
||||
. += "<span class='notice'>It can be attached and modified.</span>"
|
||||
else
|
||||
. += "<span class='notice'>It cannot be modified or attached.</span>"
|
||||
|
||||
/obj/item/radio/attackby(obj/item/W, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
unscrewed = !unscrewed
|
||||
if(unscrewed)
|
||||
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The radio can no longer be modified or attached!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped++ //There's been an EMP; better count it
|
||||
var/curremp = emped //Remember which EMP this was
|
||||
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
|
||||
to_chat(loc, "<span class='warning'>\The [src] overloads.</span>")
|
||||
broadcasting = FALSE
|
||||
listening = FALSE
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
on = FALSE
|
||||
spawn(200)
|
||||
if(emped == curremp) //Don't fix it if it's been EMP'd again
|
||||
emped = 0
|
||||
if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
|
||||
on = TRUE
|
||||
|
||||
///////////////////////////////
|
||||
//////////Borg Radios//////////
|
||||
///////////////////////////////
|
||||
//Giving borgs their own radio to have some more room to work with -Sieve
|
||||
|
||||
/obj/item/radio/borg
|
||||
name = "cyborg radio"
|
||||
subspace_switchable = TRUE
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/radio/borg/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
/obj/item/radio/borg/syndicate
|
||||
syndie = 1
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
|
||||
/obj/item/radio/borg/syndicate/Initialize()
|
||||
. = ..()
|
||||
set_frequency(FREQ_SYNDICATE)
|
||||
|
||||
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(keyslot)
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
|
||||
recalculateChannels()
|
||||
to_chat(user, "<span class='notice'>You pop out the encryption key in the radio.</span>")
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This radio doesn't have any encryption keys!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/encryptionkey/))
|
||||
if(keyslot)
|
||||
to_chat(user, "<span class='warning'>The radio can't hold another key!</span>")
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot = W
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
|
||||
/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
|
||||
listening = 0 // And it's nice to have a subtype too for future features.
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
/obj/item/radio/internal
|
||||
var/obj/item/implant/radio/implant
|
||||
|
||||
/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/radio/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
/obj/item/radio
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
name = "station bounced radio"
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
desc = "A basic handheld radio that communicates with local telecommunication networks."
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
flags_1 = CONDUCT_1 | HEAR_1
|
||||
slot_flags = ITEM_SLOT_BELT
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
materials = list(MAT_METAL=75, MAT_GLASS=25)
|
||||
obj_flags = USES_TGUI
|
||||
|
||||
var/on = TRUE
|
||||
var/frequency = FREQ_COMMON
|
||||
var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
|
||||
var/emped = 0 // Tracks the number of EMPs currently stacked.
|
||||
|
||||
var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
|
||||
var/listening = TRUE // Whether the radio is currently receiving.
|
||||
var/prison_radio = FALSE // If true, the transmit wire starts cut.
|
||||
var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
|
||||
var/freerange = FALSE // If true, the radio has access to the full spectrum.
|
||||
var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
|
||||
var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
|
||||
var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
|
||||
var/use_command = FALSE // If true, broadcasts will be large and BOLD.
|
||||
var/command = FALSE // If true, use_command can be toggled at will.
|
||||
var/commandspan = SPAN_COMMAND //allow us to set what the fuck we want for headsets
|
||||
|
||||
// Encryption key handling
|
||||
var/obj/item/encryptionkey/keyslot
|
||||
var/translate_binary = FALSE // If true, can hear the special binary channel.
|
||||
var/independent = FALSE // If true, can say/hear on the special CentCom channel.
|
||||
var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
|
||||
var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
|
||||
var/list/secure_radio_connections
|
||||
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
/obj/item/radio/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/radio/proc/set_frequency(new_frequency)
|
||||
SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
|
||||
remove_radio(src, frequency)
|
||||
frequency = add_radio(src, new_frequency)
|
||||
|
||||
/obj/item/radio/proc/recalculateChannels()
|
||||
channels = list()
|
||||
translate_binary = FALSE
|
||||
syndie = FALSE
|
||||
independent = FALSE
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(!(ch_name in channels))
|
||||
channels[ch_name] = keyslot.channels[ch_name]
|
||||
|
||||
if(keyslot.translate_binary)
|
||||
translate_binary = TRUE
|
||||
if(keyslot.syndie)
|
||||
syndie = TRUE
|
||||
if(keyslot.independent)
|
||||
independent = TRUE
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
|
||||
qdel(keyslot)
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
syndie = 1
|
||||
recalculateChannels()
|
||||
|
||||
/obj/item/radio/Destroy()
|
||||
remove_radio_all(src) //Just to be sure
|
||||
QDEL_NULL(wires)
|
||||
QDEL_NULL(keyslot)
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/Initialize()
|
||||
wires = new /datum/wires/radio(src)
|
||||
if(prison_radio)
|
||||
wires.cut(WIRE_TX) // OH GOD WHY
|
||||
secure_radio_connections = new
|
||||
. = ..()
|
||||
frequency = sanitize_frequency(frequency, freerange)
|
||||
set_frequency(frequency)
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
|
||||
/obj/item/radio/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
|
||||
|
||||
/obj/item/radio/interact(mob/user)
|
||||
if(unscrewed && !isAI(user))
|
||||
wires.interact(user)
|
||||
add_fingerprint(user)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
|
||||
. = ..()
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
var/ui_width = 360
|
||||
var/ui_height = 106
|
||||
if(subspace_transmission)
|
||||
if(channels.len > 0)
|
||||
ui_height += 6 + channels.len * 21
|
||||
else
|
||||
ui_height += 24
|
||||
ui = new(user, src, ui_key, "radio", name, ui_width, ui_height, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/radio/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["broadcasting"] = broadcasting
|
||||
data["listening"] = listening
|
||||
data["frequency"] = frequency
|
||||
data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
|
||||
data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
|
||||
data["freqlock"] = freqlock
|
||||
data["channels"] = list()
|
||||
for(var/channel in channels)
|
||||
data["channels"][channel] = channels[channel] & FREQ_LISTENING
|
||||
data["command"] = command
|
||||
data["useCommand"] = use_command
|
||||
data["subspace"] = subspace_transmission
|
||||
data["subspaceSwitchable"] = subspace_switchable
|
||||
data["headset"] = istype(src, /obj/item/radio/headset)
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/radio/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("frequency")
|
||||
if(freqlock)
|
||||
return
|
||||
var/tune = params["tune"]
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(tune == "input")
|
||||
var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
|
||||
var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
|
||||
tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
|
||||
if(!isnull(tune) && !..())
|
||||
if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
|
||||
// allow typing 144.7 to get 1447
|
||||
tune *= 10
|
||||
. = TRUE
|
||||
else if(adjust)
|
||||
tune = frequency + adjust * 10
|
||||
. = TRUE
|
||||
else if(text2num(tune) != null)
|
||||
tune = tune * 10
|
||||
. = TRUE
|
||||
if(.)
|
||||
set_frequency(sanitize_frequency(tune, freerange))
|
||||
if("listen")
|
||||
listening = !listening
|
||||
. = TRUE
|
||||
if("broadcast")
|
||||
broadcasting = !broadcasting
|
||||
. = TRUE
|
||||
if("channel")
|
||||
var/channel = params["channel"]
|
||||
if(!(channel in channels))
|
||||
return
|
||||
if(channels[channel] & FREQ_LISTENING)
|
||||
channels[channel] &= ~FREQ_LISTENING
|
||||
else
|
||||
channels[channel] |= FREQ_LISTENING
|
||||
. = TRUE
|
||||
if("command")
|
||||
use_command = !use_command
|
||||
. = TRUE
|
||||
if("subspace")
|
||||
if(subspace_switchable)
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(!subspace_transmission)
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
. = TRUE
|
||||
|
||||
/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!spans)
|
||||
spans = list(M.speech_span)
|
||||
if(!language)
|
||||
language = M.get_default_language()
|
||||
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
|
||||
return ITALICS | REDUCE_RANGE
|
||||
|
||||
/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
|
||||
if(!on)
|
||||
return // the device has to be on
|
||||
if(!M || !message)
|
||||
return
|
||||
if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
|
||||
return
|
||||
if(!M.IsVocal())
|
||||
return
|
||||
|
||||
if(use_command)
|
||||
spans |= commandspan
|
||||
|
||||
/*
|
||||
Roughly speaking, radios attempt to make a subspace transmission (which
|
||||
is received, processed, and rebroadcast by the telecomms satellite) and
|
||||
if that fails, they send a mundane radio transmission.
|
||||
|
||||
Headsets cannot send/receive mundane transmissions, only subspace.
|
||||
Syndicate radios can hear transmissions on all well-known frequencies.
|
||||
CentCom radios can hear the CentCom frequency no matter what.
|
||||
*/
|
||||
|
||||
// From the channel, determine the frequency and get a reference to it.
|
||||
var/freq
|
||||
if(channel && channels && channels.len > 0)
|
||||
if(channel == MODE_DEPARTMENT)
|
||||
channel = channels[1]
|
||||
freq = secure_radio_connections[channel]
|
||||
if (!channels[channel]) // if the channel is turned off, don't broadcast
|
||||
return
|
||||
else
|
||||
freq = frequency
|
||||
channel = null
|
||||
|
||||
// Nearby active jammers severely gibberish the message
|
||||
var/turf/position = get_turf(src)
|
||||
for(var/obj/item/jammer/jammer in GLOB.active_jammers)
|
||||
var/turf/jammer_turf = get_turf(jammer)
|
||||
if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
|
||||
message = Gibberish(message,100)
|
||||
break
|
||||
|
||||
// Determine the identity information which will be attached to the signal.
|
||||
var/atom/movable/virtualspeaker/speaker = new(null, M, src)
|
||||
|
||||
// Construct the signal
|
||||
var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
|
||||
|
||||
// Independent radios, on the CentCom frequency, reach all independent radios
|
||||
if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_SUPERSPACE
|
||||
signal.levels = list(0) // reaches all Z-levels
|
||||
signal.broadcast()
|
||||
return
|
||||
|
||||
// All radios make an attempt to use the subspace system first
|
||||
signal.send_to_receivers()
|
||||
|
||||
// If the radio is subspace-only, that's all it can do
|
||||
if (subspace_transmission)
|
||||
return
|
||||
|
||||
// Non-subspace radios will check in a couple of seconds, and if the signal
|
||||
// was never received, send a mundane broadcast (no headsets).
|
||||
addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
|
||||
|
||||
/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
|
||||
var/turf/T = get_turf(src)
|
||||
if (signal.data["done"] && (T.z in signal.levels))
|
||||
return
|
||||
|
||||
// Okay, the signal was never processed, send a mundane broadcast.
|
||||
signal.data["compression"] = 0
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
signal.levels = list(T.z)
|
||||
signal.broadcast()
|
||||
|
||||
/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
|
||||
. = ..()
|
||||
if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
|
||||
return
|
||||
|
||||
if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
|
||||
// radios don't pick up whispers very well
|
||||
raw_message = stars(raw_message)
|
||||
else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
|
||||
// try to avoid being heard double
|
||||
if (loc == speaker && ismob(speaker))
|
||||
var/mob/M = speaker
|
||||
var/idx = M.get_held_index_of_item(src)
|
||||
// left hands are odd slots
|
||||
if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
|
||||
return
|
||||
|
||||
talk_into(speaker, raw_message, , spans, language=message_language)
|
||||
|
||||
// Checks if this radio can receive on the given frequency.
|
||||
/obj/item/radio/proc/can_receive(freq, level)
|
||||
// deny checks
|
||||
if (!on || !listening || wires.is_cut(WIRE_RX))
|
||||
return FALSE
|
||||
if (freq == FREQ_SYNDICATE && !syndie)
|
||||
return FALSE
|
||||
if (freq == FREQ_CENTCOM)
|
||||
return independent // hard-ignores the z-level check
|
||||
if (!(0 in level))
|
||||
var/turf/position = get_turf(src)
|
||||
if(!position || !(position.z in level))
|
||||
return FALSE
|
||||
|
||||
// allow checks: are we listening on that frequency?
|
||||
if (freq == frequency)
|
||||
return TRUE
|
||||
for(var/ch_name in channels)
|
||||
if(channels[ch_name] & FREQ_LISTENING)
|
||||
//the GLOB.radiochannels list is located in communications.dm
|
||||
if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/item/radio/examine(mob/user)
|
||||
. = ..()
|
||||
if (unscrewed)
|
||||
. += "<span class='notice'>It can be attached and modified.</span>"
|
||||
else
|
||||
. += "<span class='notice'>It cannot be modified or attached.</span>"
|
||||
|
||||
/obj/item/radio/attackby(obj/item/W, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
unscrewed = !unscrewed
|
||||
if(unscrewed)
|
||||
to_chat(user, "<span class='notice'>The radio can now be attached and modified!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The radio can no longer be modified or attached!</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
emped++ //There's been an EMP; better count it
|
||||
var/curremp = emped //Remember which EMP this was
|
||||
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
|
||||
to_chat(loc, "<span class='warning'>\The [src] overloads.</span>")
|
||||
broadcasting = FALSE
|
||||
listening = FALSE
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
on = FALSE
|
||||
spawn(200)
|
||||
if(emped == curremp) //Don't fix it if it's been EMP'd again
|
||||
emped = 0
|
||||
if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
|
||||
on = TRUE
|
||||
|
||||
///////////////////////////////
|
||||
//////////Borg Radios//////////
|
||||
///////////////////////////////
|
||||
//Giving borgs their own radio to have some more room to work with -Sieve
|
||||
|
||||
/obj/item/radio/borg
|
||||
name = "cyborg radio"
|
||||
subspace_switchable = TRUE
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/radio/borg/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
/obj/item/radio/borg/syndicate
|
||||
syndie = 1
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
|
||||
/obj/item/radio/borg/syndicate/Initialize()
|
||||
. = ..()
|
||||
set_frequency(FREQ_SYNDICATE)
|
||||
|
||||
/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
if(keyslot)
|
||||
for(var/ch_name in channels)
|
||||
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.forceMove(T)
|
||||
keyslot = null
|
||||
|
||||
recalculateChannels()
|
||||
to_chat(user, "<span class='notice'>You pop out the encryption key in the radio.</span>")
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This radio doesn't have any encryption keys!</span>")
|
||||
|
||||
else if(istype(W, /obj/item/encryptionkey/))
|
||||
if(keyslot)
|
||||
to_chat(user, "<span class='warning'>The radio can't hold another key!</span>")
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
keyslot = W
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
|
||||
/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
|
||||
listening = 0 // And it's nice to have a subtype too for future features.
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
/obj/item/radio/internal
|
||||
var/obj/item/implant/radio/implant
|
||||
|
||||
/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
|
||||
. = ..()
|
||||
implant = _implant
|
||||
|
||||
/obj/item/radio/internal/Destroy()
|
||||
if(implant?.imp_in)
|
||||
qdel(implant)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tanks", name, 420, 200, master_ui, state)
|
||||
ui = new(user, src, ui_key, "tanks", name, 400, 120, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/tank/ui_data(mob/user)
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
roundstart = FALSE
|
||||
death = FALSE
|
||||
mob_species = /datum/species/pod
|
||||
flavour_text = "<span class='big bold'>You are a sentient ecosystem,</span><b> an example of the mastery over life that your creators possessed. Your masters, benevolent as they were, created uncounted \
|
||||
seed vaults and spread them across the universe to every planet they could chart. You are in one such seed vault. Your goal is to cultivate and spread life wherever it will go while waiting \
|
||||
for contact from your creators. Estimated time of last contact: Deployment, 5x10^3 millennia ago.</b>"
|
||||
short_desc = "You are a sentient ecosystem, an example of the mastery over life that your creators possessed."
|
||||
flavour_text = "Your masters, benevolent as they were, created uncounted seed vaults and spread them across \
|
||||
the universe to every planet they could chart. You are in one such seed vault. \
|
||||
Your goal is to cultivate and spread life wherever it will go while waiting for contact from your creators. \
|
||||
Estimated time of last contact: Deployment, 5000 millennia ago."
|
||||
assignedrole = "Lifebringer"
|
||||
|
||||
/obj/effect/mob_spawn/human/seed_vault/special(mob/living/new_spawn)
|
||||
@@ -47,8 +49,10 @@
|
||||
death = FALSE
|
||||
anchored = FALSE
|
||||
density = FALSE
|
||||
flavour_text = "<span class='big bold'>You are an ash walker.</span><b> Your tribe worships <span class='danger'>the Necropolis</span>. The wastes are sacred ground, its monsters a blessed bounty. You would never leave its beautiful expanse. \
|
||||
You have seen lights in the distance... they foreshadow the arrival of outsiders that seek to tear apart the Necropolis and its domain. Fresh sacrifices for your nest.</b>"
|
||||
short_desc = "You are an ash walker. Your tribe worships the Necropolis."
|
||||
flavour_text = "The wastes are sacred ground, its monsters a blessed bounty. You would never leave its sacred ground. \
|
||||
You have seen lights in the distance... they foreshadow the arrival of outsiders that seek to tear apart the Necropolis and its domain. \
|
||||
Fresh sacrifices for your nest."
|
||||
assignedrole = "Ash Walker"
|
||||
|
||||
/obj/effect/mob_spawn/human/ash_walker/special(mob/living/new_spawn)
|
||||
@@ -87,8 +91,9 @@
|
||||
roundstart = FALSE
|
||||
death = FALSE
|
||||
mob_species = /datum/species/shadow
|
||||
flavour_text = "<span class='big bold'>You are cursed.</span><b> Years ago, you sacrificed the lives of your trusted friends and the humanity of yourself to reach the Wish Granter. Though you \
|
||||
did so, it has come at a cost: your very body rejects the light, dooming you to wander endlessly in this horrible wasteland.</b>"
|
||||
short_desc = "You are cursed."
|
||||
flavour_text = "Years ago, you sacrificed the lives of your trusted friends and the humanity of yourself to reach the Wish Granter. Though you \
|
||||
did so, it has come at a cost: your very body rejects the light, dooming you to wander endlessly in this horrible wasteland."
|
||||
assignedrole = "Exile"
|
||||
|
||||
/obj/effect/mob_spawn/human/exile/Destroy()
|
||||
@@ -124,9 +129,10 @@
|
||||
var/has_owner = FALSE
|
||||
var/can_transfer = TRUE //if golems can switch bodies to this new shell
|
||||
var/mob/living/owner = null //golem's owner if it has one
|
||||
flavour_text = "<span class='big bold'>You are a Free Golem.</span><b> Your family worships <span class='danger'>The Liberator</span>. In his infinite and divine wisdom, he set your clan free to \
|
||||
short_desc = "You are a Free Golem. Your family worships The Liberator."
|
||||
flavour_text = "In his infinite and divine wisdom, he set your clan free to \
|
||||
travel the stars with a single declaration: \"Yeah go do whatever.\" Though you are bound to the one who created you, it is customary in your society to repeat those same words to newborn \
|
||||
golems, so that no golem may ever be forced to serve again.</b>"
|
||||
golems, so that no golem may ever be forced to serve again."
|
||||
|
||||
/obj/effect/mob_spawn/human/golem/Initialize(mapload, datum/species/golem/species = null, mob/creator = null)
|
||||
if(species) //spawners list uses object name to register so this goes before ..()
|
||||
@@ -137,8 +143,9 @@
|
||||
if(!mapload && A)
|
||||
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_key = POLL_IGNORE_GOLEM, ignore_dnr_observers = TRUE)
|
||||
if(has_owner && creator)
|
||||
flavour_text = "<span class='big bold'>You are a Golem.</span><b> You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. \
|
||||
Serve [creator], and assist [creator.p_them()] in completing [creator.p_their()] goals at any cost.</b>"
|
||||
short_desc = "You are a golem."
|
||||
flavour_text = "You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools."
|
||||
important_info = "Serve [creator], and assist [creator.p_them()] in completing [creator.p_their()] goals at any cost."
|
||||
owner = creator
|
||||
|
||||
/obj/effect/mob_spawn/human/golem/special(mob/living/new_spawn, name)
|
||||
@@ -211,8 +218,9 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You've been stranded in this godless prison of a planet for longer than you can remember.</span><b> Each day you barely scrape by, and between the terrible \
|
||||
conditions of your makeshift shelter, the hostile creatures, and the ash drakes swooping down from the cloudless skies, all you can wish for is the feel of soft grass between your toes and \
|
||||
short_desc = "You've been stranded in this godless prison of a planet for longer than you can remember."
|
||||
flavour_text = "Each day you barely scrape by, and between the terrible conditions of your makeshift shelter, \
|
||||
the hostile creatures, and the ash drakes swooping down from the cloudless skies, all you can wish for is the feel of soft grass between your toes and \
|
||||
the fresh air of Earth. These thoughts are dispelled by yet another recollection of how you got here... "
|
||||
assignedrole = "Hermit"
|
||||
|
||||
@@ -223,20 +231,20 @@
|
||||
if(1)
|
||||
flavour_text += "you were a [pick("arms dealer", "shipwright", "docking manager")]'s assistant on a small trading station several sectors from here. Raiders attacked, and there was \
|
||||
only one pod left when you got to the escape bay. You took it and launched it alone, and the crowd of terrified faces crowding at the airlock door as your pod's engines burst to \
|
||||
life and sent you to this hell are forever branded into your memory.</b>"
|
||||
life and sent you to this hell are forever branded into your memory."
|
||||
outfit.uniform = /obj/item/clothing/under/assistantformal
|
||||
outfit.shoes = /obj/item/clothing/shoes/sneakers/black
|
||||
outfit.back = /obj/item/storage/backpack
|
||||
if(2)
|
||||
flavour_text += "you're an exile from the Tiger Cooperative. Their technological fanaticism drove you to question the power and beliefs of the Exolitics, and they saw you as a \
|
||||
heretic and subjected you to hours of horrible torture. You were hours away from execution when a high-ranking friend of yours in the Cooperative managed to secure you a pod, \
|
||||
scrambled its destination's coordinates, and launched it. You awoke from stasis when you landed and have been surviving - barely - ever since.</b>"
|
||||
scrambled its destination's coordinates, and launched it. You awoke from stasis when you landed and have been surviving - barely - ever since."
|
||||
outfit.uniform = /obj/item/clothing/under/rank/prisoner
|
||||
outfit.shoes = /obj/item/clothing/shoes/sneakers/orange
|
||||
outfit.back = /obj/item/storage/backpack
|
||||
if(3)
|
||||
flavour_text += "you were a doctor on one of Nanotrasen's space stations, but you left behind that damn corporation's tyranny and everything it stood for. From a metaphorical hell \
|
||||
to a literal one, you find yourself nonetheless missing the recycled air and warm floors of what you left behind... but you'd still rather be here than there.</b>"
|
||||
to a literal one, you find yourself nonetheless missing the recycled air and warm floors of what you left behind... but you'd still rather be here than there."
|
||||
outfit.uniform = /obj/item/clothing/under/rank/medical
|
||||
outfit.suit = /obj/item/clothing/suit/toggle/labcoat
|
||||
outfit.back = /obj/item/storage/backpack/medic
|
||||
@@ -244,7 +252,7 @@
|
||||
if(4)
|
||||
flavour_text += "you were always joked about by your friends for \"not playing with a full deck\", as they so <i>kindly</i> put it. It seems that they were right when you, on a tour \
|
||||
at one of Nanotrasen's state-of-the-art research facilities, were in one of the escape pods alone and saw the red button. It was big and shiny, and it caught your eye. You pressed \
|
||||
it, and after a terrifying and fast ride for days, you landed here. You've had time to wisen up since then, and you think that your old friends wouldn't be laughing now.</b>"
|
||||
it, and after a terrifying and fast ride for days, you landed here. You've had time to wisen up since then, and you think that your old friends wouldn't be laughing now."
|
||||
outfit.uniform = /obj/item/clothing/under/color/grey/glorf
|
||||
outfit.shoes = /obj/item/clothing/shoes/sneakers/black
|
||||
outfit.back = /obj/item/storage/backpack
|
||||
@@ -283,8 +291,9 @@
|
||||
outfit = /datum/outfit/lavalandprisoner
|
||||
roundstart = FALSE
|
||||
death = FALSE
|
||||
flavour_text = "<b>Good. It seems as though your ship crashed. <span class='big bold'>You're a prisoner,</span> sentenced to hard work in one of Nanotrasen's labor camps, but it seems as \
|
||||
though fate has other plans for you. You remember that you were convicted of "
|
||||
short_desc = "You're a prisoner, sentenced to hard work in one of Nanotrasen's labor camps, but it seems as \
|
||||
though fate has other plans for you."
|
||||
flavour_text = "Good. It seems as though your ship crashed. You remember that you were convicted of "
|
||||
assignedrole = "Escaped Prisoner"
|
||||
|
||||
/obj/effect/mob_spawn/human/prisoner_transport/special(mob/living/L)
|
||||
@@ -296,7 +305,7 @@
|
||||
var/list/crimes = list("murder", "larceny", "embezzlement", "unionization", "dereliction of duty", "kidnapping", "gross incompetence", "grand theft", "collaboration with the Syndicate", \
|
||||
"worship of a forbidden deity", "interspecies relations", "mutiny")
|
||||
flavour_text += "[pick(crimes)]. but regardless of that, it seems like your crime doesn't matter now. You don't know where you are, but you know that it's out to kill you, and you're not going \
|
||||
to lose this opportunity. Find a way to get out of this mess and back to where you rightfully belong - your [pick("house", "apartment", "spaceship", "station")]</b>."
|
||||
to lose this opportunity. Find a way to get out of this mess and back to where you rightfully belong - your [pick("house", "apartment", "spaceship", "station")]."
|
||||
|
||||
/datum/outfit/lavalandprisoner
|
||||
name = "Lavaland Prisoner"
|
||||
@@ -323,8 +332,9 @@
|
||||
roundstart = FALSE
|
||||
random = TRUE
|
||||
outfit = /datum/outfit/hotelstaff
|
||||
flavour_text = "<span class='big bold'>You are a staff member of a top-of-the-line space hotel!</span><b> Cater to guests and <font size=6><b>DON'T</b></font> leave the hotel, lest the manager fire you for\
|
||||
dereliction of duty!</b>"
|
||||
short_desc = "You are a staff member of a top-of-the-line space hotel!"
|
||||
flavour_text = "You are a staff member of a top-of-the-line space hotel! Cater to guests and make sure the manager doesn't fire you."
|
||||
important_info = "DON'T leave the hotel"
|
||||
assignedrole = "Hotel Staff"
|
||||
|
||||
/datum/outfit/hotelstaff
|
||||
@@ -341,8 +351,10 @@
|
||||
mob_name = "hotel security member"
|
||||
job_description = "Hotel Security"
|
||||
outfit = /datum/outfit/hotelstaff/security
|
||||
flavour_text = "<span class='big bold'>You are a peacekeeper</span><b> assigned to this hotel to protect the interests of the company while keeping the peace between \
|
||||
guests and the staff. Do <font size=6>NOT</font> leave the hotel, as that is grounds for contract termination.</b>"
|
||||
short_desc = "You are a peacekeeper."
|
||||
flavour_text = "You have been assigned to this hotel to protect the interests of the company while keeping the peace between \
|
||||
guests and the staff."
|
||||
important_info = "Do NOT leave the hotel, as that is grounds for contract termination."
|
||||
objectives = "Do not leave your assigned hotel. Try and keep the peace between staff and guests, non-lethal force heavily advised if possible."
|
||||
|
||||
/datum/outfit/hotelstaff/security
|
||||
@@ -381,7 +393,8 @@
|
||||
/obj/effect/mob_spawn/human/demonic_friend/Initialize(mapload, datum/mind/owner_mind, obj/effect/proc_holder/spell/targeted/summon_friend/summoning_spell)
|
||||
. = ..()
|
||||
owner = owner_mind
|
||||
flavour_text = "<span class='big bold'>You have been given a reprieve from your eternity of torment, to be [owner.name]'s friend for [owner.p_their()] short mortal coil.</span><b> Be aware that if you do not live up to [owner.name]'s expectations, they can send you back to hell with a single thought. [owner.name]'s death will also return you to hell.</b>"
|
||||
flavour_text = "You have been given a reprieve from your eternity of torment, to be [owner.name]'s friend for [owner.p_their()] short mortal coil."
|
||||
important_info = "Be aware that if you do not live up to [owner.name]'s expectations, they can send you back to hell with a single thought. [owner.name]'s death will also return you to hell."
|
||||
var/area/A = get_area(src)
|
||||
if(!mapload && A)
|
||||
notify_ghosts("\A friendship shell has been completed in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_dnr_observers = TRUE)
|
||||
@@ -439,9 +452,9 @@
|
||||
|
||||
/obj/effect/mob_spawn/human/syndicate/battlecruiser
|
||||
name = "Syndicate Battlecruiser Ship Operative"
|
||||
flavour_text = "<span class='big bold'>You are a crewmember aboard the syndicate flagship: the SBC Starfury.</span><span class='big'> <span class='danger'><b>Your job is to follow your captain's orders, maintain the ship, and keep the engine running.</b></span> If you are not familiar with how the supermatter engine functions: <b>do not attempt to start it.</b><br>\
|
||||
<br>\
|
||||
<span class='danger'><b>The armory is not a candy store, and your role is not to assault the station directly, leave that work to the assault operatives.</b></span></font>"
|
||||
short_desc = "You are a crewmember aboard the syndicate flagship: the SBC Starfury."
|
||||
flavour_text = "Your job is to follow your captain's orders, maintain the ship, and keep the engine running. If you are not familiar with how the supermatter engine functions: do not attempt to start it."
|
||||
important_info = "The armory is not a candy store, and your role is not to assault the station directly, leave that work to the assault operatives."
|
||||
outfit = /datum/outfit/syndicate_empty/SBC
|
||||
|
||||
/datum/outfit/syndicate_empty/SBC
|
||||
@@ -451,10 +464,9 @@
|
||||
belt = /obj/item/storage/belt/military/assault
|
||||
|
||||
/obj/effect/mob_spawn/human/syndicate/battlecruiser/assault
|
||||
name = "Syndicate Battlecruiser Assault Operative"
|
||||
flavour_text = "<span class='big bold'>You are an assault operative aboard the syndicate flagship: the SBC Starfury.</span><span class='big'> <span class='danger'><b>Your job is to follow your captain's orders, keep intruders out of the ship, and assault Space Station 13.</b></span> There is an armory, multiple assault ships, and beam cannons to attack the station with.<br>\
|
||||
<br>\
|
||||
<span class='danger'><b>Work as a team with your fellow operatives and work out a plan of attack. If you are overwhelmed, escape back to your ship!</b></span></span>"
|
||||
short_desc = "You are an assault operative aboard the syndicate flagship: the SBC Starfury."
|
||||
flavour_text = "Your job is to follow your captain's orders, keep intruders out of the ship, and assault Space Station 13. There is an armory, multiple assault ships, and beam cannons to attack the station with."
|
||||
important_info = "Work as a team with your fellow operatives and work out a plan of attack. If you are overwhelmed, escape back to your ship!"
|
||||
outfit = /datum/outfit/syndicate_empty/SBC/assault
|
||||
|
||||
/datum/outfit/syndicate_empty/SBC/assault
|
||||
@@ -470,9 +482,9 @@
|
||||
|
||||
/obj/effect/mob_spawn/human/syndicate/battlecruiser/captain
|
||||
name = "Syndicate Battlecruiser Captain"
|
||||
flavour_text = "<span class='big bold'>You are the captain aboard the syndicate flagship: the SBC Starfury.</span><span class='big'> <span class='danger'><b>Your job is to oversee your crew, defend the ship, and destroy Space Station 13.</b></span> The ship has an armory, multiple ships, beam cannons, and multiple crewmembers to accomplish this goal.<br>\
|
||||
<br>\
|
||||
<span class='danger'><b>As the captain, this whole operation falls on your shoulders.</b></span> You do not need to nuke the station, causing sufficient damage and preventing your ship from being destroyed will be enough.</span>"
|
||||
short_desc = "You are the captain aboard the syndicate flagship: the SBC Starfury."
|
||||
flavour_text = "Your job is to oversee your crew, defend the ship, and destroy Space Station 13. The ship has an armory, multiple ships, beam cannons, and multiple crewmembers to accomplish this goal."
|
||||
important_info = "As the captain, this whole operation falls on your shoulders. You do not need to nuke the station, causing sufficient damage and preventing your ship from being destroyed will be enough."
|
||||
outfit = /datum/outfit/syndicate_empty/SBC/assault/captain
|
||||
id_access_list = list(150,151)
|
||||
|
||||
@@ -498,10 +510,11 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You are a security officer working for Nanotrasen,</span><b> stationed onboard a state of the art research station. You vaguely recall rushing into a \
|
||||
cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
|
||||
Work as a team with your fellow survivors and do not abandon them.</b>"
|
||||
short_desc = "You are a security officer working for Nanotrasen, stationed onboard a state of the art research station."
|
||||
flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. \
|
||||
The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
|
||||
important_info = "Work as a team with your fellow survivors and do not abandon them."
|
||||
uniform = /obj/item/clothing/under/rank/security
|
||||
shoes = /obj/item/clothing/shoes/jackboots
|
||||
id = /obj/item/card/id/away/old/sec
|
||||
@@ -525,10 +538,11 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You are an engineer working for Nanotrasen,</span><b> stationed onboard a state of the art research station. You vaguely recall rushing into a \
|
||||
cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
|
||||
Work as a team with your fellow survivors and do not abandon them.</b>"
|
||||
short_desc = "You are an engineer working for Nanotrasen, stationed onboard a state of the art research station."
|
||||
flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. The last thing \
|
||||
you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
|
||||
important_info = "Work as a team with your fellow survivors and do not abandon them."
|
||||
uniform = /obj/item/clothing/under/rank/engineer
|
||||
shoes = /obj/item/clothing/shoes/workboots
|
||||
id = /obj/item/card/id/away/old/eng
|
||||
@@ -550,10 +564,11 @@
|
||||
death = FALSE
|
||||
random = TRUE
|
||||
mob_species = /datum/species/human
|
||||
flavour_text = "<span class='big bold'>You are a scientist working for Nanotrasen,</span><b> stationed onboard a state of the art research station. You vaguely recall rushing into a \
|
||||
cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
|
||||
Work as a team with your fellow survivors and do not abandon them.</b>"
|
||||
short_desc = "You are a scientist working for Nanotrasen, stationed onboard a state of the art research station."
|
||||
flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. \
|
||||
The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
|
||||
your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
|
||||
important_info = "Work as a team with your fellow survivors and do not abandon them."
|
||||
uniform = /obj/item/clothing/under/rank/scientist
|
||||
shoes = /obj/item/clothing/shoes/laceup
|
||||
id = /obj/item/card/id/away/old/sci
|
||||
@@ -580,7 +595,8 @@
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
show_flavour = FALSE //Flavour only exists for spawners menu
|
||||
flavour_text = "<span class='big bold'>You are a space pirate.</span><b> The station refused to pay for your protection, protect the ship, siphon the credits from the station and raid it for even more loot.</b>"
|
||||
short_desc = "You are a space pirate."
|
||||
flavour_text = "The station refused to pay for your protection, protect the ship, siphon the credits from the station and raid it for even more loot."
|
||||
assignedrole = "Space Pirate"
|
||||
var/rank = "Mate"
|
||||
|
||||
|
||||
@@ -1,111 +1,111 @@
|
||||
#define TANK_DISPENSER_CAPACITY 10
|
||||
|
||||
/obj/structure/tank_dispenser
|
||||
name = "tank dispenser"
|
||||
desc = "A simple yet bulky storage device for gas tanks. Holds up to 10 oxygen tanks and 10 plasma tanks."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "dispenser"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
max_integrity = 300
|
||||
var/oxygentanks = TANK_DISPENSER_CAPACITY
|
||||
var/plasmatanks = TANK_DISPENSER_CAPACITY
|
||||
|
||||
/obj/structure/tank_dispenser/oxygen
|
||||
plasmatanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/plasma
|
||||
oxygentanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/Initialize()
|
||||
. = ..()
|
||||
for(var/i in 1 to oxygentanks)
|
||||
new /obj/item/tank/internals/oxygen(src)
|
||||
for(var/i in 1 to plasmatanks)
|
||||
new /obj/item/tank/internals/plasma(src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/update_icon()
|
||||
cut_overlays()
|
||||
switch(oxygentanks)
|
||||
if(1 to 3)
|
||||
add_overlay("oxygen-[oxygentanks]")
|
||||
if(4 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("oxygen-4")
|
||||
switch(plasmatanks)
|
||||
if(1 to 4)
|
||||
add_overlay("plasma-[plasmatanks]")
|
||||
if(5 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("plasma-5")
|
||||
|
||||
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
|
||||
var/full
|
||||
if(istype(I, /obj/item/tank/internals/plasma))
|
||||
if(plasmatanks < TANK_DISPENSER_CAPACITY)
|
||||
plasmatanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/tank/internals/oxygen))
|
||||
if(oxygentanks < TANK_DISPENSER_CAPACITY)
|
||||
oxygentanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
default_unfasten_wrench(user, I, time = 20)
|
||||
return
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='notice'>[I] does not fit into [src].</span>")
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
if(full)
|
||||
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
|
||||
return
|
||||
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tank_dispenser", name, 275, 100, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["oxygen"] = oxygentanks
|
||||
data["plasma"] = plasmatanks
|
||||
|
||||
return data
|
||||
|
||||
/obj/structure/tank_dispenser/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("plasma")
|
||||
var/obj/item/tank/internals/plasma/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
plasmatanks--
|
||||
. = TRUE
|
||||
if("oxygen")
|
||||
var/obj/item/tank/internals/oxygen/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
oxygentanks--
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
for(var/X in src)
|
||||
var/obj/item/I = X
|
||||
I.forceMove(loc)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
#undef TANK_DISPENSER_CAPACITY
|
||||
#define TANK_DISPENSER_CAPACITY 10
|
||||
|
||||
/obj/structure/tank_dispenser
|
||||
name = "tank dispenser"
|
||||
desc = "A simple yet bulky storage device for gas tanks. Holds up to 10 oxygen tanks and 10 plasma tanks."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "dispenser"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
max_integrity = 300
|
||||
var/oxygentanks = TANK_DISPENSER_CAPACITY
|
||||
var/plasmatanks = TANK_DISPENSER_CAPACITY
|
||||
|
||||
/obj/structure/tank_dispenser/oxygen
|
||||
plasmatanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/plasma
|
||||
oxygentanks = 0
|
||||
|
||||
/obj/structure/tank_dispenser/Initialize()
|
||||
. = ..()
|
||||
for(var/i in 1 to oxygentanks)
|
||||
new /obj/item/tank/internals/oxygen(src)
|
||||
for(var/i in 1 to plasmatanks)
|
||||
new /obj/item/tank/internals/plasma(src)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/update_icon()
|
||||
cut_overlays()
|
||||
switch(oxygentanks)
|
||||
if(1 to 3)
|
||||
add_overlay("oxygen-[oxygentanks]")
|
||||
if(4 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("oxygen-4")
|
||||
switch(plasmatanks)
|
||||
if(1 to 4)
|
||||
add_overlay("plasma-[plasmatanks]")
|
||||
if(5 to TANK_DISPENSER_CAPACITY)
|
||||
add_overlay("plasma-5")
|
||||
|
||||
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
|
||||
var/full
|
||||
if(istype(I, /obj/item/tank/internals/plasma))
|
||||
if(plasmatanks < TANK_DISPENSER_CAPACITY)
|
||||
plasmatanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/tank/internals/oxygen))
|
||||
if(oxygentanks < TANK_DISPENSER_CAPACITY)
|
||||
oxygentanks++
|
||||
else
|
||||
full = TRUE
|
||||
else if(istype(I, /obj/item/wrench))
|
||||
default_unfasten_wrench(user, I, time = 20)
|
||||
return
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='notice'>[I] does not fit into [src].</span>")
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
if(full)
|
||||
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
|
||||
return
|
||||
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tank_dispenser", name, 275, 103, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/tank_dispenser/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["oxygen"] = oxygentanks
|
||||
data["plasma"] = plasmatanks
|
||||
|
||||
return data
|
||||
|
||||
/obj/structure/tank_dispenser/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("plasma")
|
||||
var/obj/item/tank/internals/plasma/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
plasmatanks--
|
||||
. = TRUE
|
||||
if("oxygen")
|
||||
var/obj/item/tank/internals/oxygen/tank = locate() in src
|
||||
if(tank && Adjacent(usr))
|
||||
usr.put_in_hands(tank)
|
||||
oxygentanks--
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
for(var/X in src)
|
||||
var/obj/item/I = X
|
||||
I.forceMove(loc)
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
#undef TANK_DISPENSER_CAPACITY
|
||||
|
||||
+322
-319
@@ -1,319 +1,322 @@
|
||||
#define RESTART_COUNTER_PATH "data/round_counter.txt"
|
||||
|
||||
GLOBAL_VAR(restart_counter)
|
||||
|
||||
GLOBAL_VAR(topic_status_lastcache)
|
||||
GLOBAL_LIST(topic_status_cache)
|
||||
|
||||
//This happens after the Master subsystem new(s) (it's a global datum)
|
||||
//So subsystems globals exist, but are not initialised
|
||||
/world/New()
|
||||
|
||||
log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
|
||||
|
||||
SetupExternalRSC()
|
||||
|
||||
GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
|
||||
|
||||
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
|
||||
|
||||
TgsNew()
|
||||
|
||||
GLOB.revdata = new
|
||||
|
||||
config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
|
||||
|
||||
//SetupLogs depends on the RoundID, so lets check
|
||||
//DB schema and set RoundID if we can
|
||||
SSdbcore.CheckSchemaVersion()
|
||||
SSdbcore.SetRoundID()
|
||||
SetupLogs()
|
||||
|
||||
#ifndef USE_CUSTOM_ERROR_HANDLER
|
||||
world.log = file("[GLOB.log_directory]/dd.log")
|
||||
#endif
|
||||
|
||||
load_admins()
|
||||
LoadVerbs(/datum/verbs/menu)
|
||||
if(CONFIG_GET(flag/usewhitelist))
|
||||
load_whitelist()
|
||||
LoadBans()
|
||||
reload_custom_roundstart_items_list()//Cit change - loads donator items. Remind me to remove when I port over bay's loadout system
|
||||
|
||||
GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000
|
||||
|
||||
if(fexists(RESTART_COUNTER_PATH))
|
||||
GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
|
||||
fdel(RESTART_COUNTER_PATH)
|
||||
|
||||
if(NO_INIT_PARAMETER in params)
|
||||
return
|
||||
|
||||
cit_initialize()
|
||||
|
||||
Master.Initialize(10, FALSE, TRUE)
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
HandleTestRun()
|
||||
|
||||
/world/proc/HandleTestRun()
|
||||
//trigger things to run the whole process
|
||||
Master.sleep_offline_after_initializations = FALSE
|
||||
SSticker.start_immediately = TRUE
|
||||
CONFIG_SET(number/round_end_countdown, 0)
|
||||
var/datum/callback/cb
|
||||
#ifdef UNIT_TESTS
|
||||
cb = CALLBACK(GLOBAL_PROC, /proc/RunUnitTests)
|
||||
#else
|
||||
cb = VARSET_CALLBACK(SSticker, force_ending, TRUE)
|
||||
#endif
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, /proc/addtimer, cb, 10 SECONDS))
|
||||
|
||||
/world/proc/SetupExternalRSC()
|
||||
#if (PRELOAD_RSC == 0)
|
||||
GLOB.external_rsc_urls = world.file2list("[global.config.directory]/external_rsc_urls.txt","\n")
|
||||
var/i=1
|
||||
while(i<=GLOB.external_rsc_urls.len)
|
||||
if(GLOB.external_rsc_urls[i])
|
||||
i++
|
||||
else
|
||||
GLOB.external_rsc_urls.Cut(i,i+1)
|
||||
#endif
|
||||
|
||||
/world/proc/SetupLogs()
|
||||
var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
|
||||
if(!override_dir)
|
||||
var/realtime = world.realtime
|
||||
var/texttime = time2text(realtime, "YYYY/MM/DD")
|
||||
GLOB.log_directory = "data/logs/[texttime]/round-"
|
||||
GLOB.picture_logging_prefix = "L_[time2text(realtime, "YYYYMMDD")]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[texttime]/round-"
|
||||
if(GLOB.round_id)
|
||||
GLOB.log_directory += "[GLOB.round_id]"
|
||||
GLOB.picture_logging_prefix += "R_[GLOB.round_id]_"
|
||||
GLOB.picture_log_directory += "[GLOB.round_id]"
|
||||
else
|
||||
var/timestamp = replacetext(TIME_STAMP("hh:mm:ss", FALSE), ":", ".")
|
||||
GLOB.log_directory += "[timestamp]"
|
||||
GLOB.picture_log_directory += "[timestamp]"
|
||||
GLOB.picture_logging_prefix += "T_[timestamp]_"
|
||||
else
|
||||
GLOB.log_directory = "data/logs/[override_dir]"
|
||||
GLOB.picture_logging_prefix = "O_[override_dir]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
|
||||
|
||||
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
|
||||
GLOB.world_virus_log = "[GLOB.log_directory]/virus.log"
|
||||
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
|
||||
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
|
||||
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
|
||||
GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
|
||||
GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
|
||||
GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
|
||||
GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log"
|
||||
GLOB.world_map_error_log = "[GLOB.log_directory]/map_errors.log"
|
||||
GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log"
|
||||
GLOB.query_debug_log = "[GLOB.log_directory]/query_debug.log"
|
||||
GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log"
|
||||
GLOB.subsystem_log = "[GLOB.log_directory]/subsystem.log"
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
GLOB.test_log = file("[GLOB.log_directory]/tests.log")
|
||||
start_log(GLOB.test_log)
|
||||
#endif
|
||||
start_log(GLOB.world_game_log)
|
||||
start_log(GLOB.world_attack_log)
|
||||
start_log(GLOB.world_pda_log)
|
||||
start_log(GLOB.world_telecomms_log)
|
||||
start_log(GLOB.world_manifest_log)
|
||||
start_log(GLOB.world_href_log)
|
||||
start_log(GLOB.world_qdel_log)
|
||||
start_log(GLOB.world_runtime_log)
|
||||
start_log(GLOB.world_job_debug_log)
|
||||
start_log(GLOB.subsystem_log)
|
||||
|
||||
GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
|
||||
if(fexists(GLOB.config_error_log))
|
||||
fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
|
||||
fdel(GLOB.config_error_log)
|
||||
|
||||
if(GLOB.round_id)
|
||||
log_game("Round ID: [GLOB.round_id]")
|
||||
|
||||
// This was printed early in startup to the world log and config_error.log,
|
||||
// but those are both private, so let's put the commit info in the runtime
|
||||
// log which is ultimately public.
|
||||
log_runtime(GLOB.revdata.get_log_message())
|
||||
|
||||
/world/Topic(T, addr, master, key)
|
||||
TGS_TOPIC //redirect to server tools if necessary
|
||||
|
||||
if(!SSfail2topic)
|
||||
return "Server not initialized."
|
||||
else if(SSfail2topic.IsRateLimited(addr))
|
||||
return "Rate limited."
|
||||
|
||||
if(length(T) > CONFIG_GET(number/topic_max_size))
|
||||
return "Payload too large!"
|
||||
|
||||
var/static/list/topic_handlers = TopicHandlers()
|
||||
|
||||
var/list/input = params2list(T)
|
||||
var/datum/world_topic/handler
|
||||
for(var/I in topic_handlers)
|
||||
if(I in input)
|
||||
handler = topic_handlers[I]
|
||||
break
|
||||
|
||||
if((!handler || initial(handler.log)) && config && CONFIG_GET(flag/log_world_topic))
|
||||
log_topic("\"[T]\", from:[addr], master:[master], key:[key]")
|
||||
|
||||
if(!handler)
|
||||
return
|
||||
|
||||
handler = new handler()
|
||||
return handler.TryRun(input, addr)
|
||||
|
||||
/world/proc/AnnouncePR(announcement, list/payload)
|
||||
var/static/list/PRcounts = list() //PR id -> number of times announced this round
|
||||
var/id = "[payload["pull_request"]["id"]]"
|
||||
if(!PRcounts[id])
|
||||
PRcounts[id] = 1
|
||||
else
|
||||
++PRcounts[id]
|
||||
if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
|
||||
return
|
||||
|
||||
var/final_composed = "<span class='announce'>PR: [announcement]</span>"
|
||||
for(var/client/C in GLOB.clients)
|
||||
C.AnnouncePR(final_composed)
|
||||
|
||||
/world/proc/FinishTestRun()
|
||||
set waitfor = FALSE
|
||||
var/list/fail_reasons
|
||||
if(GLOB)
|
||||
if(GLOB.total_runtimes != 0)
|
||||
fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
|
||||
#ifdef UNIT_TESTS
|
||||
if(GLOB.failed_any_test)
|
||||
LAZYADD(fail_reasons, "Unit Tests failed!")
|
||||
#endif
|
||||
if(!GLOB.log_directory)
|
||||
LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
|
||||
else
|
||||
fail_reasons = list("Missing GLOB!")
|
||||
if(!fail_reasons)
|
||||
text2file("Success!", "[GLOB.log_directory]/clean_run.lk")
|
||||
else
|
||||
log_world("Test run failed!\n[fail_reasons.Join("\n")]")
|
||||
sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
|
||||
qdel(src) //shut it down
|
||||
|
||||
/world/Reboot(reason = 0, fast_track = FALSE)
|
||||
TgsReboot()
|
||||
if (reason || fast_track) //special reboot, do none of the normal stuff
|
||||
if (usr)
|
||||
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting World immediately due to host request</span>")
|
||||
else
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
FinishTestRun()
|
||||
return
|
||||
|
||||
if(TgsAvailable())
|
||||
var/do_hard_reboot
|
||||
// check the hard reboot counter
|
||||
var/ruhr = CONFIG_GET(number/rounds_until_hard_restart)
|
||||
switch(ruhr)
|
||||
if(-1)
|
||||
do_hard_reboot = FALSE
|
||||
if(0)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
if(GLOB.restart_counter >= ruhr)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
text2file("[++GLOB.restart_counter]", RESTART_COUNTER_PATH)
|
||||
do_hard_reboot = FALSE
|
||||
|
||||
if(do_hard_reboot)
|
||||
log_world("World hard rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // See comment below.
|
||||
TgsEndProcess()
|
||||
|
||||
log_world("World rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
|
||||
..()
|
||||
|
||||
/world/proc/update_status()
|
||||
|
||||
var/list/features = list()
|
||||
|
||||
/*if(GLOB.master_mode) CIT CHANGE - hides the gamemode from the hub entry, removes some useless info from the hub entry
|
||||
features += GLOB.master_mode
|
||||
|
||||
if (!GLOB.enter_allowed)
|
||||
features += "closed"*/
|
||||
|
||||
var/s = ""
|
||||
var/hostedby
|
||||
if(config)
|
||||
var/server_name = CONFIG_GET(string/servername)
|
||||
if (server_name)
|
||||
s += "<b>[server_name]</b> — "
|
||||
/*features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn" CIT CHANGE - removes some useless info from the hub entry
|
||||
if(CONFIG_GET(flag/allow_vote_mode))
|
||||
features += "vote"
|
||||
if(CONFIG_GET(flag/allow_ai))
|
||||
features += "AI allowed"*/
|
||||
hostedby = CONFIG_GET(string/hostedby)
|
||||
|
||||
s += "<b>[station_name()]</b>";
|
||||
s += " ("
|
||||
s += "<a href=\"https://citadel-station.net/home/\">" //Change this to wherever you want the hub to link to. CIT CHANGE - links to cit's website on the hub
|
||||
s += "Citadel" //Replace this with something else. Or ever better, delete it and uncomment the game version. CIT CHANGE - modifies the hub entry link
|
||||
s += "</a>"
|
||||
s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
|
||||
s += "<br>[CONFIG_GET(string/servertagline)]<br>" //CIT CHANGE - adds a tagline!
|
||||
|
||||
var/n = 0
|
||||
for (var/mob/M in GLOB.player_list)
|
||||
if (M.client)
|
||||
n++
|
||||
|
||||
if(SSmapping.config) // this just stops the runtime, honk.
|
||||
features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
|
||||
|
||||
if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
|
||||
features += "[get_security_level()] alert"
|
||||
|
||||
if (n > 1)
|
||||
features += "~[n] players"
|
||||
else if (n > 0)
|
||||
features += "~[n] player"
|
||||
|
||||
if (!host && hostedby)
|
||||
features += "hosted by <b>[hostedby]</b>"
|
||||
|
||||
if (features)
|
||||
s += "\[[jointext(features, ", ")]" //CIT CHANGE - replaces the colon here with a left bracket
|
||||
|
||||
status = s
|
||||
|
||||
/world/proc/update_hub_visibility(new_visibility)
|
||||
if(new_visibility == GLOB.hub_visibility)
|
||||
return
|
||||
GLOB.hub_visibility = new_visibility
|
||||
if(GLOB.hub_visibility)
|
||||
hub_password = "kMZy3U5jJHSiBQjr"
|
||||
else
|
||||
hub_password = "SORRYNOPASSWORD"
|
||||
|
||||
/world/proc/incrementMaxZ()
|
||||
maxz++
|
||||
SSmobs.MaxZChanged()
|
||||
SSidlenpcpool.MaxZChanged()
|
||||
#define RESTART_COUNTER_PATH "data/round_counter.txt"
|
||||
|
||||
GLOBAL_VAR(restart_counter)
|
||||
|
||||
GLOBAL_VAR(topic_status_lastcache)
|
||||
GLOBAL_LIST(topic_status_cache)
|
||||
|
||||
//This happens after the Master subsystem new(s) (it's a global datum)
|
||||
//So subsystems globals exist, but are not initialised
|
||||
/world/New()
|
||||
|
||||
log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
|
||||
|
||||
SetupExternalRSC()
|
||||
|
||||
GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
|
||||
|
||||
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
|
||||
|
||||
TgsNew()
|
||||
|
||||
GLOB.revdata = new
|
||||
|
||||
config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
|
||||
|
||||
//SetupLogs depends on the RoundID, so lets check
|
||||
//DB schema and set RoundID if we can
|
||||
SSdbcore.CheckSchemaVersion()
|
||||
SSdbcore.SetRoundID()
|
||||
SetupLogs()
|
||||
|
||||
#ifndef USE_CUSTOM_ERROR_HANDLER
|
||||
world.log = file("[GLOB.log_directory]/dd.log")
|
||||
#endif
|
||||
|
||||
load_admins()
|
||||
LoadVerbs(/datum/verbs/menu)
|
||||
if(CONFIG_GET(flag/usewhitelist))
|
||||
load_whitelist()
|
||||
LoadBans()
|
||||
reload_custom_roundstart_items_list()//Cit change - loads donator items. Remind me to remove when I port over bay's loadout system
|
||||
|
||||
GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000
|
||||
|
||||
if(fexists(RESTART_COUNTER_PATH))
|
||||
GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
|
||||
fdel(RESTART_COUNTER_PATH)
|
||||
|
||||
if(NO_INIT_PARAMETER in params)
|
||||
return
|
||||
|
||||
cit_initialize()
|
||||
|
||||
Master.Initialize(10, FALSE, TRUE)
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
HandleTestRun()
|
||||
|
||||
/world/proc/HandleTestRun()
|
||||
//trigger things to run the whole process
|
||||
Master.sleep_offline_after_initializations = FALSE
|
||||
SSticker.start_immediately = TRUE
|
||||
CONFIG_SET(number/round_end_countdown, 0)
|
||||
var/datum/callback/cb
|
||||
#ifdef UNIT_TESTS
|
||||
cb = CALLBACK(GLOBAL_PROC, /proc/RunUnitTests)
|
||||
#else
|
||||
cb = VARSET_CALLBACK(SSticker, force_ending, TRUE)
|
||||
#endif
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, /proc/addtimer, cb, 10 SECONDS))
|
||||
|
||||
/world/proc/SetupExternalRSC()
|
||||
#if (PRELOAD_RSC == 0)
|
||||
GLOB.external_rsc_urls = world.file2list("[global.config.directory]/external_rsc_urls.txt","\n")
|
||||
var/i=1
|
||||
while(i<=GLOB.external_rsc_urls.len)
|
||||
if(GLOB.external_rsc_urls[i])
|
||||
i++
|
||||
else
|
||||
GLOB.external_rsc_urls.Cut(i,i+1)
|
||||
#endif
|
||||
|
||||
/world/proc/SetupLogs()
|
||||
var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
|
||||
if(!override_dir)
|
||||
var/realtime = world.realtime
|
||||
var/texttime = time2text(realtime, "YYYY/MM/DD")
|
||||
GLOB.log_directory = "data/logs/[texttime]/round-"
|
||||
GLOB.picture_logging_prefix = "L_[time2text(realtime, "YYYYMMDD")]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[texttime]/round-"
|
||||
if(GLOB.round_id)
|
||||
GLOB.log_directory += "[GLOB.round_id]"
|
||||
GLOB.picture_logging_prefix += "R_[GLOB.round_id]_"
|
||||
GLOB.picture_log_directory += "[GLOB.round_id]"
|
||||
else
|
||||
var/timestamp = replacetext(TIME_STAMP("hh:mm:ss", FALSE), ":", ".")
|
||||
GLOB.log_directory += "[timestamp]"
|
||||
GLOB.picture_log_directory += "[timestamp]"
|
||||
GLOB.picture_logging_prefix += "T_[timestamp]_"
|
||||
else
|
||||
GLOB.log_directory = "data/logs/[override_dir]"
|
||||
GLOB.picture_logging_prefix = "O_[override_dir]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
|
||||
|
||||
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
|
||||
GLOB.world_virus_log = "[GLOB.log_directory]/virus.log"
|
||||
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
|
||||
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
|
||||
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
|
||||
GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
|
||||
GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
|
||||
GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
|
||||
GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log"
|
||||
GLOB.world_map_error_log = "[GLOB.log_directory]/map_errors.log"
|
||||
GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log"
|
||||
GLOB.query_debug_log = "[GLOB.log_directory]/query_debug.log"
|
||||
GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log"
|
||||
GLOB.tgui_log = "[GLOB.log_directory]/tgui.log"
|
||||
GLOB.subsystem_log = "[GLOB.log_directory]/subsystem.log"
|
||||
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
GLOB.test_log = file("[GLOB.log_directory]/tests.log")
|
||||
start_log(GLOB.test_log)
|
||||
#endif
|
||||
start_log(GLOB.world_game_log)
|
||||
start_log(GLOB.world_attack_log)
|
||||
start_log(GLOB.world_pda_log)
|
||||
start_log(GLOB.world_telecomms_log)
|
||||
start_log(GLOB.world_manifest_log)
|
||||
start_log(GLOB.world_href_log)
|
||||
start_log(GLOB.world_qdel_log)
|
||||
start_log(GLOB.world_runtime_log)
|
||||
start_log(GLOB.world_job_debug_log)
|
||||
start_log(GLOB.tgui_log)
|
||||
start_log(GLOB.subsystem_log)
|
||||
|
||||
GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
|
||||
if(fexists(GLOB.config_error_log))
|
||||
fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
|
||||
fdel(GLOB.config_error_log)
|
||||
|
||||
if(GLOB.round_id)
|
||||
log_game("Round ID: [GLOB.round_id]")
|
||||
|
||||
// This was printed early in startup to the world log and config_error.log,
|
||||
// but those are both private, so let's put the commit info in the runtime
|
||||
// log which is ultimately public.
|
||||
log_runtime(GLOB.revdata.get_log_message())
|
||||
|
||||
/world/Topic(T, addr, master, key)
|
||||
TGS_TOPIC //redirect to server tools if necessary
|
||||
|
||||
if(!SSfail2topic)
|
||||
return "Server not initialized."
|
||||
else if(SSfail2topic.IsRateLimited(addr))
|
||||
return "Rate limited."
|
||||
|
||||
if(length(T) > CONFIG_GET(number/topic_max_size))
|
||||
return "Payload too large!"
|
||||
|
||||
var/static/list/topic_handlers = TopicHandlers()
|
||||
|
||||
var/list/input = params2list(T)
|
||||
var/datum/world_topic/handler
|
||||
for(var/I in topic_handlers)
|
||||
if(I in input)
|
||||
handler = topic_handlers[I]
|
||||
break
|
||||
|
||||
if((!handler || initial(handler.log)) && config && CONFIG_GET(flag/log_world_topic))
|
||||
log_topic("\"[T]\", from:[addr], master:[master], key:[key]")
|
||||
|
||||
if(!handler)
|
||||
return
|
||||
|
||||
handler = new handler()
|
||||
return handler.TryRun(input, addr)
|
||||
|
||||
/world/proc/AnnouncePR(announcement, list/payload)
|
||||
var/static/list/PRcounts = list() //PR id -> number of times announced this round
|
||||
var/id = "[payload["pull_request"]["id"]]"
|
||||
if(!PRcounts[id])
|
||||
PRcounts[id] = 1
|
||||
else
|
||||
++PRcounts[id]
|
||||
if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
|
||||
return
|
||||
|
||||
var/final_composed = "<span class='announce'>PR: [announcement]</span>"
|
||||
for(var/client/C in GLOB.clients)
|
||||
C.AnnouncePR(final_composed)
|
||||
|
||||
/world/proc/FinishTestRun()
|
||||
set waitfor = FALSE
|
||||
var/list/fail_reasons
|
||||
if(GLOB)
|
||||
if(GLOB.total_runtimes != 0)
|
||||
fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
|
||||
#ifdef UNIT_TESTS
|
||||
if(GLOB.failed_any_test)
|
||||
LAZYADD(fail_reasons, "Unit Tests failed!")
|
||||
#endif
|
||||
if(!GLOB.log_directory)
|
||||
LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
|
||||
else
|
||||
fail_reasons = list("Missing GLOB!")
|
||||
if(!fail_reasons)
|
||||
text2file("Success!", "[GLOB.log_directory]/clean_run.lk")
|
||||
else
|
||||
log_world("Test run failed!\n[fail_reasons.Join("\n")]")
|
||||
sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
|
||||
qdel(src) //shut it down
|
||||
|
||||
/world/Reboot(reason = 0, fast_track = FALSE)
|
||||
TgsReboot()
|
||||
if (reason || fast_track) //special reboot, do none of the normal stuff
|
||||
if (usr)
|
||||
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting World immediately due to host request</span>")
|
||||
else
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
FinishTestRun()
|
||||
return
|
||||
|
||||
if(TgsAvailable())
|
||||
var/do_hard_reboot
|
||||
// check the hard reboot counter
|
||||
var/ruhr = CONFIG_GET(number/rounds_until_hard_restart)
|
||||
switch(ruhr)
|
||||
if(-1)
|
||||
do_hard_reboot = FALSE
|
||||
if(0)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
if(GLOB.restart_counter >= ruhr)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
text2file("[++GLOB.restart_counter]", RESTART_COUNTER_PATH)
|
||||
do_hard_reboot = FALSE
|
||||
|
||||
if(do_hard_reboot)
|
||||
log_world("World hard rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // See comment below.
|
||||
TgsEndProcess()
|
||||
|
||||
log_world("World rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
|
||||
..()
|
||||
|
||||
/world/proc/update_status()
|
||||
|
||||
var/list/features = list()
|
||||
|
||||
/*if(GLOB.master_mode) CIT CHANGE - hides the gamemode from the hub entry, removes some useless info from the hub entry
|
||||
features += GLOB.master_mode
|
||||
|
||||
if (!GLOB.enter_allowed)
|
||||
features += "closed"*/
|
||||
|
||||
var/s = ""
|
||||
var/hostedby
|
||||
if(config)
|
||||
var/server_name = CONFIG_GET(string/servername)
|
||||
if (server_name)
|
||||
s += "<b>[server_name]</b> — "
|
||||
/*features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn" CIT CHANGE - removes some useless info from the hub entry
|
||||
if(CONFIG_GET(flag/allow_vote_mode))
|
||||
features += "vote"
|
||||
if(CONFIG_GET(flag/allow_ai))
|
||||
features += "AI allowed"*/
|
||||
hostedby = CONFIG_GET(string/hostedby)
|
||||
|
||||
s += "<b>[station_name()]</b>";
|
||||
s += " ("
|
||||
s += "<a href=\"https://citadel-station.net/home/\">" //Change this to wherever you want the hub to link to. CIT CHANGE - links to cit's website on the hub
|
||||
s += "Citadel" //Replace this with something else. Or ever better, delete it and uncomment the game version. CIT CHANGE - modifies the hub entry link
|
||||
s += "</a>"
|
||||
s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
|
||||
s += "<br>[CONFIG_GET(string/servertagline)]<br>" //CIT CHANGE - adds a tagline!
|
||||
|
||||
var/n = 0
|
||||
for (var/mob/M in GLOB.player_list)
|
||||
if (M.client)
|
||||
n++
|
||||
|
||||
if(SSmapping.config) // this just stops the runtime, honk.
|
||||
features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
|
||||
|
||||
if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
|
||||
features += "[get_security_level()] alert"
|
||||
|
||||
if (n > 1)
|
||||
features += "~[n] players"
|
||||
else if (n > 0)
|
||||
features += "~[n] player"
|
||||
|
||||
if (!host && hostedby)
|
||||
features += "hosted by <b>[hostedby]</b>"
|
||||
|
||||
if (features)
|
||||
s += "\[[jointext(features, ", ")]" //CIT CHANGE - replaces the colon here with a left bracket
|
||||
|
||||
status = s
|
||||
|
||||
/world/proc/update_hub_visibility(new_visibility)
|
||||
if(new_visibility == GLOB.hub_visibility)
|
||||
return
|
||||
GLOB.hub_visibility = new_visibility
|
||||
if(GLOB.hub_visibility)
|
||||
hub_password = "kMZy3U5jJHSiBQjr"
|
||||
else
|
||||
hub_password = "SORRYNOPASSWORD"
|
||||
|
||||
/world/proc/incrementMaxZ()
|
||||
maxz++
|
||||
SSmobs.MaxZChanged()
|
||||
SSidlenpcpool.MaxZChanged()
|
||||
|
||||
@@ -57,7 +57,7 @@ GLOBAL_LIST_INIT(disease_ability_singletons, list(
|
||||
var/short_desc = ""
|
||||
var/long_desc = ""
|
||||
var/stat_block = ""
|
||||
var/threshold_block = ""
|
||||
var/threshold_block = list()
|
||||
var/category = ""
|
||||
|
||||
var/list/symptoms
|
||||
@@ -76,7 +76,7 @@ GLOBAL_LIST_INIT(disease_ability_singletons, list(
|
||||
resistance += initial(S.resistance)
|
||||
stage_speed += initial(S.stage_speed)
|
||||
transmittable += initial(S.transmittable)
|
||||
threshold_block += "<br><br>[initial(S.threshold_desc)]"
|
||||
threshold_block += initial(S.threshold_desc)
|
||||
stat_block = "Resistance: [resistance]<br>Stealth: [stealth]<br>Stage Speed: [stage_speed]<br>Transmissibility: [transmittable]<br><br>"
|
||||
if(symptoms.len == 1) //lazy boy's dream
|
||||
name = initial(S.name)
|
||||
|
||||
@@ -318,7 +318,11 @@ the new instance inside the host to be updated to the template's stats.
|
||||
var/list/dat = list()
|
||||
|
||||
if(examining_ability)
|
||||
dat += "<a href='byond://?src=[REF(src)];main_menu=1'>Back</a><br><h1>[examining_ability.name]</h1>[examining_ability.stat_block][examining_ability.long_desc][examining_ability.threshold_block]"
|
||||
dat += "<a href='byond://?src=[REF(src)];main_menu=1'>Back</a><br>"
|
||||
dat += "<h1>[examining_ability.name]</h1>"
|
||||
dat += "[examining_ability.stat_block][examining_ability.long_desc][examining_ability.threshold_block]"
|
||||
for(var/entry in examining_ability.threshold_block)
|
||||
dat += "<b>[entry]</b>: [examining_ability.threshold_block[entry]]<br>"
|
||||
else
|
||||
dat += "<h1>Disease Statistics</h1><br>\
|
||||
Resistance: [DT.totalResistance()]<br>\
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
var/default_timer_set = 90
|
||||
var/minimum_timer_set = 90
|
||||
var/maximum_timer_set = 3600
|
||||
var/ui_style = "nanotrasen"
|
||||
ui_style = "nanotrasen"
|
||||
|
||||
var/numeric_input = ""
|
||||
var/ui_mode = NUKEUI_AWAIT_DISK
|
||||
var/timing = FALSE
|
||||
var/exploding = FALSE
|
||||
var/exploded = FALSE
|
||||
@@ -97,6 +98,8 @@
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
auth = I
|
||||
update_ui_mode()
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -233,113 +236,154 @@
|
||||
var/volume = (get_time_left() <= 20 ? 30 : 5)
|
||||
playsound(loc, 'sound/items/timer.ogg', volume, 0)
|
||||
|
||||
/obj/machinery/nuclearbomb/proc/update_ui_mode()
|
||||
if(exploded)
|
||||
ui_mode = NUKEUI_EXPLODED
|
||||
return
|
||||
|
||||
if(!auth)
|
||||
ui_mode = NUKEUI_AWAIT_DISK
|
||||
return
|
||||
|
||||
if(timing)
|
||||
ui_mode = NUKEUI_TIMING
|
||||
return
|
||||
|
||||
if(!safety)
|
||||
ui_mode = NUKEUI_AWAIT_ARM
|
||||
return
|
||||
|
||||
if(!yes_code)
|
||||
ui_mode = NUKEUI_AWAIT_CODE
|
||||
return
|
||||
|
||||
ui_mode = NUKEUI_AWAIT_TIMER
|
||||
|
||||
|
||||
/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state=GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "nuclear_bomb", name, 500, 600, master_ui, state)
|
||||
ui = new(user, src, ui_key, "nuclear_bomb", name, 350, 442, master_ui, state)
|
||||
ui.set_style(ui_style)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/nuclearbomb/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["disk_present"] = auth
|
||||
data["code_approved"] = yes_code
|
||||
var/first_status
|
||||
if(auth)
|
||||
if(yes_code)
|
||||
first_status = timing ? "Func/Set" : "Functional"
|
||||
else
|
||||
first_status = "Auth S2."
|
||||
var/hidden_code = (ui_mode == NUKEUI_AWAIT_CODE && numeric_input != "ERROR")
|
||||
var/current_code = ""
|
||||
if(hidden_code)
|
||||
while(length(current_code) < length(numeric_input))
|
||||
current_code = "[current_code]*"
|
||||
else
|
||||
if(timing)
|
||||
first_status = "Set"
|
||||
else
|
||||
first_status = "Auth S1."
|
||||
var/second_status = exploded ? "Warhead triggered, thanks for flying Nanotrasen" : (safety ? "Safe" : "Engaged")
|
||||
data["status1"] = first_status
|
||||
data["status2"] = second_status
|
||||
data["anchored"] = anchored
|
||||
data["safety"] = safety
|
||||
data["timing"] = timing
|
||||
data["time_left"] = get_time_left()
|
||||
|
||||
data["timer_set"] = timer_set
|
||||
data["timer_is_not_default"] = timer_set != default_timer_set
|
||||
data["timer_is_not_min"] = timer_set != minimum_timer_set
|
||||
data["timer_is_not_max"] = timer_set != maximum_timer_set
|
||||
|
||||
var/message = "AUTH"
|
||||
if(auth)
|
||||
message = "[numeric_input]"
|
||||
if(yes_code)
|
||||
message = "*****"
|
||||
data["message"] = message
|
||||
current_code = numeric_input
|
||||
while(length(current_code) < 5)
|
||||
current_code = "[current_code]-"
|
||||
var/first_status = null
|
||||
var/second_status = null
|
||||
switch(ui_mode)
|
||||
if(NUKEUI_AWAIT_DISK)
|
||||
first_status = "DEVICE LOCKED"
|
||||
if(timing)
|
||||
second_status = "TIME: [get_time_left()]"
|
||||
else
|
||||
second_status = "AWAIT DISK"
|
||||
if(NUKEUI_AWAIT_CODE)
|
||||
first_status = "INPUT CODE"
|
||||
second_status = "CODE: [current_code]"
|
||||
if(NUKEUI_AWAIT_TIMER)
|
||||
first_status = "INPUT TIME"
|
||||
second_status = "TIME: [current_code]"
|
||||
if(NUKEUI_AWAIT_ARM)
|
||||
first_status = "DEVICE READY"
|
||||
second_status = "TIME: [get_time_left()]"
|
||||
if(NUKEUI_TIMING)
|
||||
first_status = "DEVICE ARMED"
|
||||
second_status = "TIME: [get_time_left()]"
|
||||
if(NUKEUI_EXPLODED)
|
||||
first_status = "DEVICE DEPLOYED"
|
||||
second_status = "THANK YOU"
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/nuclearbomb/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
playsound(src, "terminal_type", 20, FALSE)
|
||||
switch(action)
|
||||
if("eject_disk")
|
||||
if(auth && auth.loc == src)
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
auth.forceMove(get_turf(src))
|
||||
auth = null
|
||||
. = TRUE
|
||||
if("insert_disk")
|
||||
if(!auth)
|
||||
else
|
||||
var/obj/item/I = usr.is_holding_item_of_type(/obj/item/disk/nuclear)
|
||||
if(I && disk_check(I) && usr.transferItemToLoc(I, src))
|
||||
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
auth = I
|
||||
. = TRUE
|
||||
update_ui_mode()
|
||||
if("keypad")
|
||||
if(auth)
|
||||
var/digit = params["digit"]
|
||||
switch(digit)
|
||||
if("R")
|
||||
if("C")
|
||||
if(auth && ui_mode == NUKEUI_AWAIT_ARM)
|
||||
set_safety()
|
||||
yes_code = FALSE
|
||||
playsound(src, 'sound/machines/nuke/confirm_beep.ogg', 50, FALSE)
|
||||
update_ui_mode()
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
numeric_input = ""
|
||||
yes_code = FALSE
|
||||
. = TRUE
|
||||
if("E")
|
||||
if(numeric_input == r_code)
|
||||
numeric_input = ""
|
||||
yes_code = TRUE
|
||||
. = TRUE
|
||||
else
|
||||
numeric_input = "ERROR"
|
||||
switch(ui_mode)
|
||||
if(NUKEUI_AWAIT_CODE)
|
||||
if(numeric_input == r_code)
|
||||
numeric_input = ""
|
||||
yes_code = TRUE
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
. = TRUE
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
numeric_input = "ERROR"
|
||||
if(NUKEUI_AWAIT_TIMER)
|
||||
var/number_value = text2num(numeric_input)
|
||||
if(number_value)
|
||||
timer_set = CLAMP(number_value, minimum_timer_set, maximum_timer_set)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
set_safety()
|
||||
. = TRUE
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
update_ui_mode()
|
||||
if("0","1","2","3","4","5","6","7","8","9")
|
||||
if(numeric_input != "ERROR")
|
||||
numeric_input += digit
|
||||
if(length(numeric_input) > 5)
|
||||
numeric_input = "ERROR"
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
. = TRUE
|
||||
if("timer")
|
||||
if(auth && yes_code)
|
||||
var/change = params["change"]
|
||||
if(change == "reset")
|
||||
timer_set = default_timer_set
|
||||
else if(change == "decrease")
|
||||
timer_set = max(minimum_timer_set, timer_set - 10)
|
||||
else if(change == "increase")
|
||||
timer_set = min(maximum_timer_set, timer_set + 10)
|
||||
else if(change == "input")
|
||||
var/user_input = input(usr, "Set time to detonation.", name) as null|num
|
||||
if(!user_input)
|
||||
return
|
||||
var/N = text2num(user_input)
|
||||
if(!N)
|
||||
return
|
||||
timer_set = CLAMP(N,minimum_timer_set,maximum_timer_set)
|
||||
. = TRUE
|
||||
if("safety")
|
||||
if(auth && yes_code && !exploded)
|
||||
set_safety()
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
if("arm")
|
||||
if(auth && yes_code && !safety && !exploded)
|
||||
playsound(src, 'sound/machines/nuke/confirm_beep.ogg', 50, FALSE)
|
||||
set_active()
|
||||
update_ui_mode()
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
if("anchor")
|
||||
if(auth && yes_code)
|
||||
playsound(src, 'sound/machines/nuke/general_beep.ogg', 50, FALSE)
|
||||
set_anchor()
|
||||
if("toggle_timer")
|
||||
if(auth && yes_code && !safety && !exploded)
|
||||
set_active()
|
||||
else
|
||||
playsound(src, 'sound/machines/nuke/angry_beep.ogg', 50, FALSE)
|
||||
|
||||
|
||||
/obj/machinery/nuclearbomb/proc/set_anchor()
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
job_description = "Swarmer"
|
||||
death = FALSE
|
||||
roundstart = FALSE
|
||||
short_desc = "You are a swarmer, a weapon of a long dead civilization."
|
||||
flavour_text = {"
|
||||
<b>You are a swarmer, a weapon of a long dead civilization. Until further orders from your original masters are received, you must continue to consume and replicate.</b>
|
||||
<b>Clicking on any object will try to consume it, either deconstructing it into its components, destroying it, or integrating any materials it has into you if successful.</b>
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "atmos_filter", name, 475, 195, master_ui, state)
|
||||
ui = new(user, src, ui_key, "atmos_filter", name, 475, 185, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/filter/ui_data()
|
||||
|
||||
@@ -1,156 +1,158 @@
|
||||
#define PUMP_OUT "out"
|
||||
#define PUMP_IN "in"
|
||||
#define PUMP_MAX_PRESSURE (ONE_ATMOSPHERE * 25)
|
||||
#define PUMP_MIN_PRESSURE (ONE_ATMOSPHERE / 10)
|
||||
#define PUMP_DEFAULT_PRESSURE (ONE_ATMOSPHERE)
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump
|
||||
name = "portable air pump"
|
||||
icon_state = "psiphon:0"
|
||||
density = TRUE
|
||||
|
||||
var/on = FALSE
|
||||
var/direction = PUMP_OUT
|
||||
var/obj/machinery/atmospherics/components/binary/pump/pump
|
||||
|
||||
volume = 1000
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/Initialize()
|
||||
. = ..()
|
||||
pump = new(src, FALSE)
|
||||
pump.on = TRUE
|
||||
pump.stat = 0
|
||||
pump.build_network()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(air_contents)
|
||||
air_update_turf()
|
||||
QDEL_NULL(pump)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/update_icon()
|
||||
icon_state = "psiphon:[on]"
|
||||
|
||||
cut_overlays()
|
||||
if(holding)
|
||||
add_overlay("siphon-open")
|
||||
if(connected_port)
|
||||
add_overlay("siphon-connector")
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/process_atmos()
|
||||
..()
|
||||
if(!on)
|
||||
pump.airs[1] = null
|
||||
pump.airs[2] = null
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(direction == PUMP_OUT) // Hook up the internal pump.
|
||||
pump.airs[1] = holding ? holding.air_contents : air_contents
|
||||
pump.airs[2] = holding ? air_contents : T.return_air()
|
||||
else
|
||||
pump.airs[1] = holding ? air_contents : T.return_air()
|
||||
pump.airs[2] = holding ? holding.air_contents : air_contents
|
||||
|
||||
pump.process_atmos() // Pump gas.
|
||||
if(!holding)
|
||||
air_update_turf() // Update the environment if needed.
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(is_operational())
|
||||
if(prob(50 / severity))
|
||||
on = !on
|
||||
if(prob(100 / severity))
|
||||
direction = PUMP_OUT
|
||||
pump.target_pressure = rand(0, 100 * ONE_ATMOSPHERE)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/replace_tank(mob/living/user, close_valve)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(close_valve)
|
||||
if(on)
|
||||
on = FALSE
|
||||
update_icon()
|
||||
else if(on && holding && direction == PUMP_OUT)
|
||||
investigate_log("[key_name(user)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "portable_pump", name, 420, 415, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = on
|
||||
data["direction"] = direction
|
||||
data["connected"] = connected_port ? 1 : 0
|
||||
data["pressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
|
||||
data["target_pressure"] = round(pump.target_pressure ? pump.target_pressure : 0)
|
||||
data["default_pressure"] = round(PUMP_DEFAULT_PRESSURE)
|
||||
data["min_pressure"] = round(PUMP_MIN_PRESSURE)
|
||||
data["max_pressure"] = round(PUMP_MAX_PRESSURE)
|
||||
|
||||
if(holding)
|
||||
data["holding"] = list()
|
||||
data["holding"]["name"] = holding.name
|
||||
data["holding"]["pressure"] = round(holding.air_contents.return_pressure())
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
on = !on
|
||||
if(on && !holding)
|
||||
var/plasma = air_contents.gases[/datum/gas/plasma]
|
||||
var/n2o = air_contents.gases[/datum/gas/nitrous_oxide]
|
||||
if(n2o || plasma)
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [ADMIN_VERBOSEJMP(src)]")
|
||||
log_admin("[key_name(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [AREACOORD(src)]")
|
||||
else if(on && direction == PUMP_OUT)
|
||||
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
. = TRUE
|
||||
if("direction")
|
||||
if(direction == PUMP_OUT)
|
||||
direction = PUMP_IN
|
||||
else
|
||||
if(on && holding)
|
||||
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
direction = PUMP_OUT
|
||||
. = TRUE
|
||||
if("pressure")
|
||||
var/pressure = params["pressure"]
|
||||
if(pressure == "reset")
|
||||
pressure = PUMP_DEFAULT_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "min")
|
||||
pressure = PUMP_MIN_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "max")
|
||||
pressure = PUMP_MAX_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "input")
|
||||
pressure = input("New release pressure ([PUMP_MIN_PRESSURE]-[PUMP_MAX_PRESSURE] kPa):", name, pump.target_pressure) as num|null
|
||||
if(!isnull(pressure) && !..())
|
||||
. = TRUE
|
||||
else if(text2num(pressure) != null)
|
||||
pressure = text2num(pressure)
|
||||
. = TRUE
|
||||
if(.)
|
||||
pump.target_pressure = CLAMP(round(pressure), PUMP_MIN_PRESSURE, PUMP_MAX_PRESSURE)
|
||||
investigate_log("was set to [pump.target_pressure] kPa by [key_name(usr)].", INVESTIGATE_ATMOS)
|
||||
if("eject")
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
holding = null
|
||||
. = TRUE
|
||||
update_icon()
|
||||
#define PUMP_OUT "out"
|
||||
#define PUMP_IN "in"
|
||||
#define PUMP_MAX_PRESSURE (ONE_ATMOSPHERE * 25)
|
||||
#define PUMP_MIN_PRESSURE (ONE_ATMOSPHERE / 10)
|
||||
#define PUMP_DEFAULT_PRESSURE (ONE_ATMOSPHERE)
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump
|
||||
name = "portable air pump"
|
||||
icon_state = "psiphon:0"
|
||||
density = TRUE
|
||||
|
||||
var/on = FALSE
|
||||
var/direction = PUMP_OUT
|
||||
var/obj/machinery/atmospherics/components/binary/pump/pump
|
||||
|
||||
volume = 1000
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/Initialize()
|
||||
. = ..()
|
||||
pump = new(src, FALSE)
|
||||
pump.on = TRUE
|
||||
pump.stat = 0
|
||||
pump.build_network()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(air_contents)
|
||||
air_update_turf()
|
||||
QDEL_NULL(pump)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/update_icon()
|
||||
icon_state = "psiphon:[on]"
|
||||
|
||||
cut_overlays()
|
||||
if(holding)
|
||||
add_overlay("siphon-open")
|
||||
if(connected_port)
|
||||
add_overlay("siphon-connector")
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/process_atmos()
|
||||
..()
|
||||
if(!on)
|
||||
pump.airs[1] = null
|
||||
pump.airs[2] = null
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(direction == PUMP_OUT) // Hook up the internal pump.
|
||||
pump.airs[1] = holding ? holding.air_contents : air_contents
|
||||
pump.airs[2] = holding ? air_contents : T.return_air()
|
||||
else
|
||||
pump.airs[1] = holding ? air_contents : T.return_air()
|
||||
pump.airs[2] = holding ? holding.air_contents : air_contents
|
||||
|
||||
pump.process_atmos() // Pump gas.
|
||||
if(!holding)
|
||||
air_update_turf() // Update the environment if needed.
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(is_operational())
|
||||
if(prob(50 / severity))
|
||||
on = !on
|
||||
if(prob(100 / severity))
|
||||
direction = PUMP_OUT
|
||||
pump.target_pressure = rand(0, 100 * ONE_ATMOSPHERE)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/replace_tank(mob/living/user, close_valve)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(close_valve)
|
||||
if(on)
|
||||
on = FALSE
|
||||
update_icon()
|
||||
else if(on && holding && direction == PUMP_OUT)
|
||||
investigate_log("[key_name(user)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "portable_pump", name, 300, 315, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = on
|
||||
data["direction"] = direction == PUMP_IN ? TRUE : FALSE
|
||||
data["connected"] = connected_port ? TRUE : FALSE
|
||||
data["pressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
|
||||
data["target_pressure"] = round(pump.target_pressure ? pump.target_pressure : 0)
|
||||
data["default_pressure"] = round(PUMP_DEFAULT_PRESSURE)
|
||||
data["min_pressure"] = round(PUMP_MIN_PRESSURE)
|
||||
data["max_pressure"] = round(PUMP_MAX_PRESSURE)
|
||||
|
||||
if(holding)
|
||||
data["holding"] = list()
|
||||
data["holding"]["name"] = holding.name
|
||||
data["holding"]["pressure"] = round(holding.air_contents.return_pressure())
|
||||
else
|
||||
data["holding"] = null
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
on = !on
|
||||
if(on && !holding)
|
||||
var/plasma = air_contents.gases[/datum/gas/plasma]
|
||||
var/n2o = air_contents.gases[/datum/gas/nitrous_oxide]
|
||||
if(n2o || plasma)
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [ADMIN_VERBOSEJMP(src)]")
|
||||
log_admin("[key_name(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [AREACOORD(src)]")
|
||||
else if(on && direction == PUMP_OUT)
|
||||
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
. = TRUE
|
||||
if("direction")
|
||||
if(direction == PUMP_OUT)
|
||||
direction = PUMP_IN
|
||||
else
|
||||
if(on && holding)
|
||||
investigate_log("[key_name(usr)] started a transfer into [holding].<br>", INVESTIGATE_ATMOS)
|
||||
direction = PUMP_OUT
|
||||
. = TRUE
|
||||
if("pressure")
|
||||
var/pressure = params["pressure"]
|
||||
if(pressure == "reset")
|
||||
pressure = PUMP_DEFAULT_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "min")
|
||||
pressure = PUMP_MIN_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "max")
|
||||
pressure = PUMP_MAX_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "input")
|
||||
pressure = input("New release pressure ([PUMP_MIN_PRESSURE]-[PUMP_MAX_PRESSURE] kPa):", name, pump.target_pressure) as num|null
|
||||
if(!isnull(pressure) && !..())
|
||||
. = TRUE
|
||||
else if(text2num(pressure) != null)
|
||||
pressure = text2num(pressure)
|
||||
. = TRUE
|
||||
if(.)
|
||||
pump.target_pressure = CLAMP(round(pressure), PUMP_MIN_PRESSURE, PUMP_MAX_PRESSURE)
|
||||
investigate_log("was set to [pump.target_pressure] kPa by [key_name(usr)].", INVESTIGATE_ATMOS)
|
||||
if("eject")
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
holding = null
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
@@ -1,144 +1,146 @@
|
||||
/obj/machinery/portable_atmospherics/scrubber
|
||||
name = "portable air scrubber"
|
||||
icon_state = "pscrubber:0"
|
||||
density = TRUE
|
||||
|
||||
var/on = FALSE
|
||||
var/volume_rate = 1000
|
||||
volume = 1000
|
||||
|
||||
var/list/scrubbing = list(/datum/gas/plasma, /datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/bz, /datum/gas/nitryl, /datum/gas/tritium, /datum/gas/hypernoblium, /datum/gas/water_vapor)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(air_contents)
|
||||
air_update_turf()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/update_icon()
|
||||
icon_state = "pscrubber:[on]"
|
||||
|
||||
cut_overlays()
|
||||
if(holding)
|
||||
add_overlay("scrubber-open")
|
||||
if(connected_port)
|
||||
add_overlay("scrubber-connector")
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/process_atmos()
|
||||
..()
|
||||
if(!on)
|
||||
return
|
||||
|
||||
if(holding)
|
||||
scrub(holding.air_contents)
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
scrub(T.return_air())
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/proc/scrub(var/datum/gas_mixture/mixture)
|
||||
var/transfer_moles = min(1, volume_rate / mixture.volume) * mixture.total_moles()
|
||||
|
||||
var/datum/gas_mixture/filtering = mixture.remove(transfer_moles) // Remove part of the mixture to filter.
|
||||
var/datum/gas_mixture/filtered = new
|
||||
if(!filtering)
|
||||
return
|
||||
|
||||
filtered.temperature = filtering.temperature
|
||||
for(var/gas in filtering.gases & scrubbing)
|
||||
filtered.gases[gas] = filtering.gases[gas] // Shuffle the "bad" gasses to the filtered mixture.
|
||||
filtering.gases[gas] = 0
|
||||
GAS_GARBAGE_COLLECT(filtering.gases)
|
||||
|
||||
air_contents.merge(filtered) // Store filtered out gasses.
|
||||
mixture.merge(filtering) // Returned the cleaned gas.
|
||||
if(!holding)
|
||||
air_update_turf()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(is_operational())
|
||||
if(prob(50 / severity))
|
||||
on = !on
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "portable_scrubber", name, 420, 435, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = on
|
||||
data["connected"] = connected_port ? 1 : 0
|
||||
data["pressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
|
||||
|
||||
data["id_tag"] = -1 //must be defined in order to reuse code between portable and vent scrubbers
|
||||
data["filter_types"] = list()
|
||||
for(var/path in GLOB.meta_gas_ids)
|
||||
data["filter_types"] += list(list("gas_id" = GLOB.meta_gas_ids[path], "gas_name" = GLOB.meta_gas_names[path], "enabled" = (path in scrubbing)))
|
||||
|
||||
if(holding)
|
||||
data["holding"] = list()
|
||||
data["holding"]["name"] = holding.name
|
||||
data["holding"]["pressure"] = round(holding.air_contents.return_pressure())
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
on = !on
|
||||
. = TRUE
|
||||
if("eject")
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
holding = null
|
||||
. = TRUE
|
||||
if("toggle_filter")
|
||||
scrubbing ^= gas_id2path(params["val"])
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge
|
||||
name = "huge air scrubber"
|
||||
icon_state = "scrubber:0"
|
||||
anchored = TRUE
|
||||
active_power_usage = 500
|
||||
idle_power_usage = 10
|
||||
|
||||
volume_rate = 1500
|
||||
volume = 50000
|
||||
|
||||
var/movable = FALSE
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/movable
|
||||
movable = TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon()
|
||||
icon_state = "scrubber:[on]"
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/process_atmos()
|
||||
if((!anchored && !movable) || !is_operational())
|
||||
on = FALSE
|
||||
update_icon()
|
||||
use_power = on ? ACTIVE_POWER_USE : IDLE_POWER_USE
|
||||
if(!on)
|
||||
return
|
||||
|
||||
..()
|
||||
if(!holding)
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/turf/AT in T.GetAtmosAdjacentTurfs(alldir = TRUE))
|
||||
scrub(AT.return_air())
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/attackby(obj/item/W, mob/user)
|
||||
if(default_unfasten_wrench(user, W))
|
||||
if(!movable)
|
||||
on = FALSE
|
||||
else
|
||||
return ..()
|
||||
/obj/machinery/portable_atmospherics/scrubber
|
||||
name = "portable air scrubber"
|
||||
icon_state = "pscrubber:0"
|
||||
density = TRUE
|
||||
|
||||
var/on = FALSE
|
||||
var/volume_rate = 1000
|
||||
volume = 1000
|
||||
|
||||
var/list/scrubbing = list(/datum/gas/plasma, /datum/gas/carbon_dioxide, /datum/gas/nitrous_oxide, /datum/gas/bz, /datum/gas/nitryl, /datum/gas/tritium, /datum/gas/hypernoblium, /datum/gas/water_vapor)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
T.assume_air(air_contents)
|
||||
air_update_turf()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/update_icon()
|
||||
icon_state = "pscrubber:[on]"
|
||||
|
||||
cut_overlays()
|
||||
if(holding)
|
||||
add_overlay("scrubber-open")
|
||||
if(connected_port)
|
||||
add_overlay("scrubber-connector")
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/process_atmos()
|
||||
..()
|
||||
if(!on)
|
||||
return
|
||||
|
||||
if(holding)
|
||||
scrub(holding.air_contents)
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
scrub(T.return_air())
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/proc/scrub(var/datum/gas_mixture/mixture)
|
||||
var/transfer_moles = min(1, volume_rate / mixture.volume) * mixture.total_moles()
|
||||
|
||||
var/datum/gas_mixture/filtering = mixture.remove(transfer_moles) // Remove part of the mixture to filter.
|
||||
var/datum/gas_mixture/filtered = new
|
||||
if(!filtering)
|
||||
return
|
||||
|
||||
filtered.temperature = filtering.temperature
|
||||
for(var/gas in filtering.gases & scrubbing)
|
||||
filtered.gases[gas] = filtering.gases[gas] // Shuffle the "bad" gasses to the filtered mixture.
|
||||
filtering.gases[gas] = 0
|
||||
GAS_GARBAGE_COLLECT(filtering.gases)
|
||||
|
||||
air_contents.merge(filtered) // Store filtered out gasses.
|
||||
mixture.merge(filtering) // Returned the cleaned gas.
|
||||
if(!holding)
|
||||
air_update_turf()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(is_operational())
|
||||
if(prob(50 / severity))
|
||||
on = !on
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "portable_scrubber", name, 320, 335, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = on
|
||||
data["connected"] = connected_port ? 1 : 0
|
||||
data["pressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
|
||||
|
||||
data["id_tag"] = -1 //must be defined in order to reuse code between portable and vent scrubbers
|
||||
data["filter_types"] = list()
|
||||
for(var/path in GLOB.meta_gas_ids)
|
||||
data["filter_types"] += list(list("gas_id" = GLOB.meta_gas_ids[path], "gas_name" = GLOB.meta_gas_names[path], "enabled" = (path in scrubbing)))
|
||||
|
||||
if(holding)
|
||||
data["holding"] = list()
|
||||
data["holding"]["name"] = holding.name
|
||||
data["holding"]["pressure"] = round(holding.air_contents.return_pressure())
|
||||
else
|
||||
data["holding"] = null
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power")
|
||||
on = !on
|
||||
. = TRUE
|
||||
if("eject")
|
||||
if(holding)
|
||||
holding.forceMove(drop_location())
|
||||
holding = null
|
||||
. = TRUE
|
||||
if("toggle_filter")
|
||||
scrubbing ^= gas_id2path(params["val"])
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge
|
||||
name = "huge air scrubber"
|
||||
icon_state = "scrubber:0"
|
||||
anchored = TRUE
|
||||
active_power_usage = 500
|
||||
idle_power_usage = 10
|
||||
|
||||
volume_rate = 1500
|
||||
volume = 50000
|
||||
|
||||
var/movable = FALSE
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/movable
|
||||
movable = TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon()
|
||||
icon_state = "scrubber:[on]"
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/process_atmos()
|
||||
if((!anchored && !movable) || !is_operational())
|
||||
on = FALSE
|
||||
update_icon()
|
||||
use_power = on ? ACTIVE_POWER_USE : IDLE_POWER_USE
|
||||
if(!on)
|
||||
return
|
||||
|
||||
..()
|
||||
if(!holding)
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/turf/AT in T.GetAtmosAdjacentTurfs(alldir = TRUE))
|
||||
scrub(AT.return_air())
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/attackby(obj/item/W, mob/user)
|
||||
if(default_unfasten_wrench(user, W))
|
||||
if(!movable)
|
||||
on = FALSE
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
var/death = TRUE //Kill the mob
|
||||
var/roundstart = TRUE //fires on initialize
|
||||
var/instant = FALSE //fires on New
|
||||
var/flavour_text = "The mapper forgot to set this!"
|
||||
var/short_desc = "The mapper forgot to set this!"
|
||||
var/flavour_text = ""
|
||||
var/important_info = ""
|
||||
var/faction = null
|
||||
var/permanent = FALSE //If true, the spawner will not disappear upon running out of uses.
|
||||
var/random = FALSE //Don't set a name or gender, just go random
|
||||
@@ -110,7 +112,12 @@
|
||||
if(ckey)
|
||||
M.ckey = ckey
|
||||
if(show_flavour)
|
||||
to_chat(M, "[flavour_text]")
|
||||
var/output_message = "<span class='big bold'>[short_desc]</span>"
|
||||
if(flavour_text != "")
|
||||
output_message += "\n<span class='bold'>[flavour_text]</span>"
|
||||
if(important_info != "")
|
||||
output_message += "\n<span class='userdanger'>[important_info]</span>"
|
||||
to_chat(M, output_message)
|
||||
var/datum/mind/MM = M.mind
|
||||
var/datum/antagonist/A
|
||||
if(antagonist_type)
|
||||
@@ -340,7 +347,7 @@
|
||||
name = "sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
flavour_text = "<span class='big bold'>You are a space doctor!</span>"
|
||||
short_desc = "You are a space doctor!"
|
||||
assignedrole = "Space Doctor"
|
||||
job_description = "Off-station Doctor"
|
||||
|
||||
@@ -397,7 +404,8 @@
|
||||
name = "bartender sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
flavour_text = "<span class='big bold'>You are a space bartender!</span><b> Time to mix drinks and change lives. Smoking space drugs makes it easier to understand your patrons' odd dialect.</b>"
|
||||
short_desc = "You are a space bartender!"
|
||||
flavour_text = "Time to mix drinks and change lives. Smoking space drugs makes it easier to understand your patrons' odd dialect."
|
||||
assignedrole = "Space Bartender"
|
||||
id_job = "Bartender"
|
||||
|
||||
@@ -422,7 +430,8 @@
|
||||
name = "beach bum sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
flavour_text = "<span class='big bold'>You're, like, totally a dudebro, bruh.</span><b> Ch'yea. You came here, like, on spring break, hopin' to pick up some bangin' hot chicks, y'knaw?</b>"
|
||||
short_desc = "You're a spunky lifeguard!"
|
||||
flavour_text = "It's up to you to make sure nobody drowns or gets eaten by sharks and stuff."
|
||||
assignedrole = "Beach Bum"
|
||||
|
||||
/obj/effect/mob_spawn/human/beach/alive/lifeguard
|
||||
@@ -511,7 +520,7 @@
|
||||
name = "sleeper"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
flavour_text = "<span class='big bold'>You are a Nanotrasen Commander!</span>"
|
||||
short_desc = "You are a Nanotrasen Commander!"
|
||||
|
||||
/obj/effect/mob_spawn/human/nanotrasensoldier/alive
|
||||
death = FALSE
|
||||
@@ -522,7 +531,7 @@
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper"
|
||||
faction = "nanotrasenprivate"
|
||||
flavour_text = "<span class='big bold'>You are a Nanotrasen Private Security Officer!</span>"
|
||||
short_desc = "You are a Nanotrasen Private Security Officer!"
|
||||
|
||||
|
||||
/////////////////Spooky Undead//////////////////////
|
||||
@@ -539,7 +548,8 @@
|
||||
job_description = "Skeleton"
|
||||
icon = 'icons/effects/blood.dmi'
|
||||
icon_state = "remains"
|
||||
flavour_text = "<span class='big bold'>By unknown powers, your skeletal remains have been reanimated!</span><b> Walk this mortal plain and terrorize all living adventurers who dare cross your path.</b>"
|
||||
short_desc = "By unknown powers, your skeletal remains have been reanimated!"
|
||||
flavour_text = "Walk this mortal plain and terrorize all living adventurers who dare cross your path."
|
||||
assignedrole = "Skeleton"
|
||||
|
||||
/obj/effect/mob_spawn/human/zombie
|
||||
@@ -554,7 +564,9 @@
|
||||
job_description = "Zombie"
|
||||
icon = 'icons/effects/blood.dmi'
|
||||
icon_state = "remains"
|
||||
flavour_text = "<span class='big bold'>By unknown powers, your rotting remains have been resurrected!</span><b> Walk this mortal plain and terrorize all living adventurers who dare cross your path.</b>"
|
||||
short_desc = "By unknown powers, your rotting remains have been resurrected!"
|
||||
flavour_text = "Walk this mortal plain and terrorize all living adventurers who dare cross your path."
|
||||
|
||||
|
||||
|
||||
/obj/effect/mob_spawn/human/abductor
|
||||
|
||||
@@ -595,8 +595,9 @@
|
||||
job_description = "Syndicate Snow Operative"
|
||||
faction = ROLE_SYNDICATE
|
||||
outfit = /datum/outfit/snowsyndie
|
||||
flavour_text = "<span class='big bold'>You are a syndicate operative recently awoken from cryostasis in an underground outpost. Monitor Nanotrasen communications and record information. All intruders should be \
|
||||
disposed of swiftly to assure no gathered information is stolen or lost. Try not to wander too far from the outpost as the caves can be a deadly place even for a trained operative such as yourself.</span>"
|
||||
short_desc = "You are a syndicate operative recently awoken from cryostasis in an underground outpost."
|
||||
flavour_text = "You are a syndicate operative recently awoken from cryostasis in an underground outpost. Monitor Nanotrasen communications and record information. All intruders should be \
|
||||
disposed of swiftly to assure no gathered information is stolen or lost. Try not to wander too far from the outpost as the caves can be a deadly place even for a trained operative such as yourself."
|
||||
|
||||
/datum/outfit/snowsyndie
|
||||
name = "Syndicate Snow Operative"
|
||||
|
||||
+226
-228
@@ -1,228 +1,226 @@
|
||||
/obj/machinery/computer/cargo
|
||||
name = "supply console"
|
||||
desc = "Used to order supplies, approve requests, and control the shuttle."
|
||||
icon_screen = "supply"
|
||||
circuit = /obj/item/circuitboard/computer/cargo
|
||||
req_access = list(ACCESS_CARGO)
|
||||
var/requestonly = FALSE
|
||||
var/contraband = FALSE
|
||||
var/safety_warning = "For safety reasons, the automated supply shuttle \
|
||||
cannot transport live organisms, human remains, classified nuclear weaponry \
|
||||
or homing beacons."
|
||||
var/blockade_warning = "Bluespace instability detected. Shuttle movement impossible."
|
||||
|
||||
light_color = "#E2853D"//orange
|
||||
|
||||
/obj/machinery/computer/cargo/request
|
||||
name = "supply request console"
|
||||
desc = "Used to request supplies from cargo."
|
||||
icon_screen = "request"
|
||||
circuit = /obj/item/circuitboard/computer/cargo/request
|
||||
req_access = list()
|
||||
requestonly = TRUE
|
||||
|
||||
/obj/machinery/computer/cargo/Initialize()
|
||||
. = ..()
|
||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||
contraband = board.contraband
|
||||
if (board.obj_flags & EMAGGED)
|
||||
obj_flags |= EMAGGED
|
||||
else
|
||||
obj_flags &= ~EMAGGED
|
||||
|
||||
/obj/machinery/computer/cargo/proc/get_export_categories()
|
||||
. = EXPORT_CARGO
|
||||
if(contraband)
|
||||
. |= EXPORT_CONTRABAND
|
||||
if(obj_flags & EMAGGED)
|
||||
. |= EXPORT_EMAG
|
||||
|
||||
/obj/machinery/computer/cargo/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
|
||||
"<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
|
||||
|
||||
obj_flags |= EMAGGED
|
||||
contraband = TRUE
|
||||
|
||||
// This also permamently sets this on the circuit board
|
||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||
board.contraband = TRUE
|
||||
board.obj_flags |= EMAGGED
|
||||
req_access = list()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/cargo/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cargo", name, 1000, 800, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/cargo/ui_data()
|
||||
var/list/data = list()
|
||||
data["requestonly"] = requestonly
|
||||
data["location"] = SSshuttle.supply.getStatusText()
|
||||
data["points"] = SSshuttle.points
|
||||
data["away"] = SSshuttle.supply.getDockedId() == "supply_away"
|
||||
data["docked"] = SSshuttle.supply.mode == SHUTTLE_IDLE
|
||||
data["loan"] = !!SSshuttle.shuttle_loan
|
||||
data["loan_dispatched"] = SSshuttle.shuttle_loan && SSshuttle.shuttle_loan.dispatched
|
||||
var/message = "Remember to stamp and send back the supply manifests."
|
||||
if(SSshuttle.centcom_message)
|
||||
message = SSshuttle.centcom_message
|
||||
if(SSshuttle.supplyBlocked)
|
||||
message = blockade_warning
|
||||
data["message"] = message
|
||||
data["supplies"] = list()
|
||||
for(var/pack in SSshuttle.supply_packs)
|
||||
var/datum/supply_pack/P = SSshuttle.supply_packs[pack]
|
||||
if(!data["supplies"][P.group])
|
||||
data["supplies"][P.group] = list(
|
||||
"name" = P.group,
|
||||
"packs" = list()
|
||||
)
|
||||
if((P.hidden && !(obj_flags & EMAGGED)) || (P.contraband && !contraband) || (P.special && !P.special_enabled) || P.DropPodOnly)
|
||||
continue
|
||||
data["supplies"][P.group]["packs"] += list(list(
|
||||
"name" = P.name,
|
||||
"cost" = P.cost,
|
||||
"id" = pack,
|
||||
"desc" = P.desc || P.name // If there is a description, use it. Otherwise use the pack's name.
|
||||
))
|
||||
|
||||
data["cart"] = list()
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
data["cart"] += list(list(
|
||||
"object" = SO.pack.name,
|
||||
"cost" = SO.pack.cost,
|
||||
"id" = SO.id
|
||||
))
|
||||
|
||||
data["requests"] = list()
|
||||
for(var/datum/supply_order/SO in SSshuttle.requestlist)
|
||||
data["requests"] += list(list(
|
||||
"object" = SO.pack.name,
|
||||
"cost" = SO.pack.cost,
|
||||
"orderer" = SO.orderer,
|
||||
"reason" = SO.reason,
|
||||
"id" = SO.id
|
||||
))
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/cargo/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, "<span class='notice'>Access denied.</span>")
|
||||
return
|
||||
if(action != "add" && requestonly)
|
||||
return
|
||||
switch(action)
|
||||
if("send")
|
||||
if(!SSshuttle.supply.canMove())
|
||||
say(safety_warning)
|
||||
return
|
||||
if(SSshuttle.supplyBlocked)
|
||||
say(blockade_warning)
|
||||
return
|
||||
if(SSshuttle.supply.getDockedId() == "supply_home")
|
||||
SSshuttle.supply.export_categories = get_export_categories()
|
||||
SSshuttle.moveShuttle("supply", "supply_away", TRUE)
|
||||
say("The supply shuttle is departing.")
|
||||
investigate_log("[key_name(usr)] sent the supply shuttle away.", INVESTIGATE_CARGO)
|
||||
else
|
||||
investigate_log("[key_name(usr)] called the supply shuttle.", INVESTIGATE_CARGO)
|
||||
say("The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.")
|
||||
SSshuttle.moveShuttle("supply", "supply_home", TRUE)
|
||||
. = TRUE
|
||||
if("loan")
|
||||
if(!SSshuttle.shuttle_loan)
|
||||
return
|
||||
if(SSshuttle.supplyBlocked)
|
||||
say(blockade_warning)
|
||||
return
|
||||
else if(SSshuttle.supply.mode != SHUTTLE_IDLE)
|
||||
return
|
||||
else if(SSshuttle.supply.getDockedId() != "supply_away")
|
||||
return
|
||||
else
|
||||
SSshuttle.shuttle_loan.loan_shuttle()
|
||||
say("The supply shuttle has been loaned to CentCom.")
|
||||
. = TRUE
|
||||
if("add")
|
||||
var/id = text2path(params["id"])
|
||||
var/datum/supply_pack/pack = SSshuttle.supply_packs[id]
|
||||
if(!istype(pack))
|
||||
return
|
||||
if((pack.hidden && !(obj_flags & EMAGGED)) || (pack.contraband && !contraband) || pack.DropPodOnly)
|
||||
return
|
||||
|
||||
var/name = "*None Provided*"
|
||||
var/rank = "*None Provided*"
|
||||
var/ckey = usr.ckey
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
name = H.get_authentification_name()
|
||||
rank = H.get_assignment(hand_first = TRUE)
|
||||
else if(issilicon(usr))
|
||||
name = usr.real_name
|
||||
rank = "Silicon"
|
||||
|
||||
var/reason = ""
|
||||
if(requestonly)
|
||||
reason = stripped_input("Reason:", name, "")
|
||||
if(isnull(reason) || ..())
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason)
|
||||
SO.generateRequisition(T)
|
||||
if(requestonly)
|
||||
SSshuttle.requestlist += SO
|
||||
else
|
||||
SSshuttle.shoppinglist += SO
|
||||
. = TRUE
|
||||
if("remove")
|
||||
var/id = text2num(params["id"])
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
if(SO.id == id)
|
||||
SSshuttle.shoppinglist -= SO
|
||||
. = TRUE
|
||||
break
|
||||
if("clear")
|
||||
SSshuttle.shoppinglist.Cut()
|
||||
. = TRUE
|
||||
if("approve")
|
||||
var/id = text2num(params["id"])
|
||||
for(var/datum/supply_order/SO in SSshuttle.requestlist)
|
||||
if(SO.id == id)
|
||||
SSshuttle.requestlist -= SO
|
||||
SSshuttle.shoppinglist += SO
|
||||
. = TRUE
|
||||
break
|
||||
if("deny")
|
||||
var/id = text2num(params["id"])
|
||||
for(var/datum/supply_order/SO in SSshuttle.requestlist)
|
||||
if(SO.id == id)
|
||||
SSshuttle.requestlist -= SO
|
||||
. = TRUE
|
||||
break
|
||||
if("denyall")
|
||||
SSshuttle.requestlist.Cut()
|
||||
. = TRUE
|
||||
if(.)
|
||||
post_signal("supply")
|
||||
|
||||
/obj/machinery/computer/cargo/proc/post_signal(command)
|
||||
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)
|
||||
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/status_signal = new(list("command" = command))
|
||||
frequency.post_signal(src, status_signal)
|
||||
/obj/machinery/computer/cargo
|
||||
name = "supply console"
|
||||
desc = "Used to order supplies, approve requests, and control the shuttle."
|
||||
icon_screen = "supply"
|
||||
circuit = /obj/item/circuitboard/computer/cargo
|
||||
req_access = list(ACCESS_CARGO)
|
||||
var/requestonly = FALSE
|
||||
var/contraband = FALSE
|
||||
var/safety_warning = "For safety reasons, the automated supply shuttle \
|
||||
cannot transport live organisms, human remains, classified nuclear weaponry \
|
||||
or homing beacons."
|
||||
var/blockade_warning = "Bluespace instability detected. Shuttle movement impossible."
|
||||
|
||||
light_color = "#E2853D"//orange
|
||||
|
||||
/obj/machinery/computer/cargo/request
|
||||
name = "supply request console"
|
||||
desc = "Used to request supplies from cargo."
|
||||
icon_screen = "request"
|
||||
circuit = /obj/item/circuitboard/computer/cargo/request
|
||||
req_access = list()
|
||||
requestonly = TRUE
|
||||
|
||||
/obj/machinery/computer/cargo/Initialize()
|
||||
. = ..()
|
||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||
contraband = board.contraband
|
||||
if (board.obj_flags & EMAGGED)
|
||||
obj_flags |= EMAGGED
|
||||
else
|
||||
obj_flags &= ~EMAGGED
|
||||
|
||||
/obj/machinery/computer/cargo/proc/get_export_categories()
|
||||
. = EXPORT_CARGO
|
||||
if(contraband)
|
||||
. |= EXPORT_CONTRABAND
|
||||
if(obj_flags & EMAGGED)
|
||||
. |= EXPORT_EMAG
|
||||
|
||||
/obj/machinery/computer/cargo/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
|
||||
"<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
|
||||
|
||||
obj_flags |= EMAGGED
|
||||
contraband = TRUE
|
||||
|
||||
// This also permamently sets this on the circuit board
|
||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||
board.contraband = TRUE
|
||||
board.obj_flags |= EMAGGED
|
||||
req_access = list()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/cargo/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cargo", name, 780, 750, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/cargo/ui_data()
|
||||
var/list/data = list()
|
||||
data["requestonly"] = requestonly
|
||||
data["location"] = SSshuttle.supply.getStatusText()
|
||||
data["points"] = SSshuttle.points
|
||||
data["away"] = SSshuttle.supply.getDockedId() == "supply_away"
|
||||
data["docked"] = SSshuttle.supply.mode == SHUTTLE_IDLE
|
||||
data["loan"] = !!SSshuttle.shuttle_loan
|
||||
data["loan_dispatched"] = SSshuttle.shuttle_loan && SSshuttle.shuttle_loan.dispatched
|
||||
var/message = "Remember to stamp and send back the supply manifests."
|
||||
if(SSshuttle.centcom_message)
|
||||
message = SSshuttle.centcom_message
|
||||
if(SSshuttle.supplyBlocked)
|
||||
message = blockade_warning
|
||||
data["message"] = message
|
||||
data["supplies"] = list()
|
||||
for(var/pack in SSshuttle.supply_packs)
|
||||
var/datum/supply_pack/P = SSshuttle.supply_packs[pack]
|
||||
if(!data["supplies"][P.group])
|
||||
data["supplies"][P.group] = list(
|
||||
"name" = P.group,
|
||||
"packs" = list()
|
||||
)
|
||||
if((P.hidden && !(obj_flags & EMAGGED)) || (P.contraband && !contraband) || (P.special && !P.special_enabled) || P.DropPodOnly)
|
||||
continue
|
||||
data["supplies"][P.group]["packs"] += list(list(
|
||||
"name" = P.name,
|
||||
"cost" = P.cost,
|
||||
"id" = pack,
|
||||
"desc" = P.desc || P.name // If there is a description, use it. Otherwise use the pack's name.
|
||||
))
|
||||
|
||||
data["cart"] = list()
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
data["cart"] += list(list(
|
||||
"object" = SO.pack.name,
|
||||
"cost" = SO.pack.cost,
|
||||
"id" = SO.id
|
||||
))
|
||||
|
||||
data["requests"] = list()
|
||||
for(var/datum/supply_order/SO in SSshuttle.requestlist)
|
||||
data["requests"] += list(list(
|
||||
"object" = SO.pack.name,
|
||||
"cost" = SO.pack.cost,
|
||||
"orderer" = SO.orderer,
|
||||
"reason" = SO.reason,
|
||||
"id" = SO.id
|
||||
))
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/cargo/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, "<span class='notice'>Access denied.</span>")
|
||||
return
|
||||
switch(action)
|
||||
if("send")
|
||||
if(!SSshuttle.supply.canMove())
|
||||
say(safety_warning)
|
||||
return
|
||||
if(SSshuttle.supplyBlocked)
|
||||
say(blockade_warning)
|
||||
return
|
||||
if(SSshuttle.supply.getDockedId() == "supply_home")
|
||||
SSshuttle.supply.export_categories = get_export_categories()
|
||||
SSshuttle.moveShuttle("supply", "supply_away", TRUE)
|
||||
say("The supply shuttle is departing.")
|
||||
investigate_log("[key_name(usr)] sent the supply shuttle away.", INVESTIGATE_CARGO)
|
||||
else
|
||||
investigate_log("[key_name(usr)] called the supply shuttle.", INVESTIGATE_CARGO)
|
||||
say("The supply shuttle has been called and will arrive in [SSshuttle.supply.timeLeft(600)] minutes.")
|
||||
SSshuttle.moveShuttle("supply", "supply_home", TRUE)
|
||||
. = TRUE
|
||||
if("loan")
|
||||
if(!SSshuttle.shuttle_loan)
|
||||
return
|
||||
if(SSshuttle.supplyBlocked)
|
||||
say(blockade_warning)
|
||||
return
|
||||
else if(SSshuttle.supply.mode != SHUTTLE_IDLE)
|
||||
return
|
||||
else if(SSshuttle.supply.getDockedId() != "supply_away")
|
||||
return
|
||||
else
|
||||
SSshuttle.shuttle_loan.loan_shuttle()
|
||||
say("The supply shuttle has been loaned to CentCom.")
|
||||
. = TRUE
|
||||
if("add")
|
||||
var/id = text2path(params["id"])
|
||||
var/datum/supply_pack/pack = SSshuttle.supply_packs[id]
|
||||
if(!istype(pack))
|
||||
return
|
||||
if((pack.hidden && !(obj_flags & EMAGGED)) || (pack.contraband && !contraband) || pack.DropPodOnly)
|
||||
return
|
||||
|
||||
var/name = "*None Provided*"
|
||||
var/rank = "*None Provided*"
|
||||
var/ckey = usr.ckey
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
name = H.get_authentification_name()
|
||||
rank = H.get_assignment(hand_first = TRUE)
|
||||
else if(issilicon(usr))
|
||||
name = usr.real_name
|
||||
rank = "Silicon"
|
||||
|
||||
var/reason = ""
|
||||
if(requestonly)
|
||||
reason = stripped_input("Reason:", name, "")
|
||||
if(isnull(reason) || ..())
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason)
|
||||
SO.generateRequisition(T)
|
||||
if(requestonly)
|
||||
SSshuttle.requestlist += SO
|
||||
else
|
||||
SSshuttle.shoppinglist += SO
|
||||
. = TRUE
|
||||
if("remove")
|
||||
var/id = text2num(params["id"])
|
||||
for(var/datum/supply_order/SO in SSshuttle.shoppinglist)
|
||||
if(SO.id == id)
|
||||
SSshuttle.shoppinglist -= SO
|
||||
. = TRUE
|
||||
break
|
||||
if("clear")
|
||||
SSshuttle.shoppinglist.Cut()
|
||||
. = TRUE
|
||||
if("approve")
|
||||
var/id = text2num(params["id"])
|
||||
for(var/datum/supply_order/SO in SSshuttle.requestlist)
|
||||
if(SO.id == id)
|
||||
SSshuttle.requestlist -= SO
|
||||
SSshuttle.shoppinglist += SO
|
||||
. = TRUE
|
||||
break
|
||||
if("deny")
|
||||
var/id = text2num(params["id"])
|
||||
for(var/datum/supply_order/SO in SSshuttle.requestlist)
|
||||
if(SO.id == id)
|
||||
SSshuttle.requestlist -= SO
|
||||
. = TRUE
|
||||
break
|
||||
if("denyall")
|
||||
SSshuttle.requestlist.Cut()
|
||||
. = TRUE
|
||||
if(.)
|
||||
post_signal("supply")
|
||||
|
||||
/obj/machinery/computer/cargo/proc/post_signal(command)
|
||||
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)
|
||||
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/status_signal = new(list("command" = command))
|
||||
frequency.post_signal(src, status_signal)
|
||||
|
||||
@@ -1,206 +1,206 @@
|
||||
#define MAX_EMAG_ROCKETS 8
|
||||
#define BEACON_COST 5000
|
||||
#define SP_LINKED 1
|
||||
#define SP_READY 2
|
||||
#define SP_LAUNCH 3
|
||||
#define SP_UNLINK 4
|
||||
#define SP_UNREADY 5
|
||||
|
||||
/obj/machinery/computer/cargo/express
|
||||
name = "express supply console"
|
||||
desc = "This console allows the user to purchase a package \
|
||||
with 1/40th of the delivery time: made possible by NanoTrasen's new \"1500mm Orbital Railgun\".\
|
||||
All sales are near instantaneous - please choose carefully"
|
||||
icon_screen = "supply_express"
|
||||
circuit = /obj/item/circuitboard/computer/cargo/express
|
||||
blockade_warning = "Bluespace instability detected. Delivery impossible."
|
||||
req_access = list(ACCESS_QM)
|
||||
var/message
|
||||
var/printed_beacons = 0 //number of beacons printed. Used to determine beacon names.
|
||||
var/list/meme_pack_data
|
||||
var/obj/item/supplypod_beacon/beacon //the linked supplypod beacon
|
||||
var/area/landingzone = /area/quartermaster/storage //where we droppin boys
|
||||
var/podType = /obj/structure/closet/supplypod
|
||||
var/cooldown = 0 //cooldown to prevent printing supplypod beacon spam
|
||||
var/locked = TRUE //is the console locked? unlock with ID
|
||||
var/usingBeacon = FALSE //is the console in beacon mode? exists to let beacon know when a pod may come in
|
||||
|
||||
/obj/machinery/computer/cargo/express/Initialize()
|
||||
. = ..()
|
||||
packin_up()
|
||||
|
||||
/obj/machinery/computer/cargo/express/Destroy()
|
||||
if(beacon)
|
||||
beacon.unlink_console()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/cargo/express/attackby(obj/item/W, mob/living/user, params)
|
||||
if((istype(W, /obj/item/card/id) || istype(W, /obj/item/pda)) && allowed(user))
|
||||
locked = !locked
|
||||
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the interface.</span>")
|
||||
return
|
||||
else if(istype(W, /obj/item/disk/cargo/bluespace_pod))
|
||||
podType = /obj/structure/closet/supplypod/bluespacepod
|
||||
to_chat(user, "<span class='notice'>You insert the disk into [src], allowing for advanced supply delivery vehicles.</span>")
|
||||
qdel(W)
|
||||
return TRUE
|
||||
else if(istype(W, /obj/item/supplypod_beacon))
|
||||
var/obj/item/supplypod_beacon/sb = W
|
||||
if (sb.express_console != src)
|
||||
sb.link_console(src, user)
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] is already linked to [sb].</span>")
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/cargo/express/emag_act(mob/living/user)
|
||||
. = SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
|
||||
"<span class='notice'>You change the routing protocols, allowing the Supply Pod to land anywhere on the station.</span>")
|
||||
obj_flags |= EMAGGED
|
||||
// This also sets this on the circuit board
|
||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||
board.obj_flags |= EMAGGED
|
||||
packin_up()
|
||||
req_access = list()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/cargo/express/proc/packin_up() // oh shit, I'm sorry
|
||||
meme_pack_data = list() // sorry for what?
|
||||
for(var/pack in SSshuttle.supply_packs) // our quartermaster taught us not to be ashamed of our supply packs
|
||||
var/datum/supply_pack/P = SSshuttle.supply_packs[pack] // specially since they're such a good price and all
|
||||
if(!meme_pack_data[P.group]) // yeah, I see that, your quartermaster gave you good advice
|
||||
meme_pack_data[P.group] = list( // it gets cheaper when I return it
|
||||
"name" = P.group, // mmhm
|
||||
"packs" = list() // sometimes, I return it so much, I rip the manifest
|
||||
) // see, my quartermaster taught me a few things too
|
||||
if((P.hidden) || (P.special)) // like, how not to rip the manifest
|
||||
continue// by using someone else's crate
|
||||
if(!(obj_flags & EMAGGED) && P.contraband) // will you show me?
|
||||
continue // i'd be right happy to
|
||||
meme_pack_data[P.group]["packs"] += list(list(
|
||||
"name" = P.name,
|
||||
"cost" = P.cost,
|
||||
"id" = pack,
|
||||
"desc" = P.desc || P.name // If there is a description, use it. Otherwise use the pack's name.
|
||||
))
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cargo_express", name, 1000, 800, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_data(mob/user)
|
||||
var/canBeacon = beacon && (isturf(beacon.loc) || ismob(beacon.loc))//is the beacon in a valid location?
|
||||
var/list/data = list()
|
||||
data["locked"] = locked//swipe an ID to unlock
|
||||
data["siliconUser"] = user.has_unlimited_silicon_privilege
|
||||
data["beaconzone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui
|
||||
data["usingBeacon"] = usingBeacon //is the mode set to deliver to the beacon or the cargobay?
|
||||
data["canBeacon"] = !usingBeacon || canBeacon //is the mode set to beacon delivery, and is the beacon in a valid location?
|
||||
data["canBuyBeacon"] = cooldown <= 0 && SSshuttle.points >= BEACON_COST
|
||||
data["beaconError"] = usingBeacon && !canBeacon ? "(BEACON ERROR)" : ""//changes button text to include an error alert if necessary
|
||||
data["hasBeacon"] = beacon != null//is there a linked beacon?
|
||||
data["beaconName"] = beacon ? beacon.name : "No Beacon Found"
|
||||
data["printMsg"] = cooldown > 0 ? "Print Beacon for [BEACON_COST] credits ([cooldown])" : "Print Beacon for [BEACON_COST] credits"//buttontext for printing beacons
|
||||
data["points"] = SSshuttle.points
|
||||
data["supplies"] = list()
|
||||
message = "Sales are near-instantaneous - please choose carefully."
|
||||
if(SSshuttle.supplyBlocked)
|
||||
message = blockade_warning
|
||||
if(usingBeacon && !beacon)
|
||||
message = "BEACON ERROR: BEACON MISSING"//beacon was destroyed
|
||||
else if (usingBeacon && !canBeacon)
|
||||
message = "BEACON ERROR: MUST BE EXPOSED"//beacon's loc/user's loc must be a turf
|
||||
if(obj_flags & EMAGGED)
|
||||
message = "(&!#@ERROR: ROUTING_#PROTOCOL MALF(*CT#ON. $UG%ESTE@ ACT#0N: !^/PULS3-%E)ET CIR*)ITB%ARD."
|
||||
data["message"] = message
|
||||
if(!meme_pack_data)
|
||||
packin_up()
|
||||
stack_trace("You didn't give the cargo tech good advice, and he ripped the manifest. As a result, there was no pack data for [src]")
|
||||
data["supplies"] = meme_pack_data
|
||||
if (cooldown > 0)//cooldown used for printing beacons
|
||||
cooldown--
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_act(action, params, datum/tgui/ui)
|
||||
switch(action)
|
||||
if("LZCargo")
|
||||
usingBeacon = FALSE
|
||||
if (beacon)
|
||||
beacon.update_status(SP_UNREADY) //ready light on beacon will turn off
|
||||
if("LZBeacon")
|
||||
usingBeacon = TRUE
|
||||
if (beacon)
|
||||
beacon.update_status(SP_READY) //turns on the beacon's ready light
|
||||
if("printBeacon")
|
||||
if (SSshuttle.points >= BEACON_COST)
|
||||
cooldown = 10//a ~ten second cooldown for printing beacons to prevent spam
|
||||
var/obj/item/supplypod_beacon/C = new /obj/item/supplypod_beacon(drop_location())
|
||||
C.link_console(src, usr)//rather than in beacon's Initialize(), we can assign the computer to the beacon by reusing this proc)
|
||||
printed_beacons++//printed_beacons starts at 0, so the first one out will be called beacon # 1
|
||||
beacon.name = "Supply Pod Beacon #[printed_beacons]"
|
||||
SSshuttle.points -= BEACON_COST
|
||||
|
||||
if("add")//Generate Supply Order first
|
||||
var/id = text2path(params["id"])
|
||||
var/datum/supply_pack/pack = SSshuttle.supply_packs[id]
|
||||
if(!istype(pack))
|
||||
return
|
||||
var/name = "*None Provided*"
|
||||
var/rank = "*None Provided*"
|
||||
var/ckey = usr.ckey
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
name = H.get_authentification_name()
|
||||
rank = H.get_assignment(hand_first = TRUE)
|
||||
else if(issilicon(usr))
|
||||
name = usr.real_name
|
||||
rank = "Silicon"
|
||||
var/reason = ""
|
||||
var/list/empty_turfs
|
||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason)
|
||||
if(!(obj_flags & EMAGGED))
|
||||
if(SO.pack.cost <= SSshuttle.points)
|
||||
var/LZ
|
||||
if (istype(beacon) && usingBeacon)//prioritize beacons over landing in cargobay
|
||||
LZ = get_turf(beacon)
|
||||
beacon.update_status(SP_LAUNCH)
|
||||
else if (!usingBeacon)//find a suitable supplypod landing zone in cargobay
|
||||
landingzone = GLOB.areas_by_type[/area/quartermaster/storage]
|
||||
if (!landingzone)
|
||||
WARNING("[src] couldnt find a Quartermaster/Storage (aka cargobay) area on the station, and as such it has set the supplypod landingzone to the area it resides in.")
|
||||
landingzone = get_area(src)
|
||||
for(var/turf/open/floor/T in landingzone.contents)//uses default landing zone
|
||||
if(is_blocked_turf(T))
|
||||
continue
|
||||
LAZYADD(empty_turfs, T)
|
||||
CHECK_TICK
|
||||
if(empty_turfs && empty_turfs.len)
|
||||
LZ = pick(empty_turfs)
|
||||
if (SO.pack.cost <= SSshuttle.points && LZ)//we need to call the cost check again because of the CHECK_TICK call
|
||||
SSshuttle.points -= SO.pack.cost
|
||||
new /obj/effect/abstract/DPtarget(LZ, podType, SO)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
else
|
||||
if(SO.pack.cost * (0.72*MAX_EMAG_ROCKETS) <= SSshuttle.points) // bulk discount :^)
|
||||
landingzone = GLOB.areas_by_type[pick(GLOB.the_station_areas)] //override default landing zone
|
||||
for(var/turf/open/floor/T in landingzone.contents)
|
||||
if(is_blocked_turf(T))
|
||||
continue
|
||||
LAZYADD(empty_turfs, T)
|
||||
CHECK_TICK
|
||||
if(empty_turfs && empty_turfs.len)
|
||||
SSshuttle.points -= SO.pack.cost * (0.72*MAX_EMAG_ROCKETS)
|
||||
SO.generateRequisition(get_turf(src))
|
||||
for(var/i in 1 to MAX_EMAG_ROCKETS)
|
||||
var/LZ = pick(empty_turfs)
|
||||
LAZYREMOVE(empty_turfs, LZ)
|
||||
new /obj/effect/abstract/DPtarget(LZ, podType, SO)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
CHECK_TICK
|
||||
#define MAX_EMAG_ROCKETS 8
|
||||
#define BEACON_COST 5000
|
||||
#define SP_LINKED 1
|
||||
#define SP_READY 2
|
||||
#define SP_LAUNCH 3
|
||||
#define SP_UNLINK 4
|
||||
#define SP_UNREADY 5
|
||||
|
||||
/obj/machinery/computer/cargo/express
|
||||
name = "express supply console"
|
||||
desc = "This console allows the user to purchase a package \
|
||||
with 1/40th of the delivery time: made possible by NanoTrasen's new \"1500mm Orbital Railgun\".\
|
||||
All sales are near instantaneous - please choose carefully"
|
||||
icon_screen = "supply_express"
|
||||
circuit = /obj/item/circuitboard/computer/cargo/express
|
||||
blockade_warning = "Bluespace instability detected. Delivery impossible."
|
||||
req_access = list(ACCESS_QM)
|
||||
var/message
|
||||
var/printed_beacons = 0 //number of beacons printed. Used to determine beacon names.
|
||||
var/list/meme_pack_data
|
||||
var/obj/item/supplypod_beacon/beacon //the linked supplypod beacon
|
||||
var/area/landingzone = /area/quartermaster/storage //where we droppin boys
|
||||
var/podType = /obj/structure/closet/supplypod
|
||||
var/cooldown = 0 //cooldown to prevent printing supplypod beacon spam
|
||||
var/locked = TRUE //is the console locked? unlock with ID
|
||||
var/usingBeacon = FALSE //is the console in beacon mode? exists to let beacon know when a pod may come in
|
||||
|
||||
/obj/machinery/computer/cargo/express/Initialize()
|
||||
. = ..()
|
||||
packin_up()
|
||||
|
||||
/obj/machinery/computer/cargo/express/Destroy()
|
||||
if(beacon)
|
||||
beacon.unlink_console()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/cargo/express/attackby(obj/item/W, mob/living/user, params)
|
||||
if((istype(W, /obj/item/card/id) || istype(W, /obj/item/pda)) && allowed(user))
|
||||
locked = !locked
|
||||
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the interface.</span>")
|
||||
return
|
||||
else if(istype(W, /obj/item/disk/cargo/bluespace_pod))
|
||||
podType = /obj/structure/closet/supplypod/bluespacepod
|
||||
to_chat(user, "<span class='notice'>You insert the disk into [src], allowing for advanced supply delivery vehicles.</span>")
|
||||
qdel(W)
|
||||
return TRUE
|
||||
else if(istype(W, /obj/item/supplypod_beacon))
|
||||
var/obj/item/supplypod_beacon/sb = W
|
||||
if (sb.express_console != src)
|
||||
sb.link_console(src, user)
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] is already linked to [sb].</span>")
|
||||
..()
|
||||
|
||||
/obj/machinery/computer/cargo/express/emag_act(mob/living/user)
|
||||
. = SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
|
||||
"<span class='notice'>You change the routing protocols, allowing the Supply Pod to land anywhere on the station.</span>")
|
||||
obj_flags |= EMAGGED
|
||||
// This also sets this on the circuit board
|
||||
var/obj/item/circuitboard/computer/cargo/board = circuit
|
||||
board.obj_flags |= EMAGGED
|
||||
packin_up()
|
||||
req_access = list()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/cargo/express/proc/packin_up() // oh shit, I'm sorry
|
||||
meme_pack_data = list() // sorry for what?
|
||||
for(var/pack in SSshuttle.supply_packs) // our quartermaster taught us not to be ashamed of our supply packs
|
||||
var/datum/supply_pack/P = SSshuttle.supply_packs[pack] // specially since they're such a good price and all
|
||||
if(!meme_pack_data[P.group]) // yeah, I see that, your quartermaster gave you good advice
|
||||
meme_pack_data[P.group] = list( // it gets cheaper when I return it
|
||||
"name" = P.group, // mmhm
|
||||
"packs" = list() // sometimes, I return it so much, I rip the manifest
|
||||
) // see, my quartermaster taught me a few things too
|
||||
if((P.hidden) || (P.special)) // like, how not to rip the manifest
|
||||
continue// by using someone else's crate
|
||||
if(!(obj_flags & EMAGGED) && P.contraband) // will you show me?
|
||||
continue // i'd be right happy to
|
||||
meme_pack_data[P.group]["packs"] += list(list(
|
||||
"name" = P.name,
|
||||
"cost" = P.cost,
|
||||
"id" = pack,
|
||||
"desc" = P.desc || P.name // If there is a description, use it. Otherwise use the pack's name.
|
||||
))
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "cargo_express", name, 600, 700, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_data(mob/user)
|
||||
var/canBeacon = beacon && (isturf(beacon.loc) || ismob(beacon.loc))//is the beacon in a valid location?
|
||||
var/list/data = list()
|
||||
data["locked"] = locked//swipe an ID to unlock
|
||||
data["siliconUser"] = user.has_unlimited_silicon_privilege
|
||||
data["beaconzone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui
|
||||
data["usingBeacon"] = usingBeacon //is the mode set to deliver to the beacon or the cargobay?
|
||||
data["canBeacon"] = !usingBeacon || canBeacon //is the mode set to beacon delivery, and is the beacon in a valid location?
|
||||
data["canBuyBeacon"] = cooldown <= 0 && SSshuttle.points >= BEACON_COST
|
||||
data["beaconError"] = usingBeacon && !canBeacon ? "(BEACON ERROR)" : ""//changes button text to include an error alert if necessary
|
||||
data["hasBeacon"] = beacon != null//is there a linked beacon?
|
||||
data["beaconName"] = beacon ? beacon.name : "No Beacon Found"
|
||||
data["printMsg"] = cooldown > 0 ? "Print Beacon for [BEACON_COST] credits ([cooldown])" : "Print Beacon for [BEACON_COST] credits"//buttontext for printing beacons
|
||||
data["points"] = SSshuttle.points
|
||||
data["supplies"] = list()
|
||||
message = "Sales are near-instantaneous - please choose carefully."
|
||||
if(SSshuttle.supplyBlocked)
|
||||
message = blockade_warning
|
||||
if(usingBeacon && !beacon)
|
||||
message = "BEACON ERROR: BEACON MISSING"//beacon was destroyed
|
||||
else if (usingBeacon && !canBeacon)
|
||||
message = "BEACON ERROR: MUST BE EXPOSED"//beacon's loc/user's loc must be a turf
|
||||
if(obj_flags & EMAGGED)
|
||||
message = "(&!#@ERROR: ROUTING_#PROTOCOL MALF(*CT#ON. $UG%ESTE@ ACT#0N: !^/PULS3-%E)ET CIR*)ITB%ARD."
|
||||
data["message"] = message
|
||||
if(!meme_pack_data)
|
||||
packin_up()
|
||||
stack_trace("You didn't give the cargo tech good advice, and he ripped the manifest. As a result, there was no pack data for [src]")
|
||||
data["supplies"] = meme_pack_data
|
||||
if (cooldown > 0)//cooldown used for printing beacons
|
||||
cooldown--
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/cargo/express/ui_act(action, params, datum/tgui/ui)
|
||||
switch(action)
|
||||
if("LZCargo")
|
||||
usingBeacon = FALSE
|
||||
if (beacon)
|
||||
beacon.update_status(SP_UNREADY) //ready light on beacon will turn off
|
||||
if("LZBeacon")
|
||||
usingBeacon = TRUE
|
||||
if (beacon)
|
||||
beacon.update_status(SP_READY) //turns on the beacon's ready light
|
||||
if("printBeacon")
|
||||
if (SSshuttle.points >= BEACON_COST)
|
||||
cooldown = 10//a ~ten second cooldown for printing beacons to prevent spam
|
||||
var/obj/item/supplypod_beacon/C = new /obj/item/supplypod_beacon(drop_location())
|
||||
C.link_console(src, usr)//rather than in beacon's Initialize(), we can assign the computer to the beacon by reusing this proc)
|
||||
printed_beacons++//printed_beacons starts at 0, so the first one out will be called beacon # 1
|
||||
beacon.name = "Supply Pod Beacon #[printed_beacons]"
|
||||
SSshuttle.points -= BEACON_COST
|
||||
|
||||
if("add")//Generate Supply Order first
|
||||
var/id = text2path(params["id"])
|
||||
var/datum/supply_pack/pack = SSshuttle.supply_packs[id]
|
||||
if(!istype(pack))
|
||||
return
|
||||
var/name = "*None Provided*"
|
||||
var/rank = "*None Provided*"
|
||||
var/ckey = usr.ckey
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
name = H.get_authentification_name()
|
||||
rank = H.get_assignment(hand_first = TRUE)
|
||||
else if(issilicon(usr))
|
||||
name = usr.real_name
|
||||
rank = "Silicon"
|
||||
var/reason = ""
|
||||
var/list/empty_turfs
|
||||
var/datum/supply_order/SO = new(pack, name, rank, ckey, reason)
|
||||
if(!(obj_flags & EMAGGED))
|
||||
if(SO.pack.cost <= SSshuttle.points)
|
||||
var/LZ
|
||||
if (istype(beacon) && usingBeacon)//prioritize beacons over landing in cargobay
|
||||
LZ = get_turf(beacon)
|
||||
beacon.update_status(SP_LAUNCH)
|
||||
else if (!usingBeacon)//find a suitable supplypod landing zone in cargobay
|
||||
landingzone = GLOB.areas_by_type[/area/quartermaster/storage]
|
||||
if (!landingzone)
|
||||
WARNING("[src] couldnt find a Quartermaster/Storage (aka cargobay) area on the station, and as such it has set the supplypod landingzone to the area it resides in.")
|
||||
landingzone = get_area(src)
|
||||
for(var/turf/open/floor/T in landingzone.contents)//uses default landing zone
|
||||
if(is_blocked_turf(T))
|
||||
continue
|
||||
LAZYADD(empty_turfs, T)
|
||||
CHECK_TICK
|
||||
if(empty_turfs && empty_turfs.len)
|
||||
LZ = pick(empty_turfs)
|
||||
if (SO.pack.cost <= SSshuttle.points && LZ)//we need to call the cost check again because of the CHECK_TICK call
|
||||
SSshuttle.points -= SO.pack.cost
|
||||
new /obj/effect/abstract/DPtarget(LZ, podType, SO)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
else
|
||||
if(SO.pack.cost * (0.72*MAX_EMAG_ROCKETS) <= SSshuttle.points) // bulk discount :^)
|
||||
landingzone = GLOB.areas_by_type[pick(GLOB.the_station_areas)] //override default landing zone
|
||||
for(var/turf/open/floor/T in landingzone.contents)
|
||||
if(is_blocked_turf(T))
|
||||
continue
|
||||
LAZYADD(empty_turfs, T)
|
||||
CHECK_TICK
|
||||
if(empty_turfs && empty_turfs.len)
|
||||
SSshuttle.points -= SO.pack.cost * (0.72*MAX_EMAG_ROCKETS)
|
||||
SO.generateRequisition(get_turf(src))
|
||||
for(var/i in 1 to MAX_EMAG_ROCKETS)
|
||||
var/LZ = pick(empty_turfs)
|
||||
LAZYREMOVE(empty_turfs, LZ)
|
||||
new /obj/effect/abstract/DPtarget(LZ, podType, SO)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
CHECK_TICK
|
||||
|
||||
+695
-681
File diff suppressed because it is too large
Load Diff
@@ -47,6 +47,18 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
|
||||
else if (job in completed_asset_jobs) //byond bug ID:2256651
|
||||
to_chat(src, "<span class='danger'>An error has been detected in how your client is receiving resources. Attempting to correct.... (If you keep seeing these messages you might want to close byond and reconnect)</span>")
|
||||
src << browse("...", "window=asset_cache_browser")
|
||||
// Keypress passthrough
|
||||
if(href_list["__keydown"])
|
||||
var/keycode = browser_keycode_to_byond(href_list["__keydown"])
|
||||
if(keycode)
|
||||
keyDown(keycode)
|
||||
return
|
||||
if(href_list["__keyup"])
|
||||
var/keycode = browser_keycode_to_byond(href_list["__keyup"])
|
||||
if(keycode)
|
||||
keyUp(keycode)
|
||||
return
|
||||
|
||||
|
||||
var/mtl = CONFIG_GET(number/minute_topic_limit)
|
||||
if (!holder && mtl)
|
||||
|
||||
+107
-102
@@ -3,37 +3,34 @@
|
||||
var/viewing_category = 1 //typical powergamer starting on the Weapons tab
|
||||
var/viewing_subcategory = 1
|
||||
var/list/categories = list(
|
||||
CAT_WEAPONRY,
|
||||
CAT_ROBOT,
|
||||
CAT_MISC,
|
||||
CAT_PRIMAL,
|
||||
CAT_FOOD,
|
||||
CAT_CLOTHING)
|
||||
var/list/subcategories = list(
|
||||
list( //Weapon subcategories
|
||||
CAT_WEAPON,
|
||||
CAT_AMMO),
|
||||
CAT_NONE, //Robot subcategories
|
||||
CAT_NONE, //Misc subcategories
|
||||
CAT_NONE, //Tribal subcategories
|
||||
list( //Food subcategories
|
||||
CAT_BREAD,
|
||||
CAT_BURGER,
|
||||
CAT_CAKE,
|
||||
CAT_EGG,
|
||||
CAT_FISH,
|
||||
CAT_ICE, //Called Frozen
|
||||
CAT_MEAT,
|
||||
CAT_MISCFOOD,
|
||||
CAT_PASTRY,
|
||||
CAT_PIE,
|
||||
CAT_PIZZA,
|
||||
CAT_SALAD,
|
||||
CAT_SANDWICH,
|
||||
CAT_SOUP,
|
||||
CAT_SPAGHETTI),
|
||||
CAT_NONE) //Clothing subcategories
|
||||
|
||||
CAT_WEAPONRY = list(
|
||||
CAT_WEAPON,
|
||||
CAT_AMMO,
|
||||
),
|
||||
CAT_ROBOT = CAT_NONE,
|
||||
CAT_MISC = CAT_NONE,
|
||||
CAT_PRIMAL = CAT_NONE,
|
||||
CAT_FOOD = list(
|
||||
CAT_BREAD,
|
||||
CAT_BURGER,
|
||||
CAT_CAKE,
|
||||
CAT_EGG,
|
||||
CAT_FISH,
|
||||
CAT_ICE, //Called Frozen
|
||||
CAT_MEAT,
|
||||
CAT_MISCFOOD,
|
||||
CAT_PASTRY,
|
||||
CAT_PIE,
|
||||
CAT_PIZZA,
|
||||
CAT_SALAD,
|
||||
CAT_SANDWICH,
|
||||
CAT_SOUP,
|
||||
CAT_SPAGHETTI,
|
||||
),
|
||||
CAT_CLOTHING = CAT_NONE
|
||||
)
|
||||
var/cur_category = CAT_NONE
|
||||
var/cur_subcategory = CAT_NONE
|
||||
var/datum/action/innate/crafting/button
|
||||
var/display_craftable_only = FALSE
|
||||
var/display_compact = TRUE
|
||||
@@ -68,11 +65,11 @@
|
||||
continue main_loop
|
||||
else
|
||||
continue
|
||||
return 0
|
||||
return FALSE
|
||||
for(var/A in R.chem_catalysts)
|
||||
if(contents[A] < R.chem_catalysts[A])
|
||||
return 0
|
||||
return 1
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/personal_crafting/proc/get_environment(mob/user)
|
||||
. = list()
|
||||
@@ -158,7 +155,7 @@
|
||||
I.CheckParts(parts, R)
|
||||
if(send_feedback)
|
||||
SSblackbox.record_feedback("tally", "object_crafted", 1, I.type)
|
||||
return 0
|
||||
return FALSE
|
||||
return "."
|
||||
return ", missing tool."
|
||||
return ", missing component."
|
||||
@@ -290,46 +287,97 @@
|
||||
/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_turf_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
cur_category = categories[1]
|
||||
if(islist(categories[cur_category]))
|
||||
var/list/subcats = categories[cur_category]
|
||||
cur_subcategory = subcats[1]
|
||||
else
|
||||
cur_subcategory = CAT_NONE
|
||||
ui = new(user, src, ui_key, "personal_crafting", "Crafting Menu", 700, 800, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
|
||||
/datum/personal_crafting/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/list/subs = list()
|
||||
var/cur_subcategory = CAT_NONE
|
||||
var/cur_category = categories[viewing_category]
|
||||
if (islist(subcategories[viewing_category]))
|
||||
subs = subcategories[viewing_category]
|
||||
cur_subcategory = subs[viewing_subcategory]
|
||||
data["busy"] = busy
|
||||
data["prev_cat"] = categories[prev_cat()]
|
||||
data["prev_subcat"] = subs[prev_subcat()]
|
||||
data["category"] = cur_category
|
||||
data["subcategory"] = cur_subcategory
|
||||
data["next_cat"] = categories[next_cat()]
|
||||
data["next_subcat"] = subs[next_subcat()]
|
||||
data["display_craftable_only"] = display_craftable_only
|
||||
data["display_compact"] = display_compact
|
||||
|
||||
var/list/surroundings = get_surroundings(user)
|
||||
var/list/can_craft = list()
|
||||
var/list/cant_craft = list()
|
||||
var/list/craftability = list()
|
||||
for(var/rec in GLOB.crafting_recipes)
|
||||
var/datum/crafting_recipe/R = rec
|
||||
if(!R.always_availible && !(R.type in user?.mind?.learned_recipes)) //User doesn't actually know how to make this.
|
||||
continue
|
||||
if((R.category != cur_category) || (R.subcategory != cur_subcategory))
|
||||
continue
|
||||
if(check_contents(R, surroundings))
|
||||
can_craft += list(build_recipe_data(R))
|
||||
else
|
||||
cant_craft += list(build_recipe_data(R))
|
||||
data["can_craft"] = can_craft
|
||||
data["cant_craft"] = cant_craft
|
||||
craftability["[REF(R)]"] = check_contents(R, surroundings)
|
||||
data["craftability"] = craftability
|
||||
return data
|
||||
|
||||
|
||||
/datum/component/personal_crafting/ui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
var/list/crafting_recipes = list()
|
||||
for(var/rec in GLOB.crafting_recipes)
|
||||
var/datum/crafting_recipe/R = rec
|
||||
|
||||
if(R.name == "") //This is one of the invalid parents that sneaks in
|
||||
continue
|
||||
|
||||
if(!R.always_availible && !(R.type in user?.mind?.learned_recipes)) //User doesn't actually know how to make this.
|
||||
continue
|
||||
|
||||
if(isnull(crafting_recipes[R.category]))
|
||||
crafting_recipes[R.category] = list()
|
||||
|
||||
if(R.subcategory == CAT_NONE)
|
||||
crafting_recipes[R.category] += list(build_recipe_data(R))
|
||||
else
|
||||
if(isnull(crafting_recipes[R.category][R.subcategory]))
|
||||
crafting_recipes[R.category][R.subcategory] = list()
|
||||
crafting_recipes[R.category]["has_subcats"] = TRUE
|
||||
crafting_recipes[R.category][R.subcategory] += list(build_recipe_data(R))
|
||||
|
||||
data["crafting_recipes"] = crafting_recipes
|
||||
return data
|
||||
|
||||
/datum/component/personal_crafting/proc/build_recipe_data(datum/crafting_recipe/R)
|
||||
var/list/data = list()
|
||||
data["name"] = R.name
|
||||
data["ref"] = "[REF(R)]"
|
||||
var/req_text = ""
|
||||
var/tool_text = ""
|
||||
var/catalyst_text = ""
|
||||
|
||||
for(var/a in R.reqs)
|
||||
//We just need the name, so cheat-typecast to /atom for speed (even tho Reagents are /datum they DO have a "name" var)
|
||||
//Also these are typepaths so sadly we can't just do "[a]"
|
||||
var/atom/A = a
|
||||
req_text += " [R.reqs[A]] [initial(A.name)],"
|
||||
req_text = replacetext(req_text,",","",-1)
|
||||
data["req_text"] = req_text
|
||||
|
||||
for(var/a in R.chem_catalysts)
|
||||
var/atom/A = a //cheat-typecast
|
||||
catalyst_text += " [R.chem_catalysts[A]] [initial(A.name)],"
|
||||
catalyst_text = replacetext(catalyst_text,",","",-1)
|
||||
data["catalyst_text"] = catalyst_text
|
||||
|
||||
for(var/a in R.tools)
|
||||
if(ispath(a, /obj/item))
|
||||
var/obj/item/b = a
|
||||
tool_text += " [initial(b.name)],"
|
||||
else
|
||||
tool_text += " [a],"
|
||||
tool_text = replacetext(tool_text,",","",-1)
|
||||
data["tool_text"] = tool_text
|
||||
|
||||
return data
|
||||
|
||||
/datum/personal_crafting/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
@@ -345,61 +393,18 @@
|
||||
to_chat(usr, "<span class='warning'>Construction failed[fail_msg]</span>")
|
||||
busy = FALSE
|
||||
ui_interact(usr)
|
||||
if("forwardCat") //Meow
|
||||
viewing_category = next_cat(FALSE)
|
||||
. = TRUE
|
||||
if("backwardCat")
|
||||
viewing_category = prev_cat(FALSE)
|
||||
. = TRUE
|
||||
if("forwardSubCat")
|
||||
viewing_subcategory = next_subcat()
|
||||
. = TRUE
|
||||
if("backwardSubCat")
|
||||
viewing_subcategory = prev_subcat()
|
||||
. = TRUE
|
||||
if("toggle_recipes")
|
||||
display_craftable_only = !display_craftable_only
|
||||
. = TRUE
|
||||
if("toggle_compact")
|
||||
display_compact = !display_compact
|
||||
. = TRUE
|
||||
|
||||
|
||||
//Next works nicely with modular arithmetic
|
||||
/datum/personal_crafting/proc/next_cat(readonly = TRUE)
|
||||
if (!readonly)
|
||||
viewing_subcategory = 1
|
||||
. = viewing_category % categories.len + 1
|
||||
|
||||
/datum/personal_crafting/proc/next_subcat()
|
||||
if(islist(subcategories[viewing_category]))
|
||||
var/list/subs = subcategories[viewing_category]
|
||||
. = viewing_subcategory % subs.len + 1
|
||||
|
||||
|
||||
//Previous can go fuck itself
|
||||
/datum/personal_crafting/proc/prev_cat(readonly = TRUE)
|
||||
if (!readonly)
|
||||
viewing_subcategory = 1
|
||||
if(viewing_category == categories.len)
|
||||
. = viewing_category-1
|
||||
else
|
||||
. = viewing_category % categories.len - 1
|
||||
if(. <= 0)
|
||||
. = categories.len
|
||||
|
||||
/datum/personal_crafting/proc/prev_subcat()
|
||||
if(islist(subcategories[viewing_category]))
|
||||
var/list/subs = subcategories[viewing_category]
|
||||
if(viewing_subcategory == subs.len)
|
||||
. = viewing_subcategory-1
|
||||
else
|
||||
. = viewing_subcategory % subs.len - 1
|
||||
if(. <= 0)
|
||||
. = subs.len
|
||||
else
|
||||
. = null
|
||||
|
||||
if("set_category")
|
||||
if(!isnull(params["category"]))
|
||||
cur_category = params["category"]
|
||||
if(!isnull(params["subcategory"]))
|
||||
cur_subcategory = params["subcategory"]
|
||||
. = TRUE
|
||||
|
||||
/datum/personal_crafting/proc/build_recipe_data(datum/crafting_recipe/R)
|
||||
var/list/data = list()
|
||||
|
||||
@@ -481,6 +481,8 @@ datum/crafting_recipe/food/donut/meat
|
||||
/obj/item/reagent_containers/food/snacks/grown/oat = 1
|
||||
)
|
||||
result = /obj/item/reagent_containers/food/snacks/oatmealcookie
|
||||
subcategory = CAT_PASTRY
|
||||
|
||||
|
||||
/datum/crafting_recipe/food/raisincookie
|
||||
name = "Raisin cookie"
|
||||
|
||||
@@ -101,7 +101,7 @@ a.popt {text-decoration: none;}
|
||||
#ping {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 115px;
|
||||
right: 135px;
|
||||
width: 45px;
|
||||
background: #d0d0d0;
|
||||
height: 30px;
|
||||
@@ -131,13 +131,13 @@ a.popt {text-decoration: none;}
|
||||
}
|
||||
#userBar .subCell:hover {background: #ccc;}
|
||||
#userBar .toggle {
|
||||
width: 40px;
|
||||
width: 45px;
|
||||
background: #ccc;
|
||||
border-top: 0;
|
||||
float: right;
|
||||
text-align: center;
|
||||
}
|
||||
#userBar .sub {clear: both; display: none; width: 160px;}
|
||||
#userBar .sub {clear: both; display: none; width: 180px;}
|
||||
#userBar .sub.scroll {overflow-y: scroll;}
|
||||
#userBar .sub.subCell {padding: 3px 0 3px 8px; line-height: 30px; font-size: 0.9em; clear: both;}
|
||||
#userBar .sub span {
|
||||
|
||||
@@ -1,788 +0,0 @@
|
||||
@font-face{font-family:'FontAwesome';src:url('fontawesome-webfont.eot');src:url('fontawesome-webfont.eot') format('embedded-opentype'),url('fontawesome-webfont.woff') format('woff'),url('fontawesome-webfont.ttf') format('truetype'),url('fontawesome-webfont.svg') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;}
|
||||
[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;}
|
||||
.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;}
|
||||
a [class^="icon-"],a [class*=" icon-"]{display:inline;}
|
||||
[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;}
|
||||
.icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;}
|
||||
.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;}
|
||||
[class^="icon-"].hide,[class*=" icon-"].hide{display:none;}
|
||||
.icon-muted{color:#eeeeee;}
|
||||
.icon-light{color:#ffffff;}
|
||||
.icon-dark{color:#333333;}
|
||||
.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
||||
.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
|
||||
.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
|
||||
.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;}
|
||||
.pull-right{float:right;}
|
||||
.pull-left{float:left;}
|
||||
[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;}
|
||||
[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;}
|
||||
[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;}
|
||||
.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;}
|
||||
.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;}
|
||||
.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;}
|
||||
.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;}
|
||||
.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;}
|
||||
.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;}
|
||||
.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;}
|
||||
.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;}
|
||||
.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;}
|
||||
.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;}
|
||||
.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;}
|
||||
.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;}
|
||||
.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;}
|
||||
.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;}
|
||||
a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;}
|
||||
@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);}
|
||||
.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);}
|
||||
.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);}
|
||||
.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);}
|
||||
.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);}
|
||||
a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;}
|
||||
.icon-glass:before{content:"\f000";}
|
||||
.icon-music:before{content:"\f001";}
|
||||
.icon-search:before{content:"\f002";}
|
||||
.icon-envelope-alt:before{content:"\f003";}
|
||||
.icon-heart:before{content:"\f004";}
|
||||
.icon-star:before{content:"\f005";}
|
||||
.icon-star-empty:before{content:"\f006";}
|
||||
.icon-user:before{content:"\f007";}
|
||||
.icon-film:before{content:"\f008";}
|
||||
.icon-th-large:before{content:"\f009";}
|
||||
.icon-th:before{content:"\f00a";}
|
||||
.icon-th-list:before{content:"\f00b";}
|
||||
.icon-ok:before{content:"\f00c";}
|
||||
.icon-remove:before{content:"\f00d";}
|
||||
.icon-zoom-in:before{content:"\f00e";}
|
||||
.icon-zoom-out:before{content:"\f010";}
|
||||
.icon-power-off:before,.icon-off:before{content:"\f011";}
|
||||
.icon-signal:before{content:"\f012";}
|
||||
.icon-gear:before,.icon-cog:before{content:"\f013";}
|
||||
.icon-trash:before{content:"\f014";}
|
||||
.icon-home:before{content:"\f015";}
|
||||
.icon-file-alt:before{content:"\f016";}
|
||||
.icon-time:before{content:"\f017";}
|
||||
.icon-road:before{content:"\f018";}
|
||||
.icon-download-alt:before{content:"\f019";}
|
||||
.icon-download:before{content:"\f01a";}
|
||||
.icon-upload:before{content:"\f01b";}
|
||||
.icon-inbox:before{content:"\f01c";}
|
||||
.icon-play-circle:before{content:"\f01d";}
|
||||
.icon-rotate-right:before,.icon-repeat:before{content:"\f01e";}
|
||||
.icon-refresh:before{content:"\f021";}
|
||||
.icon-list-alt:before{content:"\f022";}
|
||||
.icon-lock:before{content:"\f023";}
|
||||
.icon-flag:before{content:"\f024";}
|
||||
.icon-headphones:before{content:"\f025";}
|
||||
.icon-volume-off:before{content:"\f026";}
|
||||
.icon-volume-down:before{content:"\f027";}
|
||||
.icon-volume-up:before{content:"\f028";}
|
||||
.icon-qrcode:before{content:"\f029";}
|
||||
.icon-barcode:before{content:"\f02a";}
|
||||
.icon-tag:before{content:"\f02b";}
|
||||
.icon-tags:before{content:"\f02c";}
|
||||
.icon-book:before{content:"\f02d";}
|
||||
.icon-bookmark:before{content:"\f02e";}
|
||||
.icon-print:before{content:"\f02f";}
|
||||
.icon-camera:before{content:"\f030";}
|
||||
.icon-font:before{content:"\f031";}
|
||||
.icon-bold:before{content:"\f032";}
|
||||
.icon-italic:before{content:"\f033";}
|
||||
.icon-text-height:before{content:"\f034";}
|
||||
.icon-text-width:before{content:"\f035";}
|
||||
.icon-align-left:before{content:"\f036";}
|
||||
.icon-align-center:before{content:"\f037";}
|
||||
.icon-align-right:before{content:"\f038";}
|
||||
.icon-align-justify:before{content:"\f039";}
|
||||
.icon-list:before{content:"\f03a";}
|
||||
.icon-indent-left:before{content:"\f03b";}
|
||||
.icon-indent-right:before{content:"\f03c";}
|
||||
.icon-facetime-video:before{content:"\f03d";}
|
||||
.icon-picture:before{content:"\f03e";}
|
||||
.icon-pencil:before{content:"\f040";}
|
||||
.icon-map-marker:before{content:"\f041";}
|
||||
.icon-adjust:before{content:"\f042";}
|
||||
.icon-tint:before{content:"\f043";}
|
||||
.icon-edit:before{content:"\f044";}
|
||||
.icon-share:before{content:"\f045";}
|
||||
.icon-check:before{content:"\f046";}
|
||||
.icon-move:before{content:"\f047";}
|
||||
.icon-step-backward:before{content:"\f048";}
|
||||
.icon-fast-backward:before{content:"\f049";}
|
||||
.icon-backward:before{content:"\f04a";}
|
||||
.icon-play:before{content:"\f04b";}
|
||||
.icon-pause:before{content:"\f04c";}
|
||||
.icon-stop:before{content:"\f04d";}
|
||||
.icon-forward:before{content:"\f04e";}
|
||||
.icon-fast-forward:before{content:"\f050";}
|
||||
.icon-step-forward:before{content:"\f051";}
|
||||
.icon-eject:before{content:"\f052";}
|
||||
.icon-chevron-left:before{content:"\f053";}
|
||||
.icon-chevron-right:before{content:"\f054";}
|
||||
.icon-plus-sign:before{content:"\f055";}
|
||||
.icon-minus-sign:before{content:"\f056";}
|
||||
.icon-remove-sign:before{content:"\f057";}
|
||||
.icon-ok-sign:before{content:"\f058";}
|
||||
.icon-question-sign:before{content:"\f059";}
|
||||
.icon-info-sign:before{content:"\f05a";}
|
||||
.icon-screenshot:before{content:"\f05b";}
|
||||
.icon-remove-circle:before{content:"\f05c";}
|
||||
.icon-ok-circle:before{content:"\f05d";}
|
||||
.icon-ban-circle:before{content:"\f05e";}
|
||||
.icon-arrow-left:before{content:"\f060";}
|
||||
.icon-arrow-right:before{content:"\f061";}
|
||||
.icon-arrow-up:before{content:"\f062";}
|
||||
.icon-arrow-down:before{content:"\f063";}
|
||||
.icon-mail-forward:before,.icon-share-alt:before{content:"\f064";}
|
||||
.icon-resize-full:before{content:"\f065";}
|
||||
.icon-resize-small:before{content:"\f066";}
|
||||
.icon-plus:before{content:"\f067";}
|
||||
.icon-minus:before{content:"\f068";}
|
||||
.icon-asterisk:before{content:"\f069";}
|
||||
.icon-exclamation-sign:before{content:"\f06a";}
|
||||
.icon-gift:before{content:"\f06b";}
|
||||
.icon-leaf:before{content:"\f06c";}
|
||||
.icon-fire:before{content:"\f06d";}
|
||||
.icon-eye-open:before{content:"\f06e";}
|
||||
.icon-eye-close:before{content:"\f070";}
|
||||
.icon-warning-sign:before{content:"\f071";}
|
||||
.icon-plane:before{content:"\f072";}
|
||||
.icon-calendar:before{content:"\f073";}
|
||||
.icon-random:before{content:"\f074";}
|
||||
.icon-comment:before{content:"\f075";}
|
||||
.icon-magnet:before{content:"\f076";}
|
||||
.icon-chevron-up:before{content:"\f077";}
|
||||
.icon-chevron-down:before{content:"\f078";}
|
||||
.icon-retweet:before{content:"\f079";}
|
||||
.icon-shopping-cart:before{content:"\f07a";}
|
||||
.icon-folder-close:before{content:"\f07b";}
|
||||
.icon-folder-open:before{content:"\f07c";}
|
||||
.icon-resize-vertical:before{content:"\f07d";}
|
||||
.icon-resize-horizontal:before{content:"\f07e";}
|
||||
.icon-bar-chart:before{content:"\f080";}
|
||||
.icon-twitter-sign:before{content:"\f081";}
|
||||
.icon-facebook-sign:before{content:"\f082";}
|
||||
.icon-camera-retro:before{content:"\f083";}
|
||||
.icon-key:before{content:"\f084";}
|
||||
.icon-gears:before,.icon-cogs:before{content:"\f085";}
|
||||
.icon-comments:before{content:"\f086";}
|
||||
.icon-thumbs-up-alt:before{content:"\f087";}
|
||||
.icon-thumbs-down-alt:before{content:"\f088";}
|
||||
.icon-star-half:before{content:"\f089";}
|
||||
.icon-heart-empty:before{content:"\f08a";}
|
||||
.icon-signout:before{content:"\f08b";}
|
||||
.icon-linkedin-sign:before{content:"\f08c";}
|
||||
.icon-pushpin:before{content:"\f08d";}
|
||||
.icon-external-link:before{content:"\f08e";}
|
||||
.icon-signin:before{content:"\f090";}
|
||||
.icon-trophy:before{content:"\f091";}
|
||||
.icon-github-sign:before{content:"\f092";}
|
||||
.icon-upload-alt:before{content:"\f093";}
|
||||
.icon-lemon:before{content:"\f094";}
|
||||
.icon-phone:before{content:"\f095";}
|
||||
.icon-unchecked:before,.icon-check-empty:before{content:"\f096";}
|
||||
.icon-bookmark-empty:before{content:"\f097";}
|
||||
.icon-phone-sign:before{content:"\f098";}
|
||||
.icon-twitter:before{content:"\f099";}
|
||||
.icon-facebook:before{content:"\f09a";}
|
||||
.icon-github:before{content:"\f09b";}
|
||||
.icon-unlock:before{content:"\f09c";}
|
||||
.icon-credit-card:before{content:"\f09d";}
|
||||
.icon-rss:before{content:"\f09e";}
|
||||
.icon-hdd:before{content:"\f0a0";}
|
||||
.icon-bullhorn:before{content:"\f0a1";}
|
||||
.icon-bell:before{content:"\f0a2";}
|
||||
.icon-certificate:before{content:"\f0a3";}
|
||||
.icon-hand-right:before{content:"\f0a4";}
|
||||
.icon-hand-left:before{content:"\f0a5";}
|
||||
.icon-hand-up:before{content:"\f0a6";}
|
||||
.icon-hand-down:before{content:"\f0a7";}
|
||||
.icon-circle-arrow-left:before{content:"\f0a8";}
|
||||
.icon-circle-arrow-right:before{content:"\f0a9";}
|
||||
.icon-circle-arrow-up:before{content:"\f0aa";}
|
||||
.icon-circle-arrow-down:before{content:"\f0ab";}
|
||||
.icon-globe:before{content:"\f0ac";}
|
||||
.icon-wrench:before{content:"\f0ad";}
|
||||
.icon-tasks:before{content:"\f0ae";}
|
||||
.icon-filter:before{content:"\f0b0";}
|
||||
.icon-briefcase:before{content:"\f0b1";}
|
||||
.icon-fullscreen:before{content:"\f0b2";}
|
||||
.icon-group:before{content:"\f0c0";}
|
||||
.icon-link:before{content:"\f0c1";}
|
||||
.icon-cloud:before{content:"\f0c2";}
|
||||
.icon-beaker:before{content:"\f0c3";}
|
||||
.icon-cut:before{content:"\f0c4";}
|
||||
.icon-copy:before{content:"\f0c5";}
|
||||
.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";}
|
||||
.icon-save:before{content:"\f0c7";}
|
||||
.icon-sign-blank:before{content:"\f0c8";}
|
||||
.icon-reorder:before{content:"\f0c9";}
|
||||
.icon-list-ul:before{content:"\f0ca";}
|
||||
.icon-list-ol:before{content:"\f0cb";}
|
||||
.icon-strikethrough:before{content:"\f0cc";}
|
||||
.icon-underline:before{content:"\f0cd";}
|
||||
.icon-table:before{content:"\f0ce";}
|
||||
.icon-magic:before{content:"\f0d0";}
|
||||
.icon-truck:before{content:"\f0d1";}
|
||||
.icon-pinterest:before{content:"\f0d2";}
|
||||
.icon-pinterest-sign:before{content:"\f0d3";}
|
||||
.icon-google-plus-sign:before{content:"\f0d4";}
|
||||
.icon-google-plus:before{content:"\f0d5";}
|
||||
.icon-money:before{content:"\f0d6";}
|
||||
.icon-caret-down:before{content:"\f0d7";}
|
||||
.icon-caret-up:before{content:"\f0d8";}
|
||||
.icon-caret-left:before{content:"\f0d9";}
|
||||
.icon-caret-right:before{content:"\f0da";}
|
||||
.icon-columns:before{content:"\f0db";}
|
||||
.icon-sort:before{content:"\f0dc";}
|
||||
.icon-sort-down:before{content:"\f0dd";}
|
||||
.icon-sort-up:before{content:"\f0de";}
|
||||
.icon-envelope:before{content:"\f0e0";}
|
||||
.icon-linkedin:before{content:"\f0e1";}
|
||||
.icon-rotate-left:before,.icon-undo:before{content:"\f0e2";}
|
||||
.icon-legal:before{content:"\f0e3";}
|
||||
.icon-dashboard:before{content:"\f0e4";}
|
||||
.icon-comment-alt:before{content:"\f0e5";}
|
||||
.icon-comments-alt:before{content:"\f0e6";}
|
||||
.icon-bolt:before{content:"\f0e7";}
|
||||
.icon-sitemap:before{content:"\f0e8";}
|
||||
.icon-umbrella:before{content:"\f0e9";}
|
||||
.icon-paste:before{content:"\f0ea";}
|
||||
.icon-lightbulb:before{content:"\f0eb";}
|
||||
.icon-exchange:before{content:"\f0ec";}
|
||||
.icon-cloud-download:before{content:"\f0ed";}
|
||||
.icon-cloud-upload:before{content:"\f0ee";}
|
||||
.icon-user-md:before{content:"\f0f0";}
|
||||
.icon-stethoscope:before{content:"\f0f1";}
|
||||
.icon-suitcase:before{content:"\f0f2";}
|
||||
.icon-bell-alt:before{content:"\f0f3";}
|
||||
.icon-coffee:before{content:"\f0f4";}
|
||||
.icon-food:before{content:"\f0f5";}
|
||||
.icon-file-text-alt:before{content:"\f0f6";}
|
||||
.icon-building:before{content:"\f0f7";}
|
||||
.icon-hospital:before{content:"\f0f8";}
|
||||
.icon-ambulance:before{content:"\f0f9";}
|
||||
.icon-medkit:before{content:"\f0fa";}
|
||||
.icon-fighter-jet:before{content:"\f0fb";}
|
||||
.icon-beer:before{content:"\f0fc";}
|
||||
.icon-h-sign:before{content:"\f0fd";}
|
||||
.icon-plus-sign-alt:before{content:"\f0fe";}
|
||||
.icon-double-angle-left:before{content:"\f100";}
|
||||
.icon-double-angle-right:before{content:"\f101";}
|
||||
.icon-double-angle-up:before{content:"\f102";}
|
||||
.icon-double-angle-down:before{content:"\f103";}
|
||||
.icon-angle-left:before{content:"\f104";}
|
||||
.icon-angle-right:before{content:"\f105";}
|
||||
.icon-angle-up:before{content:"\f106";}
|
||||
.icon-angle-down:before{content:"\f107";}
|
||||
.icon-desktop:before{content:"\f108";}
|
||||
.icon-laptop:before{content:"\f109";}
|
||||
.icon-tablet:before{content:"\f10a";}
|
||||
.icon-mobile-phone:before{content:"\f10b";}
|
||||
.icon-circle-blank:before{content:"\f10c";}
|
||||
.icon-quote-left:before{content:"\f10d";}
|
||||
.icon-quote-right:before{content:"\f10e";}
|
||||
.icon-spinner:before{content:"\f110";}
|
||||
.icon-circle:before{content:"\f111";}
|
||||
.icon-mail-reply:before,.icon-reply:before{content:"\f112";}
|
||||
.icon-github-alt:before{content:"\f113";}
|
||||
.icon-folder-close-alt:before{content:"\f114";}
|
||||
.icon-folder-open-alt:before{content:"\f115";}
|
||||
.icon-expand-alt:before{content:"\f116";}
|
||||
.icon-collapse-alt:before{content:"\f117";}
|
||||
.icon-smile:before{content:"\f118";}
|
||||
.icon-frown:before{content:"\f119";}
|
||||
.icon-meh:before{content:"\f11a";}
|
||||
.icon-gamepad:before{content:"\f11b";}
|
||||
.icon-keyboard:before{content:"\f11c";}
|
||||
.icon-flag-alt:before{content:"\f11d";}
|
||||
.icon-flag-checkered:before{content:"\f11e";}
|
||||
.icon-terminal:before{content:"\f120";}
|
||||
.icon-code:before{content:"\f121";}
|
||||
.icon-reply-all:before{content:"\f122";}
|
||||
.icon-mail-reply-all:before{content:"\f122";}
|
||||
.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";}
|
||||
.icon-location-arrow:before{content:"\f124";}
|
||||
.icon-crop:before{content:"\f125";}
|
||||
.icon-code-fork:before{content:"\f126";}
|
||||
.icon-unlink:before{content:"\f127";}
|
||||
.icon-question:before{content:"\f128";}
|
||||
.icon-info:before{content:"\f129";}
|
||||
.icon-exclamation:before{content:"\f12a";}
|
||||
.icon-superscript:before{content:"\f12b";}
|
||||
.icon-subscript:before{content:"\f12c";}
|
||||
.icon-eraser:before{content:"\f12d";}
|
||||
.icon-puzzle-piece:before{content:"\f12e";}
|
||||
.icon-microphone:before{content:"\f130";}
|
||||
.icon-microphone-off:before{content:"\f131";}
|
||||
.icon-shield:before{content:"\f132";}
|
||||
.icon-calendar-empty:before{content:"\f133";}
|
||||
.icon-fire-extinguisher:before{content:"\f134";}
|
||||
.icon-rocket:before{content:"\f135";}
|
||||
.icon-maxcdn:before{content:"\f136";}
|
||||
.icon-chevron-sign-left:before{content:"\f137";}
|
||||
.icon-chevron-sign-right:before{content:"\f138";}
|
||||
.icon-chevron-sign-up:before{content:"\f139";}
|
||||
.icon-chevron-sign-down:before{content:"\f13a";}
|
||||
.icon-html5:before{content:"\f13b";}
|
||||
.icon-css3:before{content:"\f13c";}
|
||||
.icon-anchor:before{content:"\f13d";}
|
||||
.icon-unlock-alt:before{content:"\f13e";}
|
||||
.icon-bullseye:before{content:"\f140";}
|
||||
.icon-ellipsis-horizontal:before{content:"\f141";}
|
||||
.icon-ellipsis-vertical:before{content:"\f142";}
|
||||
.icon-rss-sign:before{content:"\f143";}
|
||||
.icon-play-sign:before{content:"\f144";}
|
||||
.icon-ticket:before{content:"\f145";}
|
||||
.icon-minus-sign-alt:before{content:"\f146";}
|
||||
.icon-check-minus:before{content:"\f147";}
|
||||
.icon-level-up:before{content:"\f148";}
|
||||
.icon-level-down:before{content:"\f149";}
|
||||
.icon-check-sign:before{content:"\f14a";}
|
||||
.icon-edit-sign:before{content:"\f14b";}
|
||||
.icon-external-link-sign:before{content:"\f14c";}
|
||||
.icon-share-sign:before{content:"\f14d";}
|
||||
.icon-compass:before{content:"\f14e";}
|
||||
.icon-collapse:before{content:"\f150";}
|
||||
.icon-collapse-top:before{content:"\f151";}
|
||||
.icon-expand:before{content:"\f152";}
|
||||
.icon-euro:before,.icon-eur:before{content:"\f153";}
|
||||
.icon-gbp:before{content:"\f154";}
|
||||
.icon-dollar:before,.icon-usd:before{content:"\f155";}
|
||||
.icon-rupee:before,.icon-inr:before{content:"\f156";}
|
||||
.icon-yen:before,.icon-jpy:before{content:"\f157";}
|
||||
.icon-renminbi:before,.icon-cny:before{content:"\f158";}
|
||||
.icon-won:before,.icon-krw:before{content:"\f159";}
|
||||
.icon-bitcoin:before,.icon-btc:before{content:"\f15a";}
|
||||
.icon-file:before{content:"\f15b";}
|
||||
.icon-file-text:before{content:"\f15c";}
|
||||
.icon-sort-by-alphabet:before{content:"\f15d";}
|
||||
.icon-sort-by-alphabet-alt:before{content:"\f15e";}
|
||||
.icon-sort-by-attributes:before{content:"\f160";}
|
||||
.icon-sort-by-attributes-alt:before{content:"\f161";}
|
||||
.icon-sort-by-order:before{content:"\f162";}
|
||||
.icon-sort-by-order-alt:before{content:"\f163";}
|
||||
.icon-thumbs-up:before{content:"\f164";}
|
||||
.icon-thumbs-down:before{content:"\f165";}
|
||||
.icon-youtube-sign:before{content:"\f166";}
|
||||
.icon-youtube:before{content:"\f167";}
|
||||
.icon-xing:before{content:"\f168";}
|
||||
.icon-xing-sign:before{content:"\f169";}
|
||||
.icon-youtube-play:before{content:"\f16a";}
|
||||
.icon-dropbox:before{content:"\f16b";}
|
||||
.icon-stackexchange:before{content:"\f16c";}
|
||||
.icon-instagram:before{content:"\f16d";}
|
||||
.icon-flickr:before{content:"\f16e";}
|
||||
.icon-adn:before{content:"\f170";}
|
||||
.icon-bitbucket:before{content:"\f171";}
|
||||
.icon-bitbucket-sign:before{content:"\f172";}
|
||||
.icon-tumblr:before{content:"\f173";}
|
||||
.icon-tumblr-sign:before{content:"\f174";}
|
||||
.icon-long-arrow-down:before{content:"\f175";}
|
||||
.icon-long-arrow-up:before{content:"\f176";}
|
||||
.icon-long-arrow-left:before{content:"\f177";}
|
||||
.icon-long-arrow-right:before{content:"\f178";}
|
||||
.icon-apple:before{content:"\f179";}
|
||||
.icon-windows:before{content:"\f17a";}
|
||||
.icon-android:before{content:"\f17b";}
|
||||
.icon-linux:before{content:"\f17c";}
|
||||
.icon-dribbble:before{content:"\f17d";}
|
||||
.icon-skype:before{content:"\f17e";}
|
||||
.icon-foursquare:before{content:"\f180";}
|
||||
.icon-trello:before{content:"\f181";}
|
||||
.icon-female:before{content:"\f182";}
|
||||
.icon-male:before{content:"\f183";}
|
||||
.icon-gittip:before{content:"\f184";}
|
||||
.icon-sun:before{content:"\f185";}
|
||||
.icon-moon:before{content:"\f186";}
|
||||
.icon-archive:before{content:"\f187";}
|
||||
.icon-bug:before{content:"\f188";}
|
||||
.icon-vk:before{content:"\f189";}
|
||||
.icon-weibo:before{content:"\f18a";}
|
||||
.icon-renren:before{content:"\f18b";}
|
||||
|
||||
.icon-large{font-size:1.3333333333333333em;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;vertical-align:middle;}
|
||||
.nav [class^="icon-"],.nav [class*=" icon-"]{vertical-align:inherit;margin-top:-4px;padding-top:3px;margin-bottom:-4px;padding-bottom:3px;}.nav [class^="icon-"].icon-large,.nav [class*=" icon-"].icon-large{vertical-align:-25%;}
|
||||
.nav-pills [class^="icon-"].icon-large,.nav-tabs [class^="icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large{line-height:.75em;margin-top:-7px;padding-top:5px;margin-bottom:-5px;padding-bottom:4px;}
|
||||
.btn [class^="icon-"].pull-left,.btn [class*=" icon-"].pull-left,.btn [class^="icon-"].pull-right,.btn [class*=" icon-"].pull-right{vertical-align:inherit;}
|
||||
.btn [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large{margin-top:-0.5em;}
|
||||
a [class^="icon-"],a [class*=" icon-"]{cursor:pointer;}
|
||||
.icon-glass{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-music{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-search{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-envelope-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-heart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-star{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-star-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-user{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-film{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-th-large{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-th{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-th-list{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ok{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-remove{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-zoom-in{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-zoom-out{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-power-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-signal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-cog{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-gear{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-trash{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-home{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-file-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-time{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-road{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-download-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-download{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-upload{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-inbox{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-play-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-repeat{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-rotate-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-refresh{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-list-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-lock{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-flag{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-headphones{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-volume-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-volume-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-volume-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-qrcode{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-barcode{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-tag{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-tags{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-book{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bookmark{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-print{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-camera{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-font{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bold{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-italic{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-text-height{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-text-width{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-align-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-align-center{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-align-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-align-justify{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-list{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-indent-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-indent-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-facetime-video{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-picture{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-pencil{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-map-marker{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-adjust{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-tint{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-edit{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-share{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-check{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-move{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-step-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-fast-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-backward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-play{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-pause{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-stop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-fast-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-step-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-eject{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-plus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-minus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-remove-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ok-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-question-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-info-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-screenshot{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-remove-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ok-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ban-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-share-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-mail-forward{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-resize-full{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-resize-small{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-plus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-minus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-asterisk{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-exclamation-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-gift{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-leaf{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-fire{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-eye-open{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-eye-close{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-warning-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-plane{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-calendar{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-random{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-comment{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-magnet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-retweet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-shopping-cart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-folder-close{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-folder-open{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-resize-vertical{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-resize-horizontal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bar-chart{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-twitter-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-facebook-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-camera-retro{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-key{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-cogs{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-gears{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-comments{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-thumbs-up-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-thumbs-down-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-star-half{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-heart-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-signout{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-linkedin-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-pushpin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-external-link{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-signin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-trophy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-github-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-upload-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-lemon{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-phone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-check-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-unchecked{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bookmark-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-phone-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-twitter{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-facebook{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-github{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-unlock{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-credit-card{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-rss{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-hdd{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bullhorn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bell{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-certificate{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-hand-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-hand-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-hand-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-hand-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-circle-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-circle-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-circle-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-circle-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-globe{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-wrench{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-tasks{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-filter{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-briefcase{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-fullscreen{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-group{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-link{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-cloud{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-beaker{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-cut{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-copy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-paper-clip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-paperclip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-save{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sign-blank{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-reorder{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-list-ul{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-list-ol{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-strikethrough{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-underline{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-table{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-magic{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-truck{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-pinterest{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-pinterest-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-google-plus-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-google-plus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-money{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-caret-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-caret-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-caret-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-caret-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-columns{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-envelope{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-linkedin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-undo{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-rotate-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-legal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-dashboard{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-comment-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-comments-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bolt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sitemap{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-umbrella{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-paste{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-lightbulb{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-exchange{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-cloud-download{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-cloud-upload{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-user-md{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-stethoscope{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-suitcase{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bell-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-coffee{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-food{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-file-text-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-building{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-hospital{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ambulance{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-medkit{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-fighter-jet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-beer{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-h-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-plus-sign-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-double-angle-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-double-angle-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-double-angle-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-double-angle-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-angle-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-angle-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-angle-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-angle-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-desktop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-laptop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-tablet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-mobile-phone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-circle-blank{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-quote-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-quote-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-spinner{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-circle{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-reply{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-mail-reply{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-github-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-folder-close-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-folder-open-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-expand-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-collapse-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-smile{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-frown{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-meh{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-gamepad{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-keyboard{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-flag-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-flag-checkered{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-terminal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-code{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-mail-reply-all{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-star-half-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-star-half-full{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-location-arrow{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-crop{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-code-fork{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-unlink{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-question{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-info{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-exclamation{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-superscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-subscript{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-eraser{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-puzzle-piece{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-microphone{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-microphone-off{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-shield{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-calendar-empty{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-fire-extinguisher{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-rocket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-maxcdn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-sign-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-sign-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-sign-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-chevron-sign-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-html5{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-css3{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-anchor{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-unlock-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bullseye{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ellipsis-horizontal{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ellipsis-vertical{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-rss-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-play-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-ticket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-minus-sign-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-check-minus{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-level-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-level-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-check-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-edit-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-external-link-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-share-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-compass{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-collapse{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-collapse-top{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-expand{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-eur{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-euro{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-gbp{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-usd{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-dollar{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-inr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-rupee{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-jpy{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-yen{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-cny{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-renminbi{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-krw{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-won{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-btc{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bitcoin{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-file{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-file-text{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-by-alphabet{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-by-alphabet-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-by-attributes{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-by-attributes-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-by-order{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sort-by-order-alt{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-thumbs-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-thumbs-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-youtube-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-youtube{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-xing{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-xing-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-youtube-play{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-dropbox{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-stackexchange{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-instagram{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-flickr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-adn{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bitbucket{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bitbucket-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-tumblr{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-tumblr-sign{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-long-arrow-down{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-long-arrow-up{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-long-arrow-left{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-long-arrow-right{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-apple{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-windows{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-android{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-linux{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-dribbble{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-skype{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-foursquare{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-trello{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-female{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-male{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-gittip{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-sun{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-moon{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-archive{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-bug{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-vk{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-weibo{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
.icon-renren{*zoom:expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '');}
|
||||
@@ -14,7 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="loading">
|
||||
<i class="icon-spinner icon-2x"></i>
|
||||
<i class="fas fa-spinner fa-2x"></i>
|
||||
<div>
|
||||
Loading...<br><br>
|
||||
If this takes longer than 30 seconds, it will automatically reload a maximum of 5 times.<br>
|
||||
@@ -26,31 +26,31 @@
|
||||
</div>
|
||||
<div id="userBar" style="display: none;">
|
||||
<div id="ping">
|
||||
<i class="icon-circle" id="pingDot"></i>
|
||||
<i class="fas fa-circle" id="pingDot"></i>
|
||||
<span class="ms" id="pingMs">--ms</span>
|
||||
</div>
|
||||
<div id="darkmodething">
|
||||
<a href="#" class="subCell toggle" id="changeColorPreset" title="Change color preset"><i class="icon-eye-open"></i></a>
|
||||
<a href="#" class="subCell toggle" id="changeColorPreset" title="Change color preset"><i class="fas fa-eye-open"></i></a>
|
||||
</div>
|
||||
<div id="audio">
|
||||
<a href="#" class="subCell toggle" id="toggleAudio" title="Audio"><i class="icon-volume-up"></i></a>
|
||||
<a href="#" class="subCell toggle" id="toggleAudio" title="Audio"><i class="fas fa-volume-up"></i></a>
|
||||
</div>
|
||||
<div id="options">
|
||||
<a href="#" class="subCell toggle" id="toggleOptions" title="Options"><i class="icon-cog"></i></a>
|
||||
<a href="#" class="subCell toggle" id="toggleOptions" title="Options"><i class="fas fa-cog"></i></a>
|
||||
</div>
|
||||
<div class="sub" id="subOptions">
|
||||
<a href="#" class="subCell decreaseFont topCell" id="decreaseFont"><span>Decrease font size</span> <i class="icon-font">-</i></a>
|
||||
<a href="#" class="subCell increaseFont" id="increaseFont"><span>Increase font size</span> <i class="icon-font">+</i></a>
|
||||
<a href="#" class="subCell decreaseLineHeight" id="decreaseLineHeight"><span>Decrease line height</span> <i class="icon-text-height">-</i></a>
|
||||
<a href="#" class="subCell increaseLineHeight" id="increaseLineHeight"><span>Increase line height</span> <i class="icon-text-height">+</i></a>
|
||||
<a href="#" class="subCell togglePing" id="togglePing"><span>Toggle ping display</span> <i class="icon-circle"></i></a>
|
||||
<a href="#" class="subCell highlightTerm" id="highlightTerm"><span>Highlight string</span> <i class="icon-tag"></i></a>
|
||||
<a href="#" class="subCell saveLog" id="saveLog"><span>Save chat log</span> <i class="icon-save"></i></a>
|
||||
<a href="#" class="subCell toggleCombine" id="toggleCombine"><span>Toggle line combining</span> <i class="icon-filter"></i></a>
|
||||
<a href="#" class="subCell clearMessages" id="clearMessages"><span>Clear all messages</span> <i class="icon-eraser"></i></a>
|
||||
<a href="#" class="subCell decreaseFont topCell" id="decreaseFont"><span>Decrease font size</span> <i class="fas fa-font">-</i></a>
|
||||
<a href="#" class="subCell increaseFont" id="increaseFont"><span>Increase font size</span> <i class="fas fa-font">+</i></a>
|
||||
<a href="#" class="subCell decreaseLineHeight" id="decreaseLineHeight"><span>Decrease line height</span> <i class="fas fa-text-height">-</i></a>
|
||||
<a href="#" class="subCell increaseLineHeight" id="increaseLineHeight"><span>Increase line height</span> <i class="fas fa-text-height">+</i></a>
|
||||
<a href="#" class="subCell togglePing" id="togglePing"><span>Toggle ping display</span> <i class="fas fa-circle"></i></a>
|
||||
<a href="#" class="subCell highlightTerm" id="highlightTerm"><span>Highlight string</span> <i class="fas fa-tag"></i></a>
|
||||
<a href="#" class="subCell saveLog" id="saveLog"><span>Save chat log</span> <i class="fas fa-save"></i></a>
|
||||
<a href="#" class="subCell toggleCombine" id="toggleCombine"><span>Toggle line combining</span> <i class="fas fa-filter"></i></a>
|
||||
<a href="#" class="subCell clearMessages" id="clearMessages"><span>Clear all messages</span> <i class="fas fa-eraser"></i></a>
|
||||
</div>
|
||||
<div class="sub" id="subAudio">
|
||||
<span class="subCell topCell" id="musicVolumeSpan"><input type="range" class="hidden" id="musicVolume"><span id="musicVolumeText">Admin music volume</span><i class="icon-music"></i></span>
|
||||
<span class="subCell topCell" id="musicVolumeSpan"><input type="range" class="hidden" id="musicVolume"><span id="musicVolumeText">Admin music volume</span><i class="fas fa-music"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<audio class="hidden" id="adminMusic" autoplay></audio>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/datum/language_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.language_menu_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "language_menu", "Language Menu", 700, 800, master_ui, state)
|
||||
ui = new(user, src, ui_key, "language_menu", "Language Menu", 700, 600, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/datum/language_menu/ui_data(mob/user)
|
||||
|
||||
@@ -1,157 +1,162 @@
|
||||
GLOBAL_LIST(labor_sheet_values)
|
||||
|
||||
/**********************Prisoners' Console**************************/
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console
|
||||
name = "point claim console"
|
||||
desc = "A stacking console with an electromagnetic writer, used to track ore mined by prisoners."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
var/obj/machinery/mineral/stacking_machine/laborstacker/stacking_machine = null
|
||||
var/machinedir = SOUTH
|
||||
var/obj/machinery/door/airlock/release_door
|
||||
var/door_tag = "prisonshuttle"
|
||||
var/obj/item/radio/Radio //needed to send messages to sec radio
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/Initialize()
|
||||
. = ..()
|
||||
Radio = new/obj/item/radio(src)
|
||||
Radio.listening = FALSE
|
||||
locate_stacking_machine()
|
||||
|
||||
if(!GLOB.labor_sheet_values)
|
||||
var/sheet_list = list()
|
||||
for(var/sheet_type in subtypesof(/obj/item/stack/sheet))
|
||||
var/obj/item/stack/sheet/sheet = sheet_type
|
||||
if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes
|
||||
continue
|
||||
sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value)))
|
||||
GLOB.labor_sheet_values = sortList(sheet_list, /proc/cmp_sheet_list)
|
||||
|
||||
/proc/cmp_sheet_list(list/a, list/b)
|
||||
return a["value"] - b["value"]
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "labor_claim_console", name, 450, 475, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/can_go_home = FALSE
|
||||
|
||||
data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0
|
||||
if(obj_flags & EMAGGED)
|
||||
can_go_home = TRUE
|
||||
|
||||
data["status_info"] = "No Prisoner ID detected."
|
||||
var/obj/item/card/id/I = user.get_idcard(TRUE)
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/P = I
|
||||
data["id_points"] = P.points
|
||||
if(P.points >= P.goal)
|
||||
can_go_home = TRUE
|
||||
data["status_info"] = "Goal met!"
|
||||
else
|
||||
data["status_info"] = "You are [(P.goal - P.points)] points away."
|
||||
|
||||
if(stacking_machine)
|
||||
data["unclaimed_points"] = stacking_machine.points
|
||||
|
||||
data["ores"] = GLOB.labor_sheet_values
|
||||
data["can_go_home"] = can_go_home
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("claim_points")
|
||||
var/mob/M = usr
|
||||
var/obj/item/card/id/I = M.get_idcard(TRUE)
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/P = I
|
||||
P.points += stacking_machine.points
|
||||
stacking_machine.points = 0
|
||||
to_chat(usr, "<span class='notice'>Points transferred.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>No valid id for point transfer detected.</span>")
|
||||
if("move_shuttle")
|
||||
if(!alone_in_area(get_area(src), usr))
|
||||
to_chat(usr, "<span class='warning'>Prisoners are only allowed to be released while alone.</span>")
|
||||
else
|
||||
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
|
||||
if(1)
|
||||
to_chat(usr, "<span class='notice'>Shuttle not found.</span>")
|
||||
if(2)
|
||||
to_chat(usr, "<span class='notice'>Shuttle already at station.</span>")
|
||||
if(3)
|
||||
to_chat(usr, "<span class='notice'>No permission to dock could be granted.</span>")
|
||||
else
|
||||
if(!(obj_flags & EMAGGED))
|
||||
Radio.set_frequency(FREQ_SECURITY)
|
||||
Radio.talk_into(src, "A prisoner has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
|
||||
to_chat(usr, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
|
||||
stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
|
||||
if(stacking_machine)
|
||||
stacking_machine.CONSOLE = src
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
|
||||
return TRUE
|
||||
|
||||
/**********************Prisoner Collection Unit**************************/
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker
|
||||
force_connect = TRUE
|
||||
var/points = 0 //The unclaimed value of ore stacked.
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
||||
points += inp.point_value * inp.amount
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/attackby(obj/item/I, mob/living/user)
|
||||
if(istype(I, /obj/item/stack/sheet) && user.canUnEquip(I))
|
||||
var/obj/item/stack/sheet/inp = I
|
||||
points += inp.point_value * inp.amount
|
||||
return ..()
|
||||
|
||||
/**********************Point Lookup Console**************************/
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker
|
||||
name = "points checking console"
|
||||
desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
user.examinate(src)
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/card/id))
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/prisoner_id = I
|
||||
to_chat(user, "<span class='notice'><B>ID: [prisoner_id.registered_name]</B></span>")
|
||||
to_chat(user, "<span class='notice'>Points Collected:[prisoner_id.points]</span>")
|
||||
to_chat(user, "<span class='notice'>Point Quota: [prisoner_id.goal]</span>")
|
||||
to_chat(user, "<span class='notice'>Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Error: Invalid ID</span>")
|
||||
else
|
||||
return ..()
|
||||
GLOBAL_LIST(labor_sheet_values)
|
||||
|
||||
/**********************Prisoners' Console**************************/
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console
|
||||
name = "point claim console"
|
||||
desc = "A stacking console with an electromagnetic writer, used to track ore mined by prisoners."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
var/obj/machinery/mineral/stacking_machine/laborstacker/stacking_machine = null
|
||||
var/machinedir = SOUTH
|
||||
var/obj/machinery/door/airlock/release_door
|
||||
var/door_tag = "prisonshuttle"
|
||||
var/obj/item/radio/Radio //needed to send messages to sec radio
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/Initialize()
|
||||
. = ..()
|
||||
Radio = new/obj/item/radio(src)
|
||||
Radio.listening = FALSE
|
||||
locate_stacking_machine()
|
||||
|
||||
if(!GLOB.labor_sheet_values)
|
||||
var/sheet_list = list()
|
||||
for(var/sheet_type in subtypesof(/obj/item/stack/sheet))
|
||||
var/obj/item/stack/sheet/sheet = sheet_type
|
||||
if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes
|
||||
continue
|
||||
sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value)))
|
||||
GLOB.labor_sheet_values = sortList(sheet_list, /proc/cmp_sheet_list)
|
||||
|
||||
/proc/cmp_sheet_list(list/a, list/b)
|
||||
return a["value"] - b["value"]
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "labor_claim_console", name, 315, 430, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/can_go_home = FALSE
|
||||
|
||||
data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0
|
||||
if(obj_flags & EMAGGED)
|
||||
can_go_home = TRUE
|
||||
|
||||
var/obj/item/card/id/I = user.get_idcard(TRUE)
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/P = I
|
||||
data["id_points"] = P.points
|
||||
if(P.points >= P.goal)
|
||||
can_go_home = TRUE
|
||||
data["status_info"] = "Goal met!"
|
||||
else
|
||||
data["status_info"] = "You are [(P.goal - P.points)] points away."
|
||||
else
|
||||
data["status_info"] = "No Prisoner ID detected."
|
||||
data["id_points"] = 0
|
||||
|
||||
if(stacking_machine)
|
||||
data["unclaimed_points"] = stacking_machine.points
|
||||
|
||||
data["ores"] = GLOB.labor_sheet_values
|
||||
data["can_go_home"] = can_go_home
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("claim_points")
|
||||
var/mob/M = usr
|
||||
var/obj/item/card/id/I = M.get_idcard(TRUE)
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/P = I
|
||||
P.points += stacking_machine.points
|
||||
stacking_machine.points = 0
|
||||
to_chat(usr, "<span class='notice'>Points transferred.</span>")
|
||||
. = TRUE
|
||||
else
|
||||
to_chat(usr, "<span class='alert'>No valid id for point transfer detected.</span>")
|
||||
if("move_shuttle")
|
||||
if(!alone_in_area(get_area(src), usr))
|
||||
to_chat(usr, "<span class='alert'>Prisoners are only allowed to be released while alone.</span>")
|
||||
else
|
||||
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
|
||||
if(1)
|
||||
to_chat(usr, "<span class='alert'>Shuttle not found.</span>")
|
||||
if(2)
|
||||
to_chat(usr, "<span class='alert'>Shuttle already at station.</span>")
|
||||
if(3)
|
||||
to_chat(usr, "<span class='alert'>No permission to dock could be granted.</span>")
|
||||
else
|
||||
if(!(obj_flags & EMAGGED))
|
||||
Radio.set_frequency(FREQ_SECURITY)
|
||||
Radio.talk_into(src, "A prisoner has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
|
||||
to_chat(usr, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
|
||||
stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
|
||||
if(stacking_machine)
|
||||
stacking_machine.CONSOLE = src
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(obj_flags & EMAGGED)
|
||||
return
|
||||
obj_flags |= EMAGGED
|
||||
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
|
||||
return TRUE
|
||||
|
||||
/**********************Prisoner Collection Unit**************************/
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker
|
||||
force_connect = TRUE
|
||||
var/points = 0 //The unclaimed value of ore stacked.
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
||||
points += inp.point_value * inp.amount
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/attackby(obj/item/I, mob/living/user)
|
||||
if(istype(I, /obj/item/stack/sheet) && user.canUnEquip(I))
|
||||
var/obj/item/stack/sheet/inp = I
|
||||
points += inp.point_value * inp.amount
|
||||
return ..()
|
||||
|
||||
/**********************Point Lookup Console**************************/
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker
|
||||
name = "points checking console"
|
||||
desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
user.examinate(src)
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/card/id))
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/prisoner_id = I
|
||||
to_chat(user, "<span class='notice'><B>ID: [prisoner_id.registered_name]</B></span>")
|
||||
to_chat(user, "<span class='notice'>Points Collected:[prisoner_id.points]</span>")
|
||||
to_chat(user, "<span class='notice'>Point Quota: [prisoner_id.goal]</span>")
|
||||
to_chat(user, "<span class='notice'>Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Error: Invalid ID</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -220,6 +220,7 @@
|
||||
data["disconnected"] = "mineral withdrawal is on hold"
|
||||
|
||||
data["diskDesigns"] = list()
|
||||
data["hasDisk"] = FALSE
|
||||
if(inserted_disk)
|
||||
data["hasDisk"] = TRUE
|
||||
if(inserted_disk.blueprints.len)
|
||||
|
||||
+114
-105
@@ -1,105 +1,114 @@
|
||||
/**********************Mint**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint
|
||||
name = "coin press"
|
||||
icon = 'icons/obj/economy.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = TRUE
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = FALSE
|
||||
var/chosen = MAT_METAL //which material will be used to make coins
|
||||
var/coinsToProduce = 10
|
||||
speed_process = TRUE
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50, FALSE, /obj/item/stack)
|
||||
|
||||
/obj/machinery/mineral/mint/process()
|
||||
var/turf/T = get_step(src, input_dir)
|
||||
if(!T)
|
||||
return
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
for(var/obj/item/stack/sheet/O in T)
|
||||
materials.insert_stack(O, O.amount)
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
for(var/mat_id in materials.materials)
|
||||
var/datum/material/M = materials.materials[mat_id]
|
||||
if(!M.amount && chosen != mat_id)
|
||||
continue
|
||||
dat += "<br><b>[M.name] amount:</b> [M.amount] cm<sup>3</sup> "
|
||||
if (chosen == mat_id)
|
||||
dat += "<b>Chosen</b>"
|
||||
else
|
||||
dat += "<A href='?src=[REF(src)];choose=[mat_id]'>Choose</A>"
|
||||
|
||||
var/datum/material/M = materials.materials[chosen]
|
||||
|
||||
dat += "<br><br>Will produce [coinsToProduce] [lowertext(M.name)] coins if enough materials are available.<br>"
|
||||
dat += "<A href='?src=[REF(src)];chooseAmt=-10'>-10</A> "
|
||||
dat += "<A href='?src=[REF(src)];chooseAmt=-5'>-5</A> "
|
||||
dat += "<A href='?src=[REF(src)];chooseAmt=-1'>-1</A> "
|
||||
dat += "<A href='?src=[REF(src)];chooseAmt=1'>+1</A> "
|
||||
dat += "<A href='?src=[REF(src)];chooseAmt=5'>+5</A> "
|
||||
dat += "<A href='?src=[REF(src)];chooseAmt=10'>+10</A> "
|
||||
|
||||
dat += "<br><br>In total this machine produced <font color='green'><b>[newCoins]</b></font> coins."
|
||||
dat += "<br><A href='?src=[REF(src)];makeCoins=[1]'>Make coins</A>"
|
||||
user << browse(dat, "window=mint")
|
||||
|
||||
/obj/machinery/mineral/mint/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
to_chat(usr, "<span class='notice'>The machine is processing.</span>")
|
||||
return
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
if(href_list["choose"])
|
||||
if(materials.materials[href_list["choose"]])
|
||||
chosen = href_list["choose"]
|
||||
if(href_list["chooseAmt"])
|
||||
coinsToProduce = CLAMP(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
processing = TRUE
|
||||
icon_state = "coinpress1"
|
||||
var/coin_mat = MINERAL_MATERIAL_AMOUNT * 0.2
|
||||
var/datum/material/M = materials.materials[chosen]
|
||||
if(!M || !M.coin_type)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
while(coinsToProduce > 0 && materials.use_amount_type(coin_mat, chosen))
|
||||
create_coins(M.coin_type)
|
||||
coinsToProduce--
|
||||
newCoins++
|
||||
src.updateUsrDialog()
|
||||
sleep(5)
|
||||
|
||||
icon_state = "coinpress0"
|
||||
processing = FALSE
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/mint/proc/create_coins(P)
|
||||
var/turf/T = get_step(src,output_dir)
|
||||
if(T)
|
||||
var/obj/item/O = new P(src)
|
||||
var/obj/item/storage/bag/money/M = locate(/obj/item/storage/bag/money, T)
|
||||
if(!M)
|
||||
M = new /obj/item/storage/bag/money(src)
|
||||
unload_mineral(M)
|
||||
O.forceMove(M)
|
||||
/**********************Mint**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint
|
||||
name = "coin press"
|
||||
icon = 'icons/obj/economy.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = TRUE
|
||||
input_dir = EAST
|
||||
|
||||
var/produced_coins = 0 // how many coins the machine has made in it's last cycle
|
||||
var/processing = FALSE
|
||||
var/chosen = MAT_METAL //which material will be used to make coins
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 75, FALSE, /obj/item/stack)
|
||||
|
||||
/obj/machinery/mineral/mint/process()
|
||||
var/turf/T = get_step(src, input_dir)
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
|
||||
for(var/obj/item/stack/O in T)
|
||||
var/inserted = materials.insert_item(O)
|
||||
if(inserted)
|
||||
qdel(O)
|
||||
|
||||
if(processing)
|
||||
var/datum/material/M = chosen
|
||||
|
||||
if(!M)
|
||||
processing = FALSE
|
||||
icon_state = "coinpress0"
|
||||
return
|
||||
|
||||
icon_state = "coinpress1"
|
||||
var/coin_mat = MINERAL_MATERIAL_AMOUNT
|
||||
|
||||
for(var/sheets in 1 to 2)
|
||||
if(materials.use_amount_mat(coin_mat, chosen))
|
||||
for(var/coin_to_make in 1 to 5)
|
||||
create_coins()
|
||||
produced_coins++
|
||||
else
|
||||
var/found_new = FALSE
|
||||
for(var/datum/material/inserted_material in materials.materials)
|
||||
var/amount = materials.get_material_amount(inserted_material)
|
||||
|
||||
if(amount)
|
||||
chosen = inserted_material
|
||||
found_new = TRUE
|
||||
|
||||
if(!found_new)
|
||||
processing = FALSE
|
||||
else
|
||||
icon_state = "coinpress0"
|
||||
|
||||
/obj/machinery/mineral/mint/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "mint", name, 300, 250, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/mint/ui_data()
|
||||
var/list/data = list()
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
|
||||
for(var/datum/material/inserted_material in materials.materials)
|
||||
var/amount = materials.get_material_amount(inserted_material)
|
||||
|
||||
if(!amount)
|
||||
continue
|
||||
|
||||
data["inserted_materials"] += list(list(
|
||||
"material" = inserted_material.name,
|
||||
"amount" = amount
|
||||
))
|
||||
|
||||
if(chosen == inserted_material)
|
||||
data["chosen_material"] = inserted_material.name
|
||||
|
||||
data["produced_coins"] = produced_coins
|
||||
data["processing"] = processing
|
||||
|
||||
return data;
|
||||
|
||||
/obj/machinery/mineral/mint/ui_act(action, params, datum/tgui/ui)
|
||||
switch(action)
|
||||
if ("startpress")
|
||||
if (!processing)
|
||||
produced_coins = 0
|
||||
processing = TRUE
|
||||
if ("stoppress")
|
||||
processing = FALSE
|
||||
if ("changematerial")
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
for(var/datum/material/mat in materials.materials)
|
||||
if (params["material_name"] == mat.name)
|
||||
chosen = mat
|
||||
|
||||
/obj/machinery/mineral/mint/proc/create_coins()
|
||||
var/turf/T = get_step(src,output_dir)
|
||||
var/temp_list = list()
|
||||
temp_list[chosen] = 400
|
||||
if(T)
|
||||
var/obj/item/O = new /obj/item/coin(src)
|
||||
var/obj/item/storage/bag/money/B = locate(/obj/item/storage/bag/money, T)
|
||||
O.set_custom_materials(temp_list)
|
||||
if(!B)
|
||||
B = new /obj/item/storage/bag/money(src)
|
||||
unload_mineral(B)
|
||||
O.forceMove(B)
|
||||
@@ -1,89 +1,98 @@
|
||||
|
||||
/**********************Ore box**************************/
|
||||
|
||||
/obj/structure/ore_box
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "orebox"
|
||||
name = "ore box"
|
||||
desc = "A heavy wooden box, which can be filled with a lot of ores."
|
||||
density = TRUE
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/W, mob/user, params)
|
||||
if (istype(W, /obj/item/stack/ore))
|
||||
user.transferItemToLoc(W, src)
|
||||
else if(SEND_SIGNAL(W, COMSIG_CONTAINS_STORAGE))
|
||||
SEND_SIGNAL(W, COMSIG_TRY_STORAGE_TAKE_TYPE, /obj/item/stack/ore, src)
|
||||
to_chat(user, "<span class='notice'>You empty the ore in [W] into \the [src].</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/ore_box/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(I.use_tool(src, user, 50, volume=50))
|
||||
user.visible_message("[user] pries \the [src] apart.",
|
||||
"<span class='notice'>You pry apart \the [src].</span>",
|
||||
"<span class='italics'>You hear splitting wood.</span>")
|
||||
deconstruct(TRUE, user)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/ore_box/examine(mob/living/user)
|
||||
if(Adjacent(user) && istype(user))
|
||||
show_contents(user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(Adjacent(user))
|
||||
show_contents(user)
|
||||
|
||||
/obj/structure/ore_box/attack_robot(mob/user)
|
||||
if(Adjacent(user))
|
||||
show_contents(user)
|
||||
|
||||
/obj/structure/ore_box/proc/show_contents(mob/user)
|
||||
var/dat = text("<b>The contents of the ore box reveal...</b><br>")
|
||||
var/list/assembled = list()
|
||||
for(var/obj/item/stack/ore/O in src)
|
||||
assembled[O.type] += O.amount
|
||||
for(var/type in assembled)
|
||||
var/obj/item/stack/ore/O = type
|
||||
dat += "[initial(O.name)] - [assembled[type]]<br>"
|
||||
dat += text("<br><br><A href='?src=[REF(src)];removeall=1'>Empty box</A>")
|
||||
user << browse(dat, "window=orebox")
|
||||
|
||||
/obj/structure/ore_box/proc/dump_box_contents()
|
||||
var/drop = drop_location()
|
||||
for(var/obj/item/stack/ore/O in src)
|
||||
if(QDELETED(O))
|
||||
continue
|
||||
if(QDELETED(src))
|
||||
break
|
||||
O.forceMove(drop)
|
||||
if(TICK_CHECK)
|
||||
stoplag()
|
||||
drop = drop_location()
|
||||
|
||||
/obj/structure/ore_box/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(!Adjacent(usr))
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
if(href_list["removeall"])
|
||||
dump_box_contents()
|
||||
to_chat(usr, "<span class='notice'>You open the release hatch on the box..</span>")
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user)
|
||||
var/obj/item/stack/sheet/mineral/wood/WD = new (loc, 4)
|
||||
if(user)
|
||||
WD.add_fingerprint(user)
|
||||
dump_box_contents()
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/ore_box/onTransitZ()
|
||||
return
|
||||
|
||||
/**********************Ore box**************************/
|
||||
|
||||
/obj/structure/ore_box
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "orebox"
|
||||
name = "ore box"
|
||||
desc = "A heavy wooden box, which can be filled with a lot of ores."
|
||||
density = TRUE
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
|
||||
/obj/structure/ore_box/attackby(obj/item/W, mob/user, params)
|
||||
if (istype(W, /obj/item/stack/ore))
|
||||
user.transferItemToLoc(W, src)
|
||||
else if(SEND_SIGNAL(W, COMSIG_CONTAINS_STORAGE))
|
||||
SEND_SIGNAL(W, COMSIG_TRY_STORAGE_TAKE_TYPE, /obj/item/stack/ore, src)
|
||||
to_chat(user, "<span class='notice'>You empty the ore in [W] into \the [src].</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/ore_box/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(I.use_tool(src, user, 50, volume=50))
|
||||
user.visible_message("[user] pries \the [src] apart.",
|
||||
"<span class='notice'>You pry apart \the [src].</span>",
|
||||
"<span class='italics'>You hear splitting wood.</span>")
|
||||
deconstruct(TRUE, user)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/ore_box/examine(mob/living/user)
|
||||
if(Adjacent(user) && istype(user))
|
||||
ui_interact(user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/ore_box/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(Adjacent(user))
|
||||
ui_interact(user)
|
||||
|
||||
/obj/structure/ore_box/attack_robot(mob/user)
|
||||
if(Adjacent(user))
|
||||
ui_interact(user)
|
||||
|
||||
/obj/structure/ore_box/proc/dump_box_contents()
|
||||
var/drop = drop_location()
|
||||
for(var/obj/item/stack/ore/O in src)
|
||||
if(QDELETED(O))
|
||||
continue
|
||||
if(QDELETED(src))
|
||||
break
|
||||
O.forceMove(drop)
|
||||
if(TICK_CHECK)
|
||||
stoplag()
|
||||
drop = drop_location()
|
||||
|
||||
/obj/structure/ore_box/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ore_box", name, 335, 415, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/structure/ore_box/ui_data()
|
||||
var/contents = list()
|
||||
for(var/obj/item/stack/ore/O in src)
|
||||
contents[O.type] += O.amount
|
||||
|
||||
var/data = list()
|
||||
data["materials"] = list()
|
||||
for(var/type in contents)
|
||||
var/obj/item/stack/ore/O = type
|
||||
var/name = initial(O.name)
|
||||
data["materials"] += list(list("name" = name, "amount" = contents[type], "id" = type))
|
||||
|
||||
return data
|
||||
|
||||
/obj/structure/ore_box/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
if(!Adjacent(usr))
|
||||
return
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
switch(action)
|
||||
if("removeall")
|
||||
dump_box_contents()
|
||||
to_chat(usr, "<span class='notice'>You open the release hatch on the box..</span>")
|
||||
|
||||
/obj/structure/ore_box/deconstruct(disassembled = TRUE, mob/user)
|
||||
var/obj/item/stack/sheet/mineral/wood/WD = new (loc, 4)
|
||||
if(user)
|
||||
WD.add_fingerprint(user)
|
||||
dump_box_contents()
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/ore_box/onTransitZ()
|
||||
return
|
||||
|
||||
@@ -130,10 +130,6 @@
|
||||
hacked = TRUE
|
||||
visualAppearence = CLOCKDRONE
|
||||
can_be_held = FALSE
|
||||
mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
flavortext = "<b><span class='nezbere'>You are a cogscarab,</span> a tiny building construct of Ratvar. While you're weak and can't recite scripture, \
|
||||
you have a set of quick tools, as well as a replica fabricator that can create brass and convert objects.<br><br>Work with the servants of Ratvar \
|
||||
to construct and maintain defenses at the City of Cogs. If there are no servants, use this time to experiment with base designs!"
|
||||
|
||||
/mob/living/simple_animal/drone/cogscarab/ratvar //a subtype for spawning when ratvar is alive, has a slab that it can use and a normal fabricator
|
||||
default_storage = /obj/item/storage/toolbox/brass/prefilled/ratvar
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
data["PC_batteryicon"] = "batt_20.gif"
|
||||
else
|
||||
data["PC_batteryicon"] = "batt_5.gif"
|
||||
data["PC_batterypercent"] = "[round(battery_module.battery.percent())] %"
|
||||
data["PC_batterypercent"] = "[round(battery_module.battery.percent())]%"
|
||||
data["PC_showbatteryicon"] = 1
|
||||
else
|
||||
data["PC_batteryicon"] = "batt_5.gif"
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/headers)
|
||||
assets.send(user)
|
||||
|
||||
ui = new(user, src, ui_key, "ntos_main", "NTOS Main menu", 400, 500, master_ui, state)
|
||||
ui = new(user, src, ui_key, "ntos_main", "NtOS Main menu", 400, 500, master_ui, state)
|
||||
ui.set_style("ntos")
|
||||
ui.open()
|
||||
ui.set_autoupdate(state = 1)
|
||||
|
||||
@@ -68,10 +69,10 @@
|
||||
switch(action)
|
||||
if("PC_exit")
|
||||
kill_program()
|
||||
return 1
|
||||
return TRUE
|
||||
if("PC_shutdown")
|
||||
shutdown_computer()
|
||||
return 1
|
||||
return TRUE
|
||||
if("PC_minimize")
|
||||
var/mob/user = usr
|
||||
if(!active_program || !all_components[MC_CPU])
|
||||
@@ -156,6 +157,7 @@
|
||||
comp_light_color = new_color
|
||||
light_color = new_color
|
||||
update_light()
|
||||
return TRUE
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
var/network_destination = null // Optional string that describes what NTNet server/system this program connects to. Used in default logging.
|
||||
var/available_on_ntnet = 1 // Whether the program can be downloaded from NTNet. Set to 0 to disable.
|
||||
var/available_on_syndinet = 0 // Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
|
||||
var/tgui_id // ID of TG UI interface
|
||||
var/ui_style // ID of custom TG UI style (optional)
|
||||
var/ui_x = 575 // Default size of TG UI window, in pixels
|
||||
var/tgui_id // ID of TGUI interface
|
||||
var/ui_style // ID of custom TGUI style (optional)
|
||||
var/ui_x = 575 // Default size of TGUI window, in pixels
|
||||
var/ui_y = 700
|
||||
var/ui_header = null // 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!
|
||||
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
network_destination = "power monitoring system"
|
||||
size = 9
|
||||
tgui_id = "ntos_power_monitor"
|
||||
ui_x = 1200
|
||||
ui_y = 1000
|
||||
ui_style = "ntos"
|
||||
ui_x = 550
|
||||
ui_y = 700
|
||||
|
||||
var/has_alert = 0
|
||||
var/obj/structure/cable/attached_wire
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
network_destination = "supermatter monitoring system"
|
||||
size = 5
|
||||
tgui_id = "ntos_supermatter_monitor"
|
||||
ui_style = "ntos"
|
||||
ui_x = 600
|
||||
ui_y = 400
|
||||
ui_y = 350
|
||||
var/last_status = SUPERMATTER_INACTIVE
|
||||
var/list/supermatters
|
||||
var/obj/machinery/power/supermatter_crystal/active // Currently selected supermatter crystal.
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
dev_card = 0
|
||||
|
||||
// Recalculates the price and optionally even fabricates the device.
|
||||
/obj/machinery/lapvend/proc/fabricate_and_recalc_price(fabricate = 0)
|
||||
/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
|
||||
var/obj/item/computer_hardware/battery/battery_module = null
|
||||
@@ -160,7 +160,7 @@
|
||||
if(fabricate)
|
||||
fabricated_tablet.install_component(new/obj/item/computer_hardware/card_slot)
|
||||
return total_price
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
|
||||
|
||||
@@ -168,79 +168,78 @@
|
||||
|
||||
/obj/machinery/lapvend/ui_act(action, params)
|
||||
if(..())
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("pick_device")
|
||||
if(state) // We've already picked a device type
|
||||
return 0
|
||||
return TRUE
|
||||
devtype = text2num(params["pick"])
|
||||
state = 1
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("clean_order")
|
||||
reset_order()
|
||||
return 1
|
||||
return TRUE
|
||||
if("purchase")
|
||||
try_purchase()
|
||||
return 1
|
||||
return TRUE
|
||||
if((state != 1) && devtype) // Following IFs should only be usable when in the Select Loadout mode
|
||||
return 0
|
||||
return TRUE
|
||||
switch(action)
|
||||
if("confirm_order")
|
||||
state = 2 // Wait for ID swipe for payment processing
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("hw_cpu")
|
||||
dev_cpu = text2num(params["cpu"])
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("hw_battery")
|
||||
dev_battery = text2num(params["battery"])
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("hw_disk")
|
||||
dev_disk = text2num(params["disk"])
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("hw_netcard")
|
||||
dev_netcard = text2num(params["netcard"])
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("hw_tesla")
|
||||
dev_apc_recharger = text2num(params["tesla"])
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("hw_nanoprint")
|
||||
dev_printer = text2num(params["print"])
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
if("hw_card")
|
||||
dev_card = text2num(params["card"])
|
||||
fabricate_and_recalc_price(0)
|
||||
return 1
|
||||
return 0
|
||||
fabricate_and_recalc_price(FALSE)
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/lapvend/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
if(stat & (BROKEN | NOPOWER | MAINT))
|
||||
if(ui)
|
||||
ui.close()
|
||||
return 0
|
||||
return TRUE
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "computer_fabricator", "Personal Computer Vendor", 500, 400, state = state)
|
||||
ui.open()
|
||||
ui.set_autoupdate(state = 1)
|
||||
|
||||
/obj/machinery/lapvend/attackby(obj/item/I as obj, mob/user as mob)
|
||||
/obj/machinery/lapvend/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/stack/spacecash))
|
||||
var/obj/item/stack/spacecash/c = I
|
||||
|
||||
if(!user.temporarilyRemoveItemFromInventory(c))
|
||||
return
|
||||
credits += c.value
|
||||
visible_message("<span class='info'><span class='name'>[usr]</span> inserts [c.value] credits into [src].</span>")
|
||||
visible_message("<span class='info'><span class='name'>[user]</span> inserts [c.value] credits into [src].</span>")
|
||||
qdel(c)
|
||||
return
|
||||
return ..()
|
||||
@@ -249,9 +248,9 @@
|
||||
/obj/machinery/lapvend/proc/process_payment()
|
||||
if(total_price > credits)
|
||||
say("Insufficient credits.")
|
||||
return 0
|
||||
return TRUE
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/lapvend/ui_data(mob/user)
|
||||
|
||||
@@ -287,5 +286,6 @@
|
||||
credits -= total_price
|
||||
say("Enjoy your new product!")
|
||||
state = 3
|
||||
return 1
|
||||
return 0
|
||||
addtimer(CALLBACK(src, .proc/reset_order), 100)
|
||||
return TRUE
|
||||
return TRUE
|
||||
@@ -846,7 +846,7 @@
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "apc", name, 535, 515, master_ui, state)
|
||||
ui = new(user, src, ui_key, "apc", name, 450, 460, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/apc/ui_data(mob/user)
|
||||
|
||||
@@ -1,417 +1,409 @@
|
||||
|
||||
//
|
||||
// Gravity Generator
|
||||
//
|
||||
|
||||
GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding new gravity generators to the list, and keying it with the z level.
|
||||
|
||||
#define POWER_IDLE 0
|
||||
#define POWER_UP 1
|
||||
#define POWER_DOWN 2
|
||||
|
||||
#define GRAV_NEEDS_SCREWDRIVER 0
|
||||
#define GRAV_NEEDS_WELDING 1
|
||||
#define GRAV_NEEDS_PLASTEEL 2
|
||||
#define GRAV_NEEDS_WRENCH 3
|
||||
|
||||
//
|
||||
// Abstract Generator
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator
|
||||
name = "gravitational generator"
|
||||
desc = "A device which produces a graviton field when set up."
|
||||
icon = 'icons/obj/machines/gravity_generator.dmi'
|
||||
density = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
var/sprite_number = 0
|
||||
|
||||
/obj/machinery/gravity_generator/safe_throw_at()
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/gravity_generator/ex_act(severity, target)
|
||||
if(severity == 1) // Very sturdy.
|
||||
set_broken()
|
||||
|
||||
/obj/machinery/gravity_generator/blob_act(obj/structure/blob/B)
|
||||
if(prob(20))
|
||||
set_broken()
|
||||
|
||||
/obj/machinery/gravity_generator/tesla_act(power, tesla_flags)
|
||||
..()
|
||||
if(tesla_flags & TESLA_MACHINE_EXPLOSIVE)
|
||||
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
|
||||
|
||||
/obj/machinery/gravity_generator/update_icon()
|
||||
..()
|
||||
icon_state = "[get_status()]_[sprite_number]"
|
||||
|
||||
/obj/machinery/gravity_generator/proc/get_status()
|
||||
return "off"
|
||||
|
||||
// You aren't allowed to move.
|
||||
/obj/machinery/gravity_generator/Move()
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/gravity_generator/proc/set_broken()
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/gravity_generator/proc/set_fix()
|
||||
stat &= ~BROKEN
|
||||
|
||||
/obj/machinery/gravity_generator/part/Destroy()
|
||||
if(main_part)
|
||||
qdel(main_part)
|
||||
set_broken()
|
||||
return ..()
|
||||
|
||||
//
|
||||
// Part generator which is mostly there for looks
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/part
|
||||
var/obj/machinery/gravity_generator/main/main_part = null
|
||||
|
||||
/obj/machinery/gravity_generator/part/attackby(obj/item/I, mob/user, params)
|
||||
return main_part.attackby(I, user)
|
||||
|
||||
/obj/machinery/gravity_generator/part/get_status()
|
||||
return main_part.get_status()
|
||||
|
||||
/obj/machinery/gravity_generator/part/attack_hand(mob/user)
|
||||
return main_part.attack_hand(user)
|
||||
|
||||
/obj/machinery/gravity_generator/part/set_broken()
|
||||
..()
|
||||
if(main_part && !(main_part.stat & BROKEN))
|
||||
main_part.set_broken()
|
||||
|
||||
//
|
||||
// Generator which spawns with the station.
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/main/station/Initialize()
|
||||
. = ..()
|
||||
setup_parts()
|
||||
middle.add_overlay("activated")
|
||||
update_list()
|
||||
|
||||
//
|
||||
// Generator an admin can spawn
|
||||
//
|
||||
/obj/machinery/gravity_generator/main/station/admin
|
||||
use_power = NO_POWER_USE
|
||||
|
||||
//
|
||||
// Main Generator with the main code
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/main
|
||||
icon_state = "on_8"
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 3000
|
||||
power_channel = ENVIRON
|
||||
sprite_number = 8
|
||||
use_power = IDLE_POWER_USE
|
||||
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OFFLINE
|
||||
var/on = TRUE
|
||||
var/breaker = TRUE
|
||||
var/list/parts = list()
|
||||
var/obj/middle = null
|
||||
var/charging_state = POWER_IDLE
|
||||
var/charge_count = 100
|
||||
var/current_overlay = null
|
||||
var/broken_state = 0
|
||||
var/setting = 1 //Gravity value when on
|
||||
|
||||
/obj/machinery/gravity_generator/main/Destroy() // If we somehow get deleted, remove all of our other parts.
|
||||
investigate_log("was destroyed!", INVESTIGATE_GRAVITY)
|
||||
on = FALSE
|
||||
update_list()
|
||||
for(var/obj/machinery/gravity_generator/part/O in parts)
|
||||
O.main_part = null
|
||||
if(!QDESTROYING(O))
|
||||
qdel(O)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/setup_parts()
|
||||
var/turf/our_turf = get_turf(src)
|
||||
// 9x9 block obtained from the bottom middle of the block
|
||||
var/list/spawn_turfs = block(locate(our_turf.x - 1, our_turf.y + 2, our_turf.z), locate(our_turf.x + 1, our_turf.y, our_turf.z))
|
||||
var/count = 10
|
||||
for(var/turf/T in spawn_turfs)
|
||||
count--
|
||||
if(T == our_turf) // Skip our turf.
|
||||
continue
|
||||
var/obj/machinery/gravity_generator/part/part = new(T)
|
||||
if(count == 5) // Middle
|
||||
middle = part
|
||||
if(count <= 3) // Their sprite is the top part of the generator
|
||||
part.density = FALSE
|
||||
part.layer = WALL_OBJ_LAYER
|
||||
part.sprite_number = count
|
||||
part.main_part = src
|
||||
parts += part
|
||||
part.update_icon()
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/connected_parts()
|
||||
return parts.len == 8
|
||||
|
||||
/obj/machinery/gravity_generator/main/set_broken()
|
||||
..()
|
||||
for(var/obj/machinery/gravity_generator/M in parts)
|
||||
if(!(M.stat & BROKEN))
|
||||
M.set_broken()
|
||||
middle.cut_overlays()
|
||||
charge_count = 0
|
||||
breaker = FALSE
|
||||
set_power()
|
||||
set_state(0)
|
||||
investigate_log("has broken down.", INVESTIGATE_GRAVITY)
|
||||
|
||||
/obj/machinery/gravity_generator/main/set_fix()
|
||||
..()
|
||||
for(var/obj/machinery/gravity_generator/M in parts)
|
||||
if(M.stat & BROKEN)
|
||||
M.set_fix()
|
||||
broken_state = FALSE
|
||||
update_icon()
|
||||
set_power()
|
||||
|
||||
// Interaction
|
||||
|
||||
// Fixing the gravity generator.
|
||||
/obj/machinery/gravity_generator/main/attackby(obj/item/I, mob/user, params)
|
||||
switch(broken_state)
|
||||
if(GRAV_NEEDS_SCREWDRIVER)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
to_chat(user, "<span class='notice'>You secure the screws of the framework.</span>")
|
||||
I.play_tool_sound(src)
|
||||
broken_state++
|
||||
update_icon()
|
||||
return
|
||||
if(GRAV_NEEDS_WELDING)
|
||||
if(istype(I, /obj/item/weldingtool))
|
||||
if(I.use_tool(src, user, 0, volume=50, amount=1))
|
||||
to_chat(user, "<span class='notice'>You mend the damaged framework.</span>")
|
||||
broken_state++
|
||||
update_icon()
|
||||
return
|
||||
if(GRAV_NEEDS_PLASTEEL)
|
||||
if(istype(I, /obj/item/stack/sheet/plasteel))
|
||||
var/obj/item/stack/sheet/plasteel/PS = I
|
||||
if(PS.get_amount() >= 10)
|
||||
PS.use(10)
|
||||
to_chat(user, "<span class='notice'>You add the plating to the framework.</span>")
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
|
||||
broken_state++
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need 10 sheets of plasteel!</span>")
|
||||
return
|
||||
if(GRAV_NEEDS_WRENCH)
|
||||
if(istype(I, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You secure the plating to the framework.</span>")
|
||||
I.play_tool_sound(src)
|
||||
set_fix()
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gravity_generator/main/ui_interact(mob/user)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
var/dat = "Gravity Generator Breaker: "
|
||||
if(breaker)
|
||||
dat += "<span class='linkOn'>ON</span> <A href='?src=[REF(src)];gentoggle=1'>OFF</A>"
|
||||
else
|
||||
dat += "<A href='?src=[REF(src)];gentoggle=1'>ON</A> <span class='linkOn'>OFF</span> "
|
||||
|
||||
dat += "<br>Generator Status:<br><div class='statusDisplay'>"
|
||||
if(charging_state != POWER_IDLE)
|
||||
dat += "<font class='bad'>WARNING</font> Radiation Detected. <br>[charging_state == POWER_UP ? "Charging..." : "Discharging..."]"
|
||||
else if(on)
|
||||
dat += "Powered."
|
||||
else
|
||||
dat += "Unpowered."
|
||||
|
||||
dat += "<br>Gravity Charge: [charge_count]%</div>"
|
||||
|
||||
var/datum/browser/popup = new(user, "gravgen", name)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
|
||||
/obj/machinery/gravity_generator/main/Topic(href, href_list)
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["gentoggle"])
|
||||
breaker = !breaker
|
||||
investigate_log("was toggled [breaker ? "<font color='green'>ON</font>" : "<font color='red'>OFF</font>"] by [key_name(usr)].", INVESTIGATE_GRAVITY)
|
||||
set_power()
|
||||
src.updateUsrDialog()
|
||||
|
||||
// Power and Icon States
|
||||
|
||||
/obj/machinery/gravity_generator/main/power_change()
|
||||
..()
|
||||
investigate_log("has [stat & NOPOWER ? "lost" : "regained"] power.", INVESTIGATE_GRAVITY)
|
||||
set_power()
|
||||
|
||||
/obj/machinery/gravity_generator/main/get_status()
|
||||
if(stat & BROKEN)
|
||||
return "fix[min(broken_state, 3)]"
|
||||
return on || charging_state != POWER_IDLE ? "on" : "off"
|
||||
|
||||
/obj/machinery/gravity_generator/main/update_icon()
|
||||
..()
|
||||
for(var/obj/O in parts)
|
||||
O.update_icon()
|
||||
|
||||
// Set the charging state based on power/breaker.
|
||||
/obj/machinery/gravity_generator/main/proc/set_power()
|
||||
var/new_state = FALSE
|
||||
if(stat & (NOPOWER|BROKEN) || !breaker)
|
||||
new_state = FALSE
|
||||
else if(breaker)
|
||||
new_state = TRUE
|
||||
|
||||
charging_state = new_state ? POWER_UP : POWER_DOWN // Startup sequence animation.
|
||||
investigate_log("is now [charging_state == POWER_UP ? "charging" : "discharging"].", INVESTIGATE_GRAVITY)
|
||||
update_icon()
|
||||
|
||||
// Set the state of the gravity.
|
||||
/obj/machinery/gravity_generator/main/proc/set_state(new_state)
|
||||
charging_state = POWER_IDLE
|
||||
on = new_state
|
||||
use_power = on ? ACTIVE_POWER_USE : IDLE_POWER_USE
|
||||
// Sound the alert if gravity was just enabled or disabled.
|
||||
var/alert = FALSE
|
||||
if(SSticker.IsRoundInProgress())
|
||||
if(on) // If we turned on and the game is live.
|
||||
if(gravity_in_level() == FALSE)
|
||||
alert = TRUE
|
||||
investigate_log("was brought online and is now producing gravity for this level.", INVESTIGATE_GRAVITY)
|
||||
message_admins("The gravity generator was brought online [ADMIN_VERBOSEJMP(src)]")
|
||||
else
|
||||
if(gravity_in_level() == TRUE)
|
||||
alert = TRUE
|
||||
investigate_log("was brought offline and there is now no gravity for this level.", INVESTIGATE_GRAVITY)
|
||||
message_admins("The gravity generator was brought offline with no backup generator. [ADMIN_VERBOSEJMP(src)]")
|
||||
|
||||
update_icon()
|
||||
update_list()
|
||||
src.updateUsrDialog()
|
||||
if(alert)
|
||||
shake_everyone()
|
||||
|
||||
// Charge/Discharge and turn on/off gravity when you reach 0/100 percent.
|
||||
// Also emit radiation and handle the overlays.
|
||||
/obj/machinery/gravity_generator/main/process()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(charging_state != POWER_IDLE)
|
||||
if(charging_state == POWER_UP && charge_count >= 100)
|
||||
set_state(1)
|
||||
else if(charging_state == POWER_DOWN && charge_count <= 0)
|
||||
set_state(0)
|
||||
else
|
||||
if(charging_state == POWER_UP)
|
||||
charge_count += 2
|
||||
else if(charging_state == POWER_DOWN)
|
||||
charge_count -= 2
|
||||
|
||||
if(charge_count % 4 == 0 && prob(75)) // Let them know it is charging/discharging.
|
||||
playsound(src.loc, 'sound/effects/empulse.ogg', 100, 1)
|
||||
|
||||
updateDialog()
|
||||
if(prob(25)) // To help stop "Your clothes feel warm." spam.
|
||||
pulse_radiation()
|
||||
|
||||
var/overlay_state = null
|
||||
switch(charge_count)
|
||||
if(0 to 20)
|
||||
overlay_state = null
|
||||
if(21 to 40)
|
||||
overlay_state = "startup"
|
||||
if(41 to 60)
|
||||
overlay_state = "idle"
|
||||
if(61 to 80)
|
||||
overlay_state = "activating"
|
||||
if(81 to 100)
|
||||
overlay_state = "activated"
|
||||
|
||||
if(overlay_state != current_overlay)
|
||||
if(middle)
|
||||
middle.cut_overlays()
|
||||
if(overlay_state)
|
||||
middle.add_overlay(overlay_state)
|
||||
current_overlay = overlay_state
|
||||
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/pulse_radiation()
|
||||
radiation_pulse(src, 200)
|
||||
|
||||
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
|
||||
/obj/machinery/gravity_generator/main/proc/shake_everyone()
|
||||
var/turf/T = get_turf(src)
|
||||
var/sound/alert_sound = sound('sound/effects/alert.ogg')
|
||||
for(var/i in GLOB.mob_list)
|
||||
var/mob/M = i
|
||||
if(M.z != z && !(SSmapping.level_trait(z, ZTRAITS_STATION) && SSmapping.level_trait(M.z, ZTRAITS_STATION)))
|
||||
continue
|
||||
M.update_gravity(M.mob_has_gravity())
|
||||
if(M.client)
|
||||
shake_camera(M, 15, 1)
|
||||
M.playsound_local(T, null, 100, 1, 0.5, S = alert_sound)
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return FALSE
|
||||
if(GLOB.gravity_generators["[T.z]"])
|
||||
return length(GLOB.gravity_generators["[T.z]"])
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/update_list()
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(T)
|
||||
var/list/z_list = list()
|
||||
// Multi-Z, station gravity generator generates gravity on all ZTRAIT_STATION z-levels.
|
||||
if(SSmapping.level_trait(T.z, ZTRAIT_STATION))
|
||||
for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))
|
||||
z_list += z
|
||||
else
|
||||
z_list += T.z
|
||||
for(var/z in z_list)
|
||||
if(!GLOB.gravity_generators["[z]"])
|
||||
GLOB.gravity_generators["[z]"] = list()
|
||||
if(on)
|
||||
GLOB.gravity_generators["[z]"] |= src
|
||||
else
|
||||
GLOB.gravity_generators["[z]"] -= src
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/change_setting(value)
|
||||
if(value != setting)
|
||||
setting = value
|
||||
shake_everyone()
|
||||
|
||||
// Misc
|
||||
|
||||
/obj/item/paper/guides/jobs/engi/gravity_gen
|
||||
name = "paper- 'Generate your own gravity!'"
|
||||
info = {"<h1>Gravity Generator Instructions For Dummies</h1>
|
||||
<p>Surprisingly, gravity isn't that hard to make! All you have to do is inject deadly radioactive minerals into a ball of
|
||||
energy and you have yourself gravity! You can turn the machine on or off when required but you must remember that the generator
|
||||
will EMIT RADIATION when charging or discharging, you can tell it is charging or discharging by the noise it makes, so please WEAR PROTECTIVE CLOTHING.</p>
|
||||
<br>
|
||||
<h3>It blew up!</h3>
|
||||
<p>Don't panic! The gravity generator was designed to be easily repaired. If, somehow, the sturdy framework did not survive then
|
||||
please proceed to panic; otherwise follow these steps.</p><ol>
|
||||
<li>Secure the screws of the framework with a screwdriver.</li>
|
||||
<li>Mend the damaged framework with a welding tool.</li>
|
||||
<li>Add additional plasteel plating.</li>
|
||||
<li>Secure the additional plating with a wrench.</li></ol>"}
|
||||
|
||||
//
|
||||
// Gravity Generator
|
||||
//
|
||||
|
||||
GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding new gravity generators to the list, and keying it with the z level.
|
||||
|
||||
#define POWER_IDLE 0
|
||||
#define POWER_UP 1
|
||||
#define POWER_DOWN 2
|
||||
|
||||
#define GRAV_NEEDS_SCREWDRIVER 0
|
||||
#define GRAV_NEEDS_WELDING 1
|
||||
#define GRAV_NEEDS_PLASTEEL 2
|
||||
#define GRAV_NEEDS_WRENCH 3
|
||||
|
||||
//
|
||||
// Abstract Generator
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator
|
||||
name = "gravitational generator"
|
||||
desc = "A device which produces a graviton field when set up."
|
||||
icon = 'icons/obj/machines/gravity_generator.dmi'
|
||||
density = TRUE
|
||||
use_power = NO_POWER_USE
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
var/sprite_number = 0
|
||||
|
||||
/obj/machinery/gravity_generator/safe_throw_at()
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/gravity_generator/ex_act(severity, target)
|
||||
if(severity == 1) // Very sturdy.
|
||||
set_broken()
|
||||
|
||||
/obj/machinery/gravity_generator/blob_act(obj/structure/blob/B)
|
||||
if(prob(20))
|
||||
set_broken()
|
||||
|
||||
/obj/machinery/gravity_generator/tesla_act(power, tesla_flags)
|
||||
..()
|
||||
if(tesla_flags & TESLA_MACHINE_EXPLOSIVE)
|
||||
qdel(src)//like the singulo, tesla deletes it. stops it from exploding over and over
|
||||
|
||||
/obj/machinery/gravity_generator/update_icon()
|
||||
..()
|
||||
icon_state = "[get_status()]_[sprite_number]"
|
||||
|
||||
/obj/machinery/gravity_generator/proc/get_status()
|
||||
return "off"
|
||||
|
||||
// You aren't allowed to move.
|
||||
/obj/machinery/gravity_generator/Move()
|
||||
. = ..()
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/gravity_generator/proc/set_broken()
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/gravity_generator/proc/set_fix()
|
||||
stat &= ~BROKEN
|
||||
|
||||
/obj/machinery/gravity_generator/part/Destroy()
|
||||
if(main_part)
|
||||
qdel(main_part)
|
||||
set_broken()
|
||||
return ..()
|
||||
|
||||
//
|
||||
// Part generator which is mostly there for looks
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/part
|
||||
var/obj/machinery/gravity_generator/main/main_part = null
|
||||
|
||||
/obj/machinery/gravity_generator/part/attackby(obj/item/I, mob/user, params)
|
||||
return main_part.attackby(I, user)
|
||||
|
||||
/obj/machinery/gravity_generator/part/get_status()
|
||||
return main_part.get_status()
|
||||
|
||||
/obj/machinery/gravity_generator/part/attack_hand(mob/user)
|
||||
return main_part.attack_hand(user)
|
||||
|
||||
/obj/machinery/gravity_generator/part/set_broken()
|
||||
..()
|
||||
if(main_part && !(main_part.stat & BROKEN))
|
||||
main_part.set_broken()
|
||||
|
||||
//
|
||||
// Generator which spawns with the station.
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/main/station/Initialize()
|
||||
. = ..()
|
||||
setup_parts()
|
||||
middle.add_overlay("activated")
|
||||
update_list()
|
||||
|
||||
//
|
||||
// Generator an admin can spawn
|
||||
//
|
||||
/obj/machinery/gravity_generator/main/station/admin
|
||||
use_power = NO_POWER_USE
|
||||
|
||||
//
|
||||
// Main Generator with the main code
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/main
|
||||
icon_state = "on_8"
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 3000
|
||||
power_channel = ENVIRON
|
||||
sprite_number = 8
|
||||
use_power = IDLE_POWER_USE
|
||||
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OFFLINE
|
||||
var/on = TRUE
|
||||
var/breaker = TRUE
|
||||
var/list/parts = list()
|
||||
var/obj/middle = null
|
||||
var/charging_state = POWER_IDLE
|
||||
var/charge_count = 100
|
||||
var/current_overlay = null
|
||||
var/broken_state = 0
|
||||
var/setting = 1 //Gravity value when on
|
||||
|
||||
/obj/machinery/gravity_generator/main/Destroy() // If we somehow get deleted, remove all of our other parts.
|
||||
investigate_log("was destroyed!", INVESTIGATE_GRAVITY)
|
||||
on = FALSE
|
||||
update_list()
|
||||
for(var/obj/machinery/gravity_generator/part/O in parts)
|
||||
O.main_part = null
|
||||
if(!QDESTROYING(O))
|
||||
qdel(O)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/setup_parts()
|
||||
var/turf/our_turf = get_turf(src)
|
||||
// 9x9 block obtained from the bottom middle of the block
|
||||
var/list/spawn_turfs = block(locate(our_turf.x - 1, our_turf.y + 2, our_turf.z), locate(our_turf.x + 1, our_turf.y, our_turf.z))
|
||||
var/count = 10
|
||||
for(var/turf/T in spawn_turfs)
|
||||
count--
|
||||
if(T == our_turf) // Skip our turf.
|
||||
continue
|
||||
var/obj/machinery/gravity_generator/part/part = new(T)
|
||||
if(count == 5) // Middle
|
||||
middle = part
|
||||
if(count <= 3) // Their sprite is the top part of the generator
|
||||
part.density = FALSE
|
||||
part.layer = WALL_OBJ_LAYER
|
||||
part.sprite_number = count
|
||||
part.main_part = src
|
||||
parts += part
|
||||
part.update_icon()
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/connected_parts()
|
||||
return parts.len == 8
|
||||
|
||||
/obj/machinery/gravity_generator/main/set_broken()
|
||||
..()
|
||||
for(var/obj/machinery/gravity_generator/M in parts)
|
||||
if(!(M.stat & BROKEN))
|
||||
M.set_broken()
|
||||
middle.cut_overlays()
|
||||
charge_count = 0
|
||||
breaker = FALSE
|
||||
set_power()
|
||||
set_state(0)
|
||||
investigate_log("has broken down.", INVESTIGATE_GRAVITY)
|
||||
|
||||
/obj/machinery/gravity_generator/main/set_fix()
|
||||
..()
|
||||
for(var/obj/machinery/gravity_generator/M in parts)
|
||||
if(M.stat & BROKEN)
|
||||
M.set_fix()
|
||||
broken_state = FALSE
|
||||
update_icon()
|
||||
set_power()
|
||||
|
||||
// Interaction
|
||||
|
||||
// Fixing the gravity generator.
|
||||
/obj/machinery/gravity_generator/main/attackby(obj/item/I, mob/user, params)
|
||||
switch(broken_state)
|
||||
if(GRAV_NEEDS_SCREWDRIVER)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
to_chat(user, "<span class='notice'>You secure the screws of the framework.</span>")
|
||||
I.play_tool_sound(src)
|
||||
broken_state++
|
||||
update_icon()
|
||||
return
|
||||
if(GRAV_NEEDS_WELDING)
|
||||
if(istype(I, /obj/item/weldingtool))
|
||||
if(I.use_tool(src, user, 0, volume=50, amount=1))
|
||||
to_chat(user, "<span class='notice'>You mend the damaged framework.</span>")
|
||||
broken_state++
|
||||
update_icon()
|
||||
return
|
||||
if(GRAV_NEEDS_PLASTEEL)
|
||||
if(istype(I, /obj/item/stack/sheet/plasteel))
|
||||
var/obj/item/stack/sheet/plasteel/PS = I
|
||||
if(PS.get_amount() >= 10)
|
||||
PS.use(10)
|
||||
to_chat(user, "<span class='notice'>You add the plating to the framework.</span>")
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
|
||||
broken_state++
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need 10 sheets of plasteel!</span>")
|
||||
return
|
||||
if(GRAV_NEEDS_WRENCH)
|
||||
if(istype(I, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You secure the plating to the framework.</span>")
|
||||
I.play_tool_sound(src)
|
||||
set_fix()
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/gravity_generator/main/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "gravity_generator", name, 400, 200, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/gravity_generator/main/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["breaker"] = breaker
|
||||
data["charge_count"] = charge_count
|
||||
data["charging_state"] = charging_state
|
||||
data["on"] = on
|
||||
data["operational"] = (stat & BROKEN) ? FALSE : TRUE
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/gravity_generator/main/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("gentoggle")
|
||||
breaker = !breaker
|
||||
investigate_log("was toggled [breaker ? "<font color='green'>ON</font>" : "<font color='red'>OFF</font>"] by [key_name(usr)].", INVESTIGATE_GRAVITY)
|
||||
set_power()
|
||||
|
||||
// Power and Icon States
|
||||
|
||||
/obj/machinery/gravity_generator/main/power_change()
|
||||
..()
|
||||
investigate_log("has [stat & NOPOWER ? "lost" : "regained"] power.", INVESTIGATE_GRAVITY)
|
||||
set_power()
|
||||
|
||||
/obj/machinery/gravity_generator/main/get_status()
|
||||
if(stat & BROKEN)
|
||||
return "fix[min(broken_state, 3)]"
|
||||
return on || charging_state != POWER_IDLE ? "on" : "off"
|
||||
|
||||
/obj/machinery/gravity_generator/main/update_icon()
|
||||
..()
|
||||
for(var/obj/O in parts)
|
||||
O.update_icon()
|
||||
|
||||
// Set the charging state based on power/breaker.
|
||||
/obj/machinery/gravity_generator/main/proc/set_power()
|
||||
var/new_state = FALSE
|
||||
if(stat & (NOPOWER|BROKEN) || !breaker)
|
||||
new_state = FALSE
|
||||
else if(breaker)
|
||||
new_state = TRUE
|
||||
|
||||
charging_state = new_state ? POWER_UP : POWER_DOWN // Startup sequence animation.
|
||||
investigate_log("is now [charging_state == POWER_UP ? "charging" : "discharging"].", INVESTIGATE_GRAVITY)
|
||||
update_icon()
|
||||
|
||||
// Set the state of the gravity.
|
||||
/obj/machinery/gravity_generator/main/proc/set_state(new_state)
|
||||
charging_state = POWER_IDLE
|
||||
on = new_state
|
||||
use_power = on ? ACTIVE_POWER_USE : IDLE_POWER_USE
|
||||
// Sound the alert if gravity was just enabled or disabled.
|
||||
var/alert = FALSE
|
||||
if(SSticker.IsRoundInProgress())
|
||||
if(on) // If we turned on and the game is live.
|
||||
if(gravity_in_level() == FALSE)
|
||||
alert = TRUE
|
||||
investigate_log("was brought online and is now producing gravity for this level.", INVESTIGATE_GRAVITY)
|
||||
message_admins("The gravity generator was brought online [ADMIN_VERBOSEJMP(src)]")
|
||||
else
|
||||
if(gravity_in_level() == TRUE)
|
||||
alert = TRUE
|
||||
investigate_log("was brought offline and there is now no gravity for this level.", INVESTIGATE_GRAVITY)
|
||||
message_admins("The gravity generator was brought offline with no backup generator. [ADMIN_VERBOSEJMP(src)]")
|
||||
|
||||
update_icon()
|
||||
update_list()
|
||||
src.updateUsrDialog()
|
||||
if(alert)
|
||||
shake_everyone()
|
||||
|
||||
// Charge/Discharge and turn on/off gravity when you reach 0/100 percent.
|
||||
// Also emit radiation and handle the overlays.
|
||||
/obj/machinery/gravity_generator/main/process()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(charging_state != POWER_IDLE)
|
||||
if(charging_state == POWER_UP && charge_count >= 100)
|
||||
set_state(1)
|
||||
else if(charging_state == POWER_DOWN && charge_count <= 0)
|
||||
set_state(0)
|
||||
else
|
||||
if(charging_state == POWER_UP)
|
||||
charge_count += 2
|
||||
else if(charging_state == POWER_DOWN)
|
||||
charge_count -= 2
|
||||
|
||||
if(charge_count % 4 == 0 && prob(75)) // Let them know it is charging/discharging.
|
||||
playsound(src.loc, 'sound/effects/empulse.ogg', 100, 1)
|
||||
|
||||
updateDialog()
|
||||
if(prob(25)) // To help stop "Your clothes feel warm." spam.
|
||||
pulse_radiation()
|
||||
|
||||
var/overlay_state = null
|
||||
switch(charge_count)
|
||||
if(0 to 20)
|
||||
overlay_state = null
|
||||
if(21 to 40)
|
||||
overlay_state = "startup"
|
||||
if(41 to 60)
|
||||
overlay_state = "idle"
|
||||
if(61 to 80)
|
||||
overlay_state = "activating"
|
||||
if(81 to 100)
|
||||
overlay_state = "activated"
|
||||
|
||||
if(overlay_state != current_overlay)
|
||||
if(middle)
|
||||
middle.cut_overlays()
|
||||
if(overlay_state)
|
||||
middle.add_overlay(overlay_state)
|
||||
current_overlay = overlay_state
|
||||
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/pulse_radiation()
|
||||
radiation_pulse(src, 200)
|
||||
|
||||
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
|
||||
/obj/machinery/gravity_generator/main/proc/shake_everyone()
|
||||
var/turf/T = get_turf(src)
|
||||
var/sound/alert_sound = sound('sound/effects/alert.ogg')
|
||||
for(var/i in GLOB.mob_list)
|
||||
var/mob/M = i
|
||||
if(M.z != z && !(SSmapping.level_trait(z, ZTRAITS_STATION) && SSmapping.level_trait(M.z, ZTRAITS_STATION)))
|
||||
continue
|
||||
M.update_gravity(M.mob_has_gravity())
|
||||
if(M.client)
|
||||
shake_camera(M, 15, 1)
|
||||
M.playsound_local(T, null, 100, 1, 0.5, S = alert_sound)
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return FALSE
|
||||
if(GLOB.gravity_generators["[T.z]"])
|
||||
return length(GLOB.gravity_generators["[T.z]"])
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/update_list()
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(T)
|
||||
var/list/z_list = list()
|
||||
// Multi-Z, station gravity generator generates gravity on all ZTRAIT_STATION z-levels.
|
||||
if(SSmapping.level_trait(T.z, ZTRAIT_STATION))
|
||||
for(var/z in SSmapping.levels_by_trait(ZTRAIT_STATION))
|
||||
z_list += z
|
||||
else
|
||||
z_list += T.z
|
||||
for(var/z in z_list)
|
||||
if(!GLOB.gravity_generators["[z]"])
|
||||
GLOB.gravity_generators["[z]"] = list()
|
||||
if(on)
|
||||
GLOB.gravity_generators["[z]"] |= src
|
||||
else
|
||||
GLOB.gravity_generators["[z]"] -= src
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/change_setting(value)
|
||||
if(value != setting)
|
||||
setting = value
|
||||
shake_everyone()
|
||||
|
||||
// Misc
|
||||
|
||||
/obj/item/paper/guides/jobs/engi/gravity_gen
|
||||
name = "paper- 'Generate your own gravity!'"
|
||||
info = {"<h1>Gravity Generator Instructions For Dummies</h1>
|
||||
<p>Surprisingly, gravity isn't that hard to make! All you have to do is inject deadly radioactive minerals into a ball of
|
||||
energy and you have yourself gravity! You can turn the machine on or off when required but you must remember that the generator
|
||||
will EMIT RADIATION when charging or discharging, you can tell it is charging or discharging by the noise it makes, so please WEAR PROTECTIVE CLOTHING.</p>
|
||||
<br>
|
||||
<h3>It blew up!</h3>
|
||||
<p>Don't panic! The gravity generator was designed to be easily repaired. If, somehow, the sturdy framework did not survive then
|
||||
please proceed to panic; otherwise follow these steps.</p><ol>
|
||||
<li>Secure the screws of the framework with a screwdriver.</li>
|
||||
<li>Mend the damaged framework with a welding tool.</li>
|
||||
<li>Add additional plasteel plating.</li>
|
||||
<li>Secure the additional plating with a wrench.</li></ol>"}
|
||||
|
||||
+123
-121
@@ -1,121 +1,123 @@
|
||||
//modular computer program version is located in code\modules\modular_computers\file_system\programs\powermonitor.dm, /datum/computer_file/program/power_monitor
|
||||
|
||||
/obj/machinery/computer/monitor
|
||||
name = "power monitoring console"
|
||||
desc = "It monitors power levels across the station."
|
||||
icon_screen = "power"
|
||||
icon_keyboard = "power_key"
|
||||
light_color = LIGHT_COLOR_YELLOW
|
||||
use_power = ACTIVE_POWER_USE
|
||||
idle_power_usage = 20
|
||||
active_power_usage = 100
|
||||
circuit = /obj/item/circuitboard/computer/powermonitor
|
||||
|
||||
var/obj/structure/cable/attached_wire
|
||||
var/obj/machinery/power/apc/local_apc
|
||||
|
||||
var/list/history = list()
|
||||
var/record_size = 60
|
||||
var/record_interval = 50
|
||||
var/next_record = 0
|
||||
var/is_secret_monitor = FALSE
|
||||
|
||||
/obj/machinery/computer/monitor/secret //Hides the power monitor (such as ones on ruins & CentCom) from PDA's to prevent metagaming.
|
||||
name = "outdated power monitoring console"
|
||||
desc = "It monitors power levels across the local powernet."
|
||||
circuit = /obj/item/circuitboard/computer/powermonitor/secret
|
||||
is_secret_monitor = TRUE
|
||||
|
||||
/obj/machinery/computer/monitor/secret/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>It's operating system seems quite outdated... It doesn't seem like it'd be compatible with the latest remote NTOS monitoring systems.</span>"
|
||||
|
||||
/obj/machinery/computer/monitor/Initialize()
|
||||
. = ..()
|
||||
search()
|
||||
history["supply"] = list()
|
||||
history["demand"] = list()
|
||||
|
||||
/obj/machinery/computer/monitor/process()
|
||||
if(!get_powernet())
|
||||
use_power = IDLE_POWER_USE
|
||||
search()
|
||||
else
|
||||
use_power = ACTIVE_POWER_USE
|
||||
record()
|
||||
|
||||
/obj/machinery/computer/monitor/proc/search() //keep in sync with /datum/computer_file/program/power_monitor's version
|
||||
var/turf/T = get_turf(src)
|
||||
attached_wire = locate(/obj/structure/cable) in T
|
||||
if(attached_wire)
|
||||
return
|
||||
var/area/A = get_area(src) //if the computer isn't directly connected to a wire, attempt to find the APC powering it to pull it's powernet instead
|
||||
if(!A)
|
||||
return
|
||||
local_apc = A.get_apc()
|
||||
if(!local_apc)
|
||||
return
|
||||
if(!local_apc.terminal) //this really shouldn't happen without badminnery.
|
||||
local_apc = null
|
||||
|
||||
/obj/machinery/computer/monitor/proc/get_powernet() //keep in sync with /datum/computer_file/program/power_monitor's version
|
||||
if(attached_wire || (local_apc && local_apc.terminal))
|
||||
return attached_wire ? attached_wire.powernet : local_apc.terminal.powernet
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/computer/monitor/proc/record() //keep in sync with /datum/computer_file/program/power_monitor's version
|
||||
if(world.time >= next_record)
|
||||
next_record = world.time + record_interval
|
||||
|
||||
var/datum/powernet/connected_powernet = get_powernet()
|
||||
|
||||
var/list/supply = history["supply"]
|
||||
if(connected_powernet)
|
||||
supply += connected_powernet.viewavail
|
||||
if(supply.len > record_size)
|
||||
supply.Cut(1, 2)
|
||||
|
||||
var/list/demand = history["demand"]
|
||||
if(connected_powernet)
|
||||
demand += connected_powernet.viewload
|
||||
if(demand.len > record_size)
|
||||
demand.Cut(1, 2)
|
||||
|
||||
/obj/machinery/computer/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "power_monitor", name, 1200, 1000, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/monitor/ui_data()
|
||||
var/datum/powernet/connected_powernet = get_powernet()
|
||||
var/list/data = list()
|
||||
data["stored"] = record_size
|
||||
data["interval"] = record_interval / 10
|
||||
data["attached"] = connected_powernet ? TRUE : FALSE
|
||||
data["history"] = history
|
||||
data["areas"] = list()
|
||||
|
||||
if(connected_powernet)
|
||||
data["supply"] = DisplayPower(connected_powernet.viewavail)
|
||||
data["demand"] = DisplayPower(connected_powernet.viewload)
|
||||
for(var/obj/machinery/power/terminal/term in connected_powernet.nodes)
|
||||
var/obj/machinery/power/apc/A = term.master
|
||||
if(istype(A))
|
||||
var/cell_charge
|
||||
if(!A.cell)
|
||||
cell_charge = 0
|
||||
else
|
||||
cell_charge = A.cell.percent()
|
||||
data["areas"] += list(list(
|
||||
"name" = A.area.name,
|
||||
"charge" = cell_charge,
|
||||
"load" = DisplayPower(A.lastused_total),
|
||||
"charging" = A.charging,
|
||||
"eqp" = A.equipment,
|
||||
"lgt" = A.lighting,
|
||||
"env" = A.environ
|
||||
))
|
||||
|
||||
return data
|
||||
//modular computer program version is located in code\modules\modular_computers\file_system\programs\powermonitor.dm, /datum/computer_file/program/power_monitor
|
||||
|
||||
/obj/machinery/computer/monitor
|
||||
name = "power monitoring console"
|
||||
desc = "It monitors power levels across the station."
|
||||
icon_screen = "power"
|
||||
icon_keyboard = "power_key"
|
||||
light_color = LIGHT_COLOR_YELLOW
|
||||
use_power = ACTIVE_POWER_USE
|
||||
idle_power_usage = 20
|
||||
active_power_usage = 100
|
||||
circuit = /obj/item/circuitboard/computer/powermonitor
|
||||
|
||||
var/obj/structure/cable/attached_wire
|
||||
var/obj/machinery/power/apc/local_apc
|
||||
|
||||
var/list/history = list()
|
||||
var/record_size = 60
|
||||
var/record_interval = 50
|
||||
var/next_record = 0
|
||||
var/is_secret_monitor = FALSE
|
||||
tgui_id = "power_monitor"
|
||||
ui_style = "ntos"
|
||||
|
||||
/obj/machinery/computer/monitor/secret //Hides the power monitor (such as ones on ruins & CentCom) from PDA's to prevent metagaming.
|
||||
name = "outdated power monitoring console"
|
||||
desc = "It monitors power levels across the local powernet."
|
||||
circuit = /obj/item/circuitboard/computer/powermonitor/secret
|
||||
is_secret_monitor = TRUE
|
||||
|
||||
/obj/machinery/computer/monitor/secret/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>It's operating system seems quite outdated... It doesn't seem like it'd be compatible with the latest remote NTOS monitoring systems.</span>"
|
||||
|
||||
/obj/machinery/computer/monitor/Initialize()
|
||||
. = ..()
|
||||
search()
|
||||
history["supply"] = list()
|
||||
history["demand"] = list()
|
||||
|
||||
/obj/machinery/computer/monitor/process()
|
||||
if(!get_powernet())
|
||||
use_power = IDLE_POWER_USE
|
||||
search()
|
||||
else
|
||||
use_power = ACTIVE_POWER_USE
|
||||
record()
|
||||
|
||||
/obj/machinery/computer/monitor/proc/search() //keep in sync with /datum/computer_file/program/power_monitor's version
|
||||
var/turf/T = get_turf(src)
|
||||
attached_wire = locate(/obj/structure/cable) in T
|
||||
if(attached_wire)
|
||||
return
|
||||
var/area/A = get_area(src) //if the computer isn't directly connected to a wire, attempt to find the APC powering it to pull it's powernet instead
|
||||
if(!A)
|
||||
return
|
||||
local_apc = A.get_apc()
|
||||
if(!local_apc)
|
||||
return
|
||||
if(!local_apc.terminal) //this really shouldn't happen without badminnery.
|
||||
local_apc = null
|
||||
|
||||
/obj/machinery/computer/monitor/proc/get_powernet() //keep in sync with /datum/computer_file/program/power_monitor's version
|
||||
if(attached_wire || (local_apc && local_apc.terminal))
|
||||
return attached_wire ? attached_wire.powernet : local_apc.terminal.powernet
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/computer/monitor/proc/record() //keep in sync with /datum/computer_file/program/power_monitor's version
|
||||
if(world.time >= next_record)
|
||||
next_record = world.time + record_interval
|
||||
|
||||
var/datum/powernet/connected_powernet = get_powernet()
|
||||
|
||||
var/list/supply = history["supply"]
|
||||
if(connected_powernet)
|
||||
supply += connected_powernet.viewavail
|
||||
if(supply.len > record_size)
|
||||
supply.Cut(1, 2)
|
||||
|
||||
var/list/demand = history["demand"]
|
||||
if(connected_powernet)
|
||||
demand += connected_powernet.viewload
|
||||
if(demand.len > record_size)
|
||||
demand.Cut(1, 2)
|
||||
|
||||
/obj/machinery/computer/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, tgui_id, name, 550, 700, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/monitor/ui_data()
|
||||
var/datum/powernet/connected_powernet = get_powernet()
|
||||
var/list/data = list()
|
||||
data["stored"] = record_size
|
||||
data["interval"] = record_interval / 10
|
||||
data["attached"] = connected_powernet ? TRUE : FALSE
|
||||
data["history"] = history
|
||||
data["areas"] = list()
|
||||
|
||||
if(connected_powernet)
|
||||
data["supply"] = DisplayPower(connected_powernet.viewavail)
|
||||
data["demand"] = DisplayPower(connected_powernet.viewload)
|
||||
for(var/obj/machinery/power/terminal/term in connected_powernet.nodes)
|
||||
var/obj/machinery/power/apc/A = term.master
|
||||
if(istype(A))
|
||||
var/cell_charge
|
||||
if(!A.cell)
|
||||
cell_charge = 0
|
||||
else
|
||||
cell_charge = A.cell.percent()
|
||||
data["areas"] += list(list(
|
||||
"name" = A.area.name,
|
||||
"charge" = cell_charge,
|
||||
"load" = DisplayPower(A.lastused_total),
|
||||
"charging" = A.charging,
|
||||
"eqp" = A.equipment,
|
||||
"lgt" = A.lighting,
|
||||
"env" = A.environ
|
||||
))
|
||||
|
||||
return data
|
||||
|
||||
+41
-33
@@ -342,7 +342,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "solar_control", name, 500, 400, master_ui, state)
|
||||
ui = new(user, src, ui_key, "solar_control", name, 380, 230, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/power/solar_control/ui_data()
|
||||
@@ -363,39 +363,47 @@
|
||||
/obj/machinery/power/solar_control/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("angle")
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(adjust)
|
||||
currentdir = CLAMP((360 + adjust + currentdir) % 360, 0, 359)
|
||||
targetdir = currentdir
|
||||
set_panels(currentdir)
|
||||
. = TRUE
|
||||
if("rate")
|
||||
var/adjust = text2num(params["adjust"])
|
||||
if(adjust)
|
||||
trackrate = CLAMP(trackrate + adjust, -7200, 7200)
|
||||
if(trackrate)
|
||||
nexttime = world.time + 36000 / abs(trackrate)
|
||||
. = TRUE
|
||||
if("tracking")
|
||||
var/mode = text2num(params["mode"])
|
||||
track = mode
|
||||
if(mode == 2 && connected_tracker)
|
||||
connected_tracker.set_angle(SSsun.angle)
|
||||
set_panels(currentdir)
|
||||
else if(mode == 1)
|
||||
targetdir = currentdir
|
||||
if(trackrate)
|
||||
nexttime = world.time + 36000 / abs(trackrate)
|
||||
set_panels(targetdir)
|
||||
. = TRUE
|
||||
if("refresh")
|
||||
search_for_connected()
|
||||
if(connected_tracker && track == 2)
|
||||
connected_tracker.set_angle(SSsun.angle)
|
||||
if(action == "angle")
|
||||
var/adjust = text2num(params["adjust"])
|
||||
var/value = text2num(params["value"])
|
||||
if(adjust)
|
||||
value = currentdir + adjust
|
||||
if(value != null)
|
||||
currentdir = CLAMP((360 + value) % 360, 0, 359)
|
||||
targetdir = currentdir
|
||||
set_panels(currentdir)
|
||||
. = TRUE
|
||||
return TRUE
|
||||
return FALSE
|
||||
if(action == "rate")
|
||||
var/adjust = text2num(params["adjust"])
|
||||
var/value = text2num(params["value"])
|
||||
if(adjust)
|
||||
value = trackrate + adjust
|
||||
if(value != null)
|
||||
trackrate = CLAMP(value, -7200, 7200)
|
||||
if(trackrate)
|
||||
nexttime = world.time + 36000 / abs(trackrate)
|
||||
return TRUE
|
||||
return FALSE
|
||||
if(action == "tracking")
|
||||
var/mode = text2num(params["mode"])
|
||||
track = mode
|
||||
if(mode == 2 && connected_tracker)
|
||||
connected_tracker.set_angle(SSsun.angle)
|
||||
set_panels(currentdir)
|
||||
else if(mode == 1)
|
||||
targetdir = currentdir
|
||||
if(trackrate)
|
||||
nexttime = world.time + 36000 / abs(trackrate)
|
||||
set_panels(targetdir)
|
||||
return TRUE
|
||||
if(action == "refresh")
|
||||
search_for_connected()
|
||||
if(connected_tracker && track == 2)
|
||||
connected_tracker.set_angle(SSsun.angle)
|
||||
set_panels(currentdir)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/power/solar_control/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/screwdriver))
|
||||
|
||||
@@ -57,15 +57,6 @@
|
||||
var/lastgen
|
||||
var/productivity = 1
|
||||
|
||||
/obj/machinery/computer/turbine_computer
|
||||
name = "gas turbine control computer"
|
||||
desc = "A computer to remotely control a gas turbine."
|
||||
icon_screen = "turbinecomp"
|
||||
icon_keyboard = "tech_key"
|
||||
circuit = /obj/item/circuitboard/computer/turbine_computer
|
||||
var/obj/machinery/power/compressor/compressor
|
||||
var/id = 0
|
||||
|
||||
// the inlet stage of the gas turbine electricity generator
|
||||
|
||||
/obj/machinery/power/compressor/Initialize()
|
||||
@@ -113,12 +104,13 @@
|
||||
default_deconstruction_crowbar(I)
|
||||
|
||||
/obj/machinery/power/compressor/process()
|
||||
if(!turbine)
|
||||
stat = BROKEN
|
||||
if(stat & BROKEN || panel_open)
|
||||
return
|
||||
if(!starter)
|
||||
return
|
||||
if(!turbine || (turbine.stat & BROKEN))
|
||||
starter = FALSE
|
||||
if(stat & BROKEN || panel_open)
|
||||
starter = FALSE
|
||||
return
|
||||
cut_overlays()
|
||||
|
||||
rpm = 0.9* rpm + 0.1 * rpmtarget
|
||||
@@ -288,7 +280,14 @@
|
||||
|
||||
// COMPUTER NEEDS A SERIOUS REWRITE.
|
||||
|
||||
|
||||
/obj/machinery/computer/turbine_computer
|
||||
name = "gas turbine control computer"
|
||||
desc = "A computer to remotely control a gas turbine."
|
||||
icon_screen = "turbinecomp"
|
||||
icon_keyboard = "tech_key"
|
||||
circuit = /obj/item/circuitboard/computer/turbine_computer
|
||||
var/obj/machinery/power/compressor/compressor
|
||||
var/id = 0
|
||||
|
||||
/obj/machinery/computer/turbine_computer/Initialize()
|
||||
. = ..()
|
||||
@@ -304,27 +303,27 @@
|
||||
compressor = C
|
||||
return
|
||||
else
|
||||
compressor = locate(/obj/machinery/power/compressor) in range(5, src)
|
||||
compressor = locate(/obj/machinery/power/compressor) in range(7, src)
|
||||
|
||||
/obj/machinery/computer/turbine_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "turbine_computer", name, 350, 280, master_ui, state)
|
||||
ui = new(user, src, ui_key, "turbine_computer", name, 300, 200, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/turbine_computer/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["connected"] = (compressor && compressor.turbine) ? TRUE : FALSE
|
||||
data["compressor"] = compressor ? TRUE : FALSE
|
||||
data["compressor_broke"] = (!compressor || (compressor.stat & BROKEN)) ? TRUE : FALSE
|
||||
data["turbine"] = compressor?.turbine ? TRUE : FALSE
|
||||
data["turbine_broke"] = (!compressor || !compressor.turbine || (compressor.turbine.stat & BROKEN)) ? TRUE : FALSE
|
||||
data["broken"] = (data["compressor_broke"] || data["turbine_broke"])
|
||||
data["online"] = compressor.starter
|
||||
data["online"] = compressor?.starter
|
||||
|
||||
data["power"] = DisplayPower(compressor.turbine.lastgen)
|
||||
data["rpm"] = compressor.rpm
|
||||
data["temp"] = compressor.gas_contained.temperature
|
||||
data["power"] = DisplayPower(compressor?.turbine?.lastgen)
|
||||
data["rpm"] = compressor?.rpm
|
||||
data["temp"] = compressor?.gas_contained.temperature
|
||||
|
||||
return data
|
||||
|
||||
@@ -332,13 +331,9 @@
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("power-on")
|
||||
if("toggle_power")
|
||||
if(compressor && compressor.turbine)
|
||||
compressor.starter = TRUE
|
||||
. = TRUE
|
||||
if("power-off")
|
||||
if(compressor && compressor.turbine)
|
||||
compressor.starter = FALSE
|
||||
compressor.starter = !compressor.starter
|
||||
. = TRUE
|
||||
if("reconnect")
|
||||
locate_machinery()
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "chem_dispenser", name, 565, 550, master_ui, state)
|
||||
ui = new(user, src, ui_key, "chem_dispenser", name, 565, 620, master_ui, state)
|
||||
if(user.hallucinating())
|
||||
ui.set_autoupdate(FALSE) //to not ruin the immersion by constantly changing the fake chemicals
|
||||
ui.open()
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "chem_heater", name, 275, 400, master_ui, state)
|
||||
ui = new(user, src, ui_key, "chem_heater", name, 275, 320, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/chem_heater/ui_data()
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
//Calculate the span tags and ids fo all the available pill icons
|
||||
var/datum/asset/spritesheet/simple/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
|
||||
pillStyles = list()
|
||||
for (var/x in 1 to PILL_STYLE_COUNT)
|
||||
for(var/x in 1 to PILL_STYLE_COUNT)
|
||||
var/list/SL = list()
|
||||
SL["id"] = x
|
||||
SL["htmltag"] = assets.icon_tag("pill[x]")
|
||||
SL["className"] = assets.icon_class_name("pill[x]")
|
||||
pillStyles += list(SL)
|
||||
|
||||
. = ..()
|
||||
@@ -158,7 +158,7 @@
|
||||
if(!ui)
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/simple/pills)
|
||||
assets.send(user)
|
||||
ui = new(user, src, ui_key, "chem_master", name, 500, 550, master_ui, state)
|
||||
ui = new(user, src, ui_key, "chem_master", name, 465, 550, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
//Insert our custom spritesheet css link into the html
|
||||
@@ -180,8 +180,8 @@
|
||||
data["isPillBottleLoaded"] = bottle ? 1 : 0
|
||||
if(bottle)
|
||||
var/datum/component/storage/STRB = bottle.GetComponent(/datum/component/storage)
|
||||
data["pillBotContent"] = bottle.contents.len
|
||||
data["pillBotMaxContent"] = STRB.max_items
|
||||
data["pillBottleCurrentAmount"] = bottle.contents.len
|
||||
data["pillBottleMaxAmount"] = STRB.max_items
|
||||
|
||||
var/beakerContents[0]
|
||||
if(beaker)
|
||||
@@ -480,7 +480,248 @@
|
||||
screen = params["screen"]
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/chem_master/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(action == "eject")
|
||||
replace_beaker(usr)
|
||||
return TRUE
|
||||
|
||||
if(action == "ejectPillBottle")
|
||||
if(!bottle)
|
||||
return FALSE
|
||||
bottle.forceMove(drop_location())
|
||||
adjust_item_drop_location(bottle)
|
||||
bottle = null
|
||||
return TRUE
|
||||
|
||||
if(action == "transfer")
|
||||
if(!beaker)
|
||||
return FALSE
|
||||
var/reagent = GLOB.name2reagent[params["id"]]
|
||||
var/amount = text2num(params["amount"])
|
||||
var/to_container = params["to"]
|
||||
// Custom amount
|
||||
if (amount == -1)
|
||||
amount = text2num(input(
|
||||
"Enter the amount you want to transfer:",
|
||||
name, ""))
|
||||
if (amount == null || amount <= 0)
|
||||
return FALSE
|
||||
if (to_container == "buffer")
|
||||
beaker.reagents.trans_id_to(src, reagent, amount)
|
||||
return TRUE
|
||||
if (to_container == "beaker" && mode)
|
||||
reagents.trans_id_to(beaker, reagent, amount)
|
||||
return TRUE
|
||||
if (to_container == "beaker" && !mode)
|
||||
reagents.remove_reagent(reagent, amount)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
if(action == "toggleMode")
|
||||
mode = !mode
|
||||
return TRUE
|
||||
|
||||
if(action == "createVial")
|
||||
var/many = params["many"]
|
||||
if(reagents.total_volume == 0)
|
||||
return
|
||||
|
||||
var/amount_full = 0
|
||||
var/vol_part = min(reagents.total_volume, 60)
|
||||
if(text2num(many))
|
||||
amount_full = round(reagents.total_volume / 60)
|
||||
vol_part = reagents.total_volume % 60
|
||||
var/name = stripped_input(usr, "Name:","Name your hypovial!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
|
||||
return
|
||||
|
||||
var/obj/item/reagent_containers/glass/bottle/vial/small/P
|
||||
for(var/i = 0; i < amount_full; i++)
|
||||
P = new/obj/item/reagent_containers/glass/bottle/vial/small(drop_location())
|
||||
P.name = trim("[name] hypovial")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, 60)
|
||||
|
||||
if(vol_part)
|
||||
P = new/obj/item/reagent_containers/glass/bottle/vial/small(drop_location())
|
||||
P.name = trim("[name] hypovial")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_part)
|
||||
. = TRUE
|
||||
|
||||
if(action == "createDart")
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(!(istype(R, /datum/reagent/medicine)))
|
||||
visible_message("<b>The [src]</b> beeps, \"<span class='warning'>SmartDarts are insoluble with non-medicinal compounds.\"</span>")
|
||||
return
|
||||
|
||||
var/many = params["many"]
|
||||
if(reagents.total_volume == 0)
|
||||
return
|
||||
var/amount = 1
|
||||
var/vol_each = min(reagents.total_volume, 20)
|
||||
if(text2num(many))
|
||||
amount = CLAMP(round(input(usr, "Max 10. Buffer content will be split evenly.", "How many darts?", amount) as num|null), 0, 10)
|
||||
if(!amount)
|
||||
return
|
||||
vol_each = min(reagents.total_volume / amount, 20)
|
||||
|
||||
var/name = stripped_input(usr,"Name:","Name your SmartDart!", "[reagents.get_master_reagent_name()] ([vol_each]u)", MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
|
||||
return
|
||||
|
||||
var/obj/item/reagent_containers/syringe/dart/D
|
||||
for(var/i = 0; i < amount; i++)
|
||||
D = new /obj/item/reagent_containers/syringe/dart(drop_location())
|
||||
D.name = trim("[name] SmartDart")
|
||||
adjust_item_drop_location(D)
|
||||
reagents.trans_to(D, vol_each)
|
||||
D.mode=!mode
|
||||
D.update_icon()
|
||||
. = TRUE
|
||||
|
||||
if(action == "pillStyle")
|
||||
var/id = text2num(params["id"])
|
||||
chosenPillStyle = id
|
||||
return TRUE
|
||||
|
||||
if(action == "create")
|
||||
if(reagents.total_volume == 0)
|
||||
return FALSE
|
||||
var/item_type = params["type"]
|
||||
// Get amount of items
|
||||
var/amount = text2num(params["amount"])
|
||||
if(amount == null)
|
||||
amount = text2num(input(usr,
|
||||
"Max 10. Buffer content will be split evenly.",
|
||||
"How many to make?", 1))
|
||||
amount = CLAMP(round(amount), 0, 10)
|
||||
if (amount <= 0)
|
||||
return FALSE
|
||||
// Get units per item
|
||||
var/vol_each = text2num(params["volume"])
|
||||
var/vol_each_text = params["volume"]
|
||||
var/vol_each_max = reagents.total_volume / amount
|
||||
if (item_type == "pill")
|
||||
vol_each_max = min(50, vol_each_max)
|
||||
else if (item_type == "patch")
|
||||
vol_each_max = min(40, vol_each_max)
|
||||
else if (item_type == "bottle")
|
||||
vol_each_max = min(30, vol_each_max)
|
||||
else if (item_type == "condimentPack")
|
||||
vol_each_max = min(10, vol_each_max)
|
||||
else if (item_type == "condimentBottle")
|
||||
vol_each_max = min(50, vol_each_max)
|
||||
else
|
||||
return FALSE
|
||||
if(vol_each_text == "auto")
|
||||
vol_each = vol_each_max
|
||||
if(vol_each == null)
|
||||
vol_each = text2num(input(usr,
|
||||
"Maximum [vol_each_max] units per item.",
|
||||
"How many units to fill?",
|
||||
vol_each_max))
|
||||
vol_each = CLAMP(round(vol_each), 0, vol_each_max)
|
||||
if(vol_each <= 0)
|
||||
return FALSE
|
||||
// Get item name
|
||||
var/name = params["name"]
|
||||
var/name_has_units = item_type == "pill" || item_type == "patch"
|
||||
if(!name)
|
||||
var/name_default = reagents.get_master_reagent_name()
|
||||
if (name_has_units)
|
||||
name_default += " ([vol_each]u)"
|
||||
name = stripped_input(usr,
|
||||
"Name:",
|
||||
"Give it a name!",
|
||||
name_default,
|
||||
MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
|
||||
return FALSE
|
||||
// Start filling
|
||||
if(item_type == "pill")
|
||||
var/obj/item/reagent_containers/pill/P
|
||||
var/target_loc = drop_location()
|
||||
var/drop_threshold = INFINITY
|
||||
if(bottle)
|
||||
var/datum/component/storage/STRB = bottle.GetComponent(
|
||||
/datum/component/storage)
|
||||
if(STRB)
|
||||
drop_threshold = STRB.max_items - bottle.contents.len
|
||||
for(var/i = 0; i < amount; i++)
|
||||
if(i < drop_threshold)
|
||||
P = new/obj/item/reagent_containers/pill(target_loc)
|
||||
else
|
||||
P = new/obj/item/reagent_containers/pill(drop_location())
|
||||
P.name = trim("[name] pill")
|
||||
if(chosenPillStyle == RANDOM_PILL_STYLE)
|
||||
P.icon_state ="pill[rand(1,21)]"
|
||||
else
|
||||
P.icon_state = "pill[chosenPillStyle]"
|
||||
if(P.icon_state == "pill4")
|
||||
P.desc = "A tablet or capsule, but not just any, a red one, one taken by the ones not scared of knowledge, freedom, uncertainty and the brutal truths of reality."
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "patch")
|
||||
var/obj/item/reagent_containers/pill/patch/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/pill/patch(drop_location())
|
||||
P.name = trim("[name] patch")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "bottle")
|
||||
var/obj/item/reagent_containers/glass/bottle/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/glass/bottle(drop_location())
|
||||
P.name = trim("[name] bottle")
|
||||
adjust_item_drop_location(P)
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "condimentPack")
|
||||
var/obj/item/reagent_containers/food/condiment/pack/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/food/condiment/pack(drop_location())
|
||||
P.originalname = name
|
||||
P.name = trim("[name] pack")
|
||||
P.desc = "A small condiment pack. The label says it contains [name]."
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
if(item_type == "condimentBottle")
|
||||
var/obj/item/reagent_containers/food/condiment/P
|
||||
for(var/i = 0; i < amount; i++)
|
||||
P = new/obj/item/reagent_containers/food/condiment(drop_location())
|
||||
P.originalname = name
|
||||
P.name = trim("[name] bottle")
|
||||
reagents.trans_to(P, vol_each, transfered_by = usr)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
if(action == "analyze")
|
||||
var/datum/reagent/R = GLOB.name2reagent[params["id"]]
|
||||
if(R)
|
||||
var/state = "Unknown"
|
||||
if(initial(R.reagent_state) == 1)
|
||||
state = "Solid"
|
||||
else if(initial(R.reagent_state) == 2)
|
||||
state = "Liquid"
|
||||
else if(initial(R.reagent_state) == 3)
|
||||
state = "Gas"
|
||||
var/const/P = 3 //The number of seconds between life ticks
|
||||
var/T = initial(R.metabolization_rate) * (60 / P)
|
||||
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold))
|
||||
screen = "analyze"
|
||||
return TRUE
|
||||
|
||||
if(action == "goScreen")
|
||||
screen = params["screen"]
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/chem_master/proc/end_fermi_reaction()//Ends any reactions upon moving.
|
||||
if(beaker.reagents.fermiIsReacting)
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
idle_power_usage = 20
|
||||
resistance_flags = ACID_PROOF
|
||||
var/wait
|
||||
var/mode = MAIN_SCREEN
|
||||
var/datum/symptom/selected_symptom
|
||||
var/obj/item/reagent_containers/beaker
|
||||
|
||||
@@ -56,18 +55,14 @@
|
||||
if(istype(D, /datum/disease/advance))
|
||||
var/datum/disease/advance/A = D
|
||||
var/disease_name = SSdisease.get_disease_name(A.GetDiseaseID())
|
||||
if((disease_name == "Unknown") && A.mutable)
|
||||
this["can_rename"] = TRUE
|
||||
this["can_rename"] = ((disease_name == "Unknown") && A.mutable)
|
||||
this["name"] = disease_name
|
||||
this["is_adv"] = TRUE
|
||||
this["symptoms"] = list()
|
||||
var/symptom_index = 1
|
||||
for(var/symptom in A.symptoms)
|
||||
var/datum/symptom/S = symptom
|
||||
var/list/this_symptom = list()
|
||||
this_symptom["name"] = S.name
|
||||
this_symptom["sym_index"] = symptom_index
|
||||
symptom_index++
|
||||
this_symptom = get_symptom_data(S)
|
||||
this["symptoms"] += list(this_symptom)
|
||||
this["resistance"] = A.totalResistance()
|
||||
this["stealth"] = A.totalStealth()
|
||||
@@ -128,29 +123,28 @@
|
||||
/obj/machinery/computer/pandemic/ui_interact(mob/user, ui_key = "main", datum/tgui/ui, force_open = FALSE, datum/tgui/master_ui, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "pandemic", name, 700, 500, master_ui, state)
|
||||
ui = new(user, src, ui_key, "pandemic", name, 520, 550, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/pandemic/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["is_ready"] = !wait
|
||||
data["mode"] = mode
|
||||
switch(mode)
|
||||
if(MAIN_SCREEN)
|
||||
if(beaker)
|
||||
data["has_beaker"] = TRUE
|
||||
if(!beaker.reagents.total_volume || !beaker.reagents.reagent_list)
|
||||
data["beaker_empty"] = TRUE
|
||||
var/datum/reagent/blood/B = locate() in beaker.reagents.reagent_list
|
||||
if(B)
|
||||
data["has_blood"] = TRUE
|
||||
data[/datum/reagent/blood] = list()
|
||||
data[/datum/reagent/blood]["dna"] = B.data["blood_DNA"] || "none"
|
||||
data[/datum/reagent/blood]["type"] = B.data["blood_type"] || "none"
|
||||
data["viruses"] = get_viruses_data(B)
|
||||
data["resistances"] = get_resistance_data(B)
|
||||
if(SYMPTOM_DETAILS)
|
||||
data["symptom"] = get_symptom_data(selected_symptom)
|
||||
if(beaker)
|
||||
data["has_beaker"] = TRUE
|
||||
data["beaker_empty"] = (!beaker.reagents.total_volume || !beaker.reagents.reagent_list)
|
||||
var/datum/reagent/blood/B = locate() in beaker.reagents.reagent_list
|
||||
if(B)
|
||||
data["has_blood"] = TRUE
|
||||
data[/datum/reagent/blood] = list()
|
||||
data[/datum/reagent/blood]["dna"] = B.data["blood_DNA"] || "none"
|
||||
data[/datum/reagent/blood]["type"] = B.data["blood_type"] || "none"
|
||||
data["viruses"] = get_viruses_data(B)
|
||||
data["resistances"] = get_resistance_data(B)
|
||||
else
|
||||
data["has_blood"] = FALSE
|
||||
else
|
||||
data["has_beaker"] = FALSE
|
||||
data["has_blood"] = FALSE
|
||||
|
||||
return data
|
||||
|
||||
@@ -209,19 +203,6 @@
|
||||
update_icon()
|
||||
addtimer(CALLBACK(src, .proc/reset_replicator_cooldown), 200)
|
||||
. = TRUE
|
||||
if("symptom_details")
|
||||
var/picked_symptom_index = text2num(params["picked_symptom"])
|
||||
var/index = text2num(params["index"])
|
||||
var/datum/disease/advance/A = get_by_index("viruses", index)
|
||||
var/datum/symptom/S = A.symptoms[picked_symptom_index]
|
||||
mode = SYMPTOM_DETAILS
|
||||
selected_symptom = S
|
||||
. = TRUE
|
||||
if("back")
|
||||
mode = MAIN_SCREEN
|
||||
selected_symptom = null
|
||||
. = TRUE
|
||||
|
||||
|
||||
/obj/machinery/computer/pandemic/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/reagent_containers) && !(I.item_flags & ABSTRACT) && I.is_open_container())
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "smoke_machine", name, 450, 350, master_ui, state)
|
||||
ui = new(user, src, ui_key, "smoke_machine", name, 350, 350, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/smoke_machine/ui_data(mob/user)
|
||||
|
||||
@@ -286,59 +286,57 @@
|
||||
var/datum/oracle_ui/themed/nano/ui
|
||||
obj_flags = CAN_BE_HIT | USES_TGUI | SHOVABLE_ONTO
|
||||
|
||||
/obj/machinery/disposal/bin/Initialize(mapload, obj/structure/disposalconstruct/make_from)
|
||||
. = ..()
|
||||
ui = new /datum/oracle_ui/themed/nano(src, 330, 190, "disposal_bin")
|
||||
ui.auto_refresh = TRUE
|
||||
ui.can_resize = FALSE
|
||||
|
||||
// attack by item places it in to disposal
|
||||
/obj/machinery/disposal/bin/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/storage/bag/trash)) //Not doing component overrides because this is a specific type.
|
||||
var/obj/item/storage/bag/trash/T = I
|
||||
var/datum/component/storage/STR = T.GetComponent(/datum/component/storage)
|
||||
to_chat(user, "<span class='warning'>You empty the bag.</span>")
|
||||
for(var/obj/item/O in T.contents)
|
||||
STR.remove_from_storage(O,src)
|
||||
T.update_icon()
|
||||
add_fingerprint(user)
|
||||
if(!pressure_charging && !full_pressure && !flush)
|
||||
if(I.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
panel_open = !panel_open
|
||||
I.play_tool_sound(src)
|
||||
to_chat(user, "<span class='notice'>You [panel_open ? "remove":"attach"] the screws around the power connection.</span>")
|
||||
return
|
||||
else if(I.tool_behaviour == TOOL_WELDER && panel_open)
|
||||
if(!I.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You start slicing the floorweld off \the [src]...</span>")
|
||||
if(I.use_tool(src, user, 20, volume=100) && panel_open)
|
||||
to_chat(user, "<span class='notice'>You slice the floorweld off \the [src].</span>")
|
||||
deconstruct()
|
||||
return
|
||||
|
||||
if(user.a_intent != INTENT_HARM)
|
||||
if((I.item_flags & ABSTRACT) || !user.temporarilyRemoveItemFromInventory(I))
|
||||
return
|
||||
place_item_in_disposal(I, user)
|
||||
update_icon()
|
||||
ui.soft_update_fields()
|
||||
return TRUE //no afterattack
|
||||
else
|
||||
ui.soft_update_fields()
|
||||
return ..()
|
||||
|
||||
// handle machine interaction
|
||||
|
||||
/obj/machinery/disposal/bin/ui_interact(mob/user, state)
|
||||
/obj/machinery/disposal/bin/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
if(user.loc == src)
|
||||
to_chat(user, "<span class='warning'>You cannot reach the controls from inside!</span>")
|
||||
return
|
||||
ui.render(user)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "disposal_unit", name, ui_x, ui_y, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/disposal/bin/oui_canview(mob/user)
|
||||
if(user.loc == src)
|
||||
return FALSE
|
||||
if(stat & BROKEN)
|
||||
return FALSE
|
||||
if(Adjacent(user))
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/disposal/bin/oui_data(mob/user)
|
||||
/obj/machinery/disposal/bin/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["flush"] = flush ? ui.act("Disengage", user, "handle-0", class="active") : ui.act("Engage", user, "handle-1")
|
||||
data["full_pressure"] = full_pressure ? "Ready" : (pressure_charging ? "Pressurizing" : "Off")
|
||||
data["pressure_charging"] = pressure_charging ? ui.act("Turn Off", user, "pump-0", class="active", disabled=full_pressure) : ui.act("Turn On", user, "pump-1", disabled=full_pressure)
|
||||
var/per = full_pressure ? 100 : CLAMP(100* air_contents.return_pressure() / (SEND_PRESSURE), 0, 99)
|
||||
data["per"] = "[round(per, 1)]%"
|
||||
data["contents"] = ui.act("Eject Contents", user, "eject", disabled=contents.len < 1)
|
||||
data["flush"] = flush
|
||||
data["full_pressure"] = full_pressure
|
||||
data["pressure_charging"] = pressure_charging
|
||||
data["panel_open"] = panel_open
|
||||
data["per"] = CLAMP01(air_contents.return_pressure() / (SEND_PRESSURE))
|
||||
data["isai"] = isAI(user)
|
||||
return data
|
||||
|
||||
/obj/machinery/disposal/bin/oui_act(mob/user, action, list/params)
|
||||
/obj/machinery/disposal/bin/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -365,7 +363,6 @@
|
||||
if("eject")
|
||||
eject()
|
||||
. = TRUE
|
||||
ui.soft_update_fields()
|
||||
|
||||
/obj/machinery/disposal/bin/alt_attack_hand(mob/user)
|
||||
if(can_interact(usr))
|
||||
|
||||
@@ -115,7 +115,9 @@
|
||||
job_description = "Off-station Syndicate Scientist"
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
icon_state = "sleeper_s"
|
||||
flavour_text = "<span class='big bold'>You are a syndicate agent,</span><b> employed in a top secret research facility developing biological weapons. Unfortunately, your hated enemy, Nanotrasen, has begun mining in this sector. <b>Continue your research as best you can, and try to keep a low profile. <font size=6>DON'T</font> abandon the base without good cause.</b> The base is rigged with explosives should the worst happen, do not let the base fall into enemy hands!</b>"
|
||||
short_desc = "You are a syndicate science technician, employed in a top secret research facility developing biological weapons."
|
||||
flavour_text = "Unfortunately, your hated enemy, Nanotrasen, has begun mining in this sector. Continue your research as best you can, and try to keep a low profile."
|
||||
important_info = "The base is rigged with explosives, DO NOT abandon it or let it fall into enemy hands!"
|
||||
outfit = /datum/outfit/lavaland_syndicate
|
||||
assignedrole = "Lavaland Syndicate"
|
||||
|
||||
@@ -142,7 +144,9 @@
|
||||
/obj/effect/mob_spawn/human/lavaland_syndicate/comms
|
||||
name = "Syndicate Comms Agent"
|
||||
job_description = "Off-station Syndicate Comms Agent"
|
||||
flavour_text = "<span class='big bold'>You are a syndicate agent,</span><b> employed in a top secret research facility developing biological weapons. Unfortunately, your hated enemy, Nanotrasen, has begun mining in this sector. <b>Monitor enemy activity as best you can, and try to keep a low profile. <font size=6>DON'T</font> abandon the base without good cause.</b> Use the communication equipment to provide support to any field agents, and sow disinformation to throw Nanotrasen off your trail. Do not let the base fall into enemy hands!</b>"
|
||||
short_desc = "You are a syndicate comms agent, employed in a top secret research facility developing biological weapons."
|
||||
flavour_text = "Unfortunately, your hated enemy, Nanotrasen, has begun mining in this sector. Monitor enemy activity as best you can, and try to keep a low profile. Use the communication equipment to provide support to any field agents, and sow disinformation to throw Nanotrasen off your trail. Do not let the base fall into enemy hands!"
|
||||
important_info = "DO NOT abandon the base."
|
||||
outfit = /datum/outfit/lavaland_syndicate/comms
|
||||
|
||||
/obj/effect/mob_spawn/human/lavaland_syndicate/comms/space/Initialize()
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "bsa", name, 400, 305, master_ui, state)
|
||||
ui = new(user, src, ui_key, "bsa", name, 400, 220, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/bsa_control/ui_data()
|
||||
@@ -252,6 +252,8 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer/bsa_control/proc/calibrate(mob/user)
|
||||
if(!GLOB.bsa_unlock)
|
||||
return
|
||||
var/list/gps_locators = list()
|
||||
for(var/obj/item/gps/G in GLOB.GPS_list) //nulls on the list somehow
|
||||
if(G.tracking)
|
||||
|
||||
@@ -33,6 +33,37 @@
|
||||
/datum/proc/ui_data(mob/user)
|
||||
return list() // Not implemented.
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Static Data to be sent to the UI.
|
||||
* Static data differs from normal data in that it's large data that should be sent infrequently
|
||||
* This is implemented optionally for heavy uis that would be sending a lot of redundant data
|
||||
* frequently.
|
||||
* Gets squished into one object on the frontend side, but the static part is cached.
|
||||
*
|
||||
* required user mob The mob interacting with the UI.
|
||||
*
|
||||
* return list Statuic Data to be sent to the UI.
|
||||
**/
|
||||
/datum/proc/ui_static_data(mob/user)
|
||||
return list()
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Forces an update on static data. Should be done manually whenever something happens to change static data.
|
||||
*
|
||||
* required user the mob currently interacting with the ui
|
||||
* optional ui ui to be updated
|
||||
* optional ui_key ui key of ui to be updated
|
||||
*
|
||||
**/
|
||||
/datum/proc/update_static_data(mob/user, datum/tgui/ui, ui_key = "main")
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui)
|
||||
if(!ui)
|
||||
return //If there was no ui to update, there's no static data to update either.
|
||||
ui.push_data(null, ui_static_data(), TRUE)
|
||||
|
||||
/**
|
||||
* public
|
||||
@@ -80,7 +111,6 @@
|
||||
* Used to track UIs for a mob.
|
||||
**/
|
||||
/mob/var/list/open_uis = list()
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
@@ -111,4 +141,4 @@
|
||||
ui.close()
|
||||
// Unset machine just to be sure.
|
||||
if(src && src.mob)
|
||||
src.mob.unset_machine()
|
||||
src.mob.unset_machine()
|
||||
|
||||
+364
-387
@@ -1,387 +1,364 @@
|
||||
/**
|
||||
* tgui
|
||||
*
|
||||
* /tg/station user interface library
|
||||
**/
|
||||
|
||||
/**
|
||||
* tgui datum (represents a UI).
|
||||
**/
|
||||
/datum/tgui
|
||||
var/mob/user // The mob who opened/is using the UI.
|
||||
var/datum/src_object // The object which owns the UI.
|
||||
var/title // The title of te UI.
|
||||
var/ui_key // The ui_key of the UI. This allows multiple UIs for one src_object.
|
||||
var/window_id // The window_id for browse() and onclose().
|
||||
var/width = 0 // The window width.
|
||||
var/height = 0 // The window height
|
||||
var/window_options = list( // Extra options to winset().
|
||||
"focus" = FALSE,
|
||||
"titlebar" = TRUE,
|
||||
"can_resize" = TRUE,
|
||||
"can_minimize" = TRUE,
|
||||
"can_maximize" = FALSE,
|
||||
"can_close" = TRUE,
|
||||
"auto_format" = FALSE
|
||||
)
|
||||
var/style = "nanotrasen" // The style to be used for this UI.
|
||||
var/interface // The interface (template) to be used for this UI.
|
||||
var/autoupdate = TRUE // Update the UI every MC tick.
|
||||
var/initialized = FALSE // If the UI has been initialized yet.
|
||||
var/list/initial_data // The data (and datastructure) used to initialize the UI.
|
||||
var/status = UI_INTERACTIVE // The status/visibility of the UI.
|
||||
var/datum/ui_state/state = null // Topic state used to determine status/interactability.
|
||||
var/datum/tgui/master_ui // The parent UI.
|
||||
var/list/datum/tgui/children = list() // Children of this UI.
|
||||
var/titlebar = TRUE
|
||||
var/custom_browser_id = FALSE
|
||||
var/ui_screen = "home"
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Create a new UI.
|
||||
*
|
||||
* required user mob The mob who opened/is using the UI.
|
||||
* required src_object datum The object or datum which owns the UI.
|
||||
* required ui_key string The ui_key of the UI.
|
||||
* required interface string The interface used to render the UI.
|
||||
* optional title string The title of the UI.
|
||||
* optional width int The window width.
|
||||
* optional height int The window height.
|
||||
* optional master_ui datum/tgui The parent UI.
|
||||
* optional state datum/ui_state The state used to determine status.
|
||||
*
|
||||
* return datum/tgui The requested UI.
|
||||
**/
|
||||
/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state, browser_id = null)
|
||||
src.user = user
|
||||
src.src_object = src_object
|
||||
src.ui_key = ui_key
|
||||
src.window_id = browser_id ? browser_id : "[REF(src_object)]-[ui_key]"
|
||||
src.custom_browser_id = browser_id ? TRUE : FALSE
|
||||
|
||||
set_interface(interface)
|
||||
|
||||
if(title)
|
||||
src.title = sanitize(title)
|
||||
if(width)
|
||||
src.width = width
|
||||
if(height)
|
||||
src.height = height
|
||||
|
||||
src.master_ui = master_ui
|
||||
if(master_ui)
|
||||
master_ui.children += src
|
||||
src.state = state
|
||||
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/simple/tgui)
|
||||
assets.send(user)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Open this UI (and initialize it with data).
|
||||
**/
|
||||
/datum/tgui/proc/open()
|
||||
if(!user.client)
|
||||
return // Bail if there is no client.
|
||||
|
||||
update_status(push = 0) // Update the window status.
|
||||
if(status < UI_UPDATE)
|
||||
return // Bail if we're not supposed to open.
|
||||
|
||||
if(!initial_data)
|
||||
set_initial_data(src_object.ui_data(user)) // Get the UI data.
|
||||
|
||||
var/window_size = ""
|
||||
if(width && height) // If we have a width and height, use them.
|
||||
window_size = "size=[width]x[height];"
|
||||
|
||||
var/debugable = check_rights_for(user.client, R_DEBUG)
|
||||
user << browse(get_html(debugable), "window=[window_id];[window_size][list2params(window_options)]") // Open the window.
|
||||
if (!custom_browser_id)
|
||||
winset(user, window_id, "on-close=\"uiclose [REF(src)]\"") // Instruct the client to signal UI when the window is closed.
|
||||
SStgui.on_open(src)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Reinitialize the UI.
|
||||
* (Possibly with a new interface and/or data).
|
||||
*
|
||||
* optional template string The name of the new interface.
|
||||
* optional data list The new initial data.
|
||||
**/
|
||||
/datum/tgui/proc/reinitialize(interface, list/data)
|
||||
if(interface)
|
||||
set_interface(interface) // Set a new interface.
|
||||
if(data)
|
||||
set_initial_data(data) // Replace the initial_data.
|
||||
open()
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Close the UI, and all its children.
|
||||
**/
|
||||
/datum/tgui/proc/close()
|
||||
user << browse(null, "window=[window_id]") // Close the window.
|
||||
src_object.ui_close()
|
||||
SStgui.on_close(src)
|
||||
for(var/datum/tgui/child in children) // Loop through and close all children.
|
||||
child.close()
|
||||
children.Cut()
|
||||
state = null
|
||||
master_ui = null
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Sets the browse() window options for this UI.
|
||||
*
|
||||
* required window_options list The window options to set.
|
||||
**/
|
||||
/datum/tgui/proc/set_window_options(list/window_options)
|
||||
src.window_options = window_options
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Set the style for this UI.
|
||||
*
|
||||
* required style string The new UI style.
|
||||
**/
|
||||
/datum/tgui/proc/set_style(style)
|
||||
src.style = lowertext(style)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Set the interface (template) for this UI.
|
||||
*
|
||||
* required interface string The new UI interface.
|
||||
**/
|
||||
/datum/tgui/proc/set_interface(interface)
|
||||
src.interface = lowertext(interface)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Enable/disable auto-updating of the UI.
|
||||
*
|
||||
* required state bool Enable/disable auto-updating.
|
||||
**/
|
||||
/datum/tgui/proc/set_autoupdate(state = 1)
|
||||
autoupdate = state
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Set the data to initialize the UI with.
|
||||
* The datastructure cannot be changed by subsequent updates.
|
||||
*
|
||||
* optional data list The data/datastructure to initialize the UI with.
|
||||
**/
|
||||
/datum/tgui/proc/set_initial_data(list/data)
|
||||
initial_data = data
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Generate HTML for this UI.
|
||||
*
|
||||
* optional bool inline If the JSON should be inlined into the HTML (for debugging).
|
||||
*
|
||||
* return string UI HTML output.
|
||||
**/
|
||||
/datum/tgui/proc/get_html(var/inline)
|
||||
var/html
|
||||
html = SStgui.basehtml
|
||||
|
||||
//Allow the src object to override the html if needed
|
||||
html = src_object.ui_base_html(html)
|
||||
//Strip out any remaining custom tags that are used in ui_base_html
|
||||
html = replacetext(html, "<!--customheadhtml-->", "")
|
||||
|
||||
// Poplate HTML with JSON if we're supposed to inline.
|
||||
if(inline)
|
||||
html = replacetextEx(html, "{}", get_json(initial_data))
|
||||
|
||||
|
||||
//Setup for tgui stuff, including styles
|
||||
html = replacetextEx(html, "\[ref]", "[REF(src)]")
|
||||
html = replacetextEx(html, "\[style]", style)
|
||||
return html
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Get the config data/datastructure to initialize the UI with.
|
||||
*
|
||||
* return list The config data.
|
||||
**/
|
||||
/datum/tgui/proc/get_config_data()
|
||||
var/list/config_data = list(
|
||||
"title" = title,
|
||||
"status" = status,
|
||||
"screen" = ui_screen,
|
||||
"style" = style,
|
||||
"interface" = interface,
|
||||
"fancy" = user.client.prefs.tgui_fancy,
|
||||
"locked" = user.client.prefs.tgui_lock && !custom_browser_id,
|
||||
"window" = window_id,
|
||||
"ref" = "[REF(src)]",
|
||||
"user" = list(
|
||||
"name" = user.name,
|
||||
"ref" = "[REF(user)]"
|
||||
),
|
||||
"srcObject" = list(
|
||||
"name" = "[src_object]",
|
||||
"ref" = "[REF(src_object)]"
|
||||
),
|
||||
"titlebar" = titlebar
|
||||
)
|
||||
return config_data
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Package the data to send to the UI, as JSON.
|
||||
* This includes the UI data and config_data.
|
||||
*
|
||||
* return string The packaged JSON.
|
||||
**/
|
||||
/datum/tgui/proc/get_json(list/data)
|
||||
var/list/json_data = list()
|
||||
|
||||
json_data["config"] = get_config_data()
|
||||
if(!isnull(data))
|
||||
json_data["data"] = data
|
||||
|
||||
// Generate the JSON.
|
||||
var/json = json_encode(json_data)
|
||||
// Strip #255/improper.
|
||||
json = replacetext(json, "\proper", "")
|
||||
json = replacetext(json, "\improper", "")
|
||||
return json
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Handle clicks from the UI.
|
||||
* Call the src_object's ui_act() if status is UI_INTERACTIVE.
|
||||
* If the src_object's ui_act() returns 1, update all UIs attacked to it.
|
||||
**/
|
||||
/datum/tgui/Topic(href, href_list)
|
||||
if(user != usr)
|
||||
return // Something is not right here.
|
||||
|
||||
var/action = href_list["action"]
|
||||
var/params = href_list; params -= "action"
|
||||
|
||||
switch(action)
|
||||
if("tgui:initialize")
|
||||
user << output(url_encode(get_json(initial_data)), "[custom_browser_id ? window_id : "[window_id].browser"]:initialize")
|
||||
initialized = TRUE
|
||||
if("tgui:view")
|
||||
if(params["screen"])
|
||||
ui_screen = params["screen"]
|
||||
SStgui.update_uis(src_object)
|
||||
if("tgui:link")
|
||||
user << link(params["url"])
|
||||
if("tgui:fancy")
|
||||
user.client.prefs.tgui_fancy = TRUE
|
||||
if("tgui:nofrills")
|
||||
user.client.prefs.tgui_fancy = FALSE
|
||||
else
|
||||
update_status(push = 0) // Update the window state.
|
||||
if(src_object.ui_act(action, params, src, state)) // Call ui_act() on the src_object.
|
||||
SStgui.update_uis(src_object) // Update if the object requested it.
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Update the UI.
|
||||
* Only updates the data if update is true, otherwise only updates the status.
|
||||
*
|
||||
* optional force bool If the UI should be forced to update.
|
||||
**/
|
||||
/datum/tgui/process(force = 0)
|
||||
var/datum/host = src_object.ui_host(user)
|
||||
if(!src_object || !host || !user) // If the object or user died (or something else), abort.
|
||||
close()
|
||||
return
|
||||
|
||||
if(status && (force || autoupdate))
|
||||
update() // Update the UI if the status and update settings allow it.
|
||||
else
|
||||
update_status(push = 1) // Otherwise only update status.
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Push data to an already open UI.
|
||||
*
|
||||
* required data list The data to send.
|
||||
* optional force bool If the update should be sent regardless of state.
|
||||
**/
|
||||
/datum/tgui/proc/push_data(data, force = 0)
|
||||
update_status(push = 0) // Update the window state.
|
||||
if(!initialized)
|
||||
return // Cannot update UI if it is not set up yet.
|
||||
if(status <= UI_DISABLED && !force)
|
||||
return // Cannot update UI, we have no visibility.
|
||||
|
||||
// Send the new JSON to the update() Javascript function.
|
||||
user << output(url_encode(get_json(data)), "[custom_browser_id ? window_id : "[window_id].browser"]:update")
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Updates the UI by interacting with the src_object again, which will hopefully
|
||||
* call try_ui_update on it.
|
||||
*
|
||||
* optional force_open bool If force_open should be passed to ui_interact.
|
||||
**/
|
||||
/datum/tgui/proc/update(force_open = FALSE)
|
||||
src_object.ui_interact(user, ui_key, src, force_open, master_ui, state)
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Update the status/visibility of the UI for its user.
|
||||
*
|
||||
* optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
|
||||
**/
|
||||
/datum/tgui/proc/update_status(push = 0)
|
||||
var/status = src_object.ui_status(user, state)
|
||||
if(master_ui)
|
||||
status = min(status, master_ui.status)
|
||||
|
||||
set_status(status, push)
|
||||
if(status == UI_CLOSE)
|
||||
close()
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Set the status/visibility of the UI.
|
||||
*
|
||||
* required status int The status to set (UI_CLOSE/UI_DISABLED/UI_UPDATE/UI_INTERACTIVE).
|
||||
* optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
|
||||
**/
|
||||
/datum/tgui/proc/set_status(status, push = 0)
|
||||
if(src.status != status) // Only update if status has changed.
|
||||
if(src.status == UI_DISABLED)
|
||||
src.status = status
|
||||
if(push)
|
||||
update()
|
||||
else
|
||||
src.status = status
|
||||
if(status == UI_DISABLED || push) // Update if the UI just because disabled, or a push is requested.
|
||||
push_data(null, force = 1)
|
||||
|
||||
/datum/tgui/proc/set_titlebar(value)
|
||||
titlebar = value
|
||||
/**
|
||||
* tgui
|
||||
*
|
||||
* /tg/station user interface library
|
||||
**/
|
||||
|
||||
/**
|
||||
* tgui datum (represents a UI).
|
||||
**/
|
||||
/datum/tgui
|
||||
/// The mob who opened/is using the UI.
|
||||
var/mob/user
|
||||
/// The object which owns the UI.
|
||||
var/datum/src_object
|
||||
/// The title of te UI.
|
||||
var/title
|
||||
/// The ui_key of the UI. This allows multiple UIs for one src_object.
|
||||
var/ui_key
|
||||
/// The window_id for browse() and onclose().
|
||||
var/window_id
|
||||
/// The window width.
|
||||
var/width = 0
|
||||
/// The window height
|
||||
var/height = 0
|
||||
/// The style to be used for this UI.
|
||||
var/style = "nanotrasen"
|
||||
/// The interface (template) to be used for this UI.
|
||||
var/interface
|
||||
/// Update the UI every MC tick.
|
||||
var/autoupdate = TRUE
|
||||
/// If the UI has been initialized yet.
|
||||
var/initialized = FALSE
|
||||
/// The data (and datastructure) used to initialize the UI.
|
||||
var/list/initial_data
|
||||
/// The static data used to initialize the UI.
|
||||
var/list/initial_static_data
|
||||
/// The status/visibility of the UI.
|
||||
var/status = UI_INTERACTIVE
|
||||
/// Topic state used to determine status/interactability.
|
||||
var/datum/ui_state/state = null
|
||||
/// The parent UI.
|
||||
var/datum/tgui/master_ui
|
||||
/// Children of this UI.
|
||||
var/list/datum/tgui/children = list()
|
||||
var/custom_browser_id = FALSE
|
||||
var/ui_screen = "home"
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Create a new UI.
|
||||
*
|
||||
* required user mob The mob who opened/is using the UI.
|
||||
* required src_object datum The object or datum which owns the UI.
|
||||
* required ui_key string The ui_key of the UI.
|
||||
* required interface string The interface used to render the UI.
|
||||
* optional title string The title of the UI.
|
||||
* optional width int The window width.
|
||||
* optional height int The window height.
|
||||
* optional master_ui datum/tgui The parent UI.
|
||||
* optional state datum/ui_state The state used to determine status.
|
||||
*
|
||||
* return datum/tgui The requested UI.
|
||||
**/
|
||||
/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state, browser_id = null)
|
||||
src.user = user
|
||||
src.src_object = src_object
|
||||
src.ui_key = ui_key
|
||||
src.window_id = browser_id ? browser_id : "[REF(src_object)]-[ui_key]" // DO NOT replace with \ref here. src_object could potentially be tagged
|
||||
src.custom_browser_id = browser_id ? TRUE : FALSE
|
||||
|
||||
set_interface(interface)
|
||||
|
||||
if(title)
|
||||
src.title = sanitize(title)
|
||||
if(width)
|
||||
src.width = width
|
||||
if(height)
|
||||
src.height = height
|
||||
|
||||
src.master_ui = master_ui
|
||||
if(master_ui)
|
||||
master_ui.children += src
|
||||
src.state = state
|
||||
|
||||
var/datum/asset/assets = get_asset_datum(/datum/asset/group/tgui)
|
||||
assets.send(user)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Open this UI (and initialize it with data).
|
||||
**/
|
||||
/datum/tgui/proc/open()
|
||||
if(!user.client)
|
||||
return // Bail if there is no client.
|
||||
|
||||
update_status(push = FALSE) // Update the window status.
|
||||
if(status < UI_UPDATE)
|
||||
return // Bail if we're not supposed to open.
|
||||
|
||||
var/window_size
|
||||
if(width && height) // If we have a width and height, use them.
|
||||
window_size = "size=[width]x[height];"
|
||||
else
|
||||
window_size = ""
|
||||
|
||||
// Remove titlebar and resize handles for a fancy window
|
||||
var/have_title_bar
|
||||
if(user.client.prefs.tgui_fancy)
|
||||
have_title_bar = "titlebar=0;can_resize=0;"
|
||||
else
|
||||
have_title_bar = "titlebar=1;can_resize=1;"
|
||||
|
||||
// Generate page html
|
||||
var/html
|
||||
html = SStgui.basehtml
|
||||
// Allow the src object to override the html if needed
|
||||
html = src_object.ui_base_html(html)
|
||||
// Replace template tokens with important UI data
|
||||
// NOTE: Intentional \ref usage; tgui datums can't/shouldn't
|
||||
// be tagged, so this is an effective unwrap
|
||||
html = replacetextEx(html, "\[ref]", "\ref[src]")
|
||||
html = replacetextEx(html, "\[style]", style)
|
||||
|
||||
// Open the window.
|
||||
user << browse(html, "window=[window_id];can_minimize=0;auto_format=0;[window_size][have_title_bar]")
|
||||
if (!custom_browser_id)
|
||||
// Instruct the client to signal UI when the window is closed.
|
||||
// NOTE: Intentional \ref usage; tgui datums can't/shouldn't
|
||||
// be tagged, so this is an effective unwrap
|
||||
winset(user, window_id, "on-close=\"uiclose \ref[src]\"")
|
||||
|
||||
if(!initial_data)
|
||||
initial_data = src_object.ui_data(user)
|
||||
if(!initial_static_data)
|
||||
initial_static_data = src_object.ui_static_data(user)
|
||||
|
||||
SStgui.on_open(src)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Reinitialize the UI.
|
||||
* (Possibly with a new interface and/or data).
|
||||
*
|
||||
* optional template string The name of the new interface.
|
||||
* optional data list The new initial data.
|
||||
**/
|
||||
/datum/tgui/proc/reinitialize(interface, list/data, list/static_data)
|
||||
if(interface)
|
||||
set_interface(interface) // Set a new interface.
|
||||
if(data)
|
||||
initial_data = data
|
||||
if(static_data)
|
||||
initial_static_data = static_data
|
||||
open()
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Close the UI, and all its children.
|
||||
**/
|
||||
/datum/tgui/proc/close()
|
||||
user << browse(null, "window=[window_id]") // Close the window.
|
||||
src_object.ui_close()
|
||||
SStgui.on_close(src)
|
||||
for(var/datum/tgui/child in children) // Loop through and close all children.
|
||||
child.close()
|
||||
children.Cut()
|
||||
state = null
|
||||
master_ui = null
|
||||
qdel(src)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Set the style for this UI.
|
||||
*
|
||||
* required style string The new UI style.
|
||||
**/
|
||||
/datum/tgui/proc/set_style(style)
|
||||
src.style = lowertext(style)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Set the interface (template) for this UI.
|
||||
*
|
||||
* required interface string The new UI interface.
|
||||
**/
|
||||
/datum/tgui/proc/set_interface(interface)
|
||||
src.interface = lowertext(interface)
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Enable/disable auto-updating of the UI.
|
||||
*
|
||||
* required state bool Enable/disable auto-updating.
|
||||
**/
|
||||
/datum/tgui/proc/set_autoupdate(state = TRUE)
|
||||
autoupdate = state
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Package the data to send to the UI, as JSON.
|
||||
* This includes the UI data and config_data.
|
||||
*
|
||||
* return string The packaged JSON.
|
||||
**/
|
||||
/datum/tgui/proc/get_json(list/data, list/static_data)
|
||||
var/list/json_data = list()
|
||||
|
||||
json_data["config"] = list(
|
||||
"title" = title,
|
||||
"status" = status,
|
||||
"screen" = ui_screen,
|
||||
"style" = style,
|
||||
"interface" = interface,
|
||||
"fancy" = user.client.prefs.tgui_fancy,
|
||||
"locked" = user.client.prefs.tgui_lock && !custom_browser_id,
|
||||
"observer" = isobserver(user),
|
||||
"window" = window_id,
|
||||
// NOTE: Intentional \ref usage; tgui datums can't/shouldn't
|
||||
// be tagged, so this is an effective unwrap
|
||||
"ref" = "\ref[src]"
|
||||
)
|
||||
|
||||
if(!isnull(data))
|
||||
json_data["data"] = data
|
||||
if(!isnull(static_data))
|
||||
json_data["static_data"] = static_data
|
||||
|
||||
// Generate the JSON.
|
||||
var/json = json_encode(json_data)
|
||||
// Strip #255/improper.
|
||||
json = replacetext(json, "\proper", "")
|
||||
json = replacetext(json, "\improper", "")
|
||||
return json
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Handle clicks from the UI.
|
||||
* Call the src_object's ui_act() if status is UI_INTERACTIVE.
|
||||
* If the src_object's ui_act() returns 1, update all UIs attacked to it.
|
||||
**/
|
||||
/datum/tgui/Topic(href, href_list)
|
||||
if(user != usr)
|
||||
return // Something is not right here.
|
||||
|
||||
var/action = href_list["action"]
|
||||
var/params = href_list; params -= "action"
|
||||
|
||||
switch(action)
|
||||
if("tgui:initialize")
|
||||
user << output(url_encode(get_json(initial_data, initial_static_data)), "[custom_browser_id ? window_id : "[window_id].browser"]:initialize")
|
||||
initialized = TRUE
|
||||
if("tgui:view")
|
||||
if(params["screen"])
|
||||
ui_screen = params["screen"]
|
||||
SStgui.update_uis(src_object)
|
||||
if("tgui:log")
|
||||
// Force window to show frills on fatal errors
|
||||
if(params["fatal"])
|
||||
winset(user, window_id, "titlebar=1;can-resize=1;size=600x600")
|
||||
if("tgui:link")
|
||||
user << link(params["url"])
|
||||
if("tgui:fancy")
|
||||
user.client.prefs.tgui_fancy = TRUE
|
||||
if("tgui:nofrills")
|
||||
user.client.prefs.tgui_fancy = FALSE
|
||||
else
|
||||
update_status(push = FALSE) // Update the window state.
|
||||
if(src_object.ui_act(action, params, src, state)) // Call ui_act() on the src_object.
|
||||
SStgui.update_uis(src_object) // Update if the object requested it.
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Update the UI.
|
||||
* Only updates the data if update is true, otherwise only updates the status.
|
||||
*
|
||||
* optional force bool If the UI should be forced to update.
|
||||
**/
|
||||
/datum/tgui/process(force = FALSE)
|
||||
var/datum/host = src_object.ui_host(user)
|
||||
if(!src_object || !host || !user) // If the object or user died (or something else), abort.
|
||||
close()
|
||||
return
|
||||
|
||||
if(status && (force || autoupdate))
|
||||
update() // Update the UI if the status and update settings allow it.
|
||||
else
|
||||
update_status(push = TRUE) // Otherwise only update status.
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Push data to an already open UI.
|
||||
*
|
||||
* required data list The data to send.
|
||||
* optional force bool If the update should be sent regardless of state.
|
||||
**/
|
||||
/datum/tgui/proc/push_data(data, static_data, force = FALSE)
|
||||
update_status(push = FALSE) // Update the window state.
|
||||
if(!initialized)
|
||||
return // Cannot update UI if it is not set up yet.
|
||||
if(status <= UI_DISABLED && !force)
|
||||
return // Cannot update UI, we have no visibility.
|
||||
|
||||
// Send the new JSON to the update() Javascript function.
|
||||
user << output(url_encode(get_json(data, static_data)), "[custom_browser_id ? window_id : "[window_id].browser"]:update")
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Updates the UI by interacting with the src_object again, which will hopefully
|
||||
* call try_ui_update on it.
|
||||
*
|
||||
* optional force_open bool If force_open should be passed to ui_interact.
|
||||
**/
|
||||
/datum/tgui/proc/update(force_open = FALSE)
|
||||
src_object.ui_interact(user, ui_key, src, force_open, master_ui, state)
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Update the status/visibility of the UI for its user.
|
||||
*
|
||||
* optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
|
||||
**/
|
||||
/datum/tgui/proc/update_status(push = FALSE)
|
||||
var/status = src_object.ui_status(user, state)
|
||||
if(master_ui)
|
||||
status = min(status, master_ui.status)
|
||||
set_status(status, push)
|
||||
if(status == UI_CLOSE)
|
||||
close()
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
* Set the status/visibility of the UI.
|
||||
*
|
||||
* required status int The status to set (UI_CLOSE/UI_DISABLED/UI_UPDATE/UI_INTERACTIVE).
|
||||
* optional push bool Push an update to the UI (an update is always sent for UI_DISABLED).
|
||||
**/
|
||||
/datum/tgui/proc/set_status(status, push = FALSE)
|
||||
if(src.status != status) // Only update if status has changed.
|
||||
if(src.status == UI_DISABLED)
|
||||
src.status = status
|
||||
if(push)
|
||||
update()
|
||||
else
|
||||
src.status = status
|
||||
if(status == UI_DISABLED || push) // Update if the UI just because disabled, or a push is requested.
|
||||
push_data(null, force = TRUE)
|
||||
|
||||
/datum/tgui/proc/log_message(message)
|
||||
log_tgui("[user] ([user.ckey]) using \"[title]\":\n[message]")
|
||||
|
||||
|
||||
@@ -117,37 +117,37 @@
|
||||
category = "Holiday"
|
||||
|
||||
/datum/uplink_item/bundles_TC
|
||||
category = "Bundles and Telecrystals"
|
||||
category = "Telecrystals and Bundles"
|
||||
surplus = 0
|
||||
cant_discount = TRUE
|
||||
|
||||
/datum/uplink_item/dangerous
|
||||
category = "Conspicuous and Dangerous Weapons"
|
||||
category = "Conspicuous Weapons"
|
||||
|
||||
/datum/uplink_item/stealthy_weapons
|
||||
category = "Stealthy and Inconspicuous Weapons"
|
||||
category = "Stealthy Weapons"
|
||||
|
||||
/datum/uplink_item/ammo
|
||||
category = "Ammunition"
|
||||
surplus = 40
|
||||
|
||||
/datum/uplink_item/explosives
|
||||
category = "Grenades and Explosives"
|
||||
category = "Explosives"
|
||||
|
||||
/datum/uplink_item/support
|
||||
category = "Support and Mechanized Exosuits"
|
||||
category = "Support and Exosuits"
|
||||
surplus = 0
|
||||
include_modes = list(/datum/game_mode/nuclear)
|
||||
|
||||
/datum/uplink_item/suits
|
||||
category = "Space Suits, Hardsuits and Clothing"
|
||||
category = "Clothing"
|
||||
surplus = 40
|
||||
|
||||
/datum/uplink_item/stealthy_tools
|
||||
category = "Stealth and Camouflage Items"
|
||||
category = "Stealth Gadgets"
|
||||
|
||||
/datum/uplink_item/device_tools
|
||||
category = "Devices and Tools"
|
||||
category = "Misc. Gadgets"
|
||||
|
||||
/datum/uplink_item/implants
|
||||
category = "Implants"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Due to the fact browse_rsc can't create subdirectories, every time you update font-awesome you'll need to change relative webfont references in all.min.css
|
||||
eg ../webfonts/fa-regular-400.ttf => fa-regular-400.ttf (or whatever you call it in asset datum)
|
||||
|
||||
Second change is ripping out file types other than woff and eot(ie8) from the css
|
||||
|
||||
Finally, removing brand related css.
|
||||
Vendored
+5
File diff suppressed because one or more lines are too long
+5
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user