From 4c1249076f19fe51ebb596af98c1417e2f7138ef Mon Sep 17 00:00:00 2001 From: Vladisvell Date: Tue, 19 Nov 2024 18:26:10 +0500 Subject: [PATCH] add: Abstract item stacking. Client lag removal edition --- code/game/objects/items/weapons/storage/stacked.dm | 12 ++++++++++++ paradise.dme | 1 + 2 files changed, 13 insertions(+) create mode 100644 code/game/objects/items/weapons/storage/stacked.dm diff --git a/code/game/objects/items/weapons/storage/stacked.dm b/code/game/objects/items/weapons/storage/stacked.dm new file mode 100644 index 00000000000..31f413cd249 --- /dev/null +++ b/code/game/objects/items/weapons/storage/stacked.dm @@ -0,0 +1,12 @@ +/** + * This code contains abstract stacked item. Main goal of this is to make items dropping from storages, smartfridges, etc. not lag the clients out. + * It is, as simple is possible, tries to implement stacked items behavior like in storages. + * Main features: + * - Items appear stacked when dropped from smartfridge on destruction or when amount taken at one time is too high + * - Same rule applies to bags or storages with display_contents_with_number and allow_quick_empty properties enabled + * - Can't be taken by hand. Instead, player takes one sample from entire stack. + * - Same rule applies to pulling. Player pulls only one sample from entire stack. + * - Player can walk over stack. + * - Integrity of stack is determenied by summary of stacked items. + * - One by one items are deleted from stack if stack is damaged by integrity of one stack item. + */ diff --git a/paradise.dme b/paradise.dme index 30b22704ec1..7dd4c686eed 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1353,6 +1353,7 @@ #include "code\game\objects\items\weapons\storage\internal.dm" #include "code\game\objects\items\weapons\storage\lockbox.dm" #include "code\game\objects\items\weapons\storage\secure.dm" +#include "code\game\objects\items\weapons\storage\stacked.dm" #include "code\game\objects\items\weapons\storage\storage.dm" #include "code\game\objects\items\weapons\storage\toolbox.dm" #include "code\game\objects\items\weapons\storage\uplink_kits.dm"