--- deliantra/server/include/define.h 2010/01/03 02:47:14 1.112 +++ deliantra/server/include/define.h 2010/04/06 21:11:48 1.124 @@ -1,9 +1,9 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) 2003-2005,2007 Mark Wedel & Crossfire Development Team - * Copyright (©) 1992,2007 Frank Tore Johansen + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2003-2005 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992 Frank Tore Johansen * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -51,6 +51,8 @@ #define MAX_STAT 30 /* The maximum legal value of any stat */ #define MIN_STAT 1 /* The minimum legal value of any stat */ +#define MAX_FOOD 999 + //TODO: not only use more reasonable values, also enforce them #define MIN_WC -120 #define MAX_WC 120 @@ -67,12 +69,6 @@ #define ATTUNE_REPELL 16 // levels diff for attune/repell -//TODO: remove all calls to fatal and replace them by cleanup -#define OUT_OF_MEMORY 0 -#define MAP_ERROR 1 -#define ARCHTABLE_TOO_SMALL 2 // unused -#define TOO_MANY_ERRORS 3 - /* TYPE DEFINES */ /* Only add new values to this list if somewhere in the program code, @@ -100,8 +96,8 @@ #define POISON 7 #define BOOK 8 #define CLOCK 9 -//10 -//11 +#define VEIN 10 // deliantra: mineral/ore/whatever vein +#define RANGED 11 // deliantra: other range item (skill based) //12 #define ARROW 13 #define BOW 14 @@ -181,7 +177,7 @@ #define SHOP_FLOOR 68 #define SHOP_MAT 69 #define RING 70 -#define FLOOR 71 /* this is a floor tile -> native layer 0 */ +//#define FLOOR 71 /* this is a floor tile -> native layer 0 */ // UNUSED??? #define FLESH 72 /* animal 'body parts' -b.t. */ #define INORGANIC 73 /* metals and minerals */ #define SKILL_TOOL 74 /* Allows the use of a skill */ @@ -286,6 +282,35 @@ /* END TYPE DEFINE */ +typedef std::bitset typeset; + +/* These are the items that currently can change digestion, regeneration, + * spell point recovery and mana point recovery. Seems sort of an arbitary + * list, but other items store other info into stats array. + * As a special exception, bows use stats.sp for their own purposes. + */ +static const struct digest_types : typeset +{ + digest_types () + { + set (WEAPON); + set (BOW); + set (ARMOUR); + set (HELMET); + set (SHIELD); + set (RING); + set (BOOTS); + set (GLOVES); + set (AMULET); + set (GIRDLE); + set (BRACERS); + set (CLOAK); + set (DISEASE); + set (FORCE); + set (SKILL); + } +} digest_types; + // maximum supported subtype number + 1, can be increased to 256 // currently (2007-09) in use: 50 #define NUM_SUBTYPES 64 @@ -403,8 +428,7 @@ #define FLAG_USE_SHIELD 7 /* Can this creature use a shield? */ #define FLAG_NO_PICK 8 /* Object can't be picked up */ - -/*#define FLAG_WALK_ON 9*//* Applied when it's walked upon */ +/*#define FLAG_WALK_ON 9*/ /*#define FLAG_NO_PASS 10*//* Nothing can pass (wall() is true) */ #define FLAG_ANIMATE 11 /* The object looks at archetype for faces */ @@ -592,8 +616,8 @@ * practical reason to exceed this */ #define LOS_MAX 4 /* max. los value for non-blocked spaces */ #define LOS_BLOCKED 100 /* fully blocked spaces */ -#define BRIGHTNESS(xyz) (xyz)->glow_radius>MAX_LIGHT_RADII? \ - MAX_LIGHT_RADII:(xyz)->glow_radius; +#define BRIGHTNESS(xyz) (xyz)->glow_radius>MAX_LIGHT_RADII ? \ + MAX_LIGHT_RADII : (xyz)->glow_radius; // player position in blocked_los code #define LOS_X0 (MAP_CLIENT_X / 2 - 1) #define LOS_Y0 (MAP_CLIENT_Y / 2 - 1) @@ -700,17 +724,16 @@ enum apply_flag { /* Basic flags/mode, always use one of these */ - AP_TOGGLE = 0, - AP_APPLY = 1, - AP_UNAPPLY = 2, - - AP_BASIC_FLAGS = 0x0f, + AP_TOGGLE = 0, + AP_APPLY = 0x01, + AP_UNAPPLY = 0x02, + AP_MODE = 0x03, /* Optional flags, for bitwise or with a basic flag */ AP_NO_MERGE = 0x10, AP_IGNORE_CURSE = 0x20, - AP_PRINT = 0x40, /* Print what to do, don't actually do it */ - AP_NO_READY = 0x80, // do not ready skill associated with skilltool. + AP_PRINT = 0x40, /* Print what to do, don't actually do it */ + AP_NO_SLOT = 0x80, // do not update the combat/ranged/current slots }; /* Bitmask values for 'can_apply_object()' return values. @@ -739,9 +762,10 @@ * could remove. * */ -#define CAN_APPLY_NEVER 0x1 -#define CAN_APPLY_RESTRICTION 0x2 -#define CAN_APPLY_NOT_MASK 0xf +#define CAN_APPLY_NEVER 0x01 +#define CAN_APPLY_RESTRICTION 0x02 +#define CAN_APPLY_NOT_MASK 0x0f + #define CAN_APPLY_UNAPPLY 0x10 #define CAN_APPLY_UNAPPLY_MULT 0x20 #define CAN_APPLY_UNAPPLY_CHOICE 0x40