- Reagent code reorganization commit 5 (Some big errors... Yeah, renaming files in explorer and expecting SVN to understand is a bad idea.)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4494 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2012-08-18 22:06:04 +00:00
parent f392067896
commit e476b418be
30 changed files with 13744 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
/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))
/proc/mix_color_from_reagents(var/list/reagent_list)
if(!reagent_list || !reagent_list.len) return 0
var/list/rgbcolor = list(0,0,0)
var/finalcolor = 0
for(var/datum/reagent/re in 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])
return finalcolor
// 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.

View File

@@ -0,0 +1,440 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
var/const/TOUCH = 1
var/const/INGEST = 2
///////////////////////////////////////////////////////////////////////////////////
datum
reagents
var/list/datum/reagent/reagent_list = new/list()
var/total_volume = 0
var/maximum_volume = 100
var/atom/my_atom = null
New(maximum=100)
maximum_volume = maximum
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
if(!chemical_reagents_list)
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
var/paths = typesof(/datum/reagent) - /datum/reagent
chemical_reagents_list = list()
for(var/path in paths)
var/datum/reagent/D = new path()
chemical_reagents_list[D.id] = D
if(!chemical_reactions_list)
//Chemical Reactions - Initialises all /datum/chemical_reaction into a list (without an index)
var/paths = typesof(/datum/chemical_reaction) - /datum/chemical_reaction
chemical_reactions_list = list()
for(var/path in paths)
var/datum/chemical_reaction/D = new path()
chemical_reactions_list += D
proc
remove_any(var/amount=1)
var/total_transfered = 0
var/current_list_element = 1
current_list_element = rand(1,reagent_list.len)
while(total_transfered != amount)
if(total_transfered >= amount) break
if(total_volume <= 0 || !reagent_list.len) break
if(current_list_element > reagent_list.len) current_list_element = 1
var/datum/reagent/current_reagent = reagent_list[current_list_element]
src.remove_reagent(current_reagent.id, 1)
current_list_element++
total_transfered++
src.update_total()
handle_reactions()
return total_transfered
get_master_reagent_name()
var/the_name = null
var/the_volume = 0
for(var/datum/reagent/A in reagent_list)
if(A.volume > the_volume)
the_volume = A.volume
the_name = A.name
return the_name
get_master_reagent_id()
var/the_id = null
var/the_volume = 0
for(var/datum/reagent/A in reagent_list)
if(A.volume > the_volume)
the_volume = A.volume
the_id = A.id
return the_id
trans_to(var/obj/target, var/amount=1, var/multiplier=1, var/preserve_data=1)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
if (!target )
return
if (!target.reagents || src.total_volume<=0)
return
var/datum/reagents/R = target.reagents
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
var/part = amount / src.total_volume
var/trans_data = null
for (var/datum/reagent/current_reagent in src.reagent_list)
var/current_reagent_transfer = current_reagent.volume * part
if(preserve_data)
trans_data = current_reagent.data
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.remove_reagent(current_reagent.id, current_reagent_transfer)
src.update_total()
R.update_total()
R.handle_reactions()
src.handle_reactions()
return amount
copy_to(var/obj/target, var/amount=1, var/multiplier=1, var/preserve_data=1)
if(!target)
return
if(!target.reagents || src.total_volume<=0)
return
var/datum/reagents/R = target.reagents
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
var/part = amount / src.total_volume
var/trans_data = null
for (var/datum/reagent/current_reagent in src.reagent_list)
var/current_reagent_transfer = current_reagent.volume * part
if(preserve_data)
trans_data = current_reagent.data
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.update_total()
R.update_total()
R.handle_reactions()
src.handle_reactions()
return amount
trans_id_to(var/obj/target, var/reagent, var/amount=1, var/preserve_data=1)//Not sure why this proc didn't exist before. It does now! /N
if (!target)
return
if (!target.reagents || src.total_volume<=0 || !src.get_reagent_amount(reagent))
return
var/datum/reagents/R = target.reagents
if(src.get_reagent_amount(reagent)<amount)
amount = src.get_reagent_amount(reagent)
amount = min(amount, R.maximum_volume-R.total_volume)
var/trans_data = null
for (var/datum/reagent/current_reagent in src.reagent_list)
if(current_reagent.id == reagent)
if(preserve_data)
trans_data = current_reagent.data
R.add_reagent(current_reagent.id, amount, trans_data)
src.remove_reagent(current_reagent.id, amount, 1)
break
src.update_total()
R.update_total()
R.handle_reactions()
//src.handle_reactions() Don't need to handle reactions on the source since you're (presumably isolating and) transferring a specific reagent.
return amount
/*
if (!target) return
var/total_transfered = 0
var/current_list_element = 1
var/datum/reagents/R = target.reagents
var/trans_data = null
//if(R.total_volume + amount > R.maximum_volume) return 0
current_list_element = rand(1,reagent_list.len) //Eh, bandaid fix.
while(total_transfered != amount)
if(total_transfered >= amount) break //Better safe than sorry.
if(total_volume <= 0 || !reagent_list.len) break
if(R.total_volume >= R.maximum_volume) break
if(current_list_element > reagent_list.len) current_list_element = 1
var/datum/reagent/current_reagent = reagent_list[current_list_element]
if(preserve_data)
trans_data = current_reagent.data
R.add_reagent(current_reagent.id, (1 * multiplier), trans_data)
src.remove_reagent(current_reagent.id, 1)
current_list_element++
total_transfered++
src.update_total()
R.update_total()
R.handle_reactions()
handle_reactions()
return total_transfered
*/
metabolize(var/mob/M)
for(var/A in reagent_list)
var/datum/reagent/R = A
if(M && R)
R.on_mob_life(M)
update_total()
conditional_update_move(var/atom/A, var/Running = 0)
for(var/datum/reagent/R in reagent_list)
R.on_move (A, Running)
update_total()
conditional_update(var/atom/A, )
for(var/datum/reagent/R in reagent_list)
R.on_update (A)
update_total()
handle_reactions()
if(my_atom.flags & NOREACT) return //Yup, no reactions here. No siree.
var/reaction_occured = 0
do
reaction_occured = 0
for(var/datum/chemical_reaction/C in chemical_reactions_list)
var/total_required_reagents = C.required_reagents.len
var/total_matching_reagents = 0
var/total_required_catalysts = C.required_catalysts.len
var/total_matching_catalysts= 0
var/matching_container = 0
var/matching_other = 0
var/list/multipliers = new/list()
for(var/B in C.required_reagents)
if(!has_reagent(B, C.required_reagents[B])) break
total_matching_reagents++
multipliers += round(get_reagent_amount(B) / C.required_reagents[B])
for(var/B in C.required_catalysts)
if(!has_reagent(B, C.required_catalysts[B])) break
total_matching_catalysts++
if(!C.required_container)
matching_container = 1
else
if(my_atom.type == C.required_container)
matching_container = 1
if(!C.required_other)
matching_other = 1
else
if(istype(my_atom, /obj/item/metroid_core))
var/obj/item/metroid_core/M = my_atom
if(M.POWERFLAG == C.required_other && M.Uses > 0) // added a limit to metroid cores -- Muskets requested this
matching_other = 1
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other)
var/multiplier = min(multipliers)
for(var/B in C.required_reagents)
remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1)
var/created_volume = C.result_amount*multiplier
if(C.result)
feedback_add_details("chemical_reaction","[C.result]|[C.result_amount*multiplier]")
multiplier = max(multiplier, 1) //this shouldnt happen ...
add_reagent(C.result, C.result_amount*multiplier)
for(var/mob/M in viewers(4, get_turf(my_atom)) )
M << "\blue \icon[my_atom] The solution begins to bubble."
if(istype(my_atom, /obj/item/metroid_core))
var/obj/item/metroid_core/ME = my_atom
ME.Uses--
if(ME.Uses <= 0) // give the notification that the metroid core is dead
for(var/mob/M in viewers(4, get_turf(my_atom)) )
M << "\blue \icon[my_atom] The innards begin to boil!"
playsound(get_turf(my_atom), 'sound/effects/bubbles.ogg', 80, 1)
C.on_reaction(src, created_volume)
reaction_occured = 1
break
while(reaction_occured)
update_total()
return 0
isolate_reagent(var/reagent)
for(var/A in reagent_list)
var/datum/reagent/R = A
if (R.id != reagent)
del_reagent(R.id)
update_total()
del_reagent(var/reagent)
for(var/A in reagent_list)
var/datum/reagent/R = A
if (R.id == reagent)
reagent_list -= A
del(A)
update_total()
my_atom.on_reagent_change()
return 0
return 1
update_total()
total_volume = 0
for(var/datum/reagent/R in reagent_list)
if(R.volume < 0.1)
del_reagent(R.id)
else
total_volume += R.volume
return 0
clear_reagents()
for(var/datum/reagent/R in reagent_list)
del_reagent(R.id)
return 0
reaction(var/atom/A, var/method=TOUCH, var/volume_modifier=0)
switch(method)
if(TOUCH)
for(var/datum/reagent/R in reagent_list)
if(ismob(A))
spawn(0)
if(!R) return
else R.reaction_mob(A, TOUCH, R.volume+volume_modifier)
if(isturf(A))
spawn(0)
if(!R) return
else R.reaction_turf(A, R.volume+volume_modifier)
if(isobj(A))
spawn(0)
if(!R) return
else R.reaction_obj(A, R.volume+volume_modifier)
if(INGEST)
for(var/datum/reagent/R in reagent_list)
if(ismob(A) && R)
spawn(0)
if(!R) return
else R.reaction_mob(A, INGEST, R.volume+volume_modifier)
if(isturf(A) && R)
spawn(0)
if(!R) return
else R.reaction_turf(A, R.volume+volume_modifier)
if(isobj(A) && R)
spawn(0)
if(!R) return
else R.reaction_obj(A, R.volume+volume_modifier)
return
add_reagent(var/reagent, var/amount, var/data=null)
if(!isnum(amount)) return 1
update_total()
if(total_volume + amount > maximum_volume) amount = (maximum_volume - total_volume) //Doesnt fit in. Make it disappear. Shouldnt happen. Will happen.
for(var/A in reagent_list)
var/datum/reagent/R = A
if (R.id == reagent)
R.volume += amount
update_total()
my_atom.on_reagent_change()
// mix dem viruses
if(R.id == "blood" && reagent == "blood")
if(R.data && data)
if(R.data && R.data["viruses"] || data && data["viruses"])
var/list/this = R.data["viruses"]
var/list/that = data["viruses"]
this += that // combine the two
/* -- Turns out this code was buggy and unnecessary ---- Doohl
for(var/datum/disease/D in this) // makes sure no two viruses are in the reagent at the same time
for(var/datum/disease/d in this)//Something in here can cause an inf loop and I am tired so someone else will have to fix it.
if(d != D)
D.cure(0)
*/
handle_reactions()
return 0
var/datum/reagent/D = chemical_reagents_list[reagent]
if(D)
var/datum/reagent/R = new D.type()
reagent_list += R
R.holder = src
R.volume = amount
R.data = data
//debug
//world << "Adding data"
//for(var/D in R.data)
// world << "Container data: [D] = [R.data[D]]"
//debug
update_total()
my_atom.on_reagent_change()
handle_reactions()
return 0
handle_reactions()
return 1
remove_reagent(var/reagent, var/amount, var/safety)//Added a safety check for the trans_id_to
if(!isnum(amount)) return 1
for(var/A in reagent_list)
var/datum/reagent/R = A
if (R.id == reagent)
R.volume -= amount
update_total()
if(!safety)//So it does not handle reactions when it need not to
handle_reactions()
my_atom.on_reagent_change()
return 0
return 1
has_reagent(var/reagent, var/amount = -1)
for(var/A in reagent_list)
var/datum/reagent/R = A
if (R.id == reagent)
if(!amount) return R
else
if(R.volume >= amount) return R
else return 0
return 0
get_reagent_amount(var/reagent)
for(var/A in reagent_list)
var/datum/reagent/R = A
if (R.id == reagent)
return R.volume
return 0
get_reagents()
var/res = ""
for(var/datum/reagent/A in reagent_list)
if (res != "") res += ","
res += A.name
return res
///////////////////////////////////////////////////////////////////////////////////
// Convenience proc to create a reagents holder for an atom
// Max vol is maximum volume of holder
atom/proc/create_reagents(var/max_vol)
reagents = new/datum/reagents(max_vol)
reagents.my_atom = src

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,247 @@
/*
NOTE: IF YOU UPDATE THE REAGENT-SYSTEM, ALSO UPDATE THIS README.
Structure: /////////////////// //////////////////////////
// Mob or object // -------> // Reagents var (datum) // Is a reference to the datum that holds the reagents.
/////////////////// //////////////////////////
| |
The object that holds everything. V
reagent_list var (list) A List of datums, each datum is a reagent.
| | |
V V V
reagents (datums) Reagents. I.e. Water , antitoxins or mercury.
Random important notes:
An objects on_reagent_change will be called every time the objects reagents change.
Useful if you want to update the objects icon etc.
About the Holder:
The holder (reagents datum) is the datum that holds a list of all reagents
currently in the object.It also has all the procs needed to manipulate reagents
remove_any(var/amount)
This proc removes reagents from the holder until the passed amount
is matched. It'll try to remove some of ALL reagents contained.
trans_to(var/obj/target, var/amount)
This proc equally transfers the contents of the holder to another
objects holder. You need to pass it the object (not the holder) you want
to transfer to and the amount you want to transfer. Its return value is the
actual amount transfered (if one of the objects is full/empty)
trans_id_to(var/obj/target, var/reagent, var/amount)
Same as above but only for a specific reagent in the reagent list.
If the specified amount is greater than what is available, it will use
the amount of the reagent that is available. If no reagent exists, returns null.
metabolize(var/mob/M)
This proc is called by the mobs life proc. It simply calls on_mob_life for
all contained reagents. You shouldnt have to use this one directly.
handle_reactions()
This proc check all recipes and, on a match, uses them.
It will also call the recipe's on_reaction proc (for explosions or w/e).
Currently, this proc is automatically called by trans_to.
isolate_reagent(var/reagent)
Pass it a reagent id and it will remove all reagents but that one.
It's that simple.
del_reagent(var/reagent)
Completely remove the reagent with the matching id.
reaction_fire(exposed_temp)
Simply calls the reaction_fire procs of all contained reagents.
update_total()
This one simply updates the total volume of the holder.
(the volume of all reagents added together)
clear_reagents()
This proc removes ALL reagents from the holder.
reaction(var/atom/A, var/method=TOUCH, var/volume_modifier=0)
This proc calls the appropriate reaction procs of the reagents.
I.e. if A is an object, it will call the reagents reaction_obj
proc. The method var is used for reaction on mobs. It simply tells
us if the mob TOUCHed the reagent or if it INGESTed the reagent.
Since the volume can be checked in a reagents proc, you might want to
use the volume_modifier var to modifiy the passed value without actually
changing the volume of the reagents.
If you're not sure if you need to use this the answer is very most likely 'No'.
You'll want to use this proc whenever an atom first comes in
contact with the reagents of a holder. (in the 'splash' part of a beaker i.e.)
More on the reaction in the reagent part of this readme.
add_reagent(var/reagent, var/amount, var/data)
Attempts to add X of the matching reagent to the holder.
You wont use this much. Mostly in new procs for pre-filled
objects.
remove_reagent(var/reagent, var/amount)
The exact opposite of the add_reagent proc.
has_reagent(var/reagent, var/amount)
Returns 1 if the holder contains this reagent.
Or 0 if not.
If you pass it an amount it will additionally check
if the amount is matched. This is optional.
get_reagent_amount(var/reagent)
Returns the amount of the matching reagent inside the
holder. Returns 0 if the reagent is missing.
Important variables:
total_volume
This variable contains the total volume of all reagents in this holder.
reagent_list
This is a list of all contained reagents. More specifically, references
to the reagent datums.
maximum_volume
This is the maximum volume of the holder.
my_atom
This is the atom the holder is 'in'. Useful if you need to find the location.
(i.e. for explosions)
About Reagents:
Reagents are all the things you can mix and fille in bottles etc. This can be anything from
rejuvs over water to ... iron. Each reagent also has a few procs - i'll explain those below.
reaction_mob(var/mob/M, var/method=TOUCH)
This is called by the holder's reation proc.
This version is only called when the reagent
reacts with a mob. The method var can be either
TOUCH or INGEST. You'll want to put stuff like
acid-facemelting in here.
reaction_obj(var/obj/O)
This is called by the holder's reation proc.
This version is called when the reagents reacts
with an object. You'll want to put stuff like
object melting in here ... or something. i dunno.
reaction_turf(var/turf/T)
This is called by the holder's reation proc.
This version is called when the reagents reacts
with a turf. You'll want to put stuff like extra
slippery floors for lube or something in here.
on_mob_life(var/mob/M)
This proc is called everytime the mobs life proc executes.
This is the place where you put damage for toxins ,
drowsyness for sleep toxins etc etc.
You'll want to call the parents proc by using ..() .
If you dont, the chemical will stay in the mob forever -
unless you write your own piece of code to slowly remove it.
(Should be pretty easy, 1 line of code)
Important variables:
holder
This variable contains a reference to the holder the chemical is 'in'
volume
This is the volume of the reagent.
id
The id of the reagent
name
The name of the reagent.
data
This var can be used for whatever the fuck you want. I used it for the sleep
toxins to make them work slowly instead of instantly. You could also use this
for DNA in a blood reagent or ... well whatever you want.
color
This is a hexadecimal color that represents the reagent outside of containers,
you define it as "#RRGGBB", or, red green blue. You can also define it using the
rgb() proc, which returns a hexadecimal value too. The color is black by default.
A good website for color calculations: http://www.psyclops.com/tools/rgb/
About Recipes:
Recipes are simple datums that contain a list of required reagents and a result.
They also have a proc that is called when the recipe is matched.
on_reaction(var/datum/reagents/holder, var/created_volume)
This proc is called when the recipe is matched.
You'll want to add explosions etc here.
To find the location you'll have to do something
like get_turf(holder.my_atom)
name & id
Should be pretty obvious.
result
This var contains the id of the resulting reagent.
required_reagents
This is a list of ids of the required reagents.
Each id also needs an associated value that gives us the minimum required amount
of that reagent. The handle_reaction proc can detect mutiples of the same recipes
so for most cases you want to set the required amount to 1.
required_catalysts (Added May 2011)
This is a list of the ids of the required catalysts.
Functionally similar to required_reagents, it is a list of reagents that are required
for the reaction. However, unlike required_reagents, catalysts are NOT consumed.
They mearly have to be present in the container.
result_amount
This is the amount of the resulting reagent this recipe will produce.
I recommend you set this to the total volume of all required reagent.
required_container
The container the recipe has to take place in in order to happen. Leave this blank/null
if you want the reaction to happen anywhere.
required_other
Basically like a reagent's data variable. You can set extra requirements for a
reaction with this.
About the Tools:
By default, all atom have a reagents var - but its empty. if you want to use an object for the chem.
system you'll need to add something like this in its new proc:
var/datum/reagents/R = new/datum/reagents(100) <<<<< create a new datum , 100 is the maximum_volume of the new holder datum.
reagents = R <<<<< assign the new datum to the objects reagents var
R.my_atom = src <<<<< set the holders my_atom to src so that we know where we are.
This can also be done by calling a convenience proc:
atom/proc/create_reagents(var/max_volume)
Other important stuff:
amount_per_transfer_from_this var
This var is mostly used by beakers and bottles.
It simply tells us how much to transfer when
'pouring' our reagents into something else.
atom/proc/is_open_container()
Checks atom/var/flags & OPENCONTAINER.
If this returns 1 , you can use syringes, beakers etc
to manipulate the contents of this object.
If it's 0, you'll need to write your own custom reagent
transfer code since you will not be able to use the standard
tools to manipulate it.
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
/obj/item/weapon/gun/grenadelauncher
name = "grenade launcher"
icon = 'icons/obj/gun.dmi'
icon_state = "riotgun"
item_state = "riotgun"
w_class = 4.0
throw_speed = 2
throw_range = 10
force = 5.0
var/list/grenades = new/list()
var/max_grenades = 3
m_amt = 2000
examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return
usr << "\icon [src] Grenade launcher:"
usr << "\blue [grenades] / [max_grenades] Grenades."
attackby(obj/item/I as obj, mob/user as mob)
if((istype(I, /obj/item/weapon/grenade)))
if(grenades.len < max_grenades)
user.drop_item()
I.loc = src
grenades += I
user << "\blue You put the grenade in the grenade launcher."
user << "\blue [grenades.len] / [max_grenades] Grenades."
else
usr << "\red The grenade launcher cannot hold more grenades."
afterattack(obj/target, mob/user , flag)
if (istype(target, /obj/item/weapon/storage/backpack ))
return
else if (locate (/obj/structure/table, src.loc))
return
else if(target == user)
return
if(grenades.len)
spawn(0) fire_grenade(target,user)
else
usr << "\red The grenade launcher is empty."
proc
fire_grenade(atom/target, mob/user)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red [] fired a grenade!", user), 1)
user << "\red You fire the grenade launcher!"
var/obj/item/weapon/grenade/chem_grenade/F = grenades[1] //Now with less copypasta!
grenades -= F
F.loc = user.loc
F.throw_at(target, 30, 2)
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
log_game("[key_name_admin(user)] used a grenade ([src.name]).")
F.active = 1
F.icon_state = initial(icon_state) + "_active"
playsound(user.loc, 'armbomb.ogg', 75, 1, -3)
spawn(15)
F.prime()

View File

@@ -0,0 +1,45 @@
/obj/item/weapon/reagent_containers
name = "Container"
desc = "..."
icon = 'icons/obj/chemical.dmi'
icon_state = null
w_class = 1
var/amount_per_transfer_from_this = 5
var/possible_transfer_amounts = list(5,10,15,25,30)
var/volume = 30
/obj/item/weapon/reagent_containers/verb/set_APTFT() //set amount_per_transfer_from_this
set name = "Set transfer amount"
set category = "Object"
set src in range(0)
var/N = input("Amount per transfer from this:","[src]") as null|anything in possible_transfer_amounts
if (N)
amount_per_transfer_from_this = N
/obj/item/weapon/reagent_containers/New()
..()
if (!possible_transfer_amounts)
src.verbs -= /obj/item/weapon/reagent_containers/verb/set_APTFT
var/datum/reagents/R = new/datum/reagents(volume)
reagents = R
R.my_atom = src
/obj/item/weapon/reagent_containers/attack_self(mob/user as mob)
return
/obj/item/weapon/reagent_containers/attack(mob/M as mob, mob/user as mob, def_zone)
return
/obj/item/weapon/reagent_containers/attackby(obj/item/I as obj, mob/user as mob)
return
/obj/item/weapon/reagent_containers/afterattack(obj/target, mob/user , flag)
return
/obj/item/weapon/reagent_containers/proc/reagentlist(var/obj/item/weapon/reagent_containers/snack) //Attack logs for regents in pills
var/data
if(snack.reagents.reagent_list && snack.reagents.reagent_list.len) //find a reagent list if there is and check if it has entries
for (var/datum/reagent/R in snack.reagents.reagent_list) //no reagents will be left behind
data += "[R.id]([R.volume] units); " //Using IDs because SOME chemicals(I'm looking at you, chlorhydrate-beer) have the same names as other chemicals.
return data
else return "No reagents"

View File

@@ -0,0 +1,93 @@
/obj/item/weapon/reagent_containers/borghypo
name = "Cyborg Hypospray"
desc = "An advanced chemical synthesizer and injection system, designed for heavy-duty medical equipment."
icon = 'icons/obj/syringe.dmi'
item_state = "hypo"
icon_state = "borghypo"
amount_per_transfer_from_this = 5
volume = 30
possible_transfer_amounts = null
flags = FPRINT
var/mode = 1
var/charge_cost = 50
var/charge_tick = 0
var/recharge_time = 5 //Time it takes for shots to recharge (in seconds)
New()
..()
processing_objects.Add(src)
Del()
processing_objects.Remove(src)
..()
process() //Every [recharge_time] seconds, recharge some reagents for the cyborg
charge_tick++
if(charge_tick < recharge_time) return 0
charge_tick = 0
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell)
if(mode == 1 && reagents.total_volume < 30) //Don't recharge reagents and drain power if the storage is full.
R.cell.use(charge_cost) //Take power from borg...
reagents.add_reagent("tricordrazine",5) //And fill hypo with reagent.
if(mode == 2 && reagents.total_volume < 30)
R.cell.use(charge_cost)
reagents.add_reagent("inaprovaline", 5)
if(mode == 3 && reagents.total_volume < 30)
R.cell.use(charge_cost)
reagents.add_reagent("spaceacillin", 5)
//update_icon()
return 1
/obj/item/weapon/reagent_containers/borghypo/attack(mob/M as mob, mob/user as mob)
if(!reagents.total_volume)
user << "\red The injector is empty."
return
if (!( istype(M, /mob) ))
return
if (reagents.total_volume)
user << "\blue You inject [M] with the injector."
M << "\red You feel a tiny prick!"
src.reagents.reaction(M, INGEST)
if(M.reagents)
var/trans = reagents.trans_to(M, amount_per_transfer_from_this)
user << "\blue [trans] units injected. [reagents.total_volume] units remaining."
return
/obj/item/weapon/reagent_containers/borghypo/attack_self(mob/user as mob)
playsound(src.loc, 'pop.ogg', 50, 0) //Change the mode
if(mode == 1)
mode = 2
charge_tick = 0 //Prevents wasted chems/cell charge if you're cycling through modes.
reagents.clear_reagents() //Flushes whatever was in the storage previously, so you don't get chems all mixed up.
user << "\blue Synthesizer is now producing 'Inaprovaline'."
return
if(mode == 2)
mode = 3
charge_tick = 0
reagents.clear_reagents()
user << "\blue Synthesizer is now producing 'Spaceacillin'."
return
if(mode == 3)
mode = 1
charge_tick = 0
reagents.clear_reagents()
user << "\blue Synthesizer is now producing 'Tricordrazine'."
return
/obj/item/weapon/reagent_containers/borghypo/examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return
if(reagents && reagents.reagent_list.len)
for(var/datum/reagent/R in reagents.reagent_list)
usr << "\blue It currently has [R.volume] units of [R.name] stored."
else
usr << "\blue It is currently empty. Allow some time for the internal syntheszier to produce more."

View File

@@ -0,0 +1,93 @@
////////////////////////////////////////////////////////////////////////////////
/// Droppers.
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/dropper
name = "Dropper"
desc = "A dropper. Transfers 5 units."
icon = 'icons/obj/chemical.dmi'
icon_state = "dropper0"
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(1,2,3,4,5)
volume = 5
var/filled = 0
afterattack(obj/target, mob/user , flag)
if(!target.reagents) return
if(filled)
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "\red [target] is full."
return
if(!target.is_open_container() && !ismob(target) && !istype(target,/obj/item/weapon/reagent_containers/food) && !istype(target, /obj/item/clothing/mask/cigarette)) //You can inject humans and food but you cant remove the shit.
user << "\red You cannot directly fill this object."
return
var/trans = 0
if(ismob(target))
if(istype(target , /mob/living/carbon/human))
var/mob/living/carbon/human/victim = target
var/obj/item/safe_thing = null
if( victim.wear_mask )
if ( victim.wear_mask.flags & MASKCOVERSEYES )
safe_thing = victim.wear_mask
if( victim.head )
if ( victim.head.flags & MASKCOVERSEYES )
safe_thing = victim.head
if(victim.glasses)
if ( !safe_thing )
safe_thing = victim.glasses
if(safe_thing)
if(!safe_thing.reagents)
safe_thing.create_reagents(100)
trans = src.reagents.trans_to(safe_thing, amount_per_transfer_from_this)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] tries to squirt something into []'s eyes, but fails!</B>", user, target), 1)
spawn(5)
src.reagents.reaction(safe_thing, TOUCH)
user << "\blue You transfer [trans] units of the solution."
if (src.reagents.total_volume<=0)
filled = 0
icon_state = "dropper[filled]"
return
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] squirts something into []'s eyes!</B>", user, target), 1)
src.reagents.reaction(target, TOUCH)
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You transfer [trans] units of the solution."
if (src.reagents.total_volume<=0)
filled = 0
icon_state = "dropper[filled]"
else
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers))
user << "\red You cannot directly remove reagents from [target]."
return
if(!target.reagents.total_volume)
user << "\red [target] is empty."
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
user << "\blue You fill the dropper with [trans] units of the solution."
filled = 1
icon_state = "dropper[filled]"
return
////////////////////////////////////////////////////////////////////////////////
/// Droppers. END
////////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,11 @@
////////////////////////////////////////////////////////////////////////////////
/// Food.
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food
possible_transfer_amounts = null
volume = 50 //Sets the default container amount for all food items.
/obj/item/weapon/reagent_containers/food/New()
..()
src.pixel_x = rand(-5.0, 5) //Randomizes postion slightly.
src.pixel_y = rand(-5.0, 5)

View File

@@ -0,0 +1,176 @@
///////////////////////////////////////////////Condiments
//Notes by Darem: The condiments food-subtype is for stuff you don't actually eat but you use to modify existing food. They all
// leave empty containers when used up and can be filled/re-filled with other items. Formatting for first section is identical
// to mixed-drinks code. If you want an object that starts pre-loaded, you need to make it in addition to the other code.
//Food items that aren't eaten normally and leave an empty container behind.
/obj/item/weapon/reagent_containers/food/condiment
name = "Condiment Container"
desc = "Just your average condiment container."
icon = 'icons/obj/food.dmi'
icon_state = "emptycondiment"
flags = FPRINT | TABLEPASS | OPENCONTAINER
possible_transfer_amounts = list(1,5,10)
volume = 50
attackby(obj/item/weapon/W as obj, mob/user as mob)
return
attack_self(mob/user as mob)
return
attack(mob/M as mob, mob/user as mob, def_zone)
var/datum/reagents/R = src.reagents
if(!R || !R.total_volume)
user << "\red None of [src] left, oh no!"
return 0
if(M == user)
M << "\blue You swallow some of contents of the [src]."
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
reagents.trans_to(M, 10)
playsound(M.loc,'drink.ogg', rand(10,50), 1)
return 1
else if( istype(M, /mob/living/carbon/human) )
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] attempts to feed [M] [src].", 1)
if(!do_mob(user, M)) return
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] feeds [M] [src].", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [src.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
reagents.trans_to(M, 10)
playsound(M.loc,'drink.ogg', rand(10,50), 1)
return 1
return 0
attackby(obj/item/I as obj, mob/user as mob)
return
afterattack(obj/target, mob/user , flag)
if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
if(!target.reagents.total_volume)
user << "\red [target] is empty."
return
if(reagents.total_volume >= reagents.maximum_volume)
user << "\red [src] is full."
return
var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
user << "\blue You fill [src] with [trans] units of the contents of [target]."
//Something like a glass or a food item. Player probably wants to transfer TO it.
else if(target.is_open_container() || istype(target, /obj/item/weapon/reagent_containers/food/snacks))
if(!reagents.total_volume)
user << "\red [src] is empty."
return
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "\red you can't add anymore to [target]."
return
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You transfer [trans] units of the condiment to [target]."
on_reagent_change()
if(icon_state == "saltshakersmall" || icon_state == "peppermillsmall")
return
if(reagents.reagent_list.len > 0)
switch(reagents.get_master_reagent_id())
if("ketchup")
name = "Ketchup"
desc = "You feel more American already."
icon_state = "ketchup"
if("capsaicin")
name = "Hotsauce"
desc = "You can almost TASTE the stomach ulcers now!"
icon_state = "hotsauce"
if("enzyme")
name = "Universal Enzyme"
desc = "Used in cooking various dishes."
icon_state = "enzyme"
if("soysauce")
name = "Soy Sauce"
desc = "A salty soy-based flavoring."
icon_state = "soysauce"
if("frostoil")
name = "Coldsauce"
desc = "Leaves the tongue numb in its passage."
icon_state = "coldsauce"
if("sodiumchloride")
name = "Salt Shaker"
desc = "Salt. From space oceans, presumably."
icon_state = "saltshaker"
if("blackpepper")
name = "Pepper Mill"
desc = "Often used to flavor food or make people sneeze."
icon_state = "peppermillsmall"
if("cornoil")
name = "Corn Oil"
desc = "A delicious oil used in cooking. Made from corn."
icon_state = "oliveoil"
if("sugar")
name = "Sugar"
desc = "Tastey space sugar!"
else
name = "Misc Condiment Bottle"
if (reagents.reagent_list.len==1)
desc = "Looks like it is [reagents.get_master_reagent_name()], but you are not sure."
else
desc = "A mixture of various condiments. [reagents.get_master_reagent_name()] is one of them."
icon_state = "mixedcondiments"
else
icon_state = "emptycondiment"
name = "Condiment Bottle"
desc = "An empty condiment bottle."
return
/obj/item/weapon/reagent_containers/food/condiment/enzyme
name = "Universal Enzyme"
desc = "Used in cooking various dishes."
icon_state = "enzyme"
New()
..()
reagents.add_reagent("enzyme", 50)
/obj/item/weapon/reagent_containers/food/condiment/sugar
New()
..()
reagents.add_reagent("sugar", 50)
/obj/item/weapon/reagent_containers/food/condiment/saltshaker //Seperate from above since it's a small shaker rather then
name = "Salt Shaker" // a large one.
desc = "Salt. From space oceans, presumably."
icon_state = "saltshakersmall"
possible_transfer_amounts = list(1,20) //for clown turning the lid off
amount_per_transfer_from_this = 1
volume = 20
New()
..()
reagents.add_reagent("sodiumchloride", 20)
/obj/item/weapon/reagent_containers/food/condiment/peppermill
name = "Pepper Mill"
desc = "Often used to flavor food or make people sneeze."
icon_state = "peppermillsmall"
possible_transfer_amounts = list(1,20) //for clown turning the lid off
amount_per_transfer_from_this = 1
volume = 20
New()
..()
reagents.add_reagent("blackpepper", 20)

View File

@@ -0,0 +1,368 @@
////////////////////////////////////////////////////////////////////////////////
/// Drinks.
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food/drinks
name = "drink"
desc = "yummy"
icon = 'icons/obj/drinks.dmi'
icon_state = null
flags = FPRINT | TABLEPASS | OPENCONTAINER
var/gulp_size = 5 //This is now officially broken ... need to think of a nice way to fix it.
possible_transfer_amounts = list(5,10,25)
volume = 50
on_reagent_change()
if (gulp_size < 5) gulp_size = 5
else gulp_size = max(round(reagents.total_volume / 5), 5)
attack_self(mob/user as mob)
return
attack(mob/M as mob, mob/user as mob, def_zone)
var/datum/reagents/R = src.reagents
var/fillevel = gulp_size
if(!R.total_volume || !R)
user << "\red None of [src] left, oh no!"
return 0
if(M == user)
M << "\blue You swallow a gulp of [src]."
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
reagents.trans_to(M, gulp_size)
playsound(M.loc,'drink.ogg', rand(10,50), 1)
return 1
else if( istype(M, /mob/living/carbon/human) )
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] attempts to feed [M] [src].", 1)
if(!do_mob(user, M)) return
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] feeds [M] [src].", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
reagents.trans_to(M, gulp_size)
if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
var/mob/living/silicon/robot/bro = user
bro.cell.use(30)
var/refill = R.get_master_reagent_id()
spawn(600)
R.add_reagent(refill, fillevel)
playsound(M.loc,'drink.ogg', rand(10,50), 1)
return 1
return 0
afterattack(obj/target, mob/user , flag)
if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
if(!target.reagents.total_volume)
user << "\red [target] is empty."
return
if(reagents.total_volume >= reagents.maximum_volume)
user << "\red [src] is full."
return
var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
user << "\blue You fill [src] with [trans] units of the contents of [target]."
else if(target.is_open_container()) //Something like a glass. Player probably wants to transfer TO it.
if(!reagents.total_volume)
user << "\red [src] is empty."
return
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "\red [target] is full."
return
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You transfer [trans] units of the solution to [target]."
if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
var/mob/living/silicon/robot/bro = user
bro.cell.use(30)
var/refill = reagents.get_master_reagent_id()
spawn(600)
reagents.add_reagent(refill, trans)
return
examine()
set src in view()
..()
if (!(usr in range(0)) && usr!=src.loc) return
if(!reagents || reagents.total_volume==0)
usr << "\blue \The [src] is empty!"
else if (reagents.total_volume<src.volume/4)
usr << "\blue \The [src] is almost empty!"
else if (reagents.total_volume<src.volume/2)
usr << "\blue \The [src] is half full!"
else if (reagents.total_volume<src.volume/0.90)
usr << "\blue \The [src] is almost full!"
else
usr << "\blue \The [src] is full!"
////////////////////////////////////////////////////////////////////////////////
/// Drinks. END
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food/drinks/golden_cup
desc = "A golden cup"
name = "golden cup"
icon_state = "golden_cup"
item_state = "" //nope :(
w_class = 4
force = 14
throwforce = 10
amount_per_transfer_from_this = 20
possible_transfer_amounts = null
volume = 150
flags = FPRINT | CONDUCT | TABLEPASS | OPENCONTAINER
/obj/item/weapon/reagent_containers/food/drinks/golden_cup/tournament_26_06_2011
desc = "A golden cup. It will be presented to a winner of tournament 26 june and name of the winner will be graved on it."
///////////////////////////////////////////////Drinks
//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly
// rather then having to add it to something else first. They should only contain liquids. They have a default container size of 50.
// Formatting is the same as food.
/obj/item/weapon/reagent_containers/food/drinks/milk
name = "Space Milk"
desc = "It's milk. White and nutritious goodness!"
icon_state = "milk"
item_state = "carton"
New()
..()
reagents.add_reagent("milk", 50)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/soymilk
name = "SoyMilk"
desc = "It's soy milk. White and nutritious goodness!"
icon_state = "soymilk"
item_state = "carton"
New()
..()
reagents.add_reagent("soymilk", 50)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/coffee
name = "Robust Coffee"
desc = "Careful, the beverage you're about to enjoy is extremely hot."
icon_state = "coffee"
New()
..()
reagents.add_reagent("coffee", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/tea
name = "Duke Purple Tea"
desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea."
icon_state = "tea"
item_state = "coffee"
New()
..()
reagents.add_reagent("tea", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/ice
name = "Ice Cup"
desc = "Careful, cold ice, do not chew."
icon_state = "coffee"
New()
..()
reagents.add_reagent("ice", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/h_chocolate
name = "Dutch Hot Coco"
desc = "Made in Space South America."
icon_state = "tea"
item_state = "coffee"
New()
..()
reagents.add_reagent("hot_coco", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen
name = "Cup Ramen"
desc = "Just add 10ml water, self heats! A taste that reminds you of your school years."
icon_state = "ramen"
New()
..()
reagents.add_reagent("dry_ramen", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/cola
name = "Space Cola"
desc = "Cola. in space."
icon_state = "cola"
New()
..()
reagents.add_reagent("cola", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/beer
name = "Space Beer"
desc = "Beer. In space."
icon_state = "beer"
New()
..()
reagents.add_reagent("beer", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/ale
name = "Magm-Ale"
desc = "A true dorf's drink of choice."
icon_state = "alebottle"
item_state = "beer"
New()
..()
reagents.add_reagent("ale", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/space_mountain_wind
name = "Space Mountain Wind"
desc = "Blows right through you like a space wind."
icon_state = "space_mountain_wind"
New()
..()
reagents.add_reagent("spacemountainwind", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/thirteenloko
name = "Thirteen Loko"
desc = "The CMO has advised crew members that consumption of Thirteen Loko may result in seizures, blindness, drunkeness, or even death. Please Drink Responsably."
icon_state = "thirteen_loko"
New()
..()
reagents.add_reagent("thirteenloko", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/dr_gibb
name = "Dr. Gibb"
desc = "A delicious mixture of 42 different flavors."
icon_state = "dr_gibb"
New()
..()
reagents.add_reagent("dr_gibb", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/starkist
name = "Star-kist"
desc = "The taste of a star in liquid form. And, a bit of tuna...?"
icon_state = "starkist"
New()
..()
reagents.add_reagent("cola", 15)
reagents.add_reagent("orangejuice", 15)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/space_up
name = "Space-Up"
desc = "Tastes like a hull breach in your mouth."
icon_state = "space-up"
New()
..()
reagents.add_reagent("space_up", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/lemon_lime
name = "Lemon-Lime"
desc = "You wanted ORANGE. It gave you Lemon Lime."
icon_state = "lemon-lime"
New()
..()
reagents.add_reagent("lemon_lime", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
/obj/item/weapon/reagent_containers/food/drinks/sillycup
name = "Paper Cup"
desc = "A paper water cup."
icon_state = "water_cup_e"
possible_transfer_amounts = null
volume = 10
New()
..()
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
on_reagent_change()
if(reagents.total_volume)
icon_state = "water_cup"
else
icon_state = "water_cup_e"
/obj/item/weapon/reagent_containers/food/drinks/tonic
name = "T-Borg's Tonic Water"
desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away."
icon_state = "tonic"
New()
..()
reagents.add_reagent("tonic", 50)
/obj/item/weapon/reagent_containers/food/drinks/sodawater
name = "Soda Water"
desc = "A can of soda water. Why not make a scotch and soda?"
icon_state = "sodawater"
New()
..()
reagents.add_reagent("sodawater", 50)
//////////////////////////drinkingglass and shaker//
//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
// itself), in Chemistry-Recipes.dm (for the reaction that changes the components into the drink), and here (for the drinking glass
// icon states.
/obj/item/weapon/reagent_containers/food/drinks/shaker
name = "Shaker"
desc = "A metal shaker to mix drinks in."
icon_state = "shaker"
amount_per_transfer_from_this = 10
volume = 100
/obj/item/weapon/reagent_containers/food/drinks/flask
name = "Captain's Flask"
desc = "A metal flask belonging to the captain"
icon_state = "flask"
volume = 60
/obj/item/weapon/reagent_containers/food/drinks/britcup
name = "cup"
desc = "A cup with the british flag emblazoned on it."
icon_state = "britcup"
volume = 30

View File

@@ -0,0 +1,278 @@
///////////////////////////////////////////////Alchohol bottles! -Agouri //////////////////////////
//Functionally identical to regular drinks. The only difference is that the default bottle size is 100. - Darem
//Bottles now weaken and break when smashed on people's heads. - Giacom
/obj/item/weapon/reagent_containers/food/drinks/bottle
amount_per_transfer_from_this = 10
volume = 100
item_state = "broken_beer" //Generic held-item sprite until unique ones are made.
var/const/duration = 13 //Directly relates to the 'weaken' duration. Lowered by armor (i.e. helmets)
var/isGlass = 1 //Whether the 'bottle' is made of glass or not so that milk cartons dont shatter when someone gets hit by it
/obj/item/weapon/reagent_containers/food/drinks/bottle/proc/smash(mob/living/target as mob, mob/living/user as mob)
//Creates a shattering noise and replaces the bottle with a broken_bottle
user.drop_item()
var/obj/item/weapon/broken_bottle/B = new /obj/item/weapon/broken_bottle(user.loc)
user.put_in_active_hand(B)
if(prob(33))
new/obj/item/weapon/shard(target.loc) // Create a glass shard at the target's location!
B.icon_state = src.icon_state
var/icon/I = new('icons/obj/drinks.dmi', src.icon_state)
I.Blend(B.broken_outline, ICON_OVERLAY, rand(5), 1)
I.SwapColor(rgb(255, 0, 220, 255), rgb(0, 0, 0, 0))
B.icon = I
playsound(src, "shatter", 70, 1)
user.put_in_active_hand(B)
src.transfer_fingerprints_to(B)
del(src)
/obj/item/weapon/reagent_containers/food/drinks/bottle/attack(mob/living/target as mob, mob/living/user as mob)
if(!target)
return
if(user.a_intent != "hurt" || !isGlass)
return ..()
force = 15 //Smashing bottles over someoen's head hurts.
var/datum/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
var/armor_block = 0 //Get the target's armour values for normal attack damage.
var/armor_duration = 0 //The more force the bottle has, the longer the duration.
//Calculating duration and calculating damage.
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/headarmor = 0 // Target's head armour
armor_block = H.run_armor_check(affecting, "melee") // For normal attack damage
//If they have a hat/helmet and the user is targeting their head.
if(istype(H.head, /obj/item/clothing/head) && affecting == "head")
// If their head has an armour value, assign headarmor to it, else give it 0.
if(H.head.armor["melee"])
headarmor = H.head.armor["melee"]
else
headarmor = 0
else
headarmor = 0
//Calculate the weakening duration for the target.
armor_duration = (duration - headarmor) + force
else
//Only humans can have armour, right?
armor_block = target.run_armor_check(affecting, "melee")
if(affecting == "head")
armor_duration = duration + force
armor_duration /= 10
//Apply the damage!
target.apply_damage(force, BRUTE, affecting, armor_block)
// You are going to knock someone out for longer if they are not wearing a helmet.
if(affecting == "head" && istype(target, /mob/living/carbon/))
//Display an attack message.
for(var/mob/O in viewers(user, null))
if(target != user) O.show_message(text("\red <B>[target] has been hit over the head with a bottle of [src.name], by [user]!</B>"), 1)
else O.show_message(text("\red <B>[target] hit himself with a bottle of [src.name] on the head!</B>"), 1)
//Weaken the target for the duration that we calculated and divide it by 5.
if(armor_duration)
target.apply_effect(min(armor_duration, 10) , WEAKEN) // Never weaken more than a flash!
else
//Default attack message and don't weaken the target.
for(var/mob/O in viewers(user, null))
if(target != user) O.show_message(text("\red <B>[target] has been attacked with a bottle of [src.name], by [user]!</B>"), 1)
else O.show_message(text("\red <B>[target] has attacked himself with a bottle of [src.name]!</B>"), 1)
//Attack logs
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has attacked [target.name] ([target.ckey]) with a bottle!</font>")
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been smashed with a bottle by [user.name] ([user.ckey])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [target.name] with a bottle. ([target.ckey])</font>")
//The reagents in the bottle splash all over the target, thanks for the idea Nodrak
if(src.reagents)
for(var/mob/O in viewers(user, null))
O.show_message(text("\blue <B>The contents of the [src] splashes all over [target]!</B>"), 1)
src.reagents.reaction(target, TOUCH)
//Finally, smash the bottle. This kills (del) the bottle.
src.smash(target, user)
return
//Keeping this here for now, I'll ask if I should keep it here.
/obj/item/weapon/broken_bottle
name = "Broken Bottle"
desc = "A bottle with a sharp broken bottom."
icon = 'icons/obj/drinks.dmi'
icon_state = "broken_bottle"
force = 9.0
throwforce = 5.0
throw_speed = 3
throw_range = 5
item_state = "beer"
//item_state - Need to find a bottle sprite
attack_verb = list("stabbed", "slashed", "attacked")
var/icon/broken_outline = icon('icons/obj/drinks.dmi', "broken")
/obj/item/weapon/reagent_containers/food/drinks/bottle/gin
name = "Griffeater Gin"
desc = "A bottle of high quality gin, produced in the New London Space Station."
icon_state = "ginbottle"
New()
..()
reagents.add_reagent("gin", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey
name = "Uncle Git's Special Reserve"
desc = "A premium single-malt whiskey, gently matured inside the tunnels of a nuclear shelter. TUNNEL WHISKEY RULES."
icon_state = "whiskeybottle"
New()
..()
reagents.add_reagent("whiskey", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka
name = "Tunguska Triple Distilled"
desc = "Aah, vodka. Prime choice of drink AND fuel by Russians worldwide."
icon_state = "vodkabottle"
New()
..()
reagents.add_reagent("vodka", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/tequilla
name = "Caccavo Guaranteed Quality Tequilla"
desc = "Made from premium petroleum distillates, pure thalidomide and other fine quality ingredients!"
icon_state = "tequillabottle"
New()
..()
reagents.add_reagent("tequilla", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing
name = "Bottle of Nothing"
desc = "A bottle filled with nothing"
icon_state = "bottleofnothing"
New()
..()
reagents.add_reagent("nothing", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/patron
name = "Wrapp Artiste Patron"
desc = "Silver laced tequilla, served in space night clubs across the galaxy."
icon_state = "patronbottle"
New()
..()
reagents.add_reagent("patron", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/rum
name = "Captain Pete's Cuban Spiced Rum"
desc = "This isn't just rum, oh no. It's practically GRIFF in a bottle."
icon_state = "rumbottle"
New()
..()
reagents.add_reagent("rum", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/holywater
name = "Flask of Holy Water"
desc = "A flask of the chaplain's holy water."
icon_state = "holyflask"
New()
..()
reagents.add_reagent("holywater", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/vermouth
name = "Goldeneye Vermouth"
desc = "Sweet, sweet dryness~"
icon_state = "vermouthbottle"
New()
..()
reagents.add_reagent("vermouth", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/kahlua
name = "Robert Robust's Coffee Liqueur"
desc = "A widely known, Mexican coffee-flavoured liqueur. In production since 1936, HONK"
icon_state = "kahluabottle"
New()
..()
reagents.add_reagent("kahlua", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/goldschlager
name = "College Girl Goldschlager"
desc = "Because they are the only ones who will drink 100 proof cinnamon schnapps."
icon_state = "goldschlagerbottle"
New()
..()
reagents.add_reagent("goldschlager", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/cognac
name = "Chateau De Baton Premium Cognac"
desc = "A sweet and strongly alchoholic drink, made after numerous distillations and years of maturing. You might as well not scream 'SHITCURITY' this time."
icon_state = "cognacbottle"
New()
..()
reagents.add_reagent("cognac", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/wine
name = "Doublebeard Bearded Special Wine"
desc = "A faint aura of unease and asspainery surrounds the bottle."
icon_state = "winebottle"
New()
..()
reagents.add_reagent("wine", 100)
//////////////////////////JUICES AND STUFF ///////////////////////
/obj/item/weapon/reagent_containers/food/drinks/bottle/orangejuice
name = "Orange Juice"
desc = "Full of vitamins and deliciousness!"
icon_state = "orangejuice"
item_state = "carton"
isGlass = 0
New()
..()
reagents.add_reagent("orangejuice", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/cream
name = "Milk Cream"
desc = "It's cream. Made from milk. What else did you think you'd find in there?"
icon_state = "cream"
item_state = "carton"
isGlass = 0
New()
..()
reagents.add_reagent("cream", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/tomatojuice
name = "Tomato Juice"
desc = "Well, at least it LOOKS like tomato juice. You can't tell with all that redness."
icon_state = "tomatojuice"
item_state = "carton"
isGlass = 0
New()
..()
reagents.add_reagent("tomatojuice", 100)
/obj/item/weapon/reagent_containers/food/drinks/bottle/limejuice
name = "Lime Juice"
desc = "Sweet-sour goodness."
icon_state = "limejuice"
item_state = "carton"
isGlass = 0
New()
..()
reagents.add_reagent("limejuice", 100)

View File

@@ -0,0 +1,446 @@
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass
name = "glass"
desc = "Your standard drinking glass."
icon_state = "glass_empty"
amount_per_transfer_from_this = 10
volume = 50
on_reagent_change()
/*if(reagents.reagent_list.len > 1 )
icon_state = "glass_brown"
name = "Glass of Hooch"
desc = "Two or more drinks, mixed together."*/
/*else if(reagents.reagent_list.len == 1)
for(var/datum/reagent/R in reagents.reagent_list)
switch(R.id)*/
if (reagents.reagent_list.len > 0)
//mrid = R.get_master_reagent_id()
switch(reagents.get_master_reagent_id())
if("beer")
icon_state = "beerglass"
name = "Beer glass"
desc = "A freezing pint of beer"
if("beer2")
icon_state = "beerglass"
name = "Beer glass"
desc = "A freezing pint of beer"
if("ale")
icon_state = "aleglass"
name = "Ale glass"
desc = "A freezing pint of delicious Ale"
if("milk")
icon_state = "glass_white"
name = "Glass of milk"
desc = "White and nutritious goodness!"
if("cream")
icon_state = "glass_white"
name = "Glass of cream"
desc = "Ewwww..."
if("chocolate")
icon_state = "chocolateglass"
name = "Glass of chocolate"
desc = "Tasty"
if("lemon")
icon_state = "lemonglass"
name = "Glass of lemon"
desc = "Sour..."
if("cola")
icon_state = "glass_brown"
name = "Glass of Space Cola"
desc = "A glass of refreshing Space Cola"
if("nuka_cola")
icon_state = "nuka_colaglass"
name = "Nuka Cola"
desc = "Don't cry, Don't raise your eye, It's only nuclear wasteland"
if("orangejuice")
icon_state = "glass_orange"
name = "Glass of Orange juice"
desc = "Vitamins! Yay!"
if("tomatojuice")
icon_state = "glass_red"
name = "Glass of Tomato juice"
desc = "Are you sure this is tomato juice?"
if("blood")
icon_state = "glass_red"
name = "Glass of Tomato juice"
desc = "Are you sure this is tomato juice?"
if("limejuice")
icon_state = "glass_green"
name = "Glass of Lime juice"
desc = "A glass of sweet-sour lime juice."
if("whiskey")
icon_state = "whiskeyglass"
name = "Glass of whiskey"
desc = "The silky, smokey whiskey goodness inside the glass makes the drink look very classy."
if("gin")
icon_state = "ginvodkaglass"
name = "Glass of gin"
desc = "A crystal clear glass of Griffeater gin."
if("vodka")
icon_state = "ginvodkaglass"
name = "Glass of vodka"
desc = "The glass contain wodka. Xynta."
if("goldschlager")
icon_state = "ginvodkaglass"
name = "Glass of goldschlager"
desc = "100 proof that teen girls will drink anything with gold in it."
if("wine")
icon_state = "wineglass"
name = "Glass of wine"
desc = "A very classy looking drink."
if("cognac")
icon_state = "cognacglass"
name = "Glass of cognac"
desc = "Damn, you feel like some kind of French aristocrat just by holding this."
if ("kahlua")
icon_state = "kahluaglass"
name = "Glass of RR coffee Liquor"
desc = "DAMN, THIS THING LOOKS ROBUST"
if("vermouth")
icon_state = "vermouthglass"
name = "Glass of Vermouth"
desc = "You wonder why you're even drinking this straight."
if("tequilla")
icon_state = "tequillaglass"
name = "Glass of Tequilla"
desc = "Now all that's missing is the weird colored shades!"
if("patron")
icon_state = "patronglass"
name = "Glass of Patron"
desc = "Drinking patron in the bar, with all the subpar ladies."
if("rum")
icon_state = "rumglass"
name = "Glass of Rum"
desc = "Now you want to Pray for a pirate suit, don't you?"
if("gintonic")
icon_state = "gintonicglass"
name = "Gin and Tonic"
desc = "A mild but still great cocktail. Drink up, like a true Englishman."
if("whiskeycola")
icon_state = "whiskeycolaglass"
name = "Whiskey Cola"
desc = "An innocent-looking mixture of cola and Whiskey. Delicious."
if("whiterussian")
icon_state = "whiterussianglass"
name = "White Russian"
desc = "A very nice looking drink. But that's just, like, your opinion, man."
if("screwdrivercocktail")
icon_state = "screwdriverglass"
name = "Screwdriver"
desc = "A simple, yet superb mixture of Vodka and orange juice. Just the thing for the tired engineer."
if("bloodymary")
icon_state = "bloodymaryglass"
name = "Bloody Mary"
desc = "Tomato juice, mixed with Vodka and a lil' bit of lime. Tastes like liquid murder."
if("martini")
icon_state = "martiniglass"
name = "Classic Martini"
desc = "Damn, the bartender even stirred it, not shook it."
if("vodkamartini")
icon_state = "martiniglass"
name = "Vodka martini"
desc ="A bastardisation of the classic martini. Still great."
if("gargleblaster")
icon_state = "gargleblasterglass"
name = "Pan-Galactic Gargle Blaster"
desc = "Does... does this mean that Arthur and Ford are on the station? Oh joy."
if("bravebull")
icon_state = "bravebullglass"
name = "Brave Bull"
desc = "Tequilla and Coffee liquor, brought together in a mouthwatering mixture. Drink up."
if("tequillasunrise")
icon_state = "tequillasunriseglass"
name = "Tequilla Sunrise"
desc = "Oh great, now you feel nostalgic about sunrises back on Terra..."
if("toxinsspecial")
icon_state = "toxinsspecialglass"
name = "Toxins Special"
desc = "Whoah, this thing is on FIRE"
if("beepskysmash")
icon_state = "beepskysmashglass"
name = "Beepsky Smash"
desc = "Heavy, hot and strong. Just like the Iron fist of the LAW."
if("doctorsdelight")
icon_state = "doctorsdelightglass"
name = "Doctor's Delight"
desc = "A healthy mixture of juices, guaranteed to keep you healthy until the next toolboxing takes place."
if("manlydorf")
icon_state = "manlydorfglass"
name = "The Manly Dorf"
desc = "A manly concotion made from Ale and Beer. Intended for true men only."
if("irishcream")
icon_state = "irishcreamglass"
name = "Irish Cream"
desc = "It's cream, mixed with whiskey. What else would you expect from the Irish?"
if("cubalibre")
icon_state = "cubalibreglass"
name = "Cuba Libre"
desc = "A classic mix of rum and cola."
if("b52")
icon_state = "b52glass"
name = "B-52"
desc = "Kahlua, Irish Cream, and congac. You will get bombed."
if("atomicbomb")
icon_state = "atomicbombglass"
name = "Atomic Bomb"
desc = "Nanotrasen cannot take legal responsibility for your actions after imbibing."
if("longislandicedtea")
icon_state = "longislandicedteaglass"
name = "Long Island Iced Tea"
desc = "The liquor cabinet, brought together in a delicious mix. Intended for middle-aged alcoholic women only."
if("threemileisland")
icon_state = "threemileislandglass"
name = "Three Mile Island Ice Tea"
desc = "A glass of this is sure to prevent a meltdown."
if("margarita")
icon_state = "margaritaglass"
name = "Margarita"
desc = "On the rocks with salt on the rim. Arriba~!"
if("blackrussian")
icon_state = "blackrussianglass"
name = "Black Russian"
desc = "For the lactose-intolerant. Still as classy as a White Russian."
if("vodkatonic")
icon_state = "vodkatonicglass"
name = "Vodka and Tonic"
desc = "For when a gin and tonic isn't russian enough."
if("manhattan")
icon_state = "manhattanglass"
name = "Manhattan"
desc = "The Detective's undercover drink of choice. He never could stomach gin..."
if("manhattan_proj")
icon_state = "proj_manhattanglass"
name = "Manhattan Project"
desc = "A scienitst drink of choice, for thinking how to blow up the station."
if("ginfizz")
icon_state = "ginfizzglass"
name = "Gin Fizz"
desc = "Refreshingly lemony, deliciously dry."
if("irishcoffee")
icon_state = "irishcoffeeglass"
name = "Irish Coffee"
desc = "Coffee and alcohol. More fun than a Mimosa to drink in the morning."
if("hooch")
icon_state = "glass_brown2"
name = "Hooch"
desc = "You've really hit rock bottom now... your liver packed its bags and left last night."
if("whiskeysoda")
icon_state = "whiskeysodaglass2"
name = "Whiskey Soda"
desc = "Ultimate refreshment."
if("tonic")
icon_state = "glass_clear"
name = "Glass of Tonic Water"
desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away."
if("sodawater")
icon_state = "glass_clear"
name = "Glass of Soda Water"
desc = "Soda water. Why not make a scotch and soda?"
if("water")
icon_state = "glass_clear"
name = "Glass of Water"
desc = "The father of all refreshments."
if("spacemountainwind")
icon_state = "Space_mountain_wind_glass"
name = "Glass of Space Mountain Wind"
desc = "Space Mountain Wind. As you know, there are no mountains in space, only wind."
if("thirteenloko")
icon_state = "thirteen_loko_glass"
name = "Glass of Thirteen Loko"
desc = "This is a glass of Thirteen Loko, it appears to be of the highest quality. The drink, not the glass"
if("dr_gibb")
icon_state = "dr_gibb_glass"
name = "Glass of Dr. Gibb"
desc = "Dr. Gibb. Not as dangerous as the name might imply."
if("space_up")
icon_state = "space-up_glass"
name = "Glass of Space-up"
desc = "Space-up. It helps keep your cool."
if("moonshine")
icon_state = "glass_clear"
name = "Moonshine"
desc = "You've really hit rock bottom now... your liver packed its bags and left last night."
if("soymilk")
icon_state = "glass_white"
name = "Glass of soy milk"
desc = "White and nutritious soy goodness!"
if("berryjuice")
icon_state = "berryjuice"
name = "Glass of berry juice"
desc = "Berry juice. Or maybe its jam. Who cares?"
if("poisonberryjuice")
icon_state = "poisonberryjuice"
name = "Glass of poison berry juice"
desc = "A glass of deadly juice."
if("carrotjuice")
icon_state = "carrotjuice"
name = "Glass of carrot juice"
desc = "It is just like a carrot but without crunching."
if("banana")
icon_state = "banana"
name = "Glass of banana juice"
desc = "The raw essence of a banana. HONK"
if("bahama_mama")
icon_state = "bahama_mama"
name = "Bahama Mama"
desc = "Tropic cocktail"
if("singulo")
icon_state = "singulo"
name = "Singulo"
desc = "A blue-space beverage."
if("alliescocktail")
icon_state = "alliescocktail"
name = "Allies cocktail"
desc = "A drink made from your allies."
if("antifreeze")
icon_state = "antifreeze"
name = "Anti-freeze"
desc = "The ultimate refreshment."
if("barefoot")
icon_state = "b&p"
name = "Barefoot"
desc = "Barefoot and pregnant"
if("demonsblood")
icon_state = "demonsblood"
name = "Demons Blood"
desc = "Just looking at this thing makes the hair at the back of your neck stand up."
if("booger")
icon_state = "booger"
name = "Booger"
desc = "Ewww..."
if("snowwhite")
icon_state = "snowwhite"
name = "Snow White"
desc = "A cold refreshment."
if("aloe")
icon_state = "aloe"
name = "Aloe"
desc = "Very, very, very good."
if("andalusia")
icon_state = "andalusia"
name = "Andalusia"
desc = "A nice, strange named drink."
if("sbiten")
icon_state = "sbitenglass"
name = "Sbiten"
desc = "A spicy mix of Vodka and Spice. Very hot."
if("red_mead")
icon_state = "red_meadglass"
name = "Red Mead"
desc = "A True Vikings Beverage, though its color is strange."
if("mead")
icon_state = "meadglass"
name = "Mead"
desc = "A Vikings Beverage, though a cheap one."
if("iced_beer")
icon_state = "iced_beerglass"
name = "Iced Beer"
desc = "A beer so frosty, the air around it freezes."
if("grog")
icon_state = "grogglass"
name = "Grog"
desc = "A fine and cepa drink for Space."
if("soy_latte")
icon_state = "soy_latte"
name = "Soy Latte"
desc = "A nice and refrshing beverage while you are reading."
if("cafe_latte")
icon_state = "cafe_latte"
name = "Cafe Latte"
desc = "A nice, strong and refreshing beverage while you are reading."
if("acidspit")
icon_state = "acidspitglass"
name = "Acid Spit"
desc = "A drink from Nanotrasen. Made from live aliens."
if("amasec")
icon_state = "amasecglass"
name = "Amasec"
desc = "Always handy before COMBAT!!!"
if("neurotoxin")
icon_state = "neurotoxinglass"
name = "Neurotoxin"
desc = "A drink that is guaranteed to knock you silly."
if("hippiesdelight")
icon_state = "hippiesdelightglass"
name = "Hippie's Delight"
desc = "A drink enjoyed by people during the 1960's."
if("bananahonk")
icon_state = "bananahonkglass"
name = "Banana Honk"
desc = "A drink from Clown Heaven."
if("silencer")
icon_state = "silencerglass"
name = "Silencer"
desc = "A drink from mime Heaven."
if("nothing")
icon_state = "nothing"
name = "Nothing"
desc = "Absolutely nothing."
if("devilskiss")
icon_state = "devilskiss"
name = "Devils Kiss"
desc = "Creepy time!"
if("changelingsting")
icon_state = "changelingsting"
name = "Changeling Sting"
desc = "A stingy drink."
if("irishcarbomb")
icon_state = "irishcarbomb"
name = "Irish Car Bomb"
desc = "An irish car bomb."
if("syndicatebomb")
icon_state = "syndicatebomb"
name = "Syndicate Bomb"
desc = "A syndicate bomb."
if("erikasurprise")
icon_state = "erikasurprise"
name = "Erika Surprise"
desc = "The surprise is, it's green!"
if("driestmartini")
icon_state = "driestmartiniglass"
name = "Driest Martini"
desc = "Only for the experienced. You think you see sand floating in the glass."
if("ice")
icon_state = "iceglass"
name = "Glass of ice"
desc = "Generally, you're supposed to put something else in there too..."
if("icecoffee")
icon_state = "icedcoffeeglass"
name = "Iced Coffee"
desc = "A drink to perk you up and refresh you!"
if("coffee")
icon_state = "glass_brown"
name = "Glass of coffee"
desc = "Don't drop it, or you'll send scalding liquid and glass shards everywhere."
if("bilk")
icon_state = "glass_brown"
name = "Glass of bilk"
desc = "A brew of milk and beer. For those alcoholics who fear osteoporosis."
if("fuel")
icon_state = "dr_gibb_glass"
name = "Glass of welder fuel"
desc = "Unless you are an industrial tool, this is probably not safe for consumption."
else
icon_state ="glass_brown"
name = "Glass of ..what?"
desc = "You can't really tell what this is."
else
icon_state = "glass_empty"
name = "Drinking glass"
desc = "Your standard drinking glass"
return
// for /obj/machinery/vending/sovietsoda
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda
New()
..()
reagents.add_reagent("sodawater", 50)
on_reagent_change()
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola
New()
..()
reagents.add_reagent("cola", 50)
on_reagent_change()

