0 && index <= list.len)
// Returns the first key where T fulfills ispath
-/proc/get_ispath_key(var/list/L, var/T)
- for(var/key in L)
+/proc/get_ispath_key(var/list/target_list, var/T)
+ for(var/key in target_list)
if(ispath(T, key))
return key
// Gets the first instance that is of the given type (strictly)
-/proc/get_instance_of_strict_type(var/list/L, var/T)
- for(var/key in L)
+/proc/get_instance_of_strict_type(var/list/target_list, var/T)
+ for(var/key in target_list)
var/atom/A = key
if(A.type == T)
return A
@@ -865,5 +866,5 @@ var/global/list/json_cache = list()
)
/// Is this a dense (all keys have non-null values) associative list with at least one entry?
-/proc/is_dense_assoc(var/list/L)
- return length(L) > 0 && !isnull(L[L[1]])
+/proc/is_dense_assoc(var/list/target_list)
+ return length(target_list) > 0 && !isnull(target_list[target_list[1]])
diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm
index 5c1744b0178f..7e476912b248 100644
--- a/code/_helpers/logging.dm
+++ b/code/_helpers/logging.dm
@@ -214,4 +214,4 @@ var/global/log_end= world.system_type == UNIX ? ascii2text(13) : ""
/proc/report_progress(var/progress_message)
admin_notice("[progress_message]", R_DEBUG)
- to_world_log(progress_message)
+ log_world(progress_message)
diff --git a/code/_helpers/matrices.dm b/code/_helpers/matrices.dm
index e705300c4f30..230966857bb3 100644
--- a/code/_helpers/matrices.dm
+++ b/code/_helpers/matrices.dm
@@ -94,12 +94,12 @@
/// Changes distance hues have from grey while maintaining the overall lightness. Greys are unaffected.
/// * 1 is identity, 0 is greyscale, >1 oversaturates colors
/proc/color_matrix_saturation(value)
- var/inv = 1 - value
- var/R = round(LUMA_R * inv, 0.001)
- var/G = round(LUMA_G * inv, 0.001)
- var/B = round(LUMA_B * inv, 0.001)
+ var/inv = 1 - value
+ var/red = round(LUMA_R * inv, 0.001)
+ var/green = round(LUMA_G * inv, 0.001)
+ var/blue = round(LUMA_B * inv, 0.001)
- return list(R + value,R,R,0, G,G + value,G,0, B,B,B + value,0, 0,0,0,1, 0,0,0,0)
+ return list(red + value,red,red,0, green,green + value,green,0, blue,blue,blue + value,0, 0,0,0,1, 0,0,0,0)
#define LUMR 0.2126
#define LUMG 0.7152
@@ -111,11 +111,13 @@
if(value > 0)
value *= 3
var/x = 1 + value / 100
- var/inv = 1 - x
- var/R = LUMR * inv
- var/G = LUMG * inv
- var/B = LUMB * inv
- return list(R + x,R,R, G,G + x,G, B,B,B + x)
+
+ var/inv = 1 - x
+ var/red = LUMR * inv
+ var/green = LUMG * inv
+ var/blue = LUMB * inv
+ return list(red + x,red,red, green,green + x,green, blue,blue,blue + x)
+
#undef LUMR
#undef LUMG
#undef LUMB
@@ -189,7 +191,7 @@
/// Converts RGB shorthands into RGBA matrices complete of constants rows (ergo a 20 keys list in byond).
/proc/color_to_full_rgba_matrix(color)
if(istext(color))
- var/list/L = ReadRGB(color)
+ var/list/L = rgb2num(color)
if(!L)
CRASH("Invalid/unsupported color format argument in color_to_full_rgba_matrix()")
return list(L[1]/255,0,0,0, 0,L[2]/255,0,0, 0,0,L[3]/255,0, 0,0,0,L.len>3?L[4]/255:1, 0,0,0,0)
@@ -200,7 +202,7 @@
if(3 to 5) // row-by-row hexadecimals
. = list()
for(var/a in 1 to L.len)
- var/list/rgb = ReadRGB(L[a])
+ var/list/rgb = rgb2num(L[a])
for(var/b in rgb)
. += b/255
if(length(rgb) % 4) // RGB has no alpha instruction
diff --git a/code/_helpers/medical_scans.dm b/code/_helpers/medical_scans.dm
index 8e26d3d74db2..5d4b84e8df90 100644
--- a/code/_helpers/medical_scans.dm
+++ b/code/_helpers/medical_scans.dm
@@ -43,21 +43,19 @@
.["reagents"] = list()
if(reagents?.total_volume)
- for(var/liquid_type in reagents.liquid_volumes)
- var/decl/material/R = GET_DECL(liquid_type)
- var/list/reagent = list()
- reagent["name"]= R.get_reagent_name(reagents, MAT_PHASE_LIQUID)
- reagent["quantity"] = round(REAGENT_VOLUME(reagents, R.type),1)
- reagent["scannable"] = R.scannable
- .["reagents"] += list(reagent)
-
- for(var/solid_type in reagents.solid_volumes)
- var/decl/material/R = GET_DECL(solid_type)
- var/list/reagent = list()
- reagent["name"]= R.get_reagent_name(reagents, MAT_PHASE_SOLID)
- reagent["quantity"] = round(REAGENT_VOLUME(reagents, R.type),1)
- reagent["scannable"] = R.scannable
- .["reagents"] += list(reagent)
+ for(var/decl/material/reagent as anything in reagents.liquid_volumes)
+ var/list/reagent_data = list()
+ reagent_data["name"] = reagent.get_reagent_name(reagents, MAT_PHASE_LIQUID)
+ reagent_data["quantity"] = round(REAGENT_VOLUME(reagents, reagent),1)
+ reagent_data["scannable"] = reagent.scannable
+ .["reagents"] += list(reagent_data)
+
+ for(var/decl/material/reagent as anything in reagents.solid_volumes)
+ var/list/reagent_data = list()
+ reagent_data["name"] = reagent.get_reagent_name(reagents, MAT_PHASE_SOLID)
+ reagent_data["quantity"] = round(REAGENT_VOLUME(reagents, reagent),1)
+ reagent_data["scannable"] = reagent.scannable
+ .["reagents"] += list(reagent_data)
.["external_organs"] = list()
for(var/obj/item/organ/external/limb in get_external_organs())
@@ -241,9 +239,9 @@
dat += "| Antibody levels and immune system perfomance are at [scan["immune_system"]*100]% of baseline. |
"
var/other_reagent = FALSE
- for(var/list/R in scan["reagents"])
- if(R["scannable"])
- subdat += "| [R["quantity"]]u [R["name"]] |
"
+ for(var/list/reagent_data in scan["reagents"])
+ if(reagent_data["scannable"])
+ subdat += "| [reagent_data["quantity"]]u [reagent_data["name"]] |
"
else
other_reagent = TRUE
if(subdat)
diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm
index 6c040f5a57c9..269e7b986da1 100644
--- a/code/_helpers/mobs.dm
+++ b/code/_helpers/mobs.dm
@@ -9,7 +9,7 @@
/proc/random_name(gender, species)
if(species)
- var/decl/species/current_species = get_species_by_key(species)
+ var/decl/species/current_species = decls_repository.get_decl_by_id(species)
if(current_species)
var/decl/background_detail/background = current_species.get_default_background_datum_by_flag(BACKGROUND_FLAG_NAMING)
if(background)
@@ -28,13 +28,13 @@
return FALSE
if(!isrobot(thing.loc))
return FALSE
- var/mob/living/silicon/robot/R = thing.loc
- return (thing in R.module.equipment)
+ var/mob/living/silicon/robot/robot = thing.loc
+ return (thing in robot.module.equipment)
/proc/get_exposed_defense_zone(var/atom/movable/target)
return pick(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG, BP_CHEST, BP_GROIN)
-/proc/do_mob(mob/user , mob/target, time = 30, target_zone = 0, uninterruptible = 0, progress = 1, incapacitation_flags = INCAPACITATION_DEFAULT, check_holding = TRUE)
+/proc/do_mob(mob/user, mob/target, time = 30, target_zone = 0, uninterruptible = 0, progress = 1, incapacitation_flags = INCAPACITATION_DEFAULT, check_holding = TRUE)
if(!user || !target)
return 0
var/user_loc = user.loc
diff --git a/code/_helpers/profiling.dm b/code/_helpers/profiling.dm
index 0c4785568368..f02138db049f 100644
--- a/code/_helpers/profiling.dm
+++ b/code/_helpers/profiling.dm
@@ -110,7 +110,8 @@
var/init = call_ext(lib, "init")()
if("0" != init) CRASH("[lib] init error: [init]")
-/world/New()
+var/global/datum/profiler/_profiler = new
+/datum/profiler/New()
prof_init()
- . = ..()
+ ..()
#endif
diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm
index adccbbc543df..a264a7fff67a 100644
--- a/code/_helpers/text.dm
+++ b/code/_helpers/text.dm
@@ -614,9 +614,9 @@ var/global/regex/starts_lowercase_regex = regex(@"^[a-z]")
// If char isn't part of the text the entire text is returned
/proc/copytext_after_last(var/text, var/char)
- var/regex/R = regex("(\[^[char]\]*)$")
- R.Find(text)
- return R.group[1]
+ var/regex/copytext_regex = regex("(\[^[char]\]*)$")
+ copytext_regex.Find(text)
+ return copytext_regex.group[1]
/proc/sql_sanitize_text(var/text)
text = replacetext(text, "'", "''")
diff --git a/code/_macros.dm b/code/_macros.dm
index 11e6c146b5d5..62f7629af378 100644
--- a/code/_macros.dm
+++ b/code/_macros.dm
@@ -147,9 +147,9 @@
#define JOINTEXT(X) jointext(X, null)
-#define SPAN_STYLE(S, X) "[X]"
+#define SPAN_STYLE(S, X) "" + X + ""
+#define SPAN_CLASS(C, X) "" + X + ""
-#define SPAN_CLASS(C, X) "[X]"
#define SPAN_ITALIC(X) SPAN_CLASS("italic", X)
#define SPAN_BOLD(X) SPAN_CLASS("bold", X)
#define SPAN_NOTICE(X) SPAN_CLASS("notice", X)
@@ -174,6 +174,7 @@
#define SPAN_PALEPINK(X) SPAN_CLASS("font_palepink", X)
#define SPAN_SINISTER(X) SPAN_CLASS("sinister", X)
#define SPAN_MODERATE(X) SPAN_CLASS("moderate", X)
+#define SPAN_DEADSAY(X) SPAN_CLASS("deadsay", X)
// placeholders
#define SPAN_GOOD(X) SPAN_GREEN(X)
#define SPAN_NEUTRAL(X) SPAN_BLUE(X)
diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm
index 328becddbbfe..8aea97cf30db 100644
--- a/code/_onclick/adjacent.dm
+++ b/code/_onclick/adjacent.dm
@@ -144,8 +144,8 @@ Quick adjacency (to turf):
if(O.atom_flags & ATOM_FLAG_CHECKS_BORDER) // windows have throwpass but are on border, check them first
if( O.dir & target_dir || O.dir&(O.dir-1) ) // full tile windows are just diagonals mechanically
- var/obj/structure/window/W = target_atom
- if(istype(W) && W.is_fulltile()) //exception for breaking full tile windows on top of single pane windows
+ var/obj/structure/window/window = target_atom
+ if(istype(window) && window.is_fulltile()) //exception for breaking full tile windows on top of single pane windows
return 1
if(target_atom && (target_atom.atom_flags & ATOM_FLAG_ADJACENT_EXCEPTION)) // exception for atoms that should always be reachable
return 1
diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm
index 56e4ee39cc83..36fc54d2f3fc 100644
--- a/code/_onclick/ai.dm
+++ b/code/_onclick/ai.dm
@@ -72,7 +72,7 @@
The below is only really for safety, or you can alter the way
it functions and re-insert it above.
*/
-/mob/living/silicon/ai/UnarmedAttack(atom/A)
+/mob/living/silicon/ai/ResolveUnarmedAttack(atom/A)
return A.attack_ai(src)
/mob/living/silicon/ai/RangedAttack(atom/A, var/params)
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index d3692ea62f06..a7dc5af566af 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -44,7 +44,7 @@
is receiving it.
The most common are:
* mob/UnarmedAttack(atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
- * atom/attackby(item,user) - used only when adjacent
+ * atom/attackby(used_item,user) - used only when adjacent
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
@@ -187,8 +187,12 @@
/mob/proc/UnarmedAttack(var/atom/A, var/proximity_flag)
return
-/mob/living/UnarmedAttack(var/atom/A, var/proximity_flag)
+/// Handles per-mob unarmed attack functionality after shared checks, e.g. maneuvers and abilities.
+/mob/living/proc/ResolveUnarmedAttack(var/atom/A)
+ return A.attack_hand(src)
+/mob/living/UnarmedAttack(var/atom/A, var/proximity_flag)
+ SHOULD_NOT_OVERRIDE(TRUE)
if(GAME_STATE < RUNLEVEL_GAME)
to_chat(src, "You cannot attack people before the game has started.")
return TRUE
@@ -204,11 +208,11 @@
// Special glove functions:
// If the gloves do anything, have them return 1 to stop
// normal attack_hand() here.
- var/obj/item/clothing/gloves/G = get_equipped_item(slot_gloves_str) // not typecast specifically enough in defines
- if(istype(G) && G.Touch(A,1))
+ var/obj/item/clothing/gloves/G = get_equipped_item(slot_gloves_str)
+ if(istype(G) && G.Touch(A, proximity_flag))
return TRUE
- return A.attack_hand(src)
+ return ResolveUnarmedAttack(A)
/*
Ranged unarmed attack:
diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm
index 2ad7f9d7c98f..ee1eba20b7cf 100644
--- a/code/_onclick/cyborg.dm
+++ b/code/_onclick/cyborg.dm
@@ -86,11 +86,6 @@
holding.afterattack(A, src, 0, params)
return
-//Middle click cycles through selected modules.
-/mob/living/silicon/robot/MiddleClickOn(var/atom/A)
- cycle_modules()
- return
-
//Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks
// for non-doors/apcs
/mob/living/silicon/robot/CtrlShiftClickOn(var/atom/A)
@@ -156,7 +151,7 @@
clicks, you can do so here, but you will have to
change attack_robot() above to the proper function
*/
-/mob/living/silicon/robot/UnarmedAttack(atom/A)
+/mob/living/silicon/robot/ResolveUnarmedAttack(atom/A)
return A.attack_robot(src)
/mob/living/silicon/robot/RangedAttack(atom/A, var/params)
diff --git a/code/_onclick/ghost.dm b/code/_onclick/ghost.dm
index d36410ef6aea..a47458ff2f18 100644
--- a/code/_onclick/ghost.dm
+++ b/code/_onclick/ghost.dm
@@ -61,15 +61,3 @@
/obj/effect/portal/attack_ghost(mob/user)
if(target)
user.forceMove(get_turf(target))
-
-/obj/machinery/gateway/centerstation/attack_ghost(mob/user)
- if(awaygate)
- user.forceMove(awaygate.loc)
- else
- to_chat(user, "[src] has no destination.")
-
-/obj/machinery/gateway/centeraway/attack_ghost(mob/user)
- if(stationgate)
- user.forceMove(stationgate.loc)
- else
- to_chat(user, "[src] has no destination.")
diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm
index 41016eea0b09..51398a81da00 100644
--- a/code/_onclick/hud/_defines.dm
+++ b/code/_onclick/hud/_defines.dm
@@ -52,12 +52,9 @@
#define ui_movi "RIGHT-2:24,BOTTOM:5"
#define ui_attack_selector "RIGHT-2:27,BOTTOM+2:9"
#define ui_zonesel "RIGHT-1:28,BOTTOM:5"
-#define ui_acti_alt "RIGHT-1:28,BOTTOM:5" //alternative intent switcher for when the interface is hidden
#define ui_stamina "RIGHT-2:24,BOTTOM:8"
-#define ui_borg_pull "RIGHT-3:24,BOTTOM+1:7"
-#define ui_borg_module "RIGHT-2:26,BOTTOM+1:7"
-#define ui_borg_panel "RIGHT-1:28,BOTTOM+1:7"
+#define ui_borg_module "RIGHT-1:28,BOTTOM+1:7"
//Gun buttons
#define ui_gun1 "RIGHT-1:28,BOTTOM+3:7"
diff --git a/code/_onclick/hud/hud_elements/hud_auxilliary.dm b/code/_onclick/hud/hud_elements/hud_auxilliary.dm
index 42ae7a89178c..bcf8503f5a4b 100644
--- a/code/_onclick/hud/hud_elements/hud_auxilliary.dm
+++ b/code/_onclick/hud/hud_elements/hud_auxilliary.dm
@@ -25,6 +25,9 @@
/decl/hud_element/attack
elem_type = /obj/screen/default_attack_selector
+/decl/hud_element/modifiers
+ elem_type = /obj/screen/mob_modifiers
+
/decl/hud_element/stamina
elem_type = /obj/screen/stamina
elem_updates_in_life = TRUE
diff --git a/code/_onclick/hud/hud_elements/hud_robot.dm b/code/_onclick/hud/hud_elements/hud_robot.dm
index a47c9c7866f0..687d673f3a27 100644
--- a/code/_onclick/hud/hud_elements/hud_robot.dm
+++ b/code/_onclick/hud/hud_elements/hud_robot.dm
@@ -1,4 +1,5 @@
/datum/hud/robot
+ offset_hands_vertically = FALSE
gun_mode_toggle_type = /obj/screen/gun/mode
omit_hud_elements = list(
/decl/hud_element/health,
@@ -23,7 +24,6 @@
/decl/hud_element/module_selection,
/decl/hud_element/robot_inventory,
/decl/hud_element/robot_radio,
- /decl/hud_element/robot_panel,
/decl/hud_element/robot_store,
/decl/hud_element/robot_drop_grab
)
@@ -45,15 +45,12 @@
elem_is_auxilliary = FALSE
/decl/hud_element/module_selection
- elem_type = /obj/screen/robot/module/select
+ elem_type = /obj/screen/robot/module
elem_is_auxilliary = FALSE
/decl/hud_element/robot_radio
elem_type = /obj/screen/robot/radio
-/decl/hud_element/robot_panel
- elem_type = /obj/screen/robot/panel
-
/decl/hud_element/robot_store
elem_type = /obj/screen/robot/store
diff --git a/code/_onclick/hud/hud_types/_hud.dm b/code/_onclick/hud/hud_types/_hud.dm
index d0a95fe197f5..c14dcf7c378e 100644
--- a/code/_onclick/hud/hud_types/_hud.dm
+++ b/code/_onclick/hud/hud_types/_hud.dm
@@ -25,11 +25,10 @@
hud_used = new hud_used(src)
if(istype(hud_used))
hud_used.refresh_hud_icons()
- refresh_lighting_master()
/datum/hud
/// A reference to our owning mob.
- var/mob/mymob
+ VAR_PRIVATE/weakref/owner
/// Used for the HUD toggle (F12)
VAR_PRIVATE/hud_shown = TRUE
// Used for showing or hiding the equipment buttons on the left.
@@ -79,7 +78,8 @@
/decl/hud_element/oxygen,
/decl/hud_element/toxins,
/decl/hud_element/bodytemp,
- /decl/hud_element/pressure
+ /decl/hud_element/pressure,
+ /decl/hud_element/modifiers
)
/// /decl/hud_element types to be inserted into hud_elements_to_create during init.
VAR_PROTECTED/list/additional_hud_elements
@@ -99,10 +99,12 @@
VAR_PRIVATE/obj/screen/gun/item/gun_item_use_toggle
VAR_PRIVATE/obj/screen/gun/radio/gun_radio_use_toggle
+ var/offset_hands_vertically = TRUE
-/datum/hud/New(mob/owner)
- mymob = owner
- instantiate()
+/datum/hud/New(mob/_owner)
+ if(istype(_owner))
+ owner = weakref(_owner)
+ instantiate(_owner)
..()
/datum/hud/Destroy()
@@ -117,10 +119,11 @@
LAZYCLEARLIST(hud_elem_decl_to_object)
QDEL_NULL_LIST(all_hud_elements)
- if(mymob)
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob))
if(mymob.hud_used == src)
mymob.hud_used = null
- mymob = null
+ QDEL_NULL(owner)
/datum/hud/proc/is_hud_shown()
return hud_shown
@@ -133,8 +136,10 @@
return elem?.update_icon() || FALSE
/datum/hud/proc/refresh_hud_icons()
- for(var/obj/screen/elem in mymob?.client?.screen)
- elem.queue_icon_update()
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
+ for(var/obj/screen/elem in mymob.client.screen)
+ elem.queue_icon_update()
/datum/hud/proc/is_inventory_shown()
return inventory_shown
@@ -142,29 +147,39 @@
/datum/hud/proc/hide_inventory()
inventory_shown = FALSE
if(LAZYLEN(hud_elements_hidable))
- mymob?.client?.screen -= hud_elements_hidable
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
+ mymob.client.screen -= hud_elements_hidable
hidden_inventory_update()
persistent_inventory_update()
/datum/hud/proc/show_inventory()
inventory_shown = TRUE
if(LAZYLEN(hud_elements_hidable))
- mymob?.client?.screen += hud_elements_hidable
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
+ mymob.client.screen += hud_elements_hidable
hidden_inventory_update()
persistent_inventory_update()
/datum/hud/proc/hidden_inventory_update()
- var/decl/species/species = mymob?.get_species()
+ var/mob/mymob = owner?.resolve()
+ var/decl/species/species = istype(mymob) && mymob.get_species()
if(istype(species?.species_hud))
refresh_inventory_slots(species.species_hud.hidden_slots, (inventory_shown && hud_shown))
/datum/hud/proc/persistent_inventory_update()
- var/decl/species/species = mymob?.get_species()
+ var/mob/mymob = owner?.resolve()
+ var/decl/species/species = istype(mymob) && mymob.get_species()
if(istype(species?.species_hud))
refresh_inventory_slots(species.species_hud.persistent_slots, hud_shown)
/datum/hud/proc/refresh_inventory_slots(var/list/checking_slots, var/show_hud)
+ var/mob/mymob = owner?.resolve()
+ if(!istype(mymob))
+ return FALSE
+
for(var/slot in checking_slots)
var/datum/inventory_slot/inv_slot = mymob.get_inventory_slot_datum(slot)
@@ -183,18 +198,36 @@
else
inv_slot.show_slot()
-/datum/hud/proc/instantiate()
- if(ismob(mymob) && mymob.client)
- finalize_instantiation()
+ return TRUE
+
+/datum/hud/proc/instantiate(mob/_owner)
+ if(ismob(_owner) && _owner.client)
+ finalize_instantiation(_owner)
refresh_hud_icons()
return TRUE
return FALSE
/datum/hud/proc/handle_life_hud_update()
+
+ var/mob/mymob = owner?.resolve()
+ if(!istype(mymob))
+ return FALSE
+
+ if(mymob.buckled || mymob.restrained())
+ mymob.add_mob_modifier(/decl/mob_modifier/restrained, source = mymob)
+ else
+ mymob.remove_mob_modifier(/decl/mob_modifier/restrained, source = mymob)
+
+ if(mymob.current_posture?.prone)
+ mymob.add_mob_modifier(/decl/mob_modifier/prone, source = mymob)
+ else
+ mymob.remove_mob_modifier(/decl/mob_modifier/prone, source = mymob)
+
for(var/obj/screen/elem as anything in hud_elements_update_in_life)
elem.update_icon()
+ return TRUE
-/datum/hud/proc/finalize_instantiation()
+/datum/hud/proc/finalize_instantiation(mob/_owner)
SHOULD_CALL_PARENT(TRUE)
@@ -215,11 +248,11 @@
//Handle the gun settings buttons
if(!gun_mode_toggle && gun_mode_toggle_type)
- gun_mode_toggle = new gun_mode_toggle_type(null, mymob, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
+ gun_mode_toggle = new gun_mode_toggle_type(null, _owner, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
LAZYADD(hud_elements_auxilliary, gun_mode_toggle)
- gun_item_use_toggle = new(null, mymob, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
- gun_move_toggle = new(null, mymob, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
- gun_radio_use_toggle = new(null, mymob, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
+ gun_item_use_toggle = new(null, _owner, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
+ gun_move_toggle = new(null, _owner, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
+ gun_radio_use_toggle = new(null, _owner, ui_style, ui_color, ui_alpha, HUD_FIRE_INTENT)
build_inventory_ui()
build_hands_ui()
@@ -239,16 +272,17 @@
all_hud_elements |= hud_elements_auxilliary
UNSETEMPTY(all_hud_elements)
- if(mymob.client)
- mymob.client.screen = list()
+ if(_owner.client)
+ _owner.client.screen = list()
if(LAZYLEN(all_hud_elements))
- mymob.client.screen |= all_hud_elements
+ _owner.client.screen |= all_hud_elements
hide_inventory()
/datum/hud/proc/get_ui_style_data()
RETURN_TYPE(/decl/ui_style)
- . = GET_DECL(mymob?.client?.prefs?.UI_style) || GET_DECL(default_ui_style)
+ var/mob/mymob = owner?.resolve()
+ . = (istype(mymob) && GET_DECL(mymob.client?.prefs?.UI_style)) || GET_DECL(default_ui_style)
if(!.)
var/list/available_styles = get_ui_styles()
if(length(available_styles))
@@ -258,13 +292,19 @@
var/decl/ui_style/ui_style = get_ui_style_data()
if(!ui_style?.use_ui_color)
return COLOR_WHITE
- return mymob?.client?.prefs?.UI_style_color || COLOR_WHITE
+ var/mob/mymob = owner?.resolve()
+ return (istype(mymob) && mymob.client?.prefs?.UI_style_color) || COLOR_WHITE
/datum/hud/proc/get_ui_alpha()
- return mymob?.client?.prefs?.UI_style_alpha || 255
+ var/mob/mymob = owner?.resolve()
+ return (istype(mymob) && mymob.client?.prefs?.UI_style_alpha) || 255
/datum/hud/proc/rebuild_hands()
+ var/mob/mymob = owner?.resolve()
+ if(!istype(mymob))
+ return FALSE
+
var/decl/ui_style/ui_style = get_ui_style_data()
var/ui_color = get_ui_color()
var/ui_alpha = get_ui_alpha()
@@ -315,20 +355,28 @@
// Rebuild offsets for the hand elements.
var/hand_y_offset = 21
var/list/elements = hud_elements_hands?.Copy()
- while(length(elements))
- var/copy_index = min(length(elements), 2)+1
- var/list/sublist = elements.Copy(1, copy_index)
- elements.Cut(1, copy_index)
- var/obj/screen/inventory/inv_box
- if(length(sublist) == 1)
- inv_box = sublist[1]
- inv_box.screen_loc = "CENTER,BOTTOM:[hand_y_offset]"
+ if(length(elements))
+ if(offset_hands_vertically)
+ while(length(elements))
+ var/copy_index = min(length(elements), 2)+1
+ var/list/sublist = elements.Copy(1, copy_index)
+ elements.Cut(1, copy_index)
+ var/obj/screen/inventory/inv_box
+ if(length(sublist) == 1)
+ inv_box = sublist[1]
+ inv_box.screen_loc = "CENTER,BOTTOM:[hand_y_offset]"
+ else
+ inv_box = sublist[1]
+ inv_box.screen_loc = "CENTER:-[world.icon_size/2],BOTTOM:[hand_y_offset]"
+ inv_box = sublist[2]
+ inv_box.screen_loc = "CENTER:[world.icon_size/2],BOTTOM:[hand_y_offset]"
+ hand_y_offset += world.icon_size
else
- inv_box = sublist[1]
- inv_box.screen_loc = "CENTER:-[world.icon_size/2],BOTTOM:[hand_y_offset]"
- inv_box = sublist[2]
- inv_box.screen_loc = "CENTER:[world.icon_size/2],BOTTOM:[hand_y_offset]"
- hand_y_offset += world.icon_size
+ var/hand_x_offset = -((length(elements) * world.icon_size) / 2) + (world.icon_size/2)
+ for(var/obj/screen/inventory/inv_box in elements)
+ inv_box.screen_loc = "CENTER:[hand_x_offset],BOTTOM:[hand_y_offset]"
+ hand_x_offset += world.icon_size
+ hand_y_offset += world.icon_size
if(mymob.client && islist(hud_elements_hands) && length(hud_elements_hands))
mymob.client.screen |= hud_elements_hands
@@ -355,8 +403,16 @@
if(mymob.client)
mymob.client.screen |= swap_elem
+ update_hand_elements()
+
+ return TRUE
+
/datum/hud/proc/build_inventory_ui()
+ var/mob/mymob = owner?.resolve()
+ if(!istype(mymob))
+ return FALSE
+
var/decl/ui_style/ui_style = get_ui_style_data()
var/ui_color = get_ui_color()
var/ui_alpha = get_ui_alpha()
@@ -392,11 +448,17 @@
if(has_hidden_gear)
hud_elements_auxilliary += new /obj/screen/toggle(null, mymob, ui_style, ui_color, ui_alpha, HUD_INVENTORY)
+ return TRUE
+
/datum/hud/proc/build_hands_ui()
+ var/mob/mymob = owner?.resolve()
+ if(!istype(mymob))
+ return FALSE
+
var/list/held_slots = mymob.get_held_item_slots()
if(length(held_slots) <= 0)
- return
+ return FALSE
var/decl/ui_style/ui_style = get_ui_style_data()
var/ui_color = get_ui_color()
@@ -414,6 +476,7 @@
// Actual hand elems.
rebuild_hands()
+ return TRUE
/datum/hud/proc/toggle_show_inventory()
if(inventory_shown)
@@ -427,57 +490,63 @@
return action_buttons_hidden
/datum/hud/proc/toggle_minimize(var/full)
- if(hud_shown)
- hud_shown = FALSE
- if(hud_elements_auxilliary)
- mymob?.client?.screen -= hud_elements_auxilliary
- if(hud_elements_hidable)
- mymob?.client?.screen -= hud_elements_hidable
- if(hud_elements_hotkeys)
- mymob?.client?.screen -= hud_elements_hotkeys
- if(!full)
- if(LAZYLEN(hud_elements_hands))
- mymob?.client?.screen += hud_elements_hands // we want the hands to be visible
- if(LAZYLEN(hud_elements_swap))
- mymob?.client?.screen += hud_elements_swap // we want the hands swap thingy to be visible
- else
- hud_shown = TRUE
- if(LAZYLEN(hud_elements_auxilliary))
- mymob?.client?.screen |= hud_elements_auxilliary
- if(LAZYLEN(hud_elements_hidable) && inventory_shown)
- mymob?.client?.screen |= hud_elements_hidable
- if(LAZYLEN(hud_elements_hotkeys) && !hotkey_ui_hidden)
- mymob?.client?.screen |= hud_elements_hotkeys
+ hud_shown = !hud_shown
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
+ if(hud_shown)
+ if(LAZYLEN(hud_elements_auxilliary))
+ mymob.client.screen |= hud_elements_auxilliary
+ if(LAZYLEN(hud_elements_hidable) && inventory_shown)
+ mymob.client.screen |= hud_elements_hidable
+ if(LAZYLEN(hud_elements_hotkeys) && !hotkey_ui_hidden)
+ mymob.client.screen |= hud_elements_hotkeys
+ else
+ if(hud_elements_auxilliary)
+ mymob.client.screen -= hud_elements_auxilliary
+ if(hud_elements_hidable)
+ mymob.client.screen -= hud_elements_hidable
+ if(hud_elements_hotkeys)
+ mymob.client.screen -= hud_elements_hotkeys
+ if(!full)
+ if(LAZYLEN(hud_elements_hands))
+ mymob.client.screen += hud_elements_hands // we want the hands to be visible
+ if(LAZYLEN(hud_elements_swap))
+ mymob.client.screen += hud_elements_swap // we want the hands swap thingy to be visible
+
hidden_inventory_update()
persistent_inventory_update()
+ return TRUE
/datum/hud/proc/toggle_zoom_hud()
- if(hud_shown)
- hud_shown = FALSE
- if(LAZYLEN(hud_elements_auxilliary))
- mymob?.client?.screen -= hud_elements_auxilliary
- if(LAZYLEN(hud_elements_hidable))
- mymob?.client?.screen -= hud_elements_hidable
- if(LAZYLEN(hud_elements_hotkeys))
- mymob?.client?.screen -= hud_elements_hotkeys
- else
- hud_shown = TRUE
- if(LAZYLEN(hud_elements_auxilliary))
- mymob?.client?.screen += hud_elements_auxilliary
- if(LAZYLEN(hud_elements_hidable) && inventory_shown)
- mymob?.client?.screen += hud_elements_hidable
- if(LAZYLEN(hud_elements_hotkeys) && !hotkey_ui_hidden)
- mymob?.client?.screen += hud_elements_hotkeys
+ hud_shown = !hud_shown
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
+ if(hud_shown)
+ if(LAZYLEN(hud_elements_auxilliary))
+ mymob.client.screen += hud_elements_auxilliary
+ if(LAZYLEN(hud_elements_hidable) && inventory_shown)
+ mymob.client.screen += hud_elements_hidable
+ if(LAZYLEN(hud_elements_hotkeys) && !hotkey_ui_hidden)
+ mymob.client.screen += hud_elements_hotkeys
+ else
+ if(LAZYLEN(hud_elements_auxilliary))
+ mymob.client.screen -= hud_elements_auxilliary
+ if(LAZYLEN(hud_elements_hidable))
+ mymob.client.screen -= hud_elements_hidable
+ if(LAZYLEN(hud_elements_hotkeys))
+ mymob.client.screen -= hud_elements_hotkeys
+
hidden_inventory_update()
persistent_inventory_update()
/datum/hud/proc/toggle_hotkeys()
- if(hotkey_ui_hidden)
- mymob?.client?.screen += hud_elements_hotkeys
- hotkey_ui_hidden = 0
- else
- mymob?.client?.screen -= hud_elements_hotkeys
- hotkey_ui_hidden = TRUE
+ hotkey_ui_hidden = !hotkey_ui_hidden
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
+ if(hotkey_ui_hidden)
+ mymob.client.screen -= hud_elements_hotkeys
+ else
+ mymob.client.screen += hud_elements_hotkeys
/mob/verb/toggle_hotkey_verbs()
set category = "OOC"
@@ -537,13 +606,15 @@
// This can runtime if someone manages to throw a gun out of their hand before the proc is called.
if(!gun_item_use_toggle)
return TRUE
- if(mymob?.client)
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
mymob.client.screen |= gun_item_use_toggle
mymob.client.screen |= gun_move_toggle
mymob.client.screen |= gun_radio_use_toggle
/datum/hud/proc/remove_gun_icons()
- if(mymob?.client)
+ var/mob/mymob = owner?.resolve()
+ if(istype(mymob) && mymob.client)
mymob.client.screen -= gun_item_use_toggle
mymob.client.screen -= gun_move_toggle
mymob.client.screen -= gun_radio_use_toggle
@@ -574,8 +645,11 @@
gun_radio_use_toggle.update_icon()
/datum/hud/proc/create_and_register_element(decl/hud_element/ui_elem, decl/ui_style/ui_style, ui_color, ui_alpha)
- if(!istype(ui_elem) || !ui_elem.elem_type)
+
+ var/mob/mymob = owner?.resolve()
+ if(!istype(mymob) || !istype(ui_elem) || !ui_elem.elem_type)
return FALSE
+
var/obj/screen/elem = new ui_elem.elem_type(null, mymob, ui_style, ui_color, ui_alpha, ui_elem.elem_reference_type)
if(ui_elem.elem_is_hotkey)
LAZYDISTINCTADD(hud_elements_hotkeys, elem)
diff --git a/code/_onclick/hud/hud_types/robot.dm b/code/_onclick/hud/hud_types/robot.dm
index 9dd085ffe9c3..a84112549ad1 100644
--- a/code/_onclick/hud/hud_types/robot.dm
+++ b/code/_onclick/hud/hud_types/robot.dm
@@ -9,86 +9,3 @@
/datum/hud/robot/get_ui_alpha()
return 255
-
-// TODO: Convert robots to use inventory slots.
-/datum/hud/robot/finalize_instantiation()
- var/mob/living/silicon/robot/R = mymob
- if(!istype(R))
- return ..()
- R.inv1 = new(null, mymob)
- R.inv2 = new(null, mymob)
- R.inv3 = new(null, mymob)
- LAZYINITLIST(hud_elements_auxilliary)
- hud_elements_auxilliary += R.inv1
- hud_elements_auxilliary += R.inv2
- hud_elements_auxilliary += R.inv3
- ..()
-
-/datum/hud/proc/toggle_show_robot_modules()
- if(!isrobot(mymob))
- return
- var/mob/living/silicon/robot/r = mymob
- r.shown_robot_modules = !r.shown_robot_modules
- update_robot_modules_display()
-
-/datum/hud/proc/update_robot_modules_display()
- if(!isrobot(mymob) || !mymob.client)
- return
-
- var/mob/living/silicon/robot/R = mymob
-
- if(R.shown_robot_modules)
- if(R.active_storage)
- R.active_storage.close(R) //Closes the inventory ui.
-
- if(!R.module)
- to_chat(R, SPAN_WARNING("No module selected."))
- return
-
- if(!R.module.equipment)
- to_chat(R, SPAN_WARNING("Selected module has no equipment available."))
- return
-
- if(!R.robot_modules_background)
- return
-
- var/display_rows = ceil(R.module.equipment.len / 8)
- R.robot_modules_background.screen_loc = "CENTER-4:16,BOTTOM+1:7 to CENTER+3:16,BOTTOM+[display_rows]:7"
- R.client.screen += R.robot_modules_background
-
- var/x = -4 //Start at CENTER-4,SOUTH+1
- var/y = 1
-
- //Unfortunately adding the emag module to the list of modules has to be here. This is because a borg can
- //be emagged before they actually select a module. - or some situation can cause them to get a new module
- // - or some situation might cause them to get de-emagged or something.
- if(R.emagged)
- if(!(R.module.emag in R.module.equipment))
- R.module.equipment.Add(R.module.emag)
- else
- if(R.module.emag in R.module.equipment)
- R.module.equipment.Remove(R.module.emag)
-
- for(var/atom/movable/A in R.module.equipment)
- if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) )
- //Module is not currently active
- R.client.screen += A
- if(x < 0)
- A.screen_loc = "CENTER[x]:[WORLD_ICON_SIZE/2],BOTTOM+[y]:7"
- else
- A.screen_loc = "CENTER+[x]:[WORLD_ICON_SIZE/2],BOTTOM+[y]:7"
- A.hud_layerise()
-
- x++
- if(x == 4)
- x = -4
- y++
-
- else
- //Modules display is hidden
- for(var/atom/A in R.module.equipment)
- if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) )
- //Module is not currently active
- R.client.screen -= A
- R.shown_robot_modules = 0
- R.client.screen -= R.robot_modules_background
diff --git a/code/_onclick/hud/screen/robot/screen_robot_drop_grab.dm b/code/_onclick/hud/screen/robot/screen_robot_drop_grab.dm
index c3e71cef3d06..bff32e2bc888 100644
--- a/code/_onclick/hud/screen/robot/screen_robot_drop_grab.dm
+++ b/code/_onclick/hud/screen/robot/screen_robot_drop_grab.dm
@@ -8,8 +8,8 @@
/obj/screen/robot/drop_grab/handle_click(mob/user, params)
if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- R.drop_item()
+ var/mob/living/silicon/robot/robot = user
+ robot.drop_item()
update_icon()
/obj/screen/robot/drop_grab/on_update_icon()
diff --git a/code/_onclick/hud/screen/robot/screen_robot_inventory.dm b/code/_onclick/hud/screen/robot/screen_robot_inventory.dm
index a6360e2eaaab..ab8d4815f9f8 100644
--- a/code/_onclick/hud/screen/robot/screen_robot_inventory.dm
+++ b/code/_onclick/hud/screen/robot/screen_robot_inventory.dm
@@ -5,8 +5,8 @@
/obj/screen/robot/inventory/handle_click(mob/user, params)
if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- if(R.module)
- R.hud_used.toggle_show_robot_modules()
- return 1
- to_chat(R, "You haven't selected a module yet.")
+ var/mob/living/silicon/robot/robot = user
+ if(robot.module)
+ robot.module.storage?.open(user)
+ else
+ to_chat(robot, "You haven't selected a module yet.")
diff --git a/code/_onclick/hud/screen/robot/screen_robot_module.dm b/code/_onclick/hud/screen/robot/screen_robot_module.dm
index 95e662167ec2..69c0fde190f3 100644
--- a/code/_onclick/hud/screen/robot/screen_robot_module.dm
+++ b/code/_onclick/hud/screen/robot/screen_robot_module.dm
@@ -1,17 +1,17 @@
-/obj/screen/robot/module/select
+/obj/screen/robot/module
name = "module"
icon = 'icons/mob/screen/styles/robot/module.dmi'
icon_state = "nomod"
screen_loc = ui_borg_module
-/obj/screen/robot/module/select/on_update_icon()
+/obj/screen/robot/module/on_update_icon()
. = ..()
icon_state = initial(icon_state)
var/mob/living/silicon/robot/owner = owner_ref?.resolve()
if(istype(owner) && owner.modtype)
icon_state = lowertext(owner.modtype)
-/obj/screen/robot/module/select/handle_click(mob/user, params)
+/obj/screen/robot/module/handle_click(mob/user, params)
if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- R.pick_module()
+ var/mob/living/silicon/robot/robot = user
+ robot.pick_module()
diff --git a/code/_onclick/hud/screen/robot/screen_robot_modules.dm b/code/_onclick/hud/screen/robot/screen_robot_modules.dm
index 0e82b4fe44f6..09029a035fde 100644
--- a/code/_onclick/hud/screen/robot/screen_robot_modules.dm
+++ b/code/_onclick/hud/screen/robot/screen_robot_modules.dm
@@ -2,33 +2,3 @@
name = "module"
icon_state = "block"
icon = 'icons/mob/screen/styles/robot/modules_background.dmi'
-
-/obj/screen/robot/module
- dir = SOUTHWEST
- icon = 'icons/mob/screen/styles/robot/modules_inventory.dmi'
- var/module_index
-
-/obj/screen/robot/module/handle_click(mob/user, params)
- if(isrobot(user) && !isnull(module_index))
- var/mob/living/silicon/robot/robot = user
- robot.toggle_module(module_index)
- return TRUE
- return ..()
-
-/obj/screen/robot/module/one
- name = "module1"
- icon_state = "inv1"
- screen_loc = ui_inv1
- module_index = 1
-
-/obj/screen/robot/module/two
- name = "module2"
- icon_state = "inv2"
- screen_loc = ui_inv2
- module_index = 2
-
-/obj/screen/robot/module/three
- name = "module3"
- icon_state = "inv3"
- screen_loc = ui_inv3
- module_index = 3
diff --git a/code/_onclick/hud/screen/robot/screen_robot_panel.dm b/code/_onclick/hud/screen/robot/screen_robot_panel.dm
deleted file mode 100644
index 9f39909a52f9..000000000000
--- a/code/_onclick/hud/screen/robot/screen_robot_panel.dm
+++ /dev/null
@@ -1,9 +0,0 @@
-/obj/screen/robot/panel
- name = "panel"
- icon_state = "panel"
- screen_loc = ui_borg_panel
-
-/obj/screen/robot/panel/handle_click(mob/user, params)
- if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- R.installed_modules()
diff --git a/code/_onclick/hud/screen/robot/screen_robot_radio.dm b/code/_onclick/hud/screen/robot/screen_robot_radio.dm
index 5207edef2b47..96f2364ca600 100644
--- a/code/_onclick/hud/screen/robot/screen_robot_radio.dm
+++ b/code/_onclick/hud/screen/robot/screen_robot_radio.dm
@@ -6,5 +6,5 @@
/obj/screen/robot/radio/handle_click(mob/user, params)
if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- R.radio_menu()
\ No newline at end of file
+ var/mob/living/silicon/robot/robot = user
+ robot.radio_menu()
\ No newline at end of file
diff --git a/code/_onclick/hud/screen/robot/screen_robot_store.dm b/code/_onclick/hud/screen/robot/screen_robot_store.dm
index 93f1a652b96e..90b46cae00c5 100644
--- a/code/_onclick/hud/screen/robot/screen_robot_store.dm
+++ b/code/_onclick/hud/screen/robot/screen_robot_store.dm
@@ -4,10 +4,10 @@
screen_loc = ui_borg_store
/obj/screen/robot/store/handle_click(mob/user, params)
- if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- if(R.module)
- R.uneq_active()
- R.hud_used.update_robot_modules_display()
- else
- to_chat(R, "You haven't selected a module yet.")
+ var/mob/living/silicon/robot/robot = user
+ if(istype(robot) && robot.module)
+ var/obj/item/active_item = robot.get_active_held_item()
+ if(active_item)
+ user.try_unequip(active_item, robot.module, FALSE)
+ else
+ to_chat(robot, "You haven't selected a module yet.")
diff --git a/code/_onclick/hud/screen/screen_drop.dm b/code/_onclick/hud/screen/screen_drop.dm
index 085922329c75..716c451252a9 100644
--- a/code/_onclick/hud/screen/screen_drop.dm
+++ b/code/_onclick/hud/screen/screen_drop.dm
@@ -2,6 +2,8 @@
name = "drop"
icon_state = "act_drop"
screen_loc = ui_drop_throw
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
/obj/screen/drop/handle_click(mob/user, params)
if(user.client)
diff --git a/code/_onclick/hud/screen/screen_equip.dm b/code/_onclick/hud/screen/screen_equip.dm
index 39ca9349ad81..589edc66a05d 100644
--- a/code/_onclick/hud/screen/screen_equip.dm
+++ b/code/_onclick/hud/screen/screen_equip.dm
@@ -1,6 +1,8 @@
/obj/screen/equip
name = "equip"
icon_state = "act_equip"
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
/obj/screen/equip/handle_click(mob/user, params)
if(ishuman(user))
diff --git a/code/_onclick/hud/screen/screen_gun.dm b/code/_onclick/hud/screen/screen_gun.dm
index e0bc13fee624..4cb1eee5886f 100644
--- a/code/_onclick/hud/screen/screen_gun.dm
+++ b/code/_onclick/hud/screen/screen_gun.dm
@@ -2,6 +2,8 @@
icon = 'icons/mob/screen/styles/midnight/fire_intent.dmi'
dir = SOUTH
abstract_type = /obj/screen/gun
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
var/base_icon_state
var/toggle_flag
diff --git a/code/_onclick/hud/screen/screen_inventory.dm b/code/_onclick/hud/screen/screen_inventory.dm
index 3714bc5fb107..09f921ed552e 100644
--- a/code/_onclick/hud/screen/screen_inventory.dm
+++ b/code/_onclick/hud/screen/screen_inventory.dm
@@ -59,11 +59,17 @@
MA.plane = HUD_PLANE
MA.alpha = 80
MA.color = mouse_over_atom.mob_can_equip(owner, slot_id, TRUE) ? COLOR_GREEN : COLOR_RED
- MA.pixel_x = mouse_over_atom.default_pixel_x
- MA.pixel_y = mouse_over_atom.default_pixel_y
- MA.pixel_w = mouse_over_atom.default_pixel_w
- MA.pixel_z = mouse_over_atom.default_pixel_z
+ // We don't respect default_pixel_x or similar here because items should always be centered in their slots; defaults are for world-space.
+ MA.pixel_x = 0
+ MA.pixel_y = 0
+ MA.pixel_w = 0
+ MA.pixel_z = 0
MA.appearance_flags |= (KEEP_TOGETHER | RESET_COLOR)
+ // We need to color the entire thing, overlays and underlays included.
+ for(var/image/overlay in MA.overlays)
+ overlay.appearance_flags &= ~(KEEP_TOGETHER | RESET_COLOR)
+ for(var/image/underlay in MA.underlays)
+ underlay.appearance_flags &= ~(KEEP_TOGETHER | RESET_COLOR)
add_overlay(MA)
else
mouse_over_atom_ref = null
diff --git a/code/_onclick/hud/screen/screen_maneuver.dm b/code/_onclick/hud/screen/screen_maneuver.dm
index ddfdf15d7d6c..4052a690a53c 100644
--- a/code/_onclick/hud/screen/screen_maneuver.dm
+++ b/code/_onclick/hud/screen/screen_maneuver.dm
@@ -2,6 +2,8 @@
name = "Prepare Maneuver"
icon_state = "maneuver_off"
screen_loc = ui_pull_resist
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
/obj/screen/maneuver/handle_click(mob/user, params)
if(isliving(user))
diff --git a/code/_onclick/hud/screen/screen_mob_modifier.dm b/code/_onclick/hud/screen/screen_mob_modifier.dm
new file mode 100644
index 000000000000..d8d32bd3c586
--- /dev/null
+++ b/code/_onclick/hud/screen/screen_mob_modifier.dm
@@ -0,0 +1,158 @@
+/obj/screen/mob_modifiers
+ screen_loc = "CENTER,TOP"
+ icon_state = "blank"
+ requires_ui_style = FALSE
+
+ // Disable these due to vis_contents behaving oddly with them.
+ use_supplied_ui_color = FALSE
+ use_supplied_ui_alpha = FALSE
+
+ // TODO: consider pooling these.
+ var/list/elements
+ var/const/modifier_size = 18
+
+/obj/screen/mob_modifiers/Initialize(mapload, mob/_owner, decl/ui_style/ui_style, ui_color, ui_alpha, ui_cat)
+ . = ..()
+ START_PROCESSING(SSprocessing, src)
+
+/obj/screen/mob_modifiers/Destroy()
+ STOP_PROCESSING(SSprocessing, src)
+ QDEL_NULL_LIST(elements)
+ return ..()
+
+/obj/screen/mob_modifiers/Process()
+ if(QDELETED(src))
+ return PROCESS_KILL
+ var/mob/living/owner = owner_ref?.resolve()
+ if(!istype(owner))
+ return PROCESS_KILL
+ for(var/obj/screen/mob_modifier/element in elements)
+ var/expire_time = MOB_MODIFIER_INDEFINITE
+ for(var/datum/mob_modifier/modifier in LAZYACCESS(owner._mob_modifiers, element.archetype))
+ if(modifier.expire_time == MOB_MODIFIER_INDEFINITE)
+ expire_time = MOB_MODIFIER_INDEFINITE
+ break
+ expire_time = max(expire_time, modifier.expire_time)
+ if(istype(element))
+ element.update_maptext(expire_time == MOB_MODIFIER_INDEFINITE ? MOB_MODIFIER_INDEFINITE : (expire_time - world.time))
+
+/obj/screen/mob_modifiers/on_update_icon()
+
+ if(QDELETED(src))
+ return
+
+ var/mob/living/owner = owner_ref?.resolve()
+ if(!istype(owner) || !istype(owner.hud_used))
+ return
+
+ var/list/seen_archetypes
+ var/list/elements_to_keep
+ var/list/elements_to_add
+ var/list/elements_to_remove
+
+ // Track deltas for keeping/removing existing elements.
+ for(var/obj/screen/mob_modifier/element in elements)
+ var/list/modifiers = LAZYACCESS(owner._mob_modifiers, element.archetype)
+ if(length(modifiers))
+ LAZYADD(elements_to_keep, element)
+ else
+ LAZYADD(elements_to_remove, element)
+ LAZYDISTINCTADD(seen_archetypes, element.archetype)
+
+ var/decl/ui_style/ui_style = owner.hud_used.get_ui_style_data()
+ var/ui_color = owner.hud_used.get_ui_color()
+ var/ui_alpha = owner.hud_used.get_ui_alpha()
+
+ // Create elements for new modifiers.
+ for(var/decl/mob_modifier/archetype in owner._mob_modifiers)
+ if(archetype in seen_archetypes)
+ continue
+ var/obj/screen/mob_modifier/element = new(null, owner, ui_style, ui_color, ui_alpha, HUD_MODIFIERS)
+ element.archetype = archetype
+ element.holder = src
+ element.pixel_y = 32
+ element.alpha = 0
+ element.update_icon()
+ LAZYADD(elements_to_add, element)
+
+ // Fade out and delete expired markers.
+ if(LAZYLEN(elements_to_remove))
+ LAZYREMOVE(elements, elements_to_remove)
+ for(var/obj/screen/mob_modifier/element in elements_to_remove)
+ animate(element, alpha = 0, pixel_y = 32, time = 5)
+ QDEL_IN(element, 5)
+
+ // Add our new records.
+ if(LAZYLEN(elements_to_add))
+ LAZYADD(elements, elements_to_add)
+ add_vis_contents(elements_to_add)
+
+ // Adjust positions and fade in new elements.
+ if(length(elements))
+ var/offset_x = -(((length(elements)-1) * modifier_size) / 2)
+ for(var/obj/screen/element in elements)
+ if(element in elements_to_add)
+ pixel_x = offset_x
+ animate(element, alpha = 255, pixel_x = offset_x, pixel_y = 0, time = 5)
+ offset_x += modifier_size
+
+/obj/screen/mob_modifier
+ alpha = 0
+ screen_loc = null // not handled via screen loc, but via vis contents of the holder object.
+ maptext_x = -8
+ maptext_y = -3
+ icon_state = "modifier_base"
+ // these must be enabled
+ use_supplied_ui_alpha = TRUE
+ use_supplied_ui_color = TRUE
+ var/decl/mob_modifier/archetype
+ var/obj/screen/mob_modifiers/holder
+
+/obj/screen/mob_modifier/Destroy()
+ if(holder)
+ LAZYREMOVE(holder.elements, src)
+ holder.remove_vis_contents(src)
+ holder = null
+ return ..()
+
+/obj/screen/mob_modifier/rebuild_screen_overlays()
+ . = ..()
+ if(archetype)
+ add_overlay(overlay_image(archetype.hud_icon, archetype.hud_icon_state, COLOR_WHITE, RESET_COLOR))
+
+/obj/screen/mob_modifier/proc/update_maptext(duration)
+ if(archetype.hide_expiry)
+ maptext = null
+ return
+
+ if(duration == MOB_MODIFIER_INDEFINITE)
+ if(archetype.show_indefinite_duration)
+ maptext = STYLE_SMALLFONTS_OUTLINE("∞", 12, COLOR_WHITE, COLOR_BLACK)
+ else
+ maptext = null
+ else if(duration <= 0)
+ maptext = STYLE_SMALLFONTS_OUTLINE("0", 7, COLOR_WHITE, COLOR_BLACK)
+ else
+ maptext = STYLE_SMALLFONTS_OUTLINE("[ticks2shortreadable(duration) || 0]", 7, COLOR_WHITE, COLOR_BLACK)
+
+/obj/screen/mob_modifier/handle_click(mob/user, params)
+ if((. = ..()))
+ var/mob/living/owner = owner_ref?.resolve()
+ if(istype(owner) && archetype)
+ var/list/modifiers = LAZYACCESS(owner._mob_modifiers, archetype)
+ for(var/datum/mob_modifier/modifier in modifiers)
+ modifier.on_modifier_click(params)
+ return
+
+/obj/screen/mob_modifier/MouseEntered(location, control, params)
+ if(archetype && (archetype.name || archetype.desc))
+ openToolTip(user = usr, tip_src = src, params = params, title = archetype.name, content = archetype.desc)
+ ..()
+
+/obj/screen/mob_modifier/MouseDown()
+ closeToolTip(usr)
+ ..()
+
+/obj/screen/mob_modifier/MouseExited()
+ closeToolTip(usr)
+ ..()
diff --git a/code/_onclick/hud/screen/screen_resist.dm b/code/_onclick/hud/screen/screen_resist.dm
index 9bdb07a9a0b9..ff781aa09c7a 100644
--- a/code/_onclick/hud/screen/screen_resist.dm
+++ b/code/_onclick/hud/screen/screen_resist.dm
@@ -2,6 +2,8 @@
name = "resist"
icon_state = "act_resist"
screen_loc = ui_pull_resist
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
/obj/screen/resist/handle_click(mob/user, params)
if(isliving(user))
diff --git a/code/_onclick/hud/screen/screen_stamina.dm b/code/_onclick/hud/screen/screen_stamina.dm
index b70d9e743618..5d4f34b32da9 100644
--- a/code/_onclick/hud/screen/screen_stamina.dm
+++ b/code/_onclick/hud/screen/screen_stamina.dm
@@ -4,6 +4,9 @@
icon_state = "prog_bar_100"
invisibility = INVISIBILITY_MAXIMUM
screen_loc = ui_stamina
+ use_supplied_ui_color = FALSE
+ use_supplied_ui_alpha = FALSE
+ use_supplied_ui_icon = FALSE
requires_ui_style = FALSE
layer = HUD_BASE_LAYER + 0.1 // needs to layer over the movement intent element
diff --git a/code/_onclick/hud/screen/screen_throw.dm b/code/_onclick/hud/screen/screen_throw.dm
index 1b4de10e6e87..5d2d9888ec02 100644
--- a/code/_onclick/hud/screen/screen_throw.dm
+++ b/code/_onclick/hud/screen/screen_throw.dm
@@ -2,6 +2,8 @@
name = "throw"
icon_state = "act_throw_off"
screen_loc = ui_drop_throw
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
/obj/screen/throw_toggle/handle_click(mob/user, params)
if(!user.stat && isturf(user.loc) && !user.restrained())
diff --git a/code/_onclick/hud/screen/screen_toggle.dm b/code/_onclick/hud/screen/screen_toggle.dm
index 4f534e230f33..ddcf626e8c26 100644
--- a/code/_onclick/hud/screen/screen_toggle.dm
+++ b/code/_onclick/hud/screen/screen_toggle.dm
@@ -2,6 +2,8 @@
name = "toggle"
icon_state = "other"
screen_loc = ui_inventory
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
/obj/screen/toggle/handle_click(mob/user, params)
if(!user.hud_used)
diff --git a/code/_onclick/hud/screen/screen_warning_oxygen.dm b/code/_onclick/hud/screen/screen_warning_oxygen.dm
index f964f7017a6c..507e80dea53d 100644
--- a/code/_onclick/hud/screen/screen_warning_oxygen.dm
+++ b/code/_onclick/hud/screen/screen_warning_oxygen.dm
@@ -23,7 +23,7 @@
var/datum/gas_mixture/environment = owner.loc?.return_air()
if(!environment)
return
- var/decl/species/species = get_species_by_key(global.using_map.default_species)
+ var/decl/species/species = decls_repository.get_decl_by_id(global.using_map.default_species)
if(!species.breath_type || environment.gas[species.breath_type] > species.breath_pressure)
for(var/gas in species.poison_types)
if(environment.gas[gas])
diff --git a/code/_onclick/hud/screen/screen_zone_selector.dm b/code/_onclick/hud/screen/screen_zone_selector.dm
index 51b36db21255..567b5645da3d 100644
--- a/code/_onclick/hud/screen/screen_zone_selector.dm
+++ b/code/_onclick/hud/screen/screen_zone_selector.dm
@@ -2,6 +2,8 @@
name = "damage zone"
icon_state = "zone_sel_tail"
screen_loc = ui_zonesel
+ use_supplied_ui_color = TRUE
+ use_supplied_ui_alpha = TRUE
/obj/screen/zone_selector/handle_click(mob/user, params)
var/list/PL = params2list(params)
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index b92356b4a145..f38f1a25e243 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -48,10 +48,10 @@ avoid code duplication. This includes items that may sometimes act as a standard
return FALSE
-/atom/movable/attackby(obj/item/W, mob/user)
+/atom/movable/attackby(obj/item/used_item, mob/user)
. = ..()
if(!.)
- return bash(W,user)
+ return bash(used_item,user)
// Return TRUE if further actions (afterattack, etc) should be prevented, FALSE if they can proceed.
/atom/movable/proc/bash(obj/item/weapon, mob/user)
@@ -154,7 +154,8 @@ avoid code duplication. This includes items that may sometimes act as a standard
user.setClickCooldown(attack_cooldown + w_class)
if(animate)
user.do_attack_animation(target)
- if(!user.aura_check(AURA_TYPE_WEAPON, src, user))
+
+ if(target.mob_modifiers_block_attack(MM_ATTACK_TYPE_WEAPON, user, src))
return FALSE
var/hit_zone = target.resolve_item_attack(src, user, user.get_target_zone())
diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm
index 04f398c519aa..1cc25ce2b5e3 100644
--- a/code/_onclick/other_mobs.dm
+++ b/code/_onclick/other_mobs.dm
@@ -55,7 +55,7 @@
return climb_up(A)
var/obj/item/clothing/gloves/G = get_equipped_item(slot_gloves_str)
- if(istype(G) && G.Touch(A,0)) // for magic gloves
+ if(istype(G) && G.Touch(A, FALSE)) // for magic gloves
return TRUE
. = ..()
@@ -96,13 +96,8 @@
/*
Animals
*/
-
-/mob/living/simple_animal/UnarmedAttack(var/atom/A, var/proximity)
-
- . = ..()
- if(.)
- return
-
+/// Make unarmed attacks use natural weapons on harm intent.
+/mob/living/simple_animal/ResolveUnarmedAttack(atom/A)
var/attacking_with = get_natural_weapon()
if(check_intent(I_FLAG_HELP) || !attacking_with)
return A.attack_animal(src)
diff --git a/code/controllers/master.dm b/code/controllers/master.dm
index f5f59fe940ca..7c24faa29d7e 100644
--- a/code/controllers/master.dm
+++ b/code/controllers/master.dm
@@ -187,7 +187,6 @@ var/global/datum/controller/master/Master = new
var/msg = "Initializations complete within [time] second\s!"
report_progress(msg)
- log_world(msg)
initializing = FALSE
diff --git a/code/controllers/subsystems/holomap.dm b/code/controllers/subsystems/holomap.dm
index ac6662184f62..0d2cc7371e49 100644
--- a/code/controllers/subsystems/holomap.dm
+++ b/code/controllers/subsystems/holomap.dm
@@ -104,4 +104,5 @@ SUBSYSTEM_DEF(minimap)
if(!areas[areaToPaint])
areas[areaToPaint] = icon(HOLOMAP_ICON, "blank")
areas[areaToPaint].DrawBox(HOLOMAP_AREACOLOR_BASE, x + offset_x, y + offset_y) //We draw white because we want a generic version to use later. However if there is no colour we ignore it
+ CHECK_TICK
return areas
\ No newline at end of file
diff --git a/code/controllers/subsystems/initialization/codex_dump.dm b/code/controllers/subsystems/initialization/codex_dump.dm
index c417e887a572..b12dd686d78b 100644
--- a/code/controllers/subsystems/initialization/codex_dump.dm
+++ b/code/controllers/subsystems/initialization/codex_dump.dm
@@ -127,7 +127,7 @@ TODO: work out how to implement an external search function.
address_to_body[address] = convert.convert_body(codex_entry.name, codex_entry.get_codex_body(include_header = FALSE, include_footer = FALSE))
// Copied from del_the_world UT exceptions list.
- var/static/list/skip_types = list(
+ var/static/list/skip_types = typesof(
/obj/item/organ/external/chest,
/obj/machinery/power/apc,
/obj/machinery/alarm,
@@ -144,7 +144,7 @@ TODO: work out how to implement an external search function.
if(!TYPE_IS_SPAWNABLE(atom) || !initial(atom.simulated))
continue
try
- atom = atom_info_repository.get_instance_of(atom)
+ atom = new atom_type
if(!istype(atom)) // Something went wrong, possibly a runtime in the atom info repo.
continue
var/datum/codex_entry/codex_entry = atom.get_specific_codex_entry()
@@ -161,6 +161,8 @@ TODO: work out how to implement an external search function.
address_to_entry[address] = codex_entry
entry_to_address[codex_entry] = address
address_to_body[address] = convert.convert_body(codex_entry.name, codex_entry.get_codex_body(include_header = FALSE, include_footer = FALSE))
+ if(!QDELETED(atom))
+ qdel(atom, force = TRUE) // clean up after yourself, goddang
catch(var/exception/E)
PRINT_STACK_TRACE("Exception when performing codex dump for [atom_type]: [E]")
diff --git a/code/controllers/subsystems/initialization/fabrication.dm b/code/controllers/subsystems/initialization/fabrication.dm
index 37a6d57dfae0..6fd2b5c28dbd 100644
--- a/code/controllers/subsystems/initialization/fabrication.dm
+++ b/code/controllers/subsystems/initialization/fabrication.dm
@@ -15,8 +15,7 @@ SUBSYSTEM_DEF(fabrication)
/datum/controller/subsystem/fabrication/Initialize()
// Fab recipes.
- for(var/R in subtypesof(/datum/fabricator_recipe))
- var/datum/fabricator_recipe/recipe = R
+ for(var/datum/fabricator_recipe/recipe as anything in subtypesof(/datum/fabricator_recipe))
if(!initial(recipe.path))
continue
recipe = new recipe
diff --git a/code/controllers/subsystems/initialization/materials.dm b/code/controllers/subsystems/initialization/materials.dm
index d82b3df641bb..9ce2feb2c266 100644
--- a/code/controllers/subsystems/initialization/materials.dm
+++ b/code/controllers/subsystems/initialization/materials.dm
@@ -6,8 +6,6 @@ SUBSYSTEM_DEF(materials)
priority = SS_PRIORITY_MATERIALS
// Material vars.
- var/list/materials
- var/list/strata
var/list/fusion_reactions
var/list/weighted_minerals_sparse = list()
var/list/weighted_minerals_rich = list()
@@ -54,9 +52,8 @@ SUBSYSTEM_DEF(materials)
sortTim(cocktails_by_primary_ingredient[reagent], /proc/cmp_cocktail_des)
// Various other material functions.
- build_material_lists() // Build core material lists.
+ build_mineral_weight_lists()
build_fusion_reaction_list() // Build fusion reaction tree.
- materials = sortTim(SSmaterials.materials, /proc/cmp_name_asc)
var/alpha_inc = 256 / DAMAGE_OVERLAY_COUNT
for(var/i = 1; i <= DAMAGE_OVERLAY_COUNT; i++)
@@ -65,18 +62,11 @@ SUBSYSTEM_DEF(materials)
img.alpha = (i * alpha_inc) - 1
LAZYADD(wall_damage_overlays, img)
- strata = decls_repository.get_decls_of_subtype(/decl/strata) // for debug VV purposes
-
. = ..()
-/datum/controller/subsystem/materials/proc/build_material_lists()
- if(LAZYLEN(materials))
- return
- materials = list()
- var/list/material_decls = decls_repository.get_decls_of_subtype(/decl/material)
- for(var/mtype in material_decls)
- var/decl/material/new_mineral = material_decls[mtype]
- materials += new_mineral
+/datum/controller/subsystem/materials/proc/build_mineral_weight_lists()
+ var/list/material_decls = decls_repository.get_decls_of_subtype_unassociated(/decl/material)
+ for(var/decl/material/new_mineral as anything in material_decls)
if(new_mineral.sparse_material_weight)
weighted_minerals_sparse[new_mineral.type] = new_mineral.sparse_material_weight
if(new_mineral.rich_material_weight)
diff --git a/code/controllers/subsystems/jobs.dm b/code/controllers/subsystems/jobs.dm
index 311b9f487c0f..722dd50bee4c 100644
--- a/code/controllers/subsystems/jobs.dm
+++ b/code/controllers/subsystems/jobs.dm
@@ -438,14 +438,14 @@ SUBSYSTEM_DEF(jobs)
var/list/spawn_in_storage = list()
if(H.client.prefs.Gear() && job.loadout_allowed)
for(var/thing in H.client.prefs.Gear())
- var/decl/loadout_option/G = decls_repository.get_decl_by_id_or_var(thing, /decl/loadout_option)
- if(!istype(G))
+ var/decl/loadout_option/gear = decls_repository.get_decl_by_id_or_var(thing, /decl/loadout_option)
+ if(!istype(gear))
continue
- if(!G.is_permitted(H, job))
+ if(!gear.is_permitted(H, job))
to_chat(H, SPAN_WARNING("Your current species, job, branch, skills or whitelist status does not permit you to spawn with [thing]!"))
continue
- if(!G.slot || !G.spawn_on_mob(H, H.client.prefs.Gear()[G.uid]))
- spawn_in_storage.Add(G)
+ if(!gear.slot || !gear.spawn_on_mob(H, H.client.prefs.Gear()[gear.uid]))
+ spawn_in_storage.Add(gear)
// do accessories last so they don't attach to a suit that will be replaced
if(H.char_rank && H.char_rank.accessory)
@@ -537,8 +537,8 @@ SUBSYSTEM_DEF(jobs)
return other_mob
if(spawn_in_storage)
- for(var/decl/loadout_option/G in spawn_in_storage)
- G.spawn_in_storage_or_drop(H, H.client.prefs.Gear()[G.uid])
+ for(var/decl/loadout_option/gear in spawn_in_storage)
+ gear.spawn_in_storage_or_drop(H, H.client.prefs.Gear()[gear.uid])
var/article = job.total_positions == 1 ? "the" : "a"
to_chat(H, "You are [article] [alt_title || job_title].")
@@ -573,7 +573,7 @@ SUBSYSTEM_DEF(jobs)
return positions_by_department[dept] || list()
/datum/controller/subsystem/jobs/proc/spawn_empty_ai()
- for(var/obj/abstract/landmark/start/S in global.landmarks_list)
+ for(var/obj/abstract/landmark/start/S in global.all_landmarks)
if(S.name != "AI")
continue
if(locate(/mob/living) in S.loc)
diff --git a/code/controllers/subsystems/lighting.dm b/code/controllers/subsystems/lighting.dm
index 068353abbe0c..43e79dea97ef 100644
--- a/code/controllers/subsystems/lighting.dm
+++ b/code/controllers/subsystems/lighting.dm
@@ -8,13 +8,16 @@ SUBSYSTEM_DEF(lighting)
var/total_lighting_overlays = 0
var/total_lighting_sources = 0
var/total_ambient_turfs = 0
- var/list/lighting_corners = list() // List of all lighting corners in the world.
+ var/total_lighting_corners = 0
- var/list/light_queue = list() // lighting sources queued for update.
+ /// lighting sources queued for update.
+ var/list/light_queue = list()
var/lq_idex = 1
- var/list/corner_queue = list() // lighting corners queued for update.
+ /// lighting corners queued for update.
+ var/list/corner_queue = list()
var/cq_idex = 1
- var/list/overlay_queue = list() // lighting overlays queued for update.
+ /// lighting overlays queued for update.
+ var/list/overlay_queue = list()
var/oq_idex = 1
var/tmp/processed_lights = 0
@@ -25,18 +28,20 @@ SUBSYSTEM_DEF(lighting)
var/total_instant_updates = 0
#ifdef USE_INTELLIGENT_LIGHTING_UPDATES
+ var/instant_ctr = 0
var/force_queued = TRUE
- var/force_override = FALSE // For admins.
+ /// For admins.
+ var/force_override = FALSE
#endif
/datum/controller/subsystem/lighting/stat_entry()
var/list/out = list(
#ifdef USE_INTELLIGENT_LIGHTING_UPDATES
- "IUR: [total_ss_updates ? round(total_instant_updates/(total_instant_updates+total_ss_updates)*100, 0.1) : "NaN"]%\n",
+ "IUR: [total_ss_updates ? round(total_instant_updates/(total_instant_updates+total_ss_updates)*100, 0.1) : "NaN"]% Instant: [force_queued ? "Disabled" : "Allowed"]\n",
#endif
- "\tT:{L:[total_lighting_sources] C:[lighting_corners.len] O:[total_lighting_overlays] A:[total_ambient_turfs]}\n",
- "\tP:{L:[light_queue.len - (lq_idex - 1)]|C:[corner_queue.len - (cq_idex - 1)]|O:[overlay_queue.len - (oq_idex - 1)]}\n",
- "\tL:{L:[processed_lights]|C:[processed_corners]|O:[processed_overlays]}\n"
+ "\tT: { L: [total_lighting_sources] C: [total_lighting_corners] O:[total_lighting_overlays] A: [total_ambient_turfs] }\n",
+ "\tP: { L: [light_queue.len - (lq_idex - 1)] C: [corner_queue.len - (cq_idex - 1)] O: [overlay_queue.len - (oq_idex - 1)] }\n",
+ "\tL: { L: [processed_lights] C: [processed_corners] O: [processed_overlays]}\n"
)
..(out.Join())
@@ -46,6 +51,32 @@ SUBSYSTEM_DEF(lighting)
force_queued = FALSE
total_ss_updates = 0
total_instant_updates = 0
+
+/// Disable instant updates, relying entirely on the (slower, but less laggy) queued pathway. Use if changing a *lot* of lights.
+/datum/controller/subsystem/lighting/proc/pause_instant()
+ if (force_override)
+ return
+
+ instant_ctr += 1
+ if (instant_ctr == 1)
+ force_queued = TRUE
+
+/// Resume instant updates.
+/datum/controller/subsystem/lighting/proc/resume_instant()
+ if (force_override)
+ return
+
+ instant_ctr = max(instant_ctr - 1, 0)
+
+ if (!instant_ctr)
+ force_queued = FALSE
+
+#else
+
+/datum/controller/subsystem/lighting/proc/pause_instant()
+
+/datum/controller/subsystem/lighting/proc/resume_instant()
+
#endif
/datum/controller/subsystem/lighting/Initialize(timeofday)
@@ -157,7 +188,7 @@ SUBSYSTEM_DEF(lighting)
oq_idex = 1
/datum/controller/subsystem/lighting/Recover()
- lighting_corners = SSlighting.lighting_corners
+ total_lighting_corners = SSlighting.total_lighting_corners
total_lighting_overlays = SSlighting.total_lighting_overlays
total_lighting_sources = SSlighting.total_lighting_sources
diff --git a/code/controllers/subsystems/machines.dm b/code/controllers/subsystems/machines.dm
index 19a5202daa38..ca54acb3d7d3 100644
--- a/code/controllers/subsystems/machines.dm
+++ b/code/controllers/subsystems/machines.dm
@@ -94,7 +94,7 @@ if(current_step == this_step || (check_resumed && !resumed)) {\
for(var/datum/powernet/PN in powernets)
qdel(PN)
powernets.Cut()
- setup_powernets_for_cables(global.cable_list)
+ setup_powernets_for_cables(global.all_cables)
/datum/controller/subsystem/machines/proc/setup_powernets_for_cables(list/cables)
for(var/obj/structure/cable/PC in cables)
diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm
index baf6e4c614de..69bde2c28c2d 100644
--- a/code/controllers/subsystems/supply.dm
+++ b/code/controllers/subsystems/supply.dm
@@ -40,13 +40,10 @@ SUBSYSTEM_DEF(supply)
ordernum = rand(1,9000)
//Build master supply list
- var/decl/hierarchy/supply_pack/root = GET_DECL(/decl/hierarchy/supply_pack)
- for(var/decl/hierarchy/supply_pack/sp in root.children)
- if(sp.is_category())
- for(var/decl/hierarchy/supply_pack/spc in sp.get_descendants())
- spc.setup()
- master_supply_list += spc
- CHECK_TICK
+ var/decl/hierarchy/supply_pack/root = IMPLIED_DECL
+ for(var/decl/hierarchy/supply_pack/pack in root.get_descendants())
+ if(!pack.is_category())
+ master_supply_list += pack
// Just add points over time.
/datum/controller/subsystem/supply/fire()
@@ -62,68 +59,63 @@ SUBSYSTEM_DEF(supply)
point_sources[source] += amount
point_sources["total"] += amount
- //To stop things being sent to centcomm which should not be sent to centcomm. Recursively checks for these types.
-/datum/controller/subsystem/supply/proc/forbidden_atoms_check(atom/A)
- if(isliving(A))
- return 1
- if(istype(A,/obj/item/disk/nuclear))
- return 1
- if(istype(A,/obj/machinery/nuclearbomb))
- return 1
- if(istype(A,/obj/item/radio/beacon))
- return 1
-
- for(var/i=1, i<=A.contents.len, i++)
- var/atom/B = A.contents[i]
- if(.(B))
- return 1
+/// To stop things being sent to centcomm which should not be sent to centcomm. Recursively checks for these types.
+/datum/controller/subsystem/supply/proc/forbidden_atoms_check(atom/checking)
+ if(isliving(checking)) // You can't send a mob to the admin level.
+ return TRUE
+ if(istype(checking, /obj/item/disk/nuclear)) // Keep it somewhere nuclear operatives can reach it.
+ return TRUE
+ if(istype(checking, /obj/machinery/nuclearbomb)) // Don't nuke the admin level.
+ return TRUE
+ if(istype(checking, /obj/item/radio/beacon)) // Because these can be used for teleportation, I guess?
+ return TRUE
+
+ for(var/atom/child in checking.contents)
+ if(forbidden_atoms_check(child))
+ return TRUE
+ return FALSE
/datum/controller/subsystem/supply/proc/sell()
-
for(var/area/subarea in shuttle.shuttle_area)
- for(var/atom/movable/AM in subarea)
- if(AM.anchored)
+ for(var/obj/structure/closet/crate/sold_crate in subarea)
+ if(sold_crate.anchored)
continue
- if(istype(AM, /obj/structure/closet/crate))
- var/obj/structure/closet/crate/CR = AM
- RAISE_EVENT(/decl/observ/crate_sold, subarea, CR)
- add_points_from_source(CR.get_single_monetary_worth() * crate_return_rebate * 0.1, "crate")
- var/find_slip = 1
-
- for(var/atom/atom as anything in CR)
- // Sell manifests
- if(find_slip && istype(atom, /obj/item/paper/manifest))
- var/obj/item/paper/manifest/slip = atom
- if(!LAZYACCESS(slip.metadata, "is_copy") && LAZYLEN(slip.applied_stamps))
- add_points_from_source(LAZYACCESS(slip.metadata, "order_total") * slip_return_rebate, "manifest")
- find_slip = 0
- continue
-
- // Sell materials
- if(is_type_in_list(atom, saleable_materials))
- add_points_from_source(atom.get_combined_monetary_worth() * goods_sale_modifier * 0.1, "goods")
- // Must sell ore detector disks in crates
- else if(istype(atom, /obj/item/disk/survey))
- add_points_from_source(atom.get_combined_monetary_worth() * 0.005, "data")
-
- qdel(AM)
+ RAISE_EVENT(/decl/observ/crate_sold, subarea, sold_crate)
+ add_points_from_source(sold_crate.get_single_monetary_worth() * crate_return_rebate * 0.1, "crate")
+ var/find_slip = TRUE
+
+ for(var/atom/movable/subcontent as anything in sold_crate)
+ // Sell manifests
+ if(find_slip && istype(subcontent, /obj/item/paper/manifest))
+ var/obj/item/paper/manifest/slip = subcontent
+ if(!LAZYACCESS(slip.metadata, "is_copy") && LAZYLEN(slip.applied_stamps))
+ add_points_from_source(LAZYACCESS(slip.metadata, "order_total") * slip_return_rebate, "manifest")
+ find_slip = FALSE
+ continue
+
+ // Sell materials
+ if(is_type_in_list(subcontent, saleable_materials))
+ add_points_from_source(subcontent.get_combined_monetary_worth() * goods_sale_modifier * 0.1, "goods")
+ // Must sell ore detector disks in crates
+ else if(istype(subcontent, /obj/item/disk/survey))
+ add_points_from_source(subcontent.get_combined_monetary_worth() * 0.005, "data")
+
+ qdel(sold_crate)
/datum/controller/subsystem/supply/proc/get_clear_turfs()
var/list/clear_turfs = list()
-
for(var/area/subarea in shuttle.shuttle_area)
- for(var/turf/T in subarea)
- if(T.density)
+ for(var/turf/candidate_turf in subarea)
+ if(candidate_turf.density)
continue
- var/occupied = 0
- for(var/atom/A in T.contents)
- if(!A.simulated)
+ var/occupied = FALSE
+ for(var/atom/movable/child as anything in candidate_turf.contents)
+ if(!child.simulated || !child.density)
continue
- occupied = 1
+ occupied = TRUE
break
if(!occupied)
- clear_turfs += T
-
+ clear_turfs += candidate_turf
return clear_turfs
//Buyin
@@ -133,56 +125,55 @@ SUBSYSTEM_DEF(supply)
var/list/clear_turfs = get_clear_turfs()
- for(var/S in shoppinglist)
+ for(var/datum/supply_order/order in shoppinglist)
if(!clear_turfs.len)
break
var/turf/pickedloc = pick_n_take(clear_turfs)
- shoppinglist -= S
- donelist += S
+ shoppinglist -= order
+ donelist += order
- var/datum/supply_order/SO = S
- var/decl/hierarchy/supply_pack/SP = SO.object
+ var/decl/hierarchy/supply_pack/supplypack = order.object
- var/obj/A = new SP.containertype(pickedloc)
- A.SetName("[SP.containername][SO.comment ? " ([SO.comment])":"" ]")
+ var/obj/result = new supplypack.containertype(pickedloc)
+ result.SetName("[supplypack.containername][order.comment ? " ([order.comment])":"" ]")
//supply manifest generation begin
var/obj/item/paper/manifest/slip
- if(!SP.contraband)
+ if(!supplypack.contraband)
var/info = list()
info +="[global.using_map.boss_name] Shipping Manifest
"
- info +="Order #[SO.ordernum]
"
+ info +="Order #[order.ordernum]
"
info +="Destination: [global.using_map.station_name]
"
info +="[shoppinglist.len] PACKAGES IN THIS SHIPMENT
"
info +="CONTENTS:
"
- slip = new /obj/item/paper/manifest(A, null, JOINTEXT(info))
- LAZYSET(slip.metadata, "order_total", SP.cost)
+ slip = new /obj/item/paper/manifest(result, null, JOINTEXT(info))
+ LAZYSET(slip.metadata, "order_total", supplypack.cost)
LAZYSET(slip.metadata, "is_copy", FALSE)
//spawn the stuff, finish generating the manifest while you're at it
- if(SP.access)
- if(!islist(SP.access))
- A.req_access = list(SP.access)
- else if(islist(SP.access))
- var/list/L = SP.access // access var is a plain var, we need a list
- A.req_access = L.Copy()
-
- var/list/spawned = SP.spawn_contents(A)
+ if(supplypack.access)
+ if(!islist(supplypack.access))
+ result.req_access = list(supplypack.access)
+ else if(islist(supplypack.access))
+ var/list/supplypack_access = supplypack.access // access var is a plain var, we need a list
+ result.req_access = supplypack_access.Copy()
+
+ var/list/spawned = supplypack.spawn_contents(result)
if(slip)
for(var/atom/content in spawned)
slip.info += "- [content.name]
" //add the item to the manifest
slip.info += "
CHECK CONTENTS AND STAMP BELOW THE LINE TO CONFIRM RECEIPT OF GOODS
"
// Adds any given item to the supply shuttle
-/datum/controller/subsystem/supply/proc/addAtom(var/atom/movable/A)
+/datum/controller/subsystem/supply/proc/addAtom(var/atom/movable/added)
var/list/clear_turfs = get_clear_turfs()
if(!clear_turfs.len)
return FALSE
var/turf/pickedloc = pick(clear_turfs)
- A.forceMove(pickedloc)
+ added.forceMove(pickedloc)
return TRUE
diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm
index 89122cad2f97..5c097d91ba2b 100644
--- a/code/controllers/subsystems/ticker.dm
+++ b/code/controllers/subsystems/ticker.dm
@@ -315,7 +315,7 @@ Helpers
/datum/controller/subsystem/ticker/proc/attempt_late_antag_spawn(var/list/antag_choices)
var/decl/special_role/antag = antag_choices[1]
while(antag_choices.len && antag)
- var/needs_ghost = antag.flags & (ANTAG_OVERRIDE_JOB | ANTAG_OVERRIDE_MOB)
+ var/needs_ghost = antag.is_latejoin_template()
if (needs_ghost)
looking_for_antags = 1
antag_pool.Cut()
diff --git a/code/controllers/subsystems/zcopy.dm b/code/controllers/subsystems/zcopy.dm
index 1f550d0aeeb1..e0dfe3f0b1cb 100644
--- a/code/controllers/subsystems/zcopy.dm
+++ b/code/controllers/subsystems/zcopy.dm
@@ -494,6 +494,8 @@ SUBSYSTEM_DEF(zcopy)
// return: is-invalid
/datum/controller/subsystem/zcopy/proc/discover_movable(atom/movable/object)
ASSERT(!QDELETED(object))
+ if(init_state < SS_INITSTATE_STARTED)
+ return FALSE // no-op, discover_movable is only valid during or after zcopy init
var/turf/Tloc = object.loc
if (!isturf(Tloc) || !MOVABLE_SHALL_MIMIC(object))
@@ -503,12 +505,13 @@ SUBSYSTEM_DEF(zcopy)
ZM_RECORD_START
+ var/above_needs_discovery = FALSE
if (!object.bound_overlay)
var/atom/movable/openspace/mimic/M = new(T)
object.bound_overlay = M
+ M.z_flags = object.z_flags // Necessary to ensure MOVABLE_IS_ON_ZTURF works
M.associated_atom = object
- if (TURF_IS_MIMICKING(M.loc))
- .(M)
+ above_needs_discovery = TRUE
var/override_depth
var/original_type = object.type
@@ -559,6 +562,9 @@ SUBSYSTEM_DEF(zcopy)
ZM_RECORD_STOP
ZM_RECORD_WRITE(discovery_stats, "Depth [OO.depth] on [OO.z]")
+ if (above_needs_discovery && MOVABLE_IS_ON_ZTURF(OO))
+ discover_movable(OO) // recursion!
+
return FALSE
/datum/controller/subsystem/zcopy/proc/flush_z_state(turf/T)
diff --git a/code/datums/ai/beast.dm b/code/datums/ai/beast.dm
index 9090698f55aa..f730e939e913 100644
--- a/code/datums/ai/beast.dm
+++ b/code/datums/ai/beast.dm
@@ -41,8 +41,8 @@
if(!length(.))
if(LAZYLEN(prey))
. = list()
- for(var/weakref/W in prey)
- var/mob/M = W.resolve()
+ for(var/weakref/prey_ref in prey)
+ var/mob/M = prey_ref.resolve()
if(M)
. |= M
else if(body.get_nutrition() < body.get_max_nutrition() * 0.75) //time to look for some food
diff --git a/code/datums/appearances/appearance_manager.dm b/code/datums/appearances/appearance_manager.dm
index d196a89303dc..be42ee3bd184 100644
--- a/code/datums/appearances/appearance_manager.dm
+++ b/code/datums/appearances/appearance_manager.dm
@@ -23,7 +23,7 @@
/decl/appearance_manager/proc/remove_appearances(var/mob/viewer)
var/datum/priority_queue/pq = appearances_[viewer]
- for(var/entry in pq.L)
+ for(var/entry in pq.GetQueue())
var/datum/appearance_data/ad = entry
ad.RemoveViewer(viewer, FALSE)
if(viewer in appearances_)
@@ -39,7 +39,7 @@
var/datum/priority_queue/pq = appearances_[viewer]
if(!pq)
return
- for(var/entry in pq.L)
+ for(var/entry in pq.GetQueue())
var/datum/appearance_data/ad = entry
viewer.client.images -= ad.images
@@ -49,6 +49,6 @@
var/datum/priority_queue/pq = appearances_[viewer]
if(!pq)
return
- for(var/entry in pq.L)
+ for(var/entry in pq.GetQueue())
var/datum/appearance_data/ad = entry
viewer.client.images |= ad.images
diff --git a/code/datums/appearances/automatic/cardborg.dm b/code/datums/appearances/automatic/cardborg.dm
index 52ad0031f3bb..dcc909286344 100644
--- a/code/datums/appearances/automatic/cardborg.dm
+++ b/code/datums/appearances/automatic/cardborg.dm
@@ -34,19 +34,19 @@
var/obj/item/back = H.get_equipped_item(slot_back_str)
if(!istype(back))
return
- var/decl/cardborg_appearance/ca = appearances[back.type]
- if(!ca) ca = appearances[/obj/item/backpack]
+ var/decl/cardborg_appearance/disguise = appearances[back.type]
+ if(!disguise) disguise = appearances[/obj/item/backpack]
- var/image/I = image(icon = ca.icon, icon_state = ca.icon_state, loc = H)
+ var/image/I = image(icon = disguise.icon, icon_state = disguise.icon_state, loc = H)
I.override = 1
- I.overlays += image(icon = ca.icon, icon_state = "[ca.icon_state]-eyes") //gotta look realistic
+ I.overlays += image(icon = disguise.icon, icon_state = "[disguise.icon_state]-eyes") //gotta look realistic
return I
/decl/appearance_handler/cardborg/proc/init_appearances()
if(!appearances)
appearances = list()
- for(var/decl/cardborg_appearance/ca in init_subtypes(/decl/cardborg_appearance))
- appearances[ca.backpack_type] = ca
+ for(var/decl/cardborg_appearance/disguise in init_subtypes(/decl/cardborg_appearance))
+ appearances[disguise.backpack_type] = disguise
/decl/cardborg_appearance
var/backpack_type
diff --git a/code/datums/category.dm b/code/datums/category.dm
index 1c2688ff57d3..d345573374c9 100644
--- a/code/datums/category.dm
+++ b/code/datums/category.dm
@@ -12,16 +12,16 @@
categories_by_name = new()
for(var/category_type in typesof(category_group_type))
var/datum/category_group/category = category_type
- if(initial(category.name))
- category = new category(src)
- categories += category
- categories_by_name[category.name] = category
+ if(TYPE_IS_ABSTRACT(category))
+ continue
+ category = new category(src)
+ categories += category
+ ASSERT(category.name)
+ categories_by_name[category.name] = category
categories = sortTim(categories, /proc/cmp_category_groups)
/datum/category_collection/Destroy()
- for(var/category in categories)
- qdel(category)
- categories.Cut()
+ QDEL_LIST(categories)
return ..()
/******************
@@ -43,10 +43,12 @@
for(var/item_type in typesof(category_item_type))
var/datum/category_item/item = item_type
- if(initial(item.name))
- item = new item(src)
- items += item
- items_by_name[item.name] = item
+ if(TYPE_IS_ABSTRACT(item))
+ continue
+ item = new item(src)
+ items += item
+ ASSERT(item.name)
+ items_by_name[item.name] = item
// For whatever reason dd_insertObjectList(items, item) doesn't insert in the correct order
// If you change this, confirm that character setup doesn't become completely unordered.
@@ -67,6 +69,7 @@
* Category Items *
*****************/
/datum/category_item
+ abstract_type = /datum/category_item
var/name = ""
var/datum/category_group/category // The group this item belongs to
diff --git a/code/datums/cinematic.dm b/code/datums/cinematic.dm
index 86ddc55b91f6..bf03370505e8 100644
--- a/code/datums/cinematic.dm
+++ b/code/datums/cinematic.dm
@@ -27,7 +27,7 @@ var/global/datum/cinematic/cinematic = new
if(M.client)
M.client.screen += cinematic_screen //show every client the cinematic
viewers[M.client] = GET_STATUS(M, STAT_STUN)
- M.set_status(STAT_STUN, 8000)
+ M.set_status_condition(STAT_STUN, 8000)
override.nuke_act(cinematic_screen, station_missed) //cinematic happens here, as does mob death.
//If it's actually the end of the round, wait for it to end.
@@ -36,6 +36,6 @@ var/global/datum/cinematic/cinematic = new
for(var/client/C in viewers)
if(C.mob)
- C.mob.set_status(STAT_STUN, viewers[C])
+ C.mob.set_status_condition(STAT_STUN, viewers[C])
C.screen -= cinematic_screen
QDEL_NULL(cinematic_screen)
\ No newline at end of file
diff --git a/code/datums/datum.dm b/code/datums/datum.dm
index d4d9d3f5a1b5..881b69bb4e36 100644
--- a/code/datums/datum.dm
+++ b/code/datums/datum.dm
@@ -50,10 +50,8 @@
qdel(extension)
extensions = null
- var/decl/observ/destroyed/destroyed_event = GET_DECL(/decl/observ/destroyed)
- // Typecheck is needed (rather than nullchecking) due to oddness with new() ordering during world creation.
- if(istype(events_repository) && destroyed_event.event_sources[src])
- RAISE_EVENT(/decl/observ/destroyed, src)
+ if(event_listeners?[/decl/observ/destroyed])
+ raise_event_non_global(/decl/observ/destroyed)
if (!isturf(src)) // Not great, but the 'correct' way to do it would add overhead for little benefit.
cleanup_events(src)
diff --git a/code/datums/daycycle/time_of_day.dm b/code/datums/daycycle/time_of_day.dm
index 5411dba4b076..fbe3f6330d7b 100644
--- a/code/datums/daycycle/time_of_day.dm
+++ b/code/datums/daycycle/time_of_day.dm
@@ -24,7 +24,7 @@
name = "daytime"
announcement = "The sun rises over the horizon, beginning another day."
period = 0.4
- power = 1
+ power = 0.8
color = COLOR_DAYLIGHT
/datum/daycycle_period/sunset
diff --git a/code/datums/extensions/abilities/ability_handler.dm b/code/datums/extensions/abilities/ability_handler.dm
index d215868a4c58..5ac742b00384 100644
--- a/code/datums/extensions/abilities/ability_handler.dm
+++ b/code/datums/extensions/abilities/ability_handler.dm
@@ -21,7 +21,7 @@
if(!istype(owner))
CRASH("Ability handler received invalid owner!")
..()
- refresh_login()
+ refresh_login(being_created = TRUE)
/datum/ability_handler/Process()
@@ -211,7 +211,7 @@
stat(stat_strings[1], stat_strings[2])
/// Individual ability methods/disciplines (psioncs, etc.) so that mobs can have multiple.
-/datum/ability_handler/proc/refresh_login()
+/datum/ability_handler/proc/refresh_login(being_created = FALSE)
SHOULD_CALL_PARENT(TRUE)
if(LAZYLEN(screen_elements))
var/list/add_elements = list()
diff --git a/code/datums/extensions/assembly/assembly_interaction.dm b/code/datums/extensions/assembly/assembly_interaction.dm
index a4c4c8b2f920..7987ee9f8fd6 100644
--- a/code/datums/extensions/assembly/assembly_interaction.dm
+++ b/code/datums/extensions/assembly/assembly_interaction.dm
@@ -1,5 +1,5 @@
-/datum/extension/assembly/proc/attackby(var/obj/item/W, var/mob/user)
- if(IS_WRENCH(W))
+/datum/extension/assembly/proc/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_WRENCH(used_item))
if(parts.len)
to_chat(user, "Remove all components from \the [holder] before disassembling it.")
return TRUE
@@ -9,10 +9,10 @@
qdel(holder)
return TRUE
- if(IS_WELDER(W))
- var/obj/item/weldingtool/WT = W
- if(!WT.isOn())
- to_chat(user, "\The [W] is off.")
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.isOn())
+ to_chat(user, "\The [used_item] is off.")
return TRUE
if(!damage)
@@ -20,12 +20,12 @@
return TRUE
to_chat(user, "You begin repairing damage to \the [holder]...")
- if(WT.weld(round(damage/75)) && do_after(user, damage/10))
+ if(welder.weld(round(damage/75)) && do_after(user, damage/10))
damage = 0
to_chat(user, "You repair \the [holder].")
return TRUE
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
if(!parts.len)
to_chat(user, "This device doesn't have any components installed.")
return TRUE
@@ -47,24 +47,24 @@
uninstall_component(user, H)
return TRUE
- if(istype(W, /obj/item/card/id)) // ID Card, try to insert it.
+ if(istype(used_item, /obj/item/card/id)) // ID Card, try to insert it.
var/obj/item/stock_parts/computer/card_slot/card_slot = get_component(PART_CARD)
if(!card_slot)
- to_chat(user, SPAN_WARNING("You try to insert [W] into [holder], but it does not have an ID card slot installed."))
+ to_chat(user, SPAN_WARNING("You try to insert [used_item] into [holder], but it does not have an ID card slot installed."))
return TRUE
- card_slot.insert_id(W, user)
+ card_slot.insert_id(used_item, user)
return TRUE
- if(istype(W, /obj/item/charge_stick)) // Try to insert charge stick.
+ if(istype(used_item, /obj/item/charge_stick)) // Try to insert charge stick.
var/obj/item/stock_parts/computer/charge_stick_slot/mstick_slot = get_component(PART_MSTICK)
if(!mstick_slot)
- to_chat(user, SPAN_WARNING("You try to insert [W] into [holder], but it does not have a charge-stick slot installed."))
+ to_chat(user, SPAN_WARNING("You try to insert [used_item] into [holder], but it does not have a charge-stick slot installed."))
return TRUE
- mstick_slot.insert_stick(W, user)
+ mstick_slot.insert_stick(used_item, user)
return TRUE
- if(istype(W, PART_DRIVE)) // Portable HDD, try to insert it.
- var/obj/item/stock_parts/computer/hard_drive/portable/I = W
+ if(istype(used_item, PART_DRIVE)) // Portable HDD, try to insert it.
+ var/obj/item/stock_parts/computer/hard_drive/portable/I = used_item
var/obj/item/stock_parts/computer/drive_slot/drive_slot = get_component(PART_D_SLOT)
if(!drive_slot)
to_chat(user, SPAN_WARNING("You try to insert [I] into [holder], but it does not have a drive slot installed."))
@@ -72,8 +72,8 @@
drive_slot.insert_drive(I, user)
return TRUE
- if(istype(W, /obj/item/disk))
- var/obj/item/disk/disk = W
+ if(istype(used_item, /obj/item/disk))
+ var/obj/item/disk/disk = used_item
var/obj/item/stock_parts/computer/data_disk_drive/disk_drive = get_component(PART_DSKSLOT)
if(!disk_drive)
to_chat(user, SPAN_WARNING("You try to insert [disk] into [holder], but it does not have a disk slot installed."))
@@ -81,26 +81,26 @@
disk_drive.insert_disk(disk, user)
return TRUE
- if(istype(W, /obj/item/paper))
- var/obj/item/paper/paper = W
+ if(istype(used_item, /obj/item/paper))
+ var/obj/item/paper/paper = used_item
if(paper.info)
var/obj/item/stock_parts/computer/scanner/scanner = get_component(PART_SCANNER)
if(scanner)
- scanner.attackby(user, W)
+ scanner.attackby(user, used_item)
return TRUE
- if(istype(W, /obj/item/paper) || istype(W, /obj/item/paper_bundle))
+ if(istype(used_item, /obj/item/paper) || istype(used_item, /obj/item/paper_bundle))
var/obj/item/stock_parts/computer/scanner/scanner = get_component(PART_SCANNER)
if(scanner)
- scanner.attackby(W, user)
+ scanner.attackby(used_item, user)
return TRUE
- if(istype(W, /obj/item/aicard))
+ if(istype(used_item, /obj/item/aicard))
var/obj/item/stock_parts/computer/ai_slot/ai_slot = get_component(PART_AI)
if(ai_slot)
- ai_slot.attackby(W, user)
+ ai_slot.attackby(used_item, user)
return TRUE
- if(istype(W, /obj/item/stock_parts))
- return try_install_component(user, W)
+ if(istype(used_item, /obj/item/stock_parts))
+ return try_install_component(user, used_item)
return FALSE
\ No newline at end of file
diff --git a/code/datums/extensions/lockable.dm b/code/datums/extensions/lockable.dm
index 095522d2f9b3..12fd928839ba 100644
--- a/code/datums/extensions/lockable.dm
+++ b/code/datums/extensions/lockable.dm
@@ -395,13 +395,13 @@
/**
Called when a multitool is used on the holder to hack the device.
*/
-/datum/extension/lockable/proc/try_hack(obj/item/multitool/W, mob/user)
+/datum/extension/lockable/proc/try_hack(obj/item/multitool/multitool, mob/user)
//Don't do anything if the panel isn't opened, or if we're already hacking it.
if(!open || l_hacking)
return FALSE
//Show a message to let the user know how likely this is to even succeed.
- var/fail_chance = hack_fail_chance(W, user)
+ var/fail_chance = hack_fail_chance(multitool, user)
var/skill_msg
if(fail_chance >= 90)
skill_msg = SPAN_WARNING("But, you struggle to make sense of this thing..")
@@ -436,7 +436,7 @@
/**
Returns a percent chance of the given user failing at hacking this lock.
*/
-/datum/extension/lockable/proc/hack_fail_chance(obj/item/multitool/W, mob/user)
+/datum/extension/lockable/proc/hack_fail_chance(obj/item/multitool/multitool, mob/user)
//In order to make the lock actually any use at all, make sure not just anybody with a multitool can open it.
return user.skill_fail_chance(SKILL_DEVICES, 99, SKILL_MAX, 0.35)
diff --git a/code/datums/hierarchy.dm b/code/datums/hierarchy.dm
index 1186dcebc939..361295e09ae3 100644
--- a/code/datums/hierarchy.dm
+++ b/code/datums/hierarchy.dm
@@ -4,6 +4,8 @@
var/name = "Hierarchy"
var/decl/hierarchy/parent
var/list/decl/hierarchy/children
+ /// The cached result of get_descendants(). Should not be mutated.
+ VAR_PRIVATE/list/decl/hierarchy/_descendants
var/expected_type
/decl/hierarchy/Initialize()
@@ -22,10 +24,13 @@
/decl/hierarchy/proc/get_descendants()
if(!children)
return
- . = children.Copy()
+ if(_descendants)
+ return _descendants
+ _descendants = children.Copy()
for(var/decl/hierarchy/child in children)
if(child.children)
- . |= child.get_descendants()
+ _descendants |= child.get_descendants()
+ return _descendants
/decl/hierarchy/dd_SortValue()
return name
diff --git a/code/datums/inventory_slots/inventory_gripper.dm b/code/datums/inventory_slots/inventory_gripper.dm
index 08d90f5bd49e..2f87394ca74e 100644
--- a/code/datums/inventory_slots/inventory_gripper.dm
+++ b/code/datums/inventory_slots/inventory_gripper.dm
@@ -1,13 +1,12 @@
/datum/inventory_slot/gripper
+ // For reference, grippers do not use ui_loc, they have it set dynamically during /datum/hud/proc/rebuild_hands()
+ quick_equip_priority = null // you quick-equip stuff by holding it in a gripper, so this ought to be skipped
+ fluid_height = (FLUID_SHALLOW + FLUID_OVER_MOB_HEAD) / 2 // halfway between waist and top of head, so roughly chest level, reasoning that you can just hold it up out of the water
var/hand_sort_priority = 1
var/dexterity = DEXTERITY_FULL
var/covering_slot_flags
/// If set, use this icon_state for the hand slot overlay; otherwise, use slot_id.
var/hand_overlay
- quick_equip_priority = null // you quick-equip stuff by holding it in a gripper, so this ought to be skipped
- fluid_height = (FLUID_SHALLOW + FLUID_OVER_MOB_HEAD) / 2 // halfway between waist and top of head, so roughly chest level, reasoning that you can just hold it up out of the water
-
- // For reference, grippers do not use ui_loc, they have it set dynamically during /datum/hud/proc/rebuild_hands()
/datum/inventory_slot/gripper/proc/get_dexterity(var/silent)
return dexterity
@@ -32,16 +31,3 @@
/datum/inventory_slot/gripper/can_equip_to_slot(var/mob/user, var/obj/item/prop, var/disable_warning)
return ..() && user.check_dexterity(DEXTERITY_EQUIP_ITEM, silent = disable_warning)
-
-// Stub definitions for future work and to pass CI.
-/datum/inventory_slot/gripper/robot
- abstract_type = /datum/inventory_slot/gripper/robot
-
-/datum/inventory_slot/gripper/robot/one
- ui_label = "1"
-
-/datum/inventory_slot/gripper/robot/two
- ui_label = "2"
-
-/datum/inventory_slot/gripper/robot/three
- ui_label = "3"
diff --git a/code/datums/inventory_slots/inventory_gripper_robot.dm b/code/datums/inventory_slots/inventory_gripper_robot.dm
new file mode 100644
index 000000000000..11e521a8612f
--- /dev/null
+++ b/code/datums/inventory_slots/inventory_gripper_robot.dm
@@ -0,0 +1,24 @@
+// Stub definitions for future work and to pass CI.
+/datum/inventory_slot/gripper/robot
+ abstract_type = /datum/inventory_slot/gripper/robot
+
+/datum/inventory_slot/gripper/robot/can_equip_to_slot(var/mob/user, var/obj/item/prop, var/disable_warning)
+ var/mob/living/silicon/robot/robot = user
+ if(!istype(robot) || !robot.module || !(prop in robot.module.equipment))
+ return FALSE
+ return ..()
+
+/datum/inventory_slot/gripper/robot/one
+ slot_name = "Primary Hardpoint"
+ slot_id = "slot_robot_one"
+ ui_label = "1"
+
+/datum/inventory_slot/gripper/robot/two
+ slot_name = "Secondary Hardpoint"
+ slot_id = "slot_robot_two"
+ ui_label = "2"
+
+/datum/inventory_slot/gripper/robot/three
+ slot_name = "Tertiary Hardpoint"
+ slot_id = "slot_robot_three"
+ ui_label = "3"
diff --git a/code/datums/mind/memory.dm b/code/datums/mind/memory.dm
index 34dacf9ef8a3..0089d7d8dfc9 100644
--- a/code/datums/mind/memory.dm
+++ b/code/datums/mind/memory.dm
@@ -7,8 +7,8 @@
. = mind.StoreMemory(memory, options)
/datum/mind/proc/StoreMemory(var/memory, var/options)
- var/decl/memory_options/MO = GET_DECL(options || /decl/memory_options/default)
- return MO.Create(src, memory)
+ var/decl/memory_options/memory_option = GET_DECL(options || /decl/memory_options/default)
+ return memory_option.Create(src, memory)
/datum/mind/proc/RemoveMemory(var/datum/memory/memory, var/mob/remover)
if(!memory)
@@ -20,20 +20,18 @@
ShowMemory(remover)
/datum/mind/proc/ClearMemories(var/list/tags)
- for(var/mem in memories)
- var/datum/memory/M = mem
+ for(var/datum/memory/mem as anything in memories)
// If no tags were supplied OR if there is any union between the given tags and memory tags
// then remove the memory
- if(!length(tags) || length(tags & M.tags))
- LAZYREMOVE(memories, M)
+ if(!length(tags) || length(tags & mem.tags))
+ LAZYREMOVE(memories, mem)
/datum/mind/proc/CopyMemories(var/datum/mind/target)
if(!istype(target))
return
- for(var/mem in memories)
- var/datum/memory/M = mem
- M.Copy(target)
+ for(var/datum/memory/mem in memories)
+ mem.Copy(target)
/datum/mind/proc/MemoryTags()
. = list()
@@ -50,13 +48,12 @@
var/list/output = list()
var/last_owner_name
// We pretend that memories are stored in some semblance of an order
- for(var/mem in memories)
- var/datum/memory/M = mem
- var/owner_name = M.OwnerName()
+ for(var/datum/memory/mem in memories)
+ var/owner_name = mem.OwnerName()
if(owner_name != last_owner_name)
output += "[current.real_name]'s Memories
"
last_owner_name = owner_name
- output += "[M.memory] \[Remove\]"
+ output += "[mem.memory] \[Remove\]"
if(objectives.len > 0)
output += "
Objectives:"
@@ -161,9 +158,8 @@
return
var/relevant_memories = 0
- for(var/mem in target.memories)
- var/datum/memory/M = mem
- if(M.type == memory_type)
+ for(var/datum/memory/mem in target.memories)
+ if(mem.type == memory_type)
relevant_memories++
if(relevant_memories > memory_limit)
diff --git a/code/datums/mind/mind.dm b/code/datums/mind/mind.dm
index 1db348880015..27a740428272 100644
--- a/code/datums/mind/mind.dm
+++ b/code/datums/mind/mind.dm
@@ -46,12 +46,8 @@
var/list/datum/objective/objectives = list()
- var/has_been_rev = 0//Tracks if this mind has been a rev or not
-
- var/rev_cooldown = 0
-
- // the world.time since the mob has been brigged, or -1 if not at all
- var/brigged_since = -1
+ /// The world.time value after which another conversion can be attempted.
+ var/conversion_cooldown = 0
//put this here for easier tracking ingame
var/datum/money_account/initial_account
@@ -142,8 +138,8 @@
if(href_list["add_goal"])
- var/mob/calling_proc = locate(href_list["add_goal_caller"])
- if(calling_proc && calling_proc == current) can_modify = TRUE
+ var/mob/goal_user = locate(href_list["add_goal_user"])
+ if(goal_user && goal_user == current) can_modify = TRUE
if(can_modify)
if(is_admin)
@@ -161,8 +157,8 @@
if(href_list["abandon_goal"])
var/datum/goal/goal = get_goal_from_href(href_list["abandon_goal"])
- var/mob/calling_proc = locate(href_list["abandon_goal_caller"])
- if(calling_proc && calling_proc == current) can_modify = TRUE
+ var/mob/goal_user = locate(href_list["abandon_goal_user"])
+ if(goal_user && goal_user == current) can_modify = TRUE
if(goal && can_modify)
if(usr == current)
@@ -176,8 +172,8 @@
if(href_list["reroll_goal"])
var/datum/goal/goal = get_goal_from_href(href_list["reroll_goal"])
- var/mob/calling_proc = locate(href_list["reroll_goal_caller"])
- if(calling_proc && calling_proc == current) can_modify = TRUE
+ var/mob/goal_user = locate(href_list["reroll_goal_user"])
+ if(goal_user && goal_user == current) can_modify = TRUE
if(goal && (goal in goals) && can_modify)
qdel(goal)
@@ -394,46 +390,30 @@
switch(href_list["silicon"])
if("unemag")
- var/mob/living/silicon/robot/R = current
- if (istype(R))
- R.emagged = 0
- if (R.activated(R.module.emag))
- R.module_active = null
- if(R.module_state_1 == R.module.emag)
- R.module_state_1 = null
- R.module.emag.forceMove(null)
- else if(R.module_state_2 == R.module.emag)
- R.module_state_2 = null
- R.module.emag.forceMove(null)
- else if(R.module_state_3 == R.module.emag)
- R.module_state_3 = null
- R.module.emag.forceMove(null)
- log_admin("[key_name_admin(usr)] has unemag'ed [R].")
+ var/mob/living/silicon/robot/robot = current
+ if (istype(robot))
+ if(robot.module?.emag)
+ robot.drop_from_inventory(robot.module.emag)
+ robot.module.emag.forceMove(null)
+ robot.emagged = FALSE
+ log_admin("[key_name_admin(usr)] has unemag'ed [robot].")
if("unemagcyborgs")
if (isAI(current))
var/mob/living/silicon/ai/ai = current
- for (var/mob/living/silicon/robot/R in ai.connected_robots)
- R.emagged = 0
- if (R.module)
- if (R.activated(R.module.emag))
- R.module_active = null
- if(R.module_state_1 == R.module.emag)
- R.module_state_1 = null
- R.module.emag.forceMove(null)
- else if(R.module_state_2 == R.module.emag)
- R.module_state_2 = null
- R.module.emag.forceMove(null)
- else if(R.module_state_3 == R.module.emag)
- R.module_state_3 = null
- R.module.emag.forceMove(null)
+ for (var/mob/living/silicon/robot/robot in ai.connected_robots)
+ robot.emagged = FALSE
+ if(robot.module?.emag)
+ robot.drop_from_inventory(robot.module.emag)
+ robot.module.emag.forceMove(null)
+
log_admin("[key_name_admin(usr)] has unemag'ed [ai]'s Cyborgs.")
else if (href_list["common"])
switch(href_list["common"])
if("undress")
- for(var/obj/item/W in current)
- current.drop_from_inventory(W)
+ for(var/obj/item/undressing in current)
+ current.drop_from_inventory(undressing)
if("takeuplink")
take_uplink()
if("crystals")
@@ -465,20 +445,6 @@
if(H)
qdel(H)
-
-// check whether this mind's mob has been brigged for the given duration
-// have to call this periodically for the duration to work properly
-/datum/mind/proc/is_brigged(duration)
- var/area/A = get_area(current)
- if(!isturf(current.loc) || !istype(A) || !(A.area_flags & AREA_FLAG_PRISON) || current.GetIdCard())
- brigged_since = -1
- return 0
-
- if(brigged_since == -1)
- brigged_since = world.time
-
- return (duration <= world.time - brigged_since)
-
/datum/mind/proc/reset()
assigned_role = null
assigned_special_role = null
@@ -486,9 +452,7 @@
assigned_job = null
initial_account = null
objectives = list()
- has_been_rev = 0
- rev_cooldown = 0
- brigged_since = -1
+ conversion_cooldown = 0
//Initialisation procs
/mob/living/proc/mind_initialize()
diff --git a/code/datums/movement/movement.dm b/code/datums/movement/movement.dm
index ffe142f72310..a4f79e092ffc 100644
--- a/code/datums/movement/movement.dm
+++ b/code/datums/movement/movement.dm
@@ -90,10 +90,7 @@ if(LAZYLEN(movement_handlers) && ispath(movement_handlers[1])) { \
var/oldloc = loc
var/turf/T = get_step(loc, direction)
if(istype(T))
- if(direction in global.cornerdirs) // Diagonal movement with step() currently breaks
- forceMove(T) // grabs, remove these lines when that is fixed.
- else
- step(src, direction)
+ step(src, direction)
return loc != oldloc
for(var/datum/movement_handler/movement_handler as anything in movement_handlers)
diff --git a/code/datums/music_tracks/fantasy.dm b/code/datums/music_tracks/fantasy.dm
index 6f1f6e05f279..521a9e5aa5d0 100644
--- a/code/datums/music_tracks/fantasy.dm
+++ b/code/datums/music_tracks/fantasy.dm
@@ -25,3 +25,10 @@
song = 'sound/music/Miris-Magic-Dance.ogg'
license = /decl/license/cc_by_3_0
url = "https://incompetech.com/music/royalty-free/index.html?isrc=USUAN1100157"
+
+/decl/music_track/adventure
+ artist = "Alexander Nakarada"
+ title = "Adventure"
+ song = 'sound/music/winter/alexander-nakarada-adventure.ogg'
+ license = /decl/license/cc_by_4_0
+ url = "https://creatorchords.com/music/adventure/"
\ No newline at end of file
diff --git a/code/datums/observation/density_set.dm b/code/datums/observation/density_set.dm
index 9a022b893257..0eaeb65e56e3 100644
--- a/code/datums/observation/density_set.dm
+++ b/code/datums/observation/density_set.dm
@@ -11,3 +11,4 @@
/decl/observ/density_set
name = "Density Set"
expected_type = /atom
+ flags = OBSERVATION_NO_GLOBAL_REGISTRATIONS
diff --git a/code/datums/observation/entered.dm b/code/datums/observation/entered.dm
index d52829d6c7df..3512ed616173 100644
--- a/code/datums/observation/entered.dm
+++ b/code/datums/observation/entered.dm
@@ -12,6 +12,7 @@
/decl/observ/entered
name = "Entered"
expected_type = /atom
+ flags = OBSERVATION_NO_GLOBAL_REGISTRATIONS
/*******************
* Entered Handling *
@@ -19,4 +20,5 @@
/atom/Entered(atom/movable/enterer, atom/old_loc)
..()
- RAISE_EVENT(/decl/observ/entered, src, enterer, old_loc)
+ if(event_listeners?[/decl/observ/entered])
+ raise_event_non_global(/decl/observ/entered, enterer, old_loc)
diff --git a/code/datums/observation/exited.dm b/code/datums/observation/exited.dm
index b00e30c79f68..6e8bc2ac80fc 100644
--- a/code/datums/observation/exited.dm
+++ b/code/datums/observation/exited.dm
@@ -12,6 +12,7 @@
/decl/observ/exited
name = "Exited"
expected_type = /atom
+ flags = OBSERVATION_NO_GLOBAL_REGISTRATIONS
/******************
* Exited Handling *
@@ -19,4 +20,5 @@
/atom/Exited(atom/movable/exitee, atom/new_loc)
. = ..()
- RAISE_EVENT(/decl/observ/exited, src, exitee, new_loc)
+ if(event_listeners?[/decl/observ/exited])
+ raise_event_non_global(/decl/observ/exited, exitee, new_loc)
diff --git a/code/datums/observation/helpers.dm b/code/datums/observation/helpers.dm
index 89330ecc50b0..b404f2372635 100644
--- a/code/datums/observation/helpers.dm
+++ b/code/datums/observation/helpers.dm
@@ -1,5 +1,6 @@
/atom/movable/proc/recursive_move(var/atom/movable/am, var/old_loc, var/new_loc)
- RAISE_EVENT(/decl/observ/moved, src, old_loc, new_loc)
+ if(event_listeners?[/decl/observ/moved])
+ raise_event_non_global(/decl/observ/moved, old_loc, new_loc)
/atom/movable/proc/move_to_turf(var/atom/movable/am, var/old_loc, var/new_loc)
var/turf/T = get_turf(new_loc)
diff --git a/code/datums/observation/moved.dm b/code/datums/observation/moved.dm
index 101dd5b756fa..340779227b99 100644
--- a/code/datums/observation/moved.dm
+++ b/code/datums/observation/moved.dm
@@ -33,12 +33,13 @@
/atom/Entered(var/atom/movable/am, var/atom/old_loc)
. = ..()
- RAISE_EVENT(/decl/observ/moved, am, old_loc, am.loc)
+ if(am.event_listeners?[/decl/observ/moved])
+ am.raise_event_non_global(/decl/observ/moved, old_loc, am.loc)
/atom/movable/Entered(var/atom/movable/am, atom/old_loc)
. = ..()
- var/decl/observ/moved/moved_event = GET_DECL(/decl/observ/moved)
- if(moved_event.has_listeners(am))
+ // We inline and simplify has_listeners here since we know this event can never have global registrations.
+ if(am.event_listeners?[/decl/observ/moved])
events_repository.register(/decl/observ/moved, src, am, TYPE_PROC_REF(/atom/movable, recursive_move))
/atom/movable/Exited(var/atom/movable/am, atom/new_loc)
diff --git a/code/datums/observation/name_set.dm b/code/datums/observation/name_set.dm
index b3d216e6686a..f0f75e0c684c 100644
--- a/code/datums/observation/name_set.dm
+++ b/code/datums/observation/name_set.dm
@@ -11,6 +11,7 @@
/decl/observ/name_set
name = "Name Set"
expected_type = /atom
+ flags = OBSERVATION_NO_GLOBAL_REGISTRATIONS
/*********************
* Name Set Handling *
@@ -23,5 +24,6 @@
if(has_extension(src, /datum/extension/labels))
var/datum/extension/labels/L = get_extension(src, /datum/extension/labels)
name = L.AppendLabelsToName(name)
- RAISE_EVENT(/decl/observ/name_set, src, old_name, new_name)
+ if(event_listeners?[/decl/observ/name_set])
+ raise_event_non_global(/decl/observ/name_set, old_name, new_name)
update_above()
\ No newline at end of file
diff --git a/code/datums/observation/observation.dm b/code/datums/observation/observation.dm
index 892e97ce7c93..ee87ba09d524 100644
--- a/code/datums/observation/observation.dm
+++ b/code/datums/observation/observation.dm
@@ -59,29 +59,30 @@
/decl/observ
var/name = "Unnamed Event" // The name of this event, used mainly for debug/VV purposes. The list of event managers can be reached through the "Debug Controller" verb, selecting the "Observation" entry.
var/expected_type = /datum // The expected event source for this event. register() will CRASH() if it receives an unexpected type.
- var/list/list/list/event_sources = list() // Associative list of event sources, each with their own associative list. This associative list contains an instance/list of procs to call when the event is raised.
var/list/global_listeners = list() // Associative list of instances that listen to all events of this type (as opposed to events belonging to a specific source) and the proc to call.
VAR_PROTECTED/flags // See _defines.dm for available flags and what they do
-/decl/observ/Initialize()
- . = ..()
- global.all_observable_events += src
+/datum
+ /// Associative list of observ type -> associative list of listeners -> an instance/list of procs to call on the listener when the event is raised.
+ var/list/list/list/event_listeners
+ /// Associative list of observ type -> datums we're listening to; contains no information about callbacks as that's already stored on their event_listeners list.
+ var/list/_listening_to
-/decl/observ/proc/is_listening(var/event_source, var/datum/listener, var/proc_call)
+/decl/observ/proc/is_listening(var/datum/event_source, var/datum/listener, var/proc_call)
// Return whether there are global listeners unless the event source is given.
if (!event_source)
return !!global_listeners.len
+ var/list/listeners = event_source.event_listeners?[type]
// Return whether anything is listening to a source, if no listener is given.
if (!listener)
- return global_listeners.len || !!event_sources[event_source]
+ return length(global_listeners) || !!listeners
// Return false if nothing is associated with that source.
- if (!event_sources[event_source])
+ if (!listeners)
return FALSE
- // Get and check the listeners for the reuqested event.
- var/listeners = event_sources[event_source]
+ // Get and check the listeners for the requested event.
if (!listeners[listener])
return FALSE
@@ -96,7 +97,7 @@
return (proc_call in callback)
-/decl/observ/proc/has_listeners(var/event_source)
+/decl/observ/proc/has_listeners(var/datum/event_source)
return is_listening(event_source)
/decl/observ/proc/register(var/datum/event_source, var/datum/listener, var/proc_call)
@@ -111,16 +112,16 @@
CRASH("Unexpected type. Expected [expected_type], was [event_source.type]")
// Setup the listeners for this source if needed.
- var/list/listeners = event_sources[event_source]
- if (!listeners)
- listeners = list()
- event_sources[event_source] = listeners
-
+ LAZYINITLIST(event_source.event_listeners)
+ LAZYINITLIST(event_source.event_listeners[type])
+ var/list/listeners = event_source.event_listeners[type]
// Make sure the callbacks are a list.
var/list/callbacks = listeners[listener]
if (!callbacks)
callbacks = list()
listeners[listener] = callbacks
+ LAZYINITLIST(listener._listening_to)
+ LAZYADD(listener._listening_to[type], event_source)
// If the proc_call is already registered skip
if(proc_call in callbacks)
@@ -130,25 +131,24 @@
callbacks += proc_call
return TRUE
-/decl/observ/proc/unregister(var/event_source, var/datum/listener, var/proc_call)
+/decl/observ/proc/unregister(var/datum/event_source, var/datum/listener, var/proc_call)
// Sanity.
- if (!event_source || !listener || !event_sources[event_source])
- return 0
-
- // Return zero if nothing is listening for this event.
- var/list/listeners = event_sources[event_source]
- if (!length(listeners))
- event_sources -= event_source
+ if (!event_source || !listener || !event_source.event_listeners?[type])
return 0
+ var/list/list/listeners = event_source.event_listeners[type]
// Remove all callbacks if no specific one is given.
if (!proc_call)
// Return the number of callbacks removed.
. = length(listeners[listener])
if(listeners.Remove(listener))
+ LAZYREMOVE(listener._listening_to?[type], event_source)
+ UNSETEMPTY(listener._listening_to)
// Perform some cleanup and return true.
- if (!listeners.len)
- event_sources -= event_source
+ if (!length(listeners)) // No one is listening to us on this source anymore.
+ LAZYREMOVE(event_source.event_listeners, type)
+ UNSETEMPTY(event_source.event_listeners?[type])
+ UNSETEMPTY(event_source.event_listeners)
return .
return 0
@@ -161,10 +161,13 @@
if(!callbacks.Remove(proc_call))
return 0
- if (!callbacks.len)
- listeners -= listener
- if (!listeners.len)
- event_sources -= event_source
+ if(!LAZYLEN(callbacks)) // the above Remove() took our last callback away, so remove our callbacks list for this listener
+ LAZYREMOVE(event_source.event_listeners[type], listener) // note that UNSETEMPTY would just give it a null value
+ LAZYREMOVE(listener._listening_to[type], event_source)
+ if(!LAZYLEN(listener._listening_to[type]))
+ LAZYREMOVE(listener._listening_to, type)
+ if(!LAZYLEN(event_source.event_listeners[type]))
+ LAZYREMOVE(event_source.event_listeners, type)
return 1
/decl/observ/proc/register_global(var/datum/listener, var/proc_call)
@@ -210,9 +213,27 @@
global_listeners -= listener
return 1
-/decl/observ/proc/raise_event()
+/// A variant of raise_event for extra-fast processing, for observs that are certain to never have any global registrations.
+/datum/proc/raise_event_non_global(event_type)
+ // Call the listeners for this specific event source, if they exist.
+ var/list/listeners = event_listeners?[event_type]
+ if(length(listeners))
+ args[1] = src // replace event_type with src for the call
+ for (var/listener in listeners)
+ var/list/callbacks = listeners[listener]
+ for (var/proc_call in callbacks)
+ // If the callback crashes, record the error and remove it.
+ try
+ call(listener, proc_call)(arglist(args))
+ catch (var/exception/e)
+ error(EXCEPTION_TEXT(e))
+ var/decl/observ/event = GET_DECL(event_type)
+ event.unregister(src, listener, proc_call)
+ return TRUE
+
+/decl/observ/proc/raise_event(datum/source)
// Sanity
- if(!length(args))
+ if(!source)
return FALSE
if(length(global_listeners))
@@ -229,8 +250,7 @@
unregister_global(listener, proc_call)
// Call the listeners for this specific event source, if they exist.
- var/source = args[1]
- var/list/listeners = event_sources[source]
+ var/list/listeners = source.event_listeners?[type]
if(length(listeners))
for (var/listener in listeners)
var/list/callbacks = listeners[listener]
diff --git a/code/datums/observation/updated_icon.dm b/code/datums/observation/updated_icon.dm
index 19e43b88cb50..021b8bca092e 100644
--- a/code/datums/observation/updated_icon.dm
+++ b/code/datums/observation/updated_icon.dm
@@ -11,3 +11,4 @@
/decl/observ/updated_icon
name = "Updated Icon"
expected_type = /atom
+ flags = OBSERVATION_NO_GLOBAL_REGISTRATIONS
\ No newline at end of file
diff --git a/code/datums/observation/~cleanup.dm b/code/datums/observation/~cleanup.dm
index 9685f39741a3..39c9dc8152c2 100644
--- a/code/datums/observation/~cleanup.dm
+++ b/code/datums/observation/~cleanup.dm
@@ -1,18 +1,20 @@
-var/global/list/global_listen_count = list()
-
+/// This variable is used only for sanity checks during unit tests. It contains a list of all datums with global event registrations.
+var/global/list/_all_global_event_listeners = list()
/datum
/// Tracks how many event registrations are listening to us. Used in cleanup to prevent dangling references.
var/event_source_count = 0
/// Tracks how many event registrations we are listening to. Used in cleanup to prevent dangling references.
var/event_listen_count = 0
+ /// Tracks how many global event registrations we are listening to. Used in cleanup to prevent dangling references.
+ var/global_listen_count = 0
/proc/cleanup_events(var/datum/source)
- if(global.global_listen_count && global.global_listen_count[source])
- cleanup_global_listener(source, global.global_listen_count[source])
+ if(source?.global_listen_count > 0)
+ cleanup_global_listener(source)
if(source?.event_source_count > 0)
- cleanup_source_listeners(source, source?.event_source_count)
+ cleanup_source_listeners(source)
if(source?.event_listen_count > 0)
- cleanup_event_listener(source, source?.event_listen_count)
+ cleanup_event_listener(source)
/decl/observ/register(var/datum/event_source, var/datum/listener, var/proc_call)
. = ..()
@@ -29,58 +31,55 @@ var/global/list/global_listen_count = list()
/decl/observ/register_global(var/datum/listener, var/proc_call)
. = ..()
if(.)
- global.global_listen_count[listener] += 1
+ listener.global_listen_count += 1
+// This variable is used only for sanity checks during unit tests.
+#ifdef UNIT_TEST
+ global._all_global_event_listeners += listener
+#endif
/decl/observ/unregister_global(var/datum/listener, var/proc_call)
. = ..()
if(.)
- global.global_listen_count[listener] -= .
- if(global.global_listen_count[listener] <= 0)
- global.global_listen_count -= listener
+ listener.global_listen_count -= .
+#ifdef UNIT_TEST
+ if(!listener.global_listen_count)
+ global._all_global_event_listeners -= listener
+#endif
-/proc/cleanup_global_listener(listener, listen_count)
- global.global_listen_count -= listener
- var/events_removed
- for(var/entry in global.all_observable_events)
- var/decl/observ/event = entry
- if((events_removed = event.unregister_global(listener)))
- log_debug("[event] ([event.type]) - [log_info_line(listener)] was deleted while still registered to global events.")
- listen_count -= events_removed
- if(!listen_count)
+/proc/cleanup_global_listener(datum/listener)
+ for(var/decl/observ/event as anything in decls_repository.get_decls_of_subtype_unassociated(/decl/observ))
+ if(event.unregister_global(listener))
+ log_debug("[event] ([event.type]) - [log_info_line(listener)] was deleted while still globally registered to an event.")
+ if(!listener.global_listen_count)
return
- if(listen_count > 0)
+ if(listener.global_listen_count > 0)
CRASH("Failed to clean up all global listener entries!")
-/proc/cleanup_source_listeners(datum/event_source, source_listener_count)
- event_source.event_source_count = 0
- var/events_removed
- for(var/entry in global.all_observable_events)
- var/decl/observ/event = entry
- var/list/list/proc_owners = event.event_sources[event_source]
+// This might actually be fast enough now that there's no point in logging it?
+/proc/cleanup_source_listeners(datum/event_source)
+ for(var/event_type in event_source.event_listeners)
+ var/list/list/proc_owners = event_source.event_listeners[event_type]
if(proc_owners)
+ var/decl/observ/event = GET_DECL(event_type)
for(var/proc_owner in proc_owners)
var/list/callbacks_cached = proc_owners[proc_owner]?.Copy()
- if((events_removed = event.unregister(event_source, proc_owner)))
+ if(event.unregister(event_source, proc_owner))
log_debug("[event] ([event.type]) - [log_info_line(event_source)] was deleted while still being listened to by [log_info_line(proc_owner)]. Callbacks: [json_encode(callbacks_cached)]")
- source_listener_count -= events_removed
- if(!source_listener_count)
+ if(!event_source.event_source_count)
return
- if(source_listener_count > 0)
+ if(event_source.event_source_count > 0)
CRASH("Failed to clean up all event source entries!")
-/proc/cleanup_event_listener(datum/listener, listener_count)
- listener.event_listen_count = 0
- var/events_removed
- for(var/entry in global.all_observable_events)
- var/decl/observ/event = entry
- for(var/event_source in event.event_sources)
- if(isnull(event.event_sources[event_source]))
- log_debug("[event] ([event.type]) - [log_info_line(event_source)] had null listeners list!")
- var/list/callbacks_cached = event.event_sources[event_source]?[listener]?.Copy()
- if((events_removed = event.unregister(event_source, listener)))
- log_debug("[event] ([event.type]) - [log_info_line(listener)] was deleted while still listening to [log_info_line(event_source)]. Callbacks: [json_encode(callbacks_cached)]")
- listener_count -= events_removed
- if(!listener_count)
- return
- if(listener_count > 0)
+/proc/cleanup_event_listener(datum/listener)
+ for(var/event_type in listener._listening_to)
+ var/list/listened_sources = listener._listening_to[event_type]
+ if(listened_sources)
+ for(var/datum/event_source in listened_sources)
+ var/list/callbacks_cached = event_source.event_listeners[event_type]?[listener]?.Copy()
+ var/decl/observ/event = GET_DECL(event_type)
+ if(event.unregister(event_source, listener))
+ log_debug("[event] ([event.type]) - [log_info_line(listener)] was deleted while still listening to [log_info_line(event_source)]. Callbacks: [json_encode(callbacks_cached)]")
+ if(!listener.event_listen_count)
+ return
+ if(listener.event_listen_count > 0)
CRASH("Failed to clean up all listener entries!")
diff --git a/code/datums/outfits/equipment/backpacks.dm b/code/datums/outfits/equipment/backpacks.dm
index 2a4aed715eab..8e6c68468285 100644
--- a/code/datums/outfits/equipment/backpacks.dm
+++ b/code/datums/outfits/equipment/backpacks.dm
@@ -190,9 +190,9 @@
/proc/get_default_outfit_backpack()
var backpacks = global.using_map.get_available_backpacks()
for(var/backpack in backpacks)
- var/decl/backpack_outfit/bo = backpacks[backpack]
- if(bo.is_default)
- return bo
+ var/decl/backpack_outfit/backpack_option = backpacks[backpack]
+ if(backpack_option.is_default)
+ return backpack_option
#undef BACKPACK_HAS_TYPE_SELECTION
#undef BACKPACK_HAS_SUBTYPE_SELECTION
diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm
index c3728f48a2a5..fa1c3f9627b9 100644
--- a/code/datums/outfits/outfit.dm
+++ b/code/datums/outfits/outfit.dm
@@ -205,17 +205,17 @@
wearer.put_in_hands(new hand(wearer))
if((outfit_flags & OUTFIT_HAS_BACKPACK) && !(OUTFIT_ADJUSTMENT_SKIP_BACKPACK & equip_adjustments))
- var/decl/backpack_outfit/bo
+ var/decl/backpack_outfit/backpack_option
var/metadata
if(wearer.backpack_setup)
- bo = wearer.backpack_setup.backpack
+ backpack_option = wearer.backpack_setup.backpack
metadata = wearer.backpack_setup.metadata
else
- bo = get_default_outfit_backpack()
+ backpack_option = get_default_outfit_backpack()
- var/override_type = backpack_overrides[bo.type]
- var/backpack = bo.spawn_backpack(wearer, metadata, override_type)
+ var/override_type = backpack_overrides[backpack_option.type]
+ var/backpack = backpack_option.spawn_backpack(wearer, metadata, override_type)
if(backpack)
if(back)
@@ -241,22 +241,22 @@
return
if(OUTFIT_ADJUSTMENT_SKIP_ID_PDA & equip_adjustments)
return
- var/obj/item/card/id/W = new id_type(wearer)
+ var/obj/item/card/id/id_card = new id_type(wearer)
if(id_desc)
- W.desc = id_desc
+ id_card.desc = id_desc
if(assignment)
- W.assignment = assignment
+ id_card.assignment = assignment
if(job)
- W.position = job.title
- LAZYDISTINCTADD(W.access, job.get_access())
- if(!W.detail_color)
- W.detail_color = job.selection_color
- W.update_icon()
+ id_card.position = job.title
+ LAZYDISTINCTADD(id_card.access, job.get_access())
+ if(!id_card.detail_color)
+ id_card.detail_color = job.selection_color
+ id_card.update_icon()
wearer.update_icon()
- wearer.set_id_info(W)
+ wearer.set_id_info(id_card)
equip_pda(wearer, id_pda_assignment || assignment, equip_adjustments)
- if(wearer.equip_to_slot_or_store_or_drop(W, id_slot))
- return W
+ if(wearer.equip_to_slot_or_store_or_drop(id_card, id_slot))
+ return id_card
/decl/outfit/proc/equip_pda(var/mob/living/wearer, var/label_assignment, var/equip_adjustments)
if(!pda_slot || !pda_type)
diff --git a/code/datums/outfits/tournament.dm b/code/datums/outfits/tournament.dm
index 37560506ddd5..19ce1a32b9be 100644
--- a/code/datums/outfits/tournament.dm
+++ b/code/datums/outfits/tournament.dm
@@ -36,7 +36,7 @@
suit = /obj/item/clothing/suit/chef
hands = list(
/obj/item/knife/combat,
- /obj/item/kitchen/rollingpin
+ /obj/item/rollingpin
)
l_pocket = /obj/item/knife/combat
r_pocket = /obj/item/knife/combat
diff --git a/code/datums/repositories/atom_info.dm b/code/datums/repositories/atom_info.dm
index 4bfb7a4b8233..9e842cf2feb0 100644
--- a/code/datums/repositories/atom_info.dm
+++ b/code/datums/repositories/atom_info.dm
@@ -5,14 +5,15 @@ var/global/repository/atom_info/atom_info_repository = new()
var/list/combined_worth_cache = list()
var/list/single_worth_cache = list()
var/list/name_cache = list()
+ var/list/description_cache = list()
var/list/matter_mult_cache = list()
var/list/origin_tech_cache = list()
/repository/atom_info/proc/create_key_for(var/path, var/material, var/amount)
. = "[path]"
- if(material)
+ if(ispath(path, /obj) && material) // only objects take material as an arg
. = "[.]-[material]"
- if(!isnull(amount))
+ if(ispath(path, /obj/item/stack) && !isnull(amount)) // similarly for stacks and amount
. = "[.]-[amount]"
/repository/atom_info/proc/get_instance_of(var/path, var/material, var/amount)
@@ -37,6 +38,9 @@ var/global/repository/atom_info/atom_info_repository = new()
if(!name_cache[key])
instance = instance || get_instance_of(path, material, amount)
name_cache[key] = instance.name
+ if(!description_cache[key])
+ instance = instance || get_instance_of(path, material, amount)
+ description_cache[key] = instance.desc
if(!matter_mult_cache[key] && ispath(path, /obj))
var/obj/obj_instance = instance || get_instance_of(path, material, amount)
matter_mult_cache[key] = obj_instance.get_matter_amount_modifier()
@@ -67,6 +71,11 @@ var/global/repository/atom_info/atom_info_repository = new()
update_cached_info_for(path, material, amount, key)
. = name_cache[key]
+/repository/atom_info/proc/get_description_for(var/path, var/material, var/amount)
+ var/key = create_key_for(path, material, amount)
+ update_cached_info_for(path, material, amount, key)
+ . = description_cache[key]
+
/repository/atom_info/proc/get_matter_multiplier_for(var/path, var/material, var/amount)
var/key = create_key_for(path, material, amount)
update_cached_info_for(path, material, amount, key)
diff --git a/code/datums/repositories/crew/crew.dm b/code/datums/repositories/crew/crew.dm
index 35bd0ecfb515..4a0e5b2c53a7 100644
--- a/code/datums/repositories/crew/crew.dm
+++ b/code/datums/repositories/crew/crew.dm
@@ -98,7 +98,7 @@ var/global/datum/repository/crew/crew_repository = new()
var/current_priority = INFINITY
var/list/modifiers_of_this_priority = list()
- for(var/crew_sensor_modifier/csm in modifiers.L)
+ for(var/crew_sensor_modifier/csm in modifiers.GetQueue())
if(csm.priority < current_priority)
. = check_queue(modifiers_of_this_priority, H, S, pos, crew_data)
if(. != MOD_SUIT_SENSORS_NONE)
@@ -123,7 +123,7 @@ var/global/datum/repository/crew/crew_repository = new()
var/datum/priority_queue/pq = modifier_queues_by_type[base_type]
if(!pq)
CRASH("The given base type was not a valid base type.")
- if(csm in pq.L)
+ if(csm in pq.GetQueue())
CRASH("This crew sensor modifier has already been supplied.")
pq.Enqueue(csm)
return TRUE
diff --git a/code/datums/repositories/decls.dm b/code/datums/repositories/decls.dm
index 73a9f14fb610..28dea46d5cd1 100644
--- a/code/datums/repositories/decls.dm
+++ b/code/datums/repositories/decls.dm
@@ -144,6 +144,20 @@ var/global/repository/decls/decls_repository = new
. = get_decls(subtypesof(decl_prototype))
fetched_decl_subtypes[decl_prototype] = .
+/// Gets the path of any concrete (non-abstract) decl of the provided type.
+/// If decl_prototype is not abstract it will return that type.
+/// Otherwise, it returns the first (in compile order) non-abstract child of this type,
+/// or null otherwise.
+/// This doesn't respect DECL_FLAG_ALLOW_ABSTRACT_INIT, but that flag should probably be deprecated someday
+/// and replaced with a better solution to avoid instantiating abstract decls.
+/// This is mostly used for recipe validation in unit tests and such.
+/repository/decls/proc/get_first_concrete_decl_path_of_type(decl_prototype)
+ RETURN_TYPE(/decl)
+ . = fetched_decl_paths_by_type[decl_prototype]
+ if(!.)
+ . = get_decl_paths_of_type(decl_prototype)
+ return LAZYACCESS(., 1) // gets the first key (type) if it exists, else null if index is out of range
+
/decl
abstract_type = /decl
var/uid
diff --git a/code/datums/repositories/follow.dm b/code/datums/repositories/follow.dm
index fb12909997cb..14787fb97b63 100644
--- a/code/datums/repositories/follow.dm
+++ b/code/datums/repositories/follow.dm
@@ -158,11 +158,11 @@ var/global/repository/follow/follow_repository = new()
followed_type = /mob/living/silicon/robot
/datum/follow_holder/robot/show_entry()
- var/mob/living/silicon/robot/R = followed_instance
- return ..() && R.braintype
+ var/mob/living/silicon/robot/robot = followed_instance
+ return ..() && robot.braintype
-/datum/follow_holder/robot/get_suffix(var/mob/living/silicon/robot/R)
- suffix = "\[[R.braintype]\][R.module ? " \[[R.module.name]\]" : ""]"
+/datum/follow_holder/robot/get_suffix(var/mob/living/silicon/robot/robot)
+ suffix = "\[[robot.braintype]\][robot.module ? " \[[robot.module.name]\]" : ""]"
return ..()
/datum/follow_holder/human
@@ -211,11 +211,6 @@ var/global/repository/follow/follow_repository = new()
followed_type = /mob/living // List all other (living) mobs we haven't given a special suffix
suffix = "Mob"
-/datum/follow_holder/blob
- sort_order = 9
- followed_type = /obj/effect/blob/core
- suffix = "Blob"
-
/datum/follow_holder/singularity
sort_order = 10
followed_type = /obj/effect/singularity
diff --git a/code/datums/storage/_storage.dm b/code/datums/storage/_storage.dm
index 07d0d0871521..cead225909e9 100644
--- a/code/datums/storage/_storage.dm
+++ b/code/datums/storage/_storage.dm
@@ -90,11 +90,6 @@ var/global/list/_test_storage_items = list()
play_open_sound()
holder?.queue_icon_update()
play_use_sound()
- if (isrobot(user) && user.hud_used)
- var/mob/living/silicon/robot/robot = user
- if(robot.shown_robot_modules) //The robot's inventory is open, need to close it first.
- robot.hud_used.toggle_show_robot_modules()
-
prepare_ui()
if(storage_ui)
storage_ui.on_open(user)
@@ -121,13 +116,13 @@ var/global/list/_test_storage_items = list()
//This proc return 1 if the item can be picked up and 0 if it can't.
//Set the stop_messages to stop it from printing messages
-/datum/storage/proc/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
- if(!istype(W)) return //Not an item
+/datum/storage/proc/can_be_inserted(obj/item/inserting, mob/user, stop_messages = 0, click_params = null)
+ if(!istype(inserting)) return //Not an item
- if(user && !user.canUnEquip(W))
+ if(user && !user.can_unequip_item(inserting))
return 0
- if(!holder || holder.loc == W)
+ if(!holder || holder.loc == inserting)
return 0 //Means the item is already in the storage item
if(storage_slots != null && length(get_contents()) >= storage_slots)
@@ -135,51 +130,51 @@ var/global/list/_test_storage_items = list()
to_chat(user, SPAN_WARNING("\The [holder] is full, make some space."))
return 0 //Storage item is full
- if(W.anchored)
+ if(inserting.anchored)
return 0
if(can_hold.len)
- if(!is_type_in_list(W, can_hold))
- if(!stop_messages && ! istype(W, /obj/item/hand_labeler))
- to_chat(user, SPAN_WARNING("\The [holder] cannot hold \the [W]."))
+ if(!is_type_in_list(inserting, can_hold))
+ if(!stop_messages && ! istype(inserting, /obj/item/hand_labeler))
+ to_chat(user, SPAN_WARNING("\The [holder] cannot hold \the [inserting]."))
return 0
- var/max_instances = can_hold[W.type]
- if(max_instances && instances_of_type_in_list(W, get_contents()) >= max_instances)
- if(!stop_messages && !istype(W, /obj/item/hand_labeler))
- to_chat(user, SPAN_WARNING("\The [holder] has no more space specifically for \the [W]."))
+ var/max_instances = can_hold[inserting.type]
+ if(max_instances && instances_of_type_in_list(inserting, get_contents()) >= max_instances)
+ if(!stop_messages && !istype(inserting, /obj/item/hand_labeler))
+ to_chat(user, SPAN_WARNING("\The [holder] has no more space specifically for \the [inserting]."))
return 0
//If attempting to lable the storage item, silently fail to allow it
- if(istype(W, /obj/item/hand_labeler) && !user?.check_intent(I_FLAG_HELP))
+ if(istype(inserting, /obj/item/hand_labeler) && !user?.check_intent(I_FLAG_HELP))
return FALSE
//Prevent package wrapper from being inserted by default
- if(istype(W, /obj/item/stack/package_wrap) && !user?.check_intent(I_FLAG_HELP))
+ if(istype(inserting, /obj/item/stack/package_wrap) && !user?.check_intent(I_FLAG_HELP))
return FALSE
// Don't allow insertion of unsafed compressed matter implants
// Since they are sucking something up now, their afterattack will delete the storage
- if(istype(W, /obj/item/implanter/compressed))
- var/obj/item/implanter/compressed/impr = W
+ if(istype(inserting, /obj/item/implanter/compressed))
+ var/obj/item/implanter/compressed/impr = inserting
if(!impr.safe)
stop_messages = 1
return 0
- if(cant_hold.len && is_type_in_list(W, cant_hold))
+ if(cant_hold.len && is_type_in_list(inserting, cant_hold))
if(!stop_messages)
- to_chat(user, SPAN_WARNING("\The [holder] cannot hold \the [W]."))
+ to_chat(user, SPAN_WARNING("\The [holder] cannot hold \the [inserting]."))
return 0
- if (max_w_class != null && W.w_class > max_w_class)
+ if (max_w_class != null && inserting.w_class > max_w_class)
if(!stop_messages)
- to_chat(user, SPAN_WARNING("\The [W] is too big for \the [holder]."))
+ to_chat(user, SPAN_WARNING("\The [inserting] is too big for \the [holder]."))
return 0
- if(W.obj_flags & OBJ_FLAG_NO_STORAGE)
+ if(inserting.obj_flags & OBJ_FLAG_NO_STORAGE)
if(!stop_messages)
- to_chat(user, SPAN_WARNING("\The [W] cannot be placed in \the [holder]."))
+ to_chat(user, SPAN_WARNING("\The [inserting] cannot be placed in \the [holder]."))
return 0
- var/total_storage_space = W.get_storage_cost() + storage_space_used() //Adds up the combined w_classes which will be in the storage item if the item is added to it.
+ var/total_storage_space = inserting.get_storage_cost() + storage_space_used() //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(total_storage_space > max_storage_space)
if(!stop_messages)
to_chat(user, SPAN_WARNING("\The [holder] is too full, make some space."))
@@ -190,35 +185,35 @@ var/global/list/_test_storage_items = list()
//This proc handles items being inserted. It does not perform any checks of whether an item can or can't be inserted. That's done by can_be_inserted()
//The stop_warning parameter will stop the insertion message from being displayed. It is intended for cases where you are inserting multiple items at once,
//such as when picking up all the items on a tile with one click.
-/datum/storage/proc/handle_item_insertion(mob/user, obj/item/W, prevent_warning, skip_update, click_params)
- if(!istype(W))
+/datum/storage/proc/handle_item_insertion(mob/user, obj/item/inserting, prevent_warning, skip_update, click_params)
+ if(!istype(inserting))
return FALSE
- if(ismob(W.loc))
- var/mob/M = W.loc
- if(!M.try_unequip(W))
+ if(ismob(inserting.loc))
+ var/mob/M = inserting.loc
+ if(!M.try_unequip(inserting))
return FALSE
if(holder.reagents?.total_volume)
- W.fluid_act(holder.reagents)
- if(QDELETED(W))
+ inserting.fluid_act(holder.reagents)
+ if(QDELETED(inserting))
return FALSE
- W.forceMove(holder)
- W.on_enter_storage(src)
+ inserting.forceMove(holder)
+ inserting.on_enter_storage(src)
if(user)
holder.add_fingerprint(user)
if(!prevent_warning)
for(var/mob/M in viewers(user, null))
if (M == user)
- to_chat(user, SPAN_NOTICE("You put \the [W] into [holder]."))
+ to_chat(user, SPAN_NOTICE("You put \the [inserting] into [holder]."))
else if (get_dist(holder, M) <= 1) //If someone is standing close enough, they can tell what it is...
- M.show_message(SPAN_NOTICE("\The [user] puts [W] into [holder]."), VISIBLE_MESSAGE)
- else if (W && W.w_class >= ITEM_SIZE_NORMAL) //Otherwise they can only see large or normal items from a distance...
- M.show_message(SPAN_NOTICE("\The [user] puts [W] into [holder]."), VISIBLE_MESSAGE)
+ M.show_message(SPAN_NOTICE("\The [user] puts [inserting] into [holder]."), VISIBLE_MESSAGE)
+ else if (inserting && inserting.w_class >= ITEM_SIZE_NORMAL) //Otherwise they can only see large or normal items from a distance...
+ M.show_message(SPAN_NOTICE("\The [user] puts [inserting] into [holder]."), VISIBLE_MESSAGE)
// Run this regardless of update flag, as it impacts our remaining storage space.
consolidate_stacks()
if(!skip_update)
- update_ui_after_item_insertion(W, click_params)
+ update_ui_after_item_insertion(inserting, click_params)
holder.storage_inserted()
if(!skip_update)
holder.update_icon()
@@ -249,43 +244,42 @@ var/global/list/_test_storage_items = list()
/datum/storage/proc/update_ui_after_item_insertion(obj/item/inserted, click_params)
prepare_ui()
- storage_ui?.on_insertion()
+ storage_ui?.on_insertion(inserted)
/datum/storage/proc/update_ui_after_item_removal(obj/item/removed)
if(QDELETED(holder))
return
prepare_ui()
- storage_ui?.on_post_remove()
+ storage_ui?.on_post_remove(removed)
//Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target
-/datum/storage/proc/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
- if(!istype(W))
+/datum/storage/proc/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
+ if(!istype(removing))
return FALSE
new_location = new_location || get_turf(holder)
- storage_ui?.on_pre_remove(W)
- if(ismob(holder?.loc))
- W.dropped(user)
- if(ismob(new_location))
- W.hud_layerise()
- else
- W.reset_plane_and_layer()
- W.forceMove(new_location)
+ storage_ui?.on_pre_remove(removing)
+ // This doesn't call dropped anymore because it's not leaving a mob slot directly.
+ // If something needs to duplicate dropped() functionality on removal from a storage object,
+ // it should be done in on_exit_storage instead.
+ removing.forceMove(new_location)
+ if(!ismob(new_location)) // inventory slot equipped() already handles hud_layerise
+ removing.reset_plane_and_layer() // this should be done post-move to avoid wasting an icon update
if(!skip_update)
- update_ui_after_item_removal(W)
- if(W.maptext)
- W.maptext = ""
- W.on_exit_storage(src)
+ update_ui_after_item_removal(removing)
+ if(removing.maptext)
+ removing.maptext = ""
+ removing.on_exit_storage(src)
if(!skip_update && holder)
holder.update_icon()
return TRUE
// Only do ui functions for now; the obj is responsible for anything else.
-/datum/storage/proc/on_item_pre_deletion(obj/item/W)
- storage_ui?.on_pre_remove(W) // Supposed to be able to handle null user.
+/datum/storage/proc/on_item_pre_deletion(obj/item/deleting)
+ storage_ui?.on_pre_remove(deleting) // Supposed to be able to handle null user.
// Only do ui functions for now; the obj is responsible for anything else.
-/datum/storage/proc/on_item_post_deletion(obj/item/W)
- update_ui_after_item_removal(W)
+/datum/storage/proc/on_item_post_deletion(obj/item/deleting)
+ update_ui_after_item_removal(deleting)
holder?.queue_icon_update()
//Run once after using remove_from_storage with skip_update = 1
diff --git a/code/datums/storage/_storage_ui.dm b/code/datums/storage/_storage_ui.dm
index a3e1f23bfcb5..27807cb9e239 100644
--- a/code/datums/storage/_storage_ui.dm
+++ b/code/datums/storage/_storage_ui.dm
@@ -32,18 +32,21 @@
/datum/storage_ui/proc/after_close(mob/user)
return
-/datum/storage_ui/proc/on_insertion()
+/datum/storage_ui/proc/on_insertion(obj/item/inserted)
return
-/datum/storage_ui/proc/on_pre_remove(obj/item/W)
+/datum/storage_ui/proc/on_pre_remove(obj/item/removing)
return
-/datum/storage_ui/proc/on_post_remove(obj/item/W)
+/datum/storage_ui/proc/on_post_remove(obj/item/removing)
return
/datum/storage_ui/proc/on_hand_attack(mob/user)
return
+/datum/storage_ui/proc/get_displayed_contents()
+ return
+
// Default subtype
/datum/storage_ui/default
var/obj/screen/storage/boxes/boxes
@@ -93,26 +96,35 @@
/datum/storage_ui/default/on_insertion()
refresh_viewers()
-/datum/storage_ui/default/on_post_remove(obj/item/W)
+/datum/storage_ui/default/on_post_remove(obj/item/removing)
refresh_viewers()
-/datum/storage_ui/default/on_pre_remove(obj/item/W)
+/datum/storage_ui/default/on_pre_remove(obj/item/removing)
for(var/mob/user in is_seeing)
- user.client?.screen -= W
+ user.client?.screen -= removing
+ // if being moved to an inventory slot or other storage item, this will be re-set after the transfer is done
+ removing.screen_loc = null
/datum/storage_ui/default/on_hand_attack(mob/user)
for(var/mob/other_user in is_seeing)
if (other_user.active_storage == _storage)
_storage.close(other_user)
+/datum/storage_ui/default/get_displayed_contents()
+ return _storage?.get_contents()
+
/datum/storage_ui/default/show_to(mob/user)
if(!istype(user))
return
+ // TODO: move this to the interaction that opens the storage object rather than handling it on the UI
+ // because i really hate calling get_contents followed by get_displayed_contents
+ // the issue is that some things call atom.storage.show_to() directly rather than using open()
var/list/contents = _storage?.get_contents()
if(user.active_storage != _storage)
for(var/obj/item/I in contents)
if(I.on_found(user))
return
+ var/list/displayed_contents = get_displayed_contents()
if(user.active_storage)
user.active_storage.hide_from(user)
if(user.client)
@@ -123,8 +135,8 @@
user.client.screen -= closer
user.client.screen -= contents
user.client.screen += closer
- if(length(contents))
- user.client.screen += contents
+ if(length(displayed_contents))
+ user.client.screen += displayed_contents
if(_storage.storage_slots)
user.client.screen += boxes
else
@@ -306,6 +318,17 @@
row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width.
arrange_item_slots(row_num, clamp(adjusted_contents - 1, 0, 6))
+// Only display one item for each key.
+/datum/storage_ui/default/produce_bin/get_displayed_contents()
+ . = list()
+ var/list/displayed = list()
+ for(var/obj/item/food/grown/produce in _storage.get_contents())
+ var/produce_key = get_key_for_object(produce)
+ if(displayed[produce_key])
+ continue
+ displayed[produce_key] = TRUE
+ . += produce
+
//This proc draws out the inventory and places the items on it. It uses the standard position.
/datum/storage_ui/default/produce_bin/arrange_item_slots(rows, cols)
var/cx = SCREEN_LOC_MOD_FIRST
@@ -313,12 +336,9 @@
boxes.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED] to LEFT+[SCREEN_LOC_MOD_FIRST + cols]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[SCREEN_LOC_MOD_SECOND + rows]:[SCREEN_LOC_MOD_DIVIDED]"
var/list/counts = get_seed_counts()
- var/list/displayed = list()
- for(var/obj/item/food/grown/produce in _storage.get_contents())
+ // get_displayed_contents already handles deduplication
+ for(var/obj/item/food/grown/produce in get_displayed_contents())
var/produce_key = get_key_for_object(produce)
- if(displayed[produce_key])
- continue
- displayed[produce_key] = TRUE
produce.screen_loc = "LEFT+[cx]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[cy]:[SCREEN_LOC_MOD_DIVIDED]"
produce.maptext_x = 2
produce.maptext_y = 2
diff --git a/code/datums/storage/subtypes_backpack.dm b/code/datums/storage/subtypes_backpack.dm
index 360c835727d1..30c6027aa028 100644
--- a/code/datums/storage/subtypes_backpack.dm
+++ b/code/datums/storage/subtypes_backpack.dm
@@ -6,10 +6,8 @@
/datum/storage/backpack/holding
max_storage_space = 56
-/datum/storage/backpack/holding/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params)
- if(istype(W, /obj/item/backpack/holding))
- return 1
- return ..()
+/datum/storage/backpack/holding/can_be_inserted(obj/item/inserting, mob/user, stop_messages = 0, click_params)
+ return istype(inserting, /obj/item/backpack/holding) || ..()
/datum/storage/backpack/santa
max_w_class = ITEM_SIZE_NORMAL
diff --git a/code/datums/storage/subtypes_bag.dm b/code/datums/storage/subtypes_bag.dm
index 07cdaf12cd2d..401ea28d1dad 100644
--- a/code/datums/storage/subtypes_bag.dm
+++ b/code/datums/storage/subtypes_bag.dm
@@ -3,19 +3,19 @@
allow_quick_empty = 1
use_to_pickup = 1
-/datum/storage/bag/handle_item_insertion(mob/user, obj/item/W, prevent_warning, skip_update, click_params)
+/datum/storage/bag/handle_item_insertion(mob/user, obj/item/inserting, prevent_warning, skip_update, click_params)
. = ..()
if(. && istype(holder, /obj/item/bag))
var/obj/item/bag/bag = holder
bag.update_w_class()
-/datum/storage/bag/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/bag/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
. = ..()
if(. && istype(holder, /obj/item/bag))
var/obj/item/bag/bag = holder
bag.update_w_class()
-/datum/storage/bag/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
+/datum/storage/bag/can_be_inserted(obj/item/inserting, mob/user, stop_messages = 0, click_params = null)
var/mob/living/human/H = ishuman(user) ? user : null // if we're human, then we need to check if bag in a pocket
if(holder.loc?.storage || H?.is_in_pocket(holder))
if(!stop_messages)
@@ -41,9 +41,9 @@
max_w_class = ITEM_SIZE_HUGE
can_hold = list(/obj/item/coin, /obj/item/cash)
-/datum/storage/bag/cash/infinite/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/bag/cash/infinite/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
. = ..()
- if(. && istype(W,/obj/item/cash)) //only matters if its spacecash.
+ if(. && istype(removing, /obj/item/cash)) //only matters if its spacecash.
handle_item_insertion(null, new /obj/item/cash/c1000, TRUE)
/datum/storage/bag/quantum
diff --git a/code/datums/storage/subtypes_box.dm b/code/datums/storage/subtypes_box.dm
index dd94c30e1f32..479c9460eb88 100644
--- a/code/datums/storage/subtypes_box.dm
+++ b/code/datums/storage/subtypes_box.dm
@@ -47,23 +47,23 @@
max_w_class = ITEM_SIZE_TINY
storage_slots = 7
-/datum/storage/box/cigar/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
- if(istype(W, /obj/item/clothing/mask/smokable/cigarette/cigar) && isatom(holder))
+/datum/storage/box/cigar/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
+ if(istype(removing, /obj/item/clothing/mask/smokable/cigarette/cigar) && isatom(holder))
var/atom/atom_holder = holder
if(atom_holder.reagents)
- atom_holder.reagents.trans_to_obj(W, (atom_holder.reagents.total_volume/max(1, length(get_contents()))))
+ atom_holder.reagents.trans_to_obj(removing, (atom_holder.reagents.total_volume/max(1, length(get_contents()))))
return ..()
/datum/storage/box/cigarettes
max_w_class = ITEM_SIZE_TINY
max_storage_space = 6
-/datum/storage/box/cigarettes/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/box/cigarettes/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
// Don't try to transfer reagents to lighters
- if(istype(W, /obj/item/clothing/mask/smokable/cigarette) && isatom(holder))
+ if(istype(removing, /obj/item/clothing/mask/smokable/cigarette) && isatom(holder))
var/atom/atom_holder = holder
if(atom_holder.reagents)
- atom_holder.reagents.trans_to_obj(W, (atom_holder.reagents.total_volume/max(1, length(get_contents()))))
+ atom_holder.reagents.trans_to_obj(removing, (atom_holder.reagents.total_volume/max(1, length(get_contents()))))
return ..()
/datum/storage/box/cigarettes/cigarello
diff --git a/code/datums/storage/subtypes_excavation.dm b/code/datums/storage/subtypes_excavation.dm
index dacbdf2d2440..ec23be327fae 100644
--- a/code/datums/storage/subtypes_excavation.dm
+++ b/code/datums/storage/subtypes_excavation.dm
@@ -5,7 +5,7 @@
max_w_class = ITEM_SIZE_NORMAL
use_to_pickup = 1
-/datum/storage/excavation/handle_item_insertion(mob/user, obj/item/W, prevent_warning, skip_update, click_params)
+/datum/storage/excavation/handle_item_insertion(mob/user, obj/item/inserting, prevent_warning, skip_update, click_params)
. = ..()
var/obj/item/excavation/picks = holder
if(istype(picks))
diff --git a/code/datums/storage/subtypes_misc.dm b/code/datums/storage/subtypes_misc.dm
index fec9cd65cdf9..5f51b0ffc9de 100644
--- a/code/datums/storage/subtypes_misc.dm
+++ b/code/datums/storage/subtypes_misc.dm
@@ -106,16 +106,16 @@
can_hold = list(/obj/item)
expected_type = /obj/structure/reagent_dispensers/compost_bin
-/datum/storage/hopper/industrial/compost/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
+/datum/storage/hopper/industrial/compost/can_be_inserted(obj/item/inserting, mob/user, stop_messages = 0, click_params = null)
. = ..()
if(!.)
return
- if(istype(W, /obj/item/food/worm) && istype(holder, /obj/structure/reagent_dispensers/compost_bin))
+ if(istype(inserting, /obj/item/food/worm) && istype(holder, /obj/structure/reagent_dispensers/compost_bin))
var/worms = 0
for(var/obj/item/food/worm/worm in get_contents())
worms++
return worms < COMPOST_MAX_WORMS
- return W.is_compostable()
+ return inserting.is_compostable()
/datum/storage/hopper/mortar
max_w_class = ITEM_SIZE_NORMAL * 2
diff --git a/code/datums/storage/subtypes_pills.dm b/code/datums/storage/subtypes_pills.dm
index ca8287f168c6..29d2ba18f8f2 100644
--- a/code/datums/storage/subtypes_pills.dm
+++ b/code/datums/storage/subtypes_pills.dm
@@ -10,20 +10,20 @@
use_to_pickup = 1
use_sound = 'sound/effects/storage/pillbottle.ogg'
-/datum/storage/pillbottle/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/pillbottle/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
. = ..()
if(. && istype(holder, /obj/item/pill_bottle/foil_pack))
var/obj/item/pill_bottle/foil_pack/pop = holder
if(pop.pop_sound)
playsound(get_turf(pop), pop.pop_sound, 50)
-/datum/storage/pillbottle/foil/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
+/datum/storage/pillbottle/foil/can_be_inserted(obj/item/inserting, mob/user, stop_messages = 0, click_params = null)
return FALSE
-/datum/storage/pillbottle/foil/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/pillbottle/foil/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
. = ..()
- if(. && W.loc != holder && istype(W, /obj/item/pill_bottle/foil_pack))
+ if(. && removing.loc != holder && istype(removing, /obj/item/pill_bottle/foil_pack))
var/obj/item/pill_bottle/foil_pack/pop = holder
if(pop.pill_positions)
- pop.pill_positions -= W
+ pop.pill_positions -= removing
pop.update_icon()
diff --git a/code/datums/storage/subtypes_secure.dm b/code/datums/storage/subtypes_secure.dm
index bf501d186be7..8427c0d7579d 100644
--- a/code/datums/storage/subtypes_secure.dm
+++ b/code/datums/storage/subtypes_secure.dm
@@ -16,7 +16,7 @@
. = ..()
//Must be overriden to prevent gathering from tile and using on items when locked!
-/datum/storage/secure/can_be_inserted(obj/item/W, mob/user, stop_messages, click_params = null)
+/datum/storage/secure/can_be_inserted(inserting, mob/user, stop_messages, click_params = null)
if(is_locked())
if(!stop_messages)
to_chat(user, SPAN_WARNING("\The [holder] is locked, you cannot put anything inside."))
diff --git a/code/datums/storage/subtypes_sheets.dm b/code/datums/storage/subtypes_sheets.dm
index 578282c8d4b9..7bc7504efca3 100644
--- a/code/datums/storage/subtypes_sheets.dm
+++ b/code/datums/storage/subtypes_sheets.dm
@@ -9,10 +9,10 @@
/datum/storage/sheets/robot
capacity = 500 //Borgs get more because >specialization
-/datum/storage/sheets/can_be_inserted(obj/item/W, mob/user, stop_messages = 0, click_params = null)
- if(!istype(W,/obj/item/stack/material))
+/datum/storage/sheets/can_be_inserted(obj/item/inserting, mob/user, stop_messages = 0, click_params = null)
+ if(!istype(inserting,/obj/item/stack/material))
if(!stop_messages)
- to_chat(user, "\The [holder] does not accept [W].")
+ to_chat(user, "\The [holder] does not accept [inserting].")
return FALSE
var/current = 0
for(var/obj/item/stack/material/S in get_contents())
@@ -24,8 +24,8 @@
return TRUE
// Modified handle_item_insertion. Would prefer not to, but...
-/datum/storage/sheets/handle_item_insertion(mob/user, obj/item/W, prevent_warning, skip_update, click_params)
- var/obj/item/stack/material/S = W
+/datum/storage/sheets/handle_item_insertion(mob/user, obj/item/inserting, prevent_warning, skip_update, click_params)
+ var/obj/item/stack/material/S = inserting
if(!istype(S))
return FALSE
var/amount
@@ -71,8 +71,8 @@
atom_holder.update_icon()
// Instead of removing
-/datum/storage/sheets/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
- var/obj/item/stack/material/S = W
+/datum/storage/sheets/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
+ var/obj/item/stack/material/S = removing
if(!istype(S))
return FALSE
diff --git a/code/datums/storage/subtypes_slides.dm b/code/datums/storage/subtypes_slides.dm
index 1f1e76f069a2..3630191a176f 100644
--- a/code/datums/storage/subtypes_slides.dm
+++ b/code/datums/storage/subtypes_slides.dm
@@ -3,15 +3,15 @@
max_storage_space = BASE_STORAGE_CAPACITY(ITEM_SIZE_SMALL)
use_sound = 'sound/effects/storage/toolbox.ogg'
-/datum/storage/slide_projector/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/slide_projector/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
. = ..()
var/obj/item/slide_projector/projector = holder
- if(. && istype(projector) && W == projector.current_slide)
+ if(. && istype(projector) && removing == projector.current_slide)
var/list/contents = get_contents()
projector.set_slide(length(contents) ? contents[1] : null)
-/datum/storage/slide_projector/handle_item_insertion(mob/user, obj/item/W, prevent_warning, skip_update, click_params)
+/datum/storage/slide_projector/handle_item_insertion(mob/user, obj/item/inserting, prevent_warning, skip_update, click_params)
. = ..()
var/obj/item/slide_projector/projector = holder
if(. && istype(projector) && !projector.current_slide)
- projector.set_slide(W)
+ projector.set_slide(inserting)
diff --git a/code/datums/storage/subtypes_tray.dm b/code/datums/storage/subtypes_tray.dm
index fd17ea8d7e45..f0d79ec39b46 100644
--- a/code/datums/storage/subtypes_tray.dm
+++ b/code/datums/storage/subtypes_tray.dm
@@ -4,11 +4,11 @@
allow_quick_gather = 1
use_sound = null
-/datum/storage/tray/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/tray/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
. = ..()
- W.vis_flags = initial(W.vis_flags)
- W.appearance_flags = initial(W.appearance_flags)
- W.update_icon() // in case it updates vis_flags
+ removing.vis_flags = initial(removing.vis_flags)
+ removing.appearance_flags = initial(removing.appearance_flags)
+ removing.update_icon() // in case it updates vis_flags
/datum/storage/tray/gather_all(var/turf/T, var/mob/user)
..()
diff --git a/code/datums/storage/subtypes_wallet.dm b/code/datums/storage/subtypes_wallet.dm
index c9318f0146d6..75aed5045327 100644
--- a/code/datums/storage/subtypes_wallet.dm
+++ b/code/datums/storage/subtypes_wallet.dm
@@ -39,23 +39,23 @@
/obj/item/clothing/armor_attachment/tag,
)
-/datum/storage/wallet/remove_from_storage(mob/user, obj/item/W, atom/new_location, skip_update)
+/datum/storage/wallet/remove_from_storage(mob/user, obj/item/removing, atom/new_location, skip_update)
. = ..()
if(. && istype(holder, /obj/item/wallet))
var/obj/item/wallet/wallet = holder
- if(W == wallet.front_id)
+ if(removing == wallet.front_id)
wallet.front_id = null
wallet.SetName(initial(wallet.name))
wallet.update_icon()
- if(W == wallet.front_stick)
+ if(removing == wallet.front_stick)
wallet.front_stick = null
-/datum/storage/wallet/handle_item_insertion(mob/user, obj/item/W, prevent_warning, skip_update, click_params)
+/datum/storage/wallet/handle_item_insertion(mob/user, obj/item/inserting, prevent_warning, skip_update, click_params)
. = ..()
if(. && istype(holder, /obj/item/wallet))
var/obj/item/wallet/wallet = holder
- if(!wallet.front_id && istype(W, /obj/item/card/id))
- wallet.front_id = W
+ if(!wallet.front_id && istype(inserting, /obj/item/card/id))
+ wallet.front_id = inserting
wallet.update_icon()
- if(!wallet.front_stick && istype(W, /obj/item/charge_stick))
- wallet.front_stick = W
+ if(!wallet.front_stick && istype(inserting, /obj/item/charge_stick))
+ wallet.front_stick = inserting
diff --git a/code/datums/supplypacks/engineering.dm b/code/datums/supplypacks/engineering.dm
index e7ec3c1645be..727e55a1432c 100644
--- a/code/datums/supplypacks/engineering.dm
+++ b/code/datums/supplypacks/engineering.dm
@@ -87,7 +87,7 @@
containername = "collector crate"
access = access_engine_equip
-/decl/hierarchy/supply_pack/engineering/PA
+/decl/hierarchy/supply_pack/engineering/particle_accelerator
name = "Equipment - Particle accelerator"
contains = list(/obj/structure/particle_accelerator/fuel_chamber,
/obj/machinery/particle_accelerator/control_box,
diff --git a/code/datums/supplypacks/galley.dm b/code/datums/supplypacks/galley.dm
index 45c2c05ea161..2244e737d4e9 100644
--- a/code/datums/supplypacks/galley.dm
+++ b/code/datums/supplypacks/galley.dm
@@ -143,7 +143,7 @@
/decl/hierarchy/supply_pack/galley/beer_dispenser
name = "Equipment - Booze dispenser"
contains = list(
- /obj/machinery/chemical_dispenser/bar_alc{anchored = FALSE}
+ /obj/machinery/chemical_dispenser/bar_alc/unanchored
)
containertype = /obj/structure/largecrate
containername = "booze dispenser crate"
@@ -151,7 +151,7 @@
/decl/hierarchy/supply_pack/galley/soda_dispenser
name = "Equipment - Soda dispenser"
contains = list(
- /obj/machinery/chemical_dispenser/bar_soft{anchored = FALSE}
+ /obj/machinery/chemical_dispenser/bar_soft/unanchored
)
containertype = /obj/structure/largecrate
containername = "soda dispenser crate"
diff --git a/code/datums/supplypacks/nonessent.dm b/code/datums/supplypacks/nonessent.dm
index f9e82573d193..bfbf2e87f4aa 100644
--- a/code/datums/supplypacks/nonessent.dm
+++ b/code/datums/supplypacks/nonessent.dm
@@ -94,7 +94,7 @@
/obj/item/clothing/pants/slacks/purple,
/obj/item/clothing/shirt/button,
/obj/item/clothing/suit/jacket/vest/black,
- /obj/item/clothing/jumpsuit/mailman,
+ /obj/item/clothing/costume/mailman,
/obj/item/clothing/dress/saloon,
/obj/item/clothing/suspenders,
/obj/item/clothing/suit/toggle/labcoat/mad,
@@ -103,7 +103,7 @@
/obj/item/clothing/costume/owl,
/obj/item/clothing/pants/slacks/black,
/obj/item/clothing/shirt/button,
- /obj/item/clothing/neck/tie/bow/color/red,
+ /obj/item/clothing/neck/tie/bow/red,
/obj/item/clothing/suit/jacket/vest/blue,
/obj/item/clothing/costume/gladiator,
/obj/item/clothing/costume/soviet,
@@ -115,7 +115,7 @@
/obj/item/clothing/costume/kilt,
/obj/item/clothing/costume/savage_hunter,
/obj/item/clothing/costume/savage_hunter/female,
- /obj/item/clothing/jumpsuit/wetsuit)
+ /obj/item/clothing/costume/wetsuit)
name = "Costume - Random"
containername = "actor costumes crate"
supply_method = /decl/supply_method/randomized
diff --git a/code/datums/supplypacks/science.dm b/code/datums/supplypacks/science.dm
index f7d7f9991091..5505d65f4647 100644
--- a/code/datums/supplypacks/science.dm
+++ b/code/datums/supplypacks/science.dm
@@ -4,7 +4,7 @@
/decl/hierarchy/supply_pack/science/chemistry_dispenser
name = "Equipment - Chemical Reagent dispenser"
contains = list(
- /obj/machinery/chemical_dispenser{anchored = FALSE}
+ /obj/machinery/chemical_dispenser/unanchored
)
containertype = /obj/structure/largecrate
containername = "reagent dispenser crate"
@@ -65,4 +65,13 @@
/decl/hierarchy/supply_pack/science/illuminate
name = "Gear - Illumination grenades"
contains = list(/obj/item/grenade/light = 8)
- containername = "illumination grenade crate"
\ No newline at end of file
+ containername = "illumination grenade crate"
+
+/decl/hierarchy/supply_pack/science/stasis_cages
+ name = "Stasis Cage"
+ contains = list(
+ /obj/structure/stasis_cage = 1
+ )
+ containertype = /obj/structure/closet/crate/large
+ containername = "stasis cage crate"
+ access = access_research
diff --git a/code/datums/supplypacks/supplypack.dm b/code/datums/supplypacks/supplypack.dm
index 1be6469edc51..319d1dee4089 100644
--- a/code/datums/supplypacks/supplypack.dm
+++ b/code/datums/supplypacks/supplypack.dm
@@ -14,9 +14,11 @@
var/supply_method = /decl/supply_method
var/decl/security_level/security_level
-//Is run once on init for non-base-category supplypacks.
var/global/list/cargoprices = list()
-/decl/hierarchy/supply_pack/proc/setup()
+/decl/hierarchy/supply_pack/Initialize()
+ . = ..() // make sure children are set up
+ if(is_category())
+ return // don't do any of this for categories
if(!num_contained)
for(var/entry in contains)
num_contained += max(1, contains[entry])
@@ -28,8 +30,8 @@ var/global/list/cargoprices = list()
cost = max(1, NONUNIT_CEILING((cost * WORTH_TO_SUPPLY_POINTS_CONSTANT * SSsupply.price_markup), WORTH_TO_SUPPLY_POINTS_ROUND_CONSTANT))
global.cargoprices[name] = cost
- var/decl/supply_method/sm = GET_DECL(supply_method)
- manifest = sm.setup_manifest(src)
+ var/decl/supply_method/method = GET_DECL(supply_method)
+ manifest = method.setup_manifest(src)
/client/proc/print_cargo_prices()
set name = "Print Cargo Prices"
@@ -59,8 +61,8 @@ var/global/list/cargoprices = list()
return security_state.current_security_level_is_same_or_higher_than(security_level)
/decl/hierarchy/supply_pack/proc/spawn_contents(var/location)
- var/decl/supply_method/sm = GET_DECL(supply_method)
- . = sm.spawn_contents(src, location)
+ var/decl/supply_method/method = GET_DECL(supply_method)
+ . = method.spawn_contents(src, location)
for(var/obj/O in .)
O.anchored = FALSE
@@ -73,18 +75,18 @@ var/global/list/cargoprices = list()
//NEW NOTE: Do NOT set the price of any crates below 7 points. Doing so allows infinite points.
*/
-/decl/supply_method/proc/spawn_contents(var/decl/hierarchy/supply_pack/sp, var/location)
- if(!sp || !location)
+/decl/supply_method/proc/spawn_contents(var/decl/hierarchy/supply_pack/pack, var/location)
+ if(!pack || !location)
return
. = list()
- for(var/entry in sp.contains)
- for(var/i = 1 to max(1, sp.contains[entry]))
+ for(var/entry in pack.contains)
+ for(var/i = 1 to max(1, pack.contains[entry]))
dd_insertObjectList(.,new entry(location))
-/decl/supply_method/proc/setup_manifest(var/decl/hierarchy/supply_pack/sp)
+/decl/supply_method/proc/setup_manifest(var/decl/hierarchy/supply_pack/pack)
. = list()
. += ""
- for(var/path in sp.contains)
+ for(var/path in pack.contains)
var/atom/A = path
if(!ispath(A))
continue
@@ -92,13 +94,13 @@ var/global/list/cargoprices = list()
. += "
"
. = jointext(.,null)
-/decl/supply_method/randomized/spawn_contents(var/decl/hierarchy/supply_pack/sp, var/location)
- if(!sp || !location)
+/decl/supply_method/randomized/spawn_contents(var/decl/hierarchy/supply_pack/pack, var/location)
+ if(!pack || !location)
return
. = list()
- for(var/j = 1 to sp.num_contained)
- var/picked = pick(sp.contains)
+ for(var/j = 1 to pack.num_contained)
+ var/picked = pick(pack.contains)
. += new picked(location)
-/decl/supply_method/randomized/setup_manifest(var/decl/hierarchy/supply_pack/sp)
- return "Contains any [sp.num_contained] of:" + ..()
+/decl/supply_method/randomized/setup_manifest(var/decl/hierarchy/supply_pack/pack)
+ return "Contains any [pack.num_contained] of:" + ..()
diff --git a/code/datums/trading/_trader.dm b/code/datums/trading/_trader.dm
index 267e2c67c776..097965789bd6 100644
--- a/code/datums/trading/_trader.dm
+++ b/code/datums/trading/_trader.dm
@@ -199,7 +199,7 @@
if(ishuman(user))
var/mob/living/human/H = user
if(H.species)
- specific = H.species.name
+ specific = H.species.uid
else if(issilicon(user))
specific = TRADER_HAIL_SILICON_END
if(!speech["[TRADER_HAIL_START][specific]"])
diff --git a/code/datums/traits/_traits.dm b/code/datums/traits/_traits.dm
index bd1cbbf26364..b3e7103fe9d4 100644
--- a/code/datums/traits/_traits.dm
+++ b/code/datums/traits/_traits.dm
@@ -3,14 +3,18 @@
// certain number of them at character generation and they will alter some interactions with the world.
/mob/living
- var/list/traits
+ /// A list of mob-specific traits, for when the list differs from the species list.
+ /// Overrides the species list; if it's identical to it, it will be unset.
+ /// Code using the traits system should use get_traits() instead.
+ VAR_PRIVATE/list/_mob_traits
/mob/living/proc/has_trait(trait_type, trait_level = TRAIT_LEVEL_EXISTS)
SHOULD_NOT_OVERRIDE(TRUE)
SHOULD_NOT_SLEEP(TRUE)
- return (trait_type in traits) && (!trait_level || traits[trait_type] >= trait_level)
+ var/list/actual_traits = get_traits()
+ return (trait_type in actual_traits) && (!trait_level || actual_traits[trait_type] >= trait_level)
-/mob/living/proc/GetTraitLevel(trait_type)
+/mob/living/proc/get_trait_level(trait_type)
SHOULD_NOT_SLEEP(TRUE)
var/traits = get_traits()
if(!traits)
@@ -24,7 +28,7 @@
/mob/living/get_traits()
RETURN_TYPE(/list)
var/decl/species/our_species = get_species()
- return traits || our_species?.traits
+ return _mob_traits || our_species?.traits
/mob/living/proc/set_trait(trait_type, trait_level)
SHOULD_NOT_SLEEP(TRUE)
@@ -32,53 +36,51 @@
var/decl/trait/trait = GET_DECL(trait_type)
if(!trait.validate_level(trait_level))
return FALSE
- if(our_species && !traits) // If species traits haven't been setup before, check if we need to do so now
+ if(our_species && !_mob_traits) // If species traits haven't been setup before, check if we need to do so now
var/species_level = our_species.traits[trait_type]
if(species_level == trait_level) // Matched the default species trait level, ignore
return TRUE
- traits = our_species.traits.Copy() // The setup is to simply copy the species list of traits
- if(!(trait_type in traits))
- LAZYSET(traits, trait_type, trait_level)
+ _mob_traits = our_species.traits.Copy() // The setup is to simply copy the species list of traits
+ if(!(trait_type in _mob_traits))
+ LAZYSET(_mob_traits, trait_type, trait_level)
trait.apply_trait(src)
return TRUE
-/mob/living/proc/RemoveTrait(trait_type, canonize = TRUE)
+/mob/living/proc/remove_trait(trait_type, canonize = TRUE)
var/decl/species/our_species = get_species()
// If traits haven't been set up, but we're trying to remove a trait that exists on the species then set up traits
- if(!traits && LAZYISIN(our_species?.traits, trait_type))
- traits = our_species.traits.Copy()
- if(LAZYLEN(traits))
- LAZYREMOVE(traits, trait_type)
+ if(!_mob_traits && LAZYISIN(our_species?.traits, trait_type))
+ _mob_traits = our_species.traits.Copy()
+ if(LAZYLEN(_mob_traits))
+ LAZYREMOVE(_mob_traits, trait_type)
// Check if we can just default back to species traits.
if(canonize)
- CanonizeTraits()
+ canonize_traits()
/// Removes a trait unless it exists on the species.
/// If it does exist on the species, we reset it to the species' trait level.
-/mob/living/proc/RemoveExtrinsicTrait(trait_type)
+/mob/living/proc/remove_extrinsic_trait(trait_type)
var/decl/species/our_species = get_species()
if(!LAZYACCESS(our_species?.traits, trait_type))
- RemoveTrait(trait_type)
- else if(our_species?.traits[trait_type] != GetTraitLevel(trait_type))
+ remove_trait(trait_type)
+ else if(our_species?.traits[trait_type] != get_trait_level(trait_type))
set_trait(trait_type, our_species?.traits[trait_type])
+/mob/living/proc/clear_extrinsic_traits()
+ _mob_traits = null
+
/// Sets the traits list to null if it's identical to the species list.
/// Returns TRUE if the list was reset and FALSE otherwise.
-/mob/living/proc/CanonizeTraits()
- if(!traits) // Already in canonical form.
+/mob/living/proc/canonize_traits()
+ if(!_mob_traits) // Already in canonical form.
return FALSE
var/decl/species/our_species = get_species()
if(!our_species) // Doesn't apply without a species.
return FALSE
- var/list/missing_traits = traits ^ our_species?.traits
- var/list/matched_traits = traits & our_species?.traits
- if(LAZYLEN(missing_traits))
- return FALSE
- for(var/trait in matched_traits) // inside this loop we know our_species exists and has traits
- if(traits[trait] != our_species.traits[trait])
- return FALSE
- traits = null
- return TRUE
+ if(_mob_traits ~= our_species.traits)
+ _mob_traits = null
+ return TRUE
+ return FALSE
/decl/trait
abstract_type = /decl/trait
@@ -194,10 +196,10 @@
return (istype(holder))
// Called by preferences selection for HTML display.
-/decl/trait/proc/get_trait_selection_data(var/datum/category_item/player_setup_item/traits/caller, var/list/ticked_traits = list(), var/recurse_level = 0, var/ignore_children_if_unticked = 1, var/ignore_unticked)
+/decl/trait/proc/get_trait_selection_data(var/datum/category_item/player_setup_item/traits/calling_item, var/list/ticked_traits = list(), var/recurse_level = 0, var/ignore_children_if_unticked = 1, var/ignore_unticked)
var/ticked = (type in ticked_traits)
- if((ignore_unticked && !ticked) || (caller && !is_available_to_select(caller.pref)))
+ if((ignore_unticked && !ticked) || (calling_item && !is_available_to_select(calling_item.pref)))
return ""
var/result = "| "
@@ -211,10 +213,10 @@
incompatible_trait_taken = TRUE
break
- var/chargen_name = get_chargen_name(caller.pref)
- var/chargen_desc = get_chargen_desc(caller.pref)
- if(istype(caller) && (ticked || caller.get_trait_total() + trait_cost <= get_config_value(/decl/config/num/max_character_traits)) && !incompatible_trait_taken)
- result += "[ticked ? "[chargen_name]" : "[chargen_name]"] ([trait_cost])"
+ var/chargen_name = get_chargen_name(calling_item.pref)
+ var/chargen_desc = get_chargen_desc(calling_item.pref)
+ if(istype(calling_item) && (ticked || calling_item.get_trait_total() + trait_cost <= get_config_value(/decl/config/num/max_character_traits)) && !incompatible_trait_taken)
+ result += "[ticked ? "[chargen_name]" : "[chargen_name]"] ([trait_cost])"
else
result += ticked ? "[chargen_name]" : "[chargen_name]"
@@ -227,7 +229,7 @@
result += " |
"
if(LAZYLEN(children) && !(ignore_children_if_unticked && !ticked))
for(var/decl/trait/trait in children)
- result += trait.get_trait_selection_data(caller, ticked_traits, (recurse_level+1), ignore_children_if_unticked)
+ result += trait.get_trait_selection_data(calling_item, ticked_traits, (recurse_level+1), ignore_children_if_unticked)
return result
/// Shows `show_to` a browser window describing the character setup traits taken by `src`.
diff --git a/code/datums/traits/prosthetics/prosthetic_limbs.dm b/code/datums/traits/prosthetics/prosthetic_limbs.dm
index 0ea2e8c06580..a620ebef2942 100644
--- a/code/datums/traits/prosthetics/prosthetic_limbs.dm
+++ b/code/datums/traits/prosthetics/prosthetic_limbs.dm
@@ -14,10 +14,8 @@
var/list/incompatible_with_limbs = list(BP_L_HAND)
var/model
-/decl/trait/prosthetic_limb/proc/get_base_model(var/species_name)
- if(!species_name)
- return /decl/bodytype/prosthetic/basic_human
- var/decl/species/species = species_name ? get_species_by_key(species_name) : global.using_map.default_species
+/decl/trait/prosthetic_limb/proc/get_base_model(var/species_uid)
+ var/decl/species/species = decls_repository.get_decl_by_id(species_uid || global.using_map.default_species)
return species?.base_external_prosthetics_model
/decl/trait/prosthetic_limb/get_chargen_name(datum/preferences/pref)
@@ -84,12 +82,12 @@
if(!bodytype?.is_robotic)
return FALSE
if(model)
- var/decl/bodytype/prosthetic/R = GET_DECL(model)
- if(!istype(R))
+ var/decl/bodytype/prosthetic/robot_model = GET_DECL(model)
+ if(!istype(robot_model))
return FALSE
- var/decl/species/S = get_species_by_key(pref.species) || get_species_by_key(global.using_map.default_species)
+ var/decl/species/S = pref.get_species_decl()
var/decl/bodytype/B = S.get_bodytype_by_name(pref.bodytype)
- if(!R.check_can_install(apply_to_limb, target_bodytype = (check_bodytype || B.bodytype_category)))
+ if(!robot_model.check_can_install(apply_to_limb, target_bodytype = (check_bodytype || B.bodytype_category)))
return FALSE
// If we're a duplicate of our parent due to get_base_model(), hide this one.
var/decl/trait/prosthetic_limb/parent_limb = parent
@@ -114,7 +112,7 @@
// Robotize the selected limb.
if(. && apply_to_limb)
- var/use_model = model || get_base_model(holder.get_species_name())
+ var/use_model = model || get_base_model(holder.get_species()?.uid)
var/obj/item/organ/external/E = GET_EXTERNAL_ORGAN(holder, apply_to_limb)
if(!istype(E))
var/list/organ_data = holder.should_have_limb(apply_to_limb)
diff --git a/code/datums/underwear/bottom.dm b/code/datums/underwear/bottom.dm
index a2ed61658161..fc8bd4a2ee30 100644
--- a/code/datums/underwear/bottom.dm
+++ b/code/datums/underwear/bottom.dm
@@ -1,4 +1,5 @@
/datum/category_item/underwear/bottom
+ abstract_type = /datum/category_item/underwear/bottom
underwear_gender = PLURAL
underwear_name = "underwear"
underwear_type = /obj/item/underwear/bottom
diff --git a/code/datums/underwear/socks.dm b/code/datums/underwear/socks.dm
index 4b2689521937..70dc7454dce7 100644
--- a/code/datums/underwear/socks.dm
+++ b/code/datums/underwear/socks.dm
@@ -1,4 +1,5 @@
/datum/category_item/underwear/socks
+ abstract_type = /datum/category_item/underwear/socks
underwear_name = "socks"
underwear_gender = PLURAL
underwear_type = /obj/item/underwear/socks
diff --git a/code/datums/underwear/top.dm b/code/datums/underwear/top.dm
index 6b559214f65e..816df62549df 100644
--- a/code/datums/underwear/top.dm
+++ b/code/datums/underwear/top.dm
@@ -1,4 +1,5 @@
/datum/category_item/underwear/top
+ abstract_type = /datum/category_item/underwear/top
underwear_name = "bra"
underwear_type = /obj/item/underwear/top
diff --git a/code/datums/underwear/undershirt.dm b/code/datums/underwear/undershirt.dm
index ad2f3c3691f7..ae4ac6a5d603 100644
--- a/code/datums/underwear/undershirt.dm
+++ b/code/datums/underwear/undershirt.dm
@@ -1,4 +1,5 @@
/datum/category_item/underwear/undershirt
+ abstract_type = /datum/category_item/underwear/undershirt
underwear_name = "undershirt"
underwear_type = /obj/item/underwear/undershirt
diff --git a/code/datums/underwear/underwear.dm b/code/datums/underwear/underwear.dm
index a42fcf1a66f1..ff0813a3e9f5 100644
--- a/code/datums/underwear/underwear.dm
+++ b/code/datums/underwear/underwear.dm
@@ -1,6 +1,9 @@
/****************************
* Category Collection Setup *
****************************/
+// TODO: replace underwear category stuff with decls or something? unlike player_setup_collection they're all singletons
+// i hate to say it but the way this works may actually be perfect for /decl/hierarchy
+var/global/datum/category_collection/underwear/underwear = new()
/datum/category_collection/underwear
category_group_type = /datum/category_group/underwear
@@ -8,6 +11,9 @@
* Categories *
*************/
// Lower sort order is applied as icons first
+/datum/category_group/underwear
+ abstract_type = /datum/category_group/underwear
+
/datum/category_group/underwear/top
name = "Underwear, top"
sort_order = 1
diff --git a/code/datums/uplink/ammunition.dm b/code/datums/uplink/ammunition.dm
index 4c0f2ba93ab3..0b9d512df9df 100644
--- a/code/datums/uplink/ammunition.dm
+++ b/code/datums/uplink/ammunition.dm
@@ -34,20 +34,6 @@
item_cost = 8
path = /obj/item/ammo_magazine/rifle
-/datum/uplink_item/item/ammo/sniperammo
- name = "Ammobox of Sniper Rounds"
- desc = "A container of rounds for the anti-materiel rifle. Contains 7 rounds."
- item_cost = 8
- path = /obj/item/box/ammo/sniperammo
- antag_roles = list(/decl/special_role/mercenary)
-
-/datum/uplink_item/item/ammo/sniperammo/apds
- name = "Ammobox of APDS Sniper Rounds"
- desc = "A container of armor piercing rounds for the anti-materiel rifle. Contains 3 rounds."
- item_cost = 12
- path = /obj/item/box/ammo/sniperammo/apds
- antag_roles = list(/decl/special_role/mercenary)
-
/datum/uplink_item/item/ammo/shotgun_shells
name = "Ammobox of Shotgun Shells"
desc = "An ammo box with 2 sets of shell holders. Contains 8 buckshot shells total."
@@ -60,26 +46,12 @@
item_cost = 8
path = /obj/item/box/ammo/shotgunammo
-/datum/uplink_item/item/ammo/smg
- name = "Standard Box Magazine"
- desc = "A magazine for standard SMGs. Contains 20 rounds."
- item_cost = 8
- path = /obj/item/ammo_magazine/smg
- antag_roles = list(/decl/special_role/mercenary)
-
/datum/uplink_item/item/ammo/speedloader_magnum
name = "Magnum Speedloader"
desc = "A speedloader for magnum revolvers. Contains 6 rounds."
item_cost = 8
path = /obj/item/ammo_magazine/speedloader
-/datum/uplink_item/item/ammo/flechette
- name = "Flechette Rifle Magazine"
- desc = "A rifle magazine loaded with flechette rounds. Contains 9 rounds."
- item_cost = 8
- path = /obj/item/magnetic_ammo
- antag_roles = list(/decl/special_role/mercenary)
-
/datum/uplink_item/item/ammo/pistol_emp
name = "Standard EMP Ammo Box"
desc = "A box of EMP ammo for standard pistols. Contains 15 rounds."
diff --git a/code/datums/uplink/badassery.dm b/code/datums/uplink/badassery.dm
index 43375e941cb9..a0b1b26d0da3 100644
--- a/code/datums/uplink/badassery.dm
+++ b/code/datums/uplink/badassery.dm
@@ -67,33 +67,3 @@
/datum/uplink_item/item/badassery/random_many/purchase_log(obj/item/uplink/U)
SSstatistics.add_field_details("traitor_uplink_items_bought", "[src]")
log_and_message_admins("used \the [U.loc] to buy \a [src]")
-
-/****************
-* Surplus Crate *
-****************/
-/datum/uplink_item/item/badassery/surplus
- name = "\improper Surplus Crate"
- item_cost = DEFAULT_TELECRYSTAL_AMOUNT * 4
- var/item_worth = DEFAULT_TELECRYSTAL_AMOUNT * 6
- var/icon
-
-/datum/uplink_item/item/badassery/surplus/New()
- ..()
- antag_roles = list(/decl/special_role/mercenary)
- desc = "A crate containing [item_worth] telecrystal\s worth of surplus leftovers. If you can find some help to pay for it, you might strike gold."
-
-/datum/uplink_item/item/badassery/surplus/get_goods(var/obj/item/uplink/U, var/loc)
- var/obj/structure/largecrate/C = new(loc)
- var/random_items = get_random_uplink_items(U, item_worth, C)
- for(var/datum/uplink_item/I in random_items)
- I.purchase_log(U)
- I.get_goods(U, C)
-
- return C
-
-/datum/uplink_item/item/badassery/surplus/log_icon()
- if(!icon)
- var/obj/structure/largecrate/C = /obj/structure/largecrate
- icon = image(initial(C.icon), initial(C.icon_state))
-
- return html_icon(icon)
diff --git a/code/datums/uplink/devices_and_tools.dm b/code/datums/uplink/devices_and_tools.dm
index 7536a5d65616..b9e59845a66a 100644
--- a/code/datums/uplink/devices_and_tools.dm
+++ b/code/datums/uplink/devices_and_tools.dm
@@ -116,17 +116,6 @@
item_cost = 40
path = /obj/item/powersink
-/datum/uplink_item/item/tools/teleporter
- name = "Teleporter Circuit Board"
- desc = "A circuit board that can be used to create a teleporter console, able to lock onto detected \
- teleportation beacons. Requires a projector and teleporter hub nearby to work."
- item_cost = 40
- path = /obj/item/stock_parts/circuitboard/teleporter
-
-/datum/uplink_item/item/tools/teleporter/New()
- ..()
- antag_roles = list(/decl/special_role/mercenary)
-
/datum/uplink_item/item/tools/ai_module
name = "Hacked AI Upload Module"
desc = "A module that can be used anonymously add a singular, top level law to an active AI. \
@@ -146,7 +135,6 @@
name = "Camera MIU"
desc = "Wearing this mask allows you to remotely view any cameras you currently have access to. Take the mask off to stop viewing."
item_cost = 60
- antag_costs = list(/decl/special_role/mercenary = 30)
path = /obj/item/clothing/mask/ai
/datum/uplink_item/item/tools/interceptor
diff --git a/code/datums/uplink/grenades.dm b/code/datums/uplink/grenades.dm
index c91af43ad7d9..fa22ab92bffc 100644
--- a/code/datums/uplink/grenades.dm
+++ b/code/datums/uplink/grenades.dm
@@ -48,35 +48,3 @@
name = "5x EMP Grenades"
item_cost = 24
path = /obj/item/box/emps
-
-/datum/uplink_item/item/grenades/frag_high_yield
- name = "Fragmentation Bomb"
- item_cost = 24
- antag_roles = list(/decl/special_role/mercenary) // yeah maybe regular traitors shouldn't be able to get these
- path = /obj/item/grenade/frag/high_yield
-
-/datum/uplink_item/item/grenades/fragshell
- name = "1x Fragmentation Shell"
- desc = "Weaker than standard fragmentation grenades, these devices can be fired from a grenade launcher."
- item_cost = 10
- antag_roles = list(/decl/special_role/mercenary)
- path = /obj/item/grenade/frag/shell
-
-/datum/uplink_item/item/grenades/fragshells
- name = "5x Fragmentation Shells"
- desc = "Weaker than standard fragmentation grenades, these devices can be fired from a grenade launcher."
- item_cost = 40
- antag_roles = list(/decl/special_role/mercenary)
- path = /obj/item/box/fragshells
-
-/datum/uplink_item/item/grenades/frag
- name = "1x Fragmentation Grenade"
- item_cost = 10
- antag_roles = list(/decl/special_role/mercenary)
- path = /obj/item/grenade/frag
-
-/datum/uplink_item/item/grenades/frags
- name = "5x Fragmentation Grenades"
- item_cost = 40
- antag_roles = list(/decl/special_role/mercenary)
- path = /obj/item/box/frags
diff --git a/code/datums/uplink/hardsuit_modules.dm b/code/datums/uplink/hardsuit_modules.dm
index d770e635c9f6..076c0247d543 100644
--- a/code/datums/uplink/hardsuit_modules.dm
+++ b/code/datums/uplink/hardsuit_modules.dm
@@ -39,10 +39,3 @@
desc = "A module capable of recharging your suit's power reserves, by tapping into an exposed, live wire."
item_cost = 48
path = /obj/item/rig_module/power_sink
-
-/datum/uplink_item/item/hardsuit_modules/laser_canon
- name = "\improper Mounted Laser Cannon"
- desc = "A module capable of draining your suit's power reserves in order to fire a shoulder mounted laser cannon."
- item_cost = 64
- path = /obj/item/rig_module/mounted/lcannon
- antag_roles = list(/decl/special_role/mercenary)
diff --git a/code/datums/uplink/highly_visible_and_dangerous_weapons.dm b/code/datums/uplink/highly_visible_and_dangerous_weapons.dm
index c64cf84b614a..66e2b05b34d3 100644
--- a/code/datums/uplink/highly_visible_and_dangerous_weapons.dm
+++ b/code/datums/uplink/highly_visible_and_dangerous_weapons.dm
@@ -61,69 +61,18 @@
item_cost = 56
path = /obj/item/backpack/satchel/syndie_kit/revolver
-/datum/uplink_item/item/visible_weapons/grenade_launcher
- name = "Grenade Launcher"
- desc = "A pump action grenade launcher loaded with a random assortment of grenades"
- item_cost = 60
- antag_roles = list(/decl/special_role/mercenary)
- path = /obj/item/gun/launcher/grenade/loaded
-
-//These are for traitors (or other antags, perhaps) to have the option of purchasing some merc gear.
-/datum/uplink_item/item/visible_weapons/smg
- name = "Standard Submachine Gun"
- desc = "A quick-firing weapon with three toggleable fire modes."
- item_cost = 52
- path = /obj/item/gun/projectile/automatic/smg
- antag_roles = list(/decl/special_role/mercenary)
-
-/datum/uplink_item/item/visible_weapons/assaultrifle
- name = "Assault Rifle"
- desc = "A common rifle with three toggleable fire modes."
- item_cost = 60
- path = /obj/item/gun/projectile/automatic/assault_rifle
- antag_roles = list(/decl/special_role/mercenary)
-
/datum/uplink_item/item/visible_weapons/advanced_energy_gun
name = "Advanced Energy Gun"
desc = "A highly experimental heavy energy weapon, with three different lethality settings."
item_cost = 60
path = /obj/item/gun/energy/gun/nuclear
-/datum/uplink_item/item/visible_weapons/heavysniper
- name = "Anti-materiel Sniper Rifle"
- desc = "A secure briefcase that contains an immensely powerful penetrating rifle, as well as seven extra sniper rounds."
- item_cost = 68
- path = /obj/item/secure_storage/briefcase/heavysniper
- antag_roles = list(/decl/special_role/mercenary)
-
-/datum/uplink_item/item/visible_weapons/combat_shotgun
- name = "Pump Shotgun"
- desc = "A high capacity, pump-action shotgun regularly used for repelling boarding parties in close range scenarios."
- item_cost = 52
- path = /obj/item/gun/projectile/shotgun/pump
- antag_roles = list(/decl/special_role/mercenary)
-
/datum/uplink_item/item/visible_weapons/sawnoff
name = "Sawnoff Shotgun"
desc = "A shortened double-barrel shotgun, able to fire either one, or both, barrels at once."
item_cost = 45
path = /obj/item/gun/projectile/shotgun/doublebarrel/sawn
-/datum/uplink_item/item/visible_weapons/flechetterifle
- name = "Flechette Rifle"
- desc = "A railgun with two toggleable fire modes, able to launch flechette ammunition at incredible speeds."
- item_cost = 60
- path = /obj/item/gun/magnetic/railgun/flechette
- antag_roles = list(/decl/special_role/mercenary)
-
-/datum/uplink_item/item/visible_weapons/railgun // Like a semi-auto AMR
- name = "Railgun"
- desc = "An anti-armour magnetic launching system fed by a high-capacity matter cartridge, \
- capable of firing slugs at intense speeds."
- item_cost = DEFAULT_TELECRYSTAL_AMOUNT - (DEFAULT_TELECRYSTAL_AMOUNT - (DEFAULT_TELECRYSTAL_AMOUNT % 6)) / 6
- antag_roles = list(/decl/special_role/mercenary)
- path = /obj/item/gun/magnetic/railgun
-
/datum/uplink_item/item/visible_weapons/harpoonbomb
name = "Explosive Harpoon"
item_cost = 12
diff --git a/code/datums/uplink/uplink_items.dm b/code/datums/uplink/uplink_items.dm
index 97db7fad4614..26ed3c2e370c 100644
--- a/code/datums/uplink/uplink_items.dm
+++ b/code/datums/uplink/uplink_items.dm
@@ -1,11 +1,10 @@
-var/global/datum/uplink/uplink = new()
-
-/datum/uplink
+/decl/uplink
var/list/items_assoc
var/list/datum/uplink_item/items
var/list/datum/uplink_category/categories
-/datum/uplink/New()
+/decl/uplink/Initialize()
+ . = ..()
items_assoc = list()
items = init_subtypes(/datum/uplink_item)
categories = init_subtypes(/datum/uplink_category)
diff --git a/code/datums/uplink/uplink_sources.dm b/code/datums/uplink/uplink_sources.dm
index a0dc90c3bf93..a37027741bf1 100644
--- a/code/datums/uplink/uplink_sources.dm
+++ b/code/datums/uplink/uplink_sources.dm
@@ -54,15 +54,15 @@ var/global/list/default_uplink_source_priority = list(
. = ..()
/decl/uplink_source/radio/setup_uplink_source(var/mob/M, var/amount)
- var/obj/item/radio/R = find_in_mob(M, /obj/item/radio)
- if(!R)
+ var/obj/item/radio/radio = find_in_mob(M, /obj/item/radio)
+ if(!radio)
return SETUP_FAILED
- var/obj/item/uplink/T = new(R, M.mind, amount)
- R.hidden_uplink = T
- R.traitor_frequency = sanitize_frequency(rand(PUBLIC_LOW_FREQ+1, PUB_FREQ-1))
- to_chat(M, "A portable object teleportation relay has been installed in your [R.name]. Simply dial the frequency [format_frequency(R.traitor_frequency)] to unlock its hidden features.")
- M.StoreMemory("Radio Freq: [format_frequency(R.traitor_frequency)] ([R.name]).", /decl/memory_options/system)
+ var/obj/item/uplink/T = new(radio, M.mind, amount)
+ radio.hidden_uplink = T
+ radio.traitor_frequency = sanitize_frequency(rand(PUBLIC_LOW_FREQ+1, PUB_FREQ-1))
+ to_chat(M, "A portable object teleportation relay has been installed in your [radio.name]. Simply dial the frequency [format_frequency(radio.traitor_frequency)] to unlock its hidden features.")
+ M.StoreMemory("Radio Freq: [format_frequency(radio.traitor_frequency)] ([radio.name]).", /decl/memory_options/system)
/decl/uplink_source/implant
name = "Implant"
@@ -133,8 +133,8 @@ var/global/list/default_uplink_source_priority = list(
priority_order |= GET_DECL(entry)
for(var/entry in priority_order)
- var/decl/uplink_source/US = entry
- if(US.setup_uplink_source(M, amount) != SETUP_FAILED)
+ var/decl/uplink_source/uplink = entry
+ if(uplink.setup_uplink_source(M, amount) != SETUP_FAILED)
return TRUE
to_chat(M, "Either by choice or circumstance you will be without an uplink.")
diff --git a/code/datums/vending/stored_item.dm b/code/datums/vending/stored_item.dm
index 8eda6287cacb..3246f711603d 100644
--- a/code/datums/vending/stored_item.dm
+++ b/code/datums/vending/stored_item.dm
@@ -82,7 +82,7 @@
for(var/atom/movable/thing in instances)
thing.forceMove(new_storing_obj)
-/datum/stored_items/proc/get_combined_matter(include_instances = TRUE)
+/datum/stored_items/proc/get_combined_matter(include_instances = TRUE, include_reagents = TRUE)
var/virtual_amount = amount - length(instances)
if(virtual_amount)
. = atom_info_repository.get_matter_for(item_path)?.Copy()
@@ -92,4 +92,4 @@
. = list()
if(include_instances)
for(var/atom/instance in instances)
- . = MERGE_ASSOCS_WITH_NUM_VALUES(., instance.get_contained_matter())
\ No newline at end of file
+ . = MERGE_ASSOCS_WITH_NUM_VALUES(., instance.get_contained_matter(include_reagents))
\ No newline at end of file
diff --git a/code/datums/wires/camera.dm b/code/datums/wires/camera.dm
index 09046ea83f19..c1e09d292805 100644
--- a/code/datums/wires/camera.dm
+++ b/code/datums/wires/camera.dm
@@ -42,7 +42,7 @@ var/global/const/CAMERA_WIRE_ALARM = 8
if(CAMERA_WIRE_POWER)
C.cut_power = !mended
- C.set_status(mended, usr)
+ C.set_camera_status(mended, usr)
if(CAMERA_WIRE_LIGHT)
C.light_disabled = !mended
diff --git a/code/datums/wires/radio.dm b/code/datums/wires/radio.dm
index d2d868a4a7d1..5de478c9dd76 100644
--- a/code/datums/wires/radio.dm
+++ b/code/datums/wires/radio.dm
@@ -12,35 +12,35 @@ var/global/const/WIRE_RECEIVE = 2
var/global/const/WIRE_TRANSMIT = 4
/datum/wires/radio/CanUse(var/mob/living/L)
- var/obj/item/radio/R = holder
- if(R.panel_open)
+ var/obj/item/radio/radio = holder
+ if(radio.panel_open)
return 1
return 0
/datum/wires/radio/UpdatePulsed(var/index)
- var/obj/item/radio/R = holder
+ var/obj/item/radio/radio = holder
switch(index)
if(WIRE_SIGNAL)
- R.listening = !R.listening && !IsIndexCut(WIRE_RECEIVE)
- R.broadcasting = R.listening && !IsIndexCut(WIRE_TRANSMIT)
+ radio.listening = !radio.listening && !IsIndexCut(WIRE_RECEIVE)
+ radio.broadcasting = radio.listening && !IsIndexCut(WIRE_TRANSMIT)
if(WIRE_RECEIVE)
- R.listening = !R.listening && !IsIndexCut(WIRE_SIGNAL)
+ radio.listening = !radio.listening && !IsIndexCut(WIRE_SIGNAL)
if(WIRE_TRANSMIT)
- R.broadcasting = !R.broadcasting && !IsIndexCut(WIRE_SIGNAL)
+ radio.broadcasting = !radio.broadcasting && !IsIndexCut(WIRE_SIGNAL)
SSnano.update_uis(holder)
/datum/wires/radio/UpdateCut(var/index, var/mended)
- var/obj/item/radio/R = holder
+ var/obj/item/radio/radio = holder
switch(index)
if(WIRE_SIGNAL)
- R.listening = mended && !IsIndexCut(WIRE_RECEIVE)
- R.broadcasting = mended && !IsIndexCut(WIRE_TRANSMIT)
+ radio.listening = mended && !IsIndexCut(WIRE_RECEIVE)
+ radio.broadcasting = mended && !IsIndexCut(WIRE_TRANSMIT)
if(WIRE_RECEIVE)
- R.listening = mended && !IsIndexCut(WIRE_SIGNAL)
+ radio.listening = mended && !IsIndexCut(WIRE_SIGNAL)
if(WIRE_TRANSMIT)
- R.broadcasting = mended && !IsIndexCut(WIRE_SIGNAL)
+ radio.broadcasting = mended && !IsIndexCut(WIRE_SIGNAL)
SSnano.update_uis(holder)
\ No newline at end of file
diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm
index 8bbba0d8da59..2a5576b5fb9e 100644
--- a/code/datums/wires/robot.dm
+++ b/code/datums/wires/robot.dm
@@ -19,61 +19,59 @@ var/global/const/BORG_WIRE_CAMERA = 16
/datum/wires/robot/GetInteractWindow(mob/user)
. = ..()
- var/mob/living/silicon/robot/R = holder
+ var/mob/living/silicon/robot/robot = holder
var/datum/extension/network_device/camera/D = get_extension(holder, /datum/extension/network_device/)
- . += text("
\n[(R.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]")
- . += text("
\n[(R.connected_ai ? "The AI link light is on." : "The AI link light is off.")]")
+ . += text("
\n[(robot.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]")
+ . += text("
\n[(robot.connected_ai ? "The AI link light is on." : "The AI link light is off.")]")
. += text("
\n[(D.is_functional() ? "The Camera light is on." : "The Camera light is off.")]")
- . += text("
\n[(R.lockcharge ? "The lockdown light is on." : "The lockdown light is off.")]")
+ . += text("
\n[(robot.lockcharge ? "The lockdown light is on." : "The lockdown light is off.")]")
return .
/datum/wires/robot/UpdateCut(var/index, var/mended)
- var/mob/living/silicon/robot/R = holder
+ var/mob/living/silicon/robot/robot = holder
switch(index)
if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI
if(!mended)
- if (R.lawupdate == 1)
- to_chat(R, "LawSync protocol engaged.")
- R.show_laws()
+ if (robot.lawupdate == 1)
+ to_chat(robot, "LawSync protocol engaged.")
+ robot.show_laws()
else
- if (R.lawupdate == 0 && !R.emagged)
- R.lawupdate = 1
+ if (robot.lawupdate == 0 && !robot.emagged)
+ robot.lawupdate = 1
if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
if(!mended)
- R.disconnect_from_ai()
+ robot.disconnect_from_ai()
if (BORG_WIRE_CAMERA)
cameranet.update_visibility(src, FALSE)
if(BORG_WIRE_LOCKED_DOWN)
- R.SetLockdown(!mended)
+ robot.SetLockdown(!mended)
/datum/wires/robot/UpdatePulsed(var/index)
- var/mob/living/silicon/robot/R = holder
+ var/mob/living/silicon/robot/robot = holder
switch(index)
if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
- if(!R.emagged)
- var/mob/living/silicon/ai/new_ai = select_active_ai(R, get_z(R))
- R.connect_to_ai(new_ai)
+ if(!robot.emagged)
+ var/mob/living/silicon/ai/new_ai = select_active_ai(robot, get_z(robot))
+ robot.connect_to_ai(new_ai)
if (BORG_WIRE_CAMERA)
var/datum/extension/network_device/camera/robot/D = get_extension(src, /datum/extension/network_device)
if(D && D.is_functional())
- R.visible_message("[R]'s camera lens focuses loudly.")
- to_chat(R, "Your camera lense focuses loudly.")
+ robot.visible_message("[robot]'s camera lens focuses loudly.")
+ to_chat(robot, "Your camera lense focuses loudly.")
if(BORG_WIRE_LOCKED_DOWN)
- R.SetLockdown(!R.lockcharge) // Toggle
+ robot.SetLockdown(!robot.lockcharge) // Toggle
/datum/wires/robot/CanUse(var/mob/living/L)
- var/mob/living/silicon/robot/R = holder
- if(R.wiresexposed)
- return 1
- return 0
+ var/mob/living/silicon/robot/robot = holder
+ return robot.wiresexposed
/datum/wires/robot/proc/IsCameraCut()
return wires_status & BORG_WIRE_CAMERA
diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm
index 042a32f12ee8..130f060c8591 100644
--- a/code/game/antagonist/antagonist.dm
+++ b/code/game/antagonist/antagonist.dm
@@ -51,6 +51,7 @@
var/decl/language/required_language
// Used for setting appearance.
+ /// Species that are valid when changing appearance while spawning as this role. Null allows all species.
var/list/valid_species
var/min_player_age = 14
@@ -139,9 +140,6 @@
/decl/special_role/proc/get_leader_welcome_text(mob/recipient)
return leader_welcome_text
-/decl/special_role/proc/tick()
- return 1
-
// Get the raw list of potential players.
/decl/special_role/proc/build_candidate_list(decl/game_mode/mode, ghosts_only)
candidates = list() // Clear.
@@ -192,7 +190,7 @@
/decl/special_role/proc/attempt_random_spawn()
update_current_antag_max(SSticker.mode)
- build_candidate_list(SSticker.mode, flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB))
+ build_candidate_list(SSticker.mode, is_latejoin_template())
attempt_spawn()
finalize_spawn()
@@ -208,7 +206,7 @@
message_admins("Could not auto-spawn a [name], active antag limit reached.")
return 0
- build_candidate_list(SSticker.mode, flags & (ANTAG_OVERRIDE_MOB|ANTAG_OVERRIDE_JOB))
+ build_candidate_list(SSticker.mode, is_latejoin_template())
if(!candidates.len)
message_admins("Could not auto-spawn a [name], no candidates found.")
return 0
diff --git a/code/game/antagonist/antagonist_equip.dm b/code/game/antagonist/antagonist_equip.dm
index 358f49da1a4f..022bb8c57d09 100644
--- a/code/game/antagonist/antagonist_equip.dm
+++ b/code/game/antagonist/antagonist_equip.dm
@@ -12,7 +12,7 @@
// This could use work.
if(flags & ANTAG_CLEAR_EQUIPMENT)
for(var/obj/item/thing in player.contents)
- if(player.canUnEquip(thing))
+ if(player.can_unequip_item(thing))
qdel(thing)
//mainly for nonhuman antag compatibility. Should not effect item spawning.
player.species.equip_survival_gear(player)
diff --git a/code/game/antagonist/antagonist_factions.dm b/code/game/antagonist/antagonist_factions.dm
index 07e12dd921fb..079a4daeb571 100644
--- a/code/game/antagonist/antagonist_factions.dm
+++ b/code/game/antagonist/antagonist_factions.dm
@@ -18,7 +18,7 @@
to_chat(src, "\The [player.current] cannot be \a [faction.faction_name]!")
return
- if(world.time < player.rev_cooldown)
+ if(world.time < player.conversion_cooldown)
to_chat(src, "You must wait five seconds between attempts.")
return
@@ -26,7 +26,7 @@
log_admin("[src]([src.ckey]) attempted to convert [player.current] to the [faction.faction_name] faction.")
message_admins("[src]([src.ckey]) attempted to convert [player.current] to the [faction.faction_name] faction.")
- player.rev_cooldown = world.time + 5 SECONDS
+ player.conversion_cooldown = world.time + 5 SECONDS
if (!faction.is_antagonist(player))
var/choice = alert(player.current,"Asked by [src]: Do you want to join the [faction.faction_descriptor]?","Join the [faction.faction_descriptor]?","No!","Yes!")
if(!(player.current in able_mobs_in_oview(src)))
diff --git a/code/game/antagonist/antagonist_panel.dm b/code/game/antagonist/antagonist_panel.dm
index f16e898af98a..d34d47f6fe4d 100644
--- a/code/game/antagonist/antagonist_panel.dm
+++ b/code/game/antagonist/antagonist_panel.dm
@@ -17,7 +17,7 @@
/decl/special_role/proc/get_extra_panel_options()
return
-/decl/special_role/proc/get_check_antag_output(var/datum/admins/caller)
+/decl/special_role/proc/get_check_antag_output(var/datum/admins/calling_admin)
if(!current_antagonists || !current_antagonists.len)
return ""
@@ -33,7 +33,7 @@
if(M.stat == DEAD)
dat += " (DEAD)"
dat += ""
- dat += "\[PM\]\[SR\] | "
+ dat += "\[PM\]\[SR\] | "
else
dat += "Mob not found/([player.key])! | "
dat += ""
@@ -47,17 +47,17 @@
while(!isturf(disk_loc))
if(ismob(disk_loc))
var/mob/M = disk_loc
- dat += "carried by [M.real_name] "
+ dat += "carried by [M.real_name] "
if(istype(disk_loc, /obj))
var/obj/O = disk_loc
dat += "in \a [O.name] "
disk_loc = disk_loc.loc
dat += "in [disk_loc.loc] at ([disk_loc.x], [disk_loc.y], [disk_loc.z])"
dat += ""
- dat += get_additional_check_antag_output(caller)
+ dat += get_additional_check_antag_output(calling_admin)
dat += "
"
return dat
//Overridden elsewhere.
-/decl/special_role/proc/get_additional_check_antag_output(var/datum/admins/caller)
+/decl/special_role/proc/get_additional_check_antag_output(var/datum/admins/calling_admin)
return ""
diff --git a/code/game/antagonist/antagonist_place.dm b/code/game/antagonist/antagonist_place.dm
index 1a69b0a7f26f..a81a4cb0dfb4 100644
--- a/code/game/antagonist/antagonist_place.dm
+++ b/code/game/antagonist/antagonist_place.dm
@@ -1,7 +1,7 @@
/decl/special_role/proc/get_starting_locations()
if(landmark_id)
starting_locations = list()
- for(var/obj/abstract/landmark/L in global.landmarks_list)
+ for(var/obj/abstract/landmark/L in global.all_landmarks)
if(L.name == landmark_id)
starting_locations |= get_turf(L)
diff --git a/code/game/antagonist/antagonist_update.dm b/code/game/antagonist/antagonist_update.dm
index fcfd2c5fcdc2..4700d8b30018 100644
--- a/code/game/antagonist/antagonist_update.dm
+++ b/code/game/antagonist/antagonist_update.dm
@@ -3,10 +3,6 @@
leader = current_antagonists[1]
/decl/special_role/proc/update_antag_mob(var/datum/mind/player, var/preserve_appearance)
-
- if(!valid_species)
- valid_species = list(global.using_map.default_species)
-
// Get the mob.
if((flags & ANTAG_OVERRIDE_MOB) && (!player.current || (mob_path && !istype(player.current, mob_path))))
var/mob/holder = player.current
@@ -16,7 +12,7 @@
if(!preserve_appearance && (flags & ANTAG_SET_APPEARANCE))
spawn(3)
var/mob/living/human/H = player.current
- if(istype(H)) H.change_appearance(APPEARANCE_ALL, H.loc, H, valid_species, state = global.z_topic_state)
+ if(istype(H)) H.change_appearance(APPEARANCE_ALL, H.loc, H, species_whitelist = valid_species, state = global.z_topic_state)
return player.current
/decl/special_role/proc/update_access(var/mob/living/player)
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index b6e467b64dac..0beedbde9025 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -403,8 +403,8 @@ var/global/list/mob/living/forced_ambiance_list = new
if(LAZYLEN(forced_ambience) && !(L in forced_ambiance_list))
forced_ambiance_list += L
L.playsound_local(T,sound(pick(forced_ambience), repeat = 1, wait = 0, volume = 25, channel = sound_channels.lobby_channel))
- if(LAZYLEN(ambience) && prob(5) && (world.time >= L.client.played + 3 MINUTES))
- L.playsound_local(T, sound(pick(ambience), repeat = 0, wait = 0, volume = 15, channel = sound_channels.ambience_channel))
+ if(LAZYLEN(ambience) && prob(35) && (world.time >= L.client.played + 1.5 MINUTES))
+ L.playsound_local(T, sound(pick(ambience), repeat = 0, wait = 0, volume = 25, channel = sound_channels.ambience_channel))
L.client.played = world.time
/area/proc/clear_ambience(var/mob/living/L)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index fb3c08684708..d6d80c68478b 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -102,7 +102,7 @@
return null
/**
- Merge an exhaled air volume into air contents..
+ Merge an exhaled air volume into air contents.
*/
/atom/proc/merge_exhaled_volume(datum/gas_mixture/exhaled)
var/datum/gas_mixture/environment = return_air()
@@ -145,7 +145,7 @@
/atom/proc/try_on_reagent_change()
SHOULD_NOT_OVERRIDE(TRUE)
set waitfor = FALSE
- if(QDELETED(src) ||_reagent_update_started >= world.time)
+ if(QDELETED(src) || _reagent_update_started >= world.time)
return FALSE
_reagent_update_started = world.time
sleep(0) // Defer to end of tick so we don't drop subsequent reagent updates.
@@ -216,7 +216,8 @@
SHOULD_CALL_PARENT(TRUE)
if(density != new_density)
density = !!new_density
- RAISE_EVENT(/decl/observ/density_set, src, !density, density)
+ if(event_listeners?[/decl/observ/density_set])
+ raise_event_non_global(/decl/observ/density_set, !density, density)
/**
Handle a projectile `P` hitting this atom
@@ -284,11 +285,13 @@
*/
/atom/proc/examined_by(mob/user, distance, infix, suffix)
var/list/examine_lines
+ // to_chat(user, "") // these don't work in BYOND's native output panel. If we switch to browser output instead, you can readd this
for(var/add_lines in list(get_examine_header(user, distance, infix, suffix), get_examine_strings(user, distance, infix, suffix), get_examine_hints(user, distance, infix, suffix)))
if(islist(add_lines) && LAZYLEN(add_lines))
LAZYADD(examine_lines, add_lines)
if(LAZYLEN(examine_lines))
to_chat(user, jointext(examine_lines, "
"))
+ // to_chat(user, "
") // see above
RAISE_EVENT(/decl/observ/atom_examined, src, user, distance)
return TRUE
@@ -376,7 +379,8 @@
if(L.light_angle)
L.source_atom.update_light()
- RAISE_EVENT(/decl/observ/dir_set, src, old_dir, new_dir)
+ if(event_listeners?[/decl/observ/dir_set])
+ raise_event_non_global(/decl/observ/dir_set, old_dir, new_dir)
/// Set the icon to `new_icon`
@@ -398,18 +402,24 @@
/**
Update this atom's icon.
- If prior to the first SSicon_update flush (i.e. it's during init), icon updates are forced to queue instead.
- This saves a lot of init time.
- Events: `updated_icon`
*/
/atom/proc/update_icon()
SHOULD_CALL_PARENT(TRUE)
- if(SSicon_update.init_state == SS_INITSTATE_NONE)
- queue_icon_update()
- else
- on_update_icon()
- RAISE_EVENT(/decl/observ/updated_icon, src)
+ on_update_icon()
+ if(event_listeners?[/decl/observ/updated_icon])
+ raise_event_non_global(/decl/observ/updated_icon)
+
+/**
+ * Update this atom's icon.
+ * If prior to SSicon_update's first flush, queues.
+ * Otherwise, updates instantly.
+ */
+/atom/proc/lazy_update_icon()
+ if(SSicon_update.init_state != SS_INITSTATE_NONE)
+ return update_icon()
+ queue_icon_update()
/**
Update this atom's icon.
@@ -425,13 +435,13 @@
* Obj adds matter contents. Other overrides may add extra handling for things like material storage.
* Most useful for calculating worth or deconstructing something along with its contents.
*/
-/atom/proc/get_contained_matter()
- if(length(reagents?.reagent_volumes))
+/atom/proc/get_contained_matter(include_reagents = TRUE)
+ if(include_reagents && length(reagents?.reagent_volumes))
LAZYINITLIST(.)
- for(var/R in reagents.reagent_volumes)
- .[R] += floor(REAGENT_VOLUME(reagents, R) / REAGENT_UNITS_PER_MATERIAL_UNIT)
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ .[reagent.type] += floor(REAGENT_VOLUME(reagents, reagent) / REAGENT_UNITS_PER_MATERIAL_UNIT)
for(var/atom/contained_obj as anything in get_contained_external_atoms()) // machines handle component parts separately
- . = MERGE_ASSOCS_WITH_NUM_VALUES(., contained_obj.get_contained_matter())
+ . = MERGE_ASSOCS_WITH_NUM_VALUES(., contained_obj.get_contained_matter(include_reagents))
/// Return a list of all simulated atoms inside this one.
/atom/proc/get_contained_external_atoms()
@@ -485,9 +495,8 @@
*/
/atom/proc/try_detonate_reagents(var/severity = 3)
if(reagents)
- for(var/r_type in reagents.reagent_volumes)
- var/decl/material/R = GET_DECL(r_type)
- R.explosion_act(src, severity)
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ reagent.explosion_act(src, severity)
/**
Handle an explosion of `severity` affecting this atom
@@ -673,7 +682,7 @@
- Return: The result of the forceMove() at the end.
*/
/atom/movable/proc/dropInto(var/atom/destination)
- while(istype(destination))
+ while(!QDELETED(src) && istype(destination))
var/atom/drop_destination = destination.onDropInto(src)
if(!istype(drop_destination) || drop_destination == destination)
return forceMove(destination)
diff --git a/code/game/atoms_init.dm b/code/game/atoms_init.dm
index eb08297e2ab9..74a53a1d715c 100644
--- a/code/game/atoms_init.dm
+++ b/code/game/atoms_init.dm
@@ -89,10 +89,7 @@
updateVisibility(src)
if(atom_codex_ref && atom_codex_ref != TRUE) // may be null, TRUE or a datum instance
QDEL_NULL(atom_codex_ref)
- var/atom/oldloc = loc
. = ..()
- if(isatom(oldloc) && oldloc.storage && !QDELETED(loc.storage))
- oldloc.storage.on_item_post_deletion(src) // must be done after deletion
// This might need to be moved onto a Del() override at some point.
QDEL_NULL(storage)
@@ -135,6 +132,7 @@
. = ..()
+ var/atom/oldloc = loc
forceMove(null)
if(LAZYLEN(movement_handlers) && !ispath(movement_handlers[1]))
@@ -151,6 +149,10 @@
if(!QDELETED(mask))
qdel(mask)
+ // This has to be done for movables because atoms can't be in storage.
+ if(isatom(oldloc) && !QDELETED(oldloc?.storage))
+ oldloc.storage.on_item_post_deletion(src) // must be done after deletion
+
/atom/GetCloneArgs()
return list(loc)
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 73011d930265..0d998a4a5ec1 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -10,7 +10,8 @@
var/buckle_layer_above = FALSE
var/buckle_dir = 0
var/buckle_lying = -1 // bed-like behavior, forces mob to lie or stand if buckle_lying != -1
- var/buckle_pixel_shift // ex. @'{"x":0,"y":0,"z":0}' //where the buckled mob should be pixel shifted to, or null for no pixel shift control
+ /// A list or JSON-encoded list of pixel offsets to use on a mob buckled to this atom. TRUE to use this atom's pixel shifts, null for no pixel shift control.
+ var/buckle_pixel_shift // ex. @'{"x":0,"y":0,"z":0}'
var/buckle_require_restraints = 0 // require people to be cuffed before being able to buckle. eg: pipes
var/buckle_require_same_tile = FALSE
var/buckle_sound
@@ -22,7 +23,9 @@
// var/elevation = 2 - not used anywhere
var/move_speed = 10
var/l_move_time = 1
- var/m_flag = 1
+ var/const/FIRST_DIAGONAL_STEP = 1
+ var/const/SECOND_DIAGONAL_STEP = 2
+ var/moving_diagonally = FALSE // Used so we don't break grabs mid-diagonal-move.
var/datum/thrownthing/throwing
var/throw_speed = 2
var/throw_range = 7
@@ -61,20 +64,24 @@
SSspacedrift.processing[src] = src
return 1
-//return 0 to space drift, 1 to stop, -1 for mobs to handle space slips
+// return SPACE_MOVE_FORBIDDEN to space drift, SPACE_MOVE_PERMITTED to stop, SPACE_MOVE_SUPPORTED for mobs to handle space slips
+// Note that it may also return an instance of /atom/movable, which acts as SPACE_MOVE_SUPPORTED and results in pushing the movable backwards.
/atom/movable/proc/is_space_movement_permitted(allow_movement = FALSE)
if(!simulated)
return SPACE_MOVE_PERMITTED
if(has_gravity())
return SPACE_MOVE_PERMITTED
- if(length(grabbed_by))
- return SPACE_MOVE_PERMITTED
if(throwing)
return SPACE_MOVE_PERMITTED
if(anchored)
return SPACE_MOVE_PERMITTED
if(!isturf(loc))
return SPACE_MOVE_PERMITTED
+ if(length(grabbed_by))
+ for(var/obj/item/grab/grab as anything in grabbed_by)
+ if(grab.assailant == src)
+ continue
+ return SPACE_MOVE_PERMITTED
if(locate(/obj/structure/lattice) in range(1, get_turf(src))) //Not realistic but makes pushing things in space easier
return SPACE_MOVE_SUPPORTED
return SPACE_MOVE_FORBIDDEN
@@ -149,7 +156,7 @@
/atom/movable/proc/forceMove(atom/destination)
- if(QDELETED(src) && !QDESTROYING(src) && !isnull(destination))
+ if(QDELETED(src) && !isnull(destination))
CRASH("Attempted to forceMove a QDELETED [src] out of nullspace!!!")
if(loc == destination)
@@ -161,6 +168,7 @@
// Both the origin and destination are turfs with different areas.
// When either origin or destination is a turf and the other is not.
var/is_new_area = (is_origin_turf ^ is_destination_turf) || (is_origin_turf && is_destination_turf && loc.loc != destination.loc)
+ var/was_below_z_turf = MOVABLE_IS_BELOW_ZTURF(src)
var/atom/origin = loc
loc = destination
@@ -185,8 +193,8 @@
. = TRUE
// observ
- if(!loc)
- RAISE_EVENT(/decl/observ/moved, src, origin, null)
+ if(!loc && event_listeners?[/decl/observ/moved])
+ raise_event_non_global(/decl/observ/moved, origin, null)
// freelook
if(simulated && opacity)
@@ -202,6 +210,18 @@
L = thing
L.source_atom.update_light()
+ // Z-Mimic.
+ if (bound_overlay)
+ // The overlay will handle cleaning itself up on non-openspace turfs.
+ if (isturf(destination))
+ bound_overlay.forceMove(get_step(src, UP))
+ if (dir != bound_overlay.dir)
+ bound_overlay.set_dir(dir)
+ else // Not a turf, so we need to destroy immediately instead of waiting for the destruction timer to proc.
+ qdel(bound_overlay)
+ else if (isturf(loc) && (!origin || !was_below_z_turf) && MOVABLE_SHALL_MIMIC(src))
+ SSzcopy.discover_movable(src)
+
if(buckled_mob)
if(isturf(loc))
buckled_mob.glide_size = glide_size // Setting loc apparently does animate with glide size.
@@ -224,7 +244,7 @@
/atom/movable/Move(...)
var/old_loc = loc
-
+ var/was_below_z_turf = MOVABLE_IS_BELOW_ZTURF(src)
. = ..()
if(.)
@@ -237,8 +257,8 @@
else
unbuckle_mob()
- if(!loc)
- RAISE_EVENT(/decl/observ/moved, src, old_loc, null)
+ if(!loc && event_listeners?[/decl/observ/moved])
+ raise_event_non_global(/decl/observ/moved, old_loc, null)
// freelook
if(simulated && opacity)
@@ -260,7 +280,7 @@
bound_overlay.forceMove(get_step(src, UP))
if (bound_overlay.dir != dir)
bound_overlay.set_dir(dir)
- else if (isturf(loc) && (!old_loc || !TURF_IS_MIMICKING(old_loc)) && MOVABLE_SHALL_MIMIC(src))
+ else if (isturf(loc) && (!old_loc || !was_below_z_turf) && MOVABLE_SHALL_MIMIC(src))
SSzcopy.discover_movable(src)
if(isturf(loc))
@@ -603,3 +623,8 @@
return TRUE
return FALSE
+/atom/movable/proc/get_cryogenic_power()
+ return 0
+
+/atom/movable/proc/is_valid_merchant_pad_target()
+ return simulated
diff --git a/code/game/atoms_movable_overlay.dm b/code/game/atoms_movable_overlay.dm
index c6beb4d1becd..9f290edc35f7 100644
--- a/code/game/atoms_movable_overlay.dm
+++ b/code/game/atoms_movable_overlay.dm
@@ -39,9 +39,9 @@
master = null
. = ..()
-/atom/movable/overlay/attackby(obj/item/I, mob/user)
+/atom/movable/overlay/attackby(obj/item/used_item, mob/user)
if (master)
- return master.attackby(I, user)
+ return master.attackby(used_item, user)
return TRUE
/atom/movable/overlay/attack_hand(mob/user)
diff --git a/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm b/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm
index 77f579113835..634ee0779fb6 100644
--- a/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm
+++ b/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm
@@ -53,14 +53,14 @@
if(M.client)
to_chat(M,"You feel oddly light, and somewhat disoriented as everything around you shimmers and warps ever so slightly.")
M.overlay_fullscreen("wormhole", /obj/screen/fullscreen/wormhole_overlay)
- M.set_status(STAT_CONFUSE, 20)
+ M.set_status_condition(STAT_CONFUSE, 20)
bluegoasts += new/obj/effect/bluegoast/(get_turf(M),M)
/datum/universal_state/jump/proc/clear_duplicated(var/mob/living/M)
if(M.client)
to_chat(M,"You feel rooted in material world again.")
M.clear_fullscreen("wormhole")
- M.set_status(STAT_CONFUSE, 0)
+ M.set_status_condition(STAT_CONFUSE, 0)
for(var/mob/goast in global.ghost_mob_list)
goast.mouse_opacity = initial(goast.mouse_opacity)
goast.set_invisibility(initial(goast.invisibility))
@@ -121,7 +121,7 @@
/obj/effect/bluegoast/proc/blueswitch()
var/mob/living/human/H
if(ishuman(daddy))
- H = new(get_turf(src), daddy.species.name, daddy.get_mob_snapshot(), daddy.get_bodytype())
+ H = new(get_turf(src), daddy.species.uid, daddy.get_mob_snapshot(), daddy.get_bodytype())
for(var/obj/item/entry in daddy.get_equipped_items(TRUE))
daddy.remove_from_mob(entry) //steals instead of copies so we don't end up with duplicates
H.equip_to_appropriate_slot(entry)
diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm
index 014baac33a14..20cd9d5a395b 100644
--- a/code/game/jobs/access.dm
+++ b/code/game/jobs/access.dm
@@ -58,19 +58,19 @@
/atom/movable/proc/check_access(atom/movable/A)
return check_access_list(A ? A.GetAccess() : list())
-/atom/movable/proc/check_access_list(list/L)
- var/list/R = get_req_access()
+/atom/movable/proc/check_access_list(list/supplied_access)
+ var/list/required_access = get_req_access()
- if(!R)
- R = list()
- if(!istype(L, /list))
+ if(!required_access)
+ required_access = list()
+ if(!istype(supplied_access, /list))
return FALSE
if(maint_all_access)
- L = L.Copy()
- L |= access_maint_tunnels
+ supplied_access = supplied_access.Copy()
+ supplied_access |= access_maint_tunnels
- return has_access(R, L)
+ return has_access(required_access, supplied_access)
/proc/has_access(list/req_access, list/accesses)
for(var/req in req_access)
@@ -143,11 +143,10 @@ var/global/list/datum/access/priv_all_access_datums_region
return priv_all_access_datums_region.Copy()
/proc/get_access_ids(var/access_types = ACCESS_TYPE_ALL)
- var/list/L = new()
+ . = list()
for(var/datum/access/A in get_all_access_datums())
if(A.access_type & access_types)
- L += A.id
- return L
+ . += A.id
var/global/list/priv_all_access
/proc/get_all_accesses()
diff --git a/code/game/jobs/job/_job.dm b/code/game/jobs/job/_job.dm
index 06e985a8772d..eb27bd7793e3 100644
--- a/code/game/jobs/job/_job.dm
+++ b/code/game/jobs/job/_job.dm
@@ -173,8 +173,8 @@
remembered_info += "Your account pin is: [account.remote_access_pin]
"
remembered_info += "Your account funds are: [account.format_value_by_currency(account.money)]
"
if(account.transaction_log.len)
- var/datum/transaction/T = account.transaction_log[1]
- remembered_info += "Your account was created: [T.time], [T.date] at [T.get_source_name()]
"
+ var/datum/transaction/transaction = account.transaction_log[1]
+ remembered_info += "Your account was created: [transaction.time], [transaction.date] at [transaction.get_source_name()]
"
if(cash_on_hand > 0)
var/decl/currency/cur = GET_DECL(global.using_map.default_currency)
remembered_info += "Your cash on hand is: [cur.format_value(cash_on_hand)]
"
@@ -235,13 +235,13 @@
to_chat(feedback, "Wrong rank for [title]. Valid ranks in [prefs.branches[title]] are: [get_ranks(prefs.branches[title])].")
return TRUE
- var/decl/species/S = get_species_by_key(prefs.species)
+ var/decl/species/S = prefs.get_species_decl()
if(!is_species_allowed(S))
to_chat(feedback, "Restricted species, [S], for [title].")
return TRUE
- if(LAZYACCESS(minimum_character_age, S.get_root_species_name()) && (prefs.get_character_age() < minimum_character_age[S.get_root_species_name()]))
- to_chat(feedback, "Not old enough. Minimum character age is [minimum_character_age[S.get_root_species_name()]].")
+ if(LAZYACCESS(minimum_character_age, S.uid) && (prefs.get_character_age() < minimum_character_age[S.uid]))
+ to_chat(feedback, "Not old enough. Minimum character age is [minimum_character_age[S.uid]].")
return TRUE
if(!S.check_background(src, prefs))
@@ -255,9 +255,9 @@
return FALSE
-/datum/job/proc/get_join_link(var/client/caller, var/href_string, var/show_invalid_jobs)
- if(is_available(caller))
- if(is_restricted(caller.prefs))
+/datum/job/proc/get_join_link(var/client/calling_client, var/href_string, var/show_invalid_jobs)
+ if(is_available(calling_client))
+ if(is_restricted(calling_client.prefs))
if(show_invalid_jobs)
return "| [title] | [current_positions] | Active: [get_active_count()] |
"
else
@@ -356,22 +356,21 @@
//Returns human-readable list of branches this job allows.
/datum/job/proc/get_branches()
- var/list/res = list()
- for(var/T in allowed_branches)
- var/datum/mil_branch/B = mil_branches.get_branch_by_type(T)
- res += B.name
- return english_list(res)
+ . = list()
+ for(var/branch in allowed_branches)
+ var/datum/mil_branch/branch_datum = mil_branches.get_branch_by_type(branch)
+ . += branch_datum.name
+ return english_list(.)
//Same as above but ranks
/datum/job/proc/get_ranks(branch)
- var/list/res = list()
- var/datum/mil_branch/B = mil_branches.get_branch(branch)
- for(var/T in allowed_ranks)
- var/datum/mil_rank/R = T
- if(B && !(initial(R.name) in B.ranks))
+ . = list()
+ var/datum/mil_branch/branch_datum = mil_branches.get_branch(branch)
+ for(var/datum/mil_rank/rank as anything in allowed_ranks)
+ if(branch_datum && !(initial(rank.name) in branch_datum.ranks))
continue
- res |= initial(R.name)
- return english_list(res)
+ . |= initial(rank.name)
+ return english_list(.)
/datum/job/proc/get_description_blurb()
return description
@@ -380,17 +379,17 @@
if(!SSjobs.job_icons[title])
var/mob/living/human/dummy/mannequin/mannequin = get_mannequin("#job_icon")
if(mannequin)
- var/decl/species/mannequin_species = get_species_by_key(global.using_map.default_species)
+ var/decl/species/mannequin_species = decls_repository.get_decl_by_id(global.using_map.default_species)
if(!is_species_allowed(mannequin_species))
// Don't just default to the first species allowed, pick one at random.
for(var/other_species in shuffle(get_playable_species()))
- var/decl/species/other_species_decl = get_species_by_key(other_species)
+ var/decl/species/other_species_decl = decls_repository.get_decl_by_id(other_species)
if(is_species_allowed(other_species_decl))
mannequin_species = other_species_decl
break
if(!is_species_allowed(mannequin_species))
PRINT_STACK_TRACE("No allowed species allowed for job [title] ([type]), falling back to default!")
- mannequin.change_species(mannequin_species.name)
+ mannequin.change_species(mannequin_species.uid)
dress_mannequin(mannequin)
mannequin.set_dir(SOUTH)
var/icon/preview_icon = getFlatIcon(mannequin)
@@ -398,27 +397,27 @@
SSjobs.job_icons[title] = preview_icon
return SSjobs.job_icons[title]
-/datum/job/proc/get_unavailable_reasons(var/client/caller)
+/datum/job/proc/get_unavailable_reasons(var/client/calling_client)
var/list/reasons = list()
- if(jobban_isbanned(caller, title))
+ if(jobban_isbanned(calling_client, title))
reasons["You are jobbanned."] = TRUE
- if(is_semi_antagonist && jobban_isbanned(caller, /decl/special_role/provocateur))
+ if(is_semi_antagonist && jobban_isbanned(calling_client, /decl/special_role/provocateur))
reasons["You are semi-antagonist banned."] = TRUE
- if(!player_old_enough(caller))
+ if(!player_old_enough(calling_client))
reasons["Your player age is too low."] = TRUE
if(!is_position_available())
reasons["There are no positions left."] = TRUE
- if(!isnull(allowed_branches) && (!caller.prefs.branches[title] || !is_branch_allowed(caller.prefs.branches[title])))
+ if(!isnull(allowed_branches) && (!calling_client.prefs.branches[title] || !is_branch_allowed(calling_client.prefs.branches[title])))
reasons["Your branch of service does not allow it."] = TRUE
- else if(!isnull(allowed_ranks) && (!caller.prefs.ranks[title] || !is_rank_allowed(caller.prefs.branches[title], caller.prefs.ranks[title])))
+ else if(!isnull(allowed_ranks) && (!calling_client.prefs.ranks[title] || !is_rank_allowed(calling_client.prefs.branches[title], calling_client.prefs.ranks[title])))
reasons["Your rank choice does not allow it."] = TRUE
- var/decl/species/S = get_species_by_key(caller.prefs.species)
+ var/decl/species/S = calling_client.prefs.get_species_decl()
if(S)
if(!is_species_allowed(S))
reasons["Your species choice does not allow it."] = TRUE
- if(!S.check_background(src, caller.prefs))
+ if(!S.check_background(src, calling_client.prefs))
reasons["Your background choices do not allow it."] = TRUE
- var/special_blocker = check_special_blockers(caller.prefs)
+ var/special_blocker = check_special_blockers(calling_client.prefs)
if(special_blocker)
reasons["Your preferences do not allow it: '[special_blocker]'."] = TRUE
return TRUE
@@ -430,14 +429,14 @@
mannequin.delete_inventory(TRUE)
equip_preview(mannequin, additional_skips = OUTFIT_ADJUSTMENT_SKIP_BACKPACK)
-/datum/job/proc/is_available(var/client/caller)
+/datum/job/proc/is_available(var/client/calling_client)
if(!is_position_available())
return FALSE
- if(jobban_isbanned(caller, title))
+ if(jobban_isbanned(calling_client, title))
return FALSE
- if(is_semi_antagonist && jobban_isbanned(caller, /decl/special_role/provocateur))
+ if(is_semi_antagonist && jobban_isbanned(calling_client, /decl/special_role/provocateur))
return FALSE
- if(!player_old_enough(caller))
+ if(!player_old_enough(calling_client))
return FALSE
return TRUE
@@ -446,7 +445,7 @@
/datum/job/proc/get_roundstart_spawnpoint()
var/list/loc_list = list()
- for(var/obj/abstract/landmark/start/sloc in global.landmarks_list)
+ for(var/obj/abstract/landmark/start/sloc in global.all_landmarks)
if(sloc.name != title) continue
if(locate(/mob/living) in sloc.loc) continue
loc_list += sloc
diff --git a/code/game/jobs/server_whitelist.dm b/code/game/jobs/server_whitelist.dm
index 9c8b84f46b57..da26aaeea7cf 100644
--- a/code/game/jobs/server_whitelist.dm
+++ b/code/game/jobs/server_whitelist.dm
@@ -63,8 +63,8 @@ var/global/list/alien_whitelist = list()
alien_whitelist[row["ckey"]] = list(row["race"])
return TRUE
-/proc/is_species_whitelisted(mob/M, var/species_name)
- var/decl/species/S = get_species_by_key(species_name)
+/proc/is_species_whitelisted(mob/M, var/species_uid)
+ var/decl/species/S = decls_repository.get_decl_by_id(species_uid)
return is_alien_whitelisted(M, S)
/proc/is_alien_whitelisted(mob/M, var/species)
@@ -95,7 +95,7 @@ var/global/list/alien_whitelist = list()
return FALSE
if(!get_config_value(/decl/config/toggle/use_alien_whitelist) || !(S.spawn_flags & SPECIES_IS_WHITELISTED))
return TRUE
- return whitelist_lookup(S.get_root_species_name(M), M.ckey)
+ return whitelist_lookup(S.uid, M.ckey) || whitelist_lookup(S.name, M.ckey)
// Check for arbitrary text whitelisting.
return istext(species) ? whitelist_lookup(species, M.ckey) : FALSE
diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm
index e9da96a9a367..ee1ee91f4aa3 100644
--- a/code/game/machinery/CableLayer.dm
+++ b/code/game/machinery/CableLayer.dm
@@ -26,17 +26,17 @@
user.visible_message("\The [user] [!on?"dea":"a"]ctivates \the [src].", "You switch [src] [on? "on" : "off"]")
return TRUE
-/obj/machinery/cablelayer/attackby(var/obj/item/O, var/mob/user)
- if(istype(O, /obj/item/stack/cable_coil))
+/obj/machinery/cablelayer/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/stack/cable_coil))
- var/result = load_cable(O)
+ var/result = load_cable(used_item)
if(!result)
to_chat(user, "\The [src]'s cable reel is full.")
else
to_chat(user, "You load [result] lengths of cable into [src].")
return TRUE
- if(IS_WIRECUTTER(O))
+ if(IS_WIRECUTTER(used_item))
if(cable && cable.amount)
var/m = round(input(user,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1)
m = min(m, cable.amount)
diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm
index 37f33f20daca..435834976bc0 100644
--- a/code/game/machinery/OpTable.dm
+++ b/code/game/machinery/OpTable.dm
@@ -10,7 +10,6 @@
active_power_usage = 5
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
- stat_immune = 0
var/suppressing = FALSE
var/mob/living/victim
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 24e826c1739b..dc25d0685b56 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -42,6 +42,9 @@
add_reagent_canister(null, new /obj/item/chems/chem_disp_cartridge/antitoxins())
add_reagent_canister(null, new /obj/item/chems/chem_disp_cartridge/oxy_meds())
+/obj/machinery/sleeper/get_cryogenic_power()
+ return stasis
+
/obj/machinery/sleeper/Destroy()
QDEL_NULL(beaker)
QDEL_NULL_LIST(loaded_canisters)
@@ -56,8 +59,7 @@
to_chat(user, SPAN_WARNING("\The [src] cannot accept any more chemical canisters."))
return FALSE
if(!emagged)
- for(var/rid in canister.reagents?.reagent_volumes)
- var/decl/material/reagent = GET_DECL(rid)
+ for(var/decl/material/reagent as anything in canister.reagents?.reagent_volumes)
for(var/banned_type in banned_chem_types)
if(istype(reagent, banned_type))
to_chat(user, SPAN_WARNING("Automatic safety checking indicates the presence of a prohibited substance in this canister."))
@@ -94,11 +96,11 @@
LAZYREMOVE(., loaded_canisters)
LAZYREMOVE(., beaker)
-/obj/machinery/sleeper/get_contained_matter()
+/obj/machinery/sleeper/get_contained_matter(include_reagents = TRUE)
. = ..()
- . = MERGE_ASSOCS_WITH_NUM_VALUES(., beaker.get_contained_matter())
+ . = MERGE_ASSOCS_WITH_NUM_VALUES(., beaker.get_contained_matter(include_reagents))
for(var/obj/canister in loaded_canisters)
- . = MERGE_ASSOCS_WITH_NUM_VALUES(., canister.get_contained_matter())
+ . = MERGE_ASSOCS_WITH_NUM_VALUES(., canister.get_contained_matter(include_reagents))
/obj/machinery/sleeper/Initialize(mapload, d = 0, populate_parts = TRUE)
. = ..()
@@ -168,7 +170,7 @@
toggle_lavage()
if(isliving(occupant) && stasis > 1)
- occupant.set_stasis(stasis)
+ occupant.add_mob_modifier(/decl/mob_modifier/stasis, 2 SECONDS, source = src)
/obj/machinery/sleeper/on_update_icon()
cut_overlays()
@@ -300,17 +302,17 @@
updateUsrDialog()
go_out()
-/obj/machinery/sleeper/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/chems/chem_disp_cartridge))
- add_reagent_canister(user, I)
+/obj/machinery/sleeper/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/chems/chem_disp_cartridge))
+ add_reagent_canister(user, used_item)
return TRUE
- if(istype(I, /obj/item/chems/glass))
+ if(istype(used_item, /obj/item/chems/glass))
add_fingerprint(user)
if(!beaker)
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- beaker = I
- user.visible_message(SPAN_NOTICE("\The [user] adds \a [I] to \the [src]."), SPAN_NOTICE("You add \a [I] to \the [src]."))
+ beaker = used_item
+ user.visible_message(SPAN_NOTICE("\The [user] adds \a [used_item] to \the [src]."), SPAN_NOTICE("You add \a [used_item] to \the [src]."))
else
to_chat(user, SPAN_WARNING("\The [src] has a beaker already."))
return TRUE
@@ -440,7 +442,7 @@
to_chat(user, SPAN_WARNING("There's no suitable occupant in \the [src]."))
return
if(!emagged && canister.reagents?.primary_reagent)
- var/decl/material/chem = GET_DECL(canister.reagents.primary_reagent)
+ var/decl/material/chem = canister.reagents.primary_reagent
if(chem.overdose && REAGENT_VOLUME(occupant.reagents, canister.reagents.primary_reagent) + amount >= chem.overdose)
to_chat(user, SPAN_WARNING("Injecting more [chem.name] presents an overdose risk to the subject."))
return
diff --git a/code/game/machinery/_machines_base/machine_construction/_construction.dm b/code/game/machinery/_machines_base/machine_construction/_construction.dm
index fa819a58c1a6..8ae207901bbc 100644
--- a/code/game/machinery/_machines_base/machine_construction/_construction.dm
+++ b/code/game/machinery/_machines_base/machine_construction/_construction.dm
@@ -85,10 +85,10 @@
PRINT_STACK_TRACE("Machine [log_info_line(machine)] violated the state assumptions of the construction state [type]!")
machine.attack_hand(user)
-/decl/machine_construction/proc/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/proc/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if(!validate_state(machine))
PRINT_STACK_TRACE("Machine [log_info_line(machine)] violated the state assumptions of the construction state [type]!")
- return machine.attackby(I, user)
+ return machine.attackby(used_item, user)
return FALSE
/decl/machine_construction/proc/mechanics_info()
diff --git a/code/game/machinery/_machines_base/machine_construction/airlock.dm b/code/game/machinery/_machines_base/machine_construction/airlock.dm
index 27f29d03070d..48de7420a1b7 100644
--- a/code/game/machinery/_machines_base/machine_construction/airlock.dm
+++ b/code/game/machinery/_machines_base/machine_construction/airlock.dm
@@ -3,22 +3,44 @@
down_state = /decl/machine_construction/default/panel_open/door
var/hacking_state = /decl/machine_construction/default/panel_closed/door/hacking
-/decl/machine_construction/default/panel_closed/door/attackby(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_SCREWDRIVER(I))
+/decl/machine_construction/default/panel_closed/door/fail_test_state_transfer(obj/machinery/machine, mob/user)
+ var/static/obj/item/screwdriver/screwdriver = new
+ // Prevent access locks on doors from interfering with our interactions.
+ for(var/obj/item/stock_parts/access_lock/lock in machine.get_all_components_of_type(/obj/item/stock_parts/access_lock))
+ lock.locked = FALSE
+ // Test hacking state
+ if(!machine.attackby(screwdriver, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with screwdriver."
+ if(machine.construct_state.type != hacking_state)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [hacking_state])."
+ // Do it again to reverse that state change.
+ if(!machine.attackby(screwdriver, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with screwdriver on a second try."
+ if(machine.construct_state != src)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [type])."
+ // Now test the down state
+ var/static/obj/item/wrench/wrench = new
+ if(!machine.attackby(wrench, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with wrench."
+ if(machine.construct_state.type != down_state)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [down_state])."
+
+/decl/machine_construction/default/panel_closed/door/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_SCREWDRIVER(used_item))
TRANSFER_STATE(hacking_state)
playsound(get_turf(machine), 'sound/items/Screwdriver.ogg', 50, 1)
to_chat(user, SPAN_NOTICE("You release some of the logic wiring on \the [machine]. The cover panel remains closed."))
machine.update_icon()
return TRUE
- if(IS_WRENCH(I))
+ if(IS_WRENCH(used_item))
TRANSFER_STATE(down_state)
playsound(get_turf(machine), 'sound/items/Crowbar.ogg', 50, 1)
machine.panel_open = TRUE
to_chat(user, SPAN_NOTICE("You open the main cover panel on \the [machine], exposing the internals."))
machine.queue_icon_update()
return TRUE
- if(istype(I, /obj/item/part_replacer))
- var/obj/item/part_replacer/replacer = I
+ if(istype(used_item, /obj/item/part_replacer))
+ var/obj/item/part_replacer/replacer = used_item
if(replacer.remote_interaction)
machine.part_replacement(user, replacer)
for(var/line in machine.get_part_info_strings(user))
@@ -35,8 +57,8 @@
/decl/machine_construction/default/panel_closed/door/hacking
up_state = /decl/machine_construction/default/panel_closed/door
-/decl/machine_construction/default/panel_closed/door/hacking/attackby(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_SCREWDRIVER(I))
+/decl/machine_construction/default/panel_closed/door/hacking/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_SCREWDRIVER(used_item))
TRANSFER_STATE(up_state)
playsound(get_turf(machine), 'sound/items/Screwdriver.ogg', 50, 1)
to_chat(user, SPAN_NOTICE("You tuck the exposed wiring back into \the [machine] and screw the hatch back into place."))
diff --git a/code/game/machinery/_machines_base/machine_construction/computer.dm b/code/game/machinery/_machines_base/machine_construction/computer.dm
index 684f0f4b8c18..797f16ad1ef2 100644
--- a/code/game/machinery/_machines_base/machine_construction/computer.dm
+++ b/code/game/machinery/_machines_base/machine_construction/computer.dm
@@ -4,7 +4,7 @@
down_state = /decl/machine_construction/default/panel_open/computer
needs_board = "computer"
-/decl/machine_construction/default/panel_closed/computer/no_deconstruct/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/default/panel_closed/computer/no_deconstruct/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
return FALSE
/decl/machine_construction/default/panel_open/computer
diff --git a/code/game/machinery/_machines_base/machine_construction/default.dm b/code/game/machinery/_machines_base/machine_construction/default.dm
index 928954909b4e..d573df31e478 100644
--- a/code/game/machinery/_machines_base/machine_construction/default.dm
+++ b/code/game/machinery/_machines_base/machine_construction/default.dm
@@ -5,7 +5,7 @@
var/up_state
var/down_state
-/decl/machine_construction/default/no_deconstruct/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/default/no_deconstruct/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
. = FALSE
/decl/machine_construction/default/panel_closed
@@ -13,6 +13,22 @@
visible_components = FALSE
locked = TRUE
+/decl/machine_construction/default/panel_closed/fail_unit_test(obj/machinery/machine)
+ if((. = ..()))
+ return
+ var/static/mob/living/human/user = new
+ return fail_test_state_transfer(machine, user)
+
+/decl/machine_construction/default/panel_closed/proc/fail_test_state_transfer(obj/machinery/machine, mob/user)
+ var/static/obj/item/screwdriver/screwdriver = new
+ // Prevent access locks on machines interfering with our interactions.
+ for(var/obj/item/stock_parts/access_lock/lock in machine.get_all_components_of_type(/obj/item/stock_parts/access_lock))
+ lock.locked = FALSE
+ if(!machine.attackby(screwdriver, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with screwdriver."
+ if(machine.construct_state.type != down_state)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [down_state])."
+
/decl/machine_construction/default/panel_closed/state_is_valid(obj/machinery/machine)
return !machine.panel_open
@@ -21,18 +37,18 @@
if(!.)
try_change_state(machine, down_state)
-/decl/machine_construction/default/panel_closed/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/default/panel_closed/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if((. = ..()))
return
- if(IS_SCREWDRIVER(I))
+ if(IS_SCREWDRIVER(used_item))
TRANSFER_STATE(down_state)
playsound(get_turf(machine), 'sound/items/Screwdriver.ogg', 50, 1)
machine.panel_open = TRUE
to_chat(user, SPAN_NOTICE("You open the maintenance hatch of \the [machine]."))
machine.update_icon()
return TRUE
- if(istype(I, /obj/item/part_replacer))
- var/obj/item/part_replacer/replacer = I
+ if(istype(used_item, /obj/item/part_replacer))
+ var/obj/item/part_replacer/replacer = used_item
if(replacer.remote_interaction)
machine.part_replacement(user, replacer)
for(var/line in machine.get_part_info_strings(user))
@@ -62,28 +78,28 @@
if(!.)
try_change_state(machine, up_state)
-/decl/machine_construction/default/panel_open/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/default/panel_open/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if((. = ..()))
return
- if(IS_CROWBAR(I))
+ if(IS_CROWBAR(used_item))
TRANSFER_STATE(down_state)
playsound(get_turf(machine), 'sound/items/Crowbar.ogg', 50, 1)
machine.visible_message(SPAN_NOTICE("\The [user] deconstructs \the [machine]."))
machine.dismantle()
return
- if(IS_SCREWDRIVER(I))
+ if(IS_SCREWDRIVER(used_item))
TRANSFER_STATE(up_state)
playsound(get_turf(machine), 'sound/items/Screwdriver.ogg', 50, 1)
machine.panel_open = FALSE
to_chat(user, SPAN_NOTICE("You close the maintenance hatch of \the [machine]."))
machine.update_icon()
return TRUE
- if(istype(I, /obj/item/part_replacer))
- return machine.part_replacement(user, I)
- if(IS_WRENCH(I))
+ if(istype(used_item, /obj/item/part_replacer))
+ return machine.part_replacement(user, used_item)
+ if(IS_WRENCH(used_item))
return machine.part_removal(user)
- if(istype(I))
- return machine.part_insertion(user, I)
+ if(istype(used_item))
+ return machine.part_insertion(user, used_item)
return FALSE
/decl/machine_construction/default/panel_open/mechanics_info()
diff --git a/code/game/machinery/_machines_base/machine_construction/frame.dm b/code/game/machinery/_machines_base/machine_construction/frame.dm
index 1913c959fbed..5eeb7883bc92 100644
--- a/code/game/machinery/_machines_base/machine_construction/frame.dm
+++ b/code/game/machinery/_machines_base/machine_construction/frame.dm
@@ -11,21 +11,21 @@
else
try_change_state(machine, /decl/machine_construction/frame/wrenched)
-/decl/machine_construction/frame/unwrenched/attackby(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_WRENCH(I))
+/decl/machine_construction/frame/unwrenched/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_WRENCH(used_item))
playsound(machine.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20, machine))
TRANSFER_STATE(/decl/machine_construction/frame/wrenched)
to_chat(user, "You wrench \the [machine] into place.")
machine.anchored = TRUE
- if(IS_WELDER(I))
- var/obj/item/weldingtool/WT = I
- if(!WT.weld(0, user))
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.weld(0, user))
to_chat(user, "The welding tool must be on to complete this task.")
return TRUE
playsound(machine.loc, 'sound/items/Welder.ogg', 50, 1)
if(do_after(user, 20, machine))
- if(!WT.isOn())
+ if(!welder.isOn())
return TRUE
TRANSFER_STATE(/decl/machine_construction/default/deconstructed)
to_chat(user, "You deconstruct \the [machine].")
@@ -48,16 +48,16 @@
else
try_change_state(machine, /decl/machine_construction/frame/unwrenched)
-/decl/machine_construction/frame/wrenched/attackby(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_WRENCH(I))
+/decl/machine_construction/frame/wrenched/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_WRENCH(used_item))
playsound(machine.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 20, machine))
TRANSFER_STATE(/decl/machine_construction/frame/unwrenched)
to_chat(user, "You unfasten \the [machine].")
machine.anchored = FALSE
return TRUE
- if(IS_COIL(I))
- var/obj/item/stack/cable_coil/C = I
+ if(IS_COIL(used_item))
+ var/obj/item/stack/cable_coil/C = used_item
if(C.get_amount() < 5)
to_chat(user, "You need five lengths of cable to add them to \the [machine].")
return TRUE
@@ -85,20 +85,20 @@
else
try_change_state(machine, /decl/machine_construction/frame/unwrenched)
-/decl/machine_construction/frame/awaiting_circuit/attackby(obj/item/I, mob/user, obj/machinery/constructable_frame/machine)
- if(istype(I, /obj/item/stock_parts/circuitboard))
- var/obj/item/stock_parts/circuitboard/circuit = I
+/decl/machine_construction/frame/awaiting_circuit/attackby(obj/item/used_item, mob/user, obj/machinery/constructable_frame/machine)
+ if(istype(used_item, /obj/item/stock_parts/circuitboard))
+ var/obj/item/stock_parts/circuitboard/circuit = used_item
if(circuit.board_type == machine.expected_machine_type)
- if(user.canUnEquip(I))
+ if(user.can_unequip_item(used_item))
TRANSFER_STATE(/decl/machine_construction/frame/awaiting_parts)
- user.try_unequip(I, machine)
+ user.try_unequip(used_item, machine)
playsound(machine.loc, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, "You add the circuit board to \the [machine].")
- machine.circuit = I
+ machine.circuit = used_item
else
to_chat(user, "This frame does not accept circuit boards of this type!")
return TRUE
- if(IS_WIRECUTTER(I))
+ if(IS_WIRECUTTER(used_item))
TRANSFER_STATE(/decl/machine_construction/frame/wrenched)
playsound(machine.loc, 'sound/items/Wirecutter.ogg', 50, 1)
to_chat(user, "You remove the cables.")
@@ -122,15 +122,15 @@
else
try_change_state(machine, /decl/machine_construction/frame/unwrenched)
-/decl/machine_construction/frame/awaiting_parts/attackby(obj/item/I, mob/user, obj/machinery/constructable_frame/machine)
- if(IS_CROWBAR(I))
+/decl/machine_construction/frame/awaiting_parts/attackby(obj/item/used_item, mob/user, obj/machinery/constructable_frame/machine)
+ if(IS_CROWBAR(used_item))
TRANSFER_STATE(/decl/machine_construction/frame/awaiting_circuit)
playsound(machine.loc, 'sound/items/Crowbar.ogg', 50, 1)
machine.circuit.dropInto(machine.loc)
machine.circuit = null
to_chat(user, "You remove the circuit board.")
return TRUE
- if(IS_SCREWDRIVER(I))
+ if(IS_SCREWDRIVER(used_item))
playsound(machine.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/machinery/new_machine = new machine.circuit.build_path(machine.loc, machine.dir, FALSE)
machine.circuit.construct(new_machine)
diff --git a/code/game/machinery/_machines_base/machine_construction/item_chassis.dm b/code/game/machinery/_machines_base/machine_construction/item_chassis.dm
index 234319a1bca2..e97190d5d71a 100644
--- a/code/game/machinery/_machines_base/machine_construction/item_chassis.dm
+++ b/code/game/machinery/_machines_base/machine_construction/item_chassis.dm
@@ -5,8 +5,8 @@
down_state = /decl/machine_construction/default/panel_open/item_chassis
-/decl/machine_construction/default/panel_closed/item_chassis/attackby(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_WRENCH(I))
+/decl/machine_construction/default/panel_closed/item_chassis/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_WRENCH(used_item))
TRANSFER_STATE(/decl/machine_construction/default/deconstructed)
playsound(get_turf(machine), 'sound/items/Ratchet.ogg', 50, 1)
machine.visible_message(SPAN_NOTICE("\The [user] deconstructs \the [machine]."))
diff --git a/code/game/machinery/_machines_base/machine_construction/pipe.dm b/code/game/machinery/_machines_base/machine_construction/pipe.dm
index 4667327dd0e0..010428a50e47 100644
--- a/code/game/machinery/_machines_base/machine_construction/pipe.dm
+++ b/code/game/machinery/_machines_base/machine_construction/pipe.dm
@@ -6,29 +6,29 @@
/decl/machine_construction/pipe/state_is_valid(obj/machinery/machine)
return TRUE
-/decl/machine_construction/pipe/proc/deconstruct_transition(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_WRENCH(I))
+/decl/machine_construction/pipe/proc/deconstruct_transition(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_WRENCH(used_item))
TRANSFER_STATE(/decl/machine_construction/default/deconstructed)
playsound(get_turf(machine), 'sound/items/Ratchet.ogg', 50, 1)
machine.visible_message(SPAN_NOTICE("\The [user] unfastens \the [machine]."))
machine.dismantle()
-/decl/machine_construction/pipe/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/pipe/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if((. = ..()))
return
- return deconstruct_transition(I, user, machine)
+ return deconstruct_transition(used_item, user, machine)
/decl/machine_construction/pipe/mechanics_info()
. = list()
. += "Use a wrench to deconstruct the machine"
// Same, but uses different tool.
-/decl/machine_construction/pipe/welder/deconstruct_transition(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_WELDER(I))
- var/obj/item/weldingtool/WT = I
- if(!WT.isOn())
+/decl/machine_construction/pipe/welder/deconstruct_transition(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.isOn())
return FALSE
- if(!WT.weld(0,user))
+ if(!welder.weld(0,user))
return FALSE
var/fail = machine.cannot_transition_to(/decl/machine_construction/default/deconstructed, user)
if(istext(fail))
@@ -40,7 +40,7 @@
playsound(get_turf(machine), 'sound/items/Welder.ogg', 50, 1)
if(!do_after(user, 5 SECONDS, machine))
return TRUE
- if(!WT.isOn())
+ if(!welder.isOn())
return TRUE
playsound(get_turf(machine), 'sound/items/Welder2.ogg', 50, 1)
TRANSFER_STATE(/decl/machine_construction/default/deconstructed)
diff --git a/code/game/machinery/_machines_base/machine_construction/wall_frame.dm b/code/game/machinery/_machines_base/machine_construction/wall_frame.dm
index 9c01dcc5db7c..a81bd4d52312 100644
--- a/code/game/machinery/_machines_base/machine_construction/wall_frame.dm
+++ b/code/game/machinery/_machines_base/machine_construction/wall_frame.dm
@@ -25,20 +25,20 @@
else
try_change_state(machine, newly_built_state)
-/decl/machine_construction/wall_frame/panel_closed/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/wall_frame/panel_closed/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if((. = ..()))
return
- if(istype(I, /obj/item/part_replacer))
- var/obj/item/part_replacer/replacer = I
+ if(istype(used_item, /obj/item/part_replacer))
+ var/obj/item/part_replacer/replacer = used_item
if(replacer.remote_interaction)
machine.part_replacement(user, replacer)
for(var/line in machine.get_part_info_strings(user))
to_chat(user, line)
return TRUE
- return down_interaction(I, user, machine)
+ return down_interaction(used_item, user, machine)
-/decl/machine_construction/wall_frame/panel_closed/proc/down_interaction(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_SCREWDRIVER(I))
+/decl/machine_construction/wall_frame/panel_closed/proc/down_interaction(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_SCREWDRIVER(used_item))
TRANSFER_STATE(open_state)
playsound(get_turf(machine), 'sound/items/Screwdriver.ogg', 50, 1)
machine.panel_open = TRUE
@@ -55,6 +55,23 @@
machine.panel_open = TRUE
machine.queue_icon_update()
+/decl/machine_construction/wall_frame/panel_closed/fail_unit_test(obj/machinery/machine)
+ if((. = ..()))
+ return
+ var/static/mob/living/human/user = new
+ return fail_test_state_transfer(machine, user)
+
+/decl/machine_construction/wall_frame/panel_closed/proc/fail_test_state_transfer(obj/machinery/machine, mob/user)
+ var/static/obj/item/screwdriver/screwdriver = new
+ // Prevent access locks on machines interfering with our interactions.
+ for(var/obj/item/stock_parts/access_lock/lock in machine.get_all_components_of_type(/obj/item/stock_parts/access_lock))
+ lock.locked = FALSE
+ if(!machine.attackby(screwdriver, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with screwdriver."
+ if(machine.construct_state.type != open_state)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [open_state])."
+
+
// Open panel
/decl/machine_construction/wall_frame/panel_open/state_is_valid(obj/machinery/machine)
@@ -68,11 +85,11 @@
else
try_change_state(machine, active_state)
-/decl/machine_construction/wall_frame/panel_open/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/wall_frame/panel_open/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if((. = ..()))
return
- if(IS_WIRECUTTER(I))
+ if(IS_WIRECUTTER(used_item))
TRANSFER_STATE(diconnected_state)
playsound(get_turf(machine), 'sound/items/Wirecutter.ogg', 50, 1)
user.visible_message(SPAN_WARNING("\The [user] has cut the wires inside \the [machine]!"), "You have cut the wires inside \the [machine].")
@@ -81,20 +98,20 @@
machine.queue_icon_update()
return TRUE
- if((. = up_interaction(I, user, machine)))
+ if((. = up_interaction(used_item, user, machine)))
return
- if(istype(I, /obj/item/part_replacer))
- return machine.part_replacement(user, I)
+ if(istype(used_item, /obj/item/part_replacer))
+ return machine.part_replacement(user, used_item)
- if(IS_WRENCH(I))
+ if(IS_WRENCH(used_item))
return machine.part_removal(user)
- if(istype(I))
- return machine.part_insertion(user, I)
+ if(istype(used_item))
+ return machine.part_insertion(user, used_item)
-/decl/machine_construction/wall_frame/panel_open/proc/up_interaction(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_SCREWDRIVER(I))
+/decl/machine_construction/wall_frame/panel_open/proc/up_interaction(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_SCREWDRIVER(used_item))
TRANSFER_STATE(active_state)
playsound(get_turf(machine), 'sound/items/Screwdriver.ogg', 50, 1)
machine.panel_open = FALSE
@@ -124,12 +141,12 @@
else
try_change_state(machine, active_state)
-/decl/machine_construction/wall_frame/no_wires/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/wall_frame/no_wires/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if((. = ..()))
return
- if(IS_COIL(I))
- var/obj/item/stack/cable_coil/A = I
+ if(IS_COIL(used_item))
+ var/obj/item/stack/cable_coil/A = used_item
if (A.can_use(5))
TRANSFER_STATE(open_state)
A.use(5)
@@ -140,20 +157,20 @@
to_chat(user, SPAN_WARNING("You need five pieces of cable to wire \the [machine]."))
return TRUE
- if((. = down_interaction(I, user, machine)))
+ if((. = down_interaction(used_item, user, machine)))
return
- if(istype(I, /obj/item/part_replacer))
- return machine.part_replacement(user, I)
+ if(istype(used_item, /obj/item/part_replacer))
+ return machine.part_replacement(user, used_item)
- if(IS_WRENCH(I))
+ if(IS_WRENCH(used_item))
return machine.part_removal(user)
- if(istype(I))
- return machine.part_insertion(user, I)
+ if(istype(used_item))
+ return machine.part_insertion(user, used_item)
-/decl/machine_construction/wall_frame/no_wires/proc/down_interaction(obj/item/I, mob/user, obj/machinery/machine)
- if(IS_CROWBAR(I))
+/decl/machine_construction/wall_frame/no_wires/proc/down_interaction(obj/item/used_item, mob/user, obj/machinery/machine)
+ if(IS_CROWBAR(used_item))
TRANSFER_STATE(bottom_state)
playsound(get_turf(machine), 'sound/items/Crowbar.ogg', 50, 1)
to_chat(user, "You pry out the circuit!")
@@ -183,16 +200,16 @@
else
try_change_state(machine, active_state)
-/decl/machine_construction/wall_frame/no_circuit/attackby(obj/item/I, mob/user, obj/machinery/machine)
+/decl/machine_construction/wall_frame/no_circuit/attackby(obj/item/used_item, mob/user, obj/machinery/machine)
if((. = ..()))
return
- if(istype(I, /obj/item/stock_parts/circuitboard))
- var/obj/item/stock_parts/circuitboard/board = I
+ if(istype(used_item, /obj/item/stock_parts/circuitboard))
+ var/obj/item/stock_parts/circuitboard/board = used_item
if(board.build_path != (machine.base_type || machine.type))
to_chat(user, SPAN_WARNING("This circuitboard does not fit inside \the [machine]!"))
return TRUE
- if(!user.canUnEquip(board))
+ if(!user.can_unequip_item(board))
return TRUE
machine.set_broken(TRUE, MACHINE_BROKEN_CONSTRUCT)
TRANSFER_STATE(diconnected_state)
@@ -202,7 +219,7 @@
machine.queue_icon_update()
return TRUE
- if(IS_WRENCH(I))
+ if(IS_WRENCH(used_item))
TRANSFER_STATE(/decl/machine_construction/default/deconstructed)
playsound(get_turf(machine), 'sound/items/Ratchet.ogg', 50, 1)
machine.visible_message(SPAN_NOTICE("\The [user] deconstructs \the [machine]."))
diff --git a/code/game/machinery/_machines_base/machine_construction/wall_frame_hackable.dm b/code/game/machinery/_machines_base/machine_construction/wall_frame_hackable.dm
index 2afb4460f3fa..7c1d98873bda 100644
--- a/code/game/machinery/_machines_base/machine_construction/wall_frame_hackable.dm
+++ b/code/game/machinery/_machines_base/machine_construction/wall_frame_hackable.dm
@@ -64,6 +64,29 @@
. += "Use a screwdriver close the hatch and tuck the exposed wires back in."
. += "Use a parts replacer to view installed parts."
+/decl/machine_construction/wall_frame/panel_closed/hackable/fail_test_state_transfer(obj/machinery/machine, mob/user)
+ var/static/obj/item/screwdriver/screwdriver = new
+ // Prevent access locks on doors from interfering with our interactions.
+ for(var/obj/item/stock_parts/access_lock/lock in machine.get_all_components_of_type(/obj/item/stock_parts/access_lock))
+ lock.locked = FALSE
+ // Test hacking state
+ if(!machine.attackby(screwdriver, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with screwdriver."
+ var/const/hacking_state = /decl/machine_construction/wall_frame/panel_closed/hackable/hacking // TODO: un-hardcode this
+ if(machine.construct_state.type != hacking_state)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [hacking_state])."
+ // Do it again to reverse that state change.
+ if(!machine.attackby(screwdriver, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with screwdriver on a second try."
+ if(machine.construct_state != src)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [type])."
+ // Now test the open state
+ var/static/obj/item/crowbar/crowbar = new
+ if(!machine.attackby(crowbar, user))
+ return "Machine [log_info_line(machine)] did not respond to attackby with crowbar."
+ if(machine.construct_state.type != open_state)
+ return "Machine [log_info_line(machine)] had a construct_state of type [machine.construct_state.type] after screwdriver interaction (expected [open_state])."
+
/decl/machine_construction/wall_frame/panel_open/hackable/up_interaction(obj/item/I, mob/user, obj/machinery/machine)
if(IS_CROWBAR(I))
TRANSFER_STATE(active_state)
diff --git a/code/game/machinery/_machines_base/machinery.dm b/code/game/machinery/_machines_base/machinery.dm
index c57624ee3c9e..5f03a9d4ba72 100644
--- a/code/game/machinery/_machines_base/machinery.dm
+++ b/code/game/machinery/_machines_base/machinery.dm
@@ -506,12 +506,12 @@ Class Procs:
LAZYREMOVE(., component_parts)
// This only includes external atoms by default, so we need to add components back.
-/obj/machinery/get_contained_matter()
+/obj/machinery/get_contained_matter(include_reagents = TRUE)
. = ..()
var/list/component_types = types_of_component(/obj/item/stock_parts)
for(var/path in component_types)
for(var/obj/item/stock_parts/part in get_all_components_of_type(path))
- var/list/part_costs = part.get_contained_matter()
+ var/list/part_costs = part.get_contained_matter(include_reagents)
for(var/key in part_costs)
.[key] += part_costs[key] * component_types[path]
diff --git a/code/game/machinery/_machines_base/machinery_components.dm b/code/game/machinery/_machines_base/machinery_components.dm
index 032e31d058a3..d4fecb27c52d 100644
--- a/code/game/machinery/_machines_base/machinery_components.dm
+++ b/code/game/machinery/_machines_base/machinery_components.dm
@@ -187,15 +187,15 @@ var/global/list/machine_path_to_circuit_type
events_repository.unregister(/decl/observ/destroyed, part, src)
return part
-/obj/machinery/proc/replace_part(mob/user, var/obj/item/part_replacer/R, var/obj/item/stock_parts/old_part, var/obj/item/stock_parts/new_part)
+/obj/machinery/proc/replace_part(mob/user, var/obj/item/part_replacer/replacer, var/obj/item/stock_parts/old_part, var/obj/item/stock_parts/new_part)
if(ispath(old_part))
old_part = get_component_of_type(old_part, TRUE)
old_part = uninstall_component(old_part)
- if(R)
- if(R.storage)
- R.storage.remove_from_storage(null, new_part, src)
- R.storage.handle_item_insertion(null, old_part, TRUE)
- R.part_replacement_sound()
+ if(replacer)
+ if(replacer.storage)
+ replacer.storage.remove_from_storage(null, new_part, src)
+ replacer.storage.handle_item_insertion(null, old_part, TRUE)
+ replacer.part_replacement_sound()
install_component(new_part)
to_chat(user, "[old_part.name] replaced with [new_part.name].")
@@ -254,18 +254,18 @@ var/global/list/machine_path_to_circuit_type
// Hook to get updates.
/obj/machinery/proc/component_stat_change(var/obj/item/stock_parts/part, old_stat, flag)
-/obj/machinery/attackby(obj/item/I, mob/user)
- if((. = component_attackby(I, user)))
+/obj/machinery/attackby(obj/item/used_item, mob/user)
+ if((. = component_attackby(used_item, user)))
return
return ..()
-/obj/machinery/proc/component_attackby(obj/item/I, mob/user)
+/obj/machinery/proc/component_attackby(obj/item/used_item, mob/user)
for(var/obj/item/stock_parts/part in component_parts)
if(!components_are_accessible(part.type))
continue
- if((. = part.attackby(I, user)))
+ if((. = part.attackby(used_item, user)))
return
- return construct_state?.attackby(I, user, src)
+ return construct_state?.attackby(used_item, user, src)
/obj/machinery/proc/component_attack_hand(mob/user)
for(var/obj/item/stock_parts/part in component_parts)
@@ -279,15 +279,15 @@ var/global/list/machine_path_to_circuit_type
Standard helpers for users interacting with machinery parts.
*/
-/obj/machinery/proc/part_replacement(mob/user, obj/item/part_replacer/R)
+/obj/machinery/proc/part_replacement(mob/user, obj/item/part_replacer/replacer)
for(var/obj/item/stock_parts/A in component_parts)
if(!A.base_type)
continue
if(!(A.part_flags & PART_FLAG_HAND_REMOVE))
continue
- for(var/obj/item/stock_parts/B in R.contents)
+ for(var/obj/item/stock_parts/B in replacer.contents)
if(istype(B, A.base_type) && B.rating > A.rating)
- replace_part(user, R, A, B)
+ replace_part(user, replacer, A, B)
return TRUE
for(var/path in uncreated_component_parts)
var/obj/item/stock_parts/A = path
@@ -295,13 +295,13 @@ Standard helpers for users interacting with machinery parts.
continue
var/base_type = initial(A.base_type)
if(base_type)
- for(var/obj/item/stock_parts/B in R.contents)
+ for(var/obj/item/stock_parts/B in replacer.contents)
if(istype(B, base_type) && B.rating > initial(A.rating))
- replace_part(user, R, A, B)
+ replace_part(user, replacer, A, B)
return TRUE
/obj/machinery/proc/part_insertion(mob/user, obj/item/stock_parts/part) // Second argument may actually be an arbitrary item.
- if(!user.canUnEquip(part) && !isstack(part))
+ if(!user.can_unequip_item(part) && !isstack(part))
return FALSE
var/number = can_add_component(part, user)
if(!number)
diff --git a/code/game/machinery/_machines_base/machinery_damage.dm b/code/game/machinery/_machines_base/machinery_damage.dm
index bba75011ff7a..29a821716b0c 100644
--- a/code/game/machinery/_machines_base/machinery_damage.dm
+++ b/code/game/machinery/_machines_base/machinery_damage.dm
@@ -82,13 +82,13 @@
. = ..()
take_damage(P.damage, P.atom_damage_type)
-/obj/machinery/bash(obj/item/W, mob/user)
- if(!istype(W))
+/obj/machinery/bash(obj/item/used_item, mob/user)
+ if(!istype(used_item))
return FALSE
- var/force = W.expend_attack_force(user)
+ var/force = used_item.expend_attack_force(user)
if(force <= 5)
return FALSE
. = ..()
if(.)
- user.setClickCooldown(W.attack_cooldown + W.w_class)
- take_damage(force, W.atom_damage_type)
\ No newline at end of file
+ user.setClickCooldown(used_item.attack_cooldown + used_item.w_class)
+ take_damage(force, used_item.atom_damage_type)
\ No newline at end of file
diff --git a/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm b/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm
index c8fdd39f53bd..f3c2bd507167 100644
--- a/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm
+++ b/code/game/machinery/_machines_base/stock_parts/_stock_parts.dm
@@ -15,7 +15,7 @@
return FALSE // Can potentially add uninstall code here, but not currently supported.
return ..()
-/obj/item/stock_parts/proc/set_status(var/obj/machinery/machine, var/flag)
+/obj/item/stock_parts/proc/set_component_status(var/obj/machinery/machine, var/flag)
var/old_stat = status
status |= flag
if(old_stat != status)
@@ -34,7 +34,7 @@
machine.component_stat_change(src, old_stat, flag)
/obj/item/stock_parts/proc/on_install(var/obj/machinery/machine)
- set_status(machine, PART_STAT_INSTALLED)
+ set_component_status(machine, PART_STAT_INSTALLED)
/obj/item/stock_parts/proc/on_uninstall(var/obj/machinery/machine, var/temporary = FALSE)
unset_status(machine, PART_STAT_INSTALLED)
@@ -48,7 +48,7 @@
if(istype(machine))
LAZYDISTINCTADD(machine.processing_parts, src)
START_PROCESSING_MACHINE(machine, MACHINERY_PROCESS_COMPONENTS)
- set_status(machine, PART_STAT_PROCESSING)
+ set_component_status(machine, PART_STAT_PROCESSING)
/obj/item/stock_parts/proc/stop_processing(var/obj/machinery/machine)
if(istype(machine))
@@ -86,7 +86,12 @@
if(ELECTROCUTE)
cause = "sparks"
visible_message(SPAN_WARNING("Something [cause] inside \the [machine]."), range = 2)
- SetName("broken [name]")
+ update_name()
+
+/obj/item/stock_parts/update_name()
+ . = ..()
+ if(!is_functional())
+ SetName("broken [name]") // prepend 'broken' to the results
/obj/item/stock_parts/proc/is_functional()
return (!can_take_damage()) || (current_health > 0)
diff --git a/code/game/machinery/_machines_base/stock_parts/access_lock.dm b/code/game/machinery/_machines_base/stock_parts/access_lock.dm
index 2f4935ed6731..8d6b4aec8cea 100644
--- a/code/game/machinery/_machines_base/stock_parts/access_lock.dm
+++ b/code/game/machinery/_machines_base/stock_parts/access_lock.dm
@@ -54,10 +54,10 @@
if(emagged && user.skill_check_multiple(list(SKILL_FORENSICS = SKILL_EXPERT, SKILL_COMPUTER = SKILL_EXPERT)))
. += SPAN_WARNING("On close inspection, there is something odd about the interface. You suspect it may have been tampered with.")
-/obj/item/stock_parts/access_lock/attackby(obj/item/W, mob/user)
+/obj/item/stock_parts/access_lock/attackby(obj/item/used_item, mob/user)
var/obj/machinery/machine = loc
if(!emagged && istype(machine))
- var/obj/item/card/id/I = W.GetIdCard()
+ var/obj/item/card/id/I = used_item.GetIdCard()
if(I && check_access(I))
locked = !locked
visible_message(SPAN_NOTICE("\The [src] beeps and flashes green twice: it is now [locked ? "" : "un"]locked."))
diff --git a/code/game/machinery/_machines_base/stock_parts/building_material.dm b/code/game/machinery/_machines_base/stock_parts/building_material.dm
index 615a39b9a852..2ad4e83360f9 100644
--- a/code/game/machinery/_machines_base/stock_parts/building_material.dm
+++ b/code/game/machinery/_machines_base/stock_parts/building_material.dm
@@ -67,9 +67,9 @@
materials = null
..()
-/obj/item/stock_parts/building_material/get_contained_matter()
+/obj/item/stock_parts/building_material/get_contained_matter(include_reagents = TRUE)
. = ..()
for(var/obj/item/thing in materials)
- var/list/costs = thing.get_contained_matter()
+ var/list/costs = thing.get_contained_matter(include_reagents)
for(var/key in costs)
.[key] += costs[key]
diff --git a/code/game/machinery/_machines_base/stock_parts/card_reader.dm b/code/game/machinery/_machines_base/stock_parts/card_reader.dm
index 3f92564a8d7e..05472503c246 100644
--- a/code/game/machinery/_machines_base/stock_parts/card_reader.dm
+++ b/code/game/machinery/_machines_base/stock_parts/card_reader.dm
@@ -46,8 +46,8 @@
return swipe_card(O, user)
. = ..()
-/obj/item/stock_parts/item_holder/card_reader/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W) && !istype(loc, /obj/machinery)) //Only if not in the machine, to prevent hijacking tool interactions with the machine
+/obj/item/stock_parts/item_holder/card_reader/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item) && !istype(loc, /obj/machinery)) //Only if not in the machine, to prevent hijacking tool interactions with the machine
should_swipe = !should_swipe
to_chat(user, SPAN_NOTICE("You toggle \the [src] into [should_swipe? "swipe" : "insert"] card mode."))
return TRUE
diff --git a/code/game/machinery/_machines_base/stock_parts/item_holder.dm b/code/game/machinery/_machines_base/stock_parts/item_holder.dm
index 707acd2dbd00..cb875fa65dec 100644
--- a/code/game/machinery/_machines_base/stock_parts/item_holder.dm
+++ b/code/game/machinery/_machines_base/stock_parts/item_holder.dm
@@ -17,9 +17,9 @@
unregister_on_eject()
. = ..()
-/obj/item/stock_parts/item_holder/attackby(obj/item/W, mob/user)
- if(is_accepted_type(W))
- insert_item(W, user)
+/obj/item/stock_parts/item_holder/attackby(obj/item/used_item, mob/user)
+ if(is_accepted_type(used_item))
+ insert_item(used_item, user)
return TRUE
. = ..()
diff --git a/code/game/machinery/_machines_base/stock_parts/network_lock.dm b/code/game/machinery/_machines_base/stock_parts/network_lock.dm
index d5d6e187fdee..d5cd653186e4 100644
--- a/code/game/machinery/_machines_base/stock_parts/network_lock.dm
+++ b/code/game/machinery/_machines_base/stock_parts/network_lock.dm
@@ -75,10 +75,10 @@
if(emagged && user.skill_check_multiple(list(SKILL_FORENSICS = SKILL_EXPERT, SKILL_COMPUTER = SKILL_EXPERT)))
. += SPAN_WARNING("On closer inspection, there is something odd about the interface. You suspect it may have been tampered with.")
-/obj/item/stock_parts/network_receiver/network_lock/attackby(obj/item/W, mob/user)
+/obj/item/stock_parts/network_receiver/network_lock/attackby(obj/item/used_item, mob/user)
. = ..()
- if(istype(W, /obj/item/card/id))
- if(check_access(W))
+ if(istype(used_item, /obj/item/card/id))
+ if(check_access(used_item))
playsound(src, 'sound/machines/ping.ogg', 20, 0)
else
playsound(src, 'sound/machines/buzz-two.ogg', 20, 0)
diff --git a/code/game/machinery/_machines_base/stock_parts/power/battery.dm b/code/game/machinery/_machines_base/stock_parts/power/battery.dm
index c78b358aea6b..ecb17db640aa 100644
--- a/code/game/machinery/_machines_base/stock_parts/power/battery.dm
+++ b/code/game/machinery/_machines_base/stock_parts/power/battery.dm
@@ -49,7 +49,7 @@
if(istype(machine))
machine.power_change()
machine.queue_icon_update()
- set_status(machine, PART_STAT_CONNECTED)
+ set_component_status(machine, PART_STAT_CONNECTED)
update_icon()
return cell
@@ -112,7 +112,7 @@
/obj/item/stock_parts/power/battery/can_provide_power(var/obj/machinery/machine)
if(is_functional() && cell && cell.check_charge(CELLRATE * machine.get_power_usage()))
machine.update_power_channel(LOCAL)
- set_status(machine, PART_STAT_ACTIVE)
+ set_component_status(machine, PART_STAT_ACTIVE)
return TRUE
return FALSE
@@ -147,24 +147,24 @@
icon_state = "battery[!!cell]"
// Cell interaction
-/obj/item/stock_parts/power/battery/attackby(obj/item/I, mob/user)
+/obj/item/stock_parts/power/battery/attackby(obj/item/used_item, mob/user)
var/obj/machinery/machine = loc
// Interactions with/without machine
- if(istype(I, /obj/item/cell))
+ if(istype(used_item, /obj/item/cell))
if(cell)
to_chat(user, "There is a power cell already installed.")
return TRUE
if(istype(machine) && (machine.stat & MAINT))
to_chat(user, "There is no connector for your power cell.")
return TRUE
- if(I.w_class != ITEM_SIZE_NORMAL)
- to_chat(user, "\The [I] is too [I.w_class < ITEM_SIZE_NORMAL? "small" : "large"] to fit here.")
+ if(used_item.w_class != ITEM_SIZE_NORMAL)
+ to_chat(user, "\The [used_item] is too [used_item.w_class < ITEM_SIZE_NORMAL? "small" : "large"] to fit here.")
return TRUE
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- add_cell(machine, I)
+ add_cell(machine, used_item)
user.visible_message(\
SPAN_WARNING("\The [user] has inserted the power cell to \the [src]!"),\
SPAN_NOTICE("You insert the power cell."))
diff --git a/code/game/machinery/_machines_base/stock_parts/power/terminal.dm b/code/game/machinery/_machines_base/stock_parts/power/terminal.dm
index 79cdd75518dd..2d0347720f4a 100644
--- a/code/game/machinery/_machines_base/stock_parts/power/terminal.dm
+++ b/code/game/machinery/_machines_base/stock_parts/power/terminal.dm
@@ -48,7 +48,7 @@
//Is willing to provide power if the wired contribution is nonnegligible and there is enough total local power to run the machine.
/obj/item/stock_parts/power/terminal/can_provide_power(var/obj/machinery/machine)
if(is_functional() && terminal && terminal.surplus() && machine.can_use_power_oneoff(machine.get_power_usage(), LOCAL) <= 0)
- set_status(machine, PART_STAT_ACTIVE)
+ set_component_status(machine, PART_STAT_ACTIVE)
machine.update_power_channel(LOCAL)
return TRUE
return FALSE
@@ -76,7 +76,7 @@
terminal.queue_icon_update()
set_extension(src, /datum/extension/event_registration/shuttle_stationary, GET_DECL(/decl/observ/moved), machine, PROC_REF(machine_moved), get_area(src))
- set_status(machine, PART_STAT_CONNECTED)
+ set_component_status(machine, PART_STAT_CONNECTED)
start_processing(machine)
/obj/item/stock_parts/power/terminal/proc/machine_moved(var/obj/machinery/machine, var/turf/old_loc, var/turf/new_loc)
@@ -115,13 +115,13 @@
to_chat(user, "There is already a terminal here.")
return TRUE
-/obj/item/stock_parts/power/terminal/attackby(obj/item/I, mob/user)
+/obj/item/stock_parts/power/terminal/attackby(obj/item/used_item, mob/user)
var/obj/machinery/machine = loc
if(!istype(machine))
return ..()
// Interactions inside machine only
- if (istype(I, /obj/item/stack/cable_coil) && !terminal)
+ if (istype(used_item, /obj/item/stack/cable_coil) && !terminal)
var/turf/T = get_step(machine, terminal_dir)
if(terminal_dir && user.loc != T)
return FALSE // Wrong terminal handler.
@@ -131,7 +131,7 @@
if(istype(T) && !T.is_plating())
to_chat(user, "You must remove the floor plating in front of \the [machine] first.")
return TRUE
- var/obj/item/stack/cable_coil/C = I
+ var/obj/item/stack/cable_coil/C = used_item
if(!C.can_use(10))
to_chat(user, "You need ten lengths of cable for \the [machine].")
return TRUE
diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm
index e571411e9730..e8aab501f355 100644
--- a/code/game/machinery/ai_slipper.dm
+++ b/code/game/machinery/ai_slipper.dm
@@ -23,7 +23,7 @@
src.uses = uses
src.power_change()
-/obj/machinery/ai_slipper/attackby(obj/item/W, mob/user)
+/obj/machinery/ai_slipper/attackby(obj/item/used_item, mob/user)
if(stat & (NOPOWER|BROKEN))
return FALSE
if (issilicon(user))
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 4096611b87e7..ea3a147ad7ea 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -884,18 +884,18 @@ FIRE ALARM
set_light(2, 0.25, COLOR_RED)
else if(isContactLevel(z))
var/decl/security_state/security_state = GET_DECL(global.using_map.security_state)
- var/decl/security_level/sl = security_state.current_security_level
+ var/decl/security_level/sec_level = security_state.current_security_level
- set_light(sl.light_power, sl.light_range, sl.light_color_alarm)
+ set_light(sec_level.light_power, sec_level.light_range, sec_level.light_color_alarm)
- if(sl.alarm_appearance.alarm_icon)
- var/image/alert1 = image(sl.icon, sl.alarm_appearance.alarm_icon)
- alert1.color = sl.alarm_appearance.alarm_icon_color
+ if(sec_level.alarm_appearance.alarm_icon)
+ var/image/alert1 = image(sec_level.icon, sec_level.alarm_appearance.alarm_icon)
+ alert1.color = sec_level.alarm_appearance.alarm_icon_color
add_overlay(alert1)
- if(sl.alarm_appearance.alarm_icon_twotone)
- var/image/alert2 = image(sl.icon, sl.alarm_appearance.alarm_icon_twotone)
- alert2.color = sl.alarm_appearance.alarm_icon_twotone_color
+ if(sec_level.alarm_appearance.alarm_icon_twotone)
+ var/image/alert2 = image(sec_level.icon, sec_level.alarm_appearance.alarm_icon_twotone)
+ alert2.color = sec_level.alarm_appearance.alarm_icon_twotone_color
add_overlay(alert2)
else
add_overlay("fire0")
@@ -913,7 +913,7 @@ FIRE ALARM
alarm(rand(30/severity, 60/severity))
..()
-/obj/machinery/firealarm/attackby(obj/item/W, mob/user)
+/obj/machinery/firealarm/attackby(obj/item/used_item, mob/user)
if((. = ..()))
return
src.alarm()
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 52613f16121d..af152d8b5028 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -1,32 +1,36 @@
/obj/machinery/portable_atmospherics/canister
- name = "canister"
- icon = 'icons/obj/atmos.dmi'
- icon_state = "yellow"
- density = TRUE
- max_health = 100
- obj_flags = OBJ_FLAG_CONDUCTIBLE
- w_class = ITEM_SIZE_GARGANTUAN
- construct_state = /decl/machine_construction/pipe/welder
- uncreated_component_parts = null
- start_pressure = 45 ATM
- volume = 1000
- interact_offline = TRUE
- matter = list(
+ name = "canister"
+ icon = 'icons/obj/atmos.dmi'
+ icon_state = "yellow"
+ density = TRUE
+ max_health = 100
+ obj_flags = OBJ_FLAG_CONDUCTIBLE
+ w_class = ITEM_SIZE_GARGANTUAN
+ construct_state = /decl/machine_construction/pipe/welder
+ stat_immune = NOSCREEN | NOINPUT | NOPOWER
+ start_pressure = 45 ATM
+ volume = 1000
+ interact_offline = TRUE
+ matter = list(
/decl/material/solid/metal/steel = 10 * SHEET_MATERIAL_AMOUNT
)
-
+ uncreated_component_parts = null
var/valve_open = FALSE
var/release_pressure = ONE_ATMOSPHERE
var/release_flow_rate = ATMOS_DEFAULT_VOLUME_PUMP //in L/s
var/canister_color = "yellow"
var/can_label = TRUE
var/temperature_resistance = 1000 + T0C
+ var/decl/material/start_gas = null
/obj/machinery/portable_atmospherics/canister/Initialize(mapload, material)
if(ispath(material))
matter = list()
matter[material] = 10 * SHEET_MATERIAL_AMOUNT
. = ..(mapload)
+ if(start_gas)
+ air_contents.adjust_gas(start_gas, MolesForPressure())
+ lazy_update_icon()
/obj/machinery/portable_atmospherics/canister/drain_power()
return -1
@@ -36,45 +40,69 @@
icon_state = "redws"
canister_color = "redws"
can_label = FALSE
+ start_gas = /decl/material/gas/nitrous_oxide
/obj/machinery/portable_atmospherics/canister/nitrogen
name = "nitrogen canister"
icon_state = "red"
canister_color = "red"
can_label = FALSE
+ start_gas = /decl/material/gas/nitrogen
/obj/machinery/portable_atmospherics/canister/nitrogen/prechilled
name = "cryogenic nitrogen canister"
start_pressure = 20 ATM
+/obj/machinery/portable_atmospherics/canister/nitrogen/prechilled/Initialize()
+ . = ..()
+ air_contents.temperature = 80
+ lazy_update_icon()
+
/obj/machinery/portable_atmospherics/canister/oxygen
name = "oxygen canister"
icon_state = "blue"
canister_color = "blue"
can_label = FALSE
+ start_gas = /decl/material/gas/oxygen
/obj/machinery/portable_atmospherics/canister/oxygen/prechilled
name = "cryogenic oxygen canister"
start_pressure = 20 ATM
+/obj/machinery/portable_atmospherics/canister/oxygen/prechilled/Initialize()
+ . = ..()
+ air_contents.temperature = 80
+ lazy_update_icon()
+
/obj/machinery/portable_atmospherics/canister/hydrogen
name = "hydrogen canister"
icon_state = "purple"
canister_color = "purple"
can_label = FALSE
+ start_gas = /decl/material/gas/hydrogen
/obj/machinery/portable_atmospherics/canister/carbon_dioxide
name = "\improper CO2 canister"
icon_state = "black"
canister_color = "black"
can_label = FALSE
+ start_gas = /decl/material/gas/carbon_dioxide
+// This uses an Initialize override instead of start_gas.
/obj/machinery/portable_atmospherics/canister/air
name = "air canister"
icon_state = "grey"
canister_color = "grey"
can_label = FALSE
+// This doesn't use start_gas because it's a mix.
+/obj/machinery/portable_atmospherics/canister/air/Initialize()
+ . = ..()
+ var/list/air_mix = StandardAirMix()
+ air_contents.adjust_gas(/decl/material/gas/oxygen, air_mix[/decl/material/gas/oxygen], FALSE)
+ air_contents.adjust_gas(/decl/material/gas/nitrogen, air_mix[/decl/material/gas/nitrogen])
+ lazy_update_icon()
+
/obj/machinery/portable_atmospherics/canister/air/airlock
start_pressure = 3 ATM
@@ -197,15 +225,15 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
healthcheck()
return ..()
-/obj/machinery/portable_atmospherics/canister/bash(var/obj/item/W, var/mob/user)
+/obj/machinery/portable_atmospherics/canister/bash(var/obj/item/used_item, var/mob/user)
. = ..()
if(.)
- current_health -= W.expend_attack_force(user)
+ current_health -= used_item.expend_attack_force(user)
healthcheck()
-/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/W, var/mob/user)
- if(isrobot(user) && istype(W, /obj/item/tank/jetpack))
- var/obj/item/tank/jetpack/pack = W
+/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/used_item, var/mob/user)
+ if(isrobot(user) && istype(used_item, /obj/item/tank/jetpack))
+ var/obj/item/tank/jetpack/pack = used_item
var/datum/gas_mixture/thejetpack = pack.air_contents
if(thejetpack)
var/env_pressure = thejetpack.return_pressure()
@@ -301,64 +329,11 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
return STATUS_CLOSE
return ..()
-/obj/machinery/portable_atmospherics/canister/oxygen/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/oxygen, MolesForPressure())
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/hydrogen/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/hydrogen, MolesForPressure())
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/oxygen/prechilled/Initialize()
- . = ..()
- air_contents.temperature = 80
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/sleeping_agent/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/nitrous_oxide, MolesForPressure())
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/nitrogen/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/nitrogen, MolesForPressure())
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/nitrogen/prechilled/Initialize()
- . = ..()
- air_contents.temperature = 80
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/carbon_dioxide/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/carbon_dioxide, MolesForPressure())
- update_icon()
-
-
-/obj/machinery/portable_atmospherics/canister/air/Initialize()
- . = ..()
- var/list/air_mix = StandardAirMix()
- air_contents.adjust_multi(/decl/material/gas/oxygen, air_mix[/decl/material/gas/oxygen], /decl/material/gas/nitrogen, air_mix[/decl/material/gas/nitrogen])
- update_icon()
-
-
// Special types used for engine setup admin verb, they contain double amount of that of normal canister.
-/obj/machinery/portable_atmospherics/canister/nitrogen/engine_setup/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/nitrogen, MolesForPressure())
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/carbon_dioxide/engine_setup/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/carbon_dioxide, MolesForPressure())
- update_icon()
-
-/obj/machinery/portable_atmospherics/canister/hydrogen/engine_setup/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/hydrogen, MolesForPressure())
- update_icon()
+#define ENGINE_SETUP_CANISTER(BASE_TYPE) ##BASE_TYPE/engine_setup/start_pressure = BASE_TYPE::start_pressure * 2;
+ENGINE_SETUP_CANISTER(/obj/machinery/portable_atmospherics/canister/nitrogen)
+ENGINE_SETUP_CANISTER(/obj/machinery/portable_atmospherics/canister/carbon_dioxide)
+ENGINE_SETUP_CANISTER(/obj/machinery/portable_atmospherics/canister/hydrogen)
// Spawn debug tanks.
/obj/machinery/portable_atmospherics/canister/helium
@@ -366,31 +341,19 @@ EMPTY_CANISTER(hydrogen, /obj/machinery/portable_atmospherics/canister/hydrogen)
icon_state = "black"
canister_color = "black"
can_label = FALSE
-
-/obj/machinery/portable_atmospherics/canister/helium/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/helium, MolesForPressure())
- update_icon()
+ start_gas = /decl/material/gas/helium
/obj/machinery/portable_atmospherics/canister/methyl_bromide
name = "\improper CH3Br canister"
icon_state = "black"
canister_color = "black"
can_label = FALSE
-
-/obj/machinery/portable_atmospherics/canister/methyl_bromide/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/methyl_bromide, MolesForPressure())
- update_icon()
+ start_gas = /decl/material/gas/methyl_bromide
/obj/machinery/portable_atmospherics/canister/chlorine
name = "chlorine canister"
icon_state = "black"
canister_color = "black"
can_label = FALSE
-
-/obj/machinery/portable_atmospherics/canister/chlorine/Initialize()
- . = ..()
- air_contents.adjust_gas(/decl/material/gas/chlorine, MolesForPressure())
- update_icon()
+ start_gas = /decl/material/gas/chlorine
// End debug tanks.
diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm
index 2c107d7aac1b..43297c50a477 100644
--- a/code/game/machinery/atmoalter/pump.dm
+++ b/code/game/machinery/atmoalter/pump.dm
@@ -27,7 +27,8 @@
. = ..()
var/list/air_mix = StandardAirMix()
- src.air_contents.adjust_multi(/decl/material/gas/oxygen, air_mix[/decl/material/gas/oxygen], /decl/material/gas/nitrogen, air_mix[/decl/material/gas/nitrogen])
+ air_contents.adjust_gas(/decl/material/gas/oxygen, air_mix[/decl/material/gas/oxygen], FALSE)
+ air_contents.adjust_gas(/decl/material/gas/nitrogen, air_mix[/decl/material/gas/nitrogen])
/obj/machinery/portable_atmospherics/powered/pump/on_update_icon()
overlays.Cut()
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index 06bed379ecea..bf3c3498dda1 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -181,8 +181,8 @@
cut_overlays()
icon_state = "scrubber:[!!((use_power == POWER_USE_ACTIVE) && !(stat & (NOPOWER|BROKEN)))]"
-/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/I, var/mob/user)
- if(IS_WRENCH(I))
+/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_WRENCH(used_item))
if(use_power == POWER_USE_ACTIVE)
to_chat(user, "Turn \the [src] off first!")
return TRUE
@@ -193,7 +193,7 @@
return TRUE
//doesn't hold tanks
- if(istype(I, /obj/item/tank))
+ if(istype(used_item, /obj/item/tank))
return FALSE
return ..()
@@ -203,8 +203,8 @@
name = "stationary air scrubber"
base_type = /obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary
-/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I, var/mob/user)
- if(IS_WRENCH(I))
+/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_WRENCH(used_item))
to_chat(user, "The bolts are too tight for you to unscrew!")
return TRUE
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index f9583f4acfc1..75e0387142c4 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -81,6 +81,9 @@
/obj/machinery/biogenerator/attackby(var/obj/item/used_item, var/mob/user)
+ if(panel_open || IS_SCREWDRIVER(used_item))
+ return ..()
+
if(processing)
if((. = component_attackby(used_item, user)))
return
diff --git a/code/game/machinery/bodyscanner.dm b/code/game/machinery/bodyscanner.dm
index 9ae5ed360527..6998f0f78519 100644
--- a/code/game/machinery/bodyscanner.dm
+++ b/code/game/machinery/bodyscanner.dm
@@ -2,7 +2,7 @@
/obj/machinery/bodyscanner
var/mob/living/human/occupant
var/locked
- name = "Body Scanner"
+ name = "body scanner"
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "body_scanner_0"
density = TRUE
@@ -11,7 +11,6 @@
active_power_usage = 10000 //10 kW. It's a big all-body scanner.
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
- stat_immune = 0
var/open_sound = 'sound/machines/podopen.ogg'
var/close_sound = 'sound/machines/podclose.ogg'
diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm
index 10f382fb55be..9e19104b483a 100644
--- a/code/game/machinery/buttons.dm
+++ b/code/game/machinery/buttons.dm
@@ -40,8 +40,8 @@
. = ..()
update_icon()
-/obj/machinery/button/attackby(obj/item/W, mob/user)
- if(!(. = component_attackby(W, user)))
+/obj/machinery/button/attackby(obj/item/used_item, mob/user)
+ if(!(. = component_attackby(used_item, user)))
return attack_hand_with_interaction_checks(user)
/obj/machinery/button/interface_interact(user)
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 98bac3c1fd33..8d28f55a3c86 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -44,7 +44,13 @@
var/light_disabled = 0
var/alarm_on = 0
- var/affected_by_emp_until = 0
+ var/emp_timer_id = null
+
+ /// The threshold that installed scanning modules need to met or exceed in order for the camera to see through walls.
+ var/const/XRAY_THRESHOLD = 2
+
+ /// The threshold that installed capacitors need to met or exceed in order for the camera to be immunie to EMP.
+ var/const/EMP_PROOF_THRESHOLD = 2
/obj/machinery/camera/get_examine_strings(mob/user, distance, infix, suffix)
. = ..()
@@ -84,23 +90,14 @@
invalidateCameraCache()
set_extension(src, /datum/extension/network_device/camera, null, null, null, TRUE, preset_channels, c_tag, cameranet_enabled, requires_connection)
+ RefreshParts()
/obj/machinery/camera/Destroy()
- set_status(0) //kick anyone viewing out
+ set_camera_status(0) //kick anyone viewing out
+ deltimer(emp_timer_id)
return ..()
/obj/machinery/camera/Process()
- if((stat & EMPED) && world.time >= affected_by_emp_until)
- stat &= ~EMPED
- cancelCameraAlarm()
- update_icon()
- update_coverage()
-
- if (detectTime > 0)
- var/elapsed = world.time - detectTime
- if (elapsed > alarm_delay)
- triggerAlarm()
-
if (stat & (EMPED))
return
if(!motion_sensor)
@@ -156,16 +153,30 @@
newTarget(AM)
/obj/machinery/camera/emp_act(severity)
- if(!(stat_immune & EMPED) && prob(100/severity))
- if(!affected_by_emp_until || (world.time < affected_by_emp_until))
- affected_by_emp_until = max(affected_by_emp_until, world.time + (90 SECONDS / severity))
- else
- stat |= EMPED
- set_light(0)
- triggerCameraAlarm()
- update_icon()
- update_coverage()
- START_PROCESSING_MACHINE(src, MACHINERY_PROCESS_SELF)
+ if(stat_immune & EMPED)
+ return
+ if(prob(100 / severity))
+ stat |= EMPED
+ set_light(0)
+ triggerCameraAlarm()
+ update_icon()
+ update_coverage()
+
+ var/emp_length = 90 SECONDS / severity
+ emp_timer_id = addtimer(CALLBACK(src, PROC_REF(emp_expired)), emp_length, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE)
+ ..()
+
+/obj/machinery/camera/proc/emp_expired()
+ stat &= ~EMPED
+ cancelCameraAlarm()
+ update_icon()
+ update_coverage()
+
+ if (detectTime > 0)
+ var/elapsed = world.time - detectTime
+ if (elapsed > alarm_delay)
+ triggerAlarm()
+
/obj/machinery/camera/bullet_act(var/obj/item/projectile/P)
take_damage(P.get_structure_damage(), P.atom_damage_type)
@@ -196,10 +207,10 @@
return TRUE
return FALSE
-/obj/machinery/camera/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/paper))
+/obj/machinery/camera/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/paper))
var/datum/extension/network_device/camera/D = get_extension(src, /datum/extension/network_device)
- D.show_paper(W, user)
+ D.show_paper(used_item, user)
return ..()
/obj/machinery/camera/interface_interact(mob/user)
@@ -227,7 +238,7 @@
//sparks
spark_at(loc, amount=5)
-/obj/machinery/camera/proc/set_status(var/newstatus, var/mob/user)
+/obj/machinery/camera/proc/set_camera_status(var/newstatus, var/mob/user)
if (status != newstatus && (!cut_power || status == TRUE))
status = newstatus
// The only way for AI to reactivate cameras are malf abilities, this gives them different messages.
@@ -254,25 +265,28 @@
update_coverage()
/obj/machinery/camera/on_update_icon()
+ var/base_state = initial(icon_state)
+ if(total_component_rating_of_type(/obj/item/stock_parts/scanning_module) >= XRAY_THRESHOLD)
+ base_state = "xraycam"
if (!status || (stat & BROKEN))
- icon_state = "[initial(icon_state)]1"
+ icon_state = "[base_state]1"
else if (stat & EMPED)
- icon_state = "[initial(icon_state)]emp"
+ icon_state = "[base_state]emp"
else
- icon_state = initial(icon_state)
+ icon_state = base_state
/obj/machinery/camera/RefreshParts()
. = ..()
var/power_mult = 1
var/emp_protection = total_component_rating_of_type(/obj/item/stock_parts/capacitor)
- if(emp_protection > 2)
- stat_immune &= EMPED
+ if(emp_protection >= EMP_PROOF_THRESHOLD)
+ stat_immune |= EMPED
else
stat_immune &= ~EMPED
var/xray_rating = total_component_rating_of_type(/obj/item/stock_parts/scanning_module)
var/datum/extension/network_device/camera/camera_device = get_extension(src, /datum/extension/network_device/)
if(camera_device)
- if(xray_rating > 2)
+ if(xray_rating >= XRAY_THRESHOLD)
camera_device.xray_enabled = TRUE
power_mult++
else
@@ -337,7 +351,7 @@
)
/obj/machinery/camera/proc/toggle_status()
- set_status(!status)
+ set_camera_status(!status)
/decl/public_access/public_method/toggle_camera
name = "toggle camera"
diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm
index 30ee583beec2..0fe1d526de06 100644
--- a/code/game/machinery/camera/presets.dm
+++ b/code/game/machinery/camera/presets.dm
@@ -1,5 +1,5 @@
/obj/machinery/camera/network/engineering
- preset_channels = list(CAMERA_CAMERA_CHANNEL_ENGINEERING)
+ preset_channels = list(CAMERA_CHANNEL_ENGINEERING)
req_access = list(access_engine)
/obj/machinery/camera/network/ert
@@ -33,33 +33,24 @@
requires_connection = FALSE
// EMP
-
-/obj/machinery/camera/emp_proof/populate_parts(full_populate)
- . = ..()
- install_component(/obj/item/stock_parts/capacitor/adv, TRUE)
+/obj/machinery/camera/emp_proof
+ uncreated_component_parts = list(/obj/item/stock_parts/capacitor/adv = 1)
// X-RAY
-
/obj/machinery/camera/xray
- icon_state = "xraycam" // Thanks to Krutchen for the icons.
-
-/obj/machinery/camera/xray/populate_parts(full_populate)
- . = ..()
- install_component(/obj/item/stock_parts/scanning_module/adv, TRUE)
+ uncreated_component_parts = list(/obj/item/stock_parts/scanning_module/adv = 1)
// MOTION
-
-/obj/machinery/camera/motion/populate_parts(full_populate)
- . = ..()
- install_component(/obj/item/stock_parts/micro_laser, TRUE)
+/obj/machinery/camera/motion
+ uncreated_component_parts = list(/obj/item/stock_parts/micro_laser = 1)
// ALL UPGRADES
-
-/obj/machinery/camera/all/populate_parts(full_populate)
- . = ..()
- install_component(/obj/item/stock_parts/capacitor/adv, TRUE)
- install_component(/obj/item/stock_parts/scanning_module/adv, TRUE)
- install_component(/obj/item/stock_parts/micro_laser, TRUE)
+/obj/machinery/camera/all
+ uncreated_component_parts = list(
+ /obj/item/stock_parts/capacitor/adv = 1,
+ /obj/item/stock_parts/scanning_module/adv = 1,
+ /obj/item/stock_parts/micro_laser = 1
+ )
// AUTONAME left as a map stub
/obj/machinery/camera/autoname
\ No newline at end of file
diff --git a/code/game/machinery/camera/robot_camera.dm b/code/game/machinery/camera/robot_camera.dm
index fc74d78f8096..cf3463664fa9 100644
--- a/code/game/machinery/camera/robot_camera.dm
+++ b/code/game/machinery/camera/robot_camera.dm
@@ -1,14 +1,14 @@
/datum/extension/network_device/camera/robot
- expected_type = /mob/living/silicon/robot
+ expected_type = /mob/living/silicon/robot
/datum/extension/network_device/camera/robot/is_functional()
- var/mob/living/silicon/robot/R = holder
- if(R.wires.IsIndexCut(BORG_WIRE_CAMERA))
+ var/mob/living/silicon/robot/robot = holder
+ if(robot.wires.IsIndexCut(BORG_WIRE_CAMERA))
return FALSE
- if(!R.has_power)
+ if(!robot.has_power)
return FALSE
- if(R.stat == DEAD)
+ if(robot.stat == DEAD)
return FALSE
- if(!R.is_component_functioning("camera"))
+ if(!robot.is_component_functioning("camera"))
return FALSE
return TRUE
\ No newline at end of file
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 5a27cca96219..9cc55afa80f1 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -52,8 +52,8 @@
STOP_PROCESSING_MACHINE(src, MACHINERY_PROCESS_SELF)
update_icon()
-/obj/machinery/cell_charger/attackby(obj/item/W, mob/user)
- if(IS_WRENCH(W) && !panel_open)
+/obj/machinery/cell_charger/attackby(obj/item/used_item, mob/user)
+ if(IS_WRENCH(used_item) && !panel_open)
. = TRUE
if(get_cell())
to_chat(user, "Remove the cell first!")
diff --git a/code/game/machinery/centrifuge.dm b/code/game/machinery/centrifuge.dm
new file mode 100644
index 000000000000..217e63809e5e
--- /dev/null
+++ b/code/game/machinery/centrifuge.dm
@@ -0,0 +1,183 @@
+/datum/storage/hopper/industrial/centrifuge
+ can_hold = list(
+ /obj/item/food,
+ )
+ expected_type = /obj/machinery/centrifuge
+
+/datum/storage/hopper/industrial/centrifuge/proc/should_ingest(mob/user, obj/item/thing)
+ if(thing.reagents?.total_volume <= 0)
+ if(user)
+ to_chat(user, SPAN_WARNING("\The [thing] is empty."))
+ return FALSE
+ return TRUE
+
+/datum/storage/hopper/industrial/centrifuge/can_be_inserted(obj/item/inserting, mob/user, stop_messages, click_params)
+ . = ..()
+ if(. && !should_ingest(user, inserting))
+ return FALSE
+
+/obj/machinery/centrifuge
+ name = "industrial centrifuge"
+ desc = "A machine used to extract reagents and materials from objects via spinning them at extreme speed."
+ icon = 'icons/obj/machines/centrifuge.dmi'
+ icon_state = ICON_STATE_WORLD
+ anchored = TRUE
+ density = TRUE
+ construct_state = /decl/machine_construction/default/panel_closed
+ uncreated_component_parts = null
+ storage = /datum/storage/hopper/industrial/centrifuge
+ base_type = /obj/machinery/centrifuge
+ stat_immune = 0
+
+ // Reference to our reagent container. Set to a path to create on init.
+ var/obj/item/loaded_beaker
+
+ // Stolen from fabricators.
+ var/sound_id
+ var/datum/sound_token/sound_token
+ var/work_sound = 'sound/machines/fabricator_loop.ogg'
+
+/obj/machinery/centrifuge/mapped
+ loaded_beaker = /obj/item/chems/glass/beaker/large
+
+/obj/machinery/centrifuge/Initialize()
+ . = ..()
+ if(ispath(loaded_beaker))
+ loaded_beaker = new loaded_beaker
+
+/obj/machinery/centrifuge/get_stored_inventory()
+ . = ..()
+ if(LAZYLEN(.))
+ LAZYREMOVE(., loaded_beaker)
+
+/obj/machinery/centrifuge/Destroy()
+ QDEL_NULL(loaded_beaker)
+ return ..()
+
+/obj/machinery/centrifuge/dismantle()
+ if(loaded_beaker)
+ loaded_beaker.dropInto(loc)
+ loaded_beaker = null
+ return ..()
+
+/obj/machinery/centrifuge/components_are_accessible(path)
+ return use_power != POWER_USE_ACTIVE && ..()
+
+/obj/machinery/centrifuge/cannot_transition_to(state_path, mob/user)
+ if(use_power == POWER_USE_ACTIVE)
+ return SPAN_NOTICE("You must wait for \the [src] to finish first!")
+ return ..()
+
+/obj/machinery/centrifuge/attackby(obj/item/used_item, mob/user)
+
+ if(use_power == POWER_USE_ACTIVE)
+ to_chat(user, SPAN_NOTICE("\The [src] is currently spinning, wait until it's finished."))
+ return TRUE
+
+ if((. = component_attackby(used_item, user)))
+ return
+
+ // Load in a new container for products.
+ if(istype(used_item, /obj/item/chems/glass/beaker))
+ if(loaded_beaker)
+ to_chat(user, SPAN_WARNING("\The [src] already has a beaker loaded."))
+ return TRUE
+ if(user.try_unequip(used_item, src))
+ loaded_beaker = used_item
+ to_chat(user, SPAN_NOTICE("You load \the [loaded_beaker] into \the [src]."))
+ return TRUE
+
+ // Parent call handles inserting the frame into our contents,
+ return ..()
+
+/obj/machinery/centrifuge/attack_hand(mob/user)
+
+ if(use_power == POWER_USE_ACTIVE)
+ user.visible_message("\The [user] disengages \the [src].")
+ update_use_power(POWER_USE_IDLE)
+ return TRUE
+
+ if(use_power == POWER_USE_IDLE)
+ if(!loaded_beaker || QDELETED(loaded_beaker))
+ to_chat(user, SPAN_WARNING("\The [src] has no beaker loaded to receive any products."))
+ loaded_beaker = null // just in case
+ return TRUE
+
+ if(length(get_stored_inventory()))
+ user.visible_message("\The [user] engages \the [src].")
+ update_use_power(POWER_USE_ACTIVE)
+ else
+ to_chat(user, SPAN_WARNING("\The [src]'s hopper is empty."))
+ return TRUE
+
+ if(use_power == POWER_USE_OFF || !operable())
+ to_chat(user, SPAN_WARNING("\The [src]'s interface is unresponsive."))
+ return TRUE
+
+ return ..()
+
+/obj/machinery/centrifuge/Process(wait, tick)
+ ..()
+
+ if(use_power != POWER_USE_ACTIVE)
+ return
+
+ if(!loaded_beaker)
+ visible_message("\The [src] stops spinning and flashes a red light.")
+ update_use_power(POWER_USE_IDLE)
+ return
+
+ var/list/processing_items = get_stored_inventory()
+ if(!length(processing_items))
+ visible_message("\The [src] stops spinning and flashes a green light.")
+ update_use_power(POWER_USE_IDLE)
+ return
+
+ var/obj/item/thing = processing_items[1]
+ thing.handle_centrifuge_process(src)
+ if(!QDELETED(thing) && loc)
+ thing.dropInto(loc)
+
+/obj/machinery/centrifuge/Initialize()
+ sound_id = "[work_sound]"
+ return ..()
+
+/obj/machinery/centrifuge/Destroy()
+ QDEL_NULL(sound_token)
+ return ..()
+
+/obj/machinery/centrifuge/update_use_power()
+ . = ..()
+ if(use_power == POWER_USE_ACTIVE)
+ if(!sound_token)
+ sound_token = play_looping_sound(src, sound_id, work_sound, volume = 30)
+ else
+ QDEL_NULL(sound_token)
+
+/obj/machinery/centrifuge/on_update_icon()
+ icon_state = initial(icon_state)
+ if(stat & BROKEN)
+ icon_state = "[icon_state]-broken"
+ else if(use_power == POWER_USE_OFF || !operable())
+ icon_state = "[icon_state]-off"
+ else if(use_power == POWER_USE_ACTIVE)
+ icon_state = "[icon_state]-working"
+
+/obj/machinery/centrifuge/get_quick_interaction_handler(mob/user)
+ return loaded_beaker ? GET_DECL(/decl/interaction_handler/remove_centrifuge_beaker) : null
+
+/obj/machinery/centrifuge/get_alt_interactions(var/mob/user)
+ . = ..()
+ if(loaded_beaker)
+ LAZYADD(., /decl/interaction_handler/remove_centrifuge_beaker)
+
+/decl/interaction_handler/remove_centrifuge_beaker
+ name = "Remove Beaker"
+ expected_target_type = /obj/machinery/centrifuge
+
+/decl/interaction_handler/remove_centrifuge_beaker/invoked(atom/target, mob/user, obj/item/prop)
+ var/obj/machinery/centrifuge/centrifuge = target
+ if(centrifuge.loaded_beaker)
+ centrifuge.loaded_beaker.dropInto(centrifuge.loc)
+ user.put_in_hands(centrifuge.loaded_beaker)
+ centrifuge.loaded_beaker = null
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index c76905972bca..79bb78e9540e 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -108,59 +108,59 @@ var/global/list/empty_playable_ai_cores = list()
else
icon_state = "0"
-/obj/structure/aicore/attackby(obj/item/P, mob/user)
+/obj/structure/aicore/attackby(obj/item/used_item, mob/user)
. = ..()
if(.)
update_icon()
else
if(!authorized)
- if(access_ai_upload in P.GetAccess())
- to_chat(user, SPAN_NOTICE("You swipe [P] at [src] and authorize it to connect into the systems of [global.using_map.full_name]."))
+ if(access_ai_upload in used_item.GetAccess())
+ to_chat(user, SPAN_NOTICE("You swipe [used_item] at [src] and authorize it to connect into the systems of [global.using_map.full_name]."))
authorized = 1
if(anchored)
if(!glass_installed && wired)
- if(istype(P, /obj/item/stock_parts/circuitboard/aicore))
+ if(istype(used_item, /obj/item/stock_parts/circuitboard/aicore))
if(circuit)
to_chat(user, SPAN_WARNING("There is already a circuit installed in \the [src]."))
return TRUE
if(!wired)
to_chat(user, SPAN_WARNING("Wire \the [src] first."))
return TRUE
- if(user.try_unequip(P, src))
+ if(user.try_unequip(used_item, src))
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, SPAN_NOTICE("You place the circuit board inside the frame."))
- circuit = P
+ circuit = used_item
update_icon()
return TRUE
if(circuit && circuit_secured)
- if(istype(P, /obj/item/organ/internal) && wired && circuit && circuit_secured)
- var/obj/item/organ/internal/M = P
+ if(istype(used_item, /obj/item/organ/internal) && wired && circuit && circuit_secured)
+ var/obj/item/organ/internal/M = used_item
var/mob/living/brainmob = M.get_brainmob()
if(!brainmob)
- to_chat(user, SPAN_WARNING("Sticking a mindless [P] into the frame would be pointless."))
+ to_chat(user, SPAN_WARNING("Sticking a mindless [used_item] into the frame would be pointless."))
return
if(brainmob.stat == DEAD)
- to_chat(user, SPAN_WARNING("Sticking a dead [P] into the frame would sort of defeat the purpose."))
+ to_chat(user, SPAN_WARNING("Sticking a dead [used_item] into the frame would sort of defeat the purpose."))
return
if(jobban_isbanned(brainmob, "AI"))
- to_chat(user, SPAN_WARNING("This [P] does not seem to fit."))
+ to_chat(user, SPAN_WARNING("This [used_item] does not seem to fit."))
return
- if(!user.try_unequip(P, src))
+ if(!user.try_unequip(used_item, src))
if(brainmob.mind)
clear_antag_roles(brainmob.mind, 1)
- brain = P
- to_chat(usr, "You connect \the [P] to the frame and slide it into the casing.")
+ brain = used_item
+ to_chat(usr, "You connect \the [used_item] to the frame and slide it into the casing.")
update_icon()
return TRUE
- if(istype(P, /obj/item/stack/material))
- var/obj/item/stack/material/RG = P
+ if(istype(used_item, /obj/item/stack/material))
+ var/obj/item/stack/material/RG = used_item
if(RG.material.type != /decl/material/solid/glass || !RG.reinf_material || RG.get_amount() < 2)
to_chat(user, SPAN_WARNING("You need two sheets of reinforced glass to put in the glass panel."))
return TRUE
@@ -175,14 +175,14 @@ var/global/list/empty_playable_ai_cores = list()
update_icon()
return TRUE
- if(istype(P, /obj/item/aiModule/freeform))
- var/obj/item/aiModule/freeform/M = P
+ if(istype(used_item, /obj/item/aiModule/freeform))
+ var/obj/item/aiModule/freeform/M = used_item
laws.add_inherent_law(M.newFreeFormLaw)
to_chat(usr, "Added a freeform law.")
return TRUE
- if(istype(P, /obj/item/aiModule))
- var/obj/item/aiModule/module = P
+ if(istype(used_item, /obj/item/aiModule))
+ var/obj/item/aiModule/module = used_item
laws.clear_inherent_laws()
if(module.laws)
for(var/datum/ai_law/AL in module.laws.inherent_laws)
@@ -224,9 +224,9 @@ var/global/list/deactivated_ai_cores = list()
card.clear()
qdel(src)
-/obj/structure/aicore/deactivated/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/aicard))
- var/obj/item/aicard/card = W
+/obj/structure/aicore/deactivated/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/aicard))
+ var/obj/item/aicard/card = used_item
var/mob/living/silicon/ai/transfer = locate() in card
if(transfer)
load_ai(transfer,card,user)
diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm
index 6b52228b8ec4..4fcf1b94292d 100644
--- a/code/game/machinery/computer/guestpass.dm
+++ b/code/game/machinery/computer/guestpass.dm
@@ -58,19 +58,20 @@
var/reason = "NOT SPECIFIED"
var/duration_max = 60
var/duration = 5
+ var/terminal_serial
var/list/internal_log = list()
var/mode = 0 // 0 - making pass, 1 - viewing logs
/obj/machinery/computer/guestpass/Initialize()
. = ..()
- uid = "[random_id("guestpass_serial_number",100,999)]-G[rand(10,99)]"
+ terminal_serial = "[random_id("guestpass_serial_number",100,999)]-G[rand(10,99)]"
-/obj/machinery/computer/guestpass/attackby(obj/O, mob/user)
- if(istype(O, /obj/item/card/id))
- if(!giver && user.try_unequip(O))
- O.forceMove(src)
- giver = O
+/obj/machinery/computer/guestpass/attackby(obj/used_item, mob/user)
+ if(istype(used_item, /obj/item/card/id))
+ if(!giver && user.try_unequip(used_item))
+ used_item.forceMove(src)
+ giver = used_item
updateUsrDialog()
else if(giver)
to_chat(user, SPAN_WARNING("There is already ID card inside."))
@@ -151,19 +152,19 @@
giver = null
accesses.Cut()
else
- var/obj/item/I = user.get_active_held_item()
- if (istype(I, /obj/item/card/id) && user.try_unequip(I))
- I.forceMove(src)
- giver = I
+ var/obj/item/used_item = user.get_active_held_item()
+ if (istype(used_item, /obj/item/card/id) && user.try_unequip(used_item))
+ used_item.forceMove(src)
+ giver = used_item
. = TOPIC_REFRESH
else if (href_list["print"])
- var/dat = "Activity log of guest pass terminal #[uid]
"
+ var/dat = "Activity log of guest pass terminal #[terminal_serial]
"
for (var/entry in internal_log)
dat += "[entry]
"
- var/obj/item/paper/P = new/obj/item/paper( loc )
- P.SetName("activity log")
- P.info = dat
+ var/obj/item/paper/paper = new/obj/item/paper( loc )
+ paper.SetName("activity log")
+ paper.info = dat
. = TOPIC_REFRESH
else if (href_list["issue"])
diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm
index 992d2b211b51..8128cf6e71da 100644
--- a/code/game/machinery/computer/law.dm
+++ b/code/game/machinery/computer/law.dm
@@ -4,13 +4,12 @@
icon_screen = "command"
var/mob/living/silicon/current
-/obj/machinery/computer/upload/attackby(obj/item/O, mob/user)
- if(istype(O, /obj/item/aiModule))
- var/obj/item/aiModule/M = O
+/obj/machinery/computer/upload/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/aiModule))
+ var/obj/item/aiModule/M = used_item
M.install(src, user)
return TRUE
- else
- return ..()
+ return ..()
/obj/machinery/computer/upload/ai
name = "\improper AI upload console"
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index da48f9028515..ab639d35a2e9 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -41,12 +41,12 @@
break
. = tracking_linked_server
-/obj/machinery/computer/message_monitor/attackby(obj/item/O, mob/user)
+/obj/machinery/computer/message_monitor/attackby(obj/item/used_item, mob/user)
if(stat & (NOPOWER|BROKEN))
return ..()
if(!istype(user))
return TRUE
- if(IS_SCREWDRIVER(O) && emagged)
+ if(IS_SCREWDRIVER(used_item) && emagged)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
to_chat(user, "It is too hot to mess with!")
return TRUE
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index b3903352d555..aa9eb1647d52 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -78,5 +78,5 @@
if(!warning) return TOPIC_HANDLED
var/obj/item/implant/I = locate(href_list["warn"])
if(I?.imp_in)
- var/mob/living/R = I.imp_in
- to_chat(R, "You hear a voice in your head saying: '[warning]'")
+ var/mob/living/victim = I.imp_in
+ to_chat(victim, "You hear a voice in your head saying: '[warning]'")
diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm
index 4b1d38034e52..81e3a6b26706 100644
--- a/code/game/machinery/computer/robot.dm
+++ b/code/game/machinery/computer/robot.dm
@@ -108,47 +108,47 @@
/obj/machinery/computer/robotics/proc/get_cyborgs(var/mob/user)
var/list/robots = list()
- for(var/mob/living/silicon/robot/R in global.silicon_mob_list)
+ for(var/mob/living/silicon/robot/robot in global.silicon_mob_list)
// Ignore drones
- if(isdrone(R))
+ if(isdrone(robot))
continue
// Ignore antagonistic cyborgs
- if(R.scrambledcodes)
+ if(robot.scrambledcodes)
continue
- var/list/robot = list()
- robot["name"] = R.name
- var/turf/T = get_turf(R)
+ var/list/robot_data = list()
+ robot_data["name"] = robot.name
+ var/turf/T = get_turf(robot)
var/area/A = get_area(T)
if(istype(T) && istype(A) && isContactLevel(T.z))
- robot["location"] = "[A.proper_name] ([T.x], [T.y])"
+ robot_data["location"] = "[A.proper_name] ([T.x], [T.y])"
else
- robot["location"] = "Unknown"
+ robot_data["location"] = "Unknown"
- if(R.stat)
- robot["status"] = "Not Responding"
- else if (R.lockcharge)
- robot["status"] = "Lockdown"
+ if(robot.stat)
+ robot_data["status"] = "Not Responding"
+ else if (robot.lockcharge)
+ robot_data["status"] = "Lockdown"
else
- robot["status"] = "Operational"
+ robot_data["status"] = "Operational"
- if(R.cell)
- robot["cell"] = 1
- robot["cell_capacity"] = R.cell.maxcharge
- robot["cell_current"] = R.cell.charge
- robot["cell_percentage"] = round(R.cell.percent())
+ if(robot.cell)
+ robot_data["cell"] = 1
+ robot_data["cell_capacity"] = robot.cell.maxcharge
+ robot_data["cell_current"] = robot.cell.charge
+ robot_data["cell_percentage"] = round(robot.cell.percent())
else
- robot["cell"] = 0
+ robot_data["cell"] = 0
- robot["module"] = R.module ? R.module.name : "None"
- robot["master_ai"] = R.connected_ai ? R.connected_ai.name : "None"
- robot["hackable"] = 0
+ robot_data["module"] = robot.module ? robot.module.name : "None"
+ robot_data["master_ai"] = robot.connected_ai ? robot.connected_ai.name : "None"
+ robot_data["hackable"] = 0
// Antag AIs know whether linked cyborgs are hacked or not.
- if(user && isAI(user) && (R.connected_ai == user) && player_is_antag(user.mind))
- robot["hacked"] = R.emagged ? 1 : 0
- robot["hackable"] = R.emagged? 0 : 1
- robots.Add(list(robot))
+ if(user && isAI(user) && (robot.connected_ai == user) && player_is_antag(user.mind))
+ robot_data["hacked"] = robot.emagged ? 1 : 0
+ robot_data["hackable"] = robot.emagged? 0 : 1
+ robots.Add(list(robot_data))
return robots
// Proc: get_cyborg_by_name()
@@ -157,6 +157,6 @@
/obj/machinery/computer/robotics/proc/get_cyborg_by_name(var/name)
if (!name)
return
- for(var/mob/living/silicon/robot/R in global.silicon_mob_list)
- if(R.name == name)
- return R
+ for(var/mob/living/silicon/robot/robot in global.silicon_mob_list)
+ if(robot.name == name)
+ return robot
diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm
index dad8eb391e9a..a63d6d3b2ead 100644
--- a/code/game/machinery/computer/shuttle.dm
+++ b/code/game/machinery/computer/shuttle.dm
@@ -9,7 +9,7 @@
var/list/authorized = list( )
-/obj/machinery/computer/shuttle/attackby(var/obj/item/card as obj, var/mob/user as mob)
+/obj/machinery/computer/shuttle/attackby(var/obj/item/used_item, var/mob/user)
if(stat & (BROKEN|NOPOWER)) return TRUE
var/datum/evacuation_controller/shuttle/evac_control = SSevac.evacuation_controller
@@ -17,20 +17,20 @@
to_chat(user, "This console should not be in use on this map. Please report this to a developer.")
return TRUE
- if(!istype(card, /obj/item/card)) // don't try to get an ID card if we're an emag
- card = card.GetIdCard() // handles stored IDs in modcomps and similar
+ if(!istype(used_item, /obj/item/card)) // don't try to get an ID card if we're an emag
+ used_item = used_item.GetIdCard() // handles stored IDs in modcomps and similar
- if ((!istype(card, /obj/item/card) || evac_control.has_evacuated() || !user))
+ if ((!istype(used_item, /obj/item/card) || evac_control.has_evacuated() || !user))
return FALSE
- if (istype(card, /obj/item/card/id))
- var/obj/item/card/id/id_card = card
+ if (istype(used_item, /obj/item/card/id))
+ var/obj/item/card/id/id_card = used_item
if(!LAZYISIN(id_card.access, access_bridge)) //doesn't have this access
to_chat(user, "The access level of [id_card.registered_name]\'s card is not high enough.")
return TRUE
var/choice = alert(user, "Would you like to (un)authorize a shortened launch time? [auth_need - authorized.len] authorization\s are still needed. Use abort to cancel all authorizations.", "Shuttle Launch", "Authorize", "Repeal", "Abort")
- if(evac_control.is_prepared() && user.get_active_held_item() != card)
+ if(evac_control.is_prepared() && user.get_active_held_item() != used_item)
return TRUE
switch(choice)
if("Authorize")
@@ -59,10 +59,10 @@
src.authorized = list( )
return TRUE
- else if (istype(card, /obj/item/card/emag) && !emagged)
+ else if (istype(used_item, /obj/item/card/emag) && !emagged)
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
- if(!emagged && !evac_control.is_prepared() && user.get_active_held_item() == card && choice == "Launch")
+ if(!emagged && !evac_control.is_prepared() && user.get_active_held_item() == used_item && choice == "Launch")
to_world("Alert: Shuttle launch time shortened to 10 seconds!")
evac_control.set_launch_time(world.time+100)
emagged = 1
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 1892189e038e..7a0bf2fccd41 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -157,7 +157,9 @@
var/occupied_icon_state = "body_scanner_1"
var/on_store_message = "has entered long-term storage."
var/on_store_name = "Cryogenic Oversight"
+ var/on_store_visible_message = "$TARGET$ hums and hisses as it moves $USER$ into storage." //! A visible message to display when the user is despawned. $USER$ will be replaced with the user's name, $TARGET$ will be replaced with the pod's name.
var/on_enter_occupant_message = "You feel cool air surround you. You go numb as your senses turn inward."
+ var/on_enter_visible_message = "$USER$ starts climbing into $TARGET$." //! A visible message to display when the user enters the pod. $USER$ will be replaced with the user's name.
var/allow_occupant_types = list(/mob/living/human)
var/disallow_occupant_types = list()
@@ -188,6 +190,31 @@
disallow_occupant_types = list(/mob/living/silicon/robot/drone)
applies_stasis = 0
+// Cryo
+/obj/machinery/cryopod/robot/door
+ //This inherits from the robot cryo, so synths can be properly cryo'd. If a non-synth enters and is cryo'd, ..() is called and it'll still work.
+ abstract_type = /obj/machinery/cryopod/robot/door
+ name = "Airlock of Wonders"
+ desc = "An airlock that isn't an airlock, and shouldn't exist. Yell at a coder/mapper."
+ icon = 'icons/obj/machines/tramdoors.dmi'
+ icon_state = "door_closed"
+ base_icon_state = "door_closed"
+ occupied_icon_state = "door_locked"
+ on_enter_visible_message = "$USER$ steps into $TARGET$."
+
+ time_till_despawn = 1 MINUTE //We want to be much faster then normal cryo, since waiting in an elevator for half an hour is a special kind of hell.
+
+ allow_occupant_types = list(/mob/living/silicon/robot,/mob/living/human)
+ disallow_occupant_types = list(/mob/living/silicon/robot/drone)
+
+/obj/machinery/cryopod/robot/door/dorms
+ name = "Residential District Elevator"
+ desc = "A small elevator that goes down to the deeper section of the colony."
+ on_store_message = "has departed for the residential district."
+ on_store_name = "Residential Oversight"
+ on_enter_occupant_message = "The elevator door closes slowly, ready to bring you down to the residential district."
+ on_store_visible_message = "$TARGET$ makes a ding as it moves $USER$ to the residential district."
+
/obj/machinery/cryopod/lifepod
name = "life pod"
desc = "A man-sized pod for entering suspended animation. Dubbed 'cryocoffin' by more cynical spacers, it is pretty barebone, counting on stasis system to keep the victim alive rather than packing extended supply of food or air. Can be ordered with symbols of common religious denominations to be used in space funerals too."
@@ -248,7 +275,7 @@
/obj/machinery/cryopod/lifepod/Process()
if(SSevac.evacuation_controller && SSevac.evacuation_controller.state >= EVAC_LAUNCHING)
if(occupant && !launched)
- launch()
+ INVOKE_ASYNC(src, PROC_REF(launch))
..()
/obj/machinery/cryopod/Destroy()
@@ -299,11 +326,14 @@
if (occupant && user.Adjacent(src))
. += occupant.get_examine_strings(user, distance, infix, suffix)
+/obj/machinery/cryopod/get_cryogenic_power()
+ return applies_stasis ? 1 : 0
+
//Lifted from Unity stasis.dm and refactored.
/obj/machinery/cryopod/Process()
if(occupant)
if(applies_stasis && (world.time > time_entered + 20 SECONDS))
- occupant.set_stasis(2)
+ occupant.add_mob_modifier(/decl/mob_modifier/stasis, 2 SECONDS, source = src)
//Allow a ten minute gap between entering the pod and actually despawning.
// Only provide the gap if the occupant hasn't ghosted
@@ -356,6 +386,7 @@
control_computer._admin_logs += "[key_name(occupant)] ([role_alt_title]) at [stationtime2text()]"
log_and_message_admins("[key_name(occupant)] ([role_alt_title]) entered cryostorage.")
+ visible_message(SPAN_NOTICE(emote_replace_user_tokens(emote_replace_target_tokens(on_store_visible_message, src), occupant)))
do_telecomms_announcement(src, "[occupant.real_name], [role_alt_title], [on_store_message]", "[on_store_name]")
despawn_character(occupant)
set_occupant(null)
@@ -366,7 +397,10 @@
if(alert(target,"Would you like to enter long-term storage?",,"Yes","No") != "Yes")
return
if(!user.incapacitated() && !user.anchored && user.Adjacent(src) && user.Adjacent(target))
- visible_message("[user] starts putting [target] into \the [src].", range = 3)
+ if(target == user)
+ visible_message(SPAN_NOTICE(emote_replace_user_tokens(emote_replace_target_tokens(on_enter_visible_message, src), usr)), range = 3)
+ else
+ visible_message("[user] starts putting [target] into \the [src].", range = 3)
if(!do_after(user, 20, src)|| QDELETED(target))
return
set_occupant(target)
@@ -417,8 +451,8 @@
var/list/items = get_contained_external_atoms()
if(occupant) items -= occupant
- for(var/obj/item/W in items)
- W.dropInto(loc)
+ for(var/obj/item/thing in items)
+ thing.dropInto(loc)
src.go_out()
add_fingerprint(usr)
@@ -441,7 +475,7 @@
if(!usr.can_enter_cryopod(usr))
return
- visible_message("\The [usr] starts climbing into \the [src].", range = 3)
+ visible_message(emote_replace_user_tokens(emote_replace_target_tokens(on_enter_visible_message, src), usr), range = 3)
if(do_after(usr, 20, src))
@@ -484,7 +518,7 @@
if(occupant.client)
if(!silent)
- to_chat(occupant, SPAN_NOTICE("[on_enter_occupant_message]"))
+ occupant.visible_message("\The [src] [emote_replace_target_tokens(on_enter_visible_message)]", SPAN_NOTICE(on_enter_occupant_message))
to_chat(occupant, SPAN_NOTICE("If you ghost, log out or close your client now, your character will shortly be permanently removed from the round."))
occupant.client.perspective = EYE_PERSPECTIVE
occupant.client.eye = src
@@ -520,14 +554,14 @@
to_chat(user, SPAN_NOTICE("The glass is already open."))
return TRUE
-/obj/structure/broken_cryo/attackby(obj/item/W, mob/user)
+/obj/structure/broken_cryo/attackby(obj/item/used_item, mob/user)
if (busy)
to_chat(user, SPAN_NOTICE("Someone else is attempting to open this."))
return TRUE
if (!closed)
to_chat(user, SPAN_NOTICE("The glass cover is already open."))
return TRUE
- if (IS_CROWBAR(W))
+ if (IS_CROWBAR(used_item))
busy = 1
visible_message("[user] starts to pry the glass cover off of \the [src].")
if (!do_after(user, 50, src))
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 345a6b0359aa..7172c5958187 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -19,8 +19,8 @@
. = ..()
icon_state = "barrier[src.locked]"
-/obj/machinery/deployable/barrier/attackby(obj/item/W, mob/user)
- if (istype(W, /obj/item/card/id))
+/obj/machinery/deployable/barrier/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item, /obj/item/card/id))
if (src.allowed(user))
if (src.emagged < 2.0)
src.locked = !src.locked
@@ -36,7 +36,7 @@
spark_at(src, amount=2, cardinal_only = TRUE)
visible_message("BZZzZZzZZzZT")
return TRUE
- else if(IS_WRENCH(W))
+ else if(IS_WRENCH(used_item))
var/current_max_health = get_max_health()
if (current_health < current_max_health)
current_health = current_max_health
@@ -50,11 +50,11 @@
visible_message("[user] repairs \the [src]!")
return TRUE
else
- switch(W.atom_damage_type)
+ switch(used_item.atom_damage_type)
if(BURN)
- current_health -= W.expend_attack_force(user) * 0.75
+ current_health -= used_item.expend_attack_force(user) * 0.75
if(BRUTE)
- current_health -= W.expend_attack_force(user) * 0.5
+ current_health -= used_item.expend_attack_force(user) * 0.5
if (current_health <= 0)
explode()
return TRUE
diff --git a/code/game/machinery/doors/_door.dm b/code/game/machinery/doors/_door.dm
index 39628fe7da0b..17dfd16d50df 100644
--- a/code/game/machinery/doors/_door.dm
+++ b/code/game/machinery/doors/_door.dm
@@ -248,11 +248,10 @@
else if(density)
do_animate("deny")
- update_icon()
return TRUE
-/obj/machinery/door/proc/handle_repair(obj/item/I, mob/user)
- if(istype(I, /obj/item/stack/material) && I.get_material_type() == src.get_material_type())
+/obj/machinery/door/proc/handle_repair(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/stack/material) && used_item.get_material_type() == src.get_material_type())
if(reason_broken & MACHINE_BROKEN_GENERIC)
to_chat(user, "It looks like \the [src] is pretty busted. It's going to need more than just patching up now.")
return TRUE
@@ -268,7 +267,7 @@
var/amount_needed = (current_max_health - current_health) / DOOR_REPAIR_AMOUNT
amount_needed = ceil(amount_needed)
- var/obj/item/stack/stack = I
+ var/obj/item/stack/stack = used_item
var/transfer
if (repairing)
transfer = stack.transfer_to(repairing, amount_needed - repairing.amount)
@@ -286,12 +285,12 @@
return TRUE
- if(repairing && IS_WELDER(I))
+ if(repairing && IS_WELDER(used_item))
if(!density)
to_chat(user, "\The [src] must be closed before you can repair it.")
return TRUE
- var/obj/item/weldingtool/welder = I
+ var/obj/item/weldingtool/welder = used_item
if(welder.weld(0,user))
to_chat(user, "You start to fix dents and weld \the [repairing] into place.")
playsound(src, 'sound/items/Welder.ogg', 100, 1)
@@ -303,15 +302,15 @@
repairing = null
return TRUE
- if(repairing && IS_CROWBAR(I))
+ if(repairing && IS_CROWBAR(used_item))
to_chat(user, "You remove \the [repairing].")
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
repairing.dropInto(user.loc)
repairing = null
return TRUE
-/obj/machinery/door/attackby(obj/item/I, mob/user)
- . = handle_repair(I, user)
+/obj/machinery/door/attackby(obj/item/used_item, mob/user)
+ . = handle_repair(used_item, user)
if(.)
return
return ..()
@@ -537,17 +536,17 @@
if( istype(T, /turf/wall))
success = 1
if(propagate)
- for(var/turf/wall/W in RANGE_TURFS(T, 1))
- W.wall_connections = null
- W.other_connections = null
- W.queue_icon_update()
+ for(var/turf/wall/wall in RANGE_TURFS(T, 1))
+ wall.wall_connections = null
+ wall.other_connections = null
+ wall.queue_icon_update()
else if(istype(T, /turf/unsimulated/wall))
success = 1
else
- for(var/obj/O in T)
+ for(var/obj/blend_obj in T)
for(var/blend_type in get_blend_objects())
- if( istype(O, blend_type))
+ if( istype(blend_obj, blend_type))
success = 1
if(success)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 004f0fc02a44..8c44f0f99c0b 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -428,12 +428,12 @@ About the new airlock wires panel:
set_airlock_overlays(AIRLOCK_OPENING)
flick("opening", src)//[stat ? "_stat":]
animating_state = AIRLOCK_OPEN
- update_icon()
+ addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon), AIRLOCK_OPEN), 1 SECOND) // wait to update icon so the light doesn't go out too soon
if("closing")
set_airlock_overlays(AIRLOCK_CLOSING)
flick("closing", src)
animating_state = AIRLOCK_CLOSED
- update_icon()
+ addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon), AIRLOCK_CLOSED), 1 SECOND) // wait to update icon so the light doesn't go out too soon
if("deny")
set_airlock_overlays(AIRLOCK_DENY)
if(density && arePowerSystemsOn())
@@ -441,7 +441,7 @@ About the new airlock wires panel:
if(speaker)
playsound(loc, open_failure_access_denied, 50, 0)
animating_state = AIRLOCK_CLOSED
- update_icon()
+ addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon), AIRLOCK_CLOSED), 1 SECOND) // wait to update icon so the light doesn't go out too soon
if("emag")
set_airlock_overlays(AIRLOCK_EMAG)
if(density && arePowerSystemsOn())
@@ -643,8 +643,8 @@ About the new airlock wires panel:
var/cut_sound
if(IS_WELDER(item))
- var/obj/item/weldingtool/WT = item
- if(!WT.weld(0,user))
+ var/obj/item/weldingtool/welder = item
+ if(!welder.weld(0,user))
return FALSE
cut_verb = "cutting"
cut_sound = 'sound/items/Welder.ogg'
@@ -716,13 +716,13 @@ About the new airlock wires panel:
src.unlock(1) //force it
return TRUE
-/obj/machinery/door/airlock/attackby(var/obj/item/C, var/mob/user)
+/obj/machinery/door/airlock/attackby(var/obj/item/used_item, var/mob/user)
// Brace is considered installed on the airlock, so interacting with it is protected from electrification.
- if(brace && (istype(C.GetIdCard(), /obj/item/card/id/) || istype(C, /obj/item/crowbar/brace_jack)))
- return brace.attackby(C, user)
+ if(brace && (istype(used_item.GetIdCard(), /obj/item/card/id/) || istype(used_item, /obj/item/crowbar/brace_jack)))
+ return brace.attackby(used_item, user)
- if(!brace && istype(C, /obj/item/airlock_brace))
- var/obj/item/airlock_brace/A = C
+ if(!brace && istype(used_item, /obj/item/airlock_brace))
+ var/obj/item/airlock_brace/A = used_item
if(!density)
to_chat(user, SPAN_WARNING("You must close \the [src] before installing \the [A]!"))
return TRUE
@@ -742,19 +742,19 @@ About the new airlock wires panel:
if(src.shock(user, 75))
return TRUE
- if(bash(C, user))
+ if(bash(used_item, user))
return TRUE
if (!repairing && (reason_broken & MACHINE_BROKEN_GENERIC) && src.locked) //bolted and broken
- . = cut_bolts(C, user)
+ . = cut_bolts(used_item, user)
if(!.)
. = ..()
return
- if(!repairing && IS_WELDER(C) && !operating && density)
- var/obj/item/weldingtool/W = C
- if(!W.weld(0,user))
- to_chat(user, SPAN_NOTICE("Your [W.name] doesn't have enough fuel."))
+ if(!repairing && IS_WELDER(used_item) && !operating && density)
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.weld(0,user))
+ to_chat(user, SPAN_NOTICE("Your [welder.name] doesn't have enough fuel."))
return TRUE
playsound(src, 'sound/items/Welder.ogg', 50, 1)
user.visible_message(SPAN_WARNING("\The [user] begins welding \the [src] [welded ? "open" : "closed"]!"),
@@ -769,11 +769,11 @@ About the new airlock wires panel:
to_chat(user, SPAN_NOTICE("You must remain still to complete this task."))
return TRUE
- else if(IS_WIRECUTTER(C) || IS_MULTITOOL(C) || istype(C, /obj/item/assembly/signaler))
+ else if(IS_WIRECUTTER(used_item) || IS_MULTITOOL(used_item) || istype(used_item, /obj/item/assembly/signaler))
return wires.Interact(user)
- else if(IS_CROWBAR(C))
- if(density && !can_open(TRUE) && component_attackby(C, user))
+ else if(IS_CROWBAR(used_item))
+ if(density && !can_open(TRUE) && component_attackby(used_item, user))
return TRUE
else if(!repairing)
// Add some minor damage as evidence of forcing.
@@ -792,8 +792,8 @@ About the new airlock wires panel:
close(1)
return TRUE
- if(istype(C, /obj/item/bladed/axe/fire) && !arePowerSystemsOn() && !(user.check_intent(I_FLAG_HARM)))
- var/obj/item/bladed/axe/fire/F = C
+ if(istype(used_item, /obj/item/bladed/axe/fire) && !arePowerSystemsOn() && !(user.check_intent(I_FLAG_HARM)))
+ var/obj/item/bladed/axe/fire/F = used_item
if(F.is_held_twohanded(user))
if(locked)
to_chat(user, SPAN_WARNING("The airlock's bolts prevent it from being forced."))
@@ -805,16 +805,15 @@ About the new airlock wires panel:
close(1)
else
if(user.can_twohand_item(F))
- to_chat(user, SPAN_WARNING("You need to be holding \the [C] in both hands to do that!"))
+ to_chat(user, SPAN_WARNING("You need to be holding \the [used_item] in both hands to do that!"))
else
- to_chat(user, SPAN_WARNING("You are too small to lever \the [src] open with \the [C]!"))
+ to_chat(user, SPAN_WARNING("You are too small to lever \the [src] open with \the [used_item]!"))
return TRUE
else if((stat & (BROKEN|NOPOWER)) && isanimal(user))
var/mob/living/simple_animal/A = user
- var/obj/item/I = A.get_natural_weapon()
- if(I?.expend_attack_force(user) >= 10)
+ if(used_item?.expend_attack_force(user) >= 10)
if(density)
visible_message(SPAN_DANGER("\The [A] forces \the [src] open!"))
open(1)
@@ -890,7 +889,7 @@ About the new airlock wires panel:
panel_open = TRUE
if(istype(construct_state, /decl/machine_construction/default/panel_closed))
var/decl/machine_construction/default/panel_closed/closed = construct_state
- construct_state = closed.down_state
+ construct_state = GET_DECL(closed.down_state)
construct_state.validate_state(src)
if (secured_wires)
lock()
@@ -988,7 +987,8 @@ About the new airlock wires panel:
if (lock_cut_state == BOLTS_CUT) return FALSE //what bolts?
- src.locked = TRUE
+ locked = TRUE
+ locking = FALSE
playsound(src, bolts_dropping, 30, 0, -6)
audible_message("You hear a click from the bottom of the door.", hearing_distance = 1)
update_icon()
@@ -996,20 +996,21 @@ About the new airlock wires panel:
return TRUE
/obj/machinery/door/airlock/proc/unlock(var/forced=0)
- if(!src.locked)
+ if(!locked)
return FALSE
if (!forced)
- if(!src.arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
+ if(!arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
return FALSE
if(operating)
locking = FALSE
unlocking = TRUE
return FALSE
- if(operating || !src.arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
+ if(!arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
return FALSE
- src.locked = FALSE
+ locked = FALSE
+ unlocking = FALSE
playsound(src, bolts_rising, 30, 0, -6)
audible_message("You hear a click from the bottom of the door.", hearing_distance = 1)
update_icon()
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index 579e29e33112..c1f9b50ebf6d 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -181,8 +181,8 @@
/obj/machinery/airlock_sensor/set_id_tag(var/new_id_tag)
. = ..()
- for(var/obj/item/stock_parts/radio/R in get_all_components_of_type(/obj/item/stock_parts/radio))
- R.set_id_tag(id_tag)
+ for(var/obj/item/stock_parts/radio/radio in get_all_components_of_type(/obj/item/stock_parts/radio))
+ radio.set_id_tag(id_tag)
/decl/public_access/public_variable/airlock_pressure
expected_type = /obj/machinery/airlock_sensor
@@ -331,8 +331,8 @@
/obj/machinery/button/access/set_id_tag(var/new_id_tag)
. = ..()
- for(var/obj/item/stock_parts/radio/R in get_all_components_of_type(/obj/item/stock_parts/radio))
- R.set_id_tag(id_tag)
+ for(var/obj/item/stock_parts/radio/radio in get_all_components_of_type(/obj/item/stock_parts/radio))
+ radio.set_id_tag(id_tag)
//
// Button Part Presets
diff --git a/code/game/machinery/doors/airlock_interactions.dm b/code/game/machinery/doors/airlock_interactions.dm
index 2ad96280a52c..2406735f21a7 100644
--- a/code/game/machinery/doors/airlock_interactions.dm
+++ b/code/game/machinery/doors/airlock_interactions.dm
@@ -59,8 +59,8 @@
for(var/i in 1 to round(crush_damage/AIRLOCK_CRUSH_INCREMENT, 1))
apply_damage(AIRLOCK_CRUSH_INCREMENT, BRUTE)
- set_status(STAT_STUN, round(crush_damage / 8, 1))
- set_status(STAT_WEAK, round(crush_damage / 8, 1))
+ set_status_condition(STAT_STUN, round(crush_damage / 8, 1))
+ set_status_condition(STAT_WEAK, round(crush_damage / 8, 1))
var/turf/T = loc
if(!istype(T))
diff --git a/code/game/machinery/doors/airlock_subtypes.dm b/code/game/machinery/doors/airlock_subtypes.dm
index 179b0d35d2c8..b3474720a5f6 100644
--- a/code/game/machinery/doors/airlock_subtypes.dm
+++ b/code/game/machinery/doors/airlock_subtypes.dm
@@ -163,9 +163,9 @@
name = "Escape Pod"
locked = TRUE
-/obj/machinery/door/airlock/external/escapepod/attackby(obj/item/C, mob/user)
+/obj/machinery/door/airlock/external/escapepod/attackby(obj/item/used_item, mob/user)
if(panel_open && !arePowerSystemsOn())
- if(IS_WRENCH(C))
+ if(IS_WRENCH(used_item))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message(SPAN_WARNING("[user.name] starts frantically pumping the bolt override mechanism!"), SPAN_WARNING("You start frantically pumping the bolt override mechanism!"))
if(do_after(user, 160) && locked)
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index 1fc6bb6afe3a..ca111e877bcf 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -142,13 +142,13 @@
return implicit_material
// Proc: attackby()
-// Parameters: 2 (C - Item this object was clicked with, user - Mob which clicked this object)
+// Parameters: 2 (used_item - Item this object was clicked with, user - Mob which clicked this object)
// Description: If we are clicked with crowbar or wielded fire axe, try to manually open the door.
// This only works on broken doors or doors without power. Also allows repair with Plasteel.
-/obj/machinery/door/blast/attackby(obj/item/C, mob/user)
- add_fingerprint(user, 0, C)
+/obj/machinery/door/blast/attackby(obj/item/used_item, mob/user)
+ add_fingerprint(user, 0, used_item)
if(!panel_open) //Do this here so the door won't change state while prying out the circuit
- if(IS_CROWBAR(C) || (istype(C, /obj/item/bladed/axe/fire) && C.is_held_twohanded()))
+ if(IS_CROWBAR(used_item) || (istype(used_item, /obj/item/bladed/axe/fire) && used_item.is_held_twohanded()))
if(((stat & NOPOWER) || (stat & BROKEN)) && !( operating ))
to_chat(user, "You begin prying at \the [src]...")
if(do_after(user, 2 SECONDS, src))
@@ -158,18 +158,18 @@
else
to_chat(user, "[src]'s motors resist your effort.")
return TRUE
- if(istype(C, /obj/item/stack/material) && C.get_material_type() == /decl/material/solid/metal/plasteel)
+ if(istype(used_item, /obj/item/stack/material) && used_item.get_material_type() == /decl/material/solid/metal/plasteel)
var/amt = ceil((get_max_health() - current_health)/150)
if(!amt)
to_chat(user, "\The [src] is already fully functional.")
return TRUE
- var/obj/item/stack/P = C
- if(!P.can_use(amt))
+ var/obj/item/stack/stack = used_item
+ if(!stack.can_use(amt))
to_chat(user, "You don't have enough sheets to repair this! You need at least [amt] sheets.")
return TRUE
to_chat(user, "You begin repairing \the [src]...")
if(do_after(user, 5 SECONDS, src))
- if(P.use(amt))
+ if(stack.use(amt))
to_chat(user, "You have repaired \the [src].")
repair()
else
diff --git a/code/game/machinery/doors/braces.dm b/code/game/machinery/doors/braces.dm
index 137c4cddb4f1..92846b45c43d 100644
--- a/code/game/machinery/doors/braces.dm
+++ b/code/game/machinery/doors/braces.dm
@@ -68,12 +68,12 @@
/obj/item/airlock_brace/attack_self(mob/user)
electronics.attack_self(user)
-/obj/item/airlock_brace/attackby(obj/item/W, mob/user)
- if (istype(W.GetIdCard(), /obj/item/card/id))
+/obj/item/airlock_brace/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item.GetIdCard(), /obj/item/card/id))
if(!airlock)
return attack_self(user)
else
- var/obj/item/card/id/C = W.GetIdCard()
+ var/obj/item/card/id/C = used_item.GetIdCard()
if(check_access(C))
to_chat(user, "You swipe \the [C] through \the [src].")
if(do_after(user, 10, airlock))
@@ -83,18 +83,18 @@
to_chat(user, "You swipe \the [C] through \the [src], but it does not react.")
return TRUE
- if (istype(W, /obj/item/crowbar/brace_jack))
+ if (istype(used_item, /obj/item/crowbar/brace_jack))
if(!airlock)
return FALSE
- var/obj/item/crowbar/brace_jack/C = W
+ var/obj/item/crowbar/brace_jack/C = used_item
to_chat(user, "You begin forcibly removing \the [src] with \the [C].")
if(do_after(user, rand(150,300), airlock))
to_chat(user, "You finish removing \the [src].")
unlock_brace(user)
return TRUE
- if(IS_WELDER(W))
- var/obj/item/weldingtool/C = W
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/C = used_item
if(!is_damaged())
to_chat(user, "\The [src] does not require repairs.")
return TRUE
diff --git a/code/game/machinery/doors/double.dm b/code/game/machinery/doors/double.dm
index 1cd2c99b2669..4bfc77f73631 100644
--- a/code/game/machinery/doors/double.dm
+++ b/code/game/machinery/doors/double.dm
@@ -58,10 +58,10 @@
if( istype(T, /turf/wall))
success = 1
if(propagate)
- var/turf/wall/W = T
- W.wall_connections = null
- W.other_connections = null
- W.queue_icon_update()
+ var/turf/wall/wall = T
+ wall.wall_connections = null
+ wall.other_connections = null
+ wall.queue_icon_update()
else
for(var/obj/O in T)
for(var/blend_type in get_blend_objects())
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 673d87c5bdde..732b04b47d39 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -217,19 +217,19 @@
nextstate = FIREDOOR_CLOSED
close()
-/obj/machinery/door/firedoor/attackby(obj/item/C, mob/user)
- add_fingerprint(user, 0, C)
+/obj/machinery/door/firedoor/attackby(obj/item/used_item, mob/user)
+ add_fingerprint(user, 0, used_item)
if(operating)
return TRUE //Already doing something.
- if(IS_WELDER(C) && !repairing)
- var/obj/item/weldingtool/W = C
- if(W.weld(0, user))
+ if(IS_WELDER(used_item) && !repairing)
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.weld(0, user))
playsound(src, 'sound/items/Welder.ogg', 100, 1)
if(do_after(user, 2 SECONDS, src))
- if(!W.isOn()) return TRUE
+ if(!welder.isOn()) return TRUE
blocked = !blocked
- user.visible_message("\The [user] [blocked ? "welds" : "unwelds"] \the [src] with \a [W].",\
- "You [blocked ? "weld" : "unweld"] \the [src] with \the [W].",\
+ user.visible_message("\The [user] [blocked ? "welds" : "unwelds"] \the [src] with \a [welder].",\
+ "You [blocked ? "weld" : "unweld"] \the [src] with \the [welder].",\
"You hear something being welded.")
playsound(src, 'sound/items/Welder.ogg', 100, 1)
update_icon()
@@ -237,33 +237,33 @@
to_chat(user, SPAN_WARNING("You must remain still to complete this task."))
return TRUE
- if(blocked && IS_CROWBAR(C))
- user.visible_message("\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\
+ if(blocked && IS_CROWBAR(used_item))
+ user.visible_message("\The [user] pries at \the [src] with \a [used_item], but \the [src] is welded in place!",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
return TRUE
- if(!blocked && (IS_CROWBAR(C) || istype(C,/obj/item/bladed/axe/fire)))
+ if(!blocked && (IS_CROWBAR(used_item) || istype(used_item,/obj/item/bladed/axe/fire)))
if(operating)
return ..()
- if(istype(C,/obj/item/bladed/axe/fire))
- var/obj/item/bladed/axe/fire/F = C
+ if(istype(used_item,/obj/item/bladed/axe/fire))
+ var/obj/item/bladed/axe/fire/F = used_item
if(!F.is_held_twohanded())
return ..()
- user.visible_message("\The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [C]!",\
- "You start forcing \the [src] [density ? "open" : "closed"] with \the [C]!",\
+ user.visible_message("\The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [used_item]!",\
+ "You start forcing \the [src] [density ? "open" : "closed"] with \the [used_item]!",\
"You hear metal strain.")
if(do_after(user, 3 SECONDS, src))
- if(IS_CROWBAR(C))
+ if(IS_CROWBAR(used_item))
if(stat & (BROKEN|NOPOWER) || !density)
- user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\
- "You force \the [src] [density ? "open" : "closed"] with \the [C]!",\
+ user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [used_item]!",\
+ "You force \the [src] [density ? "open" : "closed"] with \the [used_item]!",\
"You hear metal strain, and a door [density ? "open" : "close"].")
else
- user.visible_message("\The [user] forces \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \a [C]!",\
- "You force \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \the [C]!",\
+ user.visible_message("\The [user] forces \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \a [used_item]!",\
+ "You force \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \the [used_item]!",\
"You hear metal strain and groan, and a door [density ? "opening" : "closing"].")
if(density)
open(1)
@@ -348,7 +348,7 @@
panel_open = FALSE
if(istype(construct_state, /decl/machine_construction/default/panel_open))
var/decl/machine_construction/default/panel_open/open = construct_state
- construct_state = open.up_state
+ construct_state = GET_DECL(open.up_state)
construct_state.validate_state(src)
visible_message("The maintenance hatch of \the [src] closes.")
update_icon()
@@ -377,10 +377,10 @@
ATMOS_CANPASS_TURF(airblock, neighbour, myturf)
if(airblock & AIR_BLOCKED)
continue
- for(var/obj/O in myturf)
- if(istype(O, /obj/machinery/door))
+ for(var/obj/thing in myturf)
+ if(istype(thing, /obj/machinery/door))
continue
- ATMOS_CANPASS_MOVABLE(airblock, O, neighbour)
+ ATMOS_CANPASS_MOVABLE(airblock, thing, neighbour)
. |= airblock
if(. & AIR_BLOCKED)
continue
diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm
index bc3dcf1ab404..a861aa14a7db 100644
--- a/code/game/machinery/doors/firedoor_assembly.dm
+++ b/code/game/machinery/doors/firedoor_assembly.dm
@@ -10,19 +10,19 @@
var/result = /obj/machinery/door/firedoor
-/obj/structure/firedoor_assembly/attackby(var/obj/item/C, var/mob/user)
+/obj/structure/firedoor_assembly/attackby(var/obj/item/used_item, var/mob/user)
. = ..()
- if(!. && istype(C, /obj/item/stock_parts/circuitboard/airlock_electronics/firedoor) && wired)
+ if(!. && istype(used_item, /obj/item/stock_parts/circuitboard/airlock_electronics/firedoor) && wired)
if(!anchored)
to_chat(user, SPAN_WARNING("You must secure \the [src] first!"))
else
- if(!user.try_unequip(C, src))
+ if(!user.try_unequip(used_item, src))
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
visible_message(SPAN_NOTICE("\The [user] inserts a circuit into \the [src]."))
var/obj/machinery/door/firedoor/D = new result(get_turf(src), dir, FALSE)
- var/obj/item/stock_parts/circuitboard/airlock_electronics/firedoor/electronics = C
- D.install_component(C)
+ var/obj/item/stock_parts/circuitboard/airlock_electronics/firedoor/electronics = used_item
+ D.install_component(used_item)
electronics.construct(D)
D.construct_state.post_construct(D)
D.close()
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index e6366bcc0a0f..f39b5849a088 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -171,12 +171,12 @@
/obj/machinery/door/window/CanFluidPass(var/coming_from)
return !density || ((dir in global.cardinal) && coming_from != dir)
-/obj/machinery/door/window/attackby(obj/item/I, mob/user)
+/obj/machinery/door/window/attackby(obj/item/used_item, mob/user)
//If it's in the process of opening/closing, ignore the click
if(operating)
return TRUE
- if(bash(I, user))
+ if(bash(used_item, user))
return TRUE
. = ..()
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller.dm b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
index 026318090b40..0605e8f0ff8e 100644
--- a/code/game/machinery/embedded_controller/airlock_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
@@ -12,15 +12,15 @@
var/datum/computer/file/embedded_program/docking/airlock/docking_program = program
docking_program.display_name = display_name
-/obj/machinery/embedded_controller/radio/airlock/docking_port/attackby(obj/item/W, mob/user)
- if(IS_MULTITOOL(W)) //give them part of code, would take few tries to get full
+/obj/machinery/embedded_controller/radio/airlock/docking_port/attackby(obj/item/used_item, mob/user)
+ if(IS_MULTITOOL(used_item)) //give them part of code, would take few tries to get full
var/datum/computer/file/embedded_program/docking/airlock/docking_program = program
var/code = docking_program.docking_codes
if(!code)
code = "N/A"
else
code = stars(code)
- to_chat(user,"[W]'s screen displays '[code]'")
+ to_chat(user,"[used_item]'s screen displays '[code]'")
return TRUE
else
return ..()
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index eeef5d6c7deb..edd7f125381e 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -35,9 +35,9 @@
// src.sd_SetLuminosity(0)
//Don't want to render prison breaks impossible
-/obj/machinery/flasher/attackby(obj/item/W, mob/user)
- if(IS_WIRECUTTER(W))
- add_fingerprint(user, 0, W)
+/obj/machinery/flasher/attackby(obj/item/used_item, mob/user)
+ if(IS_WIRECUTTER(used_item))
+ add_fingerprint(user, 0, used_item)
src.disable = !src.disable
if (src.disable)
user.visible_message("[user] has disconnected \the [src]'s flashbulb!", "You disconnect \the [src]'s flashbulb!")
@@ -71,30 +71,7 @@
continue
var/flash_time = strength
- if(isliving(viewer))
- if(viewer.eyecheck() > FLASH_PROTECTION_NONE)
- continue
- if(ishuman(viewer))
- var/mob/living/human/H = viewer
- flash_time = round(H.get_flash_mod() * flash_time)
- if(flash_time <= 0)
- return
- var/vision_organ_tag = H.get_vision_organ_tag()
- if(vision_organ_tag)
- var/obj/item/organ/internal/organ = GET_INTERNAL_ORGAN(H, vision_organ_tag)
- if(organ && organ.is_bruised() && prob(organ.get_organ_damage() + 50))
- H.flash_eyes()
- organ.adjust_organ_damage(rand(1, 5))
-
- if(!viewer.is_blind())
- do_flash(viewer, flash_time)
-
-/obj/machinery/flasher/proc/do_flash(var/mob/living/victim, var/flash_time)
- victim.flash_eyes()
- ADJ_STATUS(victim, STAT_BLURRY, flash_time)
- ADJ_STATUS(victim, STAT_CONFUSE, flash_time + 2)
- SET_STATUS_MAX(victim, STAT_STUN, flash_time / 2)
- SET_STATUS_MAX(victim, STAT_WEAK, 3)
+ viewer.handle_flashed(flash_time)
/obj/machinery/flasher/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
@@ -109,6 +86,7 @@
desc = "A portable flashing device. Wrench to activate and deactivate. Cannot detect slow movements."
icon_state = "pflash1"
icon = 'icons/obj/machines/flash_portable.dmi'
+ directional_offset = @'{"NORTH":{"y":0}, "SOUTH":{"y":0}, "EAST":{"x":0}, "WEST":{"x":0}}'
strength = 8
anchored = FALSE
base_state = "pflash"
@@ -123,8 +101,8 @@
if(!MOVING_DELIBERATELY(M))
flash()
-/obj/machinery/flasher/portable/attackby(obj/item/W, mob/user)
- if(IS_WRENCH(W))
+/obj/machinery/flasher/portable/attackby(obj/item/used_item, mob/user)
+ if(IS_WRENCH(used_item))
add_fingerprint(user)
src.anchored = !src.anchored
diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm
index b6fefd1fe27b..c9c4e8571b5f 100644
--- a/code/game/machinery/floor_light.dm
+++ b/code/game/machinery/floor_light.dm
@@ -29,28 +29,28 @@ var/global/list/floor_light_cache = list()
. = ..()
update_icon()
-/obj/machinery/floor_light/attackby(var/obj/item/W, var/mob/user)
+/obj/machinery/floor_light/attackby(var/obj/item/used_item, var/mob/user)
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
anchored = !anchored
if(use_power)
update_use_power(POWER_USE_OFF)
visible_message(SPAN_NOTICE("\The [user] has [anchored ? "attached" : "detached"] \the [src]."))
return TRUE
- if(IS_WELDER(W) && (damaged || (stat & BROKEN)))
- var/obj/item/weldingtool/WT = W
- if(!WT.weld(0, user))
+ if(IS_WELDER(used_item) && (damaged || (stat & BROKEN)))
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.weld(0, user))
to_chat(user, SPAN_WARNING("\The [src] must be on to complete this task."))
return TRUE
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
- if(do_after(user, 20, src) && !QDELETED(src) && WT.isOn())
+ if(do_after(user, 20, src) && !QDELETED(src) && welder.isOn())
visible_message(SPAN_NOTICE("\The [user] has repaired \the [src]."))
set_broken(FALSE)
damaged = null
return TRUE
- if(IS_WRENCH(W))
+ if(IS_WRENCH(used_item))
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
to_chat(user, SPAN_NOTICE("You dismantle the floor light."))
SSmaterials.create_object(/decl/material/solid/metal/steel, loc, 1)
@@ -58,7 +58,7 @@ var/global/list/floor_light_cache = list()
qdel(src)
return TRUE
- if(W.get_attack_force(user) && user.check_intent(I_FLAG_HARM))
+ if(used_item.get_attack_force(user) && user.check_intent(I_FLAG_HARM))
return physical_attack_hand(user)
return ..()
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
index ea04c68ba826..92b6260ce5b6 100644
--- a/code/game/machinery/floorlayer.dm
+++ b/code/game/machinery/floorlayer.dm
@@ -35,23 +35,23 @@
user.visible_message("[user] has [!on?"de":""]activated \the [src].", "You [!on?"de":""]activate \the [src].")
return TRUE
-/obj/machinery/floorlayer/attackby(var/obj/item/W, var/mob/user)
+/obj/machinery/floorlayer/attackby(var/obj/item/used_item, var/mob/user)
- if(IS_WRENCH(W))
+ if(IS_WRENCH(used_item))
var/m = input("Choose work mode", "Mode") as null|anything in mode
mode[m] = !mode[m]
var/O = mode[m]
user.visible_message("[user] has set \the [src] [m] mode [!O?"off":"on"].", "You set \the [src] [m] mode [!O?"off":"on"].")
return TRUE
- if(istype(W, /obj/item/stack/tile))
- if(!user.try_unequip(W, T))
+ if(istype(used_item, /obj/item/stack/tile))
+ if(!user.try_unequip(used_item, T))
return TRUE
- to_chat(user, "\The [W] successfully loaded.")
+ to_chat(user, "\The [used_item] successfully loaded.")
TakeTile(T)
return TRUE
- if(IS_CROWBAR(W))
+ if(IS_CROWBAR(used_item))
if(!length(contents))
to_chat(user, "\The [src] is empty.")
else
@@ -62,7 +62,7 @@
T = null
return TRUE
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
T = input("Choose tile type.", "Tiles") as null|anything in contents
return TRUE
return ..()
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index ce3c79b45d88..7145a9762c51 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -348,7 +348,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
end_call()
if (caller_id&&sourcepad)
if(caller_id.loc!=sourcepad.loc)
- sourcepad.to_chat(caller_id, "Severing connection to distant holopad.")
+ to_chat(sourcepad.caller_id, "Severing connection to distant holopad.")
end_call()
audible_message("The connection has been terminated by the caller.")
return 1
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index 26a071ea6aef..176f286e06bb 100644
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -119,14 +119,14 @@
else
icon_state = "[base_state]-p"
-/obj/machinery/sparker/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/machinery/sparker/attackby(obj/item/used_item, mob/user)
+ if(panel_open && IS_WIRECUTTER(used_item))
add_fingerprint(user)
disable = !disable
if(disable)
- user.visible_message("[user] has disabled \the [src]!", "You disable the connection to \the [src].")
- else if(!disable)
- user.visible_message("[user] has reconnected \the [src]!", "You fix the connection to \the [src].")
+ user.visible_message(SPAN_WARNING("[user] has disabled \the [src]!"), SPAN_WARNING("You disable the connection to \the [src]."))
+ else
+ user.visible_message(SPAN_WARNING("[user] has reconnected \the [src]!"), SPAN_WARNING("You fix the connection to \the [src]."))
update_icon()
return TRUE
else
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 1fb6b7666b72..530e66903cbb 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -126,7 +126,7 @@
var/mob/living/human/H = M
if(H.get_sound_volume_multiplier() < 0.2)
continue
- M.set_status(STAT_ASLEEP, 0)
+ M.set_status_condition(STAT_ASLEEP, 0)
ADJ_STATUS(M, STAT_STUTTER, 20)
SET_STATUS_MAX(M, STAT_DEAF, 30)
SET_STATUS_MAX(M, STAT_WEAK, 3)
@@ -134,7 +134,7 @@
SET_STATUS_MAX(M, STAT_STUN, 10)
SET_STATUS_MAX(M, STAT_PARA, 4)
else
- M.set_status(STAT_JITTER, 400)
+ M.set_status_condition(STAT_JITTER, 400)
spawn(15)
explode()
@@ -152,10 +152,10 @@
new /obj/effect/decal/cleanable/blood/oil(src.loc)
qdel(src)
-/obj/machinery/media/jukebox/attackby(obj/item/W, mob/user)
- if((IS_WRENCH(W) || IS_HAMMER(W)) && !panel_open)
+/obj/machinery/media/jukebox/attackby(obj/item/used_item, mob/user)
+ if((IS_WRENCH(used_item) || IS_HAMMER(used_item)) && !panel_open)
add_fingerprint(user)
- wrench_floor_bolts(user, 0, W)
+ wrench_floor_bolts(user, 0, used_item)
power_change()
return TRUE
return ..()
diff --git a/code/game/machinery/kitchen/cooking_machines/_cooker.dm b/code/game/machinery/kitchen/cooking_machines/_cooker.dm
index 699f0670a3b1..a340029c6599 100644
--- a/code/game/machinery/kitchen/cooking_machines/_cooker.dm
+++ b/code/game/machinery/kitchen/cooking_machines/_cooker.dm
@@ -65,14 +65,14 @@
return TRUE
-/obj/machinery/cooker/attackby(var/obj/item/I, var/mob/user)
+/obj/machinery/cooker/attackby(var/obj/item/used_item, var/mob/user)
set waitfor = 0 //So that any remaining parts of calling proc don't have to wait for the long cooking time ahead.
if(cooking)
to_chat(user, "\The [src] is running!")
return TRUE
- if((. = component_attackby(I, user)))
+ if((. = component_attackby(used_item, user)))
return
if(!cook_type || (stat & (NOPOWER|BROKEN)))
@@ -80,7 +80,7 @@
return TRUE
// We're trying to cook something else. Check if it's valid.
- var/obj/item/food/check = I
+ var/obj/item/food/check = used_item
if(istype(check) && islist(check.cooked) && (cook_type in check.cooked))
to_chat(user, "\The [check] has already been [cook_type].")
return TRUE
@@ -100,12 +100,12 @@
M.apply_damage(rand(30,40), BURN, BP_CHEST)
// Not sure why a food item that passed the previous checks would fail to drop, but safety first.
- if(!user.try_unequip(I))
+ if(!user.try_unequip(used_item))
return TRUE
// We can actually start cooking now.
- user.visible_message("\The [user] puts \the [I] into \the [src].")
- cooking_obj = I
+ user.visible_message("\The [user] puts \the [used_item] into \the [src].")
+ cooking_obj = used_item
cooking_obj.forceMove(src)
cooking = 1
icon_state = on_icon
diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm
index aa537a6a9965..4a68783d0305 100644
--- a/code/game/machinery/kitchen/gibber.dm
+++ b/code/game/machinery/kitchen/gibber.dm
@@ -9,7 +9,7 @@
initial_access = list(list(access_kitchen, access_morgue))
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
- stat_immune = 0
+ stat_immune = NOSCREEN
var/operating = 0 //Is it on?
var/dirty = 0 // Does it need cleaning?
@@ -79,11 +79,11 @@
to_chat(user, SPAN_DANGER("You need a better grip to do that!"))
return TRUE
-/obj/machinery/gibber/attackby(var/obj/item/W, var/mob/user)
- if(!operating && istype(W, /obj/item/organ))
- if(user.try_unequip(W))
- qdel(W)
- user.visible_message(SPAN_DANGER("\The [user] feeds \the [W] into \the [src], obliterating it."))
+/obj/machinery/gibber/attackby(var/obj/item/used_item, var/mob/user)
+ if(!operating && istype(used_item, /obj/item/organ))
+ if(user.try_unequip(used_item))
+ qdel(used_item)
+ user.visible_message(SPAN_DANGER("\The [user] feeds \the [used_item] into \the [src], obliterating it."))
return TRUE
return ..()
diff --git a/code/game/machinery/kitchen/icecream.dm b/code/game/machinery/kitchen/icecream.dm
index cd751f4d64af..9671e16e3614 100644
--- a/code/game/machinery/kitchen/icecream.dm
+++ b/code/game/machinery/kitchen/icecream.dm
@@ -100,15 +100,13 @@
dat += "Chocolate cones: Dispense Make x5 [product_types[CONE_CHOC]] cones left. (Ingredients: flour, sugar, coco powder)
"
dat += "
"
dat += "VAT CONTENT
"
- for(var/liquid_type in reagents?.liquid_volumes)
- var/decl/material/R = GET_DECL(liquid_type)
- dat += "[R.get_reagent_name(reagents, MAT_PHASE_LIQUID)]: [LIQUID_VOLUME(reagents, liquid_type)]"
- dat += "Purge
"
+ for(var/decl/material/reagent as anything in reagents?.liquid_volumes)
+ dat += "[reagent.get_reagent_name(reagents, MAT_PHASE_LIQUID)]: [LIQUID_VOLUME(reagents, reagent)]"
+ dat += "Purge
"
- for(var/solid_type in reagents?.solid_volumes)
- var/decl/material/R = GET_DECL(solid_type)
- dat += "[R.get_reagent_name(reagents, MAT_PHASE_SOLID)]: [SOLID_VOLUME(reagents, solid_type)]"
- dat += "Purge
"
+ for(var/decl/material/reagent as anything in reagents?.solid_volumes)
+ dat += "[reagent.get_reagent_name(reagents, MAT_PHASE_SOLID)]: [SOLID_VOLUME(reagents, reagent)]"
+ dat += "Purge
"
dat += "Refresh Close"
@@ -116,37 +114,37 @@
popup.set_content(dat)
popup.open()
-/obj/machinery/icecream_vat/attackby(var/obj/item/O, var/mob/user)
- if(istype(O, /obj/item/food/icecream))
- var/obj/item/food/icecream/I = O
- if(!I.ice_creamed)
+/obj/machinery/icecream_vat/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/food/icecream))
+ var/obj/item/food/icecream/icecream = used_item
+ if(!icecream.ice_creamed)
if(product_types[dispense_flavour] > 0)
- src.visible_message("[html_icon(src)] [user] scoops delicious [flavour_name] icecream into [I].")
+ src.visible_message("[html_icon(src)] [user] scoops delicious [flavour_name] icecream into [icecream].")
product_types[dispense_flavour] -= 1
- I.add_ice_cream(flavour_name)
+ icecream.add_ice_cream(flavour_name)
// if(beaker)
- // beaker.reagents.trans_to(I, 10)
- if(I.reagents.total_volume < 10)
- I.add_to_reagents(/decl/material/liquid/nutriment/sugar, 10 - I.reagents.total_volume)
+ // beaker.reagents.trans_to(icecream, 10)
+ if(icecream.reagents.total_volume < 10)
+ icecream.add_to_reagents(/decl/material/liquid/nutriment/sugar, 10 - icecream.reagents.total_volume)
else
to_chat(user, "There is not enough icecream left!")
else
- to_chat(user, "[O] already has icecream in it.")
+ to_chat(user, "[used_item] already has icecream in it.")
return TRUE
- else if(ATOM_IS_OPEN_CONTAINER(O))
+ else if(ATOM_IS_OPEN_CONTAINER(used_item))
return TRUE
else
return ..()
/obj/machinery/icecream_vat/proc/make(var/mob/user, var/make_type, var/amount)
- for(var/R in get_ingredient_list(make_type))
- if(reagents.has_reagent(R, amount))
+ for(var/reagent in get_ingredient_list(make_type))
+ if(reagents.has_reagent(reagent, amount))
continue
amount = 0
break
if(amount)
- for(var/R in get_ingredient_list(make_type))
- remove_from_reagents(R, amount)
+ for(var/reagent in get_ingredient_list(make_type))
+ remove_from_reagents(reagent, amount)
product_types[make_type] += amount
var/flavour = get_flavour_name(make_type)
if(make_type > 6)
@@ -172,10 +170,10 @@
var/cone_name = get_flavour_name(dispense_cone)
if(product_types[dispense_cone] >= 1)
product_types[dispense_cone] -= 1
- var/obj/item/food/icecream/I = new(src.loc)
- I.cone_type = cone_name
- I.icon_state = "icecream_cone_[cone_name]"
- I.desc = "Delicious [cone_name] cone, but no ice cream."
+ var/obj/item/food/icecream/icecream = new(src.loc)
+ icecream.cone_type = cone_name
+ icecream.icon_state = "icecream_cone_[cone_name]"
+ icecream.desc = "Delicious [cone_name] cone, but no ice cream."
src.visible_message("[user] dispenses a crunchy [cone_name] cone from [src].")
else
to_chat(user, "There are no [cone_name] cones left!")
@@ -188,9 +186,9 @@
. = TOPIC_REFRESH
else if(href_list["disposeI"])
- var/decl/material/R = locate(href_list["disposeI"])
- if(R)
- reagents.clear_reagent(R.type)
+ var/decl/material/reagent = locate(href_list["disposeI"])
+ if(reagent)
+ reagents.clear_reagent(reagent.type)
. = TOPIC_REFRESH
if(href_list["refresh"])
diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm
index 886b8ce43997..f1b754a8920e 100644
--- a/code/game/machinery/kitchen/microwave.dm
+++ b/code/game/machinery/kitchen/microwave.dm
@@ -53,9 +53,9 @@
to_chat(user, SPAN_WARNING("This is ridiculous. You can not fit \the [grab.affecting] into \the [src]."))
return TRUE
-/obj/machinery/microwave/attackby(var/obj/item/O, var/mob/user)
+/obj/machinery/microwave/attackby(var/obj/item/used_item, var/mob/user)
if(broken > 0)
- if(broken == 2 && IS_SCREWDRIVER(O)) // If it's broken and they're using a screwdriver
+ if(broken == 2 && IS_SCREWDRIVER(used_item)) // If it's broken and they're using a screwdriver
user.visible_message(
SPAN_NOTICE("\The [user] starts to fix part of [src]."),
SPAN_NOTICE("You start to fix part of [src].")
@@ -66,7 +66,7 @@
SPAN_NOTICE("You have fixed part of [src].")
)
broken = 1 // Fix it a bit
- else if(broken == 1 && IS_WRENCH(O)) // If it's broken and they're doing the wrench
+ else if(broken == 1 && IS_WRENCH(used_item)) // If it's broken and they're doing the wrench
user.visible_message(
SPAN_NOTICE("\The [user] starts to fix part of [src]."),
SPAN_NOTICE("You start to fix part of [src].")
@@ -83,11 +83,11 @@
else
to_chat(user, SPAN_WARNING("It's broken!"))
return 1
- else if((. = component_attackby(O, user)))
+ else if((. = component_attackby(used_item, user)))
dispose()
return
else if(dirty==100) // The microwave is all dirty so can't be used!
- if(istype(O, /obj/item/chems/spray/cleaner) || istype(O, /obj/item/chems/rag)) // If they're trying to clean it then let them
+ if(istype(used_item, /obj/item/chems/spray/cleaner) || istype(used_item, /obj/item/chems/rag)) // If they're trying to clean it then let them
user.visible_message(
SPAN_NOTICE("\The [user] starts to clean [src]."),
SPAN_NOTICE("You start to clean [src].")
@@ -104,11 +104,11 @@
else //Otherwise bad luck!!
to_chat(user, SPAN_WARNING("It's dirty!"))
return 1
- else if(!istype(O, /obj/item/chems/glass/bowl) && (istype(O,/obj/item/chems/glass) || istype(O,/obj/item/chems/drinks) || istype(O,/obj/item/chems/condiment) ))
- if (!O.reagents)
+ else if(!istype(used_item, /obj/item/chems/glass/bowl) && (istype(used_item,/obj/item/chems/glass) || istype(used_item,/obj/item/chems/drinks) || istype(used_item,/obj/item/chems/condiment) ))
+ if (!used_item.reagents)
return 1
return // transfer is handled in afterattack
- else if(IS_WRENCH(O))
+ else if(IS_WRENCH(used_item))
user.visible_message(
SPAN_NOTICE("\The [user] begins [anchored ? "securing" : "unsecuring"] [src]."),
SPAN_NOTICE("You attempt to [anchored ? "secure" : "unsecure"] [src].")
@@ -121,32 +121,32 @@
)
else
to_chat(user, SPAN_NOTICE("You decide not to do that."))
- else if(O.w_class <= ITEM_SIZE_LARGE) // this must be last
+ else if(used_item.w_class <= ITEM_SIZE_LARGE) // this must be last
if (LAZYLEN(get_contained_external_atoms()) >= max_n_of_items)
to_chat(user, SPAN_WARNING("This [src] is full of ingredients, you cannot put more."))
return 1
- if(istype(O, /obj/item/stack)) // This is bad, but I can't think of how to change it
- var/obj/item/stack/S = O
+ if(istype(used_item, /obj/item/stack)) // This is bad, but I can't think of how to change it
+ var/obj/item/stack/S = used_item
if(S.get_amount() > 1)
var/obj/item/stack/new_stack = S.split(1)
if(new_stack)
new_stack.forceMove(src)
user.visible_message(
SPAN_NOTICE("\The [user] has added \a [new_stack.singular_name] to \the [src]."),
- SPAN_NOTICE("You add one of [O] to \the [src].")
+ SPAN_NOTICE("You add one of [used_item] to \the [src].")
)
SSnano.update_uis(src)
return
- if (!user.try_unequip(O, src))
+ if (!user.try_unequip(used_item, src))
return
user.visible_message(
- SPAN_NOTICE("\The [user] has added \the [O] to \the [src]."),
- SPAN_NOTICE("You add \the [O] to \the [src].")
+ SPAN_NOTICE("\The [user] has added \the [used_item] to \the [src]."),
+ SPAN_NOTICE("You add \the [used_item] to \the [src].")
)
SSnano.update_uis(src)
return
else
- to_chat(user, SPAN_WARNING("You have no idea what you can cook with \the [O]."))
+ to_chat(user, SPAN_WARNING("You have no idea what you can cook with \the [used_item]."))
SSnano.update_uis(src)
/obj/machinery/microwave/components_are_accessible(path)
@@ -176,12 +176,11 @@
. = ..()
var/data = list()
data["cooking_items"] = list()
- for(var/obj/O in get_contained_external_atoms())
- data["cooking_items"][O.name]++
+ for(var/obj/used_item in get_contained_external_atoms())
+ data["cooking_items"][used_item.name]++
data["cooking_reagents"] = list()
- for(var/material_type in reagents.reagent_volumes)
- var/decl/material/mat = GET_DECL(material_type)
- data["cooking_reagents"][mat.name] = reagents.reagent_volumes[material_type]
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ data["cooking_reagents"][reagent.name] = reagents.reagent_volumes[reagent]
data["on"] = !!operating
data["broken"] = broken > 0
data["dirty"] = dirty >= 100
@@ -278,8 +277,8 @@
SSnano.update_uis(src)
/obj/machinery/microwave/proc/has_extra_item()
- for(var/obj/O in get_contained_external_atoms())
- if(!istype(O,/obj/item/food))
+ for(var/obj/thing in get_contained_external_atoms())
+ if(!istype(thing,/obj/item/food))
return TRUE
return FALSE
@@ -349,8 +348,8 @@
var/list/ingredients = get_contained_external_atoms()
if (!LAZYLEN(ingredients) && !reagents.total_volume)
return
- for (var/obj/O in ingredients)
- O.dropInto(loc)
+ for (var/obj/thing in ingredients)
+ thing.dropInto(loc)
if (reagents.total_volume)
dirty++
reagents.clear_reagents()
@@ -358,31 +357,30 @@
to_chat(user, SPAN_NOTICE("You empty [src]."))
SSnano.update_uis(src)
-/obj/machinery/microwave/proc/eject_item(var/mob/user, var/obj/O, var/message = TRUE)
- if(!istype(O) || !length(get_contained_external_atoms()))
+/obj/machinery/microwave/proc/eject_item(var/mob/user, var/obj/thing, var/message = TRUE)
+ if(!istype(thing) || !length(get_contained_external_atoms()))
return
- O.dropInto(loc)
+ thing.dropInto(loc)
if(user && message)
- to_chat(user, SPAN_NOTICE("You remove [O] from [src]."))
+ to_chat(user, SPAN_NOTICE("You remove [thing] from [src]."))
SSnano.update_uis(src)
-/obj/machinery/microwave/proc/eject_reagent(var/mob/user, var/material_type)
- if(!reagents.reagent_volumes[material_type])
+/obj/machinery/microwave/proc/eject_reagent(var/mob/user, var/decl/material/reagent)
+ if(!reagents.reagent_volumes[reagent])
SSnano.update_uis(src)
return // should not happen, must be a UI glitch or href hacking
var/obj/item/chems/held_container = user.get_active_held_item()
- var/decl/material/M = GET_DECL(material_type)
if(istype(held_container))
- var/amount_to_move = min(REAGENTS_FREE_SPACE(held_container.reagents), REAGENT_VOLUME(reagents, material_type))
+ var/amount_to_move = min(REAGENTS_FREE_SPACE(held_container.reagents), REAGENT_VOLUME(reagents, reagent))
if(amount_to_move <= 0)
to_chat(user, SPAN_WARNING("[held_container] is full!"))
return
- to_chat(user, SPAN_NOTICE("You empty [amount_to_move] units of [M.name] into [held_container]."))
- reagents.trans_type_to(held_container, material_type, amount_to_move)
+ to_chat(user, SPAN_NOTICE("You empty [amount_to_move] units of [reagent.name] into [held_container]."))
+ reagents.trans_type_to(held_container, reagent, amount_to_move)
else
- to_chat(user, SPAN_NOTICE("You try to dump out the [M.name], but it gets all over [src] because you have nothing to put it in."))
+ to_chat(user, SPAN_NOTICE("You try to dump out the [reagent.name], but it gets all over [src] because you have nothing to put it in."))
dirty++
- reagents.clear_reagent(material_type)
+ reagents.clear_reagent(reagent)
SSnano.update_uis(src)
/obj/machinery/microwave/on_update_icon()
@@ -403,11 +401,11 @@
M.death()
qdel(M)
- for (var/obj/O in ingredients)
+ for (var/obj/thing in ingredients)
amount++
- if (O.reagents && O.reagents.primary_reagent)
- amount += REAGENT_VOLUME(O.reagents, O.reagents.primary_reagent)
- qdel(O)
+ if (thing.reagents && thing.reagents.primary_reagent)
+ amount += REAGENT_VOLUME(thing.reagents, thing.reagents.primary_reagent)
+ qdel(thing)
reagents.clear_reagents()
SSnano.update_uis(src)
var/obj/item/food/badrecipe/ffuu = new(src)
@@ -426,18 +424,16 @@
return TOPIC_REFRESH
if ("ejectitem")
- for(var/obj/O in get_contained_external_atoms())
- if(strip_improper(O.name) == href_list["target"])
- eject_item(user, O)
+ for(var/obj/thing in get_contained_external_atoms())
+ if(strip_improper(thing.name) == href_list["target"])
+ eject_item(user, thing)
break
return TOPIC_REFRESH
if ("ejectreagent")
- var/decl/material/mat
- for(var/material_type in reagents.reagent_volumes)
- mat = GET_DECL(material_type)
- if(mat.name == href_list["target"])
- eject_reagent(user, material_type)
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ if(reagent.name == href_list["target"])
+ eject_reagent(user, reagent)
break
return TOPIC_REFRESH
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 7bcf166a9089..d598001b671e 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -82,10 +82,10 @@
set_state(!on)
return TRUE
-/obj/machinery/light_switch/attackby(obj/item/I, mob/user)
+/obj/machinery/light_switch/attackby(obj/item/used_item, mob/user)
. = ..()
if(!.)
- to_chat(user, SPAN_NOTICE("You flick \the [src] with \the [I]."))
+ to_chat(user, SPAN_NOTICE("You flick \the [src] with \the [used_item]."))
interface_interact(user)
return TRUE
diff --git a/code/game/machinery/mech_recharger.dm b/code/game/machinery/mech_recharger.dm
index 5c2449e37ed2..08629aece6a2 100644
--- a/code/game/machinery/mech_recharger.dm
+++ b/code/game/machinery/mech_recharger.dm
@@ -11,7 +11,6 @@
base_type = /obj/machinery/mech_recharger
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
- stat_immune = 0
var/mob/living/exosuit/charging
var/base_charge_rate = 60 KILOWATTS
diff --git a/code/game/machinery/message_server.dm b/code/game/machinery/message_server.dm
index fdec0c2b48ee..9ddf2a4d9f39 100644
--- a/code/game/machinery/message_server.dm
+++ b/code/game/machinery/message_server.dm
@@ -135,11 +135,11 @@ var/global/list/message_servers = list()
update_icon()
return TRUE
-/obj/machinery/network/message_server/attackby(obj/item/O, mob/user)
+/obj/machinery/network/message_server/attackby(obj/item/used_item, mob/user)
if (active && !(stat & (BROKEN|NOPOWER)) && (spamfilter_limit < MESSAGE_SERVER_DEFAULT_SPAM_LIMIT*2) && \
- istype(O,/obj/item/stock_parts/circuitboard/message_monitor))
+ istype(used_item,/obj/item/stock_parts/circuitboard/message_monitor))
spamfilter_limit += round(MESSAGE_SERVER_DEFAULT_SPAM_LIMIT / 2)
- qdel(O)
+ qdel(used_item)
to_chat(user, "You install additional memory and processors into \the [src]. Its filtering capabilities been enhanced.")
return TRUE
else
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index b129241b2ea4..5a3776da1e39 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -41,18 +41,18 @@ var/global/list/navbeacons = list()
else
icon_state = "[state]"
-/obj/machinery/navbeacon/attackby(var/obj/item/I, var/mob/user)
+/obj/machinery/navbeacon/attackby(var/obj/item/used_item, var/mob/user)
var/turf/T = loc
if(!T.is_plating())
return TRUE // prevent intraction when T-scanner revealed
- if(IS_SCREWDRIVER(I))
+ if(IS_SCREWDRIVER(used_item))
open = !open
user.visible_message("\The [user] [open ? "opens" : "closes"] cover of \the [src].", "You [open ? "open" : "close"] cover of \the [src].")
update_icon()
return TRUE
- else if(I.GetIdCard())
+ else if(used_item.GetIdCard())
if(open)
if (src.allowed(user))
src.locked = !src.locked
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index 20c88ea60823..ae2af31628d8 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -711,7 +711,7 @@ var/global/list/allCasters = list() //Global list that will contain reference to
else if(href_list["pick_censor_channel"])
var/datum/feed_channel/FC = locate(href_list["pick_censor_channel"])
viewing_channel = FC
- screen = SCREEN_PICK_CENSOR_CHANNEL
+ screen = SCREEN_PICK_CENSOR_STORY
. = TOPIC_REFRESH
else if(href_list["refresh"])
@@ -882,8 +882,8 @@ var/global/list/allCasters = list() //Global list that will contain reference to
src.attack_self(src.loc)
-/obj/item/newspaper/attackby(obj/item/W, mob/user)
- if(IS_PEN(W))
+/obj/item/newspaper/attackby(obj/item/used_item, mob/user)
+ if(IS_PEN(used_item))
if(src.scribble_page == src.curr_page)
to_chat(user, SPAN_WARNING("There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?"))
return TRUE
@@ -893,7 +893,7 @@ var/global/list/allCasters = list() //Global list that will contain reference to
if(!CanPhysicallyInteractWith(user, src))
to_chat(user, SPAN_WARNING("You must stay close to \the [src]!"))
return TRUE
- if(W.do_tool_interaction(TOOL_PEN, user, src, 0, fuel_expenditure = 1) && !QDELETED(src)) //Make it instant, since handle_writing_literacy does the waiting
+ if(used_item.do_tool_interaction(TOOL_PEN, user, src, 0, fuel_expenditure = 1) && !QDELETED(src)) //Make it instant, since handle_writing_literacy does the waiting
s = sanitize(s)
s = user.handle_writing_literacy(user, s)
src.scribble_page = src.curr_page
@@ -943,3 +943,8 @@ var/global/list/allCasters = list() //Global list that will contain reference to
else
audible_message("[src.name] beeps, \"Attention! Wanted issue distributed!\"")
playsound(src.loc, 'sound/machines/warning-buzzer.ogg', 75, 1)
+
+// security newscaster preset
+/obj/machinery/newscaster/security_unit
+ base_type = /obj/machinery/newscaster
+ securityCaster = TRUE
\ No newline at end of file
diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm
index ac2a4f67cec2..bb2365dbc314 100644
--- a/code/game/machinery/nuclear_bomb.dm
+++ b/code/game/machinery/nuclear_bomb.dm
@@ -44,8 +44,8 @@ var/global/bomb_set
addtimer(CALLBACK(src, PROC_REF(explode)), 0)
SSnano.update_uis(src)
-/obj/machinery/nuclearbomb/attackby(obj/item/O, mob/user, params)
- if(IS_SCREWDRIVER(O))
+/obj/machinery/nuclearbomb/attackby(obj/item/used_item, mob/user, params)
+ if(IS_SCREWDRIVER(used_item))
add_fingerprint(user)
if(auth)
if(panel_open == 0)
@@ -69,38 +69,38 @@ var/global/bomb_set
flick("lock", src)
return TRUE
- if(panel_open && (IS_MULTITOOL(O) || IS_WIRECUTTER(O)))
+ if(panel_open && (IS_MULTITOOL(used_item) || IS_WIRECUTTER(used_item)))
return attack_hand_with_interaction_checks(user)
if(extended)
- if(istype(O, /obj/item/disk/nuclear))
- if(!user.try_unequip(O, src))
+ if(istype(used_item, /obj/item/disk/nuclear))
+ if(!user.try_unequip(used_item, src))
return TRUE
- auth = O
+ auth = used_item
add_fingerprint(user)
return attack_hand_with_interaction_checks(user)
if(anchored)
switch(removal_stage)
if(0)
- if(IS_WELDER(O))
- var/obj/item/weldingtool/WT = O
- if(!WT.isOn()) return TRUE
- if(WT.get_fuel() < 5) // uses up 5 fuel.
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.isOn()) return TRUE
+ if(welder.get_fuel() < 5) // uses up 5 fuel.
to_chat(user, "You need more fuel to complete this task.")
return TRUE
- user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [O]...")
+ user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [used_item]...")
if(do_after(user, 4 SECONDS, src))
- if(QDELETED(src) || QDELETED(user) || !WT.weld(5, user)) return TRUE
+ if(QDELETED(src) || QDELETED(user) || !welder.weld(5, user)) return TRUE
user.visible_message("\The [user] cuts through the bolt covers on \the [src].", "You cut through the bolt cover.")
removal_stage = 1
return TRUE
if(1)
- if(IS_CROWBAR(O))
- user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...")
+ if(IS_CROWBAR(used_item))
+ user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [used_item]...")
if(do_after(user, 1.5 SECONDS, src))
if(QDELETED(src) || QDELETED(user)) return TRUE
@@ -109,23 +109,23 @@ var/global/bomb_set
return TRUE
if(2)
- if(IS_WELDER(O))
- var/obj/item/weldingtool/WT = O
- if(!WT.isOn()) return TRUE
- if (WT.get_fuel() < 5) // uses up 5 fuel.
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.isOn()) return TRUE
+ if (welder.get_fuel() < 5) // uses up 5 fuel.
to_chat(user, "You need more fuel to complete this task.")
return TRUE
- user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [O]...")
+ user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [used_item]...")
if(do_after(user, 4 SECONDS, src))
- if(QDELETED(src) || QDELETED(user) || !WT.weld(5, user)) return TRUE
+ if(QDELETED(src) || QDELETED(user) || !welder.weld(5, user)) return TRUE
user.visible_message("\The [user] cuts apart the anchoring system sealant on \the [src].", "You cut apart the anchoring system's sealant.")
removal_stage = 3
return TRUE
if(3)
- if(IS_WRENCH(O))
+ if(IS_WRENCH(used_item))
user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...")
if(do_after(user, 5 SECONDS, src))
if(QDELETED(src) || QDELETED(user)) return TRUE
@@ -134,7 +134,7 @@ var/global/bomb_set
return TRUE
if(4)
- if(IS_CROWBAR(O))
+ if(IS_CROWBAR(used_item))
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")
if(do_after(user, 8 SECONDS, src))
if(QDELETED(src) || QDELETED(user)) return TRUE
@@ -230,11 +230,11 @@ var/global/bomb_set
yes_code = 0
auth = null
else
- var/obj/item/I = user.get_active_held_item()
- if(istype(I, /obj/item/disk/nuclear))
- if(!user.try_unequip(I, src))
+ var/obj/item/used_item = user.get_active_held_item()
+ if(istype(used_item, /obj/item/disk/nuclear))
+ if(!user.try_unequip(used_item, src))
return TOPIC_HANDLED
- auth = I
+ auth = used_item
if(is_auth(user))
if(href_list["type"])
. = TOPIC_REFRESH
@@ -363,6 +363,7 @@ var/global/bomb_set
icon_state = "idle"
//====The nuclear authentication disc====
+var/global/list/obj/item/disk/nuclear/nuke_disks = list()
/obj/item/disk/nuclear
name = "nuclear authentication disk"
desc = "Better keep this safe."
@@ -372,19 +373,8 @@ var/global/bomb_set
/obj/item/disk/nuclear/Initialize()
. = ..()
global.nuke_disks |= src
- // Can never be quite sure that a game mode has been properly initiated or not at this point, so always register
- events_repository.register(/decl/observ/moved, src, src, TYPE_PROC_REF(/obj/item/disk/nuclear, check_z_level))
-
-/obj/item/disk/nuclear/proc/check_z_level()
- if(!(istype(SSticker.mode, /decl/game_mode/nuclear)))
- events_repository.unregister(/decl/observ/moved, src, src, TYPE_PROC_REF(/obj/item/disk/nuclear, check_z_level)) // However, when we are certain unregister if necessary
- return
- var/turf/T = get_turf(src)
- if(!T || isNotStationLevel(T.z))
- qdel(src)
/obj/item/disk/nuclear/Destroy()
- events_repository.unregister(/decl/observ/moved, src, src, TYPE_PROC_REF(/obj/item/disk/nuclear, check_z_level))
global.nuke_disks -= src
if(!length(global.nuke_disks))
var/turf/T = pick_area_turf_by_flag(AREA_FLAG_MAINTENANCE, list(/proc/is_station_turf, /proc/not_turf_contains_dense_objects))
@@ -418,8 +408,8 @@ var/global/bomb_set
/obj/item/folder/envelope/nuke_instructions/Initialize()
. = ..()
- var/obj/item/paper/R = new(src)
- R.set_content({"Warning: Classified
[global.using_map.station_name] Self-Destruct System - Instructions
+ var/obj/item/paper/codes = new(src)
+ codes.set_content({"Warning: Classified
[global.using_map.station_name] Self-Destruct System - Instructions
In the event of a Delta-level emergency, this document will guide you through the activation of the vessel's
on-board nuclear self-destruct system. Please read carefully.
1) (Optional) Announce the imminent activation to any surviving crew members, and begin evacuation procedures.
@@ -442,7 +432,7 @@ var/global/bomb_set
"vessel self-destruct instructions")
//stamp the paper
- R.apply_custom_stamp('icons/obj/items/stamps/stamp_cos.dmi', "'Top Secret'")
+ codes.apply_custom_stamp('icons/obj/items/stamps/stamp_cos.dmi', "'Top Secret'")
//====vessel self-destruct system====
/obj/machinery/nuclearbomb/station
@@ -475,7 +465,7 @@ var/global/bomb_set
for(var/obj/machinery/self_destruct/ch in get_area(src))
inserters += ch
-/obj/machinery/nuclearbomb/station/attackby(obj/item/O, mob/user)
+/obj/machinery/nuclearbomb/station/attackby(obj/item/used_item, mob/user)
return TRUE // cannot be moved
/obj/machinery/nuclearbomb/station/OnTopic(mob/user, href_list, datum/topic_state/state)
diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm
index 3cfa2dd57bbe..51f5f1d33cec 100644
--- a/code/game/machinery/oxygen_pump.dm
+++ b/code/game/machinery/oxygen_pump.dm
@@ -17,6 +17,7 @@
var/mask_type = /obj/item/clothing/mask/breath/emergency
var/icon_state_open = "emerg_open"
var/icon_state_closed = "emerg"
+ var/icon_state_active // TODO implement
power_channel = ENVIRON
idle_power_usage = 10
@@ -135,8 +136,8 @@
return
return 1
-/obj/machinery/oxygen_pump/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/machinery/oxygen_pump/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item))
stat ^= MAINT
user.visible_message(SPAN_NOTICE("\The [user] [stat & MAINT ? "opens" : "closes"] \the [src]."), SPAN_NOTICE("You [stat & MAINT ? "open" : "close"] \the [src]."))
if(stat & MAINT)
@@ -144,17 +145,17 @@
if(!stat)
icon_state = icon_state_closed
return TRUE
- if(istype(W, /obj/item/tank) && (stat & MAINT))
+ if(istype(used_item, /obj/item/tank) && (stat & MAINT))
if(tank)
to_chat(user, SPAN_WARNING("\The [src] already has a tank installed!"))
return TRUE
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- tank = W
+ tank = used_item
user.visible_message(SPAN_NOTICE("\The [user] installs \the [tank] into \the [src]."), SPAN_NOTICE("You install \the [tank] into \the [src]."))
src.add_fingerprint(user)
return TRUE
- if(istype(W, /obj/item/tank) && !stat)
+ if(istype(used_item, /obj/item/tank) && !stat)
to_chat(user, SPAN_WARNING("Please open the maintenance hatch first."))
return TRUE
return FALSE // TODO: should this be a parent call? do we want this to be (de)constructable?
@@ -233,3 +234,45 @@
tank.distribute_pressure += cp
tank.distribute_pressure = min(max(round(tank.distribute_pressure), 0), TANK_MAX_RELEASE_PRESSURE)
. = TOPIC_REFRESH // Refreshing is handled in machinery/Topic
+
+/obj/machinery/oxygen_pump/mobile
+ name = "portable oxygen pump"
+ icon = 'icons/obj/machines/medpump.dmi'
+ desc = "A portable oxygen pump with a retractable mask that you can pull over your face in case of emergencies."
+ icon_state = "medpump"
+ icon_state_open = "medpump_open"
+ icon_state_closed = "medpump"
+ icon_state_active = "medpump_active"
+ anchored = FALSE
+ density = TRUE
+
+/obj/machinery/oxygen_pump/mobile/stabilizer
+ name = "portable patient stabilizer"
+ desc = "A portable oxygen pump with a retractable mask used for stabilizing patients in the field."
+ icon_state = "patient_stabilizer"
+ icon_state_closed = "patient_stabilizer"
+ icon_state_open = "patient_stabilizer_open"
+ icon_state_active = "patient_stabilizer_active"
+
+/obj/machinery/oxygen_pump/mobile/stabilizer/Process()
+ . = ..()
+ if(!breather) // Safety.
+ return
+ if(breather.isSynthetic())
+ return
+
+/* TODO: port modifiers or something similar
+ breather.add_modifier(breather.stat == DEAD ? /datum/modifier/bloodpump/corpse : /datum/modifier/bloodpump, 6 SECONDS)
+*/
+
+ var/obj/item/organ/internal/lungs/lungs = breather.get_organ(BP_LUNGS, /obj/item/organ/internal/lungs)
+ if(!lungs)
+ return
+ if(lungs.status & ORGAN_DEAD)
+ breather.adjustOxyLoss(-(rand(1,8)))
+ else
+ breather.adjustOxyLoss(-(rand(10,15)))
+ if(lungs.is_bruised() && prob(30))
+ lungs.heal_damage(1)
+ else
+ breather.suffocation_counter = max(breather.suffocation_counter - rand(1,5), 0)
\ No newline at end of file
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index e117f2087257..005f27ca3465 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -71,8 +71,8 @@ Buildable meters
/obj/item/pipe/attack_self(mob/user)
return rotate(user)
-/obj/item/pipe/attackby(var/obj/item/W, var/mob/user)
- if(!IS_WRENCH(W))
+/obj/item/pipe/attackby(var/obj/item/used_item, var/mob/user)
+ if(!IS_WRENCH(used_item))
return ..()
if (!isturf(loc))
return 1
@@ -117,8 +117,8 @@ Buildable meters
. = ..()
set_extension(src, /datum/extension/parts_stash)
-/obj/item/machine_chassis/attackby(var/obj/item/W, var/mob/user)
- if(!IS_WRENCH(W))
+/obj/item/machine_chassis/attackby(var/obj/item/used_item, var/mob/user)
+ if(!IS_WRENCH(used_item))
return ..()
var/obj/machinery/machine = new build_type(get_turf(src), dir, TRUE)
var/datum/extension/parts_stash/stash = get_extension(src, /datum/extension/parts_stash)
diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm
index d34c2d094474..6287eafed099 100644
--- a/code/game/machinery/pipe/pipelayer.dm
+++ b/code/game/machinery/pipe/pipelayer.dm
@@ -14,12 +14,12 @@
var/P_type_t = ""
var/max_metal = 50
var/metal = 10
- var/obj/item/wrench/W
+ var/obj/item/wrench/wrench
var/list/Pipes = list("regular pipes"=0,"scrubbers pipes"=31,"supply pipes"=29,"heat exchange pipes"=2, "fuel pipes"=45)
/obj/machinery/pipelayer/Initialize()
. = ..()
- W = new(src)
+ wrench = new(src)
/obj/machinery/pipelayer/Move(new_turf,M_Dir)
. = ..()
@@ -39,24 +39,24 @@
user.visible_message("[user] has [!on?"de":""]activated \the [src].", "You [!on?"de":""]activate \the [src].")
return TRUE
-/obj/machinery/pipelayer/attackby(var/obj/item/W, var/mob/user)
+/obj/machinery/pipelayer/attackby(var/obj/item/used_item, var/mob/user)
- if(IS_WRENCH(W))
+ if(IS_WRENCH(used_item))
P_type_t = input("Choose pipe type", "Pipe type") as null|anything in Pipes
P_type = Pipes[P_type_t]
user.visible_message("[user] has set \the [src] to manufacture [P_type_t].", "You set \the [src] to manufacture [P_type_t].")
return TRUE
- if(IS_CROWBAR(W))
+ if(IS_CROWBAR(used_item))
a_dis=!a_dis
user.visible_message("[user] has [!a_dis?"de":""]activated auto-dismantling.", "You [!a_dis?"de":""]activate auto-dismantling.")
return TRUE
- if(istype(W, /obj/item/stack/material) && W.get_material_type() == /decl/material/solid/metal/steel)
+ if(istype(used_item, /obj/item/stack/material) && used_item.get_material_type() == /decl/material/solid/metal/steel)
- var/result = load_metal(W)
+ var/result = load_metal(used_item)
if(isnull(result))
- to_chat(user, "Unable to load [W] - no metal found.")
+ to_chat(user, "Unable to load [used_item] - no metal found.")
else if(!result)
to_chat(user, "\The [src] is full.")
else
@@ -64,7 +64,7 @@
return TRUE
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
if(metal)
var/m = round(input(usr,"Please specify the amount of metal to remove","Remove metal",min(round(metal),50)) as num, 1)
m = min(m, 50)
@@ -129,6 +129,6 @@
var/obj/item/pipe/P = new(w_turf)
P.set_dir(p_dir)
- P.attackby(W , src)
+ P.attackby(wrench , src)
return 1
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 0fde815d1326..99d2fd9681f1 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -236,9 +236,9 @@ var/global/list/turret_icons
. = ..()
// TODO: remove these or refactor to use construct states
-/obj/machinery/porta_turret/attackby(obj/item/I, mob/user)
+/obj/machinery/porta_turret/attackby(obj/item/used_item, mob/user)
if(stat & BROKEN)
- if(IS_CROWBAR(I))
+ if(IS_CROWBAR(used_item))
//If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components
to_chat(user, "You begin prying the metal coverings off.")
@@ -251,7 +251,7 @@ var/global/list/turret_icons
return TRUE
return FALSE
- else if(IS_WRENCH(I))
+ else if(IS_WRENCH(used_item))
if(enabled || raised)
to_chat(user, "You cannot unsecure an active turret!")
return TRUE
@@ -277,7 +277,7 @@ var/global/list/turret_icons
wrenching = 0
return TRUE
- else if(istype(I, /obj/item/card/id)||istype(I, /obj/item/modular_computer))
+ else if(istype(used_item, /obj/item/card/id)||istype(used_item, /obj/item/modular_computer))
//Behavior lock/unlock mangement
if(allowed(user))
locked = !locked
@@ -289,9 +289,9 @@ var/global/list/turret_icons
else
//if the turret was attacked with the intention of harming it:
- var/force = I.expend_attack_force(user) * 0.5
+ var/force = used_item.expend_attack_force(user) * 0.5
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- take_damage(force, I.atom_damage_type)
+ take_damage(force, used_item.atom_damage_type)
if(force > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off
if(!attacked && !emagged)
attacked = 1
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index 9a05621916b9..a63a730636f3 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -15,7 +15,6 @@
var/icon_state_idle = "recharger0" //also when unpowered
var/portable = 1
- stat_immune = 0
uncreated_component_parts = null
construct_state = /decl/machine_construction/default/panel_closed
@@ -23,10 +22,10 @@
charging = null
. = ..()
-/obj/machinery/recharger/attackby(obj/item/G, mob/user)
+/obj/machinery/recharger/attackby(obj/item/used_item, mob/user)
var/allowed = 0
for (var/allowed_type in allowed_devices)
- if (istype(G, allowed_type)) allowed = 1
+ if (istype(used_item, allowed_type)) allowed = 1
if(allowed)
. = TRUE
@@ -35,24 +34,24 @@
return
// Checks to make sure the recharger is powered.
if(stat & NOPOWER)
- to_chat(user, "\The [src] blinks red as you try to insert \the [G]!")
+ to_chat(user, "\The [src] blinks red as you try to insert \the [used_item]!")
return
- if (istype(G, /obj/item/gun/energy/))
- var/obj/item/gun/energy/E = G
+ if (istype(used_item, /obj/item/gun/energy/))
+ var/obj/item/gun/energy/E = used_item
if(E.self_recharge)
to_chat(user, "You can't find a charging port on \the [E].")
return
- if(!G.get_cell())
+ if(!used_item.get_cell())
to_chat(user, "This device does not have a battery installed.")
return
- if(user.try_unequip(G))
- G.forceMove(src)
- charging = G
+ if(user.try_unequip(used_item))
+ used_item.forceMove(src)
+ charging = used_item
update_icon()
return
- if(portable && IS_WRENCH(G) && !panel_open)
+ if(portable && IS_WRENCH(used_item) && !panel_open)
. = TRUE
if(charging)
to_chat(user, "Remove [charging] first!")
@@ -83,11 +82,11 @@
update_use_power(POWER_USE_IDLE)
icon_state = icon_state_idle
else
- var/obj/item/cell/C = charging.get_cell()
- if(istype(C))
- if(!C.fully_charged())
+ var/obj/item/cell/cell = charging.get_cell()
+ if(istype(cell))
+ if(!cell.fully_charged())
icon_state = icon_state_charging
- C.give(active_power_usage*CELLRATE)
+ cell.give(active_power_usage*CELLRATE)
update_use_power(POWER_USE_ACTIVE)
else
icon_state = icon_state_charged
@@ -98,9 +97,9 @@
..(severity)
return
if(charging)
- var/obj/item/cell/C = charging.get_cell()
- if(istype(C))
- C.emp_act(severity)
+ var/obj/item/cell/cell = charging.get_cell()
+ if(istype(cell))
+ cell.emp_act(severity)
..(severity)
/obj/machinery/recharger/on_update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 1be2e054aaaa..74a34b4ac150 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -8,7 +8,6 @@
idle_power_usage = 50
base_type = /obj/machinery/recharge_station
uncreated_component_parts = null
- stat_immune = 0
construct_state = /decl/machine_construction/default/panel_closed
var/overlay_icon = 'icons/obj/objects.dmi'
@@ -70,12 +69,12 @@
var/obj/item/cell/target
if(isrobot(occupant))
- var/mob/living/silicon/robot/R = occupant
- target = R.cell
- if(R.module)
- R.module.respawn_consumable(R, charging_power * CELLRATE / 250) //consumables are magical, apparently
+ var/mob/living/silicon/robot/robot = occupant
+ target = robot.cell
+ if(robot.module)
+ robot.module.respawn_consumable(robot, charging_power * CELLRATE / 250) //consumables are magical, apparently
// If we are capable of repairing damage, reboot destroyed components and allow them to be repaired for very large power spike.
- var/list/damaged = R.get_damaged_components(1,1,1)
+ var/list/damaged = robot.get_damaged_components(1,1,1)
if(damaged.len && wire_rate && weld_rate)
for(var/datum/robot_component/C in damaged)
if((C.installed == -1) && use_power_oneoff(100 KILOWATTS, LOCAL) <= 0)
@@ -174,8 +173,8 @@
last_overlay_state = overlay_state()
overlays = list(image(overlay_icon, overlay_state()))
-/obj/machinery/recharge_station/Bumped(var/mob/living/silicon/robot/R)
- addtimer(CALLBACK(src, PROC_REF(go_in), R), 1)
+/obj/machinery/recharge_station/Bumped(var/mob/living/silicon/robot/robot)
+ addtimer(CALLBACK(src, PROC_REF(go_in), robot), 1)
/obj/machinery/recharge_station/proc/go_in(var/mob/M)
@@ -191,8 +190,8 @@
/obj/machinery/recharge_station/proc/hascell(var/mob/M)
if(isrobot(M))
- var/mob/living/silicon/robot/R = M
- return (R.cell)
+ var/mob/living/silicon/robot/robot = M
+ return (robot.cell)
if(ishuman(M))
var/mob/living/human/H = M
if(H.isSynthetic())
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index 2fe46fa3e1d6..3452f128f8b0 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -206,16 +206,16 @@ var/global/req_console_information = list()
set_department(choice)
return TOPIC_REFRESH
-/obj/machinery/network/requests_console/attackby(var/obj/item/O, var/mob/user)
- if (istype(O, /obj/item/card/id))
+/obj/machinery/network/requests_console/attackby(var/obj/item/used_item, var/mob/user)
+ if (istype(used_item, /obj/item/card/id))
if(inoperable(MAINT)) return TRUE
switch(screen)
if(RCS_MESSAUTH)
- var/obj/item/card/id/T = O
+ var/obj/item/card/id/T = used_item
msgVerified = text("Verified by [T.registered_name] ([T.assignment])")
SSnano.update_uis(src)
if(RCS_ANNOUNCE)
- var/obj/item/card/id/ID = O
+ var/obj/item/card/id/ID = used_item
if (access_RC_announce in ID.GetAccess())
announceAuth = 1
announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name
@@ -224,10 +224,10 @@ var/global/req_console_information = list()
to_chat(user, "You are not authorized to send announcements.")
SSnano.update_uis(src)
return TRUE
- if (istype(O, /obj/item/stamp))
+ if (istype(used_item, /obj/item/stamp))
if(inoperable(MAINT)) return TRUE
if(screen == RCS_MESSAUTH)
- var/obj/item/stamp/T = O
+ var/obj/item/stamp/T = used_item
msgStamped = "Stamped with the [T.name]"
SSnano.update_uis(src)
return TRUE
diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm
index 28bcefc71584..6f451e7ce6c1 100644
--- a/code/game/machinery/seed_extractor.dm
+++ b/code/game/machinery/seed_extractor.dm
@@ -10,36 +10,34 @@
active_power_usage = 2000
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
- stat_immune = 0
-/obj/machinery/seed_extractor/attackby(var/obj/item/O, var/mob/user)
+/obj/machinery/seed_extractor/attackby(var/obj/item/used_item, var/mob/user)
// Fruits and vegetables.
- if(istype(O, /obj/item/food/grown))
- if(!user.try_unequip(O))
+ if(istype(used_item, /obj/item/food/grown))
+ if(!user.try_unequip(used_item))
return TRUE
- var/obj/item/food/grown/F = O
+ var/obj/item/food/grown/F = used_item
if(!F.seed)
- to_chat(user, SPAN_WARNING("\The [O] doesn't seem to have any usable seeds inside it."))
+ to_chat(user, SPAN_WARNING("\The [used_item] doesn't seem to have any usable seeds inside it."))
return TRUE
- to_chat(user, SPAN_NOTICE("You extract some seeds from [O]."))
+ to_chat(user, SPAN_NOTICE("You extract some seeds from [used_item]."))
for(var/i = 1 to rand(1,4))
new /obj/item/seeds/modified(get_turf(src), null, F.seed)
- qdel(O)
+ qdel(used_item)
return TRUE
//Grass.
- if(istype(O, /obj/item/stack/tile/grass))
- var/obj/item/stack/tile/grass/S = O
+ if(istype(used_item, /obj/item/stack/tile/grass))
+ var/obj/item/stack/tile/grass/S = used_item
if (S.use(1))
to_chat(user, SPAN_NOTICE("You extract some seeds from the grass tile."))
new /obj/item/seeds/grassseed(loc)
return TRUE
- if(istype(O, /obj/item/fossil/plant)) // Fossils
- var/obj/item/seeds/random/R = new(get_turf(src))
- to_chat(user, SPAN_NOTICE("\The [src] scans \the [O] and spits out \a [R]."))
- qdel(O)
+ if(istype(used_item, /obj/item/fossil/plant)) // Fossils
+ to_chat(user, SPAN_NOTICE("\The [src] scans \the [used_item] and spits out \a [new /obj/item/seeds/random(get_turf(src))]."))
+ qdel(used_item)
return TRUE
return ..()
diff --git a/code/game/machinery/self_destruct.dm b/code/game/machinery/self_destruct.dm
index badb1853918b..a987fa104aee 100644
--- a/code/game/machinery/self_destruct.dm
+++ b/code/game/machinery/self_destruct.dm
@@ -9,31 +9,31 @@
var/armed = 0
var/damaged = 0
-/obj/machinery/self_destruct/attackby(obj/item/W, mob/user)
- if(IS_WELDER(W))
+/obj/machinery/self_destruct/attackby(obj/item/used_item, mob/user)
+ if(IS_WELDER(used_item))
if(!damaged)
return FALSE
user.visible_message("[user] begins to repair [src].", "You begin repairing [src].")
if(do_after(user, 100, src))
- var/obj/item/weldingtool/w = W
+ var/obj/item/weldingtool/w = used_item
if(w.weld(10))
damaged = 0
user.visible_message("[user] repairs [src].", "You repair [src].")
else
to_chat(user, "There is not enough fuel to repair [src].")
return TRUE
- if(istype(W, /obj/item/nuclear_cylinder))
+ if(istype(used_item, /obj/item/nuclear_cylinder))
if(damaged)
to_chat(user, "[src] is damaged, you cannot place the cylinder.")
return TRUE
if(cylinder)
to_chat(user, "There is already a cylinder here.")
return TRUE
- user.visible_message("[user] begins to carefully place [W] onto [src].", "You begin to carefully place [W] onto [src].")
- if(do_after(user, 80, src) && user.try_unequip(W, src))
- cylinder = W
+ user.visible_message("[user] begins to carefully place [used_item] onto [src].", "You begin to carefully place [used_item] onto [src].")
+ if(do_after(user, 80, src) && user.try_unequip(used_item, src))
+ cylinder = used_item
density = TRUE
- user.visible_message("[user] places [W] onto [src].", "You place [W] onto [src].")
+ user.visible_message("[user] places [used_item] onto [src].", "You place [used_item] onto [src].")
update_icon()
return TRUE
return ..()
diff --git a/code/game/machinery/self_destruct_storage.dm b/code/game/machinery/self_destruct_storage.dm
index afaf920ef1da..df7512e5da09 100644
--- a/code/game/machinery/self_destruct_storage.dm
+++ b/code/game/machinery/self_destruct_storage.dm
@@ -51,6 +51,16 @@
to_chat(user, SPAN_WARNING("The card fails to do anything. It seems this device has an advanced encryption system."))
return NO_EMAG_ACT
+// I hate this but can't think of a better way aside from skipping the testing entirely for this type,
+// which is worse. Basically, we just need to ensure we pass the cannot_transition_to check.
+/obj/machinery/nuclear_cylinder_storage/fail_construct_state_unit_test()
+ locked = FALSE
+ open = TRUE
+ var/list/old_cylinders = cylinders // This is evil.
+ cylinders = list()
+ . = ..()
+ cylinders = old_cylinders
+
/obj/machinery/nuclear_cylinder_storage/components_are_accessible(path)
return !locked && open && ..()
@@ -86,13 +96,13 @@
return TRUE
return FALSE
-/obj/machinery/nuclear_cylinder_storage/attackby(obj/item/O, mob/user)
- if(!open && operable() && istype(O, /obj/item/card/id))
+/obj/machinery/nuclear_cylinder_storage/attackby(obj/item/used_item, mob/user)
+ if(!open && operable() && istype(used_item, /obj/item/card/id))
if(panel_open)
to_chat(user, SPAN_WARNING("\The [src] is currently in maintenance mode!"))
return TRUE
- var/obj/item/card/id/id = O
+ var/obj/item/card/id/id = used_item
if(check_access(id))
locked = !locked
user.visible_message(
@@ -102,21 +112,21 @@
update_icon()
return TRUE
- if(open && istype(O, /obj/item/nuclear_cylinder) && (length(cylinders) < max_cylinders))
+ if(open && istype(used_item, /obj/item/nuclear_cylinder) && (length(cylinders) < max_cylinders))
if(panel_open)
to_chat(user, SPAN_WARNING("\The [src] is currently in maintenance mode!"))
return TRUE
user.visible_message(
- "\The [user] begins inserting \the [O] into storage.",
- "You begin inserting \the [O] into storage."
+ "\The [user] begins inserting \the [used_item] into storage.",
+ "You begin inserting \the [used_item] into storage."
)
- if(do_after(user, interact_time, src) && open && (length(cylinders) < max_cylinders) && user.try_unequip(O, src))
+ if(do_after(user, interact_time, src) && open && (length(cylinders) < max_cylinders) && user.try_unequip(used_item, src))
user.visible_message(
- "\The [user] places \the [O] into storage.",
- "You place \the [O] into storage."
+ "\The [user] places \the [used_item] into storage.",
+ "You place \the [used_item] into storage."
)
- cylinders.Add(O)
+ cylinders.Add(used_item)
update_icon()
return TRUE
diff --git a/code/game/machinery/singularitybeacon.dm b/code/game/machinery/singularitybeacon.dm
index 5d8690d56765..e9f6d6381be5 100644
--- a/code/game/machinery/singularitybeacon.dm
+++ b/code/game/machinery/singularitybeacon.dm
@@ -54,8 +54,8 @@ var/global/list/singularity_beacons = list()
else
to_chat(user, SPAN_DANGER("You need to screw the beacon to the floor first!"))
-/obj/machinery/singularity_beacon/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/machinery/singularity_beacon/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item))
if(use_power)
to_chat(user, SPAN_DANGER("You need to deactivate the beacon first!"))
return TRUE
diff --git a/code/game/machinery/smartfridge/_smartfridge.dm b/code/game/machinery/smartfridge/_smartfridge.dm
index c446e87a4389..68db0c387afd 100644
--- a/code/game/machinery/smartfridge/_smartfridge.dm
+++ b/code/game/machinery/smartfridge/_smartfridge.dm
@@ -45,8 +45,8 @@
return list()
return ..()
-/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O)
- if(istype(O,/obj/item/food/grown/) || istype(O,/obj/item/seeds/))
+/obj/machinery/smartfridge/proc/accept_check(var/obj/item/stocking_item)
+ if(istype(stocking_item,/obj/item/food/grown) || istype(stocking_item,/obj/item/seeds))
return 1
return 0
@@ -104,10 +104,10 @@
draw_state = "[icon_state]-top"
if(check_state_in_icon(draw_state, icon))
- var/image/I = image(icon, draw_state)
- I.pixel_z = 32
- I.layer = ABOVE_WINDOW_LAYER
- add_overlay(I)
+ var/image/overlay_image = image(icon, draw_state)
+ overlay_image.pixel_z = 32
+ overlay_image.layer = ABOVE_WINDOW_LAYER
+ add_overlay(overlay_image)
// Append our off state if needed.
if(stat & BROKEN)
@@ -116,9 +116,9 @@
icon_state = "[icon_state]-off"
/obj/machinery/smartfridge/dismantle()
- for(var/datum/stored_items/I in item_records)
- while(I.amount > 0)
- I.get_product(get_turf(src)) // They'd get dumped anyway, but this makes things GC properly.
+ for(var/datum/stored_items/stored_item in item_records)
+ while(stored_item.amount > 0)
+ stored_item.get_product(get_turf(src)) // They'd get dumped anyway, but this makes things GC properly.
..()
/*******************
@@ -129,42 +129,42 @@
. = ..()
update_icon()
-/obj/machinery/smartfridge/attackby(var/obj/item/O, var/mob/user)
- if(accept_check(O))
- if(!user.try_unequip(O))
+/obj/machinery/smartfridge/attackby(var/obj/item/used_item, var/mob/user)
+ if(accept_check(used_item))
+ if(!user.try_unequip(used_item))
return TRUE
- stock_item(O)
- user.visible_message("\The [user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].")
+ stock_item(used_item)
+ user.visible_message("\The [user] has added \the [used_item] to \the [src].", "You add \the [used_item] to \the [src].")
update_icon()
return TRUE
- if(O.storage)
+ if(used_item.storage)
var/plants_loaded = 0
- for(var/obj/G in O.storage.get_contents())
- if(accept_check(G) && O.storage.remove_from_storage(user, G, src, TRUE))
+ for(var/obj/G in used_item.storage.get_contents())
+ if(accept_check(G) && used_item.storage.remove_from_storage(user, G, src, TRUE))
plants_loaded++
stock_item(G)
- O.storage.finish_bulk_removal()
+ used_item.storage.finish_bulk_removal()
if(plants_loaded)
- user.visible_message("\The [user] loads \the [src] with the contents of \the [O].", "You load \the [src] with the contents of \the [O].")
- if(length(O.storage.get_contents()) > 0)
+ user.visible_message("\The [user] loads \the [src] with the contents of \the [used_item].", "You load \the [src] with the contents of \the [used_item].")
+ if(length(used_item.storage.get_contents()) > 0)
to_chat(user, "Some items were refused.")
return TRUE
return ..()
-/obj/machinery/smartfridge/proc/stock_item(var/obj/item/O)
- for(var/datum/stored_items/I in item_records)
- if(istype(O, I.item_path) && O.name == I.item_name)
- stock(I, O)
+/obj/machinery/smartfridge/proc/stock_item(var/obj/item/stocking_item)
+ for(var/datum/stored_items/stored_item in item_records)
+ if(istype(stocking_item, stored_item.item_path) && stocking_item.name == stored_item.item_name)
+ stock(stored_item, stocking_item)
return
- var/datum/stored_items/I = new/datum/stored_items(src, O.type, O.name)
- dd_insertObjectList(item_records, I)
- stock(I, O)
+ var/datum/stored_items/stored_item = new/datum/stored_items(src, stocking_item.type, stocking_item.name)
+ dd_insertObjectList(item_records, stored_item)
+ stock(stored_item, stocking_item)
-/obj/machinery/smartfridge/proc/stock(var/datum/stored_items/I, var/obj/item/O)
- I.add_product(O)
+/obj/machinery/smartfridge/proc/stock(var/datum/stored_items/stored_item, var/obj/item/stocking_item)
+ stored_item.add_product(stocking_item)
SSnano.update_uis(src)
/obj/machinery/smartfridge/interface_interact(mob/user)
@@ -187,10 +187,10 @@
var/list/items[0]
for (var/i=1 to length(item_records))
- var/datum/stored_items/I = item_records[i]
- var/count = I.get_amount()
+ var/datum/stored_items/stored_item = item_records[i]
+ var/count = stored_item.get_amount()
if(count > 0)
- items.Add(list(list("display_name" = html_encode(capitalize(I.item_name)), "vend" = i, "quantity" = count)))
+ items.Add(list(list("display_name" = html_encode(capitalize(stored_item.item_name)), "vend" = i, "quantity" = count)))
if(items.len > 0)
data["contents"] = items
@@ -210,15 +210,15 @@
if(href_list["vend"])
var/index = text2num(href_list["vend"])
- var/datum/stored_items/I = item_records[index]
- var/count = I.get_amount()
+ var/datum/stored_items/stored_item = item_records[index]
+ var/count = stored_item.get_amount()
var/amount = clamp(text2num(href_list["amount"]), 0, count)
// Sanity check, there are probably ways to press the button when it shouldn't be possible.
if(amount <= 0)
return TOPIC_REFRESH // you must be confused, we have none of that here!
for(var/i = 1 to amount)
- I.get_product(get_turf(src))
+ stored_item.get_product(get_turf(src))
update_icon()
var/vend_state = "[icon_state]-vend"
if (check_state_in_icon(vend_state, icon)) //Show the vending animation if needed
@@ -232,8 +232,8 @@
if(!target)
return 0
- for(var/datum/stored_items/I in src.item_records)
- throw_item = I.get_product(loc)
+ for(var/datum/stored_items/stored_item in src.item_records)
+ throw_item = stored_item.get_product(loc)
if(!QDELETED(throw_item))
break
diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm
index f42cb1070087..4059128a7d11 100644
--- a/code/game/machinery/status_display.dm
+++ b/code/game/machinery/status_display.dm
@@ -168,23 +168,23 @@
remove_display()
var/decl/security_state/security_state = GET_DECL(global.using_map.security_state)
- var/decl/security_level/sl = security_state.current_security_level
+ var/decl/security_level/sec_level = security_state.current_security_level
- set_light(sl.light_range, sl.light_power, sl.light_color_status_display)
+ set_light(sec_level.light_range, sec_level.light_power, sec_level.light_color_status_display)
- if(sl.alarm_appearance.display_icon)
- var/image/alert1 = image(sl.icon, sl.alarm_appearance.display_icon)
- alert1.color = sl.alarm_appearance.display_icon_color
+ if(sec_level.alarm_appearance.display_icon)
+ var/image/alert1 = image(sec_level.icon, sec_level.alarm_appearance.display_icon)
+ alert1.color = sec_level.alarm_appearance.display_icon_color
overlays |= alert1
- if(sl.alarm_appearance.display_icon_twotone)
- var/image/alert2 = image(sl.icon, sl.alarm_appearance.display_icon_twotone)
- alert2.color = sl.alarm_appearance.display_icon_twotone_color
+ if(sec_level.alarm_appearance.display_icon_twotone)
+ var/image/alert2 = image(sec_level.icon, sec_level.alarm_appearance.display_icon_twotone)
+ alert2.color = sec_level.alarm_appearance.display_icon_twotone_color
overlays |= alert2
- if(sl.alarm_appearance.display_emblem)
- var/image/alert3 = image(sl.icon, sl.alarm_appearance.display_emblem)
- alert3.color = sl.alarm_appearance.display_emblem_color
+ if(sec_level.alarm_appearance.display_emblem)
+ var/image/alert3 = image(sec_level.icon, sec_level.alarm_appearance.display_emblem)
+ alert3.color = sec_level.alarm_appearance.display_emblem_color
overlays |= alert3
/obj/machinery/status_display/proc/set_picture(state)
diff --git a/code/game/machinery/suit_cycler.dm b/code/game/machinery/suit_cycler.dm
index fd147aef4247..bb484cec914c 100644
--- a/code/game/machinery/suit_cycler.dm
+++ b/code/game/machinery/suit_cycler.dm
@@ -49,7 +49,7 @@
var/target_bodytype
var/mob/living/human/occupant
- var/obj/item/clothing/suit/space/void/suit
+ var/obj/item/clothing/suit/space/suit
var/obj/item/clothing/head/helmet/space/helmet
var/obj/item/clothing/shoes/magboots/boots
@@ -148,6 +148,21 @@
target_bodytype = available_bodytypes[1]
update_icon()
+#ifdef UNIT_TEST
+ // Pass this off to lateload to make sure any Initialize() overrides on subtypes or modpacks also run.
+ return INITIALIZE_HINT_LATELOAD
+
+/obj/machinery/suit_cycler/LateInitialize()
+ . = ..()
+ if(suit && !istype(suit))
+ log_error("[type] has invalid suit instance: [suit]")
+ if(helmet && !istype(helmet))
+ log_error("[type] has invalid helmet instance: [helmet]")
+ if(boots && !istype(boots))
+ log_error("[type] has invalid suit instance: [boots]")
+#endif
+
+
/obj/machinery/suit_cycler/Destroy()
if(occupant)
occupant.dropInto(loc)
@@ -195,33 +210,33 @@
return TRUE
return ..()
-/obj/machinery/suit_cycler/attackby(obj/item/I, mob/user)
+/obj/machinery/suit_cycler/attackby(obj/item/used_item, mob/user)
if(electrified != 0 && shock(user, 100))
return TRUE
//Hacking init.
- if(IS_MULTITOOL(I) || IS_WIRECUTTER(I))
+ if(IS_MULTITOOL(used_item) || IS_WIRECUTTER(used_item))
if(panel_open)
physical_attack_hand(user)
return TRUE
- if(istype(I, /obj/item/clothing/shoes/magboots))
+ if(istype(used_item, /obj/item/clothing/shoes/magboots))
if(locked)
to_chat(user, SPAN_WARNING("The suit cycler is locked."))
return TRUE
if(boots)
to_chat(user, SPAN_WARNING("The cycler already contains some boots."))
return TRUE
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- to_chat(user, "You fit \the [I] into the suit cycler.")
- set_boots(I)
+ to_chat(user, "You fit \the [used_item] into the suit cycler.")
+ set_boots(used_item)
update_icon()
updateUsrDialog()
return TRUE
- if(istype(I,/obj/item/clothing/head/helmet/space) && !istype(I, /obj/item/clothing/head/helmet/space/rig))
+ if(istype(used_item,/obj/item/clothing/head/helmet/space) && !istype(used_item, /obj/item/clothing/head/helmet/space/rig))
if(locked)
to_chat(user, SPAN_WARNING("The suit cycler is locked."))
@@ -231,26 +246,26 @@
to_chat(user, SPAN_WARNING("The cycler already contains a helmet."))
return TRUE
- if(user.try_unequip(I, src))
- to_chat(user, "You fit \the [I] into the suit cycler.")
- set_helmet(I)
+ if(user.try_unequip(used_item, src))
+ to_chat(user, "You fit \the [used_item] into the suit cycler.")
+ set_helmet(used_item)
update_icon()
updateUsrDialog()
return TRUE
- if(istype(I,/obj/item/clothing/suit/space/void))
+ if(istype(used_item, /obj/item/clothing/suit/space))
if(locked)
to_chat(user, SPAN_WARNING("The suit cycler is locked."))
return TRUE
if(suit)
- to_chat(user, SPAN_WARNING("The cycler already contains a voidsuit."))
+ to_chat(user, SPAN_WARNING("The cycler already contains a spacesuit."))
return TRUE
- if(user.try_unequip(I, src))
- to_chat(user, "You fit \the [I] into the suit cycler.")
- set_suit(I)
+ if(user.try_unequip(used_item, src))
+ to_chat(user, "You fit \the [used_item] into the suit cycler.")
+ set_suit(used_item)
update_icon()
updateUsrDialog()
return TRUE
@@ -470,6 +485,11 @@
return
eject_occupant(usr)
+/obj/machinery/suit_cycler/relaymove(var/mob/user)
+ ..()
+ if(occupant == user)
+ eject_occupant(user)
+
/obj/machinery/suit_cycler/proc/eject_occupant(mob/user)
if(locked || active)
@@ -502,3 +522,6 @@
if(boots)
boots.refit_for_bodytype(target_bodytype)
finished_job()
+
+/obj/machinery/suit_cycler/shuttle_rotate(angle) // DO NOT CHANGE DIR. Change this when someone adds directional sprites for suit cyclers.
+ return
diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm
index b74a93b635dc..6b5e01a6d6cd 100644
--- a/code/game/machinery/supplybeacon.dm
+++ b/code/game/machinery/supplybeacon.dm
@@ -41,8 +41,8 @@
if(!drop_type)
drop_type = pick(supply_drop_random_loot_types())
-/obj/structure/supply_beacon/attackby(var/obj/item/W, var/mob/user)
- if(!activated && IS_WRENCH(W))
+/obj/structure/supply_beacon/attackby(var/obj/item/used_item, var/mob/user)
+ if(!activated && IS_WRENCH(used_item))
anchored = !anchored
user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "secures" : "unsecures"] \the [src]."))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 0b61d1782680..6053e343fad9 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -48,14 +48,14 @@
var/turf/T = get_turf(locked)
. += SPAN_NOTICE("The console is locked on to \[[T.loc.name]\].")
-/obj/machinery/computer/teleporter/attackby(var/obj/I, var/mob/user)
+/obj/machinery/computer/teleporter/attackby(var/obj/used_item, var/mob/user)
- var/obj/item/card/data/C = I
+ var/obj/item/card/data/C = used_item
if(!istype(C) || (stat & (NOPOWER|BROKEN)) || C.function != "teleporter")
return ..()
var/obj/L = null
- for(var/obj/abstract/landmark/sloc in global.landmarks_list)
+ for(var/obj/abstract/landmark/sloc in global.all_landmarks)
if(sloc.name != C.data || (locate(/mob/living) in sloc.loc))
continue
L = sloc
@@ -64,10 +64,10 @@
if(!L)
L = locate("landmark*[C.data]") // use old stype
- if(istype(L, /obj/abstract/landmark) && isturf(L.loc) && user.try_unequip(I))
+ if(istype(L, /obj/abstract/landmark) && isturf(L.loc) && user.try_unequip(used_item))
to_chat(user, "You insert the coordinates into the machine.")
to_chat(user, "A message flashes across the screen reminding the traveller that the nuclear authentication disk is to remain on the [station_name()] at all times.")
- qdel(I)
+ qdel(used_item)
audible_message(SPAN_NOTICE("Locked in."))
src.locked = L
one_time_use = 1
@@ -83,10 +83,10 @@
var/list/areaindex = list()
. = TRUE
- for(var/obj/item/radio/beacon/R in global.radio_beacons)
- if(!R.functioning)
+ for(var/obj/item/radio/beacon/radio in global.radio_beacons)
+ if(!radio.functioning)
continue
- var/turf/T = get_turf(R)
+ var/turf/T = get_turf(radio)
if (!T)
continue
if(!isPlayerLevel(T.z))
@@ -96,13 +96,13 @@
tmpname = "[tmpname] ([++areaindex[tmpname]])"
else
areaindex[tmpname] = 1
- L[tmpname] = R
+ L[tmpname] = radio
- for (var/obj/item/implant/tracking/I in global.tracking_implants)
- if (!I.implanted || !ismob(I.loc))
+ for (var/obj/item/implant/tracking/used_item in global.tracking_implants)
+ if (!used_item.implanted || !ismob(used_item.loc))
continue
else
- var/mob/M = I.loc
+ var/mob/M = used_item.loc
if (M.stat == DEAD)
if (M.timeofdeath + 6000 < world.time)
continue
@@ -116,7 +116,7 @@
tmpname = "[tmpname] ([++areaindex[tmpname]])"
else
areaindex[tmpname] = 1
- L[tmpname] = I
+ L[tmpname] = used_item
var/desc = input("Please select a location to lock in.", "Locking Computer") in L|null
if(!desc)
@@ -150,8 +150,8 @@
if(station && station.engaged)
station.disengage()
-/obj/machinery/computer/teleporter/proc/set_target(var/obj/O)
- src.locked = O
+/obj/machinery/computer/teleporter/proc/set_target(var/obj/target)
+ src.locked = target
events_repository.register(/decl/observ/destroyed, locked, src, PROC_REF(target_lost))
/obj/machinery/computer/teleporter/Destroy()
@@ -248,7 +248,7 @@
else
z_flags &= ~ZMM_MANGLE_PLANES
-/obj/machinery/teleport/station/attackby(var/obj/item/W, var/mob/user)
+/obj/machinery/teleport/station/attackby(var/obj/item/used_item, var/mob/user)
return attack_hand_with_interaction_checks(user) || ..()
/obj/machinery/teleport/station/interface_interact(var/mob/user)
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index 235da1f889fd..4955f4173658 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -84,11 +84,11 @@
return ..()
-/obj/machinery/turretid/attackby(obj/item/W, mob/user)
+/obj/machinery/turretid/attackby(obj/item/used_item, mob/user)
if(stat & BROKEN)
return FALSE
- if(istype(W, /obj/item/card/id)||istype(W, /obj/item/modular_computer))
+ if(istype(used_item, /obj/item/card/id)||istype(used_item, /obj/item/modular_computer))
if(src.allowed(user))
if(emagged)
to_chat(user, "The turret control is unresponsive.")
diff --git a/code/game/machinery/turrets/_turrets.dm b/code/game/machinery/turrets/_turrets.dm
index dd6109cdf461..d0e2354b8d57 100644
--- a/code/game/machinery/turrets/_turrets.dm
+++ b/code/game/machinery/turrets/_turrets.dm
@@ -132,19 +132,19 @@
return
update_use_power(POWER_USE_IDLE)
-/obj/machinery/turret/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/gun) && !installed_gun)
- if(!user.try_unequip(I, src))
+/obj/machinery/turret/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/gun) && !installed_gun)
+ if(!user.try_unequip(used_item, src))
return TRUE
- to_chat(user, SPAN_NOTICE("You install \the [I] into \the [src]!"))
- installed_gun = I
+ to_chat(user, SPAN_NOTICE("You install \the [used_item] into \the [src]!"))
+ installed_gun = used_item
setup_gun()
return TRUE
- if(istype(I, /obj/item/ammo_magazine) || istype(I, /obj/item/ammo_casing))
+ if(istype(used_item, /obj/item/ammo_magazine) || istype(used_item, /obj/item/ammo_casing))
var/obj/item/stock_parts/ammo_box/ammo_box = get_component_of_type(/obj/item/stock_parts/ammo_box)
if(istype(ammo_box))
- return ammo_box.attackby(I, user)
+ return ammo_box.attackby(used_item, user)
. = ..()
// This is called after the gun gets instantiated or slotted in.
@@ -234,7 +234,7 @@
return angle_between_two_angles(leftmost_traverse, angle, rightmost_traverse)
/obj/machinery/turret/set_dir(ndir)
- ..()
+ . = ..()
calculate_traverse()
// Instantly turns the turret to a specific absolute angle.
@@ -323,12 +323,12 @@
else if(length(potential_targets))
while(length(potential_targets))
- var/weakref/W = potential_targets[1]
- potential_targets -= W
- if(is_valid_target(W.resolve()))
- target = W
+ var/weakref/target_ref = potential_targets[1]
+ potential_targets -= target_ref
+ if(is_valid_target(target_ref.resolve()))
+ target = target_ref
track_target()
- return W
+ return target_ref
target = null
return null
diff --git a/code/game/machinery/turrets/network_turret.dm b/code/game/machinery/turrets/network_turret.dm
index ede8a175eef7..110daa4e9487 100644
--- a/code/game/machinery/turrets/network_turret.dm
+++ b/code/game/machinery/turrets/network_turret.dm
@@ -34,13 +34,13 @@
. = ..()
set_extension(src, /datum/extension/network_device/sentry_turret)
-/obj/machinery/turret/network/attackby(obj/item/I, mob/user)
+/obj/machinery/turret/network/attackby(obj/item/used_item, mob/user)
. = ..()
- if(istype(I, /obj/item/stock_parts/computer/hard_drive/portable))
+ if(istype(used_item, /obj/item/stock_parts/computer/hard_drive/portable))
if(!check_access(user))
to_chat(user, SPAN_WARNING("\The [src] flashes a red light: you lack access to download its logfile."))
return
- var/obj/item/stock_parts/computer/hard_drive/portable/drive = I
+ var/obj/item/stock_parts/computer/hard_drive/portable/drive = used_item
var/datum/computer_file/data/logfile/turret_log = prepare_log_file()
if(drive.store_file(turret_log) == OS_FILE_SUCCESS)
to_chat(user, SPAN_NOTICE("\The [src] flashes a blue light as it downloads its log file onto \the [drive]!"))
diff --git a/code/game/machinery/turrets/turret_ammo.dm b/code/game/machinery/turrets/turret_ammo.dm
index 2ae590923072..656d35162e5e 100644
--- a/code/game/machinery/turrets/turret_ammo.dm
+++ b/code/game/machinery/turrets/turret_ammo.dm
@@ -17,9 +17,9 @@
QDEL_NULL_LIST(stored_ammo)
. = ..()
-/obj/item/stock_parts/ammo_box/attackby(obj/item/W, mob/user)
+/obj/item/stock_parts/ammo_box/attackby(obj/item/used_item, mob/user)
. = ..()
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
to_chat(user, SPAN_NOTICE("You dump the ammo stored in \the [src] on the ground."))
for(var/obj/item/ammo_casing/casing as anything in stored_ammo)
casing.forceMove(get_turf(src))
@@ -28,8 +28,8 @@
stored_caliber = null
return TRUE
- if(istype(W, /obj/item/ammo_casing))
- var/obj/item/ammo_casing/casing = W
+ if(istype(used_item, /obj/item/ammo_casing))
+ var/obj/item/ammo_casing/casing = used_item
if(stored_caliber && casing.caliber != stored_caliber)
to_chat(user, SPAN_WARNING("The caliber of \the [casing] does not match the caliber stored in \the [src]!"))
return TRUE
@@ -45,8 +45,8 @@
playsound(user, 'sound/weapons/guns/interaction/bullet_insert.ogg', 50, 1)
return TRUE
- if(istype(W, /obj/item/ammo_magazine))
- var/obj/item/ammo_magazine/magazine = W
+ if(istype(used_item, /obj/item/ammo_magazine))
+ var/obj/item/ammo_magazine/magazine = used_item
if(stored_caliber && magazine.caliber != stored_caliber)
to_chat(user, SPAN_WARNING("The caliber of \the [magazine] does not match the caliber stored in \the [src]!"))
return TRUE
@@ -58,7 +58,8 @@
return TRUE
stored_caliber = magazine.caliber
- for(var/obj/item/ammo_casing/casing in magazine.get_stored_ammo_count())
+ magazine.create_initial_contents()
+ for(var/obj/item/ammo_casing/casing in magazine.stored_ammo)
// Just in case.
if(casing.caliber != stored_caliber)
continue
diff --git a/code/game/machinery/vending/_vending.dm b/code/game/machinery/vending/_vending.dm
index b3036e173176..0587601e9378 100644
--- a/code/game/machinery/vending/_vending.dm
+++ b/code/game/machinery/vending/_vending.dm
@@ -120,8 +120,8 @@
product_records.Add(product)
/obj/machinery/vending/Destroy()
- for(var/datum/stored_items/vending_products/R in product_records)
- qdel(R)
+ for(var/datum/stored_items/vending_products/product_record in product_records)
+ qdel(product_record)
product_records = null
return ..()
@@ -144,9 +144,9 @@
if(!(. = ..()) && isitem(dropping) && istype(user) && user.check_intent(I_FLAG_HELP) && CanPhysicallyInteract(user))
return attempt_to_stock(dropping, user)
-/obj/machinery/vending/attackby(obj/item/W, mob/user)
+/obj/machinery/vending/attackby(obj/item/used_item, mob/user)
- var/obj/item/charge_stick/CS = W.GetChargeStick()
+ var/obj/item/charge_stick/CS = used_item.GetChargeStick()
if (currently_vending && vendor_account && !vendor_account.suspended)
if(!vend_ready)
@@ -159,8 +159,8 @@
if (CS)
paid = pay_with_charge_card(CS)
handled = 1
- else if (istype(W, /obj/item/cash))
- var/obj/item/cash/C = W
+ else if (istype(used_item, /obj/item/cash))
+ var/obj/item/cash/C = used_item
paid = pay_with_cash(C)
handled = 1
@@ -171,34 +171,31 @@
SSnano.update_uis(src)
return TRUE // don't smack that machine with your $2
- if (istype(W, /obj/item/cash))
+ if (istype(used_item, /obj/item/cash))
attack_hand_with_interaction_checks(user)
return TRUE
- if(IS_MULTITOOL(W) || IS_WIRECUTTER(W))
+ if(IS_MULTITOOL(used_item) || IS_WIRECUTTER(used_item))
if(panel_open)
attack_hand_with_interaction_checks(user)
return TRUE
- if((. = component_attackby(W, user)))
+ if((. = component_attackby(used_item, user)))
return
- if((user.check_intent(I_FLAG_HELP)) && attempt_to_stock(W, user))
+ if((user.check_intent(I_FLAG_HELP)) && attempt_to_stock(used_item, user))
return TRUE
- if((obj_flags & OBJ_FLAG_ANCHORABLE) && (IS_WRENCH(W) || IS_HAMMER(W)))
- wrench_floor_bolts(user, null, W)
- power_change()
- return
+ return ..() // handle anchoring and bashing
/obj/machinery/vending/state_transition(decl/machine_construction/new_state)
. = ..()
SSnano.update_uis(src)
/obj/machinery/vending/proc/attempt_to_stock(var/obj/item/I, var/mob/user)
- for(var/datum/stored_items/vending_products/R in product_records)
- if(I.type == R.item_path)
- stock(I, R, user)
+ for(var/datum/stored_items/vending_products/product_record in product_records)
+ if(I.type == product_record.item_path)
+ stock(I, product_record, user)
return 1
/**
@@ -309,20 +306,20 @@
if (href_list["vend"] && !currently_vending)
var/key = text2num(href_list["vend"])
- var/datum/stored_items/vending_products/R = LAZYACCESS(product_records, key)
- if(!R)
+ var/datum/stored_items/vending_products/product_record = LAZYACCESS(product_records, key)
+ if(!product_record)
return TOPIC_REFRESH
// This should not happen unless the request from NanoUI was bad
- if(!(R.category & categories))
+ if(!(product_record.category & categories))
return TOPIC_REFRESH
- if(R.price <= 0)
- vend(R, user)
+ if(product_record.price <= 0)
+ vend(product_record, user)
else if(issilicon(user)) //If the item is not free, provide feedback if a synth is trying to buy something.
to_chat(user, SPAN_DANGER("Artificial unit recognized. Artificial units cannot complete this transaction. Purchase canceled."))
else
- currently_vending = R
+ currently_vending = product_record
if(!vendor_account || vendor_account.suspended)
status_message = "This machine is currently unable to process payments due to problems with the associated account."
status_error = 1
@@ -344,7 +341,7 @@
return list()
return ..()
-/obj/machinery/vending/proc/vend(var/datum/stored_items/vending_products/R, mob/user)
+/obj/machinery/vending/proc/vend(var/datum/stored_items/vending_products/product_record, mob/user)
if(!vend_ready)
return
if((!allowed(user)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
@@ -365,7 +362,7 @@
var/vend_state = "[icon_state]-vend"
if (check_state_in_icon(vend_state, icon)) //Show the vending animation if needed
flick(vend_state, src)
- addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/machinery/vending, finish_vending), R), vend_delay)
+ addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/machinery/vending, finish_vending), product_record), vend_delay)
/obj/machinery/vending/proc/do_vending_reply()
set waitfor = FALSE
@@ -394,14 +391,14 @@
* Add item to the machine
*
* Checks if item is vendable in this machine should be performed before
- * calling. W is the item being inserted, R is the associated vending_product entry.
+ * calling. used_item is the item being inserted, product_record is the associated vending_product entry.
*/
-/obj/machinery/vending/proc/stock(obj/item/W, var/datum/stored_items/vending_products/R, var/mob/user)
- if(!user.try_unequip(W))
+/obj/machinery/vending/proc/stock(obj/item/used_item, var/datum/stored_items/vending_products/product_record, var/mob/user)
+ if(!user.try_unequip(used_item))
return
- if(R.add_product(W))
- to_chat(user, SPAN_NOTICE("You insert \the [W] in the product receptor."))
+ if(product_record.add_product(used_item))
+ to_chat(user, SPAN_NOTICE("You insert \the [used_item] in the product receptor."))
SSnano.update_uis(src)
return 1
@@ -456,9 +453,9 @@
//Oh no we're malfunctioning! Dump out some product and break.
/obj/machinery/vending/proc/malfunction()
set waitfor = FALSE
- for(var/datum/stored_items/vending_products/R in product_records)
- while(R.get_amount()>0)
- R.get_product(loc)
+ for(var/datum/stored_items/vending_products/product_record in product_records)
+ while(product_record.get_amount()>0)
+ product_record.get_product(loc)
break
set_broken(TRUE)
@@ -469,8 +466,8 @@
if(!target)
return 0
- for(var/datum/stored_items/vending_products/R in shuffle(product_records))
- throw_item = R.get_product(loc)
+ for(var/datum/stored_items/vending_products/product_record in shuffle(product_records))
+ throw_item = product_record.get_product(loc)
if(!QDELETED(throw_item))
break
if(QDELETED(throw_item))
diff --git a/code/game/machinery/vending/misc.dm b/code/game/machinery/vending/misc.dm
index a9386e3930e9..76360d927358 100644
--- a/code/game/machinery/vending/misc.dm
+++ b/code/game/machinery/vending/misc.dm
@@ -27,7 +27,7 @@
/obj/item/chems/glass/beaker/bowl = 2,
/obj/item/plate/tray/metal/aluminium = 8,
/obj/item/knife/kitchen = 3,
- /obj/item/kitchen/rollingpin = 2,
+ /obj/item/rollingpin = 2,
/obj/item/chems/drinks/pitcher = 2,
/obj/item/chems/drinks/glass2/coffeecup = 8,
/obj/item/chems/drinks/glass2/coffeecup/teacup = 8,
diff --git a/code/game/machinery/vending_deconstruction.dm b/code/game/machinery/vending_deconstruction.dm
index 958f9d71d4b3..57ab1eba0302 100644
--- a/code/game/machinery/vending_deconstruction.dm
+++ b/code/game/machinery/vending_deconstruction.dm
@@ -25,25 +25,25 @@
var/obj/machinery/vending/vendor = over
var/target_type = vendor.base_type || vendor.type
if(ispath(expected_type, target_type))
- for(var/datum/stored_items/R in product_records)
+ for(var/datum/stored_items/product_record in product_records)
for(var/datum/stored_items/record in vendor.product_records)
- if(record.merge(R))
+ if(record.merge(product_record))
break
- if(!QDELETED(R))
- R.migrate(over)
- vendor.product_records += R
+ if(!QDELETED(product_record))
+ product_record.migrate(over)
+ vendor.product_records += product_record
product_records = null
SSnano.update_uis(vendor)
qdel(src)
return TRUE
. = ..()
-/obj/structure/vending_refill/get_contained_matter()
+/obj/structure/vending_refill/get_contained_matter(include_reagents = TRUE)
. = ..()
for(var/datum/stored_items/vending_products/record in product_records)
. = MERGE_ASSOCS_WITH_NUM_VALUES(., record.get_combined_matter(include_instances = FALSE))
-/obj/machinery/vending/get_contained_matter()
+/obj/machinery/vending/get_contained_matter(include_reagents = TRUE)
. = ..()
for(var/datum/stored_items/vending_products/record in product_records)
. = MERGE_ASSOCS_WITH_NUM_VALUES(., record.get_combined_matter(include_instances = FALSE))
@@ -52,8 +52,8 @@
var/obj/structure/vending_refill/dump = new(loc)
dump.SetName("[dump.name] ([name])")
dump.expected_type = base_type || type
- for(var/datum/stored_items/vending_products/R in product_records)
- R.migrate(dump)
+ for(var/datum/stored_items/vending_products/product_record in product_records)
+ product_record.migrate(dump)
dump.product_records = product_records
product_records = null
. = ..()
\ No newline at end of file
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
index f06099ed6e37..56e7c788416d 100644
--- a/code/game/machinery/wall_frames.dm
+++ b/code/game/machinery/wall_frames.dm
@@ -9,15 +9,15 @@
var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures)
var/fully_construct = FALSE // Results in a machine with all parts auto-installed and ready to go if TRUE; if FALSE, the machine will spawn without removable expected parts
-/obj/item/frame/get_contained_matter()
+/obj/item/frame/get_contained_matter(include_reagents = TRUE)
. = ..()
if(fully_construct)
var/list/cost = atom_info_repository.get_matter_for(build_machine_type)
for(var/key in cost)
.[key] += cost[key]
-/obj/item/frame/attackby(obj/item/W, mob/user)
- if(IS_WRENCH(W))
+/obj/item/frame/attackby(obj/item/used_item, mob/user)
+ if(IS_WRENCH(used_item))
for(var/key in matter)
SSmaterials.create_object(key, get_turf(src), round(matter[key]/SHEET_MATERIAL_AMOUNT))
qdel(src)
@@ -278,10 +278,10 @@
return TRUE
master_controller_id_tag = null
-/obj/item/frame/button/airlock_controller/attackby(obj/item/W, mob/user)
- if(!istype(W, /obj/item/stock_parts/circuitboard))
+/obj/item/frame/button/airlock_controller/attackby(obj/item/used_item, mob/user)
+ if(!istype(used_item, /obj/item/stock_parts/circuitboard))
return ..()
- var/obj/item/stock_parts/circuitboard/board = W
+ var/obj/item/stock_parts/circuitboard/board = used_item
var/obj/machinery/M
if(ispath(board.build_path, /obj/machinery/embedded_controller/radio))
build_machine_type = board.build_path
@@ -291,7 +291,7 @@
. = TRUE
if(.)
M = build_machine_type
- to_chat(user, SPAN_NOTICE("You setup \the [src]'s software to work as a '[initial(M.name)]', using \the [W]."))
+ to_chat(user, SPAN_NOTICE("You setup \the [src]'s software to work as a '[initial(M.name)]', using \the [used_item]."))
return TRUE
return FALSE
@@ -305,8 +305,8 @@
to_chat(user, SPAN_WARNING("First, use a multitool on the kit to properly setup the controller's software!"))
//Let them also hit it with a circuitboard if they so wish. But multitool is better when you don't want to print one for nothing.
-/obj/item/frame/button/airlock_controller/kit/attackby(obj/item/W, mob/user)
- if(!IS_MULTITOOL(W))
+/obj/item/frame/button/airlock_controller/kit/attackby(obj/item/used_item, mob/user)
+ if(!IS_MULTITOOL(used_item))
return ..()
//Handle kit configuration
var/obj/machinery/M = /obj/machinery/dummy_airlock_controller
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index 1beca6b072f1..f6e04eb2d50f 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -16,7 +16,6 @@
anchored = TRUE
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
- stat_immune = NOSCREEN
obj_flags = OBJ_FLAG_ANCHORABLE
clicksound = "button"
clickvol = 40
@@ -93,58 +92,59 @@
state &= ~WASHER_STATE_RUNNING
update_use_power(POWER_USE_IDLE)
-/obj/machinery/washing_machine/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/chems/pill/detergent))
+/obj/machinery/washing_machine/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/chems/pill/detergent))
if(!(atom_flags & ATOM_FLAG_OPEN_CONTAINER))
to_chat(user, SPAN_WARNING("Open the detergent port first!"))
return TRUE
if(reagents.total_volume >= reagents.maximum_volume)
to_chat(user, SPAN_WARNING("The detergent port is full!"))
return TRUE
- if(!user.try_unequip(W))
+ if(!user.try_unequip(used_item))
return TRUE
// Directly transfer to the holder to avoid touch reactions.
- W.reagents?.trans_to_holder(reagents, W.reagents.total_volume)
- to_chat(user, SPAN_NOTICE("You dissolve \the [W] in the detergent port."))
- qdel(W)
+ used_item.reagents?.trans_to_holder(reagents, used_item.reagents.total_volume)
+ to_chat(user, SPAN_NOTICE("You dissolve \the [used_item] in the detergent port."))
+ qdel(used_item)
return TRUE
if(state & WASHER_STATE_RUNNING)
to_chat(user, SPAN_WARNING("\The [src] is currently running."))
return TRUE
+ if((. = ..()))
+ return
+
// If the detergent port is open and the item is an open container, assume we're trying to fill the detergent port.
- if(!(state & WASHER_STATE_CLOSED) && !((atom_flags & W.atom_flags) & ATOM_FLAG_OPEN_CONTAINER))
+ if(!(state & WASHER_STATE_CLOSED) && !((atom_flags & used_item.atom_flags) & ATOM_FLAG_OPEN_CONTAINER))
var/list/wash_whitelist = get_wash_whitelist()
var/list/wash_blacklist = get_wash_blacklist()
var/list/washing_atoms = get_contained_external_atoms()
if(length(washing_atoms) < 5)
- if(istype(W, /obj/item/holder)) // Mob holder
- for(var/mob/living/doggy in W)
+ if(istype(used_item, /obj/item/holder)) // Mob holder
+ for(var/mob/living/doggy in used_item)
doggy.forceMove(src)
- qdel(W)
+ qdel(used_item)
state |= WASHER_STATE_LOADED
update_icon()
return TRUE
// An empty whitelist implies all items can be washed.
- else if((!length(wash_whitelist) || is_type_in_list(W, wash_whitelist)) && !is_type_in_list(W, wash_blacklist))
- if(W.w_class > max_item_size)
- to_chat(user, SPAN_WARNING("\The [W] is too large for \the [src]!"))
+ else if((!length(wash_whitelist) || is_type_in_list(used_item, wash_whitelist)) && !is_type_in_list(used_item, wash_blacklist))
+ if(used_item.w_class > max_item_size)
+ to_chat(user, SPAN_WARNING("\The [used_item] is too large for \the [src]!"))
return TRUE
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
state |= WASHER_STATE_LOADED
update_icon()
else
- to_chat(user, SPAN_WARNING("You can't put \the [W] in \the [src]."))
+ to_chat(user, SPAN_WARNING("You can't put \the [used_item] in \the [src]."))
return TRUE
else
to_chat(user, SPAN_NOTICE("\The [src] is full."))
return TRUE
- return ..()
-
/obj/machinery/washing_machine/physical_attack_hand(mob/user)
if(state & WASHER_STATE_RUNNING)
to_chat(user, SPAN_WARNING("\The [src] is currently running."))
diff --git a/code/game/movietitles.dm b/code/game/movietitles.dm
index 5361529c1593..e193fae03d2a 100644
--- a/code/game/movietitles.dm
+++ b/code/game/movietitles.dm
@@ -66,9 +66,9 @@ var/global/list/end_titles
if(GetAssignment(H) != "Unassigned")
job = ", [uppertext(GetAssignment(H))]"
var/used_name = H.real_name
- var/datum/computer_file/report/crew_record/R = get_crewmember_record(H.real_name)
- if(R && R.get_rank())
- var/datum/mil_rank/rank = mil_branches.get_rank(R.get_branch(), R.get_rank())
+ var/datum/computer_file/report/crew_record/record = get_crewmember_record(H.real_name)
+ if(record && record.get_rank())
+ var/datum/mil_rank/rank = mil_branches.get_rank(record.get_branch(), record.get_rank())
if(rank.name_short)
used_name = "[rank.name_short] [used_name]"
var/showckey = 0
@@ -102,17 +102,16 @@ var/global/list/end_titles
if(H.timeofdeath < 5 MINUTES) //no prespawned corpses
continue
if(H.isMonkey() && findtext(H.real_name,"[lowertext(H.species.name)]"))
- monkies[H.species.name] += 1
+ monkies[H.species] += 1
else if(H.real_name)
corpses += H.real_name
- for(var/spec in monkies)
- var/decl/species/S = get_species_by_key(spec)
- corpses += "[monkies[spec]] [lowertext(monkies[spec] > 1 ? S.name_plural : S.name)]"
+ for(var/decl/species/monkey_species in monkies)
+ corpses += "[monkies[monkey_species]] [lowertext(monkies[monkey_species] > 1 ? monkey_species.name_plural : monkey_species.name)]"
if(corpses.len)
titles += "BASED ON REAL EVENTS
In memory of [english_list(corpses)]."
var/list/staff = list("PRODUCTION STAFF:")
- var/list/staffjobs = list("Coffe Fetcher", "Cameraman", "Angry Yeller", "Chair Operator", "Choreographer", "Historical Consultant", "Costume Designer", "Chief Editor", "Executive Assistant")
+ var/list/staffjobs = list("Coffee Fetcher", "Cameraman", "Angry Yeller", "Chair Operator", "Choreographer", "Historical Consultant", "Costume Designer", "Chief Editor", "Executive Assistant")
var/list/goodboys = list()
for(var/client/C)
if(!C.holder)
@@ -120,7 +119,7 @@ var/global/list/end_titles
if(C.holder.rights & (R_DEBUG|R_ADMIN))
var/list/all_backgrounds = decls_repository.get_decls_of_subtype(/decl/background_detail/heritage)
var/decl/background_detail/cult = all_backgrounds[pick(all_backgrounds)]
- staff += "[uppertext(pick(staffjobs))] - [cult.get_random_name(pick(MALE, FEMALE))] a.k.a. '[C.key]'"
+ staff += "[uppertext(pick(staffjobs))] - [cult.get_random_name(C.gender)] a.k.a. '[C.key]'"
else if(C.holder.rights & R_MOD)
goodboys += "[C.key]"
diff --git a/code/game/objects/__objs.dm b/code/game/objects/__objs.dm
index 8ea7caabc68b..62566afe1a1c 100644
--- a/code/game/objects/__objs.dm
+++ b/code/game/objects/__objs.dm
@@ -293,7 +293,7 @@
/obj/proc/WillContain()
return
-/obj/get_contained_matter()
+/obj/get_contained_matter(include_reagents = TRUE)
. = ..()
if(length(matter))
. = MERGE_ASSOCS_WITH_NUM_VALUES(., matter.Copy())
@@ -479,3 +479,9 @@
animate_heat_glow(temperature, scale_sub = round((my_material.melting_point - T20C) * 0.25) + T20C, scale_div = round(my_material.melting_point * 0.75), scale_max = my_material.melting_point, skip_filter = TRUE, anim_time = anim_time)
if(isatom(loc))
loc.update_icon()
+
+/obj/is_valid_merchant_pad_target()
+ if(anchored)
+ return FALSE
+ return ..()
+
diff --git a/code/game/objects/_obj_edibility.dm b/code/game/objects/_objs_edibility.dm
similarity index 98%
rename from code/game/objects/_obj_edibility.dm
rename to code/game/objects/_objs_edibility.dm
index 9fa4ec70827f..65fc62ced6a4 100644
--- a/code/game/objects/_obj_edibility.dm
+++ b/code/game/objects/_objs_edibility.dm
@@ -156,8 +156,8 @@
show_feed_message_end(user, target, consumption_method)
if(consumption_method == EATING_METHOD_DRINK && target?.has_personal_goal(/datum/goal/achievement/specific_object/drink))
- for(var/R in reagents.reagent_volumes)
- target.update_personal_goal(/datum/goal/achievement/specific_object/drink, R)
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ target.update_personal_goal(/datum/goal/achievement/specific_object/drink, reagent)
handle_consumed(user, target, consumption_method)
return EATEN_SUCCESS
diff --git a/code/game/objects/auras/aura.dm b/code/game/objects/auras/aura.dm
deleted file mode 100644
index 5de18f3adf62..000000000000
--- a/code/game/objects/auras/aura.dm
+++ /dev/null
@@ -1,58 +0,0 @@
-/*Auras are simple: They are simple overriders for attackbys, bullet_act, damage procs, etc. They also tick after their respective mob.
-They should be used for undeterminate mob effects, like for instance a toggle-able forcefield, or indestructability as long as you don't move.
-They should also be used for when you want to effect the ENTIRE mob, like having an armor buff or showering candy everytime you walk.
-*/
-
-/obj/aura
- var/mob/living/user
-
-/obj/aura/Initialize()
- . = ..()
- if(isliving(loc))
- added_to(loc)
- user.add_aura(src)
-
-/obj/aura/Destroy()
- if(user)
- user.remove_aura(src)
- removed()
- return ..()
-
-/obj/aura/proc/added_to(var/mob/living/target)
- user = target
-
-/obj/aura/proc/removed()
- user = null
-
-/obj/aura/proc/life_tick()
- return 0
-
-/obj/aura/attackby(var/obj/item/I, var/mob/user)
- return 0
-
-/obj/aura/bullet_act(var/obj/item/projectile/P, var/def_zone)
- return 0
-
-/obj/aura/hitby()
- SHOULD_CALL_PARENT(FALSE)
- return FALSE
-
-/obj/aura/debug
- var/returning = FALSE
-
-/obj/aura/debug/attackby(var/obj/item/I, var/mob/user)
- log_debug("Attackby for \ref[src]: [I], [user]")
- return returning
-
-/obj/aura/debug/bullet_act(var/obj/item/projectile/P, var/def_zone)
- log_debug("Bullet Act for \ref[src]: [P], [def_zone]")
- return returning
-
-/obj/aura/debug/life_tick()
- log_debug("Life tick")
- return returning
-
-/obj/aura/debug/hitby(var/atom/movable/M, var/datum/thrownthing/TT)
- SHOULD_CALL_PARENT(FALSE)
- log_debug("Hit By for \ref[src]: [M], [TT.speed]")
- return returning
\ No newline at end of file
diff --git a/code/game/objects/auras/personal_shields/personal_shield.dm b/code/game/objects/auras/personal_shields/personal_shield.dm
deleted file mode 100644
index 934005ceb4f9..000000000000
--- a/code/game/objects/auras/personal_shields/personal_shield.dm
+++ /dev/null
@@ -1,34 +0,0 @@
-/obj/aura/personal_shield
- name = "personal shield"
-
-/obj/aura/personal_shield/added_to(var/mob/living/L)
- ..()
- playsound(user,'sound/weapons/flash.ogg',35,1)
- to_chat(user,"You feel your body prickle as \the [src] comes online.")
-
-/obj/aura/personal_shield/bullet_act(var/obj/item/projectile/P, var/def_zone)
- user.visible_message("\The [user]'s [src.name] flashes before \the [P] can hit them!")
- new /obj/effect/temporary(get_turf(src), 2 SECONDS,'icons/obj/machines/shielding.dmi',"shield_impact")
- playsound(user,'sound/effects/basscannon.ogg',35,1)
- return AURA_FALSE|AURA_CANCEL
-
-/obj/aura/personal_shield/removed()
- to_chat(user,"\The [src] goes offline!")
- playsound(user,'sound/mecha/internaldmgalarm.ogg',25,1)
- ..()
-
-/obj/aura/personal_shield/device
- var/obj/item/personal_shield/shield
-
-/obj/aura/personal_shield/device/bullet_act()
- . = ..()
- if(shield)
- shield.take_charge()
-
-/obj/aura/personal_shield/device/Initialize(mapload, var/user_shield)
- . = ..()
- shield = user_shield
-
-/obj/aura/personal_shield/device/Destroy()
- shield = null
- return ..()
\ No newline at end of file
diff --git a/code/game/objects/auras/radiant_aura.dm b/code/game/objects/auras/radiant_aura.dm
deleted file mode 100644
index d25cfa807b95..000000000000
--- a/code/game/objects/auras/radiant_aura.dm
+++ /dev/null
@@ -1,20 +0,0 @@
-/obj/aura/radiant_aura
- name = "radiant aura"
- icon = 'icons/effects/effects.dmi'
- icon_state = "fire_goon"
- layer = ABOVE_WINDOW_LAYER
-
-/obj/aura/radiant_aura/added_to(var/mob/living/L)
- ..()
- to_chat(L,"A bubble of light appears around you, exuding protection and warmth.")
- set_light(6, 6, "#e09d37")
-
-/obj/aura/radiant_aura/removed()
- to_chat(user, "Your protective aura dissipates, leaving you feeling cold and unsafe.")
- ..()
-
-/obj/aura/radiant_aura/bullet_act(var/obj/item/projectile/P, var/def_zone)
- if(P.damage_flags() & DAM_LASER)
- user.visible_message("\The [P] refracts, bending into \the [user]'s aura.")
- return AURA_FALSE
- return 0
diff --git a/code/game/objects/auras/regenerating_aura.dm b/code/game/objects/auras/regenerating_aura.dm
deleted file mode 100644
index 7c313fc2d1c3..000000000000
--- a/code/game/objects/auras/regenerating_aura.dm
+++ /dev/null
@@ -1,121 +0,0 @@
-/obj/aura/regenerating
- name = "regenerating aura"
- var/brute_mult = 1
- var/fire_mult = 1
- var/tox_mult = 1
-
-/obj/aura/regenerating/life_tick()
- user.heal_damage(BRUTE, brute_mult, do_update_health = FALSE)
- user.heal_damage(BURN, fire_mult, do_update_health = FALSE)
- user.heal_damage(TOX, tox_mult)
-
-/obj/aura/regenerating/human
- var/nutrition_damage_mult = 1 //How much nutrition it takes to heal regular damage
- var/external_nutrition_mult = 50 // How much nutrition it takes to regrow a limb
- var/organ_mult = 2
- var/regen_message = "Your body throbs as you feel your ORGAN regenerate."
- var/grow_chance = 0
- var/grow_threshold = 0
- var/ignore_tag = BP_BRAIN //organ tag to ignore
- var/last_nutrition_warning = 0
- var/innate_heal = TRUE // Whether the aura is on, basically.
-
-
-/obj/aura/regenerating/human/proc/external_regeneration_effect(var/obj/item/organ/external/O, var/mob/living/human/H)
- return
-
-/obj/aura/regenerating/human/life_tick()
- var/mob/living/human/H = user
- if(!istype(H))
- . = 0
- CRASH("Someone gave [user.type] a [src.type] aura. This is invalid.")
- if(!innate_heal || H.is_in_stasis() || H.stat == DEAD)
- return 0
- if(H.nutrition < nutrition_damage_mult)
- low_nut_warning()
- return 0
-
- var/update_health = FALSE
- var/organ_regen = get_config_value(/decl/config/num/health_organ_regeneration_multiplier)
- if(brute_mult && H.get_damage(BRUTE))
- update_health = TRUE
- H.heal_damage(BRUTE, brute_mult * organ_regen, do_update_health = FALSE)
- H.adjust_nutrition(-nutrition_damage_mult)
- if(fire_mult && H.get_damage(BURN))
- update_health = TRUE
- H.heal_damage(BURN, fire_mult * organ_regen, do_update_health = FALSE)
- H.adjust_nutrition(-nutrition_damage_mult)
- if(tox_mult && H.get_damage(TOX))
- update_health = TRUE
- H.heal_damage(TOX, tox_mult * organ_regen, do_update_health = FALSE)
- H.adjust_nutrition(-nutrition_damage_mult)
- if(update_health)
- H.update_health()
-
- if(!can_regenerate_organs())
- return 1
- if(organ_mult)
- if(prob(10) && H.nutrition >= 150 && !H.get_damage(BRUTE) && !H.get_damage(BURN))
- var/obj/item/organ/external/D = GET_EXTERNAL_ORGAN(H, BP_HEAD)
- if (D.status & ORGAN_DISFIGURED)
- if (H.nutrition >= 20)
- D.status &= ~ORGAN_DISFIGURED
- H.adjust_nutrition(-20)
- else
- low_nut_warning(BP_HEAD)
-
- var/list/organs = H.get_internal_organs()
- for(var/obj/item/organ/internal/regen_organ in shuffle(organs.Copy()))
- if(BP_IS_PROSTHETIC(regen_organ) || regen_organ.organ_tag == ignore_tag)
- continue
- if(istype(regen_organ))
- if(regen_organ.get_organ_damage() > 0 && !(regen_organ.status & ORGAN_DEAD))
- if (H.nutrition >= organ_mult)
- regen_organ.adjust_organ_damage(-(organ_mult))
- H.adjust_nutrition(-organ_mult)
- if(prob(5))
- to_chat(H, replacetext(regen_message,"ORGAN", regen_organ.name))
- else
- low_nut_warning(regen_organ.name)
-
- if(prob(grow_chance))
- var/decl/bodytype/root_bodytype = H.get_bodytype()
- for(var/limb_type in root_bodytype.has_limbs)
- var/obj/item/organ/external/E = GET_EXTERNAL_ORGAN(H, limb_type)
- if(E && E.organ_tag != BP_HEAD && !E.is_vital_to_owner() && !E.is_usable()) //Skips heads and vital bits...
- if (H.nutrition > grow_threshold)
- H.remove_organ(E) //...because no one wants their head to explode to make way for a new one.
- qdel(E)
- E= null
- else
- low_nut_warning(E.name)
- if(!E)
- var/list/organ_data = root_bodytype.has_limbs[limb_type]
- var/limb_path = organ_data["path"]
- var/obj/item/organ/external/O = new limb_path(H)
- external_regeneration_effect(O,H)
- H.adjust_nutrition(-external_nutrition_mult)
- organ_data["descriptor"] = O.name
- H.update_body()
- return
- else if (H.nutrition > grow_threshold) //We don't subtract any nut here, but let's still only heal wounds when we have nut.
- for(var/datum/wound/W in E.wounds)
- if(W.wound_damage() == 0 && prob(50))
- qdel(W)
- return 1
-
-/obj/aura/regenerating/human/proc/low_nut_warning(var/wound_type)
- if (last_nutrition_warning + 1 MINUTE < world.time)
- to_chat(user, "You need more energy to regenerate your [wound_type || "wounds"].")
- last_nutrition_warning = world.time
- return 1
- return 0
-
-/obj/aura/regenerating/human/proc/toggle()
- innate_heal = !innate_heal
-
-/obj/aura/regenerating/human/proc/can_toggle()
- return TRUE
-
-/obj/aura/regenerating/human/proc/can_regenerate_organs()
- return TRUE
diff --git a/code/game/objects/compass/compass_overmap.dm b/code/game/objects/compass/compass_overmap.dm
index 31ef3d2bb1fe..11ee76eef866 100644
--- a/code/game/objects/compass/compass_overmap.dm
+++ b/code/game/objects/compass/compass_overmap.dm
@@ -30,10 +30,10 @@
var/list/seen_waypoint_ids = list()
for(var/key in owner.known_sectors)
- var/datum/computer_file/data/waypoint/R = owner.known_sectors[key]
- var/wp_id = "\ref[R]"
- set_waypoint(wp_id, uppertext(R.fields["name"]), R.fields["x"], R.fields["y"], owner_turf.z, R.fields["color"] || COLOR_SILVER)
- if(!R.fields["tracking"])
+ var/datum/computer_file/data/waypoint/waypoint = owner.known_sectors[key]
+ var/wp_id = "\ref[waypoint]"
+ set_waypoint(wp_id, uppertext(waypoint.fields["name"]), waypoint.fields["x"], waypoint.fields["y"], owner_turf.z, waypoint.fields["color"] || COLOR_SILVER)
+ if(!waypoint.fields["tracking"])
hide_waypoint(wp_id)
seen_waypoint_ids += wp_id
for(var/id in compass_waypoints)
diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm
index 70d5c86bb2e0..06a1a7d81f79 100644
--- a/code/game/objects/effects/chem/foam.dm
+++ b/code/game/objects/effects/chem/foam.dm
@@ -59,8 +59,8 @@
if(!metal)
F.create_reagents(10)
if(reagents)
- for(var/R in reagents.reagent_volumes)
- F.add_to_reagents(R, 1, safety = 1) //added safety check since reagents in the foam have already had a chance to react
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ F.add_to_reagents(reagent, 1, safety = 1) //added safety check since reagents in the foam have already had a chance to react
/obj/effect/effect/foam/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) // foam disolves when heated, except metal foams
if(!metal && prob(max(0, exposed_temperature - 475)))
@@ -93,8 +93,8 @@
// bit of a hack here. Foam carries along any reagent also present in the glass it is mixed with (defaults to water if none is present). Rather than actually transfer the reagents, this makes a list of the reagent ids and spawns 1 unit of that reagent when the foam disolves.
if(carry && !metal)
- for(var/R in carry.reagent_volumes)
- carried_reagents += R
+ for(var/decl/material/reagent as anything in carry.reagent_volumes)
+ carried_reagents += reagent
/datum/effect/effect/system/foam_spread/start()
spawn(0)
@@ -170,11 +170,11 @@
physically_destroyed()
return TRUE
-/obj/structure/foamedmetal/attackby(var/obj/item/I, var/mob/user)
- if(prob(I.expend_attack_force(user) * 20 - metal * 25))
+/obj/structure/foamedmetal/attackby(var/obj/item/used_item, var/mob/user)
+ if(prob(used_item.expend_attack_force(user) * 20 - metal * 25))
user.visible_message(
SPAN_WARNING("\The [user] smashes through the foamed metal."),
- SPAN_NOTICE("You smash through the foamed metal with \the [I].")
+ SPAN_NOTICE("You smash through the foamed metal with \the [used_item].")
)
physically_destroyed()
else
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index 5fae22fc6003..421c415cb24f 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -196,8 +196,8 @@
/obj/effect/decal/cleanable/blood/writing/Initialize()
. = ..()
if(LAZYLEN(random_icon_states))
- for(var/obj/effect/decal/cleanable/blood/writing/W in loc)
- random_icon_states.Remove(W.icon_state)
+ for(var/obj/effect/decal/cleanable/blood/writing/writing in loc)
+ random_icon_states.Remove(writing.icon_state)
icon_state = pick(random_icon_states)
else
icon_state = "writing1"
@@ -255,9 +255,9 @@
/obj/effect/decal/cleanable/blood/gibs/proc/streak(var/list/directions)
spawn (0)
var/direction = pick(directions)
- for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
+ for (var/i in 1 to pick(1, 200; 2, 150; 3, 50; 4))
sleep(3)
- if (i > 0)
+ if (i > 1)
var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(loc, null, chemical)
b.basecolor = src.basecolor
b.update_icon()
diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm
index 6fe6ea7441a4..3da636a2c505 100644
--- a/code/game/objects/effects/decals/Cleanable/misc.dm
+++ b/code/game/objects/effects/decals/Cleanable/misc.dm
@@ -16,13 +16,13 @@
sweepable = TRUE
burnable = FALSE
-/obj/effect/decal/cleanable/ash/attackby(obj/item/I, mob/user)
- if(ATOM_IS_OPEN_CONTAINER(I))
- if(REAGENTS_FREE_SPACE(I.reagents) <= 0)
- to_chat(user, SPAN_WARNING("\The [I] is full."))
+/obj/effect/decal/cleanable/ash/attackby(obj/item/used_item, mob/user)
+ if(ATOM_IS_OPEN_CONTAINER(used_item))
+ if(REAGENTS_FREE_SPACE(used_item.reagents) <= 0)
+ to_chat(user, SPAN_WARNING("\The [used_item] is full."))
else
- I.add_to_reagents(/decl/material/solid/carbon/ashes, 20)
- user.visible_message(SPAN_NOTICE("\The [user] carefully scoops \the [src] into \the [I]."))
+ used_item.add_to_reagents(/decl/material/solid/carbon/ashes, 20)
+ user.visible_message(SPAN_NOTICE("\The [user] carefully scoops \the [src] into \the [used_item]."))
qdel(src)
return TRUE
return ..()
diff --git a/code/game/objects/effects/decals/Cleanable/robots.dm b/code/game/objects/effects/decals/Cleanable/robots.dm
index 8487334c1a4d..925fb3c2e437 100644
--- a/code/game/objects/effects/decals/Cleanable/robots.dm
+++ b/code/game/objects/effects/decals/Cleanable/robots.dm
@@ -16,9 +16,9 @@
/obj/effect/decal/cleanable/blood/gibs/robot/streak(var/list/directions)
spawn (0)
var/direction = pick(directions)
- for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
+ for (var/i in 1 to pick(1, 200; 2, 150; 3, 50; 4))
sleep(3)
- if (i > 0)
+ if (i > 1)
if (prob(40))
var/obj/effect/decal/cleanable/blood/oil/streak = new(src.loc)
streak.update_icon()
diff --git a/code/game/objects/effects/gateway.dm b/code/game/objects/effects/gateway.dm
index 2b6be989f274..61c3250d6462 100644
--- a/code/game/objects/effects/gateway.dm
+++ b/code/game/objects/effects/gateway.dm
@@ -54,10 +54,10 @@
var/mob/living/silicon/robot/Robot = victim
QDEL_NULL(Robot.central_processor)
else
- for(var/obj/item/W in victim)
- victim.drop_from_inventory(W)
- if(istype(W, /obj/item/implant))
- qdel(W)
+ for(var/obj/item/thing in victim)
+ victim.drop_from_inventory(thing)
+ if(istype(thing, /obj/item/implant))
+ qdel(thing)
var/mob/living/new_mob = new /mob/living/simple_animal/corgi(AM.loc)
new_mob.set_intent(I_FLAG_HARM)
diff --git a/code/game/objects/effects/item_pickup_ghost.dm b/code/game/objects/effects/item_pickup_ghost.dm
index aa07bcd0e6a8..cd8d1df1cc0b 100644
--- a/code/game/objects/effects/item_pickup_ghost.dm
+++ b/code/game/objects/effects/item_pickup_ghost.dm
@@ -3,10 +3,8 @@
var/lifetime = 0.2 SECONDS
/obj/effect/temporary/item_pickup_ghost/Initialize(var/mapload, var/obj/item/picked_up)
- . = ..(mapload, lifetime, picked_up.icon, picked_up.icon_state)
- pixel_x = picked_up.pixel_x
- pixel_y = picked_up.pixel_y
- color = picked_up.color
+ . = ..(mapload, lifetime, null, null)
+ appearance = picked_up.appearance
/obj/effect/temporary/item_pickup_ghost/proc/animate_towards(var/atom/target)
var/new_pixel_x = pixel_x + (target.x - src.x) * 32
diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm
index 827773adb4cc..b71fd6a50060 100644
--- a/code/game/objects/effects/landmarks.dm
+++ b/code/game/objects/effects/landmarks.dm
@@ -1,3 +1,4 @@
+var/global/list/obj/abstract/landmark/all_landmarks = list()
/obj/abstract/landmark
name = "landmark"
var/delete_me = 0
@@ -7,13 +8,13 @@
tag = "landmark*[name]"
if(delete_me)
return INITIALIZE_HINT_QDEL
- global.landmarks_list += src
+ global.all_landmarks += src
/obj/abstract/landmark/proc/delete()
delete_me = TRUE
/obj/abstract/landmark/Destroy()
- global.landmarks_list -= src
+ global.all_landmarks -= src
return ..()
/obj/abstract/landmark/start
@@ -107,7 +108,7 @@
/obj/abstract/landmark/costume/waiter/make_costumes()
new /obj/item/clothing/pants/slacks/black(loc)
new /obj/item/clothing/shirt/button(loc)
- new /obj/item/clothing/neck/tie/bow/color/red(loc)
+ new /obj/item/clothing/neck/tie/bow/red(loc)
new /obj/item/clothing/suit/jacket/vest/blue(loc)
var/CHOICE= pick( /obj/item/clothing/head/kitty, /obj/item/clothing/head/rabbitears)
new CHOICE(loc)
diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm
index bcfac656cfd2..805288d6b365 100644
--- a/code/game/objects/effects/misc.dm
+++ b/code/game/objects/effects/misc.dm
@@ -26,16 +26,16 @@
return INITIALIZE_HINT_LATELOAD
/obj/effect/paint/LateInitialize()
- var/turf/wall/W = get_turf(src)
- if(istype(W))
- W.paint_color = color
- W.stripe_color = color
- W.update_icon()
+ var/turf/wall/wall = get_turf(src)
+ if(istype(wall))
+ wall.paint_color = color
+ wall.stripe_color = color
+ wall.lazy_update_icon()
var/obj/structure/wall_frame/WF = locate() in loc
if(WF)
WF.paint_color = color
WF.stripe_color = color
- WF.update_icon()
+ WF.lazy_update_icon()
qdel(src)
/obj/effect/paint/pink
@@ -72,10 +72,10 @@
return INITIALIZE_HINT_LATELOAD
/obj/effect/paint_stripe/LateInitialize()
- var/turf/wall/W = get_turf(src)
- if(istype(W))
- W.stripe_color = color
- W.update_icon()
+ var/turf/wall/wall = get_turf(src)
+ if(istype(wall))
+ wall.stripe_color = color
+ wall.update_icon()
var/obj/structure/wall_frame/WF = locate() in loc
if(WF)
WF.stripe_color = color
diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm
index 2aae839cd613..5e5f6d7cf2c8 100644
--- a/code/game/objects/effects/spiders.dm
+++ b/code/game/objects/effects/spiders.dm
@@ -33,23 +33,20 @@
die()
return TRUE
-/obj/effect/spider/attackby(var/obj/item/W, var/mob/user)
+/obj/effect/spider/attackby(var/obj/item/used_item, var/mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- if(W.attack_verb.len)
- visible_message("\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
- else
- visible_message("\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]")
+ visible_message("\The [src] has been [used_item.pick_attack_verb()] with \the [used_item][(user ? " by [user]." : ".")]")
- var/damage = W.expend_attack_force(user) / 4
+ var/damage = used_item.expend_attack_force(user) / 4
- if(W.has_edge())
+ if(used_item.has_edge())
damage += 5
- if(IS_WELDER(W))
- var/obj/item/weldingtool/WT = W
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
- if(WT.weld(0, user))
+ if(welder.weld(0, user))
damage = 15
playsound(loc, 'sound/items/Welder.ogg', 100, 1)
@@ -194,7 +191,7 @@
stop_automove()
. = ..()
-/obj/effect/spider/spiderling/attackby(var/obj/item/W, var/mob/user)
+/obj/effect/spider/spiderling/attackby(var/obj/item/used_item, var/mob/user)
. = ..()
if(current_health > 0)
disturbed()
diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm
index 638b704a188d..f037c65998aa 100644
--- a/code/game/objects/explosion.dm
+++ b/code/game/objects/explosion.dm
@@ -89,8 +89,7 @@
addtimer(CALLBACK(AM, TYPE_PROC_REF(/atom/movable, throw_at), throw_target, throw_dist, throw_dist), 0)
var/took = (REALTIMEOFDAY-start_time)/10
- if(Debug2)
- to_world_log("## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds.")
+ testing("## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds.")
return 1
#define EXPLFX_NONE 0
diff --git a/code/game/objects/items/__item.dm b/code/game/objects/items/__item.dm
index fb1c143c2752..171b27c8b98b 100644
--- a/code/game/objects/items/__item.dm
+++ b/code/game/objects/items/__item.dm
@@ -23,7 +23,7 @@
var/no_attack_log = FALSE
var/obj/item/master = null
var/origin_tech //Used by R&D to determine what research bonuses it grants.
- var/list/attack_verb = list("hit") //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
+ VAR_PROTECTED/list/attack_verb = "hit" //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
var/lock_picking_level = 0 //used to determine whether something can pick a lock, and how well.
var/attack_cooldown = DEFAULT_WEAPON_COOLDOWN
var/melee_accuracy_bonus = 0
@@ -109,8 +109,8 @@
var/tmp/use_single_icon
var/center_of_mass = @'{"x":16,"y":16}' //can be null for no exact placement behaviour
- /// Used when this item is replaced by a loadout item. If TRUE, loadout places src in wearer's storage. If FALSE, src is deleted.
- var/replaced_in_loadout = TRUE
+ /// Controls what method is used to resolve conflicts between equipped items and mob loadout.
+ var/replaced_in_loadout = LOADOUT_CONFLICT_DELETE
var/paint_color
var/paint_verb
@@ -129,6 +129,7 @@
var/unwieldsound = 'sound/foley/tooldrop1.ogg'
var/base_name
+ var/base_desc
/// Can this object leak into water sources?
var/watertight = FALSE
@@ -196,6 +197,7 @@
/obj/item/Initialize(var/ml, var/material_key)
base_name ||= name
+ base_desc ||= desc
if(isnull(current_health))
current_health = max_health //Make sure to propagate max_health to health var before material setup, for consistency
@@ -488,27 +490,11 @@
return ..() && (!strict || loc == user)
/obj/item/proc/squash_item(skip_qdel = FALSE)
-
if(!istype(material) || material.hardness > MAT_VALUE_MALLEABLE)
return null
-
- var/list/leftover_mats = list()
- for(var/mat in matter)
- var/decl/material/material_decl = GET_DECL(mat)
- if(material_decl.hardness <= MAT_VALUE_MALLEABLE)
- var/spawn_amount = round(matter[mat] / SHEET_MATERIAL_AMOUNT)
- if(spawn_amount > 0)
- var/obj/item/stack/material/lump/lump = new(loc, spawn_amount, mat)
- LAZYADD(., lump)
- continue
- leftover_mats[mat] = matter[mat]
-
- if(length(leftover_mats))
- var/obj/item/debris/scraps/remains = new(loc)
- remains.matter = leftover_mats?.Copy()
- remains.update_primary_material()
- LAZYADD(., remains)
-
+ var/list/results = convert_matter_to_lumps(skip_qdel)
+ if(length(results))
+ . = results
if(!skip_qdel)
matter = null
material = null
@@ -591,26 +577,24 @@
if (isturf(old_loc))
var/obj/effect/temporary/item_pickup_ghost/ghost = new(old_loc, src)
ghost.animate_towards(user)
- on_picked_up(user)
+ on_picked_up(user, old_loc)
return TRUE
return FALSE
/obj/item/attack_ai(mob/living/silicon/ai/user)
- if (!istype(src.loc, /obj/item/robot_module))
+ if (!istype(loc, /obj/item/robot_module))
return
//If the item is part of a cyborg module, equip it
if(!isrobot(user))
return
- var/mob/living/silicon/robot/R = user
- R.activate_module(src)
- if(R.hud_used)
- R.hud_used.update_robot_modules_display()
+ var/mob/living/silicon/robot/robot = user
+ robot.put_in_hands(src)
-/obj/item/proc/try_slapcrafting(obj/item/W, mob/user)
- if(SSfabrication.try_craft_with(src, W, user))
+/obj/item/proc/try_slapcrafting(obj/item/used_item, mob/user)
+ if(SSfabrication.try_craft_with(src, used_item, user))
return TRUE
- if(SSfabrication.try_craft_with(W, src, user))
+ if(SSfabrication.try_craft_with(used_item, src, user))
return TRUE
return FALSE
@@ -665,10 +649,13 @@
addtimer(CALLBACK(user, TYPE_PROC_REF(/mob, check_emissive_equipment)), 0, TIMER_UNIQUE)
RAISE_EVENT(/decl/observ/mob_unequipped, user, src)
- RAISE_EVENT_REPEAT(/decl/observ/item_unequipped, src, user)
+ RAISE_EVENT(/decl/observ/item_unequipped, src, user)
// called just after an item is picked up, after it has been equipped to the mob.
-/obj/item/proc/on_picked_up(mob/user)
+/obj/item/proc/on_picked_up(mob/user, atom/old_loc)
+ if(old_loc == loc || old_loc == user)
+ // not being picked up, just transferring between slots, don't adjust the offset
+ return
if(randpixel)
pixel_x = rand(-randpixel, randpixel)
pixel_y = rand(-randpixel/2, randpixel/2)
@@ -725,7 +712,7 @@
addtimer(CALLBACK(user, TYPE_PROC_REF(/mob, check_emissive_equipment)), 0, TIMER_UNIQUE)
RAISE_EVENT(/decl/observ/mob_equipped, user, src, slot)
- RAISE_EVENT_REPEAT(/decl/observ/item_equipped, src, user, slot)
+ RAISE_EVENT(/decl/observ/item_equipped, src, user, slot)
// As above but for items being equipped to an active module on a robot.
/obj/item/proc/equipped_robot(var/mob/user)
@@ -743,7 +730,6 @@
var/obj/item/back = user.get_equipped_item(slot_back_str)
return back?.storage?.can_be_inserted(src, user, TRUE)
-
var/datum/inventory_slot/inv_slot = user.get_inventory_slot_datum(slot)
if(!inv_slot)
return FALSE
@@ -764,7 +750,7 @@
return inv_slot?.is_accessible(user, src, disable_warning)
/obj/item/proc/can_be_dropped_by_client(mob/M)
- return M.canUnEquip(src)
+ return M.can_unequip_item(src)
/obj/item/verb/verb_pickup()
set src in oview(1)
@@ -1021,8 +1007,7 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
/obj/item/clothing/inherit_custom_item_data(var/datum/custom_item/citem)
. = ..()
- base_clothing_icon = icon
- base_clothing_state = icon_state
+ reconsider_single_icon()
/obj/item/proc/is_special_cutting_tool(var/high_power)
return FALSE
@@ -1137,7 +1122,7 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
for(var/equipped_slot in get_associated_equipment_slots())
wearer.update_equipment_overlay(equipped_slot, FALSE)
if(do_update_icon)
- wearer.update_icon()
+ wearer.lazy_update_icon()
return TRUE
/obj/item/proc/reconsider_client_screen_presence(var/client/client, var/slot)
@@ -1185,9 +1170,12 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
/obj/item/proc/handle_loadout_equip_replacement(obj/item/old_item)
return
-/// Used to handle equipped icons overwritten by custom loadout. If TRUE, loadout places src in wearer's storage. If FALSE, src is deleted by loadout.
+/// Used to handle equipped items overwritten by custom loadout.
+/// Returns one of LOADOUT_CONFLICT_DELETE, LOADOUT_CONFLICT_STORAGE, or LOADOUT_CONFLICT_KEEP.
/obj/item/proc/loadout_should_keep(obj/item/new_item, mob/wearer)
- return type != new_item.type && !replaced_in_loadout
+ if(type == new_item.type) // for exact type collisions, just delete by default
+ return LOADOUT_CONFLICT_DELETE
+ return replaced_in_loadout
/obj/item/dropped(mob/user, slot)
. = ..()
@@ -1226,10 +1214,9 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
var/decl/material/bait_mat = GET_DECL(mat)
if(bait_mat.fishing_bait_value)
. += MATERIAL_UNITS_TO_REAGENTS_UNITS(matter[mat]) * bait_mat.fishing_bait_value * BAIT_VALUE_CONSTANT
- for(var/mat in reagents?.reagent_volumes)
- var/decl/material/bait_mat = GET_DECL(mat)
- if(bait_mat.fishing_bait_value)
- . += reagents.reagent_volumes[mat] * bait_mat.fishing_bait_value * BAIT_VALUE_CONSTANT
+ for(var/decl/material/reagent as anything in reagents?.reagent_volumes)
+ if(reagent.fishing_bait_value)
+ . += reagents.reagent_volumes[reagent] * reagent.fishing_bait_value * BAIT_VALUE_CONSTANT
#undef BAIT_VALUE_CONSTANT
/obj/item/proc/get_storage_cost()
@@ -1308,8 +1295,7 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
if(!reagents_state || !check_state_in_icon(reagents_state, icon))
return
var/image/reagent_overlay = overlay_image(icon, reagents_state, reagents.get_color(), RESET_COLOR | RESET_ALPHA)
- for(var/reagent_type in reagents.reagent_volumes)
- var/decl/material/reagent = GET_DECL(reagent_type)
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
if(!reagent.reagent_overlay)
continue
var/modified_reagent_overlay = state_prefix ? "[state_prefix]_[reagent.reagent_overlay]" : reagent.reagent_overlay
@@ -1337,3 +1323,37 @@ modules/mob/living/human/life.dm if you die, you will be zoomed out.
coating_string = FONT_COLORED(coating.get_color(), coating_string)
return coating_string
return ..()
+
+// Bespoke proc for handling when a centrifuge smooshes us, only currently used by growns and hive frames.
+/obj/item/proc/handle_centrifuge_process(obj/machinery/centrifuge/centrifuge)
+ SHOULD_CALL_PARENT(TRUE)
+ return istype(centrifuge) && !QDELETED(centrifuge.loaded_beaker) && istype(centrifuge.loaded_beaker)
+
+/obj/item/proc/convert_matter_to_lumps(skip_qdel = FALSE)
+
+ var/list/scrap_matter = list()
+ for(var/mat in matter)
+ var/mat_amount = matter[mat]
+ var/obj/item/stack/material/mat_stack = /obj/item/stack/material/lump
+ var/mat_per_stack = SHEET_MATERIAL_AMOUNT * initial(mat_stack.matter_multiplier)
+ var/sheet_amount = round(mat_amount / mat_per_stack)
+ if(sheet_amount)
+ var/obj/item/stack/material/lump/lump = new(loc, sheet_amount, mat)
+ LAZYADD(., lump)
+ mat_amount -= sheet_amount * mat_per_stack
+ if(mat_amount)
+ scrap_matter[mat] += mat_amount
+
+ if(length(scrap_matter))
+ var/obj/item/debris/scraps/scraps = new(loc)
+ scraps.matter = scrap_matter.Copy()
+ scraps.update_primary_material()
+ LAZYADD(., scraps)
+
+ matter = null
+ material = null
+ if(!skip_qdel)
+ qdel(src)
+
+/obj/item/proc/pick_attack_verb()
+ return DEFAULTPICK(attack_verb, attack_verb) || "attacked" // if it's not a list, return itself or just "attacked"
\ No newline at end of file
diff --git a/code/game/objects/items/_item_edibility.dm b/code/game/objects/items/_item_edibility.dm
index c93934b6f52b..4957dbecff8f 100644
--- a/code/game/objects/items/_item_edibility.dm
+++ b/code/game/objects/items/_item_edibility.dm
@@ -4,7 +4,7 @@
add_trace_DNA(target)
// Used to get a piece of food from an item.
-/obj/item/proc/seperate_food_chunk(obj/item/utensil/utensil, mob/user)
+/obj/item/proc/separate_food_chunk(obj/item/utensil/utensil, mob/user)
var/utensil_food_type = get_utensil_food_type()
if(!istype(utensil) || !utensil_food_type)
return
@@ -14,8 +14,12 @@
// Create a dummy copy of the target food item.
// This ensures we keep all food behavior, strings, sounds, etc.
utensil.loaded_food = new utensil_food_type(utensil, material?.type, TRUE)
- QDEL_NULL(utensil.loaded_food.trash)
- QDEL_NULL(utensil.loaded_food.plate)
+ if(ismovable(utensil.loaded_food.trash))
+ qdel(utensil.loaded_food.trash)
+ utensil.loaded_food.trash = null // Unset it even if it didn't need deleting (e.g. it was a path)
+ if(ismovable(utensil.loaded_food.plate))
+ qdel(utensil.loaded_food.plate)
+ utensil.loaded_food.plate = null
utensil.loaded_food.color = color
utensil.loaded_food.filling_color = get_food_filling_color()
utensil.loaded_food.SetName("\proper some [utensil.loaded_food.name]")
@@ -25,12 +29,12 @@
reagents.trans_to(utensil.loaded_food, remove_amt)
handle_chunk_separated()
if(!reagents.total_volume)
- handle_consumed()
+ handle_consumed(user) // it's not actually being consumed, so i'm not sure this is correct
utensil.update_icon()
else // This shouldn't happen, but who knows.
to_chat(user, SPAN_WARNING("None of \the [src] is left!"))
- handle_consumed()
+ handle_consumed(user)
return TRUE
/obj/item/proc/get_food_filling_color()
diff --git a/code/game/objects/items/_item_force.dm b/code/game/objects/items/_item_force.dm
index 790d894e5962..500bec99069c 100644
--- a/code/game/objects/items/_item_force.dm
+++ b/code/game/objects/items/_item_force.dm
@@ -22,7 +22,7 @@
var/list/item_effects = get_item_effects(IE_CAT_DAMAGE)
if(length(item_effects))
for(var/decl/item_effect/damage_effect as anything in item_effects)
- . = damage_effect.expend_attack_use(src, user, item_effects[damage_effect])
+ damage_effect.expend_attack_use(src, user, item_effects[damage_effect])
/obj/item/proc/get_attack_force(mob/living/user)
if(_base_attack_force <= 0 || (item_flags & ITEM_FLAG_NO_BLUDGEON))
diff --git a/code/game/objects/items/_item_materials.dm b/code/game/objects/items/_item_materials.dm
index ecf48b7029e8..893b901af7c8 100644
--- a/code/game/objects/items/_item_materials.dm
+++ b/code/game/objects/items/_item_materials.dm
@@ -1,6 +1,6 @@
/obj/item/on_update_icon()
- . = ..()
SHOULD_CALL_PARENT(TRUE)
+ . = ..()
cut_overlays()
if((material_alteration & MAT_FLAG_ALTERATION_COLOR) && material)
alpha = 100 + material.opacity * 255
@@ -91,6 +91,7 @@
obj_flags &= (~OBJ_FLAG_CONDUCTIBLE)
if(isnull(initial(paint_verb)))
paint_verb = material.paint_verb
+ refresh_color() // apply material color
update_attack_force()
update_name()
if(material_armor_multiplier)
diff --git a/code/game/objects/items/artifice/chain.dm b/code/game/objects/items/artifice/chain.dm
index 3a48abad4759..2e44bf586f62 100644
--- a/code/game/objects/items/artifice/chain.dm
+++ b/code/game/objects/items/artifice/chain.dm
@@ -6,4 +6,5 @@
icon_state = ICON_STATE_WORLD
icon = 'icons/obj/items/chain.dmi'
material = /decl/material/solid/metal/iron
+ color = /decl/material/solid/metal/iron::color
material_alteration = MAT_FLAG_ALTERATION_ALL
diff --git a/code/game/objects/items/artifice/hook.dm b/code/game/objects/items/artifice/hook.dm
index c20c77b14801..c04401d873fb 100644
--- a/code/game/objects/items/artifice/hook.dm
+++ b/code/game/objects/items/artifice/hook.dm
@@ -5,4 +5,5 @@
icon_state = ICON_STATE_WORLD
icon = 'icons/obj/items/hook.dmi'
material = /decl/material/solid/metal/iron
+ color = /decl/material/solid/metal/iron::color
material_alteration = MAT_FLAG_ALTERATION_ALL
diff --git a/code/game/objects/items/blades/_blade.dm b/code/game/objects/items/blades/_blade.dm
index 19dbcbce1cd6..80aa8b5d1ed7 100644
--- a/code/game/objects/items/blades/_blade.dm
+++ b/code/game/objects/items/blades/_blade.dm
@@ -75,7 +75,7 @@
initial_tool_qualities[TOOL_HATCHET] = TOOL_QUALITY_MEDIOCRE
set_extension(src, /datum/extension/tool/variable/simple, initial_tool_qualities)
- shine = istype(material) ? clamp((material.reflectiveness * 0.01) * 255, 10, (0.6 * ReadHSV(RGBtoHSV(material.color))[3])) : null
+ shine = istype(material) ? clamp((material.reflectiveness * 0.01) * 255, 10, (0.6 * rgb2num(material.color, COLORSPACE_HSV)[3])) : null
icon_state = ICON_STATE_WORLD
on_update_icon()
diff --git a/code/game/objects/items/blades/axe.dm b/code/game/objects/items/blades/axe.dm
index 9bda1a9a1345..ab902f9187a4 100644
--- a/code/game/objects/items/blades/axe.dm
+++ b/code/game/objects/items/blades/axe.dm
@@ -19,8 +19,8 @@
. = ..()
if(proximity && A && is_held_twohanded())
if(istype(A,/obj/structure/window))
- var/obj/structure/window/W = A
- W.shatter()
+ var/obj/structure/window/window = A
+ window.shatter()
else if(istype(A,/obj/structure/grille))
qdel(A)
else if(istype(A,/obj/effect/vine))
diff --git a/code/game/objects/items/blades/axe_fire.dm b/code/game/objects/items/blades/axe_fire.dm
index 61cc07e683f1..afe7d8e25f23 100644
--- a/code/game/objects/items/blades/axe_fire.dm
+++ b/code/game/objects/items/blades/axe_fire.dm
@@ -1,6 +1,7 @@
/obj/item/bladed/axe/fire
name = "fire axe"
icon = 'icons/obj/items/bladed/fireaxe.dmi'
+ icon_state = ICON_STATE_WORLD
desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?"
material_alteration = MAT_FLAG_ALTERATION_NAME
guard_material = /decl/material/solid/organic/plastic
diff --git a/code/game/objects/items/blades/folding.dm b/code/game/objects/items/blades/folding.dm
index 281c88d523a0..8e769c44d179 100644
--- a/code/game/objects/items/blades/folding.dm
+++ b/code/game/objects/items/blades/folding.dm
@@ -52,15 +52,13 @@
icon_state = "[icon_state]-closed"
/obj/item/bladed/folding/update_attack_force()
- ..()
+ . = ..()
set_edge(open)
set_sharp(open)
- if(open)
- w_class = open_item_size
- attack_verb = open_attack_verbs
- else
- w_class = closed_item_size
- attack_verb = closed_attack_verbs
+ w_class = open ? open_item_size : closed_item_size
+
+/obj/item/bladed/folding/pick_attack_verb()
+ return DEFAULTPICK(open ? open_attack_verbs : closed_attack_verbs, ..())
// Only show the inhand sprite when open.
/obj/item/bladed/folding/get_mob_overlay(mob/user_mob, slot, bodypart, use_fallback_if_icon_missing = TRUE, skip_adjustment = FALSE)
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 4313657b12dc..f3b1c0e3a00a 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -7,11 +7,17 @@
icon_state = "bodybag_folded"
w_class = ITEM_SIZE_SMALL
material = /decl/material/solid/organic/plastic
+ var/bag_type = /obj/structure/closet/body_bag
+
+/obj/item/bodybag/proc/create_bag_structure(mob/user)
+ var/atom/bag = new bag_type(user.loc)
+ bag.add_fingerprint(user)
+ return bag
/obj/item/bodybag/attack_self(mob/user)
- var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc)
- R.add_fingerprint(user)
+ create_bag_structure(user)
qdel(src)
+ return TRUE
/obj/item/box/bodybags
name = "body bags"
@@ -56,8 +62,8 @@
if(LAZYLEN(lbls?.labels))
add_overlay("bodybag_label")
-/obj/structure/closet/body_bag/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/hand_labeler))
+/obj/structure/closet/body_bag/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/hand_labeler))
return FALSE //Prevent the labeler from opening the bag when trying to apply a label
. = ..()
diff --git a/code/game/objects/items/books/_book.dm b/code/game/objects/items/books/_book.dm
index a71fd39032a7..f9db9deefc36 100644
--- a/code/game/objects/items/books/_book.dm
+++ b/code/game/objects/items/books/_book.dm
@@ -41,6 +41,13 @@
if(SSpersistence.is_tracking(src, /decl/persistence_handler/book))
. = QDEL_HINT_LETMELIVE
+/// Clears the text written in the book. Used for acetone removing ink. Returns TRUE if successful, FALSE if it can't be dissolved.
+/obj/item/book/proc/clear_text()
+ if(can_dissolve_text)
+ dat = null
+ return TRUE
+ return FALSE
+
/obj/item/book/on_update_icon()
. = ..()
icon_state = get_world_inventory_state()
@@ -77,16 +84,20 @@
if(dat)
user.visible_message("\The [user] opens a book titled \"[title]\" and begins reading intently.")
- var/processed_dat = user.handle_reading_literacy(user, dat)
- if(processed_dat)
- show_browser(user, processed_dat, "window=book;size=1000x550")
- onclose(user, "book")
+ show_text_to(user)
else
to_chat(user, SPAN_WARNING("This book is completely blank!"))
-/obj/item/book/attackby(obj/item/W, mob/user)
+/// Reader is the mob doing the reading, whose skill will be used for skillchecks. User is the mob who is holding the book, and do_afters will use them.
+/obj/item/book/proc/show_text_to(mob/reader, mob/user)
+ var/processed_dat = reader.handle_reading_literacy(reader, dat)
+ if(processed_dat)
+ show_browser(reader, processed_dat, "window=book;size=1000x550")
+ onclose(reader, "book")
+
+/obj/item/book/attackby(obj/item/used_item, mob/user)
- if(IS_PEN(W))
+ if(IS_PEN(used_item))
if(unique)
to_chat(user, SPAN_WARNING("These pages don't seem to take the ink well. Looks like you can't modify it."))
return TRUE
@@ -113,7 +124,7 @@
if(content)
last_modified_ckey = user.ckey
pencode_dat = content
- dat = formatpencode(usr, content, W)
+ dat = formatpencode(usr, content, used_item)
if("Author")
var/newauthor = sanitize(input(usr, "Write the author's name:"))
@@ -126,7 +137,7 @@
author = newauthor
return TRUE
- if((IS_KNIFE(W) || IS_WIRECUTTER(W)) && user.check_intent(I_FLAG_HARM) && try_carve(user, W))
+ if((IS_KNIFE(used_item) || IS_WIRECUTTER(used_item)) && user.check_intent(I_FLAG_HARM) && try_carve(user, used_item))
return TRUE
return ..()
@@ -148,9 +159,7 @@
SPAN_NOTICE("\The [user] opens up a book and shows it to \the [target].")
)
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN) //to prevent spam
- var/processed_dat = target.handle_reading_literacy(user, "Author: [author].
" + "[dat]")
- if(processed_dat)
- show_browser(target, processed_dat, "window=book;size=1000x550")
+ show_text_to(target)
return TRUE
return ..()
diff --git a/code/game/objects/items/books/manuals/_manual.dm b/code/game/objects/items/books/manuals/_manual.dm
index 7cee55d5709e..8d09360270e9 100644
--- a/code/game/objects/items/books/manuals/_manual.dm
+++ b/code/game/objects/items/books/manuals/_manual.dm
@@ -2,13 +2,38 @@
unique = TRUE // Unable to be copied, unable to be modified
abstract_type = /obj/item/book/manual
var/guide_decl
+ var/tmp/has_initialized = FALSE
/obj/item/book/manual/Initialize()
. = ..()
+ // try to initialize the text! if it's prior to sscodex init it'll initialize on being read
+ // if the guide is invalid the manual will need to be deleted
+ if(initialize_data(in_init = TRUE) == INITIALIZE_HINT_QDEL)
+ return INITIALIZE_HINT_QDEL
+
+/obj/item/book/manual/try_to_read()
+ initialize_data()
+ . = ..()
+
+/obj/item/book/manual/show_text_to()
+ initialize_data()
+ . = ..()
+
+/obj/item/book/manual/clear_text()
+ if((. = ..()))
+ has_initialized = TRUE // prevent data from being added later if it hasn't already been
+
+/obj/item/book/manual/proc/initialize_data(in_init = FALSE)
+ if(has_initialized || !SScodex.initialized)
+ return
+ // Has yet to initialize.
var/guide_text = guide_decl && SScodex.get_manual_text(guide_decl)
if(!guide_text)
log_debug("Manual [type] spawned with invalid guide decl type ([guide_decl || null]).")
- return INITIALIZE_HINT_QDEL
+ if(in_init)
+ return INITIALIZE_HINT_QDEL
+ qdel(src)
+ return
dat = {"
@@ -19,3 +44,4 @@
"}
+ has_initialized = TRUE
diff --git a/code/game/objects/items/books/skill/_skill.dm b/code/game/objects/items/books/skill/_skill.dm
index 9c9bf06db827..39ed2b3cdfe0 100644
--- a/code/game/objects/items/books/skill/_skill.dm
+++ b/code/game/objects/items/books/skill/_skill.dm
@@ -213,17 +213,17 @@ Skill books that increase your skills while you activate and hold them
/obj/item/book/skill/proc/check_buff()
if(!reading)
return
- var/mob/R = reading.resolve()
- if(!istype(R) || !CanPhysicallyInteract(R))
+ var/mob/reader = reading.resolve()
+ if(!istype(reader) || !CanPhysicallyInteract(reader))
remove_buff()
/obj/item/book/skill/proc/remove_buff()
- var/mob/R = reading?.resolve()
+ var/mob/reader = reading?.resolve()
reading = null
- if(istype(R))
- to_chat(R, SPAN_DANGER("You lose the page you were on! You can't cross-reference using [title] like this!"))
- if(R.fetch_buffs_of_type(/datum/skill_buff/skill_book, 0))
- unlearn(R)
+ if(istype(reader))
+ to_chat(reader, SPAN_DANGER("You lose the page you were on! You can't cross-reference using [title] like this!"))
+ if(reader.fetch_buffs_of_type(/datum/skill_buff/skill_book, 0))
+ unlearn(reader)
STOP_PROCESSING(SSprocessing, src)
/obj/item/book/skill/Destroy()
diff --git a/code/game/objects/items/books/skill/_skill_custom.dm b/code/game/objects/items/books/skill/_skill_custom.dm
index 2d9bfa2a3595..736cd80fe022 100644
--- a/code/game/objects/items/books/skill/_skill_custom.dm
+++ b/code/game/objects/items/books/skill/_skill_custom.dm
@@ -53,8 +53,8 @@
/obj/item/book/skill/custom/question
icon = 'icons/obj/items/books/book_white_question.dmi'
-/obj/item/book/skill/custom/attackby(obj/item/pen, mob/user)
- if(!IS_PEN(pen))
+/obj/item/book/skill/custom/attackby(obj/item/used_item, mob/user)
+ if(!IS_PEN(used_item))
return ..()
if(!user.skill_check(SKILL_LITERACY, SKILL_BASIC))
to_chat(user, SPAN_WARNING("You can't even read, yet you want to write a whole educational textbook?"))
@@ -64,26 +64,26 @@
return TRUE
var/state_check = skill_option_string // the state skill_option_string is in just before opening the input
var/choice = input(user, "What would you like to change?","Textbook editing") as null|anything in list("Title", "Author", skill_option_string)
- if(!can_write(pen,user))
+ if(!can_write(used_item,user))
return TRUE
switch(choice)
if("Title")
- edit_title(pen, user)
+ edit_title(used_item, user)
if("Skill")
if(state_check != "Skill") // make sure someone hasn't already started the book while we were staring at menus woops
to_chat(user, SPAN_WARNING("The skill has already been selected and the writing started."))
return TRUE
- edit_skill(pen, user)
+ edit_skill(used_item, user)
if("Continue writing content")
if(state_check != "Continue writing content")
return TRUE
- continue_skill(pen, user)
+ continue_skill(used_item, user)
if("Author")
- edit_author(pen, user)
+ edit_author(used_item, user)
else
return TRUE
diff --git a/code/game/objects/items/candelabra.dm b/code/game/objects/items/candelabra.dm
index 1f82ec443aa7..1b123c42034f 100644
--- a/code/game/objects/items/candelabra.dm
+++ b/code/game/objects/items/candelabra.dm
@@ -7,7 +7,7 @@
list("x" = 6, "y" = 17)
)
-/datum/storage/candelabra/can_be_inserted(obj/item/W, mob/user, stop_messages, click_params)
+/datum/storage/candelabra/can_be_inserted(obj/item/used_item, mob/user, stop_messages, click_params)
. = ..() && holder && length(holder.get_stored_inventory()) < length(candle_offsets)
/obj/item/candelabra
@@ -17,6 +17,7 @@
icon_state = ICON_STATE_WORLD
storage = /datum/storage/candelabra
material = /decl/material/solid/metal/brass
+ color = /decl/material/solid/metal/brass::color
material_alteration = MAT_FLAG_ALTERATION_ALL
/obj/item/candelabra/attackby(obj/item/used_item, mob/user)
@@ -26,12 +27,8 @@
return TRUE
. = ..()
-/obj/item/candelabra/filled/Initialize(ml, material_key)
- new /obj/item/flame/candle/random(src)
- new /obj/item/flame/candle/random(src)
- new /obj/item/flame/candle/random(src)
- . = ..()
- update_icon()
+/obj/item/candelabra/filled/WillContain()
+ return list(/obj/item/flame/candle/handmade = 3)
// Workaround for vis_contents propagating color.
/obj/item/candelabra/on_update_icon()
diff --git a/code/game/objects/items/circuitboards/machinery/household.dm b/code/game/objects/items/circuitboards/machinery/household.dm
index 5ce6f6ead15f..b3e8803a255d 100644
--- a/code/game/objects/items/circuitboards/machinery/household.dm
+++ b/code/game/objects/items/circuitboards/machinery/household.dm
@@ -46,6 +46,18 @@
/obj/item/stock_parts/circuitboard/cooker/get_buildable_types()
return subtypesof(/obj/machinery/cooker)
+/obj/item/stock_parts/circuitboard/centrifuge
+ name = "circuitboard (industrial centrifuge)"
+ build_path = /obj/machinery/centrifuge
+ board_type = "machine"
+ origin_tech = @'{"biotech":2,"engineering":1}'
+ req_components = list(
+ /obj/item/stock_parts/manipulator = 2,
+ /obj/item/stock_parts/matter_bin = 2,
+ /obj/item/stock_parts/console_screen = 1,
+ /obj/item/stock_parts/keyboard = 1
+ )
+
/obj/item/stock_parts/circuitboard/seed_extractor
name = "circuitboard (seed extractor)"
build_path = /obj/machinery/seed_extractor
diff --git a/code/game/objects/items/circuitboards/machinery/medical.dm b/code/game/objects/items/circuitboards/machinery/medical.dm
index a1ad9088df20..0f5e011f6878 100644
--- a/code/game/objects/items/circuitboards/machinery/medical.dm
+++ b/code/game/objects/items/circuitboards/machinery/medical.dm
@@ -18,8 +18,7 @@
origin_tech = @'{"engineering":2,"biotech":4,"programming":4}'
req_components = list(
/obj/item/stock_parts/scanning_module = 2,
- /obj/item/stock_parts/manipulator = 2,
- /obj/item/stock_parts/console_screen = 1)
+ /obj/item/stock_parts/manipulator = 2)
additional_spawn_components = list(
/obj/item/stock_parts/power/apc/buildable = 1
)
diff --git a/code/game/objects/items/contraband.dm b/code/game/objects/items/contraband.dm
index 601f8a9f3e83..8b62f298f8f7 100644
--- a/code/game/objects/items/contraband.dm
+++ b/code/game/objects/items/contraband.dm
@@ -48,12 +48,10 @@
add_to_reagents(reagent, picked_reagents[reagent])
var/list/names = new
- for(var/liquid_type in reagents.liquid_volumes)
- var/decl/material/liquid = GET_DECL(liquid_type)
- names += liquid.get_reagent_name(reagents, MAT_PHASE_LIQUID)
+ for(var/decl/material/reagent as anything in reagents.liquid_volumes)
+ names += reagent.get_reagent_name(reagents, MAT_PHASE_LIQUID)
- for(var/solid_type in reagents.solid_volumes)
- var/decl/material/solid = GET_DECL(solid_type)
- names += solid.get_reagent_name(reagents, MAT_PHASE_SOLID)
+ for(var/decl/material/reagent as anything in reagents.solid_volumes)
+ names += reagent.get_reagent_name(reagents, MAT_PHASE_SOLID)
desc = "Contains [english_list(names)]."
\ No newline at end of file
diff --git a/code/game/objects/items/cryobag.dm b/code/game/objects/items/cryobag.dm
index f045c550ad9d..ba01e37bc1d0 100644
--- a/code/game/objects/items/cryobag.dm
+++ b/code/game/objects/items/cryobag.dm
@@ -12,15 +12,17 @@
/decl/material/solid/metal/silver = MATTER_AMOUNT_TRACE,
/decl/material/solid/metal/gold = MATTER_AMOUNT_TRACE
)
+ bag_type = /obj/structure/closet/body_bag/cryobag
var/stasis_power
-/obj/item/bodybag/cryobag/attack_self(mob/user)
- var/obj/structure/closet/body_bag/cryobag/R = new /obj/structure/closet/body_bag/cryobag(user.loc)
- if(stasis_power)
- R.stasis_power = stasis_power
- R.update_icon()
- R.add_fingerprint(user)
- qdel(src)
+/obj/item/bodybag/cryobag/get_cryogenic_power()
+ return stasis_power
+
+/obj/item/bodybag/cryobag/create_bag_structure(mob/user)
+ var/obj/structure/closet/body_bag/cryobag/bag = ..()
+ if(istype(bag) && stasis_power)
+ bag.stasis_power = stasis_power
+ return bag
/obj/structure/closet/body_bag/cryobag
name = "stasis bag"
@@ -92,9 +94,7 @@
stasis_power = round(0.75 * stasis_power)
animate(src, color = color_matrix_saturation(get_saturation()), time = 10)
update_icon()
-
- if(LAZYACCESS(patient.stasis_sources, STASIS_CRYOBAG) != stasis_power)
- patient.set_stasis(stasis_power, STASIS_CRYOBAG)
+ patient.add_mob_modifier(/decl/mob_modifier/stasis, 2 SECONDS, source = src)
/obj/structure/closet/body_bag/cryobag/return_air() //Used to make stasis bags protect from vacuum.
if(airtank)
diff --git a/code/game/objects/items/devices/boombox.dm b/code/game/objects/items/devices/boombox.dm
index fc3850c843bc..01f0e716d581 100644
--- a/code/game/objects/items/devices/boombox.dm
+++ b/code/game/objects/items/devices/boombox.dm
@@ -2,8 +2,7 @@
name = "boombox"
desc = "A device used to emit rhythmic sounds, colloquially referred to as a 'boombox'. It's in a retro style (massive), and absolutely unwieldy."
icon = 'icons/obj/items/device/boombox.dmi'
- icon_state = "off"
- item_state = "boombox"
+ icon_state = ICON_STATE_WORLD
_base_attack_force = 7
w_class = ITEM_SIZE_HUGE //forbid putting something that emits loud sounds forever into a backpack
origin_tech = @'{"magnets":2,"combat":1}'
@@ -91,22 +90,22 @@
change_volume(volume - 10)
return TOPIC_HANDLED
-/obj/item/boombox/attackby(var/obj/item/W, var/mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/item/boombox/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_SCREWDRIVER(used_item))
if(!panel)
- user.visible_message(SPAN_NOTICE("\The [user] re-attaches \the [src]'s front panel with \the [W]."), SPAN_NOTICE("You re-attach \the [src]'s front panel."))
+ user.visible_message(SPAN_NOTICE("\The [user] re-attaches \the [src]'s front panel with \the [used_item]."), SPAN_NOTICE("You re-attach \the [src]'s front panel."))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
panel = TRUE
return TRUE
if(!broken)
- AdjustFrequency(W, user)
+ AdjustFrequency(used_item, user)
return TRUE
else if(panel)
- user.visible_message(SPAN_NOTICE("\The [user] unhinges \the [src]'s front panel with \the [W]."), SPAN_NOTICE("You unhinge \the [src]'s front panel."))
+ user.visible_message(SPAN_NOTICE("\The [user] unhinges \the [src]'s front panel with \the [used_item]."), SPAN_NOTICE("You unhinge \the [src]'s front panel."))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
panel = FALSE
- if(istype(W,/obj/item/stack/nanopaste))
- var/obj/item/stack/S = W
+ if(istype(used_item,/obj/item/stack/nanopaste))
+ var/obj/item/stack/S = used_item
if(broken && !panel)
if(S.use(1))
user.visible_message(SPAN_NOTICE("\The [user] pours some of \the [S] onto \the [src]."), SPAN_NOTICE("You pour some of \the [S] over \the [src]'s internals and watch as it retraces and resolders paths."))
@@ -116,7 +115,7 @@
else
. = ..()
-/obj/item/boombox/proc/AdjustFrequency(var/obj/item/W, var/mob/user)
+/obj/item/boombox/proc/AdjustFrequency(var/obj/item/used_item, var/mob/user)
var/const/MIN_FREQUENCY = 0.5
var/const/MAX_FREQUENCY = 1.5
@@ -137,7 +136,7 @@
return FALSE
if(!MayAdjust(user))
return FALSE
- if(W != user.get_active_held_item())
+ if(used_item != user.get_active_held_item())
return FALSE
if(!CanPhysicallyInteract(user))
diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm
index 1b06acd9f0d3..88ebe70cf775 100644
--- a/code/game/objects/items/devices/hacktool.dm
+++ b/code/game/objects/items/devices/hacktool.dm
@@ -23,8 +23,8 @@
hack_state = null
return ..()
-/obj/item/multitool/hacktool/attackby(var/obj/item/W, var/mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/item/multitool/hacktool/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_SCREWDRIVER(used_item))
in_hack_mode = !in_hack_mode
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
return TRUE
diff --git a/code/game/objects/items/devices/holowarrant.dm b/code/game/objects/items/devices/holowarrant.dm
index ff3fe45f5725..624d4f818656 100644
--- a/code/game/objects/items/devices/holowarrant.dm
+++ b/code/game/objects/items/devices/holowarrant.dm
@@ -58,9 +58,9 @@
if(href_list["select"])
var/list/active_warrants = list()
- for(var/datum/computer_file/report/warrant/W in global.all_warrants)
- if(!W.archived)
- active_warrants["[capitalize(W.get_category())] - [W.get_name()]"] = W
+ for(var/datum/computer_file/report/warrant/warrant in global.all_warrants)
+ if(!warrant.archived)
+ active_warrants["[capitalize(warrant.get_category())] - [warrant.get_name()]"] = warrant
if(!length(active_warrants))
to_chat(user,SPAN_WARNING("There are no active warrants available."))
return TOPIC_HANDLED
@@ -81,10 +81,10 @@
D.ui_interact(user)
return TOPIC_HANDLED
-/obj/item/holowarrant/attackby(obj/item/W, mob/user)
+/obj/item/holowarrant/attackby(obj/item/used_item, mob/user)
if(!active)
return ..()
- var/obj/item/card/id/I = W.GetIdCard()
+ var/obj/item/card/id/I = used_item.GetIdCard()
if(I && check_access_list(I.GetAccess()))
var/choice = alert(user, "Would you like to authorize this warrant?","Warrant authorization","Yes","No")
var/datum/report_field/signature/auth = active.field_from_name("Authorized by")
diff --git a/code/game/objects/items/devices/inducer.dm b/code/game/objects/items/devices/inducer.dm
index 132fcc0e82fe..bb84d497a164 100644
--- a/code/game/objects/items/devices/inducer.dm
+++ b/code/game/objects/items/devices/inducer.dm
@@ -46,8 +46,8 @@
return TRUE
return FALSE
-/obj/item/inducer/attackby(obj/item/W, mob/user)
- if(CannotUse(user) || recharge(W, user))
+/obj/item/inducer/attackby(obj/item/used_item, mob/user)
+ if(CannotUse(user) || recharge(used_item, user))
return TRUE
return ..()
@@ -59,15 +59,15 @@
else
recharging = TRUE
var/obj/item/cell/MyC = get_cell()
- var/obj/item/cell/C = A.get_cell()
+ var/obj/item/cell/cell = A.get_cell()
var/obj/O
if(istype(A, /obj))
O = A
- if(C)
+ if(cell)
var/charge_length = 10
var/done_any = FALSE
spark_at(user, amount = 1, cardinal_only = TRUE)
- if(C.charge >= C.maxcharge)
+ if(cell.charge >= cell.maxcharge)
to_chat(user, "\The [A] is fully charged!")
recharging = FALSE
return TRUE
@@ -78,15 +78,15 @@
charge_length += rand(10, 30)
if (user.get_skill_value(SKILL_ELECTRICAL) < SKILL_ADEPT)
charge_length += rand(40, 60)
- while(C.charge < C.maxcharge)
+ while(cell.charge < cell.maxcharge)
if(MyC.charge > max(0, MyC.charge*failsafe) && do_after(user, charge_length, target = user))
if(CannotUse(user))
return TRUE
- if(QDELETED(C))
+ if(QDELETED(cell))
return TRUE
spark_at(user, amount = 1, cardinal_only = TRUE)
done_any = TRUE
- induce(C)
+ induce(cell)
if(O)
O.update_icon()
else
diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm
index 4d9877a67ead..df209e9cc0d5 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -91,9 +91,9 @@
. = ..()
// TODO: Refactor this to check matter or maybe even just use the fabricator recipe for lights directly
-/obj/item/lightreplacer/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/material) && W.get_material_type() == /decl/material/solid/glass)
- var/obj/item/stack/G = W
+/obj/item/lightreplacer/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/stack/material) && used_item.get_material_type() == /decl/material/solid/glass)
+ var/obj/item/stack/G = used_item
if(uses >= max_uses)
to_chat(user, "\The [src] is full.")
else if(G.use(1))
@@ -103,8 +103,8 @@
to_chat(user, "You need one sheet of glass to replace lights.")
return TRUE
- if(istype(W, /obj/item/light))
- var/obj/item/light/L = W
+ if(istype(used_item, /obj/item/light))
+ var/obj/item/light/L = used_item
if(L.status == 0) // LIGHT OKAY
if(uses < max_uses)
if(!user.try_unequip(L))
@@ -119,15 +119,8 @@
return ..()
/obj/item/lightreplacer/attack_self(mob/user)
- /* // This would probably be a bit OP. If you want it though, uncomment the code.
- if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- if(R.emagged)
- src.Emag()
- to_chat(usr, "You shortcircuit \the [src].")
- return
- */
to_chat(usr, "It has [uses] lights remaining.")
+ return TRUE
/obj/item/lightreplacer/on_update_icon()
. = ..()
diff --git a/code/game/objects/items/devices/modkit.dm b/code/game/objects/items/devices/modkit.dm
index b5eb44262b35..8b73d443025e 100644
--- a/code/game/objects/items/devices/modkit.dm
+++ b/code/game/objects/items/devices/modkit.dm
@@ -18,7 +18,7 @@
/obj/item/modkit/Initialize(ml, material_key)
if(!target_bodytype)
- var/decl/species/species = GET_DECL(global.using_map.default_species)
+ var/decl/species/species = decls_repository.get_decl_by_id(global.using_map.default_species)
target_bodytype = species.default_bodytype.bodytype_flag
. = ..()
diff --git a/code/game/objects/items/devices/oxycandle.dm b/code/game/objects/items/devices/oxycandle.dm
index 0040ac660821..c24ced497aef 100644
--- a/code/game/objects/items/devices/oxycandle.dm
+++ b/code/game/objects/items/devices/oxycandle.dm
@@ -1,3 +1,4 @@
+// TODO: Make this an actual candle that burns something that produces oxygen as a waste product? That'd be doable now...
/obj/item/oxycandle
name = "oxygen candle"
desc = "A steel tube with the words 'OXYGEN - PULL CORD TO IGNITE' stamped on the side.\nA small label reads 'WARNING: NOT FOR LIGHTING USE. WILL IGNITE FLAMMABLE GASSES'"
@@ -34,8 +35,8 @@
air_contents = new /datum/gas_mixture()
air_contents.volume = 200 //liters
air_contents.temperature = T20C
- var/list/air_mix = list(/decl/material/gas/oxygen = 1 * (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
- air_contents.adjust_multi(/decl/material/gas/oxygen, air_mix[/decl/material/gas/oxygen])
+ var/const/OXYGEN_FRACTION = 1 // separating out the constant so it's clearer why it exists and how to modify it later
+ air_contents.adjust_gas(/decl/material/gas/oxygen, OXYGEN_FRACTION * (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
START_PROCESSING(SSprocessing, src)
// Process of Oxygen candles releasing air. Makes 200 volume of oxygen
@@ -63,8 +64,8 @@
return
environment.merge(removed)
volume -= 200
- var/list/air_mix = list(/decl/material/gas/oxygen = 1 * (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
- air_contents.adjust_multi(/decl/material/gas/oxygen, air_mix[/decl/material/gas/oxygen])
+ var/const/OXYGEN_FRACTION = 1 // separating out the constant so it's clearer why it exists and how to modify it later
+ air_contents.adjust_gas(/decl/material/gas/oxygen, OXYGEN_FRACTION * (target_pressure * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature))
/obj/item/oxycandle/on_update_icon()
. = ..()
diff --git a/code/game/objects/items/devices/paint_sprayer.dm b/code/game/objects/items/devices/paint_sprayer.dm
index 90c99edcaacc..33f49ba11395 100644
--- a/code/game/objects/items/devices/paint_sprayer.dm
+++ b/code/game/objects/items/devices/paint_sprayer.dm
@@ -143,46 +143,46 @@
return .
-/obj/item/paint_sprayer/proc/paint_wall(var/turf/wall/W, var/mob/user)
- if(istype(W) && (!W.material || !W.material.wall_flags))
+/obj/item/paint_sprayer/proc/paint_wall(var/turf/wall/wall, var/mob/user)
+ if(istype(wall) && (!wall.material || !wall.material.wall_flags))
to_chat(user, SPAN_WARNING("You can't paint this wall type."))
return
var/choice
- if(W.material.wall_flags & PAINT_PAINTABLE && W.material.wall_flags & PAINT_STRIPABLE)
+ if(wall.material.wall_flags & PAINT_PAINTABLE && wall.material.wall_flags & PAINT_STRIPABLE)
choice = input(user, "What do you wish to paint?") as null|anything in list(PAINT_REGION_PAINT,PAINT_REGION_STRIPE)
- else if(W.material.wall_flags & PAINT_PAINTABLE)
+ else if(wall.material.wall_flags & PAINT_PAINTABLE)
choice = PAINT_REGION_PAINT
- else if(W.material.wall_flags & PAINT_STRIPABLE)
+ else if(wall.material.wall_flags & PAINT_STRIPABLE)
choice = PAINT_REGION_STRIPE
- if (user.incapacitated() || !W || !user.Adjacent(W))
+ if (user.incapacitated() || !wall || !user.Adjacent(wall))
return FALSE
if(choice == PAINT_REGION_PAINT)
- W.paint_wall(spray_color)
+ wall.paint_wall(spray_color)
else if(choice == PAINT_REGION_STRIPE)
- W.stripe_wall(spray_color)
+ wall.stripe_wall(spray_color)
-/obj/item/paint_sprayer/proc/pick_color_from_wall(var/turf/wall/W, var/mob/user)
- if (!W.material || !W.material.wall_flags)
+/obj/item/paint_sprayer/proc/pick_color_from_wall(var/turf/wall/wall, var/mob/user)
+ if (!wall.material || !wall.material.wall_flags)
return FALSE
- switch (select_wall_region(W, user, "Where do you wish to select the color from?"))
+ switch (select_wall_region(wall, user, "Where do you wish to select the color from?"))
if (PAINT_REGION_PAINT)
- return W.paint_color
+ return wall.paint_color
if (PAINT_REGION_STRIPE)
- return W.stripe_color
+ return wall.stripe_color
else
return FALSE
-/obj/item/paint_sprayer/proc/select_wall_region(var/turf/wall/W, var/mob/user, var/input_text)
+/obj/item/paint_sprayer/proc/select_wall_region(var/turf/wall/wall, var/mob/user, var/input_text)
var/list/choices = list()
- if (W.material.wall_flags & PAINT_PAINTABLE)
+ if (wall.material.wall_flags & PAINT_PAINTABLE)
choices |= PAINT_REGION_PAINT
- if (W.material.wall_flags & PAINT_STRIPABLE)
+ if (wall.material.wall_flags & PAINT_STRIPABLE)
choices |= PAINT_REGION_STRIPE
var/choice = input(user, input_text) as null|anything in sortTim(choices, /proc/cmp_text_asc)
- if (user.incapacitated() || !W || !user.Adjacent(W))
+ if (user.incapacitated() || !wall || !user.Adjacent(wall))
return FALSE
return choice
diff --git a/code/game/objects/items/devices/personal_shield.dm b/code/game/objects/items/devices/personal_shield.dm
index c83b7522cc8d..c88b59712e98 100644
--- a/code/game/objects/items/devices/personal_shield.dm
+++ b/code/game/objects/items/devices/personal_shield.dm
@@ -11,36 +11,45 @@
/decl/material/solid/metal/uranium = MATTER_AMOUNT_TRACE,
)
var/uses = 5
- var/obj/aura/personal_shield/device/shield
+ var/shield_effect_type = /decl/mob_modifier/shield/device
/obj/item/personal_shield/attack_self(var/mob/user)
- if(uses && !shield)
- shield = new(user,src)
- else
- QDEL_NULL(shield)
+ if(loc == user && isliving(user))
+ var/mob/living/holder = user
+ if(holder.has_mob_modifier(shield_effect_type, source = src))
+ holder.remove_mob_modifier(shield_effect_type, source = src)
+ else if(uses && shield_effect_type)
+ holder.add_mob_modifier(shield_effect_type, source = src)
+ else
+ return ..()
+ return TRUE
+ return ..()
/obj/item/personal_shield/Move()
- QDEL_NULL(shield)
- return ..()
+ var/mob/living/holder = loc
+ . = ..()
+ if(. && istype(holder) && holder.has_mob_modifier(shield_effect_type, source = src))
+ holder.remove_mob_modifier(shield_effect_type, source = src)
/obj/item/personal_shield/forceMove()
- QDEL_NULL(shield)
- return ..()
+ var/mob/living/holder = loc
+ . = ..()
+ if(. && istype(holder) && holder.has_mob_modifier(shield_effect_type, source = src))
+ holder.remove_mob_modifier(shield_effect_type, source = src)
-/obj/item/personal_shield/proc/take_charge()
- if(!--uses)
- QDEL_NULL(shield)
- to_chat(loc,"\The [src] begins to spark as it breaks!")
+/obj/item/personal_shield/proc/expend_charge()
+ if(uses <= 0)
+ return FALSE
+ uses--
+ if(uses <= 0 && ismob(loc))
+ var/mob/living/holder = loc
+ if(istype(holder) && holder.has_mob_modifier(shield_effect_type, source = src))
+ holder.remove_mob_modifier(shield_effect_type, source = src)
+ to_chat(holder, SPAN_DANGER("\The [src] begins to spark as it breaks!"))
update_icon()
- return
+ return TRUE
/obj/item/personal_shield/on_update_icon()
. = ..()
if(uses)
- icon_state = "batterer"
- else
- icon_state = "battererburnt"
-
-/obj/item/personal_shield/Destroy()
- QDEL_NULL(shield)
- return ..()
\ No newline at end of file
+ add_overlay("[icon_state]-on")
\ No newline at end of file
diff --git a/code/game/objects/items/devices/pinpointer.dm b/code/game/objects/items/devices/pinpointer.dm
index f187965a533c..b9624ebf4803 100644
--- a/code/game/objects/items/devices/pinpointer.dm
+++ b/code/game/objects/items/devices/pinpointer.dm
@@ -126,14 +126,14 @@
var/turf/T = get_turf(src)
var/zlevels = SSmapping.get_connected_levels(T.z)
var/cur_dist = world.maxx+world.maxy
- for(var/obj/item/radio/beacon/R in global.radio_beacons)
- if(!R.functioning)
+ for(var/obj/item/radio/beacon/radio in global.radio_beacons)
+ if(!radio.functioning)
continue
- if((R.z in zlevels) && R.frequency == tracking_freq)
- var/check_dist = get_dist(src,R)
+ if((radio.z in zlevels) && radio.frequency == tracking_freq)
+ var/check_dist = get_dist(src, radio)
if(check_dist < cur_dist)
cur_dist = check_dist
- . = weakref(R)
+ . = weakref(radio)
/obj/item/pinpointer/radio/attack_self(var/mob/user)
interact(user)
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index 890fb77b269c..104617710a6e 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -67,8 +67,8 @@
STOP_PROCESSING_POWER_OBJECT(src)
. = ..()
-/obj/item/powersink/attackby(var/obj/item/I, var/mob/user)
- if(IS_SCREWDRIVER(I))
+/obj/item/powersink/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_SCREWDRIVER(used_item))
if(mode == DISCONNECTED)
var/turf/T = loc
if(isturf(T) && !!T.is_plating())
diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm
index 3aa24d6dacaf..1cda309212b5 100644
--- a/code/game/objects/items/devices/radio/beacon.dm
+++ b/code/game/objects/items/devices/radio/beacon.dm
@@ -74,8 +74,8 @@ var/global/list/radio_beacons = list()
var/turf/T = get_turf(src)
hide(hides_under_flooring() && !T.is_plating())
-/obj/item/radio/beacon/anchored/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/stack/nanopaste))
+/obj/item/radio/beacon/anchored/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/stack/nanopaste))
if(functioning)
to_chat(user, SPAN_WARNING("\The [src] does not need any repairs."))
return TRUE
@@ -83,7 +83,7 @@ var/global/list/radio_beacons = list()
to_chat(user, SPAN_WARNING("\The [src] is completely irrepairable."))
return TRUE
- var/obj/item/stack/nanopaste/S = I
+ var/obj/item/stack/nanopaste/S = used_item
if(!panel_open)
to_chat(user, SPAN_WARNING("You can't work on \the [src] until its been opened up."))
return TRUE
diff --git a/code/game/objects/items/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm
index dc29d7b3e4b4..bcc1ab952fbe 100644
--- a/code/game/objects/items/devices/radio/encryptionkey.dm
+++ b/code/game/objects/items/devices/radio/encryptionkey.dm
@@ -43,17 +43,17 @@
return TRUE
. = ..()
-/obj/item/encryptionkey/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/card/id))
- var/obj/item/card/id/id = W
+/obj/item/encryptionkey/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/card/id))
+ var/obj/item/card/id/id = used_item
var/list/access = id.GetAccess()
if(!length(access))
- to_chat(user, SPAN_WARNING("\The [W] has no access keys to copy."))
+ to_chat(user, SPAN_WARNING("\The [used_item] has no access keys to copy."))
return TRUE
LAZYINITLIST(can_decrypt)
can_decrypt |= access
UNSETEMPTY(can_decrypt)
- to_chat(user, SPAN_NOTICE("You pass \the [W] across \the [src], copying the access keys into the encryption cache."))
+ to_chat(user, SPAN_NOTICE("You pass \the [used_item] across \the [src], copying the access keys into the encryption cache."))
return TRUE
. = ..()
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index 0d58d152d45a..ed308e4410a9 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -16,8 +16,8 @@
return
/obj/item/radio/headset/on_update_icon()
+ . = ..()
icon_state = get_world_inventory_state()
- cut_overlays()
if(on)
if(analog)
add_overlay("[icon_state]-local")
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 081365675f01..7277834d2d25 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -456,22 +456,22 @@
if(panel_open)
. += SPAN_WARNING("A panel on the back of \the [src] is hanging open.")
-/obj/item/radio/attackby(obj/item/W, mob/user)
+/obj/item/radio/attackby(obj/item/used_item, mob/user)
user.set_machine(src)
- if(istype(W, /obj/item/encryptionkey))
+ if(istype(used_item, /obj/item/encryptionkey))
if(!encryption_key_capacity)
to_chat(user, SPAN_WARNING("\The [src] cannot accept an encryption key."))
return TRUE
if(length(encryption_keys) >= encryption_key_capacity)
to_chat(user, SPAN_WARNING("\The [src] cannot fit any more encryption keys."))
return TRUE
- if(user.try_unequip(W, src))
- LAZYADD(encryption_keys, W)
+ if(user.try_unequip(used_item, src))
+ LAZYADD(encryption_keys, used_item)
channels = null
return TRUE
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
if(length(encryption_keys))
var/obj/item/encryptionkey/ekey = pick(encryption_keys)
ekey.dropInto(loc)
diff --git a/code/game/objects/items/devices/radio/radio_borg.dm b/code/game/objects/items/devices/radio/radio_borg.dm
index c8c6935215e0..eab3b5bd6e08 100644
--- a/code/game/objects/items/devices/radio/radio_borg.dm
+++ b/code/game/objects/items/devices/radio/radio_borg.dm
@@ -13,8 +13,8 @@
/obj/item/radio/borg/can_receive_message(var/check_network_membership)
. = ..() && isrobot(loc)
if(.)
- var/mob/living/silicon/robot/R = loc
- if(!R.handle_radio_transmission())
+ var/mob/living/silicon/robot/robot = loc
+ if(!robot.handle_radio_transmission())
return FALSE
/obj/item/radio/borg/ert
@@ -32,8 +32,8 @@
/obj/item/radio/borg/talk_into(mob/living/M, message, message_mode, var/verb = "says", var/decl/language/speaking = null)
. = ..()
if(isrobot(loc))
- var/mob/living/silicon/robot/R = src.loc
- R.handle_radio_transmission()
+ var/mob/living/silicon/robot/robot = src.loc
+ robot.handle_radio_transmission()
/obj/item/radio/borg/OnTopic(mob/user, href_list, datum/topic_state/state)
if((. = ..()))
diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm
index c3cf46fe3b81..518b43c3d377 100644
--- a/code/game/objects/items/devices/spy_bug.dm
+++ b/code/game/objects/items/devices/spy_bug.dm
@@ -38,13 +38,12 @@
/obj/item/spy_bug/attack_self(mob/user)
radio.attack_self(user)
-/obj/item/spy_bug/attackby(obj/W, mob/user)
- if(istype(W, /obj/item/spy_monitor))
- var/obj/item/spy_monitor/SM = W
+/obj/item/spy_bug/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/spy_monitor))
+ var/obj/item/spy_monitor/SM = used_item
SM.pair(src, user)
return TRUE
- else
- return ..()
+ return ..()
/obj/item/spy_bug/hear_talk(mob/M, var/msg, verb, decl/language/speaking)
radio.hear_talk(M, msg, speaking)
@@ -88,12 +87,11 @@
radio.attack_self(user)
view_cameras(user)
-/obj/item/spy_monitor/attackby(obj/W, mob/user)
- if(istype(W, /obj/item/spy_bug))
- pair(W, user)
+/obj/item/spy_monitor/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/spy_bug))
+ pair(used_item, user)
return TRUE
- else
- return ..()
+ return ..()
/obj/item/spy_monitor/proc/pair(var/obj/item/spy_bug/SB, var/mob/living/user)
to_chat(user, SPAN_NOTICE("\The [SB] has been paired with \the [src]."))
diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm
index 27b044c6a1d0..a8cbf50f10b3 100644
--- a/code/game/objects/items/devices/suit_cooling.dm
+++ b/code/game/objects/items/devices/suit_cooling.dm
@@ -106,8 +106,8 @@
turn_on()
to_chat(user, "You switch \the [src] [on ? "on" : "off"].")
-/obj/item/suit_cooling_unit/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/item/suit_cooling_unit/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item))
if(cover_open)
cover_open = 0
to_chat(user, "You screw the panel into place.")
@@ -117,14 +117,14 @@
update_icon()
return TRUE
- if (istype(W, /obj/item/cell))
+ if (istype(used_item, /obj/item/cell))
if(cover_open)
if(cell)
to_chat(user, "There is a [cell] already installed here.")
else
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- cell = W
+ cell = used_item
to_chat(user, "You insert \the [cell].")
update_icon()
return TRUE
diff --git a/code/game/objects/items/devices/tape_recorder/magnetic_tape.dm b/code/game/objects/items/devices/tape_recorder/magnetic_tape.dm
new file mode 100644
index 000000000000..26d5cdf79b36
--- /dev/null
+++ b/code/game/objects/items/devices/tape_recorder/magnetic_tape.dm
@@ -0,0 +1,176 @@
+/obj/item/magnetic_tape
+ name = "tape"
+ desc = "A magnetic tape that can hold up to ten minutes of content."
+ icon = 'icons/obj/items/device/tape_recorder/tape_casette_white.dmi'
+ icon_state = ICON_STATE_WORLD
+ w_class = ITEM_SIZE_SMALL
+ material = /decl/material/solid/organic/plastic
+ matter = list(
+ /decl/material/solid/metal/steel = MATTER_AMOUNT_REINFORCEMENT,
+ /decl/material/solid/fiberglass = MATTER_AMOUNT_TRACE
+ )
+ _base_attack_force = 1
+ var/max_capacity = 600
+ var/used_capacity = 0
+ var/list/storedinfo = new/list()
+ var/list/timestamp = new/list()
+ var/ruined = FALSE
+ var/doctored = FALSE
+ /// Whether we draw the ruined ribbon overlay when ruined.
+ var/draw_ribbon_if_ruined = TRUE
+
+/obj/item/magnetic_tape/on_update_icon()
+ . = ..()
+ icon_state = get_world_inventory_state()
+ if(draw_ribbon_if_ruined && ruined && max_capacity)
+ add_overlay(overlay_image(icon, "[icon_state]_ribbonoverlay", flags = RESET_COLOR))
+
+/obj/item/magnetic_tape/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
+ ruin()
+ return ..()
+
+/obj/item/magnetic_tape/attack_self(mob/user)
+ if(!ruined)
+ to_chat(user, SPAN_NOTICE("You pull out all the tape!"))
+ get_loose_tape(user, length(storedinfo))
+ ruin()
+
+
+/obj/item/magnetic_tape/proc/ruin()
+ ruined = TRUE
+ update_icon()
+
+
+/obj/item/magnetic_tape/proc/fix()
+ ruined = FALSE
+ update_icon()
+
+
+/obj/item/magnetic_tape/proc/record_speech(text)
+ timestamp += used_capacity
+ storedinfo += "\[[time2text(used_capacity SECONDS,"mm:ss")]\] [text]"
+
+
+//shows up on the printed transcript as (Unrecognized sound)
+/obj/item/magnetic_tape/proc/record_noise(text)
+ timestamp += used_capacity
+ storedinfo += "*\[[time2text(used_capacity SECONDS,"mm:ss")]\] [text]"
+
+
+/obj/item/magnetic_tape/attackby(obj/item/used_item, mob/user, params)
+ if(user.incapacitated()) // TODO: this may not be necessary since OnClick checks before starting the attack chain
+ return TRUE
+ if(ruined && IS_SCREWDRIVER(used_item))
+ if(!max_capacity)
+ to_chat(user, SPAN_NOTICE("There is no tape left inside."))
+ return TRUE
+ to_chat(user, SPAN_NOTICE("You start winding the tape back in..."))
+ if(do_after(user, 12 SECONDS, target = src))
+ to_chat(user, SPAN_NOTICE("You wound the tape back in."))
+ fix()
+ return TRUE
+ else if(IS_PEN(used_item))
+ if(loc == user)
+ var/new_name = input(user, "What would you like to label the tape?", "Tape labeling") as null|text
+ if(isnull(new_name)) return TRUE
+ new_name = sanitize_safe(new_name)
+ if(new_name)
+ SetName("tape - '[new_name]'")
+ to_chat(user, SPAN_NOTICE("You label the tape '[new_name]'."))
+ else
+ SetName("tape")
+ to_chat(user, SPAN_NOTICE("You scratch off the label."))
+ return TRUE
+ else if(IS_WIRECUTTER(used_item))
+ cut(user)
+ return TRUE
+ else if(istype(used_item, /obj/item/magnetic_tape/loose))
+ join(user, used_item)
+ return TRUE
+ return ..()
+
+/obj/item/magnetic_tape/proc/cut(mob/user)
+ if(!LAZYLEN(timestamp))
+ to_chat(user, SPAN_NOTICE("There's nothing on this tape!"))
+ return
+ var/list/output = list("")
+ for(var/i in 1 to length(timestamp))
+ var/time = "\[[time2text(timestamp[i] SECONDS,"mm:ss")]\]"
+ output += "[time]
-----CUT------
"
+ output += ""
+
+ var/datum/browser/popup = new(user, "tape_cutting", "Cutting tape", 170, 600)
+ popup.set_content(jointext(output,null))
+ popup.open()
+
+/obj/item/magnetic_tape/proc/join(mob/user, obj/item/magnetic_tape/other)
+ if(max_capacity + other.max_capacity > initial(max_capacity))
+ to_chat(user, SPAN_NOTICE("You can't fit this much tape in!"))
+ return
+ if(user.try_unequip(other))
+ to_chat(user, SPAN_NOTICE("You join ends of the tape together."))
+ max_capacity += other.max_capacity
+ used_capacity = min(used_capacity + other.used_capacity, max_capacity)
+ timestamp += other.timestamp
+ storedinfo += other.storedinfo
+ doctored = TRUE
+ ruin()
+ update_icon()
+ qdel(other)
+
+/obj/item/magnetic_tape/OnTopic(var/mob/user, var/list/href_list)
+ if(href_list["cut_after"])
+ var/index = text2num(href_list["cut_after"])
+ if(index >= length(timestamp))
+ return
+
+ to_chat(user, SPAN_NOTICE("You remove part of the tape."))
+ get_loose_tape(user, index)
+ cut(user)
+ return TOPIC_REFRESH
+
+//Spawns new loose tape item, with data starting from [index] entry
+/obj/item/magnetic_tape/proc/get_loose_tape(var/mob/user, var/index)
+ var/obj/item/magnetic_tape/loose/newtape = new()
+ newtape.timestamp = timestamp.Copy(index+1)
+ newtape.storedinfo = storedinfo.Copy(index+1)
+ newtape.max_capacity = max_capacity - index
+ newtape.used_capacity = max(0, used_capacity - max_capacity)
+ newtape.doctored = doctored
+ user.put_in_hands(newtape)
+
+ timestamp.Cut(index+1)
+ storedinfo.Cut(index+1)
+ max_capacity = index
+ used_capacity = min(used_capacity,index)
+
+//Random colour tapes
+/obj/item/magnetic_tape/random/Initialize()
+ icon = pick(list(
+ 'icons/obj/items/device/tape_recorder/tape_casette_white.dmi',
+ 'icons/obj/items/device/tape_recorder/tape_casette_blue.dmi',
+ 'icons/obj/items/device/tape_recorder/tape_casette_red.dmi',
+ 'icons/obj/items/device/tape_recorder/tape_casette_yellow.dmi',
+ 'icons/obj/items/device/tape_recorder/tape_casette_purple.dmi'
+ ))
+ . = ..()
+
+/obj/item/magnetic_tape/loose
+ name = "magnetic tape"
+ desc = "Quantum-enriched self-repairing nanotape, used for magnetic storage of information."
+ icon = 'icons/obj/items/device/tape_recorder/tape_casette_loose.dmi'
+ ruined = TRUE
+ draw_ribbon_if_ruined = FALSE
+
+/obj/item/magnetic_tape/loose/fix()
+ return
+
+/obj/item/magnetic_tape/loose/get_loose_tape()
+ return
+
+/obj/item/magnetic_tape/loose/get_examine_strings(mob/user, distance, infix, suffix)
+ . = ..()
+ if(distance <= 1)
+ . += SPAN_NOTICE("It looks long enough to hold [max_capacity] seconds worth of recording.")
+ if(doctored && user.skill_check(SKILL_FORENSICS, SKILL_PROF))
+ . += SPAN_WARNING("It has been tampered with...")
diff --git a/code/game/objects/items/devices/tape_recorder/tape_recorder.dm b/code/game/objects/items/devices/tape_recorder/tape_recorder.dm
new file mode 100644
index 000000000000..7677f30a1dc0
--- /dev/null
+++ b/code/game/objects/items/devices/tape_recorder/tape_recorder.dm
@@ -0,0 +1,360 @@
+/obj/item/taperecorder
+ name = "universal recorder"
+ desc = "A device that can record to cassette tapes, and play them. It automatically translates the content in playback."
+ icon = 'icons/obj/items/device/tape_recorder/tape_recorder.dmi'
+ icon_state = ICON_STATE_WORLD
+ w_class = ITEM_SIZE_SMALL
+ material = /decl/material/solid/metal/aluminium
+ matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT)
+ obj_flags = OBJ_FLAG_CONDUCTIBLE
+ slot_flags = SLOT_LOWER_BODY
+ throw_speed = 4
+ throw_range = 20
+
+ var/emagged = FALSE
+ var/recording = FALSE
+ var/playing = FALSE
+ var/playsleepseconds = 0
+ var/obj/item/magnetic_tape/mytape = /obj/item/magnetic_tape/random
+ var/const/TRANSCRIPT_PRINT_COOLDOWN = 5 MINUTES
+ /// (FLOAT) The minimum world.time before a transcript can be printed again.
+ var/next_print_time = 0
+ var/datum/wires/taperecorder/wires = null // Wires datum
+ /// (BOOL) If TRUE, wire datum is accessible for interactions.
+ var/wires_accessible = FALSE
+
+/obj/item/taperecorder/Initialize()
+ . = ..()
+ wires = new(src)
+ if(ispath(mytape))
+ mytape = new mytape(src)
+ global.listening_objects += src
+ update_icon()
+
+/obj/item/taperecorder/empty
+ mytape = null
+
+/obj/item/taperecorder/Destroy()
+ QDEL_NULL(wires)
+ QDEL_NULL(mytape)
+ return ..()
+
+/obj/item/taperecorder/attackby(obj/item/used_item, mob/user, params)
+ if(IS_SCREWDRIVER(used_item))
+ wires_accessible = !wires_accessible
+ to_chat(user, SPAN_NOTICE("You [wires_accessible ? "open" : "secure"] the lid."))
+ return TRUE
+ if(istype(used_item, /obj/item/magnetic_tape))
+ if(mytape)
+ to_chat(user, SPAN_NOTICE("There's already a tape inside."))
+ return TRUE
+ if(!user.try_unequip(used_item))
+ return TRUE
+ used_item.forceMove(src)
+ mytape = used_item
+ to_chat(user, SPAN_NOTICE("You insert [used_item] into [src]."))
+ update_icon()
+ return TRUE
+ return ..()
+
+
+/obj/item/taperecorder/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
+ if(mytape)
+ mytape.ruin() //Fires destroy the tape
+ return ..()
+
+
+/obj/item/taperecorder/attack_hand(mob/user)
+ if(user.is_holding_offhand(src) && mytape && user.check_dexterity(DEXTERITY_SIMPLE_MACHINES))
+ eject()
+ return TRUE
+ return ..()
+
+
+/obj/item/taperecorder/verb/eject()
+ set name = "Eject Tape"
+ set category = "Object"
+
+ if(usr.incapacitated())
+ return
+ if(!mytape)
+ to_chat(usr, SPAN_NOTICE("There's no tape in \the [src]."))
+ return
+ if(emagged)
+ to_chat(usr, SPAN_NOTICE("The tape seems to be stuck inside."))
+ return
+
+ if(playing || recording)
+ stop()
+ to_chat(usr, SPAN_NOTICE("You remove [mytape] from [src]."))
+ usr.put_in_hands(mytape)
+ mytape = null
+ update_icon()
+
+/obj/item/taperecorder/get_examine_strings(mob/user, distance, infix, suffix)
+ . = ..()
+ if(distance <= 1 && wires_accessible)
+ . += SPAN_NOTICE("The wires are exposed.")
+
+/obj/item/taperecorder/hear_talk(mob/living/M, msg, var/verb="says", decl/language/speaking=null)
+ if(mytape && recording)
+
+ if(speaking)
+ if(!speaking.machine_understands)
+ msg = speaking.scramble(M, msg)
+ mytape.record_speech("[M.name] [speaking.format_message_plain(msg, verb)]")
+ else
+ mytape.record_speech("[M.name] [verb], \"[msg]\"")
+
+/obj/item/taperecorder/show_message(msg, type, alt, alt_type)
+ var/recordedtext
+ if (msg && type == AUDIBLE_MESSAGE) //must be hearable
+ recordedtext = msg
+ else if (alt && alt_type == AUDIBLE_MESSAGE)
+ recordedtext = alt
+ else
+ return
+ if(mytape && recording)
+ mytape.record_noise("[strip_html_properly(recordedtext)]")
+
+/obj/item/taperecorder/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
+ emagged = TRUE
+ recording = FALSE
+ to_chat(user, SPAN_WARNING("PZZTTPFFFT"))
+ update_icon()
+ return 1
+ else
+ to_chat(user, SPAN_WARNING("It is already emagged!"))
+
+/obj/item/taperecorder/proc/explode()
+ var/turf/T = get_turf(loc)
+ if(ismob(loc))
+ var/mob/M = loc
+ to_chat(M, SPAN_DANGER("\The [src] explodes!"))
+ if(T)
+ T.hotspot_expose(700,125)
+ explosion(T, -1, -1, 0, 4)
+ qdel(src)
+ return
+
+/obj/item/taperecorder/verb/record()
+ set name = "Start Recording"
+ set category = "Object"
+
+ if(usr.incapacitated())
+ return
+ playsound(src, 'sound/machines/click.ogg', 10, 1)
+ if(!mytape)
+ to_chat(usr, SPAN_NOTICE("There's no tape!"))
+ return
+ if(mytape.ruined || emagged)
+ audible_message(SPAN_WARNING("The tape recorder makes a scratchy noise."))
+ return
+ if(recording)
+ to_chat(usr, SPAN_NOTICE("You're already recording!"))
+ return
+ if(playing)
+ to_chat(usr, SPAN_NOTICE("You can't record when playing!"))
+ return
+ if(mytape.used_capacity < mytape.max_capacity)
+ to_chat(usr, SPAN_NOTICE("Recording started."))
+ recording = TRUE
+ update_icon()
+
+ mytape.record_speech("Recording started.")
+
+ //count seconds until full, or recording is stopped
+ while(mytape && recording && mytape.used_capacity < mytape.max_capacity)
+ sleep(1 SECOND)
+ mytape.used_capacity++
+ if(mytape.used_capacity >= mytape.max_capacity)
+ to_chat(usr, SPAN_NOTICE("The tape is full."))
+ stop_recording()
+
+
+ update_icon()
+ return
+ else
+ to_chat(usr, SPAN_NOTICE("The tape is full."))
+
+
+/obj/item/taperecorder/proc/stop_recording()
+ //Sanity checks skipped, should not be called unless actually recording
+ recording = FALSE
+ update_icon()
+ mytape.record_speech("Recording stopped.")
+ if(ismob(loc))
+ var/mob/M = loc
+ to_chat(M, SPAN_NOTICE("Recording stopped."))
+
+
+/obj/item/taperecorder/verb/stop()
+ set name = "Stop"
+ set category = "Object"
+
+ if(usr.incapacitated())
+ return
+ playsound(src, 'sound/machines/click.ogg', 10, 1)
+ if(recording)
+ stop_recording()
+ return
+ else if(playing)
+ playing = FALSE
+ update_icon()
+ to_chat(usr, SPAN_NOTICE("Playback stopped."))
+ return
+ else
+ to_chat(usr, SPAN_NOTICE("Stop what?"))
+
+
+/obj/item/taperecorder/verb/wipe_tape()
+ set name = "Wipe Tape"
+ set category = "Object"
+
+ if(usr.incapacitated())
+ return
+ if(!mytape)
+ return
+ if(emagged || mytape.ruined)
+ audible_message(SPAN_WARNING("The tape recorder makes a scratchy noise."))
+ return
+ if(recording || playing)
+ to_chat(usr, SPAN_NOTICE("You can't wipe the tape while playing or recording!"))
+ return
+ else
+ if(mytape.storedinfo) mytape.storedinfo.Cut()
+ if(mytape.timestamp) mytape.timestamp.Cut()
+ mytape.used_capacity = 0
+ to_chat(usr, SPAN_NOTICE("You wipe the tape."))
+ return
+
+
+/obj/item/taperecorder/verb/playback_memory()
+ set name = "Playback Tape"
+ set category = "Object"
+
+ if(usr.incapacitated())
+ return
+ play(usr)
+
+/obj/item/taperecorder/proc/play(mob/user)
+ if(!mytape)
+ to_chat(user, SPAN_NOTICE("There's no tape!"))
+ return
+ if(mytape.ruined)
+ audible_message(SPAN_WARNING("The tape recorder makes a scratchy noise."))
+ return
+ if(recording)
+ to_chat(user, SPAN_NOTICE("You can't playback when recording!"))
+ return
+ if(playing)
+ to_chat(user, SPAN_NOTICE("\The [src] is already playing its recording!"))
+ return
+ playing = TRUE
+ update_icon()
+ to_chat(user, SPAN_NOTICE("Audio playback started."))
+ playsound(src, 'sound/machines/click.ogg', 10, 1)
+ for(var/i=1 , i < mytape.max_capacity , i++)
+ if(!mytape || !playing)
+ break
+ if(length(mytape.storedinfo) < i)
+ break
+
+ var/turf/T = get_turf(src)
+ var/playedmessage = mytape.storedinfo[i]
+ if (findtextEx(playedmessage,"*",1,2)) //remove marker for action sounds
+ playedmessage = copytext(playedmessage,2)
+ T.audible_message(SPAN_MAROON("Tape Recorder: [playedmessage]"))
+
+ if(length(mytape.storedinfo) < i+1)
+ playsleepseconds = 1
+ sleep(10)
+ T = get_turf(src)
+ T.audible_message(SPAN_MAROON("Tape Recorder: End of recording."))
+ playsound(src, 'sound/machines/click.ogg', 10, 1)
+ break
+ else
+ playsleepseconds = mytape.timestamp[i+1] - mytape.timestamp[i]
+
+ if(playsleepseconds > 14)
+ sleep(10)
+ T = get_turf(src)
+ T.audible_message(SPAN_MAROON("Tape Recorder: Skipping [playsleepseconds] seconds of silence"))
+ playsleepseconds = 1
+ sleep(playsleepseconds SECONDS)
+
+
+ playing = FALSE
+ update_icon()
+
+ if(emagged)
+ var/turf/T = get_turf(src)
+ T.audible_message(SPAN_MAROON("Tape Recorder: This tape recorder will self-destruct in... Five."))
+ sleep(10)
+ T = get_turf(src)
+ T.audible_message(SPAN_MAROON("Tape Recorder: Four."))
+ sleep(10)
+ T = get_turf(src)
+ T.audible_message(SPAN_MAROON("Tape Recorder: Three."))
+ sleep(10)
+ T = get_turf(src)
+ T.audible_message(SPAN_MAROON("Tape Recorder: Two."))
+ sleep(10)
+ T = get_turf(src)
+ T.audible_message(SPAN_MAROON("Tape Recorder: One."))
+ sleep(10)
+ explode()
+
+
+/obj/item/taperecorder/verb/print_transcript()
+ set name = "Print Transcript"
+ set category = "Object"
+
+ if(usr.incapacitated())
+ return
+ if(!mytape)
+ to_chat(usr, SPAN_NOTICE("There's no tape!"))
+ return
+ if(mytape.ruined || emagged)
+ audible_message(SPAN_WARNING("The tape recorder makes a scratchy noise."))
+ return
+ if(next_print_time < world.time)
+ to_chat(usr, SPAN_NOTICE("The recorder can't print that fast!"))
+ return
+ if(recording || playing)
+ to_chat(usr, SPAN_NOTICE("You can't print the transcript while playing or recording!"))
+ return
+
+ to_chat(usr, SPAN_NOTICE("Transcript printed."))
+ var/obj/item/paper/P = new /obj/item/paper(get_turf(src))
+ var/t1 = "Transcript:
"
+ for(var/i in 1 to length(mytape.storedinfo))
+ var/printedmessage = mytape.storedinfo[i]
+ if (findtextEx(printedmessage,"*",1,2)) //replace action sounds
+ printedmessage = "\[[time2text(mytape.timestamp[i]*10,"mm:ss")]\] (Unrecognized sound)"
+ t1 += "[printedmessage]
"
+ P.info = t1
+ P.SetName("Transcript")
+ next_print_time = world.time + TRANSCRIPT_PRINT_COOLDOWN
+
+/obj/item/taperecorder/attack_self(mob/user)
+ if(wires_accessible)
+ wires.Interact(user)
+ return
+ if(recording || playing)
+ stop()
+ else
+ record()
+
+/obj/item/taperecorder/on_update_icon()
+ . = ..()
+ icon_state = get_world_inventory_state()
+ if(!mytape)
+ icon_state = "[icon_state]_empty"
+ else if(recording)
+ icon_state = "[icon_state]_recording"
+ else if(playing)
+ icon_state = "[icon_state]_playing"
+ else
+ icon_state = "[icon_state]_idle"
diff --git a/code/datums/wires/taperecorder.dm b/code/game/objects/items/devices/tape_recorder/taperecorder_wires.dm
similarity index 90%
rename from code/datums/wires/taperecorder.dm
rename to code/game/objects/items/devices/tape_recorder/taperecorder_wires.dm
index 784cd1a17df1..20e4bd7f63fa 100644
--- a/code/datums/wires/taperecorder.dm
+++ b/code/game/objects/items/devices/tape_recorder/taperecorder_wires.dm
@@ -4,8 +4,7 @@
descriptions = list(
new /datum/wire_description(TAPE_WIRE_TOGGLE, "This wire runs to the play/stop toggle.", SKILL_ADEPT)
)
-
-var/global/const/TAPE_WIRE_TOGGLE = 1
+ var/const/TAPE_WIRE_TOGGLE = 1
/datum/wires/taperecorder/UpdatePulsed(var/index)
var/obj/item/taperecorder/T = holder
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
deleted file mode 100644
index 54ecd2dfd4ef..000000000000
--- a/code/game/objects/items/devices/taperecorder.dm
+++ /dev/null
@@ -1,540 +0,0 @@
-/obj/item/taperecorder
- name = "universal recorder"
- desc = "A device that can record to cassette tapes, and play them. It automatically translates the content in playback."
- icon = 'icons/obj/items/device/tape_recorder/tape_recorder.dmi'
- icon_state = ICON_STATE_WORLD
- w_class = ITEM_SIZE_SMALL
- material = /decl/material/solid/metal/aluminium
- matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT)
- obj_flags = OBJ_FLAG_CONDUCTIBLE
- slot_flags = SLOT_LOWER_BODY
- throw_speed = 4
- throw_range = 20
-
- var/emagged = 0.0
- var/recording = 0.0
- var/playing = 0.0
- var/playsleepseconds = 0.0
- var/obj/item/magnetic_tape/mytape = /obj/item/magnetic_tape/random
- var/canprint = 1
- var/datum/wires/taperecorder/wires = null // Wires datum
- var/maintenance = 0
-
-/obj/item/taperecorder/Initialize()
- . = ..()
- wires = new(src)
- if(ispath(mytape))
- mytape = new mytape(src)
- global.listening_objects += src
- update_icon()
-
-/obj/item/taperecorder/empty
- mytape = null
-
-/obj/item/taperecorder/Destroy()
- QDEL_NULL(wires)
- if(mytape)
- qdel(mytape)
- mytape = null
- return ..()
-
-/obj/item/taperecorder/attackby(obj/item/I, mob/user, params)
- if(IS_SCREWDRIVER(I))
- maintenance = !maintenance
- to_chat(user, "You [maintenance ? "open" : "secure"] the lid.")
- return TRUE
- if(istype(I, /obj/item/magnetic_tape))
- if(mytape)
- to_chat(user, "There's already a tape inside.")
- return TRUE
- if(!user.try_unequip(I))
- return TRUE
- I.forceMove(src)
- mytape = I
- to_chat(user, "You insert [I] into [src].")
- update_icon()
- return TRUE
- return ..()
-
-
-/obj/item/taperecorder/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
- if(mytape)
- mytape.ruin() //Fires destroy the tape
- return ..()
-
-
-/obj/item/taperecorder/attack_hand(mob/user)
- if(user.is_holding_offhand(src) && mytape && user.check_dexterity(DEXTERITY_SIMPLE_MACHINES))
- eject()
- return TRUE
- return ..()
-
-
-/obj/item/taperecorder/verb/eject()
- set name = "Eject Tape"
- set category = "Object"
-
- if(usr.incapacitated())
- return
- if(!mytape)
- to_chat(usr, "There's no tape in \the [src].")
- return
- if(emagged)
- to_chat(usr, "The tape seems to be stuck inside.")
- return
-
- if(playing || recording)
- stop()
- to_chat(usr, "You remove [mytape] from [src].")
- usr.put_in_hands(mytape)
- mytape = null
- update_icon()
-
-/obj/item/taperecorder/get_examine_strings(mob/user, distance, infix, suffix)
- . = ..()
- if(distance <= 1 && maintenance)
- . += SPAN_NOTICE("The wires are exposed.")
-
-/obj/item/taperecorder/hear_talk(mob/living/M, msg, var/verb="says", decl/language/speaking=null)
- if(mytape && recording)
-
- if(speaking)
- if(!speaking.machine_understands)
- msg = speaking.scramble(M, msg)
- mytape.record_speech("[M.name] [speaking.format_message_plain(msg, verb)]")
- else
- mytape.record_speech("[M.name] [verb], \"[msg]\"")
-
-/obj/item/taperecorder/show_message(msg, type, alt, alt_type)
- var/recordedtext
- if (msg && type == AUDIBLE_MESSAGE) //must be hearable
- recordedtext = msg
- else if (alt && alt_type == AUDIBLE_MESSAGE)
- recordedtext = alt
- else
- return
- if(mytape && recording)
- mytape.record_noise("[strip_html_properly(recordedtext)]")
-
-/obj/item/taperecorder/emag_act(var/remaining_charges, var/mob/user)
- if(emagged == 0)
- emagged = 1
- recording = 0
- to_chat(user, "PZZTTPFFFT")
- update_icon()
- return 1
- else
- to_chat(user, "It is already emagged!")
-
-/obj/item/taperecorder/proc/explode()
- var/turf/T = get_turf(loc)
- if(ismob(loc))
- var/mob/M = loc
- to_chat(M, "\The [src] explodes!")
- if(T)
- T.hotspot_expose(700,125)
- explosion(T, -1, -1, 0, 4)
- qdel(src)
- return
-
-/obj/item/taperecorder/verb/record()
- set name = "Start Recording"
- set category = "Object"
-
- if(usr.incapacitated())
- return
- playsound(src, 'sound/machines/click.ogg', 10, 1)
- if(!mytape)
- to_chat(usr, "There's no tape!")
- return
- if(mytape.ruined || emagged)
- audible_message("The tape recorder makes a scratchy noise.")
- return
- if(recording)
- to_chat(usr, "You're already recording!")
- return
- if(playing)
- to_chat(usr, "You can't record when playing!")
- return
- if(mytape.used_capacity < mytape.max_capacity)
- to_chat(usr, "Recording started.")
- recording = 1
- update_icon()
-
- mytape.record_speech("Recording started.")
-
- //count seconds until full, or recording is stopped
- while(mytape && recording && mytape.used_capacity < mytape.max_capacity)
- sleep(10)
- mytape.used_capacity++
- if(mytape.used_capacity >= mytape.max_capacity)
- if(ismob(loc))
- var/mob/M = loc
- to_chat(M, "The tape is full.")
- stop_recording()
-
-
- update_icon()
- return
- else
- to_chat(usr, "The tape is full.")
-
-
-/obj/item/taperecorder/proc/stop_recording()
- //Sanity checks skipped, should not be called unless actually recording
- recording = 0
- update_icon()
- mytape.record_speech("Recording stopped.")
- if(ismob(loc))
- var/mob/M = loc
- to_chat(M, "Recording stopped.")
-
-
-/obj/item/taperecorder/verb/stop()
- set name = "Stop"
- set category = "Object"
-
- if(usr.incapacitated())
- return
- playsound(src, 'sound/machines/click.ogg', 10, 1)
- if(recording)
- stop_recording()
- return
- else if(playing)
- playing = 0
- update_icon()
- to_chat(usr, "Playback stopped.")
- return
- else
- to_chat(usr, "Stop what?")
-
-
-/obj/item/taperecorder/verb/wipe_tape()
- set name = "Wipe Tape"
- set category = "Object"
-
- if(usr.incapacitated())
- return
- if(!mytape)
- return
- if(emagged || mytape.ruined)
- audible_message("The tape recorder makes a scratchy noise.")
- return
- if(recording || playing)
- to_chat(usr, "You can't wipe the tape while playing or recording!")
- return
- else
- if(mytape.storedinfo) mytape.storedinfo.Cut()
- if(mytape.timestamp) mytape.timestamp.Cut()
- mytape.used_capacity = 0
- to_chat(usr, "You wipe the tape.")
- return
-
-
-/obj/item/taperecorder/verb/playback_memory()
- set name = "Playback Tape"
- set category = "Object"
-
- if(usr.incapacitated())
- return
- play(usr)
-
-/obj/item/taperecorder/proc/play(mob/user)
- if(!mytape)
- to_chat(user, "There's no tape!")
- return
- if(mytape.ruined)
- audible_message("The tape recorder makes a scratchy noise.")
- return
- if(recording)
- to_chat(user, "You can't playback when recording!")
- return
- if(playing)
- to_chat(user, "You're already playing!")
- return
- playing = 1
- update_icon()
- to_chat(user, "Audio playback started.")
- playsound(src, 'sound/machines/click.ogg', 10, 1)
- for(var/i=1 , i < mytape.max_capacity , i++)
- if(!mytape || !playing)
- break
- if(mytape.storedinfo.len < i)
- break
-
- var/turf/T = get_turf(src)
- var/playedmessage = mytape.storedinfo[i]
- if (findtextEx(playedmessage,"*",1,2)) //remove marker for action sounds
- playedmessage = copytext(playedmessage,2)
- T.audible_message(SPAN_MAROON("Tape Recorder: [playedmessage]"))
-
- if(mytape.storedinfo.len < i+1)
- playsleepseconds = 1
- sleep(10)
- T = get_turf(src)
- T.audible_message(SPAN_MAROON("Tape Recorder: End of recording."))
- playsound(src, 'sound/machines/click.ogg', 10, 1)
- break
- else
- playsleepseconds = mytape.timestamp[i+1] - mytape.timestamp[i]
-
- if(playsleepseconds > 14)
- sleep(10)
- T = get_turf(src)
- T.audible_message(SPAN_MAROON("Tape Recorder: Skipping [playsleepseconds] seconds of silence"))
- playsleepseconds = 1
- sleep(10 * playsleepseconds)
-
-
- playing = 0
- update_icon()
-
- if(emagged)
- var/turf/T = get_turf(src)
- T.audible_message(SPAN_MAROON("Tape Recorder: This tape recorder will self-destruct in... Five."))
- sleep(10)
- T = get_turf(src)
- T.audible_message(SPAN_MAROON("Tape Recorder: Four."))
- sleep(10)
- T = get_turf(src)
- T.audible_message(SPAN_MAROON("Tape Recorder: Three."))
- sleep(10)
- T = get_turf(src)
- T.audible_message(SPAN_MAROON("Tape Recorder: Two."))
- sleep(10)
- T = get_turf(src)
- T.audible_message(SPAN_MAROON("Tape Recorder: One."))
- sleep(10)
- explode()
-
-
-/obj/item/taperecorder/verb/print_transcript()
- set name = "Print Transcript"
- set category = "Object"
-
- if(usr.incapacitated())
- return
- if(!mytape)
- to_chat(usr, "There's no tape!")
- return
- if(mytape.ruined || emagged)
- audible_message("The tape recorder makes a scratchy noise.")
- return
- if(!canprint)
- to_chat(usr, "The recorder can't print that fast!")
- return
- if(recording || playing)
- to_chat(usr, "You can't print the transcript while playing or recording!")
- return
-
- to_chat(usr, "Transcript printed.")
- var/obj/item/paper/P = new /obj/item/paper(get_turf(src))
- var/t1 = "Transcript:
"
- for(var/i=1,mytape.storedinfo.len >= i,i++)
- var/printedmessage = mytape.storedinfo[i]
- if (findtextEx(printedmessage,"*",1,2)) //replace action sounds
- printedmessage = "\[[time2text(mytape.timestamp[i]*10,"mm:ss")]\] (Unrecognized sound)"
- t1 += "[printedmessage]
"
- P.info = t1
- P.SetName("Transcript")
- canprint = 0
- sleep(300)
- canprint = 1
-
-/obj/item/taperecorder/attack_self(mob/user)
- if(maintenance)
- wires.Interact(user)
- return
- if(recording || playing)
- stop()
- else
- record()
-
-/obj/item/taperecorder/on_update_icon()
- . = ..()
- icon_state = get_world_inventory_state()
- if(!mytape)
- icon_state = "[icon_state]_empty"
- else if(recording)
- icon_state = "[icon_state]_recording"
- else if(playing)
- icon_state = "[icon_state]_playing"
- else
- icon_state = "[icon_state]_idle"
-
-/obj/item/magnetic_tape
- name = "tape"
- desc = "A magnetic tape that can hold up to ten minutes of content."
- icon = 'icons/obj/items/device/tape_recorder/tape_casette_white.dmi'
- icon_state = ICON_STATE_WORLD
- w_class = ITEM_SIZE_SMALL
- material = /decl/material/solid/organic/plastic
- matter = list(
- /decl/material/solid/metal/steel = MATTER_AMOUNT_REINFORCEMENT,
- /decl/material/solid/fiberglass = MATTER_AMOUNT_TRACE
- )
- _base_attack_force = 1
- var/max_capacity = 600
- var/used_capacity = 0
- var/list/storedinfo = new/list()
- var/list/timestamp = new/list()
- var/ruined = 0
- var/doctored = 0
- /// Whether we draw the ruined ribbon overlay when ruined.
- var/draw_ribbon_if_ruined = TRUE
-
-/obj/item/magnetic_tape/on_update_icon()
- . = ..()
- icon_state = get_world_inventory_state()
- if(draw_ribbon_if_ruined && ruined && max_capacity)
- add_overlay(overlay_image(icon, "[icon_state]_ribbonoverlay", flags = RESET_COLOR))
-
-/obj/item/magnetic_tape/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
- ruin()
- return ..()
-
-/obj/item/magnetic_tape/attack_self(mob/user)
- if(!ruined)
- to_chat(user, "You pull out all the tape!")
- get_loose_tape(user, storedinfo.len)
- ruin()
-
-
-/obj/item/magnetic_tape/proc/ruin()
- ruined = TRUE
- update_icon()
-
-
-/obj/item/magnetic_tape/proc/fix()
- ruined = FALSE
- update_icon()
-
-
-/obj/item/magnetic_tape/proc/record_speech(text)
- timestamp += used_capacity
- storedinfo += "\[[time2text(used_capacity*10,"mm:ss")]\] [text]"
-
-
-//shows up on the printed transcript as (Unrecognized sound)
-/obj/item/magnetic_tape/proc/record_noise(text)
- timestamp += used_capacity
- storedinfo += "*\[[time2text(used_capacity*10,"mm:ss")]\] [text]"
-
-
-/obj/item/magnetic_tape/attackby(obj/item/I, mob/user, params)
- if(user.incapacitated()) // TODO: this may not be necessary since OnClick checks before starting the attack chain
- return TRUE
- if(ruined && IS_SCREWDRIVER(I))
- if(!max_capacity)
- to_chat(user, "There is no tape left inside.")
- return TRUE
- to_chat(user, "You start winding the tape back in...")
- if(do_after(user, 120, target = src))
- to_chat(user, "You wound the tape back in.")
- fix()
- return TRUE
- else if(IS_PEN(I))
- if(loc == user)
- var/new_name = input(user, "What would you like to label the tape?", "Tape labeling") as null|text
- if(isnull(new_name)) return TRUE
- new_name = sanitize_safe(new_name)
- if(new_name)
- SetName("tape - '[new_name]'")
- to_chat(user, "You label the tape '[new_name]'.")
- else
- SetName("tape")
- to_chat(user, "You scratch off the label.")
- return TRUE
- else if(IS_WIRECUTTER(I))
- cut(user)
- return TRUE
- else if(istype(I, /obj/item/magnetic_tape/loose))
- join(user, I)
- return TRUE
- return ..()
-
-/obj/item/magnetic_tape/proc/cut(mob/user)
- if(!LAZYLEN(timestamp))
- to_chat(user, "There's nothing on this tape!")
- return
- var/list/output = list("")
- for(var/i=1, i < timestamp.len, i++)
- var/time = "\[[time2text(timestamp[i]*10,"mm:ss")]\]"
- output += "[time]
-----CUT------
"
- output += ""
-
- var/datum/browser/popup = new(user, "tape_cutting", "Cutting tape", 170, 600)
- popup.set_content(jointext(output,null))
- popup.open()
-
-/obj/item/magnetic_tape/proc/join(mob/user, obj/item/magnetic_tape/other)
- if(max_capacity + other.max_capacity > initial(max_capacity))
- to_chat(user, "You can't fit this much tape in!")
- return
- if(user.try_unequip(other))
- to_chat(user, "You join ends of the tape together.")
- max_capacity += other.max_capacity
- used_capacity = min(used_capacity + other.used_capacity, max_capacity)
- timestamp += other.timestamp
- storedinfo += other.storedinfo
- doctored = 1
- ruin()
- update_icon()
- qdel(other)
-
-/obj/item/magnetic_tape/OnTopic(var/mob/user, var/list/href_list)
- if(href_list["cut_after"])
- var/index = text2num(href_list["cut_after"])
- if(index >= timestamp.len)
- return
-
- to_chat(user, "You remove part of the tape off.")
- get_loose_tape(user, index)
- cut(user)
- return TOPIC_REFRESH
-
-//Spawns new loose tape item, with data starting from [index] entry
-/obj/item/magnetic_tape/proc/get_loose_tape(var/mob/user, var/index)
- var/obj/item/magnetic_tape/loose/newtape = new()
- newtape.timestamp = timestamp.Copy(index+1)
- newtape.storedinfo = storedinfo.Copy(index+1)
- newtape.max_capacity = max_capacity - index
- newtape.used_capacity = max(0, used_capacity - max_capacity)
- newtape.doctored = doctored
- user.put_in_hands(newtape)
-
- timestamp.Cut(index+1)
- storedinfo.Cut(index+1)
- max_capacity = index
- used_capacity = min(used_capacity,index)
-
-//Random colour tapes
-/obj/item/magnetic_tape/random/Initialize()
- icon = pick(list(
- 'icons/obj/items/device/tape_recorder/tape_casette_white.dmi',
- 'icons/obj/items/device/tape_recorder/tape_casette_blue.dmi',
- 'icons/obj/items/device/tape_recorder/tape_casette_red.dmi',
- 'icons/obj/items/device/tape_recorder/tape_casette_yellow.dmi',
- 'icons/obj/items/device/tape_recorder/tape_casette_purple.dmi'
- ))
- . = ..()
-
-/obj/item/magnetic_tape/loose
- name = "magnetic tape"
- desc = "Quantum-enriched self-repairing nanotape, used for magnetic storage of information."
- icon = 'icons/obj/items/device/tape_recorder/tape_casette_loose.dmi'
- ruined = TRUE
- draw_ribbon_if_ruined = FALSE
-
-/obj/item/magnetic_tape/loose/fix()
- return
-
-/obj/item/magnetic_tape/loose/get_loose_tape()
- return
-
-/obj/item/magnetic_tape/loose/get_examine_strings(mob/user, distance, infix, suffix)
- . = ..()
- if(distance <= 1)
- . += SPAN_NOTICE("It looks long enough to hold [max_capacity] seconds worth of recording.")
- if(doctored && user.skill_check(SKILL_FORENSICS, SKILL_PROF))
- . += SPAN_WARNING("It has been tampered with...")
diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm
index 2f2506b6aa05..40f7cc830eff 100644
--- a/code/game/objects/items/devices/transfer_valve.dm
+++ b/code/game/objects/items/devices/transfer_valve.dm
@@ -28,21 +28,21 @@
attacher_ref = null
return ..()
-/obj/item/transfer_valve/attackby(obj/item/item, mob/user)
+/obj/item/transfer_valve/attackby(obj/item/used_item, mob/user)
var/turf/location = get_turf(src) // For admin logs
- if(istype(item, /obj/item/tank))
+ if(istype(used_item, /obj/item/tank))
var/T1_weight = 0
var/T2_weight = 0
if(tank_one && tank_two)
to_chat(user, "There are already two tanks attached, remove one first.")
return TRUE
- if(!user.try_unequip(item, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
if(!tank_one)
- tank_one = item
+ tank_one = used_item
else
- tank_two = item
+ tank_two = used_item
message_admins("[key_name_admin(user)] attached both tanks to a transfer valve. (JMP)")
log_game("[key_name_admin(user)] attached both tanks to a transfer valve.")
to_chat(user, "You attach the tank to the transfer valve.")
@@ -54,24 +54,24 @@
src.w_class = max(initial(src.w_class),T1_weight,T2_weight) //gets w_class of biggest object, because you shouldn't be able to just shove tanks in and have them be tiny.
. = TRUE
//TODO: Have this take an assemblyholder
- else if(isassembly(item))
- var/obj/item/assembly/A = item
+ else if(isassembly(used_item))
+ var/obj/item/assembly/A = used_item
if(A.secured)
to_chat(user, "The device is secured.")
return TRUE
if(attached_device)
to_chat(user, "There is already an device attached to the valve, remove it first.")
return TRUE
- if(!user.try_unequip(item, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
attached_device = A
- to_chat(user, "You attach \the [item] to the valve controls and secure it.")
+ to_chat(user, "You attach \the [used_item] to the valve controls and secure it.")
A.holder = src
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
- global.bombers += "[key_name(user)] attached a [item] to a transfer valve."
- message_admins("[key_name_admin(user)] attached a [item] to a transfer valve. (JMP)")
- log_game("[key_name_admin(user)] attached a [item] to a transfer valve.")
+ global.bombers += "[key_name(user)] attached a [used_item] to a transfer valve."
+ message_admins("[key_name_admin(user)] attached a [used_item] to a transfer valve. (JMP)")
+ log_game("[key_name_admin(user)] attached a [used_item] to a transfer valve.")
attacher_ref = weakref(user)
. = TRUE
if(.)
diff --git a/code/game/objects/items/devices/tvcamera.dm b/code/game/objects/items/devices/tvcamera.dm
index 914286faa0f3..4450994afe0c 100644
--- a/code/game/objects/items/devices/tvcamera.dm
+++ b/code/game/objects/items/devices/tvcamera.dm
@@ -97,12 +97,13 @@
/* Assembly by a roboticist */
// TODO: Make this slapcrafting or remove tvcamera/tvassembly entirely
-/obj/item/robot_parts/head/attackby(var/obj/item/assembly/S, mob/user)
- if (!istype(S, /obj/item/assembly/infra))
+/obj/item/robot_parts/head/attackby(obj/item/used_item, mob/user)
+ var/obj/item/assembly/infra/assembly = used_item
+ if(!istype(assembly))
return ..()
- var/obj/item/TVAssembly/A = new(user)
- qdel(S)
- user.put_in_hands(A)
+ var/obj/item/TVAssembly/tv_assembly = new(user)
+ qdel(assembly)
+ user.put_in_hands(tv_assembly)
to_chat(user, "You add the infrared sensor to the robot head.")
qdel(src)
return TRUE
@@ -120,25 +121,25 @@ Using robohead because of restricting to roboticist */
material = /decl/material/solid/metal/steel
// TODO: refactor this to use slapcrafting? remove entirely?
-/obj/item/TVAssembly/attackby(var/obj/item/W, var/mob/user)
+/obj/item/TVAssembly/attackby(var/obj/item/used_item, var/mob/user)
switch(buildstep)
if(0)
- if(istype(W, /obj/item/robot_parts/robot_component/camera))
+ if(istype(used_item, /obj/item/robot_parts/robot_component/camera))
to_chat(user, "You add the camera module to [src]")
- qdel(W)
+ qdel(used_item)
desc = "This TV camera assembly has a camera module."
buildstep++
return TRUE
if(1)
- if(istype(W, /obj/item/taperecorder))
- qdel(W)
+ if(istype(used_item, /obj/item/taperecorder))
+ qdel(used_item)
buildstep++
to_chat(user, "You add the tape recorder to [src]")
desc = "This TV camera assembly has a camera and audio module."
return TRUE
if(2)
- if(IS_COIL(W))
- var/obj/item/stack/cable_coil/C = W
+ if(IS_COIL(used_item))
+ var/obj/item/stack/cable_coil/C = used_item
if(!C.use(3))
to_chat(user, "You need three cable coils to wire the devices.")
return TRUE
@@ -147,14 +148,14 @@ Using robohead because of restricting to roboticist */
desc = "This TV camera assembly has wires sticking out."
return TRUE
if(3)
- if(IS_WIRECUTTER(W))
+ if(IS_WIRECUTTER(used_item))
to_chat(user, " You trim the wires.")
buildstep++
desc = "This TV camera assembly needs casing."
return TRUE
if(4)
- if(istype(W, /obj/item/stack/material))
- var/obj/item/stack/material/S = W
+ if(istype(used_item, /obj/item/stack/material))
+ var/obj/item/stack/material/S = used_item
if(S.material?.type == /decl/material/solid/metal/steel && S.use(1))
buildstep++
to_chat(user, "You encase the assembly.")
diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm
index 02f4eb078b7c..2d54bf5b1bfa 100644
--- a/code/game/objects/items/devices/uplink.dm
+++ b/code/game/objects/items/devices/uplink.dm
@@ -50,13 +50,11 @@
update_nano_data()
src.uplink_owner = owner
- world_uplinks += src
uses = telecrystals
START_PROCESSING(SSobj, src)
/obj/item/uplink/Destroy()
uplink_owner = null
- world_uplinks -= src
STOP_PROCESSING(SSobj, src)
return ..()
@@ -152,6 +150,7 @@
// The purchasing code.
/obj/item/uplink/OnTopic(user, href_list)
+ var/decl/uplink/uplink = IMPLIED_DECL
if(href_list["buy_item"])
var/datum/uplink_item/UI = (locate(href_list["buy_item"]) in uplink.items)
UI.buy(src, usr)
@@ -175,6 +174,7 @@
update_nano_data()
/obj/item/uplink/proc/update_nano_data()
+ var/decl/uplink/uplink = IMPLIED_DECL
if(nanoui_menu == 0)
var/categories[0]
for(var/datum/uplink_category/category in uplink.categories)
diff --git a/code/game/objects/items/devices/uplink_random_lists.dm b/code/game/objects/items/devices/uplink_random_lists.dm
index b0acc8d88f6a..bd97ea3283ee 100644
--- a/code/game/objects/items/devices/uplink_random_lists.dm
+++ b/code/game/objects/items/devices/uplink_random_lists.dm
@@ -4,7 +4,7 @@
var/reselect_probability // Probability that we'll decide to keep this item if previously selected.
// Is done together with the keep_probability check. Being selected more than once does not affect this probability.
-/datum/uplink_random_item/New(var/uplink_item, var/keep_probability = 100, var/reselect_propbability = 33)
+/datum/uplink_random_item/New(var/uplink_item, var/keep_probability = 100, var/reselect_probability = 33)
..()
src.uplink_item = uplink_item
src.keep_probability = keep_probability
@@ -19,19 +19,20 @@
/datum/uplink_random_selection/proc/get_random_item(var/telecrystals, obj/item/uplink/U, var/list/bought_items)
var/const/attempts = 50
+ var/decl/uplink/uplink = IMPLIED_DECL
for(var/i = 0; i < attempts; i++)
- var/datum/uplink_random_item/RI = pick(items)
- if(!prob(RI.keep_probability))
+ var/datum/uplink_random_item/random_item = pick(items)
+ if(!prob(random_item.keep_probability))
continue
- var/datum/uplink_item/I = uplink.items_assoc[RI.uplink_item]
- if(I.cost(telecrystals, U) > telecrystals)
+ var/datum/uplink_item/uplink_item = uplink.items_assoc[random_item.uplink_item]
+ if(uplink_item.cost(telecrystals, uplink) > telecrystals)
continue
- if(bought_items && (I in bought_items) && !prob(RI.reselect_probability))
+ if(bought_items && (uplink_item in bought_items) && !prob(random_item.reselect_probability))
continue
- if(U && !I.can_buy(U))
+ if(uplink && !uplink_item.can_buy(uplink))
continue
- return I
+ return uplink_item
return uplink.items_assoc[/datum/uplink_item/item/stealthy_weapons/soap]
var/global/list/uplink_random_selections_
@@ -47,7 +48,6 @@ var/global/list/uplink_random_selections_
items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/silenced)
items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/revolver)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/heavysniper, 15, 0)
items += new/datum/uplink_random_item(/datum/uplink_item/item/grenades/emp, 50)
items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/crossbow, 33)
items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/energy_sword, 75)
@@ -63,7 +63,7 @@ var/global/list/uplink_random_selections_
items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/chameleon_projector)
items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/voice)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/toolbox, reselect_propbability = 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/toolbox, reselect_probability = 10)
items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/plastique)
items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/encryptionkey_radio)
items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/encryptionkey_binary)
@@ -74,27 +74,25 @@ var/global/list/uplink_random_selections_
items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/heavy_armor)
items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/powersink, 10, 10)
items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/ai_module, 25, 0)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/teleporter, 10, 0)
items += new/datum/uplink_random_item(/datum/uplink_item/item/implants/imp_freedom)
items += new/datum/uplink_random_item(/datum/uplink_item/item/implants/imp_compress)
items += new/datum/uplink_random_item(/datum/uplink_item/item/implants/imp_explosive)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/sinpockets, reselect_propbability = 20)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/surgery, reselect_propbability = 10)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/combat, reselect_propbability = 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/sinpockets, reselect_probability = 20)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/surgery, reselect_probability = 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/combat, reselect_probability = 10)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/energy_net, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/ewar_voice, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/maneuvering_jets, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/egun, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/power_sink, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/laser_canon, reselect_propbability = 5)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_probability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/energy_net, reselect_probability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/ewar_voice, reselect_probability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/maneuvering_jets, reselect_probability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/egun, reselect_probability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/power_sink, reselect_probability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_propbability = 15)
- items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_propbability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_probability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_probability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_probability = 15)
items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/suit_sensor_mobile)
items += new/datum/uplink_random_item(/datum/uplink_item/item/services/suit_sensor_shutdown, 75, 0)
@@ -105,7 +103,6 @@ var/global/list/uplink_random_selections_
/datum/uplink_item/item/ammo,
/datum/uplink_item/item/badassery,
/datum/uplink_item/item/telecrystal,
- /datum/uplink_item/item/tools/teleporter,
/datum/uplink_item/item/tools/supply_beacon,
/datum/uplink_item/item/implants/imp_uplink,
)
@@ -121,16 +118,17 @@ var/global/list/uplink_random_selections_
var/new_thing = new/datum/uplink_random_item(uplink_item_type)
items += new_thing
-/datum/uplink_random_selection/blacklist/get_random_item(var/telecrystals, obj/item/uplink/U, var/list/bought_items)
+/datum/uplink_random_selection/blacklist/get_random_item(var/telecrystals, obj/item/uplink/uplink_access, var/list/bought_items)
var/const/attempts = 50
+ var/decl/uplink/uplink = IMPLIED_DECL
for(var/i = 0; i < attempts; i++)
- var/datum/uplink_random_item/RI = pick(items)
- if(!prob(RI.keep_probability))
+ var/datum/uplink_random_item/random_item = pick(items)
+ if(!prob(random_item.keep_probability))
continue
- var/datum/uplink_item/I = uplink.items_assoc[RI.uplink_item]
- if(I.cost(telecrystals, U) > telecrystals)
+ var/datum/uplink_item/uplink_item = uplink.items_assoc[random_item.uplink_item]
+ if(uplink_item.cost(telecrystals, uplink_access) > telecrystals)
continue
- if(bought_items && (I in bought_items) && !prob(RI.reselect_probability))
+ if(bought_items && (uplink_item in bought_items) && !prob(random_item.reselect_probability))
continue
- return I
+ return uplink_item
return uplink.items_assoc[/datum/uplink_item/item/stealthy_weapons/soap]
diff --git a/code/game/objects/items/fleece.dm b/code/game/objects/items/fleece.dm
index c787e1b21679..b6f7a4cc2807 100644
--- a/code/game/objects/items/fleece.dm
+++ b/code/game/objects/items/fleece.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/items/fleece.dmi'
icon_state = ICON_STATE_WORLD
w_class = ITEM_SIZE_HUGE // an entire fleece is quite large in terms of volume
- attack_verb = list("slapped")
+ attack_verb = "slapped"
hitsound = 'sound/weapons/towelwhip.ogg'
material = /decl/material/solid/organic/cloth/wool
material_alteration = MAT_FLAG_ALTERATION_COLOR
diff --git a/code/game/objects/items/glassjar.dm b/code/game/objects/items/glassjar.dm
index 22e99321baa3..6c6a654fb2fc 100644
--- a/code/game/objects/items/glassjar.dm
+++ b/code/game/objects/items/glassjar.dm
@@ -71,15 +71,15 @@
update_icon()
return
-/obj/item/glass_jar/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/cash))
+/obj/item/glass_jar/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/cash))
if(contains == 0)
contains = 1
if(contains != 1)
return TRUE
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- var/obj/item/cash/S = W
+ var/obj/item/cash/S = used_item
user.visible_message("[user] puts \the [S] into \the [src].")
update_icon()
return TRUE
diff --git a/code/game/objects/items/horseshoe.dm b/code/game/objects/items/horseshoe.dm
index 089d3c9cc4bf..622dfaf99721 100644
--- a/code/game/objects/items/horseshoe.dm
+++ b/code/game/objects/items/horseshoe.dm
@@ -5,4 +5,11 @@
icon_state = ICON_STATE_WORLD
icon = 'icons/obj/items/horseshoe.dmi'
material = /decl/material/solid/metal/iron
+ color = /decl/material/solid/metal/iron::color
material_alteration = MAT_FLAG_ALTERATION_ALL
+
+/// A horseshoe hung above a door.
+/obj/item/horseshoe/hung
+ anchored = TRUE
+ randpixel = 0
+ layer = ABOVE_HUMAN_LAYER
\ No newline at end of file
diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm
index 6066fbeaedef..cf070a49deef 100644
--- a/code/game/objects/items/latexballoon.dm
+++ b/code/game/objects/items/latexballoon.dm
@@ -43,8 +43,8 @@
burst()
return ..()
-/obj/item/latexballon/attackby(obj/item/W, mob/user)
- if (W.can_puncture())
+/obj/item/latexballon/attackby(obj/item/used_item, mob/user)
+ if (used_item.can_puncture())
burst()
return TRUE
return FALSE
diff --git a/code/game/objects/items/paintkit.dm b/code/game/objects/items/paintkit.dm
index 9e99fdea07d2..5d8602efb267 100644
--- a/code/game/objects/items/paintkit.dm
+++ b/code/game/objects/items/paintkit.dm
@@ -38,10 +38,10 @@
desc = "A kit for modifying a voidsuit."
uses = 2
-/obj/item/clothing/head/helmet/space/void/attackby(var/obj/item/O, var/mob/user)
+/obj/item/clothing/head/helmet/space/void/attackby(var/obj/item/used_item, var/mob/user)
- if(istype(O,/obj/item/kit/suit))
- var/obj/item/kit/suit/kit = O
+ if(istype(used_item,/obj/item/kit/suit))
+ var/obj/item/kit/suit/kit = used_item
to_chat(user, SPAN_NOTICE("You set about modifying \the [src] into \a [kit.new_name] void helmet."))
SetName("[kit.new_name] void helmet")
desc = kit.new_desc
@@ -53,10 +53,10 @@
return ..()
-/obj/item/clothing/suit/space/void/attackby(var/obj/item/O, var/mob/user)
+/obj/item/clothing/suit/space/void/attackby(var/obj/item/used_item, var/mob/user)
- if(istype(O, /obj/item/kit/suit))
- var/obj/item/kit/suit/kit = O
+ if(istype(used_item, /obj/item/kit/suit))
+ var/obj/item/kit/suit/kit = used_item
to_chat(user, SPAN_NOTICE("You set about modifying \the [src] into \a [kit.new_name] voidsuit."))
SetName("[kit.new_name] voidsuit")
desc = kit.new_desc
diff --git a/code/game/objects/items/passport.dm b/code/game/objects/items/passport.dm
index 55032ba5ba8b..48ce254e834e 100644
--- a/code/game/objects/items/passport.dm
+++ b/code/game/objects/items/passport.dm
@@ -5,7 +5,7 @@
_base_attack_force = 1
gender = PLURAL
w_class = ITEM_SIZE_SMALL
- attack_verb = list("whipped")
+ attack_verb = "whipped"
hitsound = 'sound/weapons/towelwhip.ogg'
desc = "A set of identifying documents."
material = /decl/material/solid/organic/paper
diff --git a/code/game/objects/items/plunger.dm b/code/game/objects/items/plunger.dm
index 711aec009b05..29558d974c81 100644
--- a/code/game/objects/items/plunger.dm
+++ b/code/game/objects/items/plunger.dm
@@ -3,7 +3,7 @@
desc = "This is possibly the least sanitary object around."
icon = 'icons/obj/items/plunger.dmi'
icon_state = ICON_STATE_WORLD
- attack_verb = list("plunged")
+ attack_verb = "plunged"
_base_attack_force = 1
w_class = ITEM_SIZE_NORMAL
slot_flags = SLOT_HEAD | SLOT_FACE
diff --git a/code/game/objects/items/rescuebag.dm b/code/game/objects/items/rescuebag.dm
index 4ae13e1cd418..df7b9225027f 100644
--- a/code/game/objects/items/rescuebag.dm
+++ b/code/game/objects/items/rescuebag.dm
@@ -8,6 +8,7 @@
origin_tech = @'{"biotech":2}'
material = /decl/material/solid/organic/plastic
matter = list(/decl/material/solid/silicon = MATTER_AMOUNT_SECONDARY)
+ bag_type = /obj/structure/closet/body_bag/rescue
var/obj/item/tank/airtank
/obj/item/bodybag/rescue/loaded
@@ -23,25 +24,24 @@
QDEL_NULL(airtank)
return ..()
-/obj/item/bodybag/rescue/attack_self(mob/user)
- var/obj/structure/closet/body_bag/rescue/R = new /obj/structure/closet/body_bag/rescue(user.loc)
- R.add_fingerprint(user)
- if(airtank)
- R.set_tank(airtank)
+/obj/item/bodybag/rescue/create_bag_structure(mob/user)
+ var/obj/structure/closet/body_bag/rescue/bag = ..()
+ if(istype(bag) && airtank)
+ bag.set_tank(airtank)
airtank = null
- qdel(src)
+ return bag
-/obj/item/bodybag/rescue/attackby(obj/item/W, mob/user, var/click_params)
- if(istype(W,/obj/item/tank))
+/obj/item/bodybag/rescue/attackby(obj/item/used_item, mob/user, var/click_params)
+ if(istype(used_item,/obj/item/tank))
if(airtank)
to_chat(user, "\The [src] already has an air tank installed.")
return TRUE
- if(user.try_unequip(W))
- W.forceMove(src)
- airtank = W
- to_chat(user, "You install \the [W] in \the [src].")
+ if(user.try_unequip(used_item))
+ used_item.forceMove(src)
+ airtank = used_item
+ to_chat(user, "You install \the [used_item] in \the [src].")
return TRUE
- else if(airtank && IS_SCREWDRIVER(W))
+ else if(airtank && IS_SCREWDRIVER(used_item))
to_chat(user, "You remove \the [airtank] from \the [src].")
airtank.dropInto(loc)
airtank = null
@@ -88,15 +88,15 @@
if(airtank)
add_overlay("tank")
-/obj/structure/closet/body_bag/rescue/attackby(obj/item/W, mob/user, var/click_params)
- if(istype(W,/obj/item/tank))
+/obj/structure/closet/body_bag/rescue/attackby(obj/item/used_item, mob/user, var/click_params)
+ if(istype(used_item,/obj/item/tank))
if(airtank)
to_chat(user, "\The [src] already has an air tank installed.")
- else if(user.try_unequip(W, src))
- set_tank(W)
- to_chat(user, "You install \the [W] in \the [src].")
+ else if(user.try_unequip(used_item, src))
+ set_tank(used_item)
+ to_chat(user, "You install \the [used_item] in \the [src].")
return TRUE
- else if(airtank && IS_SCREWDRIVER(W))
+ else if(airtank && IS_SCREWDRIVER(used_item))
to_chat(user, "You remove \the [airtank] from \the [src].")
airtank.dropInto(loc)
airtank = null
diff --git a/code/game/objects/items/robot/robot_frame.dm b/code/game/objects/items/robot/robot_frame.dm
index 24f7474aa6e1..2759cbc834e3 100644
--- a/code/game/objects/items/robot/robot_frame.dm
+++ b/code/game/objects/items/robot/robot_frame.dm
@@ -32,10 +32,10 @@
SSstatistics.add_field("cyborg_frames_built",1)
return TRUE
-/obj/item/robot_parts/robot_suit/attackby(obj/item/W, mob/user)
+/obj/item/robot_parts/robot_suit/attackby(obj/item/used_item, mob/user)
// Uninstall a robotic part.
- if(IS_CROWBAR(W))
+ if(IS_CROWBAR(used_item))
if(!parts.len)
to_chat(user, SPAN_WARNING("\The [src] has no parts to remove."))
return TRUE
@@ -49,40 +49,40 @@
return TRUE
// Install a robotic part.
- else if (istype(W, /obj/item/robot_parts))
- var/obj/item/robot_parts/part = W
- if(!required_parts[part.bp_tag] || !istype(W, required_parts[part.bp_tag]))
- to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [W]."))
+ else if (istype(used_item, /obj/item/robot_parts))
+ var/obj/item/robot_parts/part = used_item
+ if(!required_parts[part.bp_tag] || !istype(used_item, required_parts[part.bp_tag]))
+ to_chat(user, SPAN_WARNING("\The [src] is not compatible with \the [used_item]."))
else if(parts[part.bp_tag])
- to_chat(user, SPAN_WARNING("\The [src] already has \a [W] installed."))
- else if(part.can_install(user) && user.try_unequip(W, src))
+ to_chat(user, SPAN_WARNING("\The [src] already has \a [used_item] installed."))
+ else if(part.can_install(user) && user.try_unequip(used_item, src))
parts[part.bp_tag] = part
update_icon()
return TRUE
// Install a brain.
- else if(istype(W, /obj/item/organ/internal/brain_interface))
+ else if(istype(used_item, /obj/item/organ/internal/brain_interface))
if(!isturf(loc))
- to_chat(user, SPAN_WARNING("You can't put \the [W] in without the frame being on the ground."))
+ to_chat(user, SPAN_WARNING("You can't put \the [used_item] in without the frame being on the ground."))
return TRUE
if(!check_completion())
to_chat(user, SPAN_WARNING("The frame is not ready for the central processor to be installed."))
return TRUE
- var/obj/item/organ/internal/brain_interface/M = W
+ var/obj/item/organ/internal/brain_interface/M = used_item
var/mob/living/brainmob = M?.get_brainmob()
if(!brainmob)
- to_chat(user, SPAN_WARNING("Sticking an empty [W.name] into the frame would sort of defeat the purpose."))
+ to_chat(user, SPAN_WARNING("Sticking an empty [used_item.name] into the frame would sort of defeat the purpose."))
return TRUE
if(jobban_isbanned(brainmob, ASSIGNMENT_ROBOT))
- to_chat(user, SPAN_WARNING("\The [W] does not seem to fit."))
+ to_chat(user, SPAN_WARNING("\The [used_item] does not seem to fit."))
return TRUE
if(brainmob.stat == DEAD)
- to_chat(user, SPAN_WARNING("Sticking a dead [W.name] into the frame would sort of defeat the purpose."))
+ to_chat(user, SPAN_WARNING("Sticking a dead [used_item.name] into the frame would sort of defeat the purpose."))
return TRUE
var/ghost_can_reenter = 0
@@ -95,10 +95,10 @@
else
ghost_can_reenter = 1
if(!ghost_can_reenter)
- to_chat(user, SPAN_WARNING("\The [W] is completely unresponsive; there's no point."))
+ to_chat(user, SPAN_WARNING("\The [used_item] is completely unresponsive; there's no point."))
return TRUE
- if(!user.try_unequip(W))
+ if(!user.try_unequip(used_item))
return TRUE
SSstatistics.add_field("cyborg_frames_built",1)
@@ -106,7 +106,7 @@
if(!O)
return TRUE
- O.central_processor = W
+ O.central_processor = used_item
O.set_invisibility(INVISIBILITY_NONE)
O.custom_name = created_name
O.updatename("Default")
@@ -120,7 +120,7 @@
var/obj/item/robot_parts/chest/chest = parts[BP_CHEST]
chest.cell.forceMove(O)
- W.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
+ used_item.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
// Since we "magically" installed a cell, we also have to update the correct component.
if(O.cell)
@@ -134,7 +134,7 @@
qdel(src)
return TRUE
- else if(IS_PEN(W))
+ else if(IS_PEN(used_item))
var/t = sanitize_safe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
if(t && (in_range(src, user) || loc == user))
created_name = t
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index 16d7f1eddcd5..cbe87ec2d299 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -7,15 +7,15 @@
***********************************************************************/
/obj/item/borg/overdrive
name = "overdrive"
- icon = 'icons/obj/decals.dmi'
+ icon = 'icons/obj/signs/warnings.dmi'
icon_state = "shock"
/**********************************************************************
HUD/SIGHT things
***********************************************************************/
/obj/item/borg/sight
- icon = 'icons/obj/decals.dmi'
- icon_state = "securearea"
+ icon = 'icons/obj/signs/warnings.dmi'
+ icon_state = "secureareaold"
var/sight_mode = null
var/glasses_hud_type
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 3e99d2da0c52..3fde339bc303 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -22,12 +22,12 @@
if(!ispath(model, /decl/bodytype/prosthetic))
model = /decl/bodytype/prosthetic/basic_human
model_info = model
- var/decl/bodytype/prosthetic/R = GET_DECL(model)
- if(R)
- SetName("[R.name] [initial(name)]")
- desc = "[R.desc]"
- if(icon_state in icon_states(R.icon_base))
- icon = R.icon_base
+ var/decl/bodytype/prosthetic/robot_model = GET_DECL(model)
+ if(robot_model)
+ SetName("[robot_model.name] [initial(name)]")
+ desc = "[robot_model.desc]"
+ if(icon_state in icon_states(robot_model.icon_base))
+ icon = robot_model.icon_base
else
SetDefaultName()
@@ -106,54 +106,54 @@
success = FALSE
return success && ..()
-/obj/item/robot_parts/chest/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/cell))
+/obj/item/robot_parts/chest/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/cell))
if(src.cell)
to_chat(user, "You have already inserted a cell!")
else
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- src.cell = W
+ src.cell = used_item
to_chat(user, "You insert the cell!")
return TRUE
- if(IS_COIL(W))
+ if(IS_COIL(used_item))
if(src.wires)
to_chat(user, "You have already inserted wire!")
else
- var/obj/item/stack/cable_coil/coil = W
+ var/obj/item/stack/cable_coil/coil = used_item
if(coil.use(1))
src.wires = 1.0
to_chat(user, "You insert the wire!")
return TRUE
return ..()
-/obj/item/robot_parts/head/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/flash))
+/obj/item/robot_parts/head/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/flash))
if(isrobot(user))
var/current_module = user.get_active_held_item()
- if(current_module == W)
+ if(current_module == used_item)
to_chat(user, "How do you propose to do that?")
return TRUE
else
- add_flashes(W,user)
+ add_flashes(used_item,user)
else
- add_flashes(W,user)
+ add_flashes(used_item,user)
return TRUE
return ..()
-/obj/item/robot_parts/head/proc/add_flashes(obj/item/W, mob/user) //Made into a seperate proc to avoid copypasta
+/obj/item/robot_parts/head/proc/add_flashes(obj/item/used_item, mob/user) //Made into a seperate proc to avoid copypasta
if(src.flash1 && src.flash2)
to_chat(user, "You have already inserted the eyes!")
return
else if(src.flash1)
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return
- src.flash2 = W
+ src.flash2 = used_item
to_chat(user, "You insert the flash into the eye socket!")
else
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return
- src.flash1 = W
+ src.flash1 = used_item
to_chat(user, "You insert the flash into the eye socket!")
diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm
index 1dd4881d7c09..7230cd94476d 100644
--- a/code/game/objects/items/robot/robot_upgrades.dm
+++ b/code/game/objects/items/robot/robot_upgrades.dm
@@ -11,8 +11,8 @@
var/locked = 0
var/require_module = 0
-/obj/item/borg/upgrade/proc/action(var/mob/living/silicon/robot/R)
- if(R.stat == DEAD)
+/obj/item/borg/upgrade/proc/action(var/mob/living/silicon/robot/robot)
+ if(robot.stat == DEAD)
to_chat(usr, "\The [src] will not function on a deceased robot.")
return 1
return 0
@@ -23,10 +23,10 @@
icon = 'icons/obj/modules/module_cyborg_1.dmi'
require_module = 1
-/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/robot)
if((. = ..())) return 0
- R.reset_module()
+ robot.reset_module()
return 1
/obj/item/borg/upgrade/uncertified
@@ -36,15 +36,15 @@
require_module = 0
var/new_module = null
-/obj/item/borg/upgrade/uncertified/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/uncertified/action(var/mob/living/silicon/robot/robot)
if((. = ..())) return 0
if(!new_module)
- to_chat(usr, "[R]'s error lights strobe repeatedly - something seems to be wrong with the chip.")
+ to_chat(usr, "[robot]'s error lights strobe repeatedly - something seems to be wrong with the chip.")
return 0
// Suppress the alert so the AI doesn't see a reset message.
- R.reset_module(TRUE)
- R.pick_module(new_module)
+ robot.reset_module(TRUE)
+ robot.pick_module(new_module)
return 1
/obj/item/borg/upgrade/uncertified/party
@@ -72,12 +72,12 @@
/obj/item/borg/upgrade/rename/attack_self(mob/user)
heldname = sanitize_safe(input(user, "Enter new robot name", "Robot Reclassification", heldname), MAX_NAME_LEN)
-/obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/rename/action(var/mob/living/silicon/robot/robot)
if(..()) return 0
- R.notify_ai(ROBOT_NOTIFICATION_NEW_NAME, R.name, heldname)
- R.SetName(heldname)
- R.custom_name = heldname
- R.real_name = heldname
+ robot.notify_ai(ROBOT_NOTIFICATION_NEW_NAME, robot.name, heldname)
+ robot.SetName(heldname)
+ robot.custom_name = heldname
+ robot.real_name = heldname
return 1
@@ -86,16 +86,16 @@
desc = "Used to boost cyborg's light intensity."
icon = 'icons/obj/modules/module_cyborg_1.dmi'
-/obj/item/borg/upgrade/floodlight/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/floodlight/action(var/mob/living/silicon/robot/robot)
if(..()) return 0
- if(R.intenselight)
+ if(robot.intenselight)
to_chat(usr, "This cyborg's light was already upgraded.")
return 0
else
- R.intenselight = 1
- R.update_robot_light()
- to_chat(R, "Lighting systems upgrade detected.")
+ robot.intenselight = 1
+ robot.update_robot_light()
+ to_chat(robot, "Lighting systems upgrade detected.")
return 1
/obj/item/borg/upgrade/restart
@@ -105,19 +105,19 @@
material = /decl/material/solid/metal/steel
matter = list(/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT)
-/obj/item/borg/upgrade/restart/action(var/mob/living/silicon/robot/R)
- if(R.current_health < 0)
+/obj/item/borg/upgrade/restart/action(var/mob/living/silicon/robot/robot)
+ if(robot.current_health < 0)
to_chat(usr, "You have to repair the robot before using this module!")
return 0
- if(!R.key)
+ if(!robot.key)
for(var/mob/observer/ghost/ghost in global.player_list)
- if(ghost.mind && ghost.mind.current == R)
- R.key = ghost.key
+ if(ghost.mind && ghost.mind.current == robot)
+ robot.key = ghost.key
- R.set_stat(CONSCIOUS)
- R.switch_from_dead_to_living_mob_list()
- R.notify_ai(ROBOT_NOTIFICATION_NEW_UNIT)
+ robot.set_stat(CONSCIOUS)
+ robot.switch_from_dead_to_living_mob_list()
+ robot.notify_ai(ROBOT_NOTIFICATION_NEW_UNIT)
return 1
@@ -132,14 +132,14 @@
/decl/material/solid/metal/gold = MATTER_AMOUNT_TRACE
)
-/obj/item/borg/upgrade/vtec/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/vtec/action(var/mob/living/silicon/robot/robot)
if(..()) return FALSE
- if(R.vtec == TRUE)
+ if(robot.vtec == TRUE)
return FALSE
- R.speed--
- R.vtec = TRUE
+ robot.speed--
+ robot.vtec = TRUE
return TRUE
@@ -156,23 +156,23 @@
)
origin_tech = @'{"materials":2,"engineering":3,"programming":3,"powerstorage":2,"combat":2}'
-/obj/item/borg/upgrade/weaponcooler/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/weaponcooler/action(var/mob/living/silicon/robot/robot)
if(..()) return 0
- if(!R.module || !(type in R.module.supported_upgrades))
- to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
+ if(!robot.module || !(type in robot.module.supported_upgrades))
+ to_chat(robot, "Upgrade mounting error! No suitable hardpoint detected!")
to_chat(usr, "There's no mounting point for the module!")
return 0
- var/obj/item/gun/energy/gun/secure/mounted/T = locate() in R.module
+ var/obj/item/gun/energy/gun/secure/mounted/T = locate() in robot.module
if(!T)
- T = locate() in R.module.equipment
+ T = locate() in robot.module.equipment
if(!T)
to_chat(usr, "This robot has had its energy gun removed!")
return 0
if(T.recharge_time <= 2)
- to_chat(R, "Maximum cooling achieved for this hardpoint!")
+ to_chat(robot, "Maximum cooling achieved for this hardpoint!")
to_chat(usr, "There's no room for another cooling unit!")
return 0
@@ -193,18 +193,18 @@
)
origin_tech = @'{"materials":2,"engineering":3,"programming":3,"magnets":3}'
-/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/robot)
if(..()) return 0
- if(!R.module || !(type in R.module.supported_upgrades))
- to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
+ if(!robot.module || !(type in robot.module.supported_upgrades))
+ to_chat(robot, "Upgrade mounting error! No suitable hardpoint detected!")
to_chat(usr, "There's no mounting point for the module!")
return 0
else
- R.module.equipment += new/obj/item/tank/jetpack/carbondioxide
- for(var/obj/item/tank/jetpack/carbondioxide in R.module.equipment)
- R.set_internals(src)
- //R.icon_state="Miner+j"
+ robot.module.equipment += new/obj/item/tank/jetpack/carbondioxide
+ for(var/obj/item/tank/jetpack/carbondioxide in robot.module.equipment)
+ robot.set_internals(src)
+ //robot.icon_state="Miner+j"
return 1
/obj/item/borg/upgrade/rcd
@@ -219,15 +219,15 @@
)
origin_tech = @'{"materials":4,"engineering":4,"programming":3}'
-/obj/item/borg/upgrade/rcd/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/rcd/action(var/mob/living/silicon/robot/robot)
if(..()) return 0
- if(!R.module || !(type in R.module.supported_upgrades))
- to_chat(R, "Upgrade mounting error! No suitable hardpoint detected!")
+ if(!robot.module || !(type in robot.module.supported_upgrades))
+ to_chat(robot, "Upgrade mounting error! No suitable hardpoint detected!")
to_chat(usr, "There's no mounting point for the module!")
return 0
else
- R.module.equipment += new/obj/item/rcd/borg(R.module)
+ robot.module.equipment += new/obj/item/rcd/borg(robot.module)
return 1
/obj/item/borg/upgrade/syndicate
@@ -242,11 +242,11 @@
)
origin_tech = @'{"materials":2,"engineering":2,"programming":3,"esoteric":2,"combat":2}'
-/obj/item/borg/upgrade/syndicate/action(var/mob/living/silicon/robot/R)
+/obj/item/borg/upgrade/syndicate/action(var/mob/living/silicon/robot/robot)
if(..()) return 0
- if(R.emagged == 1)
+ if(robot.emagged == 1)
return 0
- R.emagged = 1
+ robot.emagged = 1
return 1
diff --git a/code/game/objects/items/rock.dm b/code/game/objects/items/rock.dm
index 4a57b5ab4dde..ff0f5189bb5c 100644
--- a/code/game/objects/items/rock.dm
+++ b/code/game/objects/items/rock.dm
@@ -17,9 +17,9 @@
))
// TODO: craft a flint striker from a flint and a piece of metal
-/obj/item/rock/attackby(obj/item/W, mob/user)
+/obj/item/rock/attackby(obj/item/used_item, mob/user)
- var/decl/material/weapon_material = W.get_striking_material()
+ var/decl/material/weapon_material = used_item.get_striking_material()
var/decl/material/our_material = get_material()
if((weapon_material?.ferrous && our_material?.type == /decl/material/solid/stone/flint) || (our_material?.ferrous && weapon_material?.type == /decl/material/solid/stone/flint))
var/turf/spark_turf = get_turf(src)
diff --git a/code/game/objects/items/stacks/medical/medical_bandage.dm b/code/game/objects/items/stacks/medical/medical_bandage.dm
index 23d81504abf9..cd0ca1efdc10 100644
--- a/code/game/objects/items/stacks/medical/medical_bandage.dm
+++ b/code/game/objects/items/stacks/medical/medical_bandage.dm
@@ -25,9 +25,8 @@
/obj/item/stack/medical/bandage/proc/get_poultice_requirement_string()
. = list()
- for(var/reagent in poultice_reagent_requirements)
- var/decl/material/reagent_decl = GET_DECL(reagent)
- . += "[poultice_reagent_requirements[reagent]] unit\s of [reagent_decl.liquid_name]"
+ for(var/decl/material/reagent as anything in poultice_reagent_requirements)
+ . += "[poultice_reagent_requirements[reagent.type]] unit\s of [reagent.liquid_name]"
. = english_list(.)
/obj/item/stack/medical/bandage/get_examine_strings(mob/user, distance, infix, suffix)
@@ -76,7 +75,7 @@
/obj/item/stack/medical/bandage/proc/bandage_wound(mob/user, mob/target, obj/item/organ/external/affecting, datum/wound/wound)
user.visible_message(
SPAN_NOTICE("\The [user] bandages \a [wound.desc] on \the [target]'s [affecting.name]."),
- SPAN_NOTICE("You bandage \a [wound.desc] on \the [target]'s [affecting.name].")
+ SPAN_NOTICE("You bandage \a [wound.desc] on \the [target]'s [affecting.name].")
)
wound.bandage()
diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm
index 405c08b1f34c..0c4581d6c17f 100644
--- a/code/game/objects/items/stacks/nanopaste.dm
+++ b/code/game/objects/items/stacks/nanopaste.dm
@@ -21,18 +21,18 @@
return TRUE
if (isrobot(target)) //Repairing cyborgs
- var/mob/living/silicon/robot/R = target
- if (R.getBruteLoss() || R.getFireLoss() )
+ var/mob/living/silicon/robot/robot = target
+ if (robot.getBruteLoss() || robot.getFireLoss() )
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- R.heal_damage(BRUTE, 15, do_update_health = FALSE)
- R.heal_damage(BURN, 15)
+ robot.heal_damage(BRUTE, 15, do_update_health = FALSE)
+ robot.heal_damage(BURN, 15)
use(1)
user.visible_message(
- SPAN_NOTICE("\The [user] applied some [name] to \the [R]'s damaged areas."),
- SPAN_NOTICE("You apply some [name] to \the [R]'s damaged areas.")
+ SPAN_NOTICE("\The [user] applied some [name] to \the [robot]'s damaged areas."),
+ SPAN_NOTICE("You apply some [name] to \the [robot]'s damaged areas.")
)
else
- to_chat(user, SPAN_NOTICE("\The [R]'s systems are all nominal."))
+ to_chat(user, SPAN_NOTICE("\The [robot]'s systems are all nominal."))
return TRUE
//Repairing robolimbs
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 7e244c18453f..1a8d655c9dd1 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -47,17 +47,17 @@
icon_state = base_state
// TODO: slapcrafting recipes to replace this block.
-/obj/item/stack/material/rods/attackby(obj/item/W, mob/user)
+/obj/item/stack/material/rods/attackby(obj/item/used_item, mob/user)
- if(IS_WELDER(W))
- var/obj/item/weldingtool/WT = W
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
if(!can_use(2))
to_chat(user, SPAN_WARNING("You need at least two rods to do this."))
return TRUE
- if(WT.weld(0,user))
- visible_message(SPAN_NOTICE("\The [src] is fused together by \the [user] with \the [WT]."), 3, SPAN_NOTICE("You hear welding."), 2)
+ if(welder.weld(0,user))
+ visible_message(SPAN_NOTICE("\The [src] is fused together by \the [user] with \the [welder]."), 3, SPAN_NOTICE("You hear welding."), 2)
for(var/obj/item/stack/material/new_item in SSmaterials.create_object((material?.type || /decl/material/solid/metal/steel), usr.loc, 1))
new_item.add_to_stacks(usr)
if(user.is_holding_offhand(src))
@@ -65,8 +65,8 @@
use(2)
return TRUE
- if (istype(W, /obj/item/stack/tape_roll/duct_tape))
- var/obj/item/stack/tape_roll/duct_tape/T = W
+ if (istype(used_item, /obj/item/stack/tape_roll/duct_tape))
+ var/obj/item/stack/tape_roll/duct_tape/T = used_item
if(!T.can_use(4))
to_chat(user, SPAN_WARNING("You need 4 [T.plural_name] to make a splint!"))
return TRUE
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index b95475cea8fe..2a48ee7fd1b5 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -165,11 +165,15 @@
popup.open()
-/obj/item/stack/proc/produce_recipe(decl/stack_recipe/recipe, var/producing, var/expending, mob/user, paint_color, sublist = null)
+/obj/item/stack/proc/produce_recipe(decl/stack_recipe/recipe, var/producing, var/expending, mob/user, paint_color)
if(producing <= 0 || expending <= 0 || expending > get_amount())
return
+ if(expending > recipe.get_required_stack_amount(src, product_amount = producing))
+ PRINT_STACK_TRACE("Possible HREF hacking attempt, recipe amount consumed and produced doesn't match!")
+ return
+
var/decl/material/mat = get_material()
var/decl/material/reinf_mat = get_reinforced_material()
if (!can_use(expending))
@@ -194,11 +198,14 @@
to_chat(user, SPAN_NOTICE("You [recipe.get_craft_verb(src)] [recipe.get_display_name(producing, mat, reinf_mat)]!"))
var/list/atom/results = recipe.spawn_result(user, user.loc, producing, mat, reinf_mat, paint_color, crafting_stack_type, expending)
- var/atom/movable/O = LAZYACCESS(results, 1)
- if(istype(O) && !QDELETED(O)) // In case of stack merger.
- O.add_fingerprint(user)
- user.put_in_hands(O)
- list_recipes(user, sublist)
+ var/was_put_in_hand = FALSE
+ for(var/atom/result in results)
+ if(QDELETED(result))
+ continue
+ result.add_fingerprint(user)
+ if(isitem(result) && !was_put_in_hand)
+ if(user.put_in_hands(result))
+ was_put_in_hand = TRUE
/obj/item/stack/OnTopic(mob/user, list/href_list)
. = ..()
@@ -246,9 +253,10 @@
var/producing = text2num(href_list["producing"])
var/expending = text2num(href_list["expending"])
var/datum/stack_recipe_list/returning = locate(href_list["returning"])
- if(producing > 0 && expending > 0)
- produce_recipe(recipe, producing, expending, user, paint_color, sublist = returning)
- return TOPIC_REFRESH
+ if(producing > 0 && expending > 0 && expending <= recipe.get_required_stack_amount(src, product_amount = producing))
+ produce_recipe(recipe, producing, expending, user, paint_color)
+ list_recipes(user, returning)
+ return TOPIC_HANDLED // Don't attempt to refresh, list_recipes should handle that already...
return TOPIC_NOACTION
@@ -448,9 +456,9 @@
src.interact(usr)
return TRUE
-/obj/item/stack/attackby(obj/item/W, mob/user)
- if (istype(W, /obj/item/stack) && can_merge_stacks(W))
- var/obj/item/stack/S = W
+/obj/item/stack/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item, /obj/item/stack) && can_merge_stacks(used_item))
+ var/obj/item/stack/S = used_item
. = src.transfer_to(S)
spawn(0) //give the stacks a chance to delete themselves if necessary
diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm
index 2fa50e63988a..79f64d66a684 100644
--- a/code/game/objects/items/stacks/tiles/tile_types.dm
+++ b/code/game/objects/items/stacks/tiles/tile_types.dm
@@ -202,6 +202,7 @@
* Carpets
*/
/obj/item/stack/tile/carpet
+ build_type = /obj/item/stack/tile/carpet
name = "brown carpet"
singular_name = "brown carpet"
desc = "A piece of brown carpet."
@@ -217,12 +218,13 @@
/obj/item/stack/tile/carpet/on_update_icon()
. = ..()
if(detail_color)
- set_overlays(overlay_image(icon, "[icon_state]-detail", detail_color, RESET_COLOR))
+ add_overlay(overlay_image(icon, "[icon_state]_detail", detail_color, RESET_COLOR))
/obj/item/stack/tile/carpet/fifty
amount = 50
/obj/item/stack/tile/carpet/blue
+ build_type = /obj/item/stack/tile/carpet/blue
name = "blue carpet"
desc = "A piece of blue and gold carpet."
singular_name = "blue carpet"
@@ -232,6 +234,7 @@
amount = 50
/obj/item/stack/tile/carpet/blue2
+ build_type = /obj/item/stack/tile/carpet/blue2
name = "pale blue carpet"
desc = "A piece of blue and pale blue carpet."
singular_name = "pale blue carpet"
@@ -242,6 +245,7 @@
amount = 50
/obj/item/stack/tile/carpet/blue3
+ build_type = /obj/item/stack/tile/carpet/blue3
name = "sea blue carpet"
desc = "A piece of blue and green carpet."
singular_name = "sea blue carpet"
@@ -252,6 +256,7 @@
amount = 50
/obj/item/stack/tile/carpet/magenta
+ build_type = /obj/item/stack/tile/carpet/magenta
name = "magenta carpet"
desc = "A piece of magenta carpet."
singular_name = "magenta carpet"
@@ -262,6 +267,7 @@
amount = 50
/obj/item/stack/tile/carpet/purple
+ build_type = /obj/item/stack/tile/carpet/purple
name = "purple carpet"
desc = "A piece of purple carpet."
singular_name = "purple carpet"
@@ -272,6 +278,7 @@
amount = 50
/obj/item/stack/tile/carpet/orange
+ build_type = /obj/item/stack/tile/carpet/orange
name = "orange carpet"
desc = "A piece of orange carpet."
singular_name = "orange carpet"
@@ -282,6 +289,7 @@
amount = 50
/obj/item/stack/tile/carpet/green
+ build_type = /obj/item/stack/tile/carpet/green
name = "green carpet"
desc = "A piece of green carpet."
singular_name = "green carpet"
@@ -302,6 +310,7 @@
amount = 50
/obj/item/stack/tile/carpet/rustic
+ build_type = /obj/item/stack/tile/carpet/rustic
name = "rustic carpet"
desc = "A piece of simple, rustic carpeting."
singular_name = "rustic carpet"
diff --git a/code/game/objects/items/stools.dm b/code/game/objects/items/stools.dm
index 31c54d503a53..528ff6abad1e 100644
--- a/code/game/objects/items/stools.dm
+++ b/code/game/objects/items/stools.dm
@@ -96,8 +96,8 @@
padding_extension?.remove_padding(do_icon_update = FALSE)
qdel(src)
-/obj/item/stool/attackby(obj/item/W, mob/user)
- if(IS_WRENCH(W))
+/obj/item/stool/attackby(obj/item/used_item, mob/user)
+ if(IS_WRENCH(used_item))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
dismantle()
return TRUE
diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm
index d16e6c230f38..ce927361ee62 100644
--- a/code/game/objects/items/tools/screwdriver.dm
+++ b/code/game/objects/items/tools/screwdriver.dm
@@ -7,7 +7,7 @@
w_class = ITEM_SIZE_TINY
material = /decl/material/solid/metal/steel
center_of_mass = @'{"x":16,"y":7}'
- attack_verb = list("stabbed")
+ attack_verb = "stabbed"
lock_picking_level = 5
sharp = TRUE
material_alteration = MAT_FLAG_ALTERATION_COLOR
diff --git a/code/game/objects/items/tools/shears.dm b/code/game/objects/items/tools/shears.dm
index b5958ab00254..47ff4cf48b7a 100644
--- a/code/game/objects/items/tools/shears.dm
+++ b/code/game/objects/items/tools/shears.dm
@@ -6,6 +6,7 @@
w_class = ITEM_SIZE_SMALL
origin_tech = @'{"materials":1,"engineering":1}'
material = /decl/material/solid/metal/steel
+ color = /decl/material/solid/metal/steel::color
center_of_mass = @'{"x":18,"y":10}'
attack_verb = list("sheared", "cut")
sharp = TRUE
diff --git a/code/game/objects/items/tools/wrench.dm b/code/game/objects/items/tools/wrench.dm
index c117895cea1b..ea8c1ac9e68a 100644
--- a/code/game/objects/items/tools/wrench.dm
+++ b/code/game/objects/items/tools/wrench.dm
@@ -60,5 +60,5 @@
/obj/item/wrench/pipe/afterattack(atom/A, mob/user, proximity)
. = ..()
if(proximity && istype(A,/obj/structure/window) && is_held_twohanded())
- var/obj/structure/window/W = A
- W.shatter()
+ var/obj/structure/window/window = A
+ window.shatter()
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 15e634163ec3..76255a19f118 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -66,10 +66,9 @@
return
w_class = (reagents?.total_volume > 0)? ITEM_SIZE_SMALL : ITEM_SIZE_TINY
//#TODO: Maybe acids should handle eating their own containers themselves?
- for(var/reagent in reagents?.reagent_volumes)
- var/decl/material/M = GET_DECL(reagent)
- if(M.solvent_power >= MAT_SOLVENT_STRONG)
- visible_message(SPAN_DANGER("\The [M] chews through \the [src]!"))
+ for(var/decl/material/reagent as anything in reagents?.reagent_volumes)
+ if(reagent.solvent_power >= MAT_SOLVENT_STRONG)
+ visible_message(SPAN_DANGER("\The [reagent] chews through \the [src]!"))
physically_destroyed()
/obj/item/chems/water_balloon/throw_impact(atom/hit_atom, datum/thrownthing/TT)
@@ -146,11 +145,11 @@
desc = "A cheap, plastic replica of an energy sword. Realistic sounds! Ages 8 and up."
sharp = FALSE
edge = FALSE
- attack_verb = list("hit")
+ attack_verb = "hit"
material = /decl/material/solid/organic/plastic
active_hitsound = 'sound/weapons/genhit.ogg'
active_descriptor = "extended"
- active_attack_verb = list("hit")
+ active_attack_verb = "hit"
active_edge = FALSE
active_sharp = FALSE
_active_base_attack_force = 1
diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm
index edaf4f9a0e5c..efc2e1ac52de 100644
--- a/code/game/objects/items/weapons/AI_modules.dm
+++ b/code/game/objects/items/weapons/AI_modules.dm
@@ -64,9 +64,9 @@ AI MODULES
if(!istype(ai))
return //We don't have slaves if we are not an AI
- for(var/mob/living/silicon/robot/R in ai.connected_robots)
- to_chat(R, "These are your laws now:")
- R.show_laws()
+ for(var/mob/living/silicon/robot/robot in ai.connected_robots)
+ to_chat(robot, "These are your laws now:")
+ robot.show_laws()
/obj/item/aiModule/proc/log_law_changes(mob/living/silicon/target, mob/sender)
var/time = time2text(world.realtime,"hh:mm:ss")
diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm
index 88fd20ce3f67..2d17c5eef94c 100644
--- a/code/game/objects/items/weapons/RCD.dm
+++ b/code/game/objects/items/weapons/RCD.dm
@@ -46,19 +46,19 @@
. += "The current mode is '[work_mode]'."
. += "It currently holds [stored_matter]/[max_stored_matter] matter-units."
-/obj/item/rcd/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/rcd_ammo))
- var/obj/item/rcd_ammo/cartridge = W
+/obj/item/rcd/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/rcd_ammo))
+ var/obj/item/rcd_ammo/cartridge = used_item
if((stored_matter + cartridge.remaining) > max_stored_matter)
to_chat(user, "The RCD can't hold that many additional matter-units.")
return TRUE
stored_matter += cartridge.remaining
- qdel(W)
+ qdel(used_item)
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
to_chat(user, "The RCD now holds [stored_matter]/[max_stored_matter] matter-units.")
update_icon()
return TRUE
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
crafting = !crafting
if(!crafting)
to_chat(user, SPAN_NOTICE("You reassemble the RCD."))
@@ -150,11 +150,11 @@
/obj/item/rcd/borg/useResource(var/amount, var/mob/user)
if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- if(R.cell)
+ var/mob/living/silicon/robot/robot = user
+ if(robot.cell)
var/cost = amount*30
- if(R.cell.charge >= cost)
- R.cell.use(cost)
+ if(robot.cell.charge >= cost)
+ robot.cell.use(cost)
return 1
return 0
diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm
index 6a4725991050..91262b470c90 100644
--- a/code/game/objects/items/weapons/RPD.dm
+++ b/code/game/objects/items/weapons/RPD.dm
@@ -146,7 +146,7 @@ var/global/list/rpd_pipe_selection_skilled = list()
return
playsound(get_turf(user), 'sound/items/Deconstruct.ogg', 50, 1)
- P.build(T, new/datum/fabricator_build_order(P, 1, list("slected_color" = pipe_colors[pipe_color])))
+ P.build(T, new/datum/fabricator_build_order(P, 1, list("selected_color" = pipe_colors[pipe_color])))
if(prob(20))
spark_at(src, amount = 5, holder = src)
@@ -162,17 +162,17 @@ var/global/list/rpd_pipe_selection_skilled = list()
interact(user)
add_fingerprint(user)
-/obj/item/rpd/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/pipe))
- if(!user.try_unequip(W))
+/obj/item/rpd/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/pipe))
+ if(!user.try_unequip(used_item))
return TRUE
- recycle(W,user)
+ recycle(used_item,user)
return TRUE
return ..()
-/obj/item/rpd/proc/recycle(var/obj/item/W,var/mob/user)
+/obj/item/rpd/proc/recycle(var/obj/item/used_item,var/mob/user)
if(!user.skill_check(SKILL_ATMOS,SKILL_BASIC))
- user.visible_message("\The [user] struggles with \the [src] as they futilely jam \the [W] against it.")
+ user.visible_message("\The [user] struggles with \the [src] as they futilely jam \the [used_item] against it.")
return
playsound(src.loc, 'sound/effects/pop.ogg', 50, 1)
- qdel(W)
\ No newline at end of file
+ qdel(used_item)
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm
index 19fd6dc47b10..977b8c1909c3 100644
--- a/code/game/objects/items/weapons/RSF.dm
+++ b/code/game/objects/items/weapons/RSF.dm
@@ -27,12 +27,12 @@ RSF
if(distance <= 1)
. += "It currently holds [stored_matter]/30 fabrication-units."
-/obj/item/rsf/attackby(obj/item/W, mob/user)
- if (istype(W, /obj/item/rcd_ammo))
+/obj/item/rsf/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item, /obj/item/rcd_ammo))
if ((stored_matter + 10) > 30)
to_chat(user, "The RSF can't hold any more matter.")
return TRUE
- qdel(W)
+ qdel(used_item)
stored_matter += 10
playsound(src.loc, 'sound/machines/click.ogg', 10, 1)
to_chat(user, "The RSF now holds [stored_matter]/30 fabrication-units.")
@@ -67,8 +67,8 @@ RSF
if(!proximity) return
if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- if(R.stat || !R.cell || R.cell.charge <= 0)
+ var/mob/living/silicon/robot/robot = user
+ if(robot.stat || !robot.cell || robot.cell.charge <= 0)
return
else
if(stored_matter <= 0)
@@ -106,9 +106,9 @@ RSF
product.dropInto(A.loc)
if(isrobot(user))
- var/mob/living/silicon/robot/R = user
- if(R.cell)
- R.cell.use(used_energy)
+ var/mob/living/silicon/robot/robot = user
+ if(robot.cell)
+ robot.cell.use(used_energy)
else
stored_matter--
to_chat(user, "The RSF now holds [stored_matter]/30 fabrication-units.")
diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm
index e7e5cb527e9b..b71582135b02 100644
--- a/code/game/objects/items/weapons/autopsy.dm
+++ b/code/game/objects/items/weapons/autopsy.dm
@@ -35,9 +35,8 @@
return
add_autopsy_data(S)
- for(var/T in M.chem_doses)
- var/decl/material/R = T
- chemtraces |= initial(R.name)
+ for(var/decl/material/reagent as anything in M._chem_doses)
+ chemtraces |= reagent.use_name
else if(istype(A, /obj/item/organ/external))
set_target(A, user)
@@ -52,13 +51,13 @@
return
for(var/V in O.autopsy_data)
- var/datum/autopsy_data/W = O.autopsy_data[V]
+ var/datum/autopsy_data/wound_data = O.autopsy_data[V]
if(weapon_data[V])
var/datum/autopsy_data/data = weapon_data[V]["data"]
- data.merge_with(W)
+ data.merge_with(wound_data)
weapon_data[V]["organs"] |= O.name
else
- weapon_data[V] = list("data" = W.copy(), "organs" = list(O.name))
+ weapon_data[V] = list("data" = wound_data.copy(), "organs" = list(O.name))
/obj/item/scanner/autopsy/proc/get_formatted_data()
var/list/scan_data = list("Subject: [target_name]")
@@ -66,11 +65,11 @@
if(timeofdeath)
scan_data += "Time of death: [worldtime2stationtime(timeofdeath)]
"
- var/n = 1
+ var/weapon_count = 1
for(var/weapon in weapon_data)
var/list/organs = weapon_data[weapon]["organs"]
var/datum/autopsy_data/data = weapon_data[weapon]["data"]
- scan_data += "Weapon #[n++]: [data.weapon]"
+ scan_data += "Weapon #[weapon_count++]: [data.weapon]"
if(data.hits)
var/damage_desc
switch(data.damage)
@@ -111,12 +110,12 @@
var/time_inflicted = 0
/datum/autopsy_data/proc/copy()
- var/datum/autopsy_data/W = new()
- W.weapon = weapon
- W.damage = damage
- W.hits = hits
- W.time_inflicted = time_inflicted
- return W
+ var/datum/autopsy_data/wound_data = new()
+ wound_data.weapon = weapon
+ wound_data.damage = damage
+ wound_data.hits = hits
+ wound_data.time_inflicted = time_inflicted
+ return wound_data
/datum/autopsy_data/proc/merge_with(var/datum/autopsy_data/other)
damage += other.damage
diff --git a/code/game/objects/items/weapons/cane.dm b/code/game/objects/items/weapons/cane.dm
index e78dcbfe9502..2fef3513ae38 100644
--- a/code/game/objects/items/weapons/cane.dm
+++ b/code/game/objects/items/weapons/cane.dm
@@ -61,14 +61,13 @@
return TRUE
return ..()
-/obj/item/cane/fancy/sword/attackby(var/obj/item/knife/folding/W, var/mob/user)
-
- if(!istype(concealed_blade) && istype(W) && user.try_unequip(W, src))
+/obj/item/cane/fancy/sword/attackby(var/obj/item/used_item, var/mob/user)
+ if(!istype(concealed_blade) && istype(used_item, /obj/item/knife/folding) && user.try_unequip(used_item, src))
user.visible_message(
- SPAN_NOTICE("\The [user] has sheathed \a [W] into \the [src]."),
- SPAN_NOTICE("You sheathe \the [W] into \the [src].")
+ SPAN_NOTICE("\The [user] has sheathed \a [used_item] into \the [src]."),
+ SPAN_NOTICE("You sheathe \the [used_item] into \the [src].")
)
- concealed_blade = W
+ concealed_blade = used_item
update_icon()
user.update_inhand_overlays()
return TRUE
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 37ebe84e2db5..2dadd2bbf4d5 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -35,8 +35,8 @@
else
. += "It has a blank space for a signature."
-/obj/item/card/union/attackby(var/obj/item/thing, var/mob/user)
- if(IS_PEN(thing))
+/obj/item/card/union/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_PEN(used_item))
if(signed_by)
to_chat(user, SPAN_WARNING("\The [src] has already been signed."))
else
@@ -63,9 +63,9 @@
. = ..()
add_overlay(overlay_image(icon, "[icon_state]-color", detail_color))
-/obj/item/card/data/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/integrated_electronics/detailer))
- var/obj/item/integrated_electronics/detailer/D = I
+/obj/item/card/data/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/integrated_electronics/detailer))
+ var/obj/item/integrated_electronics/detailer/D = used_item
detail_color = D.detail_color
update_icon()
return ..()
diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm
index c6ba8afe150d..18245dfe7fbd 100644
--- a/code/game/objects/items/weapons/clown_items.dm
+++ b/code/game/objects/items/weapons/clown_items.dm
@@ -24,7 +24,7 @@
w_class = ITEM_SIZE_SMALL
throw_speed = 3
throw_range = 15
- attack_verb = list("HONKED")
+ attack_verb = "HONKED"
material = /decl/material/solid/metal/steel
matter = list(
/decl/material/solid/organic/plastic = MATTER_AMOUNT_SECONDARY
diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm
index 8fb5342ed6e6..828d94861e61 100644
--- a/code/game/objects/items/weapons/defib.dm
+++ b/code/game/objects/items/weapons/defib.dm
@@ -69,23 +69,23 @@
return TRUE
// TODO: This should really use the cell extension
-/obj/item/defibrillator/attackby(obj/item/W, mob/user, params)
- if(W == paddles)
+/obj/item/defibrillator/attackby(obj/item/used_item, mob/user, params)
+ if(used_item == paddles)
reattach_paddles(user)
return TRUE
- else if(istype(W, /obj/item/cell))
+ else if(istype(used_item, /obj/item/cell))
if(bcell)
to_chat(user, "\The [src] already has a cell.")
else
- if(!user.try_unequip(W))
+ if(!user.try_unequip(used_item))
return TRUE
- W.forceMove(src)
- bcell = W
+ used_item.forceMove(src)
+ bcell = used_item
to_chat(user, "You install a cell in \the [src].")
update_icon()
return TRUE
- else if(IS_SCREWDRIVER(W))
+ else if(IS_SCREWDRIVER(used_item))
if(bcell)
bcell.update_icon()
bcell.dropInto(loc)
@@ -365,8 +365,8 @@
H.resuscitate()
var/obj/item/organ/internal/cell/potato = H.get_organ(BP_CELL, /obj/item/organ/internal/cell)
if(potato && potato.cell)
- var/obj/item/cell/C = potato.cell
- C.give(chargecost)
+ var/obj/item/cell/cell = potato.cell
+ cell.give(chargecost)
ADJ_STATUS(H, STAT_ASLEEP, -60)
log_and_message_admins("used \a [src] to revive [key_name(H)].")
@@ -471,14 +471,14 @@
cooldowntime = (3 SECONDS)
/obj/item/shockpaddles/robot/check_charge(var/charge_amt)
- if(isrobot(src.loc))
- var/mob/living/silicon/robot/R = src.loc
- return (R.cell && R.cell.check_charge(charge_amt))
+ if(isrobot(loc))
+ var/mob/living/silicon/robot/robot = loc
+ return robot.cell?.check_charge(charge_amt)
/obj/item/shockpaddles/robot/checked_use(var/charge_amt)
- if(isrobot(src.loc))
- var/mob/living/silicon/robot/R = src.loc
- return (R.cell && R.cell.checked_use(charge_amt))
+ if(isrobot(loc))
+ var/mob/living/silicon/robot/robot = loc
+ return robot.cell?.checked_use(charge_amt)
/obj/item/shockpaddles/rig
name = "mounted defibrillator"
@@ -490,19 +490,19 @@
wielded = 1
/obj/item/shockpaddles/rig/check_charge(var/charge_amt)
- if(istype(src.loc, /obj/item/rig_module/device/defib))
- var/obj/item/rig_module/device/defib/module = src.loc
+ if(istype(loc, /obj/item/rig_module/device/defib))
+ var/obj/item/rig_module/device/defib/module = loc
return (module.holder && module.holder.cell && module.holder.cell.check_charge(charge_amt))
/obj/item/shockpaddles/rig/checked_use(var/charge_amt)
- if(istype(src.loc, /obj/item/rig_module/device/defib))
- var/obj/item/rig_module/device/defib/module = src.loc
+ if(istype(loc, /obj/item/rig_module/device/defib))
+ var/obj/item/rig_module/device/defib/module = loc
return (module.holder && module.holder.cell && module.holder.cell.checked_use(charge_amt))
/obj/item/shockpaddles/rig/set_cooldown(var/delay)
..()
- if(istype(src.loc, /obj/item/rig_module/device/defib))
- var/obj/item/rig_module/device/defib/module = src.loc
+ if(istype(loc, /obj/item/rig_module/device/defib))
+ var/obj/item/rig_module/device/defib/module = loc
module.next_use = world.time + delay
/*
Shockpaddles that are linked to a base unit
diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm
index f67a1791c48d..374f19e6ccb2 100644
--- a/code/game/objects/items/weapons/dice.dm
+++ b/code/game/objects/items/weapons/dice.dm
@@ -5,7 +5,7 @@
icon_state = "d66"
w_class = ITEM_SIZE_TINY
var/sides = 6
- attack_verb = list("diced")
+ attack_verb = "diced"
material = /decl/material/solid/organic/plastic
/obj/item/dice/Initialize()
@@ -77,7 +77,7 @@
/obj/item/dice/d100
name = "d100"
desc = "A die with ten sides. This one is for the tens digit."
- icon_state = "d10010"
+ icon_state = "d1001"
sides = 10
/obj/item/dice/d100/roll_die()
diff --git a/code/game/objects/items/weapons/ecigs.dm b/code/game/objects/items/weapons/ecigs.dm
index 55789ad967b9..353404026db9 100644
--- a/code/game/objects/items/weapons/ecigs.dm
+++ b/code/game/objects/items/weapons/ecigs.dm
@@ -131,14 +131,14 @@
M.update_equipment_overlay(slot_wear_mask_str, redraw_mob = FALSE)
M.update_inhand_overlays()
-/obj/item/clothing/mask/smokable/ecig/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/chems/ecig_cartridge))
+/obj/item/clothing/mask/smokable/ecig/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/chems/ecig_cartridge))
if (ec_cartridge)//can't add second one
to_chat(user, SPAN_NOTICE("A cartridge has already been installed."))
- else if(user.try_unequip(I, src))//fits in new one
- ec_cartridge = I
+ else if(user.try_unequip(used_item, src))//fits in new one
+ ec_cartridge = used_item
update_icon()
- to_chat(user, SPAN_NOTICE("You insert \the [I] into \the [src]."))
+ to_chat(user, SPAN_NOTICE("You insert \the [used_item] into \the [src]."))
return TRUE
return ..()
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 289c8d6fcd57..296e348430d4 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -28,12 +28,12 @@
wires = null
return ..()
-/obj/item/plastique/attackby(var/obj/item/I, var/mob/user)
- if(IS_SCREWDRIVER(I))
+/obj/item/plastique/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_SCREWDRIVER(used_item))
open_panel = !open_panel
to_chat(user, "You [open_panel ? "open" : "close"] the wire panel.")
return TRUE
- else if(IS_WIRECUTTER(I) || IS_MULTITOOL(I) || istype(I, /obj/item/assembly/signaler ))
+ else if(IS_WIRECUTTER(used_item) || IS_MULTITOOL(used_item) || istype(used_item, /obj/item/assembly/signaler ))
return wires.Interact(user)
else
return ..()
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index 99b4cb049def..f50b680ff129 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -106,11 +106,11 @@
/obj/item/flamethrower/isflamesource()
return lit
-/obj/item/flamethrower/attackby(obj/item/W, mob/user)
+/obj/item/flamethrower/attackby(obj/item/used_item, mob/user)
if(user.incapacitated())
return TRUE
- if(IS_WRENCH(W) && !secured)//Taking this apart
+ if(IS_WRENCH(used_item) && !secured)//Taking this apart
var/turf/T = get_turf(src)
if(welding_tool)
welding_tool.dropInto(T)
@@ -128,14 +128,14 @@
qdel(src)
return TRUE
- if(IS_SCREWDRIVER(W) && igniter && !lit)
+ if(IS_SCREWDRIVER(used_item) && igniter && !lit)
secured = !secured
to_chat(user, SPAN_NOTICE("\The [igniter] is now [secured ? "secured" : "unsecured"]!"))
update_icon()
return TRUE
- if(isigniter(W))
- var/obj/item/assembly/igniter/I = W
+ if(isigniter(used_item))
+ var/obj/item/assembly/igniter/I = used_item
if(I.secured)
to_chat(user, SPAN_WARNING("\The [I] is not ready to attach yet! Use a screwdriver on it first."))
return TRUE
@@ -149,23 +149,23 @@
update_icon()
return TRUE
- if(istype(W, /obj/item/tank))
+ if(istype(used_item, /obj/item/tank))
if(tank)
to_chat(user, SPAN_WARNING("There appears to already be a tank loaded in \the [src]!"))
return TRUE
- user.drop_from_inventory(W, src)
- tank = W
+ user.drop_from_inventory(used_item, src)
+ tank = used_item
update_icon()
return TRUE
- if(istype(W, /obj/item/scanner/gas))
- var/obj/item/scanner/gas/A = W
+ if(istype(used_item, /obj/item/scanner/gas))
+ var/obj/item/scanner/gas/A = used_item
A.analyze_gases(src, user)
return TRUE
- if(W.isflamesource()) // you can light it with external input, even without an igniter
+ if(used_item.isflamesource()) // you can light it with external input, even without an igniter
attempt_lighting(user, TRUE)
update_icon()
return TRUE
diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm
index 62f1c7e3fe4a..331c51c130ee 100644
--- a/code/game/objects/items/weapons/gift_wrappaper.dm
+++ b/code/game/objects/items/weapons/gift_wrappaper.dm
@@ -35,8 +35,8 @@
return
to_chat(user, "You can't move.")
-/obj/effect/spresent/attackby(obj/item/W, mob/user)
- if(!IS_WIRECUTTER(W))
+/obj/effect/spresent/attackby(obj/item/used_item, mob/user)
+ if(!IS_WIRECUTTER(used_item))
to_chat(user, "I need wirecutters for that.")
return TRUE
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index be47c0d7390d..060c4864e227 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -48,9 +48,9 @@
if(path == 1)
add_overlay("[icon_state]-locked")
-/obj/item/grenade/chem_grenade/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/assembly_holder) && (!stage || stage==1) && path != 2)
- var/obj/item/assembly_holder/det = W
+/obj/item/grenade/chem_grenade/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item,/obj/item/assembly_holder) && (!stage || stage==1) && path != 2)
+ var/obj/item/assembly_holder/det = used_item
if(istype(det.a_left,det.a_right.type) || (!isigniter(det.a_left) && !isigniter(det.a_right)))
to_chat(user, "Assembly must contain one igniter.")
return TRUE
@@ -60,8 +60,8 @@
if(!user.try_unequip(det, src))
return TRUE
path = 1
- log_and_message_admins("has attached \a [W] to \the [src].")
- to_chat(user, "You add [W] to the metal casing.")
+ log_and_message_admins("has attached \a [used_item] to \the [src].")
+ to_chat(user, "You add [used_item] to the metal casing.")
playsound(src.loc, 'sound/items/Screwdriver2.ogg', 25, -3)
detonator = det
if(istimer(detonator.a_left))
@@ -73,7 +73,7 @@
SetName("unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]")
stage = 1
. = TRUE
- else if(IS_SCREWDRIVER(W) && path != 2)
+ else if(IS_SCREWDRIVER(used_item) && path != 2)
if(stage == 1)
path = 1
if(beakers.len)
@@ -97,22 +97,22 @@
stage = 1
active = FALSE
. = TRUE
- else if(is_type_in_list(W, allowed_containers) && (!stage || stage==1) && path != 2)
+ else if(is_type_in_list(used_item, allowed_containers) && (!stage || stage==1) && path != 2)
path = 1
if(beakers.len == 2)
to_chat(user, "The grenade can not hold more containers.")
return TRUE
else
- if(W.reagents.total_volume)
- if(!user.try_unequip(W, src))
+ if(used_item.reagents.total_volume)
+ if(!user.try_unequip(used_item, src))
return TRUE
- to_chat(user, "You add \the [W] to the assembly.")
- beakers += W
+ to_chat(user, "You add \the [used_item] to the assembly.")
+ beakers += used_item
stage = 1
SetName("unsecured grenade with [beakers.len] containers[detonator?" and detonator":""]")
. = TRUE
else
- to_chat(user, "\The [W] is empty.")
+ to_chat(user, "\The [used_item] is empty.")
return TRUE
if(.)
update_icon()
diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm
index 138a3b7df34c..ef1232a46a31 100644
--- a/code/game/objects/items/weapons/grenades/flashbang.dm
+++ b/code/game/objects/items/weapons/grenades/flashbang.dm
@@ -7,25 +7,22 @@
/obj/item/grenade/flashbang/detonate()
..()
+ var/turf/our_turf = get_turf(src)
+ on_detonate(our_turf)
+ new /obj/effect/sparks(our_turf)
+ new /obj/effect/effect/smoke/illumination(our_turf, 5, 30, 1, "#ffffff")
+ qdel(src)
+
+/obj/item/grenade/flashbang/proc/on_detonate(turf/our_turf)
var/list/victims = list()
var/list/objs = list()
- var/turf/T = get_turf(src)
- get_listeners_in_range(T, 7, victims, objs)
- for(var/mob/living/M in victims)
- bang(T, M)
-
- FOR_DVIEW(var/obj/effect/blob/B, 7, T, INVISIBILITY_MAXIMUM) //Blob damage here
- var/damage = round(30/(get_dist(B,T)+1))
- B.take_damage(damage, BURN)
- END_FOR_DVIEW
-
- new /obj/effect/sparks(loc)
- new /obj/effect/effect/smoke/illumination(loc, 5, 30, 1, "#ffffff")
- qdel(src)
+ get_listeners_in_range(our_turf, 7, victims, objs)
+ for(var/mob/living/victim in victims)
+ bang(our_turf, victim)
// Added a new proc called 'bang' that takes a location and a person to be banged.
// Called during the loop that bangs people in lockers/containers and when banging
-// people in normal view. Could theroetically be called during other explosions.
+// people in normal view. Could theoretically be called during other explosions.
// -- Polymorph
/obj/item/grenade/flashbang/proc/bang(var/turf/T , var/mob/living/M)
to_chat(M, SPAN_DANGER("BANG"))
diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm
index 29b99d979ac2..42ef0fe712ed 100644
--- a/code/game/objects/items/weapons/grenades/grenade.dm
+++ b/code/game/objects/items/weapons/grenades/grenade.dm
@@ -81,8 +81,8 @@
if(T)
T.hotspot_expose(700,125)
-/obj/item/grenade/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/item/grenade/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item))
switch(det_time)
if (1)
det_time = 10
diff --git a/code/game/objects/items/weapons/grenades/smokebomb.dm b/code/game/objects/items/weapons/grenades/smokebomb.dm
index 1347194837ec..2ba6f0b26f7d 100644
--- a/code/game/objects/items/weapons/grenades/smokebomb.dm
+++ b/code/game/objects/items/weapons/grenades/smokebomb.dm
@@ -18,10 +18,6 @@
smoke.attach(src)
smoke.set_up(10, 0, get_turf(src))
START_PROCESSING(SSobj, src)
- for(var/obj/effect/blob/B in view(8,src))
- var/damage = round(30/(get_dist(B,src)+1))
- B.current_health -= damage
- B.update_icon()
QDEL_IN(src, 8 SECONDS)
/obj/item/grenade/smokebomb/Process()
diff --git a/code/game/objects/items/weapons/locator.dm b/code/game/objects/items/weapons/locator.dm
index a6ad7b1def9d..01fe0fcc8c02 100644
--- a/code/game/objects/items/weapons/locator.dm
+++ b/code/game/objects/items/weapons/locator.dm
@@ -51,11 +51,11 @@ Frequency:
if (sr)
src.temp += "Located Beacons:
"
- for(var/obj/item/radio/beacon/W in global.radio_beacons)
- if(!W.functioning)
+ for(var/obj/item/radio/beacon/radio in global.radio_beacons)
+ if(!radio.functioning)
continue
- if (W.frequency == src.frequency)
- var/turf/tr = get_turf(W)
+ if (radio.frequency == src.frequency)
+ var/turf/tr = get_turf(radio)
if (tr.z == sr.z && tr)
var/direct = max(abs(tr.x - sr.x), abs(tr.y - sr.y))
if (direct < 5)
@@ -68,19 +68,19 @@ Frequency:
direct = "weak"
else
direct = "very weak"
- src.temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]
"
+ src.temp += "[radio.code]-[dir2text(get_dir(sr, tr))]-[direct]
"
src.temp += "Extranneous Signals:
"
- for (var/obj/item/implant/tracking/W in global.tracking_implants)
- if (!W.implanted || !(istype(W.loc,/obj/item/organ/external) || ismob(W.loc)))
+ for (var/obj/item/implant/tracking/implant in global.tracking_implants)
+ if (!implant.implanted || !(istype(implant.loc,/obj/item/organ/external) || ismob(implant.loc)))
continue
else
- var/mob/M = W.loc
+ var/mob/M = implant.loc
if (M.stat == DEAD)
if (M.timeofdeath + 6000 < world.time)
continue
- var/turf/tr = get_turf(W)
+ var/turf/tr = get_turf(implant)
if (tr.z == sr.z && tr)
var/direct = max(abs(tr.x - sr.x), abs(tr.y - sr.y))
if (direct < 20)
@@ -91,7 +91,7 @@ Frequency:
direct = "strong"
else
direct = "weak"
- src.temp += "[W.id]-[dir2text(get_dir(sr, tr))]-[direct]
"
+ src.temp += "[implant.id]-[dir2text(get_dir(sr, tr))]-[direct]
"
src.temp += "You are at \[[sr.x],[sr.y],[sr.z]\] in orbital coordinates.
Refresh
"
else
diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm
index babc46c5ba58..305f721f1730 100644
--- a/code/game/objects/items/weapons/material/ashtray.dm
+++ b/code/game/objects/items/weapons/material/ashtray.dm
@@ -22,23 +22,23 @@
else if (contents.len >= max_butts/2)
add_overlay("ashtray_half")
-/obj/item/ashtray/attackby(obj/item/W, mob/user)
- if (istype(W,/obj/item/trash/cigbutt) || istype(W,/obj/item/clothing/mask/smokable/cigarette) || istype(W, /obj/item/flame/match))
+/obj/item/ashtray/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item,/obj/item/trash/cigbutt) || istype(used_item,/obj/item/clothing/mask/smokable/cigarette) || istype(used_item, /obj/item/flame/match))
if (contents.len >= max_butts)
to_chat(user, "\The [src] is full.")
return TRUE
- if (istype(W,/obj/item/clothing/mask/smokable/cigarette))
- var/obj/item/clothing/mask/smokable/cigarette/cig = W
+ if (istype(used_item,/obj/item/clothing/mask/smokable/cigarette))
+ var/obj/item/clothing/mask/smokable/cigarette/cig = used_item
if (cig.lit == 1)
visible_message(SPAN_NOTICE("\The [user] crushes \the [cig] in \the [src], putting it out."))
- W = cig.extinguish_fire(no_message = TRUE)
+ used_item = cig.extinguish_fire(no_message = TRUE)
else if (cig.lit == 0)
to_chat(user, SPAN_NOTICE("You place \the [cig] in \the [src] without even smoking it. Why would you do that?"))
else
- visible_message(SPAN_NOTICE("\The [user] places \the [W] in \the [src]."))
+ visible_message(SPAN_NOTICE("\The [user] places \the [used_item] in \the [src]."))
- if(user.try_unequip(W, src))
+ if(user.try_unequip(used_item, src))
set_extension(src, /datum/extension/scent/ashtray)
update_icon()
return TRUE
diff --git a/code/game/objects/items/weapons/material/folding.dm b/code/game/objects/items/weapons/material/folding.dm
index 5d298afbd27b..e5bcd0486741 100644
--- a/code/game/objects/items/weapons/material/folding.dm
+++ b/code/game/objects/items/weapons/material/folding.dm
@@ -27,13 +27,12 @@
add_fingerprint(user)
/obj/item/knife/folding/update_attack_force()
- ..()
+ . = ..()
if(open)
set_edge(TRUE)
set_sharp(TRUE)
w_class = ITEM_SIZE_NORMAL
attack_verb = list("slashed", "stabbed")
- ..()
else
set_edge(initial(edge))
set_sharp(initial(sharp))
@@ -58,7 +57,7 @@
valid_handle_colors = list(WOOD_COLOR_GENERIC, WOOD_COLOR_RICH, WOOD_COLOR_BLACK, WOOD_COLOR_CHOCOLATE, WOOD_COLOR_PALE)
/obj/item/knife/folding/wood/get_striking_material(mob/user, atom/target)
- . = open ? ..() : GET_DECL(/decl/material/solid/organic/wood) // todo: different handle colors -> different material
+ . = open ? ..() : GET_DECL(/decl/material/solid/organic/wood/oak) // todo: different handle colors -> different material
/obj/item/knife/folding/tacticool
name = "folding knife"
diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm
index b33cef4f1c83..344eb317abbf 100644
--- a/code/game/objects/items/weapons/material/kitchen.dm
+++ b/code/game/objects/items/weapons/material/kitchen.dm
@@ -1,23 +1,25 @@
-/obj/item/kitchen
- icon = 'icons/obj/kitchen.dmi'
- material = /decl/material/solid/metal/aluminium
- material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME
-
/*
* Rolling Pins
*/
-/obj/item/kitchen/rollingpin
+/obj/item/rollingpin
name = "rolling pin"
desc = "Used to knock out the Bartender."
- icon_state = "rolling_pin"
+ icon_state = ICON_STATE_WORLD
+ icon = 'icons/obj/items/rolling_pin.dmi'
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
material = /decl/material/solid/organic/wood/oak
+ material_alteration = MAT_FLAG_ALTERATION_ALL
+ color = /decl/material/solid/organic/wood/oak::color
-/obj/item/kitchen/rollingpin/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)
+/obj/item/rollingpin/use_on_mob(mob/living/target, mob/living/user, animate = TRUE)
if (user.has_genetic_condition(GENE_COND_CLUMSY) && prob(50) && user.try_unequip(src))
to_chat(user, SPAN_DANGER("\The [src] slips out of your hand and hits your head."))
user.take_organ_damage(10)
SET_STATUS_MAX(user, STAT_PARA, 2)
return TRUE
return ..()
+
+/obj/item/kitchen/rollingpin/walnut
+ material = /decl/material/solid/organic/wood/walnut
+ color = /decl/material/solid/organic/wood/walnut::color
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm
index cd4ddfb14100..12b2e317060c 100644
--- a/code/game/objects/items/weapons/material/shards.dm
+++ b/code/game/objects/items/weapons/material/shards.dm
@@ -56,14 +56,14 @@
if(has_handle)
add_overlay(overlay_image(icon, "handle", has_handle, RESET_COLOR))
-/obj/item/shard/attackby(obj/item/W, mob/user)
- if(IS_WELDER(W) && material.shard_can_repair)
- var/obj/item/weldingtool/WT = W
- if(WT.weld(0, user))
+/obj/item/shard/attackby(obj/item/used_item, mob/user)
+ if(IS_WELDER(used_item) && material.shard_can_repair)
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.weld(0, user))
material.create_object(get_turf(src))
qdel(src)
return TRUE
- if(istype(W, /obj/item/stack/cable_coil))
+ if(istype(used_item, /obj/item/stack/cable_coil))
if(!material || (material.shard_name in list(SHARD_SPLINTER, SHARD_SHRAPNEL)))
to_chat(user, SPAN_WARNING("\The [src] is not suitable for using as a shank."))
@@ -71,7 +71,7 @@
if(has_handle)
to_chat(user, SPAN_WARNING("\The [src] already has a handle."))
return TRUE
- var/obj/item/stack/cable_coil/cable = W
+ var/obj/item/stack/cable_coil/cable = used_item
if(cable.use(3))
to_chat(user, SPAN_NOTICE("You wind some cable around the thick end of \the [src]."))
has_handle = cable.color
diff --git a/code/game/objects/items/weapons/material/stick.dm b/code/game/objects/items/weapons/material/stick.dm
index d752ca73f46d..92faaca3265f 100644
--- a/code/game/objects/items/weapons/material/stick.dm
+++ b/code/game/objects/items/weapons/material/stick.dm
@@ -5,6 +5,7 @@
icon_state = ICON_STATE_WORLD
w_class = ITEM_SIZE_NORMAL
material = /decl/material/solid/organic/wood/oak
+ color = /decl/material/solid/organic/wood/oak::color
attack_verb = list("poked", "jabbed")
material_alteration = MAT_FLAG_ALTERATION_ALL
lock_picking_level = 3
@@ -14,22 +15,22 @@
user.visible_message("\The [user] snaps [src].", "You snap [src].")
shatter(0)
-/obj/item/stick/attackby(obj/item/W, mob/user)
+/obj/item/stick/attackby(obj/item/used_item, mob/user)
- if(W.is_sharp() && W.has_edge() && !sharp)
- user.visible_message("[user] sharpens [src] with [W].", "You sharpen [src] using [W].")
+ if(used_item.is_sharp() && used_item.has_edge() && !sharp)
+ user.visible_message("[user] sharpens [src] with [used_item].", "You sharpen [src] using [used_item].")
set_sharp(TRUE)
SetName("sharpened " + name)
update_attack_force()
return TRUE
- if(!sharp && (istype(W, /obj/item/stack/material/bolt) || istype(W, /obj/item/stack/material/bundle)))
+ if(!sharp && (istype(used_item, /obj/item/stack/material/bolt) || istype(used_item, /obj/item/stack/material/bundle)))
var/choice = input(user, "Do you want to make a torch, or a splint?", "Stick Crafting") as null|anything in list("Torch", "Splint")
- if(!choice || QDELETED(user) || user.get_active_held_item() != W || QDELETED(W) || !QDELETED(src) || (loc != user && !Adjacent(user)) || sharp)
+ if(!choice || QDELETED(user) || user.get_active_held_item() != used_item || QDELETED(used_item) || !QDELETED(src) || (loc != user && !Adjacent(user)) || sharp)
return TRUE
- var/obj/item/stack/material/cloth = W
+ var/obj/item/stack/material/cloth = used_item
var/atom/product_type
var/cloth_cost
@@ -43,7 +44,7 @@
return TRUE
if(cloth.get_amount() < cloth_cost)
- to_chat(user, SPAN_WARNING("You need at least [cloth_cost] unit\s of material to create \a [initial(product_type.name)]."))
+ to_chat(user, SPAN_WARNING("You need at least [cloth_cost] unit\s of material to create \a [atom_info_repository.get_name_for(product_type)]."))
return TRUE
// Ugly way to check for dried grass vs regular grass.
@@ -53,7 +54,7 @@
var/was_held = (loc == user)
cloth.use(cloth_cost)
if(!was_held || user.try_unequip(src))
- var/obj/item/thing = new product_type(get_turf(src), material?.type, W.material?.type)
+ var/obj/item/thing = new product_type(get_turf(src), material?.type, used_item.material?.type)
if(was_held)
user.put_in_hands(thing)
to_chat(user, SPAN_NOTICE("You fashion \the [src] into \a [thing]."))
@@ -74,3 +75,7 @@
user.do_attack_animation(target)
return TRUE
return ..()
+
+/obj/item/stick/walnut
+ material = /decl/material/solid/organic/wood/walnut
+ color = /decl/material/solid/organic/wood/walnut::color
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/material/swiss.dm b/code/game/objects/items/weapons/material/swiss.dm
index 5d8c473145fb..33db97ea49cd 100644
--- a/code/game/objects/items/weapons/material/swiss.dm
+++ b/code/game/objects/items/weapons/material/swiss.dm
@@ -94,7 +94,7 @@
. += "Its [lowertext(active_tool)] is folded out."
/obj/item/knife/folding/swiss/update_attack_force()
- ..()
+ . = ..()
if(active_tool == SWISSKNF_CLOSED)
w_class = initial(w_class)
else
diff --git a/code/game/objects/items/weapons/material/swords.dm b/code/game/objects/items/weapons/material/swords.dm
index 094dd9767a23..8723695261a2 100644
--- a/code/game/objects/items/weapons/material/swords.dm
+++ b/code/game/objects/items/weapons/material/swords.dm
@@ -20,7 +20,7 @@
_base_attack_force = 15
var/draw_handle = TRUE
-/obj/item/edge/set_edge(new_edge)
+/obj/item/sword/set_edge(new_edge)
. = ..()
if(. && !has_edge())
attack_verb = list("attacked", "stabbed", "jabbed", "smacked", "prodded")
diff --git a/code/game/objects/items/weapons/melee/baseball_bat.dm b/code/game/objects/items/weapons/melee/baseball_bat.dm
index 9499208e9c84..b3f851b290c9 100644
--- a/code/game/objects/items/weapons/melee/baseball_bat.dm
+++ b/code/game/objects/items/weapons/melee/baseball_bat.dm
@@ -2,6 +2,7 @@
name = "bat"
desc = "HOME RUN!"
icon = 'icons/obj/items/weapon/bat.dmi'
+ icon_state = ICON_STATE_WORLD
w_class = ITEM_SIZE_LARGE
can_be_twohanded = TRUE
pickup_sound = 'sound/foley/scrape1.ogg'
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index bfc53022ae67..58437b40dcb6 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -39,9 +39,9 @@
var/inactive_sound = 'sound/weapons/saberoff.ogg'
- attack_verb = list("hit")
+ attack_verb = "hit"
var/list/active_attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
- var/list/inactive_attack_verb = list("hit")
+ var/list/inactive_attack_verb = "hit"
/obj/item/energy_blade/get_max_weapon_force()
return _active_base_attack_force
@@ -82,6 +82,9 @@
return _active_base_attack_force
return _base_attack_force
+/obj/item/energy_blade/pick_attack_verb()
+ return DEFAULTPICK(active ? active_attack_verb : inactive_attack_verb, ..())
+
/obj/item/energy_blade/proc/toggle_active(var/mob/user)
active = !active
@@ -93,7 +96,6 @@
base_parry_chance = active_parry_chance
armor_penetration = active_armour_pen
hitsound = active_hitsound
- attack_verb = active_attack_verb
w_class = max(w_class, ITEM_SIZE_NORMAL)
slot_flags &= ~SLOT_POCKET
@@ -108,7 +110,6 @@
base_parry_chance = initial(base_parry_chance)
armor_penetration = initial(armor_penetration)
hitsound = initial(hitsound)
- attack_verb = inactive_attack_verb
w_class = initial(w_class)
slot_flags = initial(slot_flags)
diff --git a/code/game/objects/items/weapons/melee/energy_projected.dm b/code/game/objects/items/weapons/melee/energy_projected.dm
index 927cff0a5f96..1009f5745438 100644
--- a/code/game/objects/items/weapons/melee/energy_projected.dm
+++ b/code/game/objects/items/weapons/melee/energy_projected.dm
@@ -38,7 +38,7 @@
. = ..()
check_loc()
-/obj/item/energy_blade/projected/on_picked_up(mob/user)
+/obj/item/energy_blade/projected/on_picked_up(mob/user, atom/old_loc)
. = ..()
check_loc()
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index 87d93544aebe..2efa8c00554f 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -68,8 +68,8 @@
to_chat(user, SPAN_NOTICE("You have finished mopping!"))
return TRUE
-/obj/effect/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/mop) || istype(I, /obj/item/soap))
+/obj/effect/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/mop) || istype(used_item, /obj/item/soap))
return FALSE
return ..()
diff --git a/code/game/objects/items/weapons/secrets_disk.dm b/code/game/objects/items/weapons/secrets_disk.dm
index afcf3d485403..70a6c4036b17 100644
--- a/code/game/objects/items/weapons/secrets_disk.dm
+++ b/code/game/objects/items/weapons/secrets_disk.dm
@@ -58,9 +58,9 @@
to_chat(user, "The cryptographic lock on this disk is far too complex. Your sequencer can't break the code.")
return 0
-/obj/item/disk/secret_project/attackby(obj/item/W, mob/user)
- if(istype(W,/obj/item/card/id))
- var/obj/item/card/id/ID = W
+/obj/item/disk/secret_project/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item,/obj/item/card/id))
+ var/obj/item/card/id/ID = used_item
if(check_access(ID))
locked = !locked
to_chat(user, "You swipe your card and [locked ? "lock":"unlock"] the disk.")
diff --git a/code/game/objects/items/weapons/shields/shield_crafting.dm b/code/game/objects/items/weapons/shields/shield_crafting.dm
index 307db9bce88b..783be5a4e6e2 100644
--- a/code/game/objects/items/weapons/shields/shield_crafting.dm
+++ b/code/game/objects/items/weapons/shields/shield_crafting.dm
@@ -5,6 +5,7 @@
icon_state = ICON_STATE_WORLD
icon = 'icons/obj/items/shield_fasteners.dmi'
material = /decl/material/solid/metal/iron
+ color = /decl/material/solid/metal/iron::color
material_alteration = MAT_FLAG_ALTERATION_ALL
// TODO: single-step slapcrafting
@@ -14,6 +15,7 @@
icon_state = ICON_STATE_WORLD
abstract_type = /obj/item/shield_base
material = /decl/material/solid/organic/wood/oak
+ color = /decl/material/solid/organic/wood/oak::color
material_alteration = MAT_FLAG_ALTERATION_ALL
var/wooden_icon
var/fittings_type = /obj/item/shield_fasteners
diff --git a/code/game/objects/items/weapons/shields/shield_riot.dm b/code/game/objects/items/weapons/shields/shield_riot.dm
index 0cc0c9324f0a..afd8e5959e44 100644
--- a/code/game/objects/items/weapons/shields/shield_riot.dm
+++ b/code/game/objects/items/weapons/shields/shield_riot.dm
@@ -30,10 +30,10 @@
return 0
return base_block_chance
-/obj/item/shield/riot/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/baton))
+/obj/item/shield/riot/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/baton))
if(cooldown < world.time - 25)
- user.visible_message("[user] bashes [src] with [W]!")
+ user.visible_message("[user] bashes [src] with [used_item]!")
playsound(user.loc, 'sound/effects/shieldbash.ogg', 50, 1)
cooldown = world.time
return TRUE
diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm
index 99614d0fe16e..ebb10a60b96d 100644
--- a/code/game/objects/items/weapons/soap.dm
+++ b/code/game/objects/items/weapons/soap.dm
@@ -54,7 +54,7 @@
update_icon()
/obj/item/soap/proc/wet()
- add_to_reagents(/decl/material/liquid/cleaner/soap, SOAP_CLEANER_ON_WET)
+ add_to_reagents(/decl/material/liquid/cleaner/soap, SOAP_CLEANER_ON_WET, phase = MAT_PHASE_LIQUID)
/obj/item/soap/Crossed(atom/movable/AM)
var/mob/living/victim = AM
@@ -111,13 +111,13 @@
return TRUE
return ..()
-/obj/item/soap/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/key))
+/obj/item/soap/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/key))
if(key_data)
to_chat(user, SPAN_WARNING("\The [src] already has a key imprint."))
else
- to_chat(user, SPAN_NOTICE("You imprint \the [I] into \the [src]."))
- var/obj/item/key/K = I
+ to_chat(user, SPAN_NOTICE("You imprint \the [used_item] into \the [src]."))
+ var/obj/item/key/K = used_item
key_data = K.key_data
update_icon()
return TRUE
diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm
index 7a234732c98e..2b3e166a2d24 100644
--- a/code/game/objects/items/weapons/storage/backpack.dm
+++ b/code/game/objects/items/weapons/storage/backpack.dm
@@ -13,11 +13,15 @@
storage = /datum/storage/backpack
material = /decl/material/solid/organic/leather/synth
+/obj/item/backpack/get_associated_equipment_slots()
+ . = ..()
+ LAZYDISTINCTADD(., slot_back_str)
+
//Cannot be washed :(
/obj/item/backpack/can_contaminate()
return FALSE
-/obj/item/backpack/attackby(obj/item/W, mob/user)
+/obj/item/backpack/attackby(obj/item/used_item, mob/user)
if (storage?.use_sound)
playsound(src.loc, storage.use_sound, 50, 1, -5)
return ..()
@@ -51,10 +55,10 @@
explosion(src.loc,(dist),(dist*2),(dist*4))
return 1000
-/obj/item/backpack/holding/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/backpack/holding) || istype(W, /obj/item/bag/trash/advanced))
+/obj/item/backpack/holding/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/backpack/holding) || istype(used_item, /obj/item/bag/trash/advanced))
to_chat(user, "The spatial interfaces of the two devices conflict and malfunction.")
- qdel(W)
+ qdel(used_item)
return 1
return ..()
@@ -344,7 +348,7 @@
anchored = i ? TRUE : FALSE
alpha = i ? 128 : initial(alpha)
-/obj/item/backpack/satchel/flat/attackby(obj/item/W, mob/user)
+/obj/item/backpack/satchel/flat/attackby(obj/item/used_item, mob/user)
var/turf/T = get_turf(src)
if(hides_under_flooring() && isturf(T) && !T.is_plating())
to_chat(user, "You must remove the plating first.")
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 5b60770ac977..6e4dde21a2b7 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -58,10 +58,10 @@
origin_tech = @'{"exoticmatter":5,"materials":6}'
storage = /datum/storage/bag/trash/advanced
-/obj/item/bag/trash/advanced/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/backpack/holding) || istype(W, /obj/item/bag/trash/advanced))
+/obj/item/bag/trash/advanced/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/backpack/holding) || istype(used_item, /obj/item/bag/trash/advanced))
to_chat(user, "The spatial interfaces of the two devices conflict and malfunction.")
- qdel(W)
+ qdel(used_item)
return 1
return ..()
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index 9c123d4624dc..37a12e8d3dcc 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -89,9 +89,9 @@
if(proximity && user?.mind?.assigned_job?.is_holy)
if(A.reagents && A.reagents.has_reagent(/decl/material/liquid/water)) //blesses all the water in the holder
to_chat(user, SPAN_NOTICE("You bless \the [A].")) // I wish it was this easy in nethack
- LAZYSET(A.reagents.reagent_data, /decl/material/liquid/water, list("holy" = TRUE))
+ LAZYSET(A.reagents.reagent_data, /decl/material/liquid/water, list(DATA_WATER_HOLINESS = TRUE))
-/obj/item/bible/attackby(obj/item/W, mob/user)
+/obj/item/bible/attackby(obj/item/used_item, mob/user)
if(storage?.use_sound)
playsound(loc, storage.use_sound, 50, 1, -5)
return ..()
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index 0b46f4484c5e..fa38daee6000 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -431,6 +431,7 @@
return list(/obj/item/chems/hypospray/autoinjector/stabilizer = 7)
/obj/item/box/lights
+ abstract_type = /obj/item/box/lights
name = "box of replacement bulbs"
icon_state = "light"
desc = "This box is shaped on the inside so that only light tubes and bulbs fit."
diff --git a/code/game/objects/items/weapons/storage/fancy/_fancy.dm b/code/game/objects/items/weapons/storage/fancy/_fancy.dm
index 7dbc2d00ee76..44f9cd602a65 100644
--- a/code/game/objects/items/weapons/storage/fancy/_fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy/_fancy.dm
@@ -49,4 +49,4 @@
if(distance > 1 || !key_type)
return
var/key_count = count_by_type(contents, key_type)
- . += "There [key_count == 1? "is" : "are"] [key_count] [initial(key_type.name)]\s in the box."
+ . += "There [key_count == 1? "is" : "are"] [key_count] [atom_info_repository.get_name_for(key_type)]\s in the box."
diff --git a/code/game/objects/items/weapons/storage/fancy/cigarettes.dm b/code/game/objects/items/weapons/storage/fancy/cigarettes.dm
index b8f10502a532..379d275b5f8f 100644
--- a/code/game/objects/items/weapons/storage/fancy/cigarettes.dm
+++ b/code/game/objects/items/weapons/storage/fancy/cigarettes.dm
@@ -130,7 +130,7 @@
//cigarellos
/obj/item/box/fancy/cigarettes/cigarello
name = "pack of Trident Original cigars"
- desc = "The Trident brand's wood tipped little cigar, favored by the Sol corps diplomatique for their pleasant aroma. Machine made on Mars for over 100 years."
+ desc = "The Trident brand's wood tipped little cigar, favored by some for their pleasant aroma. Machine made on Mars for over 100 years."
icon = 'icons/obj/items/storage/cigpack/cigarillo.dmi'
icon_state = "CRpacket"
item_state = "Dpacket"
@@ -142,7 +142,7 @@
/obj/item/box/fancy/cigarettes/cigarello/variety
name = "pack of Trident Fruit cigars"
- desc = "The Trident brand's wood tipped little cigar, favored by the Sol corps diplomatique for their pleasant aroma. Machine made on Mars for over 100 years. This is a fruit variety pack."
+ desc = "The Trident brand's wood tipped little cigar, favored by some for their pleasant aroma. Machine made on Mars for over 100 years. This is a fruit variety pack."
icon = 'icons/obj/items/storage/cigpack/cigarillo_fruity.dmi'
icon_state = "CRFpacket"
@@ -157,7 +157,7 @@
/obj/item/box/fancy/cigarettes/cigarello/mint
name = "pack of Trident Menthol cigars"
- desc = "The Trident brand's wood tipped little cigar, favored by the Sol corps diplomatique for their pleasant aroma. Machine made on Mars for over 100 years. These are the menthol variety."
+ desc = "The Trident brand's wood tipped little cigar, favored by some for their pleasant aroma. Machine made on Mars for over 100 years. These are the menthol variety."
icon = 'icons/obj/items/storage/cigpack/cigarillo_menthol.dmi'
icon_state = "CRMpacket"
@@ -167,76 +167,57 @@
////////////////////////////////////////////////////////////////////////////////
// Syndie Cigs
////////////////////////////////////////////////////////////////////////////////
+/obj/item/box/fancy/cigarettes/covert
+ abstract_type = /obj/item/box/fancy/cigarettes/covert
+ /// (TYPEPATH) Used to reset the name and description of covert cigarette packs on init.
+ var/obj/item/box/fancy/cigarettes/disguised_as = /obj/item/box/fancy/cigarettes
+ /// (STRING) Part of a string appended to the description on init.
+ var/scribble = null
+
+/obj/item/box/fancy/cigarettes/covert/Initialize(ml, material_key)
+ . = ..()
+ if(ispath(disguised_as, /obj/item/box/fancy/cigarettes))
+ //Reset the name to the default cig pack. Done for codex reasons, since it indexes things by initial names
+ if(name == initial(name)) // allow mapped names to override it
+ SetName(disguised_as::name)
+ if(desc == initial(desc) && istext(scribble)) // ditto for mapped descs
+ desc = "[disguised_as::desc] '[scribble]' has been scribbled on it."
// Flash Powder Pack
-/obj/item/box/fancy/cigarettes/flash_powder
+/obj/item/box/fancy/cigarettes/covert/flash_powder
name = "pack of flash powder laced Trans-Stellar Duty-frees"
+ disguised_as = /obj/item/box/fancy/cigarettes
+ scribble = "F"
-/obj/item/box/fancy/cigarettes/flash_powder/Initialize(ml, material_key)
- . = ..()
- //Reset the name to the default cig pack. Done for codex reasons, since it indexes things by initial names
- var/obj/item/box/fancy/cigarettes/C = /obj/item/box/fancy/cigarettes
- if(name == initial(name))
- SetName(initial(C.name))
- if(desc == initial(desc))
- desc = "[initial(desc)] 'F' has been scribbled on it."
-
-/obj/item/box/fancy/cigarettes/flash_powder/populate_reagents()
+/obj/item/box/fancy/cigarettes/covert/flash_powder/populate_reagents()
var/max_storage_space = max(1, storage?.max_storage_space)
add_to_reagents(/decl/material/solid/metal/aluminium, max_storage_space)
add_to_reagents(/decl/material/solid/potassium, max_storage_space)
add_to_reagents(/decl/material/solid/sulfur, max_storage_space)
//Chemsmoke Pack
-/obj/item/box/fancy/cigarettes/chemsmoke
+/obj/item/box/fancy/cigarettes/covert/chemsmoke
name = "pack of smoke powder laced Trans-Stellar Duty-frees"
+ scribble = "S"
-/obj/item/box/fancy/cigarettes/chemsmoke/Initialize(ml, material_key)
- . = ..()
- //Reset the name to the default cig pack. Done for codex reasons, since it indexes things by initial names
- var/obj/item/box/fancy/cigarettes/C = /obj/item/box/fancy/cigarettes
- if(name == initial(name))
- SetName(initial(C.name))
- if(desc == initial(desc))
- desc = "[initial(desc)] 'S' has been scribbled on it."
-
-/obj/item/box/fancy/cigarettes/chemsmoke/populate_reagents()
+/obj/item/box/fancy/cigarettes/covert/chemsmoke/populate_reagents()
var/max_storage_space = max(1, storage?.max_storage_space)
add_to_reagents(/decl/material/solid/potassium, max_storage_space)
add_to_reagents(/decl/material/liquid/nutriment/sugar, max_storage_space)
add_to_reagents(/decl/material/solid/phosphorus, max_storage_space)
//Mindbreak Pack (now called /decl/chemical_reaction/hallucinogenics)
-/obj/item/box/fancy/cigarettes/mindbreak
- name = "pack of mindbreak toxin laced Trans-Stellar Duty-frees" //#TODO: maybe fix the lore for that?
+/obj/item/box/fancy/cigarettes/covert/mindbreak
+ name = "pack of hallucinogen-laced Trans-Stellar Duty-frees" //#TODO: maybe fix the lore for that?
+ scribble = "H"
-/obj/item/box/fancy/cigarettes/mindbreak/Initialize(ml, material_key)
- . = ..()
- //Reset the name to the default cig pack. Done for codex reasons, since it indexes things by initial names
- var/obj/item/box/fancy/cigarettes/C = /obj/item/box/fancy/cigarettes
- if(name == initial(name))
- SetName(initial(C.name))
- if(desc == initial(desc))
- desc = "[initial(desc)] 'MB' has been scribbled on it." //#TODO: maybe fix the lore for that?
-
-/obj/item/box/fancy/cigarettes/mindbreak/populate_reagents()
- var/max_storage_space = max(1, storage?.max_storage_space)
- add_to_reagents(/decl/material/solid/silicon, max_storage_space)
- add_to_reagents(/decl/material/liquid/fuel/hydrazine, max_storage_space)
- add_to_reagents(/decl/material/liquid/antitoxins, max_storage_space)
+/obj/item/box/fancy/cigarettes/covert/mindbreak/populate_reagents()
+ add_to_reagents(/decl/material/liquid/hallucinogenics, (3 * max(1, storage?.max_storage_space)))
-//Tricord pack (now called /decl/material/liquid/regenerator)
-/obj/item/box/fancy/cigarettes/tricord
- name = "pack of tricordazine laced Trans-Stellar Duty-frees" //#TODO: maybe fix the lore for that?
+//Tricord pack (now called 'regenerative serum')
+/obj/item/box/fancy/cigarettes/covert/tricord
+ name = "pack of regenerative serum-laced Trans-Stellar Duty-frees" //#TODO: maybe fix the lore for that?
+ scribble = "R"
-/obj/item/box/fancy/cigarettes/tricord/Initialize(ml, material_key)
- . = ..()
- //Reset the name to the default cig pack. Done for codex reasons, since it indexes things by initial names
- var/obj/item/box/fancy/cigarettes/C = /obj/item/box/fancy/cigarettes
- if(name == initial(name))
- SetName(initial(C.name))
- if(desc == initial(desc))
- desc = "[initial(desc)] 'T' has been scribbled on it." //#TODO: maybe fix the lore for that?
-
-/obj/item/box/fancy/cigarettes/tricord/populate_reagents()
+/obj/item/box/fancy/cigarettes/covert/tricord/populate_reagents()
add_to_reagents(/decl/material/liquid/regenerator, (4 * max(1, storage?.max_storage_space)))
diff --git a/code/game/objects/items/weapons/storage/fancy/vials.dm b/code/game/objects/items/weapons/storage/fancy/vials.dm
index 23cbb2db06bc..de59950c7674 100644
--- a/code/game/objects/items/weapons/storage/fancy/vials.dm
+++ b/code/game/objects/items/weapons/storage/fancy/vials.dm
@@ -46,6 +46,6 @@
else
add_overlay("ledb")
-/obj/item/lockbox/vials/attackby(obj/item/W, mob/user)
+/obj/item/lockbox/vials/attackby(obj/item/used_item, mob/user)
. = ..()
update_icon()
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/storage/laundry_basket.dm b/code/game/objects/items/weapons/storage/laundry_basket.dm
index c09205958c96..4d03a5567929 100644
--- a/code/game/objects/items/weapons/storage/laundry_basket.dm
+++ b/code/game/objects/items/weapons/storage/laundry_basket.dm
@@ -33,7 +33,7 @@
to_chat(user, "You dump \the [src]'s contents onto \the [T].")
return ..()
-/obj/item/laundry_basket/on_picked_up(mob/user)
+/obj/item/laundry_basket/on_picked_up(mob/user, atom/old_loc)
var/obj/item/laundry_basket/offhand/O = new(user)
O.SetName("[name] - second hand")
O.desc = "Your second grip on \the [src]."
diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm
index 3ad6fb923d8c..341efc0954d0 100644
--- a/code/game/objects/items/weapons/storage/lockbox.dm
+++ b/code/game/objects/items/weapons/storage/lockbox.dm
@@ -18,8 +18,8 @@
var/icon_broken = "lockbox+b"
-/obj/item/lockbox/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/card/id))
+/obj/item/lockbox/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item, /obj/item/card/id))
if(src.broken)
to_chat(user, "It appears to be broken.")
return TRUE
@@ -35,9 +35,9 @@
else
to_chat(user, "Access Denied")
return TRUE
- else if(istype(W, /obj/item/energy_blade))
- var/obj/item/energy_blade/blade = W
- if(blade.is_special_cutting_tool() && emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying."))
+ else if(istype(used_item, /obj/item/energy_blade))
+ var/obj/item/energy_blade/blade = used_item
+ if(blade.is_special_cutting_tool() && emag_act(INFINITY, user, used_item, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying."))
spark_at(src.loc, amount=5)
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
return TRUE
diff --git a/code/game/objects/items/weapons/storage/lunchbox.dm b/code/game/objects/items/weapons/storage/lunchbox.dm
index 69aefb817316..f05761ec870a 100644
--- a/code/game/objects/items/weapons/storage/lunchbox.dm
+++ b/code/game/objects/items/weapons/storage/lunchbox.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/items/storage/lunchboxes/lunchbox_rainbow.dmi'
icon_state = ICON_STATE_WORLD
w_class = ITEM_SIZE_NORMAL
- attack_verb = list("lunched")
+ attack_verb = "lunched"
material = /decl/material/solid/organic/plastic
storage = /datum/storage/lunchbox
var/tmp/filled = FALSE
diff --git a/code/game/objects/items/weapons/storage/matches.dm b/code/game/objects/items/weapons/storage/matches.dm
index 8312621ce0cb..fe883451bf5a 100644
--- a/code/game/objects/items/weapons/storage/matches.dm
+++ b/code/game/objects/items/weapons/storage/matches.dm
@@ -11,15 +11,15 @@
/obj/item/box/matches/WillContain()
return list(/obj/item/flame/match = 10)
-/obj/item/box/matches/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/flame/match))
- var/obj/item/flame/match/match = W
+/obj/item/box/matches/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/flame/match))
+ var/obj/item/flame/match/match = used_item
if(match.light(null, no_message = TRUE))
playsound(src.loc, 'sound/items/match.ogg', 60, 1, -4)
user.visible_message(
- SPAN_NOTICE("[user] strikes [W] on \the [src]."),
- SPAN_NOTICE("You strike [W] on \the [src].")
+ SPAN_NOTICE("[user] strikes [used_item] on \the [src]."),
+ SPAN_NOTICE("You strike [used_item] on \the [src].")
)
- W.update_icon()
+ used_item.update_icon()
return TRUE
return ..()
diff --git a/code/game/objects/items/weapons/storage/nuggets.dm b/code/game/objects/items/weapons/storage/nuggets.dm
index 3ecc72ce2270..c8a8b1602fc2 100644
--- a/code/game/objects/items/weapons/storage/nuggets.dm
+++ b/code/game/objects/items/weapons/storage/nuggets.dm
@@ -32,6 +32,7 @@
. += /obj/item/food/nugget
/obj/item/box/nuggets/on_update_icon()
+ . = ..()
var/datum/storage/box/nuggets/nugget_box = storage
if(length(contents) == 0 || !istype(nugget_box))
icon_state = "[initial(icon_state)]_empty"
diff --git a/code/game/objects/items/weapons/storage/picnic_basket.dm b/code/game/objects/items/weapons/storage/picnic_basket.dm
index a01f1c93088d..7ecd98a74f58 100644
--- a/code/game/objects/items/weapons/storage/picnic_basket.dm
+++ b/code/game/objects/items/weapons/storage/picnic_basket.dm
@@ -6,7 +6,7 @@
icon_state = ICON_STATE_WORLD
w_class = ITEM_SIZE_NORMAL
storage = /datum/storage/picnic_basket
- attack_verb = list("picnics")
+ attack_verb = "picnics"
material = /decl/material/solid/organic/plastic
var/tmp/filled = FALSE
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index 860536919b89..fb7ff59d4049 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -46,9 +46,9 @@
if(new_locked)
storage?.close_all()
-/obj/item/secure_storage/attackby(obj/item/W, mob/user)
+/obj/item/secure_storage/attackby(obj/item/used_item, mob/user)
var/datum/extension/lockable/lock = get_extension(src, /datum/extension/lockable)
- if(lock.attackby(W, user))
+ if(lock.attackby(used_item, user))
return TRUE
// -> storage/attackby() what with handle insertion, etc
diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm
index c2342c95d367..61fd4e38f25c 100644
--- a/code/game/objects/items/weapons/storage/toolbox.dm
+++ b/code/game/objects/items/weapons/storage/toolbox.dm
@@ -11,7 +11,7 @@
w_class = ITEM_SIZE_LARGE
storage = /datum/storage/toolbox
origin_tech = @'{"combat":1}'
- attack_verb = list("robusted")
+ attack_verb = "robusted"
material = /decl/material/solid/metal/aluminium
_base_attack_force = 20
diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm
index 7612a6e897b0..a6eb745f50c6 100644
--- a/code/game/objects/items/weapons/storage/uplink_kits.dm
+++ b/code/game/objects/items/weapons/storage/uplink_kits.dm
@@ -126,10 +126,10 @@
/obj/item/box/syndie_kit/cigarette/WillContain()
return list(
- /obj/item/box/fancy/cigarettes/flash_powder = 2,
- /obj/item/box/fancy/cigarettes/chemsmoke = 2,
- /obj/item/box/fancy/cigarettes/mindbreak,
- /obj/item/box/fancy/cigarettes/tricord,
+ /obj/item/box/fancy/cigarettes/covert/flash_powder = 2,
+ /obj/item/box/fancy/cigarettes/covert/chemsmoke = 2,
+ /obj/item/box/fancy/cigarettes/covert/mindbreak,
+ /obj/item/box/fancy/cigarettes/covert/tricord,
/obj/item/flame/fuelled/lighter/zippo/random,
)
diff --git a/code/game/objects/items/weapons/storage/wall_mirror.dm b/code/game/objects/items/weapons/storage/wall_mirror.dm
index 91b5554585d3..a69b0d5e135f 100644
--- a/code/game/objects/items/weapons/storage/wall_mirror.dm
+++ b/code/game/objects/items/weapons/storage/wall_mirror.dm
@@ -97,18 +97,17 @@
if(!ishuman(user))
return
- var/W = weakref(user)
- var/datum/nano_module/appearance_changer/AC = LAZYACCESS(ui_users, W)
+ var/weakref/user_ref = weakref(user)
+ var/datum/nano_module/appearance_changer/AC = LAZYACCESS(ui_users, user_ref)
if(!AC)
AC = new(mirror, user)
AC.name = title
if(flags)
AC.flags = flags
- LAZYSET(ui_users, W, AC)
+ LAZYSET(ui_users, user_ref, AC)
AC.ui_interact(user)
/proc/clear_ui_users(var/list/ui_users)
- for(var/W in ui_users)
- var/AC = ui_users[W]
- qdel(AC)
+ for(var/user_ref in ui_users)
+ qdel(ui_users[user_ref])
LAZYCLEARLIST(ui_users)
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index 4a176ec5298b..e8ffe9555320 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -7,7 +7,7 @@
slot_flags = SLOT_LOWER_BODY
w_class = ITEM_SIZE_NORMAL
origin_tech = @'{"combat":2}'
- attack_verb = list("beaten")
+ attack_verb = "beaten"
base_parry_chance = 30
material = /decl/material/solid/metal/aluminium
matter = list(
@@ -35,7 +35,7 @@
/obj/item/baton/infinite/Initialize(var/ml, var/material_key, var/loaded_cell_type)
. = ..(ml, material_key, loaded_cell_type = /obj/item/cell/device/infinite)
- set_status(1, null)
+ set_cell_status(1, null)
/obj/item/baton/proc/update_status()
var/obj/item/cell/cell = get_cell()
@@ -66,10 +66,10 @@
set_light(0)
/obj/item/baton/attack_self(mob/user)
- set_status(!status, user)
+ set_cell_status(!status, user)
add_fingerprint(user)
-/obj/item/baton/proc/set_status(var/newstatus, mob/user)
+/obj/item/baton/proc/set_cell_status(var/newstatus, mob/user)
var/obj/item/cell/cell = get_cell()
if(cell?.charge >= hitcost)
if(status != newstatus)
@@ -161,15 +161,15 @@
// usability without proper checks.
// Also hard-coded to be unuseable outside their righteous synthetic owners.
/obj/item/baton/robot/attack_self(mob/user)
- var/mob/living/silicon/robot/R = isrobot(user) ? user : null // null if the user is NOT a robot
- if (R)
+ var/mob/living/silicon/robot/robot = isrobot(user) ? user : null // null if the user is NOT a robot
+ if (robot)
return ..()
else // Stop pretending and get out of your cardborg suit, human.
to_chat(user, "You don't seem to be able to interact with this by yourself.")
add_fingerprint(user)
return 0
-/obj/item/baton/robot/attackby(obj/item/W, mob/user)
+/obj/item/baton/robot/attackby(obj/item/used_item, mob/user)
return FALSE
/obj/item/baton/robot/setup_power_supply(loaded_cell_type, accepted_cell_type, power_supply_extension_type, charge_value)
@@ -207,7 +207,7 @@
stunforce = 0
agonyforce = 60 //same force as a stunbaton, but uses way more charge.
hitcost = 25
- attack_verb = list("poked")
+ attack_verb = "poked"
slot_flags = null
matter = list(
/decl/material/solid/organic/plastic = MATTER_AMOUNT_TRACE,
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index 082bccc7a32a..c4f24a7afcdb 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -63,7 +63,7 @@
obj_flags = OBJ_FLAG_CONDUCTIBLE
w_class = ITEM_SIZE_SMALL
origin_tech = @'{"materials":1,"biotech":1}'
- attack_verb = list("burnt")
+ attack_verb = "burnt"
/obj/item/cautery/Initialize()
. = ..()
@@ -84,7 +84,7 @@
_base_attack_force = 15
w_class = ITEM_SIZE_NORMAL
origin_tech = @'{"materials":1,"biotech":1}'
- attack_verb = list("drilled")
+ attack_verb = "drilled"
/obj/item/surgicaldrill/Initialize()
. = ..()
diff --git a/code/game/objects/items/weapons/surgery_tools_ancient.dm b/code/game/objects/items/weapons/surgery_tools_ancient.dm
index f6f31166bfac..d9c4f6d27433 100644
--- a/code/game/objects/items/weapons/surgery_tools_ancient.dm
+++ b/code/game/objects/items/weapons/surgery_tools_ancient.dm
@@ -2,12 +2,13 @@
abstract_type = /obj/item/ancient_surgery
icon_state = ICON_STATE_WORLD
material = /decl/material/solid/metal/bronze
+ color = /decl/material/solid/metal/bronze::color
+ material_alteration = MAT_FLAG_ALTERATION_ALL
matter = null
obj_flags = OBJ_FLAG_CONDUCTIBLE
w_class = ITEM_SIZE_SMALL
origin_tech = @'{"materials":1,"biotech":1}'
drop_sound = 'sound/foley/knifedrop3.ogg'
- material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
/obj/item/ancient_surgery/proc/get_tool_properties()
return
diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm
index f5b1580e8a67..643125e14e14 100644
--- a/code/game/objects/items/weapons/tanks/tank_types.dm
+++ b/code/game/objects/items/weapons/tanks/tank_types.dm
@@ -22,6 +22,10 @@
desc = "A tank of oxygen. This one is yellow."
icon = 'icons/obj/items/tanks/tank_yellow.dmi'
+/obj/item/tank/oxygen/red
+ desc = "A tank of oxygen. This one is red."
+ icon = 'icons/obj/items/tanks/tank_red.dmi'
+
/obj/item/tank/oxygen/empty
starting_pressure = list()
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 23aa1b6ab20e..55bedc9bca88 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -114,28 +114,28 @@ var/global/list/global/tank_gauge_cache = list()
if(valve_welded)
. += SPAN_WARNING("\The [src] emergency relief valve has been welded shut!")
-/obj/item/tank/attackby(var/obj/item/W, var/mob/user)
+/obj/item/tank/attackby(var/obj/item/used_item, var/mob/user)
if (istype(loc, /obj/item/assembly))
icon = loc
- if (istype(W, /obj/item/scanner/gas))
- return TRUE
+ if (istype(used_item, /obj/item/scanner/gas))
+ return FALSE // allow afterattack to proceed
- if (istype(W,/obj/item/latexballon))
- var/obj/item/latexballon/LB = W
+ if (istype(used_item,/obj/item/latexballon))
+ var/obj/item/latexballon/LB = used_item
LB.blow(src)
add_fingerprint(user)
return TRUE
- if(IS_COIL(W))
- var/obj/item/stack/cable_coil/C = W
+ if(IS_COIL(used_item))
+ var/obj/item/stack/cable_coil/C = used_item
if(C.use(1))
wired = 1
to_chat(user, "You attach the wires to the tank.")
update_icon()
return TRUE
- if(IS_WIRECUTTER(W))
+ if(IS_WIRECUTTER(used_item))
if(wired && proxyassembly.assembly)
to_chat(user, "You carefully begin clipping the wires that attach to the tank.")
@@ -173,23 +173,20 @@ var/global/list/global/tank_gauge_cache = list()
to_chat(user, "There are no wires to cut!")
return TRUE
- if(istype(W, /obj/item/assembly_holder))
+ if(istype(used_item, /obj/item/assembly_holder))
if(wired)
to_chat(user, "You begin attaching the assembly to \the [src].")
if(do_after(user, 50, src))
- to_chat(user, "You finish attaching the assembly to \the [src].")
- global.bombers += "[key_name(user)] attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]"
- log_and_message_admins("attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]", user)
- assemble_bomb(W,user)
+ assemble_bomb(used_item,user)
else
to_chat(user, "You stop attaching the assembly.")
else
to_chat(user, "You need to wire the device up first.")
return TRUE
- if(IS_WELDER(W))
- var/obj/item/weldingtool/WT = W
- if(WT.weld(1,user))
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.weld(1,user))
if(!valve_welded)
to_chat(user, "You begin welding \the [src] emergency pressure relief valve.")
if(do_after(user, 40,src))
@@ -199,8 +196,8 @@ var/global/list/global/tank_gauge_cache = list()
else
global.bombers += "[key_name(user)] attempted to weld \a [src]. [air_contents.temperature-T0C]"
log_and_message_admins("attempted to weld \a [src]. [air_contents.temperature-T0C]", user)
- if(WT.welding)
- to_chat(user, "You accidentally rake \the [W] across \the [src]!")
+ if(welder.welding)
+ to_chat(user, "You accidentally rake \the [used_item] across \the [src]!")
maxintegrity -= rand(2,6)
integrity = min(integrity,maxintegrity)
air_contents.add_thermal_energy(rand(2000,50000))
@@ -209,8 +206,8 @@ var/global/list/global/tank_gauge_cache = list()
add_fingerprint(user)
return TRUE
- if(istype(W, /obj/item/flamethrower))
- var/obj/item/flamethrower/F = W
+ if(istype(used_item, /obj/item/flamethrower))
+ var/obj/item/flamethrower/F = used_item
if(!F.secured || F.tank || !user.try_unequip(src, F))
return TRUE
@@ -550,39 +547,45 @@ var/global/list/global/tank_gauge_cache = list()
/obj/item/tankassemblyproxy/receive_signal() //This is mainly called by the sensor through sense() to the holder, and from the holder to here.
tank.cause_explosion() //boom (or not boom if you made shijwtty mix)
-/obj/item/tank/proc/assemble_bomb(W,user) //Bomb assembly proc. This turns assembly+tank into a bomb
- var/obj/item/assembly_holder/S = W
- var/mob/M = user
- if(!S.secured) //Check if the assembly is secured
- return
+/obj/item/tank/proc/assemble_bomb(used_item,mob/user) //Bomb assembly proc. This turns assembly+tank into a bomb
+ var/obj/item/assembly_holder/S = used_item
if(isigniter(S.a_left) == isigniter(S.a_right)) //Check if either part of the assembly has an igniter, but if both parts are igniters, then fuck it
return
+ if(!S.secured) //Check if the assembly is secured
+ to_chat(user, SPAN_NOTICE("\The [S] must be secured before attaching it to \the [src]!"))
+ return
- if(!M.try_unequip(src))
+ if(!user.try_unequip(src))
return //Remove the tank from your character,in case you were holding it
- M.put_in_hands(src) //Equips the bomb if possible, or puts it on the floor.
+ user.put_in_hands(src) //Equips the bomb if possible, or puts it on the floor.
proxyassembly.assembly = S //Tell the bomb about its assembly part
S.master = proxyassembly //Tell the assembly about its new owner
- S.forceMove(src) //Move the assembly
+ user.remove_from_mob(S, src, FALSE) //Move the assembly and reset HUD layer/plane status
update_icon()
+ to_chat(user, "You finish attaching the assembly to \the [src].")
+ global.bombers += "[key_name(user)] attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]"
+ log_and_message_admins("attached an assembly to a wired [src]. Temp: [air_contents.temperature-T0C]", user)
/obj/item/tank/proc/cause_explosion() //This happens when a bomb is told to explode
+
var/obj/item/assembly_holder/assy = proxyassembly.assembly
- var/ign = assy.a_right
- var/obj/item/other = assy.a_left
+ var/obj/item/igniter = assy.a_right
+ var/obj/item/other = assy.a_left
if (isigniter(assy.a_left))
- ign = assy.a_left
- other = assy.a_right
+ igniter = assy.a_left
+ other = assy.a_right
if(other)
other.dropInto(get_turf(src))
- qdel(ign)
+ if(!QDELETED(igniter))
+ qdel(igniter)
assy.master = null
proxyassembly.assembly = null
- qdel(assy)
+ if(!QDELETED(assy))
+ qdel(assy)
update_icon()
air_contents.add_thermal_energy(15000)
diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm
index eaec2caa5867..d10c34c4f8e3 100644
--- a/code/game/objects/items/weapons/tape.dm
+++ b/code/game/objects/items/weapons/tape.dm
@@ -147,14 +147,14 @@
return ..()
-/obj/item/stack/tape_roll/duct_tape/proc/stick(var/obj/item/W, mob/user)
- if(!(W.item_flags & ITEM_FLAG_CAN_TAPE) || !user.try_unequip(W))
+/obj/item/stack/tape_roll/duct_tape/proc/stick(var/obj/item/used_item, mob/user)
+ if(!(used_item.item_flags & ITEM_FLAG_CAN_TAPE) || !user.try_unequip(used_item))
return FALSE
if(!can_use(1))
return FALSE
use(1)
var/obj/item/duct_tape/tape = new(get_turf(src))
- tape.attach(W)
+ tape.attach(used_item)
user.put_in_hands(tape)
return TRUE
@@ -184,17 +184,17 @@
anchored = FALSE // Unattach it from whereever it's on, if anything.
return ..()
-/obj/item/duct_tape/attackby(obj/item/W, mob/user)
- return stuck? stuck.attackby(W, user) : ..()
+/obj/item/duct_tape/attackby(obj/item/used_item, mob/user)
+ return stuck? stuck.attackby(used_item, user) : ..()
/obj/item/duct_tape/examined_by(mob/user, distance, infix, suffix)
return stuck ? stuck.examined_by(user, distance, infix, suffix) : ..()
-/obj/item/duct_tape/proc/attach(var/obj/item/W)
- stuck = W
+/obj/item/duct_tape/proc/attach(var/obj/item/used_item)
+ stuck = used_item
anchored = TRUE
- SetName("[W.name] (taped)")
- W.forceMove(src)
+ SetName("[used_item.name] (taped)")
+ used_item.forceMove(src)
playsound(src, 'sound/effects/tape.ogg', 25)
update_icon()
diff --git a/code/game/objects/items/weapons/towels.dm b/code/game/objects/items/weapons/towels.dm
index 498f1abd25fc..80cacb07e3da 100644
--- a/code/game/objects/items/weapons/towels.dm
+++ b/code/game/objects/items/weapons/towels.dm
@@ -7,7 +7,7 @@
slot_flags = SLOT_HEAD | SLOT_LOWER_BODY | SLOT_OVER_BODY
_base_attack_force = 1
w_class = ITEM_SIZE_NORMAL
- attack_verb = list("whipped")
+ attack_verb = "whipped"
hitsound = 'sound/weapons/towelwhip.ogg'
material = /decl/material/solid/organic/cloth
material_alteration = MAT_FLAG_ALTERATION_ALL
@@ -188,7 +188,7 @@
name = "fleece" // sets its name to 'golden fleece' due to material
desc = "The legendary Golden Fleece of Jason made real."
_base_attack_force = 1
- attack_verb = list("smote")
+ attack_verb = "smote"
material = /decl/material/solid/metal/gold
/obj/item/towel/fleece/update_material_description()
@@ -210,7 +210,7 @@
update_icon()
return TRUE
-/obj/item/towel/on_picked_up(mob/user)
+/obj/item/towel/on_picked_up(mob/user, atom/old_loc)
..()
if(laid_out)
laid_out = FALSE
@@ -241,4 +241,8 @@
/// A mapping subtype for a doormat that's already been laid out.
/obj/item/towel/doormat/flat
laid_out = TRUE
- icon_state = ICON_STATE_WORLD + "-flat"
\ No newline at end of file
+ icon_state = ICON_STATE_WORLD + "-flat"
+
+/obj/item/towel/doormat/flat/Initialize()
+ . = ..()
+ reset_offsets() // we don't want to overwrite randpixel but we don't want it to have a random offset either
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm
index 61276713a388..445f92be6909 100644
--- a/code/game/objects/items/weapons/weaponry.dm
+++ b/code/game/objects/items/weapons/weaponry.dm
@@ -200,8 +200,8 @@
healthcheck()
return TRUE
-/obj/effect/energy_net/attackby(obj/item/W, mob/user)
- current_health -= W.expend_attack_force(user)
+/obj/effect/energy_net/attackby(obj/item/used_item, mob/user)
+ current_health -= used_item.expend_attack_force(user)
healthcheck()
return TRUE
diff --git a/code/game/objects/items/welding/electric_welder.dm b/code/game/objects/items/welding/electric_welder.dm
index c46aa882f571..382690a971b4 100644
--- a/code/game/objects/items/welding/electric_welder.dm
+++ b/code/game/objects/items/welding/electric_welder.dm
@@ -47,7 +47,7 @@
/obj/item/weldingtool/electric/insert_tank(var/obj/item/chems/welder_tank/T, var/mob/user, var/no_updates = FALSE, var/quiet = FALSE)
return FALSE // No tanks!
-/obj/item/weldingtool/electric/attempt_modify(var/obj/item/W, var/mob/user)
+/obj/item/weldingtool/electric/attempt_modify(var/obj/item/used_item, var/mob/user)
return FALSE // NO ELECTRIC FLAMETHROWER
/obj/item/weldingtool/electric/use_fuel(var/amount)
diff --git a/code/game/objects/items/welding/weldbackpack.dm b/code/game/objects/items/welding/weldbackpack.dm
index 5b8bdbb036a9..661197c56601 100644
--- a/code/game/objects/items/welding/weldbackpack.dm
+++ b/code/game/objects/items/welding/weldbackpack.dm
@@ -30,7 +30,7 @@
/obj/item/weldingtool/weldpack/toggle_unscrewed(mob/user)
return FALSE
-/obj/item/weldingtool/weldpack/attempt_modify(obj/item/W, mob/user)
+/obj/item/weldingtool/weldpack/attempt_modify(obj/item/used_item, mob/user)
return FALSE
/obj/item/weldingtool/weldpack/dropped(mob/user)
diff --git a/code/game/objects/items/welding/weldingtool.dm b/code/game/objects/items/welding/weldingtool.dm
index f46f50010915..720957f0b6d0 100644
--- a/code/game/objects/items/welding/weldingtool.dm
+++ b/code/game/objects/items/welding/weldingtool.dm
@@ -137,27 +137,27 @@
to_chat(user, SPAN_NOTICE("The welder can now be attached and modified."))
return TRUE
-/obj/item/weldingtool/proc/attempt_modify(var/obj/item/W, var/mob/user)
- if(!status && istype(W, /obj/item/stack/material/rods))
- var/obj/item/stack/material/rods/R = W
+/obj/item/weldingtool/proc/attempt_modify(var/obj/item/used_item, var/mob/user)
+ if(!status && istype(used_item, /obj/item/stack/material/rods))
+ var/obj/item/stack/material/rods/R = used_item
R.use(1)
user.drop_from_inventory(src)
user.put_in_hands(new /obj/item/flamethrower(get_turf(src), src))
qdel(src)
return TRUE
-/obj/item/weldingtool/attackby(obj/item/W, mob/user)
+/obj/item/weldingtool/attackby(obj/item/used_item, mob/user)
if(welding)
to_chat(user, SPAN_WARNING("Stop welding first!"))
return TRUE
- if (istype(W, /obj/item/chems/welder_tank))
- return insert_tank(W, user)
+ if (istype(used_item, /obj/item/chems/welder_tank))
+ return insert_tank(used_item, user)
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
return toggle_unscrewed(user)
- if(attempt_modify(W, user))
+ if(attempt_modify(used_item, user))
return TRUE
return ..()
diff --git a/code/game/objects/structures/__structure.dm b/code/game/objects/structures/__structure.dm
index dfe3a96be019..2a90385995b3 100644
--- a/code/game/objects/structures/__structure.dm
+++ b/code/game/objects/structures/__structure.dm
@@ -301,11 +301,11 @@ auto_align() will then place the sprite so the defined center_of_mass is at the
closest to where the cursor has clicked on.
Note: This proc can be overwritten to allow for different types of auto-alignment.
*/
-/obj/structure/proc/auto_align(obj/item/W, click_params)
- if (!W.center_of_mass) // Clothing, material stacks, generally items with large sprites where exact placement would be unhandy.
- W.pixel_x = rand(-W.randpixel, W.randpixel)
- W.pixel_y = rand(-W.randpixel, W.randpixel)
- W.pixel_z = 0
+/obj/structure/proc/auto_align(obj/item/aligning, click_params)
+ if (!aligning.center_of_mass) // Clothing, material stacks, generally items with large sprites where exact placement would be unhandy.
+ aligning.pixel_x = rand(-aligning.randpixel, aligning.randpixel)
+ aligning.pixel_y = rand(-aligning.randpixel, aligning.randpixel)
+ aligning.pixel_z = 0
return
if (!click_params)
return
@@ -324,10 +324,10 @@ Note: This proc can be overwritten to allow for different types of auto-alignmen
span_y = bound_height / CELLSIZE
var/cell_x = clamp(round(mouse_x/CELLSIZE), 0, span_x-1) // Ranging from 0 to span_x-1
var/cell_y = clamp(round(mouse_y/CELLSIZE), 0, span_y-1)
- var/list/center = cached_json_decode(W.center_of_mass)
- W.pixel_x = (CELLSIZE * (cell_x + 0.5)) - center["x"]
- W.pixel_y = (CELLSIZE * (cell_y + 0.5)) - center["y"]
- W.pixel_z = 0
+ var/list/center = cached_json_decode(aligning.center_of_mass)
+ aligning.pixel_x = (CELLSIZE * (cell_x + 0.5)) - center["x"]
+ aligning.pixel_y = (CELLSIZE * (cell_y + 0.5)) - center["y"]
+ aligning.pixel_z = 0
// Does this structure override turf depth for the purposes of mob offsets?
/obj/structure/proc/is_platform()
diff --git a/code/game/objects/structures/_structure_construction.dm b/code/game/objects/structures/_structure_construction.dm
index 186aa29e0e0f..85ffb92fa599 100644
--- a/code/game/objects/structures/_structure_construction.dm
+++ b/code/game/objects/structures/_structure_construction.dm
@@ -65,7 +65,7 @@
var/force = used_item.expend_attack_force(user)
if(force && user.check_intent(I_FLAG_HARM))
attack_animation(user)
- visible_message(SPAN_DANGER("\The [src] has been [pick(used_item.attack_verb)] with \the [used_item] by \the [user]!"))
+ visible_message(SPAN_DANGER("\The [src] has been [used_item.pick_attack_verb()] with \the [used_item] by \the [user]!"))
take_damage(force, used_item.atom_damage_type)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
add_fingerprint(user)
diff --git a/code/game/objects/structures/_structure_icon.dm b/code/game/objects/structures/_structure_icon.dm
index 12bbc26f1602..966df9a1cc4c 100644
--- a/code/game/objects/structures/_structure_icon.dm
+++ b/code/game/objects/structures/_structure_icon.dm
@@ -35,10 +35,10 @@ var/global/list/default_noblend_objects = list(/obj/machinery/door/window, /obj/
/obj/structure/proc/find_blendable_obj_in_turf(var/turf/T, var/propagate)
if(is_type_in_list(T, global.default_blend_objects))
if(propagate && istype(T, /turf/wall))
- for(var/turf/wall/W in RANGE_TURFS(T, 1))
- W.wall_connections = null
- W.other_connections = null
- W.queue_icon_update()
+ for(var/turf/wall/wall in RANGE_TURFS(T, 1))
+ wall.wall_connections = null
+ wall.other_connections = null
+ wall.queue_icon_update()
return TRUE
for(var/obj/O in T)
if(!is_type_in_list(O, global.default_blend_objects))
diff --git a/code/game/objects/structures/_structure_materials.dm b/code/game/objects/structures/_structure_materials.dm
index 604a48b49acd..533df4ca3d72 100644
--- a/code/game/objects/structures/_structure_materials.dm
+++ b/code/game/objects/structures/_structure_materials.dm
@@ -4,6 +4,8 @@
var/material_alteration
var/dismantled
var/name_prefix
+ /// The base alpha used to calculate material-based alpha in update_material_color().
+ var/base_alpha = 50
/obj/structure/get_material()
RETURN_TYPE(/decl/material)
@@ -57,7 +59,7 @@
/obj/structure/proc/update_material_color()
color = get_color()
if(istype(material))
- alpha = clamp((50 + material.opacity * 255), 0, 255)
+ alpha = clamp((base_alpha + material.opacity * 255), 0, 255)
else
alpha = initial(alpha)
diff --git a/code/game/objects/structures/barrels/cask_rack.dm b/code/game/objects/structures/barrels/cask_rack.dm
index c8e5cebc6184..2dfbdc2d8e09 100644
--- a/code/game/objects/structures/barrels/cask_rack.dm
+++ b/code/game/objects/structures/barrels/cask_rack.dm
@@ -143,16 +143,12 @@
// A larger stack, used to arrange up to three casks.
/obj/structure/cask_rack/large
+ name_prefix = "large"
desc = "A flat rack used to stop casks from rolling around."
max_stack = 3
w_class = ITEM_SIZE_LARGE_STRUCTURE
icon = 'icons/obj/structures/barrels/cask_rack_large.dmi'
-// We want 'large wooden cask rack' not 'wooden large cask rack'
-/obj/structure/cask_rack/large/update_material_name(override_name)
- . = ..()
- SetName("large [name]")
-
/obj/structure/cask_rack/large/adjust_barrel_offsets(atom/movable/barrel, barrel_position)
..()
switch(barrel_position)
diff --git a/code/game/objects/structures/barricade.dm b/code/game/objects/structures/barricade.dm
index b5708b8f18f2..ece9d0fa5244 100644
--- a/code/game/objects/structures/barricade.dm
+++ b/code/game/objects/structures/barricade.dm
@@ -49,16 +49,16 @@
else
icon_state = "barricade"
-/obj/structure/barricade/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/stack/material/rods) && !reinf_material)
- var/obj/item/stack/material/rods/R = W
- if(R.get_amount() < 5)
+/obj/structure/barricade/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/stack/material/rods) && !reinf_material)
+ var/obj/item/stack/material/rods/rods = used_item
+ if(rods.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need more rods to build a cheval de frise."))
else
visible_message(SPAN_NOTICE("\The [user] begins to work on \the [src]."))
- if(do_after(user, 4 SECONDS, src) && !reinf_material && R.use(5))
- visible_message(SPAN_NOTICE("\The [user] fastens \the [R] to \the [src]."))
- reinf_material = R.material
+ if(do_after(user, 4 SECONDS, src) && !reinf_material && rods.use(5))
+ visible_message(SPAN_NOTICE("\The [user] fastens \the [rods] to \the [src]."))
+ reinf_material = rods.material
update_materials(TRUE)
. = ..()
diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm
index d47f2eef2fd7..f3f0467e1a62 100644
--- a/code/game/objects/structures/barsign.dm
+++ b/code/game/objects/structures/barsign.dm
@@ -33,11 +33,11 @@
. = ..()
icon_state = pick(get_valid_states())
-/obj/structure/sign/double/barsign/attackby(obj/item/I, mob/user)
+/obj/structure/sign/double/barsign/attackby(obj/item/used_item, mob/user)
if(cult)
return ..()
- var/obj/item/card/id/card = I.GetIdCard()
+ var/obj/item/card/id/card = used_item.GetIdCard()
if(istype(card))
if(access_bar in card.GetAccess())
var/sign_type = input(user, "What would you like to change the barsign to?") as null|anything in get_valid_states(0)
diff --git a/code/game/objects/structures/beds/rollerbed.dm b/code/game/objects/structures/beds/rollerbed.dm
index a919d9f30bc9..a3f332b4b044 100644
--- a/code/game/objects/structures/beds/rollerbed.dm
+++ b/code/game/objects/structures/beds/rollerbed.dm
@@ -34,12 +34,12 @@
iv.pixel_y = 6
add_overlay(iv)
-/obj/structure/bed/roller/attackby(obj/item/I, mob/user)
- if(iv_stand && !beaker && istype(I, /obj/item/chems))
- if(!user.try_unequip(I, src))
+/obj/structure/bed/roller/attackby(obj/item/used_item, mob/user)
+ if(iv_stand && !beaker && istype(used_item, /obj/item/chems))
+ if(!user.try_unequip(used_item, src))
return TRUE
- to_chat(user, "You attach \the [I] to \the [src].")
- beaker = I
+ to_chat(user, "You attach \the [used_item] to \the [src].")
+ beaker = used_item
queue_icon_update()
return TRUE
return ..()
diff --git a/code/game/objects/structures/beds/simple_bed.dm b/code/game/objects/structures/beds/simple_bed.dm
index 3092fc63a717..31a656cfa0a8 100644
--- a/code/game/objects/structures/beds/simple_bed.dm
+++ b/code/game/objects/structures/beds/simple_bed.dm
@@ -1,7 +1,7 @@
/obj/structure/bed/simple
desc = "A slatted wooden bed."
icon = 'icons/obj/structures/furniture/bed_simple.dmi'
- icon_state = "bed_padded_preview" // For map editor preview purposes
+ icon_state = "world_padded_preview" // For map editor preview purposes
parts_type = /obj/item/stack/material/plank
material = /decl/material/solid/organic/wood/oak
initial_padding_material = /decl/material/solid/organic/plantmatter/grass/dry
@@ -48,7 +48,7 @@
/obj/structure/bed/simple/crafted
initial_padding_material = null
- icon_state = "bed"
+ icon_state = ICON_STATE_WORLD
color = /decl/material/solid/organic/wood/oak::color
/obj/item/bedsheet/furs
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index ccfe1f59c914..1ddc5b1937f1 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -12,16 +12,16 @@ LINEN BINS
item_state = "bedsheet"
randpixel = 0
slot_flags = SLOT_BACK
- layer = BASE_ABOVE_OBJ_LAYER
+ layer = ABOVE_STRUCTURE_LAYER // layer below other objects but above beds
throw_speed = 1
throw_range = 2
w_class = ITEM_SIZE_SMALL
material = /decl/material/solid/organic/cloth
-/obj/item/bedsheet/attackby(obj/item/I, mob/user)
- if(I.is_sharp() || I.has_edge())
- user.visible_message("\The [user] begins cutting up \the [src] with \a [I].", "You begin cutting up \the [src] with \the [I].")
- if(do_after(user, 50, src))
+/obj/item/bedsheet/attackby(obj/item/used_item, mob/user)
+ if(used_item.is_sharp() || used_item.has_edge())
+ user.visible_message("\The [user] begins cutting up \the [src] with \a [used_item].", "You begin cutting up \the [src] with \the [used_item].")
+ if(do_after(user, 5 SECONDS, src))
to_chat(user, "You cut \the [src] into pieces!")
for(var/i in 1 to rand(2,5))
new /obj/item/chems/rag(get_turf(src))
@@ -137,33 +137,33 @@ LINEN BINS
else
icon_state = "linenbin-full"
-/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user)
+/obj/structure/bedsheetbin/attackby(obj/item/used_item, mob/user)
var/curamount = get_amount()
- if(istype(I, /obj/item/bedsheet))
+ if(istype(used_item, /obj/item/bedsheet))
if(curamount >= max_stored)
to_chat(user, SPAN_WARNING("\The [src] is full!"))
return TRUE
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- LAZYDISTINCTADD(sheets, I)
+ LAZYDISTINCTADD(sheets, used_item)
update_icon()
- to_chat(user, SPAN_NOTICE("You put [I] in [src]."))
+ to_chat(user, SPAN_NOTICE("You put [used_item] in [src]."))
return TRUE
//Let the parent attackby run to handle tool interactions
. = ..()
if(!.)
- if(curamount && !hidden && I.w_class < w_class) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
- if(!user.try_unequip(I, src))
+ if(curamount && !hidden && used_item.w_class < w_class) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
+ if(!user.try_unequip(used_item, src))
return TRUE
- hidden = I
- to_chat(user, SPAN_NOTICE("You hide [I] among the sheets."))
+ hidden = used_item
+ to_chat(user, SPAN_NOTICE("You hide [used_item] among the sheets."))
return TRUE
else if(hidden)
- to_chat(user, SPAN_WARNING("There's not enough space to hide \the [I]!"))
- else if(I.w_class >= w_class)
- to_chat(user, SPAN_WARNING("\The [I] is too big to hide in \the [src]!"))
+ to_chat(user, SPAN_WARNING("There's not enough space to hide \the [used_item]!"))
+ else if(used_item.w_class >= w_class)
+ to_chat(user, SPAN_WARNING("\The [used_item] is too big to hide in \the [src]!"))
else if(curamount < 1)
to_chat(user, SPAN_WARNING("You can't hide anything if there's no sheets to cover it!"))
diff --git a/code/game/objects/structures/benches/bench.dm b/code/game/objects/structures/benches/bench.dm
index 30cf502c7213..16ba3b36eceb 100644
--- a/code/game/objects/structures/benches/bench.dm
+++ b/code/game/objects/structures/benches/bench.dm
@@ -3,7 +3,7 @@
name = "bench"
desc = "A simple slatted bench."
icon = 'icons/obj/structures/furniture/bench.dmi'
- icon_state = ICON_STATE_WORLD + "_standing"
+ icon_state = ICON_STATE_WORLD + "_preview"
color = WOOD_COLOR_GENERIC
initial_padding_material = null
material = /decl/material/solid/organic/wood/oak
diff --git a/code/game/objects/structures/catwalk.dm b/code/game/objects/structures/catwalk.dm
index b7186e1926d5..3f5b94ea0716 100644
--- a/code/game/objects/structures/catwalk.dm
+++ b/code/game/objects/structures/catwalk.dm
@@ -76,9 +76,9 @@
for(var/i = 1 to 4)
add_overlay(image(icon, "catwalk[connections ? connections[i] : "0"]", dir = BITFLAG(i-1)))
if(plated_tile)
- var/image/I = image(icon, "plated")
- I.color = plated_tile.color
- add_overlay(I)
+ var/image/overlay_image = image(icon, "plated")
+ overlay_image.color = plated_tile.color
+ add_overlay(overlay_image)
/obj/structure/catwalk/create_dismantled_products(var/turf/T)
. = ..()
@@ -109,25 +109,25 @@
/obj/structure/catwalk/attack_robot(var/mob/user)
return attack_hand_with_interaction_checks(user)
-/obj/structure/catwalk/attackby(obj/item/C, mob/user)
+/obj/structure/catwalk/attackby(obj/item/used_item, mob/user)
if((. = ..()))
return
- if(istype(C, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/cutter = C
+ if(istype(used_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/cutter = used_item
if(cutter.slice(user))
dismantle_structure(user)
return TRUE
- if(istype(C, /obj/item/stack/tile/mono) && !plated_tile)
+ if(istype(used_item, /obj/item/stack/tile/mono) && !plated_tile)
var/ladder = (locate(/obj/structure/ladder) in loc)
if(ladder)
to_chat(user, SPAN_WARNING("\The [ladder] is in the way."))
return TRUE
- var/obj/item/stack/tile/ST = C
+ var/obj/item/stack/tile/ST = used_item
if(ST.in_use)
return TRUE
@@ -148,7 +148,7 @@
var/decl/flooring/F = decls[flooring_type]
if(!F.build_type)
continue
- if(istype(C, F.build_type) && (!F.build_material || C.material?.type == F.build_material))
+ if(istype(used_item, F.build_type) && (!F.build_material || used_item.material?.type == F.build_material))
plated_tile = F
break
update_icon()
@@ -217,13 +217,13 @@
if(locate(/obj/structure/catwalk) in loc)
warning("Frame Spawner: A catwalk already exists at [loc.x]-[loc.y]-[loc.z]")
else
- var/obj/structure/catwalk/C = new /obj/structure/catwalk(loc)
- C.plated_tile += GET_DECL(plating_type)
- C.name = "plated catwalk"
- C.update_icon()
+ var/obj/structure/catwalk/catwalk = new /obj/structure/catwalk(loc)
+ catwalk.plated_tile += GET_DECL(plating_type)
+ catwalk.name = "plated catwalk"
+ catwalk.update_icon()
activated = 1
for(var/turf/T in orange(src, 1))
- for(var/obj/effect/wallframe_spawn/other in T)
+ for(var/obj/effect/catwalk_plated/other in T)
if(!other.activated) other.activate()
/obj/effect/catwalk_plated/dark
diff --git a/code/game/objects/structures/chairs/rustic_chairs.dm b/code/game/objects/structures/chairs/rustic_chairs.dm
index 840678cb077e..a61ca9b1a171 100644
--- a/code/game/objects/structures/chairs/rustic_chairs.dm
+++ b/code/game/objects/structures/chairs/rustic_chairs.dm
@@ -5,6 +5,7 @@
material = /decl/material/solid/organic/wood/walnut
color = /decl/material/solid/organic/wood/walnut::color
user_comfort = -0.5
+ buckle_pixel_shift = TRUE // use chair offset
/obj/structure/chair/rustic_fancy
name_prefix = "fancy"
diff --git a/code/game/objects/structures/chairs/wheelchair.dm b/code/game/objects/structures/chairs/wheelchair.dm
index 31fb6781e1a7..97b79c15d7af 100644
--- a/code/game/objects/structures/chairs/wheelchair.dm
+++ b/code/game/objects/structures/chairs/wheelchair.dm
@@ -73,9 +73,9 @@
bloodiness--
/proc/equip_wheelchair(mob/living/human/H) //Proc for spawning in a wheelchair if a new character has no legs. Used in new_player.dm
- var/obj/structure/chair/wheelchair/W = new(get_turf(H))
+ var/obj/structure/chair/wheelchair/wheelchair = new(get_turf(H))
if(isturf(H.loc))
- W.buckle_mob(H)
+ wheelchair.buckle_mob(H)
/obj/structure/chair/wheelchair/verb/collapse()
set name = "Collapse Wheelchair"
@@ -136,9 +136,9 @@
user.visible_message("[user] starts to lay out \the [src].")
if(do_after(user, 4 SECONDS, src))
- var/obj/structure/chair/wheelchair/W = new structure_form_type(get_turf(user))
- user.visible_message("[user] lays out \the [W].")
- W.add_fingerprint(user)
+ var/obj/structure/chair/wheelchair/wheelchair = new structure_form_type(get_turf(user))
+ user.visible_message("[user] lays out \the [wheelchair].")
+ wheelchair.add_fingerprint(user)
qdel(src)
/obj/item/wheelchair_kit/physically_destroyed(skip_qdel)
diff --git a/code/game/objects/structures/charge_pylon.dm b/code/game/objects/structures/charge_pylon.dm
index fd12329b714f..8c504e466205 100644
--- a/code/game/objects/structures/charge_pylon.dm
+++ b/code/game/objects/structures/charge_pylon.dm
@@ -45,10 +45,10 @@
visible_message("\The [user] has been shocked by \the [src]!")
user.throw_at(get_step(user,get_dir(src,user)), 5, 10)
-/obj/structure/charge_pylon/attackby(var/obj/item/item, mob/user)
- if(!istype(item, /obj/item/grab))
+/obj/structure/charge_pylon/attackby(var/obj/item/used_item, mob/user)
+ if(!istype(used_item, /obj/item/grab))
return FALSE
- var/obj/item/grab/grab = item
+ var/obj/item/grab/grab = used_item
var/mob/M = grab.get_affecting_mob()
if(M)
charge_user(M)
diff --git a/code/game/objects/structures/chemistry/heater.dm b/code/game/objects/structures/chemistry/heater.dm
index 7050d2f9ee86..bf0c3a573feb 100644
--- a/code/game/objects/structures/chemistry/heater.dm
+++ b/code/game/objects/structures/chemistry/heater.dm
@@ -75,18 +75,18 @@
if(ismob(new_loc))
visible_message(SPAN_NOTICE("\The [new_loc] removes \the [am] from \the [src]."))
-/obj/structure/fire_source/heater/attackby(obj/item/thing, mob/user)
+/obj/structure/fire_source/heater/attackby(obj/item/used_item, mob/user)
- if(istype(thing, /obj/item/chems/glass) && ATOM_IS_OPEN_CONTAINER(thing))
+ if(istype(used_item, /obj/item/chems/glass) && ATOM_IS_OPEN_CONTAINER(used_item))
if(retort && vessel)
to_chat(user, SPAN_WARNING("\The [src] is already holding \a [retort] and \a [vessel]."))
return TRUE
- if(user.try_unequip(thing, src))
+ if(user.try_unequip(used_item, src))
if(!retort)
- set_retort(thing)
+ set_retort(used_item)
visible_message(SPAN_NOTICE("\The [user] places \the [retort] onto \the [src]."))
else if(!vessel)
- set_vessel(thing)
+ set_vessel(used_item)
visible_message(SPAN_NOTICE("\The [user] places \the [vessel] under \the [src]."))
return TRUE
diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm
index 3462edc0b082..155a7eeff3dc 100644
--- a/code/game/objects/structures/coathanger.dm
+++ b/code/game/objects/structures/coathanger.dm
@@ -70,16 +70,16 @@
if(thing.slot_flags & slots_allowed[slot])
return TRUE
-/obj/structure/coatrack/attackby(obj/item/W, mob/user)
- if(!can_hang(W))
+/obj/structure/coatrack/attackby(obj/item/used_item, mob/user)
+ if(!can_hang(used_item))
return ..()
if(length(contents) >= max_items)
- to_chat(user, SPAN_NOTICE("There is no room on \the [src] to hang \the [W]."))
+ to_chat(user, SPAN_NOTICE("There is no room on \the [src] to hang \the [used_item]."))
return TRUE
- if(user.try_unequip(W, src))
+ if(user.try_unequip(used_item, src))
user.visible_message( \
- SPAN_NOTICE("\The [user] hangs \the [W] on \the [src]."), \
- SPAN_NOTICE("You hang \the [W] on \the [src].") \
+ SPAN_NOTICE("\The [user] hangs \the [used_item] on \the [src]."), \
+ SPAN_NOTICE("You hang \the [used_item] on \the [src].") \
)
update_icon()
return TRUE
diff --git a/code/game/objects/structures/compost.dm b/code/game/objects/structures/compost.dm
index 407a6d38600d..e8f3c18ec831 100644
--- a/code/game/objects/structures/compost.dm
+++ b/code/game/objects/structures/compost.dm
@@ -88,28 +88,28 @@ var/global/const/COMPOST_WORM_HUNGER_FACTOR = MINIMUM_CHEMICAL_VOLUME
reagents.trans_to(loc, reagents.total_volume)
return ..()
-/obj/structure/reagent_dispensers/compost_bin/attackby(obj/item/W, mob/user)
+/obj/structure/reagent_dispensers/compost_bin/attackby(obj/item/used_item, mob/user)
if(user.check_intent(I_FLAG_HARM))
return ..()
- if(W.storage)
+ if(used_item.storage)
var/emptied = FALSE
- for(var/obj/item/O in W.get_stored_inventory())
+ for(var/obj/item/O in used_item.get_stored_inventory())
if(storage.can_be_inserted(O))
- W.storage.remove_from_storage(null, O, loc, skip_update = TRUE)
+ used_item.storage.remove_from_storage(null, O, loc, skip_update = TRUE)
storage.handle_item_insertion(null, O, skip_update = TRUE)
emptied = TRUE
if(emptied)
- W.storage.finish_bulk_removal()
+ used_item.storage.finish_bulk_removal()
storage.update_ui_after_item_insertion()
- if(length(W.get_stored_inventory()))
- to_chat(user, SPAN_NOTICE("You partially empty \the [W] into \the [src]'s hopper."))
+ if(length(used_item.get_stored_inventory()))
+ to_chat(user, SPAN_NOTICE("You partially empty \the [used_item] into \the [src]'s hopper."))
else
- to_chat(user, SPAN_NOTICE("You empty \the [W] into \the [src]'s hopper."))
- W.update_icon()
+ to_chat(user, SPAN_NOTICE("You empty \the [used_item] into \the [src]'s hopper."))
+ used_item.update_icon()
return TRUE
return ..()
@@ -174,15 +174,14 @@ var/global/const/COMPOST_WORM_HUNGER_FACTOR = MINIMUM_CHEMICAL_VOLUME
remains.update_primary_material()
// Digest reagents.
- for(var/mat in reagents.reagent_volumes)
- if(ispath(mat, /decl/material/liquid/fertilizer))
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ if(istype(reagent, /decl/material/liquid/fertilizer))
continue
- var/decl/material/material_data = GET_DECL(mat)
- if(!material_data.compost_value)
+ if(!reagent.compost_value)
continue
- var/clamped_worm_drink_amount = min(round(worm_eat_amount * REAGENT_UNITS_PER_MATERIAL_UNIT), reagents.reagent_volumes[mat])
- reagents.add_reagent(/decl/material/liquid/fertilizer/compost, max(1, round(clamped_worm_drink_amount * material_data.compost_value)))
- reagents.remove_reagent(mat, clamped_worm_drink_amount)
+ var/clamped_worm_drink_amount = min(round(worm_eat_amount * REAGENT_UNITS_PER_MATERIAL_UNIT), reagents.reagent_volumes[reagent])
+ reagents.add_reagent(/decl/material/liquid/fertilizer/compost, max(1, round(clamped_worm_drink_amount * reagent.compost_value)))
+ reagents.remove_reagent(reagent, clamped_worm_drink_amount)
break
// Grow more worms.
diff --git a/code/game/objects/structures/crates_lockers/closets/__closet.dm b/code/game/objects/structures/crates_lockers/closets/__closet.dm
index 67dda1ac39ba..9e18b1611a33 100644
--- a/code/game/objects/structures/crates_lockers/closets/__closet.dm
+++ b/code/game/objects/structures/crates_lockers/closets/__closet.dm
@@ -265,9 +265,9 @@ var/global/list/closets = list()
receive_mouse_drop(grab.affecting, user) //act like they were dragged onto the closet
return TRUE
if(IS_WELDER(used_item))
- var/obj/item/weldingtool/WT = used_item
- if(WT.weld(0,user))
- slice_into_parts(WT, user)
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.weld(0,user))
+ slice_into_parts(welder, user)
return TRUE
if(istype(used_item, /obj/item/gun/energy/plasmacutter))
var/obj/item/gun/energy/plasmacutter/cutter = used_item
@@ -315,9 +315,9 @@ var/global/list/closets = list()
return FALSE //Return false to get afterattack to be called
if(IS_WELDER(used_item) && (setup & CLOSET_CAN_BE_WELDED))
- var/obj/item/weldingtool/WT = used_item
- if(!WT.weld(0,user))
- if(WT.isOn())
+ var/obj/item/weldingtool/welder = used_item
+ if(!welder.weld(0,user))
+ if(welder.isOn())
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return TRUE
welded = !welded
@@ -330,10 +330,10 @@ var/global/list/closets = list()
return attack_hand_with_interaction_checks(user)
-/obj/structure/closet/proc/slice_into_parts(obj/W, mob/user)
+/obj/structure/closet/proc/slice_into_parts(obj/item/used_item, mob/user)
user.visible_message(
- SPAN_NOTICE("\The [src] has been cut apart by [user] with \the [W]."),
- SPAN_NOTICE("You have cut \the [src] apart with \the [W]."),
+ SPAN_NOTICE("\The [src] has been cut apart by [user] with \the [used_item]."),
+ SPAN_NOTICE("You have cut \the [src] apart with \the [used_item]."),
"You hear welding."
)
physically_destroyed()
diff --git a/code/game/objects/structures/crates_lockers/closets/coffin.dm b/code/game/objects/structures/crates_lockers/closets/coffin.dm
index 7b06ff2b19d8..236153f78f39 100644
--- a/code/game/objects/structures/crates_lockers/closets/coffin.dm
+++ b/code/game/objects/structures/crates_lockers/closets/coffin.dm
@@ -17,8 +17,8 @@
if(locked)
return FALSE
-/obj/structure/closet/coffin/attackby(obj/item/W, mob/user)
- if(!opened && IS_SCREWDRIVER(W))
+/obj/structure/closet/coffin/attackby(obj/item/used_item, mob/user)
+ if(!opened && IS_SCREWDRIVER(used_item))
to_chat(user, SPAN_NOTICE("You begin screwing [src]'s lid [locked ? "open" : "shut"]."))
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
if(do_after(user, screwdriver_time_needed, src))
diff --git a/code/game/objects/structures/crates_lockers/closets/job_closets.dm b/code/game/objects/structures/crates_lockers/closets/job_closets.dm
index 629490936d77..d59af0e46727 100644
--- a/code/game/objects/structures/crates_lockers/closets/job_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/job_closets.dm
@@ -43,7 +43,7 @@
/obj/item/clothing/dress/sun,
/obj/item/clothing/pants/slacks/black = 2,
/obj/item/clothing/shirt/button = 2,
- /obj/item/clothing/neck/tie/bow/color/red = 2,
+ /obj/item/clothing/neck/tie/bow/red = 2,
/obj/item/clothing/suit/jacket/vest/blue = 2,
/obj/item/radio/headset/headset_service = 2,
/obj/item/box/mousetraps = 2,
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm
index b18ae84828b6..ff568d29a611 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/_secure_closets.dm
@@ -9,5 +9,5 @@
wall_mounted = 0 //never solid (You can always pass over it)
current_health = 200
-/obj/structure/closet/secure_closet/slice_into_parts(obj/item/weldingtool/WT, mob/user)
+/obj/structure/closet/secure_closet/slice_into_parts(obj/item/weldingtool/welder, mob/user)
to_chat(user, "\The [src] is too strong to be taken apart.")
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
index 08ba2e29d23b..860f376f6b1f 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
@@ -19,7 +19,7 @@
/obj/item/telebaton,
/obj/item/clothing/dress/cap,
/obj/item/clothing/head/caphat/formal,
- /obj/item/clothing/jumpsuit/captainformal,
+ /obj/item/clothing/costume/captainformal,
)
/obj/structure/closet/secure_closet/hop
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index 27a6d55f4fce..946821ceff5a 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -98,10 +98,10 @@
current_health -= 60 / severity
check_health()
-/obj/structure/closet/statue/attackby(obj/item/I, mob/user)
- current_health -= I.expend_attack_force(user)
+/obj/structure/closet/statue/attackby(obj/item/used_item, mob/user)
+ current_health -= used_item.expend_attack_force(user)
user.do_attack_animation(src)
- visible_message("[user] strikes [src] with [I].")
+ visible_message("[user] strikes [src] with [used_item].")
check_health()
return TRUE
diff --git a/code/game/objects/structures/crates_lockers/closets/syndicate.dm b/code/game/objects/structures/crates_lockers/closets/syndicate.dm
index 6d3bec631ee9..33fd93aa1d48 100644
--- a/code/game/objects/structures/crates_lockers/closets/syndicate.dm
+++ b/code/game/objects/structures/crates_lockers/closets/syndicate.dm
@@ -33,35 +33,6 @@
new /obj/item/clothing/mask/gas/syndicate(src)
new /obj/item/clothing/head/helmet/space/void/merc(src)
-
-/obj/structure/closet/syndicate/nuclear
- desc = "It's a storage unit for nuclear-operative gear."
-
-/obj/structure/closet/syndicate/nuclear/Initialize()
- . = ..()
-
- new /obj/item/ammo_magazine/smg(src)
- new /obj/item/ammo_magazine/smg(src)
- new /obj/item/ammo_magazine/smg(src)
- new /obj/item/ammo_magazine/smg(src)
- new /obj/item/ammo_magazine/smg(src)
- new /obj/item/box/handcuffs(src)
- new /obj/item/box/flashbangs(src)
- new /obj/item/gun/energy/gun(src)
- new /obj/item/gun/energy/gun(src)
- new /obj/item/gun/energy/gun(src)
- new /obj/item/gun/energy/gun(src)
- new /obj/item/gun/energy/gun(src)
- new /obj/item/pinpointer/nukeop(src)
- new /obj/item/pinpointer/nukeop(src)
- new /obj/item/pinpointer/nukeop(src)
- new /obj/item/pinpointer/nukeop(src)
- new /obj/item/pinpointer/nukeop(src)
- new /obj/item/modular_computer/pda/mercenary(src)
- var/obj/item/radio/uplink/U = new(src)
- U.tc_amount = 40
- return
-
/obj/structure/closet/syndicate/resources
desc = "An old, dusty locker."
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index 59d02b4c8c5a..4eaac0b2cc2e 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -9,7 +9,7 @@
var/rigged = 0
/obj/structure/closet/crate/open(mob/user)
- if((atom_flags & ATOM_FLAG_CLIMBABLE) && !opened && can_open(user))
+ if((atom_flags & ATOM_FLAG_CLIMBABLE) && LAZYLEN(climbers) && !opened && can_open(user))
object_shaken()
. = ..()
if(.)
@@ -32,13 +32,13 @@
devices += A
. += "There are some wires attached to the lid, connected to [english_list(devices)]."
-/obj/structure/closet/crate/attackby(obj/item/W, mob/user)
+/obj/structure/closet/crate/attackby(obj/item/used_item, mob/user)
if(opened)
return ..()
- else if(istype(W, /obj/item/stack/package_wrap))
+ else if(istype(used_item, /obj/item/stack/package_wrap))
return FALSE // let afterattack run
- else if(istype(W, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/C = W
+ else if(istype(used_item, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/C = used_item
if(rigged)
to_chat(user, "[src] is already rigged!")
return TRUE
@@ -47,12 +47,12 @@
rigged = 1
return TRUE
return FALSE
- else if((istype(W, /obj/item/assembly_holder) || istype(W, /obj/item/assembly)) && rigged)
- if(!user.try_unequip(W, src))
+ else if((istype(used_item, /obj/item/assembly_holder) || istype(used_item, /obj/item/assembly)) && rigged)
+ if(!user.try_unequip(used_item, src))
return TRUE
- to_chat(user, "You attach [W] to [src].")
+ to_chat(user, "You attach [used_item] to [src].")
return TRUE
- else if(IS_WIRECUTTER(W))
+ else if(IS_WIRECUTTER(used_item))
if(rigged)
to_chat(user, "You cut away the wiring.")
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm
index 4e4e37090ac1..2ed4e74f0b4e 100644
--- a/code/game/objects/structures/crates_lockers/largecrate.dm
+++ b/code/game/objects/structures/crates_lockers/largecrate.dm
@@ -20,8 +20,8 @@
to_chat(user, SPAN_WARNING("You need a crowbar to pry this open!"))
return TRUE
-/obj/structure/largecrate/attackby(obj/item/W, mob/user)
- if(IS_CROWBAR(W))
+/obj/structure/largecrate/attackby(obj/item/used_item, mob/user)
+ if(IS_CROWBAR(used_item))
user.visible_message(
SPAN_NOTICE("\The [user] pries \the [src] open."),
SPAN_NOTICE("You pry open \the [src]."),
diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm
index 4e1bafbf36eb..0ef9f5dfbce3 100644
--- a/code/game/objects/structures/curtains.dm
+++ b/code/game/objects/structures/curtains.dm
@@ -23,8 +23,8 @@
matter = atom_info_repository.get_matter_for(/obj/structure/curtain, kind.material_key)
update_icon()
-/obj/item/curtain/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W))
+/obj/item/curtain/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item))
if(!curtain_kind_path)
return TRUE
@@ -110,8 +110,8 @@
return TRUE
return ..()
-/obj/structure/curtain/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W) && curtain_kind_path)
+/obj/structure/curtain/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item) && curtain_kind_path)
user.visible_message(
SPAN_NOTICE("\The [user] begins uninstalling \the [src]."),
SPAN_NOTICE("You begin uninstalling \the [src]."))
diff --git a/code/game/objects/structures/defensive_barrier.dm b/code/game/objects/structures/defensive_barrier.dm
index 97b999566c0b..889d3a94bdff 100644
--- a/code/game/objects/structures/defensive_barrier.dm
+++ b/code/game/objects/structures/defensive_barrier.dm
@@ -127,9 +127,9 @@
update_icon()
return TRUE
-/obj/structure/defensive_barrier/attackby(obj/item/W, mob/user)
+/obj/structure/defensive_barrier/attackby(obj/item/used_item, mob/user)
- if(IS_SCREWDRIVER(W) && density)
+ if(IS_SCREWDRIVER(used_item) && density)
user.visible_message(SPAN_NOTICE("\The [user] begins to [secured ? "secure" : "unsecure"] \the [src]..."))
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
if(!do_after(user, 30, src))
@@ -199,9 +199,9 @@
user.drop_from_inventory(src)
qdel(src)
-/obj/item/defensive_barrier/attackby(obj/item/W, mob/user)
- if(stored_health < stored_max_health && IS_WELDER(W))
- if(W.do_tool_interaction(TOOL_WELDER, user, src, \
+/obj/item/defensive_barrier/attackby(obj/item/used_item, mob/user)
+ if(stored_health < stored_max_health && IS_WELDER(used_item))
+ if(used_item.do_tool_interaction(TOOL_WELDER, user, src, \
max(5, round((stored_max_health-stored_health) / 5)), \
"repairing the damage to", "repairing the damage to", \
"You fail to patch the damage to \the [src].", \
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 06455c87a1fc..2223ada43936 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -92,9 +92,9 @@
for(var/atom/movable/AM in contents)
underlays += AM.appearance
-/obj/structure/displaycase/attackby(obj/item/W, mob/user)
+/obj/structure/displaycase/attackby(obj/item/used_item, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- var/obj/item/card/id/id = W.GetIdCard()
+ var/obj/item/card/id/id = used_item.GetIdCard()
if(istype(id))
if(allowed(user))
locked = !locked
@@ -103,13 +103,13 @@
to_chat(user, "\The [src]'s card reader denies you access.")
return TRUE
- if(isitem(W) && (!locked || destroyed))
- if(!W.simulated || W.anchored)
+ if(isitem(used_item) && (!locked || destroyed))
+ if(!used_item.simulated || used_item.anchored)
return FALSE
- if(user.try_unequip(W, src))
- W.pixel_x = 0
- W.pixel_y = -7
+ if(user.try_unequip(used_item, src))
+ used_item.pixel_x = 0
+ used_item.pixel_y = -7
update_icon()
return TRUE
. = ..()
diff --git a/code/game/objects/structures/divider.dm b/code/game/objects/structures/divider.dm
index d0cb78e85dfd..0ead2c654980 100644
--- a/code/game/objects/structures/divider.dm
+++ b/code/game/objects/structures/divider.dm
@@ -20,6 +20,11 @@
material = /decl/material/solid/organic/wood/oak
color = /decl/material/solid/organic/wood/oak::color
+
+/obj/structure/divider/extended/wood/ebony
+ material = /decl/material/solid/organic/wood/ebony
+ color = /decl/material/solid/organic/wood/ebony::color
+
/obj/structure/divider/attack_hand(mob/user)
if(user.check_intent(I_FLAG_HELP) && user.check_dexterity(DEXTERITY_SIMPLE_MACHINES, silent = TRUE))
extended = !extended
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 9aba1e77c074..cf7af2c01748 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -123,9 +123,9 @@
icon_state = "shutter1"
airlock_type = /obj/machinery/door/blast/shutters
-/obj/structure/door_assembly/attackby(obj/item/W, mob/user)
+/obj/structure/door_assembly/attackby(obj/item/used_item, mob/user)
- if(IS_PEN(W))
+ if(IS_PEN(used_item))
var/t = sanitize_safe(input(user, "Enter the name for the door.", src.name, src.created_name), MAX_NAME_LEN)
if(!length(t))
return TRUE
@@ -135,9 +135,9 @@
created_name = t
return TRUE
- if(IS_WELDER(W) && (glass == 1 || !anchored))
- var/obj/item/weldingtool/WT = W
- if (WT.weld(0, user))
+ if(IS_WELDER(used_item) && (glass == 1 || !anchored))
+ var/obj/item/weldingtool/welder = used_item
+ if (welder.weld(0, user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(glass == 1)
var/decl/material/glass_material_datum = GET_DECL(glass_material)
@@ -145,7 +145,7 @@
var/mat_name = glass_material_datum.solid_name || glass_material_datum.name
user.visible_message("[user] welds the [mat_name] plating off the airlock assembly.", "You start to weld the [mat_name] plating off the airlock assembly.")
if(do_after(user, 4 SECONDS, src))
- if(!WT.isOn())
+ if(!welder.isOn())
return TRUE
to_chat(user, "You welded the [mat_name] plating off!")
glass_material_datum.create_object(get_turf(src), 2)
@@ -155,7 +155,7 @@
if(!anchored)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
if(do_after(user, 4 SECONDS, src))
- if(!WT.isOn())
+ if(!welder.isOn())
return TRUE
to_chat(user, "You dissasembled the airlock assembly!")
dismantle_structure(user)
@@ -164,7 +164,7 @@
to_chat(user, "You need more welding fuel.")
return TRUE
- if(IS_WRENCH(W) && state == 0)
+ if(IS_WRENCH(used_item) && state == 0)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
if(anchored)
user.visible_message("[user] begins unsecuring the airlock assembly from the floor.", "You begin unsecuring the airlock assembly from the floor.")
@@ -179,8 +179,8 @@
return TRUE
- else if(IS_COIL(W) && state == 0 && anchored)
- var/obj/item/stack/cable_coil/C = W
+ else if(IS_COIL(used_item) && state == 0 && anchored)
+ var/obj/item/stack/cable_coil/C = used_item
if (C.get_amount() < 1)
to_chat(user, "You need one length of coil to wire the airlock assembly.")
return TRUE
@@ -192,7 +192,7 @@
update_icon()
return TRUE
- else if(IS_WIRECUTTER(W) && state == 1 )
+ else if(IS_WIRECUTTER(used_item) && state == 1 )
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
@@ -204,8 +204,8 @@
update_icon()
return TRUE
- else if(istype(W, /obj/item/stock_parts/circuitboard/airlock_electronics) && state == 1)
- var/obj/item/stock_parts/circuitboard/airlock_electronics/E = W
+ else if(istype(used_item, /obj/item/stock_parts/circuitboard/airlock_electronics) && state == 1)
+ var/obj/item/stock_parts/circuitboard/airlock_electronics/E = used_item
if(!ispath(airlock_type, E.build_path))
return FALSE
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
@@ -213,16 +213,16 @@
if(do_after(user, 40,src))
if(QDELETED(src)) return TRUE
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
to_chat(user, "You installed the airlock electronics!")
src.state = 2
src.SetName("Near finished Airlock Assembly")
- src.electronics = W
+ src.electronics = used_item
update_icon()
return TRUE
- else if(IS_CROWBAR(W) && state == 2 )
+ else if(IS_CROWBAR(used_item) && state == 2 )
//This should never happen, but just in case I guess
if (!electronics)
to_chat(user, "There was nothing to remove.")
@@ -243,8 +243,8 @@
update_icon()
return TRUE
- else if(istype(W, /obj/item/stack/material) && !glass)
- var/obj/item/stack/material/S = W
+ else if(istype(used_item, /obj/item/stack/material) && !glass)
+ var/obj/item/stack/material/S = used_item
var/material_name = S.get_material_type()
if (S.get_amount() >= 2)
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
@@ -258,7 +258,7 @@
return TRUE
return FALSE
- else if(IS_SCREWDRIVER(W) && state == 2 )
+ else if(IS_SCREWDRIVER(used_item) && state == 2 )
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
to_chat(user, "Now finishing the airlock.")
diff --git a/code/game/objects/structures/drain.dm b/code/game/objects/structures/drain.dm
index 3b8e57ce9f49..66cdf42b45e0 100644
--- a/code/game/objects/structures/drain.dm
+++ b/code/game/objects/structures/drain.dm
@@ -16,17 +16,17 @@
if(welded)
. += "It is welded shut."
-/obj/structure/hygiene/drain/attackby(var/obj/item/thing, var/mob/user)
- if(IS_WELDER(thing))
- var/obj/item/weldingtool/WT = thing
- if(WT.isOn())
+/obj/structure/hygiene/drain/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.isOn())
welded = !welded
to_chat(user, "You weld \the [src] [welded ? "closed" : "open"].")
else
- to_chat(user, "Turn \the [thing] on, first.")
+ to_chat(user, "Turn \the [used_item] on, first.")
update_icon()
return TRUE
- if(IS_WRENCH(thing))
+ if(IS_WRENCH(used_item))
new /obj/item/drain(src.loc)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "[user] unwrenches \the [src].")
@@ -52,8 +52,8 @@
material = /decl/material/solid/metal/brass
var/constructed_type = /obj/structure/hygiene/drain
-/obj/item/drain/attackby(var/obj/item/thing, var/mob/user)
- if(IS_WRENCH(thing))
+/obj/item/drain/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_WRENCH(used_item))
new constructed_type(get_turf(src))
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, SPAN_NOTICE("\The [user] wrenches \the [src] down."))
diff --git a/code/game/objects/structures/drying_rack.dm b/code/game/objects/structures/drying_rack.dm
index 6bfacec89299..3feffa51de95 100644
--- a/code/game/objects/structures/drying_rack.dm
+++ b/code/game/objects/structures/drying_rack.dm
@@ -4,11 +4,13 @@
icon = 'icons/obj/drying_rack.dmi'
icon_state = ICON_STATE_WORLD
material = /decl/material/solid/metal/steel
+ color = /decl/material/solid/metal/steel::color
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
var/obj/item/drying
/obj/structure/drying_rack/ebony
material = /decl/material/solid/organic/wood/ebony
+ color = /decl/material/solid/organic/wood/ebony::color
/obj/structure/drying_rack/Destroy()
QDEL_NULL(drying)
@@ -54,12 +56,12 @@
if(drying_state)
add_overlay(drying_state)
-/obj/structure/drying_rack/attackby(var/obj/item/W, var/mob/user)
+/obj/structure/drying_rack/attackby(var/obj/item/used_item, var/mob/user)
- if(!drying && W.is_dryable())
- if(user.try_unequip(W))
- W.forceMove(src)
- drying = W
+ if(!drying && used_item.is_dryable())
+ if(user.try_unequip(used_item))
+ used_item.forceMove(src)
+ drying = used_item
if(!is_processing)
START_PROCESSING(SSobj, src)
update_icon()
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index 768fe81af7f1..79cd15f429fc 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -16,13 +16,13 @@
// TODO: I wanted to make it so you had to actually use your hand to open it if it's closed, but
// that'd be out of scope for just an attackby audit. Someone fix this so it can call parent please.
-/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user)
+/obj/structure/extinguisher_cabinet/attackby(obj/item/used_item, mob/user)
if(isrobot(user))
return FALSE
- if(istype(O, /obj/item/chems/spray/extinguisher))
- if(!has_extinguisher && opened && user.try_unequip(O, src))
- has_extinguisher = O
- to_chat(user, "You place [O] in [src].")
+ if(istype(used_item, /obj/item/chems/spray/extinguisher))
+ if(!has_extinguisher && opened && user.try_unequip(used_item, src))
+ has_extinguisher = used_item
+ to_chat(user, "You place [used_item] in [src].")
playsound(src.loc, 'sound/effects/extin.ogg', 50, 0)
else
opened = !opened
diff --git a/code/game/objects/structures/fences.dm b/code/game/objects/structures/fences.dm
index 8a127ce484fe..05eb791fb898 100644
--- a/code/game/objects/structures/fences.dm
+++ b/code/game/objects/structures/fences.dm
@@ -77,8 +77,8 @@
return TRUE
return ..()
-/obj/structure/fence/handle_repair(mob/user, obj/item/tool)
- var/obj/item/stack/stack = tool
+/obj/structure/fence/handle_repair(mob/user, obj/item/used_item)
+ var/obj/item/stack/stack = used_item
if(hole_size > NO_HOLE && istype(stack))
to_chat(user, SPAN_NOTICE("You fit [stack.get_string_for_amount(1)] to damaged areas of \the [src]."))
stack.use(1)
@@ -88,8 +88,8 @@
return ..()
-/obj/structure/fence/attackby(obj/item/tool, mob/user)
- if(IS_WIRECUTTER(tool))
+/obj/structure/fence/attackby(obj/item/used_item, mob/user)
+ if(IS_WIRECUTTER(used_item))
if(!cuttable)
to_chat(user, SPAN_WARNING("This section of the fence can't be cut."))
return TRUE
@@ -98,7 +98,7 @@
to_chat(user, SPAN_NOTICE("This fence has too much cut out of it already."))
return TRUE
- if(tool.do_tool_interaction(TOOL_WIRECUTTERS, user, src, CUT_TIME, "cutting through", "cutting through", check_skill = FALSE) && current_stage == hole_size) // do_tool_interaction sleeps, so make sure it hasn't been cut more while we waited
+ if(used_item.do_tool_interaction(TOOL_WIRECUTTERS, user, src, CUT_TIME, "cutting through", "cutting through", check_skill = FALSE) && current_stage == hole_size) // do_tool_interaction sleeps, so make sure it hasn't been cut more while we waited
switch(++hole_size)
if(MEDIUM_HOLE)
user.visible_message(
diff --git a/code/game/objects/structures/fireaxe_cabinet.dm b/code/game/objects/structures/fireaxe_cabinet.dm
index ec563ffce7e7..dc52f5b61153 100644
--- a/code/game/objects/structures/fireaxe_cabinet.dm
+++ b/code/game/objects/structures/fireaxe_cabinet.dm
@@ -64,29 +64,29 @@
fireaxe = null
. = ..()
-/obj/structure/fireaxecabinet/attackby(var/obj/item/O, var/mob/user)
+/obj/structure/fireaxecabinet/attackby(var/obj/item/used_item, var/mob/user)
- if(IS_MULTITOOL(O))
+ if(IS_MULTITOOL(used_item))
toggle_lock(user)
return TRUE
- if(istype(O, /obj/item/bladed/axe/fire))
+ if(istype(used_item, /obj/item/bladed/axe/fire))
if(open)
if(fireaxe)
to_chat(user, "There is already \a [fireaxe] inside \the [src].")
- else if(user.try_unequip(O))
- O.forceMove(src)
- fireaxe = O
+ else if(user.try_unequip(used_item))
+ used_item.forceMove(src)
+ fireaxe = used_item
to_chat(user, "You place \the [fireaxe] into \the [src].")
update_icon()
return TRUE
- var/force = O.expend_attack_force(user)
+ var/force = used_item.expend_attack_force(user)
if(force)
user.setClickCooldown(10)
attack_animation(user)
playsound(user, 'sound/effects/Glasshit.ogg', 50, 1)
- visible_message("[user] [pick(O.attack_verb)] \the [src]!")
+ visible_message("[user] [used_item.pick_attack_verb()] \the [src]!")
if(damage_threshold > force)
to_chat(user, "Your strike is deflected by the reinforced glass!")
return TRUE
diff --git a/code/game/objects/structures/fires.dm b/code/game/objects/structures/fires.dm
index 2c7dbb75097f..6f4821ea174c 100644
--- a/code/game/objects/structures/fires.dm
+++ b/code/game/objects/structures/fires.dm
@@ -277,36 +277,36 @@
environment.adjust_gas(w, waste[w], FALSE)
environment.update_values()
-/obj/structure/fire_source/attackby(var/obj/item/thing, var/mob/user)
+/obj/structure/fire_source/attackby(var/obj/item/used_item, var/mob/user)
// Gate a few interactions behind intent so they can be bypassed if needed.
if(!user.check_intent(I_FLAG_HARM))
// Put cooking items onto the fire source.
- if(istype(thing, /obj/item/chems/cooking_vessel) && user.try_unequip(thing, get_turf(src)))
- thing.reset_offsets()
+ if(istype(used_item, /obj/item/chems/cooking_vessel) && user.try_unequip(used_item, get_turf(src)))
+ used_item.reset_offsets()
return TRUE
// Pour fuel or water into a fire.
- if(istype(thing, /obj/item/chems))
- var/obj/item/chems/chems = thing
+ if(istype(used_item, /obj/item/chems))
+ var/obj/item/chems/chems = used_item
if(chems.standard_pour_into(user, src))
return TRUE
- if(lit == FIRE_LIT && istype(thing, /obj/item/flame))
- thing.fire_act(return_air(), get_effective_burn_temperature(), 500)
+ if(lit == FIRE_LIT && istype(used_item, /obj/item/flame))
+ used_item.fire_act(return_air(), get_effective_burn_temperature(), 500)
return TRUE
- if(thing.isflamesource())
- visible_message(SPAN_NOTICE("\The [user] attempts to light \the [src] with \the [thing]."))
- try_light(thing.get_heat())
+ if(used_item.isflamesource())
+ visible_message(SPAN_NOTICE("\The [user] attempts to light \the [src] with \the [used_item]."))
+ try_light(used_item.get_heat())
return TRUE
if((lit != FIRE_LIT || user.check_intent(I_FLAG_HARM)))
// Only drop in one log at a time.
- if(istype(thing, /obj/item/stack))
- var/obj/item/stack/stack = thing
- thing = stack.split(1)
- if(!QDELETED(thing) && user.try_unequip(thing, src))
- user.visible_message(SPAN_NOTICE("\The [user] drops \the [thing] into \the [src]."))
+ if(istype(used_item, /obj/item/stack))
+ var/obj/item/stack/stack = used_item
+ used_item = stack.split(1)
+ if(!QDELETED(used_item) && user.try_unequip(used_item, src))
+ user.visible_message(SPAN_NOTICE("\The [user] drops \the [used_item] into \the [src]."))
update_icon()
return TRUE
@@ -366,13 +366,12 @@
var/do_steam = FALSE
var/list/waste = list()
- for(var/rtype in reagents?.reagent_volumes)
+ for(var/decl/material/reagent as anything in reagents?.reagent_volumes)
- var/decl/material/reagent = GET_DECL(rtype)
if(reagent.accelerant_value <= FUEL_VALUE_SUPPRESSANT && !isnull(reagent.boiling_point) && reagent.boiling_point < get_effective_burn_temperature())
do_steam = TRUE
- var/volume = NONUNIT_CEILING(REAGENT_VOLUME(reagents, rtype) / REAGENT_UNITS_PER_GAS_MOLE, 0.1)
+ var/volume = NONUNIT_CEILING(REAGENT_VOLUME(reagents, reagent) / REAGENT_UNITS_PER_GAS_MOLE, 0.1)
var/list/waste_products = burn_material(reagent, volume)
if(!isnull(waste_products))
for(var/product in waste_products)
diff --git a/code/game/objects/structures/fishtanks.dm b/code/game/objects/structures/fishtanks.dm
index f11786c8c397..313c92a5ccd7 100644
--- a/code/game/objects/structures/fishtanks.dm
+++ b/code/game/objects/structures/fishtanks.dm
@@ -70,10 +70,10 @@ var/global/list/fishtank_cache = list()
visible_message(SPAN_NOTICE("\The [user] taps on \the [src]."))
return TRUE
-/obj/structure/glass_tank/attackby(var/obj/item/W, var/mob/user)
- if(W.get_attack_force(user) < 5 || !user.check_intent(I_FLAG_HARM))
+/obj/structure/glass_tank/attackby(var/obj/item/used_item, var/mob/user)
+ if(used_item.get_attack_force(user) < 5 || !user.check_intent(I_FLAG_HARM))
attack_animation(user)
- visible_message(SPAN_NOTICE("\The [user] taps \the [src] with \the [W]."))
+ visible_message(SPAN_NOTICE("\The [user] taps \the [src] with \the [used_item]."))
else
. = ..()
diff --git a/code/game/objects/structures/fitness.dm b/code/game/objects/structures/fitness.dm
index 6cbc033c7a37..f467fab29b45 100644
--- a/code/game/objects/structures/fitness.dm
+++ b/code/game/objects/structures/fitness.dm
@@ -42,8 +42,8 @@
var/list/success_message = list("with great effort", "straining hard", "without any trouble", "with ease")
var/list/fail_message = list(", lifting them part of the way and then letting them drop", ", unable to even budge them")
-/obj/structure/fitness/weightlifter/attackby(obj/item/W, mob/user)
- if(IS_WRENCH(W))
+/obj/structure/fitness/weightlifter/attackby(obj/item/used_item, mob/user)
+ if(IS_WRENCH(used_item))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 75, 1)
weight = (weight % max_weight) + 1
to_chat(user, "You set the machine's weight level to [weight].")
diff --git a/code/game/objects/structures/flaps.dm b/code/game/objects/structures/flaps.dm
index 3208d09cc814..b3b305a9f946 100644
--- a/code/game/objects/structures/flaps.dm
+++ b/code/game/objects/structures/flaps.dm
@@ -41,14 +41,14 @@
return ..()
-/obj/structure/flaps/attackby(obj/item/W, mob/user)
- if(IS_CROWBAR(W) && !anchored)
+/obj/structure/flaps/attackby(obj/item/used_item, mob/user)
+ if(IS_CROWBAR(used_item) && !anchored)
user.visible_message("\The [user] begins deconstructing \the [src].", "You start deconstructing \the [src].")
if(user.do_skilled(3 SECONDS, SKILL_CONSTRUCTION, src))
user.visible_message("\The [user] deconstructs \the [src].", "You deconstruct \the [src].")
qdel(src)
return TRUE
- if(IS_SCREWDRIVER(W) && anchored)
+ if(IS_SCREWDRIVER(used_item) && anchored)
airtight = !airtight
airtight ? become_airtight() : clear_airtight()
user.visible_message("\The [user] adjusts \the [src], [airtight ? "preventing" : "allowing"] air flow.")
diff --git a/code/game/objects/structures/flora/_flora.dm b/code/game/objects/structures/flora/_flora.dm
index c38361f4a845..a7bcda669ec2 100644
--- a/code/game/objects/structures/flora/_flora.dm
+++ b/code/game/objects/structures/flora/_flora.dm
@@ -25,16 +25,16 @@
clear_materials()
return ..()
-/obj/structure/flora/attackby(obj/item/O, mob/user)
- if(!user.check_intent(I_FLAG_HARM) && can_cut_down(O, user))
+/obj/structure/flora/attackby(obj/item/used_item, mob/user)
+ if(!user.check_intent(I_FLAG_HARM) && can_cut_down(used_item, user))
play_cut_sound(user)
- cut_down(O, user)
+ cut_down(used_item, user)
return TRUE
. = ..()
/**Whether the item used by user can cause cut_down to be called. Used to bypass default attack proc for some specific items/tools. */
-/obj/structure/flora/proc/can_cut_down(var/obj/item/I, var/mob/user)
- return (I.expend_attack_force(user) >= 5) && I.is_sharp() //Anything sharp and relatively strong can cut us instantly
+/obj/structure/flora/proc/can_cut_down(var/obj/item/used_item, var/mob/user)
+ return (used_item.expend_attack_force(user) >= 5) && used_item.is_sharp() //Anything sharp and relatively strong can cut us instantly
/**What to do when the can_cut_down check returns true. Normally simply calls dismantle. */
/obj/structure/flora/proc/play_cut_sound(mob/user)
@@ -42,7 +42,7 @@
if(snd_cut)
playsound(src, snd_cut, 40, TRUE)
-/obj/structure/flora/proc/cut_down(var/obj/item/I, var/mob/user)
+/obj/structure/flora/proc/cut_down(var/obj/item/used_item, var/mob/user)
dismantle_structure(user)
return TRUE
@@ -74,3 +74,4 @@
icon = 'icons/effects/decals/plant_remains.dmi'
icon_state = "leafy_bits"
cleanable_scent = "freshly cut plants"
+ sweepable = TRUE
diff --git a/code/game/objects/structures/flora/plant.dm b/code/game/objects/structures/flora/plant.dm
index 02ccd36a6567..9e44f55a2f3a 100644
--- a/code/game/objects/structures/flora/plant.dm
+++ b/code/game/objects/structures/flora/plant.dm
@@ -73,15 +73,15 @@
reset_color()
set_overlays(plant.get_appearance(dead = dead, growth_stage = growth_stage, can_harvest = !!harvestable))
-/obj/structure/flora/plant/attackby(obj/item/O, mob/user)
+/obj/structure/flora/plant/attackby(obj/item/used_item, mob/user)
- if(IS_SHOVEL(O) || IS_HATCHET(O))
- user.visible_message(SPAN_NOTICE("\The [user] uproots \the [src] with \the [O]!"))
+ if(IS_SHOVEL(used_item) || IS_HATCHET(used_item))
+ user.visible_message(SPAN_NOTICE("\The [user] uproots \the [src] with \the [used_item]!"))
physically_destroyed()
return TRUE
// Hydrotray boilerplate for taking samples.
- if(O.has_edge() && O.w_class < ITEM_SIZE_NORMAL && !user.check_intent(I_FLAG_HARM))
+ if(used_item.has_edge() && used_item.w_class < ITEM_SIZE_NORMAL && !user.check_intent(I_FLAG_HARM))
if(sampled)
to_chat(user, SPAN_WARNING("There's no bits that can be used for a sampling left."))
return TRUE
diff --git a/code/game/objects/structures/fountain.dm b/code/game/objects/structures/fountain.dm
index c92c9d360b1f..f596d169c6e0 100644
--- a/code/game/objects/structures/fountain.dm
+++ b/code/game/objects/structures/fountain.dm
@@ -85,6 +85,22 @@
used = TRUE
desc = "The water flows beautifully from the spout, but the water in the pool does not ripple."
+/mob/living/human
+ /// Used by the Fountain of Youth point of interest for on-examine messages.
+ var/became_older
+ /// Used by the Fountain of Youth point of interest for on-examine messages.
+ var/became_younger
+
+/decl/human_examination/fountain
+ priority = /decl/human_examination/graffiti::priority + 0.5 // just squeeze it in there
+
+/decl/human_examination/fountain/do_examine(mob/user, distance, mob/living/human/source, hideflags, decl/pronouns/pronouns)
+ . = list()
+ if(source.became_younger)
+ . += "[pronouns.He] look[pronouns.s] a lot younger than you remember."
+ if(source.became_older)
+ . += "[pronouns.He] look[pronouns.s] a lot older than you remember."
+
/obj/structure/fountain/mundane
name = "fountain"
desc = "A beautifully constructed fountain."
diff --git a/code/game/objects/structures/fuel_port.dm b/code/game/objects/structures/fuel_port.dm
index 91eef126f0bb..6488d9972ad2 100644
--- a/code/game/objects/structures/fuel_port.dm
+++ b/code/game/objects/structures/fuel_port.dm
@@ -51,9 +51,9 @@
else
add_overlay("[icon_state]_closed")
-/obj/structure/fuel_port/attackby(obj/item/W, mob/user)
+/obj/structure/fuel_port/attackby(obj/item/used_item, mob/user)
. = FALSE
- if(W.do_tool_interaction(TOOL_CROWBAR, user, src, 1 SECOND))
+ if(used_item.do_tool_interaction(TOOL_CROWBAR, user, src, 1 SECOND))
if(open)
playsound(src, sound_open, 25, 0, -3)
open = FALSE
@@ -62,7 +62,7 @@
open = TRUE
. = TRUE
- else if(istype(W, /obj/item/tank))
+ else if(istype(used_item, /obj/item/tank))
if(!open)
to_chat(user, SPAN_WARNING("\The [src] door is still closed!"))
return TRUE
@@ -71,7 +71,7 @@
to_chat(user, SPAN_WARNING("\The [src] already has a tank inside!"))
return TRUE
else
- user.try_unequip(W, src)
+ user.try_unequip(used_item, src)
. = TRUE
if(.)
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index a82c4c7733da..d168182cdcc2 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -92,37 +92,37 @@
return FALSE
. = ..()
-/obj/structure/girder/attackby(var/obj/item/W, var/mob/user)
+/obj/structure/girder/attackby(var/obj/item/used_item, var/mob/user)
// Other methods of quickly destroying a girder.
- if(W.is_special_cutting_tool(TRUE))
- if(istype(W, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/cutter = W
+ if(used_item.is_special_cutting_tool(TRUE))
+ if(istype(used_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/cutter = used_item
if(!cutter.slice(user))
return TRUE
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- visible_message(SPAN_NOTICE("\The [user] begins slicing apart \the [src] with \the [W]."))
+ visible_message(SPAN_NOTICE("\The [user] begins slicing apart \the [src] with \the [used_item]."))
if(do_after(user,reinf_material ? 40: 20,src))
- visible_message(SPAN_NOTICE("\The [user] slices apart \the [src] with \the [W]."))
+ visible_message(SPAN_NOTICE("\The [user] slices apart \the [src] with \the [used_item]."))
dismantle_structure(user)
return TRUE
- if(IS_PICK(W))
- if(W.material?.hardness < material.hardness)
- to_chat(user, SPAN_WARNING("\The [W] is not hard enough to excavate [material.solid_name]."))
- else if(W.get_tool_quality(TOOL_PICK) < TOOL_QUALITY_GOOD)
- to_chat(user, SPAN_WARNING("\The [W] is not capable of destroying \the [src]."))
- else if(W.do_tool_interaction(TOOL_PICK, user, src, (reinf_material ? 6 : 4) SECONDS, set_cooldown = TRUE))
+ if(IS_PICK(used_item))
+ if(used_item.material?.hardness < material.hardness)
+ to_chat(user, SPAN_WARNING("\The [used_item] is not hard enough to excavate [material.solid_name]."))
+ else if(used_item.get_tool_quality(TOOL_PICK) < TOOL_QUALITY_GOOD)
+ to_chat(user, SPAN_WARNING("\The [used_item] is not capable of destroying \the [src]."))
+ else if(used_item.do_tool_interaction(TOOL_PICK, user, src, (reinf_material ? 6 : 4) SECONDS, set_cooldown = TRUE))
dismantle_structure(user)
return TRUE
// Reinforcing a girder, or turning it into a wall.
- if(istype(W, /obj/item/stack/material))
+ if(istype(used_item, /obj/item/stack/material))
if(anchored)
- return construct_wall(W, user)
+ return construct_wall(used_item, user)
else
if(reinf_material)
to_chat(user, SPAN_WARNING("\The [src] is already reinforced with [reinf_material.solid_name]."))
else
- return reinforce_with_material(W, user)
+ return reinforce_with_material(used_item, user)
return TRUE
. = ..()
diff --git a/code/game/objects/structures/grandfather_clock.dm b/code/game/objects/structures/grandfather_clock.dm
index 24882cb59e6c..49f4b63c22b7 100644
--- a/code/game/objects/structures/grandfather_clock.dm
+++ b/code/game/objects/structures/grandfather_clock.dm
@@ -8,6 +8,7 @@
density = TRUE
material = /decl/material/solid/organic/wood/mahogany
material_alteration = MAT_FLAG_ALTERATION_ALL
+ color = /decl/material/solid/organic/wood/mahogany::color
var/face_color = "#f0edc7"
var/last_time
var/decl/material/clockwork_mat = /decl/material/solid/metal/brass
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index f1717f3be263..2577519149b1 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -166,13 +166,13 @@
parts_amount = 1
update_icon()
-/obj/structure/grille/attackby(obj/item/W, mob/user)
- if(IS_WIRECUTTER(W))
+/obj/structure/grille/attackby(obj/item/used_item, mob/user)
+ if(IS_WIRECUTTER(used_item))
if(!material.conductive || !shock(user, 100))
cut_grille()
return TRUE
- if((IS_SCREWDRIVER(W)))
+ if((IS_SCREWDRIVER(used_item)))
var/turf/turf = loc
if(((istype(turf) && turf.simulated) || anchored))
if(!shock(user, 90))
@@ -187,8 +187,8 @@
return TRUE
//window placing
- if(istype(W,/obj/item/stack/material))
- var/obj/item/stack/material/ST = W
+ if(istype(used_item,/obj/item/stack/material))
+ var/obj/item/stack/material/ST = used_item
if(ST.material.opacity > 0.7)
return FALSE
@@ -204,15 +204,15 @@
place_window(user, loc, dir_to_set, ST)
return TRUE
- if(!(W.obj_flags & OBJ_FLAG_CONDUCTIBLE) || !shock(user, 70))
+ if(!(used_item.obj_flags & OBJ_FLAG_CONDUCTIBLE) || !shock(user, 70))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
- switch(W.atom_damage_type)
+ switch(used_item.atom_damage_type)
if(BURN)
- take_damage(W.expend_attack_force(user))
+ take_damage(used_item.expend_attack_force(user))
if(BRUTE)
- take_damage(W.expend_attack_force(user) * 0.1)
+ take_damage(used_item.expend_attack_force(user) * 0.1)
return TRUE
return ..()
diff --git a/code/game/objects/structures/hand_cart.dm b/code/game/objects/structures/hand_cart.dm
index e87082ef4650..33b352889f37 100644
--- a/code/game/objects/structures/hand_cart.dm
+++ b/code/game/objects/structures/hand_cart.dm
@@ -20,7 +20,7 @@
underlays += "cart_wheel"
var/image/I = image(icon, "handcart_layer_north")
I.layer = STRUCTURE_LAYER + 0.02
- I.color = BlendRGB(color, material.color, 0.5)
+ I.color = BlendHSV(color, material.color, 0.5)
add_overlay(I)
if(carrying)
var/image/CA = image(carrying.icon, carrying.icon_state)
diff --git a/code/game/objects/structures/hay.dm b/code/game/objects/structures/hay.dm
index 47fa6ac32056..71f6c73a0647 100644
--- a/code/game/objects/structures/hay.dm
+++ b/code/game/objects/structures/hay.dm
@@ -44,6 +44,7 @@
icon = 'icons/obj/structures/haystack.dmi'
icon_state = ICON_STATE_WORLD
material = /decl/material/solid/organic/plantmatter/grass/dry
+ color = /decl/material/solid/organic/plantmatter/grass/dry::color
storage = /datum/storage/haystack
material_alteration = MAT_FLAG_ALTERATION_COLOR
atom_flags = ATOM_FLAG_CLIMBABLE
diff --git a/code/game/objects/structures/holosigns.dm b/code/game/objects/structures/holosigns.dm
index 5e9ace14110d..d0c2b590a36f 100644
--- a/code/game/objects/structures/holosigns.dm
+++ b/code/game/objects/structures/holosigns.dm
@@ -25,8 +25,8 @@
deactivate(user)
return TRUE
-/obj/structure/holosign/attackby(obj/W, mob/user)
- visible_message(SPAN_NOTICE("\The [user] waves \a [W] through \the [src], causing it to dissipate."))
+/obj/structure/holosign/attackby(obj/item/used_item, mob/user)
+ visible_message(SPAN_NOTICE("\The [user] waves \a [used_item] through \the [src], causing it to dissipate."))
deactivate(user)
return TRUE
diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm
index 6963ec745c48..137ce1cba193 100644
--- a/code/game/objects/structures/inflatable.dm
+++ b/code/game/objects/structures/inflatable.dm
@@ -19,11 +19,11 @@
return
playsound(loc, 'sound/items/zip.ogg', 75, 1)
user.visible_message(SPAN_NOTICE("[user] inflates \the [src]."), SPAN_NOTICE("You inflate \the [src]."))
- var/obj/structure/inflatable/R = new deploy_path(user.loc)
- transfer_fingerprints_to(R)
- R.add_fingerprint(user)
+ var/obj/structure/inflatable/debris = new deploy_path(user.loc)
+ transfer_fingerprints_to(debris)
+ debris.add_fingerprint(user)
if(inflatable_health)
- R.current_health = inflatable_health
+ debris.current_health = inflatable_health
qdel(src)
/obj/item/inflatable/door
@@ -137,14 +137,14 @@
current_health = clamp(current_health + 3, 0, get_max_health())
taped = TRUE
-/obj/structure/inflatable/attackby(obj/item/W, mob/user)
+/obj/structure/inflatable/attackby(obj/item/used_item, mob/user)
- if((W.atom_damage_type == BRUTE || W.atom_damage_type == BURN) && (W.can_puncture() || W.expend_attack_force(user) > 10))
- visible_message(SPAN_DANGER("\The [user] pierces \the [src] with \the [W]!"))
+ if((used_item.atom_damage_type == BRUTE || used_item.atom_damage_type == BURN) && (used_item.can_puncture() || used_item.expend_attack_force(user) > 10))
+ visible_message(SPAN_DANGER("\The [user] pierces \the [src] with \the [used_item]!"))
deflate(TRUE)
return TRUE
- if(!istype(W, /obj/item/inflatable_dispenser))
+ if(!istype(used_item, /obj/item/inflatable_dispenser))
return ..()
return FALSE
@@ -160,17 +160,16 @@
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
if(violent)
visible_message("[src] rapidly deflates!")
- var/obj/item/inflatable/torn/R = new(loc)
- src.transfer_fingerprints_to(R)
+ transfer_fingerprints_to(new /obj/item/inflatable/torn(loc))
qdel(src)
else
if(!undeploy_path)
return
visible_message("\The [src] slowly deflates.")
spawn(50)
- var/obj/item/inflatable/R = new undeploy_path(src.loc)
- src.transfer_fingerprints_to(R)
- R.inflatable_health = current_health
+ var/obj/item/inflatable/door_item = new undeploy_path(src.loc)
+ src.transfer_fingerprints_to(door_item)
+ door_item.inflatable_health = current_health
qdel(src)
/obj/structure/inflatable/verb/hand_deflate()
@@ -270,15 +269,15 @@
playsound(loc, 'sound/machines/hiss.ogg', 75, 1)
if(violent)
visible_message("[src] rapidly deflates!")
- var/obj/item/inflatable/door/torn/R = new /obj/item/inflatable/door/torn(loc)
- src.transfer_fingerprints_to(R)
+ transfer_fingerprints_to(new /obj/item/inflatable/door/torn(loc))
qdel(src)
else
visible_message("[src] slowly deflates.")
spawn(50)
- var/obj/item/inflatable/door/R = new /obj/item/inflatable/door(loc)
- src.transfer_fingerprints_to(R)
- qdel(src)
+ if(!QDELETED(src))
+ if(loc)
+ transfer_fingerprints_to(new /obj/item/inflatable/door(loc))
+ qdel(src)
/obj/item/inflatable/torn
name = "torn inflatable wall"
diff --git a/code/game/objects/structures/ironing_board.dm b/code/game/objects/structures/ironing_board.dm
index 3248822f656e..a6c821cadf72 100644
--- a/code/game/objects/structures/ironing_board.dm
+++ b/code/game/objects/structures/ironing_board.dm
@@ -24,14 +24,14 @@
. = ..()
-/obj/structure/bed/roller/ironingboard/proc/remove_item(var/obj/item/I)
- if(I == cloth)
+/obj/structure/bed/roller/ironingboard/proc/remove_item(var/obj/item/used_item)
+ if(used_item == cloth)
cloth = null
- else if(I == holding)
+ else if(used_item == holding)
holding = null
update_icon()
- events_repository.unregister(/decl/observ/destroyed, I, src, TYPE_PROC_REF(/obj/structure/bed/roller/ironingboard, remove_item))
+ events_repository.unregister(/decl/observ/destroyed, used_item, src, TYPE_PROC_REF(/obj/structure/bed/roller/ironingboard, remove_item))
// make a screeching noise to drive people mad
/obj/structure/bed/roller/ironingboard/Move()
@@ -60,14 +60,14 @@
if(cloth)
add_overlay(image(cloth.icon, cloth.icon_state))
-/obj/structure/bed/roller/ironingboard/attackby(var/obj/item/I, var/mob/user)
+/obj/structure/bed/roller/ironingboard/attackby(var/obj/item/used_item, var/mob/user)
if(!density)
- if(istype(I,/obj/item/clothing) || istype(I,/obj/item/ironingiron))
+ if(istype(used_item,/obj/item/clothing) || istype(used_item,/obj/item/ironingiron))
to_chat(user, "[src] isn't deployed!")
return TRUE
return ..()
- if(istype(I,/obj/item/clothing))
+ if(istype(used_item,/obj/item/clothing))
if(cloth)
to_chat(user, "[cloth] is already on the ironing table!")
return TRUE
@@ -75,13 +75,13 @@
to_chat(user, "[buckled_mob] is already on the ironing table!")
return TRUE
- if(user.try_unequip(I, src))
- cloth = I
- events_repository.register(/decl/observ/destroyed, I, src, TYPE_PROC_REF(/obj/structure/bed/roller/ironingboard, remove_item))
+ if(user.try_unequip(used_item, src))
+ cloth = used_item
+ events_repository.register(/decl/observ/destroyed, used_item, src, TYPE_PROC_REF(/obj/structure/bed/roller/ironingboard, remove_item))
update_icon()
return TRUE
- else if(istype(I,/obj/item/ironingiron))
- var/obj/item/ironingiron/R = I
+ else if(istype(used_item,/obj/item/ironingiron))
+ var/obj/item/ironingiron/iron = used_item
// anti-wrinkle "massage"
if(buckled_mob && ishuman(buckled_mob))
@@ -100,9 +100,9 @@
return TRUE
if(!cloth)
- if(!holding && !R.enabled && user.try_unequip(I, src))
- holding = R
- events_repository.register(/decl/observ/destroyed, I, src, TYPE_PROC_REF(/obj/structure/bed/roller/ironingboard, remove_item))
+ if(!holding && !iron.enabled && user.try_unequip(used_item, src))
+ holding = iron
+ events_repository.register(/decl/observ/destroyed, used_item, src, TYPE_PROC_REF(/obj/structure/bed/roller/ironingboard, remove_item))
update_icon()
return TRUE
to_chat(user, "There isn't anything on the ironing board.")
diff --git a/code/game/objects/structures/iv_drip.dm b/code/game/objects/structures/iv_drip.dm
index ffc24bfd1b37..796690f63565 100644
--- a/code/game/objects/structures/iv_drip.dm
+++ b/code/game/objects/structures/iv_drip.dm
@@ -84,15 +84,15 @@
return TRUE
. = ..()
-/obj/structure/iv_drip/attackby(obj/item/W, mob/user)
- if (istype(W, /obj/item/chems))
+/obj/structure/iv_drip/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item, /obj/item/chems))
if(!isnull(src.beaker))
to_chat(user, "There is already a reagent container loaded!")
return TRUE
- if(!user.try_unequip(W, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- beaker = W
- to_chat(user, "You attach \the [W] to \the [src].")
+ beaker = used_item
+ to_chat(user, "You attach \the [used_item] to \the [src].")
queue_icon_update()
return TRUE
else
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index 4d58c9790cbf..5d67e910f7cb 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -24,69 +24,69 @@
. += "\The [src] [html_icon(src)] contains [reagents.total_volume] unit\s of liquid!"
-/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/bag/trash) && !mybag)
- if(!user.try_unequip(I, src))
+/obj/structure/janitorialcart/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/bag/trash) && !mybag)
+ if(!user.try_unequip(used_item, src))
return TRUE
- mybag = I
+ mybag = used_item
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [used_item] into [src].")
return TRUE
- else if(istype(I, /obj/item/mop))
- if(I.reagents.total_volume < I.reagents.maximum_volume) //if it's not completely soaked we assume they want to wet it, otherwise store it
+ else if(istype(used_item, /obj/item/mop))
+ if(used_item.reagents.total_volume < used_item.reagents.maximum_volume) //if it's not completely soaked we assume they want to wet it, otherwise store it
if(reagents.total_volume < 1)
to_chat(user, "[src] is out of water!")
else
- reagents.trans_to_obj(I, I.reagents.maximum_volume)
- to_chat(user, "You wet [I] in [src].")
+ reagents.trans_to_obj(used_item, used_item.reagents.maximum_volume)
+ to_chat(user, "You wet [used_item] in [src].")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return TRUE
if(!mymop)
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- mymop = I
+ mymop = used_item
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [used_item] into [src].")
return TRUE
- else if(istype(I, /obj/item/chems/spray) && !myspray)
- if(!user.try_unequip(I, src))
+ else if(istype(used_item, /obj/item/chems/spray) && !myspray)
+ if(!user.try_unequip(used_item, src))
return TRUE
- myspray = I
+ myspray = used_item
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [used_item] into [src].")
return TRUE
- else if(istype(I, /obj/item/lightreplacer) && !myreplacer)
- if(!user.try_unequip(I, src))
+ else if(istype(used_item, /obj/item/lightreplacer) && !myreplacer)
+ if(!user.try_unequip(used_item, src))
return TRUE
- myreplacer = I
+ myreplacer = used_item
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [used_item] into [src].")
return TRUE
- else if(istype(I, /obj/item/caution))
+ else if(istype(used_item, /obj/item/caution))
if(signs < 4)
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
signs++
update_icon()
updateUsrDialog()
- to_chat(user, "You put [I] into [src].")
+ to_chat(user, "You put [used_item] into [src].")
else
to_chat(user, "[src] can't hold any more signs.")
return TRUE
- else if(istype(I, /obj/item/chems/glass))
+ else if(istype(used_item, /obj/item/chems/glass))
return FALSE // So we do not put them in the trash bag as we mean to fill the mop bucket; FALSE means run afterattack
else if(mybag)
- return mybag.attackby(I, user)
+ return mybag.attackby(used_item, user)
return ..()
@@ -217,26 +217,26 @@
if(mybag)
. += "\A [mybag] is hanging on the [callme]."
-/obj/structure/janicart/attackby(obj/item/I, mob/user)
+/obj/structure/janicart/attackby(obj/item/used_item, mob/user)
- if(istype(I, /obj/item/mop))
+ if(istype(used_item, /obj/item/mop))
if(reagents.total_volume > 1)
- reagents.trans_to_obj(I, 2)
- to_chat(user, SPAN_NOTICE("You wet [I] in the [callme]."))
+ reagents.trans_to_obj(used_item, 2)
+ to_chat(user, SPAN_NOTICE("You wet [used_item] in the [callme]."))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
to_chat(user, SPAN_NOTICE("This [callme] is out of water!"))
return TRUE
- if(istype(I, /obj/item/janicart_key))
- to_chat(user, SPAN_NOTICE("Hold \the [I] in one of your hands while you drive this [callme]."))
+ if(istype(used_item, /obj/item/janicart_key))
+ to_chat(user, SPAN_NOTICE("Hold \the [used_item] in one of your hands while you drive this [callme]."))
return TRUE
- if(istype(I, /obj/item/bag/trash))
- if(!user.try_unequip(I, src))
+ if(istype(used_item, /obj/item/bag/trash))
+ if(!user.try_unequip(used_item, src))
return TRUE
- to_chat(user, SPAN_NOTICE("You hook \the [I] onto the [callme]."))
- mybag = I
+ to_chat(user, SPAN_NOTICE("You hook \the [used_item] onto the [callme]."))
+ mybag = used_item
return TRUE
. = ..()
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index 3de7c1dba7b2..0dd3a86c453d 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -64,37 +64,37 @@
to_chat(user, SPAN_NOTICE("Slicing lattice joints..."))
physically_destroyed()
-/obj/structure/lattice/attackby(obj/item/C, mob/user)
- if (istype(C, /obj/item/stack/tile))
+/obj/structure/lattice/attackby(obj/item/used_item, mob/user)
+ if (istype(used_item, /obj/item/stack/tile))
var/turf/T = get_turf(src)
- T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
+ T.attackby(used_item, user) //BubbleWrap - hand this off to the underlying turf instead
return TRUE
- if(IS_WELDER(C))
- var/obj/item/weldingtool/WT = C
- if(WT.weld(0, user))
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.weld(0, user))
deconstruct(user)
return TRUE
- if(istype(C, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/cutter = C
+ if(istype(used_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/cutter = used_item
if(!cutter.slice(user))
return TRUE
deconstruct(user)
return TRUE
- if (istype(C, /obj/item/stack/material/rods))
+ if (istype(used_item, /obj/item/stack/material/rods))
var/ladder = (locate(/obj/structure/ladder) in loc)
if(ladder)
to_chat(user, SPAN_WARNING("\The [ladder] is in the way."))
return TRUE
- var/obj/item/stack/material/rods/R = C
+ var/obj/item/stack/material/rods/rods = used_item
var/turf/my_turf = get_turf(src)
if(my_turf?.get_supporting_platform())
to_chat(user, SPAN_WARNING("There is already a platform here."))
return TRUE
- else if(R.use(2))
+ else if(rods.use(2))
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
- new /obj/structure/catwalk(my_turf, R.material.type)
+ new /obj/structure/catwalk(my_turf, rods.material.type)
return TRUE
else
to_chat(user, SPAN_WARNING("You require at least two rods to complete the catwalk."))
diff --git a/code/game/objects/structures/memorial.dm b/code/game/objects/structures/memorial.dm
index 5a99c067a93d..38b509028309 100644
--- a/code/game/objects/structures/memorial.dm
+++ b/code/game/objects/structures/memorial.dm
@@ -12,12 +12,12 @@
var/list/fallen = list()
-/obj/structure/memorial/attackby(var/obj/D, var/mob/user)
- if(istype(D, /obj/item/clothing/dog_tags))
- var/obj/item/clothing/dog_tags/T = D
- to_chat(user, "You add \the [T.owner_name]'s \the [T] to \the [src].")
- fallen += "[T.owner_rank] [T.owner_name] | [T.owner_branch]"
- qdel(T)
+/obj/structure/memorial/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/clothing/dog_tags))
+ var/obj/item/clothing/dog_tags/dogtags = used_item
+ to_chat(user, "You add \the [dogtags.owner_name]'s [dogtags.name] to \the [src].")
+ fallen += "[dogtags.owner_rank] [dogtags.owner_name] | [dogtags.owner_branch]"
+ qdel(dogtags)
return TRUE
return ..()
diff --git a/code/game/objects/structures/mineral_bath.dm b/code/game/objects/structures/mineral_bath.dm
index 3180e095a765..1ed4d581c726 100644
--- a/code/game/objects/structures/mineral_bath.dm
+++ b/code/game/objects/structures/mineral_bath.dm
@@ -14,7 +14,9 @@
/obj/structure/mineral_bath/return_air()
var/datum/gas_mixture/venus = new(CELL_VOLUME, SYNTH_HEAT_LEVEL_1 - 10)
- venus.adjust_multi(/decl/material/gas/chlorine, MOLES_N2STANDARD, /decl/material/gas/hydrogen, MOLES_O2STANDARD)
+
+ venus.adjust_gas(/decl/material/gas/chlorine, MOLES_N2STANDARD, FALSE)
+ venus.adjust_gas(/decl/material/gas/hydrogen, MOLES_O2STANDARD, TRUE)
return venus
/obj/structure/mineral_bath/grab_attack(obj/item/grab/grab, mob/user)
@@ -108,18 +110,17 @@
if(occupant.has_body_flag(BODY_FLAG_CRYSTAL_REFORM) && prob(10))
var/decl/bodytype/root_bodytype = occupant.get_bodytype()
for(var/limb_type in root_bodytype.has_limbs)
- var/obj/item/organ/external/E = GET_EXTERNAL_ORGAN(occupant, limb_type)
- if(E && !E.is_usable() && !(E.limb_flags & ORGAN_FLAG_HEALS_OVERKILL))
- occupant.remove_organ(E)
- qdel(E)
- E = null
- if(!E)
+ var/obj/item/organ/external/limb = GET_EXTERNAL_ORGAN(occupant, limb_type)
+ if(limb && !limb.is_usable() && !(limb.limb_flags & ORGAN_FLAG_HEALS_OVERKILL))
+ occupant.remove_organ(limb)
+ qdel(limb)
+ limb = null
+ if(!limb)
var/list/organ_data = root_bodytype.has_limbs[limb_type]
var/limb_path = organ_data["path"]
- E = new limb_path(occupant)
- organ_data["descriptor"] = E.name
- to_chat(occupant, SPAN_NOTICE("You feel your [E.name] reform in the crystal bath."))
- occupant.update_body()
+ limb = new limb_path(occupant)
+ occupant.add_organ(limb, GET_EXTERNAL_ORGAN(occupant, limb.parent_organ), FALSE, FALSE)
+ to_chat(occupant, SPAN_NOTICE("You feel your [limb.name] reform in the crystal bath."))
repaired_organ = TRUE
break
@@ -133,18 +134,18 @@
// Repair robotic external organs.
if(!repaired_organ && prob(25))
- for(var/obj/item/organ/external/E in occupant.get_external_organs())
- if(BP_IS_PROSTHETIC(E))
- for(var/obj/implanted_object in E.implants)
+ for(var/obj/item/organ/external/limb in occupant.get_external_organs())
+ if(BP_IS_PROSTHETIC(limb))
+ for(var/obj/implanted_object in limb.implants)
if(!istype(implanted_object,/obj/item/implant) && !istype(implanted_object,/obj/item/organ/internal/augment) && prob(25)) // We don't want to remove REAL implants. Just shrapnel etc.
- LAZYREMOVE(E.implants, implanted_object)
+ LAZYREMOVE(limb.implants, implanted_object)
to_chat(occupant, SPAN_NOTICE("The mineral-rich bath dissolves the [implanted_object.name]."))
qdel(implanted_object)
- if(E.brute_dam || E.burn_dam)
- E.heal_damage(rand(3,5), rand(3,5), robo_repair = 1)
+ if(limb.brute_dam || limb.burn_dam)
+ limb.heal_damage(rand(3,5), rand(3,5), robo_repair = 1)
if(prob(25))
- to_chat(occupant, SPAN_NOTICE("The mineral-rich bath mends your [E.name]."))
- if(!BP_IS_CRYSTAL(E) && !BP_IS_BRITTLE(E))
- E.status |= ORGAN_BRITTLE
+ to_chat(occupant, SPAN_NOTICE("The mineral-rich bath mends your [limb.name]."))
+ if(!BP_IS_CRYSTAL(limb) && !BP_IS_BRITTLE(limb))
+ limb.status |= ORGAN_BRITTLE
to_chat(occupant, SPAN_WARNING("It feels a bit brittle, though..."))
break
diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm
index 4a4adca8fb22..22eec93ece55 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -17,15 +17,15 @@
if(distance <= 1)
. += "\The [src] [html_icon(src)] contains [reagents.total_volume] unit\s of water!"
-/obj/structure/mopbucket/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/mop))
+/obj/structure/mopbucket/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, SPAN_WARNING("\The [src] is out of water!"))
- else if(REAGENTS_FREE_SPACE(I.reagents) >= 5)
- reagents.trans_to_obj(I, 5)
- to_chat(user, SPAN_NOTICE("You wet \the [I] in \the [src]."))
+ else if(REAGENTS_FREE_SPACE(used_item.reagents) >= 5)
+ reagents.trans_to_obj(used_item, 5)
+ to_chat(user, SPAN_NOTICE("You wet \the [used_item] in \the [src]."))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
- to_chat(user, SPAN_WARNING("\The [I] is saturated."))
+ to_chat(user, SPAN_WARNING("\The [used_item] is saturated."))
return TRUE
return ..()
diff --git a/code/game/objects/structures/pit.dm b/code/game/objects/structures/pit.dm
index 3e906526c8db..245e55bce956 100644
--- a/code/game/objects/structures/pit.dm
+++ b/code/game/objects/structures/pit.dm
@@ -148,6 +148,7 @@
pixel_y = 8
anchored = TRUE
material = /decl/material/solid/organic/wood/oak
+ color = /decl/material/solid/organic/wood/oak::color
w_class = ITEM_SIZE_NORMAL
material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC | MAT_FLAG_ALTERATION_COLOR
var/message = "Unknown."
@@ -214,6 +215,7 @@
destruction_start_message = "smashing"
destruction_finish_message = "smashing"
material = /decl/material/solid/stone/granite
+ color = /decl/material/solid/stone/granite::color
// Gravemarker items.
// TODO: unify with signs somehow? some of this behaviour is similar...
@@ -223,6 +225,7 @@
icon = 'icons/obj/structures/gravestone.dmi'
icon_state = "wood"
material = /decl/material/solid/organic/wood/oak
+ color = /decl/material/solid/organic/wood/oak::color
w_class = ITEM_SIZE_NORMAL
material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC | MAT_FLAG_ALTERATION_COLOR
var/gravemarker_type = /obj/structure/gravemarker
@@ -232,6 +235,7 @@
name = "gravestone"
icon_state = "stone"
material = /decl/material/solid/stone/granite
+ color = /decl/material/solid/stone/granite::color
gravemarker_type = /obj/structure/gravemarker/gravestone
/obj/item/gravemarker/get_examine_strings(mob/user, distance, infix, suffix)
diff --git a/code/game/objects/structures/produce_bin.dm b/code/game/objects/structures/produce_bin.dm
index 5c4b23434322..86ed462f5050 100644
--- a/code/game/objects/structures/produce_bin.dm
+++ b/code/game/objects/structures/produce_bin.dm
@@ -23,27 +23,27 @@
if(storage.can_be_inserted(produce, null))
storage.handle_item_insertion(null, produce)
-/obj/structure/produce_bin/attackby(obj/item/bag, mob/user)
+/obj/structure/produce_bin/attackby(obj/item/used_item, mob/user)
if(user.check_intent(I_FLAG_HARM))
return ..()
- if(bag.storage)
+ if(used_item.storage)
var/emptied = FALSE
- for(var/obj/item/food/grown/produce in bag.get_stored_inventory())
+ for(var/obj/item/food/grown/produce in used_item.get_stored_inventory())
if(storage.can_be_inserted(produce))
- bag.storage.remove_from_storage(null, produce, loc, skip_update = TRUE)
+ used_item.storage.remove_from_storage(null, produce, loc, skip_update = TRUE)
storage.handle_item_insertion(null, produce, skip_update = TRUE)
emptied = TRUE
if(emptied)
- bag.storage.finish_bulk_removal()
+ used_item.storage.finish_bulk_removal()
storage.finish_bulk_insertion()
- if(length(bag.get_stored_inventory()))
- to_chat(user, SPAN_NOTICE("You partially empty \the [bag] into \the [src]'s hopper."))
+ if(length(used_item.get_stored_inventory()))
+ to_chat(user, SPAN_NOTICE("You partially empty \the [used_item] into \the [src]'s hopper."))
else
- to_chat(user, SPAN_NOTICE("You empty \the [bag] into \the [src]'s hopper."))
+ to_chat(user, SPAN_NOTICE("You empty \the [used_item] into \the [src]'s hopper."))
return TRUE
return ..()
diff --git a/code/game/objects/structures/quicksand.dm b/code/game/objects/structures/quicksand.dm
index fbbd3393c87e..b3e1cffa4809 100644
--- a/code/game/objects/structures/quicksand.dm
+++ b/code/game/objects/structures/quicksand.dm
@@ -79,8 +79,8 @@
exposed = 1
update_icon()
-/obj/effect/quicksand/attackby(obj/item/W, mob/user)
- if(!exposed && W.expend_attack_force(user))
+/obj/effect/quicksand/attackby(obj/item/used_item, mob/user)
+ if(!exposed && used_item.expend_attack_force(user))
expose()
return TRUE
else
diff --git a/code/game/objects/structures/racks.dm b/code/game/objects/structures/racks.dm
index 2cbeb5bb7f58..cda6216899a8 100644
--- a/code/game/objects/structures/racks.dm
+++ b/code/game/objects/structures/racks.dm
@@ -35,10 +35,10 @@
return DEXTERITY_HOLD_ITEM
return ..()
-/obj/structure/rack/attackby(obj/item/O, mob/user, click_params)
+/obj/structure/rack/attackby(obj/item/used_item, mob/user, click_params)
. = ..()
- if(!. && !isrobot(user) && O.loc == user && user.try_unequip(O, loc))
- auto_align(O, click_params)
+ if(!. && !isrobot(user) && used_item.loc == user && user.try_unequip(used_item, loc))
+ auto_align(used_item, click_params)
return TRUE
/obj/structure/rack/holorack/dismantle_structure(mob/user)
diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm
index ae06bb484e42..b04f59f9a150 100644
--- a/code/game/objects/structures/railing.dm
+++ b/code/game/objects/structures/railing.dm
@@ -88,8 +88,8 @@ WOOD_RAILING_SUBTYPE(yew)
broken = TRUE
for(var/thing in RANGE_TURFS(src, 1))
var/turf/T = thing
- for(var/obj/structure/railing/R in T.contents)
- R.update_icon()
+ for(var/obj/structure/railing/rail in T.contents)
+ rail.update_icon()
. = ..()
/obj/structure/railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
@@ -105,41 +105,41 @@ WOOD_RAILING_SUBTYPE(yew)
var/Rturn = turn(dir, -90)
var/Lturn = turn(dir, 90)
- for(var/obj/structure/railing/R in loc)
- if ((R.dir == Lturn) && R.anchored)
+ for(var/obj/structure/railing/rail in loc)
+ if ((rail.dir == Lturn) && rail.anchored)
neighbor_status |= 32
if (propagate)
- R.update_connections()
- R.update_icon()
- if ((R.dir == Rturn) && R.anchored)
+ rail.update_connections()
+ rail.update_icon()
+ if ((rail.dir == Rturn) && rail.anchored)
neighbor_status |= 2
if (propagate)
- R.update_connections()
- R.update_icon()
- for (var/obj/structure/railing/R in get_step(src, Lturn))
- if ((R.dir == dir) && R.anchored)
+ rail.update_connections()
+ rail.update_icon()
+ for (var/obj/structure/railing/rail in get_step(src, Lturn))
+ if ((rail.dir == dir) && rail.anchored)
neighbor_status |= 16
if (propagate)
- R.update_connections()
- R.update_icon()
- for (var/obj/structure/railing/R in get_step(src, Rturn))
- if ((R.dir == dir) && R.anchored)
+ rail.update_connections()
+ rail.update_icon()
+ for (var/obj/structure/railing/rail in get_step(src, Rturn))
+ if ((rail.dir == dir) && rail.anchored)
neighbor_status |= 1
if (propagate)
- R.update_connections()
- R.update_icon()
- for (var/obj/structure/railing/R in get_step(src, (Lturn + dir)))
- if ((R.dir == Rturn) && R.anchored)
+ rail.update_connections()
+ rail.update_icon()
+ for (var/obj/structure/railing/rail in get_step(src, (Lturn + dir)))
+ if ((rail.dir == Rturn) && rail.anchored)
neighbor_status |= 64
if (propagate)
- R.update_connections()
- R.update_icon()
- for (var/obj/structure/railing/R in get_step(src, (Rturn + dir)))
- if ((R.dir == Lturn) && R.anchored)
+ rail.update_connections()
+ rail.update_icon()
+ for (var/obj/structure/railing/rail in get_step(src, (Rturn + dir)))
+ if ((rail.dir == Lturn) && rail.anchored)
neighbor_status |= 4
if (propagate)
- R.update_connections()
- R.update_icon()
+ rail.update_connections()
+ rail.update_icon()
/obj/structure/railing/on_update_icon()
..()
@@ -247,9 +247,9 @@ WOOD_RAILING_SUBTYPE(yew)
return TRUE
// TODO: rewrite to use handle_default_wrench_attackby, bash, etc
-/obj/structure/railing/attackby(var/obj/item/W, var/mob/user)
+/obj/structure/railing/attackby(var/obj/item/used_item, var/mob/user)
// Dismantle
- if(IS_WRENCH(W))
+ if(IS_WRENCH(used_item))
if(!anchored)
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 2 SECONDS, src))
@@ -272,8 +272,8 @@ WOOD_RAILING_SUBTYPE(yew)
update_icon()
return TRUE
// Repair
- if(IS_WELDER(W))
- var/obj/item/weldingtool/F = W
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/F = used_item
if(F.isOn())
var/current_max_health = get_max_health()
if(current_health >= current_max_health)
@@ -288,7 +288,7 @@ WOOD_RAILING_SUBTYPE(yew)
return TRUE
// Install
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
if(!density)
to_chat(user, "You need to wrench \the [src] from back into place first.")
return TRUE
@@ -301,11 +301,11 @@ WOOD_RAILING_SUBTYPE(yew)
update_icon()
return TRUE
- var/force = W.expend_attack_force(user)
- if(force && (W.atom_damage_type == BURN || W.atom_damage_type == BRUTE))
+ var/force = used_item.expend_attack_force(user)
+ if(force && (used_item.atom_damage_type == BURN || used_item.atom_damage_type == BRUTE))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
- visible_message("\The [src] has been [LAZYLEN(W.attack_verb) ? pick(W.attack_verb) : "attacked"] with \the [W] by \the [user]!")
- take_damage(force, W.atom_damage_type)
+ visible_message("\The [src] has been [used_item.pick_attack_verb()] with \the [used_item] by \the [user]!")
+ take_damage(force, used_item.atom_damage_type)
return TRUE
. = ..()
diff --git a/code/game/objects/structures/rubble.dm b/code/game/objects/structures/rubble.dm
index 69a418337921..221b9ebd9ea0 100644
--- a/code/game/objects/structures/rubble.dm
+++ b/code/game/objects/structures/rubble.dm
@@ -26,21 +26,21 @@
/obj/structure/rubble/on_update_icon()
..()
for(var/i = 1 to 7)
- var/image/I = image(icon,"rubble[rand(1,76)]")
+ var/image/overlay_image = image(icon,"rubble[rand(1,76)]")
if(prob(10))
var/atom/A = pick(loot)
if(initial(A.icon) && initial(A.icon_state))
- I.icon = initial(A.icon)
- I.icon_state = initial(A.icon_state)
- I.color = initial(A.color)
+ overlay_image.icon = initial(A.icon)
+ overlay_image.icon_state = initial(A.icon_state)
+ overlay_image.color = initial(A.color)
if(!lootleft)
- I.color = "#54362e"
- I.pixel_x = rand(-16,16)
- I.pixel_y = rand(-16,16)
+ overlay_image.color = "#54362e"
+ overlay_image.pixel_x = rand(-16,16)
+ overlay_image.pixel_y = rand(-16,16)
var/matrix/M = matrix()
M.Turn(rand(0,360))
- I.transform = M
- add_overlay(I)
+ overlay_image.transform = M
+ add_overlay(overlay_image)
if(lootleft)
add_overlay("twinkle[rand(1,3)]")
@@ -65,8 +65,8 @@
to_chat(user, SPAN_WARNING("Someone is already rummaging here!"))
return TRUE
-/obj/structure/rubble/attackby(var/obj/item/I, var/mob/user)
- if(I.do_tool_interaction(TOOL_PICK, user, I, 3 SECONDS, set_cooldown = TRUE))
+/obj/structure/rubble/attackby(var/obj/item/used_item, var/mob/user)
+ if(used_item.do_tool_interaction(TOOL_PICK, user, used_item, 3 SECONDS, set_cooldown = TRUE))
if(lootleft && prob(1))
var/obj/item/booty = pickweight(loot)
booty = new booty(loc)
diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm
index 5257b0607a9f..bd2bfd5e8d37 100644
--- a/code/game/objects/structures/safe.dm
+++ b/code/game/objects/structures/safe.dm
@@ -23,12 +23,12 @@ FLOOR SAFES
// TODO: make this use a storage datum?
/obj/structure/safe/Initialize()
- for(var/obj/item/I in loc)
+ for(var/obj/item/thing in loc)
if(space >= maxspace)
break
- if(I.w_class + space <= maxspace) //todo replace with internal storage or something
- space += I.w_class
- I.forceMove(src)
+ if(thing.w_class + space <= maxspace) //todo replace with internal storage or something
+ space += thing.w_class
+ thing.forceMove(src)
. = ..()
tumbler_1_pos = rand(0, 72)
tumbler_1_open = rand(0, 72)
@@ -134,21 +134,21 @@ FLOOR SAFES
return TOPIC_REFRESH
-/obj/structure/safe/attackby(obj/item/I, mob/user)
+/obj/structure/safe/attackby(obj/item/used_item, mob/user)
if(open)
- if(I.w_class + space <= maxspace)
- if(!user.try_unequip(I, src))
+ if(used_item.w_class + space <= maxspace)
+ if(!user.try_unequip(used_item, src))
return TRUE
- space += I.w_class
- to_chat(user, "You put [I] in [src].")
+ space += used_item.w_class
+ to_chat(user, "You put [used_item] in [src].")
updateUsrDialog()
return TRUE
else
- to_chat(user, "[I] won't fit in [src].")
+ to_chat(user, "[used_item] won't fit in [src].")
return TRUE
else
- if(istype(I, /obj/item/clothing/neck/stethoscope))
- to_chat(user, "Hold [I] in one of your hands while you manipulate the dial.")
+ if(istype(used_item, /obj/item/clothing/neck/stethoscope))
+ to_chat(user, "Hold [used_item] in one of your hands while you manipulate the dial.")
return TRUE
return FALSE
diff --git a/code/game/objects/structures/seaweed.dm b/code/game/objects/structures/seaweed.dm
index bfa52f88a189..45762a60d942 100644
--- a/code/game/objects/structures/seaweed.dm
+++ b/code/game/objects/structures/seaweed.dm
@@ -30,8 +30,8 @@
icon_state = "lichen"
icon = 'icons/obj/structures/plants.dmi'
-/obj/effect/decal/cleanable/lichen/attackby(obj/item/I, mob/user)
- if(I.is_sharp() && I.expend_attack_force(user) > 1)
+/obj/effect/decal/cleanable/lichen/attackby(obj/item/used_item, mob/user)
+ if(used_item.is_sharp() && used_item.expend_attack_force(user) > 1)
qdel(src)
return TRUE
. = ..()
\ No newline at end of file
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index d5fcfd514556..0b1245e25d7c 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -23,9 +23,9 @@
try_install(target, user)
return TRUE
-/obj/item/sign/attackby(obj/item/W, mob/user)
- if(IS_SCREWDRIVER(W) && W.CanUseTopic(user, global.inventory_topic_state) && isturf(user.loc))
- return try_install(W, user)
+/obj/item/sign/attackby(obj/item/used_item, mob/user)
+ if(IS_SCREWDRIVER(used_item) && used_item.CanUseTopic(user, global.inventory_topic_state) && isturf(user.loc))
+ return try_install(used_item, user)
return ..()
/obj/item/sign/on_update_icon()
@@ -87,7 +87,7 @@
///A wall mountable sign structure
/obj/structure/sign
name = "sign"
- icon = 'icons/obj/decals.dmi'
+ icon = 'icons/obj/signs/warnings.dmi'
anchored = TRUE
opacity = FALSE
density = FALSE
diff --git a/code/game/objects/structures/signs/diploma.dm b/code/game/objects/structures/signs/diploma.dm
index a6bbf52d992b..f3e929982b6d 100644
--- a/code/game/objects/structures/signs/diploma.dm
+++ b/code/game/objects/structures/signs/diploma.dm
@@ -125,9 +125,9 @@
if(distance <= 2)
. += details.get_examine_string()
-/obj/item/sign/diploma/attackby(obj/item/pen/W, mob/user)
- if(IS_PEN(W))
- sign_diploma(W, user)
+/obj/item/sign/diploma/attackby(obj/item/used_item, mob/user)
+ if(IS_PEN(used_item))
+ sign_diploma(used_item, user)
return TRUE
return ..()
diff --git a/code/game/objects/structures/skele_stand.dm b/code/game/objects/structures/skele_stand.dm
index 95ce5fb549c2..4b3d9d944d18 100644
--- a/code/game/objects/structures/skele_stand.dm
+++ b/code/game/objects/structures/skele_stand.dm
@@ -56,25 +56,25 @@
swagnames += C.get_examine_line()
. += "[gender == MALE ? "He" : "She"] is wearing [english_list(swagnames)]."
-/obj/structure/skele_stand/attackby(obj/item/W, mob/user)
- if(IS_PEN(W))
+/obj/structure/skele_stand/attackby(obj/item/used_item, mob/user)
+ if(IS_PEN(used_item))
var/nuname = sanitize(input(user,"What do you want to name this skeleton as?","Skeleton Christening",name) as text|null)
if(nuname && CanPhysicallyInteract(user))
SetName(nuname)
return TRUE
- if(istype(W,/obj/item/clothing))
- var/obj/item/clothing/clothes = W
+ if(istype(used_item,/obj/item/clothing))
+ var/obj/item/clothing/clothes = used_item
if(!clothes.fallback_slot)
return FALSE
if(swag[clothes.fallback_slot])
to_chat(user,SPAN_NOTICE("There is already that kind of clothing on \the [src]."))
- else if(user.try_unequip(W, src))
- swag[clothes.fallback_slot] = W
+ else if(user.try_unequip(used_item, src))
+ swag[clothes.fallback_slot] = used_item
update_icon()
return TRUE
. = ..()
if(!.)
- rattle_bones(user, W)
+ rattle_bones(user, used_item)
return TRUE
/obj/structure/skele_stand/Destroy()
diff --git a/code/game/objects/structures/stasis_cage.dm b/code/game/objects/structures/stasis_cage.dm
index 2ac55e2afe1d..5474cb223cf5 100644
--- a/code/game/objects/structures/stasis_cage.dm
+++ b/code/game/objects/structures/stasis_cage.dm
@@ -15,9 +15,9 @@
if(A)
contain(A)
-/obj/structure/stasis_cage/attackby(obj/item/O, mob/user)
- if(contained && istype(O, /obj/item/scanner/xenobio))
- return contained.attackby(O, user)
+/obj/structure/stasis_cage/attackby(obj/item/used_item, mob/user)
+ if(contained && istype(used_item, /obj/item/scanner/xenobio))
+ return contained.attackby(used_item, user)
. = ..()
/obj/structure/stasis_cage/attack_hand(var/mob/user)
diff --git a/code/game/objects/structures/tables.dm b/code/game/objects/structures/tables.dm
index 98a4918cb530..ab9fbf3e716e 100644
--- a/code/game/objects/structures/tables.dm
+++ b/code/game/objects/structures/tables.dm
@@ -179,9 +179,9 @@
update_materials()
return TRUE
-/obj/structure/table/attackby(obj/item/W, mob/user, click_params)
+/obj/structure/table/attackby(obj/item/used_item, mob/user, click_params)
- if(user.check_intent(I_FLAG_HARM) && W.is_special_cutting_tool())
+ if(user.check_intent(I_FLAG_HARM) && used_item.is_special_cutting_tool())
spark_at(src.loc, amount=5)
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
user.visible_message(SPAN_DANGER("\The [src] was sliced apart by \the [user]!"))
@@ -189,14 +189,14 @@
return TRUE
if(!reinf_material)
- if(istype(W, /obj/item/stack/material/rods))
- return reinforce_table(W, user)
- if(istype(W, /obj/item/stack/material))
- return finish_table(W, user)
+ if(istype(used_item, /obj/item/stack/material/rods))
+ return reinforce_table(used_item, user)
+ if(istype(used_item, /obj/item/stack/material))
+ return finish_table(used_item, user)
return ..()
- if(!felted && istype(W, /obj/item/stack/tile/carpet))
- var/obj/item/stack/tile/carpet/C = W
+ if(!felted && istype(used_item, /obj/item/stack/tile/carpet))
+ var/obj/item/stack/tile/carpet/C = used_item
if(C.use(1))
user.visible_message(
SPAN_NOTICE("\The [user] adds \the [C] to \the [src]."),
@@ -208,15 +208,15 @@
return TRUE
//playing cards
- if(istype(W, /obj/item/hand))
- var/obj/item/hand/H = W
+ if(istype(used_item, /obj/item/hand))
+ var/obj/item/hand/H = used_item
if(H.cards && length(H.cards) == 1)
user.visible_message("\The [user] plays \the [H.cards[1]].")
return TRUE
- if(istype(W, /obj/item/deck)) //playing cards
+ if(istype(used_item, /obj/item/deck)) //playing cards
if(user.check_intent(I_FLAG_GRAB))
- var/obj/item/deck/D = W
+ var/obj/item/deck/D = used_item
if(!length(D.cards))
to_chat(user, "There are no cards in the deck.")
else
@@ -226,8 +226,8 @@
. = ..()
// Finally we can put the object onto the table.
- if(!. && can_place_items && !isrobot(user) && W.loc == user && user.try_unequip(W, src.loc))
- auto_align(W, click_params)
+ if(!. && can_place_items && !isrobot(user) && used_item.loc == user && user.try_unequip(used_item, src.loc))
+ auto_align(used_item, click_params)
return TRUE
/obj/structure/table/proc/reinforce_table(obj/item/stack/material/S, mob/user)
@@ -342,11 +342,10 @@
var/flip_mod = ""
if(left_neighbor_blend && right_neighbor_blend)
flip_type = 2
- icon_state = "flip[flip_type]"
else if(left_neighbor_blend || right_neighbor_blend)
flip_type = 1
flip_mod = (left_neighbor_blend ? "+" : "-")
- icon_state = "flip[flip_type][flip_mod]"
+ icon_state = "flip[flip_type][flip_mod]"
var/image/I
if(reinf_material)
@@ -393,26 +392,26 @@
return
var/list/blocked_dirs = list()
- for(var/obj/structure/window/W in get_turf(src))
- if(W.is_fulltile())
+ for(var/obj/structure/window/used_item in get_turf(src))
+ if(used_item.is_fulltile())
connections = list("0", "0", "0", "0")
return
- blocked_dirs |= W.dir
+ blocked_dirs |= used_item.dir
for(var/D in list(NORTH, SOUTH, EAST, WEST) - blocked_dirs)
var/turf/T = get_step(src, D)
- for(var/obj/structure/window/W in T)
- if(W.is_fulltile() || W.dir == global.reverse_dir[D])
+ for(var/obj/structure/window/used_item in T)
+ if(used_item.is_fulltile() || used_item.dir == global.reverse_dir[D])
blocked_dirs |= D
break
else
- if(W.dir != D) // it's off to the side
- blocked_dirs |= W.dir|D // blocks the diagonal
+ if(used_item.dir != D) // it's off to the side
+ blocked_dirs |= used_item.dir|D // blocks the diagonal
for(var/D in list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) - blocked_dirs)
var/turf/T = get_step(src, D)
- for(var/obj/structure/window/W in T)
- if(W.is_fulltile() || (W.dir & global.reverse_dir[D]))
+ for(var/obj/structure/window/used_item in T)
+ if(used_item.is_fulltile() || (used_item.dir & global.reverse_dir[D]))
blocked_dirs |= D
break
@@ -904,6 +903,7 @@
reinf_material = /decl/material/solid/organic/wood/walnut
storage = /datum/storage/structure/desk
bound_width = 64
+ appearance_flags = /obj/structure/table::appearance_flags & ~TILE_BOUND
material_alteration = MAT_FLAG_ALTERATION_ALL
can_flip = FALSE
top_surface_noun = "desktop"
@@ -979,6 +979,7 @@
icon = 'icons/obj/structures/dresser.dmi'
icon_state = "dresser"
bound_width = 32
+ appearance_flags = /obj/structure/table::appearance_flags
top_surface_noun = "surface"
tabletop_height = 15
mob_offset = 18
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index 9f3fe1060a3c..25154a8f0036 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -78,14 +78,14 @@
popup.open()
return TRUE
-/obj/structure/tank_rack/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/tank))
+/obj/structure/tank_rack/attackby(obj/item/used_item, mob/user)
+ if(istype(used_item, /obj/item/tank))
var/list/adding_to_list
- if(istype(I, /obj/item/tank/oxygen) || istype(I, /obj/item/tank/air))
+ if(istype(used_item, /obj/item/tank/oxygen) || istype(used_item, /obj/item/tank/air))
LAZYINITLIST(oxygen_tanks)
adding_to_list = oxygen_tanks
- else if(istype(I, /obj/item/tank/hydrogen))
+ else if(istype(used_item, /obj/item/tank/hydrogen))
LAZYINITLIST(hydrogen_tanks)
adding_to_list = hydrogen_tanks
else
@@ -96,11 +96,11 @@
UNSETEMPTY(adding_to_list)
return TRUE
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- LAZYADD(adding_to_list, weakref(I))
- to_chat(user, SPAN_NOTICE("You put [I] in [src]."))
+ LAZYADD(adding_to_list, weakref(used_item))
+ to_chat(user, SPAN_NOTICE("You put [used_item] in [src]."))
update_icon()
attack_hand_with_interaction_checks(user)
return TRUE
diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm
index 38feb74fd25d..b1e25a0f4dce 100644
--- a/code/game/objects/structures/target_stake.dm
+++ b/code/game/objects/structures/target_stake.dm
@@ -11,15 +11,22 @@
structure_flags = STRUCTURE_FLAG_THROWN_DAMAGE
var/obj/item/training_dummy/dummy
+/obj/structure/target_stake/proc/set_dummy(obj/item/training_dummy/new_dummy)
+ dummy = new_dummy
+ if(dummy)
+ dummy.reset_offsets()
+ queue_icon_update()
+ queue_vis_contents_update()
+
/obj/structure/target_stake/Destroy()
- dummy = null
+ set_dummy(null)
. = ..()
/obj/structure/target_stake/take_damage(damage, damage_type, damage_flags, inflicter, armor_pen, silent, do_update_health)
if(dummy)
. = dummy.take_damage(damage, damage_type, damage_flags, inflicter, armor_pen, silent, do_update_health)
if(QDELETED(dummy))
- dummy = null
+ set_dummy(null)
update_icon()
return
return ..()
@@ -31,44 +38,32 @@
if(dummy)
dummy.dropInto(loc)
user.put_in_hands(dummy)
- dummy = null
- update_icon()
+ set_dummy(null)
return TRUE
return ..()
/obj/structure/target_stake/attackby(obj/item/used_item, mob/user)
if(dummy?.repair_target_dummy(used_item, user))
return TRUE
+ if(user.check_intent(I_FLAG_HARM) && dummy?.attackby(used_item, user))
+ return TRUE
if(istype(used_item, /obj/item/training_dummy) && can_hold_dummy(user, used_item))
if(dummy)
to_chat(user, SPAN_WARNING("\The [src] is already holding \the [dummy]."))
else if(user.try_unequip(used_item, src))
- dummy = used_item
+ set_dummy(used_item)
visible_message(SPAN_NOTICE("\The [user] places \the [dummy] onto \the [src]."))
- update_icon()
return TRUE
return ..()
/obj/structure/target_stake/Initialize(ml, _mat, _reinf_mat)
if(ispath(dummy))
- dummy = new dummy(src)
+ set_dummy(new dummy(src))
. = ..()
- update_icon()
-/obj/structure/target_stake/on_update_icon()
+/obj/structure/target_stake/get_vis_contents_to_add()
. = ..()
- if(dummy)
- // WTB way to stop vis_contents inheriting atom color
- var/image/dummy_overlay = new /image
- dummy_overlay.appearance = dummy
- dummy_overlay.pixel_x = 0
- dummy_overlay.pixel_y = 0
- dummy_overlay.pixel_z = 0
- dummy_overlay.pixel_w = 0
- dummy_overlay.plane = FLOAT_PLANE
- dummy_overlay.layer = FLOAT_LAYER
- dummy_overlay.appearance_flags |= RESET_COLOR
- add_overlay(dummy_overlay)
+ LAZYADD(., dummy)
// Subtypes below.
/obj/structure/target_stake/steel
diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm
index 0c9982cc9a63..8c98af230f7a 100644
--- a/code/game/objects/structures/transit_tubes.dm
+++ b/code/game/objects/structures/transit_tubes.dm
@@ -59,7 +59,8 @@
/obj/structure/transit_tube_pod/Initialize()
. = ..()
- air_contents.adjust_multi(/decl/material/gas/oxygen, MOLES_O2STANDARD * 2, /decl/material/gas/nitrogen, MOLES_N2STANDARD)
+ air_contents.adjust_gas(/decl/material/gas/oxygen, MOLES_O2STANDARD * 2, FALSE)
+ air_contents.adjust_gas(/decl/material/gas/nitrogen, MOLES_N2STANDARD, TRUE)
air_contents.temperature = T20C
// Give auto tubes time to align before trying to start moving
diff --git a/code/game/objects/structures/travois.dm b/code/game/objects/structures/travois.dm
index bcf23f16081b..324972fbba5f 100644
--- a/code/game/objects/structures/travois.dm
+++ b/code/game/objects/structures/travois.dm
@@ -20,3 +20,8 @@
parts_type = /obj/item/stack/material/log
material_alteration = MAT_FLAG_ALTERATION_ALL
material = /decl/material/solid/organic/wood/oak
+ color = /decl/material/solid/organic/wood/oak::color
+
+/obj/structure/travois/walnut
+ material = /decl/material/solid/organic/wood/walnut
+ color = /decl/material/solid/organic/wood/walnut::color
\ No newline at end of file
diff --git a/code/game/objects/structures/under_wardrobe.dm b/code/game/objects/structures/under_wardrobe.dm
index 815a1405394a..a440ae1b8806 100644
--- a/code/game/objects/structures/under_wardrobe.dm
+++ b/code/game/objects/structures/under_wardrobe.dm
@@ -8,9 +8,9 @@
density = TRUE
var/static/list/amount_of_underwear_by_id_card
-/obj/structure/undies_wardrobe/attackby(var/obj/item/item, var/mob/user)
- if(istype(item, /obj/item/underwear))
- var/obj/item/underwear/underwear = item
+/obj/structure/undies_wardrobe/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/underwear))
+ var/obj/item/underwear/underwear = used_item
if(!user.try_unequip(underwear))
return TRUE
qdel(underwear)
diff --git a/code/game/objects/structures/wall_cabinet.dm b/code/game/objects/structures/wall_cabinet.dm
new file mode 100644
index 000000000000..3cc7b07bcc55
--- /dev/null
+++ b/code/game/objects/structures/wall_cabinet.dm
@@ -0,0 +1,35 @@
+// A wall-mounted storage object.
+/obj/structure/wall_cabinet
+ name = "cabinet"
+ desc = "A wall-mounted cabinet used to store various goods and sundries, and also make use of all that wasted wall-space."
+ icon = 'icons/obj/structures/furniture/cabinet_duo.dmi'
+ icon_state = ICON_STATE_WORLD
+ anchored = TRUE
+ obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
+ layer = ABOVE_HUMAN_LAYER
+ material_alteration = MAT_FLAG_ALTERATION_ALL
+ directional_offset = @'{"NORTH":{"y":-1},"SOUTH":{"y":24}}'
+ storage = /datum/storage/wall_cabinet
+
+/obj/structure/wall_cabinet/on_update_icon()
+ . = ..()
+ if(storage?.opened)
+ // todo: door material? glass cabinet doors could be interesting if we add a 'full' sprite
+ var/image/open_overlay = overlay_image(icon, "[icon_state]_open", get_color(), RESET_COLOR|KEEP_APART)
+ open_overlay.layer = ABOVE_HUMAN_LAYER + 0.005
+ add_overlay(open_overlay)
+
+/datum/storage/wall_cabinet
+ max_storage_space = BASE_STORAGE_CAPACITY(ITEM_SIZE_GARGANTUAN) // smaller than structure fwiw
+ open_sound = 'sound/foley/drawer-open.ogg'
+ close_sound = 'sound/foley/drawer-close.ogg'
+
+/obj/structure/wall_cabinet/walnut
+ color = /decl/material/solid/organic/wood/walnut::color
+ material = /decl/material/solid/organic/wood/walnut
+ reinf_material = /decl/material/solid/organic/wood/walnut
+
+/obj/structure/wall_cabinet/ebony
+ color = /decl/material/solid/organic/wood/ebony::color
+ material = /decl/material/solid/organic/wood/ebony
+ reinf_material = /decl/material/solid/organic/wood/ebony
\ No newline at end of file
diff --git a/code/game/objects/structures/wall_frame.dm b/code/game/objects/structures/wall_frame.dm
index b4d8c7a46054..21bf8027cd36 100644
--- a/code/game/objects/structures/wall_frame.dm
+++ b/code/game/objects/structures/wall_frame.dm
@@ -57,33 +57,33 @@
else
return SPAN_DANGER("It's nearly falling to pieces.")
-/obj/structure/wall_frame/attackby(var/obj/item/W, var/mob/user)
+/obj/structure/wall_frame/attackby(var/obj/item/used_item, var/mob/user)
. = ..()
if(!.)
//grille placing
- if(istype(W, /obj/item/stack/material/rods))
+ if(istype(used_item, /obj/item/stack/material/rods))
for(var/obj/structure/window/WINDOW in loc)
if(WINDOW.dir == get_dir(src, user))
to_chat(user, SPAN_WARNING("There is a window in the way."))
return TRUE
- place_grille(user, loc, W)
+ place_grille(user, loc, used_item)
return TRUE
//window placing
- if(istype(W,/obj/item/stack/material))
- var/obj/item/stack/material/ST = W
+ if(istype(used_item,/obj/item/stack/material))
+ var/obj/item/stack/material/ST = used_item
if(ST.material.opacity <= 0.7)
place_window(user, loc, SOUTHWEST, ST)
return TRUE
- if(istype(W, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/cutter = W
+ if(istype(used_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/cutter = used_item
if(!cutter.slice(user))
return
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
- visible_message(SPAN_NOTICE("\The [user] begins slicing through \the [src] with \the [W]."))
+ visible_message(SPAN_NOTICE("\The [user] begins slicing through \the [src] with \the [used_item]."))
if(do_after(user, 20,src))
- visible_message(SPAN_NOTICE("\The [user] slices \the [src] apart with \the [W]."))
+ visible_message(SPAN_NOTICE("\The [user] slices \the [src] apart with \the [used_item]."))
dismantle_structure(user)
return TRUE
diff --git a/code/game/objects/structures/wall_sconce.dm b/code/game/objects/structures/wall_sconce.dm
index c1211712b3c8..c87951094585 100644
--- a/code/game/objects/structures/wall_sconce.dm
+++ b/code/game/objects/structures/wall_sconce.dm
@@ -86,22 +86,22 @@
return ..()
-/obj/structure/wall_sconce/attackby(obj/item/W, mob/user)
+/obj/structure/wall_sconce/attackby(obj/item/used_item, mob/user)
if(user.check_intent(I_FLAG_HARM))
return ..()
- if(IS_HAMMER(W) || IS_WRENCH(W))
+ if(IS_HAMMER(used_item) || IS_WRENCH(used_item))
dismantle_structure(user)
return TRUE
- if(W.isflamesource() && light_source && !light_source.lit)
- light_source.attackby(W, user)
+ if(used_item.isflamesource() && light_source && !light_source.lit)
+ light_source.attackby(used_item, user)
update_icon()
return TRUE
- if(istype(W, /obj/item/flame))
- var/obj/item/flame/flame = W
+ if(istype(used_item, /obj/item/flame))
+ var/obj/item/flame/flame = used_item
if(flame.sconce_can_hold)
if(light_source)
@@ -115,8 +115,8 @@
return TRUE
// Refilling
- if(light_source && istype(W, /obj/item/chems))
- var/obj/item/chems/chem_source = W
+ if(light_source && istype(used_item, /obj/item/chems))
+ var/obj/item/chems/chem_source = used_item
if(chem_source.standard_pour_into(user, light_source))
return TRUE
diff --git a/code/game/objects/structures/wallframe_spawner.dm b/code/game/objects/structures/wallframe_spawner.dm
index 2573ad0514fb..524b017cc5f5 100644
--- a/code/game/objects/structures/wallframe_spawner.dm
+++ b/code/game/objects/structures/wallframe_spawner.dm
@@ -4,6 +4,7 @@
icon_state = "wingrille"
density = TRUE
anchored = TRUE
+ atmos_canpass = CANPASS_NEVER
var/win_path = /obj/structure/window/basic/full
var/frame_path = /obj/structure/wall_frame/standard
var/grille_path = /obj/structure/grille
@@ -53,10 +54,10 @@
if(!other)
var/found_connection
if(locate(/obj/structure/grille) in T)
- for(var/obj/structure/window/W in T)
- if(W.type == win_path && W.dir == get_dir(T,src))
+ for(var/obj/structure/window/window in T)
+ if(window.type == win_path && window.dir == get_dir(T,src))
found_connection = 1
- qdel(W)
+ qdel(window)
if(!found_connection)
var/obj/structure/window/new_win = new win_path(loc)
new_win.set_dir(dir)
@@ -84,7 +85,7 @@
D.update_connections()
D.update_icon()
-/obj/effect/wallframe_spawn/proc/handle_window_spawn(var/obj/structure/window/W)
+/obj/effect/wallframe_spawn/proc/handle_window_spawn(var/obj/structure/window/window)
return
/obj/effect/wallframe_spawn/proc/handle_grille_spawn(var/obj/structure/grille/G)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 93cf5851a2da..1778979d9b52 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -29,9 +29,9 @@ var/global/list/hygiene_props = list()
clogged = 0
tool_interaction_flags = initial(tool_interaction_flags)
-/obj/structure/hygiene/attackby(var/obj/item/thing, var/mob/user)
- if(clogged > 0 && isplunger(thing))
- user.visible_message(SPAN_NOTICE("\The [user] strives valiantly to unclog \the [src] with \the [thing]!"))
+/obj/structure/hygiene/attackby(var/obj/item/used_item, var/mob/user)
+ if(clogged > 0 && isplunger(used_item))
+ user.visible_message(SPAN_NOTICE("\The [user] strives valiantly to unclog \the [src] with \the [used_item]!"))
spawn
playsound(loc, 'sound/effects/plunger.ogg', 75, 1)
sleep(5)
@@ -50,9 +50,9 @@ var/global/list/hygiene_props = list()
unclog()
return TRUE
//toilet paper interaction for clogging toilets and other facilities
- if (istype(thing, /obj/item/stack/tape_roll/barricade_tape/toilet))
+ if (istype(used_item, /obj/item/stack/tape_roll/barricade_tape/toilet))
if (clogged == -1)
- to_chat(user, SPAN_WARNING("Try as you might, you can not clog \the [src] with \the [thing]."))
+ to_chat(user, SPAN_WARNING("Try as you might, you can not clog \the [src] with \the [used_item]."))
return TRUE
if (clogged)
to_chat(user, SPAN_WARNING("\The [src] is already clogged."))
@@ -60,11 +60,11 @@ var/global/list/hygiene_props = list()
if (!do_after(user, 3 SECONDS, src))
to_chat(user, SPAN_WARNING("You must stay still to clog \the [src]."))
return TRUE
- if (clogged || QDELETED(thing) || !user.try_unequip(thing))
+ if (clogged || QDELETED(used_item) || !user.try_unequip(used_item))
return TRUE
- to_chat(user, SPAN_NOTICE("You unceremoniously jam \the [src] with \the [thing]. What a rebel."))
+ to_chat(user, SPAN_NOTICE("You unceremoniously jam \the [src] with \the [used_item]. What a rebel."))
clog(1)
- qdel(thing)
+ qdel(used_item)
return TRUE
. = ..()
@@ -141,17 +141,18 @@ var/global/list/hygiene_props = list()
swirlie.take_damage(8)
return TRUE
+ // TODO: storage datum
if(cistern && !open)
if(!contents.len)
to_chat(user, SPAN_NOTICE("The cistern is empty."))
else
- var/obj/item/I = pick(contents)
+ var/obj/item/thing = pick(contents)
if(ishuman(user))
- user.put_in_hands(I)
+ user.put_in_hands(thing)
else
- I.dropInto(loc)
- to_chat(user, SPAN_NOTICE("You find \a [I] in the cistern."))
- w_items -= I.w_class
+ thing.dropInto(loc)
+ to_chat(user, SPAN_NOTICE("You find \a [thing] in the cistern."))
+ w_items -= thing.w_class
return TRUE
if(user.check_dexterity(DEXTERITY_SIMPLE_MACHINES, TRUE))
@@ -188,8 +189,8 @@ var/global/list/hygiene_props = list()
return TRUE
return ..()
-/obj/structure/hygiene/toilet/attackby(obj/item/I, var/mob/user)
- if(IS_CROWBAR(I))
+/obj/structure/hygiene/toilet/attackby(obj/item/used_item, var/mob/user)
+ if(IS_CROWBAR(used_item))
to_chat(user, SPAN_NOTICE("You start to [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]."))
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1)
if(do_after(user, 30, src))
@@ -202,16 +203,16 @@ var/global/list/hygiene_props = list()
return TRUE
if(cistern && !isrobot(user)) //STOP PUTTING YOUR MODULES IN THE TOILET.
- if(I.w_class > ITEM_SIZE_NORMAL)
- to_chat(user, SPAN_WARNING("\The [I] does not fit."))
+ if(used_item.w_class > ITEM_SIZE_NORMAL)
+ to_chat(user, SPAN_WARNING("\The [used_item] does not fit."))
return TRUE
- if(w_items + I.w_class > ITEM_SIZE_HUGE)
+ if(w_items + used_item.w_class > ITEM_SIZE_HUGE)
to_chat(user, SPAN_WARNING("The cistern is full."))
return TRUE
- if(!user.try_unequip(I, src))
+ if(!user.try_unequip(used_item, src))
return TRUE
- w_items += I.w_class
- to_chat(user, SPAN_NOTICE("You carefully place \the [I] into the cistern."))
+ w_items += used_item.w_class
+ to_chat(user, SPAN_NOTICE("You carefully place \the [used_item] into the cistern."))
return TRUE
. = ..()
@@ -300,21 +301,21 @@ var/global/list/hygiene_props = list()
if(. != INITIALIZE_HINT_QDEL)
addtimer(CALLBACK(src, TYPE_PROC_REF(/datum, qdel_self)), 25 SECONDS)
-/obj/structure/hygiene/shower/attackby(obj/item/I, var/mob/user)
- if(istype(I, /obj/item/scanner/gas))
+/obj/structure/hygiene/shower/attackby(obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/scanner/gas))
to_chat(user, SPAN_NOTICE("The water temperature seems to be [watertemp]."))
return TRUE
- if(IS_WRENCH(I))
+ if(IS_WRENCH(used_item))
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
- if(newtemp != watertemp && !QDELETED(I) && !QDELETED(user) && !QDELETED(src) && user.Adjacent(src) && I.loc == src)
- to_chat(user, SPAN_NOTICE("You begin to adjust the temperature valve with \the [I]."))
+ if(newtemp != watertemp && !QDELETED(used_item) && !QDELETED(user) && !QDELETED(src) && user.Adjacent(src) && used_item.loc == src)
+ to_chat(user, SPAN_NOTICE("You begin to adjust the temperature valve with \the [used_item]."))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, (5 SECONDS), src) && newtemp != watertemp)
watertemp = newtemp
user.visible_message(
- SPAN_NOTICE("\The [user] adjusts \the [src] with \the [I]."),
- SPAN_NOTICE("You adjust the shower with \the [I]."))
+ SPAN_NOTICE("\The [user] adjusts \the [src] with \the [used_item]."),
+ SPAN_NOTICE("You adjust the shower with \the [used_item]."))
add_fingerprint(user)
return TRUE
. = ..()
@@ -405,15 +406,15 @@ var/global/list/hygiene_props = list()
SPAN_NOTICE("You wash your hands using \the [src]."))
return TRUE
-/obj/structure/hygiene/sink/attackby(obj/item/hit_with, var/mob/user)
- if(isplunger(hit_with) && clogged > 0)
+/obj/structure/hygiene/sink/attackby(obj/item/used_item, var/mob/user)
+ if(isplunger(used_item) && clogged > 0)
return ..()
if(busy)
to_chat(user, SPAN_WARNING("Someone's already washing here."))
return TRUE
- var/obj/item/chems/chem_container = hit_with
+ var/obj/item/chems/chem_container = used_item
if (istype(chem_container) && ATOM_IS_OPEN_CONTAINER(chem_container) && chem_container.reagents)
user.visible_message(
SPAN_NOTICE("\The [user] fills \the [chem_container] using \the [src]."),
@@ -422,8 +423,8 @@ var/global/list/hygiene_props = list()
chem_container.add_to_reagents(/decl/material/liquid/water, min(REAGENTS_FREE_SPACE(chem_container.reagents), chem_container.amount_per_transfer_from_this))
return TRUE
- else if (istype(hit_with, /obj/item/baton))
- var/obj/item/baton/baton = hit_with
+ else if (istype(used_item, /obj/item/baton))
+ var/obj/item/baton/baton = used_item
var/obj/item/cell/cell = baton.get_cell()
if(cell?.check_charge(0) && baton.status)
if(isliving(user))
@@ -434,25 +435,25 @@ var/global/list/hygiene_props = list()
// robot users used to be handled separately, but deductcharge handles that for us
baton.deductcharge(baton.hitcost)
var/decl/pronouns/user_pronouns = user.get_pronouns()
- user.visible_message(SPAN_DANGER("\The [user] was stunned by [user_pronouns.his] wet [hit_with]!"))
+ user.visible_message(SPAN_DANGER("\The [user] was stunned by [user_pronouns.his] wet [used_item]!"))
return TRUE
- else if(istype(hit_with, /obj/item/mop))
- if(REAGENTS_FREE_SPACE(hit_with.reagents) >= 5)
- hit_with.add_to_reagents(/decl/material/liquid/water, 5)
- to_chat(user, SPAN_NOTICE("You wet \the [hit_with] in \the [src]."))
+ else if(istype(used_item, /obj/item/mop))
+ if(REAGENTS_FREE_SPACE(used_item.reagents) >= 5)
+ used_item.add_to_reagents(/decl/material/liquid/water, 5)
+ to_chat(user, SPAN_NOTICE("You wet \the [used_item] in \the [src]."))
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
- to_chat(user, SPAN_WARNING("\The [hit_with] is saturated."))
+ to_chat(user, SPAN_WARNING("\The [used_item] is saturated."))
return TRUE
var/turf/location = user.loc
if(!isturf(location))
return FALSE
- if(!istype(hit_with))
+ if(!istype(used_item))
return FALSE
- to_chat(usr, SPAN_NOTICE("You start washing \the [hit_with]."))
+ to_chat(usr, SPAN_NOTICE("You start washing \the [used_item]."))
playsound(loc, 'sound/effects/sink_long.ogg', 75, 1)
busy = TRUE
@@ -461,13 +462,13 @@ var/global/list/hygiene_props = list()
return TRUE
busy = FALSE
- if(istype(hit_with, /obj/item/chems/spray/extinguisher))
+ if(istype(used_item, /obj/item/chems/spray/extinguisher))
return TRUE // We're washing, not filling.
- hit_with.clean()
+ used_item.clean()
user.visible_message( \
- SPAN_NOTICE("\The [user] washes \a [hit_with] using \the [src]."),
- SPAN_NOTICE("You wash \a [hit_with] using \the [src]."))
+ SPAN_NOTICE("\The [user] washes \a [used_item] using \the [src]."),
+ SPAN_NOTICE("You wash \a [used_item] using \the [src]."))
return TRUE
@@ -486,10 +487,10 @@ var/global/list/hygiene_props = list()
flick("puddle-splash", src)
return ..()
-/obj/structure/hygiene/sink/puddle/attackby(obj/item/O, var/mob/user)
- icon_state = "puddle-splash"
+/obj/structure/hygiene/sink/puddle/attackby(obj/item/used_item, var/mob/user)
. = ..()
- icon_state = "puddle"
+ if(.)
+ flick("puddle-splash", src)
////////////////////////////////////////////////////
// Toilet Paper Roll
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 56324d48a196..8fbd7f7f983e 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -115,11 +115,11 @@
return TRUE
return FALSE
-/obj/structure/windoor_assembly/attackby(obj/item/W, mob/user)
+/obj/structure/windoor_assembly/attackby(obj/item/used_item, mob/user)
. = ..()
if(!. && anchored)
- if(!secure && istype(W, /obj/item/stack/material/rods))
- var/obj/item/stack/material/rods/R = W
+ if(!secure && istype(used_item, /obj/item/stack/material/rods))
+ var/obj/item/stack/material/rods/R = used_item
if(R.get_amount() < 4)
to_chat(user, SPAN_WARNING("You need more rods to do this."))
return TRUE
@@ -128,14 +128,14 @@
visible_message(SPAN_NOTICE("\The [user] finishes reinforcing \the [src]."))
secure = TRUE
. = TRUE
- else if(wired && !electronics && istype(W, /obj/item/stock_parts/circuitboard/airlock_electronics/windoor))
+ else if(wired && !electronics && istype(used_item, /obj/item/stock_parts/circuitboard/airlock_electronics/windoor))
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
- visible_message(SPAN_NOTICE("\The [user] starts installing \the [W] into \the [src]."))
- if(do_after(user, 4 SECONDS, src) && wired && !electronics && anchored && !QDELETED(src) && user.try_unequip(W, src))
- visible_message(SPAN_NOTICE("\The [user] finishes installing \the [W] into \the [src]."))
- electronics = W
+ visible_message(SPAN_NOTICE("\The [user] starts installing \the [used_item] into \the [src]."))
+ if(do_after(user, 4 SECONDS, src) && wired && !electronics && anchored && !QDELETED(src) && user.try_unequip(used_item, src))
+ visible_message(SPAN_NOTICE("\The [user] finishes installing \the [used_item] into \the [src]."))
+ electronics = used_item
else
- W.dropInto(loc)
+ used_item.dropInto(loc)
. = TRUE
update_icon()
update_name()
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index dcc075f7e4f6..f128e44b16f6 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -7,10 +7,12 @@
color = GLASS_COLOR
layer = SIDE_WINDOW_LAYER
- anchored = TRUE
+ anchored = FALSE // Base, non-premapped type should start unanchored.
atom_flags = ATOM_FLAG_CHECKS_BORDER | ATOM_FLAG_CAN_BE_PAINTED
obj_flags = OBJ_FLAG_ROTATABLE | OBJ_FLAG_MOVES_UNSUPPORTED
- alpha = 180
+ base_alpha = 100 // at 0.3 opacity for glass, this will result in a total alpha of around 176
+ alpha = 180 // preview value
+ material_alteration = MAT_FLAG_ALTERATION_COLOR
material = /decl/material/solid/glass
rad_resistance_modifier = 0.5
atmos_canpass = CANPASS_PROC
@@ -22,7 +24,7 @@
var/const/CONSTRUCTION_STATE_NO_FRAME = 0
var/const/CONSTRUCTION_STATE_IN_FRAME = 1
var/const/CONSTRUCTION_STATE_FASTENED = 2
- var/construction_state = CONSTRUCTION_STATE_FASTENED
+ var/construction_state = CONSTRUCTION_STATE_NO_FRAME
var/id
var/polarized = 0
var/basestate = "window"
@@ -38,10 +40,19 @@
connections = dirs_to_corner_states(dirs)
other_connections = dirs_to_corner_states(other_dirs)
-/obj/structure/window/update_materials(var/keep_health)
- . = ..()
- name = "[reinf_material ? "reinforced " : ""][material.solid_name] window"
- desc = "A window pane made from [material.solid_name]."
+/obj/structure/window/update_material_name(override_name)
+ var/base_name = override_name || initial(name)
+ if(istype(material))
+ SetName("[reinf_material ? "reinforced " : ""][material.adjective_name] [base_name]")
+ else
+ SetName(base_name)
+
+/obj/structure/window/update_material_desc(var/override_desc)
+ if(istype(material))
+ var/reinf_string = istype(reinf_material) ? " reinforced with [reinf_material.use_name]" : null
+ desc = "A window pane made from [material.solid_name][reinf_string]."
+ else
+ ..()
/obj/structure/window/Initialize(var/ml, var/_mat, var/_reinf_mat, var/dir_to_set, var/anchored)
. = ..(ml, _mat, _reinf_mat)
@@ -50,6 +61,8 @@
if(. != INITIALIZE_HINT_QDEL)
if(!isnull(anchored))
set_anchored(anchored)
+ if(!anchored)
+ construction_state = CONSTRUCTION_STATE_NO_FRAME
if(!isnull(dir_to_set))
set_dir(dir_to_set)
if(is_fulltile())
@@ -252,9 +265,9 @@
to_chat(user, SPAN_NOTICE("You cut the wiring and remove the polarization from \the [src]."))
return TRUE
-/obj/structure/window/attackby(obj/item/W, mob/user)
+/obj/structure/window/attackby(obj/item/used_item, mob/user)
// bespoke interactions not handled by the prior procs
- if(IS_MULTITOOL(W))
+ if(IS_MULTITOOL(used_item))
if (!polarized)
to_chat(user, SPAN_WARNING("\The [src] is not polarized."))
return TRUE
@@ -264,13 +277,13 @@
toggle()
else
var/response = input(user, "New Window ID:", name, id) as null | text
- if (isnull(response) || user.incapacitated() || !user.Adjacent(src) || user.get_active_held_item() != W)
+ if (isnull(response) || user.incapacitated() || !user.Adjacent(src) || user.get_active_held_item() != used_item)
return TRUE
id = sanitize_safe(response, MAX_NAME_LEN)
to_chat(user, SPAN_NOTICE("The new ID of \the [src] is [id]."))
return TRUE
- else if(istype(W, /obj/item/gun/energy/plasmacutter) && anchored)
- var/obj/item/gun/energy/plasmacutter/cutter = W
+ else if(istype(used_item, /obj/item/gun/energy/plasmacutter) && anchored)
+ var/obj/item/gun/energy/plasmacutter/cutter = used_item
if(!cutter.slice(user))
return TRUE // failed to finish or otherwise failed, prevent further interactions
playsound(src, 'sound/items/Welder.ogg', 80, 1)
@@ -279,7 +292,7 @@
visible_message(SPAN_WARNING("[user] has sliced through the window's frame!"))
playsound(src, 'sound/items/Welder.ogg', 80, 1)
set_anchored(FALSE)
- if (istype(W, /obj/item/paint_sprayer))
+ if (istype(used_item, /obj/item/paint_sprayer))
return FALSE // allow afterattack to run
return ..() // handle generic interactions, bashing, etc
@@ -414,8 +427,8 @@
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
/obj/structure/window/proc/update_nearby_icons()
update_icon()
- for(var/obj/structure/window/W in orange(src, 1))
- W.update_icon()
+ for(var/obj/structure/window/window in orange(src, 1))
+ window.update_icon()
// Visually connect with every type of window as long as it's full-tile.
/obj/structure/window/can_visually_connect()
@@ -472,6 +485,7 @@
..()
/obj/structure/window/basic
+ anchored = TRUE // Premapped type, start anchored.
icon_state = "window"
color = GLASS_COLOR
@@ -486,6 +500,7 @@
name = "borosilicate window"
color = GLASS_COLOR_SILICATE
material = /decl/material/solid/glass/borosilicate
+ anchored = TRUE // Premapped type, start anchored.
/obj/structure/window/borosilicate/full
dir = NORTHEAST
@@ -497,6 +512,8 @@
color = GLASS_COLOR_SILICATE
material = /decl/material/solid/glass/borosilicate
reinf_material = /decl/material/solid/metal/steel
+ anchored = TRUE // Premapped type, start anchored and fastened.
+ construction_state = CONSTRUCTION_STATE_FASTENED
/obj/structure/window/borosilicate_reinforced/full
dir = NORTHEAST
@@ -507,6 +524,8 @@
icon_state = "rwindow"
material = /decl/material/solid/glass
reinf_material = /decl/material/solid/metal/steel
+ anchored = TRUE // Premapped type, start anchored and fastened.
+ construction_state = CONSTRUCTION_STATE_FASTENED
/obj/structure/window/reinforced/full
dir = NORTHEAST
@@ -528,6 +547,7 @@
basestate = "w"
reinf_basestate = "w"
dir = NORTHEAST
+ anchored = TRUE // Premapped type, start anchored.
/obj/structure/window/reinforced/polarized
name = "electrochromic window"
@@ -564,8 +584,8 @@
construct_state = /decl/machine_construction/wall_frame/panel_closed/simple
base_type = /obj/machinery/button/windowtint
-/obj/machinery/button/windowtint/attackby(obj/item/W, mob/user)
- if(IS_MULTITOOL(W))
+/obj/machinery/button/windowtint/attackby(obj/item/used_item, mob/user)
+ if(IS_MULTITOOL(used_item))
var/t = sanitize_safe(input(user, "Enter the ID for the button.", name, id_tag), MAX_NAME_LEN)
if(!CanPhysicallyInteract(user))
return TRUE
@@ -579,9 +599,9 @@
/obj/machinery/button/windowtint/activate()
if(operating)
return
- for(var/obj/structure/window/W in range(src,range))
- if(W.polarized && (W.id == id_tag || !W.id))
- W.toggle()
+ for(var/obj/structure/window/window in range(src,range))
+ if(window.polarized && (window.id == id_tag || !window.id))
+ window.toggle()
..()
/obj/machinery/button/windowtint/power_change()
@@ -619,27 +639,26 @@
if (!ST.can_use(required_amount))
to_chat(user, SPAN_NOTICE("You do not have enough sheets."))
return
- for(var/obj/structure/window/WINDOW in loc)
- if(WINDOW.dir == dir_to_set)
+ for(var/obj/structure/window/existing_window in loc)
+ if(existing_window.dir == dir_to_set)
to_chat(user, SPAN_NOTICE("There is already a window facing this way there."))
return
- if(WINDOW.is_fulltile() && (dir_to_set & (dir_to_set - 1))) //two fulltile windows
+ if(existing_window.is_fulltile() && (dir_to_set & (dir_to_set - 1))) //two fulltile windows
to_chat(user, SPAN_NOTICE("There is already a window there."))
return
to_chat(user, SPAN_NOTICE("You start placing the window."))
- if(do_after(user,20))
- for(var/obj/structure/window/WINDOW in loc)
- if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
+ if(do_after(user, 2 SECONDS))
+ for(var/obj/structure/window/existing_window in loc)
+ if(existing_window.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
to_chat(user, SPAN_NOTICE("There is already a window facing this way there."))
return
- if(WINDOW.is_fulltile() && (dir_to_set & (dir_to_set - 1)))
+ if(existing_window.is_fulltile() && (dir_to_set & (dir_to_set - 1)))
to_chat(user, SPAN_NOTICE("There is already a window there."))
return
if (ST.use(required_amount))
var/obj/structure/window/WD = new(loc, ST.material.type, ST.reinf_material?.type, dir_to_set, FALSE)
to_chat(user, SPAN_NOTICE("You place [WD]."))
- WD.set_anchored(FALSE) // handles setting construction state for us
else
to_chat(user, SPAN_NOTICE("You do not have enough sheets."))
return
diff --git a/code/game/objects/structures/window_spawner.dm b/code/game/objects/structures/window_spawner.dm
index 95f24c0fd089..2b3e90164e1a 100644
--- a/code/game/objects/structures/window_spawner.dm
+++ b/code/game/objects/structures/window_spawner.dm
@@ -9,6 +9,7 @@
icon_state = "wingrille"
density = TRUE
anchored = TRUE
+ atmos_canpass = CANPASS_NEVER
var/win_path = /obj/structure/window/basic
var/activated = FALSE
var/fulltile = FALSE
@@ -50,10 +51,10 @@
if(!other)
var/found_connection
if(locate(/obj/structure/grille) in T)
- for(var/obj/structure/window/W in T)
- if(W.type == win_path && W.dir == get_dir(T,src))
+ for(var/obj/structure/window/window in T)
+ if(window.type == win_path && window.dir == get_dir(T,src))
found_connection = 1
- qdel(W)
+ qdel(window)
if(!found_connection)
var/obj/structure/window/new_win = new win_path(loc)
new_win.set_dir(dir)
@@ -71,7 +72,7 @@
for(var/obj/effect/wingrille_spawn/other in neighbours)
if(!other.activated) other.activate()
-/obj/effect/wingrille_spawn/proc/handle_window_spawn(var/obj/structure/window/W)
+/obj/effect/wingrille_spawn/proc/handle_window_spawn(var/obj/structure/window/window)
return
// Currently unused, could be useful for pre-wired electrified windows.
diff --git a/code/game/turfs/flooring/_flooring.dm b/code/game/turfs/flooring/_flooring.dm
index 14e490f0aed6..a4e97fe7d360 100644
--- a/code/game/turfs/flooring/_flooring.dm
+++ b/code/game/turfs/flooring/_flooring.dm
@@ -194,12 +194,6 @@ var/global/list/flooring_cache = list()
if(target.icon_state != target.floor_icon_state_override)
target.icon_state = target.floor_icon_state_override
- if(color)
- target.color = color
- else if(!can_paint || isnull(target.paint_color))
- var/decl/material/use_material = target.get_material()
- target.color = use_material?.color
-
if (icon_edge_layer != FLOOR_EDGE_NONE && (has_internal_edges || has_external_edges))
var/edge_layer = target.layer + icon_edge_layer
var/list/edge_overlays = list()
diff --git a/code/game/turfs/flooring/_flooring_decals.dm b/code/game/turfs/flooring/_flooring_decals.dm
index 57b678005ee5..50ca2d36ab71 100644
--- a/code/game/turfs/flooring/_flooring_decals.dm
+++ b/code/game/turfs/flooring/_flooring_decals.dm
@@ -1525,3 +1525,113 @@ var/global/list/floor_decals = list()
/obj/effect/floor_decal/arrows
name = "floor arrows"
icon_state = "arrows"
+
+//Old tile, taken from Polaris
+//TODO: Change these colors to use color defines?
+/obj/effect/floor_decal/corner_oldtile
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+
+/obj/effect/floor_decal/corner_oldtile/white
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#d9d9d9"
+
+/obj/effect/floor_decal/corner_oldtile/white/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/white/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
+
+/obj/effect/floor_decal/corner_oldtile/blue
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#8ba7ad"
+
+/obj/effect/floor_decal/corner_oldtile/blue/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/blue/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
+
+/obj/effect/floor_decal/corner_oldtile/yellow
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#8c6d46"
+
+/obj/effect/floor_decal/corner_oldtile/yellow/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/yellow/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
+
+/obj/effect/floor_decal/corner_oldtile/gray
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#687172"
+
+/obj/effect/floor_decal/corner_oldtile/gray/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/gray/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
+
+/obj/effect/floor_decal/corner_oldtile/beige
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#385e60"
+
+/obj/effect/floor_decal/corner_oldtile/beige/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/beige/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
+
+/obj/effect/floor_decal/corner_oldtile/red
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#964e51"
+
+/obj/effect/floor_decal/corner_oldtile/red/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/red/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
+
+/obj/effect/floor_decal/corner_oldtile/purple
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#906987"
+
+/obj/effect/floor_decal/corner_oldtile/purple/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/purple/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
+
+/obj/effect/floor_decal/corner_oldtile/green
+ name = "corner oldtile"
+ icon_state = "corner_oldtile"
+ color = "#46725c"
+
+/obj/effect/floor_decal/corner_oldtile/green/diagonal
+ name = "corner oldtile diagonal"
+ icon_state = "corner_oldtile_diagonal"
+
+/obj/effect/floor_decal/corner_oldtile/green/full
+ name = "corner oldtile full"
+ icon_state = "corner_oldtile_full"
\ No newline at end of file
diff --git a/code/game/turfs/flooring/flooring_grass.dm b/code/game/turfs/flooring/flooring_grass.dm
index e557193db38d..bc340140b5d5 100644
--- a/code/game/turfs/flooring/flooring_grass.dm
+++ b/code/game/turfs/flooring/flooring_grass.dm
@@ -6,7 +6,7 @@
has_base_range = 3
footstep_type = /decl/footsteps/grass
icon_edge_layer = FLOOR_EDGE_GRASS
- color = "#5e7a3b"
+ color = null // color from material
turf_flags = TURF_FLAG_BACKGROUND | TURF_IS_HOLOMAP_PATH | TURF_FLAG_ABSORB_LIQUID
can_engrave = FALSE
damage_temperature = T0C+80
@@ -50,5 +50,6 @@
desc = "Do they smoke grass out in space, Bowie? Or do they smoke AstroTurf?"
icon = 'icons/turf/flooring/fakegrass.dmi'
has_base_range = 3
+ color = "#5e7a3b"
build_type = /obj/item/stack/tile/grass
force_material = /decl/material/solid/organic/plastic
diff --git a/code/game/turfs/flooring/flooring_mud.dm b/code/game/turfs/flooring/flooring_mud.dm
index d6d77b4e9e31..6265343f2e7f 100644
--- a/code/game/turfs/flooring/flooring_mud.dm
+++ b/code/game/turfs/flooring/flooring_mud.dm
@@ -28,7 +28,7 @@
walker.add_walking_contaminant(force_material.type, rand(2,3))
/decl/flooring/mud/can_show_coating_footprints(turf/target, decl/material/contaminant)
- if(force_material.type == contaminant) // So we don't end up covered in a million footsteps that we provided.
+ if(force_material == contaminant) // So we don't end up covered in a million footsteps that we provided.
return FALSE
return ..()
diff --git a/code/game/turfs/flooring/flooring_path.dm b/code/game/turfs/flooring/flooring_path.dm
index 475573d57730..cd821d713a86 100644
--- a/code/game/turfs/flooring/flooring_path.dm
+++ b/code/game/turfs/flooring/flooring_path.dm
@@ -27,15 +27,18 @@
icon_base = "cobble"
icon_edge_layer = FLOOR_EDGE_PATH
flooring_flags = TURF_REMOVE_CROWBAR
+ has_base_range = 1
/decl/flooring/path/running_bond
name = "stone path"
desc = "A rustic stone path, laid out in a running bond pattern."
icon_base = "runningbond"
+ has_base_range = 3
gender = NEUTER
/decl/flooring/path/herringbone
name = "stone path"
desc = "A rustic stone path, laid out in a herringbone pattern."
icon_base = "herringbone"
+ has_base_range = null
gender = NEUTER
diff --git a/code/game/turfs/flooring/flooring_snow.dm b/code/game/turfs/flooring/flooring_snow.dm
index 7ef511ab0e33..8dabb7167af5 100644
--- a/code/game/turfs/flooring/flooring_snow.dm
+++ b/code/game/turfs/flooring/flooring_snow.dm
@@ -41,7 +41,7 @@
walker.add_walking_contaminant(force_material.type, rand(1, 2))
/decl/flooring/snow/can_show_coating_footprints(turf/target, decl/material/contaminant)
- if(force_material.type == contaminant) // So we don't end up covered in a million footsteps that we provided.
+ if(force_material == contaminant) // So we don't end up covered in a million footsteps that we provided.
return FALSE
return ..()
diff --git a/code/game/turfs/flooring/flooring_wood.dm b/code/game/turfs/flooring/flooring_wood.dm
index b5fc086d42f4..d7352fb03ae2 100644
--- a/code/game/turfs/flooring/flooring_wood.dm
+++ b/code/game/turfs/flooring/flooring_wood.dm
@@ -9,7 +9,7 @@
build_type = /obj/item/stack/tile/wood
flooring_flags = TURF_IS_FRAGILE | TURF_REMOVE_SCREWDRIVER
footstep_type = /decl/footsteps/wood
- color = /decl/material/solid/organic/wood/oak::color
+ color = null
force_material = /decl/material/solid/organic/wood/oak
constructed = TRUE
gender = NEUTER
@@ -24,32 +24,26 @@
)
/decl/flooring/wood/mahogany
- color = /decl/material/solid/organic/wood/mahogany::color
build_type = /obj/item/stack/tile/wood/mahogany
force_material = /decl/material/solid/organic/wood/mahogany
/decl/flooring/wood/maple
- color = /decl/material/solid/organic/wood/maple::color
build_type = /obj/item/stack/tile/wood/maple
force_material = /decl/material/solid/organic/wood/maple
/decl/flooring/wood/ebony
- color = /decl/material/solid/organic/wood/ebony::color
build_type = /obj/item/stack/tile/wood/ebony
force_material = /decl/material/solid/organic/wood/ebony
/decl/flooring/wood/walnut
- color = /decl/material/solid/organic/wood/walnut::color
build_type = /obj/item/stack/tile/wood/walnut
force_material = /decl/material/solid/organic/wood/walnut
/decl/flooring/wood/bamboo
- color = /decl/material/solid/organic/wood/bamboo::color
build_type = /obj/item/stack/tile/wood/bamboo
force_material = /decl/material/solid/organic/wood/bamboo
/decl/flooring/wood/yew
- color = /decl/material/solid/organic/wood/yew::color
build_type = /obj/item/stack/tile/wood/yew
force_material = /decl/material/solid/organic/wood/yew
@@ -65,32 +59,26 @@
broken_states = null
/decl/flooring/wood/rough/mahogany
- color = /decl/material/solid/organic/wood/mahogany::color
build_type = /obj/item/stack/tile/wood/rough/mahogany
force_material = /decl/material/solid/organic/wood/mahogany
/decl/flooring/wood/rough/maple
- color = /decl/material/solid/organic/wood/maple::color
build_type = /obj/item/stack/tile/wood/rough/maple
force_material = /decl/material/solid/organic/wood/maple
/decl/flooring/wood/rough/ebony
- color = /decl/material/solid/organic/wood/ebony::color
build_type = /obj/item/stack/tile/wood/rough/ebony
force_material = /decl/material/solid/organic/wood/ebony
/decl/flooring/wood/rough/walnut
- color = /decl/material/solid/organic/wood/walnut::color
build_type = /obj/item/stack/tile/wood/rough/walnut
force_material = /decl/material/solid/organic/wood/walnut
/decl/flooring/wood/rough/bamboo
- color = /decl/material/solid/organic/wood/bamboo::color
build_type = /obj/item/stack/tile/wood/rough/bamboo
force_material = /decl/material/solid/organic/wood/bamboo
/decl/flooring/wood/rough/yew
- color = /decl/material/solid/organic/wood/yew::color
build_type = /obj/item/stack/tile/wood/rough/yew
force_material = /decl/material/solid/organic/wood/yew
@@ -105,7 +93,7 @@
build_type = /obj/item/stack/tile/wood/laminate/oak
flooring_flags = TURF_IS_FRAGILE | TURF_REMOVE_SCREWDRIVER
footstep_type = /decl/footsteps/wood
- color = /decl/material/solid/organic/wood/chipboard::color
+ color = null
force_material = /decl/material/solid/organic/wood/chipboard
constructed = TRUE
gender = NEUTER
@@ -120,26 +108,21 @@
)
/decl/flooring/laminate/mahogany
- color = /decl/material/solid/organic/wood/chipboard/mahogany::color
build_type = /obj/item/stack/tile/wood/laminate/mahogany
force_material = /decl/material/solid/organic/wood/chipboard/mahogany
/decl/flooring/laminate/maple
- color = /decl/material/solid/organic/wood/chipboard/maple::color
build_type = /obj/item/stack/tile/wood/laminate/maple
force_material = /decl/material/solid/organic/wood/chipboard/maple
/decl/flooring/laminate/ebony
- color = /decl/material/solid/organic/wood/chipboard/ebony::color
build_type = /obj/item/stack/tile/wood/laminate/ebony
force_material = /decl/material/solid/organic/wood/chipboard/ebony
/decl/flooring/laminate/walnut
- color = /decl/material/solid/organic/wood/chipboard/walnut::color
build_type = /obj/item/stack/tile/wood/laminate/walnut
- force_material = /decl/material/solid/organic/wood/chipboard/yew
+ force_material = /decl/material/solid/organic/wood/chipboard/walnut
/decl/flooring/laminate/yew
- color = /decl/material/solid/organic/wood/chipboard/yew::color
build_type = /obj/item/stack/tile/wood/laminate/yew
force_material = /decl/material/solid/organic/wood/chipboard/yew
diff --git a/code/game/turfs/floors/_floor.dm b/code/game/turfs/floors/_floor.dm
index 7dc51d0f1746..22123008d757 100644
--- a/code/game/turfs/floors/_floor.dm
+++ b/code/game/turfs/floors/_floor.dm
@@ -5,7 +5,6 @@
layer = PLATING_LAYER
permit_ao = TRUE
thermal_conductivity = 0.040
- heat_capacity = 10000
explosion_resistance = 1
turf_flags = TURF_IS_HOLOMAP_PATH
initial_gas = GAS_STANDARD_AIRMIX
@@ -46,16 +45,9 @@
fill_to_zero_height() // try to refill turfs that act as fluid sources
if(floor_material || get_topmost_flooring())
- update_from_flooring()
- if(!ml)
- for(var/direction in global.alldirs)
- var/turf/target_turf = get_step_resolving_mimic(src, direction)
- if(istype(target_turf))
- if(TICK_CHECK) // not CHECK_TICK -- only queue if the server is overloaded
- target_turf.queue_icon_update()
- else
- target_turf.update_icon()
- update_icon()
+ update_from_flooring(skip_update = ml)
+ if(ml) // We skipped the update above to avoid updating our neighbors, but we need to update ourselves.
+ lazy_update_icon()
/turf/floor/ChangeTurf(turf/N, tell_universe, force_lighting_update, keep_air, update_open_turfs_above, keep_height)
@@ -121,10 +113,10 @@
else
physically_destroyed()
-/turf/floor/get_footstep_sound(var/mob/caller)
+/turf/floor/get_footstep_sound(var/mob/stepper)
var/decl/flooring/use_flooring = get_topmost_flooring()
if(istype(use_flooring))
- return get_footstep_for_mob(use_flooring.footstep_type, caller)
+ return get_footstep_for_mob(use_flooring.footstep_type, stepper)
return ..()
/turf/floor/get_movable_alpha_mask_state(atom/movable/mover)
diff --git a/code/game/turfs/floors/floor_acts.dm b/code/game/turfs/floors/floor_acts.dm
index 1280fd30cfa9..b231da61241b 100644
--- a/code/game/turfs/floors/floor_acts.dm
+++ b/code/game/turfs/floors/floor_acts.dm
@@ -54,6 +54,6 @@
/turf/floor/adjacent_fire_act(turf/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume)
var/dir_to = get_dir(src, adj_turf)
- for(var/obj/structure/window/W in src)
- if(W.dir == dir_to || W.is_fulltile()) //Same direction or diagonal (full tile)
- W.fire_act(adj_air, adj_temp, adj_volume)
+ for(var/obj/structure/window/window in src)
+ if(window.dir == dir_to || window.is_fulltile()) //Same direction or diagonal (full tile)
+ window.fire_act(adj_air, adj_temp, adj_volume)
diff --git a/code/game/turfs/floors/floor_attackby.dm b/code/game/turfs/floors/floor_attackby.dm
index 8b81baf3ae7a..c509629a34d2 100644
--- a/code/game/turfs/floors/floor_attackby.dm
+++ b/code/game/turfs/floors/floor_attackby.dm
@@ -51,7 +51,12 @@
for(var/decl/flooring/F as anything in decls_repository.get_decls_of_subtype_unassociated(/decl/flooring))
if(!F.build_type)
continue
- if((ispath(S.type, F.build_type) || ispath(S.build_type, F.build_type)) && (isnull(F.build_material) || S.material?.type == F.build_material))
+ // If S.build_type is set, we expect an exact match. Otherwise, we do
+ // an ispath on S.type. This is a shitty way to disambiguate carpet
+ // types because they're in the ugly position of "same material, built
+ // with a subtype" whereas with everything else, material + type
+ // disambiguates well enough.
+ if((S.build_type ? S.build_type == F.build_type : ispath(S.type, F.build_type)) && (isnull(F.build_material) || S.material?.type == F.build_material))
use_flooring = F
break
if(!use_flooring)
diff --git a/code/game/turfs/floors/floor_icon.dm b/code/game/turfs/floors/floor_icon.dm
index 0946e0d363ed..2b799313b9b1 100644
--- a/code/game/turfs/floors/floor_icon.dm
+++ b/code/game/turfs/floors/floor_icon.dm
@@ -71,15 +71,17 @@
// Draw a cliff wall if we have a northern neighbor that isn't part of our trench.
var/turf/floor/neighbor = get_step_resolving_mimic(src, NORTH)
- if(isturf(neighbor) && neighbor.is_open())
+ // skip null and unsim edges, because we don't want trench edges along the edges of a map for no reason
+ if(!neighbor?.simulated || (isturf(neighbor) && neighbor.is_open()))
return
- if(!istype(neighbor) || (neighbor.get_physical_height() > my_height))
+ if(!istype(neighbor, /turf/floor) || (neighbor.get_physical_height() > my_height))
- var/trench_icon = (istype(neighbor) && neighbor.get_trench_icon()) || get_trench_icon()
+ var/trench_icon = (istype(neighbor, /turf/floor) && neighbor.get_trench_icon()) || get_trench_icon()
if(trench_icon)
// cache the trench image, keyed by icon and color
- var/trench_color = isatom(neighbor) ? neighbor.get_color() : get_color()
+ // formerly an isatom check but it should never be a non-atom true value
+ var/trench_color = neighbor ? neighbor.get_color() : get_color()
var/trench_icon_key = "[ref(trench_icon)][trench_color]"
I = _trench_image_cache[trench_icon_key]
if(!I)
diff --git a/code/game/turfs/floors/floor_layers.dm b/code/game/turfs/floors/floor_layers.dm
index e482d21fc5a4..5396b3607cf2 100644
--- a/code/game/turfs/floors/floor_layers.dm
+++ b/code/game/turfs/floors/floor_layers.dm
@@ -5,16 +5,13 @@
/turf/floor/proc/get_all_flooring()
. = list()
- if(istype(_flooring))
- . += _flooring
- else if(ispath(_flooring))
- . += GET_DECL(_flooring)
- else if(islist(_flooring))
- for(var/floor in _flooring)
- if(ispath(floor))
- _flooring += GET_DECL(floor)
- else if(istype(floor, /decl/flooring))
- _flooring += floor
+ if(_flooring)
+ if(islist(_flooring))
+ for(var/floor in _flooring)
+ . += RESOLVE_TO_DECL(floor)
+ _flooring = . // ensure the list elements are resolved
+ else
+ . += RESOLVE_TO_DECL(_flooring)
if(_base_flooring)
. += get_base_flooring()
@@ -22,15 +19,11 @@
return !isnull(_flooring)
/turf/floor/proc/set_base_flooring(new_base_flooring, skip_update)
- if(ispath(new_base_flooring, /decl/flooring))
- new_base_flooring = GET_DECL(new_base_flooring)
- else if(!istype(new_base_flooring, /decl/flooring))
- new_base_flooring = null
+ // We can never have a null base flooring.
+ new_base_flooring = RESOLVE_TO_DECL(new_base_flooring || initial(_base_flooring) || /decl/flooring/plating)
if(_base_flooring == new_base_flooring)
return
_base_flooring = new_base_flooring
- if(!_base_flooring) // We can never have a null base flooring.
- _base_flooring = GET_DECL(initial(_base_flooring)) || GET_DECL(/decl/flooring/plating)
update_from_flooring(skip_update)
/turf/floor/proc/get_base_flooring()
@@ -43,15 +36,14 @@
RETURN_TYPE(/decl/flooring)
if(isnull(_topmost_flooring))
- var/flooring_length = length(_flooring)
- if(flooring_length) // no need to check islist, length is only nonzero for lists and strings, and strings are invalid here
- _topmost_flooring = _flooring[flooring_length]
- else if(istype(_flooring, /decl/flooring))
- _topmost_flooring = _flooring
- else if(ispath(_flooring, /decl/flooring))
- _topmost_flooring = GET_DECL(_flooring)
- else
+ if(isnull(_flooring))
_topmost_flooring = FALSE
+ else
+ var/flooring_length = length(_flooring)
+ if(flooring_length) // no need to check islist, length is only nonzero for lists and strings, and strings are invalid here
+ _topmost_flooring = RESOLVE_TO_DECL(_flooring[flooring_length])
+ else
+ _topmost_flooring = RESOLVE_TO_DECL(_flooring)
return _topmost_flooring || get_base_flooring()
/turf/floor/proc/clear_flooring(skip_update = FALSE, place_product)
@@ -81,8 +73,7 @@
return
// Validate our input.
- if(ispath(flooring))
- flooring = GET_DECL(flooring)
+ flooring = RESOLVE_TO_DECL(flooring)
if(!istype(flooring))
return
@@ -100,8 +91,8 @@
return
LAZYCLEARLIST(decals)
- for(var/obj/effect/decal/writing/W in src)
- qdel(W)
+ for(var/obj/effect/decal/writing/writing in src)
+ qdel(writing)
flooring.on_flooring_remove(src)
@@ -145,14 +136,9 @@
if(islist(newflooring))
_flooring = list()
for(var/floor in UNLINT(newflooring))
- if(ispath(floor))
- floor = GET_DECL(floor)
- if(istype(floor, /decl/flooring))
- _flooring += floor
- else if(ispath(newflooring))
- _flooring = GET_DECL(newflooring)
- else if(istype(newflooring))
- _flooring = newflooring
+ _flooring += RESOLVE_TO_DECL(floor)
+ else if(newflooring)
+ _flooring = RESOLVE_TO_DECL(newflooring)
else
return FALSE
@@ -184,9 +170,8 @@
return
// We only want to work with references.
- if(ispath(newflooring, /decl/flooring))
- newflooring = GET_DECL(newflooring)
- else if(!istype(newflooring, /decl/flooring))
+ newflooring = RESOLVE_TO_DECL(newflooring)
+ if(!newflooring)
return FALSE
// Check if the layer is already present.
@@ -250,8 +235,8 @@
qdel(print)
if(!skip_update)
- update_icon()
+ lazy_update_icon()
for(var/dir in global.alldirs)
var/turf/neighbor = get_step_resolving_mimic(src, dir)
if(istype(neighbor))
- neighbor.update_icon()
+ neighbor.lazy_update_icon()
diff --git a/code/game/turfs/floors/subtypes/floor_path.dm b/code/game/turfs/floors/subtypes/floor_path.dm
index 65e09e4733c7..7d714f8efab9 100644
--- a/code/game/turfs/floors/subtypes/floor_path.dm
+++ b/code/game/turfs/floors/subtypes/floor_path.dm
@@ -5,7 +5,7 @@
desc = "A cobbled path made of loose stones."
color = COLOR_GRAY
icon = 'icons/turf/flooring/path.dmi'
- icon_state = "cobble"
+ icon_state = "cobble0"
_flooring = /decl/flooring/path/cobblestone
floor_material = /decl/material/solid/stone/sandstone
_base_flooring = /decl/flooring/dirt
@@ -28,7 +28,7 @@
LAZYADD(decals, moss)
/turf/floor/path/running_bond
- icon_state = "runningbond"
+ icon_state = "runningbond0"
_flooring = /decl/flooring/path/running_bond
/turf/floor/path/herringbone
diff --git a/code/game/turfs/floors/subtypes/floor_static.dm b/code/game/turfs/floors/subtypes/floor_static.dm
index e990493c61a4..0a345025524a 100644
--- a/code/game/turfs/floors/subtypes/floor_static.dm
+++ b/code/game/turfs/floors/subtypes/floor_static.dm
@@ -9,8 +9,8 @@
footstep_type = /decl/footsteps/plating
is_outside = OUTSIDE_AREA
-/turf/floor/fixed/attackby(var/obj/item/C, var/mob/user)
- if(istype(C, /obj/item/stack) && !IS_COIL(C))
+/turf/floor/fixed/attackby(var/obj/item/used_item, var/mob/user)
+ if(istype(used_item, /obj/item/stack) && !IS_COIL(used_item))
return TRUE
return ..()
@@ -29,8 +29,8 @@
icon = 'icons/turf/flooring/alium.dmi'
icon_state = "jaggy"
-/turf/floor/fixed/alium/attackby(var/obj/item/C, var/mob/user)
- if(IS_CROWBAR(C))
+/turf/floor/fixed/alium/attackby(var/obj/item/used_item, var/mob/user)
+ if(IS_CROWBAR(used_item))
to_chat(user, "There aren't any openings big enough to pry it away...")
return TRUE
return ..()
diff --git a/code/game/turfs/initialization/init.dm b/code/game/turfs/initialization/init.dm
index 4229a04db9a7..1553584fcd6e 100644
--- a/code/game/turfs/initialization/init.dm
+++ b/code/game/turfs/initialization/init.dm
@@ -7,6 +7,7 @@
/area/Initialize(mapload)
. = ..()
if(ispath(turf_initializer))
- var/decl/turf_initializer/ti = GET_DECL(turf_initializer)
- for(var/turf/T in src)
- ti.InitializeTurf(T)
+ var/decl/turf_initializer/initializer = GET_DECL(turf_initializer)
+ // TODO: It may be worth doing a post-mapload loop over turfs instead, to limit the number of in-area (in-world) loops?
+ for(var/turf/initialized_turf in src)
+ initializer.InitializeTurf(initialized_turf)
diff --git a/code/game/turfs/open/_open.dm b/code/game/turfs/open/_open.dm
index e763a49a8384..3836af3e8072 100644
--- a/code/game/turfs/open/_open.dm
+++ b/code/game/turfs/open/_open.dm
@@ -48,35 +48,35 @@
/turf/open/is_open()
return TRUE
-/turf/open/attackby(obj/item/C, mob/user)
+/turf/open/attackby(obj/item/used_item, mob/user)
- if(istype(C, /obj/item/stack/material/rods))
+ if(istype(used_item, /obj/item/stack/material/rods))
var/ladder = (locate(/obj/structure/ladder) in src)
if(ladder)
to_chat(user, SPAN_WARNING("\The [ladder] is in the way."))
return TRUE
var/obj/structure/lattice/lattice = locate(/obj/structure/lattice, src)
if(lattice)
- return lattice.attackby(C, user)
- var/obj/item/stack/material/rods/rods = C
+ return lattice.attackby(used_item, user)
+ var/obj/item/stack/material/rods/rods = used_item
if (rods.use(1))
to_chat(user, SPAN_NOTICE("You lay down the support lattice."))
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
new /obj/structure/lattice(src, rods.material.type)
return TRUE
- if (istype(C, /obj/item/stack/tile))
- var/obj/item/stack/tile/tile = C
+ if (istype(used_item, /obj/item/stack/tile))
+ var/obj/item/stack/tile/tile = used_item
tile.try_build_turf(user, src)
return TRUE
//To lay cable.
- if(IS_COIL(C) && try_build_cable(C, user))
+ if(IS_COIL(used_item) && try_build_cable(used_item, user))
return TRUE
for(var/atom/movable/M in below)
if(M.movable_flags & MOVABLE_FLAG_Z_INTERACT)
- return M.attackby(C, user)
+ return M.attackby(used_item, user)
return FALSE
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 874422eae0b8..0c4d7107c015 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -92,23 +92,23 @@
return ..()
-/turf/space/attackby(obj/item/C, mob/user)
+/turf/space/attackby(obj/item/used_item, mob/user)
- if (istype(C, /obj/item/stack/material/rods))
+ if (istype(used_item, /obj/item/stack/material/rods))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
- return L.attackby(C, user)
- var/obj/item/stack/material/rods/R = C
- if (R.use(1))
+ return L.attackby(used_item, user)
+ var/obj/item/stack/material/rods/rods = used_item
+ if (rods.use(1))
to_chat(user, "Constructing support lattice ...")
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
- new /obj/structure/lattice(src, R.material.type)
+ new /obj/structure/lattice(src, rods.material.type)
return TRUE
- if (istype(C, /obj/item/stack/tile/floor))
+ if (istype(used_item, /obj/item/stack/tile/floor))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
- var/obj/item/stack/tile/floor/S = C
+ var/obj/item/stack/tile/floor/S = used_item
if (!S.use(1))
return TRUE
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm
index 9a6aff50393d..37b63eb82cde 100644
--- a/code/game/turfs/space/transit.dm
+++ b/code/game/turfs/space/transit.dm
@@ -2,7 +2,7 @@
var/push_direction // push things that get caught in the transit tile this direction
//Overwrite because we dont want people building rods in space.
-/turf/space/transit/attackby(obj/O, mob/user)
+/turf/space/transit/attackby(obj/item/used_item, mob/user)
return TRUE
/turf/space/transit/Initialize()
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 36812e0f3f53..285f4fc05c5c 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -19,7 +19,6 @@
//Properties for airtight tiles (/wall)
var/thermal_conductivity = 0.05
- var/heat_capacity = 1
//Properties for both
/// Does this turf contain air/let air through?
@@ -242,20 +241,20 @@
grab.affecting.DoMove(get_dir(grab.affecting.loc, src), user, TRUE)
return TRUE
-/turf/attackby(obj/item/W, mob/user)
+/turf/attackby(obj/item/used_item, mob/user)
if(is_floor())
- if(istype(W, /obj/item/stack/tile))
- var/obj/item/stack/tile/T = W
+ if(istype(used_item, /obj/item/stack/tile))
+ var/obj/item/stack/tile/T = used_item
T.try_build_turf(user, src)
return TRUE
- if(IS_HOE(W) && can_dig_farm(W.material?.hardness))
- try_dig_farm(user, W)
+ if(IS_HOE(used_item) && can_dig_farm(used_item.material?.hardness))
+ try_dig_farm(user, used_item)
return TRUE
- if(IS_SHOVEL(W))
+ if(IS_SHOVEL(used_item))
// TODO: move these checks into the interaction handlers.
var/atom/platform = get_supporting_platform()
@@ -263,20 +262,20 @@
to_chat(user, SPAN_WARNING("\The [platform] [platform.get_pronouns().is] in the way!"))
return TRUE
- if(!can_be_dug(W.material?.hardness))
- to_chat(user, SPAN_WARNING("\The [src] is too hard to be dug with \the [W]."))
+ if(!can_be_dug(used_item.material?.hardness))
+ to_chat(user, SPAN_WARNING("\The [src] is too hard to be dug with \the [used_item]."))
return TRUE
- if(user.check_intent(I_FLAG_HELP) && can_dig_pit(W.material?.hardness))
- try_dig_pit(user, W)
- else if(can_dig_trench(W.material?.hardness))
- try_dig_trench(user, W)
+ if(user.check_intent(I_FLAG_HELP) && can_dig_pit(used_item.material?.hardness))
+ try_dig_pit(user, used_item)
+ else if(can_dig_trench(used_item.material?.hardness))
+ try_dig_trench(user, used_item)
else
- to_chat(user, SPAN_WARNING("You cannot dig anything out of \the [src] with \the [W]."))
+ to_chat(user, SPAN_WARNING("You cannot dig anything out of \the [src] with \the [used_item]."))
return TRUE
var/decl/material/material = get_material()
- if(IS_PICK(W) && material)
+ if(IS_PICK(used_item) && material)
// TODO: move these checks into the interaction handlers.
var/atom/platform = get_supporting_platform()
@@ -285,29 +284,29 @@
return TRUE
if(material?.hardness <= MAT_VALUE_FLEXIBLE)
- to_chat(user, SPAN_WARNING("\The [src] is too soft to be excavated with \the [W]. Use a shovel."))
+ to_chat(user, SPAN_WARNING("\The [src] is too soft to be excavated with \the [used_item]. Use a shovel."))
return TRUE
// Let picks dig out hard turfs, but not dig pits.
- if(!can_be_dug(W.material?.hardness, using_tool = TOOL_PICK))
- to_chat(user, SPAN_WARNING("\The [src] is too hard to be excavated with \the [W]."))
+ if(!can_be_dug(used_item.material?.hardness, using_tool = TOOL_PICK))
+ to_chat(user, SPAN_WARNING("\The [src] is too hard to be excavated with \the [used_item]."))
return TRUE
- if(can_dig_trench(W.material?.hardness, using_tool = TOOL_PICK))
- try_dig_trench(user, W, using_tool = TOOL_PICK)
+ if(can_dig_trench(used_item.material?.hardness, using_tool = TOOL_PICK))
+ try_dig_trench(user, used_item, using_tool = TOOL_PICK)
else
- to_chat(user, SPAN_WARNING("You cannot excavate \the [src] with \the [W]."))
+ to_chat(user, SPAN_WARNING("You cannot excavate \the [src] with \the [used_item]."))
return TRUE
- if(W?.storage?.collection_mode && W.storage.gather_all(src, user))
+ if(used_item?.storage?.collection_mode && used_item.storage.gather_all(src, user))
return TRUE
- if(istype(W, /obj/item) && storage && storage.use_to_pickup && storage.collection_mode)
+ if(istype(used_item, /obj/item) && storage && storage.use_to_pickup && storage.collection_mode)
storage.gather_all(src, user)
return TRUE
- if(IS_COIL(W) && try_build_cable(W, user))
+ if(IS_COIL(used_item) && try_build_cable(used_item, user))
return TRUE
return ..()
@@ -421,15 +420,18 @@
L.Add(t)
return L
-/turf/proc/contains_dense_objects(list/exceptions)
- if(density)
- return TRUE
+/turf/proc/get_first_dense_object(list/exceptions)
for(var/atom/A in src)
if(exceptions && (exceptions == A || (islist(exceptions) && (A in exceptions))))
continue
if(A.density && !(A.atom_flags & ATOM_FLAG_CHECKS_BORDER))
- return TRUE
- return FALSE
+ return A
+ return null
+
+/turf/proc/contains_dense_objects(list/exceptions)
+ if(density)
+ return TRUE
+ return !!get_first_dense_object(exceptions)
/turf/proc/remove_cleanables()
for(var/obj/effect/decal/cleanable/cleanable in src)
@@ -475,7 +477,7 @@
return
var/too_much_graffiti = 0
- for(var/obj/effect/decal/writing/W in src)
+ for(var/obj/effect/decal/writing/writing in src)
too_much_graffiti++
if(too_much_graffiti >= 5)
to_chat(vandal, "There's too much graffiti here to add more.")
@@ -864,7 +866,7 @@
if(IS_HOE(held) && can_dig_farm(held.material?.hardness))
LAZYADD(., /decl/interaction_handler/dig/farm)
-/// Contaminant may be the chemical type of the footprint being provided,
+/// Contaminant may be the chemical decl of the footprint being provided,
/// or null if we just want to know if we support footprints, at all, ever.
/turf/proc/can_show_coating_footprints(decl/material/contaminant)
return simulated
diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm
index a43c8994c4d4..ac2e306ea590 100644
--- a/code/game/turfs/turf_changing.dm
+++ b/code/game/turfs/turf_changing.dm
@@ -71,6 +71,8 @@
var/old_affecting_heat_sources = affecting_heat_sources
var/old_height = get_physical_height()
var/old_alpha_mask_state = get_movable_alpha_mask_state(null)
+ var/old_event_listeners = event_listeners
+ var/old_listening_to = _listening_to
var/old_ambience = ambient_light
var/old_ambience_mult = ambient_light_multiplier
@@ -95,34 +97,37 @@
qdel(src)
. = new N(src)
- var/turf/W = .
- W.above = old_above // Multiz ref tracking.
- W.prev_type = old_prev_type // Shuttle transition turf tracking.
+ var/turf/changed_turf = .
+ changed_turf.above = old_above // Multiz ref tracking.
+ changed_turf.prev_type = old_prev_type // Shuttle transition turf tracking.
+ // Set our observation bookkeeping lists back.
+ changed_turf.event_listeners = old_event_listeners
+ changed_turf._listening_to = old_listening_to
- W.affecting_heat_sources = old_affecting_heat_sources
+ changed_turf.affecting_heat_sources = old_affecting_heat_sources
if (permit_ao)
regenerate_ao()
// Update ZAS, atmos and fire.
- if(keep_air && W.can_inherit_air)
- W.air = old_air
+ if(keep_air && changed_turf.can_inherit_air)
+ changed_turf.air = old_air
if(old_fire)
- if(W.simulated)
- W.fire = old_fire
+ if(changed_turf.simulated)
+ changed_turf.fire = old_fire
else if(old_fire)
qdel(old_fire)
- if(old_flooded != W.flooded)
+ if(old_flooded != changed_turf.flooded)
set_flooded(old_flooded)
// Raise appropriate events.
- W.post_change()
+ changed_turf.post_change()
if(tell_universe)
- global.universe.OnTurfChange(W)
+ global.universe.OnTurfChange(changed_turf)
- if(W.density != old_density)
- RAISE_EVENT(/decl/observ/density_set, W, old_density, W.density)
+ if(changed_turf.density != old_density && changed_turf.event_listeners?[/decl/observ/density_set])
+ changed_turf.raise_event_non_global(/decl/observ/density_set, old_density, changed_turf.density)
// lighting stuff
@@ -153,12 +158,12 @@
// end of lighting stuff
// we check the var rather than the proc, because area outside values usually shouldn't be set on turfs
- W.last_outside_check = OUTSIDE_UNCERTAIN
- if(W.is_outside != old_outside)
+ changed_turf.last_outside_check = OUTSIDE_UNCERTAIN
+ if(changed_turf.is_outside != old_outside)
// This will check the exterior atmos participation of this turf and all turfs connected by open space below.
- W.set_outside(old_outside, skip_weather_update = TRUE)
+ changed_turf.set_outside(old_outside, skip_weather_update = TRUE)
else // We didn't already update our external atmos participation in set_outside.
- if(HasBelow(z) && (W.is_open() != old_is_open)) // Otherwise, we do it here if the open status of the turf has changed.
+ if(HasBelow(z) && (changed_turf.is_open() != old_is_open)) // Otherwise, we do it here if the open status of the turf has changed.
var/turf/checking = src
while(HasBelow(checking.z))
checking = GetBelow(checking)
@@ -168,19 +173,19 @@
if(!checking.is_open())
break
// In case the turf isn't marked for update in Initialize (e.g. space), we call this to create any unsimulated edges necessary.
- if(W.zone_membership_candidate != old_zone_membership_candidate)
+ if(changed_turf.zone_membership_candidate != old_zone_membership_candidate)
update_external_atmos_participation()
- W.update_weather(force_update_below = W.is_open() != old_is_open)
+ changed_turf.update_weather(force_update_below = changed_turf.is_open() != old_is_open)
if(keep_height)
- W.set_physical_height(old_height)
+ changed_turf.set_physical_height(old_height)
if(update_open_turfs_above)
update_open_above(old_open_turf_type)
if(old_alpha_mask_state != get_movable_alpha_mask_state(null))
- for(var/atom/movable/AM as anything in W)
+ for(var/atom/movable/AM as anything in changed_turf)
AM.update_turf_alpha_mask()
/turf/proc/transport_properties_from(turf/other, transport_air)
diff --git a/code/game/turfs/turf_fluids.dm b/code/game/turfs/turf_fluids.dm
index f0dd37d11c1a..48c6e74fc863 100644
--- a/code/game/turfs/turf_fluids.dm
+++ b/code/game/turfs/turf_fluids.dm
@@ -166,13 +166,12 @@
if(!length(reagents?.reagent_volumes) || !istype(air))
return
var/update_air = FALSE
- for(var/rtype in reagents.reagent_volumes)
- var/decl/material/mat = GET_DECL(rtype)
- if(mat.gas_flags & XGM_GAS_FUEL)
- var/moles = round(reagents.reagent_volumes[rtype] / REAGENT_UNITS_PER_GAS_MOLE)
+ for(var/decl/material/reagent as anything in reagents.reagent_volumes)
+ if(reagent.gas_flags & XGM_GAS_FUEL)
+ var/moles = round(reagents.reagent_volumes[reagent] / REAGENT_UNITS_PER_GAS_MOLE)
if(moles > 0)
- air.adjust_gas(rtype, moles, FALSE)
- remove_from_reagents(rtype, round(moles * REAGENT_UNITS_PER_GAS_MOLE))
+ air.adjust_gas(reagent.type, moles, FALSE)
+ remove_from_reagents(reagent, round(moles * REAGENT_UNITS_PER_GAS_MOLE))
update_air = TRUE
if(update_air)
air.update_values()
@@ -190,7 +189,7 @@
if(reagents?.total_volume > FLUID_QDEL_POINT)
ADD_ACTIVE_FLUID(src)
var/decl/material/primary_reagent = reagents.get_primary_reagent_decl()
- if(primary_reagent && (REAGENT_VOLUME(reagents, primary_reagent.type) >= primary_reagent.slippery_amount))
+ if(primary_reagent && (REAGENT_VOLUME(reagents, primary_reagent) >= primary_reagent.slippery_amount))
last_slipperiness = primary_reagent.slipperiness
else
last_slipperiness = 0
@@ -217,10 +216,10 @@
solids = reagents
if(LAZYLEN(solids?.solid_volumes))
var/list/matter_list = list()
- for(var/reagent_type in solids.solid_volumes)
- var/reagent_amount = solids.solid_volumes[reagent_type]
- matter_list[reagent_type] = round(reagent_amount/REAGENT_UNITS_PER_MATERIAL_UNIT)
- solids.remove_reagent(reagent_type, reagent_amount, defer_update = TRUE, removed_phases = MAT_PHASE_SOLID)
+ for(var/decl/material/reagent as anything in solids.solid_volumes)
+ var/reagent_amount = solids.solid_volumes[reagent]
+ matter_list[reagent.type] = round(reagent_amount/REAGENT_UNITS_PER_MATERIAL_UNIT)
+ solids.remove_reagent(reagent, reagent_amount, defer_update = TRUE, removed_phases = MAT_PHASE_SOLID)
var/obj/item/debris/scraps/chemical/scraps = locate() in contents
if(!istype(scraps) || scraps.get_total_matter() >= MAX_SCRAP_MATTER)
diff --git a/code/game/turfs/turf_footsteps.dm b/code/game/turfs/turf_footsteps.dm
index bfa1f9171569..e9c2ff24ca47 100644
--- a/code/game/turfs/turf_footsteps.dm
+++ b/code/game/turfs/turf_footsteps.dm
@@ -1,15 +1,15 @@
-/proc/get_footstep_for_mob(var/footstep_type, var/mob/living/caller)
- . = istype(caller) && caller.get_mob_footstep(footstep_type)
+/proc/get_footstep_for_mob(var/footstep_type, var/mob/living/stepper)
+ . = istype(stepper) && stepper.get_mob_footstep(footstep_type)
if(!.)
- var/decl/footsteps/FS = GET_DECL(footstep_type)
- . = pick(FS.footstep_sounds)
+ var/decl/footsteps/footsteps = GET_DECL(footstep_type)
+ . = pick(footsteps.footstep_sounds)
-/turf/proc/get_footstep_sound(var/mob/caller)
+/turf/proc/get_footstep_sound(var/mob/stepper)
for(var/obj/structure/S in contents)
if(S.footstep_type)
- return get_footstep_for_mob(S.footstep_type, caller)
+ return get_footstep_for_mob(S.footstep_type, stepper)
if(check_fluid_depth(10) && !is_flooded(TRUE))
- return get_footstep_for_mob(/decl/footsteps/water, caller)
+ return get_footstep_for_mob(/decl/footsteps/water, stepper)
if(footstep_type)
- return get_footstep_for_mob(footstep_type, caller)
- return get_footstep_for_mob(/decl/footsteps/blank, caller)
+ return get_footstep_for_mob(footstep_type, stepper)
+ return get_footstep_for_mob(/decl/footsteps/blank, stepper)
diff --git a/code/game/turfs/walls/_wall.dm b/code/game/turfs/walls/_wall.dm
index 3ad1fc1f62d8..ef02c8f94328 100644
--- a/code/game/turfs/walls/_wall.dm
+++ b/code/game/turfs/walls/_wall.dm
@@ -25,7 +25,6 @@ var/global/list/wall_fullblend_objects = list(
density = TRUE
blocks_air = 1
thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
- heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall
explosion_resistance = 10
color = COLOR_STEEL
turf_flags = TURF_IS_HOLOMAP_OBSTACLE
@@ -103,10 +102,10 @@ var/global/list/wall_fullblend_objects = list(
. = ..()
var/turf/debris = locate(old_x, old_y, old_z)
if(debris)
- for(var/turf/wall/W in RANGE_TURFS(debris, 1))
- W.wall_connections = null
- W.other_connections = null
- W.queue_icon_update()
+ for(var/turf/wall/wall in RANGE_TURFS(debris, 1))
+ wall.wall_connections = null
+ wall.other_connections = null
+ wall.queue_icon_update()
// Walls always hide the stuff below them.
/turf/wall/levelupdate()
@@ -301,9 +300,9 @@ var/global/list/wall_fullblend_objects = list(
/turf/wall/proc/burn(temperature)
if(!QDELETED(src) && istype(material) && material.combustion_effect(src, temperature, 0.7))
- for(var/turf/wall/W in range(3,src))
- if(W != src)
- addtimer(CALLBACK(W, TYPE_PROC_REF(/turf/wall, burn), temperature/4), 2)
+ for(var/turf/wall/wall in range(3,src))
+ if(wall != src)
+ addtimer(CALLBACK(wall, TYPE_PROC_REF(/turf/wall, burn), temperature/4), 2)
physically_destroyed()
/turf/wall/set_color(new_color)
diff --git a/code/game/turfs/walls/wall_attacks.dm b/code/game/turfs/walls/wall_attacks.dm
index 9e8eb62472e5..15cd5a1dbeec 100644
--- a/code/game/turfs/walls/wall_attacks.dm
+++ b/code/game/turfs/walls/wall_attacks.dm
@@ -111,48 +111,48 @@
if(!.)
return try_touch(user, (locate(/obj/effect/overlay/wallrot) in src))
-/turf/wall/proc/handle_wall_tool_interactions(obj/item/W, mob/user)
+/turf/wall/proc/handle_wall_tool_interactions(obj/item/used_item, mob/user)
//get the user's location
if(!isturf(user.loc))
return FALSE //can't do this stuff whilst inside objects and such
- if(!construction_stage && try_graffiti(user, W))
+ if(!construction_stage && try_graffiti(user, used_item))
return TRUE
- if(W)
+ if(used_item)
radiate()
- if(W.get_heat() >= T100C)
- burn(W.get_heat())
+ if(used_item.get_heat() >= T100C)
+ burn(used_item.get_heat())
. = TRUE
if(locate(/obj/effect/overlay/wallrot) in src)
- if(IS_WELDER(W))
- var/obj/item/weldingtool/WT = W
- if( WT.weld(0,user) )
- to_chat(user, "You burn away the fungi with \the [WT].")
+ if(IS_WELDER(used_item))
+ var/obj/item/weldingtool/welder = used_item
+ if( welder.weld(0,user) )
+ to_chat(user, "You burn away the fungi with \the [welder].")
playsound(src, 'sound/items/Welder.ogg', 10, 1)
for(var/obj/effect/overlay/wallrot/WR in src)
qdel(WR)
return TRUE
else
- var/force = W.expend_attack_force(user)
- if((!W.is_sharp() && !W.has_edge() && force >= 10) || force >= 20)
- to_chat(user, "\The [src] crumbles away under the force of your [W.name].")
+ var/force = used_item.expend_attack_force(user)
+ if((!used_item.is_sharp() && !used_item.has_edge() && force >= 10) || force >= 20)
+ to_chat(user, "\The [src] crumbles away under the force of your [used_item.name].")
physically_destroyed()
return TRUE
var/turf/T = user.loc //get user's location for delay checks
- if(damage && istype(W, /obj/item/weldingtool))
+ if(damage && istype(used_item, /obj/item/weldingtool))
- var/obj/item/weldingtool/WT = W
+ var/obj/item/weldingtool/welder = used_item
- if(WT.weld(0,user))
+ if(welder.weld(0,user))
to_chat(user, "You start repairing the damage to [src].")
playsound(src, 'sound/items/Welder.ogg', 100, 1)
- if(do_after(user, max(5, damage / 5), src) && WT && WT.isOn())
+ if(do_after(user, max(5, damage / 5), src) && welder && welder.isOn())
to_chat(user, "You finish repairing the damage to [src].")
take_damage(-damage)
return TRUE
// Basic dismantling.
if(isnull(construction_stage) || !reinf_material)
- var/datum/extension/demolisher/demolition = get_extension(W, /datum/extension/demolisher)
+ var/datum/extension/demolisher/demolition = get_extension(used_item, /datum/extension/demolisher)
if(istype(demolition) && demolition.try_demolish(user, src))
return TRUE
@@ -161,9 +161,9 @@
switch(construction_stage)
if(6)
- if(W.is_special_cutting_tool(TRUE))
+ if(used_item.is_special_cutting_tool(TRUE))
- to_chat(user, "You drive \the [W] into the wall and begin trying to rip out the support frame...")
+ to_chat(user, "You drive \the [used_item] into the wall and begin trying to rip out the support frame...")
playsound(src, 'sound/items/Welder.ogg', 100, 1)
. = TRUE
@@ -175,14 +175,14 @@
user.visible_message("The wall was torn open by [user]!")
playsound(src, 'sound/items/Welder.ogg', 100, 1)
- else if(IS_WIRECUTTER(W))
+ else if(IS_WIRECUTTER(used_item))
playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
construction_stage = 5
to_chat(user, "You cut the outer grille.")
update_icon()
return TRUE
if(5)
- if(IS_SCREWDRIVER(W))
+ if(IS_SCREWDRIVER(used_item))
to_chat(user, "You begin removing the support lines.")
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
. = TRUE
@@ -192,24 +192,24 @@
update_icon()
to_chat(user, "You remove the support lines.")
return
- else if(istype(W,/obj/item/weldingtool))
- var/obj/item/weldingtool/WT = W
- if(WT.weld(0,user))
+ else if(istype(used_item,/obj/item/weldingtool))
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.weld(0,user))
construction_stage = 6
update_icon()
to_chat(user, SPAN_NOTICE("You repair the outer grille."))
return TRUE
if(4)
var/cut_cover
- if(istype(W,/obj/item/weldingtool))
- var/obj/item/weldingtool/WT = W
- if(WT.weld(0,user))
+ if(istype(used_item,/obj/item/weldingtool))
+ var/obj/item/weldingtool/welder = used_item
+ if(welder.weld(0,user))
cut_cover=1
else
return
- else if (W.is_special_cutting_tool())
- if(istype(W, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/cutter = W
+ else if (used_item.is_special_cutting_tool())
+ if(istype(used_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/cutter = used_item
if(!cutter.slice(user))
return
cut_cover = 1
@@ -224,7 +224,7 @@
to_chat(user, "You press firmly on the cover, dislodging it.")
return
if(3)
- if(IS_CROWBAR(W))
+ if(IS_CROWBAR(used_item))
to_chat(user, "You struggle to pry off the cover.")
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
. = TRUE
@@ -235,7 +235,7 @@
to_chat(user, "You pry off the cover.")
return
if(2)
- if(IS_WRENCH(W))
+ if(IS_WRENCH(used_item))
to_chat(user, "You start loosening the anchoring bolts which secure the support rods to their frame.")
playsound(src, 'sound/items/Ratchet.ogg', 100, 1)
. = TRUE
@@ -247,15 +247,15 @@
return
if(1)
var/cut_cover
- if(istype(W, /obj/item/weldingtool))
- var/obj/item/weldingtool/WT = W
- if( WT.weld(0,user) )
+ if(istype(used_item, /obj/item/weldingtool))
+ var/obj/item/weldingtool/welder = used_item
+ if( welder.weld(0,user) )
cut_cover=1
else
return
- else if(W.is_special_cutting_tool())
- if(istype(W, /obj/item/gun/energy/plasmacutter))
- var/obj/item/gun/energy/plasmacutter/cutter = W
+ else if(used_item.is_special_cutting_tool())
+ if(istype(used_item, /obj/item/gun/energy/plasmacutter))
+ var/obj/item/gun/energy/plasmacutter/cutter = used_item
if(!cutter.slice(user))
return
cut_cover = 1
@@ -270,51 +270,51 @@
to_chat(user, "You cut the support rods loose from the frame.")
return
if(0)
- if(IS_CROWBAR(W))
+ if(IS_CROWBAR(used_item))
to_chat(user, "You struggle to pry off the outer sheath.")
playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
. = TRUE
- if(!do_after(user,100,src) || !istype(src, /turf/wall) || !user || !W || !T ) return
- if(user.loc == T && user.get_active_held_item() == W )
+ if(!do_after(user,100,src) || !istype(src, /turf/wall) || !user || !used_item || !T ) return
+ if(user.loc == T && user.get_active_held_item() == used_item )
to_chat(user, "You pry off the outer sheath.")
dismantle_turf()
return
return FALSE
-/turf/wall/attackby(var/obj/item/W, var/mob/user, click_params)
+/turf/wall/attackby(var/obj/item/used_item, var/mob/user, click_params)
- if(istype(W, /obj/item/stack/tile/roof) || !user.check_dexterity(DEXTERITY_SIMPLE_MACHINES) || !W.user_can_attack_with(user))
+ if(istype(used_item, /obj/item/stack/tile/roof) || !user.check_dexterity(DEXTERITY_SIMPLE_MACHINES) || !used_item.user_can_attack_with(user))
return ..()
- if(handle_wall_tool_interactions(W, user))
+ if(handle_wall_tool_interactions(used_item, user))
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
return TRUE
- if(istype(W,/obj/item/frame))
- var/obj/item/frame/F = W
+ if(istype(used_item,/obj/item/frame))
+ var/obj/item/frame/F = used_item
F.try_build(src, click_params)
return TRUE
// Attack the wall with items
- var/force = W.expend_attack_force(user)
- if(istype(W,/obj/item/rcd) || istype(W, /obj/item/chems) || !force || user.check_intent(I_FLAG_HELP))
+ var/force = used_item.expend_attack_force(user)
+ if(istype(used_item,/obj/item/rcd) || istype(used_item, /obj/item/chems) || !force || user.check_intent(I_FLAG_HELP))
return ..()
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(src)
var/material_divisor = max(material.brute_armor, reinf_material?.brute_armor)
- if(W.atom_damage_type == BURN)
+ if(used_item.atom_damage_type == BURN)
material_divisor = max(material.burn_armor, reinf_material?.burn_armor)
var/effective_force = round(force / material_divisor)
if(effective_force < 2)
- visible_message(SPAN_DANGER("\The [user] [pick(W.attack_verb)] \the [src] with \the [W], but it had no effect!"))
+ visible_message(SPAN_DANGER("\The [user] [used_item.pick_attack_verb()] \the [src] with \the [used_item], but it had no effect!"))
playsound(src, hitsound, 25, 1)
return TRUE
// Check for a glancing blow.
- var/dam_prob = max(0, 100 - material.hardness + effective_force + W.armor_penetration)
+ var/dam_prob = max(0, 100 - material.hardness + effective_force + used_item.armor_penetration)
if(!prob(dam_prob))
- visible_message(SPAN_DANGER("\The [user] [pick(W.attack_verb)] \the [src] with \the [W], but it bounced off!"))
+ visible_message(SPAN_DANGER("\The [user] [used_item.pick_attack_verb()] \the [src] with \the [used_item], but it bounced off!"))
playsound(src, hitsound, 25, 1)
if(user.skill_fail_prob(SKILL_HAULING, 40, SKILL_ADEPT))
SET_STATUS_MAX(user, STAT_WEAK, 2)
@@ -322,6 +322,6 @@
return TRUE
playsound(src, get_hit_sound(), 50, 1)
- visible_message(SPAN_DANGER("\The [user] [pick(W.attack_verb)] \the [src] with \the [W]!"))
+ visible_message(SPAN_DANGER("\The [user] [used_item.pick_attack_verb()] \the [src] with \the [used_item]!"))
take_damage(effective_force)
return TRUE
\ No newline at end of file
diff --git a/code/game/turfs/walls/wall_icon.dm b/code/game/turfs/walls/wall_icon.dm
index 08732bbecaf9..94ca6d9b6eca 100644
--- a/code/game/turfs/walls/wall_icon.dm
+++ b/code/game/turfs/walls/wall_icon.dm
@@ -24,17 +24,17 @@
if(update_neighbors)
var/iterate_turfs = list()
for(var/direction in global.alldirs)
- var/turf/wall/W = get_step_resolving_mimic(src, direction)
- if(istype(W))
- W.wall_connections = null
- W.other_connections = null
- iterate_turfs += W
- for(var/turf/wall/W as anything in iterate_turfs)
- W.update_icon()
+ var/turf/wall/wall = get_step_resolving_mimic(src, direction)
+ if(istype(wall))
+ wall.wall_connections = null
+ wall.other_connections = null
+ iterate_turfs += wall
+ for(var/turf/wall/wall as anything in iterate_turfs)
+ wall.lazy_update_icon()
else
wall_connections = null
other_connections = null
- update_icon()
+ lazy_update_icon()
/turf/wall/proc/paint_wall(var/new_paint_color)
paint_color = new_paint_color
@@ -219,13 +219,13 @@
integrity += reinf_material.integrity
add_overlay(SSmaterials.wall_damage_overlays[clamp(round(damage / integrity * DAMAGE_OVERLAY_COUNT) + 1, 1, DAMAGE_OVERLAY_COUNT)])
-/turf/wall/proc/can_join_with(var/turf/wall/W)
- if(unique_merge_identifier != W.unique_merge_identifier)
+/turf/wall/proc/can_join_with(var/turf/wall/wall)
+ if(unique_merge_identifier != wall.unique_merge_identifier)
return 0
else if(unique_merge_identifier)
return 1
- else if(material && istype(W.material))
- var/other_wall_icon = W.get_wall_icon()
+ else if(material && istype(wall.material))
+ var/other_wall_icon = wall.get_wall_icon()
if(get_wall_icon() == other_wall_icon)
return 1
if(material.wall_blend_icons[other_wall_icon])
diff --git a/code/game/turfs/walls/wall_natural.dm b/code/game/turfs/walls/wall_natural.dm
index ce8ea3dbbce8..095e8f7ed26e 100644
--- a/code/game/turfs/walls/wall_natural.dm
+++ b/code/game/turfs/walls/wall_natural.dm
@@ -50,42 +50,42 @@
update_neighboring_ramps(destroying_self = TRUE)
. = ..()
-/turf/wall/natural/attackby(obj/item/W, mob/user, click_params)
+/turf/wall/natural/attackby(obj/item/used_item, mob/user, click_params)
if(user.check_dexterity(DEXTERITY_COMPLEX_TOOLS) && !ramp_slope_direction)
- if(istype(W, /obj/item/depth_scanner))
- var/obj/item/depth_scanner/C = W
+ if(istype(used_item, /obj/item/depth_scanner))
+ var/obj/item/depth_scanner/C = used_item
C.scan_atom(user, src)
return TRUE
- if (istype(W, /obj/item/measuring_tape))
- var/obj/item/measuring_tape/P = W
+ if (istype(used_item, /obj/item/measuring_tape))
+ var/obj/item/measuring_tape/P = used_item
user.visible_message(SPAN_NOTICE("\The [user] extends [P] towards [src]."),SPAN_NOTICE("You extend [P] towards [src]."))
if(do_after(user,10, src))
to_chat(user, SPAN_NOTICE("\The [src] has been excavated to a depth of [excavation_level]cm."))
return TRUE
- if(istype(W, /obj/item/tool/xeno))
- return handle_xenoarch_tool_interaction(W, user)
+ if(istype(used_item, /obj/item/tool/xeno))
+ return handle_xenoarch_tool_interaction(used_item, user)
. = ..()
// Drill out natural walls.
-/turf/wall/natural/handle_wall_tool_interactions(obj/item/W, mob/user)
- if(IS_PICK(W) && !being_mined)
+/turf/wall/natural/handle_wall_tool_interactions(obj/item/used_item, mob/user)
+ if(IS_PICK(used_item) && !being_mined)
var/check_material_hardness
if(material)
check_material_hardness = material.hardness
if(reinf_material && (isnull(check_material_hardness) || check_material_hardness > reinf_material.hardness))
check_material_hardness = reinf_material.hardness
- if(isnull(check_material_hardness) || W.material?.hardness < check_material_hardness)
- to_chat(user, SPAN_WARNING("\The [W] is not hard enough to dig through \the [src]."))
+ if(isnull(check_material_hardness) || used_item.material?.hardness < check_material_hardness)
+ to_chat(user, SPAN_WARNING("\The [used_item] is not hard enough to dig through \the [src]."))
return TRUE
if(being_mined)
return TRUE
being_mined = TRUE
- if(W.do_tool_interaction(TOOL_PICK, user, src, 2 SECONDS, suffix_message = destroy_artifacts(W, INFINITY)))
+ if(used_item.do_tool_interaction(TOOL_PICK, user, src, 2 SECONDS, suffix_message = destroy_artifacts(used_item, INFINITY)))
dismantle_turf()
if(istype(src, /turf/wall/natural)) // dismantle_turf() can change our type
being_mined = FALSE
diff --git a/code/game/turfs/walls/wall_natural_icon.dm b/code/game/turfs/walls/wall_natural_icon.dm
index 1d99392c29f5..e0231caf658a 100644
--- a/code/game/turfs/walls/wall_natural_icon.dm
+++ b/code/game/turfs/walls/wall_natural_icon.dm
@@ -39,7 +39,7 @@
shine = exterior_wall_shine_cache[shine_cache_key]
if(isnull(shine))
// patented formula based on color's value (in HSV)
- shine = clamp((material.reflectiveness * 0.01) * 255, 10, (0.6 * ReadHSV(RGBtoHSV(material.color))[3]))
+ shine = clamp((material.reflectiveness * 0.01) * 255, 10, (0.6 * rgb2num(material.color, COLORSPACE_HSV)[3]))
exterior_wall_shine_cache[shine_cache_key] = shine
var/new_icon
diff --git a/code/game/turfs/walls/wall_natural_xenoarch.dm b/code/game/turfs/walls/wall_natural_xenoarch.dm
index e24be7d65b39..85a49e5282fb 100644
--- a/code/game/turfs/walls/wall_natural_xenoarch.dm
+++ b/code/game/turfs/walls/wall_natural_xenoarch.dm
@@ -112,13 +112,13 @@
if(amount_rocks > 0)
pass_geodata_to(new /obj/item/stack/material/ore(src, amount_rocks, material?.type))
-/turf/wall/natural/proc/destroy_artifacts(var/obj/item/W, var/newDepth)
+/turf/wall/natural/proc/destroy_artifacts(var/obj/item/used_item, var/newDepth)
if(!length(finds))
return
var/datum/find/F = finds[1]
if(newDepth > F.excavation_required) // Digging too deep can break the item. At least you won't summon a Balrog (probably)
- if(W)
- . = ". [pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]"
+ if(used_item)
+ . = ". [pick("There is a crunching noise","[used_item] collides with some different rock","Part of the rock face crumbles away","Something breaks under [used_item]")]"
if(prob(10))
return
if(prob(25))
diff --git a/code/game/turfs/walls/wall_wattle.dm b/code/game/turfs/walls/wall_wattle.dm
index 42a93e90fc08..4cdca1b6df0c 100644
--- a/code/game/turfs/walls/wall_wattle.dm
+++ b/code/game/turfs/walls/wall_wattle.dm
@@ -21,16 +21,16 @@
return list("", "paint") // paint should always be available because of plastering!
// Daubing with clay or soil
-/turf/wall/wattle/attackby(obj/item/W, mob/user, click_params)
+/turf/wall/wattle/attackby(obj/item/used_item, mob/user, click_params)
if(isnull(daubing_material))
var/static/list/daub_materials = list( // Does not include subtypes.
/decl/material/solid/soil = TRUE,
/decl/material/solid/clay = TRUE
)
- if(istype(W, /obj/item/stack/material) && daub_materials[W.material?.type])
+ if(istype(used_item, /obj/item/stack/material) && daub_materials[used_item.material?.type])
if(!user.check_dexterity(DEXTERITY_WIELD_ITEM))
return TRUE
- var/obj/item/stack/material/stack = W
+ var/obj/item/stack/material/stack = used_item
var/sheets_to_use = stack.matter_units_to_sheets(matter_to_daub)
if(stack.can_use(sheets_to_use) && user.do_skilled(1 SECOND, daubing_skill, target = src) && stack.can_use(sheets_to_use))
to_chat(user, SPAN_NOTICE("You daub \the [src] with \the [stack]."))
@@ -49,7 +49,7 @@
// daubed walls have the color of their daubing
/turf/wall/wattle/get_base_color()
if(daubing_material)
- return "#ae9f70" // daubing_material.color // sorry, but using the daubing material color looks bad
+ return "#795946" // daubing_material.color // sorry, but using the daubing material color looks bad
return ..()
// don't plaster over our damn reinforcements
@@ -76,8 +76,10 @@
else if(paint_color)
if(reinf_material)
SetName("[reinf_material.solid_name]-framed plastered wall")
+ desc = "A plastered wall framed with [reinf_material.solid_name]."
else
SetName("plastered wall")
+ desc = "A plastered wall."
else
if(reinf_material)
SetName("[reinf_material.solid_name]-framed [material.adjective_name] wattle and daub wall")
@@ -89,6 +91,7 @@
/turf/wall/wattle/daubed
icon_state = "wattledaub"
daubing_material = /decl/material/solid/clay
+ color = "#795946" // temporary mapping preview colour taken from get_base_color()
// the daub is lost when destroyed/deconstructed, since it's dried anyway
/turf/wall/wattle/daubed/plastered
@@ -116,7 +119,6 @@
}; \
/turf/wall/wattle/daubed/##material_name { \
material = /decl/material/solid/organic/wood/##material_name; \
- color = /decl/material/solid/organic/wood/##material_name::color; \
}; \
/turf/wall/wattle/daubed/##material_name/shutter { \
shutter_state = FALSE; \
diff --git a/code/game/world_topic_commands.dm b/code/game/world_topic_commands.dm
index cfd86601053b..ab871592c196 100644
--- a/code/game/world_topic_commands.dm
+++ b/code/game/world_topic_commands.dm
@@ -212,9 +212,9 @@
info["key"] = S.key
if(isrobot(S))
- var/mob/living/silicon/robot/R = S
- info["master"] = R.connected_ai?.name
- info["sync"] = R.lawupdate
+ var/mob/living/silicon/robot/robot = S
+ info["master"] = robot.connected_ai?.name
+ info["sync"] = robot.lawupdate
if(!S.laws)
info["laws"] = null
@@ -263,7 +263,6 @@
info["turf"] = MT ? "[MT] @ [MT.x], [MT.y], [MT.z]" : "null"
info["area"] = MT ? "[MT.loc]" : "null"
info["antag"] = M.mind ? (M.mind.get_special_role_name("Not antag")) : "No mind"
- info["hasbeenrev"] = M.mind ? M.mind.has_been_rev : "No mind"
info["stat"] = M.stat
info["type"] = M.type
if(isliving(M))
diff --git a/code/modules/ZAS/ConnectionManager.dm b/code/modules/ZAS/ConnectionManager.dm
index 3890cd85f5cd..de4e36c81129 100644
--- a/code/modules/ZAS/ConnectionManager.dm
+++ b/code/modules/ZAS/ConnectionManager.dm
@@ -36,70 +36,71 @@ Macros:
/turf/var/tmp/connection_manager/connections
-/connection_manager/var/connection/N
-/connection_manager/var/connection/S
-/connection_manager/var/connection/E
-/connection_manager/var/connection/W
+/connection_manager
+ var/connection/north_connection
+ var/connection/south_connection
+ var/connection/east_connection
+ var/connection/west_connection
#ifdef MULTIZAS
-/connection_manager/var/connection/U
-/connection_manager/var/connection/D
+ var/connection/upward_connection
+ var/connection/downward_connection
#endif
/connection_manager/proc/get(d)
switch(d)
if(NORTH)
- if(check(N)) return N
+ if(check(north_connection)) return north_connection
else return null
if(SOUTH)
- if(check(S)) return S
+ if(check(south_connection)) return south_connection
else return null
if(EAST)
- if(check(E)) return E
+ if(check(east_connection)) return east_connection
else return null
if(WEST)
- if(check(W)) return W
+ if(check(west_connection)) return west_connection
else return null
#ifdef MULTIZAS
if(UP)
- if(check(U)) return U
+ if(check(upward_connection)) return upward_connection
else return null
if(DOWN)
- if(check(D)) return D
+ if(check(downward_connection)) return downward_connection
else return null
#endif
/connection_manager/proc/place(connection/c, d)
switch(d)
- if(NORTH) N = c
- if(SOUTH) S = c
- if(EAST) E = c
- if(WEST) W = c
+ if(NORTH) north_connection = c
+ if(SOUTH) south_connection = c
+ if(EAST) east_connection = c
+ if(WEST) west_connection = c
#ifdef MULTIZAS
- if(UP) U = c
- if(DOWN) D = c
+ if(UP) upward_connection = c
+ if(DOWN) downward_connection = c
#endif
/connection_manager/proc/update_all()
- if(check(N)) N.update()
- if(check(S)) S.update()
- if(check(E)) E.update()
- if(check(W)) W.update()
+ if(check(north_connection)) north_connection.update()
+ if(check(south_connection)) south_connection.update()
+ if(check(east_connection)) east_connection.update()
+ if(check(west_connection)) west_connection.update()
#ifdef MULTIZAS
- if(check(U)) U.update()
- if(check(D)) D.update()
+ if(check(upward_connection)) upward_connection.update()
+ if(check(downward_connection)) downward_connection.update()
#endif
/connection_manager/proc/erase_all()
- if(check(N)) N.erase()
- if(check(S)) S.erase()
- if(check(E)) E.erase()
- if(check(W)) W.erase()
+ if(check(north_connection)) north_connection.erase()
+ if(check(south_connection)) south_connection.erase()
+ if(check(east_connection)) east_connection.erase()
+ if(check(west_connection)) west_connection.erase()
#ifdef MULTIZAS
- if(check(U)) U.erase()
- if(check(D)) D.erase()
+ if(check(upward_connection)) upward_connection.erase()
+ if(check(downward_connection)) downward_connection.erase()
#endif
#undef check
diff --git a/code/modules/abstract/_abstract.dm b/code/modules/abstract/_abstract.dm
index 11d081248ecb..9f944be9cb33 100644
--- a/code/modules/abstract/_abstract.dm
+++ b/code/modules/abstract/_abstract.dm
@@ -1,20 +1,22 @@
/obj/abstract
- name = ""
- icon = 'icons/effects/landmarks.dmi'
- icon_state = "x2"
- simulated = FALSE
- density = FALSE
- anchored = TRUE
- abstract_type = /obj/abstract
- invisibility = INVISIBILITY_ABSTRACT
+ name = ""
+ icon = 'icons/effects/landmarks.dmi'
+ icon_state = "x2"
+ simulated = FALSE
+ density = FALSE
+ anchored = TRUE
+ abstract_type = /obj/abstract
+ invisibility = INVISIBILITY_ABSTRACT
+ var/hide_on_init = TRUE
/obj/abstract/Initialize()
. = ..()
verbs.Cut()
- //Let mappers see the damn thing by just making them invisible here
opacity = FALSE
- alpha = 0
- mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
+ //Let mappers see the damn thing by just making them invisible here
+ if(hide_on_init)
+ alpha = 0
+ mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
/obj/abstract/explosion_act()
SHOULD_CALL_PARENT(FALSE)
diff --git a/code/modules/abstract/airlock_helper.dm b/code/modules/abstract/airlock_helper.dm
index 3e70efba8d44..0dd25032a27d 100644
--- a/code/modules/abstract/airlock_helper.dm
+++ b/code/modules/abstract/airlock_helper.dm
@@ -145,4 +145,7 @@ You still need to set the controller's "id_tag" to something unique.
/obj/abstract/airlock_helper/button
my_device = /obj/machinery/button/access
icon_state = "button"
- tag_addon = "_airlock"
+
+/obj/abstract/airlock_helper/button/configure_associated_device()
+ var/obj/machinery/button/access/my_button = my_device
+ my_button.set_id_tag(my_controller.id_tag)
\ No newline at end of file
diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/abstract/corpse_spawner.dm
similarity index 95%
rename from code/modules/awaymissions/corpse.dm
rename to code/modules/abstract/corpse_spawner.dm
index 0974e8d543e6..47319d03325b 100644
--- a/code/modules/awaymissions/corpse.dm
+++ b/code/modules/abstract/corpse_spawner.dm
@@ -1,9 +1,3 @@
-//These are meant for spawning on maps, namely Away Missions.
-
-//If someone can do this in a neater way, be my guest-Kor
-
-//To do: Allow corpses to appear mangled, bloody, etc. Allow customizing the bodies appearance (they're all bald and white right now).
-
#define CORPSE_SPAWNER_RANDOM_NAME BITFLAG(0)
#define CORPSE_SPAWNER_CUT_SURVIVAL BITFLAG(1)
#define CORPSE_SPAWNER_CUT_ID_PDA BITFLAG(2)
@@ -63,7 +57,7 @@
else
M.randomize_skin_color()
- var/decl/species/species_decl = get_species_by_key(species_choice)
+ var/decl/species/species_decl = decls_repository.get_decl_by_id(species_choice)
var/decl/bodytype/root_bodytype = M.get_bodytype()
var/update_hair = FALSE
if((spawn_flags & CORPSE_SPAWNER_RANDOM_HAIR_COLOR))
diff --git a/code/modules/abstract/follower.dm b/code/modules/abstract/follower.dm
new file mode 100644
index 000000000000..42611d1131d2
--- /dev/null
+++ b/code/modules/abstract/follower.dm
@@ -0,0 +1,18 @@
+// Simple obj for following another obj around (for light effects or such that need a physical reference)
+/obj/abstract/follower
+ anchored = TRUE
+ simulated = FALSE
+ invisibility = INVISIBILITY_ABSTRACT
+
+/obj/abstract/follower/Initialize()
+ . = ..()
+ name = ""
+ verbs.Cut()
+
+/obj/abstract/follower/proc/follow_owner(atom/movable/owner)
+ if(istype(owner) && !QDELETED(owner))
+ set_dir(owner.dir)
+ if(owner.loc)
+ forceMove(owner.loc)
+ else
+ forceMove(null)
diff --git a/code/modules/acting/acting_items.dm b/code/modules/acting/acting_items.dm
index 43fab6332707..daa5ba77f187 100644
--- a/code/modules/acting/acting_items.dm
+++ b/code/modules/acting/acting_items.dm
@@ -33,7 +33,7 @@
if(!ishuman(user))
return ..()
var/mob/living/human/H = user
- H.change_appearance(APPEARANCE_ALL, H.loc, H, H.generate_valid_species(), state = global.z_topic_state)
+ H.change_appearance(APPEARANCE_ALL, H.loc, H, state = global.z_topic_state)
var/getName = sanitize(input(H, "Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN)
if(getName)
H.real_name = getName
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index c211f274d603..1cd43c395226 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -216,9 +216,9 @@ var/global/BSACooldown = 0
else
f = 0
if(L in M.languages)
- body += "[L.name]"
+ body += "[L.name]"
else
- body += "[L.name]"
+ body += "[L.name]"
body += {"