[WIP] Implement Potion Effects - #430
Conversation
|
I'm gonna make method to get effect on quill. |
There was a problem hiding this comment.
Just a few things I see, I know its not done yet.
Going forward, I think the best plan of action would be some form of trait for doing potion work. It would likely extend Entity so we can do entity.add_effect::<SlownessEffect>(5, 727727727); and so on.
Additionally, don't forget to write the systems to manage effect state every tick.
| impl_effect!(Speed); | ||
| impl_effect!(Slowness); | ||
| impl_effect!(Haste); | ||
| impl_effect!(MiningFatigue); | ||
| impl_effect!(Strength); | ||
| impl_effect!(InstantHealth); | ||
| impl_effect!(InstantDamage); | ||
| impl_effect!(JumpBoost); | ||
| impl_effect!(Nausea); | ||
| impl_effect!(Regeneration); | ||
| impl_effect!(Resistance); | ||
| impl_effect!(FireResistance); | ||
| impl_effect!(WaterBreathing); | ||
| impl_effect!(Invisibility); | ||
| impl_effect!(Blindness); | ||
| impl_effect!(NightVision); | ||
| impl_effect!(Hunger); | ||
| impl_effect!(Weakness); | ||
| impl_effect!(Poison); | ||
| impl_effect!(WitherEffect); | ||
| impl_effect!(HealthBoost); | ||
| impl_effect!(Absorption); | ||
| impl_effect!(Saturation); | ||
| impl_effect!(Glowing); | ||
| impl_effect!(Levitation); | ||
| impl_effect!(Luck); | ||
| impl_effect!(BadLuck); | ||
| impl_effect!(SlowFalling); | ||
| impl_effect!(ConduitPower); | ||
| impl_effect!(DolphinsGrace); | ||
| impl_effect!(BadOmen); | ||
| impl_effect!(HeroOfTheVillage); |
There was a problem hiding this comment.
All of these should have the Effect suffix.
| pub ambient: bool, // given from beacon or not. | ||
| pub icon: bool, // show effect icon. |
There was a problem hiding this comment.
Switch the comments to doc comments on the members, consider adding one for particle and duration.
| macro_rules! impl_effect { | ||
| ($ident:ident) => { | ||
| #[derive(Serialize, Deserialize, Eq, PartialEq, Hash)] | ||
| pub struct $ident(BTreeSet<PotionApplication>); | ||
| impl $ident {} | ||
| bincode_component_impl!($ident); | ||
| }; | ||
| } |
There was a problem hiding this comment.
I think we might have somewhere we try to consolidate macros? Not sure.
| #[derive(Copy, Clone, Debug, Hash, Serialize, PartialEq, Eq, Deserialize)] | ||
| pub struct PotionApplication { | ||
| pub amplifier: u8, | ||
| pub duration: u32, | ||
| pub particle: bool, | ||
| pub ambient: bool, // given from beacon or not. | ||
| pub icon: bool, // show effect icon. |
There was a problem hiding this comment.
We could probably move effects into their own module.
There was a problem hiding this comment.
the effect enum was originally in libcraft but I made a transition to components.
|
Hi there, it appears your PR has been inactive for a while. Are you planning to continue it? Please let me know so I can either pick it up or wait for more progress. |
|
yeah im try to continue but no progress |

Implement Potion Effects
Status
Description
Implemented Potion Effects.
Related issues
Checklist
cargo fmt,cargo clippy,cargo build --releaseandcargo testand fixed any generated errors!