From 21903cc27c896f455518809daa329e7788abc975 Mon Sep 17 00:00:00 2001 From: ntr Date: Wed, 11 Dec 2019 18:19:45 +1000 Subject: [PATCH] immunities for initial skill ticks --- core/src/construct.rs | 2 ++ core/src/skill.rs | 32 ++++++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/core/src/construct.rs b/core/src/construct.rs index cd69b493..bd215b4a 100644 --- a/core/src/construct.rs +++ b/core/src/construct.rs @@ -722,6 +722,8 @@ impl Construct { } pub fn healing(&mut self, amount: usize, colour: Colour) -> Vec { + if self.is_ko() { return vec![Event::TargetKo { construct: self.id }] } + match colour { Colour::Red => self.red_healing(amount), Colour::Blue => self.blue_healing(amount), diff --git a/core/src/skill.rs b/core/src/skill.rs index d6e0e991..a17f62e1 100644 --- a/core/src/skill.rs +++ b/core/src/skill.rs @@ -363,6 +363,10 @@ impl Cast { effect: ConstructEffect { effect: Effect::Decay, duration: 2, meta: Some(EffectMeta::CastTick { source: self.source, target: self.target, skill: Skill::DecayTick }) }, }, + Action::Effect { + construct: self.target, + effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks + }, Action::Damage { construct: self.target, colour: Colour::Blue, @@ -379,6 +383,10 @@ impl Cast { effect: ConstructEffect { effect: Effect::Decay, duration: 4, meta: Some(EffectMeta::CastTick { source: self.source, target: self.target, skill: Skill::DecayTickPlus }) }, }, + Action::Effect { + construct: self.target, + effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks + }, Action::Damage { construct: self.target, colour: Colour::Blue, @@ -395,6 +403,10 @@ impl Cast { effect: ConstructEffect { effect: Effect::Decay, duration: 4, meta: Some(EffectMeta::CastTick { source: self.source, target: self.target, skill: Skill::DecayTickPlusPlus }) }, }, + Action::Effect { + construct: self.target, + effect: ConstructEffect { effect: Effect::Decayed, duration: 1, meta: None }, // immunity to additional ticks + }, Action::Damage { construct: self.target, colour: Colour::Blue, @@ -787,15 +799,15 @@ impl Cast { colour: Colour::Blue, values: vec![Value::Stat { construct: self.source, stat: Stat::BluePower, mult: self.skill.multiplier() }], }, + Action::Effect { + construct: self.target, + effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks + }, Action::Heal { construct: self.source, colour: Colour::Green, values: vec![Value::DamageReceived { construct: self.target, colour: Colour::Blue, mult: 100 }], }, - Action::Effect { - construct: self.target, - effect: ConstructEffect { effect: Effect::Siphoned, duration: 1, meta: None }, // immunity to additional ticks - }, ], Skill::Slay | @@ -899,6 +911,10 @@ impl Cast { colour: Colour::Green, values: vec![Value::Stat { construct: self.source, stat: Stat::GreenPower, mult: self.skill.multiplier() }], }, + Action::Effect { + construct: self.target, + effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, + }, ], Skill::TriagePlus => vec![ Action::Effect { @@ -911,6 +927,10 @@ impl Cast { colour: Colour::Green, values: vec![Value::Stat { construct: self.source, stat: Stat::GreenPower, mult: self.skill.multiplier() }], }, + Action::Effect { + construct: self.target, + effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, + }, ], Skill::TriagePlusPlus => vec![ Action::Effect { @@ -923,6 +943,10 @@ impl Cast { colour: Colour::Green, values: vec![Value::Stat { construct: self.source, stat: Stat::GreenPower, mult: self.skill.multiplier() }], }, + Action::Effect { + construct: self.target, + effect: ConstructEffect { effect: Effect::Triaged, duration: 1, meta: None }, + }, ], Skill::TriageTick | Skill::TriageTickPlus |