Fixed ruin resolution cast

This commit is contained in:
Mashy 2019-05-08 13:19:51 +10:00
parent af03d37404
commit 54b7757e2a
5 changed files with 28 additions and 24 deletions

View File

@ -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%

View File

@ -51,7 +51,6 @@ function GameCryp(props) {
const {
cryp,
resolution,
activeSkill,
setActiveCryp,
selectSkillTarget,

View File

@ -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}`;

View File

@ -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,

View File

@ -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;;