counterattack immunity
This commit is contained in:
parent
f941feea6f
commit
b7768e58bd
@ -110,6 +110,12 @@ impl Effect {
|
|||||||
Skill::TriageTick,
|
Skill::TriageTick,
|
||||||
].contains(&skill),
|
].contains(&skill),
|
||||||
|
|
||||||
|
Effect::Countered => [
|
||||||
|
Skill::CounterAttack,
|
||||||
|
Skill::CounterAttackPlus,
|
||||||
|
Skill::CounterAttackPlusPlus,
|
||||||
|
].contains(&skill),
|
||||||
|
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,7 +206,7 @@ impl Effect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Old colour matching system for buffs / debuffs
|
// Old colour matching system for buffs / debuffs
|
||||||
// Had issues as some effects will be considered as both a buff and debuff e.g. invert,
|
// Had issues as some effects will be considered as both a buff and debuff e.g. invert,
|
||||||
// Ended up being confusing with mismatch skills that have red / blue e.g. amplify, haste, hybrid
|
// Ended up being confusing with mismatch skills that have red / blue e.g. amplify, haste, hybrid
|
||||||
/* pub fn colour(&self) -> Option<Colour> {
|
/* pub fn colour(&self) -> Option<Colour> {
|
||||||
match self {
|
match self {
|
||||||
|
|||||||
@ -1915,8 +1915,7 @@ mod tests {
|
|||||||
assert!(game.players[1].constructs[0].is_ko() == false);
|
assert!(game.players[1].constructs[0].is_ko() == false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// refer fixme.md (infinite counterattack loop)
|
#[test]
|
||||||
/*#[test]
|
|
||||||
fn multi_counter_test() {
|
fn multi_counter_test() {
|
||||||
let mut game = create_2v2_test_game();
|
let mut game = create_2v2_test_game();
|
||||||
let player_id = game.players[0].id;
|
let player_id = game.players[0].id;
|
||||||
@ -1929,13 +1928,14 @@ mod tests {
|
|||||||
game.new_resolve(Cast::new(target, target_player_id, target, Skill::Counter));
|
game.new_resolve(Cast::new(target, target_player_id, target, Skill::Counter));
|
||||||
game.new_resolve(Cast::new(source, player_id, target, Skill::Attack));
|
game.new_resolve(Cast::new(source, player_id, target, Skill::Attack));
|
||||||
|
|
||||||
|
println!("{:#?}", game.resolutions);
|
||||||
|
|
||||||
assert!(game.players[0].constructs[0].is_ko() == false);
|
assert!(game.players[0].constructs[0].is_ko() == false);
|
||||||
assert!(game.players[1].constructs[0].is_ko() == false);
|
assert!(game.players[1].constructs[0].is_ko() == false);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn intercept_test() {
|
fn intercept_test() {
|
||||||
|
|
||||||
let mut game = create_2v2_test_game();
|
let mut game = create_2v2_test_game();
|
||||||
|
|
||||||
let player_id = game.players[0].id;
|
let player_id = game.players[0].id;
|
||||||
|
|||||||
@ -1407,6 +1407,13 @@ fn counter_plus_plus(cast: Cast, game: &mut Game) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn counter_attack(cast: Cast, game: &mut Game) {
|
fn counter_attack(cast: Cast, game: &mut Game) {
|
||||||
|
// effect has to be first so that the loop doesn't occur
|
||||||
|
game.action(cast,
|
||||||
|
Action::Effect {
|
||||||
|
construct: cast.target,
|
||||||
|
effect: ConstructEffect { effect: Effect::Countered, duration: 1, meta: None }, // immunity to additional hits
|
||||||
|
}
|
||||||
|
);
|
||||||
game.action(cast,
|
game.action(cast,
|
||||||
Action::Damage {
|
Action::Damage {
|
||||||
construct: cast.target,
|
construct: cast.target,
|
||||||
@ -1414,12 +1421,6 @@ fn counter_attack(cast: Cast, game: &mut Game) {
|
|||||||
amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()),
|
amount: game.value(Value::Stat { construct: cast.source, stat: Stat::RedPower }).pct(cast.skill.multiplier()),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
game.action(cast,
|
|
||||||
Action::Effect {
|
|
||||||
construct: cast.target,
|
|
||||||
effect: ConstructEffect { effect: Effect::Countered, duration: 1, meta: None }, // immunity to additional hits
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn decay(cast: Cast, game: &mut Game) {
|
fn decay(cast: Cast, game: &mut Game) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user