mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
Only one IV bag at a time (#25805)
* single iv bag * add to traits.dm * comment for called signal
This commit is contained in:
@@ -234,6 +234,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
|
||||
#define TRAIT_ABSTRACT_HANDS "abstract_hands" // Mobs with this trait can only pick up abstract items.
|
||||
#define TRAIT_SLOW_GRABBER "slow_grabber" // Adds a 1.5 * CLICK_CD_MELEE delay to upgrading into a aggressive grab.
|
||||
#define TRAIT_LANGUAGE_LOCKED "language_locked" // cant add/remove languages until removed (excludes babel because fuck everything i guess)
|
||||
#define TRAIT_HAS_IV_BAG "iv_bag" // Used to check if there is an active IV bag. Currently blocks another IV bags from being inserted.
|
||||
|
||||
//***** MIND TRAITS *****/
|
||||
#define TRAIT_HOLY "is_holy" // The mob is holy in regards to religion
|
||||
|
||||
@@ -97,6 +97,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
|
||||
"TRAIT_ABSTRACT_HANDS" = TRAIT_ABSTRACT_HANDS,
|
||||
"TRAIT_SLOW_GRABBER" = TRAIT_SLOW_GRABBER,
|
||||
"TRAIT_LANGUAGE_LOCKED" = TRAIT_LANGUAGE_LOCKED,
|
||||
"TRAIT_HAS_IV_BAG" = TRAIT_HAS_IV_BAG
|
||||
),
|
||||
|
||||
/datum/mind = list(
|
||||
|
||||
@@ -41,11 +41,19 @@
|
||||
..()
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/proc/on_examine(datum/source, mob/examiner, list/examine_list)
|
||||
SIGNAL_HANDLER // COMSIG_PARENT_EXAMINE
|
||||
examine_list += "<span class='notice'>[source.p_they(TRUE)] [source.p_have()] an active IV bag.</span>"
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/proc/begin_processing(mob/target)
|
||||
injection_target = target
|
||||
ADD_TRAIT(injection_target, TRAIT_HAS_IV_BAG, UID())
|
||||
RegisterSignal(injection_target, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine))
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/reagent_containers/iv_bag/proc/end_processing()
|
||||
REMOVE_TRAIT(injection_target, TRAIT_HAS_IV_BAG, UID())
|
||||
UnregisterSignal(injection_target, COMSIG_PARENT_EXAMINE)
|
||||
injection_target = null
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
@@ -106,6 +114,9 @@
|
||||
else // Inserting the needle
|
||||
if(!L.can_inject(user, TRUE))
|
||||
return
|
||||
if(HAS_TRAIT(target, TRAIT_HAS_IV_BAG))
|
||||
to_chat(user, "<span class='warning'>[target] already [target.p_have()] another IV bag inserted into [target.p_them()]!</span>")
|
||||
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
|
||||
to_chat(user, "<span class='warning'>The IV bag can only be used on someone with a transfer amount of 1, 5 or 10.</span>")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user