finish making smoke OOP, compiles

This commit is contained in:
uraniummeltdown
2017-11-03 22:46:49 +04:00
parent 4d0ea7b630
commit a0939ca93b
30 changed files with 53 additions and 54 deletions

View File

@@ -89,7 +89,7 @@
/obj/machinery/atmospherics/pipe/simple/proc/burst()
src.visible_message("<span class='danger'>\The [src] bursts!</span>");
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
var/datum/effect/system/harmless_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, src.loc, 0)
smoke.start()
qdel(src)

View File

@@ -263,15 +263,15 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
sparks.start()
if(smoke_spread)
if(smoke_spread == 1)
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
smoke.start()
else if(smoke_spread == 2)
var/datum/effect/system/bad_smoke_spread/smoke = new /datum/effect/system/bad_smoke_spread()
var/datum/effect/system/smoke_spread/bad/smoke = new
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
smoke.start()
else if(smoke_spread == 3)
var/datum/effect/system/sleep_smoke_spread/smoke = new /datum/effect/system/sleep_smoke_spread()
var/datum/effect/system/smoke_spread/sleeping/smoke = new
smoke.set_up(smoke_amt, 0, location) // same here
smoke.start()

View File

@@ -14,7 +14,7 @@
/obj/effect/proc_holder/spell/targeted/rathens/cast(list/targets, mob/user = usr)
playsound(get_turf(user), 'sound/goonstation/effects/superfart.ogg', 25, 1)
for(var/mob/living/carbon/human/H in targets)
var/datum/effect/system/harmless_smoke_spread/s = new /datum/effect/system/harmless_smoke_spread
var/datum/effect/system/smoke_spread/s = new
s.set_up(5, 0, H)
s.start()
var/obj/item/organ/internal/appendix/A = H.get_int_organ(/obj/item/organ/internal/appendix)

View File

@@ -97,7 +97,7 @@
/mob/living/simple_animal/hostile/blob/blobspore/death(gibbed)
..()
// On death, create a small smoke of harmful gas (s-Acid)
var/datum/effect/system/chem_smoke_spread/S = new
var/datum/effect/system/smoke_spread/chem/S = new
var/turf/location = get_turf(src)
// Create the reagents to put into the air

View File

@@ -473,7 +473,7 @@
B.reagents.clear_reagents() //Just in case!
B.icon_state = null //Invisible
B.reagents.add_reagent("blindness_smoke", 10)
var/datum/effect/system/chem_smoke_spread/S = new /datum/effect/system/chem_smoke_spread
var/datum/effect/system/smoke_spread/chem/S = new
S.attach(B)
if(S)
S.set_up(B.reagents, 10, 0, B.loc)

View File

@@ -53,7 +53,7 @@
var/list/candidates = pollCandidates("Do you want to play as the wizard apprentice of [H.real_name]?", ROLE_WIZARD, 1)
if(candidates.len)
var/mob/C = pick(candidates)
new /obj/effect/effect/harmless_smoke(H.loc)
new /obj/effect/effect/smoke(H.loc)
var/mob/living/carbon/human/M = new/mob/living/carbon/human(H.loc)
M.key = C.key
to_chat(M, "<B>You are the [H.real_name]'s apprentice! You are bound by magic contract to follow their orders and help them in accomplishing their goals.")

View File

@@ -107,7 +107,7 @@
to_chat(user, "<span class='warning'>The spell has no effect on [target].</span>")
return
var/datum/effect/system/harmless_smoke_spread/s = new /datum/effect/system/harmless_smoke_spread
var/datum/effect/system/smoke_spread/s = new
s.set_up(5, 0, target)
s.start()

View File

@@ -15,7 +15,7 @@
var/smoke = 5
var/smoke_ready = 1
var/smoke_cooldown = 100
var/datum/effect/system/harmless_smoke_spread/smoke_system = new
var/datum/effect/system/smoke_spread/smoke_system = new
operation_req_access = list(access_cent_specops)
wreckage = /obj/effect/decal/mecha_wreckage/marauder
add_req_access = 0

