From 54b7757e2ad2ce48db62b59ce01108a2f83c2737 Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 8 May 2019 13:19:51 +1000 Subject: [PATCH 1/2] Fixed ruin resolution cast --- CHANGELOG.md | 13 ++++++------- client/src/components/game.cryp.jsx | 1 - client/src/utils.jsx | 14 ++++++-------- server/src/game.rs | 12 ++++++++---- server/src/skill.rs | 12 ++++++++---- 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22381456..1e1c9e88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,11 +17,6 @@ This project adheres to [Semantic Versioning](http://semver.org/). - fx for buffs when applied to enemies - invert + haste -> doubles all cooldowns -New skill `Scatter ` - Combines - Buff + BB - Links targets together so dmg taken is split - Recharge 140% source blue damage as blue life to target - var / skill info rpc thresholds / bonuses sell cost @@ -30,6 +25,11 @@ var / skill info rpc ## [0.1.2] - 2019-05-07 ### Added +New skill `Scatter ` + Combines - Buff + BB + Links targets together so dmg taken is split + Recharge 140% source blue damage as blue life to target + New skill `Impurity` Combines - Buff + GB New buff that does the following - @@ -71,13 +71,12 @@ New skill `Impurity` Inc red and blue multiplier changed 200% -> 150% `(More reworks soon to make this skill fun)` - - Haste Changed to Buff + RG (was Buff + RB) Buff causes target to deal an extra attack when using red attack base skills (strike / slay / chaos) Extra attack does 25% source speed as red damage Cooldown increased to 2T - Speed bonused reduced 200% -> 150% + Speed bonus reduced 200% -> 150% - Heal Changed multiplier 120% -> 130% diff --git a/client/src/components/game.cryp.jsx b/client/src/components/game.cryp.jsx index 9b6bc6cc..c7e08c98 100644 --- a/client/src/components/game.cryp.jsx +++ b/client/src/components/game.cryp.jsx @@ -51,7 +51,6 @@ function GameCryp(props) { const { cryp, resolution, - activeSkill, setActiveCryp, selectSkillTarget, diff --git a/client/src/utils.jsx b/client/src/utils.jsx index cdf0ef03..70ce7a55 100644 --- a/client/src/utils.jsx +++ b/client/src/utils.jsx @@ -221,7 +221,7 @@ function getCombatSequence(event) { // Skip combat animations depending on event type, expandable in future const dotTicks = ['DecayTick', 'CorruptionTick', 'TriageTick', 'SiphonTick', 'StrangleTick']; - if (['Skill'].includes(event[0])) return ['START_SKILL', 'END_SKILL']; + if (['Skill', 'AoeSkill'].includes(event[0])) return ['START_SKILL', 'END_SKILL']; if (['Immunity'].includes(event[0])) return ['START_SKILL', 'POST_SKILL']; if (['Removal'].includes(event[0])) return ['POST_SKILL']; @@ -235,12 +235,9 @@ function getCombatSequence(event) { && (event[1].skill === 'Reflect')) return ['POST_SKILL']; - if (['Effect'].includes(event[0]) - && ((event[1].skill === 'Decay' && event[1].effect === 'Wither') - || event[1].skill === 'Ruin' - || event[1].skill === 'Taunt' - || event[1].skill === 'Strangling' - || event[1].skill === 'Parry')) return ['POST_SKILL']; + if (event[0] === 'Effect' + && (['Ruin', 'Taunt', 'Strangling', 'Parry'].includes(event[1].skill) + || (event[1].skill === 'Decay' && event[1].effect === 'Wither'))) return ['POST_SKILL']; if (['Damage'].includes(event[0]) && ((event[1].skill === 'Chaos' && event[1].colour === 'RedDamage') @@ -257,6 +254,7 @@ function getCombatSequence(event) { function getCombatText(cryp, resolution) { if (!resolution) return ''; + const [type, event] = resolution.event; const source = cryp.id === resolution.source.id; const target = cryp.id === resolution.target.id; @@ -333,7 +331,7 @@ function getCombatText(cryp, resolution) { if (postSkill && target) return `+${red}R ${blue}B`; } - if (type === 'Skill') { + if (type === 'Skill' || type === 'AoeSkill') { const { skill } = event; if (startSkill && source) return `${skill}`; if (endSkill && target) return `${skill}`; diff --git a/server/src/game.rs b/server/src/game.rs index 3ded010d..42111c33 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -511,6 +511,10 @@ impl Game { self.log.push(format!("[{:}] {:} {:?} {:} {:?} {:}T", speed, source.name, skill, target.name, effect, duration)), + Event::AoeSkill { skill } => + self.log.push(format!("[{:}] {:} {:?} {:}", + speed, source.name, skill, target.name)), + Event::Skill { skill } => self.log.push(format!("[{:}] {:} {:?} {:}", speed, source.name, skill, target.name)), @@ -1126,11 +1130,11 @@ mod tests { // should auto progress back to skill phase assert!(game.phase == Phase::Skill); - assert!(game.player_by_id(y_player.id).unwrap().cryps[0].skill_on_cd(Skill::Stun).is_none()); + assert!(game.player_by_id(y_player.id).unwrap().cryps[0].skill_on_cd(Skill::Stun).is_some()); // second round // now we block and it should go back on cd - let _x_block_id = game.add_skill(x_player.id, x_cryp.id, Some(y_cryp.id), Skill::Stun).unwrap(); + // let _x_block_id = game.add_skill(x_player.id, x_cryp.id, Some(y_cryp.id), Skill::Stun).unwrap(); let _y_touch_id = game.add_skill(y_player.id, y_cryp.id, Some(x_cryp.id), Skill::TestTouch).unwrap(); game.player_ready(x_player.id).unwrap(); @@ -1138,7 +1142,7 @@ mod tests { game = game.resolve_phase_start(); - assert!(game.player_by_id(x_player.id).unwrap().cryps[0].skill_on_cd(Skill::Stun).is_some()); + assert!(game.player_by_id(x_player.id).unwrap().cryps[0].skill_on_cd(Skill::Stun).is_none()); assert!(game.player_by_id(y_player.id).unwrap().cryps[0].skill_on_cd(Skill::Block).is_none()); } @@ -1320,7 +1324,7 @@ mod tests { assert!(*duration == 1); true }, - Event::Skill { skill } => false, + Event::AoeSkill { skill } => false, _ => panic!("ruin result not effect {:?}", event), } false => false, diff --git a/server/src/skill.rs b/server/src/skill.rs index 54d2c69d..5f27705b 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -20,6 +20,10 @@ pub fn pre_resolve(cast: &Cast, game: &mut Game, mut resolutions: Resolutions) - let source = game.cryp_by_id(cast.source_cryp_id).unwrap().clone(); let targets = game.get_targets(cast.skill, &source, cast.target_cryp_id); + if (skill.aoe()) { // Send an aoe skill event for anims + resolutions.push(Resolution::new(&source, &game.cryp_by_id(cast.target_cryp_id).unwrap().clone()).event(Event::AoeSkill { skill })); + } + for target_id in targets { let mut source = game.cryp_by_id(cast.source_cryp_id).unwrap().clone(); let mut target = game.cryp_by_id(target_id).unwrap().clone(); @@ -275,6 +279,7 @@ pub enum Event { Inversion { skill: Skill }, Reflection { skill: Skill }, Effect { skill: Skill, effect: Effect, duration: u8 }, + AoeSkill { skill: Skill }, Skill { skill: Skill }, Removal { effect: Effect }, TargetKo { skill: Skill }, @@ -740,7 +745,7 @@ impl Skill { Skill::Parry => Some(2), // avoid all damage Skill::Riposte => None, // used on parry Skill::Snare => Some(2), - Skill::Stun => Some(1), + Skill::Stun => Some(2), Skill::Heal => None, Skill::Triage => None, // hot Skill::TriageTick => None, @@ -748,7 +753,7 @@ impl Skill { Skill::Blast => None, Skill::Chaos => None, Skill::Amplify => Some(1), - Skill::Impurity => None, + Skill::Impurity => Some(3), Skill::ImpureBlast => None, Skill::Invert => Some(2), Skill::Decay => Some(1), // dot @@ -767,7 +772,7 @@ impl Skill { Skill::Reflect => Some(2), Skill::Recharge => Some(2), - Skill::Ruin => Some(3), + Skill::Ruin => None, Skill::Slay => None, Skill::Sleep => Some(3), @@ -1222,7 +1227,6 @@ fn corruption_tick(source: &mut Cryp, target: &mut Cryp, mut results: Resolution } fn ruin(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions { - results.push(Resolution::new(source, target).event(Event::Skill { skill })); let effect = CrypEffect::new(Effect::Ruin, skill.duration()); results.push(Resolution::new(source, target).event(target.add_effect(skill, effect))); return results;; From 9ec4beb6c6db5700b5ce3e9b905e34c1214b7a05 Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 8 May 2019 13:30:22 +1000 Subject: [PATCH 2/2] ruin cd --- server/src/skill.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/skill.rs b/server/src/skill.rs index 5f27705b..5681664d 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -772,7 +772,7 @@ impl Skill { Skill::Reflect => Some(2), Skill::Recharge => Some(2), - Skill::Ruin => None, + Skill::Ruin => Some(3), Skill::Slay => None, Skill::Sleep => Some(3),