From bcbb2f1033891d5f4e055936c968f5844e05535b Mon Sep 17 00:00:00 2001 From: Fikou <23585223+Fikou@users.noreply.github.com> Date: Tue, 31 May 2022 23:24:54 +0200 Subject: [PATCH] Adds a chance for ID cards to be tastefully thick (#67359) About The Pull Request Adds a 1% chance for any ID to have a new trait (100% on golden IDs) This trait adds a special interaction with ID appraisal chips https://streamable.com/pdu7kj Why It's Good For The Game Impressive. Very nice. Let's see the Captain's card. Changelog cl add: Adds a chance for ID cards to be tastefully thick /cl --- code/__DEFINES/traits.dm | 3 +++ code/game/objects/items/cards_ids.dm | 26 +++++++++++++++++++ code/modules/mob/inventory.dm | 6 ++--- .../mob/living/simple_animal/simple_animal.dm | 4 +-- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 28fa7107458..03b156de665 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -849,6 +849,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_JOB_FIRST_ID_CARD "job_first_id_card" /// ID cards with this trait will attempt to forcibly occupy the front-facing ID card slot in wallets. #define TRAIT_MAGNETIC_ID_CARD "magnetic_id_card" +/// ID cards with this trait have special appraisal text. +#define TRAIT_TASTEFULLY_THICK_ID_CARD "impressive_very_nice" + /// Traits granted to items due to their chameleon properties. #define CHAMELEON_ITEM_TRAIT "chameleon_item_trait" diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 066c5c3b698..b755c698742 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -120,6 +120,8 @@ register_context() RegisterSignal(src, COMSIG_ATOM_UPDATED_ICON, .proc/update_in_wallet) + if(prob(1)) + ADD_TRAIT(src, TRAIT_TASTEFULLY_THICK_ID_CARD, ROUNDSTART_TRAIT) /obj/item/card/id/Destroy() if (registered_account) @@ -692,8 +694,28 @@ if(HAS_TRAIT(user, TRAIT_ID_APPRAISER)) . += HAS_TRAIT(src, TRAIT_JOB_FIRST_ID_CARD) ? span_boldnotice("Hmm... yes, this ID was issued from Central Command!") : span_boldnotice("This ID was created in this sector, not by Central Command.") + if(HAS_TRAIT(src, TRAIT_TASTEFULLY_THICK_ID_CARD) && (user.is_holding(src) || (user.CanReach(src) && user.put_in_hands(src, ignore_animation = FALSE)))) + ADD_TRAIT(src, TRAIT_NODROP, "psycho") + . += span_hypnophrase("Look at that subtle coloring... The tasteful thickness of it. Oh my God, it even has a watermark...") + var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = TRUE) + user.playsound_local(get_turf(src), slowbeat, 40, 0, channel = CHANNEL_HEARTBEAT, use_reverb = FALSE) + if(isliving(user)) + var/mob/living/living_user = user + living_user.adjust_timed_status_effect(10 SECONDS, /datum/status_effect/jitter) + addtimer(CALLBACK(src, .proc/drop_card, user), 10 SECONDS) . += span_notice("There's more information below, you can look again to take a closer look...") +/obj/item/card/id/proc/drop_card(mob/user) + user.stop_sound_channel(CHANNEL_HEARTBEAT) + REMOVE_TRAIT(src, TRAIT_NODROP, "psycho") + if(user.is_holding(src)) + user.dropItemToGround(src) + for(var/mob/living/carbon/human/viewing_mob in viewers(user, 2)) + if(viewing_mob.stat || viewing_mob == user) + continue + viewing_mob.say("Is something wrong? [user.first_name()]... you're sweating.", forced = "psycho") + break + /obj/item/card/id/examine_more(mob/user) if(!user.can_read(src)) return @@ -1006,6 +1028,10 @@ inhand_icon_state = "gold_id" wildcard_slots = WILDCARD_LIMIT_GOLD +/obj/item/card/id/advanced/gold/Initialize(mapload) + . = ..() + ADD_TRAIT(src, TRAIT_TASTEFULLY_THICK_ID_CARD, ROUNDSTART_TRAIT) + /obj/item/card/id/advanced/gold/captains_spare name = "captain's spare ID" desc = "The spare ID of the High Lord himself." diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 715eee74d25..a5220a05323 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -204,7 +204,7 @@ //Puts the item our active hand if possible. Failing that it tries other hands. Returns TRUE on success. //If both fail it drops it on the floor and returns FALSE. //This is probably the main one you need to know :) -/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, forced = FALSE) +/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, forced = FALSE, ignore_animation = TRUE) if(QDELETED(I)) return FALSE @@ -228,14 +228,14 @@ to_chat(usr, span_notice("Your [inactive_stack.name] stack now contains [inactive_stack.get_amount()] [inactive_stack.singular_name]\s.")) return TRUE - if(put_in_active_hand(I, forced)) + if(put_in_active_hand(I, forced, ignore_animation)) return TRUE var/hand = get_empty_held_index_for_side(LEFT_HANDS) if(!hand) hand = get_empty_held_index_for_side(RIGHT_HANDS) if(hand) - if(put_in_hand(I, hand, forced)) + if(put_in_hand(I, hand, forced, ignore_animation)) return TRUE if(del_on_fail) qdel(I) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 877dfc97909..82fe4d55596 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -615,8 +615,8 @@ if(H) H.update_appearance() -/mob/living/simple_animal/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE) - . = ..(I, del_on_fail, merge_stacks) +/mob/living/simple_animal/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, ignore_animation = TRUE) + . = ..() update_inv_hands() /mob/living/simple_animal/update_inv_hands()