Merge pull request #3135 from Fox-McCloud/timestop

Timestop Spell Port and Sepia Slimes
This commit is contained in:
TheDZD
2016-01-07 19:56:45 -05:00
8 changed files with 200 additions and 76 deletions
@@ -205,7 +205,7 @@
/obj/item/weapon/sentience_potion/afterattack(mob/living/M, mob/user)
if(being_used || !ismob(M))
return
if(!isslime(M) && !isanimal(M) || M.ckey) //only works on animals that aren't player controlled
if(!isanimal(M) || M.ckey) //only works on animals that aren't player controlled
user << "<span class='warning'>[M] is already too intelligent for this to work!</span>"
return ..()
if(M.stat)
@@ -351,6 +351,81 @@
if(!uses)
qdel(src)
/obj/effect/timestop
anchored = 1
name = "chronofield"
desc = "ZA WARUDO"
icon = 'icons/effects/160x160.dmi'
icon_state = "time"
layer = FLY_LAYER
pixel_x = -64
pixel_y = -64
unacidable = 1
mouse_opacity = 0
var/mob/living/immune = list() // the one who creates the timestop is immune
var/list/stopped_atoms = list()
var/freezerange = 2
var/duration = 140
alpha = 125
/obj/effect/timestop/New()
..()
for(var/mob/living/M in player_list)
for(var/obj/effect/proc_holder/spell/aoe_turf/conjure/timestop/T in M.mind.spell_list) //People who can stop time are immune to timestop
immune |= M
/obj/effect/timestop/proc/timestop()
playsound(get_turf(src), 'sound/magic/TIMEPARADOX2.ogg', 100, 1, -1)
for(var/i in 1 to duration-1)
for(var/A in orange (freezerange, src.loc))
if(istype(A, /mob/living))
var/mob/living/M = A
if(M in immune)
continue
M.stunned = 10
M.anchored = 1
if(istype(M, /mob/living/simple_animal/hostile))
var/mob/living/simple_animal/hostile/H = M
H.AIStatus = AI_OFF
H.LoseTarget()
stopped_atoms |= M
else if(istype(A, /obj/item/projectile))
var/obj/item/projectile/P = A
P.paused = TRUE
stopped_atoms |= P
for(var/mob/living/M in stopped_atoms)
if(get_dist(get_turf(M),get_turf(src)) > freezerange) //If they lagged/ran past the timestop somehow, just ignore them
unfreeze_mob(M)
stopped_atoms -= M
sleep(1)
//End
for(var/mob/living/M in stopped_atoms)
unfreeze_mob(M)
for(var/obj/item/projectile/P in stopped_atoms)
P.paused = FALSE
qdel(src)
return
/obj/effect/timestop/proc/unfreeze_mob(mob/living/M)
M.stunned = 0
M.anchored = 0
if(istype(M, /mob/living/simple_animal/hostile))
var/mob/living/simple_animal/hostile/H = M
H.AIStatus = initial(H.AIStatus)
/obj/effect/timestop/wizard
duration = 100
/obj/effect/timestop/wizard/New()
..()
timestop()
/obj/item/stack/tile/bluespace
name = "bluespace floor tile"
singular_name = "floor tile"