Skip to content

Commit

Permalink
Merge Upstream 09.04.2024 (#1168)
Browse files Browse the repository at this point in the history
## Changelog

:cl: ParadiseSS13
add: Меню обыска теперь TGUI
tweak: Снятие/Надевание предметов из инвентаря корги и попугаев больше
не происходит мгновенно.
/:cl:
  • Loading branch information
dj-34 authored Apr 8, 2024
2 parents aa2232e + 175ac67 commit 7a89a92
Show file tree
Hide file tree
Showing 90 changed files with 1,879 additions and 1,142 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/dcs/dcs_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// /datum/element flags
/// Causes the detach proc to be called when the host object is being deleted
#define ELEMENT_DETACH (1 << 0)
#define ELEMENT_DETACH_ON_HOST_DESTROY (1 << 0)
/**
* Only elements created with the same arguments given after `id_arg_index` share an element instance
* The arguments are the same when the text and number values are the same and all other values have the same ref
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1038,3 +1038,6 @@
// Sent when sales are completed.
// Use to send summary messages for items that sell in bulk.
#define COMSIG_CARGO_END_SELL "end_sell"

///from of mob/MouseDrop(): (/atom/over, /mob/user)
#define COMSIG_DO_MOB_STRIP "do_mob_strip"
3 changes: 3 additions & 0 deletions code/__DEFINES/misc_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
#define MIN_SUPPLIED_LAW_NUMBER 15
#define MAX_SUPPLIED_LAW_NUMBER 50

/// Grabs the area of a supplied object. Passing an area in to this will result in an error
#define get_area(T) ((get_step(T, 0).loc))

//check_target_facings() return defines
#define FACING_FAILED 0
#define FACING_SAME_DIR 1
Expand Down
6 changes: 3 additions & 3 deletions code/__DEFINES/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@
///The shock doesn't stun.
#define SHOCK_NOSTUN (1<<3)

#define POCKET_STRIP_DELAY 40 //time taken (in deciseconds) to search somebody's pockets
#define POCKET_STRIP_DELAY 4 SECONDS //time taken to search somebody's pockets

#define DEFAULT_ITEM_STRIP_DELAY 40 //time taken (in deciseconds) to strip somebody
#define DEFAULT_ITEM_PUTON_DELAY 20 //time taken (in deciseconsd) to reverse-strip somebody
#define DEFAULT_ITEM_STRIP_DELAY 4 SECONDS //time taken to strip somebody
#define DEFAULT_ITEM_PUTON_DELAY 2 SECONDS //time taken to reverse-strip somebody

#define IGNORE_ACCESS -1

Expand Down
33 changes: 33 additions & 0 deletions code/__DEFINES/strippable_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// All of these must be matched in StripMenu.js.
#define STRIPPABLE_ITEM_HEAD "head"
#define STRIPPABLE_ITEM_BACK "back"
#define STRIPPABLE_ITEM_MASK "mask"
#define STRIPPABLE_ITEM_NECK "neck"
#define STRIPPABLE_ITEM_EYES "eyes"
#define STRIPPABLE_ITEM_L_EAR "left_ear"
#define STRIPPABLE_ITEM_R_EAR "right_ear"
#define STRIPPABLE_ITEM_JUMPSUIT "jumpsuit"
#define STRIPPABLE_ITEM_SUIT "suit"
#define STRIPPABLE_ITEM_GLOVES "gloves"
#define STRIPPABLE_ITEM_FEET "shoes"
#define STRIPPABLE_ITEM_SUIT_STORAGE "suit_storage"
#define STRIPPABLE_ITEM_ID "id"
#define STRIPPABLE_ITEM_PDA "pda"
#define STRIPPABLE_ITEM_BELT "belt"
#define STRIPPABLE_ITEM_LPOCKET "left_pocket"
#define STRIPPABLE_ITEM_RPOCKET "right_pocket"
#define STRIPPABLE_ITEM_LHAND "left_hand"
#define STRIPPABLE_ITEM_RHAND "right_hand"
#define STRIPPABLE_ITEM_HANDCUFFS "handcuffs"
#define STRIPPABLE_ITEM_LEGCUFFS "legcuffs"
#define STRIPPABLE_ITEM_PET_COLLAR "pet_collar"
#define STRIPPABLE_ITEM_PARROT_HEADSET "parrot_headset"

/// This slot is not obscured.
#define STRIPPABLE_OBSCURING_NONE 0

/// This slot is completely obscured, and cannot be accessed.
#define STRIPPABLE_OBSCURING_COMPLETELY 1

/// This slot can't be seen, but can be accessed.
#define STRIPPABLE_OBSCURING_HIDDEN 2
13 changes: 2 additions & 11 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/proc/get_area(atom/A)
RETURN_TYPE(/area)
if(isarea(A))
return A
var/turf/T = get_turf(A)
return T ? T.loc : null

/proc/get_area_name(atom/X, format_text = FALSE)
var/area/A = isarea(X) ? X : get_area(X)
if(!A)
Expand Down Expand Up @@ -403,23 +396,21 @@

/proc/mobs_in_area(area/the_area, client_needed=0, moblist=GLOB.mob_list)
var/list/mobs_found[0]
var/area/our_area = get_area(the_area)
for(var/mob/M in moblist)
if(client_needed && !M.client)
continue
if(our_area != get_area(M))
if(the_area != get_area(M))
continue
mobs_found += M
return mobs_found

/proc/alone_in_area(area/the_area, mob/must_be_alone, check_type = /mob/living/carbon)
var/area/our_area = get_area(the_area)
for(var/C in GLOB.alive_mob_list)
if(!istype(C, check_type))
continue
if(C == must_be_alone)
continue
if(our_area == get_area(C))
if(the_area == get_area(C))
return 0
return 1

Expand Down
7 changes: 6 additions & 1 deletion code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@
//Picks from the list, with some safeties, and returns the "default" arg if it fails
#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default)

#define LAZYINITLIST(L) if(!L) L = list()
#define LAZYINITLIST(L) if(!L) { L = list() }

#define UNSETEMPTY(L) if(L && !L.len) L = null
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } }
Expand All @@ -696,6 +696,11 @@
#define ISINDEXSAFE(L, I) (I >= 1 && I <= length(L))
///If the lazy list is currently initialized find item I in list L
#define LAZYIN(L, I) (L && (I in L))
/// Performs an insertion on the given lazy list with the given key and value. If the value already exists, a new one will not be made.
#define LAZYORASSOCLIST(lazy_list, key, value) \
LAZYINITLIST(lazy_list); \
LAZYINITLIST(lazy_list[key]); \
lazy_list[key] |= value;

//same, but returns nothing and acts on list in place
/proc/shuffle_inplace(list/L)
Expand Down
6 changes: 5 additions & 1 deletion code/__HELPERS/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@
var/loglevel = ATKLOG_MOST
if(!isnull(custom_level))
loglevel = custom_level
var/area/A = get_area(MT)
var/area/A
if(isatom(MT) && !QDELETED(MT))
A = get_area(MT)
else
A = get_area(user)
if(A && A.hide_attacklogs)
loglevel = ATKLOG_ALL
else if(istype(MT))
Expand Down
1 change: 1 addition & 0 deletions code/__HELPERS/trait_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NOSLIP "noslip"
#define TRAIT_MEPHEDRONE_ADAPTED "mephedrone_adapted" // Trait that changes the ending effects of twitch leaving your system
#define TRAIT_NOKNOCKDOWNSLOWDOWN "noknockdownslowdown" //If this person has this trait, they are not slowed via knockdown, but they can be hit by bullets like a self knockdown
#define TRAIT_CAN_STRIP "can_strip" // This mob can strip other mobs.

//***** MIND TRAITS *****/
#define TRAIT_HOLY "is_holy" // The mob is holy in regards to religion
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NOSLIP" = TRAIT_NOSLIP,
"TRAIT_MAGPULSE" = TRAIT_MAGPULSE,
"TRAIT_MEPHEDRONE_ADAPTED" = TRAIT_MEPHEDRONE_ADAPTED,
"TRAIT_NOKNOCKDOWNSLOWDOWN" = TRAIT_NOKNOCKDOWNSLOWDOWN
"TRAIT_NOKNOCKDOWNSLOWDOWN" = TRAIT_NOKNOCKDOWNSLOWDOWN,
"TRAIT_CAN_STRIP" = TRAIT_CAN_STRIP
),

