Made effect teleporting into a trait. (#24640)

This commit is contained in:
Charlie Nolan
2024-03-15 21:40:27 -07:00
committed by GitHub
parent aa740508e2
commit 521abceae8
6 changed files with 19 additions and 1 deletions
+3
View File
@@ -363,3 +363,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
// turf trait sources
#define FLOOR_EFFECT_TRAIT "floor_effect_trait"
//***** TURF TRAITS *****//
// Causes the effect to go through a teleporter instead of being deleted by it.
#define TRAIT_EFFECT_CAN_TELEPORT "trait_effect_can_teleport"
+3
View File
@@ -111,6 +111,9 @@ GLOBAL_LIST_INIT(traits_by_type, list(
),
/turf = list(
"bluespace_speed_trait" = TRAIT_BLUESPACE_SPEED
),
/obj/effect = list(
"TRAIT_EFFECT_CAN_TELEPORT" = TRAIT_EFFECT_CAN_TELEPORT
)
))
+1 -1
View File
@@ -76,7 +76,7 @@
//must succeed in most cases
/datum/teleport/proc/setTeleatom(atom/movable/ateleatom)
if(iseffect(ateleatom) && !istype(ateleatom, /obj/effect/dummy/chameleon))
if(iseffect(ateleatom) && !HAS_TRAIT(ateleatom, TRAIT_EFFECT_CAN_TELEPORT))
qdel(ateleatom)
return FALSE
if(istype(ateleatom))
@@ -101,6 +101,10 @@
var/can_move = TRUE
var/obj/item/chameleon/master = null
/obj/effect/dummy/chameleon/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_EFFECT_CAN_TELEPORT, ROUNDSTART_TRAIT)
/obj/effect/dummy/chameleon/proc/activate(obj/O, mob/M, new_icon, new_iconstate, new_overlays, new_underlays, obj/item/chameleon/C)
name = O.name
desc = O.desc
+4
View File
@@ -178,6 +178,10 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
desc = "you shouldnt see this"
var/atom/movable/stored_obj
/obj/effect/extraction_holder/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_EFFECT_CAN_TELEPORT, ROUNDSTART_TRAIT)
/obj/item/extraction_pack/proc/check_for_living_mobs(atom/A)
if(isliving(A))
var/mob/living/L = A
@@ -405,6 +405,10 @@
icon = 'icons/effects/effects.dmi'
var/can_destroy = FALSE
/obj/effect/immortality_talisman/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_EFFECT_CAN_TELEPORT, ROUNDSTART_TRAIT)
/obj/effect/immortality_talisman/attackby()
return