Migrates obj/item/food to the new Attack Chain (#29860)

* Creation

* Update food_base.dm

* FUCKING IF SPACE

* plants

* more plant

* Update tomato.dm

* Update root.dm
This commit is contained in:
CRUNCH
2025-08-19 07:53:49 +01:00
committed by GitHub
parent 66615e9a2a
commit dc629eb29e
18 changed files with 332 additions and 228 deletions
@@ -6,32 +6,31 @@ do {\
qdel(src);\
} while(FALSE)
/obj/item/food/sliced/bread/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/food) && !(W.flags & NODROP))
MAKE_CUSTOM_FOOD(W, user, /obj/item/food/customizable/sandwich)
return
/obj/item/food/sliced/bread/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/food) && !(used.flags & NODROP))
MAKE_CUSTOM_FOOD(used, user, /obj/item/food/customizable/sandwich)
return ITEM_INTERACT_COMPLETE
..()
/obj/item/food/bun/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/food) && !(W.flags & NODROP))
MAKE_CUSTOM_FOOD(W, user, /obj/item/food/customizable/burger)
return
/obj/item/food/bun/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/food) && !(used.flags & NODROP))
MAKE_CUSTOM_FOOD(used, user, /obj/item/food/customizable/burger)
return ITEM_INTERACT_COMPLETE
..()
/obj/item/food/sliceable/flatdough/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/food) && !(W.flags & NODROP))
MAKE_CUSTOM_FOOD(W, user, /obj/item/food/customizable/pizza)
return
/obj/item/food/sliceable/flatdough/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/food) && !(used.flags & NODROP))
MAKE_CUSTOM_FOOD(used, user, /obj/item/food/customizable/pizza)
return ITEM_INTERACT_COMPLETE
..()
/obj/item/food/boiledspaghetti/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/food) && !(W.flags & NODROP))
MAKE_CUSTOM_FOOD(W, user, /obj/item/food/customizable/pasta)
return
/obj/item/food/boiledspaghetti/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/food) && !(used.flags & NODROP))
MAKE_CUSTOM_FOOD(used, user, /obj/item/food/customizable/pasta)
return ITEM_INTERACT_COMPLETE
..()
/obj/item/trash/plate/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/food) && !(W.flags & NODROP))
MAKE_CUSTOM_FOOD(W, user, /obj/item/food/customizable/fullycustom)
@@ -49,7 +48,7 @@ do {\
/obj/item/trash/bowl/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/food) && !(I.flags & NODROP))
var/obj/item/food/customizable/soup/S = new(get_turf(user))
S.attackby__legacy__attackchain(I, user, params)
S.item_interaction(I, user, params)
qdel(src)
else
..()
@@ -322,17 +321,16 @@ do {\
tastes = list("bun" = 4)
/obj/item/food/customizable/attackby__legacy__attackchain(obj/item/I, mob/user, params)
..()
/obj/item/food/customizable/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/kitchen/utensil) || is_pen(used))
return ..()
if(istype(I, /obj/item/kitchen/utensil) || is_pen(I))
return
if(!istype(used, /obj/item/food))
to_chat(user, "<span class='warning'>[used] isn't exactly something that you would want to eat.</span>")
return ITEM_INTERACT_COMPLETE
if(!istype(I, /obj/item/food))
to_chat(user, "<span class='warning'>[I] isn't exactly something that you would want to eat.</span>")
return
add_ingredient(I, user)
add_ingredient(used, user)
return ITEM_INTERACT_COMPLETE
/**
* Tries to add one ingredient and it's ingredients, if any and applicable, to this snack
@@ -189,16 +189,17 @@
tastes = list("dough" = 1)
// Dough + rolling pin = flat dough
/obj/item/food/dough/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/kitchen/rollingpin))
if(isturf(loc))
new /obj/item/food/sliceable/flatdough(loc)
to_chat(user, "<span class='notice'>You flatten [src].</span>")
qdel(src)
else
to_chat(user, "<span class='notice'>You need to put [src] on a surface to roll it out!</span>")
/obj/item/food/dough/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/kitchen/rollingpin))
return NONE
if(isturf(loc))
new /obj/item/food/sliceable/flatdough(loc)
to_chat(user, "<span class='notice'>You flatten [src].</span>")
qdel(src)
else
..()
to_chat(user, "<span class='notice'>You need to put [src] on a surface to roll it out!</span>")
return ITEM_INTERACT_COMPLETE
// slicable into 3xdoughslices
/obj/item/food/sliceable/flatdough
@@ -244,23 +245,34 @@
icon_state = "cookiedough"
// Dough + rolling pin = flat cookie dough // Flat dough + circular cutter = unbaked cookies
/obj/item/food/cookiedough/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/kitchen/rollingpin) && !flat)
/obj/item/food/cookiedough/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/kitchen/rollingpin))
if(flat)
to_chat(user, "<span class='warning'>[src] doesn't need to be flattened any further!</span>")
return ITEM_INTERACT_COMPLETE
if(isturf(loc))
to_chat(user, "<span class='notice'>You flatten [src].</span>")
flat = TRUE
update_appearance(UPDATE_NAME|UPDATE_ICON_STATE)
else
to_chat(user, "<span class='notice'>You need to put [src] on a surface to roll it out!</span>")
else if(istype(I, /obj/item/kitchen/cutter) && flat)
to_chat(user, "<span class='warning'>You need to put [src] on a surface to roll it out!</span>")
return ITEM_INTERACT_COMPLETE
if(istype(used, /obj/item/kitchen/cutter))
if(!flat)
to_chat(user, "<span class='warning'>[src] needs to be flattened first!</span>")
return ITEM_INTERACT_COMPLETE
if(isturf(loc))
new /obj/item/food/rawcookies(loc)
to_chat(user, "<span class='notice'>You cut [src] into cookies.</span>")
qdel(src)
else
to_chat(user, "<span class='notice'>You need to put [src] on a surface to cut it out!</span>")
else
return ..()
to_chat(user, "<span class='warning'>You need to put [src] on a surface to cut it out!</span>")
return ITEM_INTERACT_COMPLETE
return NONE
/obj/item/food/rawcookies
@@ -270,17 +282,19 @@
icon_state = "unbaked_cookies"
list_reagents = list("nutriment" = 5, "sugar" = 5)
/obj/item/food/rawcookies/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/food/choc_pile))
/obj/item/food/rawcookies/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/food/choc_pile))
if(isturf(loc))
new /obj/item/food/rawcookies/chocochips(loc)
to_chat(user, "<span class='notice'>You sprinkle [I] all over the cookies.</span>")
to_chat(user, "<span class='notice'>You sprinkle [used] all over the cookies.</span>")
qdel(src)
qdel(I)
qdel(used)
else
to_chat(user, "<span class='notice'>You need to put [src] on a surface to add this</span>")
else
return ..()
to_chat(user, "<span class='warning'>You need to put [src] on a surface to add [used]!</span>")
return ITEM_INTERACT_COMPLETE
return NONE
/obj/item/food/rawcookies/chocochips
desc = "Ready for oven! They have little pieces of chocolate all over them"
@@ -302,16 +316,17 @@
goal_difficulty = FOOD_GOAL_EASY
///Chocolate crumbles/pile
/obj/item/food/chocolatebar/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/kitchen/knife))
if(isturf(loc))
new /obj/item/food/choc_pile(loc)
to_chat(user, "<span class='notice'>You cut [src] into little crumbles.</span>")
qdel(src)
else
to_chat(user, "<span class='notice'>You need to put [src] on a surface to cut it out!</span>")
/obj/item/food/chocolatebar/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/kitchen/knife))
return NONE
if(isturf(loc))
new /obj/item/food/choc_pile(loc)
to_chat(user, "<span class='notice'>You cut [src] into little crumbles.</span>")
qdel(src)
else
return ..()
to_chat(user, "<span class='warning'>You need to put [src] on a surface to cut it out!</span>")
return ITEM_INTERACT_COMPLETE
/// for reagent chocolate being spilled on turfs
@@ -111,7 +111,10 @@
list_reagents = list("nutriment" = 2, "sugar" = 10)
tastes = list("sweetness" = 3, "liquorice" = 2)
/obj/item/food/twimsts/attack_self__legacy__attackchain(mob/user)
/obj/item/food/twimsts/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
var/obj/item/restraints/handcuffs/twimsts/L = new /obj/item/restraints/handcuffs/twimsts
L.create_reagents(100)
reagents.copy_to(L, reagents.total_volume)
@@ -120,6 +123,7 @@
user.drop_item_to_ground(trash_item)
user.put_in_hands(L)
qdel(src)
return ITEM_INTERACT_COMPLETE
/obj/item/food/deluxe_chocolate_bar
name = "Deluxe Chocolate-bar"
+55 -44
View File
@@ -15,18 +15,19 @@
ingredient_name = "slab of meat"
ingredient_name_plural = "slabs of meat"
/obj/item/food/meat/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/kitchen/knife) || istype(W, /obj/item/scalpel))
new /obj/item/food/rawcutlet(src)
new /obj/item/food/rawcutlet(src)
new /obj/item/food/rawcutlet(src)
user.visible_message( \
"<span class ='notice'>[user] cuts [src] with [W]!</span>", \
"<span class ='notice'>You cut [src] with [W]!</span>" \
)
qdel(src)
else
..()
/obj/item/food/meat/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/kitchen/knife) && !istype(used, /obj/item/scalpel))
return NONE
new /obj/item/food/rawcutlet(src)
new /obj/item/food/rawcutlet(src)
new /obj/item/food/rawcutlet(src)
user.visible_message(
"<span class ='notice'>[user] cuts [src] with [used]!</span>",
"<span class ='notice'>You cut [src] with [used]!</span>"
)
qdel(src)
return ITEM_INTERACT_COMPLETE
/obj/item/food/meat/syntiflesh
name = "synthetic meat"
@@ -97,21 +98,22 @@
bitesize = 1
list_reagents = list("protein" = 1)
/obj/item/food/rawcutlet/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/kitchen/knife) || istype(W, /obj/item/scalpel))
user.visible_message( \
"<span class ='notice'>[user] cuts the raw cutlet with [W]!</span>", \
"<span class ='notice'>You cut the raw cutlet with [W]!</span>" \
)
var/obj/item/food/raw_bacon/bacon = new(get_turf(src))
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
qdel(src)
H.put_in_hands(bacon)
else
qdel(src)
/obj/item/food/rawcutlet/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/kitchen/knife) && !istype(used, /obj/item/scalpel))
return NONE
return ..()
user.visible_message(
"<span class ='notice'>[user] cuts the raw cutlet with [used]!</span>",
"<span class ='notice'>You cut the raw cutlet with [used]!</span>"
)
var/obj/item/food/raw_bacon/bacon = new(get_turf(src))
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
qdel(src)
H.put_in_hands(bacon)
else
qdel(src)
return ITEM_INTERACT_COMPLETE
//////////////////////////
// Monster Meat //
@@ -270,7 +272,10 @@
. = ..()
. += "<span class='notice'>Use it in hand to shape it into a raw meatball.</span>"
/obj/item/food/meat/patty_raw/attack_self__legacy__attackchain(mob/user)
/obj/item/food/meat/patty_raw/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
user.visible_message(
"<span class='notice'>[user] shapes [src] into a raw meatball.</span>",
"<span class='notice'>You shape [src] into a raw meatball.</span>"
@@ -280,7 +285,7 @@
user.drop_item()
qdel(src)
user.put_in_hands(M)
return 1
return ITEM_INTERACT_COMPLETE
/obj/item/food/ground_meat
name = "ground meat"
@@ -296,7 +301,10 @@
. += "<span class='notice'>Use it in hand to shape it into a raw meatball.</span>"
. += "<span class='notice'>Use it in hand again to flatten it into a raw patty.</span>"
/obj/item/food/ground_meat/attack_self__legacy__attackchain(mob/living/user)
/obj/item/food/ground_meat/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
user.visible_message(
"<span class='notice'>[user] shapes [src] into a ball.</span>",
"<span class='notice'>You shape [src] into a ball of raw ground meat.</span>"
@@ -306,7 +314,7 @@
user.drop_item()
qdel(src)
user.put_in_hands(M)
return TRUE
return ITEM_INTERACT_COMPLETE
/obj/item/food/meat/raw_meatball
name = "raw meatball"
@@ -320,7 +328,10 @@
. = ..()
. += "<span class='notice'>Use it in hand to flatten it into a raw patty.</span>"
/obj/item/food/meat/raw_meatball/attack_self__legacy__attackchain(mob/user)
/obj/item/food/meat/raw_meatball/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
user.visible_message(
"<span class='notice'>[user] flattens [src] into a patty.</span>",
"<span class='notice'>You flatten [src] into a raw patty.</span>"
@@ -330,7 +341,7 @@
user.drop_item()
qdel(src)
user.put_in_hands(M)
return TRUE
return ITEM_INTERACT_COMPLETE
/obj/item/food/meatball
name = "meatball"
@@ -505,20 +516,20 @@
reagents.reaction(hit_atom, REAGENT_TOUCH)
qdel(src)
/obj/item/food/egg/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(istype(W, /obj/item/toy/crayon))
var/obj/item/toy/crayon/C = W
var/clr = C.dye_color
/obj/item/food/egg/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/toy/crayon))
return NONE
if(!(clr in list("blue","green","mime","orange","purple","rainbow","red","yellow")))
to_chat(usr, "<span class ='notice'>The egg refuses to take on this color!</span>")
return
var/obj/item/toy/crayon/C = used
var/clr = C.dye_color
if(!(clr in list("red", "orange", "yellow", "green", "blue", "purple", "rainbow", "mime")))
to_chat(usr, "<span class ='warning'>The egg refuses to take on this color!</span>")
return ITEM_INTERACT_COMPLETE
to_chat(usr, "<span class ='notice'>You color \the [src] [clr]</span>")
icon_state = "egg-[clr]"
item_color = clr
else
..()
to_chat(usr, "<span class ='notice'>You color \the [src] [clr]</span>")
icon_state = "egg-[clr]"
item_color = clr
return ITEM_INTERACT_COMPLETE
/obj/item/food/egg/blue
icon_state = "egg-blue"
@@ -117,16 +117,19 @@
tastes = list("rice" = 1)
goal_difficulty = FOOD_GOAL_NORMAL
/obj/item/food/boiledrice/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(!istype(I, /obj/item/stack/seaweed))
return ..()
var/obj/item/stack/seaweed/S = I
/obj/item/food/boiledrice/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/stack/seaweed))
return NONE
var/obj/item/stack/seaweed/S = used
if(!S.use(1))
return ..()
return ITEM_INTERACT_COMPLETE
var/obj/item/food/onigiri/O = new(get_turf(user))
reagents.trans_to(O, reagents.total_volume)
qdel(src)
user.put_in_active_hand(O)
return ITEM_INTERACT_COMPLETE
/obj/item/food/roastparsnip
name = "roast parsnip"
+44 -41
View File
@@ -13,6 +13,7 @@
resistance_flags = FLAMMABLE
container_type = INJECTABLE
w_class = WEIGHT_CLASS_TINY
new_attack_chain = TRUE
var/filling_color = "#FFFFFF" //Used by sandwiches.
var/junkiness = 0 //for junk food. used to lower human satiety.
var/bitesize = 2
@@ -171,51 +172,47 @@
/obj/item/food/proc/Post_Consume(mob/living/M)
return
/obj/item/food/attack_self__legacy__attackchain(mob/user)
return
/obj/item/food/attack__legacy__attackchain(mob/M, mob/user, def_zone)
/obj/item/food/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(user.a_intent == INTENT_HARM && force)
return ..()
return NONE
if(reagents && !reagents.total_volume) // Shouldn't be needed but it checks to see if it has anything left in it.
to_chat(user, "<span class='warning'>None of [src] left, oh no!</span>")
qdel(src)
return FALSE
return ITEM_INTERACT_COMPLETE
if(iscarbon(M))
var/mob/living/carbon/C = M
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.eat(src, user))
bitecount++
On_Consume(C, user)
return TRUE
return FALSE
return ITEM_INTERACT_COMPLETE
/obj/item/food/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(is_pen(W))
rename_interactive(user, W, use_prefix = FALSE, prompt = "What would you like to name this dish?")
return
if(isstorage(W))
..() // -> item/attackby(, params)
return NONE
else if(istype(W,/obj/item/kitchen/utensil))
/obj/item/food/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(is_pen(used))
rename_interactive(user, used, use_prefix = FALSE, prompt = "What would you like to name this dish?")
return ITEM_INTERACT_COMPLETE
var/obj/item/kitchen/utensil/U = W
if(isstorage(used))
return NONE
if(istype(used, /obj/item/kitchen/utensil))
var/obj/item/kitchen/utensil/U = used
if(length(U.contents) >= U.max_contents)
to_chat(user, "<span class='warning'>You cannot fit anything else on your [U].")
return
return ITEM_INTERACT_COMPLETE
user.visible_message( \
"[user] scoops up some [name] with [U]!", \
"<span class='notice'>You scoop up some [name] with [U]!" \
user.visible_message(
"<span class='notice'>[user] scoops up some [name] with [U]!</span>",
"<span class='notice'>You scoop up some [name] with [U]!</span>"
)
bitecount++
U.overlays.Cut()
var/image/I = new(U.icon, "loadedfood")
I.color = filling_color
U.overlays += I
var/obj/item/food/collected = new type
collected.name = name
collected.loc = U
@@ -233,9 +230,9 @@
TrashItem = trash
TrashItem.forceMove(loc)
qdel(src)
return TRUE
else
return ..()
return ITEM_INTERACT_COMPLETE
return NONE
/obj/item/food/proc/generate_trash(atom/location)
if(trash)
@@ -331,32 +328,38 @@
add_fingerprint(user)
I.forceMove(src)
/obj/item/food/sliceable/attackby__legacy__attackchain(obj/item/I, mob/user, params)
/obj/item/food/sliceable/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if((slices_num <= 0 || !slices_num) || !slice_path)
return FALSE
return ITEM_INTERACT_COMPLETE
if(!used.sharp)
return NONE
var/inaccurate = TRUE
if(I.sharp)
if(istype(I, /obj/item/kitchen/knife) || istype(I, /obj/item/scalpel))
inaccurate = FALSE
else
return ..()
if(istype(used, /obj/item/kitchen/knife) || istype(used, /obj/item/scalpel))
inaccurate = FALSE
if(!isturf(loc) || !(locate(/obj/structure/table) in loc) && \
!(locate(/obj/machinery/optable) in loc) && !(locate(/obj/item/storage/bag/tray) in loc))
to_chat(user, "<span class='warning'>You cannot slice [src] here! You need a table or at least a tray to do it.</span>")
return TRUE
var/slices_lost = 0
return ITEM_INTERACT_COMPLETE
var/initial_volume = 0 // the total some of reagents this food had initially
for(var/ingredient in list_reagents)
initial_volume += list_reagents[ingredient]
// we want to account for how much has been eaten already, reduce slices by how is left vs. how much food we started with
slices_num = clamp(slices_num * (reagents.total_volume / initial_volume), 1, slices_num)
var/slices_lost
if(!inaccurate)
user.visible_message("<span class='notice'>[user] slices [src]!</span>",
"<span class='notice'>You slice [src]!</span>")
user.visible_message(
"<span class='notice'>[user] slices [src] with [used].</span>",
"<span class='notice'>You slice [src] with [used].</span>"
)
else
user.visible_message("<span class='notice'>[user] crudely slices [src] with [I]!</span>",
"<span class='notice'>You crudely slice [src] with your [I]</span>!")
user.visible_message(
"<span class='notice'>[user] crudely slices [src] with [used], destroying some in the process!</span>",
"<span class='notice'>You crudely slice [src] with [used], destroying some in the process!</span>"
)
slices_lost = rand(1, min(1, round(slices_num / 2)))
var/reagents_per_slice = reagents.total_volume/slices_num
for(var/i in 1 to (slices_num - slices_lost))
@@ -364,7 +367,7 @@
reagents.trans_to(slice,reagents_per_slice)
slice.scatter_atom()
qdel(src)
return ..()
return ITEM_INTERACT_COMPLETE
/obj/item/food/badrecipe
name = "burned mess"
+34 -18
View File
@@ -67,23 +67,28 @@
if(T.examine_line)
. += T.examine_line
/obj/item/food/grown/attackby__legacy__attackchain(obj/item/O, mob/user, params)
..()
/obj/item/food/grown/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(slices_num && slice_path)
var/inaccurate = TRUE
if(O.sharp)
if(istype(O, /obj/item/kitchen/knife) || istype(O, /obj/item/scalpel))
if(used.sharp)
if(istype(used, /obj/item/kitchen/knife) || istype(used, /obj/item/scalpel))
inaccurate = FALSE
if(!isturf(loc) || !(locate(/obj/structure/table) in loc) && !(locate(/obj/machinery/optable) in loc) && !(locate(/obj/item/storage/bag/tray) in loc))
to_chat(user, "<span class='warning'>You cannot slice [src] here! You need a table or at least a tray to do it.</span>")
return TRUE
return ITEM_INTERACT_COMPLETE
var/slices_lost = 0
if(!inaccurate)
user.visible_message("<span class='notice'>[user] slices [src] with [O]!</span>", "<span class='notice'>You slice [src]!</span>")
user.visible_message(
"<span class='notice'>[user] slices [src] with [used].</span>",
"<span class='notice'>You slice [src] with [used].</span>"
)
else
user.visible_message("<span class='notice'>[user] crudely slices [src] with [O]!</span>", "<span class='notice'>You crudely slice [src] with your [O]!</span>")
user.visible_message(
"<span class='notice'>[user] crudely slices [src] with [used], destroying some in the process!</span>",
"<span class='notice'>You crudely slice [src] with [used], destroying some in the process!</span>"
)
slices_lost = rand(1, min(1, round(slices_num / 2)))
var/reagents_per_slice = reagents.total_volume/slices_num
@@ -92,21 +97,27 @@
reagents.trans_to(slice, reagents_per_slice)
slice.scatter_atom()
qdel(src)
return ..()
return ITEM_INTERACT_COMPLETE
if(istype(O, /obj/item/plant_analyzer))
if(istype(used, /obj/item/plant_analyzer))
send_plant_details(user)
else
if(seed)
for(var/datum/plant_gene/trait/T in seed.genes)
T.on_attackby(src, O, user)
return ITEM_INTERACT_COMPLETE
if(seed)
for(var/datum/plant_gene/trait/T in seed.genes)
T.on_attackby(src, used, user)
return ITEM_INTERACT_COMPLETE
return NONE
// Various gene procs
/obj/item/food/grown/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
if(seed && seed.get_gene(/datum/plant_gene/trait/squash))
squash(user)
..()
/obj/item/food/grown/throw_impact(atom/hit_atom)
if(!..()) //was it caught by a mob?
@@ -171,15 +182,20 @@
return ..()
// For item-containing growns such as eggy or gatfruit
/obj/item/food/grown/shell/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/shell/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
if(!do_after(user, 1.5 SECONDS, target = user))
return
return ITEM_INTERACT_COMPLETE
user.unequip(src)
if(trash)
var/obj/item/T = generate_trash()
user.put_in_hands(T)
to_chat(user, "<span class='notice'>You open [src]\'s shell, revealing \a [T].</span>")
to_chat(user, "<span class='notice'>You deshell [src], revealing \a [T].</span>")
qdel(src)
return ITEM_INTERACT_COMPLETE
// Diona Nymphs can eat these as well as weeds to gain nutrition.
/obj/item/food/grown/attack_animal(mob/living/simple_animal/M)
+9 -3
View File
@@ -89,11 +89,17 @@
tastes = list("meatwheat" = 1)
can_distill = FALSE
/obj/item/food/grown/meatwheat/attack_self__legacy__attackchain(mob/living/user)
user.visible_message("<span class='notice'>[user] crushes [src] into meat.</span>", "<span class='notice'>You crush [src] into something that resembles meat.</span>")
/obj/item/food/grown/meatwheat/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
user.visible_message(
"<span class='notice'>[user] crushes [src] into meat.</span>",
"<span class='notice'>You crush [src] into something that resembles meat.</span>"
)
playsound(user, 'sound/effects/blobattack.ogg', 50, 1)
var/obj/item/food/meat/meatwheat/M = new(get_turf(user))
user.drop_item()
qdel(src)
user.put_in_hands(M)
return 1
return ITEM_INTERACT_COMPLETE
+9 -2
View File
@@ -111,9 +111,15 @@
tastes = list("burning lemon" = 1)
wine_flavor = "fire"
/obj/item/food/grown/firelemon/attack_self__legacy__attackchain(mob/living/user)
/obj/item/food/grown/firelemon/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
var/area/A = get_area(user)
user.visible_message("<span class='warning'>[user] primes [src]!</span>", "<span class='userdanger'>You prime [src]!</span>")
user.visible_message(
"<span class='warning'>[user] primes [src]!</span>",
"<span class='userdanger'>You prime [src]!</span>"
)
investigate_log("[key_name(user)] primed a combustible lemon for detonation at [A] [COORD(user)].", INVESTIGATE_BOMB)
add_attack_logs(user, src, "primed a combustible lemon for detonation", ATKLOG_FEW)
log_game("[key_name(user)] primed a combustible lemon for detonation at [A] [COORD(user)].")
@@ -123,6 +129,7 @@
icon_state = "firelemon_active"
playsound(loc, 'sound/weapons/armbomb.ogg', 75, TRUE, -3)
addtimer(CALLBACK(src, PROC_REF(prime)), rand(10, 60))
return ITEM_INTERACT_COMPLETE
/obj/item/food/grown/firelemon/burn()
prime()
@@ -30,7 +30,10 @@
tastes = list("grass" = 1)
wine_power = 0.15
/obj/item/food/grown/grass/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/grass/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
to_chat(user, "<span class='notice'>You prepare the astroturf.</span>")
var/grassAmt = 1 + round(seed.potency * tile_coefficient) // The grass we're holding
for(var/obj/item/food/grown/grass/G in user.loc) // The grass on the floor
@@ -40,6 +43,7 @@
qdel(G)
new stacktype(user.drop_location(), grassAmt)
qdel(src)
return ITEM_INTERACT_COMPLETE
// Carpet
/obj/item/seeds/grass/carpet
+10 -2
View File
@@ -20,12 +20,16 @@
tastes = list("comfrey" = 1)
bitesize_mod = 2
/obj/item/food/grown/comfrey/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/comfrey/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
var/obj/item/stack/medical/bruise_pack/comfrey/C = new(get_turf(user))
C.heal_brute = seed.potency
to_chat(user, "<span class='notice'>You mash [src] into a poultice.</span>")
user.drop_item()
qdel(src)
return ITEM_INTERACT_COMPLETE
/obj/item/seeds/aloe
name = "pack of aloe seeds"
@@ -47,12 +51,16 @@
tastes = list("aloe" = 1)
bitesize_mod = 2
/obj/item/food/grown/aloe/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/aloe/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
var/obj/item/stack/medical/ointment/aloe/A = new(get_turf(user))
A.heal_burn = seed.potency
to_chat(user, "<span class='notice'>You mash [src] into a poultice.</span>")
user.drop_item()
qdel(src)
return ITEM_INTERACT_COMPLETE
// mint
/obj/item/seeds/mint
+9 -2
View File
@@ -191,15 +191,22 @@
max_integrity = 40
wine_power = 0.8
/obj/item/food/grown/cherry_bomb/attack_self__legacy__attackchain(mob/living/user)
/obj/item/food/grown/cherry_bomb/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
var/area/A = get_area(user)
user.visible_message("<span class='warning'>[user] plucks the stem from [src]!</span>", "<span class='userdanger'>You pluck the stem from [src], which begins to hiss loudly!</span>")
user.visible_message(
"<span class='warning'>[user] plucks the stem from [src]!</span>",
"<span class='userdanger'>You pluck the stem from [src], which begins to hiss loudly!</span>"
)
message_admins("[user] ([user.key ? user.key : "no key"]) primed a cherry bomb for detonation at [A] ([user.x], [user.y], [user.z]) <A href='byond://?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>(JMP)</a>")
log_game("[user] ([user.key ? user.key : "no key"]) primed a cherry bomb for detonation at [A] ([user.x],[user.y],[user.z]).")
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
prime()
return ITEM_INTERACT_COMPLETE
/obj/item/food/grown/cherry_bomb/deconstruct(disassembled = TRUE)
if(!disassembled)
+21 -10
View File
@@ -173,9 +173,14 @@
tastes = list("walking mushroom" = 1, "motion" = 1)
can_distill = FALSE
/obj/item/food/grown/mushroom/walkingmushroom/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/mushroom/walkingmushroom/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
if(isspaceturf(user.loc))
return
to_chat(user, "<span class='warning'>You need a solid floor to plant [src] on!</span>")
return ITEM_INTERACT_COMPLETE
var/mob/living/simple_animal/hostile/mushroom/M = new /mob/living/simple_animal/hostile/mushroom(user.loc)
M.maxHealth += round(seed.endurance / 4)
M.melee_damage_lower += round(seed.potency / 20)
@@ -245,12 +250,18 @@
tastes = list("warmth" = 1, "light" = 1, "glowshroom" = 1)
wine_power = 0.5
/obj/item/food/grown/mushroom/glowshroom/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/mushroom/glowshroom/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
if(isspaceturf(user.loc))
return FALSE
to_chat(user, "<span class='warning'>You need a solid floor or wall to plant [src] on!</span>")
return ITEM_INTERACT_COMPLETE
if(!isturf(user.loc))
to_chat(user, "<span class='warning'>You need more space to plant [src].</span>")
return FALSE
to_chat(user, "<span class='warning'>You need more space to plant [src]!</span>")
return ITEM_INTERACT_COMPLETE
var/count = 0
var/maxcount = 1
for(var/tempdir in GLOB.cardinal)
@@ -260,13 +271,13 @@
for(var/obj/structure/glowshroom/G in user.loc)
count++
if(count >= maxcount)
to_chat(user, "<span class='warning'>There are too many shrooms here to plant [src].</span>")
return FALSE
to_chat(user, "<span class='warning'>There are too many shrooms here to plant [src]!</span>")
return ITEM_INTERACT_COMPLETE
new effect_path(user.loc, seed)
to_chat(user, "<span class='notice'>You plant [src].</span>")
qdel(src)
return TRUE
return ITEM_INTERACT_COMPLETE
// Glowcap
/obj/item/seeds/glowshroom/glowcap
+6 -2
View File
@@ -19,8 +19,12 @@
icon_state = "mushy"
bitesize_mod = 2
/obj/item/food/grown/nymph_pod/attack_self__legacy__attackchain(mob/user)
/obj/item/food/grown/nymph_pod/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
new /mob/living/simple_animal/diona(get_turf(user))
to_chat(user, "<span class='notice'>You crack open [src] letting the nymph out.</span>")
to_chat(user, "<span class='notice'>You crack open [src], letting the nymph out.</span>")
user.drop_item()
qdel(src)
return ITEM_INTERACT_COMPLETE
+10 -11
View File
@@ -35,18 +35,17 @@
tastes = list("potato" = 1)
distill_reagent = "sbiten"
/obj/item/food/grown/potato/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!used.sharp)
return NONE
/obj/item/food/grown/potato/attackby__legacy__attackchain(obj/item/W, mob/user, params)
if(W.sharp)
to_chat(user, "<span class='notice'>You cut the potato into wedges with [W].</span>")
var/obj/item/food/grown/potato/wedges/Wedges = new /obj/item/food/grown/potato/wedges
if(!remove_item_from_storage(user))
user.unequip(src)
user.put_in_hands(Wedges)
qdel(src)
else
return ..()
to_chat(user, "<span class='notice'>You cut the potato into wedges with [used].</span>")
var/obj/item/food/grown/potato/wedges/W = new /obj/item/food/grown/potato/wedges
if(!remove_item_from_storage(user))
user.unequip(src)
user.put_in_hands(W)
qdel(src)
return ITEM_INTERACT_COMPLETE
// Sweet Potato
/obj/item/seeds/potato/sweet
+8 -8
View File
@@ -28,14 +28,14 @@
wine_power = 0.2
var/carved_type = /obj/item/clothing/head/hardhat/pumpkinhead
/obj/item/food/grown/pumpkin/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params)
if(W.sharp)
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
new carved_type(user.loc)
qdel(src)
return
else
return ..()
/obj/item/food/grown/pumpkin/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!used.sharp)
return NONE
to_chat(user, "<span class='notice'>You carve a face into [src] with [used].</span>")
new carved_type(user.loc)
qdel(src)
return ITEM_INTERACT_COMPLETE
// Blumpkin
/obj/item/seeds/pumpkin/blumpkin
+11 -10
View File
@@ -29,16 +29,17 @@
desc = "Slices of neatly cut carrot."
icon_state = "carrot_wedges"
/obj/item/food/grown/carrot/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(I.sharp)
to_chat(user, "<span class='notice'>You sharpen the carrot into a shiv with [I].</span>")
var/obj/item/kitchen/knife/shiv/carrot/Shiv = new ()
if(!remove_item_from_storage(user))
user.unequip(src)
user.put_in_hands(Shiv)
qdel(src)
else
return ..()
/obj/item/food/grown/carrot/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!used.sharp)
return NONE
to_chat(user, "<span class='notice'>You sharpen [src] into a shiv with [used].</span>")
var/obj/item/kitchen/knife/shiv/carrot/shiv = new ()
if(!remove_item_from_storage(user))
user.unequip(src)
user.put_in_hands(shiv)
qdel(src)
return ITEM_INTERACT_COMPLETE
// Parsnip
+15 -8
View File
@@ -128,16 +128,21 @@
origin_tech = "biotech=4;combat=5"
distill_reagent = "demonsblood"
/obj/item/food/grown/tomato/killer/attack__legacy__attackchain(mob/M, mob/user, def_zone)
if(awakening)
to_chat(user, "<span class='warning'>The tomato is twitching and shaking, preventing you from eating it.</span>")
return
..()
/obj/item/food/grown/tomato/killer/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(!awakening)
return ..()
to_chat(user, "<span class='warning'>The tomato is squirming and shaking too much to do anything with it!</span>")
return ITEM_INTERACT_COMPLETE
/obj/item/food/grown/tomato/killer/activate_self(mob/user)
if(..())
return ITEM_INTERACT_COMPLETE
/obj/item/food/grown/tomato/killer/attack_self__legacy__attackchain(mob/user)
if(awakening || isspaceturf(user.loc))
return
to_chat(user, "<span class='notice'>You begin to awaken the Killer Tomato...</span>")
return ITEM_INTERACT_COMPLETE
to_chat(user, "<span class='notice'>You begin to awaken [src]...</span>")
awakening = 1
spawn(30)
@@ -155,3 +160,5 @@
message_admins("[key_name_admin(user)] released a killer tomato at [ADMIN_COORDJMP(T)]")
log_game("[key_name(user)] released a killer tomato at [COORD(T)]")
qdel(src)
return ITEM_INTERACT_COMPLETE