/datum/mind = list(
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/human_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
static_inventory += inv_box

inv_box = new /atom/movable/screen/inventory()
inv_box.name = "storage1"
inv_box.name = "left_pocket"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
Expand All @@ -209,7 +209,7 @@
static_inventory += inv_box

inv_box = new /atom/movable/screen/inventory()
inv_box.name = "storage2"
inv_box.name = "right_pocket"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
Expand Down
3 changes: 2 additions & 1 deletion code/controllers/subsystem/SSafk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ SUBSYSTEM_DEF(afk)
After being AFK for another [GLOB.configuration.afk.auto_despawn_minutes] minutes you will be fully despawned. \
Please eject yourself (right click, eject) out of the cryostorage if you want to avoid being despawned.</span>")
else
message_admins("[key_name_admin(H)] at ([get_area(T).name] [ADMIN_JMP(T)]) is AFK for [mins_afk] and can't be automatically cryod due to it's antag status: ([H.mind.special_role]).")
var/area/our_area = get_area(T)
message_admins("[key_name_admin(H)] at ([our_area.name] [ADMIN_JMP(T)]) is AFK for [mins_afk] and can't be automatically cryod due to it's antag status: ([H.mind.special_role]).")
afk_players[H.ckey] = AFK_ADMINS_WARNED

else if(afk_players[H.ckey] != AFK_ADMINS_WARNED && mins_afk >= GLOB.configuration.afk.auto_despawn_minutes)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/squish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Normal squishes apply vertically, as if the target is being squished from above, but you can set reverse to TRUE if you want to squish them from the sides, like if they pancake into a wall from the East or West
*/
/datum/element/squish
element_flags = ELEMENT_DETACH
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY

/datum/element/squish/Attach(datum/target, duration = 20 SECONDS, reverse = FALSE)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/_element.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if(type == /datum/element)
return ELEMENT_INCOMPATIBLE
SEND_SIGNAL(target, COMSIG_ELEMENT_ATTACH, src)
if(element_flags & ELEMENT_DETACH)
if(element_flags & ELEMENT_DETACH_ON_HOST_DESTROY)
RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(Detach), override = TRUE)

/// Deactivates the functionality defines by the element on the given datum
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/earhealing.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/element/earhealing
element_flags = ELEMENT_DETACH
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY
var/list/user_by_item = list()

/datum/element/earhealing/New()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/rad_insulation.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/element/rad_insulation
element_flags = ELEMENT_DETACH | ELEMENT_BESPOKE
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY | ELEMENT_BESPOKE
id_arg_index = 2
var/amount // Multiplier for radiation strength passing through

Expand Down
Loading

0 comments on commit 7a89a92

Please sign in to comment.