mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge remote-tracking branch 'upstream/dev' into reagent_dispenser
This commit is contained in:
@@ -3329,7 +3329,7 @@ datum
|
||||
|
||||
// make all the beverages work together
|
||||
for(var/datum/reagent/ethanol/A in holder.reagent_list)
|
||||
if(isnum(A.data)) d += A.data
|
||||
if(A != src && isnum(A.data)) d += A.data
|
||||
|
||||
if(alien && alien == IS_SKRELL) //Skrell get very drunk very quickly.
|
||||
d*=5
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#define CELLS 4
|
||||
#define CELLSIZE (32/CELLS)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Food.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -6,7 +9,7 @@
|
||||
volume = 50 //Sets the default container amount for all food items.
|
||||
var/filling_color = "#FFFFFF" //Used by sandwiches.
|
||||
|
||||
var/list/center_of_mass = newlist() //Center of mass
|
||||
var/list/center_of_mass = list() // Used for table placement
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/New()
|
||||
..()
|
||||
@@ -18,17 +21,18 @@
|
||||
if(proximity && params && istype(A, /obj/structure/table) && center_of_mass.len)
|
||||
//Places the item on a grid
|
||||
var/list/mouse_control = params2list(params)
|
||||
var/cellnumber = 4
|
||||
|
||||
var/mouse_x = text2num(mouse_control["icon-x"])
|
||||
var/mouse_y = text2num(mouse_control["icon-y"])
|
||||
|
||||
var/grid_x = round(mouse_x, 32/cellnumber)
|
||||
var/grid_y = round(mouse_y, 32/cellnumber)
|
||||
if(!isnum(mouse_x) || !isnum(mouse_y))
|
||||
return
|
||||
|
||||
if(mouse_control["icon-x"])
|
||||
var/sign = mouse_x - grid_x != 0 ? sign(mouse_x - grid_x) : -1 //positive if rounded down, else negative
|
||||
pixel_x = grid_x - center_of_mass["x"] + sign*16/cellnumber //center of the cell
|
||||
if(mouse_control["icon-y"])
|
||||
var/sign = mouse_y - grid_y != 0 ? sign(mouse_y - grid_y) : -1
|
||||
pixel_y = grid_y - center_of_mass["y"] + sign*16/cellnumber
|
||||
var/cell_x = max(0, min(CELLS-1, round(mouse_x/CELLSIZE)))
|
||||
var/cell_y = max(0, min(CELLS-1, round(mouse_y/CELLSIZE)))
|
||||
|
||||
pixel_x = (CELLSIZE * (0.5 + cell_x)) - center_of_mass["x"]
|
||||
pixel_y = (CELLSIZE * (0.5 + cell_y)) - center_of_mass["y"]
|
||||
|
||||
#undef CELLS
|
||||
#undef CELLSIZE
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
desc = "A metal shaker to mix drinks in."
|
||||
icon_state = "shaker"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 100
|
||||
volume = 120
|
||||
center_of_mass = list("x"=17, "y"=10)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/bottle
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 100
|
||||
volume = 120
|
||||
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
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
name = "glass"
|
||||
desc = "Your standard drinking glass."
|
||||
icon_state = "glass_empty"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
|
||||
on_reagent_change()
|
||||
@@ -16,24 +16,24 @@
|
||||
/*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)
|
||||
if (reagents.reagent_list.len > 0)
|
||||
var/datum/reagent/R = reagents.get_master_reagent()
|
||||
|
||||
|
||||
if(R.glass_icon_state)
|
||||
icon_state = R.glass_icon_state
|
||||
else
|
||||
icon_state = "glass_brown"
|
||||
|
||||
|
||||
if(R.glass_name)
|
||||
name = R.glass_name
|
||||
else
|
||||
name = "Glass of.. what?"
|
||||
|
||||
|
||||
if(R.glass_desc)
|
||||
desc = R.glass_desc
|
||||
else
|
||||
desc = "You can't really tell what this is."
|
||||
|
||||
|
||||
if(R.glass_center_of_mass)
|
||||
center_of_mass = R.glass_center_of_mass
|
||||
else
|
||||
|
||||
@@ -481,14 +481,14 @@
|
||||
user.drop_from_inventory(src)
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/throw_impact(atom/hit_atom)
|
||||
/obj/item/weapon/reagent_containers/food/snacks/egg/throw_impact(atom/hit_atom)
|
||||
..()
|
||||
new/obj/effect/decal/cleanable/egg_smudge(src.loc)
|
||||
src.reagents.reaction(hit_atom, TOUCH)
|
||||
src.visible_message("\red [src.name] has been squashed.","\red You hear a smack.")
|
||||
del(src)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
/obj/item/weapon/reagent_containers/food/snacks/egg/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype( W, /obj/item/toy/crayon ))
|
||||
var/obj/item/toy/crayon/C = W
|
||||
var/clr = C.colourName
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60)
|
||||
volume = 60
|
||||
w_class = 2
|
||||
flags = OPENCONTAINER
|
||||
|
||||
var/label_text = ""
|
||||
|
||||
Reference in New Issue
Block a user