Glorious Return Update:

- Adjusted OnConsume proc in food so that it occurs before the check to see if the item is finished (so that you can do triggers whenever you take a bite rather then only when it's completely eaten). Adjusted existing food items so that they still work the same.
- Eating popcorn now has a random chance of having the user accidentally bite on an un-popped kernel. This doesn't do anything other then give the user a message though.
- Kabobs now return the bar used to make them.
- New atom flag: NOREACT. Reagents stored in objects, mobs, and turfs that have this flag do not react. Right now, only the microwave and mobs have this effect (only mobs had this effect before). It's intended to simplify devices that use reagents. ADMIN NOTE: You can remove this flag from people if you feel like being a dick.
- NOREACT flag automatically gets removed on death. (Commented out for now)
- Removed a flag on certain mobs that wasn't actually doing anything.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1459 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
morikou@gmail.com
2011-04-17 02:02:24 +00:00
parent 1bfcf3875f
commit 6809b02dfd
10 changed files with 54 additions and 24 deletions

View File

@@ -129,7 +129,7 @@ datum
update_total() update_total()
handle_reactions() handle_reactions()
if(ismob(my_atom)) return //No reactions inside mobs :I if(my_atom.flags & NOREACT) return //Yup, no reactions here. No siree.
for(var/A in typesof(/datum/chemical_reaction) - /datum/chemical_reaction) for(var/A in typesof(/datum/chemical_reaction) - /datum/chemical_reaction)
var/datum/chemical_reaction/C = new A() var/datum/chemical_reaction/C = new A()

View File

@@ -928,6 +928,7 @@
var/bitesize = 1 var/bitesize = 1
var/bitecount = 0 var/bitecount = 0
//Placeholder for effects that trigger on eating that aren't tied to reagents.
proc/On_Consume() proc/On_Consume()
return return
@@ -986,10 +987,10 @@
else else
reagents.trans_to(M, reagents.total_volume) reagents.trans_to(M, reagents.total_volume)
bitecount++ bitecount++
On_Consume()
if(!reagents.total_volume) if(!reagents.total_volume)
if(M == user) user << "\red You finish eating [src]." if(M == user) user << "\red You finish eating [src]."
else user << "\red [M] finishes eating [src]." else user << "\red [M] finishes eating [src]."
On_Consume()
del(src) del(src)
playsound(M.loc,'eatfood.ogg', rand(10,50), 1) playsound(M.loc,'eatfood.ogg', rand(10,50), 1)
return 1 return 1

View File

@@ -1,7 +1,7 @@
/mob/living/carbon/alien/larva /mob/living/carbon/alien/larva
name = "alien larva" name = "alien larva"
icon_state = "larva" icon_state = "larva"
flags = 258.0 //flags = 258.0
health = 25 health = 25

View File

@@ -6,7 +6,7 @@
icon = 'monkey.dmi' icon = 'monkey.dmi'
icon_state = "monkey1" icon_state = "monkey1"
gender = NEUTER gender = NEUTER
flags = 258.0 //flags = 258.0
var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie var/obj/item/weapon/card/id/wear_id = null // Fix for station bounced radios -- Skie

View File

@@ -2,6 +2,7 @@
density = 1 density = 1
layer = 4.0 layer = 4.0
animate_movement = 2 animate_movement = 2
flags = NOREACT
var/datum/mind/mind var/datum/mind/mind
var/uses_hud = 0 var/uses_hud = 0

View File

@@ -594,7 +594,7 @@
use_power = 1 use_power = 1
idle_power_usage = 5 idle_power_usage = 5
active_power_usage = 100 active_power_usage = 100
flags = OPENCONTAINER //Temporary holder while it counts what's in it. flags = OPENCONTAINER | NOREACT
/obj/machinery/processor /obj/machinery/processor

View File

@@ -33,6 +33,7 @@
icon_state = "banana" icon_state = "banana"
item_state = "banana" item_state = "banana"
On_Consume() On_Consume()
if(!reagents.total_volume)
var/mob/M = usr var/mob/M = usr
var/obj/item/weapon/bananapeel/W = new /obj/item/weapon/bananapeel( M ) var/obj/item/weapon/bananapeel/W = new /obj/item/weapon/bananapeel( M )
M << "\blue You peel the banana." M << "\blue You peel the banana."
@@ -469,6 +470,12 @@
..() ..()
reagents.add_reagent("nutriment", 8) reagents.add_reagent("nutriment", 8)
bitesize = 2 bitesize = 2
On_Consume()
if(!reagents.total_volume)
var/mob/M = usr
var/obj/item/stack/rods/W = new /obj/item/stack/rods( M )
M << "\blue You lick clean the rod."
M.put_in_hand(W)
/obj/item/weapon/reagent_containers/food/snacks/monkeykabob /obj/item/weapon/reagent_containers/food/snacks/monkeykabob
name = "Meat-kabob" name = "Meat-kabob"
@@ -478,6 +485,12 @@
..() ..()
reagents.add_reagent("nutriment", 8) reagents.add_reagent("nutriment", 8)
bitesize = 2 bitesize = 2
On_Consume()
if(!reagents.total_volume)
var/mob/M = usr
var/obj/item/stack/rods/W = new /obj/item/stack/rods( M )
M << "\blue You lick clean the rod."
M.put_in_hand(W)
/obj/item/weapon/reagent_containers/food/snacks/tofukabob /obj/item/weapon/reagent_containers/food/snacks/tofukabob
name = "Tofu-kabob" name = "Tofu-kabob"
@@ -487,6 +500,12 @@
..() ..()
reagents.add_reagent("nutriment", 8) reagents.add_reagent("nutriment", 8)
bitesize = 2 bitesize = 2
On_Consume()
if(!reagents.total_volume)
var/mob/M = usr
var/obj/item/stack/rods/W = new /obj/item/stack/rods( M )
M << "\blue You lick clean the rod."
M.put_in_hand(W)
/obj/item/weapon/reagent_containers/food/snacks/cubancarp /obj/item/weapon/reagent_containers/food/snacks/cubancarp
name = "Cuban Carp" name = "Cuban Carp"
@@ -503,10 +522,17 @@
name = "Popcorm" //not a typo name = "Popcorm" //not a typo
desc = "Now let's find some cinema." desc = "Now let's find some cinema."
icon_state = "popcorn" icon_state = "popcorn"
var/unpopped = 0
New() New()
..() ..()
unpopped = rand(1,10)
reagents.add_reagent("nutriment", 2) reagents.add_reagent("nutriment", 2)
bitesize = 0.1 //this snack is supposed to be eating during looooong time. And this it not dinner food! --rastaf0 bitesize = 0.1 //this snack is supposed to be eating during looooong time. And this it not dinner food! --rastaf0
On_Consume()
if(prob(unpopped))
usr << "\red You bite down on an un-popped kernel!"
unpopped = max(0, unpopped-1)
/obj/item/weapon/reagent_containers/food/snacks/sosjerky /obj/item/weapon/reagent_containers/food/snacks/sosjerky
name = "Scaredy's Private Reserve Beef Jerky" name = "Scaredy's Private Reserve Beef Jerky"
@@ -598,6 +624,7 @@
reagents.add_reagent("nutriment", 3) reagents.add_reagent("nutriment", 3)
bitesize = 2 bitesize = 2
On_Consume() On_Consume()
if(!reagents.total_volume)
var/mob/M = usr var/mob/M = usr
var/obj/item/weapon/paper/paper = locate() in src var/obj/item/weapon/paper/paper = locate() in src
M.visible_message( \ M.visible_message( \
@@ -618,7 +645,7 @@
bitesize = 1 bitesize = 1
/obj/item/weapon/reagent_containers/food/snacks/meatstake /obj/item/weapon/reagent_containers/food/snacks/meatstake
name = "Meat stake" name = "Meat steak"
desc = "A piece of hot spicy meat." desc = "A piece of hot spicy meat."
icon_state = "meatstake" icon_state = "meatstake"
New() New()

View File

@@ -14,7 +14,8 @@
if (istype(src.wear_suit, /obj/item/clothing/suit/space/space_ninja)&&src.wear_suit:initialize) if (istype(src.wear_suit, /obj/item/clothing/suit/space/space_ninja)&&src.wear_suit:initialize)
var/location = src.loc var/location = src.loc
explosion(location, 1, 2, 3, 4) explosion(location, 1, 2, 3, 4)
//src.flags = 0
//reagents.handle_reactions() //No magic stomach for corpses.
src.canmove = 0 src.canmove = 0
if(src.client) if(src.client)
src.blind.layer = 0 src.blind.layer = 0

View File

@@ -107,12 +107,12 @@
#define NOSLIP 1024 //prevents from slipping on wet floors, in space etc #define NOSLIP 1024 //prevents from slipping on wet floors, in space etc
//#define EXTRACT_CONTAINER 4095 //Container may have reagents removed from it.
//#define INSERT_CONTAINER 4096 //Container may have reagents added to it.
#define OPENCONTAINER 4096 // is an open container for chemistry purposes #define OPENCONTAINER 4096 // is an open container for chemistry purposes
#define ONESIZEFITSALL 8192 // can be worn by fatties (or children? ugh) #define ONESIZEFITSALL 8192 // can be worn by fatties (or children? ugh)
#define NOREACT 16384 //Reagents dont' react inside this container.
// bitflags for clothing parts // bitflags for clothing parts
#define HEAD 1 #define HEAD 1