Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
[MIRROR] Non-bitflag slot defines removal (#710)
Browse files Browse the repository at this point in the history
* Non-bitflag slot defines removal (#3300)

* INITIAL

* Correct bm.dm

* PROBE AND REPLACE

* correct am.dm

* l

* Revert "hrm"

This reverts commit 682c45ad7a84248ccd9205d4ce0379f5ac7fdb94.

* fix mistake in update_icons i forgot to commit and push

* PARTE23

* I used webedit. I am a terrible human being. Now it will compile again.

* Update code/modules/mob/living/carbon/update_icons.dm

Co-authored-by: Xenomedes <park246824@ gmail.com>

* Update code/modules/mob/living/carbon/update_icons.dm

Co-authored-by: Xenomedes <park246824@ gmail.com>

* Update code/modules/mob/living/carbon/update_icons.dm

Co-authored-by: Xenomedes <park246824@ gmail.com>

* Update code/modules/mob/living/carbon/update_icons.dm

Co-authored-by: Xenomedes <park246824@ gmail.com>

* do the thing

* Update squidpeople.dm

* first

* ok the computer isn't going to help me

* c

Co-authored-by: Xenomedes <park246824@ gmail.com>
Co-authored-by: Sinestia <lul>

* Non-bitflag slot defines removal

* Update loadout_donator.dm

wtf

Co-authored-by: Sinestia <40812746+Sinestia@users.noreply.github.com>
Co-authored-by: Xenomedes <park246824@ gmail.com>
Co-authored-by: jackpie <55637464+jack-pie@users.noreply.github.com>
  • Loading branch information
4 people committed Mar 27, 2021
1 parent 846eef3 commit f587944
Show file tree
Hide file tree
Showing 190 changed files with 663 additions and 714 deletions.
82 changes: 14 additions & 68 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,74 +25,20 @@
#define ITEM_SLOT_ID (1<<8)
#define ITEM_SLOT_BELT (1<<9)
#define ITEM_SLOT_BACK (1<<10)
#define ITEM_SLOT_POCKET (1<<11) //! this is to allow items with a w_class of WEIGHT_CLASS_NORMAL or WEIGHT_CLASS_BULKY to fit in pockets.
#define ITEM_SLOT_DENYPOCKET (1<<12) //! this is to deny items with a w_class of WEIGHT_CLASS_SMALL or WEIGHT_CLASS_TINY to fit in pockets.
#define ITEM_SLOT_NECK (1<<13)
#define ITEM_SLOT_HANDS (1<<14)
#define ITEM_SLOT_BACKPACK (1<<15)
#define ITEM_SLOT_SUITSTORE (1<<16)

//! ## SLOTS
#define SLOT_BACK 1
#define SLOT_WEAR_MASK 2
#define SLOT_HANDCUFFED 3
#define SLOT_HANDS 4 //! wherever you provide a slot for hands you provide SLOT_HANDS. SLOT_HANDS as a slot will pick ANY available hand
#define SLOT_BELT 5
#define SLOT_WEAR_ID 6
#define SLOT_EARS 7
#define SLOT_GLASSES 8
#define SLOT_GLOVES 9
#define SLOT_NECK 10
#define SLOT_HEAD 11
#define SLOT_SHOES 12
#define SLOT_WEAR_SUIT 13
#define SLOT_W_UNIFORM 14
#define SLOT_L_STORE 15
#define SLOT_R_STORE 16
#define SLOT_S_STORE 17
#define SLOT_IN_BACKPACK 18
#define SLOT_LEGCUFFED 19
#define SLOT_GENERC_DEXTROUS_STORAGE 20

#define SLOTS_AMT 20 //! Keep this up to date!

//I hate that this has to exist
/proc/slotdefine2slotbit(slotdefine) //Keep this up to date with the value of SLOT BITMASKS and SLOTS (the two define sections above)
. = 0
switch(slotdefine)
if(SLOT_BACK)
. = ITEM_SLOT_BACK
if(SLOT_WEAR_MASK)
. = ITEM_SLOT_MASK
if(SLOT_NECK)
. = ITEM_SLOT_NECK
if(SLOT_BELT)
. = ITEM_SLOT_BELT
if(SLOT_WEAR_ID)
. = ITEM_SLOT_ID
if(SLOT_EARS)
. = ITEM_SLOT_EARS
if(SLOT_GLASSES)
. = ITEM_SLOT_EYES
if(SLOT_GLOVES)
. = ITEM_SLOT_GLOVES
if(SLOT_HEAD)
. = ITEM_SLOT_HEAD
if(SLOT_SHOES)
. = ITEM_SLOT_FEET
if(SLOT_WEAR_SUIT)
. = ITEM_SLOT_OCLOTHING
if(SLOT_W_UNIFORM)
. = ITEM_SLOT_ICLOTHING
if(SLOT_L_STORE, SLOT_R_STORE)
. = ITEM_SLOT_POCKET
if(SLOT_HANDS)
. = ITEM_SLOT_HANDS
if(SLOT_S_STORE)
. = ITEM_SLOT_SUITSTORE
if(SLOT_IN_BACKPACK)
. = ITEM_SLOT_BACKPACK

#define ITEM_SLOT_DEX_STORAGE (1<<11)
#define ITEM_SLOT_NECK (1<<12)
#define ITEM_SLOT_HANDS (1<<13)
#define ITEM_SLOT_BACKPACK (1<<14)
#define ITEM_SLOT_SUITSTORE (1<<15)
#define ITEM_SLOT_LPOCKET (1<<16)
#define ITEM_SLOT_RPOCKET (1<<17)
#define ITEM_SLOT_HANDCUFFED (1<<18)
#define ITEM_SLOT_LEGCUFFED (1<<19)

#define SLOTS_AMT 20 // Keep this up to date!

//SLOT GROUP HELPERS
#define ITEM_SLOT_POCKETS (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET)

//Bit flags for the flags_inv variable, which determine when a piece of clothing hides another. IE a helmet hiding glasses.
//Make sure to update check_obscured_slots() if you add more.
Expand Down
6 changes: 5 additions & 1 deletion code/__DEFINES/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@

#define TORADIANS(degrees) ((degrees) * 0.0174532925)

/// Will filter out extra rotations and negative rotations E.g: 540 becomes 180. -180 becomes 180.
/// Gets shift x that would be required the bitflag (1<<x)
#define TOBITSHIFT(bit) ( log(2, bit) )

// Will filter out extra rotations and negative rotations
// E.g: 540 becomes 180. -180 becomes 180.
#define SIMPLIFY_DEGREES(degrees) (MODULUS((degrees), 360))

#define GET_ANGLE_OF_INCIDENCE(face, input) (MODULUS((face) - (input), 360))
Expand Down
18 changes: 9 additions & 9 deletions code/__HELPERS/pronouns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,62 +203,62 @@
/mob/living/carbon/human/p_they(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_their(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_them(capitalized, temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_have(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_are(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_were(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_do(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_s(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_es(temp_gender)
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_W_UNIFORM in obscured) && skipface)
if((ITEM_SLOT_ICLOTHING in obscured) && skipface)
temp_gender = PLURAL
return ..()
14 changes: 7 additions & 7 deletions code/__HELPERS/type2type.dm
Original file line number Diff line number Diff line change
Expand Up @@ -341,25 +341,25 @@
/// Returns the body_zone a given slot appears on
/proc/slot2body_zone(slot)
switch(slot)
if(SLOT_BACK, SLOT_WEAR_SUIT, SLOT_W_UNIFORM, SLOT_BELT, SLOT_WEAR_ID)
if(ITEM_SLOT_BACK, ITEM_SLOT_OCLOTHING, ITEM_SLOT_ICLOTHING, ITEM_SLOT_BELT, ITEM_SLOT_ID)
return BODY_ZONE_CHEST

if(SLOT_GLOVES, SLOT_HANDS, SLOT_HANDCUFFED)
if(ITEM_SLOT_GLOVES, ITEM_SLOT_HANDS, ITEM_SLOT_HANDCUFFED)
return pick(BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND)

if(SLOT_HEAD, SLOT_NECK, SLOT_NECK, SLOT_EARS)
if(ITEM_SLOT_HEAD, ITEM_SLOT_NECK, ITEM_SLOT_NECK, ITEM_SLOT_EARS)
return BODY_ZONE_HEAD

if(SLOT_WEAR_MASK)
if(ITEM_SLOT_MASK)
return BODY_ZONE_PRECISE_MOUTH

if(SLOT_GLASSES)
if(ITEM_SLOT_EYES)
return BODY_ZONE_PRECISE_EYES

if(SLOT_SHOES)
if(ITEM_SLOT_FEET)
return pick(BODY_ZONE_PRECISE_R_FOOT, BODY_ZONE_PRECISE_L_FOOT)

if(SLOT_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
return pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)

/// adapted from http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()

/datum/hud/alien/persistent_inventory_update()
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/hud/drones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
inv_box.icon_state = "suit_storage"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_storage
inv_box.slot_id = SLOT_GENERC_DEXTROUS_STORAGE
inv_box.slot_id = ITEM_SLOT_DEX_STORAGE
inv_box.hud = src
static_inventory += inv_box

Expand All @@ -18,14 +18,14 @@
inv_box.icon_state = "mask"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_head
inv_box.slot_id = SLOT_HEAD
inv_box.slot_id = ITEM_SLOT_HEAD
inv_box.hud = src
static_inventory += inv_box

for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()


Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/generic_dextrous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()

/datum/hud/dextrous/persistent_inventory_update()
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/guardian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
inv_box.screen_loc = ui_id
inv_box.slot_id = SLOT_GENERC_DEXTROUS_STORAGE
inv_box.slot_id = ITEM_SLOT_DEX_STORAGE
inv_box.hud = src
static_inventory += inv_box
Expand Down
Loading

0 comments on commit f587944

Please sign in to comment.