mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
Reverts maps. Fixes conflict.
This commit is contained in:
Vendored
+1
-1
@@ -16,7 +16,7 @@ var/global/datum/repository/air_alarm/air_alarm_repository = new()
|
||||
if(is_station_contact(passed_alarm.z)) // Still need sanity checks
|
||||
alarms[++alarms.len] = passed_alarm.get_nano_data_console()
|
||||
else
|
||||
for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : air_alarms)) // Generating the whole list again is a bad habit but I can't be bothered to fix it right now
|
||||
for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : GLOB.air_alarms)) // Generating the whole list again is a bad habit but I can't be bothered to fix it right now
|
||||
if(!monitored_alarms && !is_station_contact(alarm.z))
|
||||
continue
|
||||
alarms[++alarms.len] = alarm.get_nano_data_console()
|
||||
|
||||
Vendored
+1
-1
@@ -59,7 +59,7 @@ var/global/datum/repository/crew/crew_repository = new()
|
||||
|
||||
/datum/repository/crew/proc/scan()
|
||||
var/list/tracked = list()
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
for(var/mob/living/carbon/human/H in GLOB.mob_list)
|
||||
if(istype(H.w_uniform, /obj/item/clothing/under))
|
||||
var/obj/item/clothing/under/C = H.w_uniform
|
||||
if(C.has_sensor)
|
||||
|
||||
Vendored
+1
-1
@@ -11,7 +11,7 @@ var/global/datum/repository/powermonitor/powermonitor_repository = new()
|
||||
if(!refresh)
|
||||
return cache_entry.data
|
||||
|
||||
for(var/obj/machinery/computer/monitor/pMon in power_monitors)
|
||||
for(var/obj/machinery/computer/monitor/pMon in GLOB.power_monitors)
|
||||
if( !(pMon.stat & (NOPOWER|BROKEN)) )
|
||||
pMonData[++pMonData.len] = list ("Name" = pMon.name, "ref" = "\ref[pMon]")
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Concept
|
||||
|
||||
Loosely adapted from /vg/. This is an entity component system for adding behaviours to datums when inheritance doesn't quite cut it. By using signals and events instead of direct inheritance, you can inject behaviours without hacky overloads. It requires a different method of thinking, but is not hard to use correctly. If a behaviour can have application across more than one thing. Make it generic, make it a component. Atom/mob/obj event? Give it a signal, and forward it's arguments with a `SendSignal()` call. Now every component that want's to can also know about this happening.
|
||||
Loosely adapted from /vg/. This is an entity component system for adding behaviours to datums when inheritance doesn't quite cut it. By using signals and events instead of direct inheritance, you can inject behaviours without hacky overloads. It requires a different method of thinking, but is not hard to use correctly. If a behaviour can have application across more than one thing. Make it generic, make it a component. Atom/mob/obj event? Give it a signal, and forward it's arguments with a `SEND_SIGNAL` call. Now every component that want's to can also know about this happening.
|
||||
|
||||
### In the code
|
||||
|
||||
@@ -28,6 +28,7 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
|
||||
1. `COMPONENT_INCOMPATIBLE` Return this from `/datum/component/Initialize` or `datum/component/OnTransfer` to have the component be deleted if it's applied to an incorrect type. `parent` must not be modified if this is to be returned.
|
||||
|
||||
|
||||
### Vars
|
||||
|
||||
1. `/datum/var/list/datum_components` (private)
|
||||
@@ -61,6 +62,11 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* Returns a reference to a component whose type MATCHES component_type if that component exists in the datum, null otherwise
|
||||
1. `GET_COMPONENT(varname, component_type)` OR `GET_COMPONENT_FROM(varname, component_type, src)`
|
||||
* Shorthand for `var/component_type/varname = src.GetComponent(component_type)`
|
||||
1. `SEND_SIGNAL(target, sigtype, ...)` (public, final)
|
||||
* Use to send signals to target datum
|
||||
* Extra arguments are to be specified in the signal definition
|
||||
* Returns a bitflag with signal specific information assembled from all activated components
|
||||
* Arguments are packaged in a list and handed off to _SendSignal()
|
||||
1. `/datum/proc/AddComponent(component_type(type), ...) -> datum/component` (public, final)
|
||||
* Creates an instance of `component_type` in the datum and passes `...` to its `Initialize()` call
|
||||
* Sends the `COMSIG_COMPONENT_ADDED` signal to the datum
|
||||
@@ -77,10 +83,9 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* Properly transfers ownership of a component from one datum to another
|
||||
* Signals `COMSIG_COMPONENT_REMOVING` on the parent
|
||||
* Called on the datum you want to own the component with another datum's component
|
||||
1. `/datum/proc/SendSignal(signal, ...)` (public, final)
|
||||
* Call to send a signal to the components of the target datum
|
||||
* Extra arguments are to be specified in the signal definition
|
||||
* Returns a bitflag with signal specific information assembled from all activated components
|
||||
1. `/datum/proc/_SendSignal(signal, list/arguments)` (private, final)
|
||||
* Handles most of the actual signaling procedure
|
||||
* Will runtime if used on datums with an empty component list
|
||||
1. `/datum/component/New(datum/parent, ...)` (private, final)
|
||||
* Runs internal setup for the component
|
||||
* Extra arguments are passed to `Initialize()`
|
||||
@@ -108,13 +113,13 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* Clears `parent` and removes the component from it's component list
|
||||
1. `/datum/component/proc/_JoinParent` (private, final)
|
||||
* Tries to add the component to it's `parent`s `datum_components` list
|
||||
1. `/datum/component/proc/RegisterSignal(signal(string/list of strings), proc_ref(type), override(boolean))` (protected, final) (Consider removing for performance gainz)
|
||||
1. `/datum/component/proc/RegisterSignal(datum/target, signal(string/list of strings), proc_ref(type), override(boolean))` (protected, final)
|
||||
* If signal is a list it will be as if RegisterSignal was called for each of the entries with the same following arguments
|
||||
* Makes a component listen for the specified `signal` on it's `parent` datum.
|
||||
* When that signal is recieved `proc_ref` will be called on the component, along with associated arguments
|
||||
* Example proc ref: `.proc/OnEvent`
|
||||
* If a previous registration is overwritten by the call, a runtime occurs. Setting `override` to TRUE prevents this
|
||||
* These callbacks run asyncronously
|
||||
* Returning `TRUE` from these callbacks will trigger a `TRUE` return from the `SendSignal()` that initiated it
|
||||
* Returning `TRUE` from these callbacks will trigger a `TRUE` return from the `_SendSignal()` that initiated it
|
||||
|
||||
### See/Define signals and their arguments in __DEFINES\components.dm
|
||||
|
||||
@@ -56,9 +56,10 @@
|
||||
if(!force)
|
||||
_RemoveFromParent()
|
||||
if(!silent)
|
||||
P.SendSignal(COMSIG_COMPONENT_REMOVING, src)
|
||||
SEND_SIGNAL(P, COMSIG_COMPONENT_REMOVING, src)
|
||||
parent = null
|
||||
LAZYCLEARLIST(signal_procs)
|
||||
for(var/target in signal_procs)
|
||||
UnregisterSignal(target, signal_procs[target])
|
||||
return ..()
|
||||
|
||||
/datum/component/proc/_RemoveFromParent()
|
||||
@@ -77,26 +78,67 @@
|
||||
if(!dc.len)
|
||||
P.datum_components = null
|
||||
|
||||
/datum/component/proc/RegisterSignal(sig_type_or_types, proc_or_callback, override = FALSE)
|
||||
if(QDELETED(src))
|
||||
/datum/component/proc/RegisterSignal(datum/target, sig_type_or_types, proc_or_callback, override = FALSE)
|
||||
if(QDELETED(src) || QDELETED(target))
|
||||
return
|
||||
|
||||
var/list/procs = signal_procs
|
||||
if(!procs)
|
||||
procs = list()
|
||||
signal_procs = procs
|
||||
signal_procs = procs = list()
|
||||
if(!procs[target])
|
||||
procs[target] = list()
|
||||
var/list/lookup = target.comp_lookup
|
||||
if(!lookup)
|
||||
target.comp_lookup = lookup = list()
|
||||
|
||||
if(!istype(proc_or_callback, /datum/callback)) //if it wasnt a callback before, it is now
|
||||
proc_or_callback = CALLBACK(src, proc_or_callback)
|
||||
|
||||
var/list/sig_types = islist(sig_type_or_types) ? sig_type_or_types : list(sig_type_or_types)
|
||||
for(var/sig_type in sig_types)
|
||||
if(!override)
|
||||
. = procs[sig_type]
|
||||
if(.)
|
||||
stack_trace("[sig_type] overridden. Use override = TRUE to suppress this warning")
|
||||
if(!override && procs[target][sig_type])
|
||||
stack_trace("[sig_type] overridden. Use override = TRUE to suppress this warning")
|
||||
|
||||
if(!istype(proc_or_callback, /datum/callback)) //if it wasnt a callback before, it is now
|
||||
proc_or_callback = CALLBACK(src, proc_or_callback)
|
||||
procs[sig_type] = proc_or_callback
|
||||
procs[target][sig_type] = proc_or_callback
|
||||
if(!lookup[sig_type]) // Nothing has registered here yet
|
||||
lookup[sig_type] = src
|
||||
else if(lookup[sig_type] == src) // We already registered here
|
||||
continue
|
||||
else if(!length(lookup[sig_type])) // One other thing registered here
|
||||
lookup[sig_type] = list(lookup[sig_type]=TRUE)
|
||||
lookup[sig_type][src] = TRUE
|
||||
else // Many other things have registered here
|
||||
lookup[sig_type][src] = TRUE
|
||||
|
||||
enabled = TRUE
|
||||
/datum/component/proc/UnregisterSignal(datum/target, sig_type_or_types)
|
||||
var/list/lookup = target.comp_lookup
|
||||
if(!signal_procs || !signal_procs[target] || !lookup)
|
||||
return
|
||||
if(!islist(sig_type_or_types))
|
||||
sig_type_or_types = list(sig_type_or_types)
|
||||
for(var/sig in sig_type_or_types)
|
||||
switch(length(lookup[sig]))
|
||||
if(2)
|
||||
lookup[sig] = (lookup[sig]-src)[1]
|
||||
if(1)
|
||||
stack_trace("[target] ([target.type]) somehow has single length list inside comp_lookup")
|
||||
if(src in lookup[sig])
|
||||
lookup -= sig
|
||||
if(!length(lookup))
|
||||
target.comp_lookup = null
|
||||
break
|
||||
if(0)
|
||||
lookup -= sig
|
||||
if(!length(lookup))
|
||||
target.comp_lookup = null
|
||||
break
|
||||
else
|
||||
lookup[sig] -= src
|
||||
|
||||
signal_procs[target] -= sig_type_or_types
|
||||
if(length(signal_procs[target]))
|
||||
signal_procs -= target
|
||||
|
||||
/datum/component/proc/InheritComponent(datum/component/C, i_am_original)
|
||||
return
|
||||
@@ -121,28 +163,20 @@
|
||||
current_type = type2parent(current_type)
|
||||
. += current_type
|
||||
|
||||
/datum/proc/SendSignal(sigtype, ...)
|
||||
var/list/comps = datum_components
|
||||
if(!comps)
|
||||
return NONE
|
||||
var/list/arguments = args.Copy(2)
|
||||
var/target = comps[/datum/component]
|
||||
/datum/proc/_SendSignal(sigtype, list/arguments)
|
||||
var/target = comp_lookup[sigtype]
|
||||
if(!length(target))
|
||||
var/datum/component/C = target
|
||||
if(!C.enabled)
|
||||
return NONE
|
||||
var/datum/callback/CB = C.signal_procs[sigtype]
|
||||
if(!CB)
|
||||
return NONE
|
||||
var/datum/callback/CB = C.signal_procs[src][sigtype]
|
||||
return CB.InvokeAsync(arglist(arguments))
|
||||
. = NONE
|
||||
for(var/I in target)
|
||||
var/datum/component/C = I
|
||||
if(!C.enabled)
|
||||
continue
|
||||
var/datum/callback/CB = C.signal_procs[sigtype]
|
||||
if(!CB)
|
||||
continue
|
||||
var/datum/callback/CB = C.signal_procs[src][sigtype]
|
||||
. |= CB.InvokeAsync(arglist(arguments))
|
||||
|
||||
/datum/proc/GetComponent(c_type)
|
||||
@@ -224,7 +258,7 @@
|
||||
new_comp = new nt(arglist(args)) // Dupes are allowed, act like normal
|
||||
|
||||
if(!old_comp && !QDELETED(new_comp)) // Nothing related to duplicate components happened and the new component is healthy
|
||||
SendSignal(COMSIG_COMPONENT_ADDED, new_comp)
|
||||
SEND_SIGNAL(src, COMSIG_COMPONENT_ADDED, new_comp)
|
||||
return new_comp
|
||||
return old_comp
|
||||
|
||||
@@ -244,7 +278,7 @@
|
||||
qdel(C)
|
||||
return
|
||||
C._RemoveFromParent()
|
||||
helicopter.SendSignal(COMSIG_COMPONENT_REMOVING, C)
|
||||
SEND_SIGNAL(helicopter, COMSIG_COMPONENT_REMOVING, C)
|
||||
C.parent = src
|
||||
if(C == AddComponent(C))
|
||||
C._JoinParent()
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
precondition = _precondition
|
||||
after_insert = _after_insert
|
||||
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/OnAttackBy)
|
||||
RegisterSignal(COMSIG_PARENT_EXAMINE, .proc/OnExamine)
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/OnAttackBy)
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/OnExamine)
|
||||
|
||||
var/list/possible_mats = list()
|
||||
for(var/mat_type in subtypesof(/datum/material))
|
||||
@@ -42,14 +42,14 @@
|
||||
var/mat_path = possible_mats[id]
|
||||
materials[id] = new mat_path()
|
||||
|
||||
/datum/component/material_container/proc/OnExamine(mob/user)
|
||||
/datum/component/material_container/proc/OnExamine(datum/source, mob/user)
|
||||
for(var/I in materials)
|
||||
var/datum/material/M = materials[I]
|
||||
var/amt = amount(M.id)
|
||||
if(amt)
|
||||
to_chat(user, "<span class='notice'>It has [amt] units of [lowertext(M.name)] stored.</span>")
|
||||
|
||||
/datum/component/material_container/proc/OnAttackBy(obj/item/I, mob/living/user)
|
||||
/datum/component/material_container/proc/OnAttackBy(datum/source, obj/item/I, mob/living/user)
|
||||
var/list/tc = allowed_typecache
|
||||
if(user.a_intent != INTENT_HELP)
|
||||
return
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
var/real_rank = t.fields["real_rank"]
|
||||
if(OOC)
|
||||
var/active = 0
|
||||
for(var/mob/M in player_list)
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(M.real_name == name && M.client && M.client.inactivity <= 10 * 60 * 10)
|
||||
active = 1
|
||||
break
|
||||
@@ -222,7 +222,7 @@ var/global/list/PDA_Manifest = list()
|
||||
|
||||
|
||||
/datum/datacore/proc/manifest()
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
for(var/mob/living/carbon/human/H in GLOB.player_list)
|
||||
manifest_inject(H)
|
||||
|
||||
/datum/datacore/proc/manifest_modify(name, assignment)
|
||||
@@ -358,7 +358,7 @@ var/record_id_num = 1001
|
||||
preview_icon.Blend(temp, ICON_OVERLAY)
|
||||
var/head = "head"
|
||||
if(head_organ.alt_head && head_organ.dna.species.bodyflags & HAS_ALT_HEADS)
|
||||
var/datum/sprite_accessory/alt_heads/alternate_head = alt_heads_list[head_organ.alt_head]
|
||||
var/datum/sprite_accessory/alt_heads/alternate_head = GLOB.alt_heads_list[head_organ.alt_head]
|
||||
if(alternate_head.icon_state)
|
||||
head = alternate_head.icon_state
|
||||
temp = new /icon(icobase, "[head]_[g]")
|
||||
@@ -390,7 +390,7 @@ var/record_id_num = 1001
|
||||
var/icon/t_marking_s
|
||||
if(H.dna.species.bodyflags & HAS_TAIL_MARKINGS)
|
||||
var/tail_marking = H.m_styles["tail"]
|
||||
var/datum/sprite_accessory/tail_marking_style = marking_styles_list[tail_marking]
|
||||
var/datum/sprite_accessory/tail_marking_style = GLOB.marking_styles_list[tail_marking]
|
||||
if(tail_marking_style && tail_marking_style.species_allowed)
|
||||
t_marking_s = new/icon("icon" = tail_marking_style.icon, "icon_state" = "[tail_marking_style.icon_state]_s")
|
||||
t_marking_s.Blend(H.m_colours["tail"], ICON_ADD)
|
||||
@@ -405,7 +405,7 @@ var/record_id_num = 1001
|
||||
eyes_s.Blend(eyes_organ.eye_colour, ICON_ADD)
|
||||
face_s.Blend(eyes_s, ICON_OVERLAY)
|
||||
|
||||
var/datum/sprite_accessory/hair_style = hair_styles_full_list[head_organ.h_style]
|
||||
var/datum/sprite_accessory/hair_style = GLOB.hair_styles_full_list[head_organ.h_style]
|
||||
if(hair_style)
|
||||
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
|
||||
// I'll want to make a species-specific proc for this sooner or later
|
||||
@@ -425,13 +425,13 @@ var/record_id_num = 1001
|
||||
|
||||
//Head Accessory
|
||||
if(head_organ.dna.species.bodyflags & HAS_HEAD_ACCESSORY)
|
||||
var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[head_organ.ha_style]
|
||||
var/datum/sprite_accessory/head_accessory_style = GLOB.head_accessory_styles_list[head_organ.ha_style]
|
||||
if(head_accessory_style && head_accessory_style.species_allowed)
|
||||
var/icon/head_accessory_s = new/icon("icon" = head_accessory_style.icon, "icon_state" = "[head_accessory_style.icon_state]_s")
|
||||
head_accessory_s.Blend(head_organ.headacc_colour, ICON_ADD)
|
||||
face_s.Blend(head_accessory_s, ICON_OVERLAY)
|
||||
|
||||
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[head_organ.f_style]
|
||||
var/datum/sprite_accessory/facial_hair_style = GLOB.facial_hair_styles_list[head_organ.f_style]
|
||||
if(facial_hair_style && facial_hair_style.species_allowed)
|
||||
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
|
||||
if(istype(head_organ.dna.species, /datum/species/slime))
|
||||
@@ -451,14 +451,14 @@ var/record_id_num = 1001
|
||||
if((H.dna.species.bodyflags & HAS_HEAD_MARKINGS) || (H.dna.species.bodyflags & HAS_BODY_MARKINGS))
|
||||
if(H.dna.species.bodyflags & HAS_BODY_MARKINGS) //Body markings.
|
||||
var/body_marking = H.m_styles["body"]
|
||||
var/datum/sprite_accessory/body_marking_style = marking_styles_list[body_marking]
|
||||
var/datum/sprite_accessory/body_marking_style = GLOB.marking_styles_list[body_marking]
|
||||
if(body_marking_style && body_marking_style.species_allowed)
|
||||
var/icon/b_marking_s = new/icon("icon" = body_marking_style.icon, "icon_state" = "[body_marking_style.icon_state]_s")
|
||||
b_marking_s.Blend(H.m_colours["body"], ICON_ADD)
|
||||
face_s.Blend(b_marking_s, ICON_OVERLAY)
|
||||
if(H.dna.species.bodyflags & HAS_HEAD_MARKINGS) //Head markings.
|
||||
var/head_marking = H.m_styles["head"]
|
||||
var/datum/sprite_accessory/head_marking_style = marking_styles_list[head_marking]
|
||||
var/datum/sprite_accessory/head_marking_style = GLOB.marking_styles_list[head_marking]
|
||||
if(head_marking_style && head_marking_style.species_allowed)
|
||||
var/icon/h_marking_s = new/icon("icon" = head_marking_style.icon, "icon_state" = "[head_marking_style.icon_state]_s")
|
||||
h_marking_s.Blend(H.m_colours["head"], ICON_ADD)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
var/gc_destroyed //Time when this object was destroyed.
|
||||
var/list/active_timers //for SStimer
|
||||
var/list/datum_components //for /datum/components
|
||||
var/list/comp_lookup
|
||||
var/var_edited = FALSE //Warranty void if seal is broken
|
||||
|
||||
var/tmp/unique_datum_id = null
|
||||
@@ -37,6 +38,19 @@
|
||||
qdel(C, FALSE, TRUE)
|
||||
dc.Cut()
|
||||
|
||||
var/list/lookup = comp_lookup
|
||||
if(lookup)
|
||||
for(var/sig in lookup)
|
||||
var/list/comps = lookup[sig]
|
||||
if(length(comps))
|
||||
for(var/i in comps)
|
||||
var/datum/component/comp = i
|
||||
comp.UnregisterSignal(src, sig)
|
||||
else
|
||||
var/datum/component/comp = comps
|
||||
comp.UnregisterSignal(src, sig)
|
||||
comp_lookup = lookup = null
|
||||
|
||||
return QDEL_HINT_QUEUE
|
||||
|
||||
|
||||
|
||||
@@ -817,7 +817,7 @@
|
||||
|
||||
if(A.reagents)
|
||||
var/chosen_id
|
||||
var/list/reagent_options = sortAssoc(chemical_reagents_list)
|
||||
var/list/reagent_options = sortAssoc(GLOB.chemical_reagents_list)
|
||||
switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID"))
|
||||
if("Enter ID")
|
||||
var/valid_id
|
||||
@@ -1033,7 +1033,7 @@
|
||||
to_chat(usr, "This can only be done to instances of type /mob")
|
||||
return
|
||||
|
||||
var/new_language = input("Please choose a language to add.","Language",null) as null|anything in all_languages
|
||||
var/new_language = input("Please choose a language to add.","Language",null) as null|anything in GLOB.all_languages
|
||||
|
||||
if(!new_language)
|
||||
return
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
var/datum/disease/DD = new D.type(1, D, 0)
|
||||
viruses += DD
|
||||
DD.affected_mob = src
|
||||
active_diseases += DD //Add it to the active diseases list, now that it's actually in a mob and being processed.
|
||||
GLOB.active_diseases += DD //Add it to the active diseases list, now that it's actually in a mob and being processed.
|
||||
|
||||
//Copy properties over. This is so edited diseases persist.
|
||||
var/list/skipped = list("affected_mob","holder","carrier","stage","type","parent_type","vars","transformed")
|
||||
|
||||
@@ -67,7 +67,7 @@ var/list/diseases = subtypesof(/datum/disease)
|
||||
|
||||
/datum/disease/Destroy()
|
||||
affected_mob = null
|
||||
active_diseases.Remove(src)
|
||||
GLOB.active_diseases.Remove(src)
|
||||
return ..()
|
||||
|
||||
/datum/disease/proc/stage_act()
|
||||
|
||||
@@ -251,7 +251,7 @@ var/list/advance_cures = list(
|
||||
cures = list(advance_cures[res])
|
||||
|
||||
// Get the cure name from the cure_id
|
||||
var/datum/reagent/D = chemical_reagents_list[cures[1]]
|
||||
var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]]
|
||||
cure_text = D.name
|
||||
|
||||
|
||||
@@ -394,10 +394,10 @@ var/list/advance_cures = list(
|
||||
D.AssignName(new_name)
|
||||
D.Refresh()
|
||||
|
||||
for(var/datum/disease/advance/AD in active_diseases)
|
||||
for(var/datum/disease/advance/AD in GLOB.active_diseases)
|
||||
AD.Refresh()
|
||||
|
||||
for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
|
||||
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
|
||||
if(!is_station_level(H.z))
|
||||
continue
|
||||
if(!H.HasDisease(D))
|
||||
|
||||
@@ -24,35 +24,31 @@ Bonus
|
||||
level = 5
|
||||
severity = 0
|
||||
|
||||
/datum/symptom/sensory_restoration/proc/check_and_add(reagent, check, add, mob/living/M)
|
||||
if(M.reagents.get_reagent_amount(reagent) < check)
|
||||
M.reagents.add_reagent(reagent, add)
|
||||
return 1
|
||||
|
||||
/datum/symptom/sensory_restoration/Activate(var/datum/disease/advance/A)
|
||||
..()
|
||||
if(prob(SYMPTOM_ACTIVATION_PROB * 3))
|
||||
var/mob/living/M = A.affected_mob
|
||||
var/datum/reagents/RD = M.reagents
|
||||
|
||||
switch(A.stage)
|
||||
if(2)
|
||||
if(check_and_add("oculine", 10, 10, M))
|
||||
if(RD.check_and_add("oculine", 10, 10))
|
||||
to_chat(M, "<span class='notice'>Your hearing feels clearer and crisp.</span>")
|
||||
if(3)
|
||||
if(check_and_add("antihol", 10, 10, M))
|
||||
if(RD.check_and_add("antihol", 10, 10))
|
||||
to_chat(M, "<span class='notice'>You feel sober.</span>")
|
||||
check_and_add("oculine", 10, 10, M)
|
||||
RD.check_and_add("oculine", 10, 10)
|
||||
if(4)
|
||||
if(check_and_add("synaphydramine", 10, 5, M))
|
||||
if(RD.check_and_add("synaphydramine", 10, 5))
|
||||
to_chat(M, "<span class='notice'>You feel focused.</span>")
|
||||
check_and_add("antihol", 10, 10, M)
|
||||
check_and_add("oculine", 10, 10, M)
|
||||
RD.check_and_add("antihol", 10, 10)
|
||||
RD.check_and_add("oculine", 10, 10)
|
||||
if(5)
|
||||
if(check_and_add("mannitol", 10, 10, M))
|
||||
if(RD.check_and_add("mannitol", 10, 10))
|
||||
to_chat(M, "<span class='notice'>Your mind feels relaxed.</span>")
|
||||
check_and_add("synaphydramine", 10, 5, M)
|
||||
check_and_add("antihol", 10, 10, M)
|
||||
check_and_add("oculine", 10, 10, M)
|
||||
RD.check_and_add("synaphydramine", 10, 5)
|
||||
RD.check_and_add("antihol", 10, 10)
|
||||
RD.check_and_add("oculine", 10, 10)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -8,168 +8,168 @@
|
||||
var/list/steps_desc
|
||||
var/taskpath = null // Path of job objective completed.
|
||||
|
||||
New(atom)
|
||||
..()
|
||||
holder = atom
|
||||
if(!holder) //don't want this without a holder
|
||||
spawn
|
||||
qdel(src)
|
||||
/datum/construction/New(atom)
|
||||
..()
|
||||
holder = atom
|
||||
if(!holder) //don't want this without a holder
|
||||
spawn
|
||||
qdel(src)
|
||||
set_desc(steps.len)
|
||||
return
|
||||
|
||||
/datum/construction/proc/next_step(mob/user as mob)
|
||||
steps.len--
|
||||
if(!steps.len)
|
||||
spawn_result(user)
|
||||
else
|
||||
set_desc(steps.len)
|
||||
return
|
||||
return
|
||||
|
||||
proc/next_step(mob/user as mob)
|
||||
steps.len--
|
||||
if(!steps.len)
|
||||
spawn_result(user)
|
||||
/datum/construction/proc/action(atom/used_atom,mob/user as mob)
|
||||
return
|
||||
|
||||
/datum/construction/proc/check_step(atom/used_atom,mob/user as mob) //check last step only
|
||||
var/valid_step = is_right_key(used_atom)
|
||||
if(valid_step)
|
||||
if(custom_action(valid_step, used_atom, user))
|
||||
next_step(user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/construction/proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
|
||||
var/list/L = steps[steps.len]
|
||||
if(istype(used_atom, L["key"]))
|
||||
return steps.len
|
||||
return 0
|
||||
|
||||
/datum/construction/proc/custom_action(step, used_atom, user)
|
||||
if(istype(used_atom, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/W = used_atom
|
||||
if(W.remove_fuel(0, user))
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
else
|
||||
set_desc(steps.len)
|
||||
return
|
||||
return 0
|
||||
else if(istype(used_atom, /obj/item/wrench))
|
||||
var/obj/item/wrench/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
|
||||
proc/action(atom/used_atom,mob/user as mob)
|
||||
return
|
||||
else if(istype(used_atom, /obj/item/screwdriver))
|
||||
var/obj/item/screwdriver/S = used_atom
|
||||
playsound(holder, S.usesound, 50, 1)
|
||||
|
||||
proc/check_step(atom/used_atom,mob/user as mob) //check last step only
|
||||
var/valid_step = is_right_key(used_atom)
|
||||
if(valid_step)
|
||||
if(custom_action(valid_step, used_atom, user))
|
||||
next_step(user)
|
||||
return 1
|
||||
return 0
|
||||
else if(istype(used_atom, /obj/item/wirecutters))
|
||||
var/obj/item/wirecutters/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
|
||||
proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
|
||||
var/list/L = steps[steps.len]
|
||||
else if(istype(used_atom, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = used_atom
|
||||
if(C.amount<4)
|
||||
to_chat(user, ("<span class='warning'>There's not enough cable to finish the task.</span>"))
|
||||
return 0
|
||||
else
|
||||
C.use(4)
|
||||
playsound(holder, C.usesound, 50, 1)
|
||||
else if(istype(used_atom, /obj/item/stack))
|
||||
var/obj/item/stack/S = used_atom
|
||||
if(S.amount < 5)
|
||||
to_chat(user, ("<span class='warning'>There's not enough material in this stack.</span>"))
|
||||
return 0
|
||||
else
|
||||
S.use(5)
|
||||
return 1
|
||||
|
||||
/datum/construction/proc/check_all_steps(atom/used_atom,mob/user as mob) //check all steps, remove matching one.
|
||||
for(var/i=1;i<=steps.len;i++)
|
||||
var/list/L = steps[i];
|
||||
if(istype(used_atom, L["key"]))
|
||||
return steps.len
|
||||
return 0
|
||||
if(custom_action(i, used_atom, user))
|
||||
steps[i]=null;//stupid byond list from list removal...
|
||||
listclearnulls(steps);
|
||||
if(!steps.len)
|
||||
spawn_result(user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/custom_action(step, used_atom, user)
|
||||
if(istype(used_atom, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/W = used_atom
|
||||
if(W.remove_fuel(0, user))
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
else
|
||||
|
||||
/datum/construction/proc/spawn_result(mob/user as mob)
|
||||
if(result)
|
||||
if(taskpath)
|
||||
var/datum/job_objective/task = user.mind.findJobTask(taskpath)
|
||||
if(istype(task))
|
||||
task.unit_completed()
|
||||
|
||||
new result(get_turf(holder))
|
||||
spawn()
|
||||
qdel(holder)
|
||||
return
|
||||
|
||||
/datum/construction/proc/set_desc(index as num)
|
||||
var/list/step = steps[index]
|
||||
holder.desc = step["desc"]
|
||||
return
|
||||
|
||||
/datum/construction/proc/try_consume(mob/user as mob, atom/used_atom, amount)
|
||||
if(amount > 0)
|
||||
// CABLES
|
||||
if(istype(used_atom,/obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil=used_atom
|
||||
if(!coil.use(amount))
|
||||
to_chat(user, "<span class='warning'>You don't have enough cable! You need at least [amount] coils.</span>")
|
||||
return 0
|
||||
else if(istype(used_atom, /obj/item/wrench))
|
||||
var/obj/item/wrench/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/screwdriver))
|
||||
var/obj/item/screwdriver/S = used_atom
|
||||
playsound(holder, S.usesound, 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/wirecutters))
|
||||
var/obj/item/wirecutters/W = used_atom
|
||||
playsound(holder, W.usesound, 50, 1)
|
||||
|
||||
else if(istype(used_atom, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = used_atom
|
||||
if(C.amount<4)
|
||||
to_chat(user, ("<span class='warning'>There's not enough cable to finish the task.</span>"))
|
||||
// WELDER
|
||||
if(istype(used_atom,/obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/welder=used_atom
|
||||
if(!welder.isOn())
|
||||
to_chat(user, "<span class='notice'>You tap the [src] with your unlit welder. [pick("Ding","Dong")].</span>")
|
||||
return 0
|
||||
else
|
||||
C.use(4)
|
||||
playsound(holder, C.usesound, 50, 1)
|
||||
else if(istype(used_atom, /obj/item/stack))
|
||||
var/obj/item/stack/S = used_atom
|
||||
if(S.amount < 5)
|
||||
to_chat(user, ("<span class='warning'>There's not enough material in this stack.</span>"))
|
||||
if(!welder.remove_fuel(amount,user))
|
||||
to_chat(user, "<span class='warning'>You don't have enough fuel!</span>")
|
||||
return 0
|
||||
else
|
||||
S.use(5)
|
||||
return 1
|
||||
|
||||
proc/check_all_steps(atom/used_atom,mob/user as mob) //check all steps, remove matching one.
|
||||
for(var/i=1;i<=steps.len;i++)
|
||||
var/list/L = steps[i];
|
||||
if(istype(used_atom, L["key"]))
|
||||
if(custom_action(i, used_atom, user))
|
||||
steps[i]=null;//stupid byond list from list removal...
|
||||
listclearnulls(steps);
|
||||
if(!steps.len)
|
||||
spawn_result(user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
proc/spawn_result(mob/user as mob)
|
||||
if(result)
|
||||
if(taskpath)
|
||||
var/datum/job_objective/task = user.mind.findJobTask(taskpath)
|
||||
if(istype(task))
|
||||
task.unit_completed()
|
||||
|
||||
new result(get_turf(holder))
|
||||
spawn()
|
||||
qdel(holder)
|
||||
return
|
||||
|
||||
proc/set_desc(index as num)
|
||||
var/list/step = steps[index]
|
||||
holder.desc = step["desc"]
|
||||
return
|
||||
|
||||
proc/try_consume(mob/user as mob, atom/used_atom, amount)
|
||||
if(amount > 0)
|
||||
// CABLES
|
||||
if(istype(used_atom,/obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil=used_atom
|
||||
if(!coil.use(amount))
|
||||
to_chat(user, "<span class='warning'>You don't have enough cable! You need at least [amount] coils.</span>")
|
||||
return 0
|
||||
// WELDER
|
||||
if(istype(used_atom,/obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/welder=used_atom
|
||||
if(!welder.isOn())
|
||||
to_chat(user, "<span class='notice'>You tap the [src] with your unlit welder. [pick("Ding","Dong")].</span>")
|
||||
return 0
|
||||
if(!welder.remove_fuel(amount,user))
|
||||
to_chat(user, "<span class='warning'>You don't have enough fuel!</span>")
|
||||
return 0
|
||||
// STACKS
|
||||
if(istype(used_atom,/obj/item/stack))
|
||||
var/obj/item/stack/stack=used_atom
|
||||
if(stack.amount < amount)
|
||||
to_chat(user, "<span class='warning'>You don't have enough [stack]! You need at least [amount].</span>")
|
||||
return 0
|
||||
stack.use(amount)
|
||||
return 1
|
||||
// STACKS
|
||||
if(istype(used_atom,/obj/item/stack))
|
||||
var/obj/item/stack/stack=used_atom
|
||||
if(stack.amount < amount)
|
||||
to_chat(user, "<span class='warning'>You don't have enough [stack]! You need at least [amount].</span>")
|
||||
return 0
|
||||
stack.use(amount)
|
||||
return 1
|
||||
|
||||
/datum/construction/reversible
|
||||
var/index
|
||||
|
||||
New(atom)
|
||||
..()
|
||||
index = steps.len
|
||||
return
|
||||
/datum/construction/reversible/New(atom)
|
||||
..()
|
||||
index = steps.len
|
||||
return
|
||||
|
||||
proc/update_index(diff as num, mob/user as mob)
|
||||
index+=diff
|
||||
if(index==0)
|
||||
spawn_result(user)
|
||||
else
|
||||
set_desc(index)
|
||||
return
|
||||
/datum/construction/reversible/proc/update_index(diff as num, mob/user as mob)
|
||||
index+=diff
|
||||
if(index==0)
|
||||
spawn_result(user)
|
||||
else
|
||||
set_desc(index)
|
||||
return
|
||||
|
||||
is_right_key(atom/used_atom) // returns index step
|
||||
var/list/L = steps[index]
|
||||
if(istype(used_atom, L["key"]))
|
||||
return FORWARD //to the first step -> forward
|
||||
else if(L["backkey"] && istype(used_atom, L["backkey"]))
|
||||
return BACKWARD //to the last step -> backwards
|
||||
/datum/construction/reversible/is_right_key(atom/used_atom) // returns index step
|
||||
var/list/L = steps[index]
|
||||
if(istype(used_atom, L["key"]))
|
||||
return FORWARD //to the first step -> forward
|
||||
else if(L["backkey"] && istype(used_atom, L["backkey"]))
|
||||
return BACKWARD //to the last step -> backwards
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible/check_step(atom/used_atom,mob/user as mob)
|
||||
var/diff = is_right_key(used_atom)
|
||||
if(diff)
|
||||
if(custom_action(index, diff, used_atom, user))
|
||||
update_index(diff, user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible/custom_action(index, diff, used_atom, user)
|
||||
if(!..(index,used_atom,user))
|
||||
return 0
|
||||
|
||||
check_step(atom/used_atom,mob/user as mob)
|
||||
var/diff = is_right_key(used_atom)
|
||||
if(diff)
|
||||
if(custom_action(index, diff, used_atom, user))
|
||||
update_index(diff, user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
custom_action(index, diff, used_atom, user)
|
||||
if(!..(index,used_atom,user))
|
||||
return 0
|
||||
return 1
|
||||
return 1
|
||||
|
||||
#define state_next "next"
|
||||
#define state_prev "prev"
|
||||
@@ -178,73 +178,74 @@
|
||||
var/index
|
||||
var/base_icon = "durand"
|
||||
|
||||
New(atom)
|
||||
..()
|
||||
index = 1
|
||||
return
|
||||
/datum/construction/reversible2/New(atom)
|
||||
..()
|
||||
index = 1
|
||||
return
|
||||
|
||||
proc/update_index(diff as num, mob/user as mob)
|
||||
index-=diff
|
||||
if(index==steps.len+1)
|
||||
spawn_result(user)
|
||||
else
|
||||
set_desc(index)
|
||||
return
|
||||
/datum/construction/reversible2/proc/update_index(diff as num, mob/user as mob)
|
||||
index-=diff
|
||||
if(index==steps.len+1)
|
||||
spawn_result(user)
|
||||
else
|
||||
set_desc(index)
|
||||
return
|
||||
|
||||
proc/update_icon()
|
||||
holder.icon_state="[base_icon]_[index]"
|
||||
/datum/construction/reversible2/proc/update_icon()
|
||||
holder.icon_state="[base_icon]_[index]"
|
||||
|
||||
is_right_key(mob/user as mob,atom/used_atom) // returns index step
|
||||
var/list/state = steps[index]
|
||||
if(state_next in state)
|
||||
var/list/step = state[state_next]
|
||||
if(istype(used_atom, step["key"]))
|
||||
//if(L["consume"] && !try_consume(used_atom,L["consume"]))
|
||||
// return 0
|
||||
return FORWARD //to the first step -> forward
|
||||
else if(state_prev in state)
|
||||
var/list/step = state[state_prev]
|
||||
if(istype(used_atom, step["key"]))
|
||||
//if(L["consume"] && !try_consume(used_atom,L["consume"]))
|
||||
// return 0
|
||||
return BACKWARD //to the first step -> forward
|
||||
/datum/construction/reversible2/is_right_key(mob/user as mob,atom/used_atom) // returns index step
|
||||
var/list/state = steps[index]
|
||||
if(state_next in state)
|
||||
var/list/step = state[state_next]
|
||||
if(istype(used_atom, step["key"]))
|
||||
//if(L["consume"] && !try_consume(used_atom,L["consume"]))
|
||||
// return 0
|
||||
return FORWARD //to the first step -> forward
|
||||
else if(state_prev in state)
|
||||
var/list/step = state[state_prev]
|
||||
if(istype(used_atom, step["key"]))
|
||||
//if(L["consume"] && !try_consume(used_atom,L["consume"]))
|
||||
// return 0
|
||||
return BACKWARD //to the first step -> forward
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible2/check_step(atom/used_atom,mob/user as mob)
|
||||
var/diff = is_right_key(user,used_atom)
|
||||
if(diff)
|
||||
if(custom_action(index, diff, used_atom, user))
|
||||
update_index(diff,user)
|
||||
update_icon()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible2/proc/fixText(text,user)
|
||||
text = replacetext(text,"{USER}","[user]")
|
||||
text = replacetext(text,"{HOLDER}","[holder]")
|
||||
return text
|
||||
|
||||
/datum/construction/reversible2/custom_action(index, diff, used_atom, var/mob/user)
|
||||
if(!..(index,used_atom,user))
|
||||
return 0
|
||||
|
||||
check_step(atom/used_atom,mob/user as mob)
|
||||
var/diff = is_right_key(user,used_atom)
|
||||
if(diff)
|
||||
if(custom_action(index, diff, used_atom, user))
|
||||
update_index(diff,user)
|
||||
update_icon()
|
||||
return 1
|
||||
return 0
|
||||
var/list/step = steps[index]
|
||||
var/list/state = step[diff==FORWARD ? state_next : state_prev]
|
||||
user.visible_message(fixText(state["vis_msg"],user),fixText(state["self_msg"],user))
|
||||
|
||||
proc/fixText(text,user)
|
||||
text = replacetext(text,"{USER}","[user]")
|
||||
text = replacetext(text,"{HOLDER}","[holder]")
|
||||
return text
|
||||
if("delete" in state)
|
||||
qdel(used_atom)
|
||||
else if("spawn" in state)
|
||||
var/spawntype=state["spawn"]
|
||||
var/atom/A = new spawntype(holder.loc)
|
||||
if("amount" in state)
|
||||
if(istype(A,/obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C=A
|
||||
C.amount=state["amount"]
|
||||
if(istype(A,/obj/item/stack))
|
||||
var/obj/item/stack/S=A
|
||||
S.amount=state["amount"]
|
||||
|
||||
custom_action(index, diff, used_atom, var/mob/user)
|
||||
if(!..(index,used_atom,user))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
var/list/step = steps[index]
|
||||
var/list/state = step[diff==FORWARD ? state_next : state_prev]
|
||||
user.visible_message(fixText(state["vis_msg"],user),fixText(state["self_msg"],user))
|
||||
|
||||
if("delete" in state)
|
||||
qdel(used_atom)
|
||||
else if("spawn" in state)
|
||||
var/spawntype=state["spawn"]
|
||||
var/atom/A = new spawntype(holder.loc)
|
||||
if("amount" in state)
|
||||
if(istype(A,/obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C=A
|
||||
C.amount=state["amount"]
|
||||
if(istype(A,/obj/item/stack))
|
||||
var/obj/item/stack/S=A
|
||||
S.amount=state["amount"]
|
||||
|
||||
return 1
|
||||
action(used_atom,user)
|
||||
return check_step(used_atom,user)
|
||||
/datum/construction/reversible2/action(used_atom,user)
|
||||
return check_step(used_atom,user)
|
||||
|
||||
@@ -57,98 +57,96 @@ Data storage vars:
|
||||
var/result
|
||||
var/state = 0
|
||||
|
||||
New(list/arguments=null,autostart=1)
|
||||
delay = delay>0?(delay):1
|
||||
if(forbid_garbage) //prevents garbage collection with tag != null
|
||||
tag = "\ref[src]"
|
||||
set_process_args(arguments)
|
||||
if(autostart)
|
||||
start()
|
||||
return
|
||||
/datum/global_iterator/New(list/arguments=null,autostart=1)
|
||||
delay = delay>0?(delay):1
|
||||
if(forbid_garbage) //prevents garbage collection with tag != null
|
||||
tag = "\ref[src]"
|
||||
set_process_args(arguments)
|
||||
if(autostart)
|
||||
start()
|
||||
return
|
||||
|
||||
proc/main()
|
||||
state = 1
|
||||
while(src && control_switch)
|
||||
last_exec = world.timeofday
|
||||
if(check_for_null && has_null_args())
|
||||
stop()
|
||||
/datum/global_iterator/proc/main()
|
||||
state = 1
|
||||
while(src && control_switch)
|
||||
last_exec = world.timeofday
|
||||
if(check_for_null && has_null_args())
|
||||
stop()
|
||||
return 0
|
||||
result = process(arglist(arg_list))
|
||||
for(var/sleep_time=delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace.
|
||||
if(!control_switch)
|
||||
return 0
|
||||
result = process(arglist(arg_list))
|
||||
for(var/sleep_time=delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace.
|
||||
if(!control_switch)
|
||||
return 0
|
||||
sleep(1)
|
||||
return 0
|
||||
|
||||
proc/start(list/arguments=null)
|
||||
if(active())
|
||||
return
|
||||
if(arguments)
|
||||
if(!set_process_args(arguments))
|
||||
return 0
|
||||
if(!state_check()) //the main loop is sleeping, wait for it to terminate.
|
||||
return
|
||||
control_switch = 1
|
||||
spawn()
|
||||
state = main()
|
||||
return 1
|
||||
|
||||
proc/stop()
|
||||
if(!active())
|
||||
return
|
||||
control_switch = 0
|
||||
spawn(-1) //report termination error but don't wait for state_check().
|
||||
state_check()
|
||||
return 1
|
||||
|
||||
proc/state_check()
|
||||
var/lag = 0
|
||||
while(state)
|
||||
sleep(1)
|
||||
if(++lag>10)
|
||||
CRASH("The global_iterator loop \ref[src] failed to terminate in designated timeframe. This may be caused by server lagging.")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/process()
|
||||
/datum/global_iterator/proc/start(list/arguments=null)
|
||||
if(active())
|
||||
return
|
||||
if(arguments)
|
||||
if(!set_process_args(arguments))
|
||||
return 0
|
||||
if(!state_check()) //the main loop is sleeping, wait for it to terminate.
|
||||
return
|
||||
control_switch = 1
|
||||
spawn()
|
||||
state = main()
|
||||
return 1
|
||||
|
||||
proc/active()
|
||||
return control_switch
|
||||
/datum/global_iterator/proc/stop()
|
||||
if(!active())
|
||||
return
|
||||
control_switch = 0
|
||||
spawn(-1) //report termination error but don't wait for state_check().
|
||||
state_check()
|
||||
return 1
|
||||
|
||||
proc/has_null_args()
|
||||
if(null in arg_list)
|
||||
return 1
|
||||
/datum/global_iterator/proc/state_check()
|
||||
var/lag = 0
|
||||
while(state)
|
||||
sleep(1)
|
||||
if(++lag>10)
|
||||
CRASH("The global_iterator loop \ref[src] failed to terminate in designated timeframe. This may be caused by server lagging.")
|
||||
return 1
|
||||
|
||||
/datum/global_iterator/proc/process()
|
||||
return
|
||||
|
||||
/datum/global_iterator/proc/active()
|
||||
return control_switch
|
||||
|
||||
/datum/global_iterator/proc/has_null_args()
|
||||
if(null in arg_list)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/datum/global_iterator/proc/set_delay(new_delay)
|
||||
if(isnum(new_delay))
|
||||
delay = max(1, round(new_delay))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/datum/global_iterator/proc/get_last_exec_time()
|
||||
return (last_exec||0)
|
||||
|
||||
proc/set_delay(new_delay)
|
||||
if(isnum(new_delay))
|
||||
delay = max(1, round(new_delay))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
/datum/global_iterator/proc/get_last_exec_time_as_text()
|
||||
return (time2text(last_exec)||"Wasn't executed yet")
|
||||
|
||||
proc/get_last_exec_time()
|
||||
return (last_exec||0)
|
||||
|
||||
proc/get_last_exec_time_as_text()
|
||||
return (time2text(last_exec)||"Wasn't executed yet")
|
||||
|
||||
proc/set_process_args(list/arguments)
|
||||
if(arguments && istype(arguments, /list) && arguments.len)
|
||||
arg_list = arguments
|
||||
return 1
|
||||
else
|
||||
/datum/global_iterator/proc/set_process_args(list/arguments)
|
||||
if(arguments && istype(arguments, /list) && arguments.len)
|
||||
arg_list = arguments
|
||||
return 1
|
||||
else
|
||||
// to_chat(world, "<span class='warning'>Invalid arguments supplied for [src.type], ref = \ref[src]</span>")
|
||||
return 0
|
||||
|
||||
proc/toggle_null_checks()
|
||||
check_for_null = !check_for_null
|
||||
return check_for_null
|
||||
|
||||
proc/toggle()
|
||||
if(!stop())
|
||||
start()
|
||||
return active()
|
||||
return 0
|
||||
|
||||
/datum/global_iterator/proc/toggle_null_checks()
|
||||
check_for_null = !check_for_null
|
||||
return check_for_null
|
||||
|
||||
/datum/global_iterator/proc/toggle()
|
||||
if(!stop())
|
||||
start()
|
||||
return active()
|
||||
|
||||
@@ -2,59 +2,59 @@
|
||||
var/href
|
||||
var/list/href_list
|
||||
|
||||
New(thref,list/thref_list)
|
||||
href = thref
|
||||
href_list = thref_list.Copy()
|
||||
return
|
||||
/datum/topic_input/New(thref,list/thref_list)
|
||||
href = thref
|
||||
href_list = thref_list.Copy()
|
||||
return
|
||||
|
||||
proc/get(i)
|
||||
return listgetindex(href_list,i)
|
||||
/datum/topic_input/proc/get(i)
|
||||
return listgetindex(href_list,i)
|
||||
|
||||
proc/getAndLocate(i)
|
||||
var/t = get(i)
|
||||
if(t)
|
||||
t = locate(t)
|
||||
return t || null
|
||||
/datum/topic_input/proc/getAndLocate(i)
|
||||
var/t = get(i)
|
||||
if(t)
|
||||
t = locate(t)
|
||||
return t || null
|
||||
|
||||
proc/getNum(i)
|
||||
var/t = get(i)
|
||||
if(t)
|
||||
t = text2num(t)
|
||||
return isnum(t) ? t : null
|
||||
/datum/topic_input/proc/getNum(i)
|
||||
var/t = get(i)
|
||||
if(t)
|
||||
t = text2num(t)
|
||||
return isnum(t) ? t : null
|
||||
|
||||
proc/getObj(i)
|
||||
var/t = getAndLocate(i)
|
||||
return isobj(t) ? t : null
|
||||
/datum/topic_input/proc/getObj(i)
|
||||
var/t = getAndLocate(i)
|
||||
return isobj(t) ? t : null
|
||||
|
||||
proc/getMob(i)
|
||||
var/t = getAndLocate(i)
|
||||
return ismob(t) ? t : null
|
||||
/datum/topic_input/proc/getMob(i)
|
||||
var/t = getAndLocate(i)
|
||||
return ismob(t) ? t : null
|
||||
|
||||
proc/getTurf(i)
|
||||
var/t = getAndLocate(i)
|
||||
return isturf(t) ? t : null
|
||||
/datum/topic_input/proc/getTurf(i)
|
||||
var/t = getAndLocate(i)
|
||||
return isturf(t) ? t : null
|
||||
|
||||
proc/getAtom(i)
|
||||
return getType(i,/atom)
|
||||
/datum/topic_input/proc/getAtom(i)
|
||||
return getType(i,/atom)
|
||||
|
||||
proc/getArea(i)
|
||||
var/t = getAndLocate(i)
|
||||
return isarea(t) ? t : null
|
||||
/datum/topic_input/proc/getArea(i)
|
||||
var/t = getAndLocate(i)
|
||||
return isarea(t) ? t : null
|
||||
|
||||
proc/getStr(i)//params should always be text, but...
|
||||
var/t = get(i)
|
||||
return istext(t) ? t : null
|
||||
/datum/topic_input/proc/getStr(i)//params should always be text, but...
|
||||
var/t = get(i)
|
||||
return istext(t) ? t : null
|
||||
|
||||
proc/getType(i,type)
|
||||
var/t = getAndLocate(i)
|
||||
return istype(t,type) ? t : null
|
||||
/datum/topic_input/proc/getType(i,type)
|
||||
var/t = getAndLocate(i)
|
||||
return istype(t,type) ? t : null
|
||||
|
||||
proc/getPath(i)
|
||||
var/t = get(i)
|
||||
if(t)
|
||||
t = text2path(t)
|
||||
return ispath(t) ? t : null
|
||||
/datum/topic_input/proc/getPath(i)
|
||||
var/t = get(i)
|
||||
if(t)
|
||||
t = text2path(t)
|
||||
return ispath(t) ? t : null
|
||||
|
||||
proc/getList(i)
|
||||
var/t = getAndLocate(i)
|
||||
return islist(t) ? t : null
|
||||
/datum/topic_input/proc/getList(i)
|
||||
var/t = getAndLocate(i)
|
||||
return islist(t) ? t : null
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
for(var/I in callees)
|
||||
var/obj/machinery/hologram/holopad/H = I
|
||||
if(!QDELETED(H) && !(H.stat & NOPOWER))
|
||||
if(!QDELETED(H) && !(H.stat & NOPOWER) && H.anchored)
|
||||
dialed_holopads += H
|
||||
var/area/area = get_area(H)
|
||||
LAZYADD(H.holo_calls, src)
|
||||
@@ -159,7 +159,7 @@
|
||||
/datum/holocall/proc/Check()
|
||||
for(var/I in dialed_holopads)
|
||||
var/obj/machinery/hologram/holopad/H = I
|
||||
if((H.stat & NOPOWER))
|
||||
if((H.stat & NOPOWER) || !H.anchored)
|
||||
ConnectionFailure(H)
|
||||
|
||||
if(QDELETED(src))
|
||||
|
||||
+9
-16
@@ -1,32 +1,22 @@
|
||||
/* Note from Carnie:
|
||||
The way datum/mind stuff works has been changed a lot.
|
||||
Minds now represent IC characters rather than following a client around constantly.
|
||||
|
||||
Guidelines for using minds properly:
|
||||
|
||||
- Never mind.transfer_to(ghost). The var/current and var/original of a mind must always be of type mob/living!
|
||||
ghost.mind is however used as a reference to the ghost's corpse
|
||||
|
||||
- When creating a new mob for an existing IC character (e.g. cloning a dead guy or borging a brain of a human)
|
||||
the existing mind of the old mob should be transfered to the new mob like so:
|
||||
|
||||
mind.transfer_to(new_mob)
|
||||
|
||||
- You must not assign key= or ckey= after transfer_to() since the transfer_to transfers the client for you.
|
||||
By setting key or ckey explicitly after transfering the mind with transfer_to you will cause bugs like DCing
|
||||
the player.
|
||||
|
||||
- IMPORTANT NOTE 2, if you want a player to become a ghost, use mob.ghostize() It does all the hard work for you.
|
||||
|
||||
- When creating a new mob which will be a new IC character (e.g. putting a shade in a construct or randomly selecting
|
||||
a ghost to become a xeno during an event). Simply assign the key or ckey like you've always done.
|
||||
|
||||
new_mob.key = key
|
||||
|
||||
The Login proc will handle making a new mob for that mobtype (including setting up stuff like mind.name). Simple!
|
||||
However if you want that mind to have any special properties like being a traitor etc you will have to do that
|
||||
yourself.
|
||||
|
||||
*/
|
||||
|
||||
/datum/mind
|
||||
@@ -265,7 +255,7 @@
|
||||
. += "<b><font color='red'>OPERATIVE</b></font>|<a href='?src=[UID()];nuclear=clear'>no</a>"
|
||||
. += "<br><a href='?src=[UID()];nuclear=lair'>To shuttle</a>, <a href='?src=[UID()];common=undress'>undress</a>, <a href='?src=[UID()];nuclear=dressup'>dress up</a>."
|
||||
var/code
|
||||
for(var/obj/machinery/nuclearbomb/bombue in machines)
|
||||
for(var/obj/machinery/nuclearbomb/bombue in GLOB.machines)
|
||||
if(length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
|
||||
code = bombue.r_code
|
||||
break
|
||||
@@ -433,7 +423,7 @@
|
||||
return
|
||||
|
||||
if(href_list["role_edit"])
|
||||
var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in joblist
|
||||
var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in GLOB.joblist
|
||||
if(!new_role)
|
||||
return
|
||||
assigned_role = new_role
|
||||
@@ -608,6 +598,7 @@
|
||||
|
||||
if(objective)
|
||||
objectives -= objective
|
||||
qdel(objective)
|
||||
objectives.Insert(objective_pos, new_objective)
|
||||
else
|
||||
objectives += new_objective
|
||||
@@ -623,6 +614,7 @@
|
||||
|
||||
log_admin("[key_name(usr)] has removed one of [key_name(current)]'s objectives: [objective]")
|
||||
message_admins("[key_name_admin(usr)] has removed one of [key_name_admin(current)]'s objectives: [objective]")
|
||||
qdel(objective)
|
||||
|
||||
else if(href_list["obj_completed"])
|
||||
var/datum/objective/objective = locate(href_list["obj_completed"])
|
||||
@@ -949,6 +941,7 @@
|
||||
special_role = null
|
||||
for(var/datum/objective/nuclear/O in objectives)
|
||||
objectives-=O
|
||||
qdel(O)
|
||||
to_chat(current, "<span class='warning'><FONT size = 3><B>You have been brainwashed! You are no longer a syndicate operative!</B></FONT></span>")
|
||||
log_admin("[key_name(usr)] has de-nuke op'd [key_name(current)]")
|
||||
message_admins("[key_name_admin(usr)] has de-nuke op'd [key_name_admin(current)]")
|
||||
@@ -991,7 +984,7 @@
|
||||
|
||||
if("tellcode")
|
||||
var/code
|
||||
for(var/obj/machinery/nuclearbomb/bombue in machines)
|
||||
for(var/obj/machinery/nuclearbomb/bombue in GLOB.machines)
|
||||
if(length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN")
|
||||
code = bombue.r_code
|
||||
break
|
||||
@@ -1398,7 +1391,7 @@
|
||||
var/list/obj/effect/landmark/abductor/scientist_landmarks = new
|
||||
agent_landmarks.len = 4
|
||||
scientist_landmarks.len = 4
|
||||
for(var/obj/effect/landmark/abductor/A in landmarks_list)
|
||||
for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list)
|
||||
if(istype(A, /obj/effect/landmark/abductor/agent))
|
||||
agent_landmarks[text2num(A.team)] = A
|
||||
else if(istype(A, /obj/effect/landmark/abductor/scientist))
|
||||
@@ -1456,7 +1449,7 @@
|
||||
S.action.Grant(new_character)
|
||||
|
||||
/datum/mind/proc/get_ghost(even_if_they_cant_reenter)
|
||||
for(var/mob/dead/observer/G in dead_mob_list)
|
||||
for(var/mob/dead/observer/G in GLOB.dead_mob_list)
|
||||
if(G.mind == src)
|
||||
if(G.can_reenter_corpse || even_if_they_cant_reenter)
|
||||
return G
|
||||
@@ -1634,4 +1627,4 @@
|
||||
/mob/living/simple_animal/construct/armoured/mind_initialize()
|
||||
..()
|
||||
mind.assigned_role = "Juggernaut"
|
||||
mind.special_role = SPECIAL_ROLE_CULTIST
|
||||
mind.special_role = SPECIAL_ROLE_CULTIST
|
||||
@@ -669,9 +669,9 @@
|
||||
return
|
||||
|
||||
if(is_tsf_lieutenant)
|
||||
H.real_name = "Lieutenant [pick(last_names)]"
|
||||
H.real_name = "Lieutenant [pick(GLOB.last_names)]"
|
||||
else
|
||||
H.real_name = "[pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant First Class", "Master Sergeant", "Sergeant Major")] [pick(last_names)]"
|
||||
H.real_name = "[pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant First Class", "Master Sergeant", "Sergeant Major")] [pick(GLOB.last_names)]"
|
||||
H.name = H.real_name
|
||||
var/obj/item/card/id/I = H.wear_id
|
||||
if(istype(I))
|
||||
|
||||
@@ -261,9 +261,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
if(istype(target,/mob/living) && message)
|
||||
to_chat(target, text("[message]"))
|
||||
if(sparks_spread)
|
||||
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread()
|
||||
sparks.set_up(sparks_amt, 0, location) //no idea what the 0 is
|
||||
sparks.start()
|
||||
do_sparks(sparks_amt, 0, location)
|
||||
if(smoke_spread)
|
||||
if(smoke_spread == 1)
|
||||
var/datum/effect_system/smoke_spread/smoke = new
|
||||
@@ -328,10 +326,10 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/choose_targets(mob/user = usr)
|
||||
var/list/targets = list()
|
||||
|
||||
|
||||
switch(max_targets)
|
||||
if(0) //unlimited
|
||||
|
||||
|
||||
if(!humans_only)
|
||||
for(var/mob/living/target in view_or_range(range, user, selection_type))
|
||||
targets += target
|
||||
@@ -344,7 +342,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
targets += user
|
||||
else
|
||||
var/possible_targets = list()
|
||||
|
||||
|
||||
if(!humans_only)
|
||||
for(var/mob/living/M in view_or_range(range, user, selection_type))
|
||||
if(!include_user && user == M)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
/obj/effect/proc_holder/spell/aoe_turf/knock/greater/cast(list/targets, mob/user = usr)
|
||||
if(!used)
|
||||
used = TRUE
|
||||
for(var/obj/machinery/door/airlock/A in airlocks)
|
||||
for(var/obj/machinery/door/airlock/A in GLOB.airlocks)
|
||||
if(is_station_level(A.z))
|
||||
A.req_access = list()
|
||||
A.req_one_access = list()
|
||||
|
||||
@@ -68,7 +68,7 @@ Also, you never added distance checking after target is selected. I've went ahea
|
||||
|
||||
ghost.mind.transfer_to(caster)
|
||||
if(ghost.key)
|
||||
non_respawnable_keys -= ghost.ckey //ghostizing with an argument of 0 will make them unable to respawn forever, which is bad
|
||||
GLOB.non_respawnable_keys -= ghost.ckey //ghostizing with an argument of 0 will make them unable to respawn forever, which is bad
|
||||
caster.key = ghost.key //have to transfer the key since the mind was not active
|
||||
qdel(ghost)
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
var/obj/screen/alert/status_effect/A = owner.throw_alert(id, alert_type)
|
||||
A.attached_effect = src //so the alert can reference us, if it needs to
|
||||
linked_alert = A //so we can reference the alert, if we need to
|
||||
fast_processing.Add(src)
|
||||
GLOB.fast_processing.Add(src)
|
||||
return TRUE
|
||||
|
||||
/datum/status_effect/Destroy()
|
||||
fast_processing.Remove(src)
|
||||
GLOB.fast_processing.Remove(src)
|
||||
if(owner)
|
||||
owner.clear_alert(id)
|
||||
LAZYREMOVE(owner.status_effects, src)
|
||||
|
||||
@@ -923,6 +923,14 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine
|
||||
containername = "machine prototype crate"
|
||||
access = access_research
|
||||
|
||||
/datum/supply_packs/science/oil
|
||||
name = "Oil Tank Crate"
|
||||
contains = list(/obj/structure/reagent_dispensers/oil,
|
||||
/obj/item/reagent_containers/food/drinks/oilcan)
|
||||
cost = 10
|
||||
containertype = /obj/structure/largecrate
|
||||
containername = "oil tank crate"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////// Organic /////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -97,7 +97,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
|
||||
if(I)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/A = user
|
||||
log_game("[key_name(user)] purchased [I.name]")
|
||||
log_game("[key_name(user)] purchased [name]")
|
||||
A.put_in_any_hand_if_possible(I)
|
||||
|
||||
if(istype(I,/obj/item/storage/box/) && I.contents.len>0)
|
||||
@@ -220,7 +220,17 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
|
||||
cost = 5
|
||||
job = list("Chief Medical Officer", "Medical Doctor", "Geneticist", "Psychiatrist", "Chemist", "Paramedic", "Coroner", "Virologist")
|
||||
|
||||
/datum/uplink_item/dangerous/cat_grenade
|
||||
//Virology
|
||||
|
||||
/datum/uplink_item/jobspecific/viral_injector
|
||||
name = "Viral Injector"
|
||||
desc = "A modified hypospray disguised as a functional pipette. The pipette can infect victims with viruses upon injection."
|
||||
reference = "VI"
|
||||
item = /obj/item/reagent_containers/dropper/precision/viral_injector
|
||||
cost = 3
|
||||
job = list("Virologist")
|
||||
|
||||
/datum/uplink_item/jobspecific/cat_grenade
|
||||
name = "Feral Cat Delivery Grenade"
|
||||
desc = "The feral cat delivery grenade contains 8 dehydrated feral cats in a similar manner to dehydrated monkeys, which, upon detonation, will be rehydrated by a small reservoir of water contained within the grenade. These cats will then attack anything in sight."
|
||||
item = /obj/item/grenade/spawnergrenade/feral_cats
|
||||
@@ -967,6 +977,15 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
|
||||
item = /obj/item/storage/box/syndie_kit/safecracking
|
||||
cost = 1
|
||||
|
||||
/datum/uplink_item/stealthy_tools/clownkit
|
||||
name = "Honk Brand Infiltration Kit"
|
||||
desc = "All the tools you need to play the best prank Nanotrasen has ever seen. Includes a voice changer clown mask, magnetic clown shoes, and standard clown outfit, tools, and backpack."
|
||||
reference = "HBIK"
|
||||
item = /obj/item/storage/backpack/clown/syndie
|
||||
cost = 6
|
||||
gamemodes = list(/datum/game_mode/nuclear)
|
||||
surplus = 0
|
||||
|
||||
// DEVICE AND TOOLS
|
||||
|
||||
/datum/uplink_item/device_tools
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
weather_duration = rand(weather_duration_lower, weather_duration_upper)
|
||||
START_PROCESSING(SSweather, src)
|
||||
update_areas()
|
||||
for(var/M in player_list)
|
||||
for(var/M in GLOB.player_list)
|
||||
var/turf/mob_turf = get_turf(M)
|
||||
if(mob_turf && (mob_turf.z in impacted_z_levels))
|
||||
if(telegraph_message)
|
||||
@@ -74,7 +74,7 @@
|
||||
return
|
||||
stage = MAIN_STAGE
|
||||
update_areas()
|
||||
for(var/M in player_list)
|
||||
for(var/M in GLOB.player_list)
|
||||
var/turf/mob_turf = get_turf(M)
|
||||
if(mob_turf && (mob_turf.z in impacted_z_levels))
|
||||
if(weather_message)
|
||||
@@ -88,7 +88,7 @@
|
||||
return
|
||||
stage = WIND_DOWN_STAGE
|
||||
update_areas()
|
||||
for(var/M in player_list)
|
||||
for(var/M in GLOB.player_list)
|
||||
var/turf/mob_turf = get_turf(M)
|
||||
if(mob_turf && (mob_turf.z in impacted_z_levels))
|
||||
if(end_message)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if(issilicon(L))
|
||||
return
|
||||
for(var/obj/structure/O in L.loc)
|
||||
if(O.density || O.buckled_mob && istype(O, /obj/structure/stool/bed))
|
||||
if(O.density || O.buckled_mob && istype(O, /obj/structure/bed))
|
||||
return
|
||||
if(L.loc.density)
|
||||
return
|
||||
@@ -36,4 +36,4 @@
|
||||
|
||||
/datum/weather/floor_is_lava/fake
|
||||
name = "the floor is lava (fake)"
|
||||
aesthetic = TRUE
|
||||
aesthetic = TRUE
|
||||
|
||||
@@ -55,9 +55,10 @@ var/const/AIRLOCK_WIRE_LIGHT = 512
|
||||
/datum/wires/airlock/CanUse(mob/living/L)
|
||||
var/obj/machinery/door/airlock/A = holder
|
||||
if(iscarbon(L))
|
||||
if(A.isElectrified())
|
||||
if(A.shock(L, 100))
|
||||
return 0
|
||||
if(A.Adjacent(L))
|
||||
if(A.isElectrified())
|
||||
if(A.shock(L, 100))
|
||||
return 0
|
||||
if(A.panel_open)
|
||||
return 1
|
||||
return 0
|
||||
@@ -211,4 +212,4 @@ var/const/AIRLOCK_WIRE_LIGHT = 512
|
||||
A.lights = !A.lights
|
||||
A.update_icon()
|
||||
|
||||
..()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user