Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Inugami medical gloves #6462

Merged
Merged
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@
#define COMSIG_MOB_ITEM_ATTACK "mob_item_attack"
#define COMPONENT_ITEM_NO_ATTACK (1<<0)

#define COMSIG_GLOVES_DOUBLE_HANDS_TOUCH "gloves_double_hands_touch"

///from base of /mob/living/proc/get_incoming_damage_modifier(): (list/damage_mods, damage, damagetype, def_zone, sharp, used_weapon)
#define COMSIG_MOB_APPLY_DAMAGE_MODIFIERS "mob_apply_damage_modifiers"
///from base of /mob/living/proc/get_blocking_resistance(): (list/damage_resistances, damage, damagetype, def_zone, sharp, used_weapon)
Expand Down
5 changes: 4 additions & 1 deletion code/__DEFINES/dcs/signals_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#define COMSIG_SPEED_POTION_APPLIED "speed_potion"
#define SPEED_POTION_STOP (1<<0)

///from base of [/obj/proc/update_integrity]: (old_value, new_value)
#define COMSIG_OBJ_INTEGRITY_CHANGED "obj_integrity_changed"

Expand All @@ -32,3 +32,6 @@
///from [/obj/structure/closet/supplypod/proc/preOpen]:
#define COMSIG_SUPPLYPOD_LANDED "supplypodgoboom"


/// from /datum/surgery_step/proc/initiate() : (&time)
#define COMSIG_SURGERY_STEP_INIT "surgery_step_init"
1 change: 1 addition & 0 deletions code/datums/components/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
var/effect_target = isnull(actual_unit) ? parent : actual_unit

RegisterSignal(parent, COMSIG_ITEM_ATTACK, PROC_REF(trigger_defib))
RegisterSignal(parent, COMSIG_GLOVES_DOUBLE_HANDS_TOUCH, PROC_REF(trigger_defib))
RegisterSignal(effect_target, COMSIG_ATOM_EMAG_ACT, PROC_REF(on_emag))
RegisterSignal(effect_target, COMSIG_ATOM_EMP_ACT, PROC_REF(on_emp))

Expand Down
21 changes: 21 additions & 0 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ BLIND // can't see anything
var/surgeryspeedmod = 0
/// Same as above, used for surgery modifiers
var/toolspeedmod = 0
/// Constant time of surgery step
var/surgery_step_time = null
/// Chance of germs transfering to organ
var/surgery_germ_chance = 100
strip_delay = 20
put_on_delay = 40

Expand Down Expand Up @@ -336,6 +340,23 @@ BLIND // can't see anything

// Called just before an attack_hand(), in mob/UnarmedAttack()
/obj/item/clothing/gloves/proc/Touch(atom/A, proximity)
if(!ishuman(loc))
return FALSE //Only works while worn

if(!ishuman(A))
return FALSE

if(!proximity)
return FALSE

var/mob/living/carbon/human/human = loc
if(human.a_intent == INTENT_HELP)
if(!human.is_hands_free())
balloon_alert(usr, "руки заняты!")
return FALSE
SEND_SIGNAL(src, COMSIG_GLOVES_DOUBLE_HANDS_TOUCH, A, usr)
return TRUE

return FALSE // return TRUE to cancel attack_hand()


Expand Down
36 changes: 36 additions & 0 deletions code/modules/clothing/gloves/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,42 @@
item_color = "modified"
surgeryspeedmod = -0.3

/obj/item/clothing/gloves/color/latex/inugami
name = "medical gloves Inugami"
desc = "Прототип медицинских перчаток, оснащённых наночипами, что значительно повышают эффективность работы носителя во время проведения хирургических операций."
ru_names = list(
NOMINATIVE = "медицинские перчатки Inugami",
GENITIVE = "медицинских перчаток Inugami",
DATIVE = "медицинским перчаткам Inugami",
ACCUSATIVE = "медицинские перчатки Inugami",
INSTRUMENTAL = "медицинскими перчатками Inugami",
PREPOSITIONAL = "медицинских перчатках Inugami",
)
icon_state = "inugami_gl"
item_state = "inugami_gl"
item_color = null
surgery_step_time = 0.5 SECONDS
surgery_germ_chance = 50

