Files
Aurora.3/code/modules/spells/general/area_teleport.dm
LordFowl 8d436c4a03 Converts all necessary << outputs into the to_chat() macro. (#6076)
This PR will lead us towards the Promised Day, for in its wake there shall be much celebration and ecstasy as this world becomes a world suitable for developer hegemony. The first strike is thusly;

All << is converted into to_chat().
2019-03-10 23:39:03 +02:00

80 lines
1.8 KiB
Plaintext

/spell/area_teleport
name = "Teleport"
desc = "This spell teleports you to a type of area of your selection."
feedback = "TP"
school = "abjuration"
charge_max = 600
spell_flags = NEEDSCLOTHES
invocation = "SCYAR NILA"
invocation_type = SpI_SHOUT
cooldown_min = 200 //100 deciseconds reduction per rank
smoke_spread = 1
smoke_amt = 5
var/randomise_selection = 0 //if it lets the usr choose the teleport loc or picks it from the list
var/invocation_area = 1 //if the invocation appends the selected area
cast_sound = 'sound/effects/teleport.ogg'
hud_state = "wiz_tele"
/spell/area_teleport/before_cast()
return
/spell/area_teleport/choose_targets()
var/A = null
if(!randomise_selection)
A = input("Area to teleport to", "Teleport", A) in teleportlocs
else
A = pick(teleportlocs)
var/area/thearea = teleportlocs[A]
return list(thearea)
/spell/area_teleport/cast(area/thearea, mob/user)
if(!istype(thearea) && istype(thearea, /list))
thearea = thearea[1]
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
if(!T.density)
var/clear = 1
if(T.is_hole) //No more teleporting in holes.
continue
for(var/obj/O in T)
if(O.density)
clear = 0
break
if(clear)
L+=T
if(!L.len)
to_chat(user, "The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry.")
return
if(user && user.buckled)
var/obj/structure/bed/B = user.buckled
if(B && B.buckled_mob)
B.user_unbuckle_mob(user)
user.buckled = null
do_teleport(user,pick(L))
return
/spell/area_teleport/after_cast()
return
/spell/area_teleport/invocation(mob/user, area/chosenarea)
if(!istype(chosenarea))
return //can't have that, can we
if(!invocation_area || !chosenarea)
..()
else
invocation += "[uppertext(chosenarea.name)]"
..()
return