Removes spawn() from some things

Yay, refactoring.
This commit is contained in:
Jack Edge
2016-06-05 19:47:17 +01:00
parent 94a5d5bfad
commit a01b48aa48
12 changed files with 134 additions and 112 deletions
@@ -149,16 +149,21 @@
target.visible_message("<span class='warning'>A grotesque blade forms around [target.name]\'s arm!</span>", "<span class='userdanger'>Your arm twists and mutates, transforming into a horrific monstrosity!</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
playsound(target, 'sound/effects/blobattack.ogg', 30, 1)
spawn(600)
playsound(target, 'sound/effects/blobattack.ogg', 30, 1)
target.visible_message("<span class='warning'>With a sickening crunch, [target] reforms their [blade.name] into an arm!</span>", "<span class='warning'>[blade] reforms back to normal.</span>", "<span class='italics>You hear organic matter ripping and tearing!</span>")
qdel(blade)
user.update_inv_l_hand()
user.update_inv_r_hand()
addtimer(src, "remove_fake", 600, target, blade)
feedback_add_details("changeling_powers","AS")
return 1
/obj/effect/proc_holder/changeling/sting/false_armblade/proc/remove_fake(mob/target, obj/item/weapon/melee/arm_blade/false/blade)
playsound(target, 'sound/effects/blobattack.ogg', 30, 1)
target.visible_message("<span class='warning'>With a sickening crunch, \
[target] reforms their [blade.name] into an arm!</span>",
"<span class='warning'>[blade] reforms back to normal.</span>",
"<span class='italics>You hear organic matter ripping and tearing!</span>")
qdel(blade)
target.update_inv_l_hand()
target.update_inv_r_hand()
/obj/effect/proc_holder/changeling/sting/extract_dna
name = "Extract DNA Sting"
@@ -220,12 +225,14 @@
/obj/effect/proc_holder/changeling/sting/LSD/sting_action(mob/user, mob/living/carbon/target)
add_logs(user, target, "stung", "LSD sting")
spawn(rand(300,600))
if(target)
target.hallucination = max(400, target.hallucination)
addtimer(src, "hallucination_time", rand(300,600), target)
feedback_add_details("changeling_powers","HS")
return 1
/obj/effect/proc_holder/changeling/sting/LSD/proc/hallucination_time(mob/living/carbon/target)
if(target)
target.hallucination = max(400, target.hallucination)
/obj/effect/proc_holder/changeling/sting/cryo
name = "Cryogenic Sting"
desc = "We silently sting a human with a cocktail of chemicals that freeze them."
@@ -239,4 +246,4 @@
if(target.reagents)
target.reagents.add_reagent("frostoil", 30)
feedback_add_details("changeling_powers","CS")
return 1
return 1
@@ -390,15 +390,18 @@
return 0
flick("[initial(icon_state)]_discharged", src)
icon_state = "[initial(icon_state)]_recharging"
spawn(3000) //5 minutes
if(!src)
return 0
visible_message("<span class='warning'>The writhing tendrils return to the gemstone, which begins to glow with power.</span>")
flick("[initial(icon_state)]_recharged", src)
icon_state = initial(icon_state)
recharging = FALSE
addtimer(src, "recharge", 3000) // 5 minutes
return 1
/obj/structure/clockwork/interdiction_lens/proc/recharge()
if(!src)
return 0
visible_message("<span class='warning'>The writhing tendrils return \
to the gemstone, which begins to glow with power.</span>")
flick("[initial(icon_state)]_recharged", src)
icon_state = initial(icon_state)
recharging = FALSE
/obj/structure/clockwork/mending_motor //Mending motor: A prism that consumes replicant alloy to repair nearby mechanical servants at a quick rate.
name = "mending motor"
desc = "A dark onyx prism, held in midair by spiraling tendrils of stone."
@@ -594,9 +597,11 @@
clockwork_desc = "A gateway in reality. It can both send and receive objects."
else
clockwork_desc = "A gateway in reality. It can only [sender ? "send" : "receive"] objects."
spawn(lifetime)
if(src)
qdel(src)
addtimer(src, "selfdel", lifetime)
/obj/effect/clockwork/spatial_gateway/proc/selfdel()
if(src)
qdel(src)
//set up a gateway with another gateway
/obj/effect/clockwork/spatial_gateway/proc/setup_gateway(obj/effect/clockwork/spatial_gateway/gatewayB, set_duration, uses, two_way)
@@ -690,8 +695,10 @@
..()
playsound(src, 'sound/magic/clockwork/invoke_general.ogg', 50, 0)
animate(src, alpha = 0, time = 10)
spawn(10)
qdel(src)
addtimer(src, "selfdel", 10)
/obj/effect/clockwerk/general_marker/proc/selfdel()
qdel(src)
/obj/effect/clockwork/general_marker/nezbere
name = "Nezbere, the Brass Eidolon"
+4 -10
View File
@@ -175,16 +175,11 @@ obj/machinery/door/proc/try_to_crowbar(obj/item/I, mob/user)
if(BURN)
if(sound_effect)
playsound(src.loc, 'sound/items/Welder.ogg', 100, 1)
else
return
/obj/machinery/door/blob_act(obj/effect/blob/B)
if(prob(40))
qdel(src)
return
/obj/machinery/door/emp_act(severity)
if(prob(20/severity) && (istype(src,/obj/machinery/door/airlock) || istype(src,/obj/machinery/door/window)) )
@@ -193,10 +188,11 @@ obj/machinery/door/proc/try_to_crowbar(obj/item/I, mob/user)
if(secondsElectrified == 0)
secondsElectrified = -1
shockedby += "\[[time_stamp()]\]EM Pulse"
spawn(300)
secondsElectrified = 0
addtimer(src, "unelectrify", 300)
..()
/obj/machinery/door/proc/unelectrify()
secondsElectrified = 0
/obj/machinery/door/ex_act(severity, target)
if(severity == 3)
@@ -212,8 +208,6 @@ obj/machinery/door/proc/try_to_crowbar(obj/item/I, mob/user)
icon_state = "door1"
else
icon_state = "door0"
return
/obj/machinery/door/proc/do_animate(animation)
switch(animation)
@@ -340,4 +334,4 @@ obj/machinery/door/proc/try_to_crowbar(obj/item/I, mob/user)
return
/obj/machinery/door/proc/unlock()
return
return
+5 -4
View File
@@ -148,11 +148,12 @@ var/const/SAFETY_COOLDOWN = 100
safety_mode = TRUE
update_icon()
L.loc = src.loc
addtimer(src, "reboot", SAFETY_COOLDOWN)
spawn(SAFETY_COOLDOWN)
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
safety_mode = FALSE
update_icon()
/obj/machinery/recycler/proc/reboot()
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
safety_mode = FALSE
update_icon()
/obj/machinery/recycler/proc/crush_living(mob/living/L)
@@ -102,8 +102,8 @@
feedback_add_details("slime_cores_used","[type]")
var/turf/T = get_turf(holder.my_atom)
T.visible_message("<span class='danger'>The slime extract begins to vibrate violently !</span>")
spawn(50)
chemical_mob_spawn(holder, 5, "Gold Slime")
addtimer(src, "chemical_mob_spawn", 50, unique=FALSE,
holder, 5, "Gold Slime")
/datum/chemical_reaction/slimecritlesser
name = "Slime Crit Lesser"
@@ -118,8 +118,8 @@
feedback_add_details("slime_cores_used","[type]")
var/turf/T = get_turf(holder.my_atom)
T.visible_message("<span class='danger'>The slime extract begins to vibrate violently !</span>")
spawn(50)
chemical_mob_spawn(holder, 3, "Lesser Gold Slime", "neutral")
addtimer(src, "chemical_mob_spawn", 50, unique=FALSE,
holder, 3, "Lesser Gold Slime", "neutral")
/datum/chemical_reaction/slimecritfriendly
name = "Slime Crit Friendly"
@@ -134,8 +134,8 @@
feedback_add_details("slime_cores_used","[type]")
var/turf/T = get_turf(holder.my_atom)
T.visible_message("<span class='danger'>The slime extract begins to vibrate adorably !</span>")
spawn(50)
chemical_mob_spawn(holder, 1, "Friendly Gold Slime", "neutral")
addtimer(src, "chemical_mob_spawn", 50, unique=FALSE,
holder, 1, "Friendly Gold Slime", "neutral")
//Silver
/datum/chemical_reaction/slimebork
+23 -23
View File
@@ -106,32 +106,32 @@
for(var/obj/item in hand_items)
if(ABSTRACT in item.flags || NODROP in item.flags)
continue
marked_item = item
marked_item = item
M << "<span class='warning'>You begin to focus your very being into the [item.name]...</span>"
break
if(!marked_item)
M << "<span class='caution'>You must hold an item you wish to make your phylactery...</span>"
return
spawn(50)
if(marked_item.loc != M) //I changed my mind I don't want to put my soul in a cheeseburger!
M << "<span class='warning'>Your soul snaps back to your body as you drop the [marked_item.name]!</span>"
marked_item = null
return
name = "RISE!"
desc = "Rise from the dead! You will reform at the location of your phylactery and your old body will crumble away."
charge_max = 1800 //3 minute cooldown, if you rise in sight of someone and killed again, you're probably screwed.
charge_counter = 1800
stat_allowed = 1
marked_item.name = "Ensouled [marked_item.name]"
marked_item.desc = "A terrible aura surrounds this item, its very existence is offensive to life itself..."
marked_item.color = "#003300"
M << "<span class='userdanger'>With a hideous feeling of emptiness you watch in horrified fascination as skin sloughs off bone! Blood boils, nerves disintegrate, eyes boil in their sockets! As your organs crumble to dust in your fleshless chest you come to terms with your choice. You're a lich!</span>"
M.set_species(/datum/species/skeleton)
current_body = M.mind.current
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.unEquip(H.wear_suit)
H.unEquip(H.head)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe/black(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/head/wizard/black(H), slot_head)
if(!do_after(M, 50, needhand=FALSE, target=marked_item))
M << "<span class='warning'>Your soul snaps back to your body as you stop ensouling [marked_item.name]!</span>"
marked_item = null
return
name = "RISE!"
desc = "Rise from the dead! You will reform at the location of your phylactery and your old body will crumble away."
charge_max = 1800 //3 minute cooldown, if you rise in sight of someone and killed again, you're probably screwed.
charge_counter = 1800
stat_allowed = 1
marked_item.name = "Ensouled [marked_item.name]"
marked_item.desc = "A terrible aura surrounds this item, its very existence is offensive to life itself..."
marked_item.color = "#003300"
M << "<span class='userdanger'>With a hideous feeling of emptiness you watch in horrified fascination as skin sloughs off bone! Blood boils, nerves disintegrate, eyes boil in their sockets! As your organs crumble to dust in your fleshless chest you come to terms with your choice. You're a lich!</span>"
M.set_species(/datum/species/skeleton)
current_body = M.mind.current
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.unEquip(H.wear_suit)
H.unEquip(H.head)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe/black(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/head/wizard/black(H), slot_head)
+4 -3
View File
@@ -319,9 +319,7 @@
AM.overlays += targeteffect
throwtarget = get_edge_target_turf(user, get_dir(user, get_step_away(AM, user)))
distfromcaster = get_dist(user, AM)
spawn(10)
AM.overlays -= targeteffect
qdel(targeteffect)
addtimer(src, "remove_sparkles", AM, targeteffect)
if(distfromcaster == 0)
if(istype(AM, /mob/living))
var/mob/living/M = AM
@@ -335,6 +333,9 @@
M << "<span class='userdanger'>You're thrown back by [user]!</span>"
AM.throw_at_fast(throwtarget, ((Clamp((maxthrow - (Clamp(distfromcaster - 2, 0, distfromcaster))), 3, maxthrow))), 1,user)//So stuff gets tossed around at the same time.
/obj/effect/proc_holder/spell/aoe_turf/repulse/proc/remove_sparkles(atom/movable/AM, obj/effect/overlay/targeteffect)
AM.overlays -= targeteffect
qdel(targeteffect)
/obj/effect/proc_holder/spell/aoe_turf/repulse/xeno //i fixed conflicts only to find out that this is in the WIZARD file instead of the xeno file?!
name = "Tail Sweep"
+29 -24
View File
@@ -21,11 +21,11 @@
return
if(owner.nutrition <= hunger_threshold)
synthesizing = 1
synthesizing = TRUE
owner << "<span class='notice'>You feel less hungry...</span>"
owner.nutrition += 50
spawn(50)
synthesizing = 0
sleep(50)
synthesizing = FALSE
/obj/item/organ/cyberimp/chest/nutriment/emp_act(severity)
if(!owner)
@@ -57,22 +57,10 @@
/obj/item/organ/cyberimp/chest/reviver/on_life()
if(reviving)
if(owner.stat == UNCONSCIOUS)
spawn(30)
if(prob(90) && owner.getOxyLoss())
owner.adjustOxyLoss(-3)
revive_cost += 5
if(prob(75) && owner.getBruteLoss())
owner.adjustBruteLoss(-1)
revive_cost += 20
if(prob(75) && owner.getFireLoss())
owner.adjustFireLoss(-1)
revive_cost += 20
if(prob(40) && owner.getToxLoss())
owner.adjustToxLoss(-1)
revive_cost += 50
addtimer(src, "heal", 30)
else
cooldown = revive_cost + world.time
reviving = 0
reviving = FALSE
return
if(cooldown > world.time)
@@ -83,7 +71,21 @@
return
revive_cost = 0
reviving = 1
reviving = TRUE
/obj/item/organ/cyberimp/chest/reviver/proc/heal()
if(prob(90) && owner.getOxyLoss())
owner.adjustOxyLoss(-3)
revive_cost += 5
if(prob(75) && owner.getBruteLoss())
owner.adjustBruteLoss(-1)
revive_cost += 20
if(prob(75) && owner.getFireLoss())
owner.adjustFireLoss(-1)
revive_cost += 20
if(prob(40) && owner.getToxLoss())
owner.adjustToxLoss(-1)
revive_cost += 50
/obj/item/organ/cyberimp/chest/reviver/emp_act(severity)
if(!owner)
@@ -97,13 +99,16 @@
if(istype(owner, /mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(H.stat != DEAD && prob(50 / severity))
H.heart_attack = 1
spawn(600 / severity)
H.heart_attack = 0
if(H.stat == CONSCIOUS)
H << "<span class='notice'>You feel your heart beating again!</span>"
H.heart_attack = TRUE
addtimer(src, "undo_heart_attack", 600 / severity)
/obj/item/organ/cyberimp/chest/reviver/proc/undo_heart_attack()
var/mob/living/carbon/human/H = owner
if(!istype(H))
return
H.heart_attack = FALSE
if(H.stat == CONSCIOUS)
H << "<span class='notice'>You feel your heart beating again!</span>"
/obj/item/organ/cyberimp/chest/thrusters
@@ -140,9 +140,11 @@
/obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity)
if(crit_fail)
return
crit_fail = 1
spawn(90 / severity)
crit_fail = 0
crit_fail = TRUE
addtimer(src, "reboot", 90 / severity)
/obj/item/organ/cyberimp/brain/anti_stun/proc/reboot()
crit_fail = FALSE
//[[[[MOUTH]]]]
@@ -125,18 +125,19 @@
if(!special)
H.heart_attack = 1
spawn(120)
if(!owner)
Stop()
addtimer(src, "stop_if_unowned", 120)
/obj/item/organ/heart/proc/stop_if_unowned()
if(!owner)
Stop()
/obj/item/organ/heart/attack_self(mob/user)
..()
if(!beating)
visible_message("<span class='notice'>[user] squeezes [src] to \
make it beat again!</span>")
Restart()
spawn(80)
if(!owner)
Stop()
addtimer(src, "stop_if_unowned", 80)
/obj/item/organ/heart/Insert(mob/living/carbon/M, special = 0)
..()
+7 -5
View File
@@ -23,13 +23,15 @@ var/list/GPS_list = list()
return ..()
/obj/item/device/gps/emp_act(severity)
emped = 1
emped = TRUE
overlays -= "working"
overlays += "emp"
spawn(300)
emped = 0
overlays -= "emp"
overlays += "working"
addtimer(src, "reboot", 300)
/obj/item/device/gps/proc/reboot()
emped = FALSE
overlays -= "emp"
overlays += "working"
/obj/item/device/gps/AltClick(mob/user)
if(!user.canUseTopic(src, be_close=TRUE))
+7 -5
View File
@@ -74,11 +74,7 @@
A.audible_message("<span class='italics'>You hear a loud metallic \
grinding sound.</span>")
spawn(20)
if(removing_airlock)
playsound(src.loc, 'sound/hallucinations/growl3.ogg', 50, 1)
user.audible_message("<span class='warning'>[user] growls as \
their claws dig into the metal frame...</span>")
addtimer(src, "growl", 20, unique=FALSE, user)
if(do_after(user, delay=160, needhand=FALSE, target=A, progress=TRUE))
playsound(src.loc, 'sound/hallucinations/far_noise.ogg', 50, 1)
@@ -93,6 +89,12 @@
qdel(A)
removing_airlock = FALSE
/obj/item/zombie_hand/proc/growl(mob/user)
if(removing_airlock)
playsound(src.loc, 'sound/hallucinations/growl3.ogg', 50, 1)
user.audible_message("<span class='warning'>[user] growls as \
their claws dig into the metal frame...</span>")
/obj/item/zombie_hand/suicide_act(mob/living/carbon/user)
// Suiciding as a zombie brings someone else in to play it
user.visible_message("<span class='suicide'>[user] is lying down.</span>")