/obj/item/clothing/gloves/color/latex/inugami/ComponentInitialize()
. = ..()
AddComponent(/datum/component/defib, ignore_hardsuits = TRUE, safe_by_default = TRUE, emp_proof = TRUE, emag_proof = TRUE)

/obj/item/clothing/gloves/color/latex/inugami/equipped(mob/living/carbon/human/user, slot, initial)
. = ..()
if(slot == ITEM_SLOT_GLOVES)
RegisterSignal(user, COMSIG_SURGERY_STEP_INIT, PROC_REF(on_surgery_step_init))
else
UnregisterSignal(user, COMSIG_SURGERY_STEP_INIT)

/obj/item/clothing/gloves/color/latex/inugami/dropped(mob/living/carbon/human/user, slot, silent)
. = ..()
UnregisterSignal(user, COMSIG_SURGERY_STEP_INIT)

/obj/item/clothing/gloves/color/latex/inugami/proc/on_surgery_step_init(user, time_pointer)
SIGNAL_HANDLER
*time_pointer = surgery_step_time
BeebBeebBoob marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/clothing/gloves/color/white
name = "white gloves"
desc = "These look pretty fancy."
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
return r_hand
return null

/**
* Returns `TRUE` if mob's hands free
*/
/mob/proc/is_hands_free()
return !l_hand && !r_hand


/**
* Returns `TRUE` if item is in mob's active hand
Expand Down
9 changes: 9 additions & 0 deletions code/modules/research/designs/medical_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -848,3 +848,12 @@
materials = list(MAT_METAL = 340, MAT_GLASS = 340, MAT_PLASMA = 200, MAT_BLUESPACE = 30)
build_path = /obj/item/storage/pill_bottle/bluespace
category = list("Medical")

/datum/design/adv_reagent_scanner
name = "Inugami medical gloves"
id = "medical_gloves_inugami"
req_tech = list("materials" = 7, "biotech" = 7, "magnets" = 8, "programming" = 7)
build_type = PROTOLATHE
materials = list(MAT_METAL = 1200, MAT_GLASS = 1000, MAT_SILVER = 800, MAT_GOLD = 800, MAT_DIAMOND = 1000, MAT_BLUESPACE = 600)
build_path = /obj/item/clothing/gloves/color/latex/inugami
category = list("Medical")
9 changes: 7 additions & 2 deletions code/modules/surgery/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,11 @@

// They also have some interesting ways that surgery success/fail prob get evaluated, maybe worth looking at
speed_mod /= (get_location_modifier(target) * 1 + surgery.speed_modifier) * implement_speed_mod
var/modded_time = slowdown_immune(user) ? time : time * speed_mod
var/step_time = time

SEND_SIGNAL(user, COMSIG_SURGERY_STEP_INIT, &step_time)

var/modded_time = slowdown_immune(user) ? step_time : step_time * speed_mod
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved

if(implement_type) // If this is set, we aren't in an allow_hand or allow_any_item step.
prob_success = allowed_tools[implement_type]
Expand Down Expand Up @@ -529,7 +533,8 @@

// germ spread from surgeon touching the patient
if(user.gloves)
germ_level = user.gloves.germ_level
var/obj/item/clothing/gloves/gloves = user.gloves
germ_level = !(istype(gloves) && prob(gloves.surgery_germ_chance))? user.gloves.germ_level : 0
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
target_organ.germ_level = max(germ_level, target_organ.germ_level)
spread_germs_by_incision(target_organ, tool) //germ spread from environement to patient

Expand Down
Binary file modified icons/mob/clothing/hands.dmi
Binary file not shown.
Binary file modified icons/mob/clothing/species/drask/gloves.dmi
Binary file not shown.
Binary file modified icons/mob/clothing/species/monkey/gloves.dmi
Binary file not shown.
Binary file modified icons/mob/clothing/species/vox/gloves.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/clothing_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/clothing_righthand.dmi
Binary file not shown.
Binary file modified icons/obj/clothing/gloves.dmi
Binary file not shown.