Skip to content

Commit

Permalink
retributionist can select a dead townie twice now
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSammyM committed Apr 26, 2024
1 parent 0311a25 commit 054d42b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/resources/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@
"wiki.article.role.medium.attributes":"* You may perform two haunts.",
"wiki.article.role.medium.extra":"* While in jail, you can read from dead chat group, but you can't send to it. Haunted players can read AND send to dead chat, even if in jail\n* While any dead medium haunts any living player, all dead mediums, haunted players, and dead players are together in the dead chat group\n* Each medium can do two haunts, so two mediums can do four haunts",

"wiki.article.role.retributionist.guide": "You may select a dead player to possess and force them to visit a player you select. You can only choose to possess dead townies. You can not possess the same player more than once.",
"wiki.article.role.retributionist.guide": "You may select a dead player to possess and force them to visit a player you select. You can only choose to possess dead townies. You can't possess the same player more than twice.",
"wiki.article.role.retributionist.abilities":"* Visit two players to make the first player visit the second player\n* The first player you select must appear as a dead townie in the graveyard",
"wiki.article.role.retributionist.attributes":"* The first player you visit is told that they were possessed or immune to possession\n* You are told all night information messages that your target gets told\n* You can't select a dead player who you have previously possessed",
"wiki.article.role.retributionist.extra":"* You are immune to getting roleblocked or possessed\n* You can force your target to visit any living player\n* If you don't successfully possess the player you select, you can select them again\n* All your visits except the first are cleared after you change your targets visits\n * A tracker will only see you visit your first target",
Expand Down
2 changes: 1 addition & 1 deletion server/src/game/role/retributionist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl RoleStateImpl for Retributionist {
_ => false
}
) &&
!self.used_bodies.iter().any(|p| *p == target_ref)
(self.used_bodies.iter().filter(|p| **p == target_ref).count() < 2)
) || (
actor_ref != target_ref &&
actor_ref.chosen_targets(game).len() == 1 &&
Expand Down
22 changes: 22 additions & 0 deletions server/tests/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,26 @@ fn retributionist_basic(){
ChatMessageVariant::SheriffResult{ suspicious: true }
)}
);

game.skip_to(PhaseType::Night, 4);
assert!(ret.set_night_targets(vec![sher1, mafioso]));
game.next_phase();
assert_contains!(
ret.get_messages_after_last_message(ChatMessageVariant::PhaseChange { phase: PhaseState::Night, day_number: 4 }),
ChatMessageVariant::TargetsMessage{message: Box::new(
ChatMessageVariant::SheriffResult{ suspicious: true }
)}
);

game.skip_to(PhaseType::Night, 5);
assert!(!ret.set_night_targets(vec![sher1, mafioso]));
game.next_phase();
assert_not_contains!(
ret.get_messages_after_last_message(ChatMessageVariant::PhaseChange { phase: PhaseState::Night, day_number: 5 }),
ChatMessageVariant::TargetsMessage{message: Box::new(
ChatMessageVariant::SheriffResult{ suspicious: true }
)}
);
}

#[test]
Expand Down Expand Up @@ -1405,6 +1425,8 @@ fn ojo_transporter(){
}

#[test]
/// Sometimes this test fails because of the way tests work
/// if the engineer starts as the apostle and is instantly converted to engineer, then the test might fail
fn apostle_converting_trapped_player_day_later(){
kit::scenario!(game in Night 2 where
apostle: Apostle,
Expand Down

0 comments on commit 054d42b

Please sign in to comment.