throw -> break

This commit is contained in:
ntr 2019-07-05 17:02:03 +10:00
parent 3dd3536101
commit 83e8117c6a
10 changed files with 140 additions and 46 deletions

View File

@ -113,7 +113,7 @@ New skill `Hybrid`
Changed to Buff + RR (was Buff + RG)
Now recharges 80% source red damage as red life to target
- Throw
- Break
Stun duration reduced from 2T -> 1T
Vulnerable dmg bonus reduced 200% -> 150%
@ -178,7 +178,7 @@ New skill `Hybrid`
Hex is now Stun + GB (was Stun + RB)
Banish is now Stun + RB (was Stun + RG) for rng theme
Throw is now Stun + RG (was Stun + GG)
Break is now Stun + RG (was Stun + GG)
- Better fit as it applies inc Red taken debuff (vulnerability)

View File

@ -70,7 +70,7 @@ RB - Blast
# Stun Base #
RR - Strangle
GG - Throw
GG - Break
BB - Ruin
RG - Banish
GB - Silence

View File

@ -302,8 +302,8 @@ module.exports = {
// disallow use of comma operator
'no-sequences': 'error',
// restrict what can be thrown as an exception
'no-throw-literal': 'error',
// restrict what can be breakn as an exception
'no-break-literal': 'error',
// disallow unmodified conditions of loops
// https://eslint.org/docs/rules/no-unmodified-loop-condition
@ -479,10 +479,10 @@ module.exports = {
// https://eslint.org/docs/rules/no-unexpected-multiline
'no-unexpected-multiline': 'error',
// disallow unreachable statements after a return, throw, continue, or break statement
// disallow unreachable statements after a return, break, continue, or break statement
'no-unreachable': 'error',
// disallow return/throw/break/continue inside finally blocks
// disallow return/break/break/continue inside finally blocks
// https://eslint.org/docs/rules/no-unsafe-finally
'no-unsafe-finally': 'error',
@ -870,7 +870,7 @@ module.exports = {
after: true,
overrides: {
return: { after: true },
throw: { after: true },
break: { after: true },
case: { after: true }
}
}],

View File

@ -111,7 +111,7 @@ const SKILLS = [
'SleepI',
'StrikeI',
'SustainI',
'ThrowI',
'BreakI',
'TriageI',
'TriageTickI',
];

View File

@ -10,6 +10,7 @@ const Bash = require('./anims/bash');
const Blast = require('./anims/blast');
const Block = require('./anims/block');
const Buff = require('./anims/buff');
const Break = require('./anims/break');
const Chaos = require('./anims/chaos');
const Sustain = require('./anims/sustain');
const Counter = require('./anims/counter');
@ -143,7 +144,7 @@ function animations(props) {
case 'Bash': return <Bash />;
case 'Absorb': return <Absorb />;
case 'Sleep': return <Sleep />;
case 'Throw': return false;
case 'Break': return <Break />;
case 'Ruin': return false;
// Block Base

View File

@ -0,0 +1,93 @@
const preact = require('preact');
const { Component } = require('preact');
const anime = require('animejs').default;
const { TIMES } = require('../../constants');
// logarithmic spiral lifted from
// https://upload.wikimedia.org/wikipedia/commons/5/5b/Logarithmic_spiral_(1).svg
class Break extends Component {
constructor() {
super();
this.animations = [];
}
render() {
const path = 'M0,100 C100,100 100,100 200,100';
return (
<svg
class='skill-animation red'
version="1.1"
id="break"
xmlns="http://www.w3.org/2000/svg"
viewBox="-291 -291 582 582">
<filter id='breakFilter'>
<feTurbulence type="turbulence" baseFrequency="0" numOctaves="1" result="turbulence"></feTurbulence>
<feDisplacementMap in2="turbulence" in="SourceGraphic" scale="1" xChannelSelector="R" yChannelSelector="G"></feDisplacementMap>
</filter>
<g>
<path
d="M3.6 0c.23-2.93-1.9-4.9-4.8-4.77S-6.37-1.87-6.33 1.3s2.92 7.1 8.03 7 9.4-4.78 9.2-10.5-5-11.95-13.4-12.1S-18.77-6.88-18.85 3.3-10.05 24.97 4.8 24.74 32.78 11.38 32.5-6.5 16.15-42.7-7.8-42.7-55.7-22.02-56.2 9.7s27.3 65 72 64 82.32-42.78 81-92.3S55.41-126.63-23-127.4-168.4-56.97-167.6 30.3s65.85 166.15 161.27 186S246.55 187.18 284.83 0"
/>
<path
d="M3.6 0c.23-2.93-1.9-4.9-4.8-4.77S-6.37-1.87-6.33 1.3s2.92 7.1 8.03 7 9.4-4.78 9.2-10.5-5-11.95-13.4-12.1S-18.77-6.88-18.85 3.3-10.05 24.97 4.8 24.74 32.78 11.38 32.5-6.5 16.15-42.7-7.8-42.7-55.7-22.02-56.2 9.7s27.3 65 72 64 82.32-42.78 81-92.3S55.41-126.63-23-127.4-168.4-56.97-167.6 30.3s65.85 166.15 161.27 186S246.55 187.18 284.83 0"
transform="rotate(120)"
style="opacity: 0.75"
/>
<path
d="M3.6 0c.23-2.93-1.9-4.9-4.8-4.77S-6.37-1.87-6.33 1.3s2.92 7.1 8.03 7 9.4-4.78 9.2-10.5-5-11.95-13.4-12.1S-18.77-6.88-18.85 3.3-10.05 24.97 4.8 24.74 32.78 11.38 32.5-6.5 16.15-42.7-7.8-42.7-55.7-22.02-56.2 9.7s27.3 65 72 64 82.32-42.78 81-92.3S55.41-126.63-23-127.4-168.4-56.97-167.6 30.3s65.85 166.15 161.27 186S246.55 187.18 284.83 0"
transform="rotate(240)"
style="opacity: 0.5"
/>
</g>
</svg>
);
}
componentDidMount() {
this.animations.push(anime({
targets: ['#break'],
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: ['#break'],
rotate: 180,
easing: 'linear',
loop: true,
delay: TIMES.TARGET_DELAY_MS,
duration: TIMES.TARGET_DURATION_MS,
}));
this.animations.push(anime({
targets: ['#breakFilter feTurbulence', '#breakFilter feDisplacementMap'],
baseFrequency: 2,
scale: 10,
numOctaves: 5,
easing: 'easeOutSine',
delay: TIMES.TARGET_DELAY_MS,
duration: TIMES.TARGET_DURATION_MS,
}));
}
// 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 = Break;

View File

@ -261,7 +261,7 @@ function testInstance(uuid) {
"cd": null
},
{
"skill": "Throw",
"skill": "Break",
"self_targeting": false,
"cd": 1
},
@ -835,7 +835,7 @@ function testInstance(uuid) {
"cd": null
},
{
"skill": "Throw",
"skill": "Break",
"self_targeting": false,
"cd": 1
},
@ -961,7 +961,7 @@ function testInstance(uuid) {
"cd": 3
},
{
"skill": "Throw",
"skill": "Break",
"self_targeting": false,
"cd": 1
}
@ -2112,7 +2112,7 @@ function testInstance(uuid) {
"cd": null
},
{
"skill": "Throw",
"skill": "Break",
"self_targeting": false,
"cd": 1
},

View File

@ -369,7 +369,7 @@ const removeTier = skill => {
if (skill.includes('Bash')) return 'Bash';
if (skill.includes('Sleep')) return 'Sleep';
if (skill.includes('Ruin')) return 'Ruin';
if (skill.includes('Throw')) return 'Throw';
if (skill.includes('Break')) return 'Break';
if (skill.includes('Hex')) return 'Hex';
if (skill.includes('Absorb')) return 'Absorb';
if (skill.includes('Banish')) return 'Banish';

View File

@ -172,9 +172,9 @@ pub enum Item {
InterceptI,
InterceptII,
InterceptIII,
ThrowI,
ThrowII,
ThrowIII,
BreakI,
BreakII,
BreakIII,
TriageI,
TriageII,
TriageIII,
@ -384,9 +384,9 @@ impl Item {
Item::SustainI => Some(Skill::SustainI),
Item::SustainII => Some(Skill::SustainII),
Item::SustainIII => Some(Skill::SustainIII),
Item::ThrowI => Some(Skill::ThrowI),
Item::ThrowII => Some(Skill::ThrowII),
Item::ThrowIII => Some(Skill::ThrowIII),
Item::BreakI => Some(Skill::BreakI),
Item::BreakII => Some(Skill::BreakII),
Item::BreakIII => Some(Skill::BreakIII),
Item::TriageI => Some(Skill::TriageI),
Item::TriageII => Some(Skill::TriageII),
Item::TriageIII => Some(Skill::TriageIII),
@ -765,9 +765,9 @@ impl Item {
self.into_skill().unwrap().effect()[0].get_duration(),
self.into_skill().unwrap().multiplier()),
Item::ThrowI |
Item::ThrowII |
Item::ThrowIII => format!(
Item::BreakI |
Item::BreakII |
Item::BreakIII => format!(
"Stun the target for {:?}T and applies Vulnerable increasing RedDamage taken by {:?}% for {:?}T",
self.into_skill().unwrap().effect()[0].get_duration(),
self.into_skill().unwrap().effect()[1].get_multiplier() - 100,
@ -850,9 +850,9 @@ impl Item {
Item::RuinI => vec![Item::Stun, Item::Blue, Item::Blue],
Item::RuinII => vec![Item::RuinI, Item::RuinI, Item::RuinI],
Item::RuinIII => vec![Item::RuinII, Item::RuinII, Item::RuinII],
Item::ThrowI => vec![Item::Stun, Item::Red, Item::Green],
Item::ThrowII => vec![Item::ThrowI, Item::ThrowI, Item::ThrowI],
Item::ThrowIII => vec![Item::ThrowII, Item::ThrowII, Item::ThrowII],
Item::BreakI => vec![Item::Stun, Item::Red, Item::Green],
Item::BreakII => vec![Item::BreakI, Item::BreakI, Item::BreakI],
Item::BreakIII => vec![Item::BreakII, Item::BreakII, Item::BreakII],
Item::AbsorbI => vec![Item::Stun, Item::Green, Item::Blue],
Item::AbsorbII => vec![Item::AbsorbI, Item::AbsorbI, Item::AbsorbI],
Item::AbsorbIII => vec![Item::AbsorbII, Item::AbsorbII, Item::AbsorbII],
@ -1040,9 +1040,9 @@ impl From<Skill> for Item {
Skill::SustainI => Item::SustainI,
Skill::SustainII => Item::SustainII,
Skill::SustainIII => Item::SustainIII,
Skill::ThrowI => Item::ThrowI,
Skill::ThrowII => Item::ThrowII,
Skill::ThrowIII => Item::ThrowIII,
Skill::BreakI => Item::BreakI,
Skill::BreakII => Item::BreakII,
Skill::BreakIII => Item::BreakIII,
Skill::TriageI => Item::TriageI,
Skill::TriageII => Item::TriageII,
Skill::TriageIII => Item::TriageIII,
@ -1235,9 +1235,9 @@ pub fn get_combos() -> Vec<Combo> {
Combo { components: Item::RuinII.combo(), item: Item::RuinII },
Combo { components: Item::RuinIII.combo(), item: Item::RuinIII },
Combo { components: Item::ThrowI.combo(), item: Item::ThrowI },
Combo { components: Item::ThrowII.combo(), item: Item::ThrowII },
Combo { components: Item::ThrowIII.combo(), item: Item::ThrowIII },
Combo { components: Item::BreakI.combo(), item: Item::BreakI },
Combo { components: Item::BreakII.combo(), item: Item::BreakII },
Combo { components: Item::BreakIII.combo(), item: Item::BreakIII },
Combo { components: Item::AbsorbI.combo(), item: Item::AbsorbI },
Combo { components: Item::AbsorbII.combo(), item: Item::AbsorbII },
Combo { components: Item::AbsorbIII.combo(), item: Item::AbsorbIII },

View File

@ -247,9 +247,9 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
Skill::InterceptII |
Skill::InterceptIII => intercept(source, target, resolutions, skill),
Skill::ThrowI |
Skill::ThrowII |
Skill::ThrowIII => throw(source, target, resolutions, skill), // no damage stun, adds vulnerable
Skill::BreakI |
Skill::BreakII |
Skill::BreakIII => break(source, target, resolutions, skill), // no damage stun, adds vulnerable
Skill::TriageI |
Skill::TriageII |
@ -622,9 +622,9 @@ pub enum Skill {
InterceptII,
InterceptIII,
ThrowI, // no damage stun, adds vulnerable
ThrowII,
ThrowIII,
BreakI, // no damage stun, adds vulnerable
BreakII,
BreakIII,
TriageI, // hot
TriageII,
@ -823,11 +823,11 @@ impl Skill {
Skill::ReflectII => vec![ConstructEffect {effect: Effect::Reflect, duration: 2, meta: None, tick: None }],
Skill::ReflectIII => vec![ConstructEffect {effect: Effect::Reflect, duration: 3, meta: None, tick: None }],
Skill::ThrowI => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None},
Skill::BreakI => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None},
ConstructEffect {effect: Effect::Vulnerable, duration: 3, meta: Some(EffectMeta::Multiplier(150)), tick: None}],
Skill::ThrowII => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None},
Skill::BreakII => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None},
ConstructEffect {effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(200)), tick: None}],
Skill::ThrowIII => vec![ConstructEffect {effect: Effect::Stun, duration: 2, meta: None, tick: None},
Skill::BreakIII => vec![ConstructEffect {effect: Effect::Stun, duration: 2, meta: None, tick: None},
ConstructEffect {effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(250)), tick: None}],
Skill::RuinI => vec![ConstructEffect {effect: Effect::Stun, duration: 1, meta: None, tick: None}],
@ -916,9 +916,9 @@ impl Skill {
Skill::TriageII => None, // hot
Skill::TriageIII => None, // hot
Skill::ThrowI => Some(1), // no damage stun, adds vulnerable
Skill::ThrowII => Some(1),
Skill::ThrowIII => Some(1),
Skill::BreakI => Some(1), // no damage stun, adds vulnerable
Skill::BreakII => Some(1),
Skill::BreakIII => Some(1),
Skill::BlastI => None,
Skill::BlastII => None,
@ -1296,7 +1296,7 @@ fn intercept(source: &mut Construct, target: &mut Construct, mut results: Resolu
return results;
}
fn throw(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
fn break(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
let stun = skill.effect()[0];
results.push(Resolution::new(source, target).event(target.add_effect(skill, stun)));
let vuln = skill.effect()[1];