[MIRROR] Adds food vore (#6858)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Raeschen <rycoop29@gmail.com>
This commit is contained in:
CHOMPStation2
2023-08-23 06:13:38 -07:00
committed by GitHub
parent ddfecf05e6
commit 9d2f15e494
12 changed files with 275 additions and 19 deletions

View File

@@ -19,12 +19,23 @@
var/loaded // Name for currently loaded food object.
var/loaded_color // Color for currently loaded food object.
var/list/food_inserted_micros
/obj/item/weapon/material/kitchen/utensil/Initialize()
. = ..()
if (prob(60))
src.pixel_y = rand(0, 4)
create_reagents(scoop_volume)
/obj/item/weapon/material/kitchen/utensil/Destroy()
if(food_inserted_micros)
for(var/mob/M in food_inserted_micros)
M.dropInto(loc)
food_inserted_micros -= M
. = ..()
return
/obj/item/weapon/material/kitchen/utensil/update_icon()
. = ..()
cut_overlays()
@@ -49,6 +60,26 @@
loading.bitecount++
loading.reagents.trans_to_obj(src, min(loading.reagents.total_volume, scoop_volume))
loaded_color = loading.filling_color
if(loading.food_inserted_micros && loading.food_inserted_micros.len)
if(!food_inserted_micros)
food_inserted_micros = list()
for(var/mob/living/F in loading.food_inserted_micros)
var/do_transfer = FALSE
if(!loading.reagents.total_volume)
do_transfer = TRUE
else
var/transfer_chance = (loading.bitecount/(loading.bitecount + (loading.bitesize / loading.reagents.total_volume) + 1))*100
if(prob(transfer_chance))
do_transfer = TRUE
if(do_transfer)
F.forceMove(src)
loading.food_inserted_micros -= F
src.food_inserted_micros += F
if (loading.reagents.total_volume <= 0)
qdel(loading)
update_icon()
@@ -67,6 +98,13 @@
if (loaded && reagents.total_volume > 0)
reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST)
if(food_inserted_micros && food_inserted_micros.len)
for(var/mob/living/F in food_inserted_micros)
food_inserted_micros -= F
if(!F.can_be_drop_prey || !F.food_vore)
F.forceMove(get_turf(src))
else
F.forceMove(M.vore_selected)
if(M == user)
if(!M.can_eat(loaded))
return
@@ -91,6 +129,12 @@
cut_overlays()
return
/obj/item/weapon/material/kitchen/utensil/container_resist(mob/living/M)
if(food_inserted_micros)
food_inserted_micros -= M
M.forceMove(get_turf(src))
to_chat(M, "<span class='warning'>You climb off of \the [src].</span>")
/obj/item/weapon/material/kitchen/utensil/fork
name = "fork"
desc = "It's a fork. Sure is pointy."

View File

@@ -12,6 +12,9 @@
drop_sound = 'sound/items/drop/food.ogg'
pickup_sound = 'sound/items/pickup/food.ogg'
var/food_can_insert_micro = FALSE
var/list/food_inserted_micros
/obj/item/weapon/reagent_containers/food/verb/change_name()
set name = "Rename Food"
set category = "Object"
@@ -52,5 +55,11 @@
pixel_x = (CELLSIZE * (0.5 + cell_x)) - center_of_mass["x"]
pixel_y = (CELLSIZE * (0.5 + cell_y)) - center_of_mass["y"]
/obj/item/weapon/reagent_containers/food/container_resist(mob/living/M)
if(food_inserted_micros)
food_inserted_micros -= M
M.forceMove(get_turf(src))
to_chat(M, "<span class='warning'>You climb out of \the [src].</span>")
#undef CELLS
#undef CELLSIZE

View File

