mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 06:27:26 +01:00
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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user