Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eating): initial version of food eating #602

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HookWoods
Copy link
Contributor

Description

This PR is the initial version of food eating, the PR is still in draft cause some small bugs are present but this is working in a general way.

I implemented food and consumable item properties at the json loading so like that we have a generic way of handling food data

Some system will need to be handled later like effects ticking when eating some food but we currently send effect data to clients.

The system I implemented is very basic, I created a trait of PumpkinItem to handle all food function like eating duration, start eating, common on use, ...
Then there is a basic eating ticking that will send packet to client, check if eating is finished or if player has cancel the eating effect

Testing

Please follow our Coding Guidelines

Comment on lines +9 to +251

#[async_trait]
impl PumpkinFood for DriedKelpItem {}

#[pumpkin_item("sweet_berries")]
pub struct SweetBerriesItem;

#[async_trait]
impl PumpkinFood for SweetBerriesItem {}

#[pumpkin_item("honey_bottle")]
pub struct HoneyBottleItem;

#[async_trait]
impl PumpkinFood for HoneyBottleItem {}

// Additional foods
#[pumpkin_item("cookie")]
pub struct CookieItem;

#[async_trait]
impl PumpkinFood for CookieItem {}

#[pumpkin_item("melon_slice")]
pub struct MelonSliceItem;

#[async_trait]
impl PumpkinFood for MelonSliceItem {}

#[pumpkin_item("beetroot")]
pub struct BeetrootItem;

#[async_trait]
impl PumpkinFood for BeetrootItem {}

#[pumpkin_item("beetroot_soup")]
pub struct BeetrootSoupItem;

#[async_trait]
impl PumpkinFood for BeetrootSoupItem {}

#[pumpkin_item("mushroom_stew")]
pub struct MushroomStewItem;

#[async_trait]
impl PumpkinFood for MushroomStewItem {}

#[pumpkin_item("rabbit_stew")]
pub struct RabbitStewItem;

#[async_trait]
impl PumpkinFood for RabbitStewItem {}

#[pumpkin_item("carrot")]
pub struct CarrotItem;

#[async_trait]
impl PumpkinFood for CarrotItem {}

#[pumpkin_item("potato")]
pub struct PotatoItem;

#[async_trait]
impl PumpkinFood for PotatoItem {}

#[pumpkin_item("baked_potato")]
pub struct BakedPotatoItem;

#[async_trait]
impl PumpkinFood for BakedPotatoItem {}

#[pumpkin_item("poisonous_potato")]
pub struct PoisonousPotatoItem;

#[async_trait]
impl PumpkinFood for PoisonousPotatoItem {}

#[pumpkin_item("pumpkin_pie")]
pub struct PumpkinPieItem;

#[async_trait]
impl PumpkinFood for PumpkinPieItem {}

#[pumpkin_item("tropical_fish")]
pub struct TropicalFishItem;

#[async_trait]
impl PumpkinFood for TropicalFishItem {}

#[pumpkin_item("pufferfish")]
pub struct PufferfishItem;

#[async_trait]
impl PumpkinFood for PufferfishItem {}

#[pumpkin_item("glow_berries")]
pub struct GlowBerriesItem;

#[async_trait]
impl PumpkinFood for GlowBerriesItem {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why implementing all foods yourself, We have a data driven design to not hard code such things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants