mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
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 <alfalfascout@users.noreply.github.com> --------- Signed-off-by: Alan <alfalfascout@users.noreply.github.com> Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
@@ -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, "<span class='notice'>[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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user