 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
15 #define NUM_BODY_LOCATIONS 13
22 struct body_locations_struct {
54 #define WILL_APPLY_HANDLE 0x1
55 #define WILL_APPLY_TREASURE 0x2
56 #define WILL_APPLY_EARTHWALL 0x4
57 #define WILL_APPLY_DOOR 0x8
58 #define WILL_APPLY_FOOD 0x10
70 #define object_was_destroyed(op, old_tag) \
71 (op->count != old_tag || QUERY_FLAG(op, FLAG_FREED))
83 #define SPELL_TAG_SIZE 16
89 #define OB_SPELL_TAG_HASH(op, count) (op->spell_tags[count&0xf])
95 #define OB_SPELL_TAG_MATCH(op, count) (op->spell_tags[count&0xf] == count)
98 #define CUSTOM_NAME_FIELD "custom_name"
500 for (
int i = 0; i < 4; i++) {
506 return op->
flags[flag / 32] & (1U << (flag % 32));
510 op->
flags[flag / 32] &= ~(1U << (flag % 32));
513 static inline void set_flag(
object *op,
int flag) {
514 op->
flags[flag / 32] |= (1U << (flag % 32));
521 #define LOOK_OBJ(ob) (!ob->invisible && ob->type != PLAYER && ob->type != EVENT_CONNECTOR)
530 #define UP_OBJ_INSERT 1
531 #define UP_OBJ_REMOVE 2
532 #define UP_OBJ_CHANGE 3
533 #define UP_OBJ_FACE 4
544 #define FREE_OBJ_FREE_INVENTORY 1
545 #define FREE_OBJ_NO_DESTROY_CALLBACK 2
546 #define FREE_OBJ_DROP_ABOVE_FLOOR 4
580 #define INS_NO_MERGE 0x0001
581 #define INS_ABOVE_FLOOR_ONLY 0x0002
582 #define INS_NO_WALK_ON 0x0004
583 #define INS_ON_TOP 0x0008
584 #define INS_BELOW_ORIGINATOR 0x0010
585 #define INS_MAP_LOAD 0x0020
588 #define ARCH_SINGULARITY "singularity"
589 #define ARCH_DETECT_MAGIC "detect_magic"
590 #define ARCH_DEPLETION "depletion"
591 #define ARCH_SYMPTOM "symptom"
592 #define ARCH_PORTAL_FAILED "town_portal_failed"
593 #define ARCH_SPELL_BLOCKED "spell_blocked"
594 #define ARCH_SPELL_BUNGLE "spell_bungle"
596 #define MONSTER_EXCLUDE_FROM_READABLE_KEY "exclude_from_readable"
607 #define HEAD(op) ((op)->head != NULL ? (op)->head : (op))
625 static inline uint32_t
NROF(
const object *
const ob) {
641 object *
add_force(
object *op,
const char *
name,
int duration);
@ CLASS
Object for applying character class modifications to someone.
sstring name_pl
The plural name of the object.
New face structure - this enforces the notion that data is face by face only - you can not change the...
Main Crossfire structure, one ingame object.
float weapon_speed_left
How much speed is left to spend this round.
uint8_t range_modifier
How going up in level affects range
int32_t move_status
What stage in attack mode.
int nroffreeobjects
How many OBs allocated and free (free)
object * owner
Pointer to the object which controls this one.
#define NUM_BODY_LOCATIONS
Number of body locations.
uint32_t weapontype
Type of weapon.
@ MONSTER
A real, living creature.
static bool CAN_PROBE(const object *ob)
Determine whether the given object can have an HP bar.
uint8_t map_layer
What level to draw this on the map.
@ CLOSE_CON
Eneq((at)csd.uu.se): Id for close_container archetype.
@ EVENT_CONNECTOR
Lauwenmark: an invisible object holding a plugin event hook.
uint32_t path_attuned
Paths the object is attuned to.
archetype * more
Next part of a linked object.
@ FLESH
animal 'body parts' -b.t.
uint16_t client_type
Public type information.
object * inv
Pointer to the first object in the inventory.
#define QUERY_FLAG(xyz, p)
objectlink * next
Next item to link to.
oblinkpt * next
Next value in the list.
tag_t ownercount
What count the owner had (in case owner has been freed)
int8_t item_power
Power rating of the object.
struct archetype * arch
Pointer to archetype.
uint16_t attack_movement
What kind of attack movement.
int8_t range
Range of the spell.
float speed
Frequency of object 'moves' relative to server tick rate.
int16_t invisible
How much longer the object will be invis.
float speed_left
How much speed is left to spend this round.
uint8_t pick_up
See crossfire.doc.
struct mapstruct * map
Pointer to the map in which this object is present.
sstring anim_suffix
Used to determine combined animations.
Each object (this also means archetypes!) could have a few of these "dangling" from it; this could al...
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
double expmul
needed experience = (calc_exp*expmul) - means some races/classes can need less/more exp to gain level...
object * ob
Item to link to.
archetype * head
The main part of a linked object.
@ SKILL
Also see SKILL_TOOL (74) below.
int8_t direction
Means the object is moving that way.
tag_t count
Unique object number for this object.
int16_t last_grace
As last_sp, except for grace.
uint8_t smoothlevel
how to smooth this square around
Used to link together several object links.
@ TRANSPORT
see doc/Developers/objects
@ POTION_RESIST_EFFECT
A force, holding the effect of a resistance potion.
@ FLOOR
Floor tile -> native layer 0.
object * enemy
Monster/player to follow even if not closest.
key_value * key_values
Fields not explictly known by the loader.
const char * save_name
Name used to load/save it to disk.
uint8_t hide
The object is hidden, not invisible.
sstring title
Of foo, etc.
int nrofallocobjects
How many OBs allocated (free + used)
int16_t level
Level of creature or object.
uint8_t will_apply
See crossfire.doc and What monsters apply.
object * above
Pointer to the object stacked above this one.
static int query_flag(const object *op, int flag)
const char * nonuse_name
Name to describe objects we can't use.
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
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 * value
Key's value.
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.
uint32_t path_repelled
Paths the object is repelled from.
int16_t y
Position in the map for this object.
struct player * contr
Pointer to the player which control this object.
uint8_t temp_anim_speed
Ticks between temporary animation-frames.
static uint32_t NROF(const object *const ob)
Returns ob->nrof, unless it is 0, in which case return 1.
object * chosen_skill
The skill chosen to use.
int32_t last_heal
Last healed.
uint8_t subtype
Subtype of object.
Used to link together several objects.
objectlink * link
Items for this value.
key_value * next
Next key in the list.
uint8_t anim_speed
Ticks between animation-frames.
@ MARKER
inserts an invisible, weightless force into a player with a specified string.
float weapon_speed
The overall speed of this object.
const char * use_name
Name used when describing an item we can use.
object * prev
Pointer to the previous object in the free/used list.
@ BUILDER
Generic item builder, see subtypes below.
treasurelist represents one logical group of items to be generated together.
object clone
An object from which to do object_copy()
uint8_t run_away
Monster runs away if it's hp goes below this percentage.
int32_t weight_limit
Weight-limit of object.
object * spell
Spell that was being cast.
long value
Used as connected value in buttons/gates.
object * active_objects
List of active objects that need to be processed.
object * below
Pointer to the object stacked below this one.
@ INORGANIC
metals, minerals, dragon scales
int16_t casting_time
Time left before spell goes off.
MoveType move_type
Type of movement this object uses.
uint64_t event_bitmask
Bitmask of events this object has a handler for, see events.h.
const Face * face
Face with colors.
tag_t id
ob's tag, in case it is removed.
int32_t last_eat
How long since we last ate.
int32_t value
How much money it is worth (or contains)
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.
object * find_force(object *op, const char *name)
Find a force with the given 'name' in the slaying field.
uint8_t type
PLAYER, BULLET, etc.
@ SKILLSCROLL
can add a skill to player's inventory -bt.
int8_t magic
Any magical bonuses to this item.
object * active_prev
Previous object in the 'active list This is used in process_events so that the entire object list doe...
sstring materialname
Specific material name.
@ DRAGON_FOCUS
Used during character creation.
MoveType move_on
Move types affected moving on to this space.
object_type
Only add new values to this list if somewhere in the program code, it is actually needed.
uint32_t tag_t
Object tag, unique during the whole game.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
uint8_t sound_chance
Probability, 1 to 100, of the object emitting a sound.
sstring race
Human, goblin, dragon, etc.
static void compare_flags(ob_flags *ret, const object *p, const object *q)
object * objects
Pointer to the list of used objects.
int8_t facing
Object is oriented/facing that way.
const Animations * animation
Animation of this item, NULL if not animated.
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
Various statistics of objects.
#define FLAG_MONSTER
Will attack players.
object * head
Points to the main object of a large body.
object * current_weapon
Pointer to the weapon currently used.
int32_t weight
Attributes of the object.
MoveType move_slow
Movement types this slows down.
tag_t * spell_tags
Tags used for spell effect merging.
float move_slow_penalty
How much this slows down the object.
static bool IS_PLAYER(object *op)
const char * key
Name of the key.
sstring lore
Obscure information about this object, to get put into books and the like.
uint8_t dam_modifier
How going up in level affects damage.
sstring slaying
Which race to do double damage to.
int8_t glow_radius
indicates the glow radius of the object
uint8_t duration_modifier
how level modifies duration
sstring name
The name of the object, obviously...
@ BATTLEGROUND
battleground, by Andreas Vogl
object * spellitem
Spell ability monster is choosing to use.
body_locations_struct body_locations[NUM_BODY_LOCATIONS]
The ordering of this is actually doesn't make a difference However, for ease of use,...
@ OBJECT_TYPE_MAX
Try to find a fire/heat source to light this when applied.
sstring artifact
If set, the item is the artifact with this name and the matching type.
@ DUPLICATOR
Duplicator/multiplier object.
object * env
Pointer to the object which is the environment.
int32_t last_sp
As last_heal, but for spell points.
const typedef char * sstring
This represents one animation.
int8_t gen_sp_armour
Sp regen penalty this object has (was last_heal)
sstring skill
Name of the skill this object uses/grants.
@ MATERIAL
Material for building.
uint32_t light_cached_time
Computing whether or not an item is in the light is very expensive, so cache it.
object * add_force(object *op, const char *name, int duration)
Add or return an existing force inside 'op' with the given 'name' and 'duration' in units of 100 tick...
tag_t attacked_by_count
The tag of attacker, so we can be sure.
sstring msg
If this is a book/sign/magic mouth/etc.
@ SKILL_TOOL
Allows the use of a skill.
int reference_count
How many times this temporary archetype is used.
static void set_flag(object *op, int flag)
@ SHOP_INVENTORY
Mark Wedel (mark@pyramid.com) Shop inventories.
object * attacked_by
This object start to attack us! only player & monster.
int16_t duration
Number of moves (see 'speed') spell lasts.
ob_flags flags
Various flags.
int8_t body_info[NUM_BODY_LOCATIONS]
Body info as loaded from the file.
struct treasurelist * randomitems
Items to be generated.
const char *const move_name[]
Maps the MOVE_* values to names.
object * container
Current container being used.
object * active_next
Next object in the 'active' list This is used in process_events so that the entire object list does n...
MoveType move_off
Move types affected moving off this space.
int8_t tail_y
Where the lower right most portion of the object is in comparison to the head.
char * spellarg
Optional argument when casting obj::spell.
uint8_t state
How the object was last drawn (animation)
sstring name
More definite name, like "generate_kobold".
uint32_t nrof
Number of objects.
int8_t body_used[NUM_BODY_LOCATIONS]
Calculated value based on items equipped.
living stats
Str, Con, Dex, etc.
MoveType move_allow
What movement types explicitly allowed.
object * more
Pointer to the rest of a large body of objects.
static void clear_flag(object *op, int flag)
int64_t total_exp
All exp ever earned (used to calc perm_exp)
uint32_t attacktype
Bitmask of attacks this object does.
const Animations * temp_animation
A temporary animation.
uint16_t material
What materials this object consist of.
struct_dialog_information * dialog_information
Parsed dialog information for this object.
MoveType move_block
What movement types this blocks.
object * next
Pointer to the next object in the free/used list.
int16_t oy
For debugging: Where it was last inserted.
@ DETECTOR
peterm: detector is an object which notices the presense of another object and is triggered like butt...