Skip to content

Commit

Permalink
В тот день, мои термалы на шлеме спасли меня (#348)
Browse files Browse the repository at this point in the history
* Что же у меня тогда лежало в подсумке?

а я уже явно не помню

* Update pouch.dm

* Update pouch.dm

* Update icons.dm

* В тот день, мои термалы на шлеме спасли меня от шрапнели

* удаляю ебланство экзапера

* Update goggle_mods.dm

* уэээээээээээээээээээээээээээээ

* АААААА
  • Loading branch information
polerno authored Nov 6, 2023
1 parent dd87e4c commit 7ae1c03
Show file tree
Hide file tree
Showing 33 changed files with 441 additions and 102 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,7 @@
#include "code\modules\clothing\under\accessories\fire_overpants.dm"
#include "code\modules\clothing\under\accessories\flannel_shirt.dm"
#include "code\modules\clothing\under\accessories\ftu_pin.dm"
#include "code\modules\clothing\under\accessories\goggle_mods.dm"
#include "code\modules\clothing\under\accessories\hawaii.dm"
#include "code\modules\clothing\under\accessories\helmcover.dm"
#include "code\modules\clothing\under\accessories\helmet_decor.dm"
Expand Down
4 changes: 3 additions & 1 deletion code/__defines/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
#define ACCESSORY_SLOT_ARMOR_M "Misc armor"
#define ACCESSORY_SLOT_HELM_C "Helmet cover"
#define ACCESSORY_SLOT_HELM_D "Helmet decor"

#define ACCESSORY_SLOT_VISOR "Helmet visor"
#define ACCESSORY_SLOT_VISION "Vision modification"
#define ACCESSORY_SLOT_HUD "HUD modification"

#define ACCESSORY_REMOVABLE FLAG(0)
#define ACCESSORY_HIDDEN FLAG(1)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/ecigs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "electronic cigarette"
desc = "Device with modern approach to smoking."
icon = 'icons/obj/ecig.dmi'
var/active = 0
active = 0
var/obj/item/cell/cigcell
var/cartridge_type = /obj/item/reagent_containers/ecig_cartridge/med_nicotine
var/obj/item/reagent_containers/ecig_cartridge/ec_cartridge
Expand Down
4 changes: 4 additions & 0 deletions code/modules/client/client_color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
client_color = list(0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.05, 0.05, 0.05)
priority = 300

/datum/client_color/nvg
client_color = list(0.2, 0.2, 0.2, 0.2, 0.5, 0.5, 0.2, 0.3, 0.5)
priority = 200

//Disabilities, could be hooked to brain damage or chargen if so desired.
/datum/client_color/deuteranopia
client_color = list(0.47,0.38,0.15, 0.54,0.31,0.15, 0,0.3,0.7)
Expand Down
102 changes: 93 additions & 9 deletions code/modules/clothing/_clothing.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/obj/item/clothing
name = "clothing"
siemens_coefficient = 0.9
var/flash_protection = FLASH_PROTECTION_NONE // Sets the item's level of flash protection.
var/tint = TINT_NONE // Sets the item's level of visual impairment tint.
/// Sets the item's level of flash protection.
var/flash_protection = FLASH_PROTECTION_NONE
/// Sets the item's level of visual impairment tint.
var/tint = TINT_NONE
var/list/species_restricted = list(
"exclude",
SPECIES_NABBER
Expand All @@ -15,8 +17,27 @@
var/ironed_state = WRINKLES_DEFAULT
var/smell_state = SMELL_DEFAULT
var/volume_multiplier = 1

var/move_trail = /obj/effect/decal/cleanable/blood/tracks/footprints // if this item covers the feet, the footprints it should leave
var/hud_type
var/vision_flags = 0
/// Base human is 2
var/darkness_view = 0
var/see_invisible = -1
var/light_protection = 0
/// if the clothing should be disrupted by EMP
var/electric = FALSE
/// used by goggles and HUDs
var/toggleable = FALSE
var/active = TRUE
var/activation_sound
/// set this if you want a sound on deactivation
var/deactivation_sound
/// set these in initialize if you want messages other than about the optical matrix
var/toggle_on_message
var/toggle_off_message
var/off_state = null

/// if this item covers the feet, the footprints it should leave
var/move_trail = /obj/effect/decal/cleanable/blood/tracks/footprints


/obj/item/clothing/Initialize()
Expand Down Expand Up @@ -249,10 +270,6 @@ BLIND // can't see anything
w_class = ITEM_SIZE_SMALL
body_parts_covered = EYES
slot_flags = SLOT_EYES
var/vision_flags = 0
var/darkness_view = 0//Base human is 2
var/see_invisible = -1
var/light_protection = 0
sprite_sheets = list(
SPECIES_VOX = 'icons/mob/species/vox/onmob_eyes_vox.dmi',
SPECIES_VOX_ARMALIS = 'icons/mob/species/vox/onmob_eyes_vox_armalis.dmi',
Expand All @@ -265,11 +282,78 @@ BLIND // can't see anything
else
return icon_state

/obj/item/clothing/glasses/update_clothing_icon()
/obj/item/clothing/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_glasses()

/obj/item/clothing/proc/activate(mob/user)
if (toggleable && !active)
active = TRUE
flash_protection = initial(flash_protection)
tint = initial(tint)
if (user)
user.update_inv_glasses()
user.update_action_buttons()
if (activation_sound)
sound_to(user, activation_sound)
if (toggle_on_message)
to_chat(user, SPAN_NOTICE(toggle_on_message))
else
to_chat(user, "You activate the optical matrix on \the [src].")

update_icon()
update_clothing_icon()
update_vision()

/obj/item/clothing/proc/deactivate(mob/user, manual = TRUE)
if (toggleable && active)
active = FALSE
if (user)
if (manual)
if (toggle_off_message)
to_chat(user, toggle_off_message)
else
to_chat(user, "You deactivate the optical matrix on \the [src].")
if (deactivation_sound)
sound_to(user, deactivation_sound)
user.update_inv_glasses()
user.update_action_buttons()

flash_protection = FLASH_PROTECTION_NONE
tint = TINT_NONE
update_icon()
update_clothing_icon()
update_vision()

/obj/item/clothing/emp_act(severity)
if (electric && active)
if (istype(src.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/M = src.loc
if (M.glasses != src)
to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], releasing a small spark."))
else
M.eye_blind = 2
M.eye_blurry = 4
to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], blinding you!"))
// Don't cure being nearsighted
if (!(M.disabilities & NEARSIGHTED))
M.disabilities |= NEARSIGHTED
spawn(100)
M.disabilities &= ~NEARSIGHTED
if (toggleable)
deactivate(M, FALSE)
..()

/obj/item/clothing/inherit_custom_item_data(datum/custom_item/citem)
. = ..()
if (toggleable)
if (citem.additional_data["icon_on"])
set_icon_state(citem.additional_data["icon_on"])
if (citem.additional_data["icon_off"])
off_state = citem.additional_data["icon_off"]


///////////////////////////////////////////////////////////////////////
//Gloves
/obj/item/clothing/gloves
Expand Down
122 changes: 47 additions & 75 deletions code/modules/clothing/glasses/glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@
SPECIES_VOX_ARMALIS = 'icons/mob/species/vox/onmob_eyes_vox_armalis.dmi',
SPECIES_UNATHI = 'icons/mob/species/unathi/onmob_eyes_unathi.dmi'
)
var/hud_type
var/prescription = FALSE
var/toggleable = FALSE
var/off_state = "degoggles"
var/active = TRUE
var/activation_sound = 'sound/items/goggles_charge.ogg'
var/deactivation_sound // set this if you want a sound on deactivation
off_state = "degoggles"
activation_sound = 'sound/items/goggles_charge.ogg'
deactivation_sound = null
var/obj/screen/overlay = null
var/obj/item/clothing/glasses/hud/hud = null // Hud glasses, if any
var/electric = FALSE //if the glasses should be disrupted by EMP
electric = FALSE //if the glasses should be disrupted by EMP

var/toggle_on_message //set these in initialize if you want messages other than about the optical matrix
var/toggle_off_message

/obj/item/clothing/glasses/Initialize()
. = ..()
Expand All @@ -35,64 +30,6 @@
/obj/item/clothing/glasses/needs_vision_update()
return ..() || overlay || vision_flags || see_invisible || darkness_view

/obj/item/clothing/glasses/proc/activate(mob/user)
if(toggleable && !active)
var/datum/extension/base_icon_state/BIS = get_extension(src, /datum/extension/base_icon_state)
active = TRUE
icon_state = BIS.base_icon_state
flash_protection = initial(flash_protection)
tint = initial(tint)
if(user)
user.update_inv_glasses()
user.update_action_buttons()
if(activation_sound)
sound_to(user, activation_sound)
if(toggle_on_message)
to_chat(user, toggle_on_message)
else
to_chat(user, "You activate the optical matrix on \the [src].")

update_clothing_icon()
update_vision()

/obj/item/clothing/glasses/proc/deactivate(mob/user, manual = TRUE)
if(toggleable && active)
active = FALSE
icon_state = off_state
if(user)
if(manual)
if(toggle_off_message)
to_chat(user, toggle_off_message)
else
to_chat(user, "You deactivate the optical matrix on \the [src].")
if(deactivation_sound)
sound_to(user, deactivation_sound)
user.update_inv_glasses()
user.update_action_buttons()

flash_protection = FLASH_PROTECTION_NONE
tint = TINT_NONE
update_clothing_icon()
update_vision()

/obj/item/clothing/glasses/emp_act(severity)
if(electric && active)
if(istype(src.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/M = src.loc
if(M.glasses != src)
to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], releasing a small spark."))
else
M.eye_blind = 2
M.eye_blurry = 4
to_chat(M, SPAN_DANGER("\The [name] malfunction[gender != PLURAL ? "s":""], blinding you!"))
// Don't cure being nearsighted
if(!(M.disabilities & NEARSIGHTED))
M.disabilities |= NEARSIGHTED
spawn(100)
M.disabilities &= ~NEARSIGHTED
if(toggleable)
deactivate(M, FALSE)
..()

/obj/item/clothing/glasses/attack_self(mob/user)
if(toggleable && !user.incapacitated())
Expand All @@ -101,14 +38,6 @@
else
activate(user)

/obj/item/clothing/glasses/inherit_custom_item_data(datum/custom_item/citem)
. = ..()
if(toggleable)
if(citem.additional_data["icon_on"])
set_icon_state(citem.additional_data["icon_on"])
if(citem.additional_data["icon_off"])
off_state = citem.additional_data["icon_off"]

/obj/item/clothing/glasses/meson
name = "meson goggles"
desc = "Used for seeing walls, floors, and stuff through anything."
Expand All @@ -126,6 +55,49 @@
. = ..()
overlay = GLOB.global_hud.meson

/obj/item/clothing/glasses/ballistic
name = "ballistic goggles"
desc = "A pair of goggles designed to protect the wearer's eyes from shrapnel."
icon_state = "ballistic"
origin_tech = list(TECH_COMBAT = 2)
siemens_coefficient = 0.6
armor = list(
melee = ARMOR_MELEE_MINOR,
bullet = ARMOR_BALLISTIC_MINOR,
bomb = ARMOR_BOMB_MINOR
)
action_button_name = "Toggle Attachments"
valid_accessory_slots = list(ACCESSORY_SLOT_VISION, ACCESSORY_SLOT_HUD)
restricted_accessory_slots = list(ACCESSORY_SLOT_VISION, ACCESSORY_SLOT_HUD)


/obj/item/clothing/glasses/ballistic/attack_self(mob/user) // добавить проверку на блекскрин чтобы челики без сознания не меняли модули
var/obj/item/clothing/accessory/glassesmod/choice = input(user, "Toggle which accessory?", "Attachment selection") as null|anything in accessories
if (choice.active)
choice.deactivate(user)
else
choice.activate(user)


/obj/item/clothing/glasses/ballistic/prescription
name = "prescription ballistic goggles"
desc = "A pair of goggles designed to protect the wearer's eyes from shrapnel. This set has corrective lenses."
prescription = 5


/obj/item/clothing/glasses/ballistic/fake
name = "budget ballistic goggles"
desc = "A pair of goggles that probably won't protect the wearer's eyes from shrapnel. At least they make you feel more tacticool."
origin_tech = null
armor = null


/obj/item/clothing/glasses/ballistic/security
accessories = list(/obj/item/clothing/accessory/glassesmod/hud/security)

/obj/item/clothing/glasses/ballistic/medic
accessories = list(/obj/item/clothing/accessory/glassesmod/hud/medical)

/obj/item/clothing/glasses/meson/prescription
name = "meson goggles"
desc = "Used for seeing walls, floors, and stuff through anything. This set has corrective lenses."
Expand Down
Loading

0 comments on commit 7ae1c03

Please sign in to comment.