removes a bunch of unneeded spawns

spawns have a high overhead.

I only went for easy targets, almost every spawn could be removed with a few subsystems in place to handle delays or cooldowns
This commit is contained in:
MrStonedOne
2016-01-02 18:23:02 -08:00
parent cfc6bb6208
commit b50e8d2a63
47 changed files with 448 additions and 468 deletions

View File

@@ -292,10 +292,13 @@
/atom/movable/var/pressure_resistance = 5
/atom/movable/proc/experience_pressure_difference(pressure_difference, direction)
set waitfor = 0
. = 0
if(!anchored && !pulledby)
. = 1
if(pressure_difference > pressure_resistance)
spawn step(src, direction)
return 1
step(src, direction)

View File

@@ -26,10 +26,13 @@ var/datum/subsystem/timer/SStimer
if (!event.thingToCall || qdeleted(event.thingToCall))
qdel(event)
if (event.timeToRun <= world.time)
spawn(-1)
call(event.thingToCall, event.procToCall)(arglist(event.argList))
runevent(event)
qdel(event)
/datum/subsystem/timer/proc/runevent(datum/timedevent/event)
set waitfor = 0
call(event.thingToCall, event.procToCall)(arglist(event.argList))
/datum/timedevent
var/thingToCall
var/procToCall

View File

@@ -135,32 +135,32 @@
if(work_sound)
playsound(src, work_sound, 50, 1)
icon_state = icon_creating
spawn(30)
sleep 30
icon_state = icon_on
metal -= metal_cost
glass -= glass_cost
if(metal < 0)
metal = 0
if(glass < 0)
glass = 0
if(power_used)
use_power(power_used)
new dispense_type(loc)
if(create_sound)
playsound(src, create_sound, 50, 1)
if(end_create_message)
visible_message("<span class='notice'>[src] [end_create_message]</span>")
icon_state = icon_recharging
sleep(cooldownTime)
if(stat != BROKEN)
icon_state = icon_on
metal -= metal_cost
glass -= glass_cost
if(metal < 0)
metal = 0
if(glass < 0)
glass = 0
if(power_used)
use_power(power_used)
new dispense_type(loc)
if(create_sound)
playsound(src, create_sound, 50, 1)
if(end_create_message)
visible_message("<span class='notice'>[src] [end_create_message]</span>")
icon_state = icon_recharging
spawn(cooldownTime)
if(stat != BROKEN)
icon_state = icon_on
else
icon_state = icon_off
droneMadeRecently = 0
if(recharge_sound)
playsound(src, recharge_sound, 50, 1)
if(recharge_message)
visible_message("<span class='notice'>[src] [recharge_message]</span>")
else
icon_state = icon_off
droneMadeRecently = 0
if(recharge_sound)
playsound(src, recharge_sound, 50, 1)
if(recharge_message)
visible_message("<span class='notice'>[src] [recharge_message]</span>")
/obj/machinery/droneDispenser/attackby(obj/item/O, mob/living/user)
if(istype(O, /obj/item/stack))

View File

@@ -504,8 +504,7 @@
if(!tryToShootAt(targets))
if(!always_up)
spawn()
popDown() // no valid targets, close the cover
popDown() // no valid targets, close the cover
/obj/machinery/porta_turret/proc/tryToShootAt(list/atom/movable/targets)

View File

@@ -44,9 +44,12 @@
/obj/machinery/status_display/New()
..()
spawn(5) // must wait for map loading to finish
if(SSradio)
SSradio.add_object(src, frequency)
if(SSradio)
SSradio.add_object(src, frequency)
/obj/machinery/status_display/initialize()
if(SSradio)
SSradio.add_object(src, frequency)
/obj/machinery/status_display/Destroy()
if(SSradio)

View File

@@ -114,9 +114,8 @@
wires.Interact(user)
if(!open_panel)
if(!active)
spawn()
settings(user)
return
settings(user)
return
else if(anchored)
user << "<span class='warning'>The bomb is bolted to the floor!</span>"
return

View File

@@ -88,18 +88,18 @@
/obj/effect/decal/cleanable/blood/gibs/proc/streak(list/directions)
spawn (0)
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (i > 0)
var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc)
for(var/datum/disease/D in src.viruses)
var/datum/disease/ND = D.Copy(1)
b.viruses += ND
ND.holder = b
if (step_to(src, get_step(src, direction), 0))
break
set waitfor = 0
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (i > 0)
var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc)
for(var/datum/disease/D in src.viruses)
var/datum/disease/ND = D.Copy(1)
b.viruses += ND
ND.holder = b
if (step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/blood/drip
name = "drips of blood"

View File

@@ -14,19 +14,19 @@
bloodiness = MAX_SHOE_BLOODINESS
/obj/effect/decal/cleanable/robot_debris/proc/streak(list/directions)
spawn (0)
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (i > 0)
if (prob(40))
new /obj/effect/decal/cleanable/oil/streak(src.loc)
else if (prob(10))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
if (step_to(src, get_step(src, direction), 0))
break
set waitfor = 0
var/direction = pick(directions)
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (i > 0)
if (prob(40))
new /obj/effect/decal/cleanable/oil/streak(src.loc)
else if (prob(10))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
s.start()
if (step_to(src, get_step(src, direction), 0))
break
/obj/effect/decal/cleanable/robot_debris/ex_act()
return

View File

@@ -14,6 +14,7 @@
/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0 ,silent = 0)
set waitfor = 0
src = null //so we don't abort once src is deleted
epicenter = get_turf(epicenter)
@@ -30,126 +31,125 @@
flash_range = min (MAX_EX_FLASH_RANGE, flash_range)
flame_range = min (MAX_EX_FLAME_RANGE, flame_range)
spawn(0)
var/start = world.timeofday
if(!epicenter) return
var/start = world.timeofday
if(!epicenter) return
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range)
var/list/cached_exp_block = list()
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range)
var/list/cached_exp_block = list()
if(adminlog)
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])")
if(adminlog)
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])")
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
// Stereo users will also hear the direction of the explosion!
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
// Stereo users will also hear the direction of the explosion!
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
// 3/7/14 will calculate to 80 + 35
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
// 3/7/14 will calculate to 80 + 35
var/far_dist = 0
far_dist += heavy_impact_range * 5
far_dist += devastation_range * 20
var/far_dist = 0
far_dist += heavy_impact_range * 5
far_dist += devastation_range * 20
if(!silent)
var/frequency = get_rand_frequency()
for(var/mob/M in player_list)
// Double check for client
if(M && M.client)
var/turf/M_turf = get_turf(M)
if(M_turf && M_turf.z == epicenter.z)
var/dist = get_dist(M_turf, epicenter)
// If inside the blast radius + world.view - 2
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, get_sfx("explosion"), 100, 1, frequency, falloff = 5) // get_sfx() is so that everyone gets the same sound
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = Clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5)
if(!silent)
var/frequency = get_rand_frequency()
for(var/mob/M in player_list)
// Double check for client
if(M && M.client)
var/turf/M_turf = get_turf(M)
if(M_turf && M_turf.z == epicenter.z)
var/dist = get_dist(M_turf, epicenter)
// If inside the blast radius + world.view - 2
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, get_sfx("explosion"), 100, 1, frequency, falloff = 5) // get_sfx() is so that everyone gets the same sound
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = Clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5)
//postpone processing for a bit
var/postponeCycles = max(round(devastation_range/8),1)
SSlighting.postpone(postponeCycles)
SSmachine.postpone(postponeCycles)
//postpone processing for a bit
var/postponeCycles = max(round(devastation_range/8),1)
SSlighting.postpone(postponeCycles)
SSmachine.postpone(postponeCycles)
if(heavy_impact_range > 1)
var/datum/effect_system/explosion/E = new/datum/effect_system/explosion()
E.set_up(epicenter)
E.start()
if(heavy_impact_range > 1)
var/datum/effect_system/explosion/E = new/datum/effect_system/explosion()
E.set_up(epicenter)
E.start()
var/x0 = epicenter.x
var/y0 = epicenter.y
var/z0 = epicenter.z
var/x0 = epicenter.x
var/y0 = epicenter.y
var/z0 = epicenter.z
var/list/affected_turfs = trange(max_range, epicenter)
var/list/affected_turfs = trange(max_range, epicenter)
if(config.reactionary_explosions)
for(var/turf/T in affected_turfs) // we cache the explosion block rating of every turf in the explosion area
cached_exp_block[T] = 0
if(T.density && T.explosion_block)
cached_exp_block[T] += T.explosion_block
for(var/obj/machinery/door/D in T)
if(D.density && D.explosion_block)
cached_exp_block[T] += D.explosion_block
for(var/obj/structure/window/W in T)
if(W.reinf && W.fulltile)
cached_exp_block[T] += W.explosion_block
for(var/obj/effect/blob/B in T)
cached_exp_block[T] += B.explosion_block
for(var/turf/T in affected_turfs)
var/dist = cheap_hypotenuse(T.x, T.y, x0, y0)
if(config.reactionary_explosions)
for(var/turf/T in affected_turfs) // we cache the explosion block rating of every turf in the explosion area
cached_exp_block[T] = 0
if(T.density && T.explosion_block)
cached_exp_block[T] += T.explosion_block
var/turf/Trajectory = T
while(Trajectory != epicenter)
Trajectory = get_step_towards(Trajectory, epicenter)
dist += cached_exp_block[Trajectory]
for(var/obj/machinery/door/D in T)
if(D.density && D.explosion_block)
cached_exp_block[T] += D.explosion_block
var/flame_dist = 0
var/throw_dist = dist
for(var/obj/structure/window/W in T)
if(W.reinf && W.fulltile)
cached_exp_block[T] += W.explosion_block
if(dist < flame_range)
flame_dist = 1
for(var/obj/effect/blob/B in T)
cached_exp_block[T] += B.explosion_block
if(dist < devastation_range) dist = 1
else if(dist < heavy_impact_range) dist = 2
else if(dist < light_impact_range) dist = 3
else dist = 0
for(var/turf/T in affected_turfs)
//------- TURF FIRES -------
var/dist = cheap_hypotenuse(T.x, T.y, x0, y0)
if(T)
if(flame_dist && prob(40) && !istype(T, /turf/space) && !T.density)
PoolOrNew(/obj/effect/hotspot, T) //Mostly for ambience!
if(dist > 0)
T.ex_act(dist)
if(config.reactionary_explosions)
var/turf/Trajectory = T
while(Trajectory != epicenter)
Trajectory = get_step_towards(Trajectory, epicenter)
dist += cached_exp_block[Trajectory]
//--- THROW ITEMS AROUND ---
var/flame_dist = 0
var/throw_dist = dist
if(dist < flame_range)
flame_dist = 1
if(dist < devastation_range) dist = 1
else if(dist < heavy_impact_range) dist = 2
else if(dist < light_impact_range) dist = 3
else dist = 0
//------- TURF FIRES -------
if(T)
if(flame_dist && prob(40) && !istype(T, /turf/space) && !T.density)
PoolOrNew(/obj/effect/hotspot, T) //Mostly for ambience!
if(dist > 0)
T.ex_act(dist)
//--- THROW ITEMS AROUND ---
var/throw_dir = get_dir(epicenter,T)
for(var/obj/item/I in T)
if(I && !I.anchored)
var/throw_range = rand(throw_dist, max_range)
var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range)
I.throw_speed = 4 //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything)
I.throw_at_fast(throw_at, throw_range, 2)//Throw it at 2 speed, this is purely visual anyway.
var/throw_dir = get_dir(epicenter,T)
for(var/obj/item/I in T)
if(I && !I.anchored)
var/throw_range = rand(throw_dist, max_range)
var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range)
I.throw_speed = 4 //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything)
I.throw_at_fast(throw_at, throw_range, 2)//Throw it at 2 speed, this is purely visual anyway.
var/took = (world.timeofday-start)/10
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
if(Debug2) world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds."
var/took = (world.timeofday-start)/10
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
if(Debug2) world.log << "## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds."
//Machines which report explosions.
for(var/array in doppler_arrays)
var/obj/machinery/doppler_array/A = array
A.sense_explosion(epicenter,devastation_range,heavy_impact_range,light_impact_range,took,orig_dev_range,orig_heavy_range,orig_light_range)
//Machines which report explosions.
for(var/array in doppler_arrays)
var/obj/machinery/doppler_array/A = array
A.sense_explosion(epicenter,devastation_range,heavy_impact_range,light_impact_range,took,orig_dev_range,orig_heavy_range,orig_light_range)
return 1

View File

@@ -20,8 +20,7 @@
/obj/item/device/radio/intercom/attack_ai(mob/user)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
attack_self(user)
/obj/item/device/radio/intercom/attack_paw(mob/user)
return src.attack_hand(user)
@@ -29,8 +28,7 @@
/obj/item/device/radio/intercom/attack_hand(mob/user)
src.add_fingerprint(user)
spawn (0)
attack_self(user)
attack_self(user)
/obj/item/device/radio/intercom/receive_range(freq, level)
if (!on)

View File

@@ -40,16 +40,15 @@ effective or pretty fucking useless.
add_logs(user, null, "knocked down people in the area", src)
for(var/mob/living/carbon/human/M in ultra_range(10, user, 1))
spawn()
if(prob(50))
if(prob(50))
M.Weaken(rand(10,20))
if(prob(25))
M.Stun(rand(5,10))
M << "<span class='userdanger'>You feel a tremendous, paralyzing wave flood your mind.</span>"
M.Weaken(rand(10,20))
if(prob(25))
M.Stun(rand(5,10))
M << "<span class='userdanger'>You feel a tremendous, paralyzing wave flood your mind.</span>"
else
M << "<span class='userdanger'>You feel a sudden, electric jolt travel through your head.</span>"
else
M << "<span class='userdanger'>You feel a sudden, electric jolt travel through your head.</span>"
playsound(src.loc, 'sound/misc/interference.ogg', 50, 1)
user << "<span class='notice'>You trigger [src].</span>"

View File

@@ -422,7 +422,7 @@
if(istype(target, /obj/effect/decal/cleanable))
target = target.loc
if(is_type_in_list(target,validSurfaces))
var/temp = "rune"
if(letters.Find(drawtype))
temp = "letter"
@@ -1106,13 +1106,13 @@
if (cooldown < world.time)
cooldown = world.time + 1800 //3 minutes
user.visible_message("<span class='warning'>[user] presses a button on [src].</span>", "<span class='notice'>You activate [src], it plays a loud noise!</span>", "<span class='italics'>You hear the click of a button.</span>")
spawn(5) //gia said so
icon_state = "nuketoy"
playsound(src, 'sound/machines/Alarm.ogg', 100, 0, surround = 0)
sleep(135)
icon_state = "nuketoycool"
sleep(cooldown - world.time)
icon_state = "nuketoyidle"
sleep(5)
icon_state = "nuketoy"
playsound(src, 'sound/machines/Alarm.ogg', 100, 0, surround = 0)
sleep(135)
icon_state = "nuketoycool"
sleep(cooldown - world.time)
icon_state = "nuketoyidle"
else
var/timeleft = (cooldown - world.time)
user << "<span class='alert'>Nothing happens, and '</span>[round(timeleft/10)]<span class='alert'>' appears on a small display.</span>"

View File

@@ -23,8 +23,7 @@
user << "<span class='notice'>You'll need to get closer to see any more.</span>"
return
for(var/obj/item/I in loadedItems)
spawn(0)
user << "<span class='info'>\icon [I] It has \the [I] loaded.</span>"
user << "<span class='info'>\icon [I] It has \the [I] loaded.</span>"
if(tank)
user << "<span class='notice'>\icon [tank] It has \the [tank] mounted onto it.</span>"

View File

@@ -93,13 +93,12 @@
"<span class='userdanger'>You feel a powerful shock course through your body sending you flying!</span>", \
"<span class='italics'>You hear a heavy electrical crack!</span>")
var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
target.throw_at(throw_target, 200, 4)
target.throw_at_fast(throw_target, 200, 4)
return
/obj/item/weapon/twohanded/mjollnir/attack(mob/M, mob/user)
..()
spawn(0)
if(wielded)
//if(charged == 5)
//charged = 0

