Skip to content

Commit

Permalink
Update missing bitfields for VV (#5369)
Browse files Browse the repository at this point in the history
# About the pull request

This PR simply updates the bitfield defines used to parse bitfield
numbers in the variable viewer as text. The biggest reason for this PR
is to support vis_flags that I frequently need to fiddle with.

This isn't an exhaustive look at all bitfields we may have defined. Feel
free to request any others and I can also add them.

# Explain why it's good for the game

Fixes 

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/a9715efb-40f9-4cf0-ab34-83d56c6272de)
And editing it is simply a number 

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/1049398e-1841-4ad1-9d25-5c319b6e17e3)

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


![image](https://github.com/cmss13-devs/cmss13/assets/76988376/1438c778-7bd3-4b89-9352-0179431e6693)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/43e3d62c-d232-483d-aa99-71e08490d32f)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/6de59999-4754-4d2c-abd5-659425b6dd8e)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/e002e018-f76f-4e6e-9adf-9f878625c246)

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/4a6776df-258a-4cd0-bab1-09843b2d61ac)

</details>


# Changelog
:cl: Drathek
code: Add missing bitfield definitions for variable viewer (VV)
/:cl:
  • Loading branch information
Drulikar authored Jan 6, 2024
1 parent a1f477b commit 55bd564
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 18 deletions.
10 changes: 5 additions & 5 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@

//===========================================================================================
//Marine armor only, use for flags_marine_armor.
#define ARMOR_SQUAD_OVERLAY 1
#define ARMOR_LAMP_OVERLAY 2
#define ARMOR_LAMP_ON 4
#define ARMOR_IS_REINFORCED 8
#define SYNTH_ALLOWED 16
#define ARMOR_SQUAD_OVERLAY (1<<0)
#define ARMOR_LAMP_OVERLAY (1<<1)
#define ARMOR_LAMP_ON (1<<2)
#define ARMOR_IS_REINFORCED (1<<3)
#define SYNTH_ALLOWED (1<<4)
//===========================================================================================

//===========================================================================================
Expand Down
22 changes: 11 additions & 11 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,22 @@
//=================================================

//Species flags.
#define NO_BLOOD (1<<0)
#define NO_BREATHE (1<<1)
#define NO_BLOOD (1<<0)
#define NO_BREATHE (1<<1)
#define NO_CLONE_LOSS (1<<2)
#define NO_SLIP (1<<3)
#define NO_SLIP (1<<3)
#define NO_POISON (1<<4)
#define NO_CHEM_METABOLIZATION (1<<5) //Prevents reagents from acting on_mob_life().
#define NO_CHEM_METABOLIZATION (1<<5) //Prevents reagents from acting on_mob_life().
#define HAS_SKIN_TONE (1<<6)
#define HAS_SKIN_COLOR (1<<7)
#define HAS_LIPS (1<<8)
#define HAS_SKIN_COLOR (1<<7)
#define HAS_LIPS (1<<8)
#define HAS_UNDERWEAR (1<<9)
#define IS_WHITELISTED (1<<10)
#define IS_SYNTHETIC (1<<11)
#define NO_NEURO (1<<12)
#define IS_WHITELISTED (1<<10)
#define IS_SYNTHETIC (1<<11)
#define NO_NEURO (1<<12)
#define SPECIAL_BONEBREAK (1<<13) //species do not get their bonebreak chance modified by endurance
#define NO_SHRAPNEL (1<<14)
#define HAS_HARDCRIT (1<<15)
#define NO_SHRAPNEL (1<<14)
#define HAS_HARDCRIT (1<<15)

//=================================================

