From 95402ca10e4ed0c6ded38bce14b861169495d207 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 4 Jul 2019 23:11:59 +1000 Subject: [PATCH] restrict --- CHANGELOG.md | 2 +- COMBOS.md | 2 +- NODES.md | 4 +- SPECS.md | 4 +- client/src/animations.test.jsx | 2 +- client/src/components/animations.jsx | 11 +-- client/src/components/anims/restrict.jsx | 102 +++++++++++++++++++++++ client/src/test.instance.js | 8 +- client/src/utils.jsx | 2 +- server/src/effect.rs | 12 +-- server/src/item.rs | 36 ++++---- server/src/skill.rs | 32 +++---- 12 files changed, 160 insertions(+), 57 deletions(-) create mode 100644 client/src/components/anims/restrict.jsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 1affb99f..d90c5863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -162,7 +162,7 @@ New skill `Hybrid` Maximum = (0.55)(1.35)*base_blue_damage Cooldown changed 1T -> 2T Debuff duration increased 2T -> 3T - Snare + Restrict Now also deals damage amount of 40% base blue damage This damage amount does 45% more damage per red skill blocked Maximum = (0.40)(1.35)*base_red_damage diff --git a/COMBOS.md b/COMBOS.md index a2c8b6d2..9f6cb7b1 100644 --- a/COMBOS.md +++ b/COMBOS.md @@ -87,7 +87,7 @@ RB - Haste # Debuff Base # -RR - Snare +RR - Restrict GG - Purge BB - Curse RG - Slow diff --git a/NODES.md b/NODES.md index 12ffc0fa..52dd0e80 100644 --- a/NODES.md +++ b/NODES.md @@ -20,7 +20,7 @@ Uncommon `Increased % mitigation from spell shield` Uncommon `Increased damage over time` Rare `gain empower on KO` -Rare `cannot be snared` +Rare `cannot be restrictd` Rare `cannot be silenced` Rare `cannot be intercepted` @@ -34,7 +34,7 @@ Rare `increased phys damage, 0 spell damage` Rare `increased spell damage, 0 phys damage` Rare `increased phys damage, silenced` -Rare `increased spell damage, snared` +Rare `increased spell damage, restrictd` Rare `increased speed, increased durations` Rare `increased speed, increased cooldowns` diff --git a/SPECS.md b/SPECS.md index 8125c11e..e1c4cc64 100644 --- a/SPECS.md +++ b/SPECS.md @@ -4,11 +4,11 @@ Numbers are placeholder `Specs get a bonus dependent on the total of Red / Green / Blue in player skills & specs` # Example to meet 5 red gem bonus from skills only -In your player Construct #1 has `Strike`, Construct #2 has `Slay` and `Heal`, Construct #3 has `Snare` +In your player Construct #1 has `Strike`, Construct #2 has `Slay` and `Heal`, Construct #3 has `Restrict` - RR skill `Strike` contributes 2 red gems to the total red gems (2 total) - RG skill `Slay` contributes 1 red gem to the total red gems (3 total) - GG skill `Heal` contirubtes 0 red gems to the total red gems (3 total) -- RR skill `Snare` contirubtes 2 red gems to the total red gems (5 total) +- RR skill `Restrict` contirubtes 2 red gems to the total red gems (5 total) # Advanced specs also require a minimum number of Red / Green / Blue gems on the construct to take effect - Tier 1 Basic specs (Damage / Health / Defense) will have no requirements diff --git a/client/src/animations.test.jsx b/client/src/animations.test.jsx index 840500c6..cfbcb45c 100644 --- a/client/src/animations.test.jsx +++ b/client/src/animations.test.jsx @@ -109,7 +109,7 @@ const SKILLS = [ 'SiphonTickI', 'SlayI', 'SleepI', - 'SnareI', + 'RestrictI', 'StrikeI', 'ThrowI', 'TriageI', diff --git a/client/src/components/animations.jsx b/client/src/components/animations.jsx index b8e9ce76..3cf3b2c7 100644 --- a/client/src/components/animations.jsx +++ b/client/src/components/animations.jsx @@ -4,13 +4,14 @@ const anime = require('animejs').default; const AttackCharge = require('./anims/attack.charge'); const Amplify = require('./anims/amplify'); -const Blast = require('./anims/blast'); const Banish = require('./anims/banish'); const Bash = require('./anims/bash'); +const Blast = require('./anims/blast'); const Block = require('./anims/block'); const Buff = require('./anims/buff'); const Chaos = require('./anims/chaos'); const Clutch = require('./anims/clutch'); +const Counter = require('./anims/counter'); const Curse = require('./anims/curse'); const Debuff = require('./anims/debuff'); const Decay = require('./anims/decay'); @@ -22,14 +23,14 @@ const Hex = require('./anims/hex'); const Hybrid = require('./anims/hybrid'); const Intercept = require('./anims/intercept'); const Invert = require('./anims/invert'); -const Counter = require('./anims/counter'); const Purify = require('./anims/purify'); const Recharge = require('./anims/recharge'); const Refl = require('./anims/reflect'); -const Slay = require('./anims/slay'); -const Sleep = require('./anims/sleep'); +const Restrict = require('./anims/restrict'); const Siphon = require('./anims/siphon'); const SiphonTick = require('./anims/siphon.tick'); +const Slay = require('./anims/slay'); +const Sleep = require('./anims/sleep'); const Strike = require('./anims/strike'); const Stun = require('./anims/stun'); const Triage = require('./anims/triage'); @@ -133,7 +134,7 @@ function animations(props) { case 'Invert': return ; case 'Purge': return false; case 'Silence': return false; - case 'Snare': return false; + case 'Restrict': return ; // Stun Base case 'Stun': return ; diff --git a/client/src/components/anims/restrict.jsx b/client/src/components/anims/restrict.jsx new file mode 100644 index 00000000..6ec4120e --- /dev/null +++ b/client/src/components/anims/restrict.jsx @@ -0,0 +1,102 @@ +const preact = require('preact'); +const { Component } = require('preact'); + +const anime = require('animejs').default; + +const { TIMES } = require('../../constants'); + +class Restrict extends Component { + constructor() { + super(); + this.animations = []; + } + + render() { + return ( + + + + + + + + + + + ); + } + + componentDidMount() { + this.animations.push(anime({ + targets: ['#restrict'], + opacity: [ + { value: 1, delay: TIMES.TARGET_DELAY_MS, duration: TIMES.TARGET_DURATION_MS * 0.2 }, + { value: 0, delay: TIMES.TARGET_DURATION_MS * 0.6, duration: TIMES.TARGET_DURATION_MS * 0.2 }, + ], + easing: 'easeInOutSine', + })); + + this.animations.push(anime({ + targets: ['#restrict'], + scale: { + value: 1, + delay: TIMES.TARGET_DELAY_MS, + duration: TIMES.TARGET_DURATION_MS * 0.2, + easing: 'easeInExpo', + }, + + delay: TIMES.TARGET_DELAY_MS + TIMES.TARGET_DURATION_MS * 0.1, + duration: TIMES.TARGET_DURATION_MS * 0.2, + easing: 'easeOutSine', + })); + + this.animations.push(anime({ + targets: ['#restrictFilter feTurbulence', '#restrictFilter feDisplacementMap'], + baseFrequency: 2, + scale: 5, + numOctaves: 5, + easing: 'easeOutSine', + + delay: TIMES.TARGET_DELAY_MS, + duration: TIMES.TARGET_DURATION_MS, + })); + + this.animations.push(anime({ + targets: ['#rOne'], + + d: 'M 96 32 L 32 96', + + delay: TIMES.TARGET_DELAY_MS + TIMES.TARGET_DURATION_MS * 0.4, + duration: TIMES.TARGET_DURATION_MS * 0.4, + easing: 'easeOutSine', + })); + + this.animations.push(anime({ + targets: ['#rTwo'], + + d: 'M 96 96 L 32 32', + + delay: TIMES.TARGET_DELAY_MS + TIMES.TARGET_DURATION_MS * 0.4, + duration: TIMES.TARGET_DURATION_MS * 0.4, + easing: 'easeOutSine', + })); + } + + // this is necessary because + // skipping / timing / unmounting race conditions + // can cause the animations to cut short, this will ensure the values are reset + // because preact will recycle all these components + componentWillUnmount() { + for (let i = this.animations.length - 1; i >= 0; i--) { + this.animations[i].reset(); + } + } +} + +module.exports = Restrict; diff --git a/client/src/test.instance.js b/client/src/test.instance.js index b2c97ef4..1eab66ea 100644 --- a/client/src/test.instance.js +++ b/client/src/test.instance.js @@ -546,7 +546,7 @@ function testInstance(uuid) { "cd": null }, { - "skill": "Snare", + "skill": "Restrict", "self_targeting": false, "cd": 2 }, @@ -2984,7 +2984,7 @@ function testInstance(uuid) { "cd": 1 }, { - "skill": "Snare", + "skill": "Restrict", "self_targeting": false, "cd": 2 } @@ -3436,7 +3436,7 @@ function testInstance(uuid) { "cd": null }, { - "skill": "Snare", + "skill": "Restrict", "self_targeting": false, "cd": 2 }, @@ -3646,7 +3646,7 @@ function testInstance(uuid) { "cd": null }, { - "skill": "Snare", + "skill": "Restrict", "self_targeting": false, "cd": 2 } diff --git a/client/src/utils.jsx b/client/src/utils.jsx index c4c954bc..69014022 100644 --- a/client/src/utils.jsx +++ b/client/src/utils.jsx @@ -344,7 +344,7 @@ const removeTier = skill => { if (skill.includes('Slay')) return 'Slay'; if (skill.includes('Siphon')) return 'Siphon'; - if (skill.includes('Snare')) return 'Snare'; + if (skill.includes('Restrict')) return 'Restrict'; if (skill.includes('Purge')) return 'Purge'; if (skill.includes('Silence')) return 'Silence'; if (skill.includes('Curse')) return 'Curse'; diff --git a/server/src/effect.rs b/server/src/effect.rs index 1176e9c9..17147274 100644 --- a/server/src/effect.rs +++ b/server/src/effect.rs @@ -20,7 +20,7 @@ pub enum Effect { Purge, Reflect, Slow, - Snare, + Restrict, Stun, Intercept, Vulnerable, @@ -83,9 +83,9 @@ impl Effect { Skill::RuinI, Skill::RuinII, Skill::RuinIII, - Skill::SnareI, - Skill::SnareII, - Skill::SnareIII + Skill::RestrictI, + Skill::RestrictII, + Skill::RestrictIII ].contains(&skill), _ => false, } @@ -101,7 +101,7 @@ impl Effect { Effect::Hex => true, Effect::Banish => true, Effect::Silence => skill.colours().contains(&Colour::Blue), - Effect::Snare => skill.colours().contains(&Colour::Red), + Effect::Restrict => skill.colours().contains(&Colour::Red), Effect::Purge => skill.colours().contains(&Colour::Green), Effect::Ko => skill.ko_castable(), _ => false, @@ -168,7 +168,7 @@ impl Effect { Effect::Buff => Some(Colour::Green), Effect::Counter => Some(Colour::Green), Effect::Vulnerable => Some(Colour::Red), - Effect::Snare => Some(Colour::Red), + Effect::Restrict => Some(Colour::Red), Effect::Clutch => Some(Colour::Green), Effect::Intercept => Some(Colour::Green), diff --git a/server/src/item.rs b/server/src/item.rs index 9b2a2830..9e48a508 100644 --- a/server/src/item.rs +++ b/server/src/item.rs @@ -160,9 +160,9 @@ pub enum Item { SleepI, SleepII, SleepIII, - SnareI, - SnareII, - SnareIII, + RestrictI, + RestrictII, + RestrictIII, StrikeI, StrikeII, StrikeIII, @@ -368,9 +368,9 @@ impl Item { Item::SiphonI => Some(Skill::SiphonI), Item::SiphonII => Some(Skill::SiphonII), Item::SiphonIII => Some(Skill::SiphonIII), - Item::SnareI => Some(Skill::SnareI), - Item::SnareII => Some(Skill::SnareII), - Item::SnareIII => Some(Skill::SnareIII), + Item::RestrictI => Some(Skill::RestrictI), + Item::RestrictII => Some(Skill::RestrictII), + Item::RestrictIII => Some(Skill::RestrictIII), Item::BashI => Some(Skill::BashI), Item::BashII => Some(Skill::BashII), Item::BashIII => Some(Skill::BashIII), @@ -732,9 +732,9 @@ impl Item { self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().multiplier()), - Item::SnareI | - Item::SnareII | - Item::SnareIII => format!( + Item::RestrictI | + Item::RestrictII | + Item::RestrictIII => format!( "Block the target from using red skills for {:?}T and deals RedDamage {:?}% RedPower. {}", self.into_skill().unwrap().effect()[0].get_duration(), self.into_skill().unwrap().multiplier(), @@ -806,9 +806,9 @@ impl Item { Item::AmplifyII => vec![Item::AmplifyI, Item::AmplifyI, Item::AmplifyI], Item::AmplifyIII => vec![Item::AmplifyII, Item::AmplifyII, Item::AmplifyII], - Item::SnareI => vec![Item::Debuff, Item::Red, Item::Red], - Item::SnareII => vec![Item::SnareI, Item::SnareI, Item::SnareI], - Item::SnareIII => vec![Item::SnareII, Item::SnareII, Item::SnareII], + Item::RestrictI => vec![Item::Debuff, Item::Red, Item::Red], + Item::RestrictII => vec![Item::RestrictI, Item::RestrictI, Item::RestrictI], + Item::RestrictIII => vec![Item::RestrictII, Item::RestrictII, Item::RestrictII], Item::PurgeI => vec![Item::Debuff, Item::Green, Item::Green], // Needs flavour Item::PurgeII => vec![Item::PurgeI, Item::PurgeI, Item::PurgeI], // Needs flavour Item::PurgeIII => vec![Item::PurgeII, Item::PurgeII, Item::PurgeII], // Needs flavour @@ -1030,9 +1030,9 @@ impl From for Item { Skill::SleepI => Item::SleepI, Skill::SleepII => Item::SleepII, Skill::SleepIII => Item::SleepIII, - Skill::SnareI => Item::SnareI, - Skill::SnareII => Item::SnareII, - Skill::SnareIII => Item::SnareIII, + Skill::RestrictI => Item::RestrictI, + Skill::RestrictII => Item::RestrictII, + Skill::RestrictIII => Item::RestrictIII, Skill::BashI => Item::BashI, Skill::BashII => Item::BashII, Skill::BashIII => Item::BashIII, @@ -1183,9 +1183,9 @@ pub fn get_combos() -> Vec { Combo { components: Item::AmplifyII.combo(), item: Item::AmplifyII }, Combo { components: Item::AmplifyIII.combo(), item: Item::AmplifyIII }, - Combo { components: Item::SnareI.combo(), item: Item::SnareI }, - Combo { components: Item::SnareII.combo(), item: Item::SnareII }, - Combo { components: Item::SnareIII.combo(), item: Item::SnareIII }, + Combo { components: Item::RestrictI.combo(), item: Item::RestrictI }, + Combo { components: Item::RestrictII.combo(), item: Item::RestrictII }, + Combo { components: Item::RestrictIII.combo(), item: Item::RestrictIII }, Combo { components: Item::PurgeI.combo(), item: Item::PurgeI }, // Needs flavour Combo { components: Item::PurgeII.combo(), item: Item::PurgeII }, Combo { components: Item::PurgeIII.combo(), item: Item::PurgeIII }, diff --git a/server/src/skill.rs b/server/src/skill.rs index 76098132..69c015e9 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -235,9 +235,9 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut Skill::SleepII | Skill::SleepIII => sleep(source, target, resolutions, skill), // heal stun - Skill::SnareI | - Skill::SnareII | - Skill::SnareIII => snare(source, target, resolutions, skill), + Skill::RestrictI | + Skill::RestrictII | + Skill::RestrictIII => restrict(source, target, resolutions, skill), Skill::StrikeI | Skill::StrikeII | @@ -610,9 +610,9 @@ pub enum Skill { SleepII, SleepIII, - SnareI, - SnareII, - SnareIII, + RestrictI, + RestrictII, + RestrictIII, StrikeI, StrikeII, @@ -704,9 +704,9 @@ impl Skill { Skill::SilenceI => 55, // Deals more per blue skill on target Skill::SilenceII => 80, Skill::SilenceIII => 110, - Skill::SnareI => 40, // Deals more per red skill on target - Skill::SnareII => 65, - Skill::SnareIII => 100, + Skill::RestrictI => 40, // Deals more per red skill on target + Skill::RestrictII => 65, + Skill::RestrictIII => 100, // Buff base Skill::HybridBlast => 25, @@ -857,9 +857,9 @@ impl Skill { Skill::SleepII => vec![ConstructEffect {effect: Effect::Stun, duration: 3, meta: None, tick: None}], Skill::SleepIII => vec![ConstructEffect {effect: Effect::Stun, duration: 4, meta: None, tick: None}], - Skill::SnareI => vec![ConstructEffect {effect: Effect::Snare, duration: 2, meta: None, tick: None}], - Skill::SnareII => vec![ConstructEffect {effect: Effect::Snare, duration: 3, meta: None, tick: None}], - Skill::SnareIII => vec![ConstructEffect {effect: Effect::Snare, duration: 4, meta: None, tick: None}], + Skill::RestrictI => vec![ConstructEffect {effect: Effect::Restrict, duration: 2, meta: None, tick: None}], + Skill::RestrictII => vec![ConstructEffect {effect: Effect::Restrict, duration: 3, meta: None, tick: None}], + Skill::RestrictIII => vec![ConstructEffect {effect: Effect::Restrict, duration: 4, meta: None, tick: None}], Skill::BashI => vec![ConstructEffect {effect: Effect::Stun, duration: 2, meta: Some(EffectMeta::Skill(Skill::BashI)), tick: None}], @@ -899,9 +899,9 @@ impl Skill { Skill::CounterII | Skill::CounterIII => Some(2), // avoid all damage - Skill::SnareI => Some(2), - Skill::SnareII => Some(2), - Skill::SnareIII => Some(2), + Skill::RestrictI => Some(2), + Skill::RestrictII => Some(2), + Skill::RestrictIII => Some(2), Skill::Stun => Some(2), Skill::BashI => Some(2), @@ -1340,7 +1340,7 @@ fn riposte(source: &mut Construct, target: &mut Construct, mut results: Resoluti return results; } -fn snare(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { +fn restrict(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions { skill.effect().into_iter() .for_each(|e| (results.push(Resolution::new(source, target).event(target.add_effect(skill, e)))));