From bf4038b09d15a2fd27a5305d63558ab465e5bb69 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 13 Dec 2019 14:57:17 +1000 Subject: [PATCH] big changeup innit --- core/src/skill.rs | 2479 ++++++++++++++++++++++++--------------------- 1 file changed, 1308 insertions(+), 1171 deletions(-) diff --git a/core/src/skill.rs b/core/src/skill.rs index 8698454b..63f9329f 100644 --- a/core/src/skill.rs +++ b/core/src/skill.rs @@ -58,159 +58,158 @@ impl Cast { } match self.skill { - _ => attack(self, game), - // Skill::Attack => attack(self, game, events), - // Skill::Block => block(self, game, events), - // Skill::Buff => buff(self, game, events), - // Skill::Debuff => debuff(self, game, events), - // Skill::Stun => stun(self, game, events), + Skill::Attack => attack(self, game), + Skill::Block => block(self, game), + Skill::Buff => buff(self, game), + Skill::Debuff => debuff(self, game), + Skill::Stun => stun(self, game), - // Skill::Amplify => amplify(self, game, events), - // Skill::AmplifyPlus => amplify_plus(self, game, events), - // Skill::AmplifyPlusPlus => amplify_plus_plus(self, game, events), + Skill::Amplify => amplify(self, game), + Skill::AmplifyPlus => amplify_plus(self, game), + Skill::AmplifyPlusPlus => amplify_plus_plus(self, game), - // Skill::Absorb => absorb(self, game, events), - // Skill::AbsorbPlus => absorb_plus(self, game, events), - // Skill::AbsorbPlusPlus => absorb_plus_plus(self, game, events), - // Skill::Absorption => absorption(self, game, events), - // Skill::AbsorptionPlus => absorption_plus(self, game, events), - // Skill::AbsorptionPlusPlus => absorption_plus_plus(self, game, events), + Skill::Absorb => absorb(self, game), + Skill::AbsorbPlus => absorb_plus(self, game), + Skill::AbsorbPlusPlus => absorb_plus_plus(self, game), + Skill::Absorption => absorption(self, game), + Skill::AbsorptionPlus => absorption_plus(self, game), + Skill::AbsorptionPlusPlus => absorption_plus_plus(self, game), - // Skill::Banish | - // Skill::BanishPlus | - // Skill::BanishPlusPlus => banish(self, game, events), + Skill::Banish | + Skill::BanishPlus | + Skill::BanishPlusPlus => banish(self, game), - // Skill::Bash | - // Skill::BashPlus | - // Skill::BashPlusPlus => bash(self, game, events), + Skill::Bash | + Skill::BashPlus | + Skill::BashPlusPlus => bash(self, game), - // Skill::Blast | - // Skill::BlastPlus | - // Skill::BlastPlusPlus => blast(self, game, events), + Skill::Blast | + Skill::BlastPlus | + Skill::BlastPlusPlus => blast(self, game), - // Skill::Break => break_zero(self, game, events), - // Skill::BreakPlus => break_plus(self, game, events), - // Skill::BreakPlusPlus => break_plus_plus(self, game, events), + Skill::Break => break_zero(self, game), + Skill::BreakPlus => break_plus(self, game), + Skill::BreakPlusPlus => break_plus_plus(self, game), - // Skill::Curse => curse(self, game, events), - // Skill::CursePlus => curse_plus(self, game, events), - // Skill::CursePlusPlus => curse_plus_plus(self, game, events), + Skill::Curse => curse(self, game), + Skill::CursePlus => curse_plus(self, game), + Skill::CursePlusPlus => curse_plus_plus(self, game), - // Skill::Chaos | - // Skill::ChaosPlus | - // Skill::ChaosPlusPlus => chaos(self, game, events), + Skill::Chaos | + Skill::ChaosPlus | + Skill::ChaosPlusPlus => chaos(self, game), - // Skill::Counter => counter(self, game, events), - // Skill::CounterPlus => counter_plus(self, game, events), - // Skill::CounterPlusPlus => counter_plus_plus(self, game, events), - // Skill::CounterAttack | - // Skill::CounterAttackPlus | - // Skill::CounterAttackPlusPlus => counter_attack(self, game, events), + Skill::Counter => counter(self, game), + Skill::CounterPlus => counter_plus(self, game), + Skill::CounterPlusPlus => counter_plus_plus(self, game), + Skill::CounterAttack | + Skill::CounterAttackPlus | + Skill::CounterAttackPlusPlus => counter_attack(self, game), - // Skill::Decay => decay(self, game, events), - // Skill::DecayPlus => decay_plus(self, game, events), - // Skill::DecayPlusPlus => decay_plus_plus(self, game, events), - // Skill::DecayTick | - // Skill::DecayTickPlus | - // Skill::DecayTickPlusPlus => decay_tick(self, game, events), + Skill::Decay => decay(self, game), + Skill::DecayPlus => decay_plus(self, game), + Skill::DecayPlusPlus => decay_plus_plus(self, game), + Skill::DecayTick | + Skill::DecayTickPlus | + Skill::DecayTickPlusPlus => decay_tick(self, game), - // Skill::Electrify => electrify(self, game, events), - // Skill::ElectrifyPlus => electrify_plus(self, game, events), - // Skill::ElectrifyPlusPlus => electrify_plus_plus(self, game, events), - // Skill::Electrocute => electrocute(self, game, events), - // Skill::ElectrocutePlus => electrocute_plus(self, game, events), - // Skill::ElectrocutePlusPlus => electrocute_plus_plus(self, game, events), - // Skill::ElectrocuteTick | - // Skill::ElectrocuteTickPlus | - // Skill::ElectrocuteTickPlusPlus => electrocute_tick(self, game, events), + Skill::Electrify => electrify(self, game), + Skill::ElectrifyPlus => electrify_plus(self, game), + Skill::ElectrifyPlusPlus => electrify_plus_plus(self, game), + Skill::Electrocute => electrocute(self, game), + Skill::ElectrocutePlus => electrocute_plus(self, game), + Skill::ElectrocutePlusPlus => electrocute_plus_plus(self, game), + Skill::ElectrocuteTick | + Skill::ElectrocuteTickPlus | + Skill::ElectrocuteTickPlusPlus => electrocute_tick(self, game), - // Skill::Heal | - // Skill::HealPlus | - // Skill::HealPlusPlus => heal(self, game, events), + Skill::Heal | + Skill::HealPlus | + Skill::HealPlusPlus => heal(self, game), - // Skill::Haste => haste(self, game, events), - // Skill::HastePlus => haste_plus(self, game, events), - // Skill::HastePlusPlus => haste_plus_plus(self, game, events), + Skill::Haste => haste(self, game), + Skill::HastePlus => haste_plus(self, game), + Skill::HastePlusPlus => haste_plus_plus(self, game), - // Skill::HasteStrike => haste_strike(self, game, events), + Skill::HasteStrike => haste_strike(self, game), - // Skill::Hybrid => hybrid(self, game, events), - // Skill::HybridPlus => hybrid_plus(self, game, events), - // Skill::HybridPlusPlus => hybrid_plus_plus(self, game, events), + Skill::Hybrid => hybrid(self, game), + Skill::HybridPlus => hybrid_plus(self, game), + Skill::HybridPlusPlus => hybrid_plus_plus(self, game), - // Skill::HybridBlast => hybrid_blast(self, game, events), + Skill::HybridBlast => hybrid_blast(self, game), - // Skill::Intercept | - // Skill::InterceptPlus | - // Skill::InterceptPlusPlus => intercept(self, game, events), + Skill::Intercept | + Skill::InterceptPlus | + Skill::InterceptPlusPlus => intercept(self, game), - // Skill::Invert => invert(self, game, events), - // Skill::InvertPlus => invert_plus(self, game, events), - // Skill::InvertPlusPlus => invert_plus_plus(self, game, events), + Skill::Invert => invert(self, game), + Skill::InvertPlus => invert_plus(self, game), + Skill::InvertPlusPlus => invert_plus_plus(self, game), - // Skill::Link | - // Skill::LinkPlus | - // Skill::LinkPlusPlus => link(self, game, events), + Skill::Link | + Skill::LinkPlus | + Skill::LinkPlusPlus => link(self, game), - // Skill::Purge => purge(self, game, events), - // Skill::PurgePlus => purge_plus(self, game, events), - // Skill::PurgePlusPlus => purge_plus_plus(self, game, events), + Skill::Purge => purge(self, game), + Skill::PurgePlus => purge_plus(self, game), + Skill::PurgePlusPlus => purge_plus_plus(self, game), - // Skill::Purify => purify(self, game, events), - // Skill::PurifyPlus => purify_plus(self, game, events), - // Skill::PurifyPlusPlus => purify_plus_plus(self, game, events), + Skill::Purify => purify(self, game), + Skill::PurifyPlus => purify_plus(self, game), + Skill::PurifyPlusPlus => purify_plus_plus(self, game), - // Skill::Recharge | - // Skill::RechargePlus | - // Skill::RechargePlusPlus => recharge(self, game, events), + Skill::Recharge | + Skill::RechargePlus | + Skill::RechargePlusPlus => recharge(self, game), - // Skill::Reflect | - // Skill::ReflectPlus | - // Skill::ReflectPlusPlus => reflect(self, game, events), + Skill::Reflect | + Skill::ReflectPlus | + Skill::ReflectPlusPlus => reflect(self, game), - // Skill::Restrict | - // Skill::RestrictPlus | - // Skill::RestrictPlusPlus => restrict(self, game, events), + Skill::Restrict | + Skill::RestrictPlus | + Skill::RestrictPlusPlus => restrict(self, game), - // Skill::Ruin | - // Skill::RuinPlus | - // Skill::RuinPlusPlus => ruin(self, game, events), + Skill::Ruin | + Skill::RuinPlus | + Skill::RuinPlusPlus => ruin(self, game), - // Skill::Siphon => siphon(self, game, events), - // Skill::SiphonPlus => siphon_plus(self, game, events), - // Skill::SiphonPlusPlus => siphon_plus_plus(self, game, events), - // Skill::SiphonTick | - // Skill::SiphonTickPlus | - // Skill::SiphonTickPlusPlus => siphon_tick(self, game, events), + Skill::Siphon => siphon(self, game), + Skill::SiphonPlus => siphon_plus(self, game), + Skill::SiphonPlusPlus => siphon_plus_plus(self, game), + Skill::SiphonTick | + Skill::SiphonTickPlus | + Skill::SiphonTickPlusPlus => siphon_tick(self, game), - // Skill::Slay | - // Skill::SlayPlus | - // Skill::SlayPlusPlus => slay(self, game, events), + Skill::Slay | + Skill::SlayPlus | + Skill::SlayPlusPlus => slay(self, game), - // Skill::Sleep => sleep(self, game, events), - // Skill::SleepPlus => sleep_plus(self, game, events), - // Skill::SleepPlusPlus => sleep_plus_plus(self, game, events), + Skill::Sleep => sleep(self, game), + Skill::SleepPlus => sleep_plus(self, game), + Skill::SleepPlusPlus => sleep_plus_plus(self, game), - // Skill::Silence | - // Skill::SilencePlus | - // Skill::SilencePlusPlus => silence(self, game, events), + Skill::Silence | + Skill::SilencePlus | + Skill::SilencePlusPlus => silence(self, game), - // Skill::Strike | - // Skill::StrikePlus | - // Skill::StrikePlusPlus => strike(self, game, events), + Skill::Strike | + Skill::StrikePlus | + Skill::StrikePlusPlus => strike(self, game), - // Skill::Sustain | - // Skill::SustainPlus | - // Skill::SustainPlusPlus => sustain(self, game, events), + Skill::Sustain | + Skill::SustainPlus | + Skill::SustainPlusPlus => sustain(self, game), - // Skill::Triage => triage(self, game, events), - // Skill::TriagePlus => triage_plus(self, game, events), - // Skill::TriagePlusPlus => triage_plus_plus(self, game, events), - // Skill::TriageTick | - // Skill::TriageTickPlus | - // Skill::TriageTickPlusPlus => triage_tick(self, game, events), + Skill::Triage => triage(self, game), + Skill::TriagePlus => triage_plus(self, game), + Skill::TriagePlusPlus => triage_plus_plus(self, game), + Skill::TriageTick | + Skill::TriageTickPlus | + Skill::TriageTickPlusPlus => triage_tick(self, game), }; // actions.append(&mut rest); @@ -1124,1058 +1123,1196 @@ fn attack(cast: Cast, game: &mut Game) { ); } -// fn block(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Block, duration: 1, meta: Some(EffectMeta::Multiplier(35)) }, -// }, -// ] -// } - -// fn buff(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Buff, duration: 3, meta: Some(EffectMeta::Multiplier(130)) }, -// }, -// ] -// } - -// fn debuff(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Slow, duration: 3, meta: Some(EffectMeta::Multiplier(50)) }, -// }, -// ] -// } - -// fn stun(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, -// }, -// ] -// } - - -// fn amplify(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Amplify, duration: 2, meta: Some(EffectMeta::Multiplier(150)) }, -// }, -// ] -// } - -// fn amplify_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Amplify, duration: 3, meta: Some(EffectMeta::Multiplier(175)) }, -// }, -// ] -// } - -// fn amplify_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Amplify, duration: 4, meta: Some(EffectMeta::Multiplier(200)) }, -// }, -// ] -// } - -// fn absorb(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Absorb, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::Absorption)) }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Blue, -// }, -// ] -// } - -// fn absorb_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Absorb, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::AbsorptionPlus)) }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Blue, -// }, -// ] -// } - -// fn absorb_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Absorb, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::AbsorptionPlusPlus)) }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Blue, -// }, -// ] -// } - -// fn absorption(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Remove { -// construct: cast.source, -// effect: Effect::Absorb, -// }, -// Action::Effect { -// construct: cast.source, -// effect: ConstructEffect { effect: Effect::Absorption, duration: 3, meta: Some(EffectMeta::AddedDamage(0)) }, -// }, -// Action::SetEffectMeta { -// construct: cast.source, -// effect: Effect::Absorption, -// amount: game.value(Value::DamageReceived { construct: cast.source, colour: Colour::Blue }, events).pct(100), -// }, -// ] -// } - -// fn absorption_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Remove { -// construct: cast.source, -// effect: Effect::Absorb, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Absorption, duration: 4, meta: Some(EffectMeta::AddedDamage(0)) }, -// }, -// Action::SetEffectMeta { -// construct: cast.target, -// effect: Effect::Absorption, -// amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }, events).pct(100), -// }, -// ] -// } - -// fn absorption_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Remove { -// construct: cast.source, -// effect: Effect::Absorb, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Absorption, duration: 5, meta: Some(EffectMeta::AddedDamage(0)) }, -// }, -// Action::SetEffectMeta { -// construct: cast.target, -// effect: Effect::Absorption, -// amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }, events), -// }, -// ] -// } - -// fn banish(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount: game.value(Value::Stat { construct: cast.target, stat: Stat::RedLife }, events).pct(cast.skill.multiplier()), -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.target, stat: Stat::BlueLife }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Banish, duration: 2, meta: None } -// } -// ] -// } - -// fn bash(cast: &Cast, game: &Game, events: Vec) -> Vec { -// let cds = game.value(Value::Cooldowns { construct: cast.source }, events); -// let red_power = game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events); -// let amount = red_power.pct(cast.skill.multiplier().pct(100 + 45usize.saturating_mul(cds))); - -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None } -// }, -// Action::IncreaseCooldowns { -// construct: cast.target, -// turns: 1, -// }, -// ] -// } - -// fn blast(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn break_zero(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Vulnerable, duration: 3, meta: Some(EffectMeta::Multiplier(150)), }, -// }, -// ] -// } - -// fn break_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(175)), }, -// }, -// ] -// } - -// fn break_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(200)), }, -// }, -// ] -// } - - -// fn curse(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Curse, duration: 2, meta: Some(EffectMeta::Multiplier(150)) }, -// }, -// ] -// } - -// fn curse_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Curse, duration: 2, meta: Some(EffectMeta::Multiplier(175)) }, -// }, -// ] -// } - -// fn curse_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Curse, duration: 3, meta: Some(EffectMeta::Multiplier(200)) }, -// }, -// ] -// } - - -// fn chaos(cast: &Cast, game: &Game, events: Vec) -> Vec { -// let mut rng = thread_rng(); -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount: -// game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events).pct(cast.skill.multiplier() + rng.gen_range(0, 30)) -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: -// game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier() + rng.gen_range(0, 30)) -// }, -// ] -// } - -// fn counter(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Counter, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::CounterAttack)) }, -// }, -// ] -// } - -// fn counter_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Counter, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::CounterAttackPlus)) }, -// }, -// ] -// } - -// fn counter_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Counter, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::CounterAttackPlusPlus)) }, -// }, -// ] -// } - -// fn counter_attack(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn decay(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Wither, duration: 3, meta: Some(EffectMeta::Multiplier(50)) }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Decay, duration: 2, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::DecayTick }) }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks -// }, -// ] -// } - -// fn decay_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Wither, duration: 3, meta: Some(EffectMeta::Multiplier(35)) }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Decay, duration: 4, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::DecayTickPlus }) }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks -// }, -// ] -// } - -// fn decay_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Wither, duration: 4, meta: Some(EffectMeta::Multiplier(20)) }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Decay, duration: 4, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::DecayTickPlusPlus }) }, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks -// }, -// ] -// } - -// fn decay_tick(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks -// }, -// ] -// } - -// fn electrify(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Electric, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::Electrocute)) }, -// }, -// ] -// } - -// fn electrify_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Electric, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::ElectrocutePlus)) }, -// }, -// ] -// } - -// fn electrify_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Electric, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::ElectrocutePlusPlus)) }, -// }, -// ] -// } - -// fn electrocute(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Remove { -// construct: cast.source, -// effect: Effect::Electric, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Electric, duration: 2, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::ElectrocuteTick }) }, -// }, -// ] -// } -// fn electrocute_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Remove { -// construct: cast.source, -// effect: Effect::Electric, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Electric, duration: 3, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::ElectrocuteTickPlus }) }, -// }, -// ] -// } - -// fn electrocute_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Remove { -// construct: cast.source, -// effect: Effect::Electric, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Electric, duration: 4, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::ElectrocuteTickPlusPlus }) }, -// }, -// ] -// } - -// fn electrocute_tick(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn heal(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn haste(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Haste, duration: 3, meta: Some(EffectMeta::Multiplier(150)) }, -// }, -// ] -// } - -// fn haste_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Haste, duration: 3, meta: Some(EffectMeta::Multiplier(175)) }, -// }, -// ] -// } - -// fn haste_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Haste, duration: 3, meta: Some(EffectMeta::Multiplier(225)) }, -// }, -// ] -// } - -// fn haste_strike(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::Speed }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn hybrid(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Hybrid, duration: 3, meta: Some(EffectMeta::Multiplier(150)) }, -// }, -// ] -// } - -// fn hybrid_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Hybrid, duration: 4, meta: Some(EffectMeta::Multiplier(175)) }, -// }, -// ] -// } - -// fn hybrid_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Hybrid, duration: 5, meta: Some(EffectMeta::Multiplier(200)) }, -// }, -// ] -// } - -// fn hybrid_blast(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn intercept(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Intercept, duration: 1, meta: None }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Red, -// }, -// ] -// } - -// fn invert(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Invert, duration: 2, meta: None }, -// }, -// ] -// } - -// fn invert_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Invert, duration: 3, meta: None }, -// }, -// ] -// } - -// fn invert_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Invert, duration: 4, meta: None }, -// }, -// ] -// } - -// fn link(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None }, -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Effects { construct: cast.target }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn purge(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::RemoveAll { -// construct: cast.target, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Purge, duration: 2, meta: None } -// }, -// ] -// } - -// fn purge_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::RemoveAll { -// construct: cast.target, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Purge, duration: 3, meta: None } -// }, -// ] -// } - -// fn purge_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::RemoveAll { -// construct: cast.target, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Purge, duration: 4, meta: None } -// }, -// ] -// } - -// fn purify(cast: &Cast, game: &Game, events: Vec) -> Vec { -// let gp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events); -// let rms = game.value(Value::Removals { construct: cast.target }, events); -// let amount = gp.pct(cast.skill.multiplier().saturating_mul(rms)); - -// vec![ -// Action::RemoveAll { -// construct: cast.target, -// }, -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(150)) } -// }, -// ] -// } - -// fn purify_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// let gp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events); -// let rms = game.value(Value::Removals { construct: cast.target }, events); -// let amount = gp.pct(cast.skill.multiplier().saturating_mul(rms)); - -// vec![ -// Action::RemoveAll { -// construct: cast.target, -// }, -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(175)) } -// }, -// ] -// } - -// fn purify_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// let gp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events); -// let rms = game.value(Value::Removals { construct: cast.target }, events); -// let amount = gp.pct(cast.skill.multiplier().saturating_mul(rms)); - -// vec![ -// Action::RemoveAll { -// construct: cast.target, -// }, -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount, -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(200)) } -// }, -// ] -// } - -// fn recharge(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Heal { -// construct: cast.target, -// colour: Colour::Red, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Heal { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn reflect(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Reflect, duration: 1, meta: None }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Blue, -// }, -// ] -// } - -// fn restrict(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Restrict, duration: 2, meta: None } -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount: game.value(Value::ColourSkills { construct: cast.source, colour: Colour::Red }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - - -// fn ruin(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.target, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None } -// } -// ] -// } - - -// fn siphon(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Siphon, duration: 2, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::SiphonTick }) }, -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks -// }, -// Action::Heal { -// construct: cast.source, -// colour: Colour::Green, -// amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }, events).pct(100), -// }, -// ] -// } - -// fn siphon_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Siphon, duration: 3, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::SiphonTickPlus }) }, -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks -// }, -// Action::Heal { -// construct: cast.source, -// colour: Colour::Green, -// amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }, events).pct(100), -// }, -// ] -// } - -// fn siphon_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Siphon, duration: 4, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::SiphonTickPlusPlus }) }, -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks -// }, -// Action::Heal { -// construct: cast.source, -// colour: Colour::Green, -// amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }, events).pct(100), -// }, -// ] -// } - -// fn siphon_tick(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Blue, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks -// }, -// Action::Heal { -// construct: cast.source, -// colour: Colour::Green, -// amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }, events).pct(100), -// }, -// ] -// } - -// fn slay(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Heal { -// construct: cast.source, -// colour: Colour::Green, -// amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Red, mult: 50 }, events), -// }, -// ] -// } - -// fn sleep(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Blue, -// }, -// ] -// } - -// fn sleep_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Blue, -// }, -// ] -// } - -// fn sleep_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Blue, -// }, -// ] -// } - -// fn silence(cast: &Cast, game: &Game, events: Vec) -> Vec { -// let bp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events); -// let silences = game.value(Value::ColourSkills { construct: cast.target, colour: Colour::Blue }, events); -// let amount = bp.pct(45usize.saturating_mul(silences)); - -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Silence, duration: 2, meta: None }, -// }, -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount, -// }, -// ] -// } - -// fn strike(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Damage { -// construct: cast.target, -// colour: Colour::Red, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events).pct(cast.skill.multiplier()), -// }, -// ] -// } - -// fn sustain(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Sustain, duration: 1, meta: None }, -// }, -// Action::Heal { -// construct: cast.target, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }, events).pct(cast.skill.multiplier()), -// colour: Colour::Red, -// }, -// ] -// } - -// fn triage(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Triage, duration: 2, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::TriageTick }) }, -// }, -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, -// }, -// ] -// } - -// fn triage_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Triage, duration: 3, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::TriageTickPlus }) }, -// }, -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, -// }, -// ] -// } - -// fn triage_plus_plus(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Triage, duration: 4, meta: -// Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::TriageTickPlusPlus }) }, -// }, -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, -// }, -// ] -// } - -// fn triage_tick(cast: &Cast, game: &Game, events: Vec) -> Vec { -// vec![ -// Action::Heal { -// construct: cast.target, -// colour: Colour::Green, -// amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }, events).pct(cast.skill.multiplier()), -// }, -// Action::Effect { -// construct: cast.target, -// effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, -// }, -// ] -// } +fn block(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Block, duration: 1, meta: Some(EffectMeta::Multiplier(35)) }, + }, + ); +} + +fn buff(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Buff, duration: 3, meta: Some(EffectMeta::Multiplier(130)) }, + }, + ); +} + +fn debuff(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Slow, duration: 3, meta: Some(EffectMeta::Multiplier(50)) }, + }, + ); +} + +fn stun(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, + }, + ); +} + + +fn amplify(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Amplify, duration: 2, meta: Some(EffectMeta::Multiplier(150)) }, + }, + ); +} + +fn amplify_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Amplify, duration: 3, meta: Some(EffectMeta::Multiplier(175)) }, + }, + ); +} + +fn amplify_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Amplify, duration: 4, meta: Some(EffectMeta::Multiplier(200)) }, + }, + ); +} + +fn absorb(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Absorb, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::Absorption)) }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + colour: Colour::Blue, + }, + ); +} + +fn absorb_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Absorb, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::AbsorptionPlus)) }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + colour: Colour::Blue, + }, + ); +} + +fn absorb_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Absorb, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::AbsorptionPlusPlus)) }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + colour: Colour::Blue, + }, + ); +} + +fn absorption(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Remove { + construct: cast.source, + effect: Effect::Absorb, + } + ); + game.action(cast, + Action::Effect { + construct: cast.source, + effect: ConstructEffect { effect: Effect::Absorption, duration: 3, meta: Some(EffectMeta::AddedDamage(0)) }, + } + ); +game.action(cast, + Action::SetEffectMeta { + construct: cast.source, + effect: Effect::Absorption, + amount: game.value(Value::DamageReceived { construct: cast.source, colour: Colour::Blue }).pct(100), + }, + ); +} + +fn absorption_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Remove { + construct: cast.source, + effect: Effect::Absorb, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Absorption, duration: 4, meta: Some(EffectMeta::AddedDamage(0)) }, + } + ); +game.action(cast, + Action::SetEffectMeta { + construct: cast.target, + effect: Effect::Absorption, + amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }).pct(100), + }, + ); +} + +fn absorption_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Remove { + construct: cast.source, + effect: Effect::Absorb, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Absorption, duration: 5, meta: Some(EffectMeta::AddedDamage(0)) }, + } + ); +game.action(cast, + Action::SetEffectMeta { + construct: cast.target, + effect: Effect::Absorption, + amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }), + }, + ); +} + +fn banish(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount: game.value(Value::Stat { construct: cast.target, stat: Stat::RedLife }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.target, stat: Stat::BlueLife }).pct(cast.skill.multiplier()), + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Banish, duration: 2, meta: None } + } + ); +} + +fn bash(cast: Cast, game: &mut Game) { + let cds = game.value(Value::Cooldowns { construct: cast.source }); + let red_power = game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }); + let amount = red_power.pct(cast.skill.multiplier().pct(100 + 45usize.saturating_mul(cds))); + + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None } + } + ); +game.action(cast, + Action::IncreaseCooldowns { + construct: cast.target, + turns: 1, + }, + ); +} + +fn blast(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + }, + ); +} + +fn break_zero(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None }, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Vulnerable, duration: 3, meta: Some(EffectMeta::Multiplier(150)), }, + }, + ); +} + +fn break_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None }, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(175)), }, + }, + ); +} + +fn break_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Vulnerable, duration: 4, meta: Some(EffectMeta::Multiplier(200)), }, + }, + ); +} + + +fn curse(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Curse, duration: 2, meta: Some(EffectMeta::Multiplier(150)) }, + }, + ); +} + +fn curse_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Curse, duration: 2, meta: Some(EffectMeta::Multiplier(175)) }, + }, + ); +} + +fn curse_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Curse, duration: 3, meta: Some(EffectMeta::Multiplier(200)) }, + }, + ); +} + + +fn chaos(cast: Cast, game: &mut Game) { + let mut rng = thread_rng(); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount: + game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier() + rng.gen_range(0, 30)) + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: + game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier() + rng.gen_range(0, 30)) + }, + ); +} + +fn counter(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Counter, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::CounterAttack)) }, + }, + ); +} + +fn counter_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Counter, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::CounterAttackPlus)) }, + }, + ); +} + +fn counter_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Counter, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::CounterAttackPlusPlus)) }, + }, + ); +} + +fn counter_attack(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()), + }, + ); +} + +fn decay(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Wither, duration: 3, meta: Some(EffectMeta::Multiplier(50)) }, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Decay, duration: 2, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::DecayTick }) }, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks + }, + ); +} + +fn decay_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Wither, duration: 3, meta: Some(EffectMeta::Multiplier(35)) }, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Decay, duration: 4, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::DecayTickPlus }) }, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks + }, + ); +} + +fn decay_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Wither, duration: 4, meta: Some(EffectMeta::Multiplier(20)) }, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Decay, duration: 4, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::DecayTickPlusPlus }) }, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks + }, + ); +} + +fn decay_tick(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks + }, + ); +} + +fn electrify(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Electric, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::Electrocute)) }, + }, + ); +} + +fn electrify_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Electric, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::ElectrocutePlus)) }, + }, + ); +} + +fn electrify_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Electric, duration: 1, meta: Some(EffectMeta::CastOnHit(Skill::ElectrocutePlusPlus)) }, + }, + ); +} + +fn electrocute(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Remove { + construct: cast.source, + effect: Effect::Electric, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Electric, duration: 2, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::ElectrocuteTick }) }, + }, + ); +} +fn electrocute_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Remove { + construct: cast.source, + effect: Effect::Electric, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Electric, duration: 3, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::ElectrocuteTickPlus }) }, + }, + ); +} + +fn electrocute_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Remove { + construct: cast.source, + effect: Effect::Electric, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Electric, duration: 4, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::ElectrocuteTickPlusPlus }) }, + }, + ); +} + +fn electrocute_tick(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + }, + ); +} + +fn heal(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + }, + ); +} + +fn haste(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Haste, duration: 3, meta: Some(EffectMeta::Multiplier(150)) }, + }, + ); +} + +fn haste_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Haste, duration: 3, meta: Some(EffectMeta::Multiplier(175)) }, + }, + ); +} + +fn haste_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Haste, duration: 3, meta: Some(EffectMeta::Multiplier(225)) }, + }, + ); +} + +fn haste_strike(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::Speed }).pct(cast.skill.multiplier()), + }, + ); +} + +fn hybrid(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Hybrid, duration: 3, meta: Some(EffectMeta::Multiplier(150)) }, + }, + ); +} + +fn hybrid_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Hybrid, duration: 4, meta: Some(EffectMeta::Multiplier(175)) }, + }, + ); +} + +fn hybrid_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Hybrid, duration: 5, meta: Some(EffectMeta::Multiplier(200)) }, + }, + ); +} + +fn hybrid_blast(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + }, + ); +} + +fn intercept(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Intercept, duration: 1, meta: None }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()), + colour: Colour::Red, + }, + ); +} + +fn invert(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Invert, duration: 2, meta: None }, + }, + ); +} + +fn invert_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Invert, duration: 3, meta: None }, + }, + ); +} + +fn invert_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Invert, duration: 4, meta: None }, + }, + ); +} + +fn link(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None }, + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Effects { construct: cast.target }).pct(cast.skill.multiplier()), + }, + ); +} + +fn purge(cast: Cast, game: &mut Game) { + game.action(cast, + Action::RemoveAll { + construct: cast.target, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Purge, duration: 2, meta: None } + }, + ); +} + +fn purge_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::RemoveAll { + construct: cast.target, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Purge, duration: 3, meta: None } + }, + ); +} + +fn purge_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::RemoveAll { + construct: cast.target, + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Purge, duration: 4, meta: None } + }, + ); +} + +fn purify(cast: Cast, game: &mut Game) { + let gp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }); + let rms = game.value(Value::Removals { construct: cast.target }); + let amount = gp.pct(cast.skill.multiplier().saturating_mul(rms)); + + game.action(cast, + Action::RemoveAll { + construct: cast.target, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(150)) } + }, + ); +} + +fn purify_plus(cast: Cast, game: &mut Game) { + let gp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }); + let rms = game.value(Value::Removals { construct: cast.target }); + let amount = gp.pct(cast.skill.multiplier().saturating_mul(rms)); + + game.action(cast, + Action::RemoveAll { + construct: cast.target, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(175)) } + }, + ); +} + +fn purify_plus_plus(cast: Cast, game: &mut Game) { + let gp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }); + let rms = game.value(Value::Removals { construct: cast.target }); + let amount = gp.pct(cast.skill.multiplier().saturating_mul(rms)); + + game.action(cast, + Action::RemoveAll { + construct: cast.target, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount, + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Pure, duration: 2, meta: Some(EffectMeta::Multiplier(200)) } + }, + ); +} + +fn recharge(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Red, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + }, + ); +} + +fn reflect(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Reflect, duration: 1, meta: None }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + colour: Colour::Blue, + }, + ); +} + +fn restrict(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Restrict, duration: 2, meta: None } + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount: game.value(Value::ColourSkills { construct: cast.source, colour: Colour::Red }).pct(cast.skill.multiplier()), + }, + ); +} + + +fn ruin(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.target, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 1, meta: None } + } + ); +} + + +fn siphon(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Siphon, duration: 2, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::SiphonTick }) }, + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks + } + ); +game.action(cast, + Action::Heal { + construct: cast.source, + colour: Colour::Green, + amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }).pct(100), + }, + ); +} + +fn siphon_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Siphon, duration: 3, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::SiphonTickPlus }) }, + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks + } + ); +game.action(cast, + Action::Heal { + construct: cast.source, + colour: Colour::Green, + amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }).pct(100), + }, + ); +} + +fn siphon_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Siphon, duration: 4, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::SiphonTickPlusPlus }) }, + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks + } + ); +game.action(cast, + Action::Heal { + construct: cast.source, + colour: Colour::Green, + amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }).pct(100), + }, + ); +} + +fn siphon_tick(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Blue, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::BluePower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks + } + ); +game.action(cast, + Action::Heal { + construct: cast.source, + colour: Colour::Green, + amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Blue }).pct(100), + }, + ); +} + +fn slay(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Heal { + construct: cast.source, + colour: Colour::Green, + amount: game.value(Value::DamageReceived { construct: cast.target, colour: Colour::Red }), + }, + ); +} + +fn sleep(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + colour: Colour::Blue, + }, + ); +} + +fn sleep_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + colour: Colour::Blue, + }, + ); +} + +fn sleep_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Stun, duration: 2, meta: None }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + colour: Colour::Blue, + }, + ); +} + +fn silence(cast: Cast, game: &mut Game) { + let bp = game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }); + let silences = game.value(Value::ColourSkills { construct: cast.target, colour: Colour::Blue }); + let amount = bp.pct(45usize.saturating_mul(silences)); + + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Silence, duration: 2, meta: None }, + } + ); + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount, + }, + ); +} + +fn strike(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Damage { + construct: cast.target, + colour: Colour::Red, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()), + }, + ); +} + +fn sustain(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Sustain, duration: 1, meta: None }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()), + colour: Colour::Red, + }, + ); +} + +fn triage(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Triage, duration: 2, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::TriageTick }) }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, + }, + ); +} + +fn triage_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Triage, duration: 3, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::TriageTickPlus }) }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, + }, + ); +} + +fn triage_plus_plus(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Triage, duration: 4, meta: + Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::TriageTickPlusPlus }) }, + } + ); + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + } + ); +game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, + }, + ); +} + +fn triage_tick(cast: Cast, game: &mut Game) { + game.action(cast, + Action::Heal { + construct: cast.target, + colour: Colour::Green, + amount: game.value(Value::Stat { construct: cast.source, stat: Stat::GreenPower }).pct(cast.skill.multiplier()), + } + ); + game.action(cast, + Action::Effect { + construct: cast.target, + effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, + }, + ); +} // #[cfg(test)]