Expand Down
128 changes: 126 additions & 2 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ DEFINE_BITFIELD(flags_ammo_behaviour, list(
"AMMO_IGNORE_RESIST" = AMMO_IGNORE_RESIST,
"AMMO_BALLISTIC" = AMMO_BALLISTIC,
"AMMO_IGNORE_COVER" = AMMO_IGNORE_COVER,
"AMMO_ANTIVEHICLE" = AMMO_ANTIVEHICLE,
"AMMO_STOPPED_BY_COVER" = AMMO_STOPPED_BY_COVER,
"AMMO_SPECIAL_EMBED" = AMMO_SPECIAL_EMBED,
"AMMO_STRIKES_SURFACE" = AMMO_STRIKES_SURFACE,
Expand All @@ -97,7 +98,6 @@ DEFINE_BITFIELD(flags_ammo_behaviour, list(
"AMMO_FLAME" = AMMO_FLAME,
))


DEFINE_BITFIELD(projectile_flags, list(
"PROJECTILE_SHRAPNEL" = PROJECTILE_SHRAPNEL,
"PROJECTILE_BULLSEYE" = PROJECTILE_BULLSEYE,
Expand All @@ -120,6 +120,7 @@ DEFINE_BITFIELD(flags_gun_features, list(
"GUN_ANTIQUE" = GUN_ANTIQUE,
"GUN_RECOIL_BUILDUP" = GUN_RECOIL_BUILDUP,
"GUN_SUPPORT_PLATFORM" = GUN_SUPPORT_PLATFORM,
"GUN_NO_DESCRIPTION" = GUN_NO_DESCRIPTION,
))

DEFINE_BITFIELD(flags_magazine, list(
Expand Down Expand Up @@ -150,6 +151,7 @@ DEFINE_BITFIELD(flags_atom, list(
"INITIALIZED" = INITIALIZED,
"ATOM_DECORATED" = ATOM_DECORATED,
"USES_HEARING" = USES_HEARING,
"HTML_USE_INITAL_ICON" = HTML_USE_INITAL_ICON,
))

DEFINE_BITFIELD(flags_item, list(
Expand Down Expand Up @@ -181,7 +183,7 @@ DEFINE_BITFIELD(flags_inv_hide, list(
"HIDETOPHAIR" = HIDETOPHAIR,
"HIDEALLHAIR" = HIDEALLHAIR,
"HIDETAIL" = HIDETAIL,
"HIDEFACE" = HIDEFACE
"HIDEFACE" = HIDEFACE,
))

DEFINE_BITFIELD(flags_inventory, list(
Expand Down Expand Up @@ -420,6 +422,7 @@ DEFINE_BITFIELD(toggleable_flags, list(
"MODE_NO_COMBAT_CAS" = MODE_NO_COMBAT_CAS,
"MODE_LZ_PROTECTION" = MODE_LZ_PROTECTION,
"MODE_SHIPSIDE_SD" = MODE_SHIPSIDE_SD,
"MODE_HARDCORE_PERMA" = MODE_HARDCORE_PERMA,
"MODE_DISPOSABLE_MOBS" = MODE_DISPOSABLE_MOBS,
"MODE_BYPASS_JOE" = MODE_BYPASS_JOE,
))
Expand Down Expand Up @@ -453,7 +456,9 @@ DEFINE_BITFIELD(fire_immunity, list(
"FIRE_IMMUNITY_NO_DAMAGE" = FIRE_IMMUNITY_NO_DAMAGE,
"FIRE_IMMUNITY_NO_IGNITE" = FIRE_IMMUNITY_NO_IGNITE,
"FIRE_IMMUNITY_XENO_FRENZY" = FIRE_IMMUNITY_XENO_FRENZY,
"FIRE_VULNERABILITY" = FIRE_VULNERABILITY,
))

DEFINE_BITFIELD(vend_flags, list(
"VEND_TO_HAND" = VEND_TO_HAND,
"VEND_UNIFORM_RANKS" = VEND_UNIFORM_RANKS,
Expand All @@ -475,3 +480,122 @@ DEFINE_BITFIELD(vehicle_flags, list(
"VEHICLE_CLASS_HEAVY" = VEHICLE_CLASS_HEAVY,
"VEHICLE_BYPASS_BLOCKERS" = VEHICLE_BYPASS_BLOCKERS,
))

DEFINE_BITFIELD(flags_pass, list(
"PASS_THROUGH" = PASS_THROUGH,
"PASS_AROUND" = PASS_AROUND,
"PASS_OVER_THROW_ITEM" = PASS_OVER_THROW_ITEM,
"PASS_OVER_THROW_MOB" = PASS_OVER_THROW_MOB,
"PASS_OVER_FIRE" = PASS_OVER_FIRE,
"PASS_OVER_ACID_SPRAY" = PASS_OVER_ACID_SPRAY,
"PASS_UNDER" = PASS_UNDER,
"PASS_GLASS" = PASS_GLASS,
"PASS_MOB_IS_XENO" = PASS_MOB_IS_XENO,
"PASS_MOB_IS_HUMAN" = PASS_MOB_IS_HUMAN,
"PASS_MOB_IS_OTHER" = PASS_MOB_IS_OTHER,
"PASS_MOB_THRU_XENO" = PASS_MOB_THRU_XENO,
"PASS_MOB_THRU_HUMAN" = PASS_MOB_THRU_HUMAN,
"PASS_MOB_THRU_OTHER" = PASS_MOB_THRU_OTHER,
"PASS_TYPE_CRAWLER" = PASS_TYPE_CRAWLER,
"PASS_HIGH_OVER_ONLY" = PASS_HIGH_OVER_ONLY,
"PASS_BUILDING_ONLY" = PASS_BUILDING_ONLY,
"PASS_CRUSHER_CHARGE" = PASS_CRUSHER_CHARGE,
))

DEFINE_BITFIELD(flags_can_pass_all, list(
"PASS_THROUGH" = PASS_THROUGH,
"PASS_AROUND" = PASS_AROUND,
"PASS_OVER_THROW_ITEM" = PASS_OVER_THROW_ITEM,
"PASS_OVER_THROW_MOB" = PASS_OVER_THROW_MOB,
"PASS_OVER_FIRE" = PASS_OVER_FIRE,
"PASS_OVER_ACID_SPRAY" = PASS_OVER_ACID_SPRAY,
"PASS_UNDER" = PASS_UNDER,
"PASS_GLASS" = PASS_GLASS,
"PASS_MOB_IS_XENO" = PASS_MOB_IS_XENO,
"PASS_MOB_IS_HUMAN" = PASS_MOB_IS_HUMAN,
"PASS_MOB_IS_OTHER" = PASS_MOB_IS_OTHER,
"PASS_MOB_THRU_XENO" = PASS_MOB_THRU_XENO,
"PASS_MOB_THRU_HUMAN" = PASS_MOB_THRU_HUMAN,
"PASS_MOB_THRU_OTHER" = PASS_MOB_THRU_OTHER,
"PASS_TYPE_CRAWLER" = PASS_TYPE_CRAWLER,
"PASS_HIGH_OVER_ONLY" = PASS_HIGH_OVER_ONLY,
"PASS_BUILDING_ONLY" = PASS_BUILDING_ONLY,
"PASS_CRUSHER_CHARGE" = PASS_CRUSHER_CHARGE,
))

DEFINE_BITFIELD(flags_can_pass_front, list(
"PASS_THROUGH" = PASS_THROUGH,
"PASS_AROUND" = PASS_AROUND,
"PASS_OVER_THROW_ITEM" = PASS_OVER_THROW_ITEM,
"PASS_OVER_THROW_MOB" = PASS_OVER_THROW_MOB,
"PASS_OVER_FIRE" = PASS_OVER_FIRE,
"PASS_OVER_ACID_SPRAY" = PASS_OVER_ACID_SPRAY,
"PASS_UNDER" = PASS_UNDER,
"PASS_GLASS" = PASS_GLASS,
"PASS_MOB_IS_XENO" = PASS_MOB_IS_XENO,
"PASS_MOB_IS_HUMAN" = PASS_MOB_IS_HUMAN,
"PASS_MOB_IS_OTHER" = PASS_MOB_IS_OTHER,
"PASS_MOB_THRU_XENO" = PASS_MOB_THRU_XENO,
"PASS_MOB_THRU_HUMAN" = PASS_MOB_THRU_HUMAN,
"PASS_MOB_THRU_OTHER" = PASS_MOB_THRU_OTHER,
"PASS_TYPE_CRAWLER" = PASS_TYPE_CRAWLER,
"PASS_HIGH_OVER_ONLY" = PASS_HIGH_OVER_ONLY,
"PASS_BUILDING_ONLY" = PASS_BUILDING_ONLY,
"PASS_CRUSHER_CHARGE" = PASS_CRUSHER_CHARGE,
))

DEFINE_BITFIELD(flags_can_pass_behind, list(
"PASS_THROUGH" = PASS_THROUGH,
"PASS_AROUND" = PASS_AROUND,
"PASS_OVER_THROW_ITEM" = PASS_OVER_THROW_ITEM,
"PASS_OVER_THROW_MOB" = PASS_OVER_THROW_MOB,
"PASS_OVER_FIRE" = PASS_OVER_FIRE,
"PASS_OVER_ACID_SPRAY" = PASS_OVER_ACID_SPRAY,
"PASS_UNDER" = PASS_UNDER,
"PASS_GLASS" = PASS_GLASS,
"PASS_MOB_IS_XENO" = PASS_MOB_IS_XENO,
"PASS_MOB_IS_HUMAN" = PASS_MOB_IS_HUMAN,
"PASS_MOB_IS_OTHER" = PASS_MOB_IS_OTHER,
"PASS_MOB_THRU_XENO" = PASS_MOB_THRU_XENO,
"PASS_MOB_THRU_HUMAN" = PASS_MOB_THRU_HUMAN,
"PASS_MOB_THRU_OTHER" = PASS_MOB_THRU_OTHER,
"PASS_TYPE_CRAWLER" = PASS_TYPE_CRAWLER,
"PASS_HIGH_OVER_ONLY" = PASS_HIGH_OVER_ONLY,
"PASS_BUILDING_ONLY" = PASS_BUILDING_ONLY,
"PASS_CRUSHER_CHARGE" = PASS_CRUSHER_CHARGE,
))

DEFINE_BITFIELD(sight, list(
"BLIND" = BLIND,
"SEE_BLACKNESS" = SEE_BLACKNESS,
"SEE_INFRA" = SEE_INFRA,
"SEE_MOBS" = SEE_MOBS,
"SEE_OBJS" = SEE_OBJS,
"SEE_PIXELS" = SEE_PIXELS,
"SEE_SELF" = SEE_SELF,
"SEE_THRU" = SEE_THRU,
"SEE_TURFS" = SEE_TURFS,
))

DEFINE_BITFIELD(vision_flags, list(
"BLIND" = BLIND,
"SEE_BLACKNESS" = SEE_BLACKNESS,
"SEE_INFRA" = SEE_INFRA,
"SEE_MOBS" = SEE_MOBS,
"SEE_OBJS" = SEE_OBJS,
"SEE_PIXELS" = SEE_PIXELS,
"SEE_SELF" = SEE_SELF,
"SEE_THRU" = SEE_THRU,
"SEE_TURFS" = SEE_TURFS,
))

DEFINE_BITFIELD(vis_flags, list(
"VIS_HIDE" = VIS_HIDE,
"VIS_INHERIT_DIR" = VIS_INHERIT_DIR,
"VIS_INHERIT_ICON" = VIS_INHERIT_ICON,
"VIS_INHERIT_ICON_STATE" = VIS_INHERIT_ICON_STATE,
"VIS_INHERIT_ID" = VIS_INHERIT_ID,
"VIS_INHERIT_LAYER" = VIS_INHERIT_LAYER,
"VIS_INHERIT_PLANE" = VIS_INHERIT_PLANE,
"VIS_UNDERLAY" = VIS_UNDERLAY,
))

0 comments on commit 55bd564

Please sign in to comment.