mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-14 20:02:43 +00:00
32 lines
841 B
Plaintext
32 lines
841 B
Plaintext
#define DEFAULT_SLOT_AMT 2
|
|
#define HANDS_SLOT_AMT 2
|
|
#define BACKPACK_SLOT_AMT 4
|
|
|
|
/datum/preferences
|
|
var/gear_points = 10
|
|
var/list/gear_categories
|
|
var/list/chosen_gear
|
|
var/gear_tab
|
|
|
|
/datum/preferences/New(client/C)
|
|
..()
|
|
LAZYINITLIST(chosen_gear)
|
|
|
|
/datum/preferences/proc/is_loadout_slot_available(slot)
|
|
var/list/L
|
|
LAZYINITLIST(L)
|
|
for(var/i in chosen_gear)
|
|
var/datum/gear/G = i
|
|
var/occupied_slots = L[slot_to_string(initial(G.category))] ? L[slot_to_string(initial(G.category))] + 1 : 1
|
|
LAZYSET(L, slot_to_string(initial(G.category)), occupied_slots)
|
|
switch(slot)
|
|
if(slot_in_backpack)
|
|
if(L[slot_to_string(slot_in_backpack)] < BACKPACK_SLOT_AMT)
|
|
return TRUE
|
|
if(slot_hands)
|
|
if(L[slot_to_string(slot_hands)] < HANDS_SLOT_AMT)
|
|
return TRUE
|
|
else
|
|
if(L[slot_to_string(slot)] < DEFAULT_SLOT_AMT)
|
|
return TRUE
|