add haste and slow

This commit is contained in:
ntr 2019-01-07 17:59:31 +11:00
parent 37175646dc
commit 44a083f440

View File

@ -377,6 +377,8 @@ pub enum Skill {
Fear,
Taunt,
Pause, // speed slow
Haste,
Slow,
// used by tests, no cd, no dmg
TestTouch,
@ -460,6 +462,8 @@ impl Skill {
Skill::Fear => None,
Skill::Taunt => Some(1),
Skill::Pause => Some(1), // speed slow
Skill::Haste => None,
Skill::Slow => None,
// -----------------
// Test
@ -546,6 +550,9 @@ impl Skill {
Skill::Taunt => Category::Spell,
Skill::Pause => Category::Spell, // extend durations
// Skill::Lag => 2, //
Skill::Haste => Category::Spell,
Skill::Slow => Category::Spell,
// -----------------
// Test
@ -641,6 +648,8 @@ impl Skill {
Skill::Taunt => 2,
Skill::Pause => 2, // extend durations
// Skill::Lag => 2, //
Skill::Haste => 2,
Skill::Slow => 2,
// -----------------
// Test
@ -738,6 +747,8 @@ impl Skill {
Skill::Fear => panic!("nyi"), // cast random spell on self
Skill::Taunt => panic!("nyi"), // target forced to attack
Skill::Pause => panic!("nyi"), // speed slow
Skill::Haste => haste(source, target, resolution), // speed slow
Skill::Slow => slow(source, target, resolution), // speed slow
// -----------------
// Test
@ -884,6 +895,18 @@ fn amplify(_cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> R
return resolution;;
}
fn haste(_cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let effect = CrypEffect { effect: Effect::Haste, duration: Effect::Haste.duration(), tick: None };
resolution.results.push(target.add_effect(Skill::Haste, effect));
return resolution;;
}
fn slow(_cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let effect = CrypEffect { effect: Effect::Slow, duration: Effect::Slow.duration(), tick: None };
resolution.results.push(target.add_effect(Skill::Slow, effect));
return resolution;;
}
fn decay(cryp: &mut Cryp, target: &mut Cryp, mut resolution: Resolution) -> Resolution {
let decay = CrypEffect {
effect: Effect::Decay,