From f65638f0045105097cb855a7c7967fafdfaa5c9c Mon Sep 17 00:00:00 2001 From: NamelessFairy <40036527+NamelessFairy@users.noreply.github.com> Date: Thu, 22 May 2025 17:57:35 +0100 Subject: [PATCH] You can now read what cards are in a hand of cards + a related bugfix (#91279) ## About The Pull Request When you inspect a hand of cards in your hand you will see all the cards in it. When anyone inspects a hand of cards outside of your hand they will see all face up cards. Also fixes a bug that caused cards to improperly flip when added to a hand. ## Why It's Good For The Game When playing games that involve larger hand sizes (see: everything besides texas hold'em), hands can become unreadable from sprites alone. This adds a way to actually see whats in your hand and other people's hands if they're placed face up on the table. ## Changelog :cl: qol: Inspecting a hand of cards now tells you what cards you can see in it. fix: Adding cards to a hand no longer automatically flips them. /:cl: --- code/modules/cards/cardhand.dm | 13 +++++++++++-- code/modules/cards/singlecard.dm | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/code/modules/cards/cardhand.dm b/code/modules/cards/cardhand.dm index e54d004882d..fb8c025df5c 100644 --- a/code/modules/cards/cardhand.dm +++ b/code/modules/cards/cardhand.dm @@ -19,12 +19,21 @@ /obj/item/toy/cards/cardhand/examine(mob/user) . = ..() + . += span_notice("There are [count_cards()] cards.") + var/broadcast_check = FALSE for(var/obj/item/toy/singlecard/card in fetch_card_atoms()) - if(HAS_TRAIT(user, TRAIT_XRAY_VISION)) + if(user.is_holding(src) || card.flipped) + . += span_notice("The hand contains a: [card.cardname]") + if(!card.flipped) + broadcast_check = TRUE + else if(HAS_TRAIT(user, TRAIT_XRAY_VISION)) . += span_notice("You scan the cardhand with your x-ray vision and there is a: [card.cardname]") var/marked_color = card.getMarkedColor(user) if(marked_color) . += span_notice("There is a [marked_color] mark on the corner of a card in the cardhand!") + if(broadcast_check) + user.visible_message(span_notice("[user] checks [user.p_their()] cards.")) + /obj/item/toy/cards/cardhand/add_context(atom/source, list/context, obj/item/held_item, mob/living/user) if(istype(held_item, /obj/item/toy/cards/deck)) @@ -69,7 +78,7 @@ /obj/item/toy/cards/cardhand/proc/check_menu(mob/living/user) return isliving(user) && !user.incapacitated -/obj/item/toy/cards/cardhand/attackby(obj/item/weapon, mob/living/user, params, flip_card = FALSE) +/obj/item/toy/cards/cardhand/attackby(obj/item/weapon, mob/living/user, list/params, list/attack_modifier, flip_card = FALSE) var/obj/item/toy/singlecard/card if(istype(weapon, /obj/item/toy/singlecard)) diff --git a/code/modules/cards/singlecard.dm b/code/modules/cards/singlecard.dm index 92a2d921b31..d56e8e26521 100644 --- a/code/modules/cards/singlecard.dm +++ b/code/modules/cards/singlecard.dm @@ -147,7 +147,7 @@ name = flipped ? cardname : "card" return ..() -/obj/item/toy/singlecard/attackby(obj/item/item, mob/living/user, params, flip_card=FALSE) +/obj/item/toy/singlecard/attackby(obj/item/item, mob/living/user, list/params, list/attack_modifier, flip_card=FALSE) var/obj/item/toy/singlecard/card if(istype(item, /obj/item/toy/cards/deck))