Skip to content

Commit

Permalink
Jailor encyclopedia
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSammyM committed Jan 7, 2024
1 parent 3ff465f commit 891808a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 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 @@ -479,7 +479,7 @@

"wiki.entry.role.jailor.title": "Jailor",
"wiki.entry.role.jailor.abilities":"* Choose one player to jail during the day\n* You can execute your prisoners up to three times",
"wiki.entry.role.jailor.attributes":"* You may anonymously talk with your prisoner at night\n* If you execute a town member, you forfeit the ability to jail prisoners\n* Jailed players are immune to all attacks, frames, transports, douses and more\n* Jailed players can't use their ability\n* Other players will know if their target was jailed",
"wiki.entry.role.jailor.attributes":"* You may anonymously talk with your prisoner at night\n* If you execute a town member, you forfeit the ability to jail prisoners\n* Jailed players are immune to most abilities being used on them\n* Jailed players can't target\n* Other players will know if their target was jailed\n* The Jailor cant choose to execute on night one",

"wiki.entry.role.mayor.title": "Mayor",
"wiki.entry.role.mayor.abilities":"* Reveal during the day to expose your role to everyone and gain 2 more votes",
Expand Down
19 changes: 6 additions & 13 deletions server/src/game/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,12 @@ impl Game {

let settings = settings.clone();
let mut roles = match create_random_roles(&settings.excluded_roles, &settings.role_list){
Some(roles) => {
roles
},
None => {
return Err(RejectStartReason::RoleListCannotCreateRoles);
}
Some(roles) => {roles},
None => {return Err(RejectStartReason::RoleListCannotCreateRoles);}
};
roles.shuffle(&mut thread_rng());


let mut players = Vec::new();
for (player_index, player) in lobby_players.iter().enumerate() {
let ClientConnection::Connected(ref sender) = player.connection else {
Expand Down Expand Up @@ -137,7 +133,6 @@ impl Game {
return Err(RejectStartReason::RoleListCannotCreateRoles);
}



game.send_packet_to_all(ToClientPacket::StartGame);
for player_ref in PlayerReference::all_players(&game){
Expand Down Expand Up @@ -188,7 +183,7 @@ impl Game {
.collect::<std::collections::HashSet<EndGameCondition>>().into_iter().collect::<Vec<EndGameCondition>>();

//if there are no teams left and multiple amnesiacs alive then the game is not over
if
if
remaining_teams.is_empty() &&
PlayerReference::all_players(self).into_iter()
.filter(|p|p.alive(self) && p.role_state(self).role() == role::Role::Amnesiac)
Expand All @@ -197,7 +192,7 @@ impl Game {
return false;
}

remaining_teams.len() <= 1
remaining_teams.len() <= 1
}

pub fn current_phase(&self) -> &PhaseState {
Expand Down Expand Up @@ -227,8 +222,6 @@ impl Game {
return;
}
}



if self.phase_machine.day_number == u8::MAX {
self.add_message_to_chat_group(ChatGroup::All, ChatMessage::GameOver);
Expand Down
2 changes: 1 addition & 1 deletion server/src/game/role/jailor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl RoleStateImpl for Jailor {


fn do_night_action(mut self, game: &mut Game, actor_ref: PlayerReference, priority: Priority) {
if priority != Priority::Kill { return; }
if priority != Priority::Kill { return; }

if let Some(visit) = actor_ref.night_visits(game).first() {

Expand Down

1 comment on commit 891808a

@vercel
Copy link

@vercel vercel bot commented on 891808a Jan 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mafia-game – ./

mafia-game-itssammym.vercel.app
mafia-game.vercel.app
mafia-game-git-00x-main-itssammym.vercel.app

Please sign in to comment.