Haste and impurity deal an extra attack

This commit is contained in:
Mashy 2019-05-07 13:02:16 +10:00
parent 7913de7eb9
commit 50bc93073b

View File

@ -25,6 +25,35 @@ pub fn resolve(skill: Skill, source: &mut Cryp, target: &mut Cryp, mut resolutio
return resolve(skill, target, source, resolutions);
}
if source.affected(Effect::Haste) {
match skill {
Skill::Attack |
Skill::Slay |
Skill::Chaos |
Skill::Strike => {
let amount = source.speed().pct(Skill::HasteStrike.multiplier());
target.deal_red_damage(Skill::HasteStrike, amount)
.into_iter()
.for_each(|e| resolutions.push(Resolution::new(source, target).event(e)));
},
_ => (),
}
}
if source.affected(Effect::Impurity) {
match skill {
Skill::Blast |
Skill::Chaos |
Skill::Siphon => {
let amount = source.green_damage().pct(Skill::ImpureBlast.multiplier());
target.deal_blue_damage(Skill::ImpureBlast, amount)
.into_iter()
.for_each(|e| resolutions.push(Resolution::new(source, target).event(e)));
},
_ => (),
}
}
// match self.category() == Category::Red {
// true => {
// if let Some(evasion) = target.evade(*self) {
@ -49,10 +78,12 @@ pub fn resolve(skill: Skill, source: &mut Cryp, target: &mut Cryp, mut resolutio
Skill::Decay => decay(source, target, resolutions, skill), // dot
Skill::DecayTick => decay_tick(source, target, resolutions, skill), // dot
Skill::Haste => haste(source, target, resolutions, skill), // speed slow
Skill::HasteStrike => panic!("haste strike should not be caste"),
Skill::Heal => heal(source, target, resolutions, skill),
Skill::Hex => hex(source, target, resolutions, skill),
Skill::Hostility => hostility(source, target, resolutions, skill),
Skill::Impurity => impurity(source, target, resolutions, skill),
Skill::ImpureBlast => panic!("impure blast should not be caste"),
Skill::Invert => invert(source, target, resolutions, skill),
Skill::Injure => injure(source, target, resolutions, skill),
Skill::Parry => parry(source, target, resolutions, skill),
@ -481,6 +512,7 @@ pub enum Skill {
Clutch,
Taunt,
Impurity,
ImpureBlast,
Invert,
Strangle,
@ -535,6 +567,7 @@ pub enum Skill {
Chaos,
Hex,
Haste,
HasteStrike,
Slow,
// used by tests, no cd, 100% multiplier
@ -557,28 +590,31 @@ impl Skill {
Skill::Heal => 130, //GG
Skill::SiphonTick => 40, // GB
Skill::Slay => 70, // RG
Skill::Strike => 90, //RR
Skill::StrikeII => 110,
Skill::StrikeIII => 130,
// Block Base
Skill::CorruptionTick => 80,
Skill::Purify => 45, //Green dmg (heal)
Skill::Recharge => 85, //restore red and blue life (heal)
Skill::Reflect => 45, //restore blue life (heal)
Skill::Riposte => 70,
// Stun Base
Skill::Sleep => 240, //Green dmg (heal)
Skill::StrangleTick => 65,
// Debuff Base
Skill::Silence => 55, // Deals more per blue skill on target
Skill::Snare => 40, // Deals more per red skill on target
Skill::DecayTick => 25,
// Buff base
Skill::ImpureBlast => 25,
Skill::HasteStrike => 30,
Skill::TriageTick => 75,
// Others
Skill::CorruptionTick => 80,
Skill::DecayTick => 25,
Skill::Riposte => 70,
_ => 100,
}
@ -666,7 +702,8 @@ impl Skill {
Skill::Blast => None,
Skill::Chaos => None,
Skill::Amplify => Some(1),
Skill::Impurity => Some(3),
Skill::Impurity => None,
Skill::ImpureBlast => None,
Skill::Invert => Some(2),
Skill::Decay => Some(1), // dot
Skill::DecayTick => None,
@ -680,6 +717,8 @@ impl Skill {
Skill::Banish => Some(1),
Skill::Hex => Some(1),
Skill::Haste => None,
Skill::HasteStrike => None, // Used in haste
Skill::Slow => None,
Skill::Reflect => Some(2),
Skill::Recharge => Some(2),
@ -728,6 +767,7 @@ impl Skill {
Skill::Stun => Category::Red,
Skill::Slay => Category::Red,
Skill::Taunt => Category::Red,
Skill::HasteStrike => Category::Red,
Skill::Heal => Category::Green,
Skill::Triage => Category::Green, // hot
@ -741,6 +781,7 @@ impl Skill {
Skill::Invert => Category::Green,
Skill::Sleep => Category::Green,
Skill::ImpureBlast => Category::Blue,
Skill::Scatter => Category::Blue,
Skill::Blast => Category::Blue,
Skill::Chaos => Category::Blue,