feat: added more passives
This commit is contained in:
parent
34fe16407e
commit
c7089d2deb
6 changed files with 363 additions and 9 deletions
154
src/passives.rs
154
src/passives.rs
|
|
@ -1,6 +1,8 @@
|
|||
use bevy_ecs::prelude::*;
|
||||
use proxisim_models::bundle::{
|
||||
passive::{DrugCooldown, Education, FactionUpgrades, Merits},
|
||||
armour::PlayerArmour,
|
||||
passive::{DrugAddiction, DrugCooldown, Education, FactionUpgrades, Job, Merits},
|
||||
player::ActionNullification,
|
||||
stat::{
|
||||
AdditiveBonus, CritRate, Defence, Dexterity, MaxHealth, SimpleStatBonus, Speed, Strength,
|
||||
},
|
||||
|
|
@ -10,7 +12,8 @@ use crate::{
|
|||
Stages,
|
||||
effect::Effects,
|
||||
player::status_effect::{
|
||||
ExtraStatusEffectEffectiveness, Hardened, Hastened, Sharpened, Strengthened,
|
||||
ExtraStatusEffectDuration, ExtraStatusEffectEffectiveness, Hardened, Hastened, Sharpened,
|
||||
Strengthened,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -21,11 +24,14 @@ fn spawn_permanent_effects(
|
|||
&Education,
|
||||
&FactionUpgrades,
|
||||
Option<&DrugCooldown>,
|
||||
Option<&DrugAddiction>,
|
||||
Option<&Job>,
|
||||
&PlayerArmour,
|
||||
)>,
|
||||
mut effects: Effects,
|
||||
mut commands: Commands,
|
||||
) {
|
||||
for (player, merits, edu, faction, drug_cd) in merit_q.iter() {
|
||||
for (player, merits, edu, faction, drug_cd, addiction, job, armour) in merit_q.iter() {
|
||||
if merits.brawn > 0 {
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Strength>::new("brawn", (merits.brawn as f32) * 0.03),
|
||||
|
|
@ -155,6 +161,34 @@ fn spawn_permanent_effects(
|
|||
_ => (),
|
||||
}
|
||||
|
||||
if let Some(addiction) = addiction {
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Strength>::new("addiction", -0.01 * addiction.level as f32),
|
||||
player,
|
||||
);
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Speed>::new("addiction", -0.01 * addiction.level as f32),
|
||||
player,
|
||||
);
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Defence>::new("addiction", -0.01 * addiction.level as f32),
|
||||
player,
|
||||
);
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Dexterity>::new("addiction", -0.01 * addiction.level as f32),
|
||||
player,
|
||||
);
|
||||
}
|
||||
|
||||
let mut epi_eff = 1.0;
|
||||
let mut mela_eff = 1.0;
|
||||
let mut sero_eff = 1.0;
|
||||
let mut tyro_eff = 1.0;
|
||||
|
||||
let mut epi_dur = 1.0;
|
||||
let mut sero_dur = 1.0;
|
||||
let mut tyro_dur = 1.0;
|
||||
|
||||
if edu.bio2410 {
|
||||
effects.spawn(SimpleStatBonus::<CritRate>::new("BIO2410", 6), player);
|
||||
}
|
||||
|
|
@ -219,12 +253,16 @@ fn spawn_permanent_effects(
|
|||
effects.spawn(AdditiveBonus::<Speed>::new("DEF2760", 0.03), player);
|
||||
}
|
||||
if edu.spt2480 {
|
||||
commands.entity(player).insert((
|
||||
epi_eff *= 1.1;
|
||||
mela_eff *= 1.1;
|
||||
sero_eff *= 1.1;
|
||||
tyro_eff *= 1.1;
|
||||
/* commands.entity(player).insert((
|
||||
ExtraStatusEffectEffectiveness::<1, Strengthened>::new(1.1),
|
||||
ExtraStatusEffectEffectiveness::<1, Sharpened>::new(1.1),
|
||||
ExtraStatusEffectEffectiveness::<1, Hardened>::new(1.1),
|
||||
ExtraStatusEffectEffectiveness::<1, Hastened>::new(1.1),
|
||||
));
|
||||
)); */
|
||||
}
|
||||
if edu.spt2490 {
|
||||
effects.spawn(AdditiveBonus::<Speed>::new("SPT2490", 0.02), player);
|
||||
|
|
@ -234,6 +272,112 @@ fn spawn_permanent_effects(
|
|||
effects.spawn(AdditiveBonus::<Defence>::new("SPT2500", 0.02), player);
|
||||
effects.spawn(AdditiveBonus::<Dexterity>::new("SPT2500", 0.02), player);
|
||||
}
|
||||
|
||||
if let Some(job) = job {
|
||||
if job.has(Job::AmusementPark7) {
|
||||
epi_eff *= 1.25;
|
||||
epi_dur *= 1.25;
|
||||
}
|
||||
if job.has(Job::ClothingStore5) {
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Dexterity>::new("clothing_store", 0.25),
|
||||
player,
|
||||
);
|
||||
}
|
||||
if job.has(Job::FurnitureStore7) {
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Strength>::new("furniture_store", 0.25),
|
||||
player,
|
||||
);
|
||||
}
|
||||
if job.has(Job::GasStation3) {
|
||||
effects.spawn(AdditiveBonus::<Speed>::new("gas_station", 0.25), player);
|
||||
}
|
||||
if job.has(Job::GentsStripClub3) {
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Dexterity>::new("gents_strip_club", 0.25),
|
||||
player,
|
||||
);
|
||||
}
|
||||
if job.has(Job::GentsStripClub5) {
|
||||
tyro_eff *= 1.5;
|
||||
tyro_dur *= 1.5;
|
||||
}
|
||||
if job.has(Job::GentsStripClub10) {
|
||||
commands
|
||||
.entity(player)
|
||||
.with_child(ActionNullification::GentsStripClub);
|
||||
}
|
||||
if job.has(Job::LadiesStripClub3) {
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Defence>::new("ladies_strip_club", 0.25),
|
||||
player,
|
||||
);
|
||||
}
|
||||
if job.has(Job::LadiesStripClub5) {
|
||||
sero_eff *= 1.5;
|
||||
sero_dur *= 1.5;
|
||||
}
|
||||
if job.has(Job::LingeryStore5) && armour.into_iter().count() == 0 {
|
||||
effects.spawn(
|
||||
AdditiveBonus::<Dexterity>::new("lingery_store", 0.50),
|
||||
player,
|
||||
);
|
||||
effects.spawn(AdditiveBonus::<Speed>::new("lingery_store", 0.50), player);
|
||||
}
|
||||
if job.has(Job::MiningCorporation7) {
|
||||
effects.spawn(
|
||||
SimpleStatBonus::<MaxHealth>::new("mining_corporation", 1.1),
|
||||
player,
|
||||
);
|
||||
}
|
||||
if job.has(Job::MusicStore10) {
|
||||
effects.spawn(AdditiveBonus::<Strength>::new("music_store", 0.15), player);
|
||||
effects.spawn(AdditiveBonus::<Speed>::new("music_store", 0.15), player);
|
||||
effects.spawn(AdditiveBonus::<Defence>::new("music_store", 0.15), player);
|
||||
effects.spawn(AdditiveBonus::<Dexterity>::new("music_store", 0.15), player);
|
||||
}
|
||||
}
|
||||
|
||||
if epi_eff >= 1.0 {
|
||||
commands
|
||||
.entity(player)
|
||||
.insert(ExtraStatusEffectEffectiveness::<1, Strengthened>::new(
|
||||
epi_eff,
|
||||
));
|
||||
}
|
||||
if epi_dur >= 1.0 {
|
||||
commands
|
||||
.entity(player)
|
||||
.insert(ExtraStatusEffectDuration::<1, Strengthened>::new(epi_dur));
|
||||
}
|
||||
if mela_eff >= 1.0 {
|
||||
commands
|
||||
.entity(player)
|
||||
.insert(ExtraStatusEffectEffectiveness::<1, Hastened>::new(mela_eff));
|
||||
}
|
||||
if sero_eff >= 1.0 {
|
||||
commands
|
||||
.entity(player)
|
||||
.insert(ExtraStatusEffectEffectiveness::<1, Hardened>::new(sero_eff));
|
||||
}
|
||||
if sero_dur >= 1.0 {
|
||||
commands
|
||||
.entity(player)
|
||||
.insert(ExtraStatusEffectDuration::<1, Hardened>::new(sero_dur));
|
||||
}
|
||||
if tyro_eff >= 1.0 {
|
||||
commands
|
||||
.entity(player)
|
||||
.insert(ExtraStatusEffectEffectiveness::<1, Sharpened>::new(
|
||||
tyro_eff,
|
||||
));
|
||||
}
|
||||
if tyro_dur >= 1.0 {
|
||||
commands
|
||||
.entity(player)
|
||||
.insert(ExtraStatusEffectDuration::<1, Sharpened>::new(tyro_dur));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ fn check_action_nullification(
|
|||
return Some("homerun");
|
||||
}
|
||||
ActionNullification::GentsStripClub
|
||||
if player_action.0 == WeaponSlot::Melee && shared.rng.random_bool(0.25) =>
|
||||
if player_action.0 == WeaponSlot::Melee && shared.rng.random_ratio(1, 4) =>
|
||||
{
|
||||
return Some("dodged");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue