This commit is contained in:
TotallyNot 2025-11-03 16:36:45 +01:00
parent e7d6b74aab
commit 35413b563c
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
33 changed files with 10238 additions and 1891 deletions

View file

@ -1,217 +1,10 @@
use bevy_ecs::prelude::*;
use crate::{
effect::Effects,
player::{
stats::{AdditiveBonus, CritRate, Defence, Dexterity, SimpleStatBonus, Speed, Strength},
BodyPart,
},
Stages,
use proxisim_models::bundle::{
passive::{DrugCooldown, Education, FactionUpgrades, Merits},
stat::{AdditiveBonus, CritRate, Defence, Dexterity, SimpleStatBonus, Speed, Strength},
};
#[derive(Component, Default)]
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
pub struct Merits {
pub life: u16,
pub crits: u16,
pub brawn: u16,
pub protection: u16,
pub sharpness: u16,
pub evasion: u16,
pub heavy_artillery_mastery: u16,
pub machine_gun_mastery: u16,
pub rifle_mastery: u16,
pub smg_mastery: u16,
pub shotgun_mastery: u16,
pub pistol_mastery: u16,
pub club_mastery: u16,
pub piercing_mastery: u16,
pub slashing_mastery: u16,
pub mechanical_mastery: u16,
pub temporary_mastery: u16,
}
#[derive(Component)]
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
pub struct Education {
/// Gain a 1% damage bonus to all weapons
pub bio2350: bool,
/// Gain a 10% damage increase when hitting an opponent's throat
pub bio2380: bool,
/// Gain a 3% chance increase of achieving a critical hit
pub bio2410: bool,
/// Gain a 1% passive bonus to speed
pub cbt2790: bool,
/// Gain a +1.00 accuracy increase with Machine Guns
pub cbt2820: bool,
/// Gain a +1.00 accuracy increase with Submachine guns
pub cbt2830: bool,
/// Gain a +1.00 accuracy increase with Pistols
pub cbt2840: bool,
/// Gain a +1.00 accuracy increase with Rifles
pub cbt2850: bool,
/// Gain a +1.00 accuracy increase with Heavy Artillery
pub cbt2860: bool,
/// Gain a +1.00 accuracy increase with Shotguns
pub cbt2125: bool,
/// Gain a +1.00 accuracy increase with Temporary weapons
pub gen2116: bool,
/// Gain a 5% damage increase with Temporary weapons
pub gen2119: bool,
/// Gain a 1% passive bonus to dexterity
pub haf2104: bool,
/// Gain a 1% passive bonus to speed
pub haf2105: bool,
/// Gain a 1% passive bonus to strength
pub haf2106: bool,
/// Gain a 2% passive bonus to strength
pub haf2107: bool,
/// Gain a 1% passive bonus to dexterity
pub haf2108: bool,
/// Gain a 3% passive bonus to speed
pub haf2109: bool,
/// Gain a 10% damage increase with Japanese blade weapons
pub his2160: bool,
/// Gain a 2% bonus to all melee damage
pub his2170: bool,
/// Gain a 1% passive bonus to speed
pub mth2240: bool,
/// Gain a 1% passive bonus to speed
pub mth2250: bool,
/// Gain a 1% passive bonus to defense
pub mth2260: bool,
/// Gain a 2% passive bonus to defense
pub mth2320: bool,
/// Gain a 5% bonus to ammo conservation
pub mth2310: bool,
/// Gain a 20% bonus to ammo conservation
pub mth3330: bool,
/// Gain a 1% passive bonus to dexterity
pub psy2640: bool,
/// Gain a 2% passive bonus to dexterity
pub psy2650: bool,
/// Gain a 4% passive bonus to dexterity
pub psy2660: bool,
/// Gain an 8% passive bonus to dexterity
pub psy2670: bool,
/// Gain a 1% passive bonus to defense
pub def2710: bool,
/// Gain a 2% passive bonus to defense
pub def2730: bool,
/// Gain a 3% passive bonus to defense
pub def2740: bool,
/// Gain a 2% passive bonus to speed
pub def2750: bool,
/// Gain a 3% passive bonus to speed
pub def2760: bool,
/// Gain a 100% increase in damage dealt when using fists alone
pub def3770: bool,
/// Gain a 10% increase in steroid effectiveness
// NOTE: this effect is additive with the strip club perks
pub spt2480: bool,
/// Gain a 2% passive bonus to speed and strength
pub spt2490: bool,
/// Gain a 2% passive bonus to defense and dexterity
pub spt2500: bool,
}
impl Default for Education {
fn default() -> Self {
Self {
bio2350: true,
bio2380: true,
bio2410: true,
cbt2790: true,
cbt2820: true,
cbt2830: true,
cbt2840: true,
cbt2850: true,
cbt2860: true,
cbt2125: true,
gen2116: true,
gen2119: true,
haf2104: true,
haf2105: true,
haf2106: true,
haf2107: true,
haf2108: true,
haf2109: true,
his2160: true,
his2170: true,
mth2240: true,
mth2250: true,
mth2260: true,
mth2320: true,
mth2310: true,
mth3330: true,
psy2640: true,
psy2650: true,
psy2660: true,
psy2670: true,
def2710: true,
def2730: true,
def2740: true,
def2750: true,
def2760: true,
def3770: true,
spt2480: true,
spt2490: true,
spt2500: true,
}
}
}
#[derive(Component, Default)]
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
pub struct FactionUpgrades {
pub str: u16,
pub spd: u16,
pub def: u16,
pub dex: u16,
pub life: u16,
pub acc: u16,
pub dmg: u16,
pub side_effects: u16,
}
#[derive(Component)]
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
pub enum DrugCooldown {
Xanax,
Vicodin,
}
#[derive(Clone, Copy)]
pub enum EducationPartDamageBonus {
Bio2380,
}
impl EducationPartDamageBonus {
pub fn dmg_bonus(self, part: BodyPart) -> Option<f32> {
match part {
BodyPart::Throat => Some(0.10),
_ => None,
}
}
}
#[derive(Bundle, Default)]
pub(crate) struct PassiveBundle {
pub merits: Merits,
pub education: Education,
pub faction: FactionUpgrades,
}
use crate::{effect::Effects, Stages};
fn spawn_permanent_effects(
merit_q: Query<(