From efd0f2b0af934b38608287f38e0d6e3fc8810700 Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 12 Aug 2026 23:30:31 +0000 Subject: [PATCH] Add blind messages to IV bags. (#32366) * Add blind messages to IV bags. * Add fingerprints too. * Fix attack chain test? * Apply suggestions from CRUNCH review. Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan --------- Signed-off-by: Alan Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> --- .../reagents/reagent_containers/iv_bag.dm | 82 ++++++++++++++----- .../test_attack_chain_reagent_containers.dm | 2 +- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/code/modules/reagents/reagent_containers/iv_bag.dm b/code/modules/reagents/reagent_containers/iv_bag.dm index bb38f2f9351..209db3b86b6 100644 --- a/code/modules/reagents/reagent_containers/iv_bag.dm +++ b/code/modules/reagents/reagent_containers/iv_bag.dm @@ -9,7 +9,8 @@ righthand_file = 'icons/goonstation/mob/inhands/items_righthand.dmi' icon_state = "ivbag" volume = 200 - possible_transfer_amounts = list(1,5,10,15,20,25,30,50) // Everything above 10 is NOT usable on a person and is instead used for transfering to other containers + /// Everything above 10 is NOT usable on a person and is instead used for transferring to other containers. + possible_transfer_amounts = list(1, 5, 10, 15, 20, 25, 30, 50) amount_per_transfer_from_this = 1 container_type = OPENCONTAINER resistance_flags = ACID_PROOF @@ -93,21 +94,28 @@ end_processing() return - if(amount_per_transfer_from_this > 10) // Prevents people from switching to illegal transfer values while the IV is already in someone, i.e. anything over 10 - visible_message(SPAN_DANGER("The IV bag's needle pops out of [injection_target]'s arm. The transfer amount is too high!")) + if(amount_per_transfer_from_this > 10) + // Prevents people from switching to illegal transfer values while the IV is already in someone, i.e. anything over 10. + visible_message( + SPAN_DANGER("The IV bag's needle pops out of [injection_target]'s body. The transfer amount is too high!"), + SPAN_DANGER("The IV bag's needle pops out of [injection_target]'s body. The transfer amount is too high!") + ) end_processing() return if(mode) // Injecting if(reagents.total_volume) - var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) //The amount of reagents we'll transfer to the person - reagents.reaction(injection_target, REAGENT_INGEST, fraction) //React the amount we're transfering. + // The amount of reagents we'll transfer to the person. + var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1) + // React the amount we're transfering. + reagents.reaction(injection_target, REAGENT_INGEST, fraction) reagents.trans_to(injection_target, amount_per_transfer_from_this) update_icon(UPDATE_OVERLAYS) else // Drawing if(reagents.total_volume < reagents.maximum_volume) injection_target.transfer_blood_to(src, amount_per_transfer_from_this) - for(var/datum/reagent/reagent in injection_target.reagents.reagent_list) // Pull small amounts of reagents from the person while drawing blood + // Pull small amounts of reagents from the person while drawing blood + for(var/datum/reagent/reagent in injection_target.reagents.reagent_list) if(reagent.id in GLOB.blocked_chems) continue injection_target.reagents.trans_id_to(src, reagent.id, amount_per_transfer_from_this / 10) @@ -120,31 +128,47 @@ var/mob/living/L = target if(istype(L)) - if(injection_target) // Removing the needle + if(injection_target) // Removing the needle. if(L != injection_target) - to_chat(user, "[src] is already inserted into [injection_target]'s arm!") + to_chat(user, SPAN_WARNING("[src] is already inserted into [injection_target]'s body!")) return if(L != user) - L.visible_message(SPAN_DANGER("[user] is trying to remove [src]'s needle from [L]'s arm!"), \ - SPAN_USERDANGER("[user] is trying to remove [src]'s needle from [L]'s arm!")) + L.visible_message( + SPAN_DANGER("[user] is trying to remove [src]'s needle from [L]'s body!"), + SPAN_USERDANGER("[user] is trying to remove [src]'s needle from [L]'s body!"), + SPAN_DANGER("[user] is trying to remove [src]'s needle from [L]'s body!") + ) if(!do_mob(user, L, injection_action_delay)) return - L.visible_message(SPAN_DANGER("[user] removes [src]'s needle from [L]'s arm!"), \ - SPAN_USERDANGER("[user] removes [src]'s needle from [L]'s arm!")) + L.visible_message( + SPAN_DANGER("[user] removes [src]'s needle from [L]'s body!"), + SPAN_USERDANGER("[user] removes [src]'s needle from [L]'s body!"), + SPAN_DANGER("[user] removes [src]'s needle from [L]'s body!") + ) + add_fingerprint(user) end_processing() - else // Inserting the needle + else // Inserting the needle. if(!L.can_inject(user, TRUE)) return - if(amount_per_transfer_from_this > 10) // We only want to be able to transfer 1, 5, or 10 units to people. Higher numbers are for transfering to other containers + if(amount_per_transfer_from_this > 10) + // We only want to be able to transfer 1, 5, or 10 units to people. + // Higher numbers are for transfering to other containers. to_chat(user, SPAN_WARNING("The IV bag can only be used on someone with a transfer amount of 1, 5 or 10.")) return if(L != user) - L.visible_message(SPAN_DANGER("[user] is trying to insert [src]'s needle into [L]'s arm!"), \ - SPAN_USERDANGER("[user] is trying to insert [src]'s needle into [L]'s arm!")) + L.visible_message( + SPAN_DANGER("[user] is trying to insert [src]'s needle into [L]'s body!"), + SPAN_USERDANGER("[user] is trying to insert [src]'s needle into [L]'s body!"), + SPAN_DANGER("[user] is trying to insert [src]'s needle into [L]'s body!") + ) if(!do_mob(user, L, injection_action_delay)) return - L.visible_message(SPAN_DANGER("[user] inserts [src]'s needle into [L]'s arm!"), \ - SPAN_USERDANGER("[user] inserts [src]'s needle into [L]'s arm!")) + L.visible_message( + SPAN_DANGER("[user] inserts [src]'s needle into [L]'s body!"), + SPAN_USERDANGER("[user] inserts [src]'s needle into [L]'s body!"), + SPAN_DANGER("[user] inserts [src]'s needle into [L]'s body!") + ) + add_fingerprint(user) begin_processing(L) /obj/item/reagent_containers/iv_bag/normal_act(atom/target, mob/living/user) @@ -152,7 +176,8 @@ if(!target.reagents) return FALSE - if(target.is_refillable() && is_drainable()) // Transferring from IV bag to other containers + if(target.is_refillable() && is_drainable()) + // Transferring from IV bag to other containers. if(!reagents.total_volume) to_chat(user, SPAN_WARNING("[src] is empty.")) return @@ -172,7 +197,8 @@ /obj/item/reagent_containers/iv_bag/update_overlays() . = ..() if(reagents.total_volume) - var/percent = round((reagents.total_volume / volume) * 10) // We round the 1's place off of our percent for easy image processing. + // We round the 1's place off of our percent for easy image processing. + var/percent = round((reagents.total_volume / volume) * 10) var/image/filling = image('icons/goonstation/objects/iv.dmi', src, "[icon_state][percent]") filling.icon += mix_color_from_reagents(reagents.reagent_list) @@ -210,7 +236,21 @@ . = ..() if(blood_type != null) name = "[initial(name)] - [blood_type]" - reagents.add_reagent("blood", 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=blood_type,"blood_colour"=iv_blood_colour,"resistances"=null,"trace_chem"=null,"species"=blood_species,"species_only"=one_species_only)) + reagents.add_reagent( + "blood", + 200, + list( + "donor" = null, + "viruses" = null, + "blood_DNA" = null, + "blood_type" = blood_type, + "blood_colour" = iv_blood_colour, + "resistances" = null, + "trace_chem" = null, + "species" = blood_species, + "species_only" = one_species_only + ) + ) update_icon(UPDATE_OVERLAYS) diff --git a/code/tests/attack_chain/test_attack_chain_reagent_containers.dm b/code/tests/attack_chain/test_attack_chain_reagent_containers.dm index 9ff43c3685e..ea6f6aae141 100644 --- a/code/tests/attack_chain/test_attack_chain_reagent_containers.dm +++ b/code/tests/attack_chain/test_attack_chain_reagent_containers.dm @@ -286,7 +286,7 @@ player.put_away(beaker) target.puppet.forceMove(get_turf(iv_drip)) iv_drip.drag_drop_onto(target.puppet, player.puppet) - TEST_ASSERT_LAST_CHATLOG(player, "[player.puppet] inserts [blood_bag]'s needle into [target.puppet]'s arm") + TEST_ASSERT_LAST_CHATLOG(player, SPAN_DANGER("[player.puppet] inserts [blood_bag]'s needle into [target.puppet]'s body!")) blood_bag = player.spawn_obj_in_hand(/obj/item/reagent_containers/iv_bag) player.puppet.swap_hand()