Files
John Willard 2a637dd6bb Adds Coroner to Mafia & Bunch of Mafia changes (#92158)
Changeling chat is now at night, rather than :j saymode, and it is also
separated from normal messages as [CHANGELING CHAT]
Adds a new [DEAD CHAT], all dead players in Mafia are corpselocked and
talking will instead go to Dead chat.
The Chaplain's ability is now being able to hear Dead chat at night, and
being able to in turn speak to the Dead.
The Chaplain's old ability has been given to a new role, the Coroner.
"Pray" is now "Autopsy".
Deaths in the Mafia arena aren't broadcasted anymore, to lessen
annoyance to round observers.

Also updates role icons & some outfits, as well as some bug fixes I
encountered while messing with it on localhost. I also tried (but not
fully) to make Mafia games more modular and independent, so maybe in the
future we can have more than one Mafia game running at a time.

I am limited to 2 player testing for this, so it is very much possible
that there's some issues I haven't found from my local testing, let me
know if you find anything please.

Being dead in Mafia boots you out of the round regardless of how
invested you were, that kidna sucks so hopefully being able to still
contribute something to the game, or at least discuss it with other dead
players in your own chat, makes players feel important to the game
they're playing.

I have a previous attempt of this here -
https://github.com/tgstation/tgstation/pull/75879 - but it staled out.
This differs from that attempt, as only dead players from the Mafia game
can speak in dead chat, while the old attempt allowed anyone that was
observing a mafia sign post (so dead players from the game, but not
observing the post, weren't able to speak to Chaplains, making him very
hard to be useful especially since getting information like that across
is a little hard). Being corpselocked also prevents them from being able
to see who Changelings are by simply looking at who has maptext at
night, and keeps them more focused on the game being played.

🆑
add: Added a new role to Mafia; the Coroner, which takes the Chaplain's
ability to see dead people's roles.
add: Mafia Chaplains now speak with the dead at night instead, and the
dead are corpselocked to prevent cheating.
fix: Mafia's HoS doesn't kill himself when executing non-townies.
qol: You can now update your notes & send them in chat while dead, as
well as look up the descriptions of other roles.
/🆑
2025-08-04 20:53:29 -04:00

66 lines
2.3 KiB
Plaintext

/**
* Heal
*
* During the night, Healing will prevent a player from dying.
* Can be used to protect yourself, but only once.
*/
/datum/mafia_ability/heal
name = "Heal"
ability_action = "heal"
action_priority = COMSIG_MAFIA_NIGHT_ACTION_PHASE
use_flags = CAN_USE_ON_OTHERS | CAN_USE_ON_SELF
///The message sent when you've successfully saved someone.
var/saving_message = "someone nursed you back to health"
/datum/mafia_ability/heal/set_target(datum/mafia_role/new_target)
. = ..()
if(!.)
return FALSE
if(new_target.role_flags & ROLE_VULNERABLE)
host_role.send_message_to_player(span_notice("[new_target] can't be protected."))
return FALSE
/datum/mafia_ability/heal/perform_action_target(datum/mafia_controller/game, datum/mafia_role/day_target)
. = ..()
if(!.)
return FALSE
if(target_role == host_role)
use_flags &= ~CAN_USE_ON_SELF
RegisterSignal(target_role, COMSIG_MAFIA_ON_KILL, PROC_REF(prevent_kill))
return TRUE
/datum/mafia_ability/heal/clean_action_refs(datum/mafia_controller/game)
if(target_role)
UnregisterSignal(target_role, COMSIG_MAFIA_ON_KILL)
return ..()
/datum/mafia_ability/heal/proc/prevent_kill(datum/source, datum/mafia_controller/game, datum/mafia_role/attacker, lynch)
SIGNAL_HANDLER
if(host_role == target_role)
host_role.send_message_to_player(span_warning("You were attacked last night!"))
return MAFIA_PREVENT_KILL
host_role.send_message_to_player(span_warning("The person you protected tonight was attacked!"))
target_role.send_message_to_player(span_greentext("You were attacked last night, but [saving_message]!"))
return MAFIA_PREVENT_KILL
/**
* Defend subtype
* Kills both players when successfully defending.
*/
/datum/mafia_ability/heal/defend
name = "Defend"
ability_action = "defend"
saving_message = "security fought off the attacker"
/datum/mafia_ability/heal/defend/prevent_kill(datum/source, datum/mafia_controller/game, datum/mafia_role/attacker, lynch)
. = ..()
if(host_role == target_role)
return FALSE
if(attacker.kill(game, host_role, FALSE)) //you attack the attacker
attacker.send_message_to_player(span_userdanger("You have been ambushed by Security!"))
host_role.kill(game, attacker, FALSE) //the attacker attacks you, they were able to attack the target so they can attack you.
return FALSE