@@ -16,6 +16,9 @@
var/cant_open = 0
var/cant_chance = 0
/// Yims
food_can_insert_micro = TRUE
/obj/item/weapon/reagent_containers/food/drinks/Initialize()
. = ..()
if (prob(cant_chance))
@@ -30,9 +33,82 @@
price_tag = null
return
/obj/item/weapon/reagent_containers/food/drinks/proc/On_Consume(var/mob/M, var/mob/user, var/changed = FALSE)
/obj/item/weapon/reagent_containers/food/drinks/Destroy()
if(food_inserted_micros)
for(var/mob/M in food_inserted_micros)
M.dropInto(loc)
food_inserted_micros -= M
. = ..()
return
/obj/item/weapon/reagent_containers/food/drinks/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(food_can_insert_micro && istype(W, /obj/item/weapon/holder))
if(!(istype(W, /obj/item/weapon/holder/micro) || istype(W, /obj/item/weapon/holder/mouse)))
. = ..()
return
if(!is_open_container())
to_chat(user, "<span class='warning'>You cannot drop anything into \the [src] without opening it first.</span>")
return
var/obj/item/weapon/holder/H = W
if(!food_inserted_micros)
food_inserted_micros = list()
var/mob/living/M = H.held_mob
M.forceMove(src)
H.held_mob = null
user.drop_from_inventory(H)
qdel(H)
food_inserted_micros += M
to_chat(user, "<span class='warning'>You drop [M] into \the [src].</span>")
to_chat(M, "<span class='warning'>[user] drops you into \the [src].</span>")
return
return ..()
/obj/item/weapon/reagent_containers/food/drinks/MouseDrop_T(mob/living/M, mob/user)
if(!user.stat && istype(M) && (M == user) && Adjacent(M) && (M.get_effective_size(TRUE) <= 0.50) && food_can_insert_micro)
if(!food_inserted_micros)
food_inserted_micros = list()
M.forceMove(src)
food_inserted_micros += M
to_chat(user, "<span class='warning'>You climb into \the [src].</span>")
return
return ..()
/obj/item/weapon/reagent_containers/food/drinks/proc/On_Consume(var/mob/living/M, var/mob/user, var/changed = FALSE)
if(!user)
user = M
if(food_inserted_micros && food_inserted_micros.len)
if(M.can_be_drop_pred && M.food_vore && M.vore_selected)
for(var/mob/living/F in food_inserted_micros)
if(!F.can_be_drop_prey || !F.food_vore)
continue
var/do_nom = FALSE
if(!reagents.total_volume)
do_nom = TRUE
else
var/nom_chance = (1 - (reagents.total_volume / volume))*100
if(prob(nom_chance))
do_nom = TRUE
if(do_nom)
F.forceMove(M.vore_selected)
food_inserted_micros -= F
if(!reagents.total_volume && changed)
M.visible_message("<span class='notice'>[M] finishes drinking \the [src].</span>","<span class='notice'>You finish drinking \the [src].</span>")
if(trash)
@@ -113,6 +189,8 @@
if(Adjacent(user))
if(cant_open)
. += "<span class='warning'>It doesn't have a ring pull!</span>"
if(food_inserted_micros && food_inserted_micros.len)
. += "<span class='notice'>It has [english_list(food_inserted_micros)] [!reagents?.total_volume ? "sitting" : "floating"] in it.</span>"
if(!reagents?.total_volume)
. += "<span class='notice'>It is empty!</span>"
else if (reagents.total_volume <= volume * 0.25)

View File

