mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-03 05:52:17 +00:00
/obj/effects is now /obj/effect. /obj/station_objects is now /obj/structure. Did a bit of minor blob work. The Bay 12 body bags were replaced with closets because having two sets of code that do almost the same thing is silly. Changed back a few of the last jobproc edits as the remove from list before assign was a check to see if the mob was fucked up and if it was remove it so we did not check it again as it would still be fucked up. The medbay/tox monkeys names are random once more. More random name monkeys will help with changeling and clean up the observe/mob menus. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2324 316c924e-a436-60f5-8080-3fe189b3f50e
63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
/obj/effect/proc_holder/spell/targeted/area_teleport
|
|
name = "Area teleport"
|
|
desc = "This spell teleports you to a type of area of your selection."
|
|
|
|
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
|
|
|
|
/obj/effect/proc_holder/spell/targeted/area_teleport/perform(list/targets, recharge = 1)
|
|
var/thearea = before_cast(targets)
|
|
if(!thearea || !cast_check(1))
|
|
revert_cast()
|
|
return
|
|
invocation(thearea)
|
|
spawn(0)
|
|
if(charge_type == "recharge" && recharge)
|
|
start_recharge()
|
|
cast(targets,thearea)
|
|
after_cast(targets)
|
|
|
|
/obj/effect/proc_holder/spell/targeted/area_teleport/before_cast(list/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 thearea
|
|
|
|
/obj/effect/proc_holder/spell/targeted/area_teleport/cast(list/targets,area/thearea)
|
|
for(var/mob/target in targets)
|
|
var/list/L = list()
|
|
for(var/turf/T in get_area_turfs(thearea.type))
|
|
if(!T.density)
|
|
var/clear = 1
|
|
for(var/obj/O in T)
|
|
if(O.density)
|
|
clear = 0
|
|
break
|
|
if(clear)
|
|
L+=T
|
|
|
|
target.loc = pick(L)
|
|
|
|
return
|
|
|
|
/obj/effect/proc_holder/spell/targeted/area_teleport/invocation(area/chosenarea = null)
|
|
if(!invocation_area || !chosenarea)
|
|
..()
|
|
else
|
|
switch(invocation_type)
|
|
if("shout")
|
|
usr.say("[invocation] [uppertext(chosenarea.name)]")
|
|
if(usr.gender=="male")
|
|
playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1)
|
|
else
|
|
playsound(usr.loc, pick('null.ogg','null.ogg'), 100, 1)
|
|
if("whisper")
|
|
usr.whisper("[invocation] [uppertext(chosenarea.name)]")
|
|
|
|
return |