Add Russian Roulette memories and moods events (#66051)

About The Pull Request

This adds memories to a nearby audience if someone is playing Russian Roulette with a loaded gun. The person who wins or loses also gains a positive or negative mood event that is long lasting. All of these events only trigger if the person playing is targeting a lethal area.
Why It's Good For The Game

Being able to add Russian Roulette to engravings would be pretty cool.
Changelog

cl
qol: Playing Russian Roulette with lethal intent now creates a mood event for the user and is engrained in any nearby peoples memories. The more bullets the better the memory and mood boost.
/cl
This commit is contained in:
Tim
2022-06-07 21:25:11 +12:00
committed by GitHub
parent 0d1462eea4
commit 8576db2f32
5 changed files with 57 additions and 5 deletions
+6 -1
View File
@@ -102,6 +102,8 @@
#define MEMORY_PLAYING_52_PICKUP "playing_52_pickup"
/// A memory of playing cards with others
#define MEMORY_PLAYING_CARDS "playing_cards"
/// A memory of playing russian roulette
#define MEMORY_RUSSIAN_ROULETTE "russian_roulette"
/**
@@ -163,4 +165,7 @@
#define DETAIL_DEALER "DEALER"
#define DETAIL_HELD_CARD_ITEM "HELD_CARD_ITEM" // could either be a singlecard, cardhand, or a deck
// Russian Roulette
#define DETAIL_LOADED_ROUNDS "LOADED_ROUNDS"
#define DETAIL_BODYPART "BODYPART"
#define DETAIL_OUTCOME "OUTCOME"
@@ -374,3 +374,8 @@
description = "This is really embarrassing! I'm ashamed to pick up all these cards off the floor..."
mood_change = -3
timeout = 3 MINUTES
/datum/mood_event/russian_roulette_lose
description = "I gambled my life and lost! I guess this is the end..."
mood_change = -20
timeout = 10 MINUTES
@@ -297,3 +297,11 @@
mood_change *= card_players
return ..()
/datum/mood_event/russian_roulette_win
description = "I gambled my life and won! I'm lucky to be alive..."
mood_change = 2
timeout = 5 MINUTES
/datum/mood_event/russian_roulette_win/add_effects(loaded_rounds)
mood_change = 2 ** loaded_rounds
@@ -188,19 +188,42 @@
spun = FALSE
var/zone = check_zone(user.zone_selected)
var/obj/item/bodypart/affecting = H.get_bodypart(zone)
var/is_target_face = zone == BODY_ZONE_HEAD || zone == BODY_ZONE_PRECISE_EYES || zone == BODY_ZONE_PRECISE_MOUTH
var/loaded_rounds = get_ammo(FALSE, FALSE) // check before it is fired
if(loaded_rounds && is_target_face)
add_memory_in_range(
user,
7,
MEMORY_RUSSIAN_ROULETTE,
list(
DETAIL_PROTAGONIST = user,
DETAIL_LOADED_ROUNDS = loaded_rounds,
DETAIL_BODYPART = affecting.name,
DETAIL_OUTCOME = (chambered ? "lost" : "won")
),
story_value = chambered ? STORY_VALUE_SHIT : max(STORY_VALUE_NONE, loaded_rounds), // the more bullets, the greater the story (but losing is always SHIT)
memory_flags = MEMORY_CHECK_BLINDNESS,
protagonist_memory_flags = NONE
)
if(chambered)
var/obj/item/ammo_casing/AC = chambered
if(AC.fire_casing(user, user, params, distro = 0, quiet = 0, zone_override = null, spread = 0, fired_from = src))
playsound(user, fire_sound, fire_sound_volume, vary_fire_sound)
var/zone = check_zone(user.zone_selected)
var/obj/item/bodypart/affecting = H.get_bodypart(zone)
if(zone == BODY_ZONE_HEAD || zone == BODY_ZONE_PRECISE_EYES || zone == BODY_ZONE_PRECISE_MOUTH)
if(is_target_face)
shoot_self(user, affecting)
else
user.visible_message(span_danger("[user.name] cowardly fires [src] at [user.p_their()] [affecting.name]!"), span_userdanger("You cowardly fire [src] at your [affecting.name]!"), span_hear("You hear a gunshot!"))
chambered = null
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "russian_roulette_lose", /datum/mood_event/russian_roulette_lose)
return
if(loaded_rounds && is_target_face)
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "russian_roulette_win", /datum/mood_event/russian_roulette_win, loaded_rounds)
user.visible_message(span_danger("*click*"))
playsound(src, dry_fire_sound, 30, TRUE)
+12 -1
View File
@@ -414,7 +414,7 @@
],
"nuke_code_names":[
"%PROTAGONIST learns the detonation codes for a nuclear weapon, %NUKE_CODE."
],
],
"nuke_code_starts":[
"The number %NUKE_CODE written on a sticky note with the words \"FOR SYNDICATE EYES ONLY\" scrawled next to it.",
"A piece of paper with the number %NUKE_CODE being handed to %PROTAGONIST from a figure in a blood-red MODsuit."
@@ -442,5 +442,16 @@
"playing_52_pickup_moods":[
"%PROTAGONIST %MOOD as they taunt %DEUTERAGONIST.",
"%DEUTERAGONIST %MOOD as they shamefully pickup the cards."
],
"russian_roulette_names":[
"%PROTAGONIST playing a game of russian roulette."
],
"russian_roulette_starts":[
"%PROTAGONIST aiming at their %BODYPART right before they pull the trigger.",
"The revolver has %LOADED_ROUNDS rounds loaded in the chamber.",
"%PROTAGONIST is gambling their life as they spin the revolver."
],
"russian_roulette_moods":[
"%PROTAGONIST %MOOD as they %OUTCOME the deadly game of roulette."
]
}