From f78496e6819bd966cb7d3ec30dc1b727770aafd5 Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 19 Sep 2019 16:01:46 +1000 Subject: [PATCH 1/2] spec info update --- client/src/components/info.component.jsx | 8 +- client/src/components/instance.constructs.jsx | 7 +- client/src/constants.jsx | 13 +- server/src/item.rs | 134 +++++++++++------- server/src/spec.rs | 4 + 5 files changed, 107 insertions(+), 59 deletions(-) diff --git a/client/src/components/info.component.jsx b/client/src/components/info.component.jsx index ba676057..b088f711 100644 --- a/client/src/components/info.component.jsx +++ b/client/src/components/info.component.jsx @@ -133,14 +133,16 @@ function InfoComponent(args) { } return false; }); + console.log(info); + const bonusObj = info.includes('Life') + ?
+ {bonus.bonus}
+ :
+ {bonus.bonus}%
; const overFlowObj = overFlow.length ?
{overFlow}
: null; return (
{goals} {overFlowObj} -
- + {bonus.bonus} -
+ {bonusObj}
); }); diff --git a/client/src/components/instance.constructs.jsx b/client/src/components/instance.constructs.jsx index 24a1d833..9afd9cc5 100644 --- a/client/src/components/instance.constructs.jsx +++ b/client/src/components/instance.constructs.jsx @@ -179,10 +179,9 @@ function Construct(props) { const stats = Object.keys(STATS).map(s => { const stat = STATS[s]; - const info = (s === 'SpeedStat' && 'Speed') - || (s.includes('Power') && 'Power') - || (s.includes('Life') && 'Life'); - + const info = (s === 'SpeedStat' && 'speedStat') + || (s.includes('Power') && 'powerStat') + || (s.includes('Life') && 'lifeStat'); return
format!("Base item for increased power. Power determines the base damage and healing of your construct skills."), - Item::Life => format!("Base item for increased life. - When your construct reaches 0 GreenLife it is knocked out and cannot cast skills."), - Item::Speed => format!("Base item for increased speed. - Speed SpeedStat determines the order in which skills resolve."), + Item::Power => format!("Increases all power stats by {:?}%. Power determines the base damage and healing of your construct skills.", + self.into_spec().unwrap().values().base()), + Item::Life => format!("Increases construct GreenLife by {:?}. + When your construct reaches 0 GreenLife it is knocked out and cannot cast skills.", + self.into_spec().unwrap().values().base()), + Item::Speed => format!("Increases construct speed by {:?}%. + Speed SpeedStat determines the order in which skills resolve.", + self.into_spec().unwrap().values().base()), // Lifes Upgrades - Item::LifeGG=> format!("Increases construct GreenLife green life. - When your construct reaches 0 GreenLife it is knocked out and cannot cast skills."), - Item::LifeRR=> format!("Increases construct RedLife red life. - Mitigates red damage that would otherwise reduce your GreenLife green life."), - Item::LifeBB=> format!("Increases construct BlueLife blue life. - Mitigates blue damage that would otherwise reduce your GreenLife green life."), - Item::LifeRG=> format!("Increases construct GreenLife and RedLife"), - Item::LifeGB=> format!("Increases construct GreenLife and BlueLife"), - Item::LifeRB=> format!("Increases construct RedLife and BlueLife"), - Item::LifeGGPlus => format!("Increases construct GreenLife."), - Item::LifeRRPlus => format!("Increases construct RedLife."), - Item::LifeBBPlus => format!("Increases construct BlueLife."), - Item::LifeRGPlus => format!("Increases construct GreenLife and RedLife"), - Item::LifeGBPlus => format!("Increases construct GreenLife and BlueLife"), - Item::LifeRBPlus => format!("Increases construct RedLife and BlueLife"), - Item::LifeGGPlusPlus => format!("Increases construct GreenLife."), - Item::LifeRRPlusPlus => format!("Increases construct RedLife."), - Item::LifeBBPlusPlus => format!("Increases construct BlueLife."), - Item::LifeRGPlusPlus => format!("Increases construct GreenLife and RedLife"), - Item::LifeGBPlusPlus => format!("Increases construct GreenLife and BlueLife"), - Item::LifeRBPlusPlus => format!("Increases construct RedLife and BlueLife"), + Item::LifeGG | + Item::LifeGGPlus | + Item::LifeGGPlusPlus => format!("Increases construct GreenLife by {:?}. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + + Item::LifeRR | + Item::LifeRRPlus | + Item::LifeRRPlusPlus => format!("Increases construct RedLife by {:?}. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + + Item::LifeBB | + Item::LifeBBPlus | + Item::LifeBBPlusPlus => format!("Increases construct BlueLife by {:?}. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + + Item::LifeRG | + Item::LifeRGPlus | + Item::LifeRGPlusPlus => format!("Increases construct RedLife and GreenLife by {:?}. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + + Item::LifeGB | + Item::LifeGBPlus | + Item::LifeGBPlusPlus => format!("Increases construct GreenLife and BlueLife by {:?}. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + + Item::LifeRB | + Item::LifeRBPlus | + Item::LifeRBPlusPlus => format!("Increases construct RedLife and BlueLife by {:?}. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), // Power Upgrades - Item::PowerRR=> format!("Increases construct RedPower."), - Item::PowerBB=> format!("Increases construct BluePower."), - Item::PowerGG=> format!("Increases construct GreenPower."), - Item::PowerRG=> format!("Increases construct GreenPower and RedPower."), - Item::PowerGB=> format!("Increases construct GreenPower and BluePower."), - Item::PowerRB=> format!("Increases construct RedPower and BluePower."), - Item::PowerRRPlus => format!("Increases construct RedPower."), - Item::PowerBBPlus => format!("Increases construct BluePower."), - Item::PowerGGPlus => format!("Increases construct GreenPower."), - Item::PowerRGPlus => format!("Increases construct GreenPower and RedPower."), - Item::PowerGBPlus => format!("Increases construct GreenPower and BluePower."), - Item::PowerRBPlus => format!("Increases construct RedPower and BluePower."), - Item::PowerRRPlusPlus => format!("Increases construct RedPower."), - Item::PowerBBPlusPlus => format!("Increases construct BluePower."), - Item::PowerGGPlusPlus => format!("Increases construct GreenPower."), - Item::PowerRGPlusPlus => format!("Increases construct GreenPower and RedPower."), - Item::PowerGBPlusPlus => format!("Increases construct GreenPower and BluePower."), - Item::PowerRBPlusPlus => format!("Increases construct RedPower and BluePower."), + Item::PowerRR | + Item::PowerRRPlus | + Item::PowerRRPlusPlus => format!("Increases construct RedPower by {:?}%. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + Item::PowerBB | + Item::PowerBBPlus | + Item::PowerBBPlusPlus => format!("Increases construct BluePower by {:?}%. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + + Item::PowerGG | + Item::PowerGGPlus | + Item::PowerGGPlusPlus => format!("Increases construct GreenPower by {:?}%. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + Item::PowerRG | + Item::PowerRGPlus | + Item::PowerRGPlusPlus => format!("Increases construct GreenPower and RedPower by {:?}%. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + Item::PowerGB | + Item::PowerGBPlus | + Item::PowerGBPlusPlus => format!("Increases construct GreenPower and BluePower by {:?}%. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), + Item::PowerRB | + Item::PowerRBPlus | + Item::PowerRBPlusPlus => format!("Increases construct RedPower and BluePower by {:?}%. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), // Speed Upgrades - Item::SpeedRR| - Item::SpeedBB| - Item::SpeedGG| - Item::SpeedRG| - Item::SpeedGB| - Item::SpeedRB| + Item::SpeedRR | + Item::SpeedBB | + Item::SpeedGG | + Item::SpeedRG | + Item::SpeedGB | + Item::SpeedRB | Item::SpeedRRPlus | Item::SpeedBBPlus | Item::SpeedGGPlus | @@ -644,7 +674,9 @@ impl Item { Item::SpeedGGPlusPlus | Item::SpeedRGPlusPlus | Item::SpeedGBPlusPlus | - Item::SpeedRBPlusPlus => format!("Increases construct SpeedStat and provides COLOUR BONUSES"), + Item::SpeedRBPlusPlus => format!("Increases construct SpeedStat by {:?}%. + If your team meets total colour thresholds the spec provides additional bonuses", + self.into_spec().unwrap().values().base()), // Skills <- need to move effect mulltipliers into skills Item::Amplify| diff --git a/server/src/spec.rs b/server/src/spec.rs index 443bdf18..28a842f7 100644 --- a/server/src/spec.rs +++ b/server/src/spec.rs @@ -28,6 +28,10 @@ impl SpecValues { self.bonuses.iter().fold(self.base, |acc, s| acc + s.get_bonus(c)) } + pub fn base (self) -> u64 { + self.base + } + /* pub fn calc_multi (&self, c: &Colours) -> u64 { self.multi * (c.red + c.green + c.blue) as u64 From 783429b5cf60fe378e348119104d15a71432fdbf Mon Sep 17 00:00:00 2001 From: Mashy Date: Thu, 19 Sep 2019 16:07:35 +1000 Subject: [PATCH 2/2] fix purge description and dot --- server/src/item.rs | 67 +++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/server/src/item.rs b/server/src/item.rs index 33d833f4..42d564b5 100644 --- a/server/src/item.rs +++ b/server/src/item.rs @@ -563,17 +563,17 @@ impl Item { Item::Red => format!("Combine with skills and specs to create upgraded items. \n Speed and chaos."), // base skills - Item::Attack => format!("Deal {:?}% RedPower as red damage", + Item::Attack => format!("Deal {:?}% RedPower as red damage.", self.into_skill().unwrap().multiplier()), - Item::Block => format!("Reduce red damage taken by {:?}%", + Item::Block => format!("Reduce red damage taken by {:?}%.", 100 - self.into_skill().unwrap().effect()[0].get_multiplier()), - Item::Stun => format!("Stun target construct for {:?}T", + Item::Stun => format!("Stun target construct for {:?}T.", self.into_skill().unwrap().effect()[0].get_duration()), - Item::Buff => format!("Increase target construct RedPower and SpeedStat by {:?}%", + Item::Buff => format!("Increase target construct RedPower and SpeedStat by {:?}%.", self.into_skill().unwrap().effect()[0].get_multiplier() - 100), - Item::Debuff => format!("Slows the target reducing SpeedStat by {:?}%", + Item::Debuff => format!("Slows the target reducing SpeedStat by {:?}%.", 100 - self.into_skill().unwrap().effect()[0].get_multiplier()), // specs // Base @@ -590,70 +590,70 @@ impl Item { Item::LifeGG | Item::LifeGGPlus | Item::LifeGGPlusPlus => format!("Increases construct GreenLife by {:?}. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::LifeRR | Item::LifeRRPlus | Item::LifeRRPlusPlus => format!("Increases construct RedLife by {:?}. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::LifeBB | Item::LifeBBPlus | Item::LifeBBPlusPlus => format!("Increases construct BlueLife by {:?}. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::LifeRG | Item::LifeRGPlus | Item::LifeRGPlusPlus => format!("Increases construct RedLife and GreenLife by {:?}. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::LifeGB | Item::LifeGBPlus | Item::LifeGBPlusPlus => format!("Increases construct GreenLife and BlueLife by {:?}. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::LifeRB | Item::LifeRBPlus | Item::LifeRBPlusPlus => format!("Increases construct RedLife and BlueLife by {:?}. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), // Power Upgrades Item::PowerRR | Item::PowerRRPlus | Item::PowerRRPlusPlus => format!("Increases construct RedPower by {:?}%. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::PowerBB | Item::PowerBBPlus | Item::PowerBBPlusPlus => format!("Increases construct BluePower by {:?}%. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::PowerGG | Item::PowerGGPlus | Item::PowerGGPlusPlus => format!("Increases construct GreenPower by {:?}%. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::PowerRG | Item::PowerRGPlus | Item::PowerRGPlusPlus => format!("Increases construct GreenPower and RedPower by {:?}%. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::PowerGB | Item::PowerGBPlus | Item::PowerGBPlusPlus => format!("Increases construct GreenPower and BluePower by {:?}%. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), Item::PowerRB | Item::PowerRBPlus | Item::PowerRBPlusPlus => format!("Increases construct RedPower and BluePower by {:?}%. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), // Speed Upgrades @@ -675,13 +675,13 @@ impl Item { Item::SpeedRGPlusPlus | Item::SpeedGBPlusPlus | Item::SpeedRBPlusPlus => format!("Increases construct SpeedStat by {:?}%. - If your team meets total colour thresholds the spec provides additional bonuses", + If your team meets total colour thresholds the spec provides additional bonuses.", self.into_spec().unwrap().values().base()), // Skills <- need to move effect mulltipliers into skills Item::Amplify| Item::AmplifyPlus | - Item::AmplifyPlusPlus => format!("Increase RedPower and BluePower by {:?}%. Lasts {:?}T", + Item::AmplifyPlusPlus => format!("Increase RedPower and BluePower by {:?}%. Lasts {:?}T.", self.into_skill().unwrap().effect()[0].get_multiplier() - 100, self.into_skill().unwrap().effect()[0].get_duration()), @@ -699,7 +699,7 @@ impl Item { Item::Chaos| Item::ChaosPlus | Item::ChaosPlusPlus => format!( - "Hits twice for red and blue damage. Damage {:?}% RedPower and BluePower. Randomly deals 0 to 30% more damage", + "Hits twice for red and blue damage. Damage {:?}% RedPower and BluePower. Randomly deals 0 to 30% more damage.", self.into_skill().unwrap().multiplier()), Item::Sustain| @@ -720,14 +720,14 @@ impl Item { Item::Curse| Item::CursePlus | Item::CursePlusPlus => format!( - "Increases red and blue damage taken by {:?}%. Lasts {:?}T", + "Increases red and blue damage taken by {:?}%. Lasts {:?}T.", self.into_skill().unwrap().effect()[0].get_multiplier() - 100, self.into_skill().unwrap().effect()[0].get_duration()), Item::Decay| Item::DecayPlus | Item::DecayPlusPlus => format!( - "Reduces healing taken by {:?}% for {:?}T. Deals blue damage {:?}% BluePower each turn for {:?}T", + "Reduces healing taken by {:?}% for {:?}T. Deals blue damage {:?}% BluePower each turn for {:?}T.", 100 - self.into_skill().unwrap().effect()[0].get_multiplier(), self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().effect()[1].get_skill().unwrap().multiplier(), @@ -736,7 +736,7 @@ impl Item { Item::Absorb| Item::AbsorbPlus | Item::AbsorbPlusPlus => format!( - "Gain Absorb for {:?}T. {} Absorption lasts {:?}T", + "Gain Absorb for {:?}T. {} Absorption lasts {:?}T.", self.into_skill().unwrap().effect()[0].get_duration(), "When attacked with Absorb you gain Absorption which increases RedPower and BluePower based on Damage taken.", self.into_skill().unwrap().effect()[0].get_skill().unwrap().effect()[0].get_duration()), @@ -756,7 +756,7 @@ impl Item { Item::Hybrid| Item::HybridPlus | Item::HybridPlusPlus => format!( - "Hybrid increases GreenPower by {:?}%, Blue based Attack skills will blast again dealing {:?}% GreenPower as blue damage. Lasts {:?}T", + "Hybrid increases GreenPower by {:?}%, Blue based Attack skills will blast again dealing {:?}% GreenPower as blue damage. Lasts {:?}T.", self.into_skill().unwrap().effect()[0].get_multiplier() - 100, Skill::HybridBlast.multiplier(), self.into_skill().unwrap().effect()[0].get_duration()), @@ -777,7 +777,8 @@ impl Item { Item::Purge| Item::PurgePlus | - Item::PurgePlusPlus => format!("Remove buffs from target construct"), + Item::PurgePlusPlus => format!("Remove buffs from target construct. Applies purge which disables target green skills for {:?}T.", + self.into_skill().unwrap().effect()[0].get_duration()), Item::Purify| Item::PurifyPlus | @@ -788,13 +789,13 @@ impl Item { Item::Reflect| Item::ReflectPlus | Item::ReflectPlusPlus => format!( - "Reflect incoming blue skills to source. Lasts {:?}T", + "Reflect incoming blue skills to source. Lasts {:?}T.", self.into_skill().unwrap().effect()[0].get_duration()), Item::Recharge| Item::RechargePlus | Item::RechargePlusPlus => format!( - "Recharge RedLife and BlueLife based on {:?}% RedPower and BluePower", + "Recharge RedLife and BlueLife based on {:?}% RedPower and BluePower.", self.into_skill().unwrap().multiplier()), Item::Ruin| @@ -816,7 +817,7 @@ impl Item { Item::SilencePlus | Item::SilencePlusPlus => format!( "Block the target from using blue skills for {:?}T and deals {:?}% BluePower as blue damage. - Deals 45% more Damage per blue skill on target", + Deals 45% more Damage per blue skill on target.", self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().multiplier()), @@ -836,7 +837,7 @@ impl Item { Item::Restrict| Item::RestrictPlus | Item::RestrictPlusPlus => format!( - "Block the target from using red skills for {:?}T and deals {:?}% RedPower as red damage. Deals 35% more damage per red skill on target", + "Block the target from using red skills for {:?}T and deals {:?}% RedPower as red damage. Deals 35% more damage per red skill on target.", self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().multiplier()), @@ -851,13 +852,13 @@ impl Item { Item::Strike| Item::StrikePlus | Item::StrikePlusPlus => format!( - "Strike the target with speed dealing {:?}% RedPower as red damage", + "Strike the target with speed dealing {:?}% RedPower as red damage.", self.into_skill().unwrap().multiplier()), Item::Siphon| Item::SiphonPlus | Item::SiphonPlusPlus => format!( - "Deals {:?}% BluePower as blue damage each turn and heals caster based on damage dealt. Lasts {:?}T", + "Deals {:?}% BluePower as blue damage each turn and heals caster based on damage dealt. Lasts {:?}T.", self.into_skill().unwrap().effect()[0].get_skill().unwrap().multiplier(), self.into_skill().unwrap().effect()[0].get_duration()), @@ -871,7 +872,7 @@ impl Item { Item::Break| Item::BreakPlus | Item::BreakPlusPlus => format!( - "Stun the target for {:?}T and applies Vulnerable increasing red damage taken by {:?}% for {:?}T", + "Stun the target for {:?}T and applies Vulnerable increasing red damage taken by {:?}% for {:?}T.", self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().effect()[1].get_multiplier() - 100, self.into_skill().unwrap().effect()[1].get_duration()), @@ -879,7 +880,7 @@ impl Item { Item::Triage| Item::TriagePlus | Item::TriagePlusPlus => format!( - "Heals target for {:?}% GreenPower each turn. Lasts {:?}T", + "Heals target for {:?}% GreenPower each turn. Lasts {:?}T.", self.into_skill().unwrap().effect()[0].get_skill().unwrap().multiplier(), self.into_skill().unwrap().effect()[0].get_duration()), }