speed fix, counter fix, client side anim fix
This commit is contained in:
parent
2894e346e3
commit
2e366e2eca
@ -91,7 +91,7 @@ function registerEvents(store) {
|
||||
store.dispatch(actions.setAnimTarget(null));
|
||||
store.dispatch(actions.setAnimText(null));
|
||||
store.dispatch(actions.setAnimFocus([]));
|
||||
if (!sequence.includes('END_SKILL')
|
||||
if (!sequence.includes('END_SKILL' && anims.animTarget)
|
||||
|| ['Banish', 'Invert'].includes(removeTier(anims.animTarget.skill))) return cb();
|
||||
return true;
|
||||
}, timeout);
|
||||
|
||||
@ -322,7 +322,7 @@ impl Game {
|
||||
return Err(err_msg("game not in skill phase"));
|
||||
}
|
||||
let mut game_state = self.clone();
|
||||
self.stack.retain(|s| game_state.construct_by_id(s.source_construct_id).unwrap().account == player_id);
|
||||
self.stack.retain(|s| game_state.construct_by_id(s.source_construct_id).unwrap().account != player_id);
|
||||
|
||||
return Ok(self);
|
||||
}
|
||||
|
||||
@ -337,13 +337,27 @@ impl Item {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn speed(&self) -> u64 {
|
||||
pub fn base_speed(&self) -> u64 {
|
||||
match self {
|
||||
Item::Attack => 1,
|
||||
Item::Stun => 2,
|
||||
Item::Block => 3,
|
||||
Item::Buff |
|
||||
Item::Debuff => 4,
|
||||
Item::Blue => 1,
|
||||
Item::Green => 2,
|
||||
Item::Red => 3,
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn speed(&self) -> u64 {
|
||||
match self {
|
||||
Item::Attack |
|
||||
Item::Stun |
|
||||
Item::Block |
|
||||
Item::Buff |
|
||||
Item::Debuff => 24 + self.base_speed(),
|
||||
_ => {
|
||||
let combos = get_combos();
|
||||
let combo = combos.iter().find(|c| c.item == *self)
|
||||
@ -355,17 +369,17 @@ impl Item {
|
||||
|
||||
combo.components.iter().for_each(|unit| {
|
||||
colour_speed += match unit {
|
||||
Item::Red => 3,
|
||||
Item::Green => 2,
|
||||
Item::Blue => 1,
|
||||
Item::Red |
|
||||
Item::Green |
|
||||
Item::Blue => unit.base_speed(),
|
||||
_ => 0,
|
||||
};
|
||||
skill_speed += match unit {
|
||||
Item::Attack => 1,
|
||||
Item::Stun => 2,
|
||||
Item::Block => 3,
|
||||
Item::Attack |
|
||||
Item::Stun |
|
||||
Item::Block |
|
||||
Item::Buff |
|
||||
Item::Debuff => 4,
|
||||
Item::Debuff => unit.base_speed(),
|
||||
_ => 0,
|
||||
};
|
||||
if colour_speed == 0 && skill_speed == 0 {
|
||||
|
||||
@ -293,7 +293,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
let mut target = game.construct_by_id(target.id).unwrap().clone();
|
||||
|
||||
match event {
|
||||
Event::Damage { amount, skill, mitigation: _, colour: _ } => {
|
||||
Event::Damage { amount, skill, mitigation: _, colour: c } => {
|
||||
if target.affected(Effect::Electric) {
|
||||
let ConstructEffect { effect: _, duration: _, meta, tick: _ } = target.effects.iter()
|
||||
.find(|e| e.effect == Effect::Electric).unwrap().clone();
|
||||
@ -315,7 +315,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
_ => panic!("no absorb skill"),
|
||||
};
|
||||
}
|
||||
|
||||
if c == Colour::Red {
|
||||
if target.affected(Effect::Counter) {
|
||||
let ConstructEffect { effect: _, duration: _, meta, tick: _ } = target.effects.iter()
|
||||
.find(|e| e.effect == Effect::Counter).unwrap().clone();
|
||||
@ -326,6 +326,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
||||
_ => panic!("no counter skill"),
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user