Makes some more lists lazy (#94388)

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
Bloop
2025-12-28 19:57:42 +01:00
committed by GitHub
co-authored by SyncIt21 MrMelbert
parent b88e1a1328
commit 53ed83bb9d
58 changed files with 268 additions and 253 deletions
+3 -2
View File
@@ -51,7 +51,7 @@
var/list/damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 1, STAMINA = 1, OXY = 1)
///Verbs used for speaking e.g. "Says" or "Chitters". This can be elementized
var/list/speak_emote = list()
var/list/speak_emote
///When someone interacts with the simple animal.
///Help-intent verb in present continuous tense.
@@ -120,8 +120,9 @@
apply_target_randomisation()
make_stamina_slowable()
if(speak_emote)
if(LAZYLEN(speak_emote))
speak_emote = string_list(speak_emote)
damage_coeff = string_assoc_list(damage_coeff)
///We need to wait for SSair to be initialized before we can check atmos/temp requirements.
if(PERFORM_ALL_TESTS(focus_only/atmos_and_temp_requirements) && mapload && !SSair.initialized)
@@ -161,9 +161,9 @@
/mob/living/basic/bot/cleanbot/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
. = ..()
if(istype(arrived, /obj/item/reagent_containers/cup/bucket) && isnull(build_bucket))
if(istype(arrived, /obj/item/reagent_containers/cup/bucket))
QDEL_NULL(build_bucket)
build_bucket = arrived
return
if(istype(arrived, /obj/item/mop) && isnull(our_mop))
our_mop = arrived
@@ -208,7 +208,7 @@
/mob/living/basic/bot/cleanbot/explode()
var/atom/drop_loc = drop_location()
build_bucket.forceMove(drop_loc)
build_bucket?.forceMove(drop_loc)
new /obj/item/assembly/prox_sensor(drop_loc)
if(weapon)
weapon.force = initial(weapon.force)
@@ -256,11 +256,6 @@
GLOB.janitor_devices -= src
return ..()
/mob/living/basic/bot/cleanbot/proc/apply_custom_bucket(obj/item/custom_bucket)
if(!isnull(build_bucket))
QDEL_NULL(build_bucket)
custom_bucket.forceMove(src)
/mob/living/basic/bot/cleanbot/proc/on_attack_by(datum/source, obj/item/used_item, mob/living/user)
SIGNAL_HANDLER
if(!istype(used_item, /obj/item/knife) || user.combat_mode)
@@ -71,7 +71,9 @@
/// Overlay for our protection shield.
var/mutable_appearance/shield_overlay
/// Damage coefficients when shielded
var/list/shielded_damage = list(BRUTE = 0.05, BURN = 0.05, TOX = 0.05, STAMINA = 0, OXY = 0.05)
var/static/list/shielded_damage = list(BRUTE = 0.05, BURN = 0.05, TOX = 0.05, STAMINA = 0, OXY = 0.05)
// What the damage coefficients were previously
var/list/original_damage_coeff
/datum/status_effect/protector_shield/on_apply()
if (isguardian(owner))
@@ -86,6 +88,7 @@
if (isbasicmob(owner)) // Better hope you are or this status is doing basically nothing useful for you
var/mob/living/basic/basic_owner = owner
original_damage_coeff = basic_owner.damage_coeff
basic_owner.damage_coeff = shielded_damage
to_chat(owner, span_bolddanger("You enter protection mode."))
@@ -101,7 +104,7 @@
if (isbasicmob(owner))
var/mob/living/basic/basic_owner = owner
basic_owner.damage_coeff = initial(basic_owner.damage_coeff)
basic_owner.damage_coeff = original_damage_coeff
to_chat(owner, span_bolddanger("You return to your normal mode."))
UnregisterSignal(owner, list(COMSIG_ATOM_UPDATE_OVERLAYS) + COMSIG_LIVING_ADJUST_STANDARD_DAMAGE_TYPES)
@@ -50,7 +50,7 @@
/datum/ai_planning_subtree/random_speech/when_has_target/mimic_machine
speech_chance = 7
emote_hear = list()
emote_hear = null
speak = list(
"HUMANS ARE IMPERFECT!",
"YOU SHALL BE ASSIMILATED!",