mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 02:24:11 +01:00
Standardised reagent colour mixing a little bit. Fixes issue 785.
Changed the path of large beakers, so they're actually a subtype of beaker (wtf) Moved new_year.dm to unused. Updated Carn's sequential master controller to not have tension stuff, for potential live testing. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4444 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -464,27 +464,7 @@ steam.start() -- spawns the effect
|
||||
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
|
||||
var/color = mix_color_from_reagents(chemholder.reagents.reagent_list)
|
||||
|
||||
for(i=0, i<src.number, i++)
|
||||
if(src.total_smoke > 20)
|
||||
@@ -504,8 +484,8 @@ steam.start() -- spawns the effect
|
||||
if(chemholder.reagents.total_volume != 1) // can't split 1 very well
|
||||
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / number) // copy reagents to each smoke, divide evenly
|
||||
|
||||
if(finalcolor)
|
||||
smoke.icon += finalcolor // give the smoke color, if it has any to begin with
|
||||
if(color)
|
||||
smoke.icon += color // give the smoke color, if it has any to begin with
|
||||
else
|
||||
// if no color, just use the old smoke icon
|
||||
smoke.icon = 'icons/effects/96x96.dmi'
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
|
||||
/obj/item/weapon/grenade/proc/prime()
|
||||
playsound(loc, 'Welder2.ogg', 25, 1)
|
||||
// playsound(loc, 'Welder2.ogg', 25, 1)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
T.hotspot_expose(700,125)
|
||||
@@ -82,12 +82,15 @@
|
||||
if(isscrewdriver(W))
|
||||
switch(det_time)
|
||||
if ("1")
|
||||
det_time = 10
|
||||
user << "<span class='notice'>You set the [name] for 1 second detonation time.</span>"
|
||||
if ("10")
|
||||
det_time = 30
|
||||
user << "<span class='notice'>You set the [name] for 3 second detonation time.</span>"
|
||||
if ("30")
|
||||
det_time = 100
|
||||
user << "<span class='notice'>You set the [name] for 10 second detonation time.</span>"
|
||||
if ("100")
|
||||
det_time = 50
|
||||
user << "<span class='notice'>You set the [name] for 5 second detonation time.</span>"
|
||||
if ("50")
|
||||
det_time = 1
|
||||
user << "<span class='notice'>You set the [name] for instant detonation.</span>"
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -64,27 +64,6 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Hope it's okay to stick this shit here: it basically just turns a hexadecimal color into rgb
|
||||
*/
|
||||
|
||||
/proc/GetColors(hex)
|
||||
hex = uppertext(hex)
|
||||
var/hi1 = text2ascii(hex, 2)
|
||||
var/lo1 = text2ascii(hex, 3)
|
||||
var/hi2 = text2ascii(hex, 4)
|
||||
var/lo2 = text2ascii(hex, 5)
|
||||
var/hi3 = text2ascii(hex, 6)
|
||||
var/lo3 = text2ascii(hex, 7)
|
||||
return list(((hi1>= 65 ? hi1-55 : hi1-48)<<4) | (lo1 >= 65 ? lo1-55 : lo1-48),
|
||||
((hi2 >= 65 ? hi2-55 : hi2-48)<<4) | (lo2 >= 65 ? lo2-55 : lo2-48),
|
||||
((hi3 >= 65 ? hi3-55 : hi3-48)<<4) | (lo3 >= 65 ? lo3-55 : lo3-48))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -44,32 +44,10 @@
|
||||
D.create_reagents(amount_per_transfer_from_this)
|
||||
reagents.trans_to(D, amount_per_transfer_from_this)
|
||||
|
||||
var/list/rgbcolor = list(0,0,0)
|
||||
var/finalcolor
|
||||
for(var/datum/reagent/re in D.reagents.reagent_list) // natural color mixing bullshit/algorithm
|
||||
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])
|
||||
// This isn't a perfect color mixing system, the more reagents that are inside,
|
||||
// the darker it gets until it becomes absolutely pitch black! I dunno, maybe
|
||||
// that's pretty realistic? I don't do a whole lot of color-mixing anyway.
|
||||
// If you add brighter colors to it it'll eventually get lighter, though.
|
||||
|
||||
D.name = "chemicals"
|
||||
D.icon = 'icons/obj/chempuff.dmi'
|
||||
|
||||
D.icon += finalcolor
|
||||
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
|
||||
|
||||
spawn(0)
|
||||
for(var/i=0, i<3, i++)
|
||||
@@ -97,8 +75,6 @@
|
||||
/obj/item/weapon/reagent_containers/spray/examine()
|
||||
set src in usr
|
||||
..()
|
||||
// usr << "\icon[src] This is \the [src]!"
|
||||
// usr << desc
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
usr << "[round(R.volume)] units of [R.name] left."
|
||||
return
|
||||
@@ -178,25 +154,7 @@
|
||||
D.create_reagents(amount_per_transfer_from_this)
|
||||
src.reagents.trans_to(D, amount_per_transfer_from_this)
|
||||
|
||||
var/rgbcolor[3]
|
||||
var/finalcolor
|
||||
for(var/datum/reagent/re in D.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])
|
||||
|
||||
D.icon += finalcolor
|
||||
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
|
||||
|
||||
Sprays[i] = D
|
||||
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
|
||||
/obj/effect/new_year_tree
|
||||
name = "The fir"
|
||||
desc = "This is a fir. Real fir on dammit spess station. You smell pine-needles."
|
||||
icon = 'icons/effects/160x160.dmi'
|
||||
icon_state = "new-year-tree"
|
||||
anchored = 1
|
||||
opacity = 1
|
||||
density = 1
|
||||
layer = 5
|
||||
pixel_x = -64
|
||||
//pixel_y = -64
|
||||
|
||||
/obj/effect/new_year_tree/attackby(obj/item/W, mob/user)
|
||||
if (istype(W, /obj/item/weapon/grab))
|
||||
return
|
||||
W.loc = src
|
||||
if (user.client)
|
||||
user.client.screen -= W
|
||||
user.u_equip(W)
|
||||
var/const/bottom_right_x = 115.0
|
||||
var/const/bottom_right_y = 150.0
|
||||
var/const/top_left_x = 15.0
|
||||
var/const/top_left_y = 15.0
|
||||
var/const/bottom_med_x = top_left_x+(bottom_right_x-top_left_x)/2
|
||||
var/x = rand(top_left_x,bottom_med_x) //point in half of circumscribing rectangle
|
||||
var/y = rand(top_left_y,bottom_right_y)
|
||||
/*
|
||||
y1=a*x1+b
|
||||
y2=a*x2+b b = y2-a*x2
|
||||
|
||||
y1=a*x1+ y2-a*x2
|
||||
a*(x1-x2)+y2-y1=0
|
||||
a = (y1-y2)/(x1-x2)
|
||||
*/
|
||||
var/a = (top_left_y-bottom_right_y)/(top_left_x-bottom_med_x)
|
||||
var/b = bottom_right_y-a*bottom_med_x
|
||||
|
||||
if (a*x+b < y) //if point is above diagonal top_left -> bottom_median
|
||||
x = bottom_med_x + x - top_left_x
|
||||
y = bottom_right_y - y + top_left_y
|
||||
var/image/I = image(W.icon, W, icon_state = W.icon_state)
|
||||
I.pixel_x = x
|
||||
I.pixel_y = y
|
||||
overlays += I
|
||||
|
||||
/obj/item/weapon/firbang
|
||||
desc = "It is set to detonate in 10 seconds."
|
||||
name = "firbang"
|
||||
icon = 'icons/obj/grenade.dmi'
|
||||
icon_state = "flashbang"
|
||||
var/state = null
|
||||
var/det_time = 100.0
|
||||
w_class = 2.0
|
||||
item_state = "flashbang"
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
|
||||
if (user.get_active_hand() == src)
|
||||
if ((CLUMSY in usr.mutations) && prob(50))
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else if (!( src.state ))
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
user.dir = get_dir(user, target)
|
||||
user.drop_item()
|
||||
var/t = (isturf(target) ? target : target.loc)
|
||||
walk_towards(src, t, 3)
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/item/weapon/firbang/attack_hand()
|
||||
walk(src, null, null)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/proc/prime()
|
||||
playsound(src.loc, 'bang.ogg', 25, 1)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
|
||||
smoke.set_up(3, 0, src.loc)
|
||||
smoke.attach(src)
|
||||
smoke.start()
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
new /obj/effect/new_year_tree(T)
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/firbang/attack_self(mob/user as mob)
|
||||
if (!src.state)
|
||||
if (CLUMSY in user.mutations)
|
||||
user << "\red Huh? How does this thing work?!"
|
||||
spawn( 5 )
|
||||
prime()
|
||||
return
|
||||
else
|
||||
user << "\red You prime the [src]! [det_time/10] seconds!"
|
||||
src.state = 1
|
||||
src.icon_state = "flashbang1"
|
||||
add_fingerprint(user)
|
||||
spawn( src.det_time )
|
||||
prime()
|
||||
return
|
||||
return
|
||||
|
||||
/*
|
||||
/datum/supply_packs/new_year
|
||||
name = "New Year Celebration Equipment"
|
||||
contains = list("/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/firbang",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper",
|
||||
"/obj/item/weapon/wrapping_paper")
|
||||
cost = 20
|
||||
containertype = "/obj/structure/closet/crate"
|
||||
containername = "New Year Celebration crate"
|
||||
*/
|
||||
Reference in New Issue
Block a user