 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
57 {
"body_range",
"in your range slot",
"in a human's range slot" },
58 {
"body_arm",
"on your arm",
"on a human's arm" },
59 {
"body_torso",
"on your body",
"on a human's torso" },
60 {
"body_head",
"on your head",
"on a human's head" },
61 {
"body_neck",
"around your neck",
"around a human's neck" },
62 {
"body_skill",
"in your skill slot",
"in a human's skill slot" },
63 {
"body_finger",
"on your finger",
"on a human's finger" },
64 {
"body_shoulder",
"around your shoulders",
"around a human's shoulders" },
65 {
"body_foot",
"on your feet",
"on a human's feet" },
66 {
"body_hand",
"on your hands",
"on a human's hands" },
67 {
"body_wrist",
"around your wrists",
"around a human's wrist" },
68 {
"body_waist",
"around your waist",
"around a human's waist" },
69 {
"body_leg",
"around your legs",
"around a human's legs" },
81 { 0,
"none",
"none", 0, 0 },
82 {
PLAYER,
"player",
"players", 0, 0 },
83 {
TRANSPORT,
"transport",
"transports", 0, 0 },
85 {
TREASURE,
"treasure",
"treasure", 0, 0 },
90 {
CLOCK,
"clock",
"clocks", 0, 0 },
95 {
PEDESTAL,
"pedestal",
"pedestals", 0, 0 },
96 {
ALTAR,
"altar",
"altars", 0, 0 },
97 {
LOCKED_DOOR,
"locked door",
"locked doors", 0, 0 },
98 {
SPECIAL_KEY,
"special key",
"special keys", 0, 0 },
99 {
MAP,
"map",
"maps", 0, 0 },
100 {
DOOR,
"door",
"doors", 0, 0 },
101 {
KEY,
"key",
"keys", 0, 0 },
102 {
TIMED_GATE,
"timed_gate",
"timed_gates", 0, 0 },
103 {
TRIGGER,
"trigger",
"triggers", 0, 0 },
104 {
GRIMREAPER,
"grimreaper",
"grimreapers", 0, 0 },
105 {
MAGIC_EAR,
"magic ear",
"magic ears", 0, 0 },
111 {
MONEY,
"money",
"money", 0, 0 },
112 {
CLASS,
"class",
"classes", 0, 0 },
114 {
PLAYERMOVER,
"player mover",
"player movers", 0, 0 },
115 {
TELEPORTER,
"teleporter",
"teleporters", 0, 0 },
116 {
CREATOR,
"creator",
"creators", 0, 0 },
117 {
SKILL,
"skill",
"skills", 0, 0 },
118 {
EARTHWALL,
"earthwall",
"earthwalls", 0, 0 },
119 {
GOLEM,
"golem",
"golems", 0, 0 },
120 {
THROWN_OBJ,
"projectile",
"projectiles", 0, 0 },
121 {
BLINDNESS,
"blindness",
"blindness", 0, 0 },
122 {
GOD,
"god",
"gods", 0, 0 },
123 {
DETECTOR,
"detector",
"detectors", 0, 0 },
125 {
DEAD_OBJECT,
"dead object",
"dead objects", 0, 0 },
127 {
MARKER,
"marker",
"markers", 0, 0 },
128 {
HOLY_ALTAR,
"holy altar",
"holy altars", 0, 0 },
130 {
BATTLEGROUND,
"battleground",
"battlegrounds", 0, 0 },
131 {
PEACEMAKER,
"peacemaker",
"peacemakers", 0, 0 },
133 {
FIREWALL,
"firewall",
"firewalls", 0, 0 },
134 {
CHECK_INV,
"inventory checker",
"inventory checkers", 0, 0 },
135 {
MOOD_FLOOR,
"mood floor",
"mood floors", 0, 0 },
136 {
EXIT,
"exit",
"exits", 0, 0 },
137 {
ENCOUNTER,
"encounter",
"encounters", 0, 0 },
138 {
SHOP_FLOOR,
"shop floor",
"shop floors", 0, 0 },
139 {
SHOP_MAT,
"shop mat",
"shop mats", 0, 0 },
141 {
FLOOR,
"floor",
"floors", 0, 0 },
144 {
SKILL_TOOL,
"skill tool",
"skill tools", 0, 0 },
145 {
LIGHTER,
"lighter",
"lighters", 0, 0 },
146 {
WALL,
"wall",
"walls", 0, 0 },
147 {
MISC_OBJECT,
"bric-a-brac",
"bric-a-brac", 0, 0 },
148 {
MONSTER,
"monster",
"monsters", 0, 0 },
149 {
LAMP,
"lamp",
"lamps", 0, 0 },
150 {
DUPLICATOR,
"duplicator",
"duplicators", 0, 0 },
153 {
SPINNER,
"spinner",
"spinners", 0, 0 },
154 {
GATE,
"gate",
"gates", 0, 0 },
155 {
BUTTON,
"button",
"buttons", 0, 0 },
156 {
CF_HANDLE,
"cf handle",
"cf handles", 0, 0 },
157 {
HOLE,
"hole",
"holes", 0, 0 },
158 {
TRAPDOOR,
"trapdoor",
"trapdoors", 0, 0 },
159 {
SIGN,
"sign",
"signs", 0, 0 },
162 {
SPELL,
"spell",
"spells", 0, 0 },
163 {
SPELL_EFFECT,
"spell effect",
"spell effects", 0, 0 },
164 {
CONVERTER,
"converter",
"converters", 0, 0 },
166 {
POISONING,
"poisoning",
"poisonings", 0, 0 },
167 {
SAVEBED,
"savebed",
"savebeds", 0, 0 },
170 {
DIRECTOR,
"director",
"directors", 0, 0 },
172 {
FORCE,
"force",
"forces", 0, 0 },
179 {
DEEP_SWAMP,
"deep swamp",
"deep swamps", 0, 0 },
182 {
RUNE,
"rune",
"runes", 0, 0 },
183 {
TRAP,
"trap",
"traps", 0, 0 },
185 {
CORPSE,
"corpse",
"corpses", 0, 0 },
186 {
DISEASE,
"disease",
"diseases", 0, 0 },
187 {
SYMPTOM,
"symptom",
"symptoms", 0, 0 },
188 {
BUILDER,
"item builder",
"item builders", 0, 0 },
189 {
MATERIAL,
"building material",
"building materials", 0, 0 },
191 {
LIGHTABLE,
"lightable",
"lightables", 0, 0 },
222 std::bitset<32> xs = x;
385 if (use_media_tags) {
389 if (op->
resist[tmpvar] == 100 || op->
resist[tmpvar] == -100) {
397 if (use_media_tags) {
398 if (op->
resist[tmpvar] == 100 || op->
resist[tmpvar] == -100) {
424 snprintf(
buf, size,
" ");
426 snprintf(
buf, size,
"%6.1f", i/1000.0);
428 snprintf(
buf, size,
"%4d ", i/1000);
457 for (attr = 0; attr <
NUM_STATS; attr++) {
521 if (op->
name == NULL) {
522 snprintf(
buf, size,
"(null)");
553 snprintf(
buf+len, size-len,
" (lvl %d)", op->
level);
554 len += strlen(
buf+len);
578 snprintf(
buf+len, size-len,
" %+d", op->
magic);
579 len += strlen(
buf+len);
698 if ((!plural && !op->
name)
700 strncpy(
buf,
"(null)", size);
738 snprintf(
buf+len, size-len,
" (lvl %d)", op->
level);
739 len += strlen(
buf+len);
864 if (
t->item && (
t->item->clone.type ==
SPELL)) {
1047 for (attr = 0; attr <
NUM_STATS; attr++) {
1247 if (op->
title != NULL)
1460 }
else if (op->
arch) {
1481 }
else if (op->
env) {
1512 const int number =
NROF(obj);
1514 uint64_t val = (uint64_t)obj->
value * number;
1519 float ratio = atof(key);
1535 if (!identified && obj->
arch) {
1554 if (obj->
arch != NULL && identified) {
1556 val *= pow(1.15, diff);
int16_t gen_sp
Bonuses to regeneration speed of sp.
@ CLASS
Object for applying character class modifications to someone.
sstring name_pl
The plural name of the object.
#define FLAG_USE_BOW
(Monster) can apply and fire bows
#define UP_OBJ_FACE
Only thing that changed was the face.
size_t stringbuffer_length(StringBuffer *sb)
Return the current length of the buffer.
#define NUM_BODY_LOCATIONS
Number of body locations.
@ MONSTER
A real, living creature.
#define GET_MAP_TOP(M, X, Y)
Gets the top object on a map.
@ CLOSE_CON
Eneq((at)csd.uu.se): Id for close_container archetype.
#define FABS(x)
Decstations have trouble with fabs()...
#define FLAG_CLIENT_ANIM_RANDOM
Client animate this, randomized.
uint32_t path_attuned
Paths the object is attuned to.
#define FLAG_USE_RING
(Monster) can use rings, boots, gauntlets, etc
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define FLAG_UNDEAD
Monster is undead.
@ FLESH
animal 'body parts' -b.t.
int16_t digestion
Any bonuses/penalties to digestion.
object * inv
Pointer to the first object in the inventory.
int16_t gen_grace
Bonuses to regeneration speed of grace.
void safe_strcat(char *dest, const char *orig, size_t *curlen, size_t maxlen)
Simple function we use below to keep adding to the same string but also make sure we don't overwrite ...
#define QUERY_FLAG(xyz, p)
#define FLAG_REFL_MISSILE
Arrows will reflect from object.
treasure * items
Items in this list, linked.
#define FLAG_IS_TURNABLE
Object can change face with direction.
object * object_merge(object *op, object *top)
This function goes through all objects below and including top, and merges op to the first matching o...
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Append a formatted string to a string buffer instance.
#define FLAG_SEE_IN_DARK
if set ob not effected by darkness
int8_t item_power
Power rating of the object.
struct archetype * arch
Pointer to archetype.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
static int bits_set(uint32_t x)
float speed
Frequency of object 'moves' relative to server tick rate.
struct mapstruct * map
Pointer to the map in which this object is present.
int identifyskill
Skill used to identify this object class.
#define FLAG_SEE_INVISIBLE
Will see invisible player.
@ SKILL
Also see SKILL_TOOL (74) below.
int get_power_from_ench(int ench)
#define ARMOUR_SPELLS(xyz)
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
#define FLAG_BLESSED
Item has a blessing, opposite of cursed/damned.
@ TRANSPORT
see doc/Developers/objects
@ POTION_RESIST_EFFECT
A force, holding the effect of a resistance potion.
@ FLOOR
Floor tile -> native layer 0.
#define ARMOUR_SPEED(xyz)
sstring title
Of foo, etc.
#define FLAG_INV_LOCKED
Item will not be dropped from inventory.
#define FLAG_APPLIED
Object is ready for use by living.
int16_t level
Level of creature or object.
#define FLAG_STEALTH
Will wake monsters with less range.
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
static const typedata item_types[]
The following is a large table of item types, the fields are: item number, item name,...
Plugin animator file specs[Config] name
#define FLAG_ALIVE
Object can fight (or be fought)
uint32_t path_denied
Paths the object is denied access to.
const char *const short_stat_name[NUM_STATS]
Short name of stats.
int32_t carrying
How much weight this object contains.
@ TRIGGER_MARKER
inserts an invisible, weightless force into a player with a specified string WHEN TRIGGERED.
Link an object type with skill needed to identify, and general name.
int16_t y
Position in the map for this object.
uint32_t path_repelled
Paths the object is repelled from.
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
void object_update(object *op, int action)
object_update() updates the array which represents the map.
struct player * contr
Pointer to the player which control this object.
static uint32_t NROF(const object *const ob)
Returns ob->nrof, unless it is 0, in which case return 1.
sstring add_refcount(sstring str)
This will increase the refcount of the string str.
StringBuffer * describe_resistance(const object *op, int newline, int use_media_tags, StringBuffer *buf)
Generates the visible naming for resistances.
uint8_t anim_speed
Ticks between animation-frames.
@ MARKER
inserts an invisible, weightless force into a player with a specified string.
const typedata * get_typedata(int itemtype)
void query_name(const object *op, char *buf, size_t size)
Describes an item.
#define FLAG_USE_RANGE
(Monster) can apply and use range items
#define FLAG_KNOWN_BLESSED
Item is known to be blessed.
object * map_find_by_type(mapstruct *m, int x, int y, uint8_t type)
Searches for any objects with a matching type variable at the given map and coordinates.
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
@ BUILDER
Generic item builder, see subtypes below.
object clone
An object from which to do object_copy()
StringBuffer * describe_spellpath_attenuation(const char *attenuation, int value, StringBuffer *buf)
Describe the specified path attenuation.
uint64_t price_base(const object *obj)
Price an item based on its value or archetype value, type, identification/BUC status,...
@ INORGANIC
metals, minerals, dragon scales
MoveType move_type
Type of movement this object uses.
object * object_find_by_type_and_name(const object *who, int type, const char *name)
Find object in inventory by type and name.
void query_short_name(const object *op, char *buf, size_t size)
query_short_name(object) is similar to query_name(), but doesn't contain any information about object...
static StringBuffer * ring_desc(const object *op, int use_media_tags, StringBuffer *buf)
Describes a ring or amulet, or a skill.
const Face * face
Face with colors.
StringBuffer * describe_attacktype(const char *attack, int value, StringBuffer *buf)
Describe the specified attack type.
#define FLAG_MAKE_INVIS
(Item) gives invisibility when applied
const char *const change_resist_msg[NROFATTACKS]
These are the descriptions of the resistances displayed when a player puts on/takes off an item.
int32_t last_eat
How long since we last ate.
int32_t value
How much money it is worth (or contains)
int is_identified(const object *op)
Return true if the item is identified, either because it is of a type that doesn't ever need identifi...
uint8_t last_anim
Last sequence used to draw face.
@ PEACEMAKER
Object owned by a player which can convert a monster into a peaceful being incapable of attack.
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
uint8_t type
PLAYER, BULLET, etc.
@ SKILLSCROLL
can add a skill to player's inventory -bt.
#define FLAG_DAMNED
The object is very cursed.
int16_t dam
How much damage this object does when hitting.
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn t
int8_t magic
Any magical bonuses to this item.
int calc_item_enhancement(const object *op)
int32_t food
How much food in stomach.
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
body_locations_struct body_locations[NUM_BODY_LOCATIONS]
The ordering of this is actually doesn't make a difference However, for ease of use,...
#define FLAG_USE_WEAPON
(Monster) can wield weapons
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Append a string to a string buffer instance.
#define FLAG_CAN_USE_SKILL
The monster can use skills.
int8_t facing
Object is oriented/facing that way.
const Animations * animation
Animation of this item, NULL if not animated.
#define FLAG_MONSTER
Will attack players.
const typedata * get_typedata_by_name(const char *name)
#define FLAG_HITBACK
Object will hit back when hit.
const char *const resist_plus[NROFATTACKS]
Attack types to show to the player.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
StringBuffer * describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf)
Describes an item, in all its details.
int32_t weight
Attributes of the object.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
static const int item_types_size
Number of items in item_types array.
int8_t wc
Weapon Class, lower WC increases probability of hitting.
Animations * try_find_animation(const char *name)
A buffer that will be expanded as content is added to it.
#define MOVE_FLY_LOW
Low flying object.
#define FLAG_CLIENT_ANIM_SYNC
Let client animate this, synchronized.
#define FLAG_KNOWN_MAGICAL
The object is known to be magical.
int16_t gen_hp
Bonuses to regeneration speed of hp.
#define FLAG_REFL_SPELL
Spells (some) will reflect from object.
sstring slaying
Which race to do double damage to.
int8_t glow_radius
indicates the glow radius of the object
#define FLAG_FRIENDLY
Will help players.
void query_weight(const object *op, char *buf, size_t size)
Formats the item's weight.
sstring name
The name of the object, obviously...
@ BATTLEGROUND
battleground, by Andreas Vogl
#define WEAPON_SPEED(xyz)
int is_dragon_pl(const object *op)
Checks if player is a dragon.
#define FLAG_USE_ARMOUR
(Monster) can wear armour/shield/helmet
#define FLAG_CAST_SPELL
(Monster) can learn and cast spells
@ DUPLICATOR
Duplicator/multiplier object.
int is_magical(const object *op)
Checks whether object is magical.
int is_identifiable_type(const object *op)
Return true if this item's type is one that cares about whether or not it's been identified – e....
object * env
Pointer to the object which is the environment.
const typedef char * sstring
This represents one animation.
void animate_object(object *op, int dir)
Updates the face-variable of an object.
@ MATERIAL
Material for building.
#define FLAG_REFLECTING
Object reflects from walls (lightning)
@ SKILL_TOOL
Allows the use of a skill.
sstring object_get_value(const object *op, const char *const key)
Get an extra value by key.
@ SHOP_INVENTORY
Mark Wedel (mark@pyramid.com) Shop inventories.
#define FLAG_BEEN_APPLIED
Object was ever applied, for identification purposes.
#define CLEAR_FLAG(xyz, p)
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
int atnr_is_dragon_enabled(int attacknr)
Determine if the attacktype represented by the specified attack-number is enabled for dragon players.
static const int enc_to_item_power[]
This curve may be too steep.
const char *const resist_color[NROFATTACKS]
Colors to add to the resistances for media tags.
void object_give_identified_properties(object *op)
Ensure op has all its "identified" properties set.
#define MIN_ACTIVE_SPEED
Cut off point of when an object is put on the active list or not.
#define FLAG_ANIMATE
The object looks at archetype for faces.
struct treasurelist * randomitems
Items to be generated.
object * container
Current container being used.
#define MOVE_FLY_HIGH
High flying object.
#define FLAG_UNPAID
Object hasn't been paid for yet.
const Face * try_find_face(const char *name, const Face *error)
@ SK_THAUMATURGY
Thaumaturgy.
uint32_t nrof
Number of objects.
#define FLAG_XRAYS
X-ray vision.
StringBuffer * describe_monster(const object *op, int use_media_tags, StringBuffer *buf)
Describes a monster.
void query_base_name(const object *op, int plural, char *buf, size_t size)
Query a short name for the item.
living stats
Str, Con, Dex, etc.
treasure is one element in a linked list, which together consist of a complete treasure-list.
#define MOVE_SWIM
Swimming object.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
int8_t get_attr_value(const living *stats, int attr)
Gets the value of a stat.
int calc_item_power(const object *op)
This takes an object 'op' and figures out what its item_power rating should be.
uint32_t attacktype
Bitmask of attacks this object does.
#define FLAG_NO_SKILL_IDENT
If set, item cannot be identified w/ a skill.
#define FLAG_USE_SCROLL
(Monster) can read scroll
#define FLAG_CURSED
The object is cursed.
object * object_get_player_container(object *op)
Finds the player carrying an object.
@ NUM_STATS
Number of statistics.
int8_t luck
Affects thaco and ac from time to time.
@ DETECTOR
peterm: detector is an object which notices the presense of another object and is triggered like butt...
#define FLAG_LIFESAVE
Saves a players' life once, then destr.
#define FLAG_IDENTIFIED
Item is identifiable (e.g.
object * identify(object *op)
Identifies an item.