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