View File

@@ -0,0 +1,29 @@
///jar
/obj/item/weapon/reagent_containers/food/drinks/jar
name = "empty jar"
desc = "A jar. You're not sure what it's supposed to hold."
icon_state = "jar"
item_state = "beaker"
New()
..()
reagents.add_reagent("metroid", 50)
on_reagent_change()
if (reagents.reagent_list.len > 0)
switch(reagents.get_master_reagent_id())
if("metroid")
icon_state = "jar_metroid"
name = "metroid jam"
desc = "A jar of metroid jam. Delicious!"
else
icon_state ="jar_what"
name = "jar of something"
desc = "You can't really tell what this is."
else
icon_state = "jar"
name = "empty jar"
desc = "A jar. You're not sure what it's supposed to hold."
return

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,925 @@
// ***********************************************************
// Foods that are produced from hydroponics ~~~~~~~~~~
// Data from the seeds carry over to these grown foods
// ***********************************************************
//Grown foods
//Subclass so we can pass on values
/obj/item/weapon/reagent_containers/food/snacks/grown/
var/seed = ""
var/plantname = ""
var/productname = ""
var/species = ""
var/lifespan = 0
var/endurance = 0
var/maturation = 0
var/production = 0
var/yield = 0
var/potency = -1
var/plant_type = 0
icon = 'icons/obj/harvest.dmi'
New(newloc,newpotency)
if (!isnull(newpotency))
potency = newpotency
..()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/O as obj, var/mob/user as mob)
..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
var/msg
msg = "<span class='info'>*---------*\n This is \a <span class='name'>[src]</span>\n"
switch(plant_type)
if(0)
msg += "- Plant type: <i>Normal plant</i>\n"
if(1)
msg += "- Plant type: <i>Weed</i>\n"
if(2)
msg += "- Plant type: <i>Mushroom</i>\n"
msg += "- Potency: <i>[potency]</i>\n"
msg += "- Yield: <i>[yield]</i>\n"
msg += "- Maturation speed: <i>[maturation]</i>\n"
msg += "- Production speed: <i>[production]</i>\n"
msg += "- Endurance: <i>[endurance]</i>\n"
msg += "- Healing properties: <i>[reagents.get_reagent_amount("nutriment")]</i>\n"
msg += "*---------*</span>"
usr << msg
return
if (istype(O, /obj/item/weapon/plantbag))
var/obj/item/weapon/plantbag/S = O
if (S.mode == 1)
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(src.x,src.y,src.z))
if (S.contents.len < S.capacity)
S.contents += G;
else
user << "\blue The plant bag is full."
return
user << "\blue You pick up all the plants."
else
if (S.contents.len < S.capacity)
S.contents += src;
else
user << "\blue The plant bag is full."
return
/obj/item/weapon/grown/attackby(var/obj/item/O as obj, var/mob/user as mob)
..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
var/msg
msg = "<span class='info'>*---------*\n This is \a <span class='name'>[src]</span>\n"
switch(plant_type)
if(0)
msg += "- Plant type: <i>Normal plant</i>\n"
if(1)
msg += "- Plant type: <i>Weed</i>\n"
if(2)
msg += "- Plant type: <i>Mushroom</i>\n"
msg += "- Acid strength: <i>[potency]</i>\n"
msg += "- Yield: <i>[yield]</i>\n"
msg += "- Maturation speed: <i>[maturation]</i>\n"
msg += "- Production speed: <i>[production]</i>\n"
msg += "- Endurance: <i>[endurance]</i>\n"
msg += "*---------*</span>"
usr << msg
return
/obj/item/weapon/reagent_containers/food/snacks/grown/corn
seed = "/obj/item/seeds/cornseed"
name = "ear of corn"
desc = "Needs some butter!"
icon_state = "corn"
potency = 40
trash = /obj/item/weapon/corncob
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/poppy
seed = "/obj/item/seeds/poppyseed"
name = "poppy"
desc = "Long-used as a symbol of rest, peace, and death."
icon_state = "poppy"
potency = 30
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
reagents.add_reagent("bicaridine", 1+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 3, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/harebell
seed = "obj/item/seeds/harebellseed"
name = "harebell"
desc = "\"I'll sweeten thy sad grave: thou shalt not lack the flower that's like thy face, pale primrose, nor the azured hare-bell, like thy veins; no, nor the leaf of eglantine, whom not to slander, out-sweeten<65>d not thy breath.\""
icon_state = "harebell"
potency = 1
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
bitesize = 1+round(reagents.total_volume / 3, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/potato
seed = "/obj/item/seeds/potatoseed"
name = "potato"
desc = "Boil 'em! Mash 'em! Stick 'em in a stew!"
icon_state = "potato"
potency = 25
New()
..()
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
spawn(5) //So potency can be set in the proc that creates these crops
bitesize = reagents.total_volume
/obj/item/weapon/reagent_containers/food/snacks/grown/potato/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/cable_coil))
if(W:amount >= 5)
W:amount -= 5
if(!W:amount) del(W)
user << "<span class='notice'>You add some cable to the potato and slide it inside the battery encasing.</span>"
new /obj/item/weapon/cell/potato(user.loc)
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes
seed = "/obj/item/seeds/grapeseed"
name = "bunch of grapes"
desc = "Nutritious!"
icon_state = "grapes"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
reagents.add_reagent("sugar", 1+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes
seed = "/obj/item/seeds/greengrapeseed"
name = "bunch of green grapes"
desc = "Nutritious!"
icon_state = "greengrapes"
potency = 25
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
reagents.add_reagent("kelotane", 3+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage
seed = "/obj/item/seeds/cabbageseed"
name = "cabbage"
desc = "Ewwwwwwwwww. Cabbage."
icon_state = "cabbage"
potency = 25
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
bitesize = reagents.total_volume
/obj/item/weapon/reagent_containers/food/snacks/grown/berries
seed = "/obj/item/seeds/berryseed"
name = "bunch of berries"
desc = "Nutritious!"
icon_state = "berrypile"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries
seed = "/obj/item/seeds/glowberryseed"
name = "bunch of glow-berries"
desc = "Nutritious!"
var/on = 1
var/brightness_on = 2 //luminosity when on
icon_state = "glowberrypile"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", round((potency / 10), 1))
reagents.add_reagent("radium", 3+round(potency / 5, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/Del()
if(istype(loc,/mob))
loc.sd_SetLuminosity(loc.luminosity - potency/5)
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/pickup(mob/user)
src.sd_SetLuminosity(0)
user.total_luminosity += potency/5
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/dropped(mob/user)
user.total_luminosity -= potency/5
src.sd_SetLuminosity(potency/5)
/obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod
seed = "/obj/item/seeds/cocoapodseed"
name = "cocoa pod"
desc = "Fattening... Mmmmm... chucklate."
icon_state = "cocoapod"
potency = 50
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
reagents.add_reagent("coco", 4+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/sugarcane
seed = "/obj/item/seeds/sugarcaneseed"
name = "sugarcane"
desc = "Sickly sweet."
icon_state = "sugarcane"
potency = 50
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("sugar", 4+round((potency / 5), 1))
/obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries
seed = "/obj/item/seeds/poisonberryseed"
name = "bunch of poison-berries"
desc = "Taste so good, you could die!"
icon_state = "poisonberrypile"
gender = PLURAL
potency = 15
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1)
reagents.add_reagent("toxin", 3+round(potency / 5, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/deathberries
seed = "/obj/item/seeds/deathberryseed"
name = "bunch of death-berries"
desc = "Taste so good, you could die!"
icon_state = "deathberrypile"
gender = PLURAL
potency = 50
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1)
reagents.add_reagent("toxin", 3+round(potency / 3, 1))
reagents.add_reagent("lexorin", 1+round(potency / 5, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
seed = "/obj/item/seeds/ambrosiavulgaris"
name = "ambrosia vulgaris branch"
desc = "This is a plant containing various healing chemicals."
icon_state = "ambrosiavulgaris"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1)
reagents.add_reagent("space_drugs", 1+round(potency / 8, 1))
reagents.add_reagent("kelotane", 1+round(potency / 8, 1))
reagents.add_reagent("bicaridine", 1+round(potency / 10, 1))
reagents.add_reagent("toxin", 1+round(potency / 10, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus
seed = "/obj/item/seeds/ambrosiadeus"
name = "ambrosia deus branch"
desc = "Eating this makes you feel immortal!"
icon_state = "ambrosiadeus"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1)
reagents.add_reagent("bicaridine", 1+round(potency / 8, 1))
reagents.add_reagent("synaptizine", 1+round(potency / 8, 1))
reagents.add_reagent("hyperzine", 1+round(potency / 10, 1))
reagents.add_reagent("space_drugs", 1+round(potency / 10, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/apple
seed = "/obj/item/seeds/appleseed"
name = "apple"
desc = "It's a little piece of Eden."
icon_state = "apple"
potency = 15
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/goldapple
seed = "/obj/item/seeds/goldappleseed"
name = "golden apple"
desc = "Emblazoned upon the apple is the word 'Kallisti'."
icon_state = "goldapple"
potency = 15
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
reagents.add_reagent("gold", 1+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap/attackby(var/obj/item/O as obj, var/mob/user as mob)
. = ..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='info'>- Mineral Content: <i>[reagents.get_reagent_amount("gold")]%</i></span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon
seed = "/obj/item/seeds/watermelonseed"
name = "watermelon"
desc = "It's full of watery goodness."
icon_state = "watermelon"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 6), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin
seed = "/obj/item/seeds/pumpkinseed"
name = "pumpkin"
desc = "It's large and scary."
icon_state = "pumpkin"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 6), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/twohanded/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/melee/energy))
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
new /obj/item/clothing/head/pumpkinhead (user.loc)
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/lime
seed = "/obj/item/seeds/limeseed"
name = "lime"
desc = "It's so sour, your face will twist."
icon_state = "lime"
potency = 20
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon
seed = "/obj/item/seeds/lemonseed"
name = "lemon"
desc = "When life gives you lemons, be grateful they aren't limes."
icon_state = "lemon"
potency = 20
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/orange
seed = "/obj/item/seeds/orangeseed"
name = "orange"
desc = "It's an tangy fruit."
icon_state = "orange"
potency = 20
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/whitebeet
seed = "/obj/item/seeds/whitebeetseed"
name = "white-beet"
desc = "You can't beat white-beet."
icon_state = "whitebeet"
potency = 15
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", round((potency / 20), 1))
reagents.add_reagent("sugar", 1+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/banana
seed = "/obj/item/seeds/bananaseed"
name = "banana"
desc = "It's an excellent prop for a clown."
icon = 'icons/obj/items.dmi'
icon_state = "banana"
item_state = "banana"
trash = /obj/item/weapon/bananapeel
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("banana", 1+round((potency / 10), 1))
bitesize = 5
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
/obj/item/weapon/reagent_containers/food/snacks/grown/chili
seed = "/obj/item/seeds/chiliseed"
name = "chili"
desc = "It's spicy! Wait... IT'S BURNING ME!!"
icon_state = "chilipepper"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 25), 1))
reagents.add_reagent("capsaicin", 3+round(potency / 5, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/chili/attackby(var/obj/item/O as obj, var/mob/user as mob)
. = ..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='info'>- Capsaicin: <i>[reagents.get_reagent_amount("capsaicin")]%</i></span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant
seed = "/obj/item/seeds/eggplantseed"
name = "eggplant"
desc = "Maybe there's a chicken inside?"
icon_state = "eggplant"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans
seed = "/obj/item/seeds/soyaseed"
name = "soybeans"
desc = "It's pretty bland, but oh the possibilities..."
gender = PLURAL
icon_state = "soybeans"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato
seed = "/obj/item/seeds/tomatoseed"
name = "tomato"
desc = "I say to-mah-to, you say tom-mae-to."
icon_state = "tomato"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
throw_impact(atom/hit_atom)
..()
new/obj/effect/decal/cleanable/tomato_smudge(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/killertomato
seed = "/obj/item/seeds/killertomatoseed"
name = "killer-tomato"
desc = "I say to-mah-to, you say tom-mae-to... OH GOD IT'S EATING MY LEGS!!"
icon_state = "killertomato"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
if(istype(src.loc,/mob))
pickup(src.loc)
lifespan = 120
endurance = 30
maturation = 15
production = 1
yield = 3
potency = 30
plant_type = 2
/obj/item/weapon/reagent_containers/food/snacks/grown/killertomato/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
new /mob/living/simple_animal/tomato(user.loc)
del(src)
user << "<span class='notice'>You plant the killer-tomato.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/bloodtomato
seed = "/obj/item/seeds/bloodtomatoseed"
name = "blood-tomato"
desc = "So bloody...so...very...bloody....AHHHH!!!!"
icon_state = "bloodtomato"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 10), 1))
reagents.add_reagent("blood", 1+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
throw_impact(atom/hit_atom)
..()
new/obj/effect/decal/cleanable/blood/splatter(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
src.reagents.reaction(get_turf(hit_atom))
for(var/atom/A in get_turf(hit_atom))
src.reagents.reaction(A)
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato
seed = "/obj/item/seeds/bluetomatoseed"
name = "blue-tomato"
desc = "I say blue-mah-to, you say blue-mae-to."
icon_state = "bluetomato"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
reagents.add_reagent("lube", 1+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
throw_impact(atom/hit_atom)
..()
new/obj/effect/decal/cleanable/oil(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
src.reagents.reaction(get_turf(hit_atom))
for(var/atom/A in get_turf(hit_atom))
src.reagents.reaction(A)
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/bluetomato/HasEntered(AM as mob|obj)
if (istype(AM, /mob/living/carbon))
var/mob/M = AM
if (istype(M, /mob/living/carbon/human) && (isobj(M:shoes) && M:shoes.flags&NOSLIP))
return
M.stop_pulling()
M << "\blue You slipped on the [name]!"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(8)
M.Weaken(5)
/obj/item/weapon/reagent_containers/food/snacks/grown/wheat
seed = "/obj/item/seeds/wheatseed"
name = "wheat"
desc = "Sigh... wheat... a-grain?"
gender = PLURAL
icon_state = "wheat"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 25), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper
seed = "/obj/item/seeds/icepepperseed"
name = "ice-pepper"
desc = "It's a mutant strain of chili"
icon_state = "icepepper"
potency = 20
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 50), 1))
reagents.add_reagent("frostoil", 3+round(potency / 5, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper/attackby(var/obj/item/O as obj, var/mob/user as mob)
. = ..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='info'>- Frostoil: <i>[reagents.get_reagent_amount("frostoil")]%</i></span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot
seed = "/obj/item/seeds/carrotseed"
name = "carrot"
desc = "It's good for the eyes!"
icon_state = "carrot"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
reagents.add_reagent("imidazoline", 3+round(potency / 5, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/reishi
seed = "/obj/item/seeds/reishimycelium"
name = "reishi"
desc = "<I>Ganoderma lucidum</I>: A special fungus believed to help relieve stress."
icon_state = "reishi"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1)
reagents.add_reagent("stoxin", 3+round(potency / 3, 1))
reagents.add_reagent("space_drugs", 1+round(potency / 25, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/reishi/attackby(var/obj/item/O as obj, var/mob/user as mob)
. = ..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='info'>- Sleep Toxin: <i>[reagents.get_reagent_amount("stoxin")]%</i></span>"
user << "<span class='info'>- Space Drugs: <i>[reagents.get_reagent_amount("space_drugs")]%</i></span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita
seed = "/obj/item/seeds/amanitamycelium"
name = "fly amanita"
desc = "<I>Amanita Muscaria</I>: Learn poisonous mushrooms by heart. Only pick mushrooms you know."
icon_state = "amanita"
potency = 10
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1)
reagents.add_reagent("amatoxin", 3+round(potency / 3, 1))
reagents.add_reagent("psilocybin", 1+round(potency / 25, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita/attackby(var/obj/item/O as obj, var/mob/user as mob)
. = ..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='info'>- Amatoxins: <i>[reagents.get_reagent_amount("amatoxin")]%</i></span>"
user << "<span class='info'>- Psilocybin: <i>[reagents.get_reagent_amount("psilocybin")]%</i></span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel
seed = "/obj/item/seeds/angelmycelium"
name = "destroying angel"
desc = "<I>Amanita Virosa</I>: Deadly poisonous basidiomycete fungus filled with alpha amatoxins."
icon_state = "angel"
potency = 35
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 50), 1))
reagents.add_reagent("amatoxin", 13+round(potency / 3, 1))
reagents.add_reagent("psilocybin", 1+round(potency / 25, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/angel/attackby(var/obj/item/O as obj, var/mob/user as mob)
. = ..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='info'>- Amatoxins: <i>[reagents.get_reagent_amount("amatoxin")]%</i></span>"
user << "<span class='info'>- Psilocybin: <i>[reagents.get_reagent_amount("psilocybin")]%</i></span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap
seed = "/obj/item/seeds/libertymycelium"
name = "liberty-cap"
desc = "<I>Psilocybe Semilanceata</I>: Liberate yourself!"
icon_state = "libertycap"
potency = 15
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 50), 1))
reagents.add_reagent("psilocybin", 3+round(potency / 5, 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap/attackby(var/obj/item/O as obj, var/mob/user as mob)
. = ..()
if (istype(O, /obj/item/device/analyzer/plant_analyzer))
user << "<span class='info'>- Psilocybin: <i>[reagents.get_reagent_amount("psilocybin")]%</i></span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet
seed = "/obj/item/seeds/plumpmycelium"
name = "plump-helmet"
desc = "<I>Plumus Hellmus</I>: Plump, soft and s-so inviting~"
icon_state = "plumphelmet"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 2+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom
seed = "/obj/item/seeds/walkingmushroom"
name = "walking mushroom"
desc = "<I>Plumus Locomotus</I>: The beginning of the great walk."
icon_state = "walkingmushroom"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 2+round((potency / 10), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
if(istype(src.loc,/mob))
pickup(src.loc)
lifespan = 120
endurance = 30
maturation = 15
production = 1
yield = 3
potency = 30
plant_type = 2
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/walkingmushroom/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
new /mob/living/simple_animal/mushroom(user.loc)
del(src)
user << "<span class='notice'>You plant the walking mushroom.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle
seed = "/obj/item/seeds/chantermycelium"
name = "chanterelle cluster"
desc = "<I>Cantharellus Cibarius</I>: These jolly yellow little shrooms sure look tasty!"
icon_state = "chanterelle"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment",1+round((potency / 25), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom
seed = "/obj/item/seeds/glowshroom"
name = "glowshroom cluster"
desc = "<I>Mycena Bregprox</I>: This species of mushroom glows in the dark. Or does it?"
icon_state = "glowshroom"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("radium",1+round((potency / 20), 1))
if(istype(src.loc,/mob))
pickup(src.loc)
else
src.sd_SetLuminosity(potency/10)
lifespan = 120 //ten times that is the delay
endurance = 30
maturation = 15
production = 1
yield = 3
potency = 30
plant_type = 2
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/attack_self(mob/user as mob)
if(istype(user.loc,/turf/space))
return
var/obj/effect/glowshroom/planted = new /obj/effect/glowshroom(user.loc)
planted.delay = lifespan * 50
planted.endurance = endurance
planted.yield = yield
planted.potency = potency
del(src)
user << "<span class='notice'>You plant the glowshroom.</span>"
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/Del()
if(istype(loc,/mob))
loc.sd_SetLuminosity(loc.luminosity - potency/10)
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user)
src.sd_SetLuminosity(0)
user.total_luminosity += potency/10
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
user.total_luminosity -= potency/10
src.sd_SetLuminosity(potency/10)
// *************************************
// Complex Grown Object Defines -
// Putting these at the bottom so they don't clutter the list up. -Cheridan
// *************************************
//This object is just a transition object. All it does is make a grass tile and delete itself.
/obj/item/weapon/reagent_containers/food/snacks/grown/grass
seed = "/obj/item/seeds/grassseed"
name = "grass"
desc = "Green and lush."
icon_state = "spawner"
potency = 20
New()
new/obj/item/stack/tile/grass(src.loc)
spawn(5) //Workaround to keep harvesting from working weirdly.
del(src)
//This object is just a transition object. All it does is make dosh and delete itself. -Cheridan
/obj/item/weapon/reagent_containers/food/snacks/grown/money
seed = "/obj/item/seeds/cashseed"
name = "dosh"
desc = "Green and lush."
icon_state = "spawner"
potency = 10
New()
switch(rand(1,100))//(potency) //It wants to use the default potency instead of the new, so it was always 10. Will try to come back to this later - Cheridan
if(0 to 10)
new/obj/item/weapon/spacecash/(src.loc)
if(11 to 20)
new/obj/item/weapon/spacecash/c10(src.loc)
if(21 to 30)
new/obj/item/weapon/spacecash/c20(src.loc)
if(31 to 40)
new/obj/item/weapon/spacecash/c50(src.loc)
if(41 to 50)
new/obj/item/weapon/spacecash/c100(src.loc)
if(51 to 60)
new/obj/item/weapon/spacecash/c200(src.loc)
if(61 to 80)
new/obj/item/weapon/spacecash/c500(src.loc)
else
new/obj/item/weapon/spacecash/c1000(src.loc)
spawn(5) //Workaround to keep harvesting from working weirdly.
del(src)
/obj/item/weapon/reagent_containers/food/snacks/grown/bluespacetomato
seed = "/obj/item/seeds/bluespacetomatoseed"
name = "blue-space tomato"
desc = "So lubricated, you might slip through space-time."
icon_state = "bluespacetomato"
potency = 20
origin_tech = "bluespace=3"
New()
..()
spawn(5) //So potency can be set in the proc that creates these crops
reagents.add_reagent("nutriment", 1+round((potency / 20), 1))
reagents.add_reagent("singulo", 1+round((potency / 5), 1))
bitesize = 1+round(reagents.total_volume / 2, 1)
throw_impact(atom/hit_atom)
..()
var/mob/M = usr
var/outer_teleport_radius = potency/10 //Plant potency determines radius of teleport.
var/inner_teleport_radius = potency/15
var/list/turfs = new/list()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
if(inner_teleport_radius < 1) //Wasn't potent enough, it just splats.
new/obj/effect/decal/cleanable/oil(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed.</span>","<span class='moderate'>You hear a smack.</span>")
del(src)
return
for(var/turf/T in orange(M,outer_teleport_radius))
if(T in orange(M,inner_teleport_radius)) continue
if(istype(T,/turf/space)) continue
if(T.density) continue
if(T.x>world.maxx-outer_teleport_radius || T.x<outer_teleport_radius) continue
if(T.y>world.maxy-outer_teleport_radius || T.y<outer_teleport_radius) continue
turfs += T
if(!turfs.len)
var/list/turfs_to_pick_from = list()
for(var/turf/T in orange(M,outer_teleport_radius))
if(!(T in orange(M,inner_teleport_radius)))
turfs_to_pick_from += T
turfs += pick(/turf in turfs_to_pick_from)
var/turf/picked = pick(turfs)
if(!isturf(picked)) return
switch(rand(1,2))//Decides randomly to teleport the thrower or the throwee.
if(1) // Teleports the person who threw the tomato.
s.set_up(3, 1, M)
s.start()
new/obj/effect/decal/cleanable/molten_item(M.loc) //Leaves a pile of goo behind for dramatic effect.
M.loc = picked //
sleep(1)
s.set_up(3, 1, M)
s.start() //Two set of sparks, one before the teleport and one after.
if(2) //Teleports mob the tomato hit instead.
for(var/mob/A in get_turf(hit_atom))//For the mobs in the tile that was hit...
s.set_up(3, 1, A)
s.start()
new/obj/effect/decal/cleanable/molten_item(A.loc) //Leave a pile of goo behind for dramatic effect...
A.loc = picked//And teleport them to the chosen location.
sleep(1)
s.set_up(3, 1, A)
s.start()
new/obj/effect/decal/cleanable/oil(src.loc)
src.visible_message("<span class='notice'>The [src.name] has been squashed, causing a distortion in space-time.</span>","<span class='moderate'>You hear a splat and a crackle.</span>")
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon
name = "Watermelon"
icon_state = "A juicy watermelon"
icon_state = "watermelon"
slice_path = /obj/item/weapon/reagent_containers/food/snacks/watermelonslice
slices_num = 5
New()
..()
reagents.add_reagent("nutriment", 10)
bitesize = 2

View File

@@ -0,0 +1,27 @@
/obj/item/weapon/reagent_containers/food/snacks/meat
name = "meat"
desc = "A slab of meat"
icon_state = "meat"
health = 180
New()
..()
reagents.add_reagent("nutriment", 3)
src.bitesize = 3
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
name = "synthetic meat"
desc = "A synthetic slab of flesh."
/obj/item/weapon/reagent_containers/food/snacks/meat/human
name = "-meat"
var/subjectname = ""
var/subjectjob = null
/obj/item/weapon/reagent_containers/food/snacks/meat/monkey
//same as plain meat
/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
name = "Corgi meat"
desc = "Tastes like... well you know..."

View File

@@ -0,0 +1,231 @@
////////////////////////////////////////////////////////////////////////////////
/// (Mixing)Glass.
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/glass
name = " "
desc = " "
icon = 'icons/obj/chemical.dmi'
icon_state = "null"
item_state = "null"
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,50)
volume = 50
flags = FPRINT | TABLEPASS | OPENCONTAINER
var/list/can_be_placed_into = list(
/obj/machinery/chem_master/,
/obj/machinery/chem_dispenser/,
/obj/machinery/reagentgrinder,
/obj/structure/table,
/obj/structure/closet,
/obj/structure/sink,
/obj/item/weapon/storage,
/obj/machinery/atmospherics/unary/cryo_cell,
/obj/item/weapon/grenade/chem_grenade,
/obj/machinery/bot/medbot,
/obj/machinery/computer/pandemic,
/obj/item/weapon/secstorage/ssafe,
/obj/machinery/disposal
)
examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return
usr << "\blue It contains:"
if(reagents && reagents.reagent_list.len)
for(var/datum/reagent/R in reagents.reagent_list)
usr << "\blue [R.volume] units of [R.name]"
else
usr << "\blue Nothing."
afterattack(obj/target, mob/user , flag)
for(var/type in src.can_be_placed_into)
if(istype(target, type))
return
if(ismob(target) && target.reagents && reagents.total_volume)
user << "\blue You splash the solution onto [target]."
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red [] has been splashed with something by []!", target, user), 1)
src.reagents.reaction(target, TOUCH)
spawn(5) src.reagents.clear_reagents()
return
else if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us.
if(!target.reagents.total_volume && target.reagents)
user << "\red [target] is empty."
return
if(reagents.total_volume >= reagents.maximum_volume)
user << "\red [src] is full."
return
var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this)
user << "\blue You fill [src] with [trans] units of the contents of [target]."
else if(target.is_open_container() && target.reagents) //Something like a glass. Player probably wants to transfer TO it.
if(!reagents.total_volume)
user << "\red [src] is empty."
return
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "\red [target] is full."
return
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You transfer [trans] units of the solution to [target]."
//Safety for dumping stuff into a ninja suit. It handles everything through attackby() and this is unnecessary.
else if(istype(target, /obj/item/clothing/suit/space/space_ninja))
return
else if(reagents.total_volume)
user << "\blue You splash the solution onto [target]."
src.reagents.reaction(target, TOUCH)
spawn(5) src.reagents.clear_reagents()
return
////////////////////////////////////////////////////////////////////////////////
/// (Mixing)Glass. END
////////////////////////////////////////////////////////////////////////////////
//Glasses
/obj/item/weapon/reagent_containers/glass/bucket
desc = "It's a bucket."
name = "bucket"
icon = 'icons/obj/janitor.dmi'
icon_state = "bucket"
item_state = "bucket"
m_amt = 200
g_amt = 0
w_class = 3.0
amount_per_transfer_from_this = 20
possible_transfer_amounts = list(10,20,30,50,70)
volume = 70
flags = FPRINT | OPENCONTAINER
attackby(var/obj/D, mob/user as mob)
if(isprox(D))
user << "You add [D] to [src]."
del(D)
user.put_in_hands(new /obj/item/weapon/bucket_sensor)
user.drop_from_inventory(src)
del(src)
/*
/obj/item/weapon/reagent_containers/glass/canister //not used apparantly
desc = "It's a canister. Mainly used for transporting fuel."
name = "canister"
icon = 'icons/obj/tank.dmi'
icon_state = "canister"
item_state = "canister"
m_amt = 300
g_amt = 0
w_class = 4.0
amount_per_transfer_from_this = 20
possible_transfer_amounts = list(10,20,30,60)
volume = 120
flags = FPRINT
*/
/obj/item/weapon/reagent_containers/glass/dispenser
name = "reagent glass"
desc = "A reagent glass."
icon = 'icons/obj/chemical.dmi'
icon_state = "beaker0"
amount_per_transfer_from_this = 10
flags = FPRINT | TABLEPASS | OPENCONTAINER
/obj/item/weapon/reagent_containers/glass/dispenser/surfactant
name = "reagent glass (surfactant)"
icon_state = "liquid"
New()
..()
reagents.add_reagent("fluorosurfactant", 20)
/obj/item/weapon/reagent_containers/glass/beaker
name = "beaker"
desc = "A beaker. Can hold up to 50 units."
icon = 'icons/obj/chemical.dmi'
icon_state = "beaker0"
item_state = "beaker"
m_amt = 0
g_amt = 500
on_reagent_change()
update_icon()
pickup(mob/user)
..()
update_icon()
dropped(mob/user)
..()
update_icon()
attack_hand()
..()
update_icon()
update_icon()
overlays = null
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10", src.layer)
var/percent = round((reagents.total_volume / volume) * 100)
switch(percent)
if(0 to 9) filling.icon_state = "[icon_state]-10"
if(10 to 24) filling.icon_state = "[icon_state]10"
if(25 to 49) filling.icon_state = "[icon_state]25"
if(50 to 74) filling.icon_state = "[icon_state]50"
if(75 to 79) filling.icon_state = "[icon_state]75"
if(80 to 90) filling.icon_state = "[icon_state]80"
if(91 to INFINITY) filling.icon_state = "[icon_state]100"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling
/obj/item/weapon/reagent_containers/glass/beaker/large
name = "large beaker"
desc = "A large beaker. Can hold up to 100 units."
icon_state = "beakerlarge"
g_amt = 5000
volume = 100
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,50,100)
flags = FPRINT | TABLEPASS | OPENCONTAINER
/obj/item/weapon/reagent_containers/glass/blender_jug
name = "Blender Jug"
desc = "A blender jug, part of a blender."
icon = 'icons/obj/kitchen.dmi'
icon_state = "blender_jug_e"
volume = 100
on_reagent_change()
switch(src.reagents.total_volume)
if(0)
icon_state = "blender_jug_e"
if(1 to 75)
icon_state = "blender_jug_h"
if(76 to 100)
icon_state = "blender_jug_f"
/obj/item/weapon/reagent_containers/glass/beaker/cryoxadone
name = "beaker"
desc = "A beaker. Can hold up to 50 units."
icon = 'icons/obj/chemical.dmi'
icon_state = "beaker0"
item_state = "beaker"
New()
..()
reagents.add_reagent("cryoxadone", 30)

View File

@@ -0,0 +1,255 @@
//Not to be confused with /obj/item/weapon/reagent_containers/food/drinks/bottle
/obj/item/weapon/reagent_containers/glass/bottle
name = "bottle"
desc = "A small bottle."
icon = 'icons/obj/chemical.dmi'
icon_state = null
item_state = "atoxinbottle"
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30)
flags = FPRINT | TABLEPASS | OPENCONTAINER
volume = 30
New()
..()
if(!icon_state)
icon_state = "bottle[rand(1,20)]"
/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline
name = "inaprovaline bottle"
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
New()
..()
reagents.add_reagent("inaprovaline", 30)
/obj/item/weapon/reagent_containers/glass/bottle/toxin
name = "toxin bottle"
desc = "A small bottle of toxins. Do not drink, it is poisonous."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle12"
New()
..()
reagents.add_reagent("toxin", 30)
/obj/item/weapon/reagent_containers/glass/bottle/cyanide
name = "cyanide bottle"
desc = "A small bottle of cyanide. Bitter almonds?"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle12"
New()
..()
reagents.add_reagent("cyanide", 30)
/obj/item/weapon/reagent_containers/glass/bottle/stoxin
name = "sleep-toxin bottle"
desc = "A small bottle of sleep toxins. Just the fumes make you sleepy."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle20"
New()
..()
reagents.add_reagent("stoxin", 30)
/obj/item/weapon/reagent_containers/glass/bottle/chloralhydrate
name = "Chloral Hydrate Bottle"
desc = "A small bottle of Choral Hydrate. Mickey's Favorite!"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle20"
New()
..()
reagents.add_reagent("chloralhydrate", 15) //Intentionally low since it is so strong. Still enough to knock someone out.
/obj/item/weapon/reagent_containers/glass/bottle/antitoxin
name = "anti-toxin bottle"
desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle17"
New()
..()
reagents.add_reagent("anti_toxin", 30)
/obj/item/weapon/reagent_containers/glass/bottle/ammonia
name = "ammonia bottle"
desc = "A small bottle."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle20"
New()
..()
reagents.add_reagent("ammonia", 30)
/obj/item/weapon/reagent_containers/glass/bottle/diethylamine
name = "diethylamine bottle"
desc = "A small bottle."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle17"
New()
..()
reagents.add_reagent("diethylamine", 30)
/obj/item/weapon/reagent_containers/glass/bottle/flu_virion
name = "Flu virion culture bottle"
desc = "A small bottle. Contains H13N1 flu virion culture in synthblood medium."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/flu(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/pierrot_throat
name = "Pierrot's Throat culture bottle"
desc = "A small bottle. Contains H0NI<42 virion culture in synthblood medium."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/pierrot_throat(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/cold
name = "Rhinovirus culture bottle"
desc = "A small bottle. Contains XY-rhinovirus culture in synthblood medium."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/cold(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/retrovirus
name = "Retrovirus culture bottle"
desc = "A small bottle. Contains a retrovirus culture in a synthblood medium."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/dna_retrovirus(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/gbs
name = "GBS culture bottle"
desc = "A small bottle. Contains Gravitokinetic Bipotential SADS+ culture in synthblood medium."//Or simply - General BullShit
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
amount_per_transfer_from_this = 5
New()
var/datum/reagents/R = new/datum/reagents(20)
reagents = R
R.my_atom = src
var/datum/disease/F = new /datum/disease/gbs
var/list/data = list("virus"= F)
R.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/fake_gbs
name = "GBS culture bottle"
desc = "A small bottle. Contains Gravitokinetic Bipotential SADS- culture in synthblood medium."//Or simply - General BullShit
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/fake_gbs(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/*
/obj/item/weapon/reagent_containers/glass/bottle/rhumba_beat
name = "Rhumba Beat culture bottle"
desc = "A small bottle. Contains The Rhumba Beat culture in synthblood medium."//Or simply - General BullShit
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
amount_per_transfer_from_this = 5
New()
var/datum/reagents/R = new/datum/reagents(20)
reagents = R
R.my_atom = src
var/datum/disease/F = new /datum/disease/rhumba_beat
var/list/data = list("virus"= F)
R.add_reagent("blood", 20, data)
*/
/obj/item/weapon/reagent_containers/glass/bottle/brainrot
name = "Brainrot culture bottle"
desc = "A small bottle. Contains Cryptococcus Cosmosis culture in synthblood medium."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/brainrot(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/magnitis
name = "Magnitis culture bottle"
desc = "A small bottle. Contains a small dosage of Fukkos Miracos."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/magnitis(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/wizarditis
name = "Wizarditis culture bottle"
desc = "A small bottle. Contains a sample of Rincewindus Vulgaris."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
var/datum/disease/F = new /datum/disease/wizarditis(0)
var/list/data = list("viruses"= list(F))
reagents.add_reagent("blood", 20, data)
/obj/item/weapon/reagent_containers/glass/bottle/pacid
name = "Polytrinic Acid Bottle"
desc = "A small bottle. Contains a small amount of Polytrinic Acid"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle17"
New()
..()
reagents.add_reagent("pacid", 30)
/obj/item/weapon/reagent_containers/glass/bottle/adminordrazine
name = "Adminordrazine Bottle"
desc = "A small bottle. Contains the liquid essence of the gods."
icon = 'icons/obj/drinks.dmi'
icon_state = "holyflask"
New()
..()
reagents.add_reagent("adminordrazine", 30)
/obj/item/weapon/reagent_containers/glass/bottle/capsaicin
name = "Capsaicin Bottle"
desc = "A small bottle. Contains hot sauce."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle3"
New()
..()
reagents.add_reagent("capsaicin", 30)
/obj/item/weapon/reagent_containers/glass/bottle/frostoil
name = "Frost Oil Bottle"
desc = "A small bottle. Contains cold sauce."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle17"
New()
..()
reagents.add_reagent("frostoil", 30)

View File

@@ -0,0 +1,33 @@
/obj/item/weapon/reagent_containers/glass/bottle/robot
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,50,100)
flags = FPRINT | TABLEPASS | OPENCONTAINER
volume = 60
var/reagent = ""
/obj/item/weapon/reagent_containers/glass/bottle/robot/inaprovaline
name = "internal inaprovaline bottle"
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
reagent = "inaprovaline"
New()
..()
reagents.add_reagent("inaprovaline", 60)
return
/obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin
name = "internal anti-toxin bottle"
desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle17"
reagent = "anti_toxin"
New()
..()
reagents.add_reagent("anti_toxin", 60)
return

View File

@@ -0,0 +1,46 @@
////////////////////////////////////////////////////////////////////////////////
/// HYPOSPRAY
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/hypospray
name = "hypospray"
desc = "The DeForest Medical Corporation hypospray is a sterile, air-needle autoinjector for rapid administration of drugs to patients."
icon = 'icons/obj/syringe.dmi'
item_state = "hypo"
icon_state = "hypo"
amount_per_transfer_from_this = 5
volume = 30
possible_transfer_amounts = null
flags = FPRINT | TABLEPASS | OPENCONTAINER
slot_flags = SLOT_BELT
/obj/item/weapon/reagent_containers/hypospray/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/weapon/reagent_containers/hypospray/New() //comment this to make hypos start off empty
..()
reagents.add_reagent("tricordrazine", 30)
return
/obj/item/weapon/reagent_containers/hypospray/attack(mob/M as mob, mob/user as mob)
if(!reagents.total_volume)
user << "\red The hypospray is empty."
return
if (!( istype(M, /mob) ))
return
if (reagents.total_volume)
user << "\blue You inject [M] with the hypospray."
M << "\red You feel a tiny prick!"
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [src.name] by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to inject [M.name] ([M.ckey])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) injected [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
src.reagents.reaction(M, INGEST)
if(M.reagents)
var/trans = reagents.trans_to(M, amount_per_transfer_from_this)
user << "\blue [trans] units injected. [reagents.total_volume] units remaining in the hypospray."
return

View File

@@ -0,0 +1,171 @@
////////////////////////////////////////////////////////////////////////////////
/// Pills.
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/pill
name = "pill"
desc = "a pill."
icon = 'icons/obj/chemical.dmi'
icon_state = null
item_state = "pill"
possible_transfer_amounts = null
volume = 50
New()
..()
if(!icon_state)
icon_state = "pill[rand(1,20)]"
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/storage/pill_bottle))
var/obj/item/weapon/storage/pill_bottle/P = W
if (P.mode == 1)
for (var/obj/item/weapon/reagent_containers/pill/O in locate(src.x,src.y,src.z))
if(P.contents.len < P.storage_slots)
O.loc = P
P.orient2hud(user)
else
user << "\blue The pill bottle is full."
return
user << "\blue You pick up all the pills."
else
if (P.contents.len < P.storage_slots)
loc = P
P.orient2hud(user)
else
user << "\blue The pill bottle is full."
return
attack_self(mob/user as mob)
return
attack(mob/M as mob, mob/user as mob, def_zone)
if(M == user)
M << "\blue You swallow [src]."
M.drop_from_inventory(src) //icon update
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
reagents.trans_to(M, reagents.total_volume)
del(src)
else
del(src)
return 1
else if(istype(M, /mob/living/carbon/human) )
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] attempts to force [M] to swallow [src].", 1)
if(!do_mob(user, M)) return
user.drop_from_inventory(src) //icon update
for(var/mob/O in viewers(world.view, user))
O.show_message("\red [user] forces [M] to swallow [src].", 1)
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) fed [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
if(reagents.total_volume)
reagents.reaction(M, INGEST)
spawn(5)
reagents.trans_to(M, reagents.total_volume)
del(src)
else
del(src)
return 1
return 0
afterattack(obj/target, mob/user , flag)
if(target.is_open_container() == 1 && target.reagents)
if(!target.reagents.total_volume)
user << "\red [target] is empty. Cant dissolve pill."
return
user << "\blue You dissolve the pill in [target]"
reagents.trans_to(target, reagents.total_volume)
for(var/mob/O in viewers(2, user))
O.show_message("\red [user] puts something in [target].", 1)
spawn(5)
del(src)
return
////////////////////////////////////////////////////////////////////////////////
/// Pills. END
////////////////////////////////////////////////////////////////////////////////
//Pills
/obj/item/weapon/reagent_containers/pill/antitox
name = "Anti-toxins pill"
desc = "Neutralizes many common toxins."
icon_state = "pill17"
New()
..()
reagents.add_reagent("anti_toxin", 50)
/obj/item/weapon/reagent_containers/pill/tox
name = "Toxins pill"
desc = "Highly toxic."
icon_state = "pill5"
New()
..()
reagents.add_reagent("toxin", 50)
/obj/item/weapon/reagent_containers/pill/cyanide
name = "Cyanide pill"
desc = "Don't swallow this."
icon_state = "pill5"
New()
..()
reagents.add_reagent("cyanide", 50)
/obj/item/weapon/reagent_containers/pill/adminordrazine
name = "Adminordrazine pill"
desc = "It's magic. We don't have to explain it."
icon_state = "pill16"
New()
..()
reagents.add_reagent("adminordrazine", 50)
/obj/item/weapon/reagent_containers/pill/stox
name = "Sleeping pill"
desc = "Commonly used to treat insomnia."
icon_state = "pill8"
New()
..()
reagents.add_reagent("stoxin", 30)
/obj/item/weapon/reagent_containers/pill/kelotane
name = "Kelotane pill"
desc = "Used to treat burns."
icon_state = "pill11"
New()
..()
reagents.add_reagent("kelotane", 30)
/obj/item/weapon/reagent_containers/pill/inaprovaline
name = "Inaprovaline pill"
desc = "Used to stabilize patients."
icon_state = "pill20"
New()
..()
reagents.add_reagent("inaprovaline", 30)
/obj/item/weapon/reagent_containers/pill/dexalin
name = "Dexalin pill"
desc = "Used to treat oxygen deprivation."
icon_state = "pill16"
New()
..()
reagents.add_reagent("dexalin", 30)
/obj/item/weapon/reagent_containers/pill/bicaridine
name = "Bicaridine pill"
desc = "Used to treat physical injuries."
icon_state = "pill18"
New()
..()
reagents.add_reagent("bicaridine", 30)

View File

@@ -0,0 +1,88 @@
/obj/item/weapon/reagent_containers/robodropper
name = "Industrial Dropper"
desc = "A larger dropper. Transfers 10 units."
icon = 'icons/obj/chemical.dmi'
icon_state = "dropper0"
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(1,2,3,4,5,6,7,8,9,10)
volume = 10
var/filled = 0
afterattack(obj/target, mob/user , flag)
if(!target.reagents) return
if(filled)
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "\red [target] is full."
return
if(!target.is_open_container() && !ismob(target) && !istype(target,/obj/item/weapon/reagent_containers/food)) //You can inject humans and food but you cant remove the shit.
user << "\red You cannot directly fill this object."
return
var/trans = 0
if(ismob(target))
if(istype(target , /mob/living/carbon/human))
var/mob/living/carbon/human/victim = target
var/obj/item/safe_thing = null
if( victim.wear_mask )
if ( victim.wear_mask.flags & MASKCOVERSEYES )
safe_thing = victim.wear_mask
if( victim.head )
if ( victim.head.flags & MASKCOVERSEYES )
safe_thing = victim.head
if(victim.glasses)
if ( !safe_thing )
safe_thing = victim.glasses
if(safe_thing)
if(!safe_thing.reagents)
safe_thing.create_reagents(100)
trans = src.reagents.trans_to(safe_thing, amount_per_transfer_from_this)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] tries to squirt something into []'s eyes, but fails!</B>", user, target), 1)
spawn(5)
src.reagents.reaction(safe_thing, TOUCH)
user << "\blue You transfer [trans] units of the solution."
if (src.reagents.total_volume<=0)
filled = 0
icon_state = "dropper[filled]"
return
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] squirts something into []'s eyes!</B>", user, target), 1)
src.reagents.reaction(target, TOUCH)
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You transfer [trans] units of the solution."
if (src.reagents.total_volume<=0)
filled = 0
icon_state = "dropper[filled]"
else
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers))
user << "\red You cannot directly remove reagents from [target]."
return
if(!target.reagents.total_volume)
user << "\red [target] is empty."
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
user << "\blue You fill the dropper with [trans] units of the solution."
filled = 1
icon_state = "dropper[filled]"
return

View File

@@ -0,0 +1,219 @@
/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)
D.name = "chemicals"
D.icon = 'icons/obj/chempuff.dmi'
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
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
..()
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)
D.icon += mix_color_from_reagents(D.reagents.reagent_list)
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
// Plant-B-Gone
/obj/item/weapon/reagent_containers/spray/plantbgone // -- Skie
name = "Plant-B-Gone"
desc = "Kills those pesky weeds!"
icon = 'icons/obj/hydroponics.dmi'
icon_state = "plantbgone"
item_state = "plantbgone"
volume = 100
/obj/item/weapon/reagent_containers/spray/plantbgone/New()
..()
reagents.add_reagent("plantbgone", 100)
/obj/item/weapon/reagent_containers/spray/plantbgone/afterattack(atom/A as mob|obj, mob/user as mob)
if (istype(A, /obj/machinery/hydroponics)) // We are targeting hydrotray
return
if (istype(A, /obj/effect/blob)) // blob damage in blob code
return
..()

View File

@@ -0,0 +1,376 @@
////////////////////////////////////////////////////////////////////////////////
/// Syringes.
////////////////////////////////////////////////////////////////////////////////
#define SYRINGE_DRAW 0
#define SYRINGE_INJECT 1
/obj/item/weapon/reagent_containers/syringe
name = "Syringe"
desc = "A syringe."
icon = 'icons/obj/syringe.dmi'
item_state = "syringe_0"
icon_state = "0"
amount_per_transfer_from_this = 5
possible_transfer_amounts = null //list(5,10,15)
volume = 15
var/mode = SYRINGE_DRAW
on_reagent_change()
update_icon()
pickup(mob/user)
..()
update_icon()
dropped(mob/user)
..()
update_icon()
attack_self(mob/user as mob)
/*
switch(mode)
if(SYRINGE_DRAW)
mode = SYRINGE_INJECT
if(SYRINGE_INJECT)
mode = SYRINGE_DRAW
*/
mode = !mode
update_icon()
attack_hand()
..()
update_icon()
attack_paw()
return attack_hand()
attackby(obj/item/I as obj, mob/user as mob)
return
afterattack(obj/target, mob/user , flag)
if(!target.reagents) return
switch(mode)
if(SYRINGE_DRAW)
if(reagents.total_volume >= reagents.maximum_volume)
user << "\red The syringe is full."
return
if(ismob(target))//Blood!
if(istype(target, /mob/living/carbon/metroid))
user << "\red You are unable to locate any blood."
return
if(src.reagents.has_reagent("blood"))
user << "\red There is already a blood sample in this syringe"
return
if(istype(target, /mob/living/carbon))//maybe just add a blood reagent to all mobs. Then you can suck them dry...With hundreds of syringes. Jolly good idea.
var/amount = src.reagents.maximum_volume - src.reagents.total_volume
var/mob/living/carbon/T = target
var/datum/reagent/B = new /datum/reagent/blood
if(!T.dna)
usr << "You are unable to locate any blood. (To be specific, your target seems to be missing their DNA datum)"
return
if(NOCLONE in T.mutations) //target done been et, no more blood in him
user << "\red You are unable to locate any blood."
return
B.holder = src
B.volume = amount
//set reagent data
B.data["donor"] = T
/*
if(T.virus && T.virus.spread_type != SPECIAL)
B.data["virus"] = new T.virus.type(0)
*/
for(var/datum/disease/D in T.viruses)
if(!B.data["viruses"])
B.data["viruses"] = list()
B.data["viruses"] += new D.type
B.data["blood_DNA"] = copytext(T.dna.unique_enzymes,1,0)
if(T.resistances&&T.resistances.len)
B.data["resistances"] = T.resistances.Copy()
if(istype(target, /mob/living/carbon/human))//I wish there was some hasproperty operation...
var/mob/living/carbon/human/HT = target
B.data["blood_type"] = copytext(HT.dna.b_type,1,0)
var/list/temp_chem = list()
for(var/datum/reagent/R in target.reagents.reagent_list)
temp_chem += R.name
temp_chem[R.name] = R.volume
B.data["trace_chem"] = list2params(temp_chem)
src.reagents.reagent_list += B
src.reagents.update_total()
src.on_reagent_change()
src.reagents.handle_reactions()
user << "\blue You take a blood sample from [target]"
for(var/mob/O in viewers(4, user))
O.show_message("\red [user] takes a blood sample from [target].", 1)
else //if not mob
if(!target.reagents.total_volume)
user << "\red [target] is empty."
return
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers) && !istype(target,/obj/item/metroid_core))
user << "\red You cannot directly remove reagents from this object."
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares?
user << "\blue You fill the syringe with [trans] units of the solution."
if (reagents.total_volume >= reagents.maximum_volume)
mode=!mode
update_icon()
if(SYRINGE_INJECT)
if(!reagents.total_volume)
user << "\red The Syringe is empty."
return
if(istype(target, /obj/item/weapon/implantcase/chem))
return
if(!target.is_open_container() && !ismob(target) && !istype(target, /obj/item/weapon/reagent_containers/food) && !istype(target, /obj/item/metroid_core) && !istype(target, /obj/item/clothing/mask/cigarette) && !istype(target, /obj/item/weapon/cigpacket))
user << "\red You cannot directly fill this object."
return
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "\red [target] is full."
return
if(istype(target, /obj/item/metroid_core))
var/obj/item/metroid_core/core = target
core.Flush = 30 // reset flush counter
if(ismob(target) && target != user)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] is trying to inject []!</B>", user, target), 1)
if(!do_mob(user, target)) return
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red [] injects [] with the syringe!", user, target), 1)
src.reagents.reaction(target, INGEST)
if(ismob(target) && target == user)
src.reagents.reaction(target, INGEST)
spawn(5)
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units."
if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT)
mode = SYRINGE_DRAW
update_icon()
return
update_icon()
var/rounded_vol = round(reagents.total_volume,5)
overlays = null
if(ismob(loc))
var/injoverlay
switch(mode)
if (SYRINGE_DRAW)
injoverlay = "draw"
if (SYRINGE_INJECT)
injoverlay = "inject"
overlays += injoverlay
icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]"
if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "syringe10", src.layer)
switch(rounded_vol)
if(5) filling.icon_state = "syringe5"
if(10) filling.icon_state = "syringe10"
if(15) filling.icon_state = "syringe15"
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling
/obj/item/weapon/reagent_containers/ld50_syringe
name = "Lethal Injection Syringe"
desc = "A syringe used for lethal injections."
icon = 'icons/obj/syringe.dmi'
item_state = "syringe_0"
icon_state = "0"
amount_per_transfer_from_this = 50
possible_transfer_amounts = null //list(5,10,15)
volume = 50
var/mode = SYRINGE_DRAW
on_reagent_change()
update_icon()
pickup(mob/user)
..()
update_icon()
dropped(mob/user)
..()
update_icon()
attack_self(mob/user as mob)
mode = !mode
update_icon()
attack_hand()
..()
update_icon()
attack_paw()
return attack_hand()
attackby(obj/item/I as obj, mob/user as mob)
return
afterattack(obj/target, mob/user , flag)
if(!target.reagents) return
switch(mode)
if(SYRINGE_DRAW)
if(reagents.total_volume >= reagents.maximum_volume)
user << "\red The syringe is full."
return
if(ismob(target))
if(istype(target, /mob/living/carbon))//I Do not want it to suck 50 units out of people
usr << "This needle isn't designed for drawing blood."
return
else //if not mob
if(!target.reagents.total_volume)
user << "\red [target] is empty."
return
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers))
user << "\red You cannot directly remove reagents from this object."
return
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares?
user << "\blue You fill the syringe with [trans] units of the solution."
if (reagents.total_volume >= reagents.maximum_volume)
mode=!mode
update_icon()
if(SYRINGE_INJECT)
if(!reagents.total_volume)
user << "\red The Syringe is empty."
return
if(istype(target, /obj/item/weapon/implantcase/chem))
return
if(!target.is_open_container() && !ismob(target) && !istype(target, /obj/item/weapon/reagent_containers/food))
user << "\red You cannot directly fill this object."
return
if(target.reagents.total_volume >= target.reagents.maximum_volume)
user << "\red [target] is full."
return
if(ismob(target) && target != user)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[] is trying to inject [] with a giant syringe!</B>", user, target), 1)
if(!do_mob(user, target, 300)) return
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red [] injects [] with a giant syringe!", user, target), 1)
src.reagents.reaction(target, INGEST)
if(ismob(target) && target == user)
src.reagents.reaction(target, INGEST)
spawn(5)
var/trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
user << "\blue You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units."
if (reagents.total_volume >= reagents.maximum_volume && mode==SYRINGE_INJECT)
mode = SYRINGE_DRAW
update_icon()
return
update_icon()
var/rounded_vol = round(reagents.total_volume,50)
if(ismob(loc))
var/mode_t
switch(mode)
if (SYRINGE_DRAW)
mode_t = "d"
if (SYRINGE_INJECT)
mode_t = "i"
icon_state = "[mode_t][rounded_vol]"
else
icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]"
////////////////////////////////////////////////////////////////////////////////
/// Syringes. END
////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/syringe/inaprovaline
name = "Syringe (inaprovaline)"
desc = "Contains inaprovaline - used to stabilize patients."
New()
..()
reagents.add_reagent("inaprovaline", 15)
mode = SYRINGE_INJECT
update_icon()
/obj/item/weapon/reagent_containers/syringe/antitoxin
name = "Syringe (anti-toxin)"
desc = "Contains anti-toxins."
New()
..()
reagents.add_reagent("anti_toxin", 15)
mode = SYRINGE_INJECT
update_icon()
/obj/item/weapon/reagent_containers/syringe/antiviral
name = "Syringe (spaceacillin)"
desc = "Contains antiviral agents."
New()
..()
reagents.add_reagent("spaceacillin", 15)
mode = SYRINGE_INJECT
update_icon()
/obj/item/weapon/reagent_containers/ld50_syringe/choral
New()
..()
reagents.add_reagent("chloralhydrate", 50)
mode = SYRINGE_INJECT
update_icon()
//Robot syringes
//Not special in any way, code wise. They don't have added variables or procs.
/obj/item/weapon/reagent_containers/syringe/robot/antitoxin
name = "Syringe (anti-toxin)"
desc = "Contains anti-toxins."
New()
..()
reagents.add_reagent("anti_toxin", 15)
mode = SYRINGE_INJECT
update_icon()
/obj/item/weapon/reagent_containers/syringe/robot/inoprovaline
name = "Syringe (inoprovaline)"
desc = "Contains inaprovaline - used to stabilize patients."
New()
..()
reagents.add_reagent("inaprovaline", 15)
mode = SYRINGE_INJECT
update_icon()
/obj/item/weapon/reagent_containers/syringe/robot/mixed
name = "Syringe (mixed)"
desc = "Contains inaprovaline & anti-toxins."
New()
..()
reagents.add_reagent("inaprovaline", 7)
reagents.add_reagent("anti_toxin", 8)
mode = SYRINGE_INJECT
update_icon()

