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

Open
wants to merge 10 commits into
base: master220
Choose a base branch
from
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@
#define COMSIG_MOB_ITEM_ATTACK "mob_item_attack"
#define COMPONENT_ITEM_NO_ATTACK (1<<0)

#define COMSIG_MOB_ITEM_TOUCH "mob_item_touch"
#define COMPONENT_ITEM_TOUCH_SUCCESSFUL (1<<0)

///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
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_MOB_ITEM_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
4 changes: 4 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
43 changes: 43 additions & 0 deletions code/modules/clothing/gloves/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,49 @@
item_color = "modified"
surgeryspeedmod = -0.3

/obj/item/clothing/gloves/color/latex/inugami
name = "medical gloves Inugami"
desc = "Прототип медицинских перчаток оснащенных наночипами, что значительно корректируют работу носителя во время проведения операции."
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
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/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())
to_chat(usr, span_warning("Чтобы провести дефибрилляцию, обе руки должны быть свободны."))
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
balloon_alert(usr, "руки заняты")
PlayerUnknown14 marked this conversation as resolved.
Show resolved Hide resolved
return FALSE
SEND_SIGNAL(src, COMSIG_MOB_ITEM_TOUCH, A, usr)
dageavtobusnick marked this conversation as resolved.
Show resolved Hide resolved
return TRUE

return FALSE


/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")
13 changes: 11 additions & 2 deletions code/modules/surgery/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,15 @@

// 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

if(ishuman(user))
var/mob/living/carbon/human/human_user = user
var/obj/item/clothing/gloves/gloves = human_user.gloves
if(gloves && istype(gloves))
step_time = !isnull(gloves.surgery_step_time)? gloves.surgery_step_time : 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 +537,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
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.
4 changes: 2 additions & 2 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,8 @@
#include "code\datums\components\paintable.dm"
#include "code\datums\components\pellet_cloud.dm"
#include "code\datums\components\persistent_overlay.dm"
#include "code\datums\components\proximity_monitor.dm"
#include "code\datums\components\pref_holder.dm"
#include "code\datums\components\proximity_monitor.dm"
#include "code\datums\components\radioactivity.dm"
#include "code\datums\components\ritual_object.dm"
#include "code\datums\components\shielded.dm"
Expand Down Expand Up @@ -592,14 +592,14 @@
#include "code\datums\elements\devil_banishment.dm"
#include "code\datums\elements\devil_regen.dm"
#include "code\datums\elements\diona_internals.dm"
#include "code\datums\elements\pref_viewer.dm"
#include "code\datums\elements\falling_hazard.dm"
#include "code\datums\elements\footstep.dm"
#include "code\datums\elements\give_turf_traits.dm"
#include "code\datums\elements\high_value_item.dm"
#include "code\datums\elements\light_blocking.dm"
#include "code\datums\elements\movetype_handler.dm"
#include "code\datums\elements\openspace_item_click_handler.dm"
#include "code\datums\elements\pref_viewer.dm"
#include "code\datums\elements\reagent_attack.dm"
#include "code\datums\elements\ridable.dm"
#include "code\datums\elements\simple_flying.dm"
Expand Down
Loading