View File

@@ -33,7 +33,7 @@
/obj/effect/anomaly/proc/anomalyNeutralize()
var/turf/T = get_turf(src)
new /obj/effect/effect/bad_smoke(T)
new /obj/effect/effect/smoke/bad(T)
if(aSignal)
aSignal.forceMove(T)

View File

@@ -15,7 +15,7 @@
mouse_opacity = 0
var/time_to_live = 100
/datum/effect/effect/smoke/proc/fade_out(frames = 16)
/obj/effect/effect/smoke/proc/fade_out(frames = 16)
if(alpha == 0) //Handle already transparent case
return
if(frames == 0)
@@ -68,7 +68,7 @@
spawn(0)
if(holder)
location = get_turf(holder)
var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(location)
var/obj/effect/effect/smoke/S = new smoke_type(location)
total_smoke++
var/direction = src.direction
if(!direction)
@@ -78,13 +78,13 @@
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(smoke.time_to_live*0.75+rand(10,30))
if(smoke)
step(S,direction)
spawn(S.time_to_live*0.75+rand(10,30))
if(S)
spawn(0)
smoke.fade_out()
S.fade_out()
spawn(10)
smoke.delete()
S.delete()
total_smoke--
/////////////////////////////////////////////
@@ -92,7 +92,7 @@
/////////////////////////////////////////////
/obj/effect/effect/smoke/bad
time_to_live = 200+rand(10,30)
time_to_live = 200
/obj/effect/effect/smoke/bad/Move()
..()
@@ -107,7 +107,7 @@
B.damage = (B.damage/2)
return 1
/obj/effect/effect/smoke/bad/smoke_mob(mob/living/carbon/C)
/obj/effect/effect/smoke/bad/smoke_mob(mob/living/carbon/M)
if(..())
M.drop_item()
M.adjustOxyLoss(1)
@@ -162,7 +162,7 @@
/datum/effect/system/smoke_spread/freezing/start()
if(blast)
for(var/turf/T in trange(2, location))
for(var/turf/T in RANGE_TURFS(2, location))
Chilled(T)
..()
@@ -172,13 +172,14 @@
/obj/effect/effect/smoke/sleeping
color = "#9C3636"
time_to_live = 200
/obj/effect/effect/smoke/sleeping/Move()
..()
for(var/mob/living/carbon/M in get_turf(src))
smoke_mob(M)
/obj/effect/effect/smoke/sleeping/smoke_mob()
/obj/effect/effect/smoke/sleeping/smoke_mob(mob/living/carbon/M)
if(..())
M.drop_item()
M.AdjustSleeping(5)
@@ -199,12 +200,10 @@
/obj/effect/effect/smoke/chem
icon = 'icons/effects/chemsmoke.dmi'
opacity = 0
time_to_live = 200+rand(10,30)
time_to_live = 200
/datum/effect/system/smoke_spread/chem
smoke_type = /obj/effect/effect/smoke/chem
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
var/obj/chemholder
/datum/effect/system/smoke_spread/chem/New()

View File

@@ -63,6 +63,6 @@
/datum/effect/system/explosion/smoke/start()
..()
spawn(5)
var/datum/effect/system/harmless_smoke_spread/S = new/datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/S = new
S.set_up(5,0,location,null)
S.start()

View File

@@ -40,7 +40,7 @@
to_chat(user, "<span class='notice'>\The [src] is full.</span>")
return
reagents.remove_reagent(25,"water")
var/datum/effect/system/bad_smoke_spread/smoke = new /datum/effect/system/bad_smoke_spread()
var/datum/effect/system/smoke_spread/bad/smoke = new
smoke.set_up(5, 0, user.loc)
smoke.start()
playsound(user.loc, 'sound/effects/bamf.ogg', 50, 2)

View File

