hatred fix

This commit is contained in:
ntr
2019-04-13 14:56:08 +10:00
parent 2e7e9d465d
commit ef84e620fe
5 changed files with 17 additions and 11 deletions
+2 -2
View File
@@ -63,14 +63,14 @@ impl Player {
pub fn add_win(&mut self) -> &mut Player {
self.score.wins += 1;
self.set_ready(false);
self.vbox.balance_add(16);
self.vbox.balance_add(12);
self
}
pub fn add_loss(&mut self) -> &mut Player {
self.score.losses += 1;
self.set_ready(false);
self.vbox.balance_add(12);
self.vbox.balance_add(9);
self
}
+10 -2
View File
@@ -100,7 +100,7 @@ pub fn resolve(skill: Skill, source: &mut Cryp, target: &mut Cryp, mut resolutio
}
if target.affected(Effect::Hostility) {
resolutions = hatred(target, source, resolutions, skill, amount);
resolutions = hatred(source, target, resolutions, skill, amount);
}
},
Event::Immunity { skill: _, immunity } => match immunity.contains(&Effect::Parry) {
@@ -1343,7 +1343,15 @@ mod tests {
resolve(Skill::Attack, &mut x, &mut y, vec![]);
assert!(x.affected(Effect::Hatred));
assert!(y.affected(Effect::Hatred));
let mut results = resolve(Skill::Attack, &mut y, &mut x, vec![]);
let Resolution { source: _, target: _, event } = results.remove(0);
match event {
Event::Damage { amount, skill: _, mitigation: _, colour: _} => assert_eq!(amount, 512),
_ => panic!("not damage hatred"),
};
}
#[test]
-1
View File
@@ -406,7 +406,6 @@ pub struct Vbox {
impl Vbox {
pub fn new(account_id: Uuid, instance_id: Uuid) -> Vbox {
// line them up with the columns of the vbox
let starting_items = vec![
Var::Attack,
Var::Attack,