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

Equipment delay minor overhaul #1093

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,19 @@ GLOBAL_LIST_INIT(security_wintercoat_allowed, typecacheof(list(
#define LOCATION_HEAD "on your head"
/// String for items placed in the neck slot.
#define LOCATION_NECK "around your neck"

// Base equipment delays
/// Delay base for Undersuit equipment.
#define EQUIP_DELAY_UNDERSUIT (5 SECONDS)
/// Delay base efor Oversuit equipment.
#define EQUIP_DELAY_OVERSUIT (7 SECONDS)
/// Delay base for things like coats that are trivially removed or put on.
#define EQUIP_DELAY_COAT (2 SECONDS)
/// Delay base for back-worn objects.
#define EQUIP_DELAY_BACK (2 SECONDS)
/// Delay base for belts.
#define EQUIP_DELAY_BELT (1 SECONDS)
/// Delay base for gloves.
#define EQUIP_DELAY_GLOVES (1 SECONDS)
/// Delay base for shoes.
#define EQUIP_DELAY_SHOES (1 SECONDS)
6 changes: 2 additions & 4 deletions code/datums/elements/strippable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,13 @@
/datum/strippable_item/mob_item_slot/proc/get_equip_delay(obj/item/equipping)
return equipping.equip_delay_other

/// A utility function for `/datum/strippable_item`s to start unequipping an item from a mob.
/proc/start_unequip_mob(obj/item/item, mob/source, mob/user, strip_delay)
/datum/strippable_item/proc/start_unequip_mob(obj/item/item, mob/source, mob/user, strip_delay)
if (!do_after(user, source, strip_delay || item.strip_delay, DO_PUBLIC, interaction_key = REF(item), display = image('icons/hud/do_after.dmi', "pickpocket")))
return FALSE

return TRUE

/// A utility function for `/datum/strippable_item`s to finish unequipping an item from a mob.
/proc/finish_unequip_mob(obj/item/item, mob/source, mob/user)
/datum/strippable_item/proc/finish_unequip_mob(obj/item/item, mob/source, mob/user)
if (!item.doStrip(user, source))
return FALSE

Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/storage/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

storage_type = /datum/storage/backpack

equip_delay_self = EQUIP_DELAY_BACK
equip_delay_other = EQUIP_DELAY_BACK * 1.5
strip_delay = EQUIP_DELAY_BACK * 1.5

/obj/item/storage/backpack/Initialize()
. = ..()
atom_storage.max_slots = 21
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
attack_verb_continuous = list("whips", "lashes", "disciplines")
attack_verb_simple = list("whip", "lash", "discipline")
max_integrity = 300

equip_sound = 'sound/items/equip/toolbelt_equip.ogg'
equip_delay_self = EQUIP_DELAY_BELT
equip_delay_other = EQUIP_DELAY_BELT * 1.5
strip_delay = EQUIP_DELAY_BELT * 1.5

var/content_overlays = FALSE //If this is true, the belt will gain overlays based on what it's holding

/obj/item/storage/belt/suicide_act(mob/living/carbon/user)
Expand Down
7 changes: 5 additions & 2 deletions code/modules/clothing/gloves/_gloves.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
supports_variations_flags = CLOTHING_VOX_VARIATION
attack_verb_continuous = list("challenges")
attack_verb_simple = list("challenge")
strip_delay = 20
equip_delay_other = 40

equip_delay_self = EQUIP_DELAY_GLOVES
equip_delay_other = EQUIP_DELAY_GLOVES + (3 SECONDS)
strip_delay = EQUIP_DELAY_GLOVES + (3 SECONDS)

// Path variable. If defined, will produced the type through interaction with wirecutters.
var/cut_type = null
/// Used for handling bloody gloves leaving behind bloodstains on objects. Will be decremented whenever a bloodstain is left behind, and be incremented when the gloves become bloody.
Expand Down
5 changes: 4 additions & 1 deletion code/modules/clothing/shoes/_shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@

permeability_coefficient = 0.5
slowdown = SHOES_SLOWDOWN
strip_delay = 1 SECONDS

equip_delay_self = EQUIP_DELAY_SHOES
equip_delay_other = EQUIP_DELAY_SHOES * 1.5
strip_delay = EQUIP_DELAY_SHOES // In stripping code, if the mob is standing, it adds additional time.

var/offset = 0
var/equipped_before_drop = FALSE
Expand Down
14 changes: 12 additions & 2 deletions code/modules/clothing/suits/_suits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
icon = 'icons/obj/clothing/suits.dmi'
fallback_colors = list(list(13, 15))
fallback_icon_state = "coat"
var/fire_resist = T0C+100

allowed = list(/obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman)

armor = list(BLUNT = 0, PUNCTURE = 0, SLASH = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0)

drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'

equip_delay_self = EQUIP_DELAY_OVERSUIT
equip_delay_other = EQUIP_DELAY_OVERSUIT * 1.5
strip_delay = EQUIP_DELAY_OVERSUIT * 1.5

slot_flags = ITEM_SLOT_OCLOTHING

limb_integrity = 0 // disabled for most exo-suits

supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION
var/blood_overlay_type = "suit"
limb_integrity = 0 // disabled for most exo-suits
var/fire_resist = T0C+100

/obj/item/clothing/suit/Initialize(mapload)
. = ..()
Expand Down
2 changes: 0 additions & 2 deletions code/modules/clothing/suits/bio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
allowed = list(/obj/item/tank/internals, /obj/item/reagent_containers/dropper, /obj/item/flashlight/pen, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/hypospray, /obj/item/reagent_containers/glass/beaker, /obj/item/gun/syringe)
armor = list(BLUNT = 0, PUNCTURE = 0, SLASH = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 100, FIRE = 30, ACID = 100)
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT
strip_delay = 70
equip_delay_other = 70
resistance_flags = ACID_PROOF
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

Expand Down
8 changes: 8 additions & 0 deletions code/modules/clothing/suits/chaplainsuits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
/obj/item/clothing/suit/chaplainsuit
allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman)

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

/obj/item/clothing/suit/hooded/chaplainsuit
allowed = list(/obj/item/storage/book/bible, /obj/item/nullrod, /obj/item/reagent_containers/food/drinks/bottle/holywater, /obj/item/storage/fancy/candle_box, /obj/item/candle, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman)

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

//Suits
/obj/item/clothing/suit/chaplainsuit/holidaypriest
name = "holiday priest"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/clothing/suits/cloaks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
body_parts_covered = CHEST|GROIN|LEGS|ARMS
flags_inv = HIDESUITSTORAGE

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

/obj/item/clothing/neck/cloak/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is strangling [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return(OXYLOSS)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/clothing/suits/ghostsheet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
flags_inv = HIDEGLOVES|HIDEEARS|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR|HIDESNOUT
alternate_worn_layer = UNDER_HEAD_LAYER

equip_delay_self = 0
equip_delay_other = 0
strip_delay = 0

/obj/item/clothing/suit/ghost_sheet/spooky
name = "spooky ghost"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/clothing/suits/jacket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

/obj/item/clothing/suit/jacket/leather
name = "leather jacket"
desc = "Pompadour not included."
Expand Down
35 changes: 35 additions & 0 deletions code/modules/clothing/suits/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

equip_delay_self = 0
equip_delay_other = 0
strip_delay = 0

/obj/item/clothing/suit/apron/waders
name = "horticultural waders"
desc = "A pair of heavy duty leather waders, perfect for insulating your soft flesh from spills, soil and thorns."
Expand All @@ -33,6 +37,10 @@
allowed = list(/obj/item/disk, /obj/item/stamp, /obj/item/reagent_containers/food/drinks/flask, /obj/item/melee, /obj/item/storage/lockbox/medal, /obj/item/assembly/flash/handheld, /obj/item/storage/box/matches, /obj/item/lighter, /obj/item/clothing/mask/cigarette, /obj/item/storage/fancy/cigarettes, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman)
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

//Chef
/obj/item/clothing/suit/toggle/chef
name = "chef's apron"
Expand All @@ -46,6 +54,10 @@

supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

//Cook
/obj/item/clothing/suit/apron/chef
name = "cook's apron"
Expand All @@ -68,6 +80,10 @@
heat_protection = CHEST|GROIN|LEGS|ARMS
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

/obj/item/clothing/suit/det_suit/Initialize(mapload)
. = ..()
allowed = GLOB.detective_vest_allowed
Expand Down Expand Up @@ -99,6 +115,10 @@

supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

/obj/item/clothing/suit/hazardvest/worn_overlays(mob/living/carbon/human/wearer, mutable_appearance/standing, isinhands, icon_file)
. = ..()
if(!isinhands)
Expand All @@ -113,6 +133,9 @@
blood_overlay_type = "coat"
body_parts_covered = CHEST|ARMS

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

/obj/item/clothing/suit/toggle/lawyer/purple
name = "purple suit jacket"
Expand Down Expand Up @@ -154,6 +177,11 @@
icon = 'icons/obj/clothing/belts.dmi'
greyscale_colors = "#888888"

/obj/item/clothing/suit/security
equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

//Security
/obj/item/clothing/suit/security/officer
name = "security officer's jacket"
Expand Down Expand Up @@ -211,6 +239,9 @@
cold_protection = CHEST|ARMS
heat_protection = CHEST|ARMS

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

//Robotocist

Expand Down Expand Up @@ -252,3 +283,7 @@
inhand_icon_state = "p_suit"
armor = list(BLUNT = 0, PUNCTURE = 0, SLASH = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 50, FIRE = 50, ACID = 50)
supports_variations_flags = CLOTHING_TESHARI_VARIATION

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5
4 changes: 4 additions & 0 deletions code/modules/clothing/suits/labcoat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

/obj/item/clothing/suit/toggle/labcoat/cmo
name = "medical director's labcoat"
desc = "Bluer than the standard model."
Expand Down
4 changes: 4 additions & 0 deletions code/modules/clothing/suits/shirt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
icon_state = "ianshirt"
inhand_icon_state = "ianshirt"

equip_delay_self = EQUIP_DELAY_UNDERSUIT
equip_delay_other = EQUIP_DELAY_UNDERSUIT * 1.5
strip_delay = EQUIP_DELAY_UNDERSUIT * 1.5

supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION
///How many times has this shirt been washed? (In an ideal world this is just the determinant of the transform matrix.)
var/wash_count = 0
Expand Down
2 changes: 0 additions & 2 deletions code/modules/clothing/suits/straightjacket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@
body_parts_covered = CHEST|GROIN|LEGS|ARMS|HANDS
flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT
clothing_flags = DANGEROUS_OBJECT
equip_delay_self = 50
strip_delay = 60
breakouttime = 5 MINUTES
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION | CLOTHING_TESHARI_VARIATION | CLOTHING_VOX_VARIATION
5 changes: 5 additions & 0 deletions code/modules/clothing/suits/toggles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

/obj/item/clothing/suit/hooded
actions_types = list(/datum/action/item_action/toggle_hood)

equip_delay_self = EQUIP_DELAY_COAT
equip_delay_other = EQUIP_DELAY_COAT * 1.5
strip_delay = EQUIP_DELAY_COAT * 1.5

var/obj/item/clothing/head/hooded/hood
var/hoodtype = /obj/item/clothing/head/hooded/winterhood //so the chaplain hoodie or other hoodies can override this
///Alternative mode for hiding the hood, instead of storing the hood in the suit it qdels it, useful for when you deal with hooded suit with storage.
Expand Down
2 changes: 0 additions & 2 deletions code/modules/clothing/suits/utility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
cold_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS
min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT
strip_delay = 60
equip_delay_other = 60
resistance_flags = FIRE_PROOF

/obj/item/clothing/suit/fire/worn_overlays(mob/living/carbon/human/wearer, mutable_appearance/standing, isinhands, icon_file)
Expand Down
9 changes: 9 additions & 0 deletions code/modules/clothing/under/_under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@
worn_icon = 'icons/mob/clothing/under/default.dmi'
fallback_colors = list(list(15, 17), list(10, 19), list(15, 10))
fallback_icon_state = "under"

body_parts_covered = CHEST|GROIN|LEGS|ARMS
permeability_coefficient = 0.9
slot_flags = ITEM_SLOT_ICLOTHING

armor = list(BLUNT = 0, PUNCTURE = 0, SLASH = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, FIRE = 0, ACID = 0)

equip_sound = 'sound/items/equip/jumpsuit_equip.ogg'
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'

equip_delay_self = EQUIP_DELAY_UNDERSUIT
equip_delay_other = EQUIP_DELAY_UNDERSUIT * 1.5
strip_delay = EQUIP_DELAY_UNDERSUIT * 1.5

limb_integrity = 30

/// The variable containing the flags for how the woman uniform cropping is supposed to interact with the sprite.
var/female_sprite_flags = FEMALE_UNIFORM_FULL
var/has_sensor = HAS_SENSORS // For the crew computer
Expand Down
Loading
Loading