Skip to content

Commit

Permalink
Merge branch 'properties' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
elunna committed Sep 27, 2023
2 parents 43d354c + 4531d86 commit 1dcc681
Show file tree
Hide file tree
Showing 36 changed files with 2,175 additions and 1,182 deletions.
4 changes: 4 additions & 0 deletions include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ E const char *FDECL(artiname, (int));
E short FDECL(artifact_material, (int));
E struct obj *FDECL(mk_particular_artifact, (int));
E struct obj *FDECL(mk_artifact, (struct obj *, ALIGNTYP_P));
E struct obj *FDECL(create_oprop, (struct obj *, BOOLEAN_P));
E const char *FDECL(artifact_name, (const char *, short *));
E boolean FDECL(exist_artifact, (int, const char *));
E void FDECL(artifact_exists, (struct obj *, const char *, BOOLEAN_P));
Expand Down Expand Up @@ -331,6 +332,7 @@ E int FDECL(food_detect, (struct obj *));
E int FDECL(artifact_detect, (struct obj *));
E int FDECL(object_detect, (struct obj *, int));
E int FDECL(monster_detect, (struct obj *, int));
E int FDECL(magic_detect, (struct obj *));
E int FDECL(trap_detect, (struct obj *, BOOLEAN_P detect_portals));
E const char *FDECL(level_distance, (d_level *));
E void FDECL(use_crystal_ball, (struct obj **));
Expand Down Expand Up @@ -539,6 +541,8 @@ E int NDECL(take_off);
E const char *FDECL(fingers_or_gloves, (BOOLEAN_P));
E void FDECL(off_msg, (struct obj *));
E void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P));
E void FDECL(oprops_on, (struct obj *, long));
E void FDECL(oprops_off, (struct obj *, long));
E void FDECL(set_wear, (struct obj *));
E boolean FDECL(donning, (struct obj *));
E boolean FDECL(doffing, (struct obj *));
Expand Down
24 changes: 24 additions & 0 deletions include/obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ struct obj {
char invlet; /* designation in inventory */
char oartifact; /* artifact array index */
schar altmode; /* alternate modes - eg. SMG, double Lightsaber */

long oprops; /* item properties */
long oprops_known; /* known item properties */

xchar where; /* where the object thinks it is */
#define OBJ_FREE 0 /* object not attached to anything */
Expand Down Expand Up @@ -575,6 +578,27 @@ struct obj {
#define POTHIT_MONST_THROW 2 /* thrown by a monster */
#define POTHIT_OTHER_THROW 3 /* propelled by some other means [scatter()] */

/* object properties */
#define ITEM_FIRE 0x00000001L /* fire damage or resistance */
#define ITEM_FROST 0x00000002L /* frost damage or resistance */
#define ITEM_SHOCK 0x00000004L /* shock damage or resistance */
#define ITEM_VENOM 0x00000008L /* poison damage or resistance */
#define ITEM_ACID 0x00000010L /* acid damage or resistance */
#define ITEM_SCREAM 0x00000020L /* sonic damage or resistance */
#define ITEM_DRLI 0x00000040L /* drains life or resists it */
#define ITEM_OILSKIN 0x00000080L /* permanently greased */
#define ITEM_ESP 0x00000100L /* extrinsic telepathy */
#define ITEM_SEARCHING 0x00000200L /* extrinsic searching */
#define ITEM_WARNING 0x00000400L /* extrinsic warning */
#define ITEM_EXCEL 0x00000800L /* confers luck, charisma boost */
#define ITEM_FUMBLING 0x00001000L /* extrinsic fumbling */
#define ITEM_HUNGER 0x00002000L /* extrinsic hunger */

#define ITEM_MAGICAL 0x80000000L /* known to have magical properties */

#define ITEM_PROP_MASK 0x00003FFFL /* all current properties */
#define MAX_ITEM_PROPS 14

/*
* Notes for adding new oextra structures:
*
Expand Down
57 changes: 28 additions & 29 deletions include/objclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,35 +232,34 @@ enum obj_class_types {
? SHK_MATCH \
: SHK_NOMATCH))
/* Menu keys */
#define SHK_ID_BASIC 0x00000001L /* i */
#define SHK_ID_PREMIUM 0x00000002L /* I */
#define SHK_ID_WEAPON 0x00000004L /* ) */
#define SHK_ID_ARMOR 0x00000008L /* [ */

#define SHK_ID_SCROLL 0x00000010L /* ? */
#define SHK_ID_BOOK 0x00000020L /* + */
#define SHK_ID_POTION 0x00000040L /* ! */
#define SHK_ID_RING 0x00000080L /* = */

#define SHK_ID_AMULET 0x00000100L /* " */
#define SHK_ID_WAND 0x00000200L /* / */
#define SHK_ID_TOOL 0x00000400L /* ( */
#define SHK_ID_GEM 0x00000800L /* * */

#define SHK_ID_FOOD 0x00001000L /* % */
#define SHK_UNCURSE 0x00002000L /* u */
#define SHK_WEP_FIX 0x00004000L /* f */
#define SHK_WEP_ENC 0x00008000L /* e */

#define SHK_WEP_POI 0x00010000L /* p */
#define SHK_ARM_FIX 0x00020000L /* f */
#define SHK_ARM_ENC 0x00040000L /* e */
#define SHK_CHG_BAS 0x00080000L /* c */

#define SHK_CHG_PRE 0x00100000L /* C */
#define SHK_RUMOR 0x00200000L /* r */
#define SHK_FIREARMS 0x00400000L /* t */
#define SHK_TINKER 0x00800000L /* T */
#define SHK_ID_WEAPON 0x00000001L /* ) */
#define SHK_ID_ARMOR 0x00000002L /* [ */
#define SHK_ID_SCROLL 0x00000004L /* ? */
#define SHK_ID_BOOK 0x00000008L /* + */

#define SHK_ID_POTION 0x00000010L /* ! */
#define SHK_ID_RING 0x00000020L /* = */
#define SHK_ID_AMULET 0x00000040L /* " */
#define SHK_ID_WAND 0x00000080L /* / */

#define SHK_ID_TOOL 0x00000100L /* ( */
#define SHK_ID_GEM 0x00000200L /* * */
#define SHK_ID_FOOD 0x00000400L /* % */
#define SHK_UNCURSE 0x00000800L /* u */

#define SHK_WEP_FIX 0x00001000L /* f */
#define SHK_WEP_ENC 0x00002000L /* e */
#define SHK_WEP_POI 0x00004000L /* p */
#define SHK_ARM_FIX 0x00008000L /* f */

#define SHK_ARM_ENC 0x00010000L /* e */
#define SHK_CHG_BAS 0x00020000L /* c */
#define SHK_CHG_PRE 0x00040000L /* C */
#define SHK_RUMOR 0x00080000L /* r */

#define SHK_FIREARMS 0x00100000L /* t */
#define SHK_TINKER 0x00200000L /* T */
#define SHK_PROP 0x00400000L /* P */

typedef struct {
int svc_type;
Expand Down
Loading

0 comments on commit 1dcc681

Please sign in to comment.