@@ -44,24 +44,43 @@
/// For packaged/canned food sounds
var/opening_sound = null
/// Sound of eating.
var/eating_sound = 'sound/items/eatfood.ogg'
/// Yems.
food_can_insert_micro = TRUE
/obj/item/weapon/reagent_containers/food/snacks/Initialize()
. = ..()
if(nutriment_amt)
reagents.add_reagent("nutriment",(nutriment_amt*2),nutriment_desc) //VOREStation Edit: Undoes global nutrition nerf
reagents.add_reagent("nutriment",(nutriment_amt*2),nutriment_desc)
//Placeholder for effect that trigger on eating that aren't tied to reagents.
/obj/item/weapon/reagent_containers/food/snacks/proc/On_Consume(var/mob/living/M)
if(!usr) // what
usr = M
if(food_inserted_micros && food_inserted_micros.len)
if(M.can_be_drop_pred && M.food_vore && M.vore_selected)
for(var/mob/living/F in food_inserted_micros)
if(!F.can_be_drop_prey || !F.food_vore)
continue
var/do_nom = FALSE
if(!reagents.total_volume)
do_nom = TRUE
else
var/nom_chance = (bitecount/(bitecount + (bitesize / reagents.total_volume) + 1))*100
if(prob(nom_chance))
do_nom = TRUE
if(do_nom)
F.forceMove(M.vore_selected)
food_inserted_micros -= F
if(!reagents.total_volume)
M.visible_message("<span class='notice'>[M] finishes eating \the [src].</span>","<span class='notice'>You finish eating \the [src].</span>")
// Embedded-in-food smol vore
for(var/obj/item/weapon/holder/holder in src)
if(holder.held_mob?.devourable)
holder.held_mob.forceMove(M.vore_selected)
holder.held_mob = null
qdel(holder)
usr.drop_from_inventory(src) // Drop food from inventory so it doesn't end up staying on the hud after qdel, and so inhands go away
@@ -114,7 +133,6 @@
return
user.setClickCooldown(user.get_attack_speed(src)) //puts a limit on how fast people can eat/drink things
//VOREStation Edit Begin
if (fullness <= 50)
to_chat(M, "<span class='danger'>You hungrily chew out a piece of [src] and gobble it!</span>")
if (fullness > 50 && fullness <= 150)
@@ -136,7 +154,6 @@
if (fullness > 6000) // There has to be a limit eventually.
to_chat(M, "<span class='danger'>Your stomach blorts and aches, prompting you to stop. You literally cannot force any more of [src] to go down your throat.</span>")
return 0
//VOREStation Edit End
else if(user.a_intent == I_HURT)
return ..()
@@ -208,7 +225,7 @@
forceMove(belly_target)
return 1
else if(reagents) //Handle ingestion of the reagent.
playsound(M,'sound/items/eatfood.ogg', rand(10,50), 1)
playsound(M, eating_sound, rand(10,50), 1)
if(reagents.total_volume)
//CHOMPStation Edit Begin
var/bite_mod = 1
@@ -252,6 +269,8 @@
/obj/item/weapon/reagent_containers/food/snacks/examine(mob/user)
. = ..()
if(Adjacent(user))
if(food_inserted_micros && food_inserted_micros.len)
. += "<span class='notice'>It has [english_list(food_inserted_micros)] stuck in it.</span>"
if(coating)
. += "<span class='notice'>It's coated in [coating.name]!</span>"
if(bitecount==0)
@@ -274,13 +293,40 @@
U.load_food(user, src)
return
if(food_can_insert_micro && istype(W, /obj/item/weapon/holder))
if(!(istype(W, /obj/item/weapon/holder/micro) || istype(W, /obj/item/weapon/holder/mouse)))
. = ..()
return
if(package || canned)
to_chat(user, "<span class='warning'>You cannot stuff anything into \the [src] without opening it first.</span>")
return
var/obj/item/weapon/holder/H = W
if(!food_inserted_micros)
food_inserted_micros = list()
var/mob/living/M = H.held_mob
M.forceMove(src)
H.held_mob = null
user.drop_from_inventory(H)
qdel(H)
food_inserted_micros += M
to_chat(user, "<span class='warning'>You stuff [M] into \the [src].</span>")
to_chat(M, "<span class='warning'>[user] stuffs you into \the [src].</span>")
return
if (is_sliceable())
//these are used to allow hiding edge items in food that is not on a table/tray
var/can_slice_here = isturf(src.loc) && ((locate(/obj/structure/table) in src.loc) || (locate(/obj/machinery/optable) in src.loc) || (locate(/obj/item/weapon/tray) in src.loc))
var/hide_item = !has_edge(W) || !can_slice_here
if (hide_item)
if (W.w_class >= src.w_class || is_robot_module(W))
if (W.w_class >= src.w_class || is_robot_module(W) || istype(W, /obj/item/weapon/holder))
return
to_chat(user, "<span class='warning'>You slip \the [W] inside \the [src].</span>")
@@ -305,9 +351,32 @@
for(var/i=1 to (slices_num-slices_lost))
var/obj/slice = new slice_path (src.loc)
reagents.trans_to_obj(slice, reagents_per_slice)
if(food_inserted_micros && food_inserted_micros.len && istype(slice, /obj/item/weapon/reagent_containers/food/snacks))
var/obj/item/weapon/reagent_containers/food/snacks/S = slice
for(var/mob/living/F in food_inserted_micros)
F.forceMove(S)
if(!S.food_inserted_micros)
S.food_inserted_micros = list()
S.food_inserted_micros += F
food_inserted_micros -= F
qdel(src)
return
/obj/item/weapon/reagent_containers/food/snacks/MouseDrop_T(mob/living/M, mob/user)
if(!user.stat && istype(M) && (M == user) && Adjacent(M) && (M.get_effective_size(TRUE) <= 0.50) && food_can_insert_micro)
if(!food_inserted_micros)
food_inserted_micros = list()
M.forceMove(src)
food_inserted_micros += M
to_chat(user, "<span class='warning'>You climb into \the [src].</span>")
return
return ..()
/obj/item/weapon/reagent_containers/food/snacks/proc/is_sliceable()
return (slices_num && slice_path && slices_num > 0)
@@ -315,6 +384,8 @@
if(contents)
for(var/atom/movable/something in contents)
something.dropInto(loc)
if(food_inserted_micros && (something in food_inserted_micros))
food_inserted_micros -= something
. = ..()
return

View File

@@ -29,6 +29,7 @@
can_be_drop_pred = client.prefs_vr.can_be_drop_pred
latejoin_vore = client.prefs_vr.latejoin_vore //CHOMPedit
throw_vore = client.prefs_vr.throw_vore
food_vore = client.prefs_vr.food_vore
allow_spontaneous_tf = client.prefs_vr.allow_spontaneous_tf
digest_leave_remains = client.prefs_vr.digest_leave_remains
allowmobvore = client.prefs_vr.allowmobvore

View File

@@ -37,6 +37,7 @@
var/slip_vore = TRUE //Enabled by default since you have to enable drop pred/prey to do this anyway
var/drop_vore = TRUE //Enabled by default since you have to enable drop pred/prey to do this anyway
var/throw_vore = TRUE //Enabled by default since you have to enable drop pred/prey to do this anyway
var/food_vore = TRUE //Enabled by default since you have to enable drop pred/prey to do this anyway
var/can_be_drop_prey = FALSE
var/can_be_drop_pred = FALSE
var/allow_spontaneous_tf = FALSE // Obviously.
@@ -287,6 +288,7 @@
P.drop_vore = src.drop_vore
P.slip_vore = src.slip_vore
P.throw_vore = src.throw_vore
P.food_vore = src.food_vore
P.stumble_vore = src.stumble_vore
P.eating_privacy_global = src.eating_privacy_global
@@ -345,6 +347,7 @@
slip_vore = P.slip_vore
throw_vore = P.throw_vore
stumble_vore = P.stumble_vore
food_vore = P.food_vore
eating_privacy_global = P.eating_privacy_global
nutrition_message_visible = P.nutrition_message_visible
@@ -1179,6 +1182,7 @@
dispvoreprefs += "<b>Slip Vore:</b> [slip_vore ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Throw vore:</b> [throw_vore ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Stumble Vore:</b> [stumble_vore ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Food Vore:</b> [food_vore ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Spontaneous transformation:</b> [allow_spontaneous_tf ? "Enabled" : "Disabled"]<br>"
dispvoreprefs += "<b>Can be stepped on/over:</b> [step_mechanics_pref ? "Allowed" : "Disallowed"]<br>"
dispvoreprefs += "<b>Can be picked up:</b> [pickup_pref ? "Allowed" : "Disallowed"]<br>"

View File

@@ -61,6 +61,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
var/stumble_vore = TRUE
var/slip_vore = TRUE
var/throw_vore = TRUE
var/food_vore = TRUE
var/resizable = TRUE
var/show_vore_fx = TRUE
@@ -196,6 +197,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
belly_prefs = json_from_file["belly_prefs"]
drop_vore = json_from_file["drop_vore"]
slip_vore = json_from_file["slip_vore"]
food_vore = json_from_file["food_vore"]
throw_vore = json_from_file["throw_vore"]
stumble_vore = json_from_file["stumble_vore"]
nutrition_message_visible = json_from_file["nutrition_message_visible"]
@@ -258,6 +260,8 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
throw_vore = TRUE
if(isnull(stumble_vore))
stumble_vore = TRUE
if(isnull(food_vore))
food_vore = TRUE
if(isnull(nutrition_message_visible))
nutrition_message_visible = TRUE
if(isnull(weight_message_visible))
@@ -348,6 +352,7 @@ V::::::V V::::::VO:::::::OOO:::::::ORR:::::R R:::::REE::::::EEEEEE
"slip_vore" = slip_vore,
"stumble_vore" = stumble_vore,
"throw_vore" = throw_vore,
"food_vore" = food_vore,
"nutrition_message_visible" = nutrition_message_visible,
"nutrition_messages" = nutrition_messages,
"weight_message_visible" = weight_message_visible,

View File

@@ -442,6 +442,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
"slip_vore" = host.slip_vore,
"stumble_vore" = host.stumble_vore,
"throw_vore" = host.throw_vore,
"food_vore" = host.food_vore,
"nutrition_message_visible" = host.nutrition_message_visible,
"nutrition_messages" = host.nutrition_messages,
"weight_message_visible" = host.weight_message_visible,
@@ -1640,6 +1641,10 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono",
host.throw_vore = !host.throw_vore
unsaved_changes = TRUE
return TRUE
if("toggle_food_vore")
host.food_vore = !host.food_vore
unsaved_changes = TRUE
return TRUE
if("switch_selective_mode_pref")
host.selective_preference = tgui_input_list(usr, "What would you prefer happen to you with selective bellymode?","Selective Bellymode", list(DM_DEFAULT, DM_DIGEST, DM_ABSORB, DM_DRAIN))
if(!(host.selective_preference))

View File

