From 385e9baf3d4800a333158a387a510e11b0c5e41b Mon Sep 17 00:00:00 2001 From: Sam Maselli Date: Thu, 21 Nov 2024 04:28:04 -0500 Subject: [PATCH 1/2] Update role_list.rs --- server/src/game/role_list.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/game/role_list.rs b/server/src/game/role_list.rs index e6c92deab..8882ad7b4 100644 --- a/server/src/game/role_list.rs +++ b/server/src/game/role_list.rs @@ -197,7 +197,7 @@ impl RoleSet{ RoleSet::MafiaSupport => vec![ Role::Blackmailer, Role::Informant, Role::Hypnotist, Role::Consort, - Role::Forger, Role::Framer, Role::Mortician, + Role::Forger, Role::Framer, Role::Mortician, Role::Disguiser, Role::MafiaWitch, Role::Necromancer, Role::Cupid ], RoleSet::Minions => From a097938668eddf16f8f9ecf63e2f2e89f0503b6b Mon Sep 17 00:00:00 2001 From: Sam Maselli Date: Thu, 21 Nov 2024 05:03:35 -0500 Subject: [PATCH 2/2] Update mafia_hit_orders.rs --- server/src/game/modifiers/mafia_hit_orders.rs | 78 +++++++++++-------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/server/src/game/modifiers/mafia_hit_orders.rs b/server/src/game/modifiers/mafia_hit_orders.rs index a7dfa6537..5b6384523 100644 --- a/server/src/game/modifiers/mafia_hit_orders.rs +++ b/server/src/game/modifiers/mafia_hit_orders.rs @@ -144,42 +144,54 @@ impl ModifierTrait for MafiaHitOrders{ fn on_night_priority(self, game: &mut Game, priority: Priority){ if !self.active {return} if game.day_number() == 1 {return;} - if priority != Priority::Kill {return;} - let mut players_to_remove_hit_order = VecSet::new(); - for player in PlayerReference::all_players(game){ - if !InsiderGroupID::Mafia.is_player_in_revealed_group(game, player) {continue;} - if RoleSet::MafiaKilling.get_roles().contains(&player.role(game)) {continue;} - - for visit in player.night_visits(game).clone(){ - if !self.hit_order_players.contains(&visit.target) {continue;} - - players_to_remove_hit_order.insert(visit.target); - - visit.target.try_night_kill_single_attacker( - player, - game, - crate::game::grave::GraveKiller::RoleSet(RoleSet::Mafia), - crate::game::attack_power::AttackPower::Basic, - false - ); - } - + match priority { //set visits to attacking visits - let visits = player.night_visits(game).clone().into_iter() - .map(|mut v| - if self.hit_order_players.contains(&v.target) { - v.attack = true; - v - }else{ - v + Priority::Deception => { + for player in PlayerReference::all_players(game){ + if !InsiderGroupID::Mafia.is_player_in_revealed_group(game, player) {continue;} + if RoleSet::MafiaKilling.get_roles().contains(&player.role(game)) {continue;} + + let visits = player.night_visits(game).clone().into_iter() + .map(|mut v| + if self.hit_order_players.contains(&v.target) { + v.attack = true; + v + }else{ + v + } + ) + .collect(); + player.set_night_visits(game, visits); + } + } + //kill hit order players & remove hit + Priority::Kill => { + let mut players_to_remove_hit_order = VecSet::new(); + + for player in PlayerReference::all_players(game){ + if !InsiderGroupID::Mafia.is_player_in_revealed_group(game, player) {continue;} + if RoleSet::MafiaKilling.get_roles().contains(&player.role(game)) {continue;} + + for visit in player.night_visits(game).clone(){ + if !self.hit_order_players.contains(&visit.target) {continue;} + + players_to_remove_hit_order.insert(visit.target); + + visit.target.try_night_kill_single_attacker( + player, + game, + crate::game::grave::GraveKiller::RoleSet(RoleSet::Mafia), + crate::game::attack_power::AttackPower::Basic, + false + ); } - ) - .collect(); - player.set_night_visits(game, visits); - } - for player in players_to_remove_hit_order.clone(){ - MafiaHitOrders::remove_hit_order_player(game, player); + } + for player in players_to_remove_hit_order.clone(){ + MafiaHitOrders::remove_hit_order_player(game, player); + } + }, + _ => {} } } fn before_initial_role_creation(mut self, game: &mut Game) {