View File

@@ -0,0 +1,153 @@
/obj/structure/reagent_dispensers
name = "Dispenser"
desc = "..."
icon = 'icons/obj/objects.dmi'
icon_state = "watertank"
density = 1
anchored = 0
flags = FPRINT
pressure_resistance = 2*ONE_ATMOSPHERE
var/amount_per_transfer_from_this = 10
var/possible_transfer_amounts = list(10,25,50,100)
attackby(obj/item/weapon/W as obj, mob/user as mob)
return
New()
var/datum/reagents/R = new/datum/reagents(1000)
reagents = R
R.my_atom = src
if (!possible_transfer_amounts)
src.verbs -= /obj/structure/reagent_dispensers/verb/set_APTFT
..()
examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return
usr << "\blue It contains:"
if(reagents && reagents.reagent_list.len)
for(var/datum/reagent/R in reagents.reagent_list)
usr << "\blue [R.volume] units of [R.name]"
else
usr << "\blue Nothing."
verb/set_APTFT() //set amount_per_transfer_from_this
set name = "Set transfer amount"
set category = "Object"
set src in view(1)
var/N = input("Amount per transfer from this:","[src]") as null|anything in possible_transfer_amounts
if (N)
amount_per_transfer_from_this = N
ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(50))
new /obj/effect/effect/water(src.loc)
del(src)
return
if(3.0)
if (prob(5))
new /obj/effect/effect/water(src.loc)
del(src)
return
else
return
blob_act()
if(prob(50))
new /obj/effect/effect/water(src.loc)
del(src)
//Dispensers
/obj/structure/reagent_dispensers/watertank
name = "watertank"
desc = "A watertank"
icon = 'icons/obj/objects.dmi'
icon_state = "watertank"
amount_per_transfer_from_this = 10
New()
..()
reagents.add_reagent("water",1000)
/obj/structure/reagent_dispensers/fueltank
name = "fueltank"
desc = "A fueltank"
icon = 'icons/obj/objects.dmi'
icon_state = "weldtank"
amount_per_transfer_from_this = 10
New()
..()
reagents.add_reagent("fuel",1000)
bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet))
explosion(src.loc,-1,0,2)
if(src)
del(src)
blob_act()
explosion(src.loc,0,1,5,7,10)
if(src)
del(src)
ex_act()
explosion(src.loc,-1,0,2)
if(src)
del(src)
/obj/structure/reagent_dispensers/peppertank
name = "Pepper Spray Refiller"
desc = "Refill pepper spray canisters."
icon = 'icons/obj/objects.dmi'
icon_state = "peppertank"
anchored = 1
density = 0
amount_per_transfer_from_this = 45
New()
..()
reagents.add_reagent("condensedcapsaicin",1000)
/obj/structure/reagent_dispensers/water_cooler
name = "Water-Cooler"
desc = "A machine that dispenses water to drink"
amount_per_transfer_from_this = 5
icon = 'icons/obj/vending.dmi'
icon_state = "water_cooler"
possible_transfer_amounts = null
anchored = 1
New()
..()
reagents.add_reagent("water",500)
/obj/structure/reagent_dispensers/beerkeg
name = "beer keg"
desc = "A beer keg"
icon = 'icons/obj/objects.dmi'
icon_state = "beertankTEMP"
amount_per_transfer_from_this = 10
New()
..()
reagents.add_reagent("beer",1000)
/obj/structure/reagent_dispensers/beerkeg/blob_act()
explosion(src.loc,0,3,5,7,10)
del(src)

View File

@@ -0,0 +1,119 @@
/obj/item/weapon/gun/syringe
name = "syringe gun"
desc = "A spring loaded rifle designed to fit syringes, designed to incapacitate unruly patients from a distance."
icon = 'icons/obj/gun.dmi'
icon_state = "syringegun"
item_state = "syringegun"
w_class = 3.0
throw_speed = 2
throw_range = 10
force = 4.0
var/list/syringes = new/list()
var/max_syringes = 1
m_amt = 2000
examine()
set src in view()
..()
if (!(usr in view(2)) && usr!=src.loc) return
usr << "\blue [syringes.len] / [max_syringes] syringes."
attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/reagent_containers/syringe))
if(syringes.len < max_syringes)
user.drop_item()
I.loc = src
syringes += I
user << "\blue You put the syringe in [src]."
user << "\blue [syringes.len] / [max_syringes] syringes."
else
usr << "\red [src] cannot hold more syringes."
afterattack(obj/target, mob/user , flag)
if(!isturf(target.loc) || target == user) return
if(syringes.len)
spawn(0) fire_syringe(target,user)
else
usr << "\red [src] is empty."
proc
fire_syringe(atom/target, mob/user)
if (locate (/obj/structure/table, src.loc))
return
else
var/turf/trg = get_turf(target)
var/obj/effect/syringe_gun_dummy/D = new/obj/effect/syringe_gun_dummy(get_turf(src))
var/obj/item/weapon/reagent_containers/syringe/S = syringes[1]
if((!S) || (!S.reagents)) //ho boy! wot runtimes!
return
S.reagents.trans_to(D, S.reagents.total_volume)
syringes -= S
del(S)
D.icon_state = "syringeproj"
D.name = "syringe"
playsound(user.loc, 'syringeproj.ogg', 50, 1)
for(var/i=0, i<6, i++)
if(!D) break
if(D.loc == trg) break
step_towards(D,trg)
if(D)
for(var/mob/living/carbon/M in D.loc)
if(!istype(M,/mob/living/carbon)) continue
if(M == user) continue
//Syringe gun attack logging by Yvarov
var/R
if(D.reagents)
for(var/datum/reagent/A in D.reagents.reagent_list)
R += A.id + " ("
R += num2text(A.volume) + "),"
if (istype(M, /mob))
M.attack_log += "\[[time_stamp()]\] <b>[user]/[user.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>syringegun</b> ([R])"
user.attack_log += "\[[time_stamp()]\] <b>[user]/[user.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>syringegun</b> ([R])"
log_attack("<font color='red'>[user] ([user.ckey]) shot [M] ([M.ckey]) with a syringegun ([R])</font>")
else
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>syringegun</b> ([R])"
log_attack("<font color='red'>UNKNOWN shot [M] ([M.ckey]) with a <b>syringegun</b> ([R])</font>")
if(D.reagents)
D.reagents.trans_to(M, 15)
M.take_organ_damage(5)
for(var/mob/O in viewers(world.view, D))
O.show_message("\red [M.name] is hit by the syringe!", 1)
del(D)
if(D)
for(var/atom/A in D.loc)
if(A == user) continue
if(A.density) del(D)
sleep(1)
if (D) spawn(10) del(D)
return
/obj/item/weapon/gun/syringe/rapidsyringe
name = "rapid syringe gun"
desc = "A modification of the syringe gun design, using a rotating cylinder to store up to four syringes."
icon_state = "rapidsyringegun"
max_syringes = 4
/obj/effect/syringe_gun_dummy
name = ""
desc = ""
icon = 'icons/obj/chemical.dmi'
icon_state = "null"
anchored = 1
density = 0
New()
var/datum/reagents/R = new/datum/reagents(15)
reagents = R
R.my_atom = src