mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Replaces all instances of spawn() with addtimer/INVOKE_ASYNC (#28958)
* spawn removal * missed a rp * missed a var * vars * stuff * ok * Update disposal-unit.dm * Update disposal-structures.dm * Update tooltip.dm * Update experimentor.dm * Update disposal-unit.dm * Update experimentor.dm
This commit is contained in:
@@ -153,7 +153,7 @@ Auto Patrol[]"},
|
||||
update_controls()
|
||||
|
||||
/mob/living/simple_animal/bot/ed209/proc/judgement_criteria()
|
||||
var/final = FALSE
|
||||
var/final = FALSE
|
||||
if(idcheck)
|
||||
final = final|JUDGE_IDCHECK
|
||||
if(check_records)
|
||||
|
||||
@@ -156,7 +156,7 @@ Auto Patrol: []"},
|
||||
mode = BOT_HUNT
|
||||
|
||||
/mob/living/simple_animal/bot/secbot/proc/judgement_criteria()
|
||||
var/final = FALSE
|
||||
var/final = FALSE
|
||||
if(idcheck)
|
||||
final = final|JUDGE_IDCHECK
|
||||
if(check_records)
|
||||
|
||||
@@ -73,40 +73,43 @@
|
||||
reagents.trans_to(D, amount_per_transfer_from_this, 1/range)
|
||||
D.color = mix_color_from_reagents(D.reagents.reagent_list)
|
||||
var/wait_step = max(round(2+3/range), 2)
|
||||
spawn(0)
|
||||
var/range_left = range
|
||||
for(var/i=0, i<range, i++)
|
||||
range_left--
|
||||
step_towards(D,A)
|
||||
sleep(wait_step)
|
||||
do_spray(A, wait_step, D, range, puff_reagent_left)
|
||||
|
||||
for(var/atom/T in get_turf(D))
|
||||
if(T == D || T.invisibility) //we ignore the puff itself and stuff below the floor
|
||||
continue
|
||||
if(puff_reagent_left <= 0)
|
||||
break
|
||||
/obj/item/weapon/reagent_containers/spray/proc/do_spray(atom/A, wait_step, obj/effect/decal/chempuff/D, range, puff_reagent_left)
|
||||
set waitfor = FALSE
|
||||
var/range_left = range
|
||||
for(var/i=0, i<range, i++)
|
||||
range_left--
|
||||
step_towards(D,A)
|
||||
sleep(wait_step)
|
||||
|
||||
if(stream_mode)
|
||||
if(ismob(T))
|
||||
var/mob/M = T
|
||||
if(!M.lying || !range_left)
|
||||
D.reagents.reaction(M, VAPOR)
|
||||
puff_reagent_left -= 1
|
||||
else if(!range_left)
|
||||
D.reagents.reaction(T, VAPOR)
|
||||
else
|
||||
D.reagents.reaction(T, VAPOR)
|
||||
if(ismob(T))
|
||||
for(var/atom/T in get_turf(D))
|
||||
if(T == D || T.invisibility) //we ignore the puff itself and stuff below the floor
|
||||
continue
|
||||
if(puff_reagent_left <= 0)
|
||||
break
|
||||
|
||||
if(stream_mode)
|
||||
if(ismob(T))
|
||||
var/mob/M = T
|
||||
if(!M.lying || !range_left)
|
||||
D.reagents.reaction(M, VAPOR)
|
||||
puff_reagent_left -= 1
|
||||
else if(!range_left)
|
||||
D.reagents.reaction(T, VAPOR)
|
||||
else
|
||||
D.reagents.reaction(T, VAPOR)
|
||||
if(ismob(T))
|
||||
puff_reagent_left -= 1
|
||||
|
||||
if(puff_reagent_left > 0 && (!stream_mode || !range_left))
|
||||
D.reagents.reaction(get_turf(D), VAPOR)
|
||||
puff_reagent_left -= 1
|
||||
if(puff_reagent_left > 0 && (!stream_mode || !range_left))
|
||||
D.reagents.reaction(get_turf(D), VAPOR)
|
||||
puff_reagent_left -= 1
|
||||
|
||||
if(puff_reagent_left <= 0) // we used all the puff so we delete it.
|
||||
qdel(D)
|
||||
return
|
||||
qdel(D)
|
||||
if(puff_reagent_left <= 0) // we used all the puff so we delete it.
|
||||
qdel(D)
|
||||
return
|
||||
qdel(D)
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/attack_self(mob/user)
|
||||
stream_mode = !stream_mode
|
||||
|
||||
@@ -555,9 +555,7 @@
|
||||
/obj/structure/disposalpipe/trunk/Initialize()
|
||||
. = ..()
|
||||
dpdir = dir
|
||||
spawn(1)
|
||||
getlinked()
|
||||
|
||||
getlinked()
|
||||
update()
|
||||
|
||||
/obj/structure/disposalpipe/trunk/Destroy()
|
||||
@@ -658,12 +656,11 @@
|
||||
else
|
||||
stored = new (src, DISP_END_OUTLET,dir)
|
||||
|
||||
spawn(1)
|
||||
target = get_ranged_target_turf(src, dir, 10)
|
||||
target = get_ranged_target_turf(src, dir, 10)
|
||||
|
||||
trunk = locate() in src.loc
|
||||
if(trunk)
|
||||
trunk.linked = src // link the pipe trunk to self
|
||||
trunk = locate() in loc
|
||||
if(trunk)
|
||||
trunk.linked = src // link the pipe trunk to self
|
||||
|
||||
/obj/structure/disposaloutlet/Destroy()
|
||||
if(trunk)
|
||||
|
||||
@@ -379,6 +379,11 @@
|
||||
else if(full_pressure)
|
||||
add_overlay("dispover-ready")
|
||||
|
||||
/obj/machinery/disposal/bin/proc/do_flush()
|
||||
set waitfor = FALSE
|
||||
SSblackbox.inc("disposal_auto_flush")
|
||||
flush()
|
||||
|
||||
//timed process
|
||||
//charge the gas reservoir and perform flush if ready
|
||||
/obj/machinery/disposal/bin/process()
|
||||
@@ -389,15 +394,13 @@
|
||||
if(flush_count >= flush_every_ticks)
|
||||
if(contents.len)
|
||||
if(full_pressure)
|
||||
spawn(0)
|
||||
SSblackbox.inc("disposal_auto_flush",1)
|
||||
flush()
|
||||
do_flush()
|
||||
flush_count = 0
|
||||
|
||||
updateDialog()
|
||||
|
||||
if(flush && air_contents.return_pressure() >= SEND_PRESSURE) // flush can happen even without power
|
||||
INVOKE_ASYNC(src, .proc/flush)
|
||||
do_flush()
|
||||
|
||||
if(stat & NOPOWER) // won't charge if no power
|
||||
return
|
||||
@@ -447,10 +450,9 @@
|
||||
/obj/machinery/disposal/deliveryChute/Initialize(mapload, obj/structure/disposalconstruct/make_from)
|
||||
. = ..()
|
||||
stored.ptype = DISP_END_CHUTE
|
||||
spawn(5)
|
||||
trunk = locate() in loc
|
||||
if(trunk)
|
||||
trunk.linked = src // link the pipe trunk to self
|
||||
trunk = locate() in loc
|
||||
if(trunk)
|
||||
trunk.linked = src // link the pipe trunk to self
|
||||
|
||||
/obj/machinery/disposal/deliveryChute/place_item_in_disposal(obj/item/I, mob/user)
|
||||
if(I.disposalEnterTry())
|
||||
|
||||
@@ -59,11 +59,16 @@ Note: Must be placed within 3 tiles of the R&D Console
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the [src.name]!</span>")
|
||||
return
|
||||
busy = 1
|
||||
busy = TRUE
|
||||
loaded_item = O
|
||||
O.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>You add the [O.name] to the [src.name]!</span>")
|
||||
flick("d_analyzer_la", src)
|
||||
spawn(10)
|
||||
icon_state = "d_analyzer_l"
|
||||
busy = 0
|
||||
addtimer(CALLBACK(src, .proc/finish_loading), 10)
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/proc/finish_loading()
|
||||
update_icon()
|
||||
busy = FALSE
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/update_icon()
|
||||
icon_state = "d_analyzer_l"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//this is designed to replace the destructive analyzer
|
||||
|
||||
//NEEDS MAJOR CODE CLEANUP
|
||||
|
||||
#define SCANTYPE_POKE 1
|
||||
#define SCANTYPE_IRRADIATE 2
|
||||
#define SCANTYPE_GAS 3
|
||||
@@ -299,7 +301,7 @@
|
||||
investigate_log("Experimentor has released [chosenchem] smoke.", INVESTIGATE_EXPERIMENTOR)
|
||||
var/datum/effect_system/smoke_spread/chem/smoke = new
|
||||
smoke.set_up(R, 0, src, silent = 1)
|
||||
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
smoke.start()
|
||||
qdel(R)
|
||||
ejectItem(TRUE)
|
||||
@@ -311,7 +313,7 @@
|
||||
R.add_reagent(chosenchem , 50)
|
||||
var/datum/effect_system/smoke_spread/chem/smoke = new
|
||||
smoke.set_up(R, 0, src, silent = 1)
|
||||
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
smoke.start()
|
||||
qdel(R)
|
||||
ejectItem(TRUE)
|
||||
@@ -319,10 +321,10 @@
|
||||
investigate_log("Experimentor has released <font color='red'>[chosenchem]</font> smoke!", INVESTIGATE_EXPERIMENTOR)
|
||||
else if(prob(EFFECT_PROB_LOW-badThingCoeff))
|
||||
visible_message("[src] malfunctions, spewing harmless gas.")
|
||||
throwSmoke(src.loc)
|
||||
throwSmoke(loc)
|
||||
else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff))
|
||||
visible_message("<span class='warning'>[src] melts [exp_on], ionizing the air around it!</span>")
|
||||
empulse(src.loc, 4, 6)
|
||||
empulse(loc, 4, 6)
|
||||
investigate_log("Experimentor has generated an Electromagnetic Pulse.", INVESTIGATE_EXPERIMENTOR)
|
||||
ejectItem(TRUE)
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -330,7 +332,7 @@
|
||||
visible_message("[src] raises [exp_on]'s temperature.")
|
||||
if(prob(EFFECT_PROB_LOW) && criticalReaction)
|
||||
visible_message("<span class='warning'>[src]'s emergency coolant system gives off a small ding!</span>")
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
var/obj/item/weapon/reagent_containers/food/drinks/coffee/C = new /obj/item/weapon/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src))))
|
||||
chosenchem = pick("plasma","capsaicin","ethanol")
|
||||
C.reagents.remove_any(25)
|
||||
@@ -353,12 +355,12 @@
|
||||
FB.fire()
|
||||
else if(prob(EFFECT_PROB_LOW-badThingCoeff))
|
||||
visible_message("<span class='danger'>[src] malfunctions, melting [exp_on] and releasing a burst of flame!</span>")
|
||||
explosion(src.loc, -1, 0, 0, 0, 0, flame_range = 2)
|
||||
explosion(loc, -1, 0, 0, 0, 0, flame_range = 2)
|
||||
investigate_log("Experimentor started a fire.", INVESTIGATE_EXPERIMENTOR)
|
||||
ejectItem(TRUE)
|
||||
else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff))
|
||||
visible_message("<span class='warning'>[src] malfunctions, melting [exp_on] and leaking hot air!</span>")
|
||||
var/datum/gas_mixture/env = src.loc.return_air()
|
||||
var/datum/gas_mixture/env = loc.return_air()
|
||||
var/transfer_moles = 0.25 * env.total_moles()
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
if(removed)
|
||||
@@ -372,7 +374,7 @@
|
||||
ejectItem(TRUE)
|
||||
else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff))
|
||||
visible_message("<span class='warning'>[src] malfunctions, activating its emergency coolant systems!</span>")
|
||||
throwSmoke(src.loc)
|
||||
throwSmoke(loc)
|
||||
for(var/mob/living/m in oview(1, src))
|
||||
m.apply_damage(5, BURN, pick("head","chest","groin"))
|
||||
investigate_log("Experimentor has dealt minor burn damage to [m]", INVESTIGATE_EXPERIMENTOR)
|
||||
@@ -383,7 +385,7 @@
|
||||
if(prob(EFFECT_PROB_LOW) && criticalReaction)
|
||||
visible_message("<span class='warning'>[src]'s emergency coolant system gives off a small ding!</span>")
|
||||
var/obj/item/weapon/reagent_containers/food/drinks/coffee/C = new /obj/item/weapon/reagent_containers/food/drinks/coffee(get_turf(pick(oview(1,src))))
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //Ding! Your death coffee is ready!
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1) //Ding! Your death coffee is ready!
|
||||
chosenchem = pick("uranium","frostoil","ephedrine")
|
||||
C.reagents.remove_any(25)
|
||||
C.reagents.add_reagent(chosenchem , 50)
|
||||
@@ -398,13 +400,13 @@
|
||||
investigate_log("Experimentor has released frostoil gas.", INVESTIGATE_EXPERIMENTOR)
|
||||
var/datum/effect_system/smoke_spread/chem/smoke = new
|
||||
smoke.set_up(R, 0, src, silent = 1)
|
||||
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3)
|
||||
smoke.start()
|
||||
qdel(R)
|
||||
ejectItem(TRUE)
|
||||
else if(prob(EFFECT_PROB_LOW-badThingCoeff))
|
||||
visible_message("<span class='warning'>[src] malfunctions, shattering [exp_on] and leaking cold air!</span>")
|
||||
var/datum/gas_mixture/env = src.loc.return_air()
|
||||
var/datum/gas_mixture/env = loc.return_air()
|
||||
var/transfer_moles = 0.25 * env.total_moles()
|
||||
var/datum/gas_mixture/removed = env.remove(transfer_moles)
|
||||
if(removed)
|
||||
@@ -419,7 +421,7 @@
|
||||
else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff))
|
||||
visible_message("<span class='warning'>[src] malfunctions, releasing a flurry of chilly air as [exp_on] pops out!</span>")
|
||||
var/datum/effect_system/smoke_spread/smoke = new
|
||||
smoke.set_up(0, src.loc)
|
||||
smoke.set_up(0, loc)
|
||||
smoke.start()
|
||||
ejectItem()
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -433,14 +435,14 @@
|
||||
new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src))))
|
||||
else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff))
|
||||
visible_message("<span class='danger'>[src]'s crusher goes way too many levels too high, crushing right through space-time!</span>")
|
||||
playsound(src.loc, 'sound/effects/supermatter.ogg', 50, 1, -3)
|
||||
playsound(src, 'sound/effects/supermatter.ogg', 50, 1, -3)
|
||||
investigate_log("Experimentor has triggered the 'throw things' reaction.", INVESTIGATE_EXPERIMENTOR)
|
||||
for(var/atom/movable/AM in oview(7,src))
|
||||
if(!AM.anchored)
|
||||
AM.throw_at(src,10,1)
|
||||
else if(prob(EFFECT_PROB_LOW-badThingCoeff))
|
||||
visible_message("<span class='danger'>[src]'s crusher goes one level too high, crushing right into space-time!</span>")
|
||||
playsound(src.loc, 'sound/effects/supermatter.ogg', 50, 1, -3)
|
||||
playsound(src, 'sound/effects/supermatter.ogg', 50, 1, -3)
|
||||
investigate_log("Experimentor has triggered the 'minor throw things' reaction.", INVESTIGATE_EXPERIMENTOR)
|
||||
var/list/throwAt = list()
|
||||
for(var/atom/movable/AM in oview(7,src))
|
||||
@@ -458,7 +460,7 @@
|
||||
|
||||
if(exp == SCANTYPE_DISCOVER)
|
||||
visible_message("[src] scans the [exp_on], revealing its true nature!")
|
||||
playsound(src.loc, 'sound/effects/supermatter.ogg', 50, 3, -1)
|
||||
playsound(src, 'sound/effects/supermatter.ogg', 50, 3, -1)
|
||||
var/obj/item/weapon/relic/R = loaded_item
|
||||
R.reveal()
|
||||
investigate_log("Experimentor has revealed a relic with <span class='danger'>[R.realProc]</span> effect.", INVESTIGATE_EXPERIMENTOR)
|
||||
@@ -473,13 +475,13 @@
|
||||
ejectItem()
|
||||
if(globalMalf > 16 && globalMalf < 35)
|
||||
visible_message("<span class='warning'>[src] melts [exp_on], ian-izing the air around it!</span>")
|
||||
throwSmoke(src.loc)
|
||||
throwSmoke(loc)
|
||||
if(trackedIan)
|
||||
throwSmoke(trackedIan.loc)
|
||||
trackedIan.loc = src.loc
|
||||
trackedIan.forceMove(loc)
|
||||
investigate_log("Experimentor has stolen Ian!", INVESTIGATE_EXPERIMENTOR) //...if anyone ever fixes it...
|
||||
else
|
||||
new /mob/living/simple_animal/pet/dog/corgi(src.loc)
|
||||
new /mob/living/simple_animal/pet/dog/corgi(loc)
|
||||
investigate_log("Experimentor has spawned a new corgi.", INVESTIGATE_EXPERIMENTOR)
|
||||
ejectItem(TRUE)
|
||||
if(globalMalf > 36 && globalMalf < 50)
|
||||
@@ -490,13 +492,13 @@
|
||||
investigate_log("Experimentor has taken 50 brute a blood sacrifice from [m]", INVESTIGATE_EXPERIMENTOR)
|
||||
if(globalMalf > 51 && globalMalf < 75)
|
||||
visible_message("<span class='warning'>[src] encounters a run-time error!</span>")
|
||||
throwSmoke(src.loc)
|
||||
throwSmoke(loc)
|
||||
if(trackedRuntime)
|
||||
throwSmoke(trackedRuntime.loc)
|
||||
trackedRuntime.loc = src.loc
|
||||
trackedRuntime.loc = loc
|
||||
investigate_log("Experimentor has stolen Runtime!", INVESTIGATE_EXPERIMENTOR)
|
||||
else
|
||||
new /mob/living/simple_animal/pet/cat(src.loc)
|
||||
new /mob/living/simple_animal/pet/cat(loc)
|
||||
investigate_log("Experimentor failed to steal runtime, and instead spawned a new cat.", INVESTIGATE_EXPERIMENTOR)
|
||||
ejectItem(TRUE)
|
||||
if(globalMalf > 76)
|
||||
@@ -504,9 +506,14 @@
|
||||
use_power(500000)
|
||||
investigate_log("Experimentor has drained power from its APC", INVESTIGATE_EXPERIMENTOR)
|
||||
|
||||
spawn(resetTime)
|
||||
icon_state = "h_lathe"
|
||||
recentlyExperimented = 0
|
||||
addtimer(CALLBACK(src, .proc/reset_exp), resetTime)
|
||||
|
||||
/obj/machinery/r_n_d/experimentor/proc/reset_exp()
|
||||
update_icon()
|
||||
recentlyExperimented = FALSE
|
||||
|
||||
/obj/machinery/r_n_d/experimentor/update_icon()
|
||||
icon_state = "h_lathe"
|
||||
|
||||
/obj/machinery/r_n_d/experimentor/Topic(href, href_list)
|
||||
if(..())
|
||||
@@ -526,7 +533,7 @@
|
||||
else if(scantype == "eject")
|
||||
ejectItem()
|
||||
else if(scantype == "refresh")
|
||||
src.updateUsrDialog()
|
||||
updateUsrDialog()
|
||||
else
|
||||
if(recentlyExperimented)
|
||||
to_chat(usr, "<span class='warning'>[src] has been used too recently!</span>")
|
||||
@@ -551,7 +558,7 @@
|
||||
var/list/temp_tech = ConvertReqString2List(process.origin_tech)
|
||||
for(var/T in temp_tech)
|
||||
linked_console.files.UpdateTech(T, temp_tech[T])
|
||||
src.updateUsrDialog()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
//~~~~~~~~Admin logging proc, aka the Powergamer Alarm~~~~~~~~
|
||||
@@ -610,14 +617,16 @@
|
||||
if(cooldown)
|
||||
to_chat(user, "<span class='warning'>[src] does not react!</span>")
|
||||
return
|
||||
else if(src.loc == user)
|
||||
else if(loc == user)
|
||||
cooldown = TRUE
|
||||
call(src,realProc)(user)
|
||||
spawn(cooldownMax)
|
||||
cooldown = FALSE
|
||||
addtimer(CALLBACK(src, .proc/cd), cooldownMax)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You aren't quite sure what to do with this yet.</span>")
|
||||
|
||||
/obj/item/weapon/relic/proc/cd()
|
||||
cooldown = FALSE
|
||||
|
||||
//////////////// RELIC PROCS /////////////////////////////
|
||||
|
||||
/obj/item/weapon/relic/proc/throwSmoke(turf/where)
|
||||
@@ -626,19 +635,19 @@
|
||||
smoke.start()
|
||||
|
||||
/obj/item/weapon/relic/proc/corgicannon(mob/user)
|
||||
playsound(src.loc, "sparks", rand(25,50), 1)
|
||||
playsound(src, "sparks", rand(25,50), 1)
|
||||
var/mob/living/simple_animal/pet/dog/corgi/C = new/mob/living/simple_animal/pet/dog/corgi(get_turf(user))
|
||||
C.throw_at(pick(oview(10,user)), 10, rand(3,8), callback = CALLBACK(src, .throwSmoke, C))
|
||||
warn_admins(user, "Corgi Cannon", 0)
|
||||
|
||||
/obj/item/weapon/relic/proc/clean(mob/user)
|
||||
playsound(src.loc, "sparks", rand(25,50), 1)
|
||||
playsound(src, "sparks", rand(25,50), 1)
|
||||
var/obj/item/weapon/grenade/chem_grenade/cleaner/CL = new/obj/item/weapon/grenade/chem_grenade/cleaner(get_turf(user))
|
||||
CL.prime()
|
||||
warn_admins(user, "Smoke", 0)
|
||||
|
||||
/obj/item/weapon/relic/proc/flash(mob/user)
|
||||
playsound(src.loc, "sparks", rand(25,50), 1)
|
||||
playsound(src, "sparks", rand(25,50), 1)
|
||||
var/obj/item/weapon/grenade/flashbang/CB = new/obj/item/weapon/grenade/flashbang(user.loc)
|
||||
CB.prime()
|
||||
warn_admins(user, "Flash")
|
||||
@@ -664,7 +673,7 @@
|
||||
var/counter
|
||||
var/max = rand(5,10)
|
||||
for(counter = 1; counter < max; counter++)
|
||||
var/obj/item/weapon/relic/R = new src.type(get_turf(src))
|
||||
var/obj/item/weapon/relic/R = new type(get_turf(src))
|
||||
R.name = name
|
||||
R.desc = desc
|
||||
R.realName = realName
|
||||
@@ -673,31 +682,32 @@
|
||||
dupes |= R
|
||||
R.throw_at(pick(oview(7,get_turf(src))),10,1)
|
||||
counter = 0
|
||||
spawn(rand(10,100))
|
||||
for(counter = 1; counter <= dupes.len; counter++)
|
||||
var/obj/item/weapon/relic/R = dupes[counter]
|
||||
qdel(R)
|
||||
QDEL_LIST_IN(dupes, rand(10, 100))
|
||||
warn_admins(user, "Rapid duplicator", 0)
|
||||
|
||||
/obj/item/weapon/relic/proc/explode(mob/user)
|
||||
to_chat(user, "<span class='danger'>[src] begins to heat up!</span>")
|
||||
spawn(rand(35,100))
|
||||
if(src.loc == user)
|
||||
visible_message("<span class='notice'>The [src]'s top opens, releasing a powerful blast!</span>")
|
||||
explosion(user.loc, -1, rand(1,5), rand(1,5), rand(1,5), rand(1,5), flame_range = 2)
|
||||
warn_admins(user, "Explosion")
|
||||
qdel(src) //Comment this line to produce a light grenade (the bomb that keeps on exploding when used)!!
|
||||
addtimer(CALLBACK(src, .proc/do_explode, user), rand(35, 100))
|
||||
|
||||
/obj/item/weapon/relic/proc/do_explode(mob/user)
|
||||
if(loc == user)
|
||||
visible_message("<span class='notice'>\The [src]'s top opens, releasing a powerful blast!</span>")
|
||||
explosion(user.loc, 0, rand(1,5), rand(1,5), rand(1,5), rand(1,5), flame_range = 2)
|
||||
warn_admins(user, "Explosion")
|
||||
qdel(src) //Comment this line to produce a light grenade (the bomb that keeps on exploding when used)!!
|
||||
|
||||
/obj/item/weapon/relic/proc/teleport(mob/user)
|
||||
to_chat(user, "<span class='notice'>The [src] begins to vibrate!</span>")
|
||||
spawn(rand(10,30))
|
||||
var/turf/userturf = get_turf(user)
|
||||
if(src.loc == user && userturf.z != ZLEVEL_CENTCOM) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
|
||||
visible_message("<span class='notice'>The [src] twists and bends, relocating itself!</span>")
|
||||
throwSmoke(userturf)
|
||||
do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg')
|
||||
throwSmoke(get_turf(user))
|
||||
warn_admins(user, "Teleport", 0)
|
||||
addtimer(CALLBACK(src, .proc/do_teleport, user), rand(10, 30))
|
||||
|
||||
/obj/item/weapon/relic/proc/do_teleport(mob/user)
|
||||
var/turf/userturf = get_turf(user)
|
||||
if(loc == user && userturf.z != ZLEVEL_CENTCOM) //Because Nuke Ops bringing this back on their shuttle, then looting the ERT area is 2fun4you!
|
||||
visible_message("<span class='notice'>The [src] twists and bends, relocating itself!</span>")
|
||||
throwSmoke(userturf)
|
||||
do_teleport(user, userturf, 8, asoundin = 'sound/effects/phasein.ogg')
|
||||
throwSmoke(get_turf(user))
|
||||
warn_admins(user, "Teleport", 0)
|
||||
|
||||
//Admin Warning proc for relics
|
||||
/obj/item/weapon/relic/proc/warn_admins(mob/user, RelicType, priority = 1)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
//NEEDS MAJOR CODE CLEANUP
|
||||
|
||||
/obj/effect/proc_holder/spell/dumbfire
|
||||
|
||||
var/projectile_type = ""
|
||||
@@ -33,58 +36,65 @@
|
||||
/obj/effect/proc_holder/spell/dumbfire/cast(list/targets, mob/user = usr)
|
||||
playMagSound()
|
||||
for(var/turf/target in targets)
|
||||
spawn(0)
|
||||
var/obj/effect/proc_holder/spell/targeted/projectile
|
||||
if(istext(proj_type))
|
||||
var/projectile_type = text2path(proj_type)
|
||||
projectile = new projectile_type(user)
|
||||
else if(istype(proj_type,/obj/effect/proc_holder/spell))
|
||||
projectile = new /obj/effect/proc_holder/spell/targeted/trigger(user)
|
||||
projectile:linked_spells += proj_type
|
||||
else
|
||||
projectile = new proj_type(user)
|
||||
projectile.icon = proj_icon
|
||||
projectile.icon_state = proj_icon_state
|
||||
projectile.setDir(get_dir(projectile, target))
|
||||
projectile.name = proj_name
|
||||
launch_at(target, user)
|
||||
|
||||
var/current_loc = user.loc
|
||||
/obj/effect/proc_holder/spell/dumbfire/proc/launch_at(turf/target, mob/user)
|
||||
set waitfor = FALSE
|
||||
var/obj/effect/proc_holder/spell/targeted/projectile
|
||||
if(istext(proj_type))
|
||||
var/projectile_type = text2path(proj_type)
|
||||
projectile = new projectile_type(user)
|
||||
else if(istype(proj_type,/obj/effect/proc_holder/spell))
|
||||
projectile = new /obj/effect/proc_holder/spell/targeted/trigger(user)
|
||||
var/obj/effect/proc_holder/spell/targeted/trigger/T = projectile
|
||||
T.linked_spells += proj_type
|
||||
else
|
||||
projectile = new proj_type(user)
|
||||
projectile.icon = proj_icon
|
||||
projectile.icon_state = proj_icon_state
|
||||
projectile.setDir(get_dir(projectile, target))
|
||||
projectile.name = proj_name
|
||||
|
||||
projectile.loc = current_loc
|
||||
var/current_loc = user.loc
|
||||
|
||||
for(var/i = 0,i < proj_lifespan,i++)
|
||||
if(!projectile)
|
||||
break
|
||||
projectile.loc = current_loc
|
||||
|
||||
if(proj_insubstantial)
|
||||
projectile.loc = get_step(projectile, projectile.dir)
|
||||
else
|
||||
step(projectile, projectile.dir)
|
||||
for(var/i = 0,i < proj_lifespan,i++)
|
||||
if(!projectile)
|
||||
break
|
||||
|
||||
if(projectile.loc == current_loc || i == proj_lifespan)
|
||||
projectile.cast(current_loc,user=user)
|
||||
break
|
||||
if(proj_insubstantial)
|
||||
projectile.loc = get_step(projectile, projectile.dir)
|
||||
else
|
||||
step(projectile, projectile.dir)
|
||||
|
||||
var/mob/living/L = locate(/mob/living) in range(projectile, proj_trigger_range) - user
|
||||
if(L && L.stat != DEAD)
|
||||
projectile.cast(L.loc,user=user)
|
||||
break
|
||||
if(projectile.loc == current_loc || i == proj_lifespan)
|
||||
projectile.cast(current_loc,user=user)
|
||||
break
|
||||
|
||||
if(proj_trail && projectile)
|
||||
spawn(0)
|
||||
if(projectile)
|
||||
var/obj/effect/overlay/trail = new /obj/effect/overlay(projectile.loc)
|
||||
trail.icon = proj_trail_icon
|
||||
trail.icon_state = proj_trail_icon_state
|
||||
trail.density = 0
|
||||
QDEL_IN(trail, proj_trail_lifespan)
|
||||
var/mob/living/L = locate(/mob/living) in range(projectile, proj_trigger_range) - user
|
||||
if(L && L.stat != DEAD)
|
||||
projectile.cast(L.loc,user=user)
|
||||
break
|
||||
|
||||
current_loc = projectile.loc
|
||||
var/matrix/M = new
|
||||
M.Turn(dir2angle(projectile.dir))
|
||||
projectile.transform = M
|
||||
if(proj_trail && projectile)
|
||||
proj_trail(projectile)
|
||||
|
||||
sleep(proj_step_delay)
|
||||
current_loc = projectile.loc
|
||||
var/matrix/M = new
|
||||
M.Turn(dir2angle(projectile.dir))
|
||||
projectile.transform = M
|
||||
|
||||
if(projectile)
|
||||
qdel(projectile)
|
||||
sleep(proj_step_delay)
|
||||
|
||||
if(projectile)
|
||||
qdel(projectile)
|
||||
|
||||
/obj/effect/proc_holder/spell/dumbfire/proc/proj_trail(obj/effect/proc_holder/spell/targeted/projectile)
|
||||
set waitfor = FALSE
|
||||
if(projectile)
|
||||
var/obj/effect/overlay/trail = new /obj/effect/overlay(projectile.loc)
|
||||
trail.icon = proj_trail_icon
|
||||
trail.icon_state = proj_trail_icon_state
|
||||
trail.density = FALSE
|
||||
QDEL_IN(trail, proj_trail_lifespan)
|
||||
|
||||
@@ -72,8 +72,9 @@
|
||||
name = "water"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "nothing"
|
||||
var/canmove = 1
|
||||
var/reappearing = 0
|
||||
var/movedelay = 0
|
||||
var/movespeed = 2
|
||||
density = 0
|
||||
anchored = 1
|
||||
invisibility = 60
|
||||
@@ -86,15 +87,14 @@
|
||||
return ..()
|
||||
|
||||
/obj/effect/dummy/spell_jaunt/relaymove(var/mob/user, direction)
|
||||
if (!src.canmove || reappearing || !direction) return
|
||||
if ((movedelay > world.time) || reappearing || !direction) return
|
||||
var/turf/newLoc = get_step(src,direction)
|
||||
setDir(direction)
|
||||
if(!(newLoc.flags & NOJAUNT))
|
||||
loc = newLoc
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Some strange aura is blocking the way!</span>")
|
||||
src.canmove = 0
|
||||
spawn(2) src.canmove = 1
|
||||
movedelay = world.time + movespeed
|
||||
|
||||
/obj/effect/dummy/spell_jaunt/ex_act(blah)
|
||||
return
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
for(var/A in mutations)
|
||||
target.dna.add_mutation(A)
|
||||
target.disabilities |= disabilities
|
||||
spawn(duration)
|
||||
if(target && !QDELETED(target))
|
||||
for(var/A in mutations)
|
||||
target.dna.remove_mutation(A)
|
||||
target.disabilities &= ~disabilities
|
||||
addtimer(CALLBACK(src, .proc/remove, target), duration)
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/genetic/proc/remove(mob/living/carbon/target)
|
||||
if(!QDELETED(target))
|
||||
for(var/A in mutations)
|
||||
target.dna.remove_mutation(A)
|
||||
target.disabilities &= ~disabilities
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
//NEEDS MAJOR CODE CLEANUP.
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/projectile
|
||||
name = "Projectile"
|
||||
desc = "This spell summons projectiles which try to hit the targets."
|
||||
@@ -25,62 +28,69 @@
|
||||
/obj/effect/proc_holder/spell/targeted/projectile/cast(list/targets, mob/user = usr)
|
||||
playMagSound()
|
||||
for(var/mob/living/target in targets)
|
||||
spawn(0)
|
||||
var/obj/effect/proc_holder/spell/targeted/projectile
|
||||
if(istext(proj_type))
|
||||
var/projectile_type = text2path(proj_type)
|
||||
projectile = new projectile_type(user)
|
||||
if(istype(proj_type,/obj/effect/proc_holder/spell))
|
||||
projectile = new /obj/effect/proc_holder/spell/targeted/trigger(user)
|
||||
projectile:linked_spells += proj_type
|
||||
projectile.icon = proj_icon
|
||||
projectile.icon_state = proj_icon_state
|
||||
projectile.setDir(get_dir(target,projectile))
|
||||
projectile.name = proj_name
|
||||
launch(target, user)
|
||||
|
||||
var/current_loc = user.loc
|
||||
/obj/effect/proc_holder/spell/targeted/projectile/proc/launch(mob/living/target, mob/user)
|
||||
set waitfor = FALSE
|
||||
var/obj/effect/proc_holder/spell/targeted/projectile
|
||||
if(istext(proj_type))
|
||||
var/projectile_type = text2path(proj_type)
|
||||
projectile = new projectile_type(user)
|
||||
if(istype(proj_type,/obj/effect/proc_holder/spell))
|
||||
projectile = new /obj/effect/proc_holder/spell/targeted/trigger(user)
|
||||
var/obj/effect/proc_holder/spell/targeted/trigger/T = projectile
|
||||
T.linked_spells += proj_type
|
||||
projectile.icon = proj_icon
|
||||
projectile.icon_state = proj_icon_state
|
||||
projectile.setDir(get_dir(target,projectile))
|
||||
projectile.name = proj_name
|
||||
|
||||
projectile.loc = current_loc
|
||||
var/current_loc = user.loc
|
||||
|
||||
for(var/i = 0,i < proj_lifespan,i++)
|
||||
if(!projectile)
|
||||
break
|
||||
projectile.loc = current_loc
|
||||
|
||||
if(proj_homing)
|
||||
if(proj_insubstantial)
|
||||
projectile.setDir(get_dir(projectile,target))
|
||||
projectile.loc = get_step_to(projectile,target)
|
||||
else
|
||||
step_to(projectile,target)
|
||||
else
|
||||
if(proj_insubstantial)
|
||||
projectile.loc = get_step(projectile,dir)
|
||||
else
|
||||
step(projectile,dir)
|
||||
for(var/i = 0,i < proj_lifespan,i++)
|
||||
if(!projectile)
|
||||
break
|
||||
|
||||
if(!projectile) // step and step_to sleeps so we'll have to check again.
|
||||
break
|
||||
if(proj_homing)
|
||||
if(proj_insubstantial)
|
||||
projectile.setDir(get_dir(projectile,target))
|
||||
projectile.loc = get_step_to(projectile,target)
|
||||
else
|
||||
step_to(projectile,target)
|
||||
else
|
||||
if(proj_insubstantial)
|
||||
projectile.loc = get_step(projectile,dir)
|
||||
else
|
||||
step(projectile,dir)
|
||||
|
||||
if(!target || (!proj_lingering && projectile.loc == current_loc)) //if it didn't move since last time
|
||||
qdel(projectile)
|
||||
break
|
||||
if(!projectile) // step and step_to sleeps so we'll have to check again.
|
||||
break
|
||||
|
||||
if(proj_trail && projectile)
|
||||
spawn(0)
|
||||
if(projectile)
|
||||
var/obj/effect/overlay/trail = new /obj/effect/overlay(projectile.loc)
|
||||
trail.icon = proj_trail_icon
|
||||
trail.icon_state = proj_trail_icon_state
|
||||
trail.density = 0
|
||||
QDEL_IN(trail, proj_trail_lifespan)
|
||||
if(!target || (!proj_lingering && projectile.loc == current_loc)) //if it didn't move since last time
|
||||
qdel(projectile)
|
||||
break
|
||||
|
||||
if(projectile.loc in range(target.loc,proj_trigger_range))
|
||||
projectile.perform(list(target),user=user)
|
||||
break
|
||||
if(proj_trail && projectile)
|
||||
spawntrail(projectile)
|
||||
|
||||
current_loc = projectile.loc
|
||||
if(projectile.loc in range(target.loc,proj_trigger_range))
|
||||
projectile.perform(list(target),user=user)
|
||||
break
|
||||
|
||||
sleep(proj_step_delay)
|
||||
current_loc = projectile.loc
|
||||
|
||||
if(projectile)
|
||||
qdel(projectile)
|
||||
sleep(proj_step_delay)
|
||||
|
||||
if(projectile)
|
||||
qdel(projectile)
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/projectile/proc/spawntrail(obj/effect/proc_holder/spell/targeted/projectile)
|
||||
set waitfor = FALSE
|
||||
if(projectile)
|
||||
var/obj/effect/overlay/trail = new /obj/effect/overlay(projectile.loc)
|
||||
trail.icon = proj_trail_icon
|
||||
trail.icon_state = proj_trail_icon_state
|
||||
trail.density = FALSE
|
||||
QDEL_IN(trail, proj_trail_lifespan)
|
||||
|
||||
@@ -81,15 +81,16 @@ Notes:
|
||||
|
||||
/datum/tooltip/proc/hide()
|
||||
if (src.queueHide)
|
||||
spawn(1)
|
||||
winshow(src.owner, src.control, 0)
|
||||
addtimer(CALLBACK(src, .proc/do_hide), 1)
|
||||
else
|
||||
winshow(src.owner, src.control, 0)
|
||||
do_hide()
|
||||
|
||||
src.queueHide = src.showing ? 1 : 0
|
||||
queueHide = showing ? TRUE : FALSE
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/tooltip/proc/do_hide()
|
||||
winshow(owner, control, FALSE)
|
||||
|
||||
/* TG SPECIFIC CODE */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user