mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-21 12:56:10 +01:00
3f62424312
This has zero reason to exist in our code base. We have no procs or variables tied to this. I removed it to make future modifications cleaner. --------- Signed-off-by: Cody Brittain <1779662+Generalcamo@users.noreply.github.com>
163 lines
4.3 KiB
Plaintext
163 lines
4.3 KiB
Plaintext
/obj/item/chameleon
|
|
name = "chameleon projector"
|
|
desc = "A strange device."
|
|
icon = 'icons/obj/item/chameleon.dmi'
|
|
icon_state = "shield0"
|
|
item_state = "electronic"
|
|
obj_flags = OBJ_FLAG_CONDUCTABLE
|
|
slot_flags = SLOT_BELT
|
|
throwforce = 5
|
|
throw_speed = 1
|
|
throw_range = 5
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
origin_tech = list(TECH_ILLEGAL = 4, TECH_MAGNET = 4)
|
|
var/can_use = TRUE
|
|
var/obj/effect/dummy/chameleon/active_dummy = null
|
|
var/saved_item = /obj/item/trash/cigbutt
|
|
var/saved_icon = 'icons/obj/smokables.dmi'
|
|
var/saved_icon_state = "cigbutt"
|
|
var/saved_overlays
|
|
|
|
/obj/item/chameleon/antagonist_hints(mob/user, distance, is_adjacent)
|
|
. += ..()
|
|
. += "This device can let you disguise as common objects."
|
|
. += "Left-click on an object with this in your active hand to scan it."
|
|
. += "Left-click it in-hand to toggle the effect."
|
|
|
|
/obj/item/chameleon/dropped()
|
|
disrupt()
|
|
..()
|
|
|
|
/obj/item/chameleon/equipped()
|
|
disrupt()
|
|
..()
|
|
|
|
/obj/item/chameleon/attack_self()
|
|
toggle()
|
|
|
|
/obj/item/chameleon/afterattack(atom/target, mob/user , proximity)
|
|
if(!proximity)
|
|
return
|
|
if(!active_dummy)
|
|
if(istype(target,/obj/item) && !istype(target, /obj/item/disk/nuclear))
|
|
playsound(get_turf(src), 'sound/weapons/flash.ogg', 100, 1, -6)
|
|
to_chat(user, SPAN_NOTICE("Scanned [target]."))
|
|
saved_item = target.type
|
|
saved_icon = target.icon
|
|
saved_icon_state = target.icon_state
|
|
saved_overlays = target.overlays
|
|
|
|
/obj/item/chameleon/proc/toggle()
|
|
if(!can_use || !saved_item)
|
|
return
|
|
if(active_dummy)
|
|
eject_all()
|
|
playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)
|
|
qdel(active_dummy)
|
|
active_dummy = null
|
|
to_chat(usr, SPAN_NOTICE("You deactivate \the [src]."))
|
|
var/obj/effect/overlay/T = new /obj/effect/overlay(get_turf(src))
|
|
T.icon = 'icons/effects/effects.dmi'
|
|
flick("emppulse",T)
|
|
QDEL_IN(T, 8)
|
|
else
|
|
playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)
|
|
var/obj/O = new saved_item(src)
|
|
if(!O)
|
|
return
|
|
var/obj/effect/dummy/chameleon/C = new /obj/effect/dummy/chameleon(usr.loc)
|
|
C.activate(O, usr, saved_icon, saved_icon_state, saved_overlays, src)
|
|
qdel(O)
|
|
to_chat(usr, SPAN_NOTICE("You activate \the [src]."))
|
|
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
|
|
T.icon = 'icons/effects/effects.dmi'
|
|
flick("emppulse",T)
|
|
QDEL_IN(T, 8)
|
|
|
|
/obj/item/chameleon/proc/disrupt(var/delete_dummy = 1)
|
|
if(active_dummy)
|
|
spark(src, 5)
|
|
eject_all()
|
|
if(delete_dummy)
|
|
qdel(active_dummy)
|
|
active_dummy = null
|
|
can_use = 0
|
|
spawn(50) can_use = 1
|
|
|
|
/obj/item/chameleon/proc/eject_all()
|
|
for(var/atom/movable/A in active_dummy)
|
|
A.forceMove(active_dummy.loc)
|
|
if(ismob(A))
|
|
var/mob/M = A
|
|
M.reset_view(null)
|
|
|
|
/obj/effect/dummy/chameleon
|
|
name = ""
|
|
desc = ""
|
|
density = FALSE
|
|
anchored = TRUE
|
|
mouse_opacity = MOUSE_OPACITY_ICON
|
|
var/can_move = TRUE
|
|
var/obj/item/chameleon/master = null
|
|
|
|
/obj/effect/dummy/chameleon/proc/activate(var/obj/O, var/mob/M, new_icon, new_iconstate, new_overlays, var/obj/item/chameleon/C)
|
|
name = O.name
|
|
desc = O.desc
|
|
icon = new_icon
|
|
icon_state = new_iconstate
|
|
overlays = new_overlays
|
|
set_dir(O.dir)
|
|
M.forceMove(src)
|
|
master = C
|
|
master.active_dummy = src
|
|
|
|
/obj/effect/dummy/chameleon/attackby()
|
|
for(var/mob/M in src)
|
|
to_chat(M, SPAN_WARNING("Your chameleon-projector deactivates."))
|
|
master.disrupt()
|
|
|
|
/obj/effect/dummy/chameleon/attack_hand()
|
|
for(var/mob/M in src)
|
|
to_chat(M, SPAN_WARNING("Your chameleon-projector deactivates."))
|
|
master.disrupt()
|
|
|
|
/obj/effect/dummy/chameleon/ex_act(var/severity = 2.0)
|
|
for(var/mob/M in src)
|
|
to_chat(M, SPAN_WARNING("Your chameleon-projector deactivates."))
|
|
master.disrupt()
|
|
|
|
/obj/effect/dummy/chameleon/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
|
. = ..()
|
|
if(. != BULLET_ACT_HIT)
|
|
return .
|
|
|
|
for(var/mob/M in src)
|
|
to_chat(M, SPAN_WARNING("Your chameleon-projector deactivates."))
|
|
master.disrupt()
|
|
|
|
/obj/effect/dummy/chameleon/relaymove(mob/living/user, direction)
|
|
. = ..()
|
|
|
|
if(istype(loc, /turf/space))
|
|
return //No magical space movement!
|
|
|
|
if(can_move)
|
|
can_move = 0
|
|
switch(user.bodytemperature)
|
|
if(300 to INFINITY)
|
|
spawn(10) can_move = 1
|
|
if(295 to 300)
|
|
spawn(13) can_move = 1
|
|
if(280 to 295)
|
|
spawn(16) can_move = 1
|
|
if(260 to 280)
|
|
spawn(20) can_move = 1
|
|
else
|
|
spawn(25) can_move = 1
|
|
step(src, direction)
|
|
return
|
|
|
|
/obj/effect/dummy/chameleon/Destroy()
|
|
master.disrupt(0)
|
|
return ..()
|