View File

@@ -128,13 +128,12 @@
return
for(var/obj/structure/transit_tube_pod/pod in loc)
if(!pod.moving && turn(pod.dir, (reverse_launch ? 180 : 0)) in directions())
spawn(0)
pod_moving = 1
close_animation()
sleep(CLOSE_DURATION + 2)
if(icon_state == "closed" && pod)
pod.follow_tube(reverse_launch)
pod_moving = 0
pod_moving = 1
close_animation()
sleep(CLOSE_DURATION + 2)
if(icon_state == "closed" && pod)
pod.follow_tube(reverse_launch)
pod_moving = 0
return 1
return 0

View File

@@ -61,62 +61,63 @@
else return ..()
/obj/structure/transit_tube_pod/proc/follow_tube(reverse_launch)
set waitfor = 0
if(moving)
return
moving = 1
spawn()
var/obj/structure/transit_tube/current_tube = null
var/next_dir
var/next_loc
var/last_delay = 0
var/exit_delay
if(reverse_launch)
dir = turn(dir, 180) // Back it up
var/obj/structure/transit_tube/current_tube = null
var/next_dir
var/next_loc
var/last_delay = 0
var/exit_delay
for(var/obj/structure/transit_tube/tube in loc)
if(tube.has_exit(dir))
if(reverse_launch)
dir = turn(dir, 180) // Back it up
for(var/obj/structure/transit_tube/tube in loc)
if(tube.has_exit(dir))
current_tube = tube
break
while(current_tube)
next_dir = current_tube.get_exit(dir)
if(!next_dir)
break
exit_delay = current_tube.exit_delay(src, dir)
last_delay += exit_delay
sleep(exit_delay)
next_loc = get_step(loc, next_dir)
current_tube = null
for(var/obj/structure/transit_tube/tube in next_loc)
if(tube.has_entrance(next_dir))
current_tube = tube
break
while(current_tube)
next_dir = current_tube.get_exit(dir)
if(!next_dir)
break
exit_delay = current_tube.exit_delay(src, dir)
last_delay += exit_delay
sleep(exit_delay)
next_loc = get_step(loc, next_dir)
current_tube = null
for(var/obj/structure/transit_tube/tube in next_loc)
if(tube.has_entrance(next_dir))
current_tube = tube
break
if(current_tube == null)
dir = next_dir
Move(get_step(loc, dir), dir) // Allow collisions when leaving the tubes.
break
last_delay = current_tube.enter_delay(src, next_dir)
sleep(last_delay)
if(current_tube == null)
dir = next_dir
loc = next_loc // When moving from one tube to another, skip collision and such.
density = current_tube.density
Move(get_step(loc, dir), dir) // Allow collisions when leaving the tubes.
break
if(current_tube && current_tube.should_stop_pod(src, next_dir))
current_tube.pod_stopped(src, dir)
break
last_delay = current_tube.enter_delay(src, next_dir)
sleep(last_delay)
dir = next_dir
loc = next_loc // When moving from one tube to another, skip collision and such.
density = current_tube.density
density = 1
moving = 0
if(current_tube && current_tube.should_stop_pod(src, next_dir))
current_tube.pod_stopped(src, dir)
break
density = 1
moving = 0
// Should I return a copy here? If the caller edits or del()s the returned

View File

@@ -93,14 +93,11 @@
for(var/datum/d in objs)
for(var/v in call_list)
// To stop any procs which sleep from executing slowly.
if(d)
if(hascall(d, v))
spawn() call(d, v)(arglist(args_list)) // Spawn in case the function sleeps.
SDQL_callproc(d, v, args_list)
if("delete")
for(var/datum/d in objs)
del d
qdel(d)
if("select")
var/text = ""
@@ -147,6 +144,10 @@
/proc/SDQL_callproc(thing, procname, args_list)
set waitfor = 0
if(hascall(thing, procname))
call(thing, procname)(arglist(args_list)) // Spawn in case the function sleeps.
/proc/SDQL_parse(list/query_list)
var/datum/SDQL_parser/parser = new()

View File

@@ -28,72 +28,73 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
/client/proc/callproc()
set category = "Debug"
set name = "Advanced ProcCall"
set waitfor = 0
if(!check_rights(R_DEBUG)) return
spawn(0)
var/target = null
var/targetselected = 0
var/returnval = null
var/class = null
var/target = null
var/targetselected = 0
var/returnval = null
var/class = null
switch(alert("Proc owned by something?",,"Yes","No"))
if("Yes")
targetselected = 1
if(src.holder && src.holder.marked_datum)
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client","Marked datum ([holder.marked_datum.type])")
if(class == "Marked datum ([holder.marked_datum.type])")
class = "Marked datum"
switch(alert("Proc owned by something?",,"Yes","No"))
if("Yes")
targetselected = 1
if(src.holder && src.holder.marked_datum)
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client","Marked datum ([holder.marked_datum.type])")
if(class == "Marked datum ([holder.marked_datum.type])")
class = "Marked datum"
else
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client")
switch(class)
if("Obj")
target = input("Enter target:","Target",usr) as obj in world
if("Mob")
target = input("Enter target:","Target",usr) as mob in world
if("Area or Turf")
target = input("Enter target:","Target",usr.loc) as area|turf in world
if("Client")
var/list/keys = list()
for(var/client/C)
keys += C
target = input("Please, select a player!", "Selection", null, null) as null|anything in keys
if("Marked datum")
target = holder.marked_datum
else
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client")
switch(class)
if("Obj")
target = input("Enter target:","Target",usr) as obj in world
if("Mob")
target = input("Enter target:","Target",usr) as mob in world
if("Area or Turf")
target = input("Enter target:","Target",usr.loc) as area|turf in world
if("Client")
var/list/keys = list()
for(var/client/C)
keys += C
target = input("Please, select a player!", "Selection", null, null) as null|anything in keys
if("Marked datum")
target = holder.marked_datum
else
return
if("No")
target = null
targetselected = 0
return
if("No")
target = null
targetselected = 0
var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null
if(!procname) return
if(targetselected && !hascall(target,procname))
usr << "<font color='red'>Error: callproc(): target has no such call [procname].</font>"
return
var/list/lst = get_callproc_args()
if(!lst)
var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null
if(!procname) return
if(targetselected && !hascall(target,procname))
usr << "<font color='red'>Error: callproc(): target has no such call [procname].</font>"
return
var/list/lst = get_callproc_args()
if(!lst)
return
if(targetselected)
if(!target)
usr << "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>"
return
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
else
//this currently has no hascall protection. wasn't able to get it working.
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
if(targetselected)
if(!target)
usr << "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>"
return
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
else
//this currently has no hascall protection. wasn't able to get it working.
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
usr << "<font color='blue'>[procname] returned: [returnval ? returnval : "null"]</font>"
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr << "<font color='blue'>[procname] returned: [returnval ? returnval : "null"]</font>"
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/callproc_datum(A as null|area|mob|obj|turf)
set category = "Debug"
set name = "Atom ProcCall"
set waitfor = 0
if(!check_rights(R_DEBUG))
return
@@ -113,12 +114,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
spawn()
var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
usr << "<span class='notice'>[procname] returned: [returnval ? returnval : "null"]</span>"
feedback_add_details("admin_verb","DPC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
usr << "<span class='notice'>[procname] returned: [returnval ? returnval : "null"]</span>"
/client/proc/get_callproc_args()
var/argnum = input("Number of arguments","Number:",0) as num|null
if(!argnum && (argnum!=0)) return
@@ -207,7 +209,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(istype(M, /mob/living/carbon/human))
log_admin("[key_name(src)] has robotized [M.key].")
var/mob/living/carbon/human/H = M
spawn(10)
spawn(0)
H.Robotize()
else
@@ -223,7 +225,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(istype(M, /mob/living/carbon/human))
log_admin("[key_name(src)] has blobized [M.key].")
var/mob/living/carbon/human/H = M
spawn(10)
spawn(0)
H.Blobize()
else
@@ -247,7 +249,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
log_admin("[key_name(src)] has animalized [M.key].")
spawn(10)
spawn(0)
M.Animalize()
@@ -287,7 +289,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
if(ishuman(M))
log_admin("[key_name(src)] has alienized [M.key].")
spawn(10)
spawn(0)
M:Alienize()
feedback_add_details("admin_verb","MKAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] made [key_name(M)] into an alien.")
@@ -304,7 +306,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
if(ishuman(M))
log_admin("[key_name(src)] has slimeized [M.key].")
spawn(10)
spawn(0)
M:slimeize()
feedback_add_details("admin_verb","MKMET") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] made [key_name(M)] into a slime.")

View File

@@ -76,7 +76,6 @@
if (M.id == src.id)
spawn( 0 )
M.open()
return
sleep(10)
@@ -90,7 +89,6 @@
if (M.id == src.id)
spawn( 0 )
M.close()
return
sleep(10)
cooldown = 0

View File

@@ -56,7 +56,6 @@
cooldown = 2
spawn(10)
process_cooldown()
return
/obj/item/device/assembly/prox_sensor/process()
@@ -71,15 +70,13 @@
/obj/item/device/assembly/prox_sensor/dropped()
spawn(0)
sense()
return
return
/obj/item/device/assembly/prox_sensor/toggle_scan()
if(!secured) return 0
scanning = !scanning
update_icon()
return
/obj/item/device/assembly/prox_sensor/update_icon()

View File

@@ -17,7 +17,7 @@
..()
spawn(40)
set_frequency(frequency)
return
/obj/item/device/assembly/signaler/Destroy()
if(SSradio)

View File

@@ -334,6 +334,6 @@ var/next_external_rsc = 0
'html/browser/scannernew.css',
'html/browser/playeroptions.css',
)
spawn (10)
spawn (10) //removing this spawn causes all clients to not get verbs.
//Precache the client with all other assets slowly, so as to not block other browse() calls
getFilesSlow(src, SSasset.cache, register_asset = FALSE)

View File

@@ -18,7 +18,7 @@
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/T = pick(turfs)
spawn(0) new/obj/effect/spacevine_controller(T) //spawn a controller at turf
new/obj/effect/spacevine_controller(T) //spawn a controller at turf
/datum/spacevine_mutation

View File

