feat: added more passives
This commit is contained in:
parent
34fe16407e
commit
c7089d2deb
6 changed files with 363 additions and 9 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use bevy_ecs::{bundle::Bundle, component::Component};
|
||||
use strum::EnumIter;
|
||||
|
||||
use crate::bundle::player::BodyPart;
|
||||
|
||||
|
|
@ -186,11 +187,194 @@ pub struct Property {
|
|||
|
||||
#[derive(Component)]
|
||||
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
|
||||
#[cfg_attr(feature = "json", serde(rename_all = "snake_case"))]
|
||||
pub enum DrugCooldown {
|
||||
Xanax,
|
||||
Vicodin,
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
#[cfg_attr(feature = "json", derive(serde::Deserialize))]
|
||||
pub struct DrugAddiction {
|
||||
pub level: u16,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "json", derive(serde::Deserialize, serde::Serialize))]
|
||||
#[cfg_attr(feature = "json", serde(rename_all = "snake_case"))]
|
||||
#[derive(Debug, Clone, Copy, Component, EnumIter)]
|
||||
pub enum Job {
|
||||
/// 25% enemy speed reduction
|
||||
AdultNovelties7,
|
||||
/// 25% epinephrine effect & duration
|
||||
AmusementPark7,
|
||||
/// +25% Passive Dexterity
|
||||
ClothingStore5,
|
||||
/// +20% Armor Bonus
|
||||
ClothingStore10,
|
||||
/// +25% Flamethrower Damage, +10 Flamethrower Accuracy
|
||||
FireworksStand5,
|
||||
/// 25% passive strength
|
||||
FurnitureStore7,
|
||||
/// 100% fist & kick damage
|
||||
FurnitureStore10,
|
||||
/// +25% bonus to Speed
|
||||
GasStation3,
|
||||
/// Occasional 20% health regeneration (10% chance per turn)
|
||||
GasStation5,
|
||||
/// 50% reduction to Burning damage received
|
||||
GasStation7,
|
||||
/// 50% bonus to Burning damage dealt
|
||||
GasStation10,
|
||||
/// +25% Passive Dexterity
|
||||
GentsStripClub3,
|
||||
/// +50% Tyrosine effect & duration
|
||||
GentsStripClub5,
|
||||
/// 1/4 chance to dodge melee attacks
|
||||
GentsStripClub10,
|
||||
/// 1 extra clip for guns during attacks
|
||||
GunShop7,
|
||||
/// 10% primary & secondary weapon damage
|
||||
GunShop10,
|
||||
/// 20% slashing weapon damage
|
||||
HairSalon10,
|
||||
/// +25% Passive Defense
|
||||
LadiesStripClub3,
|
||||
/// +50% Serotonin effect & duration
|
||||
LadiesStripClub5,
|
||||
/// 30% melee damage mitigation
|
||||
LadiesStripClub10,
|
||||
/// +50% speed and dexterity when not wearing armor
|
||||
LingeryStore5,
|
||||
/// 10% maximum life
|
||||
MiningCorporation7,
|
||||
/// +15% passive on all stats
|
||||
MusicStore10,
|
||||
/// +50% flash grenade intensity
|
||||
PrivateSecurityFirm3,
|
||||
/// 25% full set armor mitigation bonus
|
||||
PrivateSecurityFirm7,
|
||||
/// 10% melee weapon damage
|
||||
Pub3,
|
||||
/// 10% melee weapon damage
|
||||
Restaurant3,
|
||||
/// +3.00 Accuracy
|
||||
Zoo10,
|
||||
}
|
||||
|
||||
impl Job {
|
||||
pub fn has(self, other: Self) -> bool {
|
||||
matches!(
|
||||
(self, other),
|
||||
(Self::AdultNovelties7, Self::AdultNovelties7)
|
||||
| (Self::AmusementPark7, Self::AmusementPark7)
|
||||
| (
|
||||
Self::ClothingStore5,
|
||||
Self::ClothingStore5 | Self::ClothingStore10
|
||||
)
|
||||
| (Self::ClothingStore10, Self::ClothingStore10)
|
||||
| (Self::FireworksStand5, Self::FireworksStand5)
|
||||
| (
|
||||
Self::FurnitureStore7,
|
||||
Self::FurnitureStore7 | Self::FurnitureStore10
|
||||
)
|
||||
| (Self::FurnitureStore10, Self::FurnitureStore10)
|
||||
| (
|
||||
Self::GasStation3,
|
||||
Self::GasStation3 | Self::GasStation5 | Self::GasStation7 | Self::GasStation10
|
||||
)
|
||||
| (
|
||||
Self::GasStation5,
|
||||
Self::GasStation5 | Self::GasStation7 | Self::GasStation10
|
||||
)
|
||||
| (Self::GasStation7, Self::GasStation7 | Self::GasStation10)
|
||||
| (Self::GasStation10, Self::GasStation10)
|
||||
| (
|
||||
Self::GentsStripClub3,
|
||||
Self::GentsStripClub3 | Self::GentsStripClub5 | Self::GentsStripClub10
|
||||
)
|
||||
| (
|
||||
Self::GentsStripClub5,
|
||||
Self::GentsStripClub5 | Self::GentsStripClub10
|
||||
)
|
||||
| (Self::GentsStripClub10, Self::GentsStripClub10)
|
||||
| (Self::GunShop7, Self::GunShop7 | Self::GunShop10)
|
||||
| (Self::GunShop10, Self::GunShop10)
|
||||
| (Self::HairSalon10, Self::HairSalon10)
|
||||
| (
|
||||
Self::LadiesStripClub3,
|
||||
Self::LadiesStripClub3 | Self::LadiesStripClub5 | Self::LadiesStripClub10
|
||||
)
|
||||
| (
|
||||
Self::LadiesStripClub5,
|
||||
Self::LadiesStripClub5 | Self::LadiesStripClub10
|
||||
)
|
||||
| (Self::LadiesStripClub10, Self::LadiesStripClub10)
|
||||
| (Self::LingeryStore5, Self::LingeryStore5)
|
||||
| (Self::MiningCorporation7, Self::MiningCorporation7)
|
||||
| (Self::MusicStore10, Self::MusicStore10)
|
||||
| (
|
||||
Self::PrivateSecurityFirm3,
|
||||
Self::PrivateSecurityFirm3 | Self::PrivateSecurityFirm7
|
||||
)
|
||||
| (Self::PrivateSecurityFirm7, Self::PrivateSecurityFirm7)
|
||||
| (Self::Pub3, Self::Pub3)
|
||||
| (Self::Restaurant3, Self::Restaurant3)
|
||||
| (Self::Zoo10, Self::Zoo10)
|
||||
)
|
||||
}
|
||||
|
||||
pub fn label(self) -> &'static str {
|
||||
match self {
|
||||
Self::AdultNovelties7 => "Adult novelties 7*",
|
||||
Self::AmusementPark7 => "Amusement park 7*",
|
||||
Self::ClothingStore5 => "Clothing store 5*",
|
||||
Self::ClothingStore10 => "Clothing store 10*",
|
||||
Self::FireworksStand5 => "Fireworks stand 5*",
|
||||
Self::FurnitureStore7 => "Furniture store 7*",
|
||||
Self::FurnitureStore10 => "Furniture store 10*",
|
||||
Self::GasStation3 => "Gas station 3*",
|
||||
Self::GasStation5 => "Gas station 5*",
|
||||
Self::GasStation7 => "Gas station 7*",
|
||||
Self::GasStation10 => "Gas station 10*",
|
||||
Self::GentsStripClub3 => "Gents strip club 3*",
|
||||
Self::GentsStripClub5 => "Gents strip club 5*",
|
||||
Self::GentsStripClub10 => "Gents strip club 10*",
|
||||
Self::GunShop7 => "Gun shop 7*",
|
||||
Self::GunShop10 => "Gun shop 10*",
|
||||
Self::HairSalon10 => "Hair salon 10*",
|
||||
Self::LadiesStripClub3 => "Ladies strip club 3*",
|
||||
Self::LadiesStripClub5 => "Ladies strip club 5*",
|
||||
Self::LadiesStripClub10 => "Ladies strip club 10*",
|
||||
Self::LingeryStore5 => "Lingery store 5*",
|
||||
Self::MiningCorporation7 => "Mining corporation 7*",
|
||||
Self::MusicStore10 => "Music store 10*",
|
||||
Self::PrivateSecurityFirm3 => "Private security firm 3*",
|
||||
Self::PrivateSecurityFirm7 => "Private security firm 7*",
|
||||
Self::Pub3 => "Pub 3*",
|
||||
Self::Restaurant3 => "Restaurant 3*",
|
||||
Self::Zoo10 => "Zoo 10*",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn supported(self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Self::AmusementPark7
|
||||
| Self::ClothingStore5
|
||||
| Self::FurnitureStore7
|
||||
| Self::GasStation3
|
||||
| Self::GentsStripClub3
|
||||
| Self::GentsStripClub5
|
||||
| Self::GentsStripClub10
|
||||
| Self::LadiesStripClub3
|
||||
| Self::LadiesStripClub5
|
||||
| Self::LingeryStore5
|
||||
| Self::MiningCorporation7
|
||||
| Self::MusicStore10
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum EducationPartDamageBonus {
|
||||
Bio2380,
|
||||
|
|
|
|||
|
|
@ -149,6 +149,12 @@ pub enum ActionNullification {
|
|||
GentsStripClub,
|
||||
}
|
||||
|
||||
#[derive(Component, Debug)]
|
||||
pub enum BuildUpBonus {
|
||||
Focus { bonus: f32 },
|
||||
Finale { bonus: f32 },
|
||||
}
|
||||
|
||||
impl PartDamageBonus {
|
||||
pub fn dmg_bonus(&self, part: BodyPart) -> Option<f32> {
|
||||
match self {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@ use bevy_ecs::prelude::*;
|
|||
use crate::{
|
||||
bundle::{
|
||||
armour::PlayerArmour,
|
||||
passive::{DrugCooldown, Education, FactionUpgrades, Merits, PassiveBundle, Property},
|
||||
passive::{
|
||||
DrugAddiction, DrugCooldown, Education, FactionUpgrades, Job, Merits, PassiveBundle,
|
||||
Property,
|
||||
},
|
||||
player::{PlayerBundle, PlayerStrategy, Weapons},
|
||||
stat::{Defence, Dexterity, Speed, StatBundle, Strength},
|
||||
},
|
||||
|
|
@ -49,6 +52,9 @@ pub struct PlayerDto {
|
|||
pub faction: Option<FactionUpgrades>,
|
||||
pub drug: Option<DrugCooldown>,
|
||||
pub strategy: PlayerStrategy,
|
||||
pub cooldown: Option<DrugCooldown>,
|
||||
pub addiction: Option<DrugAddiction>,
|
||||
pub job: Option<Job>,
|
||||
}
|
||||
|
||||
impl PlayerDto {
|
||||
|
|
@ -118,6 +124,18 @@ impl PlayerDto {
|
|||
commands.insert(armour);
|
||||
}
|
||||
|
||||
if let Some(cooldown) = self.cooldown {
|
||||
commands.insert(cooldown);
|
||||
}
|
||||
|
||||
if let Some(addiction) = self.addiction {
|
||||
commands.insert(addiction);
|
||||
}
|
||||
|
||||
if let Some(job) = self.job {
|
||||
commands.insert(job);
|
||||
}
|
||||
|
||||
commands
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,8 +296,10 @@ impl WeaponDto {
|
|||
814 => commands.insert(BuffingTemp::Tyrosine),
|
||||
464 => commands.insert(BuffingTemp::Melatonin),
|
||||
463 => commands.insert(BuffingTemp::Epinephrine),
|
||||
// damaging temps always hit the body
|
||||
_ => commands.insert(NonTargeted),
|
||||
// exploding temps always hit the body
|
||||
// TODO: how does that interact with armour?
|
||||
242 | 217 | 220 | 221 | 840 => commands.insert(NonTargeted),
|
||||
_ => &mut commands,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue