[F.display_name()]" - if(F.needs_big_box) + for(var/datum/report_field/field in crew_record.fields) + if(field.get_perms(access) & OS_READ_ACCESS) + dat += " | |
[field.display_name()]" + if(field.needs_big_box) dat += " | |
[F.get_value()]" + dat += " | [field.get_value()]"
dat += ""
return dat
//Should only be used for OOC stuff, for player-facing stuff you must go through the network.
/proc/get_crewmember_record(var/name)
- for(var/datum/computer_file/report/crew_record/CR in global.all_crew_records)
- if(CR.get_name() == name)
- return CR
+ for(var/datum/computer_file/report/crew_record/crew_record in global.all_crew_records)
+ if(crew_record.get_name() == name)
+ return crew_record
return null
-/proc/GetAssignment(var/mob/living/human/H)
- if(!H)
+/proc/GetAssignment(var/mob/living/crewmember)
+ if(!crewmember)
return "Unassigned"
- if(!H.mind)
- return H.job
- if(H.mind.role_alt_title)
- return H.mind.role_alt_title
- return H.mind.assigned_role
+ if(!crewmember.mind)
+ return crewmember.job
+ if(crewmember.mind.role_alt_title)
+ return crewmember.mind.role_alt_title
+ return crewmember.mind.assigned_role
#define GETTER_SETTER(PATH, KEY) /datum/computer_file/report/crew_record/proc/get_##KEY(){var/datum/report_field/F = locate(/datum/report_field/##PATH/##KEY) in fields; if(F) return F.get_value()} \
/datum/computer_file/report/crew_record/proc/set_##KEY(given_value){var/datum/report_field/F = locate(/datum/report_field/##PATH/##KEY) in fields; if(F) F.set_value(given_value)}
@@ -279,16 +279,16 @@ FIELD_LONG("Exploitable Information", antag_record, access_hacked, access_hacked
. |= "Unset"
var/list/all_genders = decls_repository.get_decls_of_type(/decl/pronouns)
for(var/thing in all_genders)
- var/decl/pronouns/G = all_genders[thing]
- if(G.bureaucratic_term )
- . |= G.bureaucratic_term
+ var/decl/pronouns/gender = all_genders[thing]
+ if(gender.bureaucratic_term )
+ . |= gender.bureaucratic_term
/datum/report_field/options/crew_record/branch/proc/record_branches()
. = list()
. |= "Unset"
- for(var/B in mil_branches.branches)
- var/datum/mil_branch/BR = mil_branches.branches[B]
- . |= BR.name
+ for(var/branch in mil_branches.branches)
+ var/datum/mil_branch/branch_datum = mil_branches.branches[branch]
+ . |= branch_datum.name
#undef GETTER_SETTER
#undef SETUP_FIELD
diff --git a/code/modules/multiz/hoist.dm b/code/modules/multiz/hoist.dm
index 02c3988c4a6..6a3c80e71fe 100644
--- a/code/modules/multiz/hoist.dm
+++ b/code/modules/multiz/hoist.dm
@@ -48,15 +48,14 @@
/obj/effect/hoist_hook/receive_mouse_drop(atom/dropping, mob/user, params)
// skip the parent buckle logic, handle climbing directly
- var/mob/living/H = user
- if(istype(H) && !H.anchored && can_climb(H) && dropping == user)
+ if(isliving(user) && !user.anchored && can_climb(user) && dropping == user)
do_climb(dropping)
return TRUE
// end copypasta'd code
if(istype(dropping, /atom/movable))
- var/atom/movable/AM = dropping
- if(!AM.simulated || AM.anchored)
- to_chat(user, SPAN_WARNING("You can't do that with \the [AM]."))
+ var/atom/movable/dropped_movable = dropping
+ if(!dropped_movable.simulated || dropped_movable.anchored)
+ to_chat(user, SPAN_WARNING("You can't do that with \the [dropped_movable]."))
return TRUE
if(source_hoist.hoistee)
to_chat(user, SPAN_NOTICE("\The [source_hoist.hoistee] is already attached to \the [src]!"))
@@ -66,24 +65,24 @@
return
if (!user.check_dexterity(DEXTERITY_HOLD_ITEM))
return
- source_hoist.attach_hoistee(AM)
+ source_hoist.attach_hoistee(dropped_movable)
user.visible_message(
- SPAN_NOTICE("[user] attaches \the [AM] to \the [src]."),
- SPAN_NOTICE("You attach \the [AM] to \the [src]."),
+ SPAN_NOTICE("[user] attaches \the [dropped_movable] to \the [src]."),
+ SPAN_NOTICE("You attach \the [dropped_movable] to \the [src]."),
"You hear something clamp into place.")
return TRUE
-/obj/structure/hoist/proc/attach_hoistee(atom/movable/AM)
- hoistee = AM
- if(ismob(AM))
- source_hook.buckle_mob(AM)
+/obj/structure/hoist/proc/attach_hoistee(atom/movable/victim)
+ hoistee = victim
+ if(ismob(victim))
+ source_hook.buckle_mob(victim)
else
- AM.anchored = TRUE // can't buckle non-mobs at the moment
- source_hook.layer = AM.layer + 0.1
- if (get_turf(AM) != get_turf(source_hook))
- AM.forceMove(get_turf(source_hook))
+ victim.anchored = TRUE // can't buckle non-mobs at the moment
+ source_hook.layer = victim.layer + 0.1
+ if (get_turf(victim) != get_turf(source_hook))
+ victim.forceMove(get_turf(source_hook))
- events_repository.register(/decl/observ/destroyed, AM, src, PROC_REF(release_hoistee))
+ events_repository.register(/decl/observ/destroyed, victim, src, PROC_REF(release_hoistee))
/obj/effect/hoist_hook/handle_mouse_drop(atom/over, mob/user, params)
if(source_hoist.hoistee && isturf(over) && over.Adjacent(source_hoist.hoistee))
@@ -105,9 +104,9 @@
/obj/effect/hoist_hook/unbuckle_mob()
. = ..()
if (. && !QDELETED(source_hoist))
- var/mob/M = .
+ var/mob/victim = .
source_hoist.hoistee = null
- M.fall(get_turf(src)) // fuck you, you fall now!
+ victim.fall(get_turf(src)) // fuck you, you fall now!
/obj/structure/hoist
name = "hoist"
@@ -210,19 +209,11 @@
check_consistency()
- var/size
- if (ismob(hoistee))
- var/mob/M = hoistee
- size = M.mob_size
- else if (isobj(hoistee))
- var/obj/O = hoistee
- size = O.w_class
-
user.visible_message(
SPAN_NOTICE("[user] begins to [movtext] \the [hoistee]!"),
SPAN_NOTICE("You begin to [movtext] \the [hoistee]!"),
SPAN_NOTICE("You hear the sound of a crank."))
- if (do_after(user, (1 SECONDS) * size / 4, src))
+ if (do_after(user, (1 SECONDS) * get_object_size(hoistee) / 4, src))
move_dir(movedir, 1)
return TRUE
@@ -265,8 +256,8 @@
if (source_hook in get_step(src, dir)) // you don't get to move above the hoist
return FALSE
if (DOWN)
- var/turf/T = get_turf(source_hook)
- if(!istype(T) || !T.is_open()) // can't move down through a solid tile
+ var/turf/current_turf = get_turf(source_hook)
+ if(!current_turf || !current_turf.is_open()) // can't move down through a solid tile or if not on a turf
return FALSE
return TRUE // i thought i could trust myself to write something as simple as this, guess i was wrong
diff --git a/code/modules/multiz/level_data.dm b/code/modules/multiz/level_data.dm
index 343808267b8..80e5b9cd74e 100644
--- a/code/modules/multiz/level_data.dm
+++ b/code/modules/multiz/level_data.dm
@@ -585,6 +585,8 @@ INITIALIZE_IMMEDIATE(/obj/abstract/level_data_spawner)
// Level Data Implementations
////////////////////////////////////////////
/datum/level_data/space
+ daycycle_id = "space_solars"
+ daycycle_type = /datum/daycycle/solars
/datum/level_data/debug
name = "Debug Level"
diff --git a/code/modules/organs/external/_external.dm b/code/modules/organs/external/_external.dm
index 5856f901e69..7e79f121407 100644
--- a/code/modules/organs/external/_external.dm
+++ b/code/modules/organs/external/_external.dm
@@ -85,8 +85,8 @@
if((limb_flags & ORGAN_FLAG_FINGERPRINT) && !BP_IS_PROSTHETIC(src))
fingerprint = value
else
- for(var/obj/item/organ/external/E in children)
- E.set_fingerprint(value)
+ for(var/obj/item/organ/external/child in children)
+ child.set_fingerprint(value)
/obj/item/organ/external/proc/get_fingerprint()
@@ -95,19 +95,19 @@
fingerprint = md5(sequential_id(/mob))
return fingerprint
- for(var/obj/item/organ/external/E in children)
- var/print = E.get_fingerprint()
+ for(var/obj/item/organ/external/child in children)
+ var/print = child.get_fingerprint()
if(print)
return print
-/obj/item/organ/external/afterattack(atom/A, mob/user, proximity)
+/obj/item/organ/external/afterattack(atom/target, mob/user, proximity)
..()
if(proximity && get_fingerprint())
var/datum/extension/forensic_evidence/forensics = get_or_create_extension(src, /datum/extension/forensic_evidence)
- var/datum/fingerprint/F = new()
- F.full_print = get_fingerprint()
- F.completeness = rand(10,90)
- forensics.add_data(/datum/forensics/fingerprints, F)
+ var/datum/fingerprint/fingerprint = new()
+ fingerprint.full_print = get_fingerprint()
+ fingerprint.completeness = rand(10,90)
+ forensics.add_data(/datum/forensics/fingerprints, fingerprint)
/obj/item/organ/external/Initialize(mapload, material_key, datum/mob_snapshot/supplied_appearance, decl/bodytype/new_bodytype)
. = ..()
@@ -197,9 +197,9 @@
burn_damage = 7.5
var/power = 4 - severity //stupid reverse severity
- for(var/obj/item/I in implants)
- if(I.obj_flags & OBJ_FLAG_CONDUCTIBLE)
- burn_damage += I.w_class * rand(power, 3*power)
+ for(var/obj/item/implanted_item in implants)
+ if(implanted_item.obj_flags & OBJ_FLAG_CONDUCTIBLE)
+ burn_damage += implanted_item.w_class * rand(power, 3*power)
if(owner && burn_damage)
owner.custom_pain("Something inside your [src] burns a [severity < 2 ? "bit" : "lot"]!", power * 15) //robotic organs won't feel it anyway
@@ -213,32 +213,30 @@
if((owner && loc == owner) || !contents.len)
return ..()
var/list/removable_objects = list()
- for(var/obj/item/organ/external/E in (contents + src))
- if(!istype(E))
- continue
- for(var/obj/item/I in E.contents)
- if(istype(I,/obj/item/organ))
+ for(var/obj/item/organ/external/child_organ in (contents + src))
+ for(var/obj/item/embedded in child_organ.contents)
+ if(istype(embedded, /obj/item/organ))
continue
- removable_objects |= I
+ removable_objects |= embedded
if(removable_objects.len)
- var/obj/item/I = pick(removable_objects)
- I.forceMove(get_turf(user)) //just in case something was embedded that is not an item
- if(istype(I) && user.get_empty_hand_slot())
- user.put_in_hands(I)
- user.visible_message(SPAN_DANGER("\The [user] rips \the [I] out of \the [src]!"))
+ var/obj/item/embedded = pick(removable_objects)
+ embedded.forceMove(get_turf(user)) //just in case something was embedded that is not an item
+ if(istype(embedded) && user.get_empty_hand_slot())
+ user.put_in_hands(embedded)
+ user.visible_message(SPAN_DANGER("\The [user] rips \the [embedded] out of \the [src]!"))
return //no eating the limb until everything's been removed
return ..()
/obj/item/organ/external/examine(mob/user, distance)
. = ..()
if(distance <= 1 || isghost(user))
- for(var/obj/item/I in contents)
- if(istype(I, /obj/item/organ))
+ for(var/obj/item/embedded in contents)
+ if(istype(embedded, /obj/item/organ))
continue
- to_chat(user, "There is \a [I] sticking out of it.")
+ to_chat(user, SPAN_DANGER("There is \a [embedded] sticking out of it."))
var/ouchies = get_wounds_desc()
if(ouchies != "nothing")
- to_chat(user, "There is [ouchies] visible on it.")
+ to_chat(user, SPAN_NOTICE("There is [ouchies] visible on it."))
return
@@ -247,105 +245,105 @@
for(var/obj/item/organ/external/child in children)
child.show_decay_status(user)
-/obj/item/organ/external/attackby(obj/item/W, mob/user)
+/obj/item/organ/external/attackby(obj/item/used_item, mob/user)
- var/obj/item/organ/external/E = W
- if(BP_IS_PROSTHETIC(src) && istype(E) && BP_IS_PROSTHETIC(E))
+ var/obj/item/organ/external/connecting_limb = used_item
+ if(BP_IS_PROSTHETIC(src) && istype(connecting_limb) && BP_IS_PROSTHETIC(connecting_limb))
var/combined = FALSE
- if(E.organ_tag == parent_organ)
+ if(connecting_limb.organ_tag == parent_organ)
- if(length(E.children))
- to_chat(usr, SPAN_WARNING("You cannot connect additional limbs to \the [E]."))
+ if(length(connecting_limb.children))
+ to_chat(usr, SPAN_WARNING("You cannot connect additional limbs to \the [connecting_limb]."))
return
- var/mob/M = loc
- if(istype(M))
- M.try_unequip(src, E)
+ var/mob/holder = loc
+ if(istype(holder))
+ holder.try_unequip(src, connecting_limb)
else
dropInto(loc)
- forceMove(E)
+ forceMove(connecting_limb)
- if(loc != E)
+ if(loc != connecting_limb)
return
- if(istype(E.owner))
- E.owner.add_organ(src, E)
+ if(istype(connecting_limb.owner))
+ connecting_limb.owner.add_organ(src, connecting_limb)
else
- do_install(null, E)
+ do_install(null, connecting_limb)
combined = TRUE
- else if(E.parent_organ == organ_tag)
+ else if(connecting_limb.parent_organ == organ_tag)
if(LAZYLEN(children))
to_chat(usr, SPAN_WARNING("You cannot connect additional limbs to \the [src]."))
return
- if(!user.try_unequip(E, src))
+ if(!user.try_unequip(connecting_limb, src))
return
- if(istype(E.owner))
- E.owner.add_organ(E, src)
+ if(istype(connecting_limb.owner))
+ connecting_limb.owner.add_organ(connecting_limb, src)
else
- E.do_install(null, src)
+ connecting_limb.do_install(null, src)
combined = TRUE
else
- to_chat(user, SPAN_WARNING("\The [E] cannot be connected to \the [src]."))
+ to_chat(user, SPAN_WARNING("\The [connecting_limb] cannot be connected to \the [src]."))
return
if(combined)
- to_chat(user, SPAN_NOTICE("You connect \the [E] to \the [src]."))
+ to_chat(user, SPAN_NOTICE("You connect \the [connecting_limb] to \the [src]."))
compile_icon()
update_icon()
- E.compile_icon()
- E.update_icon()
+ connecting_limb.compile_icon()
+ connecting_limb.update_icon()
return
//Remove sub-limbs
- if(W.get_tool_quality(TOOL_SAW) && LAZYLEN(children) && try_saw_off_child(W, user))
+ if(used_item.get_tool_quality(TOOL_SAW) && LAZYLEN(children) && try_saw_off_child(used_item, user))
return
//Remove internal items/organs/implants
- if(try_remove_internal_item(W, user))
+ if(try_remove_internal_item(used_item, user))
return
..()
//Handles removing internal organs/implants/items still in the detached limb.
-/obj/item/organ/external/proc/try_remove_internal_item(var/obj/item/W, var/mob/user)
+/obj/item/organ/external/proc/try_remove_internal_item(var/obj/item/used_item, var/mob/user)
- if(stage == 0 && W.sharp)
- user.visible_message(SPAN_NOTICE("\The [user] cuts \the [src] open with \the [W]."))
+ if(stage == 0 && used_item.sharp)
+ user.visible_message(SPAN_NOTICE("\The [user] cuts \the [src] open with \the [used_item]."))
stage++
return TRUE
- if(stage == 1 && IS_RETRACTOR(W))
- user.visible_message(SPAN_NOTICE("\The [user] levers \the [src] open with \the [W]."))
+ if(stage == 1 && IS_RETRACTOR(used_item))
+ user.visible_message(SPAN_NOTICE("\The [user] levers \the [src] open with \the [used_item]."))
stage++
return TRUE
- if(stage == 2 && (W.sharp || IS_HEMOSTAT(W) || IS_WIRECUTTER(W)))
+ if(stage == 2 && (used_item.sharp || IS_HEMOSTAT(used_item) || IS_WIRECUTTER(used_item)))
var/list/radial_buttons = make_item_radial_menu_choices(get_contents_recursive())
if(LAZYLEN(radial_buttons))
var/obj/item/removing = show_radial_menu(user, src, radial_buttons, radius = 42, require_near = TRUE, use_labels = TRUE, check_locs = list(src))
if(removing)
if(istype(removing, /obj/item/organ))
- var/obj/item/organ/O = removing
- O.do_uninstall()
+ var/obj/item/organ/removed_organ = removing
+ removed_organ.do_uninstall()
removing.forceMove(get_turf(user))
if(user.get_empty_hand_slot())
user.put_in_hands(removing)
- user.visible_message(SPAN_NOTICE("\The [user] extracts [removing] from \the [src] with \the [W]!"))
+ user.visible_message(SPAN_NOTICE("\The [user] extracts [removing] from \the [src] with \the [used_item]!"))
else
- user.visible_message(SPAN_NOTICE("\The [user] fishes around fruitlessly in \the [src] with \the [W]."))
+ user.visible_message(SPAN_NOTICE("\The [user] fishes around fruitlessly in \the [src] with \the [used_item]."))
return TRUE
return FALSE
//Handles removing child limbs from the detached limb.
-/obj/item/organ/external/proc/try_saw_off_child(var/obj/item/W, var/mob/user)
+/obj/item/organ/external/proc/try_saw_off_child(var/obj/item/used_item, var/mob/user)
//Add icons to radial menu
var/list/radial_buttons = make_item_radial_menu_choices(get_limbs_recursive())
@@ -357,7 +355,7 @@
if(!istype(removing))
return TRUE
- var/cutting_result = !W.do_tool_interaction(TOOL_SAW, user, src, 3 SECONDS, "cutting \the [removing] off")
+ var/cutting_result = !used_item.do_tool_interaction(TOOL_SAW, user, src, 3 SECONDS, "cutting \the [removing] off")
//Check if the limb is still in the hierarchy
if(cutting_result == 1 || !(removing in get_limbs_recursive()))
if(cutting_result != -1)
@@ -373,7 +371,7 @@
removing.update_icon()
if(user.get_empty_hand_slot())
user.put_in_hands(removing)
- user.visible_message(SPAN_DANGER("[user] cuts off \the [removing] from [src] with [W]!"))
+ user.visible_message(SPAN_DANGER("[user] cuts off \the [removing] from [src] with [used_item]!"))
return TRUE
/**
@@ -405,11 +403,11 @@
return (status & ORGAN_DISLOCATED) || is_parent_dislocated() //if any parent is dislocated, we are considered dislocated as well
/obj/item/organ/external/proc/is_parent_dislocated()
- var/obj/item/organ/external/O = parent
- while(O && (O.limb_flags & ORGAN_FLAG_CAN_DISLOCATE))
- if(O.status & ORGAN_DISLOCATED)
+ var/obj/item/organ/external/current_limb = parent
+ while(current_limb && (current_limb.limb_flags & ORGAN_FLAG_CAN_DISLOCATE))
+ if(current_limb.status & ORGAN_DISLOCATED)
return TRUE
- O = O.parent
+ current_limb = current_limb.parent
return FALSE
/obj/item/organ/external/proc/update_internal_organs_cost()
@@ -475,15 +473,15 @@
//
//Add any existing organs in the owner that have us as parent
//
- for(var/obj/item/organ/internal/I in owner.get_internal_organs())
- if(I.parent_organ == organ_tag)
- LAZYDISTINCTADD(internal_organs, I)
+ for(var/obj/item/organ/internal/internal_organ in owner.get_internal_organs())
+ if(internal_organ.parent_organ == organ_tag)
+ LAZYDISTINCTADD(internal_organs, internal_organ)
update_internal_organs_cost()
- for(var/obj/item/organ/external/E in owner.get_external_organs())
- if(E.parent_organ == organ_tag)
- E.parent = src
- LAZYDISTINCTADD(children, E)
+ for(var/obj/item/organ/external/external_organ in owner.get_external_organs())
+ if(external_organ.parent_organ == organ_tag)
+ external_organ.parent = src
+ LAZYDISTINCTADD(children, external_organ)
//Add any existing implants that should be refering us
for(var/obj/implant in implants)
@@ -496,10 +494,10 @@
//Since limbs attached during surgery have their internal organs detached, we want to re-attach them if we're doing the proper install of the parent limb
else if(istype(implant, /obj/item/organ) && !detached)
- var/obj/item/organ/O = implant
- if(O.parent_organ == organ_tag)
+ var/obj/item/organ/detached_organ = implant
+ if(detached_organ.parent_organ == organ_tag)
//The add_organ chain will automatically handle properly removing the detached flag, and moving it to the proper lists
- owner.add_organ(O, src, in_place, update_icon, detached)
+ owner.add_organ(detached_organ, src, in_place, update_icon, detached)
else
//Handle installing into a stand-alone parent limb to keep dropped limbs in some kind of coherent state
if(!affected)
@@ -523,9 +521,9 @@
LAZYDISTINCTADD(parent.children, src) //Even when detached the limb has to be in the children list, because of the way limbs icon are handled
//Remove any stump wound for this slot
- for(var/datum/wound/lost_limb/W in parent.wounds)
- if(W.limb_tag == organ_tag)
- qdel(W) //Removes itself from parent.wounds
+ for(var/datum/wound/lost_limb/stump in parent.wounds)
+ if(stump.limb_tag == organ_tag)
+ qdel(stump) //Removes itself from parent.wounds
break
if(!in_place)
@@ -586,8 +584,8 @@
if(BURN) src.heal_damage(0, repair_amount, 0, 1)
owner.try_refresh_visible_overlays()
if(user == src.owner)
- var/decl/pronouns/G = user.get_pronouns()
- user.visible_message(SPAN_NOTICE("\The [user] patches [damage_desc] on [G.his] [name] with \the [tool]."))
+ var/decl/pronouns/user_pronouns = user.get_pronouns()
+ user.visible_message(SPAN_NOTICE("\The [user] patches [damage_desc] on [user_pronouns.his] [name] with \the [tool]."))
else
user.visible_message(SPAN_NOTICE("\The [user] patches [damage_desc] on \the [owner]'s [name] with \the [tool]."))
return 1
@@ -631,11 +629,11 @@ This function completely restores a damaged organ to perfect condition.
/obj/item/organ/external/remove_rejuv()
if(owner)
owner.remove_organ(src, FALSE, FALSE, TRUE, TRUE, FALSE)
- for(var/obj/item/organ/external/E in children)
- E.remove_rejuv()
+ for(var/obj/item/organ/external/child in children)
+ child.remove_rejuv()
LAZYCLEARLIST(children)
- for(var/obj/item/organ/internal/I in internal_organs)
- I.remove_rejuv()
+ for(var/obj/item/organ/internal/internal_organ in internal_organs)
+ internal_organ.remove_rejuv()
..()
/obj/item/organ/external/proc/createwound(var/type = CUT, var/damage, var/surgical)
@@ -680,44 +678,44 @@ This function completely restores a damaged organ to perfect condition.
if((type == CUT || type == BRUISE) && damage >= 5)
//we need to make sure that the wound we are going to worsen is compatible with the type of damage...
var/list/compatible_wounds = list()
- for (var/datum/wound/W in wounds)
- if (W.can_worsen(type, damage))
- compatible_wounds += W
+ for (var/datum/wound/wound in wounds)
+ if (wound.can_worsen(type, damage))
+ compatible_wounds += wound
if(compatible_wounds.len)
- var/datum/wound/W = pick(compatible_wounds)
- W.open_wound(damage)
+ var/datum/wound/wound = pick(compatible_wounds)
+ wound.open_wound(damage)
if(owner && prob(25))
if(BP_IS_CRYSTAL(src))
- owner.visible_message("The cracks in \the [owner]'s [name] spread.",\
- "The cracks in your [name] spread.",\
- "You hear the cracking of crystal.")
+ owner.visible_message(SPAN_DANGER("The cracks in \the [owner]'s [name] spread."),\
+ SPAN_DANGER("The cracks in your [name] spread."),\
+ SPAN_DANGER("You hear the cracking of crystal."))
else if(BP_IS_PROSTHETIC(src))
- owner.visible_message("The damage to \the [owner]'s [name] worsens.",\
- "The damage to your [name] worsens.",\
- "You hear the screech of abused metal.")
+ owner.visible_message(SPAN_DANGER("The damage to \the [owner]'s [name] worsens."),\
+ SPAN_DANGER("The damage to your [name] worsens."),\
+ SPAN_DANGER("You hear the screech of abused metal."))
else
- owner.visible_message("The wound on \the [owner]'s [name] widens with a nasty ripping noise.",\
- "The wound on your [name] widens with a nasty ripping noise.",\
- "You hear a nasty ripping noise, as if flesh is being torn apart.")
- return W
+ owner.visible_message(SPAN_DANGER("The wound on \the [owner]'s [name] widens with a nasty ripping noise."),\
+ SPAN_DANGER("The wound on your [name] widens with a nasty ripping noise."),\
+ SPAN_DANGER("You hear a nasty ripping noise, as if flesh is being torn apart."))
+ return wound
//Creating wound
var/wound_type = get_wound_type(type, damage)
if(wound_type)
- var/datum/wound/W = new wound_type(damage, src, surgical)
+ var/datum/wound/wound = new wound_type(damage, src, surgical)
//Check whether we can add the wound to an existing wound
if(surgical)
- W.autoheal_cutoff = 0
+ wound.autoheal_cutoff = 0
else
for(var/datum/wound/other in wounds)
- if(other.can_merge_wounds(W))
- other.merge_wound(W)
+ if(other.can_merge_wounds(wound))
+ other.merge_wound(wound)
return
- LAZYADD(wounds, W)
- return W
+ LAZYADD(wounds, wound)
+ return wound
/****************************************************
PROCESSING & UPDATING
@@ -745,8 +743,8 @@ This function completely restores a damaged organ to perfect condition.
if(get_genetic_damage())
return TRUE
- for(var/obj/item/organ/internal/I in internal_organs)
- if(I.getToxLoss())
+ for(var/obj/item/organ/internal/internal_organ in internal_organs)
+ if(internal_organ.getToxLoss())
return TRUE
if(last_dam != brute_dam + burn_dam) // Process when we are fully healed up.
@@ -809,18 +807,18 @@ Note that amputating the affected organ does in fact remove the infection from t
handle_germ_effects()
/obj/item/organ/external/proc/handle_germ_sync()
- var/turf/T = get_turf(owner)
- for(var/datum/wound/W in wounds)
+ var/turf/current_turf = get_turf(owner)
+ for(var/datum/wound/wound in wounds)
//Open wounds can become infected
- // what in the hell is this doing with T?
- if(max(istype(T) && T.simulated && T.get_dirt()*10, 2*owner.germ_level) > W.germ_level && W.infection_check())
- W.germ_level++
+ // what in the hell is this doing with current_turf?
+ if(max(istype(current_turf) && current_turf.simulated && current_turf.get_dirt()*10, 2*owner.germ_level) > wound.germ_level && wound.infection_check())
+ wound.germ_level++
var/antibiotics = GET_CHEMICAL_EFFECT(owner, CE_ANTIBIOTIC)
if (!antibiotics)
- for(var/datum/wound/W in wounds)
+ for(var/datum/wound/wound in wounds)
//Infected wounds raise the organ's germ level
- if (W.germ_level > germ_level || prob(min(W.germ_level, 30)))
+ if (wound.germ_level > germ_level || prob(min(wound.germ_level, 30)))
germ_level++
break //limit increase to a maximum of one per second
@@ -834,17 +832,17 @@ Note that amputating the affected organ does in fact remove the infection from t
if(germ_level >= INFECTION_LEVEL_TWO)
//spread the infection to internal organs
var/obj/item/organ/target_organ = null //make internal organs become infected one at a time instead of all at once
- for (var/obj/item/organ/I in internal_organs)
- if (I.germ_level > 0 && I.germ_level < min(germ_level, INFECTION_LEVEL_TWO)) //once the organ reaches whatever we can give it, or level two, switch to a different one
- if (!target_organ || I.germ_level > target_organ.germ_level) //choose the organ with the highest germ_level
- target_organ = I
+ for (var/obj/item/organ/internal_organ in internal_organs)
+ if (internal_organ.germ_level > 0 && internal_organ.germ_level < min(germ_level, INFECTION_LEVEL_TWO)) //once the organ reaches whatever we can give it, or level two, switch to a different one
+ if (!target_organ || internal_organ.germ_level > target_organ.germ_level) //choose the organ with the highest germ_level
+ target_organ = internal_organ
if (!target_organ)
//figure out which organs we can spread germs to and pick one at random
var/list/candidate_organs = list()
- for (var/obj/item/organ/I in internal_organs)
- if (I.germ_level < germ_level)
- candidate_organs |= I
+ for (var/obj/item/organ/internal_organ in internal_organs)
+ if (internal_organ.germ_level < germ_level)
+ candidate_organs |= internal_organ
if (candidate_organs.len)
target_organ = pick(candidate_organs)
@@ -865,7 +863,7 @@ Note that amputating the affected organ does in fact remove the infection from t
if(germ_level >= INFECTION_LEVEL_THREE && antibiotics < REAGENTS_OVERDOSE) //overdosing is necessary to stop severe infections
if (!(status & ORGAN_DEAD))
status |= ORGAN_DEAD
- to_chat(owner, "You can't feel your [name] anymore...")
+ to_chat(owner, SPAN_NOTICE("You can't feel your [name] anymore..."))
owner.update_body(1)
germ_level++
@@ -876,18 +874,18 @@ Note that amputating the affected organ does in fact remove the infection from t
var/update_surgery
if(BP_IS_PROSTHETIC(src) || BP_IS_CRYSTAL(src)) //Robotic limbs don't heal or get worse.
- for(var/datum/wound/W in wounds) //Repaired wounds disappear though
- if(W.damage <= 0) //and they disappear right away
- qdel(W) //TODO: robot wounds for robot limbs
+ for(var/datum/wound/wound in wounds) //Repaired wounds disappear though
+ if(wound.damage <= 0) //and they disappear right away
+ qdel(wound) //TODO: robot wounds for robot limbs
update_surgery = TRUE
if(owner && update_surgery)
owner.update_surgery()
return
- for(var/datum/wound/W in wounds)
+ for(var/datum/wound/wound in wounds)
// wounds can disappear after 10 minutes at the earliest
- if(W.damage <= 0 && W.created + (10 MINUTES) <= world.time)
- qdel(W)
+ if(wound.damage <= 0 && wound.created + (10 MINUTES) <= world.time)
+ qdel(wound)
update_surgery = TRUE
continue
// let the GC handle the deletion of the wound
@@ -895,7 +893,7 @@ Note that amputating the affected organ does in fact remove the infection from t
// slow healing
var/heal_amt = 0
// if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round.
- if (owner && !GET_CHEMICAL_EFFECT(owner, CE_TOXIN) && W.can_autoheal() && W.wound_damage() && brute_ratio < 0.5 && burn_ratio < 0.5)
+ if (owner && !GET_CHEMICAL_EFFECT(owner, CE_TOXIN) && wound.can_autoheal() && wound.wound_damage() && brute_ratio < 0.5 && burn_ratio < 0.5)
heal_amt += 0.5
// we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime
@@ -912,10 +910,10 @@ Note that amputating the affected organ does in fact remove the infection from t
// making it look prettier on scanners
heal_amt = round(heal_amt,0.1)
var/dam_type = BRUTE
- if(W.damage_type == BURN)
+ if(wound.damage_type == BURN)
dam_type = BURN
if(owner?.can_autoheal(dam_type))
- W.heal_damage(heal_amt)
+ wound.heal_damage(heal_amt)
// sync the organ's damage with its wounds
update_damages()
@@ -933,29 +931,30 @@ Note that amputating the affected organ does in fact remove the infection from t
status &= ~ORGAN_BLEEDING
var/clamped = 0
- var/mob/living/human/H
+ // This is defined outside of the loop as an optimization for a large number of wounds.
+ var/mob/living/human/human_owner
if(ishuman(owner))
- H = owner
+ human_owner = owner
//update damage counts
var/bleeds = (!BP_IS_PROSTHETIC(src) && !BP_IS_CRYSTAL(src))
- for(var/datum/wound/W in wounds)
+ for(var/datum/wound/wound in wounds)
- if(W.damage <= 0)
- qdel(W)
+ if(wound.damage <= 0)
+ qdel(wound)
continue
- if(W.damage_type == BURN)
- burn_dam += W.damage
+ if(wound.damage_type == BURN)
+ burn_dam += wound.damage
else
- brute_dam += W.damage
+ brute_dam += wound.damage
- if(bleeds && W.bleeding() && (H && H.should_have_organ(BP_HEART)))
- W.bleed_timer--
+ if(bleeds && wound.bleeding() && (human_owner && human_owner.should_have_organ(BP_HEART)))
+ wound.bleed_timer--
status |= ORGAN_BLEEDING
- clamped |= W.clamped
- number_wounds += W.amount
+ clamped |= wound.clamped
+ number_wounds += wound.amount
damage = brute_dam + burn_dam
update_damage_ratios()
@@ -1060,10 +1059,10 @@ Note that amputating the affected organ does in fact remove the infection from t
. = new /obj/effect/decal/cleanable/blood/gibs(dropturf)
if(species && istype(., /obj/effect/decal/cleanable/blood/gibs))
- var/obj/effect/decal/cleanable/blood/gibs/G = .
- G.fleshcolor = species.get_species_flesh_color(owner)
- G.basecolor = species.get_species_blood_color(owner)
- G.update_icon()
+ var/obj/effect/decal/cleanable/blood/gibs/gibs = .
+ gibs.fleshcolor = species.get_species_flesh_color(owner)
+ gibs.basecolor = species.get_species_blood_color(owner)
+ gibs.update_icon()
//Handles dismemberment
/obj/item/organ/external/proc/dismember(var/clean, var/disintegrate = DISMEMBER_METHOD_EDGE, var/ignore_children, var/silent, var/ignore_last_organ)
@@ -1078,9 +1077,9 @@ Note that amputating the affected organ does in fact remove the infection from t
var/list/organ_msgs = get_droplimb_messages_for(disintegrate, clean)
if(LAZYLEN(organ_msgs) >= 3)
- owner.visible_message("[organ_msgs[1]]", \
- "[organ_msgs[2]]", \
- "[organ_msgs[3]]")
+ owner.visible_message(SPAN_DANGER("[organ_msgs[1]]"), \
+ SPAN_MODERATE("[organ_msgs[2]]"), \
+ SPAN_DANGER("[organ_msgs[3]]"))
add_pain(60)
if(!clean)
@@ -1110,9 +1109,9 @@ Note that amputating the affected organ does in fact remove the infection from t
original_parent.sever_artery()
// Leave a big ol hole.
- var/datum/wound/lost_limb/W = new(src, disintegrate, clean)
- W.parent_organ = original_parent
- LAZYADD(original_parent.wounds, W)
+ var/datum/wound/lost_limb/stump = new(src, disintegrate, clean)
+ stump.parent_organ = original_parent
+ LAZYADD(original_parent.wounds, stump)
original_parent.update_damages()
if(QDELETED(src))
@@ -1135,19 +1134,19 @@ Note that amputating the affected organ does in fact remove the infection from t
var/atom/movable/gore = place_remains_from_dismember_method(disintegrate)
if(gore)
if(disintegrate == DISMEMBER_METHOD_BURN || disintegrate == DISMEMBER_METHOD_ACID)
- for(var/obj/item/I in src)
- if(I.w_class > ITEM_SIZE_SMALL && !istype(I,/obj/item/organ))
- I.dropInto(loc)
+ for(var/obj/item/contained_item in src)
+ if(contained_item.w_class > ITEM_SIZE_SMALL && !istype(contained_item, /obj/item/organ))
+ contained_item.dropInto(loc)
else if(disintegrate == DISMEMBER_METHOD_BLUNT)
gore.throw_at(get_edge_target_turf(src,pick(global.alldirs)), rand(1,3), THROWFORCE_GIBS)
- for(var/obj/item/organ/I in internal_organs)
- I.do_uninstall() //No owner so run uninstall directly
- I.dropInto(get_turf(loc))
- if(!QDELETED(I) && isturf(loc))
- I.throw_at(get_edge_target_turf(src,pick(global.alldirs)), rand(1,3), THROWFORCE_GIBS)
- for(var/obj/item/I in src)
- I.dropInto(loc)
- I.throw_at(get_edge_target_turf(src,pick(global.alldirs)), rand(1,3), THROWFORCE_GIBS)
+ for(var/obj/item/organ/internal_organ in internal_organs)
+ internal_organ.do_uninstall() //No owner so run uninstall directly
+ internal_organ.dropInto(get_turf(loc))
+ if(!QDELETED(internal_organ) && isturf(loc))
+ internal_organ.throw_at(get_edge_target_turf(src,pick(global.alldirs)), rand(1,3), THROWFORCE_GIBS)
+ for(var/obj/item/contained_item in src)
+ contained_item.dropInto(loc)
+ contained_item.throw_at(get_edge_target_turf(src,pick(global.alldirs)), rand(1,3), THROWFORCE_GIBS)
if(!QDELETED(src))
qdel(src)
@@ -1169,70 +1168,70 @@ Note that amputating the affected organ does in fact remove the infection from t
// checks if all wounds on the organ are bandaged
/obj/item/organ/external/proc/is_bandaged()
- for(var/datum/wound/W in wounds)
- if(!W.bandaged)
+ for(var/datum/wound/wound in wounds)
+ if(!wound.bandaged)
return 0
return 1
// checks if all wounds on the organ are salved
/obj/item/organ/external/proc/is_salved()
- for(var/datum/wound/W in wounds)
- if(!W.salved)
+ for(var/datum/wound/wound in wounds)
+ if(!wound.salved)
return 0
return 1
// checks if all wounds on the organ are disinfected
/obj/item/organ/external/proc/is_disinfected()
- for(var/datum/wound/W in wounds)
- if(!W.disinfected)
+ for(var/datum/wound/wound in wounds)
+ if(!wound.disinfected)
return 0
return 1
/obj/item/organ/external/proc/salve()
var/rval = 0
- for(var/datum/wound/W in wounds)
- rval |= !W.salved
- W.salved = 1
+ for(var/datum/wound/wound in wounds)
+ rval |= !wound.salved
+ wound.salved = 1
return rval
/obj/item/organ/external/proc/disinfect()
var/rval = 0
- for(var/datum/wound/W in wounds)
- rval |= !W.disinfected
- W.disinfected = 1
- W.germ_level = 0
+ for(var/datum/wound/wound in wounds)
+ rval |= !wound.disinfected
+ wound.disinfected = 1
+ wound.germ_level = 0
return rval
/obj/item/organ/external/proc/clamp_organ()
var/rval = 0
src.status &= ~ORGAN_BLEEDING
- for(var/datum/wound/W in wounds)
- rval |= !W.clamped
- W.clamped = 1
+ for(var/datum/wound/wound in wounds)
+ rval |= !wound.clamped
+ wound.clamped = 1
return rval
/obj/item/organ/external/proc/clamped()
- for(var/datum/wound/W in wounds)
- if(W.clamped)
+ for(var/datum/wound/wound in wounds)
+ if(wound.clamped)
return 1
/obj/item/organ/external/proc/remove_clamps()
var/rval = 0
- for(var/datum/wound/W in wounds)
- rval |= W.clamped
- W.clamped = 0
+ for(var/datum/wound/wound in wounds)
+ rval |= wound.clamped
+ wound.clamped = 0
return rval
// open incisions and expose implants
// this is the retract step of surgery
/obj/item/organ/external/proc/open_incision()
- var/datum/wound/W = get_incision()
- if(!W) return
- W.open_wound(min(W.damage * 2, W.damage_list[1] - W.damage))
+ var/datum/wound/incision = get_incision()
+ if(!incision) return
+ incision.open_wound(min(incision.damage * 2, incision.damage_list[1] - incision.damage))
if(!encased)
- for(var/obj/item/implant/I in implants)
- I.exposed()
+ for(var/obj/item/implant/implant in implants)
+ implant.exposed()
/obj/item/organ/external/proc/fracture()
if(!get_config_value(/decl/config/toggle/on/health_bones_can_break))
@@ -1244,9 +1243,9 @@ Note that amputating the affected organ does in fact remove the infection from t
if(owner)
owner.visible_message(\
- "You hear a loud cracking sound coming from \the [owner].",\
- "Something feels like it shattered in your [name]!",\
- "You hear a sickening crack.")
+ SPAN_DANGER("You hear a loud cracking sound coming from \the [owner]."),\
+ SPAN_DANGER("Something feels like it shattered in your [name]!"),\
+ SPAN_DANGER("You hear a sickening crack."))
jostle_bone()
if(can_feel_pain())
owner.emote(/decl/emote/audible/scream)
@@ -1305,8 +1304,8 @@ Note that amputating the affected organ does in fact remove the infection from t
return (brute_dam+burn_dam) //could use max_damage?
/obj/item/organ/external/proc/has_infected_wound()
- for(var/datum/wound/W in wounds)
- if(W.germ_level > INFECTION_LEVEL_ONE)
+ for(var/datum/wound/wound in wounds)
+ if(wound.germ_level > INFECTION_LEVEL_ONE)
return 1
return 0
@@ -1327,38 +1326,38 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/is_malfunctioning()
return (is_robotic() && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam))
-/obj/item/organ/external/proc/embed_in_organ(var/obj/item/W, var/silent = FALSE, var/supplied_message, var/datum/wound/supplied_wound)
+/obj/item/organ/external/proc/embed_in_organ(var/obj/item/embedding, var/silent = FALSE, var/supplied_message, var/datum/wound/supplied_wound)
if(!owner || loc != owner)
return
if(species.species_flags & SPECIES_FLAG_NO_EMBED)
return
if(!silent)
if(supplied_message)
- owner.visible_message("[supplied_message]")
+ owner.visible_message(SPAN_DANGER("[supplied_message]"))
else
- owner.visible_message("\The [W] sticks in the wound!")
+ owner.visible_message(SPAN_DANGER("\The [embedding] sticks in the wound!"))
if(!supplied_wound)
for(var/datum/wound/wound in wounds)
- if((wound.damage_type == CUT || wound.damage_type == PIERCE) && wound.damage >= W.w_class * 5)
+ if((wound.damage_type == CUT || wound.damage_type == PIERCE) && wound.damage >= embedding.w_class * 5)
supplied_wound = wound
break
if(!supplied_wound)
- supplied_wound = createwound(PIERCE, W.w_class * 5)
+ supplied_wound = createwound(PIERCE, embedding.w_class * 5)
- if(!supplied_wound || (W in supplied_wound.embedded_objects)) // Just in case.
+ if(!supplied_wound || (embedding in supplied_wound.embedded_objects)) // Just in case.
return
- LAZYDISTINCTADD(supplied_wound.embedded_objects, W)
- LAZYDISTINCTADD(implants, W)
+ LAZYDISTINCTADD(supplied_wound.embedded_objects, embedding)
+ LAZYDISTINCTADD(implants, embedding)
owner.embedded_flag = 1
owner.verbs += /mob/proc/yank_out_object
- W.add_blood(owner)
- if(ismob(W.loc))
- var/mob/living/H = W.loc
- H.drop_from_inventory(W)
- W.forceMove(owner)
+ embedding.add_blood(owner)
+ if(ismob(embedding.loc))
+ var/mob/living/holder = embedding.loc
+ holder.drop_from_inventory(embedding)
+ embedding.forceMove(owner)
/obj/item/organ/external/do_uninstall(in_place, detach, ignore_children, update_icon)
@@ -1369,11 +1368,11 @@ Note that amputating the affected organ does in fact remove the infection from t
if(victim)
if(in_place)
//When removing in place, we don't bother with moving child organs and implants, we just clear the refs
- for(var/obj/item/implant/I in implants)
- I.removed()
+ for(var/obj/item/implant/implant in implants)
+ implant.removed()
//Remove the parent ref from all childs limbs until we replace the organ in place
- for(var/obj/item/organ/external/E in children)
- E.parent = null
+ for(var/obj/item/organ/external/child in children)
+ child.parent = null
implants = null
children = null
@@ -1382,28 +1381,28 @@ Note that amputating the affected organ does in fact remove the infection from t
//Move over our implants/items into us, and drop whatever else is too big or not an object(??)
for(var/atom/movable/implant in implants)
//large items and non-item objs fall to the floor, everything else stays
- var/obj/item/I = implant
+ var/obj/item/item_implant = implant
if(QDELETED(implant))
LAZYREMOVE(implants, implant)
continue
- if(istype(I) && I.w_class < ITEM_SIZE_NORMAL)
- if(istype(I, /obj/item/implant))
- var/obj/item/implant/imp = I
+ if(istype(item_implant) && item_implant.w_class < ITEM_SIZE_NORMAL)
+ if(istype(item_implant, /obj/item/implant))
+ var/obj/item/implant/imp = item_implant
imp.removed()
implant.forceMove(src)
- else
- //Dumpt the rest on the turf
+ else // Is this even necessary? What non-items can even get added to implants?
+ //Dump the rest on the turf
LAZYREMOVE(implants, implant)
implant.forceMove(get_turf(src))
if(!ignore_children)
//Move our chilren limb into our contents
- for(var/obj/item/organ/external/O in children)
- victim.remove_organ(O, FALSE, FALSE, FALSE, in_place, update_icon)
- if(QDELETED(O))
- LAZYREMOVE(children, O)
+ for(var/obj/item/organ/external/child in children)
+ victim.remove_organ(child, FALSE, FALSE, FALSE, in_place, update_icon)
+ if(QDELETED(child))
+ LAZYREMOVE(children, child)
continue
- O.do_install(null, src, FALSE, update_icon, FALSE) //Forcemove the organ and properly set it up in our internal data
+ child.do_install(null, src, FALSE, update_icon, FALSE) //Forcemove the organ and properly set it up in our internal data
// Grab all the children internal organs
for(var/obj/item/organ/internal/organ in internal_organs)
@@ -1448,13 +1447,13 @@ Note that amputating the affected organ does in fact remove the infection from t
return
if(owner)
if(type == BRUTE)
- owner.visible_message("You hear a sickening cracking sound coming from \the [owner]'s [name].", \
- "Your [name] becomes a mangled mess!", \
- "You hear a sickening crack.")
+ owner.visible_message(SPAN_DANGER("You hear a sickening cracking sound coming from \the [owner]'s [name]."), \
+ SPAN_DANGER("Your [name] becomes a mangled mess!"), \
+ SPAN_DANGER("You hear a sickening crack."))
else
- owner.visible_message("\The [owner]'s [name] melts away, turning into mangled mess!", \
- "Your [name] melts away!", \
- "You hear a sickening sizzle.")
+ owner.visible_message(SPAN_DANGER("\The [owner]'s [name] melts away, turning into mangled mess!"), \
+ SPAN_DANGER("Your [name] melts away!"), \
+ SPAN_DANGER("You hear a sickening sizzle."))
status |= ORGAN_DISFIGURED
/obj/item/organ/external/proc/get_incision(var/strict)
@@ -1465,20 +1464,20 @@ Note that amputating the affected organ does in fact remove the infection from t
if(!incision || incision.damage < other.damage)
incision = other
else
- for(var/datum/wound/cut/W in wounds)
- if(!W.is_open()) // Shit's unusable
+ for(var/datum/wound/cut/candidate_incision in wounds)
+ if(!candidate_incision.is_open()) // Shit's unusable
continue
- if(strict && !W.is_surgical()) //We don't need dirty ones
+ if(strict && !candidate_incision.is_surgical()) //We don't need dirty ones
continue
if(!incision)
- incision = W
+ incision = candidate_incision
continue
- var/same = W.is_surgical() == incision.is_surgical()
+ var/same = candidate_incision.is_surgical() == incision.is_surgical()
if(same) //If they're both dirty or both are surgical, just get bigger one
- if(W.damage > incision.damage)
- incision = W
- else if(W.is_surgical()) //otherwise surgical one takes priority
- incision = W
+ if(candidate_incision.damage > incision.damage)
+ incision = candidate_incision
+ else if(candidate_incision.is_surgical()) //otherwise surgical one takes priority
+ incision = candidate_incision
return incision
/obj/item/organ/external/proc/how_open()
@@ -1510,8 +1509,8 @@ Note that amputating the affected organ does in fact remove the infection from t
return
if(LAZYLEN(internal_organs) && prob(brute_dam + force))
owner.custom_pain("A piece of bone in your [encased ? encased : name] moves painfully!", 50, affecting = src)
- var/obj/item/organ/internal/I = pick(internal_organs)
- I.take_internal_damage(rand(3,5))
+ var/obj/item/organ/internal/internal_organ = pick(internal_organs)
+ internal_organ.take_internal_damage(rand(3,5))
/obj/item/organ/external/proc/jointlock(mob/attacker)
if(!can_feel_pain())
@@ -1519,7 +1518,7 @@ Note that amputating the affected organ does in fact remove the infection from t
var/armor = 100 * owner.get_blocked_ratio(owner, BRUTE, damage = 30)
if(armor < 70)
- to_chat(owner, "You feel extreme pain!")
+ to_chat(owner, SPAN_DANGER("You feel extreme pain!"))
var/max_halloss = round(owner.species.total_health * 0.8 * ((100 - armor) / 100)) //up to 80% of passing out, further reduced by armour
add_pain(clamp(0, max_halloss - owner.get_damage(PAIN), 30))
@@ -1529,18 +1528,18 @@ Note that amputating the affected organ does in fact remove the infection from t
var/key = used_weapon
var/data = used_weapon
if(istype(used_weapon, /obj/item))
- var/obj/item/I = used_weapon
- key = I.name
- data = english_list(I.get_autopsy_descriptors())
- var/datum/autopsy_data/W = LAZYACCESS(autopsy_data, key)
- if(!W)
- W = new()
- W.weapon = data
- LAZYSET(autopsy_data, key, W)
-
- W.hits += 1
- W.damage += damage
- W.time_inflicted = world.time
+ var/obj/item/used_item = used_weapon
+ key = used_item.name
+ data = english_list(used_item.get_autopsy_descriptors())
+ var/datum/autopsy_data/autopsy_datum = LAZYACCESS(autopsy_data, key)
+ if(!autopsy_datum)
+ autopsy_datum = new()
+ autopsy_datum.weapon = data
+ LAZYSET(autopsy_data, key, autopsy_datum)
+
+ autopsy_datum.hits += 1
+ autopsy_datum.damage += damage
+ autopsy_datum.time_inflicted = world.time
/obj/item/organ/external/proc/has_genitals()
return !BP_IS_PROSTHETIC(src) && bodytype?.get_vulnerable_location() == organ_tag
@@ -1600,8 +1599,8 @@ Note that amputating the affected organ does in fact remove the infection from t
if(isnull(vital_to_owner))
. = ..()
if(!.)
- for(var/obj/item/organ/O in children)
- if(O.is_vital_to_owner())
+ for(var/obj/item/organ/child in children)
+ if(child.is_vital_to_owner())
vital_to_owner = TRUE
break
return vital_to_owner
diff --git a/code/modules/organs/internal/_internal.dm b/code/modules/organs/internal/_internal.dm
index 4ced3c84d5a..217cd539aa3 100644
--- a/code/modules/organs/internal/_internal.dm
+++ b/code/modules/organs/internal/_internal.dm
@@ -279,7 +279,7 @@
brainmob.languages = M.languages?.Copy()
brainmob.default_language = M.default_language
to_chat(brainmob, SPAN_NOTICE("You feel slightly disoriented. That's normal when you're just \a [initial(src.name)]."))
- callHook("debrain", list(brainmob))
+ RAISE_EVENT(/decl/observ/debrain, brainmob, src, M)
return TRUE
return FALSE
diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm
index 960f437fde0..09774614695 100644
--- a/code/modules/projectiles/projectile/beams.dm
+++ b/code/modules/projectiles/projectile/beams.dm
@@ -19,6 +19,10 @@
tracer_type = /obj/effect/projectile/tracer/laser
impact_type = /obj/effect/projectile/impact/laser
+/obj/item/projectile/beam/megabot
+ damage = 45
+ distance_falloff = 0.5
+
/obj/item/projectile/beam/variable
muzzle_type = /obj/effect/projectile/muzzle/variable
tracer_type = /obj/effect/projectile/tracer/variable
diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm
index 33165821ff6..111008ff5d7 100644
--- a/code/modules/projectiles/projectile/special.dm
+++ b/code/modules/projectiles/projectile/special.dm
@@ -27,11 +27,22 @@
icon_state= "bolter"
damage = 50
damage_flags = DAM_BULLET | DAM_SHARP | DAM_EDGE
+ var/gyro_devastation = -1
+ var/gyro_heavy_impact = 0
+ var/gyro_light_impact = 2
/obj/item/projectile/bullet/gyro/on_hit(var/atom/target, var/blocked = 0)
- explosion(target, -1, 0, 2)
+ target = get_turf(target)
+ if(istype(target))
+ explosion(target, gyro_devastation, gyro_heavy_impact, gyro_light_impact)
return 1
+/obj/item/projectile/bullet/gyro/microrocket
+ name = "microrocket"
+ distance_falloff = 1.3
+ fire_sound = 'sound/effects/Explosion1.ogg'
+ gyro_light_impact = 1
+
/obj/item/projectile/temp
name = "freeze beam"
icon_state = "ice_2"
diff --git a/code/modules/random_map/drop/droppod.dm b/code/modules/random_map/drop/droppod.dm
index c84dd4cb6ea..1701c7e77fe 100644
--- a/code/modules/random_map/drop/droppod.dm
+++ b/code/modules/random_map/drop/droppod.dm
@@ -15,7 +15,7 @@
floor_type = /turf/floor/reinforced
var/list/supplied_drop_types = list()
var/door_type = /obj/structure/droppod_door
- var/drop_type = /mob/living/simple_animal/hostile/retaliate/parrot
+ var/drop_type = /mob/living/simple_animal/hostile/parrot
var/auto_open_doors
var/placement_explosion_dev = 1
diff --git a/code/modules/reagents/reactions/_reaction.dm b/code/modules/reagents/reactions/_reaction.dm
index 7725ffdff81..db0c252978a 100644
--- a/code/modules/reagents/reactions/_reaction.dm
+++ b/code/modules/reagents/reactions/_reaction.dm
@@ -14,7 +14,7 @@
var/reaction_sound = 'sound/effects/bubbles.ogg'
var/lore_text
var/mechanics_text
- var/reaction_category
+ var/reaction_category = REACTION_TYPE_COMPOUND
/// Flags used when reaction processing.
var/chemical_reaction_flags = 0
diff --git a/code/modules/reagents/reactions/reaction_compounds.dm b/code/modules/reagents/reactions/reaction_compounds.dm
index 25fe15e5b28..e27f62157e4 100644
--- a/code/modules/reagents/reactions/reaction_compounds.dm
+++ b/code/modules/reagents/reactions/reaction_compounds.dm
@@ -1,6 +1,5 @@
/decl/chemical_reaction/compound
abstract_type = /decl/chemical_reaction/compound
- reaction_category = REACTION_TYPE_COMPOUND
/decl/chemical_reaction/compound/surfactant
name = "Azosurfactant"
diff --git a/code/modules/reagents/reactions/reaction_grenade_reaction.dm b/code/modules/reagents/reactions/reaction_grenade_reaction.dm
index dd3aaac6be8..a55899a97ea 100644
--- a/code/modules/reagents/reactions/reaction_grenade_reaction.dm
+++ b/code/modules/reagents/reactions/reaction_grenade_reaction.dm
@@ -3,6 +3,7 @@
abstract_type = /decl/chemical_reaction/grenade_reaction
result_amount = 1
chemical_reaction_flags = CHEM_REACTION_FLAG_OVERFLOW_CONTAINER
+ reaction_category = REACTION_TYPE_COMPOUND
/decl/chemical_reaction/grenade_reaction/explosion_potassium
name = "Explosion"
diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm
index aa9eb80cfff..92ebdc04212 100644
--- a/code/modules/reagents/reagent_containers/glass.dm
+++ b/code/modules/reagents/reagent_containers/glass.dm
@@ -31,7 +31,7 @@
/obj/structure/iv_drip,
/obj/machinery/disposal,
/mob/living/simple_animal/cow,
- /mob/living/simple_animal/hostile/retaliate/goat,
+ /mob/living/simple_animal/hostile/goat,
/obj/machinery/sleeper,
/obj/machinery/smartfridge/,
/obj/machinery/biogenerator,
diff --git a/code/modules/recycling/disposalholder.dm b/code/modules/recycling/disposalholder.dm
index 120782aaff4..4f3546d06a6 100644
--- a/code/modules/recycling/disposalholder.dm
+++ b/code/modules/recycling/disposalholder.dm
@@ -18,9 +18,9 @@
var/partialTag = "" //set by a partial tagger the first time round, then put in destinationTag if it goes through again.
// initialize a holder from the contents of a disposal unit
-/obj/structure/disposalholder/proc/init(var/obj/machinery/disposal/D, var/datum/gas_mixture/flush_gas)
+/obj/structure/disposalholder/proc/init(var/obj/machinery/disposal/disposal_unit, var/datum/gas_mixture/flush_gas)
gas = flush_gas// transfer gas resv. into holder object -- let's be explicit about the data this proc consumes, please.
- var/stuff = D.get_contained_external_atoms()
+ var/stuff = disposal_unit.get_contained_external_atoms()
//Check for any living mobs trigger hasmob.
//hasmob effects whether the package goes to cargo or its tagged destination.
hasmob = length(check_mob(stuff))
@@ -36,20 +36,20 @@
/obj/structure/disposalholder/proc/check_mob(list/stuff, max_depth = 1)
. = list()
if(max_depth > 0)
- for(var/mob/living/M in stuff)
- if (!isdrone(M))
- . += M
- for(var/obj/O in stuff)
- . += check_mob(O.contents, max_depth - 1)
+ for(var/mob/living/victim in stuff)
+ if (!isdrone(victim))
+ . += victim
+ for(var/obj/container in stuff)
+ . += check_mob(container.contents, max_depth - 1)
// start the movement process
// argument is the disposal unit the holder started in
-/obj/structure/disposalholder/proc/start(var/obj/machinery/disposal/D)
- if(!D.trunk)
- D.expel(src) // no trunk connected, so expel immediately
+/obj/structure/disposalholder/proc/start(var/obj/machinery/disposal/disposal_unit)
+ if(!disposal_unit.trunk)
+ disposal_unit.expel(src) // no trunk connected, so expel immediately
return
- forceMove(D.trunk)
+ forceMove(disposal_unit.trunk)
active = 1
set_dir(DOWN)
START_PROCESSING(SSdisposals, src)
@@ -65,8 +65,8 @@
var/obj/structure/disposalpipe/last
if(hasmob && prob(3))
- for(var/mob/living/H in check_mob(src))
- H.apply_damage(30, BRUTE, null, DAM_DISPERSED, "Blunt Trauma", ARMOR_MELEE_MAJOR)//horribly maim any living creature jumping down disposals. c'est la vie
+ for(var/mob/living/victim in check_mob(src))
+ victim.apply_damage(30, BRUTE, null, DAM_DISPERSED, "Blunt Trauma", ARMOR_MELEE_MAJOR)//horribly maim any living creature jumping down disposals. c'est la vie
var/obj/structure/disposalpipe/curr = loc
if(!istype(curr))
@@ -87,26 +87,26 @@
return get_step(loc,dir)
// find a matching pipe on a turf
-/obj/structure/disposalholder/proc/findpipe(var/turf/T)
- if(!T)
+/obj/structure/disposalholder/proc/findpipe(var/turf/containing_turf)
+ if(!containing_turf)
return null
var/fdir = turn(dir, 180) // flip the movement direction
- for(var/obj/structure/disposalpipe/P in T)
- if(fdir & P.dpdir) // find pipe direction mask that matches flipped dir
- return P
+ for(var/obj/structure/disposalpipe/pipe in containing_turf)
+ if(fdir & pipe.dpdir) // find pipe direction mask that matches flipped dir
+ return pipe
// if no matching pipe, return null
return null
// merge two holder objects
// used when a a holder meets a stuck holder
/obj/structure/disposalholder/proc/merge(var/obj/structure/disposalholder/other)
- for(var/atom/movable/AM in other)
- AM.forceMove(src) // move everything in other holder to this one
- if(ismob(AM))
- var/mob/M = AM
- if(M.client) // if a client mob, update eye to follow this holder
- M.client.eye = src
+ for(var/atom/movable/other_movable in other)
+ other_movable.forceMove(src) // move everything in other holder to this one
+ if(ismob(other_movable))
+ var/mob/other_mob = other_movable
+ if(other_mob.client) // if a client mob, update eye to follow this holder
+ other_mob.client.eye = src
qdel(other)
/obj/structure/disposalholder/proc/settag(var/new_tag)
@@ -124,12 +124,12 @@
if(!isliving(user))
return
- var/mob/living/U = user
+ var/mob/living/living_user = user
- if (U.stat || U.is_on_special_ability_cooldown())
+ if (living_user.stat || living_user.is_on_special_ability_cooldown())
return
- U.set_special_ability_cooldown(10 SECONDS)
+ living_user.set_special_ability_cooldown(10 SECONDS)
var/turf/our_turf = get_turf(src)
if (our_turf)
diff --git a/code/modules/sealant_gun/sealant.dm b/code/modules/sealant_gun/sealant.dm
index 33e4b8d4a00..bd3abc985a2 100644
--- a/code/modules/sealant_gun/sealant.dm
+++ b/code/modules/sealant_gun/sealant.dm
@@ -38,7 +38,7 @@
break_apart(user)
return TRUE
-/obj/item/sealant/attackby(obj/item/W, mob/user)
+/obj/item/sealant/attackby(obj/item/used_item, mob/user)
break_apart(user)
return TRUE
@@ -54,9 +54,9 @@
user.setClickCooldown(1 SECOND)
qdel(src)
-/obj/item/sealant/Bump(atom/A, forced)
+/obj/item/sealant/Bump(atom/bumped, forced)
. = ..()
- splat(A)
+ splat(bumped)
/obj/item/sealant/throw_impact(atom/hit_atom)
. = ..()
@@ -66,18 +66,18 @@
if(splatted)
return
splatted = TRUE
- var/turf/T = get_turf(target) || get_turf(src)
- if(T)
- new /obj/effect/sealant(T)
+ var/turf/target_turf = get_turf(target) || get_turf(src)
+ if(target_turf)
+ new /obj/effect/sealant(target_turf)
if(isliving(target))
- var/mob/living/H = target
+ var/mob/living/living_target = target
for(var/slot in shuffle(splat_try_equip_slots))
- if(!H.get_equipped_item(slot))
- H.equip_to_slot_if_possible(src, slot)
- if(H.get_equipped_item(slot) == src)
+ if(!living_target.get_equipped_item(slot))
+ living_target.equip_to_slot_if_possible(src, slot)
+ if(living_target.get_equipped_item(slot) == src)
return
- if(!T.density && !(locate(foam_type) in T))
- new foam_type(T)
+ if(!target_turf.density && !(locate(foam_type) in target_turf))
+ new foam_type(target_turf)
if(!QDELETED(src))
qdel(src)
diff --git a/code/modules/shuttles/shuttle.dm b/code/modules/shuttles/shuttle.dm
index 8003c296df8..2c9600fad90 100644
--- a/code/modules/shuttles/shuttle.dm
+++ b/code/modules/shuttles/shuttle.dm
@@ -255,8 +255,11 @@
// remove the old ceiling, if it existed
for(var/turf/TO in turf_translation)
var/turf/TA = GetAbove(TO)
- if(istype(TA, ceiling_type))
- TA.ChangeTurf(get_base_turf_by_area(TA), TRUE, TRUE, TRUE)
+ if(istype(TA))
+ if(istype(TA, ceiling_type))
+ TA.ChangeTurf(get_base_turf_by_area(TA), TRUE, TRUE, TRUE)
+ else if(TA.prev_type == ceiling_type)
+ TA.prev_type = null
handle_pipes_and_power_on_move(new_turfs)
@@ -328,12 +331,21 @@
var/turf/TAS = GetAbove(TS)
if(!istype(TAD))
continue
+
+ // Check for multi-z shuttles. Don't create a ceiling where the shuttle is about to be.
+ if((istype(TAS) && (get_area(TAS) in shuttle_area)))
+ continue
+
+
if(force || (istype(TAD, get_base_turf_by_area(TAD)) || TAD.is_open()))
- // Check for multi-z shuttles. Don't create a ceiling where the shuttle is about to be.
- if((istype(TAS) && (get_area(TAS) in shuttle_area)))
- continue
TAD.ChangeTurf(ceiling_type, TRUE, TRUE, TRUE)
+ // TODO: Ideally the latter checks here would remain is_open() rather than direct type checks, but unfortunately we can't do that with only the path.
+ // In nearly all current situations, they are effectively the same thing.
+ else if(!TAD.prev_type || istype(TAD.prev_type, get_base_turf_by_area(TAD)) || ispath(TAD.prev_type, /turf/open) || ispath(TAD.prev_type, /turf/space))
+ // In case there's a pending shuttle move above, prepare it to create a ceiling post-translation.
+ TAD.prev_type = ceiling_type
+
//returns 1 if the shuttle has a valid arrive time
/datum/shuttle/proc/has_arrive_time()
return (moving_status == SHUTTLE_INTRANSIT)
diff --git a/code/modules/species/species_bodytype.dm b/code/modules/species/species_bodytype.dm
index 8169aa70bbb..2601b22ef1e 100644
--- a/code/modules/species/species_bodytype.dm
+++ b/code/modules/species/species_bodytype.dm
@@ -614,11 +614,11 @@ var/global/list/bodytypes_by_category = list()
/decl/bodytype/proc/get_limb_from_zone(limb)
. = length(LAZYACCESS(limb_mapping, limb)) ? pick(limb_mapping[limb]) : limb
-/decl/bodytype/proc/check_vital_organ_missing(mob/living/H)
+/decl/bodytype/proc/check_vital_organ_missing(mob/living/patient)
if(length(vital_organs))
for(var/organ_tag in vital_organs)
- var/obj/item/organ/O = H.get_organ(organ_tag, /obj/item/organ)
- if(!O || (O.status & ORGAN_DEAD))
+ var/obj/item/organ/vital_organ = patient.get_organ(organ_tag, /obj/item/organ)
+ if(!vital_organ || (vital_organ.status & ORGAN_DEAD))
return TRUE
return FALSE
diff --git a/code/modules/spells/aoe_turf/conjure/conjure.dm b/code/modules/spells/aoe_turf/conjure/conjure.dm
index c50d700d8ba..9291456f41a 100644
--- a/code/modules/spells/aoe_turf/conjure/conjure.dm
+++ b/code/modules/spells/aoe_turf/conjure/conjure.dm
@@ -56,9 +56,7 @@ How they spawn stuff is decided by behaviour vars, which are explained below
if(ismob(summoned_object)) //we want them to NOT attack us.
var/mob/M = summoned_object
M.faction = user.faction
- for(var/varName in newVars)
- if(varName in summoned_object.vars)
- summoned_object.vars[varName] = newVars[varName]
+ apply_vars(summoned_object, user)
if(duration)
spawn(duration)
@@ -68,4 +66,11 @@ How they spawn stuff is decided by behaviour vars, which are explained below
return
/spell/aoe_turf/conjure/proc/conjure_animation(var/atom/movable/overlay/animation, var/turf/target)
- qdel(animation)
\ No newline at end of file
+ qdel(animation)
+
+/spell/aoe_turf/conjure/proc/apply_vars(atom/summoned_object, mob/caster)
+ if(!istype(summoned_object) || !length(newVars))
+ return
+ for(var/varName in newVars)
+ if(varName in summoned_object.vars)
+ summoned_object.vars[varName] = newVars[varName]
diff --git a/code/modules/spells/aoe_turf/conjure/druidic_spells.dm b/code/modules/spells/aoe_turf/conjure/druidic_spells.dm
index 823a1613525..e6f0b8ea260 100644
--- a/code/modules/spells/aoe_turf/conjure/druidic_spells.dm
+++ b/code/modules/spells/aoe_turf/conjure/druidic_spells.dm
@@ -67,9 +67,13 @@
hud_state = "wiz_bear"
-/spell/aoe_turf/conjure/summon/bear/before_cast()
- ..()
- newVars["master"] = holder //why not do this in the beginning? MIND SWITCHING.
+/spell/aoe_turf/conjure/summon/bear/apply_vars(atom/summoned_object, mob/caster)
+ . = ..()
+ if(isliving(summoned_object))
+ var/mob/living/summoned_mob = summoned_object
+ if(istype(summoned_mob.ai, /datum/mob_controller/aggressive/commanded))
+ var/datum/mob_controller/aggressive/commanded/command_ai = summoned_mob.ai
+ command_ai.master = caster
/spell/aoe_turf/conjure/summon/bear/empower_spell()
if(!..())
diff --git a/code/modules/spells/aoe_turf/conjure/faithful_hound.dm b/code/modules/spells/aoe_turf/conjure/faithful_hound.dm
index 69ffe55db6c..4511e6a07f4 100644
--- a/code/modules/spells/aoe_turf/conjure/faithful_hound.dm
+++ b/code/modules/spells/aoe_turf/conjure/faithful_hound.dm
@@ -13,7 +13,16 @@
summon_type = list(/mob/living/simple_animal/faithful_hound)
hud_state = "wiz_hound"
+ var/temp_password
+
+/spell/aoe_turf/conjure/faithful_hound/apply_vars(atom/summoned_object, mob/caster)
+ . = ..()
+ var/mob/living/simple_animal/faithful_hound/hound = summoned_object
+ if(istype(hound) && istype(hound.ai))
+ hound.ai.add_friend(caster)
+ hound.ai.memorise(caster, temp_password)
+ temp_password = null
+
/spell/aoe_turf/conjure/faithful_hound/before_cast()
..()
- var/password = sanitize(input("What password will this beast listen to?") as text, MAX_NAME_LEN)
- newVars = list("password" = password, "allowed_mobs" = list(usr))
+ temp_password = sanitize(input("What password will this beast listen to?") as text, MAX_NAME_LEN)
diff --git a/code/modules/spells/artifacts/spellbound_servants.dm b/code/modules/spells/artifacts/spellbound_servants.dm
index 2c8f93815c8..0f6bb21c84e 100644
--- a/code/modules/spells/artifacts/spellbound_servants.dm
+++ b/code/modules/spells/artifacts/spellbound_servants.dm
@@ -115,7 +115,7 @@
familiar_type = /mob/living/simple_animal/passive/mouse
if("Cat")
H.add_genetic_condition(GENE_COND_RUNNING)
- familiar_type = /mob/living/simple_animal/cat
+ familiar_type = /mob/living/simple_animal/passive/cat
if("Bear")
familiar_type = /mob/living/simple_animal/hostile/bear
var/spell/targeted/shapeshift/familiar/F = new()
diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm
index 110fb98c471..b9ab445eeae 100644
--- a/code/modules/spells/spellbook.dm
+++ b/code/modules/spells/spellbook.dm
@@ -148,7 +148,7 @@ var/global/list/artefact_feedback = list(
dat += " Make Contract"
dat += " [desc] " dat += " " - dat += "
+
06 July 2024+Penelope Haze updated:+
20 June 2024MistakeNot4892 updated:
MistakeNot4892 updated:08 May 2024-MistakeNot4892 updated:-
06 May 2024-MistakeNot4892 updated:-
04 May 2024-MistakeNot4892 updated:-
|