@@ -1,4 +1,5 @@
/mob/living/carbon/proc/dream()
set waitfor = 0
dreaming = 1
var/list/dreams = list(
"an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain",
@@ -8,17 +9,16 @@
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying"
)
spawn(0)
for(var/i = rand(1,4),i > 0, i--)
var/dream_image = pick(dreams)
dreams -= dream_image
src << "<span class='notice'><i>... [dream_image] ...</i></span>"
sleep(rand(40,70))
if(paralysis <= 0)
dreaming = 0
return 0
dreaming = 0
return 1
for(var/i = rand(1,4),i > 0, i--)
var/dream_image = pick(dreams)
dreams -= dream_image
src << "<span class='notice'><i>... [dream_image] ...</i></span>"
sleep(rand(40,70))
if(paralysis <= 0)
dreaming = 0
return 0
dreaming = 0
return 1
/mob/living/carbon/proc/handle_dreams()
if(prob(5) && !dreaming) dream()

View File

@@ -377,7 +377,7 @@
harvest = 0
weedlevel = 0 // Reset
spawn(5) // Wait a while
sleep(5) // Wait a while
update_icon()
visible_message("<span class='warning'>[oldPlantName] suddenly mutated into [myseed.plantname]!</span>")
@@ -397,7 +397,7 @@
harvest = 0
weedlevel = 0 // Reset
spawn(5) // Wait a while
sleep(5) // Wait a while
update_icon()
visible_message("<span class='warning'>The mutated weeds in [src] spawned a [myseed.plantname]!</span>")
else
@@ -798,8 +798,7 @@
user << "<span class='notice'>You reconnect \the [src]'s hoses.</span>"
for(var/obj/machinery/hydroponics/h in range(1,src))
spawn()
h.update_icon()
h.update_icon()
return

View File

@@ -284,16 +284,14 @@ var/global/list/rockTurfEdgeCache
countdown(notify_admins)
/turf/simulated/mineral/gibtonite/proc/countdown(notify_admins = 0)
spawn(0)
while(stage == 1 && det_time > 0 && mineralAmt >= 1)
det_time--
sleep(5)
if(stage == 1 && det_time <= 0 && mineralAmt >= 1)
var/turf/bombturf = get_turf(src)
mineralAmt = 0
explosion(bombturf,1,3,5, adminlog = notify_admins)
if(stage == 0 || stage == 2)
return
set waitfor = 0
while(stage == 1 && det_time > 0 && mineralAmt >= 1)
det_time--
sleep(5)
if(stage == 1 && det_time <= 0 && mineralAmt >= 1)
var/turf/bombturf = get_turf(src)
mineralAmt = 0
explosion(bombturf,1,3,5, adminlog = notify_admins)
/turf/simulated/mineral/gibtonite/proc/defuse()
if(stage == 1)

View File

@@ -182,9 +182,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!istype(usr, /mob/dead/observer))
usr << "Not when you're not dead!"
return
usr.verbs -= /mob/dead/observer/proc/dead_tele
spawn(30)
usr.verbs += /mob/dead/observer/proc/dead_tele
var/A
A = input("Area to jump to", "BOOYEA", A) as null|anything in sortedAreas
var/area/thearea = A

View File

@@ -324,8 +324,8 @@
//proc functions
for(var/Proc in functions)
if(!isnotfunc())
spawn(1)
call(src,Proc)(src)
callfunction(Proc)
//target interaction stays hardcoded
@@ -411,6 +411,9 @@
tryWalk(TARGET)
LAST_TARGET = TARGET
/mob/living/carbon/human/interactive/proc/callfunction(Proc)
set waitfor = 0
call(src,Proc)(src)
/mob/living/carbon/human/interactive/proc/tryWalk(turf/TARGET)
if(!isnotfunc())
if(!walk2derpless(TARGET))

View File

@@ -364,22 +364,21 @@ var/const/GALOSHES_DONT_HELP = 4
adjustBruteLoss(10)
/mob/living/carbon/proc/spin(spintime, speed)
spawn()
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
dir = D
spintime -= speed
return
set waitfor = 0
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
dir = D
spintime -= speed
/mob/living/carbon/resist_buckle()
if(restrained())

View File

@@ -1215,7 +1215,7 @@
H.adjustOxyLoss(8)
H.throw_alert("too_much_co2", /obj/screen/alert/too_much_co2)
if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
spawn(0) H.emote("cough")
H.emote("cough")
else
H.co2overloadtime = 0
@@ -1279,7 +1279,7 @@
H.sleeping = max(H.sleeping+2, 10)
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
spawn(0) H.emote(pick("giggle", "laugh"))
H.emote(pick("giggle", "laugh"))
handle_breath_temperature(breath, H)
@@ -1294,8 +1294,7 @@
if(!(NOBREATH in specflags) || (H.health <= config.health_threshold_crit))
if(prob(20))
spawn(0)
H.emote("gasp")
H.emote("gasp")
if(breath_pp > 0)
var/ratio = safe_breath_min/breath_pp
H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!

View File

