Merge pull request #8317 from Baystation12/master

Master into dev-freeze
This commit is contained in:
Zuhayr
2015-02-28 17:01:42 +10:30
5 changed files with 24 additions and 20 deletions
+1 -1
View File
@@ -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