mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Technomancer mark sprite
This commit is contained in:
@@ -25,7 +25,7 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) -
|
||||
/obj/item/weapon/technomancer_catalog
|
||||
name = "catalog"
|
||||
desc = "A \"book\" featuring a holographic display, metal cover, and miniaturized teleportation device, allowing the user to \
|
||||
requisition various things from.. where ever they came from."
|
||||
requisition various things from... wherever they came from."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state ="scientology" //placeholder
|
||||
w_class = ITEMSIZE_SMALL
|
||||
|
||||
@@ -8,16 +8,30 @@
|
||||
ability_icon_state = "tech_mark"
|
||||
category = UTILITY_SPELLS
|
||||
|
||||
//The object to teleport to when Recall is used.
|
||||
/obj/effect/mark_spell
|
||||
name = "mark"
|
||||
desc = "This is a strange looking disturbance."
|
||||
opacity = 0
|
||||
density = 0
|
||||
anchored = 1
|
||||
/datum/technomancer_marker
|
||||
var/weakref/U
|
||||
var/image/I
|
||||
var/turf/T
|
||||
|
||||
/datum/technomancer_marker/New(var/mob/user)
|
||||
U = weakref(user)
|
||||
T = get_turf(user)
|
||||
I = image('icons/goonstation/featherzone.dmi', T, "spawn-wall")
|
||||
I.plane = TURF_PLANE
|
||||
I.layer = ABOVE_TURF_LAYER
|
||||
user.client?.images |= I
|
||||
spawn(23) //That's just how long the animation is
|
||||
I.icon_state = "spawn-wall-loop"
|
||||
|
||||
/datum/technomancer_marker/Destroy()
|
||||
var/mob/user = U?.resolve()
|
||||
user?.client?.images -= I
|
||||
I?.loc = null
|
||||
U = T = I = null
|
||||
return ..()
|
||||
|
||||
//This is global, to avoid looping through a list of all objects, or god forbid, looping through world.
|
||||
/var/global/obj/effect/mark_spell/mark_spell_ref = null
|
||||
GLOBAL_LIST_INIT(mark_spells, list())
|
||||
|
||||
/obj/item/weapon/spell/mark
|
||||
name = "mark"
|
||||
@@ -26,17 +40,20 @@
|
||||
cast_methods = CAST_USE
|
||||
aspect = ASPECT_TELE
|
||||
|
||||
/obj/item/weapon/spell/mark/on_use_cast(mob/living/user)
|
||||
/obj/item/weapon/spell/mark/on_use_cast(var/mob/living/user)
|
||||
if(!allowed_to_teleport()) // Otherwise you could teleport back to the admin Z-level.
|
||||
to_chat(user, "<span class='warning'>You can't teleport here!</span>")
|
||||
return 0
|
||||
if(pay_energy(1000))
|
||||
if(!mark_spell_ref)
|
||||
mark_spell_ref = new(get_turf(user))
|
||||
to_chat(user, "<span class='notice'>You mark \the [get_turf(user)] under you.</span>")
|
||||
else
|
||||
mark_spell_ref.forceMove(get_turf(user))
|
||||
var/datum/technomancer_marker/marker = GLOB.mark_spells[weakref(user)]
|
||||
//They have one in the list
|
||||
if(istype(marker))
|
||||
qdel(marker)
|
||||
to_chat(user, "<span class='notice'>Your mark is moved from its old position to \the [get_turf(user)] under you.</span>")
|
||||
//They don't have one yet
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You mark \the [get_turf(user)] under you.</span>")
|
||||
GLOB.mark_spells[weakref(user)] = new /datum/technomancer_marker(user)
|
||||
adjust_instability(5)
|
||||
return 1
|
||||
else
|
||||
@@ -62,9 +79,10 @@
|
||||
cast_methods = CAST_USE
|
||||
aspect = ASPECT_TELE
|
||||
|
||||
/obj/item/weapon/spell/recall/on_use_cast(mob/living/user)
|
||||
/obj/item/weapon/spell/recall/on_use_cast(var/mob/living/user)
|
||||
if(pay_energy(3000))
|
||||
if(!mark_spell_ref)
|
||||
var/datum/technomancer_marker/marker = GLOB.mark_spells[weakref(user)]
|
||||
if(!istype(marker))
|
||||
to_chat(user, "<span class='danger'>There's no Mark!</span>")
|
||||
return 0
|
||||
else
|
||||
@@ -86,7 +104,7 @@
|
||||
time_left--
|
||||
sleep(1 SECOND)
|
||||
|
||||
var/turf/target_turf = get_turf(mark_spell_ref)
|
||||
var/turf/target_turf = marker.T
|
||||
var/turf/old_turf = get_turf(user)
|
||||
|
||||
for(var/obj/item/weapon/grab/G in user.contents) // People the Technomancer is grabbing come along for the ride.
|
||||
|
||||
Reference in New Issue
Block a user