@@ -48,7 +48,7 @@
if(losebreath > 0)
losebreath--
if(prob(10))
spawn emote("gasp")
emote("gasp")
if(istype(loc, /obj/))
var/obj/loc_as_obj = loc
loc_as_obj.handle_internal_lifeform(src,0)
@@ -113,8 +113,7 @@
//OXYGEN
if(O2_partialpressure < safe_oxy_min) //Not enough oxygen
if(prob(20))
spawn(0)
emote("gasp")
emote("gasp")
if(O2_partialpressure > 0)
var/ratio = safe_oxy_min/O2_partialpressure
adjustOxyLoss(min(5*ratio, 3))
@@ -144,7 +143,7 @@
if(world.time - co2overloadtime > 300)
adjustOxyLoss(8)
if(prob(20))
spawn(0) emote("cough")
emote("cough")
else
co2overloadtime = 0
@@ -168,7 +167,7 @@
sleeping = max(sleeping+2, 10)
else if(SA_partialpressure > 0.01)
if(prob(20))
spawn(0) emote(pick("giggle","laugh"))
emote(pick("giggle","laugh"))
//BREATH TEMPERATURE
handle_breath_temperature(breath)
@@ -264,21 +263,21 @@
/mob/living/carbon/handle_stomach()
spawn(0)
for(var/mob/living/M in stomach_contents)
if(M.loc != src)
set waitfor = 0
for(var/mob/living/M in stomach_contents)
if(M.loc != src)
stomach_contents.Remove(M)
continue
if(istype(M, /mob/living/carbon) && stat != 2)
if(M.stat == 2)
M.death(1)
stomach_contents.Remove(M)
qdel(M)
continue
if(istype(M, /mob/living/carbon) && stat != 2)
if(M.stat == 2)
M.death(1)
stomach_contents.Remove(M)
qdel(M)
continue
if(SSmob.times_fired%3==1)
if(!(M.status_flags & GODMODE))
M.adjustBruteLoss(5)
nutrition += 10
if(SSmob.times_fired%3==1)
if(!(M.status_flags & GODMODE))
M.adjustBruteLoss(5)
nutrition += 10
//This updates the health and status of the mob (conscious, unconscious, dead)
/mob/living/carbon/handle_regular_status_updates()
@@ -320,8 +319,7 @@
adjustStaminaLoss(-10)
sleeping = max(sleeping-1, 0)
if( prob(10) && health && !hal_crit )
spawn(0)
emote("snore")
emote("snore")
else
clear_alert("asleep")

View File

@@ -139,9 +139,7 @@
/mob/living/carbon/monkey/handle_random_events()
if (prob(1) && prob(2))
spawn(0)
emote("scratch")
return
emote("scratch")
/mob/living/carbon/monkey/has_smoke_protection()
if(wear_mask)

View File

@@ -96,10 +96,8 @@
damage = rand(10, 15)
if ( (paralysis < 5) && (health > 0) )
Paralyse(rand(10, 15))
spawn( 0 )
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
"<span class='userdanger'>[M] has knocked out [name]!</span>")
return
adjustBruteLoss(damage)
add_logs(M, src, "attacked")
updatehealth()

View File

@@ -41,7 +41,6 @@
for(var/obj/machinery/ai_status_display/O in world) //change status
if(src.key)
spawn( 0 )
O.mode = 2
if (istype(loc, /obj/item/device/aicard))
loc.icon_state = "aicard-404"

View File

@@ -153,7 +153,7 @@
dat += "Critical Patient Alerts: <a href='?src=\ref[src];critalerts=1'>[declare_crit ? "Yes" : "No"]</a><br>"
dat += "Patrol Station: <a href='?src=\ref[src];operation=patrol'>[auto_patrol ? "Yes" : "No"]</a><br>"
dat += "Stationary Mode: <a href='?src=\ref[src];stationary=1'>[stationary_mode ? "Yes" : "No"]</a><br>"
return dat
/mob/living/simple_animal/bot/medbot/Topic(href, href_list)
@@ -229,8 +229,7 @@
declare_crit = 0
if(user)
user << "<span class='notice'>You short out [src]'s reagent synthesis circuits.</span>"
spawn(0)
audible_message("<span class='danger'>[src] buzzes oddly!</span>")
audible_message("<span class='danger'>[src] buzzes oddly!</span>")
flick("medibot_spark", src)
if(user)
oldpatient = user

View File

@@ -116,13 +116,11 @@
//second, spin a sticky spiderweb on this tile
var/obj/effect/spider/stickyweb/W = locate() in get_turf(src)
if(!W)
spawn()
Web()
Web()
else
//third, lay an egg cluster there
if(fed)
spawn()
LayEggs()
LayEggs()
else
//fourthly, cocoon any nearby items so those pesky pinkskins can't use them
for(var/obj/O in can_see)
@@ -140,8 +138,7 @@
else if(busy == MOVING_TO_TARGET && cocoon_target)
if(get_dist(src, cocoon_target) <= 1)
spawn()
Wrap()
Wrap()
else
busy = 0

View File

@@ -275,13 +275,12 @@
else
return
L.loc = locate(locx,locy,mobloc.z)
spawn(0)
var/limit = 2//For only two trailing shadows.
for(var/turf/T in getline(mobloc, L.loc))
spawn(0)
anim(T,L,'icons/mob/mob.dmi',,"shadow",,L.dir)
limit--
if(limit<=0) break
var/limit = 2//For only two trailing shadows.
for(var/turf/T in getline(mobloc, L.loc))
spawn(0)
anim(T,L,'icons/mob/mob.dmi',,"shadow",,L.dir)
limit--
if(limit<=0) break
else
spawn(0)
anim(mobloc,mob,'icons/mob/mob.dmi',,"shadow",,L.dir)

View File

