mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-01-27 17:33:05 +00:00
Fixed issue 767. The fix for issue 767 was to standardise spray bottle code (to some extent). If any issues come up with spray bottles, pepper spray, or chem sprayers, report them to me. Cyborgs now recharge their pacid and lube, as the size of their bottles was quartered. Changed the flash item_state to "flashbang", as it looks exactly like a flash. There's some more grammar and text clean up too, mostly with crates and closets. Finally, fixed some pipes in virology, and changed the librarian's den so the bookcases are at the top. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4394 316c924e-a436-60f5-8080-3fe189b3f50e
239 lines
8.0 KiB
Plaintext
239 lines
8.0 KiB
Plaintext
/obj/item/weapon/reagent_containers/spray
|
|
name = "spray bottle"
|
|
desc = "A spray bottle, with an unscrewable top."
|
|
icon = 'icons/obj/janitor.dmi'
|
|
icon_state = "cleaner"
|
|
item_state = "cleaner"
|
|
flags = TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
|
|
slot_flags = SLOT_BELT
|
|
throwforce = 3
|
|
w_class = 2.0
|
|
throw_speed = 2
|
|
throw_range = 10
|
|
amount_per_transfer_from_this = 5
|
|
volume = 250
|
|
possible_transfer_amounts = null
|
|
|
|
|
|
/obj/item/weapon/reagent_containers/spray/afterattack(atom/A as mob|obj, mob/user as mob)
|
|
if(istype(A, /obj/item/weapon/storage) || istype(A, /obj/structure/table) || istype(A, /obj/structure/rack) || istype(A, /obj/structure/closet) \
|
|
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink))
|
|
return
|
|
|
|
if(istype(A, /obj/effect/proc_holder/spell))
|
|
return
|
|
|
|
if(istype(A, /obj/structure/reagent_dispensers)) //this block copypasted from reagent_containers/glass, for lack of a better solution
|
|
if(!A.reagents.total_volume && A.reagents)
|
|
user << "<span class='notice'>\The [A] is empty.</span>"
|
|
return
|
|
|
|
if(reagents.total_volume >= reagents.maximum_volume)
|
|
user << "<span class='notice'>\The [src] is full.</span>"
|
|
return
|
|
|
|
var/trans = A.reagents.trans_to(src, A:amount_per_transfer_from_this)
|
|
user << "<span class='notice'>You fill \the [src] with [trans] units of the contents of \the [A].</span>"
|
|
return
|
|
|
|
if(reagents.total_volume < amount_per_transfer_from_this)
|
|
user << "<span class='notice'>\The [src] is empty!</span>"
|
|
return
|
|
|
|
var/obj/effect/decal/D = new/obj/effect/decal(get_turf(src))
|
|
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
|
|
|
|
spawn(0)
|
|
for(var/i=0, i<3, i++)
|
|
step_towards(D,A)
|
|
D.reagents.reaction(get_turf(D))
|
|
for(var/atom/T in get_turf(D))
|
|
D.reagents.reaction(T)
|
|
sleep(3)
|
|
del(D)
|
|
|
|
playsound(src.loc, 'spray2.ogg', 50, 1, -6)
|
|
|
|
if(reagents.has_reagent("sacid"))
|
|
message_admins("[key_name_admin(user)] fired sulphuric acid from a spray bottle.")
|
|
log_game("[key_name(user)] fired sulphuric acid from a spray bottle.")
|
|
if(reagents.has_reagent("pacid"))
|
|
message_admins("[key_name_admin(user)] fired Polyacid from a spray bottle.")
|
|
log_game("[key_name(user)] fired Polyacid from a spray bottle.")
|
|
if(reagents.has_reagent("lube"))
|
|
message_admins("[key_name_admin(user)] fired Space lube from a spray bottle.")
|
|
log_game("[key_name(user)] fired Space lube from a spray bottle.")
|
|
return
|
|
|
|
|
|
/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
|
|
|
|
|
|
//space cleaner
|
|
/obj/item/weapon/reagent_containers/spray/cleaner
|
|
name = "space cleaner"
|
|
desc = "BLAM!-brand non-foaming space cleaner!"
|
|
|
|
|
|
/obj/item/weapon/reagent_containers/spray/cleaner/New()
|
|
..()
|
|
reagents.add_reagent("cleaner", 250)
|
|
|
|
//pepperspray
|
|
/obj/item/weapon/reagent_containers/spray/pepper
|
|
name = "pepperspray"
|
|
desc = "Manufactured by UhangInc, used to blind and down an opponent quickly."
|
|
icon = 'icons/obj/weapons.dmi'
|
|
icon_state = "pepperspray"
|
|
item_state = "pepperspray"
|
|
volume = 40
|
|
amount_per_transfer_from_this = 10
|
|
|
|
|
|
/obj/item/weapon/reagent_containers/spray/pepper/New()
|
|
..()
|
|
reagents.add_reagent("condensedcapsaicin", 40)
|
|
|
|
|
|
//chemsprayer
|
|
/obj/item/weapon/reagent_containers/spray/chemsprayer
|
|
name = "chem sprayer"
|
|
desc = "A utility used to spray large amounts of reagent in a given area."
|
|
icon = 'icons/obj/gun.dmi'
|
|
icon_state = "chemsprayer"
|
|
item_state = "chemsprayer"
|
|
throwforce = 3
|
|
w_class = 3.0
|
|
volume = 600
|
|
origin_tech = "combat=3;materials=3;engineering=3"
|
|
|
|
|
|
//this is a big copypasta clusterfuck, but it's still better than it used to be!
|
|
/obj/item/weapon/reagent_containers/spray/chemsprayer/afterattack(atom/A as mob|obj, mob/user as mob)
|
|
if(istype(A, /obj/item/weapon/storage) || istype(A, /obj/structure/table) || istype(A, /obj/structure/rack) || istype(A, /obj/structure/closet) \
|
|
|| istype(A, /obj/item/weapon/reagent_containers) || istype(A, /obj/structure/sink))
|
|
return
|
|
|
|
if(istype(A, /obj/effect/proc_holder/spell))
|
|
return
|
|
|
|
if(istype(A, /obj/structure/reagent_dispensers)) //this block copypasted from reagent_containers/glass, for lack of a better solution
|
|
if(!A.reagents.total_volume && A.reagents)
|
|
user << "<span class='notice'>\The [A] is empty.</span>"
|
|
return
|
|
|
|
if(reagents.total_volume >= reagents.maximum_volume)
|
|
user << "<span class='notice'>\The [src] is full.</span>"
|
|
return
|
|
|
|
var/trans = A.reagents.trans_to(src, A:amount_per_transfer_from_this)
|
|
user << "<span class='notice'>You fill \the [src] with [trans] units of the contents of \the [A].</span>"
|
|
return
|
|
|
|
if(reagents.total_volume < amount_per_transfer_from_this)
|
|
user << "<span class='notice'>\The [src] is empty!</span>"
|
|
return
|
|
|
|
var/Sprays[3]
|
|
for(var/i=1, i<=3, i++) // intialize sprays
|
|
if(src.reagents.total_volume < 1) break
|
|
var/obj/effect/decal/D = new/obj/effect/decal(get_turf(src))
|
|
D.name = "chemicals"
|
|
D.icon = 'icons/obj/chempuff.dmi'
|
|
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
|
|
|
|
Sprays[i] = D
|
|
|
|
var/direction = get_dir(src, A)
|
|
var/turf/T = get_turf(A)
|
|
var/turf/T1 = get_step(T,turn(direction, 90))
|
|
var/turf/T2 = get_step(T,turn(direction, -90))
|
|
var/list/the_targets = list(T,T1,T2)
|
|
|
|
for(var/i=1, i<=Sprays.len, i++)
|
|
spawn()
|
|
var/obj/effect/decal/D = Sprays[i]
|
|
if(!D) continue
|
|
|
|
// Spreads the sprays a little bit
|
|
var/turf/my_target = pick(the_targets)
|
|
the_targets -= my_target
|
|
|
|
for(var/j=1, j<=rand(6,8), j++)
|
|
step_towards(D, my_target)
|
|
D.reagents.reaction(get_turf(D))
|
|
for(var/atom/t in get_turf(D))
|
|
D.reagents.reaction(t)
|
|
sleep(2)
|
|
del(D)
|
|
|
|
playsound(src.loc, 'spray2.ogg', 50, 1, -6)
|
|
|
|
if(reagents.has_reagent("sacid"))
|
|
message_admins("[key_name_admin(user)] fired sulphuric acid from a chem sprayer.")
|
|
log_game("[key_name(user)] fired sulphuric acid from a chem sprayer.")
|
|
if(reagents.has_reagent("pacid"))
|
|
message_admins("[key_name_admin(user)] fired Polyacid from a chem sprayer.")
|
|
log_game("[key_name(user)] fired Polyacid from a chem sprayer.")
|
|
if(reagents.has_reagent("lube"))
|
|
message_admins("[key_name_admin(user)] fired Space lube from a chem sprayer.")
|
|
log_game("[key_name(user)] fired Space lube from a chem sprayer.")
|
|
return
|
|
|
|
//looking for plant-b-gone? it's in code/game/objects/items/weapons/hydroponics.dm |