@@ -6,11 +6,11 @@
det_time = 20
item_state = "flashbang"
slot_flags = SLOT_BELT
var/datum/effect/system/bad_smoke_spread/smoke
var/datum/effect/system/smoke_spread/bad/smoke
New()
..()
src.smoke = new /datum/effect/system/bad_smoke_spread
src.smoke = new /datum/effect/system/smoke_spread/bad
src.smoke.attach(src)
Destroy()

View File

@@ -59,7 +59,7 @@
to_chat(user, "A mysterious force disrupts your arcane spell matrix, and you remain where you are.")
return
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(5, 0, user.loc)
smoke.attach(user)
smoke.start()

View File

@@ -31,11 +31,11 @@
s.start()
if(entersmoke)
var/datum/effect/system/harmless_smoke_spread/s = new /datum/effect/system/harmless_smoke_spread
var/datum/effect/system/smoke_spread/s = new
s.set_up(4, 1, src, 0)
s.start()
if(exitsmoke)
var/datum/effect/system/harmless_smoke_spread/s = new /datum/effect/system/harmless_smoke_spread
var/datum/effect/system/smoke_spread/s = new
s.set_up(4, 1, dest, 0)
s.start()

View File

@@ -28,7 +28,7 @@
R.my_atom = vent
R.add_reagent(pick(gunk), 50)
var/datum/effect/system/chem_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/chem/smoke = new
smoke.set_up(R, rand(1, 2), 0, vent, 0, silent = 1)
playsound(vent.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.start(3)

View File

@@ -66,7 +66,7 @@
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/burnt = new(get_turf(src))
setRegents(props, burnt)
to_chat(user, "<span class='warning'>You smell burning coming from the [src]!</span>")
var/datum/effect/system/bad_smoke_spread/smoke = new /datum/effect/system/bad_smoke_spread() // burning things makes smoke!
var/datum/effect/system/smoke_spread/bad/smoke = new // burning things makes smoke!
smoke.set_up(5, 0, src)
smoke.start()
if(prob(firechance))

View File

@@ -402,7 +402,7 @@
name = "gaseous decomposition"
/datum/plant_gene/trait/smoke/on_squash(obj/item/weapon/reagent_containers/food/snacks/grown/G, atom/target)
var/datum/effect/system/chem_smoke_spread/S = new
var/datum/effect/system/smoke_spread/chem/S = new
var/splat_location = get_turf(target)
var/smoke_amount = round(sqrt(G.seed.potency * 0.1), 1)
S.attach(splat_location)

View File

@@ -47,7 +47,7 @@
D.visible_message("<span class='danger'>[A] throws an invisible smoke bomb!!</span>")
var/datum/effect/system/bad_smoke_spread/smoke = new /datum/effect/system/bad_smoke_spread()
var/datum/effect/system/smoke_spread/bad/smoke = new
smoke.set_up(5, 0, D.loc)
smoke.start()

View File

@@ -259,14 +259,14 @@
to_chat(user, "[src] fizzles uselessly.")
return
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(1, 0, user.loc)
smoke.start()
user.forceMove(get_turf(linked))
feedback_add_details("warp_cube","[src.type]")
var/datum/effect/system/harmless_smoke_spread/smoke2 = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke2 = new
smoke2.set_up(1, 0, user.loc)
smoke2.start()

View File

@@ -329,7 +329,7 @@
message_admins("[key_name_admin(usr)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[usr]'>FLW</A>) activated a bluespace capsule away from the mining level! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</a>)")
log_admin("[key_name(usr)] activated a bluespace capsule away from the mining level at [T.x], [T.y], [T.z]")
template.load(deploy_location, centered = TRUE)
new /obj/effect/effect/harmless_smoke(get_turf(src))
new /obj/effect/effect/smoke(get_turf(src))
qdel(src)
/obj/item/weapon/survivalcapsule/luxury

View File

@@ -75,7 +75,7 @@
/mob/living/simple_animal/hostile/hivebot/tele/New()
..()
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(5, 0, src.loc)
smoke.start()
visible_message("<span class='danger'>The [src] warps in!</span>")

View File

@@ -1056,7 +1056,7 @@
cell.corrupt()
src.malfhack = 1
update_icon()
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()

View File

@@ -41,7 +41,7 @@
/obj/singularity/narsie/large/attack_ghost(mob/dead/observer/user as mob)
makeNewConstruct(/mob/living/simple_animal/hostile/construct/harvester, user, null, 1)
new /obj/effect/effect/sleep_smoke(user.loc)
new /obj/effect/effect/smoke/sleeping(user.loc)
/obj/singularity/narsie/process()

View File

@@ -440,7 +440,7 @@
for(var/mob/M in viewers(src))
M.show_message("<span class='warning'>The [src.name] is making strange noises!</span>", 3, "<span class='warning'>You hear sizzling electronics.</span>", 2)
sleep(10*pick(4,5,6,7,10,14))
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()
@@ -456,7 +456,7 @@
else
emp_act(2)
if(prob(5)) //smoke only
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()

View File

@@ -122,7 +122,7 @@
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user)
do_teleport(user, user, 10)
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(10, 0, user.loc)
smoke.start()
charges--

