mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +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
|
/obj/item/weapon/technomancer_catalog
|
||||||
name = "catalog"
|
name = "catalog"
|
||||||
desc = "A \"book\" featuring a holographic display, metal cover, and miniaturized teleportation device, allowing the user to \
|
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 = 'icons/obj/storage.dmi'
|
||||||
icon_state ="scientology" //placeholder
|
icon_state ="scientology" //placeholder
|
||||||
w_class = ITEMSIZE_SMALL
|
w_class = ITEMSIZE_SMALL
|
||||||
|
|||||||
@@ -8,16 +8,30 @@
|
|||||||
ability_icon_state = "tech_mark"
|
ability_icon_state = "tech_mark"
|
||||||
category = UTILITY_SPELLS
|
category = UTILITY_SPELLS
|
||||||
|
|
||||||
//The object to teleport to when Recall is used.
|
/datum/technomancer_marker
|
||||||
/obj/effect/mark_spell
|
var/weakref/U
|
||||||
name = "mark"
|
var/image/I
|
||||||
desc = "This is a strange looking disturbance."
|
var/turf/T
|
||||||
opacity = 0
|
|
||||||
density = 0
|
/datum/technomancer_marker/New(var/mob/user)
|
||||||
anchored = 1
|
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.
|
//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
|
/obj/item/weapon/spell/mark
|
||||||
name = "mark"
|
name = "mark"
|
||||||
@@ -26,17 +40,20 @@
|
|||||||
cast_methods = CAST_USE
|
cast_methods = CAST_USE
|
||||||
aspect = ASPECT_TELE
|
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.
|
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>")
|
to_chat(user, "<span class='warning'>You can't teleport here!</span>")
|
||||||
return 0
|
return 0
|
||||||
if(pay_energy(1000))
|
if(pay_energy(1000))
|
||||||
if(!mark_spell_ref)
|
var/datum/technomancer_marker/marker = GLOB.mark_spells[weakref(user)]
|
||||||
mark_spell_ref = new(get_turf(user))
|
//They have one in the list
|
||||||
to_chat(user, "<span class='notice'>You mark \the [get_turf(user)] under you.</span>")
|
if(istype(marker))
|
||||||
else
|
qdel(marker)
|
||||||
mark_spell_ref.forceMove(get_turf(user))
|
|
||||||
to_chat(user, "<span class='notice'>Your mark is moved from its old position to \the [get_turf(user)] under you.</span>")
|
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)
|
adjust_instability(5)
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
@@ -62,9 +79,10 @@
|
|||||||
cast_methods = CAST_USE
|
cast_methods = CAST_USE
|
||||||
aspect = ASPECT_TELE
|
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(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>")
|
to_chat(user, "<span class='danger'>There's no Mark!</span>")
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
@@ -86,7 +104,7 @@
|
|||||||
time_left--
|
time_left--
|
||||||
sleep(1 SECOND)
|
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)
|
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.
|
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