[N.name], "
var/atom/disk_loc = N.loc
while(!isturf(disk_loc))
- if(istype(disk_loc, /mob))
+ if(ismob(disk_loc))
var/mob/M = disk_loc
dat += "carried by [M.real_name] "
if(istype(disk_loc, /obj))
diff --git a/code/game/antagonist/antagonist_update.dm b/code/game/antagonist/antagonist_update.dm
index 17b83a1342c..454d1c1b2f1 100644
--- a/code/game/antagonist/antagonist_update.dm
+++ b/code/game/antagonist/antagonist_update.dm
@@ -36,10 +36,10 @@
return
var/indicator = (faction_indicator && (other in faction_members)) ? faction_indicator : antag_indicator
var/image/I = image('icons/mob/hud.dmi', loc = other.current, icon_state = indicator, layer = ABOVE_HUMAN_LAYER)
- if(ishuman(other.current))
- var/mob/living/carbon/human/H = other.current
- I.pixel_x = H.bodytype.antaghud_offset_x
- I.pixel_y = H.bodytype.antaghud_offset_y
+ var/decl/bodytype/root_bodytype = other.current.get_bodytype()
+ if(istype(root_bodytype))
+ I.pixel_x = root_bodytype.antaghud_offset_x
+ I.pixel_y = root_bodytype.antaghud_offset_y
return I
/decl/special_role/proc/update_all_icons()
@@ -81,7 +81,7 @@
if(I.loc == player.current)
qdel(I)
-/decl/special_role/proc/update_current_antag_max(datum/game_mode/mode)
+/decl/special_role/proc/update_current_antag_max(decl/game_mode/mode)
cur_max = hard_cap
if(type in mode.associated_antags)
cur_max = hard_cap_round
diff --git a/code/game/antagonist/outsider/mercenary.dm b/code/game/antagonist/outsider/mercenary.dm
index 569da9f53ec..b381a6f3fbc 100644
--- a/code/game/antagonist/outsider/mercenary.dm
+++ b/code/game/antagonist/outsider/mercenary.dm
@@ -27,7 +27,7 @@
global_objectives |= new /datum/objective/nuclear
return 1
-/decl/special_role/mercenary/equip(var/mob/living/carbon/human/player)
+/decl/special_role/mercenary/equip_role(var/mob/living/carbon/human/player)
. = ..()
if(.)
var/obj/item/radio/uplink/U = new(get_turf(player), player.mind, DEFAULT_TELECRYSTAL_AMOUNT)
diff --git a/code/game/antagonist/outsider/ninja.dm b/code/game/antagonist/outsider/ninja.dm
index 043d70da251..dc90996ea1a 100644
--- a/code/game/antagonist/outsider/ninja.dm
+++ b/code/game/antagonist/outsider/ninja.dm
@@ -98,7 +98,7 @@
hands = list(/obj/item/modular_computer/pda/ninja)
id_type = /obj/item/card/id/syndicate
-/decl/special_role/ninja/equip(var/mob/living/carbon/human/player)
+/decl/special_role/ninja/equip_role(var/mob/living/carbon/human/player)
. = ..()
if(.)
var/decl/uplink_source/pda/uplink_source = GET_DECL(/decl/uplink_source/pda)
diff --git a/code/game/antagonist/outsider/wizard.dm b/code/game/antagonist/outsider/wizard.dm
index e64d15e9f82..0123b9a0942 100644
--- a/code/game/antagonist/outsider/wizard.dm
+++ b/code/game/antagonist/outsider/wizard.dm
@@ -64,7 +64,7 @@
wizard.current.real_name = "[pick(global.wizard_first)] [pick(global.wizard_second)]"
wizard.current.SetName(wizard.current.real_name)
-/decl/special_role/wizard/equip(var/mob/living/carbon/human/wizard_mob)
+/decl/special_role/wizard/equip_role(var/mob/living/carbon/human/wizard_mob)
default_outfit = pick(decls_repository.get_decl_paths_of_subtype(/decl/hierarchy/outfit/wizard))
. = ..()
diff --git a/code/game/antagonist/station/cultist.dm b/code/game/antagonist/station/cultist.dm
index 3fd5dc284e1..25c20aa16ae 100644
--- a/code/game/antagonist/station/cultist.dm
+++ b/code/game/antagonist/station/cultist.dm
@@ -69,7 +69,7 @@
sacrifice_target = sacrifice.target
global_objectives |= sacrifice
-/decl/special_role/cultist/equip(var/mob/living/carbon/human/player)
+/decl/special_role/cultist/equip_role(var/mob/living/carbon/human/player)
. = ..()
if(.)
var/obj/item/book/tome/T = new(get_turf(player))
@@ -95,12 +95,12 @@
. = ..()
if(.)
to_chat(player, "[conversion_blurb]")
- if(player.current && !istype(player.current, /mob/living/simple_animal/construct))
+ if(player.current && !isconstruct(player.current))
player.current.add_language(/decl/language/cultcommon)
/decl/special_role/cultist/remove_antagonist(var/datum/mind/player, var/show_message, var/implanted)
. = ..()
- if(. && player.current && !istype(player.current, /mob/living/simple_animal/construct))
+ if(. && player.current && !isconstruct(player.current))
player.current.remove_language(/decl/language/cultcommon)
/decl/special_role/cultist/update_antag_mob(var/datum/mind/player)
diff --git a/code/game/antagonist/station/loyalist.dm b/code/game/antagonist/station/loyalist.dm
index b76641b9354..f6ef8f7c3ea 100644
--- a/code/game/antagonist/station/loyalist.dm
+++ b/code/game/antagonist/station/loyalist.dm
@@ -35,7 +35,7 @@
return
global_objectives = list()
for(var/mob/living/carbon/human/player in SSmobs.mob_list)
- if(!player.mind || player.stat==2 || !(player.mind.assigned_role in SSjobs.titles_by_department(command_department_id)))
+ if(!player.mind || player.stat == DEAD || !(player.mind.assigned_role in SSjobs.titles_by_department(command_department_id)))
continue
var/datum/objective/protect/loyal_obj = new
loyal_obj.target = player.mind
diff --git a/code/game/antagonist/station/renegade.dm b/code/game/antagonist/station/renegade.dm
index 7dbc740eb29..1269452a0b4 100644
--- a/code/game/antagonist/station/renegade.dm
+++ b/code/game/antagonist/station/renegade.dm
@@ -43,7 +43,7 @@
survive.owner = player
player.objectives |= survive
-/decl/special_role/renegade/equip(var/mob/living/carbon/human/player)
+/decl/special_role/renegade/equip_role(var/mob/living/carbon/human/player)
. = ..()
if(.)
var/gun_type = pick(spawn_guns)
diff --git a/code/game/antagonist/station/revolutionary.dm b/code/game/antagonist/station/revolutionary.dm
index 398f67cf367..b56b094a7d8 100644
--- a/code/game/antagonist/station/revolutionary.dm
+++ b/code/game/antagonist/station/revolutionary.dm
@@ -35,14 +35,14 @@
return
global_objectives = list()
for(var/mob/living/carbon/human/player in SSmobs.mob_list)
- if(!player.mind || player.stat==2 || !(player.mind.assigned_role in SSjobs.titles_by_department(command_department_id)))
+ if(!player.mind || player.stat == DEAD || !(player.mind.assigned_role in SSjobs.titles_by_department(command_department_id)))
continue
var/datum/objective/rev/rev_obj = new
rev_obj.target = player.mind
rev_obj.explanation_text = "Assassinate, capture or convert [player.real_name], the [player.mind.assigned_role]."
global_objectives += rev_obj
-/decl/special_role/revolutionary/equip(var/mob/living/carbon/human/player)
+/decl/special_role/revolutionary/equip_role(var/mob/living/carbon/human/player)
. = ..()
if(.)
spawn_uplink(player)
diff --git a/code/game/antagonist/station/thrall.dm b/code/game/antagonist/station/thrall.dm
index 8a0dc036268..b4745b87126 100644
--- a/code/game/antagonist/station/thrall.dm
+++ b/code/game/antagonist/station/thrall.dm
@@ -1,28 +1,29 @@
-/decl/special_role/thrall
- name = "Thrall"
- name_plural = "Thralls"
+/decl/special_role/beguiled
+ name = "Beguiled"
+ name_plural = "Beguiled"
welcome_text = "Your mind is no longer solely your own..."
flags = ANTAG_IMPLANT_IMMUNE
- var/list/thrall_controllers = list()
+ var/list/minion_controllers = list()
-/decl/special_role/thrall/create_objectives(var/datum/mind/player)
- var/mob/living/controller = thrall_controllers["\ref[player]"]
+/decl/special_role/beguiled/create_objectives(var/datum/mind/player)
+ var/mob/living/controller = minion_controllers["\ref[player]"]
if(!controller)
return // Someone is playing with buttons they shouldn't be.
var/datum/objective/obey = new
obey.owner = player
- obey.explanation_text = "Obey your master, [controller.real_name], in all things."
+ obey.explanation_text = "You are under [controller.real_name]'s glamour, and must follow their commands."
player.objectives |= obey
-/decl/special_role/thrall/add_antagonist(var/datum/mind/player, var/ignore_role, var/do_not_equip, var/move_to_spawn, var/do_not_announce, var/preserve_appearance, var/mob/new_controller)
+/decl/special_role/beguiled/add_antagonist(var/datum/mind/player, var/ignore_role, var/do_not_equip, var/move_to_spawn, var/do_not_announce, var/preserve_appearance, var/mob/new_controller)
if(!new_controller)
- return 0
+ return FALSE
. = ..()
- if(.) thrall_controllers["\ref[player]"] = new_controller
+ if(.)
+ minion_controllers["\ref[player]"] = new_controller
-/decl/special_role/thrall/greet(var/datum/mind/player)
+/decl/special_role/beguiled/greet(var/datum/mind/player)
. = ..()
- var/mob/living/controller = thrall_controllers["\ref[player]"]
+ var/mob/living/controller = minion_controllers["\ref[player]"]
if(controller)
- to_chat(player, "Your will has been subjugated by that of [controller.real_name]. Obey them in all things.")
+ to_chat(player, "You have been ensnared by [controller.real_name]'s glamour. Follow their commands.")
diff --git a/code/game/antagonist/station/traitor.dm b/code/game/antagonist/station/traitor.dm
index 4b1795ae56c..29b5bcc9722 100644
--- a/code/game/antagonist/station/traitor.dm
+++ b/code/game/antagonist/station/traitor.dm
@@ -22,7 +22,7 @@
if(!..())
return
- if(istype(traitor.current, /mob/living/silicon))
+ if(issilicon(traitor.current))
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
@@ -67,12 +67,37 @@
traitor.objectives += hijack_objective
return
-/decl/special_role/traitor/equip(var/mob/living/carbon/human/player)
+/decl/special_role/traitor/add_antagonist(datum/mind/player, ignore_role, do_not_equip, move_to_spawn, do_not_announce, preserve_appearance)
+ . = ..()
+ if(.)
+
+ var/list/dudes = list()
+ for(var/mob/living/carbon/human/man in global.player_list)
+ if(man.client)
+ var/decl/cultural_info/culture = man.get_cultural_value(TAG_FACTION)
+ if(culture && prob(culture.subversive_potential))
+ dudes += man
+ dudes -= player.current
+
+ if(length(dudes))
+ var/mob/living/carbon/human/M = pick(dudes)
+ to_chat(player.current, "We have received credible reports that [M.real_name] might be willing to help our cause. If you need assistance, consider contacting them.")
+ player.StoreMemory("Potential Collaborator: [M.real_name]", /decl/memory_options/system)
+ to_chat(M, "The subversive potential of your faction has been noticed, and you may be contacted for assistance soon...")
+
+ to_chat(player.current, "Your employers provided you with the following information on how to identify possible allies:")
+ to_chat(player.current, "Code Phrase: [syndicate_code_phrase]")
+ to_chat(player.current, "Code Response: [syndicate_code_response]")
+ player.StoreMemory("Code Phrase: [syndicate_code_phrase]", /decl/memory_options/system)
+ player.StoreMemory("Code Response: [syndicate_code_response]", /decl/memory_options/system)
+ to_chat(player.current, "Use the code words, preferably in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe.")
+
+/decl/special_role/traitor/equip_role(var/mob/living/carbon/human/player)
. = ..()
- if(istype(player, /mob/living/silicon)) // this needs to be here because ..() returns false if the mob isn't human
+ if(issilicon(player)) // this needs to be here because ..() returns false if the mob isn't human
add_law_zero(player)
- if(istype(player, /mob/living/silicon/robot))
+ if(isrobot(player))
var/mob/living/silicon/robot/R = player
R.SetLockdown(0)
R.emagged = 1 // Provides a traitor robot with its module's emag item
@@ -83,27 +108,6 @@
else
return FALSE
- var/list/dudes = list()
- for(var/mob/living/carbon/human/man in global.player_list)
- if(man.client)
- var/decl/cultural_info/culture = man.get_cultural_value(TAG_FACTION)
- if(culture && prob(culture.subversive_potential))
- dudes += man
- dudes -= player
-
- if(LAZYLEN(dudes))
- var/mob/living/carbon/human/M = pick(dudes)
- to_chat(player, "We have received credible reports that [M.real_name] might be willing to help our cause. If you need assistance, consider contacting them.")
- player.StoreMemory("Potential Collaborator: [M.real_name]", /decl/memory_options/system)
- to_chat(M, "The subversive potential of your faction has been noticed, and you may be contacted for assistance soon...")
-
- to_chat(player, "Your employers provided you with the following information on how to identify possible allies:")
- to_chat(player, "Code Phrase: [syndicate_code_phrase]")
- to_chat(player, "Code Response: [syndicate_code_response]")
- player.StoreMemory("Code Phrase: [syndicate_code_phrase]", /decl/memory_options/system)
- player.StoreMemory("Code Response: [syndicate_code_response]", /decl/memory_options/system)
- to_chat(player, "Use the code words, preferably in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe.")
-
/decl/special_role/traitor/proc/spawn_uplink(var/mob/living/carbon/human/traitor_mob)
setup_uplink_source(traitor_mob, DEFAULT_TELECRYSTAL_AMOUNT)
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 81e2bbce9d9..50538fdcb7c 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -1,3 +1,5 @@
+/// This list of names is here to make sure we don't state our descriptive blurb to a person more than once.
+var/global/list/area_blurb_stated_to = list()
var/global/list/areas = list()
/area
@@ -9,7 +11,7 @@ var/global/list/areas = list()
plane = DEFAULT_PLANE
layer = BASE_AREA_LAYER
luminosity = 0
- mouse_opacity = 0
+ mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
var/proper_name /// Automatically set by SetName and Initialize; cached result of strip_improper(name).
var/holomap_color // Color of this area on the holomap. Must be a hex color (as string) or null.
@@ -41,6 +43,7 @@ var/global/list/areas = list()
var/list/forced_ambience
var/sound_env = STANDARD_STATION
var/description //A text-based description of what this area is for.
+ var/area_blurb_category // Used to filter description showing across subareas
var/base_turf // The base turf type of the area, which can be used to override the z-level's base turf
var/open_turf // The base turf of the area if it has a turf below it in multizi. Overrides turf-specific open type
@@ -54,7 +57,6 @@ var/global/list/areas = list()
var/list/air_scrub_names = list()
var/list/air_vent_info = list()
var/list/air_scrub_info = list()
- var/list/blurbed_stated_to = list() //This list of names is here to make sure we don't state our descriptive blurb to a person more than once.
var/tmp/is_outside = OUTSIDE_NO
@@ -65,6 +67,8 @@ var/global/list/areas = list()
uid = ++global_uid
proper_name = strip_improper(name)
luminosity = !dynamic_lighting
+ if(isnull(area_blurb_category))
+ area_blurb_category = type
..()
/area/Initialize()
@@ -128,6 +132,7 @@ var/global/list/areas = list()
T.last_outside_check = OUTSIDE_UNCERTAIN
if(T.is_outside == OUTSIDE_AREA && T.is_outside() != old_outside)
T.update_weather()
+ T.update_external_atmos_participation()
/turf/proc/update_registrations_on_adjacent_area_change()
for(var/obj/machinery/door/firedoor/door in src)
@@ -207,7 +212,7 @@ var/global/list/areas = list()
if(!fire)
fire = 1 //used for firedoor checks
update_icon()
- mouse_opacity = 0
+ mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
if(!all_doors)
return
for(var/obj/machinery/door/firedoor/D in all_doors)
@@ -222,7 +227,7 @@ var/global/list/areas = list()
if (fire)
fire = 0 //used for firedoor checks
update_icon()
- mouse_opacity = 0
+ mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
if(!all_doors)
return
for(var/obj/machinery/door/firedoor/D in all_doors)
@@ -249,13 +254,13 @@ var/global/list/areas = list()
if (!( party ))
party = 1
update_icon()
- mouse_opacity = 0
+ mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
return
/area/proc/partyreset()
if (party)
party = 0
- mouse_opacity = 0
+ mouse_opacity = MOUSE_OPACITY_UNCLICKABLE
update_icon()
for(var/obj/machinery/door/firedoor/D in src)
if(!D.blocked)
@@ -323,7 +328,7 @@ var/global/list/areas = list()
var/global/list/mob/living/forced_ambiance_list = new
/area/Entered(A)
- if(!istype(A,/mob/living))
+ if(!isliving(A))
return
var/mob/living/L = A
if(!L.lastarea)
@@ -347,12 +352,10 @@ var/global/list/mob/living/forced_ambiance_list = new
/area/proc/do_area_blurb(var/mob/living/L)
if(isnull(description))
return
-
if(L?.get_preference_value(/datum/client_preference/area_info_blurb) != PREF_YES)
return
-
- if(!(L.ckey in blurbed_stated_to))
- blurbed_stated_to += L.ckey
+ if(!(L.ckey in global.area_blurb_stated_to[area_blurb_category]))
+ LAZYADD(global.area_blurb_stated_to[area_blurb_category], L.ckey)
to_chat(L, SPAN_NOTICE(FONT_SMALL("[description]")))
/area/proc/play_ambience(var/mob/living/L)
@@ -388,7 +391,7 @@ var/global/list/mob/living/forced_ambiance_list = new
if(mob.Check_Shoegrip())
return
- if(istype(mob,/mob/living/carbon/human/))
+ if(ishuman(mob))
var/mob/living/carbon/human/H = mob
if(prob(H.skill_fail_chance(SKILL_EVA, 100, SKILL_ADEPT)))
if(!MOVING_DELIBERATELY(H))
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 4d78a75bd74..9e219cd6d10 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -1,6 +1,6 @@
/atom
- /// (1 | 2) Determines if this atom is below `1` or above `2` plating. TODO: Use defines.
- var/level = 2
+ /// (DEFINE) Determines where this atom sits in terms of turf plating. See misc.dm
+ var/level = LEVEL_ABOVE_PLATING
/// (BITFLAG) See flags.dm
var/atom_flags = ATOM_FLAG_NO_TEMP_CHANGE
/// (FLOAT) The world.time that this atom last bumped another. Used mostly by mobs.
@@ -27,8 +27,8 @@
var/was_bloodied
/// (COLOR) The color of the blood shown on blood overlays.
var/blood_color
- /// (1 | 2 | 3) If it shows up under UV light. 0 doesn't, 1 does, 2 is currently glowing due to UV light. TODO: Use defines
- var/fluorescent
+ /// (FALSE|DEFINES) How this atom is interacting with UV light. See misc.dm
+ var/fluorescent = FALSE
/// (LIST) A list of all mobs that are climbing or currently on this atom
@@ -97,7 +97,7 @@
- TODO: Also sometimes handles resetting of view itself, probably should be more consistent.
*/
/atom/proc/check_eye(user)
- if (istype(user, /mob/living/silicon/ai)) // WHY
+ if (isAI(user)) // WHY
return 0
return -1
@@ -116,7 +116,7 @@
/// Handle reagents being modified
/atom/proc/on_reagent_change()
- return
+ SHOULD_CALL_PARENT(TRUE)
/**
Handle an atom bumping this atom
@@ -331,6 +331,19 @@
SHOULD_CALL_PARENT(FALSE) //Don't call the stub plz
return
+/**
+ * Returns the sum of this atoms's reagents plus the combined matter of all its contents.
+ * 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))
+ LAZYINITLIST(.)
+ for(var/R in reagents.reagent_volumes)
+ .[R] += FLOOR(REAGENT_VOLUME(reagents, R) / 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())
+
/// Return a list of all simulated atoms inside this one.
/atom/proc/get_contained_external_atoms()
for(var/atom/movable/AM in contents)
@@ -471,7 +484,7 @@
SHOULD_CALL_PARENT(TRUE)
if(!simulated)
return
- fluorescent = 0
+ fluorescent = FALSE
germ_level = 0
blood_color = null
if(istype(blood_DNA, /list))
@@ -752,15 +765,6 @@
RETURN_TYPE(/obj/item/radio)
return
-/**
- Get the material cost of this atom.
-
- - Return: An dictionary where key is the material and value is the amount.
-*/
-/atom/proc/building_cost()
- RETURN_TYPE(/list)
- . = list()
-
/atom/Topic(href, href_list)
var/mob/user = usr
if(href_list["look_at_me"] && istype(user))
@@ -855,3 +859,9 @@
/atom/proc/on_defilement()
return
+
+/atom/proc/get_overhead_text_x_offset()
+ return 0
+
+/atom/proc/get_overhead_text_y_offset()
+ return 0
diff --git a/code/game/atoms_fluids.dm b/code/game/atoms_fluids.dm
index fd7a636214f..3211271a2e5 100644
--- a/code/game/atoms_fluids.dm
+++ b/code/game/atoms_fluids.dm
@@ -2,8 +2,8 @@
return
/atom/proc/fluid_act(var/datum/reagents/fluids)
- fluids.touch(src)
- if(reagents && fluids.total_volume >= FLUID_SHALLOW && ATOM_IS_OPEN_CONTAINER(src))
+ SHOULD_CALL_PARENT(TRUE)
+ if(reagents && fluids?.total_volume >= FLUID_SHALLOW && ATOM_IS_OPEN_CONTAINER(src))
reagents.trans_to_holder(fluids, reagents.total_volume)
fluids.trans_to_holder(reagents, min(fluids.total_volume, reagents.maximum_volume))
@@ -32,7 +32,7 @@
if(!istype(T))
return FALSE
depth = T.get_fluid_depth()
- if(istype(loc, /mob))
+ if(ismob(loc))
return depth >= FLUID_SHALLOW
if(isturf(loc))
return depth >= 3
diff --git a/code/game/atoms_layering.dm b/code/game/atoms_layering.dm
index b150c70fafb..4f37917e6cb 100644
--- a/code/game/atoms_layering.dm
+++ b/code/game/atoms_layering.dm
@@ -1,5 +1,12 @@
/atom
plane = DEFAULT_PLANE
+ appearance_flags = DEFAULT_APPEARANCE_FLAGS
+/atom/movable
+ appearance_flags = DEFAULT_APPEARANCE_FLAGS | TILE_BOUND // Most AMs are not visibly bigger than a tile.
+/image
+ appearance_flags = DEFAULT_APPEARANCE_FLAGS
+/mutable_appearance
+ appearance_flags = DEFAULT_APPEARANCE_FLAGS // Inherits /image but re docs, subject to change
/atom/proc/hud_layerise()
plane = HUD_PLANE
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index fa8561acc6e..b6bda7218a4 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -1,6 +1,6 @@
/atom/movable
layer = OBJ_LAYER
- appearance_flags = TILE_BOUND | PIXEL_SCALE | LONG_GLIDE
+ appearance_flags = TILE_BOUND | DEFAULT_APPEARANCE_FLAGS | LONG_GLIDE
glide_size = 8
abstract_type = /atom/movable
@@ -18,7 +18,7 @@
var/movable_flags
var/last_move = null
- var/anchored = 0
+ var/anchored = FALSE
// var/elevation = 2 - not used anywhere
var/move_speed = 10
var/l_move_time = 1
@@ -455,5 +455,9 @@
if(simulated && !anchored)
step_towards(src, S)
+/atom/movable/proc/crossed_mob(var/mob/living/victim)
+ return
+
/atom/movable/proc/get_object_size()
- return ITEM_SIZE_NORMAL
\ No newline at end of file
+ return ITEM_SIZE_NORMAL
+
diff --git a/code/game/base_turf.dm b/code/game/base_turf.dm
index edb7d1006f7..671213c63e8 100644
--- a/code/game/base_turf.dm
+++ b/code/game/base_turf.dm
@@ -11,12 +11,30 @@
if(HasBelow(T.z))
if(istype(A) && A.open_turf)
return A.open_turf
+
+ // Find the first non-open turf below and use its open_turf_type.
+ var/z_stack_type = get_open_turf_type(T)
+ if(z_stack_type)
+ return z_stack_type
+
+ // Otherwise, default to the open turf type set on the turf being removed.
if(T.open_turf_type)
return T.open_turf_type
if(istype(A) && A.base_turf)
return A.base_turf
return get_base_turf(T.z)
+// Returns the open turf of a Z-stack by finding the nearest non-open turf below.
+/proc/get_open_turf_type(var/turf/T)
+ if(!HasBelow(T.z))
+ return
+ var/turf/below = T
+ while ((below = GetBelow(below)))
+ if(!below.is_open() || !HasBelow(below.z))
+ if(below.open_turf_type)
+ return below.open_turf_type
+ return
+
/client/proc/set_base_turf()
set category = "Debug"
set name = "Set Base Turf"
diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm
index d74cf32a3fe..0121e88e2d2 100644
--- a/code/game/dna/dna2.dm
+++ b/code/game/dna/dna2.dm
@@ -59,9 +59,11 @@ var/global/list/assigned_blocks[DNA_SE_LENGTH]
/datum/dna
// READ-ONLY, GETS OVERWRITTEN
// DO NOT FUCK WITH THESE OR BYOND WILL EAT YOUR FACE
- var/uni_identity="" // Encoded UI
- var/struc_enzymes="" // Encoded SE
- var/unique_enzymes="" // MD5 of player name
+ var/uni_identity="" // Encoded UI
+ var/struc_enzymes="" // Encoded SE
+ var/unique_enzymes="" // MD5 of mob genetic marker value
+
+ var/fingerprint
// Internal dirtiness checks
var/dirtyUI=0
@@ -87,6 +89,7 @@ var/global/list/assigned_blocks[DNA_SE_LENGTH]
clone = ..()
clone.lineage = lineage
clone.unique_enzymes = unique_enzymes
+ clone.fingerprint = fingerprint
clone.b_type = b_type
clone.real_name = real_name
clone.species = species || global.using_map.default_species
@@ -138,6 +141,9 @@ var/global/list/assigned_blocks[DNA_SE_LENGTH]
SetUIState(DNA_UI_GENDER, character.gender!=MALE, 1)
+ fingerprint = character.get_full_print(ignore_blockers = TRUE)
+ unique_enzymes = character.get_unique_enzymes()
+
// Hair
var/list/hair_types = decls_repository.get_decl_paths_of_subtype(/decl/sprite_accessory/hair)
SetUIValueRange(DNA_UI_HAIR_STYLE, hair_types.Find(character.h_style), length(hair_types), 1)
@@ -151,7 +157,7 @@ var/global/list/assigned_blocks[DNA_SE_LENGTH]
if(LAZYLEN(E.markings))
body_markings[E.organ_tag] = E.markings.Copy()
- b_type = character.b_type
+ b_type = character.get_blood_type()
UpdateUI()
@@ -321,7 +327,6 @@ var/global/list/assigned_blocks[DNA_SE_LENGTH]
//testing("SetSESubBlock([block],[subBlock],[newSubBlock],[defer]): [oldBlock] -> [newBlock]")
SetSEBlock(block,newBlock,defer)
-
/proc/EncodeDNABlock(var/value)
return add_zero2(num2hex(value,1), 3)
@@ -352,7 +357,7 @@ var/global/list/assigned_blocks[DNA_SE_LENGTH]
ResetSE()
if(length(unique_enzymes) != 32)
- unique_enzymes = md5(character.real_name)
+ unique_enzymes = md5(num2text(character.original_genetic_seed))
else
if(!species)
species = global.using_map.default_species
@@ -366,5 +371,4 @@ var/global/list/assigned_blocks[DNA_SE_LENGTH]
/datum/dna/proc/ready_dna(mob/living/carbon/human/character)
ResetUIFrom(character)
ResetSE()
- unique_enzymes = md5(character.real_name)
- global.reg_dna[unique_enzymes] = character.real_name
+ unique_enzymes = character.get_unique_enzymes()
diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm
index dce004bb25c..48c4da795e0 100644
--- a/code/game/dna/dna2_helpers.dm
+++ b/code/game/dna/dna2_helpers.dm
@@ -133,62 +133,55 @@
// Simpler. Don't specify UI in order for the mob to use its own.
/mob/proc/UpdateAppearance(var/list/UI=null)
- if(istype(src, /mob/living/carbon/human))
- if(UI!=null)
- src.dna.UI=UI
- src.dna.UpdateUI()
- dna.check_integrity()
- var/mob/living/carbon/human/H = src
- H.hair_colour = rgb(dna.GetUIValueRange(DNA_UI_HAIR_R,255), dna.GetUIValueRange(DNA_UI_HAIR_G,255), dna.GetUIValueRange(DNA_UI_HAIR_B,255))
- H.facial_hair_colour = rgb(dna.GetUIValueRange(DNA_UI_BEARD_R,255), dna.GetUIValueRange(DNA_UI_BEARD_G,255), dna.GetUIValueRange(DNA_UI_BEARD_B,255))
- H.skin_colour = rgb(dna.GetUIValueRange(DNA_UI_SKIN_R,255), dna.GetUIValueRange(DNA_UI_SKIN_G,255), dna.GetUIValueRange(DNA_UI_SKIN_B,255))
- H.eye_colour = rgb(dna.GetUIValueRange(DNA_UI_EYES_R,255), dna.GetUIValueRange(DNA_UI_EYES_G,255), dna.GetUIValueRange(DNA_UI_EYES_B,255))
- H.update_eyes()
- H.skin_tone = 35 - dna.GetUIValueRange(DNA_UI_SKIN_TONE, 220) // Value can be negative.
-
- // TODO: update DNA gender to not be a bool - use bodytype and pronouns
- /*
- if(H.gender != NEUTER)
- if (dna.GetUIState(DNA_UI_GENDER))
- H.set_gender(FEMALE)
+ return FALSE
+
+/mob/living/carbon/human/UpdateAppearance(var/list/UI=null)
+
+ if(UI!=null)
+ src.dna.UI=UI
+ src.dna.UpdateUI()
+
+ dna.check_integrity()
+
+ fingerprint = dna.fingerprint
+ unique_enzymes = dna.unique_enzymes
+ hair_colour = rgb(dna.GetUIValueRange(DNA_UI_HAIR_R,255), dna.GetUIValueRange(DNA_UI_HAIR_G,255), dna.GetUIValueRange(DNA_UI_HAIR_B,255))
+ facial_hair_colour = rgb(dna.GetUIValueRange(DNA_UI_BEARD_R,255), dna.GetUIValueRange(DNA_UI_BEARD_G,255), dna.GetUIValueRange(DNA_UI_BEARD_B,255))
+ skin_colour = rgb(dna.GetUIValueRange(DNA_UI_SKIN_R,255), dna.GetUIValueRange(DNA_UI_SKIN_G,255), dna.GetUIValueRange(DNA_UI_SKIN_B,255))
+ eye_colour = rgb(dna.GetUIValueRange(DNA_UI_EYES_R,255), dna.GetUIValueRange(DNA_UI_EYES_G,255), dna.GetUIValueRange(DNA_UI_EYES_B,255))
+ skin_tone = 35 - dna.GetUIValueRange(DNA_UI_SKIN_TONE, 220) // Value can be negative.
+
+ // TODO: update DNA gender to not be a bool - use bodytype and pronouns
+ //Body markings
+ for(var/tag in dna.body_markings)
+ var/obj/item/organ/external/E = GET_EXTERNAL_ORGAN(src, tag)
+ if(E)
+ var/list/marklist = dna.body_markings[tag]
+ if(length(marklist))
+ E.markings = marklist.Copy()
else
- H.set_gender(MALE)
- */
-
- //Body markings
- for(var/tag in dna.body_markings)
- var/obj/item/organ/external/E = GET_EXTERNAL_ORGAN(H, tag)
- if(E)
- var/list/marklist = dna.body_markings[tag]
- if(length(marklist))
- E.markings = marklist.Copy()
- else
- LAZYCLEARLIST(E.markings)
-
- //Base skin and blend
- for(var/obj/item/organ/organ in H.get_organs())
- organ.set_dna(H.dna)
-
- //Hair
- var/list/hair_subtypes = decls_repository.get_decl_paths_of_subtype(/decl/sprite_accessory/hair)
- var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE, length(hair_subtypes))
- if(hair > 0 && hair <= length(hair_subtypes))
- H.h_style = hair_subtypes[hair]
-
- //Facial Hair
- var/list/beard_subtypes = decls_repository.get_decl_paths_of_subtype(/decl/sprite_accessory/facial_hair)
- var/beard = dna.GetUIValueRange(DNA_UI_BEARD_STYLE, length(beard_subtypes))
- if((0 < beard) && (beard <= length(beard_subtypes)))
- H.f_style = beard_subtypes[beard]
-
- H.force_update_limbs()
- H.update_body()
- H.update_eyes()
- H.update_hair()
-
- return 1
- else
- return 0
+ LAZYCLEARLIST(E.markings)
+
+ //Base skin and blend
+ for(var/obj/item/organ/organ in get_organs())
+ organ.set_dna(dna)
+
+ //Hair
+ var/list/hair_subtypes = decls_repository.get_decl_paths_of_subtype(/decl/sprite_accessory/hair)
+ var/hair = dna.GetUIValueRange(DNA_UI_HAIR_STYLE, length(hair_subtypes))
+ if(hair > 0 && hair <= length(hair_subtypes))
+ h_style = hair_subtypes[hair]
+
+ //Facial Hair
+ var/list/beard_subtypes = decls_repository.get_decl_paths_of_subtype(/decl/sprite_accessory/facial_hair)
+ var/beard = dna.GetUIValueRange(DNA_UI_BEARD_STYLE, length(beard_subtypes))
+ if((0 < beard) && (beard <= length(beard_subtypes)))
+ f_style = beard_subtypes[beard]
+
+ force_update_limbs()
+ update_hair(update_icons = FALSE)
+ update_eyes()
+ return TRUE
// Used below, simple injection modifier.
/proc/probinj(var/pr, var/inj)
diff --git a/code/game/gamemodes/calamity/calamity.dm b/code/game/gamemodes/calamity/calamity.dm
index a2ff5594b92..5c809eee420 100644
--- a/code/game/gamemodes/calamity/calamity.dm
+++ b/code/game/gamemodes/calamity/calamity.dm
@@ -1,16 +1,16 @@
#define ANTAG_TYPE_RATIO 8
-/datum/game_mode/calamity
+/decl/game_mode/calamity
name = "Calamity"
round_description = "This must be a Thursday. You never could get the hang of Thursdays..."
extended_round_description = "All hell is about to break loose. Literally every antagonist type may spawn in this round. Hold on tight."
- config_tag = "calamity"
+ uid = "calamity"
required_players = 1
votable = 0
event_delay_mod_moderate = 0.5
event_delay_mod_major = 0.75
-/datum/game_mode/calamity/create_antagonists()
+/decl/game_mode/calamity/create_antagonists()
var/list/antag_candidates = list()
var/list/all_antagonist_datums = decls_repository.get_decls_of_subtype(/decl/special_role)
diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm
index c10826eba7c..3e973359edd 100644
--- a/code/game/gamemodes/cult/cult.dm
+++ b/code/game/gamemodes/cult/cult.dm
@@ -1,8 +1,8 @@
-/datum/game_mode/cult
+/decl/game_mode/cult
name = "Cult"
round_description = "Some crewmembers are attempting to start a cult!"
extended_round_description = "There has been an infiltration by a fanatical group of death-cultists! They will use powers from beyond your comprehension to subvert you to their cause and ultimately please their gods through sacrificial summons and physical immolation! Try to survive!"
- config_tag = "cult"
+ uid = "cult"
required_players = 10
required_enemies = 3
end_on_antag_death = FALSE
diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm
index 1c21c09ee7a..28daf9435d2 100644
--- a/code/game/gamemodes/cult/cult_items.dm
+++ b/code/game/gamemodes/cult/cult_items.dm
@@ -42,9 +42,8 @@
/obj/item/clothing/head/culthood
name = "cult hood"
desc = "A hood worn by the followers of Nar-Sie."
-
icon = 'icons/clothing/head/cult.dmi'
- flags_inv = HIDEFACE
+ flags_inv = HIDEFACE | BLOCK_HEAD_HAIR
body_parts_covered = SLOT_HEAD
armor = list(
ARMOR_MELEE = ARMOR_MELEE_RESISTANT,
diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm
index b38ec7d3f95..6d3194a0877 100644
--- a/code/game/gamemodes/cult/cult_structures.dm
+++ b/code/game/gamemodes/cult/cult_structures.dm
@@ -1,6 +1,6 @@
/obj/structure/cult
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
icon = 'icons/obj/cult.dmi'
/obj/structure/cult/talisman
@@ -93,9 +93,8 @@
desc = "You're pretty sure that abyss is staring back."
icon = 'icons/obj/cult.dmi'
icon_state = "hole"
- density = 1
- unacidable = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
var/spawnable = null
/obj/effect/gateway/active
@@ -126,41 +125,44 @@
new t(src.loc)
qdel(src)
-/obj/effect/gateway/active/Crossed(var/atom/A)
- if(!istype(A, /mob/living))
+/obj/effect/gateway/active/Crossed(var/atom/movable/AM)
+ if(!isliving(AM))
return
- var/mob/living/M = A
+ var/mob/living/M = AM
+ if(M.stat == DEAD)
+ return
- if(M.stat != DEAD)
- if(M.HasMovementHandler(/datum/movement_handler/mob/transformation))
- return
+ if(M.HasMovementHandler(/datum/movement_handler/mob/transformation))
+ return
- M.handle_pre_transformation()
+ M.handle_pre_transformation()
- if(iscultist(M)) return
- if(!ishuman(M) && !isrobot(M)) return
+ if(iscultist(M))
+ return
+ if(!ishuman(M) && !isrobot(M))
+ return
- M.AddMovementHandler(/datum/movement_handler/mob/transformation)
- M.icon = null
- M.overlays.len = 0
- M.set_invisibility(101)
+ M.AddMovementHandler(/datum/movement_handler/mob/transformation)
+ M.icon = null
+ M.overlays.len = 0
+ M.set_invisibility(INVISIBILITY_ABSTRACT)
- if(istype(M, /mob/living/silicon/robot))
- var/mob/living/silicon/robot/Robot = M
- if(Robot.mmi)
- qdel(Robot.mmi)
- else
- for(var/obj/item/W in M)
- M.drop_from_inventory(W)
- if(istype(W, /obj/item/implant))
- qdel(W)
-
- var/mob/living/new_mob = new /mob/living/simple_animal/corgi(A.loc)
- new_mob.a_intent = I_HURT
- if(M.mind)
- M.mind.transfer_to(new_mob)
- else
- new_mob.key = M.key
+ if(isrobot(M))
+ var/mob/living/silicon/robot/Robot = M
+ if(Robot.mmi)
+ qdel(Robot.mmi)
+ else
+ for(var/obj/item/W in M)
+ M.drop_from_inventory(W)
+ if(istype(W, /obj/item/implant))
+ qdel(W)
+
+ var/mob/living/new_mob = new /mob/living/simple_animal/corgi(AM.loc)
+ new_mob.a_intent = I_HURT
+ if(M.mind)
+ M.mind.transfer_to(new_mob)
+ else
+ new_mob.key = M.key
- to_chat(new_mob, "Your form morphs into that of a corgi.")//Because we don't have cluwnes
+ to_chat(new_mob, "Your form morphs into that of a corgi.")//Because we don't have cluwnes
diff --git a/code/game/gamemodes/cult/cultify/mob.dm b/code/game/gamemodes/cult/cultify/mob.dm
index 60751eaabdd..8c95baa107c 100644
--- a/code/game/gamemodes/cult/cultify/mob.dm
+++ b/code/game/gamemodes/cult/cultify/mob.dm
@@ -6,7 +6,7 @@
icon = 'icons/mob/mob.dmi'
icon_state = "ghost-narsie"
cut_overlays()
- set_invisibility(0)
+ set_invisibility(INVISIBILITY_NONE)
to_chat(src, SPAN_SINISTER("Even as a non-corporal being, you can feel Nar-Sie's presence altering you. You are now visible to everyone."))
/mob/living/on_defilement()
@@ -20,7 +20,7 @@
G.icon = 'icons/mob/mob.dmi'
G.icon_state = "ghost-narsie"
G.overlays.Cut()
- G.set_invisibility(0)
+ G.set_invisibility(INVISIBILITY_NONE)
to_chat(G, "You feel relieved as what's left of your soul finally escapes its prison of flesh.")
else
dust()
diff --git a/code/game/gamemodes/cult/ghosts.dm b/code/game/gamemodes/cult/ghosts.dm
index 17de3d70705..28955489c2c 100644
--- a/code/game/gamemodes/cult/ghosts.dm
+++ b/code/game/gamemodes/cult/ghosts.dm
@@ -282,9 +282,9 @@
to_chat(src, "You are now invisible.")
visible_message("It fades from sight...")
set_invisibility(INVISIBILITY_OBSERVER)
- mouse_opacity = 1
+ mouse_opacity = MOUSE_OPACITY_NORMAL
else
ghost_magic_cd = world.time + 60 SECONDS
to_chat(src, "You are now visible.")
- set_invisibility(0)
- mouse_opacity = 0 // This is so they don't make people invincible to melee attacks by hovering over them
+ set_invisibility(INVISIBILITY_NONE)
+ mouse_opacity = MOUSE_OPACITY_UNCLICKABLE // This is so they don't make people invincible to melee attacks by hovering over them
diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm
index b1346e2cb1f..90ba89f658a 100644
--- a/code/game/gamemodes/cult/narsie.dm
+++ b/code/game/gamemodes/cult/narsie.dm
@@ -16,7 +16,6 @@ var/global/list/narsie_list = list()
icon = 'icons/obj/narsie.dmi'
icon_state = "narsie"
anchored = TRUE
- unacidable = TRUE
pixel_x = -236
pixel_y = -256
plane = ABOVE_LIGHTING_PLANE
diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index 60e6a5ec29a..41c42b43b72 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -1,10 +1,9 @@
/obj/effect/rune
name = "rune"
desc = "A strange collection of symbols drawn in blood."
- anchored = 1
+ anchored = TRUE
icon = 'icons/effects/uristrunes.dmi'
icon_state = "blank"
- unacidable = 1
layer = RUNE_LAYER
var/blood
@@ -267,9 +266,8 @@
icon = 'icons/effects/effects.dmi'//TODO: better icon
icon_state = "smoke"
color = "#ff0000"
- anchored = 1
- density = 1
- unacidable = 1
+ anchored = TRUE
+ density = TRUE
var/obj/effect/rune/wall/rune
var/health
var/max_health = 200
@@ -490,7 +488,7 @@
//TODO: other rewards?
/* old sac code - left there in case someone wants to salvage it
var/worth = 0
- if(istype(H,/mob/living/carbon/human))
+ if(ishuman(H))
var/mob/living/carbon/human/lamb = H
if(lamb.species.rarity_value > 3)
worth = 1
diff --git a/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm b/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm
index ebb26b19070..2c5f9a9ffa7 100644
--- a/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm
+++ b/code/game/gamemodes/endgame/ftl_jump/ftl_jump.dm
@@ -20,7 +20,7 @@
else
create_duplicate(M)
for(var/mob/goast in global.ghost_mob_list)
- goast.mouse_opacity = 0 //can't let you click that Dave
+ goast.mouse_opacity = MOUSE_OPACITY_UNCLICKABLE //can't let you click that Dave
goast.set_invisibility(SEE_INVISIBLE_LIVING)
goast.alpha = 255
old_accessible_z_levels = SSmapping.accessible_z_levels.Copy()
@@ -73,7 +73,7 @@
name = "echo"
desc = "It's not going to punch you, is it?"
var/mob/living/carbon/human/daddy
- anchored = 1
+ anchored = TRUE
var/reality = 0
simulated = 0
@@ -121,10 +121,7 @@
/obj/effect/bluegoast/proc/blueswitch()
var/mob/living/carbon/human/H
if(ishuman(daddy))
- H = new(get_turf(src), daddy.species.name)
- H.dna = daddy.dna.Clone()
- H.sync_organ_dna()
- H.UpdateAppearance()
+ H = new(get_turf(src), daddy.species.name, daddy.dna.Clone(), 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)
@@ -144,4 +141,3 @@
color = "#ff9900"
alpha = 100
blend_mode = BLEND_SUBTRACT
- layer = FULLSCREEN_LAYER
\ No newline at end of file
diff --git a/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm b/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm
index b8c6afdaf28..95caa40a160 100644
--- a/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm
+++ b/code/game/gamemodes/endgame/nuclear_explosion/nuclear_explosion.dm
@@ -12,7 +12,7 @@
cinematic.icon_state = "station_intact"
cinematic.plane = HUD_PLANE
cinematic.layer = HUD_ABOVE_ITEM_LAYER
- cinematic.mouse_opacity = 2
+ cinematic.mouse_opacity = MOUSE_OPACITY_PRIORITY
cinematic.screen_loc = "LEFT+1,BOTTOM"
/datum/universal_state/nuclear_explosion/OnEnter()
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm
index db3d57b3d51..9b8ef1cd7a8 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm
@@ -6,7 +6,6 @@
icon = 'icons/obj/rift.dmi'
icon_state = "rift"
anchored = TRUE
- unacidable = TRUE
pixel_x = -236
pixel_y = -256
plane = ABOVE_LIGHTING_PLANE
@@ -31,7 +30,7 @@
/obj/effect/wormhole_exit/proc/transit_to_exit(const/atom/A)
if(!A.simulated)
return FALSE
- if (istype(A, /mob/living))
+ if (isliving(A))
var/mob/living/L = A
if(!length(global.endgame_safespawns))
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
index fb65ab959b8..a3c8c357bd2 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
@@ -114,9 +114,9 @@ var/global/universe_has_ended = 0
/datum/universal_state/supermatter_cascade/proc/PlayerSet()
for(var/datum/mind/M in global.player_list)
- if(!istype(M.current,/mob/living))
+ if(!isliving(M.current))
continue
- if(M.current.stat!=2)
+ if(M.current.stat != DEAD)
SET_STATUS_MAX(M.current, STAT_WEAK, 10)
M.current.flash_eyes()
diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm
index b4d069c4354..0ebfbd5cabe 100644
--- a/code/game/gamemodes/events.dm
+++ b/code/game/gamemodes/events.dm
@@ -59,7 +59,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
//AI laws
for(var/mob/living/silicon/ai/M in global.living_mob_list_)
- if(M.stat != 2 && M.see_in_dark != 0)
+ if(M.stat != DEAD && M.see_in_dark != 0)
var/who2 = pick("ALIENS", "BEARS", "CLOWNS", "XENOS", "PETES", "BOMBS", "FETISHES", "WIZARDS", "SYNDICATE AGENTS", "CENTCOM OFFICERS", "SPACE PIRATES", "TRAITORS", "MONKEYS", "BEES", "CARP", "CRABS", "EELS", "BANDITS", "LIGHTS")
var/what2 = pick("BOLTERS", "STAVES", "DICE", "SINGULARITIES", "TOOLBOXES", "NETTLES", "AIRLOCKS", "CLOTHES", "WEAPONS", "MEDKITS", "BOMBS", "CANISTERS", "CHAIRS", "BBQ GRILLS", "ID CARDS", "CAPTAINS")
var/what2pref = pick("SOFT", "WARM", "WET", "COLD", "ICY", "SEXY", "UGLY", "CUBAN")
diff --git a/code/game/gamemodes/events/black_hole.dm b/code/game/gamemodes/events/black_hole.dm
index 5418da178ff..9a4d26c3cba 100644
--- a/code/game/gamemodes/events/black_hole.dm
+++ b/code/game/gamemodes/events/black_hole.dm
@@ -5,10 +5,9 @@
icon = 'icons/obj/objects.dmi'
desc = "FUCK FUCK FUCK AAAHHH!"
icon_state = "bhole3"
- opacity = 1
- unacidable = 1
- density = 0
- anchored = 1
+ opacity = TRUE
+ density = FALSE
+ anchored = TRUE
/obj/effect/bhole/Initialize()
. = ..()
@@ -57,9 +56,9 @@
//MOVEMENT
if( prob(50) )
- src.anchored = 0
+ src.anchored = FALSE
step(src,pick(global.alldirs))
- src.anchored = 1
+ src.anchored = TRUE
/obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen
diff --git a/code/game/gamemodes/extended/extended.dm b/code/game/gamemodes/extended/extended.dm
index e5c20bd0f53..40706050003 100644
--- a/code/game/gamemodes/extended/extended.dm
+++ b/code/game/gamemodes/extended/extended.dm
@@ -1,7 +1,7 @@
-/datum/game_mode/extended
+/decl/game_mode/extended
name = "Extended"
- config_tag = "extended"
+ uid = "extended"
required_players = 0
round_description = "Just have fun and role-play!"
extended_round_description = "There are no antagonists during extended, unless an admin decides to be cheeky. Just play your character, mess around with your job, and have fun."
- addantag_allowed = ADDANTAG_ADMIN // No add antag vote allowed on extended, except when manually called by admins.
\ No newline at end of file
+ addantag_allowed = ADDANTAG_ADMIN // No add antag vote allowed on extended, except when manually called by admins.
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index e62310f18a7..62299631a4e 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -1,11 +1,12 @@
var/global/antag_add_finished // Used in antag type voting.
var/global/list/additional_antag_types = list()
-/datum/game_mode
+/decl/game_mode
+ abstract_type = /decl/game_mode
+ decl_flags = DECL_FLAG_MANDATORY_UID
var/name = "invalid"
var/round_description = "How did you even vote this in?"
var/extended_round_description = "This roundtype should not be spawned, let alone votable. Someone contact a developer and tell them the game's broken again."
- var/config_tag = null
var/votable = TRUE
var/probability = 0
@@ -44,19 +45,15 @@ var/global/list/additional_antag_types = list()
null
)
-/datum/game_mode/New()
- ..()
- // Enforce some formatting.
- // This will probably break something.
+/decl/game_mode/Initialize()
name = capitalize(lowertext(name))
- config_tag = lowertext(config_tag)
-
if(round_autoantag && !length(latejoin_antags))
latejoin_antags = associated_antags.Copy()
else if(!round_autoantag && length(latejoin_antags))
round_autoantag = TRUE
+ . = ..()
-/datum/game_mode/Topic(href, href_list[])
+/decl/game_mode/Topic(href, href_list[])
if(..())
return
if(href_list["toggle"])
@@ -132,7 +129,7 @@ var/global/list/additional_antag_types = list()
if (usr.client && usr.client.holder)
usr.client.holder.show_game_mode(usr)
-/datum/game_mode/proc/announce() //to be called when round starts
+/decl/game_mode/proc/announce() //to be called when round starts
to_world("The current game mode is [capitalize(name)]!")
if(round_description) to_world("[round_description]")
if(round_autoantag) to_world("Antagonists will be added to the round automagically as needed.")
@@ -156,7 +153,7 @@ var/global/list/additional_antag_types = list()
// startRequirements()
// Checks to see if the game can be setup and ran with the current number of players or whatnot.
// Returns 0 if the mode can start and a message explaining the reason why it can't otherwise.
-/datum/game_mode/proc/startRequirements()
+/decl/game_mode/proc/startRequirements()
var/playerC = 0
for(var/mob/new_player/player in global.player_list)
if((player.client)&&(player.ready))
@@ -189,7 +186,7 @@ var/global/list/additional_antag_types = list()
else
return 0
-/datum/game_mode/proc/refresh_event_modifiers()
+/decl/game_mode/proc/refresh_event_modifiers()
if(event_delay_mod_moderate || event_delay_mod_major)
SSevent.report_at_round_end = 1
if(event_delay_mod_moderate)
@@ -199,7 +196,7 @@ var/global/list/additional_antag_types = list()
var/datum/event_container/EMajor = SSevent.event_containers[EVENT_LEVEL_MAJOR]
EMajor.delay_modifier = event_delay_mod_major
-/datum/game_mode/proc/pre_setup()
+/decl/game_mode/proc/pre_setup()
for(var/decl/special_role/antag in antag_templates)
antag.update_current_antag_max(src)
antag.build_candidate_list(src) //compile a list of all eligible candidates
@@ -214,8 +211,9 @@ var/global/list/additional_antag_types = list()
sortTim(antag_templates_by_initial_spawn_req, /proc/cmp_numeric_asc, TRUE)
antag_templates = list()
- for(var/template in antag_templates_by_initial_spawn_req)
- antag_templates += template
+ for(var/decl/special_role/antag in antag_templates_by_initial_spawn_req)
+ antag_templates |= antag
+ latejoin_antags |= antag.type
var/list/valid_templates_per_candidate = list() // number of roles each candidate can satisfy
for(var/candidate in all_candidates)
@@ -240,7 +238,7 @@ var/global/list/additional_antag_types = list()
antag.candidates = shuffle(antag.candidates) // makes selection past initial_spawn_req fairer
///post_setup()
-/datum/game_mode/proc/post_setup()
+/decl/game_mode/proc/post_setup()
next_spawn = world.time + rand(min_autotraitor_delay, max_autotraitor_delay)
@@ -265,8 +263,9 @@ var/global/list/additional_antag_types = list()
antag.post_spawn()
// Update goals, now that antag status and jobs are both resolved.
- for(var/thing in SSticker.minds)
- var/datum/mind/mind = thing
+ for(var/datum/mind/mind as anything in SSticker.minds)
+ if(!mind.current || !mind.assigned_job)
+ continue
mind.generate_goals(mind.assigned_job, is_spawning=TRUE)
mind.current.show_goals()
@@ -279,11 +278,11 @@ var/global/list/additional_antag_types = list()
SSstatistics.set_field_details("server_ip","[world.internet_address]:[world.port]")
return 1
-/datum/game_mode/proc/fail_setup()
+/decl/game_mode/proc/fail_setup()
for(var/decl/special_role/antag in antag_templates)
antag.reset_antag_selection()
-/datum/game_mode/proc/announce_ert_disabled()
+/decl/game_mode/proc/announce_ert_disabled()
if(!ert_disabled)
return
@@ -321,7 +320,7 @@ var/global/list/additional_antag_types = list()
)
command_announcement.Announce("The presence of [pick(reasons)] in the region is tying up all available local emergency resources; emergency response teams cannot be called at this time, and post-evacuation recovery efforts will be substantially delayed.","Emergency Transmission")
-/datum/game_mode/proc/check_finished()
+/decl/game_mode/proc/check_finished()
if(SSevac.evacuation_controller?.round_over() || station_was_nuked)
return 1
if(end_on_antag_death && antag_templates && antag_templates.len)
@@ -336,10 +335,10 @@ var/global/list/additional_antag_types = list()
return 1
return 0
-/datum/game_mode/proc/cleanup() //This is called when the round has ended but not the game, if any cleanup would be necessary in that case.
+/decl/game_mode/proc/cleanup() //This is called when the round has ended but not the game, if any cleanup would be necessary in that case.
return
-/datum/game_mode/proc/declare_completion()
+/decl/game_mode/proc/declare_completion()
set waitfor = FALSE
sleep(2)
@@ -415,10 +414,10 @@ var/global/list/additional_antag_types = list()
return 0
-/datum/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere.
+/decl/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere.
return 0
-/datum/game_mode/proc/get_players_for_role(var/antag_type)
+/decl/game_mode/proc/get_players_for_role(var/antag_type)
var/list/players = list()
var/list/candidates = list()
@@ -431,7 +430,7 @@ var/global/list/additional_antag_types = list()
for(var/mob/player in global.player_list)
if(!player.client)
continue
- if(istype(player, /mob/new_player))
+ if(isnewplayer(player))
continue
if(!antag_template.name || (antag_template.name in player.client.prefs.be_special_role))
log_debug("[player.key] had [antag_template.name] enabled, so we are drafting them.")
@@ -463,16 +462,16 @@ var/global/list/additional_antag_types = list()
// required_enemies if the number of people with that role set to yes is less than recomended_enemies,
// Less if there are not enough valid players in the game entirely to make required_enemies.
-/datum/game_mode/proc/num_players()
+/decl/game_mode/proc/num_players()
. = 0
for(var/mob/new_player/P in global.player_list)
if(P.client && P.ready)
. ++
-/datum/game_mode/proc/round_status_topic(href, href_list[])
+/decl/game_mode/proc/round_status_topic(href, href_list[])
return 0
-/datum/game_mode/proc/create_antagonists()
+/decl/game_mode/proc/create_antagonists()
if(!config.traitor_scaling)
antag_scaling_coeff = 0
@@ -494,7 +493,7 @@ var/global/list/additional_antag_types = list()
shuffle(antag_templates) //In the case of multiple antag types
// Manipulates the end-game cinematic in conjunction with global.cinematic
-/datum/game_mode/proc/nuke_act(obj/screen/cinematic_screen, station_missed = 0)
+/decl/game_mode/proc/nuke_act(obj/screen/cinematic_screen, station_missed = 0)
if(!cinematic_icon_states)
return
if(station_missed < 2)
diff --git a/code/game/gamemodes/game_mode_latespawn.dm b/code/game/gamemodes/game_mode_latespawn.dm
index 2ebc4eb8820..802d83c3c00 100644
--- a/code/game/gamemodes/game_mode_latespawn.dm
+++ b/code/game/gamemodes/game_mode_latespawn.dm
@@ -1,14 +1,15 @@
-/datum/game_mode/var/next_spawn = 0
-/datum/game_mode/var/min_autotraitor_delay = 4200 // Approx 7 minutes.
-/datum/game_mode/var/max_autotraitor_delay = 12000 // Approx 20 minutes.
+/decl/game_mode
+ var/next_spawn = 0
+ var/min_autotraitor_delay = 7 MINUTES
+ var/max_autotraitor_delay = 20 MINUTES
///process()
///Called by the gameticker
-/datum/game_mode/proc/process()
+/decl/game_mode/proc/process()
if(shall_process_autoantag())
process_autoantag()
-/datum/game_mode/proc/shall_process_autoantag()
+/decl/game_mode/proc/shall_process_autoantag()
if(!round_autoantag || world.time < next_spawn)
return FALSE
if(SSevac.evacuation_controller && (SSevac.evacuation_controller.is_evacuating() || SSevac.evacuation_controller.has_evacuated()))
@@ -20,16 +21,16 @@
return TRUE
//This can be overriden in case a game mode needs to do stuff when a player latejoins
-/datum/game_mode/proc/handle_latejoin(var/mob/living/carbon/human/character)
+/decl/game_mode/proc/handle_latejoin(var/mob/living/carbon/human/character)
if(character.mind)
character.mind.generate_goals(character.mind.assigned_job, is_spawning=TRUE)
character.show_goals()
return 0
-/datum/game_mode/proc/handle_offsite_latejoin(var/mob/living/carbon/human/character)
+/decl/game_mode/proc/handle_offsite_latejoin(var/mob/living/carbon/human/character)
return 0
-/datum/game_mode/proc/process_autoantag()
+/decl/game_mode/proc/process_autoantag()
message_admins("[uppertext(name)]: Attempting autospawn.")
var/list/usable_templates = list()
diff --git a/code/game/gamemodes/godmode/form_items/starlight_mobs.dm b/code/game/gamemodes/godmode/form_items/starlight_mobs.dm
index 979e3211898..2dbde85f029 100644
--- a/code/game/gamemodes/godmode/form_items/starlight_mobs.dm
+++ b/code/game/gamemodes/godmode/form_items/starlight_mobs.dm
@@ -1,7 +1,7 @@
/mob/living/starlight_soul
name = "soul"
desc = "A captured soul."
- anchored = 1
+ anchored = TRUE
meat_type = null
meat_amount = 0
diff --git a/code/game/gamemodes/godmode/form_items/starlight_structures.dm b/code/game/gamemodes/godmode/form_items/starlight_structures.dm
index 605c2bd8ca1..d98eb249478 100644
--- a/code/game/gamemodes/godmode/form_items/starlight_structures.dm
+++ b/code/game/gamemodes/godmode/form_items/starlight_structures.dm
@@ -12,7 +12,7 @@
icon = 'icons/obj/singularity.dmi'
icon_state = "singularity_s1"
power_adjustment = 1
- density = 0
+ density = FALSE
var/weakref/target_ref
var/start_time = 0
var/power_drain = 7
diff --git a/code/game/gamemodes/godmode/god_structures.dm b/code/game/gamemodes/godmode/god_structures.dm
index 273392f75a5..f40e5bb4597 100644
--- a/code/game/gamemodes/godmode/god_structures.dm
+++ b/code/game/gamemodes/godmode/god_structures.dm
@@ -18,8 +18,8 @@
/obj/structure/deity
icon = 'icons/obj/cult.dmi'
maxhealth = 10
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
icon_state = "tomealtar"
is_spawnable_type = FALSE // will usually runtime without a linked god
diff --git a/code/game/gamemodes/godmode/god_trap.dm b/code/game/gamemodes/godmode/god_trap.dm
index bb919ad3d43..323b3bf2e15 100644
--- a/code/game/gamemodes/godmode/god_trap.dm
+++ b/code/game/gamemodes/godmode/god_trap.dm
@@ -1,5 +1,5 @@
/obj/structure/deity/trap
- density = 0
+ density = FALSE
health = 1
var/triggered = 0
@@ -24,7 +24,7 @@
return
/obj/structure/deity/trap/proc/trigger(var/atom/entered, var/atom/movable/enterer)
- if(triggered > world.time || !istype(enterer, /mob/living))
+ if(triggered > world.time || !isliving(enterer))
return
triggered = world.time + 30 SECONDS
\ No newline at end of file
diff --git a/code/game/gamemodes/godmode/godmode.dm b/code/game/gamemodes/godmode/godmode.dm
index a450a7cd2b6..9bf79d8ca87 100644
--- a/code/game/gamemodes/godmode/godmode.dm
+++ b/code/game/gamemodes/godmode/godmode.dm
@@ -1,12 +1,12 @@
-/datum/game_mode/godmode
+/decl/game_mode/godmode
name = "Deity"
round_description = "An otherworldly beast has turned its attention to you and your fellow cremembers."
extended_round_description = "The station has been infiltrated by a fanatical group of death-cultists! They will use powers from beyond your comprehension to subvert you to their cause and ultimately please their gods through sacrificial summons and physical immolation! Try to survive!"
- config_tag = "god"
+ uid = "god"
required_players = 10
required_enemies = 3
end_on_antag_death = FALSE
associated_antags = list(
- /decl/special_role/deity,
+ /decl/special_role/deity,
/decl/special_role/godcultist
)
\ No newline at end of file
diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm
index f11138c4060..c2bedd494d5 100644
--- a/code/game/gamemodes/heist/heist.dm
+++ b/code/game/gamemodes/heist/heist.dm
@@ -1,10 +1,10 @@
/*
-(VOX) HEIST ROUNDTYPE
+HEIST ROUNDTYPE
*/
-/datum/game_mode/heist
+/decl/game_mode/heist
name = "Heist"
- config_tag = "heist"
+ uid = "heist"
required_players = 12
required_enemies = 3
round_description = "An unidentified drive signature has slipped into close sensor range and is approaching!"
diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm
index 00d60dbf8cd..828322db8c9 100644
--- a/code/game/gamemodes/meteor/meteor.dm
+++ b/code/game/gamemodes/meteor/meteor.dm
@@ -2,11 +2,11 @@
#define METEOR_FAILSAFE_THRESHOLD 45 MINUTES // Failsafe that guarantees Severity will be at least 15 when the round hits this time.
// In general, a PVE oriented game mode. A middle ground between Extended and actual antagonist based rounds.
-/datum/game_mode/meteor
+/decl/game_mode/meteor
name = "Meteor"
round_description = "You are about to enter an asteroid belt!"
extended_round_description = "We are on an unavoidable collision course with an asteroid field. You have only a moment to prepare before you are barraged by dust and meteors. As if it was not enough, all kinds of negative events seem to happen more frequently. Good luck."
- config_tag = "meteor"
+ uid = "meteor"
required_players = 15 // Definitely not good for low-pop
votable = 1
shuttle_delay = 2
@@ -29,33 +29,33 @@
event_delay_mod_major = 0.3
/decl/vv_set_handler/meteor_severity_handler
- handled_type = /datum/game_mode/meteor
+ handled_type = /decl/game_mode/meteor
handled_vars = list(
- "meteor_severity" = /datum/game_mode/meteor/proc/set_meteor_severity,
- "meteor_wave_delay" = /datum/game_mode/meteor/proc/set_meteor_wave_delay
+ "meteor_severity" = /decl/game_mode/meteor/proc/set_meteor_severity,
+ "meteor_wave_delay" = /decl/game_mode/meteor/proc/set_meteor_wave_delay
)
-/datum/game_mode/meteor/proc/set_meteor_severity(value)
+/decl/game_mode/meteor/proc/set_meteor_severity(value)
meteor_severity = clamp(value, 0, maximal_severity)
-/datum/game_mode/meteor/proc/set_meteor_wave_delay(value)
+/decl/game_mode/meteor/proc/set_meteor_wave_delay(value)
meteor_wave_delay = max(10 SECONDS, value)
-/datum/game_mode/meteor/VV_static()
+/decl/game_mode/meteor/VV_static()
return ..() + "maximal_severity"
-/datum/game_mode/meteor/post_setup()
+/decl/game_mode/meteor/post_setup()
..()
alert_title = "Automated Beacon AB-[rand(10, 99)]"
alert_text = "This is an automatic warning. Your facility: [global.using_map.full_name] is on a collision course with a nearby asteroid belt. Estimated time until impact is: [meteor_grace_period / 1200] MINUTES. Please perform necessary actions to secure your ship or station from the threat. Have a nice day."
start_text = "This is an automatic warning. Your facility: [global.using_map.full_name] has entered an asteroid belt. Estimated time until you leave the belt is: [rand(20,30)] HOURS and [rand(1, 59)] MINUTES. For your safety, please consider changing course or using protective equipment. Have a nice day."
next_wave = round_duration_in_ticks + meteor_grace_period
-/datum/game_mode/meteor/proc/on_meteor_warn()
+/decl/game_mode/meteor/proc/on_meteor_warn()
alert_sent = 1
command_announcement.Announce(alert_text, alert_title)
-/datum/game_mode/meteor/proc/on_enter_field()
+/decl/game_mode/meteor/proc/on_enter_field()
alert_sent = 2
command_announcement.Announce(start_text, alert_title)
for(var/obj/machinery/shield_diffuser/SD in SSmachines.machinery)
@@ -70,7 +70,7 @@
T.add_overlay(image('icons/obj/overmap.dmi', "meteor[rand(1,4)]"))
next_wave = round_duration_in_ticks + meteor_wave_delay
-/datum/game_mode/meteor/process()
+/decl/game_mode/meteor/process()
// Send an alert halfway through the round.
if((round_duration_in_ticks >= (next_wave / 2)) && !alert_sent)
on_meteor_warn()
@@ -94,7 +94,7 @@
if(send_admin_broadcasts)
log_and_message_admins("Meteor: Wave fired. Escalation: [escalated ? "Yes" : "No"]. Severity: [meteor_severity]/[maximal_severity]")
-/datum/game_mode/meteor/proc/get_meteor_types()
+/decl/game_mode/meteor/proc/get_meteor_types()
switch(meteor_severity)
if(1 to 9)
return meteors_dust
diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm
index 2f99480f8aa..3289a214b08 100644
--- a/code/game/gamemodes/meteor/meteors.dm
+++ b/code/game/gamemodes/meteor/meteors.dm
@@ -129,8 +129,8 @@ var/global/list/meteors_cataclysm = list(\
desc = "You should probably run instead of gawking at this."
icon = 'icons/obj/meteor.dmi'
icon_state = "small"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
var/hits = 4
var/hitpwr = 2 //Level of ex_act to be called on hit.
var/dest
diff --git a/code/game/gamemodes/mixed/crossfire.dm b/code/game/gamemodes/mixed/crossfire.dm
index 041f78e5ea3..f031d36a780 100644
--- a/code/game/gamemodes/mixed/crossfire.dm
+++ b/code/game/gamemodes/mixed/crossfire.dm
@@ -1,8 +1,8 @@
-/datum/game_mode/crossfire
+/decl/game_mode/crossfire
name = "Mercenary & Heist"
round_description = "Mercenaries and raiders are preparing for a nice visit..."
extended_round_description = "Nothing can possibly go wrong with lots of people and lots of guns, right?"
- config_tag = "crossfire"
+ uid = "crossfire"
required_players = 25
required_enemies = 6
end_on_antag_death = FALSE
diff --git a/code/game/gamemodes/mixed/siege.dm b/code/game/gamemodes/mixed/siege.dm
index 6fa8fb621b8..1e84f5dbcc5 100644
--- a/code/game/gamemodes/mixed/siege.dm
+++ b/code/game/gamemodes/mixed/siege.dm
@@ -1,6 +1,6 @@
-/datum/game_mode/siege
+/decl/game_mode/siege
name = "Mercenary & Revolution"
- config_tag = "siege"
+ uid = "siege"
round_description = "Getting stuck between a rock and a hard place, maybe the nice visitors can help with your internal security problem?"
extended_round_description = "GENERAL QUARTERS! OH GOD WE GAVE THE REVOLUTIONARIES GUNS!"
required_players = 20
diff --git a/code/game/gamemodes/mixed/spyvspy.dm b/code/game/gamemodes/mixed/spyvspy.dm
index 06e6ddd6dcc..f0f9d638cf1 100644
--- a/code/game/gamemodes/mixed/spyvspy.dm
+++ b/code/game/gamemodes/mixed/spyvspy.dm
@@ -1,8 +1,8 @@
-/datum/game_mode/spyvspy
+/decl/game_mode/spyvspy
name = "Spy v. Spy"
round_description = "There are traitorous forces at play, but some crew have resolved to stop them by any means necessary!"
extended_round_description = "Traitors and renegades both spawn during this mode."
- config_tag = "spyvspy"
+ uid = "spyvspy"
required_players = 4
required_enemies = 4
end_on_antag_death = FALSE
diff --git a/code/game/gamemodes/mixed/uprising.dm b/code/game/gamemodes/mixed/uprising.dm
index 6109afbb42f..3200ee883e9 100644
--- a/code/game/gamemodes/mixed/uprising.dm
+++ b/code/game/gamemodes/mixed/uprising.dm
@@ -1,8 +1,8 @@
-/datum/game_mode/uprising
+/decl/game_mode/uprising
name = "Cult & Revolution"
round_description = "Some crewmembers are attempting to start a revolution while a cult plots in the shadows!"
extended_round_description = "Cultists and revolutionaries spawn in this round."
- config_tag = "uprising"
+ uid = "uprising"
required_players = 20
required_enemies = 6
end_on_antag_death = FALSE
diff --git a/code/game/gamemodes/ninja/ninja.dm b/code/game/gamemodes/ninja/ninja.dm
index 0358b59aea9..1e281e66f5e 100644
--- a/code/game/gamemodes/ninja/ninja.dm
+++ b/code/game/gamemodes/ninja/ninja.dm
@@ -1,8 +1,8 @@
-/datum/game_mode/ninja
+/decl/game_mode/ninja
name = "Ninja"
round_description = "An agent of the Spider Clan is on board!"
extended_round_description = "A heavily armed, high-tech covert infiltrator is on board pursuing their mysterious goals."
- config_tag = "ninja"
+ uid = "ninja"
required_players = 5
required_enemies = 1
end_on_antag_death = FALSE
diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm
index 652840ba536..663767d11c0 100644
--- a/code/game/gamemodes/nuclear/nuclear.dm
+++ b/code/game/gamemodes/nuclear/nuclear.dm
@@ -4,11 +4,11 @@
var/global/list/nuke_disks = list()
-/datum/game_mode/nuclear
+/decl/game_mode/nuclear
name = "Mercenary"
round_description = "A mercenary strike force is approaching!"
extended_round_description = "A heavily armed merc team is approaching in their warship; whatever their goal is, it can't be good for the crew."
- config_tag = "mercenary"
+ uid = "mercenary"
required_players = 15
required_enemies = 1
end_on_antag_death = FALSE
@@ -22,13 +22,13 @@ var/global/list/nuke_disks = list()
)
//checks if L has a nuke disk on their person
-/datum/game_mode/nuclear/proc/check_mob(mob/living/L)
+/decl/game_mode/nuclear/proc/check_mob(mob/living/L)
for(var/obj/item/disk/nuclear/N in nuke_disks)
if(N.storage_depth(L) >= 0)
return TRUE
return FALSE
-/datum/game_mode/nuclear/declare_completion()
+/decl/game_mode/nuclear/declare_completion()
var/decl/special_role/merc = GET_DECL(/decl/special_role/mercenary)
if(config.objectives_disabled == CONFIG_OBJECTIVE_NONE || (merc && !merc.global_objectives.len))
..()
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index bdf00ce7247..cbd16ae38a8 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -1,6 +1,6 @@
-/datum/game_mode/revolution
+/decl/game_mode/revolution
name = "Revolution"
- config_tag = "revolution"
+ uid = "revolution"
round_description = "Some crewmembers are attempting to start a revolution!"
extended_round_description = "Revolutionaries - Remove the heads of staff from power. Convert other crewmembers to your cause using the 'Convert Bourgeoise' verb. Protect your leaders."
required_players = 4
diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm
index 9203ffcf94b..b87bc25b101 100644
--- a/code/game/gamemodes/traitor/traitor.dm
+++ b/code/game/gamemodes/traitor/traitor.dm
@@ -1,8 +1,8 @@
-/datum/game_mode/traitor
+/decl/game_mode/traitor
name = "traitor"
round_description = "There is a foreign agent or traitor onboard. Do not let the traitor succeed!"
extended_round_description = "Some members of the crew have been suborned, and are acting to meet a secret and traitorous goals of their own."
- config_tag = "traitor"
+ uid = "traitor"
required_players = 0
required_enemies = 1
associated_antags = list(/decl/special_role/traitor)
diff --git a/code/game/gamemodes/wizard/servant_items/champion.dm b/code/game/gamemodes/wizard/servant_items/champion.dm
index 53cb1b5cf8c..ace80ee8685 100644
--- a/code/game/gamemodes/wizard/servant_items/champion.dm
+++ b/code/game/gamemodes/wizard/servant_items/champion.dm
@@ -42,7 +42,7 @@
/obj/item/clothing/shoes/jackboots/medievalboots
name = "leather boots"
desc = "Old-fashioned leather boots. Probably not something you want to get kicked with."
- material = /decl/material/solid/leather
+ material = /decl/material/solid/organic/leather
force = 5
armor = list(
ARMOR_MELEE = ARMOR_MELEE_RESISTANT,
diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm
index b2fbdc10822..4e1d0b54e6c 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -1,8 +1,8 @@
-/datum/game_mode/wizard
+/decl/game_mode/wizard
name = "Wizard"
round_description = "There is a SPACE WIZARD onboard. You can't let the magician achieve their objectives!"
extended_round_description = "A powerful space wizard has made their way on board. They have a wide variety of powers and spells available to them that makes your own simple moral self tremble with fear and excitement. Ultimately, their purpose is unknown. However, it is up to you and your crew to decide if their powers can be used for good or if their arrival foreshadows devastation."
- config_tag = "wizard"
+ uid = "wizard"
required_players = 5
required_enemies = 1
end_on_antag_death = FALSE
diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm
index 525cd14da71..014baac33a1 100644
--- a/code/game/jobs/access.dm
+++ b/code/game/jobs/access.dm
@@ -17,14 +17,43 @@
if(id)
. = id.GetAccess()
-/atom/movable/proc/GetIdCard()
- var/list/cards = GetIdCards()
- return LAZYACCESS(cards, LAZYLEN(cards))
-
-/atom/movable/proc/GetIdCards()
+/atom/movable/proc/GetIdCard(list/exceptions, prefer_held = TRUE)
+ RETURN_TYPE(/obj/item/card/id)
+ . = GetIdCards(exceptions)
+ return LAZYACCESS(., LAZYLEN(.))
+
+// Duplicated logic, because it's short enough to not bother splitting out.
+// Quite gross logic sorry, did not want to work out a proper sorting method :(
+// The logic behind this sorting is that we should prefer ID cards as such:
+// - held cards, because they are very easily shifted dropped etc
+// - equipped cards, because they can also be removed, albeit slower
+// - any remaining cards, because at time of writing they are implanted and
+// can't be removed easily at all.
+/mob/GetIdCard(list/exceptions, prefer_held = TRUE)
+ RETURN_TYPE(/obj/item/card/id)
+ // Get candidate cards, return similar to parent if we don't care
+ . = GetIdCards(exceptions)
+ var/card_count = length(.)
+ if(card_count <= 0)
+ return null
+ if(!prefer_held || card_count == 1)
+ return .[card_count]
+ // Move ID to the end of the list.
+ var/obj/item/id = get_equipped_item(slot_wear_id_str)
+ if(id)
+ . -= id
+ . += id
+ // Move held items to the end of the list (prefer them over equipped ID)
+ for(var/obj/item/card in get_held_items())
+ if(card in .)
+ . -= card
+ . += card
+ return .[length(.)]
+
+/atom/movable/proc/GetIdCards(list/exceptions)
var/datum/extension/access_provider/our_provider = get_extension(src, /datum/extension/access_provider)
if(our_provider)
- LAZYDISTINCTADD(., our_provider.GetIdCards())
+ LAZYDISTINCTADD(., our_provider.GetIdCards(exceptions))
/atom/movable/proc/check_access(atom/movable/A)
return check_access_list(A ? A.GetAccess() : list())
@@ -210,56 +239,6 @@ var/global/list/priv_region_access
"Emergency Response Team",
"Emergency Response Team Leader")
-/mob/observer/ghost
- var/static/obj/item/card/id/all_access/ghost_all_access
-
-/mob/observer/ghost/GetIdCards()
- . = ..()
- if (!is_admin(src))
- return .
-
- if (!ghost_all_access)
- ghost_all_access = new()
- LAZYDISTINCTADD(., ghost_all_access)
-
-/mob/living/bot/GetIdCards()
- . = ..()
- if(istype(botcard))
- LAZYDISTINCTADD(., botcard)
-
-// Gets the ID card of a mob, but will not check types in the exceptions list
-/mob/living/carbon/human/GetIdCard(exceptions = null)
- return LAZYACCESS(GetIdCards(exceptions), 1)
-
-/mob/living/carbon/human/GetIdCards(exceptions = null)
- . = ..()
- var/list/candidates = get_held_items()
- var/id = get_equipped_item(slot_wear_id_str)
- if(id)
- LAZYDISTINCTADD(candidates, id)
- for(var/atom/movable/candidate in candidates)
- if(!candidate || is_type_in_list(candidate, exceptions))
- continue
- var/list/obj/item/card/id/id_cards = candidate.GetIdCards()
- if(LAZYLEN(id_cards))
- LAZYDISTINCTADD(., id_cards)
-
-/mob/living/carbon/human/GetAccess(var/union = TRUE)
- . = ..(union)
-
-/mob/living/silicon/GetIdCards()
- . = ..()
- if(stat || (ckey && !client))
- return // Unconscious, dead or once possessed but now client-less silicons are not considered to have id access.
- if(istype(idcard))
- LAZYDISTINCTADD(., idcard)
-
-/proc/FindNameFromID(var/mob/M, var/missing_id_name = "Unknown")
- var/obj/item/card/id/C = M.GetIdCard()
- if(C)
- return C.registered_name
- return missing_id_name
-
/proc/get_all_job_icons() //For all existing HUD icons
return SSjobs.titles_to_datums + list("Prisoner")
@@ -270,13 +249,13 @@ var/global/list/priv_region_access
var/job_icons = get_all_job_icons()
if(I.assignment in job_icons) //Check if the job has a hud icon
return I.assignment
- if(I.rank in job_icons)
- return I.rank
+ if(I.position in job_icons)
+ return I.position
var/centcom = get_all_centcom_jobs()
if(I.assignment in centcom)
return "Centcom"
- if(I.rank in centcom)
+ if(I.position in centcom)
return "Centcom"
else
return
diff --git a/code/game/jobs/job/_job.dm b/code/game/jobs/job/_job.dm
index 4222150aeea..2931c501d3b 100644
--- a/code/game/jobs/job/_job.dm
+++ b/code/game/jobs/job/_job.dm
@@ -9,7 +9,7 @@
var/current_positions = 0 // How many players have this job
var/availablity_chance = 100 // Percentage chance job is available each round
var/guestbanned = FALSE // If set to 1 this job will be unavalible to guests
- var/must_fill = FALSE // If set to 1 this job will be have priority over other job preferences. Do not reccommend on jobs with more that one position.
+ var/must_fill = FALSE // If set to 1 this job will be have priority over other job preferences. Do not recommend on jobs with more than one position.
var/not_random_selectable = FALSE // If set to 1 this job will not be selected when a player asks for a random job.
var/description // If set, returns a static description. To add dynamic text, overwrite this proc, call parent aka . = ..() and then . += "extra text" on the line after that.
var/list/event_categories // A set of tags used to check jobs for suitability for things like random event selection.
@@ -85,26 +85,15 @@
/datum/job/dd_SortValue()
return title
-/datum/job/proc/equip(var/mob/living/carbon/human/H, var/alt_title, var/datum/mil_branch/branch, var/datum/mil_rank/grade)
-
+/datum/job/proc/equip_job(var/mob/living/carbon/human/H, var/alt_title, var/datum/mil_branch/branch, var/datum/mil_rank/grade)
if (required_language)
H.add_language(required_language)
H.set_default_language(required_language)
-
H.add_language(/decl/language/human/common)
H.set_default_language(/decl/language/human/common)
var/decl/hierarchy/outfit/outfit = get_outfit(H, alt_title, branch, grade)
- if(outfit) . = outfit.equip(H, title, alt_title)
-
- if(!QDELETED(H))
- var/obj/item/card/id/id = H.GetIdCard()
- if(id)
- id.rank = title
- id.assignment = id.rank
- id.access |= get_access()
- if(!id.detail_color)
- id.detail_color = selection_color
- id.update_icon()
+ if(outfit)
+ return outfit.equip_outfit(H, alt_title || title, job = src, rank = grade)
/datum/job/proc/get_outfit(var/mob/living/carbon/human/H, var/alt_title, var/datum/mil_branch/branch, var/datum/mil_rank/grade)
if(alt_title && alt_titles)
@@ -174,13 +163,12 @@
var/decl/hierarchy/outfit/outfit = get_outfit(H, alt_title, branch, grade)
if(!outfit)
return FALSE
- . = outfit.equip(H, title, alt_title, OUTFIT_ADJUSTMENT_SKIP_POST_EQUIP|OUTFIT_ADJUSTMENT_SKIP_ID_PDA|additional_skips)
+ . = outfit.equip_outfit(H, alt_title || title, equip_adjustments = (OUTFIT_ADJUSTMENT_SKIP_POST_EQUIP|OUTFIT_ADJUSTMENT_SKIP_ID_PDA|additional_skips), job = src, rank = grade)
/datum/job/proc/get_access()
if(minimal_access.len && (!config || config.jobs_have_minimal_access))
return minimal_access?.Copy()
- else
- return access?.Copy()
+ return access?.Copy()
//If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1
/datum/job/proc/player_old_enough(client/C)
@@ -451,13 +439,13 @@
spawnpos = null
if(!spawnpos)
// Step through all spawnpoints and pick first appropriate for job
- for(var/decl/spawnpoint/candidate as anything in global.using_map.allowed_spawns)
+ for(var/decl/spawnpoint/candidate as anything in global.using_map.allowed_latejoin_spawns)
if(candidate?.check_job_spawning(src))
spawnpos = candidate
break
return spawnpos
-/datum/job/proc/post_equip_rank(var/mob/person, var/alt_title)
+/datum/job/proc/post_equip_job_title(var/mob/person, var/alt_title, var/rank)
if(is_semi_antagonist && person.mind)
var/decl/special_role/provocateur/provocateurs = GET_DECL(/decl/special_role/provocateur)
provocateurs.add_antagonist(person.mind)
diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm
index e542861cd2e..771dc6e7423 100644
--- a/code/game/jobs/whitelist.dm
+++ b/code/game/jobs/whitelist.dm
@@ -8,7 +8,7 @@ var/global/list/whitelist = list()
return 1
/proc/load_whitelist()
- whitelist = file2list(WHITELISTFILE, FALSE)
+ whitelist = file2list(WHITELISTFILE)
if(!length(whitelist))
whitelist = null
diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm
index 9648d1ab6e4..38c32161aeb 100644
--- a/code/game/machinery/Beacon.dm
+++ b/code/game/machinery/Beacon.dm
@@ -3,8 +3,8 @@
icon_state = "floor_beaconf"
name = "tracking beacon"
desc = "A device that uses zero-point energy to create a permanent tracking beacon."
- level = 1 // underfloor
- anchored = 1
+ level = LEVEL_BELOW_PLATING
+ anchored = TRUE
idle_power_usage = 0
var/obj/item/radio/beacon/beacon
@@ -12,7 +12,7 @@
. = ..()
var/turf/T = get_turf(src)
beacon = new /obj/item/radio/beacon(T)
- beacon.invisibility = INVISIBILITY_MAXIMUM
+ beacon.set_invisibility(INVISIBILITY_MAXIMUM)
hide(!T.is_plating())
diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm
index 8fb51a9348a..049eea19da1 100644
--- a/code/game/machinery/CableLayer.dm
+++ b/code/game/machinery/CableLayer.dm
@@ -2,7 +2,7 @@
name = "automatic cable layer"
icon = 'icons/obj/machines/pipe_dispenser.dmi'
icon_state = "pipe_d"
- density = 1
+ density = TRUE
interact_offline = TRUE
var/obj/structure/cable/last_piece
var/obj/item/stack/cable_coil/cable
diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm
index 706e8e01c61..f06b1cd5057 100644
--- a/code/game/machinery/OpTable.dm
+++ b/code/game/machinery/OpTable.dm
@@ -3,8 +3,8 @@
desc = "Used for advanced medical procedures."
icon = 'icons/obj/surgery.dmi'
icon_state = "table2-idle"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
throwpass = 1
idle_power_usage = 1
active_power_usage = 5
@@ -94,7 +94,7 @@
icon_state = "table2-idle"
if(ishuman(victim))
var/mob/living/carbon/human/H = victim
- if(H.pulse())
+ if(H.get_pulse())
icon_state = "table2-active"
/obj/machinery/optable/Process()
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 19b3b6c4358..f78d4e0d926 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -60,7 +60,7 @@
var/decl/material/reagent = GET_DECL(rid)
for(var/banned_type in banned_chem_types)
if(istype(reagent, banned_type))
- to_chat(user, SPAN_WARNING("Automatic safety checking indicates the present of a prohibited substance in this canister."))
+ to_chat(user, SPAN_WARNING("Automatic safety checking indicates the presence of a prohibited substance in this canister."))
return FALSE
var/mob/M = canister.loc
if(istype(M) && !M.try_unequip(canister, src))
@@ -79,6 +79,16 @@
to_chat(user, SPAN_NOTICE("You remove \the [canister] from \the [src]."))
return TRUE
+/obj/machinery/sleeper/proc/eject_all_reagent_canisters()
+ for(var/obj/item/canister in loaded_canisters)
+ canister.dropInto(loc)
+ LAZYCLEARLIST(loaded_canisters)
+
+/obj/machinery/sleeper/dismantle()
+ eject_all_reagent_canisters()
+ remove_beaker()
+ return ..()
+
/obj/machinery/sleeper/get_contained_external_atoms()
. = ..()
LAZYREMOVE(., loaded_canisters)
@@ -112,35 +122,47 @@
else
to_chat(user, SPAN_NOTICE("There are no chemical canisters loaded."))
+/obj/machinery/sleeper/proc/has_room_in_beaker()
+ return beaker && beaker.reagents.total_volume < beaker.reagents.maximum_volume
+
/obj/machinery/sleeper/Process()
if(stat & (NOPOWER|BROKEN))
return
- if(filtering > 0)
- if(beaker)
- if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
- var/pumped = LAZYLEN(occupant.reagents?.reagent_volumes)
- if(pumped)
- occupant.reagents.trans_to_obj(beaker, pump_speed * pumped)
- occupant.vessel.trans_to_obj(beaker, pumped + 1)
+ if(!istype(occupant))
+ if(filtering)
+ toggle_filter()
+ if(pump)
+ toggle_pump()
+ if(lavage)
+ toggle_lavage()
+ return
+
+ if(filtering)
+ if(has_room_in_beaker())
+ var/trans_volume = LAZYLEN(occupant.reagents?.reagent_volumes)
+ if(trans_volume)
+ occupant.reagents.trans_to_obj(beaker, pump_speed * trans_volume)
+ occupant.vessel.trans_to_obj(beaker, trans_volume + 1)
else
toggle_filter()
- if(pump > 0)
- if(beaker && istype(occupant))
- if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
- var/datum/reagents/ingested = occupant.get_ingested_reagents()
- if(ingested)
- var/trans_amt = LAZYLEN(ingested.reagent_volumes)
- if(trans_amt)
- ingested.trans_to_obj(beaker, pump_speed * trans_amt)
+
+ if(pump)
+ if(has_room_in_beaker())
+ var/datum/reagents/ingested = occupant.get_ingested_reagents()
+ if(ingested)
+ var/trans_volume = LAZYLEN(ingested.reagent_volumes)
+ if(trans_volume)
+ ingested.trans_to_obj(beaker, pump_speed * trans_volume)
else
toggle_pump()
+
if(lavage)
- if(beaker?.reagents)
- if (beaker.reagents.total_volume < beaker.reagents.maximum_volume)
- var/datum/reagents/inhaled = occupant.get_inhaled_reagents()
+ if(has_room_in_beaker())
+ var/datum/reagents/inhaled = occupant.get_inhaled_reagents()
+ if(inhaled)
var/trans_volume = LAZYLEN(inhaled?.reagent_volumes)
- if(inhaled && trans_volume)
+ if(trans_volume)
inhaled.trans_to_obj(beaker, pump_speed * trans_volume)
else
toggle_lavage()
diff --git a/code/game/machinery/_machines_base/machinery.dm b/code/game/machinery/_machines_base/machinery.dm
index a8c7a4badf0..70f7aeca353 100644
--- a/code/game/machinery/_machines_base/machinery.dm
+++ b/code/game/machinery/_machines_base/machinery.dm
@@ -400,7 +400,7 @@ Class Procs:
/obj/machinery/CouldUseTopic(var/mob/user)
..()
- if(clicksound && istype(user, /mob/living/carbon))
+ if(clicksound && iscarbon(user))
playsound(src, clicksound, clickvol)
/obj/machinery/proc/display_parts(mob/user)
@@ -444,7 +444,7 @@ Class Procs:
// This is really pretty crap and should be overridden for specific machines.
/obj/machinery/fluid_act(var/datum/reagents/fluids)
..()
- if(!(stat & (NOPOWER|BROKEN)) && !waterproof && (fluids.total_volume > FLUID_DEEP))
+ if(!QDELETED(src) && !(stat & (NOPOWER|BROKEN)) && !waterproof && (fluids?.total_volume > FLUID_DEEP))
explosion_act(3)
/obj/machinery/Move()
@@ -460,15 +460,6 @@ Class Procs:
if(battery && (!functional_only || battery.is_functional()))
return battery.get_cell()
-/obj/machinery/building_cost()
- . = ..()
- var/list/component_types = types_of_component(/obj/item/stock_parts)
- for(var/path in component_types)
- var/obj/item/stock_parts/part = get_component_of_type(path)
- var/list/part_costs = part.building_cost()
- for(var/key in part_costs)
- .[key] += part_costs[key] * component_types[path]
-
/obj/machinery/emag_act(remaining_charges, mob/user, emag_source)
. = ..()
for(var/obj/item/stock_parts/access_lock/lock in get_all_components_of_type(/obj/item/stock_parts/access_lock))
@@ -489,8 +480,12 @@ Class Procs:
// This only includes external atoms by default, so we need to add components back.
/obj/machinery/get_contained_matter()
. = ..()
- for(var/obj/component in component_parts)
- . = MERGE_ASSOCS_WITH_NUM_VALUES(., component.get_contained_matter())
+ 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()
+ for(var/key in part_costs)
+ .[key] += part_costs[key] * component_types[path]
/obj/machinery/proc/get_auto_access()
var/area/A = get_area(src)
@@ -502,4 +497,11 @@ Class Procs:
///Handles updating stock parts and internal id tag when changing it to something else
/obj/machinery/proc/set_id_tag(var/new_id_tag)
id_tag = new_id_tag
- //#TODO: Add handling for components, when we're sure it will work for any kind of machinery. Some machines do not use the same id_tag on receiver and transmitters for example.
\ No newline at end of file
+ //#TODO: Add handling for components, when we're sure it will work for any kind of machinery. Some machines do not use the same id_tag on receiver and transmitters for example.
+
+// Make sure that mapped subtypes get the right codex entry.
+/obj/machinery/get_codex_value()
+ return base_type || ..()
+
+/obj/machinery/solvent_can_melt(var/solvent_power = MAT_SOLVENT_STRONG)
+ return FALSE
diff --git a/code/game/machinery/_machines_base/machinery_damage.dm b/code/game/machinery/_machines_base/machinery_damage.dm
index a8e43425260..8c7953186f9 100644
--- a/code/game/machinery/_machines_base/machinery_damage.dm
+++ b/code/game/machinery/_machines_base/machinery_damage.dm
@@ -30,8 +30,11 @@
// And lastly hit the circuitboard
victim = get_component_of_type(/obj/item/stock_parts/circuitboard)
- if(victim)
- victim.take_damage(amount, damtype)
+ if(victim?.can_take_damage() && victim.is_functional())
+ amount -= victim.take_damage(amount, damtype)
+
+ if(amount && (damtype == BRUTE || damtype == BURN))
+ dismantle()
/obj/machinery/proc/get_damageable_component(var/damage_type)
var/list/victims = shuffle(component_parts)
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 14aa1aea81d..615a39b9a85 100644
--- a/code/game/machinery/_machines_base/stock_parts/building_material.dm
+++ b/code/game/machinery/_machines_base/stock_parts/building_material.dm
@@ -33,23 +33,32 @@
new_material.forceMove(null)
// amount will cap the amount given in a stack, but may return less than amount specified.
-/obj/item/stock_parts/building_material/proc/remove_material(material_type, amount)
+/obj/item/stock_parts/building_material/proc/remove_material(material_type, amount, force_destination)
if(ispath(material_type, /obj/item/stack))
for(var/obj/item/stack/stack in materials)
if(stack.stack_merge_type == material_type)
var/stack_amount = stack.get_amount()
if(stack_amount <= amount)
materials -= stack
- stack.dropInto(loc)
+ if(force_destination)
+ stack.forceMove(force_destination)
+ else
+ stack.dropInto(loc)
amount -= stack_amount
return stack
var/obj/item/stack/new_stack = stack.split(amount)
- new_stack.dropInto(loc)
+ if(force_destination)
+ new_stack.forceMove(force_destination)
+ else
+ new_stack.dropInto(loc)
return new_stack
for(var/obj/item/item in materials)
if(istype(item, material_type))
materials -= item
- item.dropInto(loc)
+ if(force_destination)
+ item.forceMove(force_destination)
+ else
+ item.dropInto(loc)
return item
/obj/item/stock_parts/building_material/on_uninstall(var/obj/machinery/machine)
@@ -58,9 +67,9 @@
materials = null
..()
-/obj/item/stock_parts/building_material/building_cost()
+/obj/item/stock_parts/building_material/get_contained_matter()
. = ..()
for(var/obj/item/thing in materials)
- var/list/costs = thing.building_cost()
+ var/list/costs = thing.get_contained_matter()
for(var/key in costs)
- .[key] += costs[key]
\ No newline at end of file
+ .[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 f3ee37f8c8c..fb8b1fe8d34 100644
--- a/code/game/machinery/_machines_base/stock_parts/card_reader.dm
+++ b/code/game/machinery/_machines_base/stock_parts/card_reader.dm
@@ -7,7 +7,7 @@
desc = "A RFID card reader for various authentication or data sharing usages."
icon = 'icons/obj/items/stock_parts/modular_components.dmi'
icon_state = "cardreader"
- material = /decl/material/solid/plastic
+ material = /decl/material/solid/organic/plastic
matter = list(
/decl/material/solid/metal/steel = MATTER_AMOUNT_TRACE,
/decl/material/solid/metal/copper = MATTER_AMOUNT_TRACE,
diff --git a/code/game/machinery/_machines_base/stock_parts/disk_reader.dm b/code/game/machinery/_machines_base/stock_parts/disk_reader.dm
index 1a0ce05bd05..eb6a5b8fe72 100644
--- a/code/game/machinery/_machines_base/stock_parts/disk_reader.dm
+++ b/code/game/machinery/_machines_base/stock_parts/disk_reader.dm
@@ -7,7 +7,7 @@
desc = "A floppy disk drive for installation in most machines. Able to read most floppy disks."
icon = 'icons/obj/items/stock_parts/modular_components.dmi'
icon_state = "floppy_drive"
- material = /decl/material/solid/plastic
+ material = /decl/material/solid/organic/plastic
matter = list(
/decl/material/solid/metal/steel = MATTER_AMOUNT_SECONDARY,
/decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT,
diff --git a/code/game/machinery/_machines_base/stock_parts/money_printer.dm b/code/game/machinery/_machines_base/stock_parts/money_printer.dm
index 8be3830fce5..f48e3c060b8 100644
--- a/code/game/machinery/_machines_base/stock_parts/money_printer.dm
+++ b/code/game/machinery/_machines_base/stock_parts/money_printer.dm
@@ -2,7 +2,7 @@
name = "cryptographic micro-printer"
desc = "A micro-printer capable of scanning, recycling, and printing cryptographically secured bank notes on ultra thin plastic."
icon_state = "printer"
- material = /decl/material/solid/plastic
+ material = /decl/material/solid/organic/plastic
matter = list(
/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT,
/decl/material/solid/silicon = MATTER_AMOUNT_REINFORCEMENT
@@ -19,7 +19,7 @@
/obj/item/stock_parts/computer/money_printer/attackby(obj/item/W, mob/user)
. = ..()
- if(istype(W, /obj/item/stack/material) && W.get_material_type() == /decl/material/solid/plastic)
+ if(istype(W, /obj/item/stack/material) && W.get_material_type() == /decl/material/solid/organic/plastic)
var/obj/item/stack/material/stack = W
stored_plastic += SHEET_MATERIAL_AMOUNT * stack.amount
@@ -29,7 +29,7 @@
if(IS_SCREWDRIVER(W) && !istype(loc, /obj/machinery))
to_chat(user, "You pry out the plastic reserves of \the [src].")
- SSmaterials.create_object(/decl/material/solid/plastic, get_turf(src), round(stored_plastic / SHEET_MATERIAL_AMOUNT))
+ SSmaterials.create_object(/decl/material/solid/organic/plastic, get_turf(src), round(stored_plastic / SHEET_MATERIAL_AMOUNT))
stored_plastic = 0
if(istype(W, /obj/item/cash))
@@ -41,7 +41,7 @@
return
var/obj/item/cash/receiving = W
var/decl/currency/receiving_currency = GET_DECL(receiving.currency)
- if(receiving_currency.material != /decl/material/solid/plastic)
+ if(receiving_currency.material != /decl/material/solid/organic/plastic)
to_chat(user, SPAN_WARNING("\The [src] cannot accept cash of this currency!"))
return
@@ -62,7 +62,7 @@
return FALSE
// TODO: Support for non-plastic currencies
var/decl/currency/printed_currency = GET_DECL(currency_type)
- if(printed_currency.material != /decl/material/solid/plastic)
+ if(printed_currency.material != /decl/material/solid/organic/plastic)
return FALSE
return (stored_plastic >= amount*max(1, round(SHEET_MATERIAL_AMOUNT/10)))
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 fda2c356b7d..b1ac9b50f09 100644
--- a/code/game/machinery/_machines_base/stock_parts/power/battery.dm
+++ b/code/game/machinery/_machines_base/stock_parts/power/battery.dm
@@ -136,10 +136,9 @@
/obj/item/stock_parts/power/battery/on_refresh(var/obj/machinery/machine)
if(machine && !cell)
var/obj/item/stock_parts/building_material/mat = machine.get_component_of_type(/obj/item/stock_parts/building_material)
- var/obj/item/cell/cell = mat && mat.remove_material(/obj/item/cell, 1)
+ var/obj/item/cell/cell = mat && mat.remove_material(/obj/item/cell, 1, src)
if(cell)
add_cell(machine, cell)
- cell.forceMove(src)
charge_rate = initial(charge_rate)
charge_rate *= 1 + 0.5 * machine.total_component_rating_of_type(/obj/item/stock_parts/capacitor)
@@ -183,7 +182,7 @@
return ..()
/obj/item/stock_parts/power/battery/attack_hand(mob/user)
- if(cell && istype(loc, /obj/machinery) && user.check_dexterity(DEXTERITY_GRIP))
+ if(cell && istype(loc, /obj/machinery) && user.check_dexterity(DEXTERITY_HOLD_ITEM))
user.put_in_hands(cell)
extract_cell(user)
return TRUE
@@ -226,7 +225,7 @@
material = /decl/material/solid/metal/steel
matter = list(
/decl/material/solid/metal/aluminium = MATTER_AMOUNT_REINFORCEMENT,
- /decl/material/solid/plastic = MATTER_AMOUNT_TRACE
+ /decl/material/solid/organic/plastic = MATTER_AMOUNT_TRACE
)
/obj/item/stock_parts/power/battery/buildable/turbo/get_lore_info()
@@ -241,7 +240,7 @@
material = /decl/material/solid/metal/steel
matter = list(
/decl/material/solid/metal/aluminium = MATTER_AMOUNT_REINFORCEMENT,
- /decl/material/solid/plastic = MATTER_AMOUNT_TRACE
+ /decl/material/solid/organic/plastic = MATTER_AMOUNT_TRACE
)
/obj/item/stock_parts/power/battery/buildable/responsive/get_lore_info()
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 f982ee7f31c..8372665d500 100644
--- a/code/game/machinery/_machines_base/stock_parts/power/terminal.dm
+++ b/code/game/machinery/_machines_base/stock_parts/power/terminal.dm
@@ -180,7 +180,7 @@
expected_part_type = /obj/item/stock_parts/power/terminal
/decl/stock_part_preset/terminal_setup/apply(obj/machinery/machine, var/obj/item/stock_parts/power/terminal/part)
- if(isturf(machine.loc))
+ if(isturf(machine.loc) && machine.anchored)
part.make_terminal(machine)
//Offset terminals towards the owner's facing direction
diff --git a/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm b/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm
index 67d06b18aec..3ea9f96f1fa 100644
--- a/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm
+++ b/code/game/machinery/_machines_base/stock_parts/radio/transmitter.dm
@@ -4,6 +4,9 @@
icon_state = "transmitter"
var/range = 60 // Limits transmit range
var/latency = 2 // Delay between event and transmission; doesn't apply to transmit on tick
+ #ifdef UNIT_TEST
+ latency = 0 // this can slow down testing and cause random inconsistent failures
+ #endif
var/buffer
/obj/item/stock_parts/radio/transmitter/proc/queue_transmit(list/data)
@@ -11,7 +14,10 @@
return
if(!buffer)
buffer = data
- addtimer(CALLBACK(src, .proc/transmit), latency)
+ if(latency)
+ addtimer(CALLBACK(src, .proc/transmit), latency)
+ else
+ transmit()
else
buffer |= data
diff --git a/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm b/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm
index d43c4bbf012..22b01cce5db 100644
--- a/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm
+++ b/code/game/machinery/_machines_base/stock_parts/stock_parts_interface.dm
@@ -23,7 +23,7 @@
desc = "A standard part required by many machines to recieve user input."
icon_state = "input"
origin_tech = "{'materials':1}"
- material = /decl/material/solid/plastic
+ material = /decl/material/solid/organic/plastic
base_type = /obj/item/stock_parts/keyboard
part_flags = PART_FLAG_HAND_REMOVE
w_class = ITEM_SIZE_TINY
@@ -33,4 +33,3 @@
..()
if(is_functional())
machine.set_noinput(FALSE)
-
\ No newline at end of file
diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm
index fb0e422cbed..d09354e7bd3 100644
--- a/code/game/machinery/ai_slipper.dm
+++ b/code/game/machinery/ai_slipper.dm
@@ -2,7 +2,7 @@
name = "\improper AI Liquid Dispenser"
icon = 'icons/obj/items/device/motion_detector.dmi'
icon_state = "motion0"
- anchored = 1.0
+ anchored = TRUE
idle_power_usage = 10
var/uses = 20
var/disabled = 1
@@ -26,7 +26,7 @@
/obj/machinery/ai_slipper/attackby(obj/item/W, mob/user)
if(stat & (NOPOWER|BROKEN))
return
- if (istype(user, /mob/living/silicon))
+ if (issilicon(user))
return attack_ai(user)
else // trying to unlock the interface
if(allowed(user))
@@ -52,7 +52,7 @@
return
var/t = "AI Liquid Dispenser ([area.proper_name]) "
- if(src.locked && (!istype(user, /mob/living/silicon)))
+ if(src.locked && (!issilicon(user)))
t += "(Swipe ID card to unlock control panel.) "
else
t += text("Dispenser [] - []? \n", src.disabled?"deactivated":"activated", src, src.disabled?"Enable":"Disable")
diff --git a/code/game/machinery/air_sensor.dm b/code/game/machinery/air_sensor.dm
index e7daf84e268..aa53b70818e 100644
--- a/code/game/machinery/air_sensor.dm
+++ b/code/game/machinery/air_sensor.dm
@@ -11,7 +11,7 @@
public_variables = list(
/decl/public_access/public_variable/gas,
/decl/public_access/public_variable/pressure,
- /decl/public_access/public_variable/temperature
+ /decl/public_access/public_variable/temperature
)
stock_part_presets = list(/decl/stock_part_preset/radio/basic_transmitter/air_sensor = 1)
use_power = POWER_USE_IDLE
@@ -47,7 +47,7 @@
return
. = list()
for(var/gas in air_sample.gas)
- var/decl/material/mat = GET_DECL(gas)
+ var/decl/material/mat = GET_DECL(gas)
var/gaspercent = round(air_sample.gas[gas]*100/total_moles,0.01)
var/gas_list = list("symbol" = mat.gas_symbol_html, "percent" = gaspercent)
. += list(gas_list)
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 374f7131c46..5a82cc55e3a 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -47,7 +47,7 @@
name = BASE_ALARM_NAME
icon = 'icons/obj/monitors.dmi'
icon_state = "alarm0"
- anchored = 1
+ anchored = TRUE
idle_power_usage = 80
active_power_usage = 1000 //For heating/cooling rooms. 1000 joules equates to about 1 degree every 2 seconds for a single tile of air.
power_channel = ENVIRON
@@ -941,7 +941,7 @@ FIRE ALARM
var/d2
var/decl/security_state/security_state = GET_DECL(global.using_map.security_state)
- if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon))
+ if (ishuman(user) || issilicon(user) || isobserver(user))
A = A.loc
if (A.fire)
@@ -1051,7 +1051,7 @@ FIRE ALARM
ASSERT(isarea(A))
var/d1
var/d2
- if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
+ if (ishuman(user) || isAI(user))
if (A.party)
d1 = text("No Party :(", src)
diff --git a/code/game/machinery/atmoalter/_atmos_connection.dm b/code/game/machinery/atmoalter/_atmos_connection.dm
new file mode 100644
index 00000000000..32abc3ea478
--- /dev/null
+++ b/code/game/machinery/atmoalter/_atmos_connection.dm
@@ -0,0 +1,92 @@
+// Extension for allowing an atom to be connected to an atmospherics connector port.
+/datum/extension/atmospherics_connection
+ expected_type = /atom/movable
+ base_type = /datum/extension/atmospherics_connection
+
+ var/toggle_anchor // Whether to toggle anchor holder on connect/disconnect
+ var/obj/machinery/atmospherics/portables_connector/connected_port
+
+ var/datum/gas_mixture/merged_mixture
+
+/datum/extension/atmospherics_connection/New(datum/holder, _toggle_anchor, _merged_mixture)
+ . = ..()
+ toggle_anchor = _toggle_anchor
+ merged_mixture = _merged_mixture
+
+/datum/extension/atmospherics_connection/Destroy()
+ merged_mixture = null
+ disconnect()
+ . = ..()
+
+/datum/extension/atmospherics_connection/proc/connect(obj/machinery/atmospherics/portables_connector/new_port)
+ //Make sure not already connected to something else
+ if(connected_port || !new_port || new_port.connected_device)
+ return FALSE
+
+ var/atom/movable/movable_holder = holder
+
+ //Make sure are close enough for a valid connection
+ if(new_port.loc != movable_holder.loc)
+ return FALSE
+
+ //Perform the connection
+ connected_port = new_port
+ connected_port.connected_device = holder
+ connected_port.on = 1 //Activate port updates
+
+ if(toggle_anchor)
+ movable_holder.anchored = TRUE //Prevent movement
+
+ //Actually enforce the air sharing
+ var/datum/pipe_network/network = connected_port.return_network(holder)
+
+ if(network && !network.gases.Find(merged_mixture))
+ network.gases += merged_mixture
+ network.update = 1
+
+ return TRUE
+
+/datum/extension/atmospherics_connection/proc/disconnect()
+ if(!connected_port)
+ return FALSE
+
+ var/datum/pipe_network/network = connected_port.return_network(holder)
+ if(network)
+ network.gases -= merged_mixture
+
+ var/atom/movable/movable_holder = holder
+
+ if(toggle_anchor)
+ movable_holder.anchored = FALSE
+
+ connected_port.connected_device = null
+ connected_port = null
+
+ return TRUE
+
+/datum/extension/atmospherics_connection/proc/update_connected_network()
+ if(!connected_port)
+ return
+
+ var/datum/pipe_network/network = connected_port.return_network(holder)
+ if(network)
+ network.update = 1
+
+/datum/extension/atmospherics_connection/proc/update_merged_mixture(datum/gas_mixture/new_mixture)
+ if(merged_mixture == new_mixture)
+ return TRUE
+
+ if(!connected_port)
+ return FALSE
+
+ var/datum/pipe_network/network = connected_port.return_network(holder)
+
+ if(!network)
+ return FALSE
+
+ network.gases.Remove(merged_mixture)
+ if(!network.gases.Find(new_mixture))
+ network.gases += new_mixture
+
+ network.update = 1
+ return TRUE
\ No newline at end of file
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 882ae584215..fc10ef624ba 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -2,7 +2,7 @@
name = "\improper Canister: \[CAUTION\]"
icon = 'icons/obj/atmos.dmi'
icon_state = "yellow"
- density = 1
+ density = TRUE
var/health = 100.0
obj_flags = OBJ_FLAG_CONDUCTIBLE
w_class = ITEM_SIZE_GARGANTUAN
@@ -117,7 +117,7 @@
update_flag = 0
if(holding)
update_flag |= 1
- if(connected_port)
+ if(get_port())
update_flag |= 2
var/tank_pressure = return_pressure()
@@ -268,7 +268,7 @@ update_flag
healthcheck()
/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/W, var/mob/user)
- if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/tank/jetpack))
+ if(isrobot(user) && istype(W, /obj/item/tank/jetpack))
var/obj/item/tank/jetpack/pack = W
var/datum/gas_mixture/thejetpack = pack.air_contents
if(!thejetpack)
@@ -298,7 +298,7 @@ update_flag
var/data[0]
data["name"] = name
data["canLabel"] = can_label ? 1 : 0
- data["portConnected"] = connected_port ? 1 : 0
+ data["portConnected"] = get_port() ? 1 : 0
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(release_pressure ? release_pressure : 0)
data["minReleasePressure"] = round(0.1 ATM)
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index b2ba91ecd8e..45aa2558c24 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/meter.dmi'
icon_state = "meterX"
var/atom/target = null //A pipe for the base type
- anchored = 1.0
+ anchored = TRUE
power_channel = ENVIRON
idle_power_usage = 15
@@ -81,7 +81,7 @@
/obj/machinery/meter/examine(mob/user, distance)
. = ..()
- if(distance > 3 && !(istype(user, /mob/living/silicon/ai) || isghost(user)))
+ if(distance > 3 && !(isAI(user) || isghost(user)))
to_chat(user, "You are too far away to read it.")
else if(stat & (NOPOWER|BROKEN))
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index 696585a9fbd..a046dde2a97 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -5,7 +5,6 @@
atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE
var/datum/gas_mixture/air_contents = new
- var/obj/machinery/atmospherics/portables_connector/connected_port
var/obj/item/tank/holding
var/volume = 0
var/destroyed = 0
@@ -22,6 +21,10 @@
..()
air_contents.volume = volume
air_contents.temperature = T20C
+
+
+ set_extension(src, /datum/extension/atmospherics_connection, TRUE, air_contents)
+
return INITIALIZE_HINT_LATELOAD
/obj/machinery/portable_atmospherics/Destroy()
@@ -32,12 +35,13 @@
/obj/machinery/portable_atmospherics/LateInitialize()
var/obj/machinery/atmospherics/portables_connector/port = locate() in loc
if(port)
- connect(port)
- update_icon()
+ var/datum/extension/atmospherics_connection/connection = get_extension(src, /datum/extension/atmospherics_connection)
+ if(connection)
+ connection.connect(port)
+ update_icon()
/obj/machinery/portable_atmospherics/Process()
- if(!connected_port) //only react when pipe_network will ont it do it for you
- //Allow for reactions
+ if(get_port()) // Only react when pipe_network will not do it for you
air_contents.react()
else
update_icon()
@@ -53,52 +57,24 @@
/obj/machinery/portable_atmospherics/on_update_icon()
return null
-/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/portables_connector/new_port)
- //Make sure not already connected to something else
- if(connected_port || !new_port || new_port.connected_device)
- return 0
-
- //Make sure are close enough for a valid connection
- if(new_port.loc != loc)
- return 0
+/obj/machinery/portable_atmospherics/proc/get_port()
+ var/datum/extension/atmospherics_connection/connection = get_extension(src, /datum/extension/atmospherics_connection)
- //Perform the connection
- connected_port = new_port
- connected_port.connected_device = src
- connected_port.on = 1 //Activate port updates
+ return connection?.connected_port
- anchored = 1 //Prevent movement
-
- //Actually enforce the air sharing
- var/datum/pipe_network/network = connected_port.return_network(src)
- if(network && !network.gases.Find(air_contents))
- network.gases += air_contents
- network.update = 1
+/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/portables_connector/new_port)
+ var/datum/extension/atmospherics_connection/connection = get_extension(src, /datum/extension/atmospherics_connection)
- return 1
+ return connection?.connect(new_port)
/obj/machinery/portable_atmospherics/proc/disconnect()
- if(!connected_port)
- return 0
-
- var/datum/pipe_network/network = connected_port.return_network(src)
- if(network)
- network.gases -= air_contents
-
- anchored = 0
+ var/datum/extension/atmospherics_connection/connection = get_extension(src, /datum/extension/atmospherics_connection)
- connected_port.connected_device = null
- connected_port = null
-
- return 1
+ return connection?.disconnect()
/obj/machinery/portable_atmospherics/proc/update_connected_network()
- if(!connected_port)
- return
-
- var/datum/pipe_network/network = connected_port.return_network(src)
- if (network)
- network.update = 1
+ var/datum/extension/atmospherics_connection/connection = get_extension(src, /datum/extension/atmospherics_connection)
+ connection?.update_connected_network()
/obj/machinery/portable_atmospherics/attackby(var/obj/item/W, var/mob/user)
if ((istype(W, /obj/item/tank) && !( src.destroyed )))
@@ -111,8 +87,7 @@
return
else if(IS_WRENCH(W) && !panel_open)
- if(connected_port)
- disconnect()
+ if(disconnect())
to_chat(user, "You disconnect \the [src] from the port.")
update_icon()
return
diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm
index 0f6231de021..97fb22a99b3 100644
--- a/code/game/machinery/atmoalter/pump.dm
+++ b/code/game/machinery/atmoalter/pump.dm
@@ -3,7 +3,7 @@
icon = 'icons/obj/atmos.dmi'
icon_state = "psiphon:0"
- density = 1
+ density = TRUE
w_class = ITEM_SIZE_NORMAL
base_type = /obj/machinery/portable_atmospherics/powered/pump
atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE
@@ -40,7 +40,7 @@
if(holding)
overlays += "siphon-open"
- if(connected_port)
+ if(get_port())
overlays += "siphon-connector"
/obj/machinery/portable_atmospherics/powered/pump/emp_act(severity)
@@ -112,7 +112,7 @@
/obj/machinery/portable_atmospherics/powered/pump/ui_interact(mob/user, ui_key = "rcon", datum/nanoui/ui=null, force_open=1)
var/list/data[0]
var/obj/item/cell/cell = get_cell()
- data["portConnected"] = connected_port ? 1 : 0
+ data["portConnected"] = get_port() ? 1 : 0
data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)
data["targetpressure"] = round(target_pressure)
data["pump_dir"] = direction_out
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index 49ab66a4e1b..cd1ca3705e9 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -3,7 +3,7 @@
icon = 'icons/obj/atmos.dmi'
icon_state = "pscrubber:0"
- density = 1
+ density = TRUE
w_class = ITEM_SIZE_NORMAL
base_type = /obj/machinery/portable_atmospherics/powered/scrubber
atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE
@@ -49,7 +49,7 @@
if(holding)
overlays += "scrubber-open"
- if(connected_port)
+ if(get_port())
overlays += "scrubber-connector"
/obj/machinery/portable_atmospherics/powered/scrubber/Process()
@@ -95,7 +95,7 @@
/obj/machinery/portable_atmospherics/powered/scrubber/ui_interact(mob/user, ui_key = "rcon", datum/nanoui/ui=null, force_open=1)
var/list/data[0]
var/obj/item/cell/cell = get_cell()
- data["portConnected"] = connected_port ? 1 : 0
+ data["portConnected"] = get_port() ? 1 : 0
data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)
data["rate"] = round(volume_rate)
data["minrate"] = round(minrate)
@@ -148,9 +148,9 @@
//Huge scrubber
/obj/machinery/portable_atmospherics/powered/scrubber/huge
- name = "Huge Air Scrubber"
+ name = "huge air scrubber"
icon_state = "scrubber:0"
- anchored = 1
+ anchored = TRUE
volume = 50000
volume_rate = 5000
base_type = /obj/machinery/portable_atmospherics/powered/scrubber/huge
@@ -200,7 +200,7 @@
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary
- name = "Stationary Air Scrubber"
+ 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)
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index dabbf6cfa12..a4210bcb185 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -9,8 +9,8 @@
desc = ""
icon = 'icons/obj/biogenerator.dmi'
icon_state = "biogen-stand"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 40
base_type = /obj/machinery/biogenerator
construct_state = /decl/machine_construction/default/panel_closed
@@ -59,6 +59,7 @@
. = ..()
/obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well.
+ ..()
update_icon()
/obj/machinery/biogenerator/on_update_icon()
diff --git a/code/game/machinery/bodyscanner.dm b/code/game/machinery/bodyscanner.dm
index 23d02f7359f..b236e2d5bd3 100644
--- a/code/game/machinery/bodyscanner.dm
+++ b/code/game/machinery/bodyscanner.dm
@@ -5,8 +5,8 @@
name = "Body Scanner"
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "body_scanner_0"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 60
active_power_usage = 10000 //10 kW. It's a big all-body scanner.
construct_state = /decl/machine_construction/default/panel_closed
diff --git a/code/game/machinery/bodyscanner_console.dm b/code/game/machinery/bodyscanner_console.dm
index 397fc05db08..f6aa9afebe7 100644
--- a/code/game/machinery/bodyscanner_console.dm
+++ b/code/game/machinery/bodyscanner_console.dm
@@ -4,12 +4,11 @@
name = "Body Scanner Console"
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "body_scannerconsole"
- density = 0
- anchored = 1
+ density = FALSE
+ anchored = TRUE
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
stat_immune = 0
- var/list/display_tags = list()
var/list/connected_displays = list()
var/list/data = list()
@@ -36,7 +35,7 @@
/obj/machinery/body_scanconsole/proc/FindDisplays()
for(var/obj/machinery/body_scan_display/D in SSmachines.machinery)
- if(D.tag in display_tags)
+ if(D.id_tag == connected.id_tag)
connected_displays += D
events_repository.register(/decl/observ/destroyed, D, src, .proc/remove_display)
return !!connected_displays.len
@@ -107,7 +106,7 @@
to_chat(user, "[html_icon(src)]Error: No scan stored.")
return TOPIC_REFRESH
var/list/scan = data["scan"]
- new /obj/item/paper/bodyscan(loc, "Printout error.", "Body scan report - [stored_scan_subject]", scan.Copy())
+ new /obj/item/paper/bodyscan(loc, null, "Printout error.", "Body scan report - [stored_scan_subject]", scan.Copy())
return TOPIC_REFRESH
if(href_list["push"])
diff --git a/code/game/machinery/bodyscanner_display.dm b/code/game/machinery/bodyscanner_display.dm
index 0643635724e..e70446dc677 100644
--- a/code/game/machinery/bodyscanner_display.dm
+++ b/code/game/machinery/bodyscanner_display.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/modular_computers/modular_telescreen.dmi'
icon_state = "telescreen"
anchored = TRUE
- density = 0
+ density = FALSE
idle_power_usage = 75
active_power_usage = 300
construct_state = /decl/machine_construction/default/panel_closed
@@ -19,18 +19,25 @@
/obj/machinery/body_scan_display/proc/add_new_scan(var/list/scan)
bodyscans += list(scan.Copy())
updateUsrDialog()
+ queue_icon_update()
/obj/machinery/body_scan_display/on_update_icon()
. = ..()
cut_overlays()
if(!(stat & (BROKEN|NOPOWER)))
- add_overlay("operating")
+ if (selected != 0)
+ add_overlay("operating")
+ else if (bodyscans.len > 0)
+ add_overlay("menu")
+ else
+ add_overlay("standby")
/obj/machinery/body_scan_display/OnTopic(mob/user, href_list)
if(href_list["view"])
var/selection = text2num(href_list["view"])
if(is_valid_index(selection, bodyscans))
selected = selection
+ queue_icon_update()
return TOPIC_REFRESH
return TOPIC_HANDLED
if(href_list["delete"])
@@ -39,6 +46,7 @@
return TOPIC_HANDLED
if(selected == selection)
selected = 0
+ queue_icon_update()
else if(selected > selection)
selected--
bodyscans -= list(bodyscans[selection])
diff --git a/code/game/machinery/buttons.dm b/code/game/machinery/buttons.dm
index 850dc4bb7a6..97c7529dcfe 100644
--- a/code/game/machinery/buttons.dm
+++ b/code/game/machinery/buttons.dm
@@ -3,7 +3,7 @@
icon = 'icons/obj/objects.dmi'
icon_state = "launcherbtt"
desc = "A remote control switch for something."
- anchored = 1
+ anchored = TRUE
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
layer = ABOVE_WINDOW_LAYER
power_channel = ENVIRON
@@ -47,8 +47,7 @@
/obj/machinery/button/interface_interact(user)
if(!CanInteract(user, DefaultTopicState()))
return FALSE
- if(istype(user, /mob/living/carbon))
- playsound(src, "button", 60)
+ playsound(src, "button", 60)
activate(user)
return TRUE
diff --git a/code/game/machinery/camera/_camera_device.dm b/code/game/machinery/camera/_camera_device.dm
index aba5e522a61..6fa7a539f25 100644
--- a/code/game/machinery/camera/_camera_device.dm
+++ b/code/game/machinery/camera/_camera_device.dm
@@ -12,7 +12,7 @@
var/xray_enabled = FALSE
has_commands = TRUE
-/datum/extension/network_device/camera/New(datum/holder, n_id, n_key, c_type, autojoin, list/preset_channels, camera_name, camnet_enabled = TRUE, req_connection = TRUE)
+/datum/extension/network_device/camera/New(datum/holder, n_id, n_key, r_type, autojoin, list/preset_channels, camera_name, camnet_enabled = TRUE, req_connection = TRUE)
if(length(preset_channels))
channels = preset_channels.Copy()
. = ..()
@@ -22,6 +22,7 @@
display_name = camera_name
/datum/extension/network_device/camera/post_construction()
+ . = ..()
if(cameranet_enabled)
cameranet.add_source(holder)
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 1c568833574..04426a9e287 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -7,7 +7,7 @@
idle_power_usage = 5
active_power_usage = 10
layer = CAMERA_LAYER
- anchored = 1
+ anchored = TRUE
movable_flags = MOVABLE_FLAG_PROXMOVE
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
directional_offset = "{'SOUTH':{'y':21}, 'EAST':{'x':-10}, 'WEST':{'x':10}}"
@@ -86,13 +86,12 @@
if(!c_tag)
var/area/A = get_area(src)
if(isturf(loc) && A)
- for(var/obj/machinery/camera/C in A)
- if(C == src) continue
- if(C.number)
- number = max(number, C.number+1)
- c_tag = "[A.proper_name][number == 1 ? "" : " #[number]"]"
- if(!c_tag) // Add a default c_tag in case the camera has been placed in an invalid location or inside another object.
- c_tag = "Security Camera - [random_id(/obj/machinery/camera, 100,999)]"
+ var/suffix = uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, "c_tag [A.proper_name]", 1) // unlike sequential_id, starts at 1 instead of 100
+ if(suffix == 1)
+ suffix = null
+ c_tag = "[A.proper_name][suffix ? " [suffix]" : null]"
+ // Add a default c_tag in case the camera has been placed in an invalid location or inside another object.
+ c_tag ||= "Security Camera - [random_id(/obj/machinery/camera, 100,999)]"
invalidateCameraCache()
set_extension(src, /datum/extension/network_device/camera, null, null, null, TRUE, preset_channels, c_tag, cameranet_enabled, requires_connection)
@@ -131,7 +130,7 @@
/obj/machinery/camera/proc/newTarget(var/mob/target)
if (!motion_sensor)
return FALSE
- if (istype(target, /mob/living/silicon/ai))
+ if (isAI(target))
return FALSE
if (detectTime == 0)
detectTime = world.time // start the clock
@@ -192,7 +191,7 @@
if (istype(AM, /obj))
var/obj/O = AM
if (O.throwforce >= src.toughness)
- visible_message("[src] was hit by [O].")
+ visible_message(SPAN_WARNING("[src] was hit by [O]!"))
take_damage(O.throwforce)
/obj/machinery/camera/physical_attack_hand(mob/living/carbon/human/user)
@@ -200,7 +199,7 @@
return
if(user.species.can_shred(user))
user.do_attack_animation(src)
- visible_message("\The [user] slashes at [src]!")
+ visible_message(SPAN_WARNING("\The [user] slashes at [src]!"))
playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1)
add_hiddenprint(user)
take_damage(25)
@@ -220,11 +219,11 @@
/obj/machinery/camera/proc/add_channels(var/list/channels)
var/datum/extension/network_device/camera/D = get_extension(src, /datum/extension/network_device)
- D.add_channels(channels)
+ D?.add_channels(channels)
/obj/machinery/camera/proc/remove_channels(var/list/channels)
var/datum/extension/network_device/camera/D = get_extension(src, /datum/extension/network_device)
- D.remove_channels(channels)
+ D?.remove_channels(channels)
/obj/machinery/camera/set_broken(new_state, cause)
. = ..()
@@ -241,7 +240,7 @@
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.
- if(istype(user, /mob/living/silicon/ai))
+ if(isAI(user))
user = null
if(status)
diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm
index 62bf538ecfe..30ee583beec 100644
--- a/code/game/machinery/camera/presets.dm
+++ b/code/game/machinery/camera/presets.dm
@@ -1,32 +1,31 @@
/obj/machinery/camera/network/engineering
preset_channels = list(CAMERA_CAMERA_CHANNEL_ENGINEERING)
- initial_access = list(access_engine)
+ req_access = list(access_engine)
/obj/machinery/camera/network/ert
preset_channels = list(CAMERA_CHANNEL_ERT)
cameranet_enabled = FALSE
- initial_access = list(access_engine)
+ req_access = list(access_engine)
/obj/machinery/camera/network/medbay
preset_channels = list(CAMERA_CHANNEL_MEDICAL)
- initial_access = list(access_medical)
-
+ req_access = list(access_medical)
/obj/machinery/camera/network/mercenary
preset_channels = list(CAMERA_CHANNEL_MERCENARY)
cameranet_enabled = FALSE
- initial_access = list(access_mercenary)
+ req_access = list(access_mercenary)
/obj/machinery/camera/network/mining
preset_channels = list(CAMERA_CHANNEL_MINE)
- initial_access = list(access_mining)
+ req_access = list(access_mining)
/obj/machinery/camera/network/research
preset_channels = list(CAMERA_CHANNEL_RESEARCH)
- initial_access = list(access_research)
+ req_access = list(access_research)
/obj/machinery/camera/network/security
preset_channels = list(CAMERA_CHANNEL_SECURITY)
- initial_access = list(access_security)
+ req_access = list(access_security)
/obj/machinery/camera/network/television
preset_channels = list(CAMERA_CHANNEL_TELEVISION)
diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm
index c22453cc8cf..ea4513468bd 100644
--- a/code/game/machinery/camera/tracking.dm
+++ b/code/game/machinery/camera/tracking.dm
@@ -9,7 +9,7 @@
return !(T && isPlayerLevel(T.z))
/mob/living/silicon/ai/proc/get_camera_list()
- if(src.stat == 2)
+ if(src.stat == DEAD)
return
var/list/T = list()
@@ -98,7 +98,7 @@
var/list/cameras = list()
/mob/living/silicon/ai/proc/trackable_mobs()
- if(usr.stat == 2)
+ if(usr.stat == DEAD)
return list()
var/datum/trackable/TB = new()
@@ -115,7 +115,7 @@
else
TB.names.Add(name)
TB.namecounts[name] = 1
- if(istype(M, /mob/living/carbon/human))
+ if(ishuman(M))
TB.humans[name] = M
else
TB.others[name] = M
@@ -129,7 +129,7 @@
set name = "Follow With Camera"
set desc = "Select who you would like to track."
- if(src.stat == 2)
+ if(src.stat == DEAD)
to_chat(src, "You can't follow [target_name] with cameras because you are dead!")
return
if(!target_name)
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 8de3f6262a3..ed265488c05 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -3,7 +3,7 @@
desc = "A much more powerful version of the standard recharger that is specially designed for charging power cells."
icon = 'icons/obj/power.dmi'
icon_state = "ccharger0"
- anchored = 1
+ anchored = TRUE
idle_power_usage = 5
power_channel = EQUIP
var/chargelevel = -1
diff --git a/code/game/machinery/commsrelay.dm b/code/game/machinery/commsrelay.dm
index aea515878ea..5573f9df902 100644
--- a/code/game/machinery/commsrelay.dm
+++ b/code/game/machinery/commsrelay.dm
@@ -3,8 +3,8 @@
desc = "This machine creates a microscopic wormhole between here and a suitable target, allowing for FTL communication."
icon = 'icons/obj/machines/tcomms/bs_relay.dmi'
icon_state = "bspacerelay"
- anchored = 1
- density = 1
+ anchored = TRUE
+ density = TRUE
idle_power_usage = 15000
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index a732ce9e243..6ae35fa9752 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -2,8 +2,8 @@
/obj/machinery/computer/operating
name = "patient monitoring console"
- density = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
icon_keyboard = "med_key"
icon_screen = "crew"
var/mob/living/carbon/human/victim = null
@@ -23,7 +23,7 @@
/obj/machinery/computer/operating/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
- if (!istype(user, /mob/living/silicon))
+ if (!issilicon(user))
user.unset_machine()
close_browser(user, "window=op")
return
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index d4b6e05f3fe..3fa89eef553 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -1,8 +1,8 @@
var/global/list/empty_playable_ai_cores = list()
/obj/structure/aicore
- density = 1
- anchored = 0
+ density = TRUE
+ anchored = FALSE
name = "\improper AI core"
icon = 'icons/mob/AI.dmi'
icon_state = "0"
@@ -150,7 +150,7 @@ var/global/list/empty_playable_ai_cores = list()
if(!B)
to_chat(user, SPAN_WARNING("Sticking an empty [P] into the frame would sort of defeat the purpose."))
return
- if(B.stat == 2)
+ if(B.stat == DEAD)
to_chat(user, SPAN_WARNING("Sticking a dead [P] into the frame would sort of defeat the purpose."))
return
if(jobban_isbanned(B, "AI"))
@@ -201,7 +201,7 @@ var/global/list/deactivated_ai_cores = list()
name = "inactive AI"
icon = 'icons/mob/AI.dmi'
icon_state = "ai-empty"
- anchored = 1
+ anchored = TRUE
tool_interaction_flags = (TOOL_INTERACTION_ANCHOR | TOOL_INTERACTION_DECONSTRUCT)
/obj/structure/aicore/deactivated/Initialize()
@@ -215,7 +215,7 @@ var/global/list/deactivated_ai_cores = list()
/obj/structure/aicore/deactivated/proc/load_ai(var/mob/living/silicon/ai/transfer, var/obj/item/aicard/card, var/mob/user)
- if(!istype(transfer) || locate(/mob/living/silicon/ai) in src)
+ if(!isAI(transfer) || locate(/mob/living/silicon/ai) in src)
return
transfer.aiRestorePowerRoutine = 0
diff --git a/code/game/machinery/computer/arcade_orion.dm b/code/game/machinery/computer/arcade_orion.dm
index 54de20448b6..93b47f19f05 100644
--- a/code/game/machinery/computer/arcade_orion.dm
+++ b/code/game/machinery/computer/arcade_orion.dm
@@ -4,7 +4,7 @@
//////////////////////////
//Orion Trail Events
-#define ORION_TRAIL_RAIDERS "Vox Raiders"
+#define ORION_TRAIL_RAIDERS "Space Pirates"
#define ORION_TRAIL_FLUX "Interstellar Flux"
#define ORION_TRAIL_ILLNESS "Illness"
#define ORION_TRAIL_BREAKDOWN "Breakdown"
@@ -318,7 +318,7 @@
else
event_info = "You couldn't fight them off! "
if(prob(10*settlers.len))
- remove_settler(null, "was kidnapped by the Vox!")
+ remove_settler(null, "was kidnapped by the pirates!")
change_resource(null,-1)
change_resource(null,-0.5)
if(ORION_TRAIL_DERELICT)
@@ -399,7 +399,7 @@
/obj/machinery/computer/arcade/orion_trail/proc/emag_effect(var/event)
switch(event)
if(ORION_TRAIL_RAIDERS)
- if(istype(usr,/mob/living/carbon))
+ if(iscarbon(usr))
var/mob/living/carbon/M = usr
if(prob(50))
to_chat(usr, "You hear battle shouts. The tramping of boots on cold metal. Screams of agony. The rush of venting air. Are you going insane?")
@@ -410,7 +410,7 @@
else
to_chat(usr, "The sounds of battle fill your ears...")
if(ORION_TRAIL_ILLNESS)
- if(istype(usr,/mob/living/carbon/human))
+ if(ishuman(usr))
var/mob/living/carbon/human/M = usr
to_chat(M, "An overpowering wave of nausea consumes over you. You hunch over, your stomach's contents preparing for a spectacular exit.")
M.vomit()
@@ -421,7 +421,7 @@
var/mob/living/M = usr
M.adjustBruteLoss(10)
if(ORION_TRAIL_FLUX)
- if(istype(usr,/mob/living/carbon) && prob(75))
+ if(iscarbon(usr) && prob(75))
var/mob/living/carbon/M = usr
SET_STATUS_MAX(M, STAT_WEAK, 3)
src.visible_message("A sudden gust of powerful wind slams \the [M] into the floor!", "You hear a large fwooshing sound, followed by a bang.")
@@ -473,10 +473,10 @@
/obj/item/orion_ship
name = "model settler ship"
desc = "A model spaceship, it looks like those used back in the day when travelling to Orion! It even has a miniature FX-293 reactor, which was renowned for its instability and tendency to explode..."
- icon = 'icons/obj/toy.dmi'
+ icon = 'icons/obj/toy/toy.dmi'
icon_state = "ship"
w_class = ITEM_SIZE_SMALL
- material = /decl/material/solid/plastic
+ material = /decl/material/solid/organic/plastic
matter = list(
/decl/material/solid/metal/steel = MATTER_AMOUNT_SECONDARY,
/decl/material/solid/metal/copper = MATTER_AMOUNT_REINFORCEMENT,
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index 72e54fe197f..ec09704fe94 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -8,20 +8,21 @@
icon_keyboard = "generic_key"
icon_screen = "comm_logs"
light_color = "#00b000"
- density = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
initial_access = list(list(access_engine_equip, access_atmospherics))
var/list/monitored_alarm_ids = null
var/datum/nano_module/atmos_control/atmos_control
base_type = /obj/machinery/computer/atmoscontrol
+// TODO: replace this with a modular computer at some point
/obj/machinery/computer/atmoscontrol/laptop
- name = "Atmospherics Laptop"
+ name = "atmospherics laptop"
desc = "A cheap laptop."
icon_state = "laptop"
icon_keyboard = "laptop_key"
icon_screen = "atmoslaptop"
- density = 0
+ density = FALSE
/obj/machinery/computer/atmoscontrol/interface_interact(user)
ui_interact(user)
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index 4745a0ca0cb..5a6e4780c71 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -4,7 +4,6 @@
name = "computer frame"
icon = 'icons/obj/items/stock_parts/stock_parts.dmi'
icon_state = "unwired"
- obj_flags = OBJ_FLAG_ROTATABLE
expected_machine_type = "computer"
/obj/machinery/constructable_frame/computerframe/on_update_icon()
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index 6e5cce85337..dad1d1f750f 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -2,8 +2,8 @@
name = "computer console"
icon = 'icons/obj/computer.dmi'
icon_state = "computer"
- density = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 300
active_power_usage = 300
construct_state = /decl/machine_construction/default/panel_closed/computer
@@ -24,9 +24,6 @@
overlay_layer = layer
update_icon()
-/obj/machinery/computer/get_codex_value()
- return "computer"
-
/obj/machinery/computer/emp_act(severity)
if(prob(20/severity)) set_broken(TRUE)
..()
diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm
index a260d1e6e3a..7419b982914 100644
--- a/code/game/machinery/computer/guestpass.dm
+++ b/code/game/machinery/computer/guestpass.dm
@@ -50,7 +50,7 @@
icon_state = "guest"
icon_keyboard = null
icon_screen = "pass"
- density = 0
+ density = FALSE
var/obj/item/card/id/giver
var/list/accesses = list()
@@ -91,7 +91,7 @@
if(giver)
data["giver"] = !!giver
- data["giver_name"] = giver.rank || giver.assignment
+ data["giver_name"] = giver.position || giver.assignment
data["giv_name"] = giv_name
var/list/giver_access = list()
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index 78f17a16b4e..858df3d35e4 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -122,13 +122,13 @@
dat += " [++i]. Set Custom Key "
else
dat += "
Please authenticate with the server in order to show additional options."
- if((istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot)) && (user.mind.assigned_special_role && user.mind.original == user))
+ if((isAI(user) || isrobot(user)) && (user.mind.assigned_special_role && user.mind.original == user))
//Malf/Traitor AIs can bruteforce into the system to gain the Key.
dat += "*&@#. Bruteforce Key"
//Hacking screen.
if(2)
- if(istype(user, /mob/living/silicon/ai) || istype(user, /mob/living/silicon/robot))
+ if(isAI(user) || isrobot(user))
dat += "Brute-forcing for server key. It will take 20 seconds for every character that the password has."
dat += "In the meantime, this console can reveal your true intentions if you let someone access it. Make sure no humans enter the room during that time."
else
@@ -285,7 +285,7 @@
//Hack the Console to get the password
if (href_list["hack"])
- if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && usr.mind.assigned_special_role && usr.mind.original == usr)
+ if((isAI(usr) || isrobot(usr)) && usr.mind.assigned_special_role && usr.mind.original == usr)
src.hacking = 1
src.screen = 2
update_icon()
diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm
index 0ea594d7e82..524f6a35889 100644
--- a/code/game/machinery/computer/robot.dm
+++ b/code/game/machinery/computer/robot.dm
@@ -68,7 +68,7 @@
return TOPIC_HANDLED
// Antag AI checks
- if(!istype(user, /mob/living/silicon/ai) || !(user.mind.assigned_special_role && user.mind.original == user))
+ if(!isAI(user) || !(user.mind.assigned_special_role && user.mind.original == user))
to_chat(user, "Access Denied")
return TOPIC_HANDLED
@@ -110,7 +110,7 @@
for(var/mob/living/silicon/robot/R in global.silicon_mob_list)
// Ignore drones
- if(is_drone(R))
+ if(isdrone(R))
continue
// Ignore antagonistic cyborgs
if(R.scrambledcodes)
@@ -145,7 +145,7 @@
robot["master_ai"] = R.connected_ai ? R.connected_ai.name : "None"
robot["hackable"] = 0
// Antag AIs know whether linked cyborgs are hacked or not.
- if(operator && istype(operator, /mob/living/silicon/ai) && (R.connected_ai == operator) && (operator.mind.assigned_special_role && operator.mind.original == operator))
+ if(operator && isAI(operator) && (R.connected_ai == operator) && (operator.mind.assigned_special_role && operator.mind.original == operator))
robot["hacked"] = R.emagged ? 1 : 0
robot["hackable"] = R.emagged? 0 : 1
robots.Add(list(robot))
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 0ab6191ec8c..e58b243c5dc 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -1,8 +1,6 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
-
//Circuit boards are in /code/game/objects/items/weapons/circuitboards/machinery/
-
-/obj/machinery/constructable_frame //Made into a seperate type to make future revisions easier.
+///Made into a seperate type to make future revisions easier.
+/obj/machinery/constructable_frame
name = "machine frame"
icon = 'icons/obj/items/stock_parts/stock_parts.dmi'
icon_state = "box_0"
@@ -11,9 +9,10 @@
use_power = POWER_USE_OFF
uncreated_component_parts = null
construct_state = /decl/machine_construction/frame/unwrenched
+ obj_flags = OBJ_FLAG_ROTATABLE
+ atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE
var/obj/item/stock_parts/circuitboard/circuit = null
var/expected_machine_type
- atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE
/obj/machinery/constructable_frame/state_transition(decl/machine_construction/new_state)
. = ..()
diff --git a/code/game/machinery/cracker.dm b/code/game/machinery/cracker.dm
index 689aef65288..0037f028edb 100644
--- a/code/game/machinery/cracker.dm
+++ b/code/game/machinery/cracker.dm
@@ -3,8 +3,8 @@
desc = "An integrated catalytic water cracking system used to break H2O down into H and O."
icon = 'icons/obj/machines/cracker.dmi'
icon_state = "cracker"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
waterproof = TRUE
volume = 5000
use_power = POWER_USE_IDLE
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 331a8fbb367..65a10708027 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -13,7 +13,7 @@
desc = "An interface between crew and the cryogenic storage oversight systems."
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "cellconsole"
- density = 0
+ density = FALSE
interact_offline = 1
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
directional_offset = "{'NORTH':{'y':-24}, 'SOUTH':{'y':32}, 'EAST':{'x':-24}, 'WEST':{'x':24}}"
@@ -133,7 +133,7 @@
desc = "A bewildering tangle of machinery and pipes."
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "cryo_rear"
- anchored = 1
+ anchored = TRUE
dir = WEST
//Cryopods themselves.
@@ -142,8 +142,8 @@
desc = "A man-sized pod for entering suspended animation."
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "body_scanner_0"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
dir = WEST
var/base_icon_state = "body_scanner_0"
@@ -189,7 +189,7 @@
icon_state = "redpod0"
base_icon_state = "redpod0"
occupied_icon_state = "redpod1"
- var/launched = 0
+ var/launched = FALSE
var/datum/gas_mixture/airtank
/obj/machinery/cryopod/lifepod/Initialize()
@@ -203,7 +203,7 @@
return airtank
/obj/machinery/cryopod/lifepod/proc/launch()
- launched = 1
+ launched = TRUE
for(var/d in global.cardinal)
var/turf/T = get_step(src,d)
var/obj/machinery/door/blast/B = locate() in T
@@ -212,13 +212,17 @@
break
var/newz
- if(prob(10))
+ if(prob(90))
var/list/possible_locations
var/obj/effect/overmap/visitable/O = global.overmap_sectors[num2text(z)]
if(istype(O))
for(var/obj/effect/overmap/visitable/OO in range(O,2))
if((OO.sector_flags & OVERMAP_SECTOR_IN_SPACE) || istype(OO,/obj/effect/overmap/visitable/sector/planetoid))
- LAZYDISTINCTADD(possible_locations, text2num(level))
+ // Don't try to escape to the place we just launched from
+ if(OO == O)
+ continue
+ var/datum/level_data/data = OO.get_topmost_level_data()
+ LAZYDISTINCTADD(possible_locations, text2num(data.level_z))
if(length(possible_locations))
newz = pick(possible_locations)
if(!newz)
@@ -454,7 +458,7 @@
set name = "Eject Pod"
set category = "Object"
set src in oview(1)
- if(usr.stat != 0)
+ if(usr.stat != CONSCIOUS)
return
icon_state = base_icon_state
@@ -477,7 +481,7 @@
set category = "Object"
set src in oview(1)
- if(usr.stat != 0 || !check_occupant_allowed(usr))
+ if(usr.stat != CONSCIOUS || !check_occupant_allowed(usr))
return
if(src.occupant)
@@ -550,8 +554,8 @@
desc = "Whoever was inside isn't going to wake up now. It looks like you could pry it open with a crowbar."
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "broken_cryo"
- anchored = 1
- density = 1
+ anchored = TRUE
+ density = TRUE
var/closed = 1
var/busy = 0
var/remains_type = /obj/item/remains/human
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 8ce9d2e0f03..7e1f90e854e 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -9,8 +9,8 @@
name = "deployable barrier"
desc = "A deployable barrier. Swipe your ID card to lock/unlock it."
icon = 'icons/obj/objects.dmi'
- anchored = 0.0
- density = 1
+ anchored = FALSE
+ density = TRUE
icon_state = "barrier0"
var/health = 100.0
var/maxhealth = 100.0
@@ -57,7 +57,6 @@
src.health -= W.force * 0.75
if(BRUTE)
src.health -= W.force * 0.5
- else
if (src.health <= 0)
src.explode()
..()
@@ -91,7 +90,7 @@
/obj/machinery/deployable/barrier/physically_destroyed(skip_qdel)
SSmaterials.create_object(/decl/material/solid/metal/steel, get_turf(src), 1, /obj/item/stack/material/rods)
. = ..()
-
+
/obj/machinery/deployable/barrier/proc/explode()
visible_message("[src] blows apart!")
spark_at(src, cardinal_only = TRUE)
diff --git a/code/game/machinery/doors/_door.dm b/code/game/machinery/doors/_door.dm
index 0247544b7fa..60fd6d4c053 100644
--- a/code/game/machinery/doors/_door.dm
+++ b/code/game/machinery/doors/_door.dm
@@ -6,9 +6,9 @@
desc = "It opens and closes."
icon = 'icons/obj/doors/Doorint.dmi'
icon_state = "door1"
- anchored = 1
- opacity = 1
- density = 1
+ anchored = TRUE
+ opacity = TRUE
+ density = TRUE
layer = CLOSED_DOOR_LAYER
interact_offline = TRUE
construct_state = /decl/machine_construction/default/panel_closed/door
@@ -52,7 +52,7 @@
var/set_dir_on_update = TRUE
/obj/machinery/door/proc/can_operate(var/mob/user)
- . = istype(user) && !user.restrained() && (!issmall(user) || ishuman(user) || issilicon(user) || istype(user, /mob/living/bot))
+ . = istype(user) && !user.restrained() && (!issmall(user) || ishuman(user) || issilicon(user) || isbot(user))
/obj/machinery/door/attack_generic(var/mob/user, var/damage, var/attack_verb, var/environment_smash)
if(environment_smash >= 1)
@@ -521,8 +521,8 @@
success = 1
else
for(var/obj/O in T)
- for(var/b_type in blend_objects)
- if( istype(O, b_type))
+ for(var/blend_type in blend_objects)
+ if( istype(O, blend_type))
success = 1
if(success)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 768110ea59f..790e7a1a30e 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -91,9 +91,6 @@ var/global/list/airlock_overlays = list()
/obj/machinery/door/airlock/proc/get_window_material()
return GET_DECL(window_material)
-/obj/machinery/door/airlock/get_codex_value()
- return "airlock"
-
/obj/machinery/door/airlock/Process()
if(main_power_lost_until > 0 && world.time >= main_power_lost_until)
regainMainPower()
@@ -295,9 +292,9 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/on_update_icon(state=0, override=0)
if(set_dir_on_update)
- if(connections & (NORTH|SOUTH))
- set_dir(WEST)
- else
+ if(connections & (NORTH|SOUTH) == (NORTH|SOUTH))
+ set_dir(EAST)
+ else if (connections & (EAST|WEST) == (EAST|WEST))
set_dir(SOUTH)
switch(state)
@@ -546,7 +543,7 @@ About the new airlock wires panel:
return ..()
/obj/machinery/door/airlock/physical_attack_hand(mob/user)
- if(!istype(usr, /mob/living/silicon))
+ if(!issilicon(usr))
if(src.isElectrified())
if(src.shock(user, 100))
return TRUE
@@ -727,7 +724,7 @@ About the new airlock wires panel:
update_icon()
return TRUE
- if(!istype(user, /mob/living/silicon))
+ if(!issilicon(user))
if(src.isElectrified())
if(src.shock(user, 75))
return TRUE
@@ -801,7 +798,7 @@ About the new airlock wires panel:
return TRUE
- else if((stat & (BROKEN|NOPOWER)) && istype(user, /mob/living/simple_animal))
+ else if((stat & (BROKEN|NOPOWER)) && isanimal(user))
var/mob/living/simple_animal/A = user
var/obj/item/I = A.get_natural_weapon()
if(I?.force >= 10)
@@ -869,7 +866,7 @@ About the new airlock wires panel:
if(moved)
spark_at(da, amount=5, cardinal_only = TRUE)
else
- da.anchored = 1
+ da.anchored = TRUE
da.state = 1
da.created_name = name
da.update_icon()
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index c0ac2ac4d92..eea3bf99a74 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -235,7 +235,7 @@
var/obj/structure/door_assembly/da = ..()
. = da
- da.anchored = 1
+ da.anchored = TRUE
da.state = 1
da.created_name = name
da.update_icon()
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index ef9ca949ae3..f0f98def655 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -19,8 +19,8 @@
icon_state = "frame"
desc = "A remote control for a door."
initial_access = list(access_brig)
- anchored = 1.0 // can't pick it up
- density = 0 // can walk through it.
+ anchored = TRUE // can't pick it up
+ density = FALSE // can walk through it.
var/releasetime = 0 // when world.timeofday reaches it - release the prisoner
var/timing = 1 // boolean, true/1 timer is on, false/0 means it's not timing
var/picture_state // icon_state of alert picture, if not displaying text/numbers
diff --git a/code/game/machinery/doors/double.dm b/code/game/machinery/doors/double.dm
index 394893adcc6..deade476b6b 100644
--- a/code/game/machinery/doors/double.dm
+++ b/code/game/machinery/doors/double.dm
@@ -19,7 +19,6 @@
appearance_flags = 0
opacity = TRUE
width = 2
- set_dir_on_update = FALSE
/obj/machinery/door/airlock/double/update_connections(var/propagate = 0)
var/dirs = 0
@@ -42,8 +41,8 @@
success = 1
else
for(var/obj/O in T)
- for(var/b_type in blend_objects)
- if( istype(O, b_type))
+ for(var/blend_type in blend_objects)
+ if( istype(O, blend_type))
success = 1
if(success)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 70faf531e85..eecf6644ddc 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -17,8 +17,8 @@
icon_state = "open"
initial_access = list(list(access_atmospherics, access_engine_equip))
autoset_access = FALSE
- opacity = 0
- density = 0
+ opacity = FALSE
+ density = FALSE
layer = BELOW_DOOR_LAYER
open_layer = BELOW_DOOR_LAYER
closed_layer = ABOVE_WINDOW_LAYER
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index b7d4763ef1d..b0130013ea7 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -12,11 +12,12 @@
stat_immune = NOSCREEN | NOINPUT | NOPOWER
uncreated_component_parts = null
atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CHECKS_BORDER
- opacity = 0
+ opacity = FALSE
explosion_resistance = 5
pry_mod = 0.5
base_type = /obj/machinery/door/window
frame_type = /obj/structure/windoor_assembly
+ set_dir_on_update = FALSE // these can properly face all 4 directions! don't force us into just 2!
var/base_state = "left"
/obj/machinery/door/window/get_auto_access()
@@ -138,7 +139,7 @@
return
/obj/machinery/door/window/physical_attack_hand(mob/user)
- if(istype(user,/mob/living/carbon/human))
+ if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.species.can_shred(H))
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
diff --git a/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm b/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm
index 4f9b4783cac..0da24e61151 100644
--- a/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm
+++ b/code/game/machinery/embedded_controller/airlock_controllers_dummy.dm
@@ -6,7 +6,6 @@
icon_state = "airlock_control_off"
layer = ABOVE_OBJ_LAYER
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
- unacidable = TRUE
base_type = /obj/machinery/dummy_airlock_controller
construct_state = /decl/machine_construction/wall_frame/panel_closed
frame_type = /obj/item/frame/button/airlock_controller
diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm
index 0842b5de998..7e98869a6c5 100644
--- a/code/game/machinery/embedded_controller/embedded_controller_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm
@@ -1,6 +1,6 @@
/obj/machinery/embedded_controller
name = "Embedded Controller"
- anchored = 1
+ anchored = TRUE
idle_power_usage = 10
layer = ABOVE_WINDOW_LAYER
clicksound = "button"
@@ -50,7 +50,6 @@
icon_state = "airlock_control_off"
power_channel = ENVIRON
density = FALSE
- unacidable = TRUE
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
construct_state = /decl/machine_construction/wall_frame/panel_closed
frame_type = /obj/item/frame/button/airlock_controller
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 28296257736..a39a573c195 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -12,7 +12,7 @@
var/last_flash = 0 //Don't want it getting spammed like regular flashes
var/strength = 10 //How weakened targets are when flashed.
var/base_state = "mflash"
- anchored = 1
+ anchored = TRUE
idle_power_usage = 2
movable_flags = MOVABLE_FLAG_PROXMOVE
@@ -78,12 +78,14 @@
flash_time = round(H.getFlashMod() * flash_time)
if(flash_time <= 0)
return
- var/obj/item/organ/internal/E = GET_INTERNAL_ORGAN(H, H.species.vision_organ)
- if(E && E.is_bruised() && prob(E.damage + 50))
- H.flash_eyes()
- E.damage += rand(1, 5)
-
- if(!O.blinded)
+ var/vision_organ = H.get_bodytype()?.vision_organ
+ if(vision_organ)
+ var/obj/item/organ/internal/E = GET_INTERNAL_ORGAN(H, vision_organ)
+ if(E && E.is_bruised() && prob(E.damage + 50))
+ H.flash_eyes()
+ E.damage += rand(1, 5)
+
+ if(!O.is_blind())
do_flash(O, flash_time)
/obj/machinery/flasher/proc/do_flash(var/mob/living/victim, var/flash_time)
@@ -107,15 +109,15 @@
icon_state = "pflash1"
icon = 'icons/obj/machines/flash_portable.dmi'
strength = 8
- anchored = 0
+ anchored = FALSE
base_state = "pflash"
- density = 1
+ density = TRUE
/obj/machinery/flasher/portable/HasProximity(atom/movable/AM)
. = ..()
if(!. || !anchored || disable || last_flash && world.time < last_flash + 150)
return
- if(istype(AM, /mob/living/carbon))
+ if(iscarbon(AM))
var/mob/living/carbon/M = AM
if(!MOVING_DELIBERATELY(M))
flash()
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 9934e156d3f..ee1f8948409 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -2,7 +2,7 @@
name = "emergency floodlight"
icon = 'icons/obj/machines/floodlight.dmi'
icon_state = "flood00"
- density = 1
+ density = TRUE
obj_flags = OBJ_FLAG_ROTATABLE
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm
index 9a8f9cb8926..ae9bc63c9a6 100644
--- a/code/game/machinery/floor_light.dm
+++ b/code/game/machinery/floor_light.dm
@@ -6,7 +6,7 @@ var/global/list/floor_light_cache = list()
icon_state = "base"
desc = "A backlit floor panel."
layer = ABOVE_TILE_LAYER
- anchored = 0
+ anchored = FALSE
use_power = POWER_USE_ACTIVE
idle_power_usage = 2
active_power_usage = 20
@@ -23,7 +23,7 @@ var/global/list/floor_light_cache = list()
var/default_light_color = "#ffffff"
/obj/machinery/floor_light/prebuilt
- anchored = 1
+ anchored = TRUE
/obj/machinery/floor_light/Initialize()
. = ..()
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
index a70327390df..5b224487cce 100644
--- a/code/game/machinery/floorlayer.dm
+++ b/code/game/machinery/floorlayer.dm
@@ -3,7 +3,7 @@
name = "automatic floor layer"
icon = 'icons/obj/machines/pipe_dispenser.dmi'
icon_state = "pipe_d"
- density = 1
+ density = TRUE
interact_offline = TRUE
var/turf/old_turf
var/on = 0
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index 9b211dbfce8..bcb38a699ea 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -30,17 +30,17 @@ Possible to do for anyone motivated enough:
#define AREA_BASED 6
var/global/const/HOLOPAD_MODE = RANGE_BASED
+var/global/list/holopads = list()
/obj/machinery/hologram/holopad
name = "\improper holopad"
desc = "It's a floor-mounted device for projecting holographic images."
icon = 'icons/obj/machines/holopad.dmi'
icon_state = "holopad-B0"
-
layer = ABOVE_TILE_LAYER
+ idle_power_usage = 5
var/power_per_hologram = 500 //per usage per hologram
- idle_power_usage = 5
var/list/mob/living/silicon/ai/masters = new() //List of AIs that use the holopad
var/last_request = 0 //to prevent request spam. ~Carn
@@ -58,10 +58,24 @@ var/global/const/HOLOPAD_MODE = RANGE_BASED
var/allow_ai = TRUE
var/static/list/reachable_overmaps = list(OVERMAP_ID_SPACE)
+ var/holopad_id
+
/obj/machinery/hologram/holopad/Initialize()
. = ..()
- var/area/A = get_area(src)
- desc = "It's a floor-mounted device for projecting holographic images. Its ID is '[A.proper_name]'"
+
+ // Null ID means we want to use our area name.
+ global.holopads += src
+ if(isnull(holopad_id))
+ var/area/A = get_area(src)
+ holopad_id = A?.proper_name || "Unknown"
+
+ // For overmap sites, always tag the sector name so we have a unique discriminator for long range calls.
+ var/obj/effect/overmap/visitable/sector = global.overmap_sectors[num2text(z)]
+ if(sector)
+ holopad_id = "[sector.name] - [holopad_id]"
+
+ // Update our desc.
+ desc = "It's a floor-mounted device for projecting holographic images. Its ID is '[holopad_id]'"
/obj/machinery/hologram/holopad/interface_interact(var/mob/living/carbon/human/user) //Carn: Hologram requests.
if(!CanInteract(user, DefaultTopicState()))
@@ -92,12 +106,11 @@ var/global/const/HOLOPAD_MODE = RANGE_BASED
if(last_request + 200 < world.time) //don't spam the AI with requests you jerk!
last_request = world.time
to_chat(user, "You request an AI's presence.")
- var/area/area = get_area(src)
for(var/mob/living/silicon/ai/AI in global.living_mob_list_)
if(!AI.client) continue
if (holopadType != HOLOPAD_LONG_RANGE && !SSmapping.are_connected_levels(AI.z, src.z))
continue
- to_chat(AI, "Your presence is requested at \the [area.proper_name].")
+ to_chat(AI, "Your presence is requested at \the [holopad_id].")
else
to_chat(user, "A request for AI presence was already sent recently.")
if("Holocomms")
@@ -116,11 +129,10 @@ var/global/const/HOLOPAD_MODE = RANGE_BASED
zlevels_long |= O.map_z
for(var/obj/machinery/hologram/holopad/H in SSmachines.machinery)
if (H.operable())
- var/area/A = get_area(H)
if(H.z in zlevels)
- holopadlist["[A.proper_name]"] = H //Define a list and fill it with the area of every holopad in the world
+ holopadlist["[H.holopad_id]"] = H //Define a list and fill it with the area of every holopad in the world
if (H.holopadType == HOLOPAD_LONG_RANGE && (H.z in zlevels_long))
- holopadlist["[A.proper_name]"] = H
+ holopadlist["[H.holopad_id]"] = H
holopadlist = sortTim(holopadlist, /proc/cmp_text_asc)
var/temppad = input(user, "Which holopad would you like to contact?", "holopad list") as null|anything in holopadlist
targetpad = holopadlist["[temppad]"]
@@ -143,10 +155,8 @@ var/global/const/HOLOPAD_MODE = RANGE_BASED
targetpad.incoming_connection = 1
playsound(targetpad.loc, 'sound/machines/chime.ogg', 25, 5)
targetpad.icon_state = "[targetpad.base_icon]1"
- var/area/our_area = get_area(src)
- var/area/target_area = get_area(targetpad)
- targetpad.audible_message("\The [src] announces, \"Incoming communications request from [our_area.proper_name].\"")
- to_chat(user, "Trying to establish a connection to the holopad in [target_area.proper_name]... Please await confirmation from recipient.")
+ targetpad.audible_message("\The [src] announces, \"Incoming communications request from [holopad_id].\"")
+ to_chat(user, "Trying to establish a connection to the holopad in [targetpad.holopad_id]... Please await confirmation from recipient.")
/obj/machinery/hologram/holopad/proc/take_call(mob/living/carbon/user)
@@ -155,9 +165,7 @@ var/global/const/HOLOPAD_MODE = RANGE_BASED
caller_id.reset_view(src)
if(!masters[caller_id])//If there is no hologram, possibly make one.
activate_holocall(caller_id)
- var/area/source_area = get_area(sourcepad)
- var/area/our_area = get_area(src)
- log_admin("[key_name(caller_id)] just established a holopad connection from [source_area.proper_name] to [our_area.proper_name]")
+ log_admin("[key_name(caller_id)] just established a holopad connection from [sourcepad.holopad_id] to [holopad_id]")
/obj/machinery/hologram/holopad/proc/end_call(mob/user)
if(!caller_id)
@@ -289,9 +297,9 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if(A)
if(A.holo_icon_malf == TRUE)
hologram.overlays += icon("icons/effects/effects.dmi", "malf-scanline")
- hologram.mouse_opacity = 0//So you can't click on it.
+ hologram.mouse_opacity = MOUSE_OPACITY_UNCLICKABLE//So you can't click on it.
hologram.layer = ABOVE_HUMAN_LAYER //Above all the other objects/mobs. Or the vast majority of them.
- hologram.anchored = 1//So space wind cannot drag it.
+ hologram.anchored = TRUE//So space wind cannot drag it.
if(caller_id)
hologram.SetName("[caller_id.name] (Hologram)")
hologram.forceMove(get_step(src,1))
@@ -381,12 +389,13 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
*/
/obj/machinery/hologram
- anchored = 1
+ anchored = TRUE
idle_power_usage = 5
active_power_usage = 100
//Destruction procs.
/obj/machinery/hologram/holopad/Destroy()
+ global.holopads -= src
for (var/mob/living/master in masters)
clear_holo(master)
return ..()
diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm
index d0553a4de1a..61011c1e5b3 100644
--- a/code/game/machinery/holosign.dm
+++ b/code/game/machinery/holosign.dm
@@ -7,7 +7,7 @@
layer = ABOVE_DOOR_LAYER
idle_power_usage = 2
active_power_usage = 70
- anchored = 1
+ anchored = TRUE
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
directional_offset = "{'NORTH':{'y':-32}, 'SOUTH':{'y':32}, 'EAST':{'x':32}, 'WEST':{'x':-32}}"
var/lit = 0
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index acb30b36144..09a65b80873 100644
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/machines/igniter.dmi'
icon_state = "igniter1"
var/on = 0
- anchored = 1
+ anchored = TRUE
idle_power_usage = 20
active_power_usage = 1000
@@ -90,7 +90,7 @@
var/last_spark = 0
var/base_state = "migniter"
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
- anchored = 1
+ anchored = TRUE
idle_power_usage = 20
active_power_usage = 1000
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index b8965659703..51e67f598eb 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -4,8 +4,8 @@
icon = 'icons/obj/jukebox_new.dmi'
icon_state = "jukebox3-nopower"
var/state_base = "jukebox3"
- anchored = 1
- density = 1
+ anchored = TRUE
+ density = TRUE
power_channel = EQUIP
idle_power_usage = 10
active_power_usage = 100
@@ -122,7 +122,7 @@
/obj/machinery/media/jukebox/proc/emag_play()
playsound(loc, 'sound/items/AirHorn.ogg', 100, 1)
for(var/mob/living/carbon/M in ohearers(6, src))
- if(istype(M, /mob/living/carbon/human))
+ if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.get_sound_volume_multiplier() < 0.2)
continue
diff --git a/code/game/machinery/kitchen/cooking_machines/_cooker.dm b/code/game/machinery/kitchen/cooking_machines/_cooker.dm
index dc3128b80ce..8b6d0a7b74a 100644
--- a/code/game/machinery/kitchen/cooking_machines/_cooker.dm
+++ b/code/game/machinery/kitchen/cooking_machines/_cooker.dm
@@ -8,8 +8,8 @@
name = "cooker"
desc = "You shouldn't be seeing this!"
icon = 'icons/obj/cooking_machines.dmi'
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 5
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
diff --git a/code/game/machinery/kitchen/cooking_machines/_cooker_output.dm b/code/game/machinery/kitchen/cooking_machines/_cooker_output.dm
index 7f279bd0561..0fa404f0f5e 100644
--- a/code/game/machinery/kitchen/cooking_machines/_cooker_output.dm
+++ b/code/game/machinery/kitchen/cooking_machines/_cooker_output.dm
@@ -6,6 +6,7 @@
nutriment_amt = 5
bitesize = 2
filling_color = COLOR_BROWN
+ abstract_type = /obj/item/chems/food/variable
/obj/item/chems/food/variable/Initialize()
. = ..()
diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm
index 90501335331..0350d3a4998 100644
--- a/code/game/machinery/kitchen/gibber.dm
+++ b/code/game/machinery/kitchen/gibber.dm
@@ -4,8 +4,8 @@
desc = "The name isn't descriptive enough?"
icon = 'icons/obj/kitchen.dmi'
icon_state = "grinder"
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
initial_access = list(list(access_kitchen, access_morgue))
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
@@ -105,11 +105,11 @@
to_chat(user, "\The [src] is locked and running, wait for it to finish.")
return
- if(!(istype(victim, /mob/living/carbon)) && !(istype(victim, /mob/living/simple_animal)) )
+ if(!iscarbon(victim) && !isanimal(victim))
to_chat(user, "This is not suitable for \the [src]!")
return
- if(istype(victim,/mob/living/carbon/human) && !emagged)
+ if(ishuman(victim) && !emagged)
to_chat(user, "\The [src] safety guard is engaged!")
return
@@ -134,7 +134,7 @@
set name = "Empty Gibber"
set src in oview(1)
- if (usr.stat != 0)
+ if (usr.stat != CONSCIOUS)
return
src.go_out()
add_fingerprint(usr)
@@ -181,7 +181,7 @@
var/mob/living/carbon/C = occupant
slab_nutrition = C.nutrition / 15
- if(istype(occupant, /mob/living/carbon/human))
+ if(ishuman(occupant))
slab_name = occupant.real_name
// Small mobs don't give as much nutrition.
diff --git a/code/game/machinery/kitchen/icecream.dm b/code/game/machinery/kitchen/icecream.dm
index 503a64ce407..7a223bb40b5 100644
--- a/code/game/machinery/kitchen/icecream.dm
+++ b/code/game/machinery/kitchen/icecream.dm
@@ -14,9 +14,9 @@
desc = "A heavy metal container used to produce and store ice cream."
icon = 'icons/obj/kitchen.dmi'
icon_state = "icecream_vat"
- density = 1
- anchored = 0
- atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_REACT | ATOM_FLAG_OPEN_CONTAINER
+ density = TRUE
+ anchored = FALSE
+ atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_CHEM_CHANGE | ATOM_FLAG_OPEN_CONTAINER
idle_power_usage = 100
var/list/product_types = list()
diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm
index 5cd607e3440..65f98e8a90d 100644
--- a/code/game/machinery/kitchen/microwave.dm
+++ b/code/game/machinery/kitchen/microwave.dm
@@ -3,11 +3,11 @@
icon = 'icons/obj/kitchen.dmi'
icon_state = "mw"
layer = BELOW_OBJ_LAYER
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 5
active_power_usage = 100
- atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_REACT | ATOM_FLAG_OPEN_CONTAINER
+ atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_CHEM_CHANGE | ATOM_FLAG_OPEN_CONTAINER
construct_state = /decl/machine_construction/default/panel_closed
uncreated_component_parts = null
stat_immune = 0
@@ -350,7 +350,7 @@
SSnano.update_uis(src)
/obj/machinery/microwave/on_reagent_change()
- . = ..()
+ ..()
if(!operating)
SSnano.update_uis(src)
diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm
index a723a04cac4..8aae9fabfd8 100644
--- a/code/game/machinery/kitchen/smartfridge.dm
+++ b/code/game/machinery/kitchen/smartfridge.dm
@@ -6,11 +6,11 @@
icon = 'icons/obj/vending.dmi'
icon_state = "fridge_sci"
layer = BELOW_OBJ_LAYER
- density = 1
- anchored = 1
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 5
active_power_usage = 100
- atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_REACT
+ atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_NO_CHEM_CHANGE
obj_flags = OBJ_FLAG_ANCHORABLE | OBJ_FLAG_ROTATABLE
atmos_canpass = CANPASS_NEVER
required_interaction_dexterity = DEXTERITY_SIMPLE_MACHINES
@@ -71,11 +71,11 @@
initial_access = list(list(access_medical, access_chemistry))
/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O)
- if(istype(O,/obj/item/chems/glass/))
+ if(istype(O,/obj/item/chems/glass))
return 1
- if(istype(O,/obj/item/storage/pill_bottle/))
+ if(istype(O,/obj/item/storage/pill_bottle))
return 1
- if(istype(O,/obj/item/chems/pill/))
+ if(istype(O,/obj/item/chems/pill))
return 1
return 0
@@ -121,7 +121,7 @@
var/obj/item/chems/food/S = O
return !!S.dried_type
else if(istype(O, /obj/item/stack/material))
- return istype(O.material, /decl/material/solid/skin)
+ return istype(O.material, /decl/material/solid/organic/skin)
return 0
/obj/machinery/smartfridge/drying_rack/Process()
@@ -163,9 +163,9 @@
else if(istype(thing, /obj/item/stack/material))
var/obj/item/stack/material/skin = thing
- if(!istype(skin.material, /decl/material/solid/skin))
+ if(!istype(skin.material, /decl/material/solid/organic/skin))
continue
- var/decl/material/solid/skin/skin_mat = skin.material
+ var/decl/material/solid/organic/skin/skin_mat = skin.material
if(!skin_mat.tans_to)
continue
for(var/atom/item_to_stock in SSmaterials.create_object(skin_mat.tans_to, get_turf(src), skin.amount))
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 32778f69086..f574381e6c5 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -7,7 +7,7 @@
icon = 'icons/obj/power.dmi'
icon_state = "light0"
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
- anchored = 1.0
+ anchored = TRUE
idle_power_usage = 20
power_channel = LIGHT
required_interaction_dexterity = DEXTERITY_SIMPLE_MACHINES
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index a335f7b58cf..e7aa1f660e4 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -12,9 +12,9 @@ var/global/list/magnetic_modules = list()
icon_state = "floor_magnet-f"
name = "Electromagnetic Generator"
desc = "A device that uses powernet to create points of magnetic energy."
- level = 1 // underfloor
+ level = LEVEL_BELOW_PLATING
layer = ABOVE_WIRE_LAYER
- anchored = 1
+ anchored = TRUE
idle_power_usage = 50
var/freq = 1449 // radio frequency
@@ -169,7 +169,7 @@ var/global/list/magnetic_modules = list()
step_towards(M, center)
for(var/mob/living/silicon/S in orange(magnetic_field, center))
- if(istype(S, /mob/living/silicon/ai)) continue
+ if(isAI(S)) continue
step_towards(S, center)
use_power_oneoff(electricity_level * 5)
@@ -187,8 +187,8 @@ var/global/list/magnetic_modules = list()
name = "magnetic control console"
icon = 'icons/obj/airlock_machines.dmi' // uses an airlock machine icon, THINK GREEN HELP THE ENVIRONMENT - RECYCLING!
icon_state = "airlock_control_off"
- density = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 45
var/frequency = 1449
var/code = 0
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 15e226a2b10..6c3161ce09b 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -5,7 +5,7 @@
desc = "Shoots things into space."
icon = 'icons/obj/machines/massdriver.dmi'
icon_state = "mass_driver"
- anchored = 1.0
+ anchored = TRUE
idle_power_usage = 2
active_power_usage = 50
diff --git a/code/game/machinery/mech_recharger.dm b/code/game/machinery/mech_recharger.dm
index 8a8a988ff97..1738984bce3 100644
--- a/code/game/machinery/mech_recharger.dm
+++ b/code/game/machinery/mech_recharger.dm
@@ -3,9 +3,9 @@
desc = "A exosuit recharger, built into the floor."
icon = 'icons/mecha/mech_bay.dmi'
icon_state = "recharge_floor"
- density = 0
+ density = FALSE
layer = ABOVE_TILE_LAYER
- anchored = 1
+ anchored = TRUE
idle_power_usage = 200 // Some electronics, passive drain.
active_power_usage = 60 KILOWATTS // When charging
base_type = /obj/machinery/mech_recharger
@@ -18,14 +18,15 @@
var/repair_power_usage = 10 KILOWATTS // Per 1 HP of health.
var/repair = 0
-/obj/machinery/mech_recharger/Crossed(var/mob/living/exosuit/M)
+/obj/machinery/mech_recharger/Crossed(atom/movable/AM)
. = ..()
- if(istype(M) && charging != M)
- start_charging(M)
+ if(istype(AM, /mob/living/exosuit) && charging != AM)
+ start_charging(AM)
-/obj/machinery/mech_recharger/Uncrossed(var/mob/living/exosuit/M)
+/obj/machinery/mech_recharger/Uncrossed(atom/movable/AM)
. = ..()
- if(M == charging)
+ var/mob/living/exosuit/M = AM
+ if(istype(M) && M == charging)
stop_charging()
/obj/machinery/mech_recharger/RefreshParts()
diff --git a/code/game/machinery/message_server.dm b/code/game/machinery/message_server.dm
index 126a8116a7e..f9b935ff75e 100644
--- a/code/game/machinery/message_server.dm
+++ b/code/game/machinery/message_server.dm
@@ -42,8 +42,8 @@ var/global/list/message_servers = list()
name = "messaging server"
icon = 'icons/obj/machines/tcomms/message_server.dmi'
icon_state = "message_server"
- density = 1
- anchored = 1.0
+ density = TRUE
+ anchored = TRUE
idle_power_usage = 10
active_power_usage = 100
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 90f596e716a..c216f24a31a 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -5,9 +5,9 @@ var/global/list/navbeacons = list()
icon_state = "navbeacon0-f"
name = "navigation beacon"
desc = "A radio beacon used for bot navigation."
- level = 1
+ level = LEVEL_BELOW_PLATING
layer = ABOVE_WIRE_LAYER
- anchored = 1
+ anchored = TRUE
var/open = 0 // true if cover is open
var/locked = 1 // true if controls are locked
@@ -113,7 +113,7 @@ Transponder Codes: |