Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
code shamelessly ported from Bubberstation
*/
/obj/item/clothing/suit
/// When set to TRUE, this particular suit is not able to use the functional toggle
var/only_functional
/// temp list to restore the intitial functional values (for armor, cold protection, etc) to the state they were in prior to using the functional toggle
var/list/functional_suit_values

/obj/item/clothing/suit/Initialize(mapload)
. = ..()
if(!(flags_1 & HAS_CONTEXTUAL_SCREENTIPS_1))
register_context()

/obj/item/clothing/suit/examine(mob/user)
. = ..()
if(!(HAS_TRAIT(src, TRAIT_NODROP)))
. += span_notice("Ctrl + Shift + Left Click to swap between functional (suit) and non-functional (neck) mode, to allow for things such as wearing a (nonfunctional) jacket over a piece of armor for the visual effect.")
else
only_functional = TRUE

#define PREV_SLOT_FLAGS "fs_slots"
#define PREV_COLD_PROTECTION "fs_cold"
#define PREV_HEAT_PROTECTION "fs_heat"
#define PREV_SLOWDOWN "fs_slow"
#define PREV_ARMOR_DATUM "fs_armor"

/obj/item/clothing/suit/click_ctrl_shift(mob/user)
if(!iscarbon(user))
return NONE
if(only_functional)
to_chat(user, span_danger("[src] does not have a non-functional mode!"))
return NONE
var/mob/living/carbon/char = user
if((char.get_item_by_slot(ITEM_SLOT_NECK) == src) || (char.get_item_by_slot(ITEM_SLOT_OCLOTHING) == src))
to_chat(user, span_warning("You can't adjust [src] while wearing it!"))
return CLICK_ACTION_BLOCKING
if(!user.is_holding(src))
to_chat(user, span_warning("You must be holding [src] in order to adjust it!"))
return CLICK_ACTION_BLOCKING
if(slot_flags & ITEM_SLOT_OCLOTHING)
functional_suit_values = list(
PREV_SLOT_FLAGS = slot_flags,
PREV_COLD_PROTECTION = cold_protection,
PREV_HEAT_PROTECTION = heat_protection,
PREV_SLOWDOWN = slowdown,
PREV_ARMOR_DATUM = armor_type,
)
slot_flags = ITEM_SLOT_NECK
cold_protection = null
heat_protection = null
slowdown = 0
set_armor(/datum/armor/none)
user.visible_message(span_notice("[user] adjusts [user.p_their()] [src] for non-functional use."), span_notice("You adjust your [src] for non-functional use."))
else if(!isnull(functional_suit_values))
slot_flags = functional_suit_values[PREV_SLOT_FLAGS]
cold_protection = functional_suit_values[PREV_COLD_PROTECTION]
heat_protection = functional_suit_values[PREV_HEAT_PROTECTION]
slowdown = functional_suit_values[PREV_SLOWDOWN]
set_armor(functional_suit_values[PREV_ARMOR_DATUM])
functional_suit_values = null
user.visible_message(span_notice("[user] adjusts [user.p_their()] [src] for functional use."), span_notice("You adjust your [src] for functional use."))
return CLICK_ACTION_SUCCESS

#undef PREV_SLOT_FLAGS
#undef PREV_COLD_PROTECTION
#undef PREV_HEAT_PROTECTION
#undef PREV_SLOWDOWN
#undef PREV_ARMOR_DATUM

/obj/item/clothing/suit/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if(only_functional)
return
if(slot_flags == ITEM_SLOT_NECK)
context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB] = "Toggle functional mode"
else
context[SCREENTIP_CONTEXT_CTRL_SHIFT_LMB] = "Toggle non-functional mode"
return CONTEXTUAL_SCREENTIP_SET

// Add the things here that shouldn't have this functionality.

/obj/item/clothing/suit/space
only_functional = TRUE

// Stuff that gives other effects, like reactive armor, reflective armor, etc.

/obj/item/clothing/suit/armor/reactive
only_functional = TRUE

/obj/item/clothing/suit/hooded/ablative
only_functional = TRUE

/obj/item/clothing/suit/armor/heavy/adamantine
only_functional = TRUE

/obj/item/clothing/suit/armor/laserproof
only_functional = TRUE

/obj/item/clothing/suit/hooded/berserker
only_functional = TRUE

/obj/item/clothing/suit/armor/abductor/vest
only_functional = TRUE

/obj/item/clothing/suit/hooded/cultrobes/eldritch
only_functional = TRUE
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DM Environment file for tgstation.dme.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\effects\code\reflection.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\merits_flaws\code\old_quirks.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\drugs\code\bloodpacks\bloodpack_adulteration.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\werewolf_the_apocalypse\code\old\gifts.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\doors\code\vampdoor_npc.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\unit_tests\apply_all_splats.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\unit_tests\apply_all_clans.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\unit_tests\unallocated_transfer_points.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\master_files\code\game\objects\items\devices\broadcast_camera.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\master_files\code\modules\mob\living\basic\pets\cat\cat.dm.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.

Expand Down Expand Up @@ -7805,6 +7805,7 @@
#include "modular_darkpack\modules\merits_flaws\code\positive_quirks\untamable.dm"
#include "modular_darkpack\modules\merits_flaws\code\positive_quirks\wolf_sight.dm"
#include "modular_darkpack\modules\mob_spawners\code\citizen.dm"
#include "modular_darkpack\modules\modular_crimsongrid\neck_wearing\neck_wearing.dm"
#include "modular_darkpack\modules\movie_theatre\code\areas.dm"
#include "modular_darkpack\modules\movie_theatre\code\fluff.dm"
#include "modular_darkpack\modules\movie_theatre\code\popcorn_maker.dm"
Expand Down
Loading