hatred fix
This commit is contained in:
@@ -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
@@ -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]
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user