Merge with dev.

This commit is contained in:
Zuhayr
2015-05-15 23:22:48 +09:30
86 changed files with 3562 additions and 5272 deletions
@@ -5,13 +5,11 @@
icon = 'icons/effects/chemsmoke.dmi'
opacity = 0
time_to_live = 300
pass_flags = PASSTABLE | PASSGRILLE | PASSGLASS //PASSGLASS is fine here, it's just so the visual effect can "flow" around glass
pass_flags = PASSTABLE | PASSGRILLE | PASSGLASS //PASSGLASS is fine here, it's just so the visual effect can "flow" around glass
/obj/effect/effect/smoke/chem/New()
..()
var/datum/reagents/R = new/datum/reagents(500)
reagents = R
R.my_atom = src
create_reagents(500)
return
/datum/effect/effect/system/smoke_spread/chem
@@ -37,21 +35,16 @@
/datum/effect/effect/system/smoke_spread/chem/New()
..()
chemholder = new/obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
chemholder.create_reagents(500)
//------------------------------------------
//Sets up the chem smoke effect
//
// Calculates the max range smoke can travel, then gets all turfs in that view range.
// Culls the selected turfs to a (roughly) circle shape, then calls smokeFlow() to make
// sure the smoke can actually path to the turfs. This culls any turfs it can't reach.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/set_up(var/datum/reagents/carry = null, n = 10, c = 0, loca, direct)
range = n * 0.3
cardinals = c
carry.copy_to(chemholder, carry.total_volume)
carry.trans_to_obj(chemholder, carry.total_volume, copy = 1)
if(istype(loca, /turf/))
location = loca
@@ -62,28 +55,19 @@
targetTurfs = new()
//build affected area list
for(var/turf/T in view(range, location))
//cull turfs to circle
if(cheap_pythag(T.x - location.x, T.y - location.y) <= range)
for(var/turf/T in view(range, location)) //build affected area list
if(cheap_pythag(T.x - location.x, T.y - location.y) <= range) //cull turfs to circle
targetTurfs += T
//make secondary list for reagents that affect walls
if(chemholder.reagents.has_reagent("thermite") || chemholder.reagents.has_reagent("plantbgone"))
wallList = new()
wallList = new()
//pathing check
smokeFlow(location, targetTurfs, wallList)
smokeFlow() //pathing check
//set the density of the cloud - for diluting reagents
density = max(1, targetTurfs.len / 4) //clamp the cloud density minimum to 1 so it cant multiply the reagents
density = max(1, targetTurfs.len / 4) //clamp the cloud density minimum to 1 so it cant multiply the reagents
//Admin messaging
var/contained = ""
for(var/reagent in carry.reagent_list)
contained += " [reagent] "
if(contained)
contained = "\[[contained]\]"
var/contained = carry.get_reagents()
var/area/A = get_area(location)
var/where = "[A.name] | [location.x], [location.y]"
@@ -101,61 +85,27 @@
message_admins("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")
//------------------------------------------
//Runs the chem smoke effect
//
// Spawns damage over time loop for each reagent held in the cloud.
// Applies reagents to walls that affect walls (only thermite and plant-b-gone at the moment).
// Also calculates target locations to spawn the visual smoke effect on, so the whole area
// is covered fairly evenly.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/start()
if(!location) //kill grenade if it somehow ends up in nullspace
if(!location)
return
//reagent application - only run if there are extra reagents in the smoke
if(chemholder.reagents.reagent_list.len)
for(var/datum/reagent/R in chemholder.reagents.reagent_list)
var/proba = 100
var/runs = 5
if(chemholder.reagents.reagent_list.len) //reagent application - only run if there are extra reagents in the smoke
for(var/turf/T in wallList)
chemholder.reagents.touch_turf(T)
for(var/turf/T in targetTurfs)
chemholder.reagents.touch_turf(T)
for(var/atom/A in T.contents)
if(istype(A, /obj/effect/effect/smoke/chem) || istype(A, /mob))
continue
else if(isobj(A) && !A.simulated)
chemholder.reagents.touch_obj(A)
//dilute the reagents according to cloud density
R.volume /= density
chemholder.reagents.update_total()
//apply wall affecting reagents to walls
if(R.id in list("thermite", "plantbgone"))
for(var/turf/T in wallList)
R.reaction_turf(T, R.volume)
//reagents that should be applied to turfs in a random pattern
if(R.id == "carbon")
proba = 75
else if(R.id in list("blood", "radium", "uranium"))
proba = 25
spawn(0)
for(var/i = 0, i < runs, i++)
for(var/turf/T in targetTurfs)
if(prob(proba))
R.reaction_turf(T, R.volume)
for(var/atom/A in T.contents)
if(istype(A, /obj/effect/effect/smoke/chem)) //skip the item if it is chem smoke
continue
else if(istype(A, /mob))
var/dist = cheap_pythag(T.x - location.x, T.y - location.y)
if(!dist)
dist = 1
R.reaction_mob(A, volume = R.volume / dist)
else if(istype(A, /obj) && !A.simulated)
R.reaction_obj(A, R.volume)
sleep(30)
//build smoke icon
var/color = chemholder.reagents.get_color()
var/color = chemholder.reagents.get_color() //build smoke icon
var/icon/I
if(color)
I = icon('icons/effects/chemsmoke.dmi')
@@ -163,13 +113,9 @@
else
I = icon('icons/effects/96x96.dmi', "smoke")
var/const/arcLength = 2.3559 //distance between each smoke cloud
//distance between each smoke cloud
var/const/arcLength = 2.3559
//calculate positions for smoke coverage - then spawn smoke
for(var/i = 0, i < range, i++)
for(var/i = 0, i < range, i++) //calculate positions for smoke coverage - then spawn smoke
var/radius = i * 1.5
if(!radius)
spawn(0)
@@ -207,12 +153,12 @@
smoke = PoolOrNew(/obj/effect/effect/smoke/chem, location)
if(chemholder.reagents.reagent_list.len)
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / dist, safety = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
chemholder.reagents.trans_to_obj(smoke, chemholder.reagents.total_volume / dist, copy = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
smoke.icon = I
smoke.layer = 6
smoke.set_dir(pick(cardinal))
smoke.pixel_x = -32 + rand(-8,8)
smoke.pixel_y = -32 + rand(-8,8)
smoke.pixel_x = -32 + rand(-8, 8)
smoke.pixel_y = -32 + rand(-8, 8)
walk_to(smoke, T)
smoke.opacity = 1 //switching opacity on after the smoke has spawned, and then
sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner
@@ -225,10 +171,7 @@
spores.name = "cloud of [seed.seed_name] [seed.seed_noun]"
..(T, I, dist, spores)
//------------------------------------------
// Fades out the smoke smoothly using it's alpha variable.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/fadeOut(var/atom/A, var/frames = 16)
/datum/effect/effect/system/smoke_spread/chem/proc/fadeOut(var/atom/A, var/frames = 16) // Fades out the smoke smoothly using it's alpha variable.
if(A.alpha == 0) //Handle already transparent case
return
if(frames == 0)
@@ -239,11 +182,8 @@
sleep(world.tick_lag)
return
//------------------------------------------
// Smoke pathfinder. Uses a flood fill method based on zones to
// quickly check what turfs the smoke (airflow) can actually reach.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/smokeFlow()
/datum/effect/effect/system/smoke_spread/chem/proc/smokeFlow() // Smoke pathfinder. Uses a flood fill method based on zones to quickly check what turfs the smoke (airflow) can actually reach.
var/list/pending = new()
var/list/complete = new()
+184
View File
@@ -0,0 +1,184 @@
// Foam
// Similar to smoke, but spreads out more
// metal foams leave behind a foamed metal wall
/obj/effect/effect/foam
name = "foam"
icon_state = "foam"
opacity = 0
anchored = 1
density = 0
layer = OBJ_LAYER + 0.9
mouse_opacity = 0
animate_movement = 0
var/amount = 3
var/expand = 1
var/metal = 0
/obj/effect/effect/foam/New(var/loc, var/ismetal = 0)
..(loc)
icon_state = "[ismetal? "m" : ""]foam"
metal = ismetal
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
spawn(3 + metal * 3)
process()
checkReagents()
spawn(120)
processing_objects.Remove(src)
sleep(30)
if(metal)
var/obj/structure/foamedmetal/M = new(src.loc)
M.metal = metal
M.updateicon()
flick("[icon_state]-disolve", src)
sleep(5)
qdel(src)
return
/obj/effect/effect/foam/proc/checkReagents() // transfer any reagents to the floor
if(!metal && reagents)
var/turf/T = get_turf(src)
reagents.touch_turf(T)
/obj/effect/effect/foam/process()
if(--amount < 0)
return
for(var/direction in cardinal)
var/turf/T = get_step(src, direction)
if(!T)
continue
if(!T.Enter(src))
continue
var/obj/effect/effect/foam/F = locate() in T
if(F)
continue
F = new(T, metal)
F.amount = amount
if(!metal)
F.create_reagents(10)
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
F.reagents.add_reagent(R.id, 1, safety = 1) //added safety check since reagents in the foam have already had a chance to react
/obj/effect/effect/foam/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) // foam disolves when heated, except metal foams
if(!metal && prob(max(0, exposed_temperature - 475)))
flick("[icon_state]-disolve", src)
spawn(5)
qdel(src)
/obj/effect/effect/foam/Crossed(var/atom/movable/AM)
if(metal)
return
if(istype(AM, /mob/living))
var/mob/living/M = AM
M.slip("the foam", 6)
/datum/effect/effect/system/foam_spread
var/amount = 5 // the size of the foam spread.
var/list/carried_reagents // the IDs of reagents present when the foam was mixed
var/metal = 0 // 0 = foam, 1 = metalfoam, 2 = ironfoam
/datum/effect/effect/system/foam_spread/set_up(amt=5, loca, var/datum/reagents/carry = null, var/metalfoam = 0)
amount = round(sqrt(amt / 3), 1)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
carried_reagents = list()
metal = metalfoam
// bit of a hack here. Foam carries along any reagent also present in the glass it is mixed with (defaults to water if none is present). Rather than actually transfer the reagents, this makes a list of the reagent ids and spawns 1 unit of that reagent when the foam disolves.
if(carry && !metal)
for(var/datum/reagent/R in carry.reagent_list)
carried_reagents += R.id
/datum/effect/effect/system/foam_spread/start()
spawn(0)
var/obj/effect/effect/foam/F = locate() in location
if(F)
F.amount += amount
return
F = PoolOrNew(/obj/effect/effect/foam, list(location, metal))
F.amount = amount
if(!metal) // don't carry other chemicals if a metal foam
F.create_reagents(10)
if(carried_reagents)
for(var/id in carried_reagents)
F.reagents.add_reagent(id, 1, safety = 1) //makes a safety call because all reagents should have already reacted anyway
else
F.reagents.add_reagent("water", 1, safety = 1)
// wall formed by metal foams, dense and opaque, but easy to break
/obj/structure/foamedmetal
icon = 'icons/effects/effects.dmi'
icon_state = "metalfoam"
density = 1
opacity = 1 // changed in New()
anchored = 1
name = "foamed metal"
desc = "A lightweight foamed metal wall."
var/metal = 1 // 1 = aluminum, 2 = iron
/obj/structure/foamedmetal/New()
..()
update_nearby_tiles(1)
/obj/structure/foamedmetal/Destroy()
density = 0
update_nearby_tiles(1)
..()
/obj/structure/foamedmetal/proc/updateicon()
if(metal == 1)
icon_state = "metalfoam"
else
icon_state = "ironfoam"
/obj/structure/foamedmetal/ex_act(severity)
qdel(src)
/obj/structure/foamedmetal/blob_act()
qdel(src)
/obj/structure/foamedmetal/bullet_act()
if(metal == 1 || prob(50))
qdel(src)
/obj/structure/foamedmetal/attack_hand(var/mob/user)
if ((HULK in user.mutations) || (prob(75 - metal * 25)))
user.visible_message("<span class='warning'>[user] smashes through the foamed metal.</span>", "<span class='notice'>You smash through the metal foam wall.</span>")
qdel(src)
else
user << "<span class='notice'>You hit the metal foam but bounce off it.</span>"
return
/obj/structure/foamedmetal/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = I
G.affecting.loc = src.loc
visible_message("<span class='warning'>[G.assailant] smashes [G.affecting] through the foamed metal wall.</span>")
qdel(I)
qdel(src)
return
if(prob(I.force * 20 - metal * 25))
user.visible_message("<span class='warning'>[user] smashes through the foamed metal.</span>", "<span class='notice'>You smash through the foamed metal with \the [I].</span>")
qdel(src)
else
user << "<span class='notice'>You hit the metal foam to no effect.</span>"
/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
if(air_group)
return 0
return !density
+50
View File
@@ -0,0 +1,50 @@
/obj/effect/effect/water
name = "water"
icon = 'icons/effects/effects.dmi'
icon_state = "extinguish"
mouse_opacity = 0
/obj/effect/effect/water/New(loc)
..()
spawn(150) // In case whatever made it forgets to delete it
if(src)
qdel(src)
/obj/effect/effect/water/proc/set_color() // Call it after you move reagents to it
icon += reagents.get_color()
/obj/effect/effect/water/proc/set_up(var/turf/target, var/step_count = 5, var/delay = 5)
if(!target)
return
for(var/i = 1 to step_count)
step_towards(src, target)
var/turf/T = get_turf(src)
reagents.touch_turf(T)
var/mob/M = locate() in T
if(M)
reagents.splash_mob(M, reagents.total_volume)
break
for(var/atom/A in T)
reagents.touch(A)
if(T == get_turf(target))
break
sleep(delay)
sleep(10)
qdel(src)
/obj/effect/effect/water/Move(turf/newloc)
if(newloc.density)
return 0
. = ..()
/obj/effect/effect/water/Bump(atom/A)
if(reagents)
reagents.touch(A)
return ..()
//Used by spraybottles.
/obj/effect/effect/water/chempuff
name = "chemicals"
icon = 'icons/obj/chempuff.dmi'
icon_state = ""
pass_flags = PASSTABLE | PASSGRILLE
+1 -7
View File
@@ -11,10 +11,4 @@
/obj/effect/decal/spraystill
density = 0
anchored = 1
layer = 50
//Used by spraybottles.
/obj/effect/decal/chempuff
name = "chemicals"
icon = 'icons/obj/chempuff.dmi'
pass_flags = PASSTABLE | PASSGRILLE
layer = 50
+3 -248
View File
@@ -13,35 +13,11 @@ would spawn and follow the beaker, even if it is carried or thrown.
unacidable = 1//So effect are not targeted by alien acid.
pass_flags = PASSTABLE | PASSGRILLE
/obj/effect/effect/water
name = "water"
icon = 'icons/effects/effects.dmi'
icon_state = "extinguish"
var/life = 15.0
mouse_opacity = 0
/obj/effect/Destroy()
/obj/effect/Destroy()
if(reagents)
reagents.delete()
return ..()
/obj/effect/effect/water/Move(turf/newloc)
//var/turf/T = src.loc
//if (istype(T, /turf))
// T.firelevel = 0 //TODO: FIX
if (--src.life < 1)
//SN src = null
qdel(src)
if(newloc.density)
return 0
.=..()
/obj/effect/effect/water/Bump(atom/A)
if(reagents)
reagents.reaction(A)
return ..()
/datum/effect/effect/system
var/number = 3
var/cardinals = 0
@@ -479,228 +455,7 @@ steam.start() -- spawns the effect
proc/stop()
src.processing = 0
src.on = 0
// Foam
// Similar to smoke, but spreads out more
// metal foams leave behind a foamed metal wall
/obj/effect/effect/foam
name = "foam"
icon_state = "foam"
opacity = 0
anchored = 1
density = 0
layer = OBJ_LAYER + 0.9
mouse_opacity = 0
var/amount = 3
var/expand = 1
animate_movement = 0
var/metal = 0
/obj/effect/effect/foam/New(loc, var/ismetal=0)
..(loc)
icon_state = "[ismetal ? "m":""]foam"
metal = ismetal
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
spawn(3 + metal*3)
process()
checkReagents()
spawn(120)
processing_objects.Remove(src)
sleep(30)
if(metal)
var/obj/structure/foamedmetal/M = PoolOrNew(/obj/structure/foamedmetal, src.loc)
M.metal = metal
M.updateicon()
flick("[icon_state]-disolve", src)
sleep(5)
qdel(src)
return
// transfer any reagents to the floor
/obj/effect/effect/foam/proc/checkReagents()
if(!metal && reagents)
for(var/atom/A in src.loc.contents)
if(A == src)
continue
reagents.reaction(A, 1, 1)
/obj/effect/effect/foam/process()
if(--amount < 0)
return
for(var/direction in cardinal)
var/turf/T = get_step(src,direction)
if(!T)
continue
if(!T.Enter(src))
continue
var/obj/effect/effect/foam/F = locate() in T
if(F)
continue
F = PoolOrNew(/obj/effect/effect/foam, list(T, metal))
F.amount = amount
if(!metal)
F.create_reagents(10)
if (reagents)
for(var/datum/reagent/R in reagents.reagent_list)
F.reagents.add_reagent(R.id, 1, safety = 1) //added safety check since reagents in the foam have already had a chance to react
// foam disolves when heated
// except metal foams
/obj/effect/effect/foam/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(!metal && prob(max(0, exposed_temperature - 475)))
flick("[icon_state]-disolve", src)
spawn(5)
qdel(src)
/obj/effect/effect/foam/Crossed(var/atom/movable/AM)
if(metal)
return
if(istype(AM, /mob/living))
var/mob/living/M = AM
M.slip("the foam",6)
/datum/effect/effect/system/foam_spread
var/amount = 5 // the size of the foam spread.
var/list/carried_reagents // the IDs of reagents present when the foam was mixed
var/metal = 0 // 0=foam, 1=metalfoam, 2=ironfoam
set_up(amt=5, loca, var/datum/reagents/carry = null, var/metalfoam = 0)
amount = round(sqrt(amt / 3), 1)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
carried_reagents = list()
metal = metalfoam
// bit of a hack here. Foam carries along any reagent also present in the glass it is mixed
// with (defaults to water if none is present). Rather than actually transfer the reagents,
// this makes a list of the reagent ids and spawns 1 unit of that reagent when the foam disolves.
if(carry && !metal)
for(var/datum/reagent/R in carry.reagent_list)
carried_reagents += R.id
start()
spawn(0)
var/obj/effect/effect/foam/F = locate() in location
if(F)
F.amount += amount
return
F = PoolOrNew(/obj/effect/effect/foam, list(src.location, metal))
F.amount = amount
if(!metal) // don't carry other chemicals if a metal foam
F.create_reagents(10)
if(carried_reagents)
for(var/id in carried_reagents)
F.reagents.add_reagent(id, 1, null, 1) //makes a safety call because all reagents should have already reacted anyway
else
F.reagents.add_reagent("water", 1, safety = 1)
// wall formed by metal foams
// dense and opaque, but easy to break
/obj/structure/foamedmetal
icon = 'icons/effects/effects.dmi'
icon_state = "metalfoam"
density = 1
opacity = 1 // changed in New()
anchored = 1
name = "foamed metal"
desc = "A lightweight foamed metal wall."
var/metal = 1 // 1=aluminum, 2=iron
New()
..()
update_nearby_tiles(1)
Destroy()
density = 0
update_nearby_tiles(1)
..()
proc/updateicon()
if(metal == 1)
icon_state = "metalfoam"
else
icon_state = "ironfoam"
ex_act(severity)
qdel(src)
blob_act()
qdel(src)
bullet_act()
if(metal==1 || prob(50))
qdel(src)
attack_hand(var/mob/user)
if ((HULK in user.mutations) || (prob(75 - metal*25)))
user << "\blue You smash through the metal foam wall."
for(var/mob/O in oviewers(user))
if ((O.client && !( O.blinded )))
O << "\red [user] smashes through the foamed metal."
qdel(src)
else
user << "\blue You hit the metal foam but bounce off it."
return
attackby(var/obj/item/I, var/mob/user)
if (istype(I, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = I
G.affecting.loc = src.loc
for(var/mob/O in viewers(src))
if (O.client)
O << "\red [G.assailant] smashes [G.affecting] through the foamed metal wall."
qdel(I)
qdel(src)
return
if(prob(I.force*20 - metal*25))
user << "\blue You smash through the foamed metal with \the [I]."
for(var/mob/O in oviewers(user))
if ((O.client && !( O.blinded )))
O << "\red [user] smashes through the foamed metal."
qdel(src)
else
user << "\blue You hit the metal foam to no effect."
CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
if(air_group) return 0
return !density
/datum/effect/effect/system/reagents_explosion
var/amount // TNT equivalent
var/flashing = 0 // does explosion creates flash effect?
+10 -10
View File
@@ -47,7 +47,7 @@
/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
if(!proximity) return
if (istype(A, /obj/structure/reagent_dispensers/watertank) && get_dist(src,A) <= 1)
A.reagents.trans_to(src, 10)
A.reagents.trans_to_obj(src, 10)
user << "\blue You fill the balloon with the contents of [A]."
src.desc = "A translucent balloon with some form of liquid sloshing around in it."
src.update_icon()
@@ -60,22 +60,22 @@
user << "The [O] is empty."
else if(O.reagents.total_volume >= 1)
if(O.reagents.has_reagent("pacid", 1))
user << "The acid chews through the balloon!"
O.reagents.reaction(user)
qdel(src)
user << "The acid chews through the balloon!"
O.reagents.splash_mob(user, reagents.total_volume)
qdel(src)
else
src.desc = "A translucent balloon with some form of liquid sloshing around in it."
user << "\blue You fill the balloon with the contents of [O]."
O.reagents.trans_to(src, 10)
O.reagents.trans_to_obj(src, 10)
src.update_icon()
return
/obj/item/toy/balloon/throw_impact(atom/hit_atom)
if(src.reagents.total_volume >= 1)
src.visible_message("\red The [src] bursts!","You hear a pop and a splash.")
src.reagents.reaction(get_turf(hit_atom))
src.reagents.touch_turf(get_turf(hit_atom))
for(var/atom/A in get_turf(hit_atom))
src.reagents.reaction(A)
src.reagents.touch(A)
src.icon_state = "burst"
spawn(5)
if(src)
@@ -456,15 +456,15 @@
D.icon = 'icons/obj/chemical.dmi'
D.icon_state = "chempuff"
D.create_reagents(5)
src.reagents.trans_to(D, 1)
src.reagents.trans_to_obj(D, 1)
playsound(src.loc, 'sound/effects/spray3.ogg', 50, 1, -6)
spawn(0)
for(var/i=0, i<1, i++)
step_towards(D,A)
D.reagents.reaction(get_turf(D))
D.reagents.touch_turf(get_turf(D))
for(var/atom/T in get_turf(D))
D.reagents.reaction(T)
D.reagents.touch(T)
if(ismob(T) && T:client)
T:client << "\red [user] has sprayed you with water!"
sleep(4)
@@ -114,10 +114,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(H.species.flags & IS_SYNTHETIC)
return
reagents.trans_to(C, REAGENTS_METABOLISM, 0.2) // Most of it is not inhaled... balance reasons.
reagents.reaction(C)
reagents.trans_to_mob(C, REM, CHEM_INGEST, 0.2) // Most of it is not inhaled... balance reasons.
else // else just remove some of the reagents
reagents.remove_any(REAGENTS_METABOLISM)
reagents.remove_any(REM)
/obj/item/clothing/mask/smokable/proc/light(var/flavor_text = "[usr] lights the [name].")
if(!src.lit)
@@ -232,7 +231,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(!proximity)
return
if(istype(glass)) //you can dip cigarettes into beakers
var/transfered = glass.reagents.trans_to(src, chem_volume)
var/transfered = glass.reagents.trans_to_obj(src, chem_volume)
if(transfered) //if reagents were transfered, show the message
user << "<span class='notice'>You dip \the [src] into \the [glass].</span>"
else //if not, either the beaker was empty, or the cigarette was full
@@ -377,7 +376,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
smoketime = 1000
if(G.reagents)
G.reagents.trans_to(src, G.reagents.total_volume)
G.reagents.trans_to_obj(src, G.reagents.total_volume)
name = "[G.name]-packed [initial(name)]"
qdel(G)
+38 -51
View File
@@ -31,15 +31,11 @@
w_class = 2.0
force = 3.0
max_water = 60
spray_particles = 6
spray_amount = 2
sprite_name = "miniFE"
/obj/item/weapon/extinguisher/New()
var/datum/reagents/R = new/datum/reagents(max_water)
reagents = R
R.my_atom = src
R.add_reagent("water", max_water)
create_reagents(max_water)
reagents.add_reagent("water", max_water)
/obj/item/weapon/extinguisher/examine(mob/user)
if(..(user, 0))
@@ -53,19 +49,19 @@
user << "The safety is [safety ? "on" : "off"]."
return
/obj/item/weapon/extinguisher/afterattack(atom/target, mob/user , flag)
/obj/item/weapon/extinguisher/afterattack(var/atom/target, var/mob/user, var/flag)
//TODO; Add support for reagents in water.
if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(src,target) <= 1)
if( istype(target, /obj/structure/reagent_dispensers/watertank) && flag)
var/obj/o = target
var/amount = o.reagents.trans_to(src, 50)
user << "\blue You fill [src] with [amount] units of the contents of [target]."
var/amount = o.reagents.trans_to_obj(src, 50)
user << "<span class='notice'>You fill [src] with [amount] units of the contents of [target].</span>"
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
if (!safety)
if (src.reagents.total_volume < 1)
usr << "\red \The [src] is empty."
usr << "<span class='notice'>\The [src] is empty.</span>"
return
if (world.time < src.last_use + 20)
@@ -77,35 +73,35 @@
var/direction = get_dir(src,target)
if(usr.buckled && isobj(usr.buckled) && !usr.buckled.anchored )
if(user.buckled && isobj(user.buckled) && !user.buckled.anchored )
spawn(0)
var/obj/structure/bed/chair/C = null
if(istype(usr.buckled, /obj/structure/bed/chair))
C = usr.buckled
var/obj/B = usr.buckled
if(istype(user.buckled, /obj/structure/bed/chair))
C = user.buckled
var/obj/B = user.buckled
var/movementdirection = turn(direction,180)
if(C) C.propelled = 4
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
sleep(1)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
if(C) C.propelled = 3
sleep(1)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
sleep(1)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
if(C) C.propelled = 2
sleep(2)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
if(C) C.propelled = 1
sleep(2)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
if(C) C.propelled = 0
sleep(3)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
sleep(3)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
sleep(3)
B.Move(get_step(usr,movementdirection), movementdirection)
B.Move(get_step(user,movementdirection), movementdirection)
var/turf/T = get_turf(target)
var/turf/T1 = get_step(T,turn(direction, 90))
@@ -113,33 +109,24 @@
var/list/the_targets = list(T,T1,T2)
for(var/a=0, a < spray_particles, a++)
spawn(0)
var/obj/effect/effect/water/W = PoolOrNew(/obj/effect/effect/water, get_turf(src))
var/turf/my_target = pick(the_targets)
var/datum/reagents/R = new/datum/reagents(spray_amount)
if(!W) return
W.reagents = R
R.my_atom = W
if(!W || !src) return
src.reagents.trans_to(W, spray_amount)
for(var/b=0, b<5, b++)
step_towards(W,my_target)
if(!W || !W.reagents) return
W.reagents.reaction(get_turf(W))
for(var/atom/atm in get_turf(W))
if(!W)
return
if(!W.reagents)
break
W.reagents.reaction(atm)
if(isliving(atm)) //For extinguishing mobs on fire
var/mob/living/M = atm
M.ExtinguishMob()
if(W.loc == my_target) break
sleep(2)
qdel(W)
for(var/a = 1 to spray_particles)
spawn(0)
var/obj/effect/effect/water/W = PoolOrNew(new /obj/effect/effect/water, get_turf(src))
var/turf/my_target
if(a == 1)
my_target = T
else if(a == 2)
my_target = T1
else if(a == 3)
my_target = T2
else
my_target = pick(the_targets)
W.create_reagents(spray_amount)
if(!src)
return
reagents.trans_to_obj(W, spray_amount)
W.set_color()
W.set_up(my_target)
if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity == 0))
user.inertia_dir = get_dir(target, user)
@@ -158,7 +158,7 @@
for(var/atom/A in view(affected_area, src.loc))
if( A == src ) continue
src.reagents.reaction(A, 1, 10)
src.reagents.touch(A)
if(istype(loc, /mob/living/carbon)) //drop dat grenade if it goes off in your hand
var/mob/living/carbon/C = loc
@@ -291,7 +291,7 @@ the implant may become unstable and either pre-maturely inject the subject or si
activate(var/cause)
if((!cause) || (!src.imp_in)) return 0
var/mob/living/carbon/R = src.imp_in
src.reagents.trans_to(R, cause)
src.reagents.trans_to_mob(R, cause, CHEM_BLOOD)
R << "You hear a faint *beep*."
if(!src.reagents.total_volume)
R << "You hear a faint click from your chest."
@@ -38,7 +38,7 @@
user << "\red [src] is full."
else
spawn(5)
I.reagents.trans_to(src.imp, 5)
I.reagents.trans_to_mob(src.imp, 5)
user << "\blue You inject 5 units of the solution. The syringe now contains [I.reagents.total_volume] units."
else if (istype(I, /obj/item/weapon/implanter))
var/obj/item/weapon/implanter/M = I
+1 -1
View File
@@ -49,7 +49,7 @@
return ..()
if (reagents.total_volume > 0)
reagents.trans_to_ingest(M, reagents.total_volume)
reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST)
if(M == user)
for(var/mob/O in viewers(M, null))
O.show_message(text("\blue [] eats some [] from \the [].", user, loaded, src), 1)
+1 -3
View File
@@ -25,9 +25,7 @@
for(var/obj/effect/O in src)
if(istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay))
qdel(O)
source.reagents.reaction(src, TOUCH, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly.
source.reagents.remove_any(1) //reaction() doesn't use up the reagents
source.reagents.trans_to_turf(src, 1, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly.
/obj/item/weapon/mop/afterattack(atom/A, mob/user, proximity)
if(!proximity) return
+2 -5
View File
@@ -20,11 +20,8 @@ var/global/list/cached_icons = list()
afterattack(turf/simulated/target, mob/user, proximity)
if(!proximity) return
if(istype(target) && reagents.total_volume > 5)
for(var/mob/O in viewers(user))
O.show_message("\red \The [target] has been splashed with something by [user]!", 1)
spawn(5)
reagents.reaction(target, TOUCH)
reagents.remove_any(5)
user.visible_message("<span class='warning'>\The [target] has been splashed with something by [user]!</span>")
reagents.trans_to_turf(target, 5)
else
return ..()
@@ -158,7 +158,7 @@
/obj/item/weapon/storage/fancy/cigarettes/remove_from_storage(obj/item/W as obj, atom/new_location)
var/obj/item/clothing/mask/smokable/cigarette/C = W
if(!istype(C)) return // what
reagents.trans_to(C, (reagents.total_volume/contents.len))
reagents.trans_to_obj(C, (reagents.total_volume/contents.len))
..()
/obj/item/weapon/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
@@ -167,7 +167,7 @@
if(M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/smokable/cigarette/W = new /obj/item/clothing/mask/smokable/cigarette(user)
reagents.trans_to(W, (reagents.total_volume/contents.len))
reagents.trans_to_obj(W, (reagents.total_volume/contents.len))
user.equip_to_slot_if_possible(W, slot_wear_mask)
reagents.maximum_volume = 15 * contents.len
contents.len--
@@ -213,7 +213,7 @@
/obj/item/weapon/storage/fancy/cigar/remove_from_storage(obj/item/W as obj, atom/new_location)
var/obj/item/clothing/mask/smokable/cigarette/cigar/C = W
if(!istype(C)) return
reagents.trans_to(C, (reagents.total_volume/contents.len))
reagents.trans_to_obj(C, (reagents.total_volume/contents.len))
..()
/obj/item/weapon/storage/fancy/cigar/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
@@ -222,7 +222,7 @@
if(M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/smokable/cigarette/cigar/W = new /obj/item/clothing/mask/smokable/cigarette/cigar(user)
reagents.trans_to(W, (reagents.total_volume/contents.len))
reagents.trans_to_obj(W, (reagents.total_volume/contents.len))
user.equip_to_slot_if_possible(W, slot_wear_mask)
reagents.maximum_volume = 15 * contents.len
contents.len--
+1 -1
View File
@@ -247,7 +247,7 @@
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
if(!proximity) return
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding)
O.reagents.trans_to(src, max_fuel)
O.reagents.trans_to_obj(src, max_fuel)
user << "\blue Welder refueled"
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
@@ -27,7 +27,7 @@
else
if(T.welding)
user << "\red That was close!"
src.reagents.trans_to(W, T.max_fuel)
src.reagents.trans_to_obj(W, T.max_fuel)
user << "\blue Welder refilled!"
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
@@ -38,7 +38,7 @@
if(!proximity) // this replaces and improves the get_dist(src,O) <= 1 checks used previously
return
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && src.reagents.total_volume < max_fuel)
O.reagents.trans_to(src, max_fuel)
O.reagents.trans_to_obj(src, max_fuel)
user << "\blue You crack the cap off the top of the pack and fill it back up again from the tank."
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
@@ -286,8 +286,8 @@
New()
..()
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src)
new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src)
return
+2 -2
View File
@@ -39,7 +39,7 @@
if(reagents.total_volume < 1)
user << "[src] is out of water!</span>"
else
reagents.trans_to(I, 5) //
reagents.trans_to_obj(I, 5) //
user << "<span class='notice'>You wet [I] in [src].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
@@ -186,7 +186,7 @@
/obj/structure/bed/chair/janicart/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/mop))
if(reagents.total_volume > 1)
reagents.trans_to(I, 2)
reagents.trans_to_obj(I, 2)
user << "<span class='notice'>You wet [I] in the [callme].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
+1 -1
View File
@@ -22,6 +22,6 @@
if(reagents.total_volume < 1)
user << "[src] is out of water!</span>"
else
reagents.trans_to(I, 5)
reagents.trans_to_obj(I, 5)
user << "<span class='notice'>You wet [I] in [src].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)