@@ -365,18 +365,18 @@
return A.master.lightswitch && A.master.power_light
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
set waitfor = 0
if(flickering) return
flickering = 1
spawn(0)
if(on && status == LIGHT_OK)
for(var/i = 0; i < amount; i++)
if(status != LIGHT_OK) break
on = !on
update(0)
sleep(rand(5, 15))
on = (status == LIGHT_OK)
if(on && status == LIGHT_OK)
for(var/i = 0; i < amount; i++)
if(status != LIGHT_OK) break
on = !on
update(0)
flickering = 0
sleep(rand(5, 15))
on = (status == LIGHT_OK)
update(0)
flickering = 0
// ai attack - make lights flicker, because why not
@@ -539,13 +539,13 @@
// explode the light
/obj/machinery/light/proc/explode()
set waitfor = 0
var/turf/T = get_turf(src.loc)
spawn(0)
broken() // break it first to give a warning
sleep(2)
explosion(T, 0, 0, 2, 2)
sleep(1)
qdel(src)
broken() // break it first to give a warning
sleep(2)
explosion(T, 0, 0, 2, 2)
sleep(1)
qdel(src)
// the light item
// can be tube or bulb subtypes

View File

@@ -80,8 +80,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
var/orbitsize = (I.Width()+I.Height())*pick(0.5,0.6,0.7)
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
spawn(1)
EB.orbit(src,orbitsize, pick(FALSE,TRUE), rand(10,25), pick(3,4,5,6,36))
EB.orbit(src,orbitsize, pick(FALSE,TRUE), rand(10,25), pick(3,4,5,6,36))

View File

@@ -105,8 +105,7 @@
/obj/item/weapon/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
if(recoil)
spawn()
shake_camera(user, recoil + 1, recoil)
shake_camera(user, recoil + 1, recoil)
if(suppressed)
playsound(user, fire_sound, 10, 1)

View File

@@ -41,7 +41,7 @@
return
if(grenades.len)
spawn(0) fire_grenade(target,user)
fire_grenade(target,user)
else
usr << "<span class='danger'>The grenade launcher is empty.</span>"
@@ -51,7 +51,7 @@
var/obj/item/weapon/grenade/chem_grenade/F = grenades[1] //Now with less copypasta!
grenades -= F
F.loc = user.loc
F.throw_at(target, 30, 2,user)
F.throw_at_fast(target, 30, 2,user)
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
F.active = 1

View File

@@ -122,18 +122,18 @@
/obj/item/projectile/proc/fire()
spawn(1)
while(loc)
if(!paused)
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
step_towards(src, current)
if(original && (original.layer>=2.75) || ismob(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original, 1)
Range()
sleep(1)
set waitfor = 0
while(loc)
if(!paused)
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
step_towards(src, current)
if(original && (original.layer>=2.75) || ismob(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original, 1)
Range()
sleep(1)
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.

View File

@@ -334,15 +334,15 @@
if(!X.anchored)
var/distance = get_dist(X, pull)
var/moving_power = max(range_power - distance, 1)
spawn(0)
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, pull)))
var/throw_range = 5 - distance
X.throw_at(throw_target, throw_range, 1)
else
X.throw_at(pull, distance, 1)
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, pull)))
var/throw_range = 5 - distance
X.throw_at_fast(throw_target, throw_range, 1)
else
X.throw_at_fast(pull, distance, 1)
else
spawn(0)
if(setting_type)
for(var/i in 0 to moving_power-1)
sleep(2)

View File

@@ -70,14 +70,14 @@ var/list/chemical_mob_spawn_nicecritters = list() // and possible friendly mobs
if(!X.anchored)
var/distance = get_dist(X, T)
var/moving_power = max(range - distance, 1)
spawn(0) //so everything moves at the same time.
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, T)))
X.throw_at(throw_target, moving_power, 1)
else
X.throw_at(T, moving_power, 1)
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, T)))
X.throw_at_fast(throw_target, moving_power, 1)
else
X.throw_at_fast(T, moving_power, 1)
else
spawn(0) //so everything moves at the same time.
if(setting_type)
for(var/i = 0, i < moving_power, i++)
sleep(2)

View File

@@ -104,15 +104,15 @@
use_power(100)
affecting = loc.contents - src // moved items will be all in loc
spawn(1) // slight delay to prevent infinite propagation due to map order //TODO: please no spawn() in process(). It's a very bad idea
var/items_moved = 0
for(var/atom/movable/A in affecting)
if(!A.anchored)
if(A.loc == src.loc) // prevents the object from being affected if it's not currently here.
step(A,movedir)
items_moved++
if(items_moved >= 10)
break
sleep(1) // slight delay to prevent infinite propagation due to map order
var/items_moved = 0
for(var/atom/movable/A in affecting)
if(!A.anchored)
if(A.loc == src.loc) // prevents the object from being affected if it's not currently here.
step(A,movedir)
items_moved++
if(items_moved >= 10)
break
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(obj/item/I, mob/user, params)

View File

@@ -62,13 +62,13 @@
loc = D.trunk
active = 1
dir = DOWN
spawn(1)
move() // spawn off the movement process
move()
return
// movement process, persists while holder is moving through pipes
/obj/structure/disposalholder/proc/move()
set waitfor = 0
var/obj/structure/disposalpipe/last
while(active)
var/obj/structure/disposalpipe/curr = loc

View File

@@ -385,11 +385,10 @@
//docking turbulence
if(M.client)
spawn(0)
if(M.buckled)
shake_camera(M, 2, 1) // turn it down a bit come on
else
shake_camera(M, 7, 1)
if(M.buckled)
shake_camera(M, 2, 1) // turn it down a bit come on
else
shake_camera(M, 7, 1)
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(3)