feat: added property damage boost
This commit is contained in:
parent
6c3c50689a
commit
1c66dbf499
3 changed files with 21 additions and 4 deletions
|
|
@ -178,6 +178,12 @@ pub struct FactionUpgrades {
|
||||||
pub side_effects: u16,
|
pub side_effects: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Component, Default)]
|
||||||
|
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
|
||||||
|
pub struct Property {
|
||||||
|
pub damage: bool,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
|
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
|
||||||
pub enum DrugCooldown {
|
pub enum DrugCooldown {
|
||||||
|
|
@ -204,4 +210,5 @@ pub(crate) struct PassiveBundle {
|
||||||
pub merits: Merits,
|
pub merits: Merits,
|
||||||
pub education: Education,
|
pub education: Education,
|
||||||
pub faction: FactionUpgrades,
|
pub faction: FactionUpgrades,
|
||||||
|
pub property: Property,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use bevy_ecs::prelude::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
bundle::{
|
bundle::{
|
||||||
armour::PlayerArmour,
|
armour::PlayerArmour,
|
||||||
passive::{DrugCooldown, Education, FactionUpgrades, Merits, PassiveBundle},
|
passive::{DrugCooldown, Education, FactionUpgrades, Merits, PassiveBundle, Property},
|
||||||
player::{PlayerBundle, PlayerStrategy, Weapons},
|
player::{PlayerBundle, PlayerStrategy, Weapons},
|
||||||
stat::{Defence, Dexterity, Speed, StatBundle, Strength},
|
stat::{Defence, Dexterity, Speed, StatBundle, Strength},
|
||||||
},
|
},
|
||||||
|
|
@ -43,6 +43,7 @@ pub struct PlayerDto {
|
||||||
pub stats: Stats,
|
pub stats: Stats,
|
||||||
pub merits: Option<Merits>,
|
pub merits: Option<Merits>,
|
||||||
pub education: Option<Education>,
|
pub education: Option<Education>,
|
||||||
|
pub property: Option<Property>,
|
||||||
pub weapons: EquippedWeapons,
|
pub weapons: EquippedWeapons,
|
||||||
pub armour: EquippedArmour,
|
pub armour: EquippedArmour,
|
||||||
pub faction: Option<FactionUpgrades>,
|
pub faction: Option<FactionUpgrades>,
|
||||||
|
|
@ -65,11 +66,13 @@ impl PlayerDto {
|
||||||
let education = self.education.unwrap_or_default();
|
let education = self.education.unwrap_or_default();
|
||||||
let merits = self.merits.unwrap_or_default();
|
let merits = self.merits.unwrap_or_default();
|
||||||
let faction = self.faction.unwrap_or_default();
|
let faction = self.faction.unwrap_or_default();
|
||||||
|
let property = self.property.unwrap_or_default();
|
||||||
|
|
||||||
commands.insert(PassiveBundle {
|
commands.insert(PassiveBundle {
|
||||||
education,
|
education,
|
||||||
merits,
|
merits,
|
||||||
faction,
|
faction,
|
||||||
|
property,
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut weapons = None;
|
let mut weapons = None;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use bevy_ecs::prelude::*;
|
use bevy_ecs::prelude::*;
|
||||||
use proxisim_models::bundle::{
|
use proxisim_models::bundle::{
|
||||||
passive::{Education, EducationPartDamageBonus, FactionUpgrades, Merits},
|
passive::{Education, EducationPartDamageBonus, FactionUpgrades, Merits, Property},
|
||||||
player::{Current, PartDamageBonus},
|
player::{Current, PartDamageBonus},
|
||||||
stat::{
|
stat::{
|
||||||
AdditiveBonus, AmmoControl, ClipSize, Clips, CritRate, DamageBonus, Dexterity,
|
AdditiveBonus, AmmoControl, ClipSize, Clips, CritRate, DamageBonus, Dexterity,
|
||||||
|
|
@ -169,7 +169,7 @@ fn apply_passives(
|
||||||
Has<Japanese>,
|
Has<Japanese>,
|
||||||
&ChildOf,
|
&ChildOf,
|
||||||
)>,
|
)>,
|
||||||
player_q: Query<(&Merits, &Education, &FactionUpgrades)>,
|
player_q: Query<(&Merits, &Education, &FactionUpgrades, &Property)>,
|
||||||
mut effects: Effects,
|
mut effects: Effects,
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
) {
|
) {
|
||||||
|
|
@ -354,7 +354,7 @@ fn apply_passives(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let (merits, education, faction) = player_q.get(player.parent()).unwrap();
|
let (merits, education, faction, property) = player_q.get(player.parent()).unwrap();
|
||||||
|
|
||||||
let (mastery, edu_acc) = match cat {
|
let (mastery, edu_acc) = match cat {
|
||||||
WeaponCategory::HeavyArtillery => (
|
WeaponCategory::HeavyArtillery => (
|
||||||
|
|
@ -458,6 +458,13 @@ fn apply_passives(
|
||||||
weapon,
|
weapon,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if property.damage {
|
||||||
|
effects.spawn(
|
||||||
|
SimpleStatBonus::<DamageBonus>::new("property", 0.02),
|
||||||
|
weapon,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue