Fixed some runtime errors.

Backporting from ss13.ru:
- added trash: foor eaten food leaves empty картонный boxes and plates, husks. Janitors are doomed.
- new sprite for Soylent Viridians
- randomized pill sprite offset (as for fruits, tiles, papers).
- now chemmaster first assign label to pill, then dispence it.
- added sprite for trash bag. Wil be added to code soon.
Code by Jack Rost, sprites by Farart.

- added candle. Code by Balagi, sprites by Farart.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1879 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-07-18 03:02:45 +00:00
parent 9b894f0e0f
commit 1f31f809cd
15 changed files with 270 additions and 28 deletions
+11 -1
View File
@@ -57,10 +57,16 @@
switch(text2num(href_list["state"]))
if(LIQUID)
G.icon_state = "liquid"
G.pixel_x = rand(-7, 7) //random position
G.pixel_y = rand(-7, 7)
if(GAS)
G.icon_state = "vapour"
G.pixel_x = rand(-7, 7) //random position
G.pixel_y = rand(-7, 7)
if(SOLID)
G.icon_state = "solid"
G.pixel_x = rand(-7, 7) //random position
G.pixel_y = rand(-7, 7)
G.name += " ([lowertext(href_list["name"])])"
G.reagents.add_reagent(id,30)
energy--
@@ -204,10 +210,12 @@
reagents.clear_reagents()
icon_state = "mixer0"
else if (href_list["createpill"])
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
var/name = input(usr,"Name:","Name your pill!",reagents.get_master_reagent_name())
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
if(!name || name == " ") name = reagents.get_master_reagent_name()
P.name = "[name] pill"
P.pixel_x = rand(-7, 7) //random position
P.pixel_y = rand(-7, 7)
reagents.trans_to(P,50)
else if (href_list["createbottle"])
if(!condi)
@@ -215,6 +223,8 @@
var/obj/item/weapon/reagent_containers/glass/bottle/P = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
if(!name || name == " ") name = reagents.get_master_reagent_name()
P.name = "[name] bottle"
P.pixel_x = rand(-7, 7) //random position
P.pixel_y = rand(-7, 7)
reagents.trans_to(P,30)
else
var/obj/item/weapon/reagent_containers/food/condiment/P = new/obj/item/weapon/reagent_containers/food/condiment(src.loc)
+44
View File
@@ -1074,9 +1074,53 @@
icon_state = null
var/bitesize = 1
var/bitecount = 0
var/trash = null
//Placeholder for effects that trigger on eating that aren't tied to reagents.
proc/On_Consume()
if (!trash) return
if(!reagents.total_volume)
var/mob/M = usr
switch(trash)
if ("raisins")
var/obj/item/trash/raisins/T = new /obj/item/trash/raisins/( M )
M.put_in_hand(T)
if ("candy")
var/obj/item/trash/candy/T = new /obj/item/trash/candy/( M )
M.put_in_hand(T)
if ("cheesie")
var/obj/item/trash/cheesie/T = new /obj/item/trash/cheesie/( M )
M.put_in_hand(T)
if ("chips")
var/obj/item/trash/chips/T = new /obj/item/trash/chips/( M )
M.put_in_hand(T)
if ("popcorn")
var/obj/item/trash/popcorn/T = new /obj/item/trash/popcorn/( M )
M.put_in_hand(T)
if ("sosjerky")
var/obj/item/trash/sosjerky/T = new /obj/item/trash/sosjerky/( M )
M.put_in_hand(T)
if ("syndi_cakes")
var/obj/item/trash/syndi_cakes/T = new /obj/item/trash/syndi_cakes/( M )
M.put_in_hand(T)
if ("waffles")
var/obj/item/trash/waffles/T = new /obj/item/trash/waffles/( M )
M.put_in_hand(T)
if ("plate")
var/obj/item/trash/plate/T = new /obj/item/trash/plate/( M )
M.put_in_hand(T)
if ("snack_bowl")
var/obj/item/trash/snack_bowl/T = new /obj/item/trash/snack_bowl/( M )
M.put_in_hand(T)
if ("pistachios")
var/obj/item/trash/pistachios/T = new /obj/item/trash/pistachios/( M )
M.put_in_hand(T)
if ("semki")
var/obj/item/trash/semki/T = new /obj/item/trash/semki/( M )
M.put_in_hand(T)
if ("tray")
var/obj/item/trash/tray/T = new /obj/item/trash/tray/( M )
M.put_in_hand(T)
return
attackby(obj/item/weapon/W as obj, mob/user as mob)