Refactors faction lists to use getters and setters and be cached (#94490)

This commit is contained in:
Bloop
2026-01-19 04:12:35 +01:00
committed by GitHub
parent 8a8e9f7c88
commit 68153c2333
158 changed files with 757 additions and 393 deletions
@@ -29,7 +29,7 @@
living.visible_message(span_warning("[living]'s skin rapidly turns to marble!"), span_userdanger("Your body freezes up! Can't... move... can't... think..."))
living.forceMove(src)
living.add_traits(list(TRAIT_GODMODE, TRAIT_MUTE, TRAIT_NOBLOOD), STATUE_MUTE)
living.faction |= FACTION_MIMIC //Stops mimics from instaqdeling people in statues
living.add_faction(FACTION_MIMIC) //Stops mimics from instaqdeling people in statues
atom_integrity = living.health + 100 //stoning damaged mobs will result in easier to shatter statues
max_integrity = atom_integrity
START_PROCESSING(SSobj, src)
@@ -52,7 +52,7 @@
petrified_mob.remove_traits(list(TRAIT_GODMODE, TRAIT_MUTE, TRAIT_NOBLOOD), STATUE_MUTE)
petrified_mob.Paralyze(10 SECONDS)
petrified_mob.take_overall_damage((petrified_mob.health - atom_integrity + 100)) //any new damage the statue incurred is transferred to the mob
petrified_mob.faction -= FACTION_MIMIC
petrified_mob.remove_faction(FACTION_MIMIC)
petrified_mob = null
/obj/structure/statue/petrified/Destroy()
+1 -1
View File
@@ -76,7 +76,7 @@
)
/obj/structure/spawner/attack_animal(mob/living/simple_animal/user, list/modifiers)
if(faction_check(faction, user.faction, FALSE) && !user.client)
if(faction_check_atom(user) && !user.client)
return
return ..()
+1 -1
View File
@@ -69,7 +69,7 @@
user.adjust_disgust(50)
user.vomit(VOMIT_CATEGORY_DEFAULT)
var/mob/living/spawned_mob = new /mob/living/basic/mouse(get_turf(user))
spawned_mob.faction |= "[REF(user)]"
spawned_mob.add_faction("[REF(user)]")
if(prob(50))
for(var/j in 1 to rand(1, 3))
step(spawned_mob, pick(NORTH,SOUTH,EAST,WEST))