Make more object lists lazy to pay for my sins

This commit is contained in:
Aronai Sieyes
2021-07-15 01:20:17 -04:00
parent 99060e640d
commit b3fb7c181d
28 changed files with 81 additions and 85 deletions
@@ -267,7 +267,7 @@ emp_act
if(!affecting)
return //should be prevented by attacked_with_item() but for sanity.
visible_message("<span class='danger'>[src] has been [I.attack_verb.len? pick(I.attack_verb) : "attacked"] in the [affecting.name] with [I.name] by [user]!</span>")
visible_message("<span class='danger'>[src] has been [LAZYLEN(I.attack_verb) ? pick(I.attack_verb) : "attacked"] in the [affecting.name] with [I.name] by [user]!</span>")
var/soaked = get_armor_soak(hit_zone, "melee", I.armor_penetration)
@@ -15,7 +15,7 @@
user.setClickCooldown(user.get_attack_speed(W))
if(W.force)
visible_message("<span class='warning'>\The [src] has been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]</span>")
visible_message("<span class='warning'>\The [src] has been [LAZYLEN(W.attack_verb) ? pick(W.attack_verb) : "attacked"] with \the [W][(user ? " by [user]." : ".")]</span>")
qdel(src)
/obj/effect/weaversilk/bullet_act(var/obj/item/projectile/Proj)
+1 -1
View File
@@ -225,7 +225,7 @@
//Called when the mob is hit with an item in combat. Returns the blocked result
/mob/living/proc/hit_with_weapon(obj/item/I, mob/living/user, var/effective_force, var/hit_zone)
visible_message("<span class='danger'>[src] has been [I.attack_verb.len? pick(I.attack_verb) : "attacked"] with [I.name] by [user]!</span>")
visible_message("<span class='danger'>[src] has been [LAZYLEN(I.attack_verb) ? pick(I.attack_verb) : "attacked"] with [I.name] by [user]!</span>")
if(ai_holder)
ai_holder.react_to_attack(user)
@@ -1,7 +1,7 @@
var/list/mob_hat_cache = list()
/proc/get_hat_icon(var/obj/item/hat, var/offset_x = 0, var/offset_y = 0)
var/t_state = hat.icon_state
if(hat.item_state_slots && hat.item_state_slots[slot_head_str])
if(LAZYACCESS(hat.item_state_slots, slot_head_str))
t_state = hat.item_state_slots[slot_head_str]
else if(hat.item_state)
t_state = hat.item_state
@@ -10,7 +10,7 @@ var/list/mob_hat_cache = list()
var/t_icon = INV_HEAD_DEF_ICON // are unique across multiple dmis, but whatever.
if(hat.icon_override)
t_icon = hat.icon_override
else if(hat.item_icons && (slot_head_str in hat.item_icons))
else if(LAZYACCESS(hat.item_icons, slot_head_str))
t_icon = hat.item_icons[slot_head_str]
var/image/I = image(icon = t_icon, icon_state = t_state)
I.pixel_x = offset_x
+4 -4
View File
@@ -52,7 +52,7 @@
//determine icon state to use
var/t_state
if(r_hand.item_state_slots && r_hand.item_state_slots[slot_r_hand_str])
if(LAZYACCESS(r_hand.item_state_slots, slot_r_hand_str))
t_state = r_hand.item_state_slots[slot_r_hand_str]
else if(r_hand.item_state)
t_state = r_hand.item_state
@@ -61,7 +61,7 @@
//determine icon to use
var/icon/t_icon
if(r_hand.item_icons && (slot_r_hand_str in r_hand.item_icons))
if(LAZYACCESS(r_hand.item_icons, slot_r_hand_str))
t_icon = r_hand.item_icons[slot_r_hand_str]
else if(r_hand.icon_override)
t_state += "_r"
@@ -89,7 +89,7 @@
//determine icon state to use
var/t_state
if(l_hand.item_state_slots && l_hand.item_state_slots[slot_l_hand_str])
if(LAZYACCESS(l_hand.item_state_slots, slot_l_hand_str))
t_state = l_hand.item_state_slots[slot_l_hand_str]
else if(l_hand.item_state)
t_state = l_hand.item_state
@@ -98,7 +98,7 @@
//determine icon to use
var/icon/t_icon
if(l_hand.item_icons && (slot_l_hand_str in l_hand.item_icons))
if(LAZYACCESS(l_hand.item_icons, slot_l_hand_str))
t_icon = l_hand.item_icons[slot_l_hand_str]
else if(l_hand.icon_override)
t_state += "_l"