diff --git a/code/__DEFINES/memory_defines.dm b/code/__DEFINES/memory_defines.dm index 9eeb823b431..30de201dc58 100644 --- a/code/__DEFINES/memory_defines.dm +++ b/code/__DEFINES/memory_defines.dm @@ -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" diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index 050ff5ca169..f871351e1e9 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -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 diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index fd4e90e2254..8706990d918 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -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 diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index bd3a0322182..0ae9ed43f02 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -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) diff --git a/strings/memories.json b/strings/memories.json index 52c54ebece1..f373e005d17 100644 --- a/strings/memories.json +++ b/strings/memories.json @@ -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." ] }