updates?
This commit is contained in:
parent
e7d6b74aab
commit
35413b563c
33 changed files with 10238 additions and 1891 deletions
199
models/src/bundle/bonus.rs
Normal file
199
models/src/bundle/bonus.rs
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
use bevy_ecs::{bundle::Bundle, component::Component};
|
||||
use strum::Display;
|
||||
|
||||
use crate::bundle::player::BodyPart;
|
||||
|
||||
#[derive(Component, Debug, Clone, Copy)]
|
||||
#[cfg_attr(feature = "json", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(feature = "json", serde(rename_all = "snake_case"))]
|
||||
pub enum WeaponBonusType {
|
||||
// Weapon passives
|
||||
Berserk,
|
||||
Conserve,
|
||||
Expose,
|
||||
Grace,
|
||||
Powerful,
|
||||
Specialist,
|
||||
|
||||
// Turn triggered passives
|
||||
Empower,
|
||||
Quicken,
|
||||
|
||||
// First turn effects
|
||||
Assassinate,
|
||||
|
||||
// Additive status effects triggered by damaging hits
|
||||
Cripple,
|
||||
Demoralise,
|
||||
Freeze,
|
||||
Motivate,
|
||||
Slow,
|
||||
Toxin,
|
||||
Weaken,
|
||||
Wither,
|
||||
|
||||
// DOT status effects
|
||||
Bleed,
|
||||
Burning,
|
||||
Lacerate,
|
||||
Poison,
|
||||
SevereBurning,
|
||||
|
||||
// Other status effects
|
||||
Eviscerate,
|
||||
Paralyse,
|
||||
Schock,
|
||||
Stun,
|
||||
|
||||
// Multi attack bonuses
|
||||
Blindfire,
|
||||
Fury,
|
||||
DoubleTap,
|
||||
Rage,
|
||||
|
||||
// Body part multipliers
|
||||
Achilles,
|
||||
Crusher,
|
||||
Cupid,
|
||||
Deadeye,
|
||||
Roshambo,
|
||||
Throttle,
|
||||
|
||||
// Attack nullification types
|
||||
Homerun,
|
||||
Parry,
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct BonusValue(pub f32);
|
||||
|
||||
#[derive(Bundle)]
|
||||
pub struct WeaponBonusBundle {
|
||||
pub bonus: WeaponBonusType,
|
||||
pub value: BonusValue,
|
||||
}
|
||||
|
||||
impl WeaponBonusBundle {
|
||||
pub fn new(bonus: WeaponBonusType, value: f32) -> Self {
|
||||
Self {
|
||||
bonus,
|
||||
value: BonusValue(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum TurnTriggeredBonus {
|
||||
Empower,
|
||||
Quicken,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum FirstTurnBonus {
|
||||
Assassinate,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum MultiTurnBonus {
|
||||
Blindfire,
|
||||
Fury,
|
||||
DoubleTap,
|
||||
Rage,
|
||||
}
|
||||
|
||||
impl MultiTurnBonus {
|
||||
#[inline(always)]
|
||||
pub fn counter_label(self) -> &'static str {
|
||||
match self {
|
||||
Self::Blindfire => "proc_blindfire",
|
||||
Self::Fury => "proc_fury",
|
||||
Self::DoubleTap => "proc_double_tap",
|
||||
Self::Rage => "proc_rage",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum OpponentStatusEffect {
|
||||
Cripple,
|
||||
// TODO: implement for group fights
|
||||
Demoralise,
|
||||
Freeze,
|
||||
Slow,
|
||||
Toxin,
|
||||
Weaken,
|
||||
Wither,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum SelfStatusEffect {
|
||||
Motivate,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum BonusPartDamageBonus {
|
||||
Achilles,
|
||||
Crusher,
|
||||
Cupid,
|
||||
Deadeye,
|
||||
Roshambo,
|
||||
Throttle,
|
||||
}
|
||||
|
||||
impl BonusPartDamageBonus {
|
||||
pub fn dmg_bonus(self, part: BodyPart, value: f32) -> Option<f32> {
|
||||
match self {
|
||||
Self::Achilles => match part {
|
||||
BodyPart::LeftFoot | BodyPart::RightFoot => Some(value),
|
||||
_ => None,
|
||||
},
|
||||
Self::Crusher => {
|
||||
if part == BodyPart::Head {
|
||||
Some(value)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
Self::Cupid => {
|
||||
if part == BodyPart::Heart {
|
||||
Some(value)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
Self::Deadeye => match part {
|
||||
BodyPart::Head | BodyPart::Heart | BodyPart::Throat => Some(value),
|
||||
_ => None,
|
||||
},
|
||||
Self::Roshambo => {
|
||||
if part == BodyPart::Groin {
|
||||
Some(value)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
Self::Throttle => {
|
||||
if part == BodyPart::Throat {
|
||||
Some(value)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Display)]
|
||||
#[cfg_attr(feature = "json", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(feature = "json", serde(rename_all = "snake_case"))]
|
||||
pub enum ArmourBonusType {
|
||||
Impregnable,
|
||||
Impenetrable,
|
||||
Insurmountable,
|
||||
Invulnerable,
|
||||
Imperviable,
|
||||
Immmutable,
|
||||
Irrepressible,
|
||||
Kinetokinesis,
|
||||
Impassable,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue