ko checks
This commit is contained in:
parent
fe6585e925
commit
a222d87830
@ -129,6 +129,7 @@ module.exports = {
|
||||
'Strangle', // physical dot and disable
|
||||
|
||||
'Stun',
|
||||
'Throw',
|
||||
'Evade', // actively evade
|
||||
'Evasion', // adds evasion to cryp
|
||||
|
||||
|
||||
@ -12,9 +12,6 @@ function errorToast(err) {
|
||||
});
|
||||
}
|
||||
|
||||
// Create WebSocket connection.
|
||||
// requires the redux store in order to push updates
|
||||
// to components
|
||||
function createSocket(events) {
|
||||
let ws;
|
||||
|
||||
|
||||
@ -179,6 +179,11 @@ impl Cryp {
|
||||
}
|
||||
|
||||
pub fn immune(&self, skill: Skill) -> Immunity {
|
||||
|
||||
if self.is_ko() {
|
||||
return Immunity { immune: true, effects: vec![Effect::Ko]};
|
||||
}
|
||||
|
||||
let immunities = self.effects.iter()
|
||||
.filter(|e| e.effect.immune(skill))
|
||||
.map(|e| e.effect)
|
||||
|
||||
@ -436,6 +436,8 @@ impl Game {
|
||||
// println!("progressing durations for {:?}", cryp.name);
|
||||
|
||||
if cryp.is_ko() {
|
||||
self.log.push(format!("{:?} KO", cryp.name));
|
||||
cryp.effects.clear();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1045,7 +1047,7 @@ mod tests {
|
||||
|
||||
assert!(game.resolved.iter().any(|r| r.skill == Skill::DrainTick));
|
||||
|
||||
// println!("{:#?}", game);
|
||||
println!("{:#?}", game);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1074,8 +1076,6 @@ mod tests {
|
||||
|
||||
assert!([Phase::Skill, Phase::Finish].contains(&game.phase));
|
||||
|
||||
println!("{:#?}", game);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -117,6 +117,8 @@ pub enum Effect {
|
||||
|
||||
SpeedDrain,
|
||||
SpeedIncrease,
|
||||
|
||||
Ko,
|
||||
}
|
||||
|
||||
impl Effect {
|
||||
@ -209,6 +211,8 @@ impl Effect {
|
||||
|
||||
Effect::SpeedDrain => Category::SpellDebuff,
|
||||
Effect::SpeedIncrease => Category::SpellBuff,
|
||||
|
||||
Effect::Ko => Category::Ko,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -225,6 +229,7 @@ pub enum Category {
|
||||
SpellHeal,
|
||||
SpellDebuff,
|
||||
SpellBuff,
|
||||
Ko,
|
||||
}
|
||||
|
||||
#[derive(Debug,Clone,Copy,PartialEq,Serialize,Deserialize)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user