mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-22 05:17:38 +01:00
3dc4cce9c2
Minor span refactoring
43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
/mob/living/
|
|
var/summoned = 0
|
|
|
|
/obj/item/spell/summon
|
|
name = "summon template"
|
|
desc = "Chitter chitter."
|
|
cast_methods = CAST_RANGED | CAST_USE
|
|
aspect = ASPECT_TELE
|
|
var/mob/living/summoned_mob_type = null // The type to use when making new mobs when summoned.
|
|
var/list/summon_options = list()
|
|
var/energy_cost = 0
|
|
var/instability_cost = 0
|
|
|
|
/obj/item/spell/summon/on_ranged_cast(atom/hit_atom, mob/living/user)
|
|
. = ..()
|
|
var/turf/T = get_turf(hit_atom)
|
|
if(summoned_mob_type && core.summoned_mobs.len < core.max_summons && within_range(hit_atom) && pay_energy(energy_cost))
|
|
var/obj/effect/E = new(T)
|
|
E.icon = 'icons/obj/objects.dmi'
|
|
E.icon_state = "anom"
|
|
sleep(5 SECONDS)
|
|
qdel(E)
|
|
if(owner) // We might've been dropped.
|
|
var/mob/living/L = new summoned_mob_type(T)
|
|
core.summoned_mobs |= L
|
|
L.summoned = 1
|
|
on_summon(L)
|
|
to_chat(user, SPAN_NOTICE("You've successfully teleported \a [L] to you!"))
|
|
visible_message(SPAN_WARNING("\A [L] appears from no-where!"))
|
|
log_and_message_admins("has summoned \a [L] at [T.x],[T.y],[T.z].")
|
|
user.adjust_instability(instability_cost)
|
|
|
|
/obj/item/spell/summon/on_use_cast(mob/living/user)
|
|
. = ..()
|
|
if(summon_options.len)
|
|
var/choice = tgui_input_list(user, "Choose a creature to kidnap from somewhere.", "Summon", summon_options)
|
|
if(choice)
|
|
summoned_mob_type = summon_options[choice]
|
|
|
|
// Called when a new mob is summoned, override for special behaviour.
|
|
/obj/item/spell/summon/proc/on_summon(var/mob/living/summoned)
|
|
return
|