feat: added parry and homerun

This commit is contained in:
TotallyNot 2025-11-05 19:40:16 +01:00
parent 71169690b7
commit 67131c7985
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
9 changed files with 440 additions and 181 deletions

View file

@ -59,7 +59,7 @@ pub enum WeaponBonusType {
Roshambo,
Throttle,
// Attack nullification types
// Action nullification types
Homerun,
Parry,

View file

@ -21,6 +21,9 @@ pub struct Defeated;
#[derive(Component)]
pub struct Current;
#[derive(Component)]
pub struct PickedAction(pub WeaponSlot);
#[derive(Component)]
pub struct CurrentTarget;
@ -139,6 +142,13 @@ pub enum HealthChange {
DoubleEdged { dmg: u32 },
}
#[derive(Component, Debug)]
pub enum ActionNullification {
Parry { chance: f64 },
Homerun { chance: f64 },
GentsStripClub,
}
impl PartDamageBonus {
pub fn dmg_bonus(&self, part: BodyPart) -> Option<f32> {
match self {

View file

@ -305,11 +305,11 @@ impl WeaponDto {
commands.insert(EquippedMods(mods));
if let Some(bonus) = &self.bonuses[0] {
commands.insert(children![WeaponBonusBundle::new(bonus.bonus, bonus.value)]);
commands.with_child(WeaponBonusBundle::new(bonus.bonus, bonus.value));
}
if let Some(bonus) = &self.bonuses[1] {
commands.insert(children![WeaponBonusBundle::new(bonus.bonus, bonus.value)]);
commands.with_child(WeaponBonusBundle::new(bonus.bonus, bonus.value));
}
commands.id()