Skip to content

Commit

Permalink
Merge pull request #752 from mafia-rust/bug/fix-santa
Browse files Browse the repository at this point in the history
santa is no longer immune to everything
  • Loading branch information
ItsSammyM authored Jan 4, 2025
2 parents 3ccc559 + 88e2769 commit 95668aa
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 114 deletions.
7 changes: 7 additions & 0 deletions client/src/game/roleState.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ export type RoleState = {
Doomsayer
| {
type: "politician"
} | {
type: "santaClaus",
abilityUsedLastNight: "naughty" | "nice" | null
} | {
type: "krampus",
lastUsedAbility: "doNothing" | "kill" | null,
ability: "doNothing" | "kill"
} | {
type: "witch"
} | {
Expand Down
6 changes: 6 additions & 0 deletions client/src/resources/abilityId.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@
"role/politician/0": {
"midnight": false
},
"role/santaClaus/0": {
"midnight": true
},
"role/santaClaus/1": {
"midnight": true
},
"role/scarecrow/0": {
"midnight": true
},
Expand Down
14 changes: 7 additions & 7 deletions client/src/resources/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@
"chatMessage.cultKillsNext": "The cult will attempt to sacrifice and kill someone tonight.",
"chatMessage.addedToNiceList": "You've been good this year, so you have been added to the nice list.",
"chatMessage.addedToNaughtyList": "You've been bad this year - you have been added to the naughty list.",
"chatMessage.nextSantaAbility.nice": "Tonight you will add up to two people to the nice list.",
"chatMessage.nextSantaAbility.nice": "Tonight you will add zer or one players to the nice list.",
"chatMessage.nextSantaAbility.naughty": "Tonight you will add a player to the naughty list.",
"chatMessage.nextKrampusAbility.kill": "Tonight you will attack someone and investigate them.",
"chatMessage.nextKrampusAbility.doNothing": "Tonight you will investigate someone.",
Expand Down Expand Up @@ -1587,11 +1587,11 @@
"wiki.article.role.mafioso.attributes":"* None",
"wiki.article.role.mafioso.extra":"* You can't target other syndicate members",

"wiki.article.role.santaClaus.reminder": "Add players to the nice and naughty lists. You win when only nice players remain alive.",
"wiki.article.role.santaClaus.guide": "On odd nights: Select zero or one players to add to the nice list\n* This player retains their original win condition and gains the Nice List win condition.\n* Players on the nice list cannot be put on the naughty list.\n\nOn even nights: Select one player to add to the naughty list\n* This player retains their original win condition, and gains the Naughty List win condition.\n* Players on the Naughty list cannot be put on the nice list.",
"wiki.article.role.santaClaus.abilities":"- None",
"wiki.article.role.santaClaus.attributes":"* If you don't select a player to put on the naughty list, you visit a random player to be put on the naughty list.\n* You are a nice list loyalist\n* You are roleblock immune.\n* You are wardblock immune.\n* You have innocent aura.\n* You are not told whether you were successful in adding your target to the list.\n- You can't visit due to your own ability while dead, even if possessed.",
"wiki.article.role.santaClaus.extra":"* You can't add a player to both lists.\n* Visiting a player with independent win condition does nothing.",
"wiki.article.role.santaClaus.reminder": "Each Night, add players to the nice or naughty lists. You win when only nice players remain alive.",
"wiki.article.role.santaClaus.guide": "- At the beginning of each night, you are told if you are adding a player to the naughty list or nice list tonight, alternating each time you successfully add a player to a list, starting with nice list\n - Each night, choose a player to add to the list for tonight\n - When a player is added to the nice list, their current win condition is updated to include winning with the nice list. This also applies to the naughty list.\n* You are a nice list loyalist\n* Your convert is an armor-piercing attack",
"wiki.article.role.santaClaus.abilities":"- Your convert fails if\n - Your target has an independent win condition (like a typical jester)\n - Your target is on the nice list.\n - Your target is on the naughty list.\n - Your target has a defense that can stop armor-piercing attacks.\n- Your target is told when they are added to the nice list\n- Your target is told when they are added to the naughty list",
"wiki.article.role.santaClaus.attributes":"",
"wiki.article.role.santaClaus.extra":"",

"wiki.article.role.krampus.reminder": "Each night, investigate a player's role and win condition. Every odd night, select a player to attack them.",
"wiki.article.role.krampus.guide": "- At night select a player to investigate them. You learn the role and win condition of your target.\n- On odd nights, you attack your target.",
Expand Down Expand Up @@ -1791,7 +1791,7 @@
"wiki.article.role.ojo.guide":"- You have multiple night abilities\n - Each night, select up to 2 outlines, for each outline, you are told what role generated from that outline\n - Each night except the first, select a role, you attack all players with that role\n - You see the role of all players who visit you, their role is revealed to you, this is a passive ability",
"wiki.article.role.ojo.abilities":"- You have multiple night abilities\n - Each night, select up to 2 outlines, for each outline, you are told what role generated from that outline\n - Each night except the first, select a role, you attack all players with that role\n - You see the role of all players who visit you, their role is revealed to you, this is a passive ability",
"wiki.article.role.ojo.attributes":"- If you are dead, you cant select to use your ability\n* If you are blocked, you have no ability\n* Your attack is an armor-piercing attack\n* You can't attack anybody on night 1",
"wiki.article.role.ojo.extra":"- Your attack ability works on the person you actually visited, so if a transporter transports a player you visit with someone else, you attack the other player, this only applies to the attack ability, not any other ability of yours\n- You wont visit dead players using your attack ability\n- You are immune to possession, but not wardblocks or roleblocks",
"wiki.article.role.ojo.extra":"- Your attack ability works on the person you actually visited, so if a transporter transports a player you visit with someone else, you attack the other player, this only applies to the attack ability, not any other ability of yours\n- You wont visit dead players using your attack ability",

"wiki.article.role.puppeteer.reminder": "Each night, select a player to either kill them or recruit them.",
"wiki.article.role.puppeteer.guide":"- You may choose to do one of the following\n - Select and attack a player\n - Select a player to string up into a marionette\n - They are told they are strung up, and are now a fiends loyalist\n - They are attacked the following night, and every night until they die\n - At night all puppeteers and marionettes can chat in the puppeteer chat, even if dead\n - The players in the puppeteer chat that are dead can chat during the day or night\n- Your attack and convert are both armor-piercing",
Expand Down
8 changes: 5 additions & 3 deletions client/src/resources/roles.json
Original file line number Diff line number Diff line change
Expand Up @@ -875,15 +875,17 @@
"santaClaus": {
"mainRoleSet": "neutral",
"roleSets": ["neutral"],
"armor": true,
"aura": "innocent",
"armor": false,
"aura": null,
"maxCount": 1,
"canWriteDeathNote": false,
"canBeConvertedTo": [],
"chatMessages":[
{"type": "nextSantaAbility", "ability": "nice"},
{"type": "nextSantaAbility", "ability": "naughty"},
{"type": "addedToNiceList"}
{"type": "addedToNiceList"},
{"type": "addedToNaughtyList"},
{"type": "yourConvertFailed"}
]
},
"krampus": {
Expand Down
3 changes: 1 addition & 2 deletions server/src/game/role/krampus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ use super::{GetClientRoleState, Priority, Role, RoleStateImpl};
use crate::game::ability_input::*;

#[derive(Debug, Clone, Serialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Krampus {
ability: KrampusAbility,
last_used_ability: Option<KrampusAbility>
}



#[derive(Debug, Clone, Copy, Serialize, Default, PartialEq, Eq, PartialOrd, Ord)]
#[serde(rename_all = "camelCase")]
pub enum KrampusAbility {
Expand Down
14 changes: 5 additions & 9 deletions server/src/game/role/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,38 +384,34 @@ mod macros {
impl Role{
pub fn possession_immune(&self)->bool{
match self {
Role::TallyClerk
| Role::Bouncer
| Role::Veteran
| Role::Transporter | Role::Retributionist
| Role::Witch | Role::Doomsayer | Role::Scarecrow | Role::Warper
| Role::MafiaWitch | Role::Necromancer
| Role::Ojo => true,
| Role::MafiaWitch | Role::Necromancer => true,
_ => false,
}
}
pub fn roleblock_immune(&self)->bool{
match self {
Role::Veteran | Role::Jester |
Role::Bouncer |
Role::Veteran |
Role::Transporter | Role::Escort | Role::Retributionist |
Role::Jester | Role::Witch | Role::Scarecrow | Role::Warper |
Role::Hypnotist | Role::Consort | Role::MafiaWitch | Role::Necromancer |
Role::SantaClaus => true,
Role::Witch | Role::Scarecrow | Role::Warper |
Role::Hypnotist | Role::Consort | Role::MafiaWitch | Role::Necromancer => true,
_ => false,
}
}
pub fn wardblock_immune(&self)->bool{
match self {
Role::Jailor | Role::Kidnapper |
Role::Bouncer | Role::Scarecrow | Role::SantaClaus => true,
Role::Bouncer | Role::Scarecrow => true,
_ => false
}
}
pub fn has_innocent_aura(&self, game: &Game)->bool{
match self {
Role::Godfather => true,
Role::SantaClaus => true,
Role::Pyrolisk => {
game.day_number() == 1
},
Expand Down
Loading

0 comments on commit 95668aa

Please sign in to comment.