@@ -243,6 +243,7 @@
new_mob.stumble_vore = stumble_vore
new_mob.slip_vore = slip_vore
new_mob.throw_vore = throw_vore
new_mob.food_vore = food_vore
new_mob.resizable = resizable
new_mob.show_vore_fx = show_vore_fx
new_mob.step_mechanics_pref = step_mechanics_pref

View File

@@ -2009,6 +2009,7 @@ const VoreUserPreferences = (props, context) => {
stumble_vore,
slip_vore,
throw_vore,
food_vore,
nutrition_message_visible,
weight_message_visible,
eating_privacy_global,
@@ -2189,6 +2190,21 @@ const VoreUserPreferences = (props, context) => {
disabled: 'Throw Vore Disabled',
},
},
toggle_food_vore: {
action: 'toggle_food_vore',
test: food_vore,
tooltip: {
main:
'Allows for food related spontaneous vore to occur. ' +
' Note, you still need spontaneous vore pred and/or prey enabled.',
enable: 'Click here to allow for food vore.',
disable: 'Click here to disable food vore.',
},
content: {
enabled: 'Food Vore Enabled',
disabled: 'Food Vore Disabled',
},
},
spawnbelly: {
action: 'toggle_latejoin_vore',
test: latejoin_vore,
@@ -2472,6 +2488,9 @@ const VoreUserPreferences = (props, context) => {
<VoreUserPreferenceItem spec={preferences.toggle_throw_vore} />
</Flex.Item>
<Flex.Item basis="32%">
<VoreUserPreferenceItem spec={preferences.toggle_food_vore} />
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
<VoreUserPreferenceItem spec={preferences.spawnbelly} />
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
@@ -2492,7 +2511,7 @@ const VoreUserPreferences = (props, context) => {
tooltipPosition="top"
/>
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
<Flex.Item basis="32%">
<VoreUserPreferenceItem
spec={preferences.vore_fx}
tooltipPosition="top"
@@ -2504,13 +2523,13 @@ const VoreUserPreferences = (props, context) => {
tooltipPosition="top"
/>
</Flex.Item>
<Flex.Item basis="32%">
<Flex.Item basis="32%" grow={1}>
<VoreUserPreferenceItem
spec={preferences.pickuppref}
tooltipPosition="top"
/>
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
<Flex.Item basis="32%">
<VoreUserPreferenceItem spec={preferences.spontaneous_tf} />
</Flex.Item>
<Flex.Item basis="32%">

View File

@@ -2111,6 +2111,7 @@ const VoreUserPreferences = (props, context) => {
stumble_vore,
slip_vore,
throw_vore,
food_vore,
nutrition_message_visible,
weight_message_visible,
eating_privacy_global,
@@ -2291,6 +2292,21 @@ const VoreUserPreferences = (props, context) => {
disabled: 'Throw Vore Disabled',
},
},
toggle_food_vore: {
action: 'toggle_food_vore',
test: food_vore,
tooltip: {
main:
'Allows for food related spontaneous vore to occur. ' +
' Note, you still need spontaneous vore pred and/or prey enabled.',
enable: 'Click here to allow for food vore.',
disable: 'Click here to disable food vore.',
},
content: {
enabled: 'Food Vore Enabled',
disabled: 'Food Vore Disabled',
},
},
spawnbelly: {
action: 'toggle_latejoin_vore',
test: latejoin_vore,
@@ -2574,6 +2590,9 @@ const VoreUserPreferences = (props, context) => {
<VoreUserPreferenceItem spec={preferences.toggle_throw_vore} />
</Flex.Item>
<Flex.Item basis="32%">
<VoreUserPreferenceItem spec={preferences.toggle_food_vore} />
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
<VoreUserPreferenceItem spec={preferences.spawnbelly} />
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
@@ -2594,7 +2613,7 @@ const VoreUserPreferences = (props, context) => {
tooltipPosition="top"
/>
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
<Flex.Item basis="32%">
<VoreUserPreferenceItem
spec={preferences.vore_fx}
tooltipPosition="top"
@@ -2606,13 +2625,13 @@ const VoreUserPreferences = (props, context) => {
tooltipPosition="top"
/>
</Flex.Item>
<Flex.Item basis="32%">
<Flex.Item basis="32%" grow={1}>
<VoreUserPreferenceItem
spec={preferences.pickuppref}
tooltipPosition="top"
/>
</Flex.Item>
<Flex.Item basis="32%" grow={1}>
<Flex.Item basis="32%">
<VoreUserPreferenceItem spec={preferences.spontaneous_tf} />
</Flex.Item>
<Flex.Item basis="32%">

File diff suppressed because one or more lines are too long