- Chemistry smoke now is laced with everything inside of the beaker/container. Using a new smoke icon, the smoke will exhibit a color combination of the reagents just like normal, so you can easily identify a cloud of pacid smoke from dexalin smoke. (space drugs smoke, anyone?)

- A new /datum/reagents proc called copy_to() works like trans_to() except that it "copies" reagents instead of transferring them.

- Modified all breathing mobs to support inhaling chemical smoke reagents.


If you are a-hatin', please leave all your hate in this revision page. This is a very significant game change, and to be honest I only briefly mentioned it over IRC a couple of times (however the idea was positively received).

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2033 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
vageyenaman@gmail.com
2011-08-21 05:07:00 +00:00
parent 6a4b3e236b
commit 73a73a8211
10 changed files with 2771 additions and 2550 deletions
+131
View File
@@ -214,6 +214,7 @@ steam.start() -- spawns the effect
// in case you wanted a vent to always smoke north for example
/////////////////////////////////////////////
/obj/effects/harmless_smoke
name = "smoke"
icon_state = "smoke"
@@ -388,6 +389,136 @@ steam.start() -- spawns the effect
src.total_smoke--
/////////////////////////////////////////////
// Chem smoke
/////////////////////////////////////////////
/obj/effects/chem_smoke
name = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
icon = 'chemsmoke.dmi'
pixel_x = -32
pixel_y = -32
/obj/effects/chem_smoke/New()
..()
var/datum/reagents/R = new/datum/reagents(500)
reagents = R
R.my_atom = src
spawn (200+rand(10,30))
del(src)
return
/obj/effects/chem_smoke/Move()
..()
for(var/atom/A in view(2, src))
reagents.reaction(A)
return
/obj/effects/chem_smoke/HasEntered(mob/living/carbon/M as mob )
..()
reagents.reaction(M)
return
/datum/effects/system/chem_smoke_spread
var/number = 3
var/cardinals = 0
var/turf/location
var/atom/holder
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
var/obj/chemholder
New()
..()
chemholder = new/obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
/datum/effects/system/chem_smoke_spread/proc/set_up(var/datum/reagents/carry = null, n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
carry.copy_to(chemholder, carry.total_volume)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
/datum/effects/system/chem_smoke_spread/proc/attach(atom/atom)
holder = atom
/datum/effects/system/chem_smoke_spread/proc/start()
var/i = 0
// Calculate the smokes' color
var/list/rgbcolor = list(0,0,0)
var/finalcolor
for(var/datum/reagent/re in chemholder.reagents.reagent_list)
if(!finalcolor)
rgbcolor = GetColors(re.color)
finalcolor = re.color
else
var/newcolor[3]
var/prergbcolor[3]
prergbcolor = rgbcolor
newcolor = GetColors(re.color)
rgbcolor[1] = (prergbcolor[1]+newcolor[1])/2
rgbcolor[2] = (prergbcolor[2]+newcolor[2])/2
rgbcolor[3] = (prergbcolor[3]+newcolor[3])/2
finalcolor = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3])
if(finalcolor)
finalcolor = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3]) // slightly darker color
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effects/chem_smoke/smoke = new /obj/effects/chem_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume) // copy reagents to each smoke
if(finalcolor)
smoke.icon += finalcolor // give the smoke color, if it has any to begin with
else
// if no color, just use the old smoke icon
smoke.icon = '96x96.dmi'
smoke.icon_state = "smoke"
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
del(smoke)
src.total_smoke--
/////////////////////////////////////////////
// Sleep smoke
/////////////////////////////////////////////