View File

@@ -100,7 +100,7 @@
if(!stuff.anchored && stuff.loc)
teleammount++
do_teleport(stuff, stuff, 10)
var/datum/effect/system/harmless_smoke_spread/smoke = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(max(round(10 - teleammount),1), 0, stuff.loc) //Smoke drops off if a lot of stuff is moved for the sake of sanity
smoke.start()

View File

@@ -211,7 +211,7 @@ datum/chemical_reaction/flash_powder
if(holder.has_reagent(f_reagent))
holder.remove_reagent(f_reagent, holder.get_reagent_amount(f_reagent))
var/location = get_turf(holder.my_atom)
var/datum/effect/system/chem_smoke_spread/S = new /datum/effect/system/chem_smoke_spread
var/datum/effect/system/smoke_spread/chem/S = new
S.attach(location)
playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3)
spawn(0)

View File

@@ -226,7 +226,7 @@
loaded_item = null
/obj/machinery/r_n_d/experimentor/proc/throwSmoke(turf/where)
var/datum/effect/system/harmless_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, where, 0)
smoke.start()
@@ -318,7 +318,7 @@
R.my_atom = src
R.add_reagent(chosenchem , 15)
investigate_log("Experimentor has released [chosenchem] smoke.", "experimentor")
var/datum/effect/system/chem_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/chem/smoke = new
smoke.set_up(R, 1, 0, src, 0, silent = 1)
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.start()
@@ -330,7 +330,7 @@
var/datum/reagents/R = new/datum/reagents(15)
R.my_atom = src
R.add_reagent(chosenchem , 15)
var/datum/effect/system/chem_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/chem/smoke = new
smoke.set_up(R, 1, 0, src, 0, silent = 1)
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.start()
@@ -417,7 +417,7 @@
R.my_atom = src
R.add_reagent("frostoil" , 15)
investigate_log("Experimentor has released frostoil gas.", "experimentor")
var/datum/effect/system/chem_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/chem/smoke = new
smoke.set_up(R, 1, 0, src, 0, silent = 1)
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.start()
@@ -439,7 +439,7 @@
ejectItem(TRUE)
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/harmless_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, src.loc, 0)
smoke.start()
ejectItem()
@@ -648,7 +648,7 @@
//////////////// RELIC PROCS /////////////////////////////
/obj/item/weapon/relic/proc/throwSmoke(turf/where)
var/datum/effect/system/harmless_smoke_spread/smoke = new
var/datum/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, where, 0)
smoke.start()

View File

@@ -397,7 +397,7 @@
if(notice)
return null
//Totally nanite construction system not an immersion breaking spawning
var/datum/effect/system/harmless_smoke_spread/s = new /datum/effect/system/harmless_smoke_spread()
var/datum/effect/system/smoke_spread/s = new
s.set_up(4, 0, get_turf(centerpiece))
s.start()
var/obj/machinery/bsa/full/cannon = new(get_turf(centerpiece),centerpiece.get_cannon_direction())