 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
44 for (; ol; ol = ol->
next) {
48 LOG(
llevError,
"Internal error in trigger_connect. No object associated with link id (%u) (cause='%s'.\n", ol->
id, (cause && cause->
name) ? cause->
name :
"");
109 for (part = tmp; tmp != NULL; tmp = tmp->
more) {
164 int tot, any_down = 0, old_value = op->
value;
191 if ((ab->move_type&tmp->
move_on) || ab->move_type == 0)
192 tot += ab->weight*
NROF(ab)+ab->carrying;
217 if (op->
value != old_value) {
231 for (obp =
m->buttons; obp; obp = obp->
next)
232 for (ol = obp->
link; ol; ol = ol->
next) {
234 LOG(
llevError,
"Internal error in update_button (%s (%dx%d):%u, connected %ld).\n",
236 ol->
ob ? ol->
ob->
x : -1,
237 ol->
ob ? ol->
ob->
y : -1,
283 #define ARCH_SACRIFICE(xyz) ((xyz)->slaying)
284 #define NROF_SACRIFICE(xyz) ((uint32_t)(xyz)->stats.food)
349 uint32_t wanted, rest;
396 wanted -= tmp->nrof*tmp->value;
409 *toremove =
NROF(sacrifice);
421 wanted = tmp->nrof*tmp->value;
426 wanted = rest/tmp->value;
433 if (rest >
NROF(tmp)) {
443 LOG(
llevError,
"check_altar_sacrifice on %s: found objects to sacrifice, but couldn't remove them??\n", altar->
map->
path);
467 LOG(
llevError,
"BUG: operate_altar(): altar has no map\n");
519 int push = 0, tot = 0;
534 if ((tmp->move_type&op->
move_on) || tmp->move_type == 0) {
535 tot += tmp->weight*
NROF(tmp)+tmp->carrying;
547 if (in_movement || !push)
557 object *head = tmp->head ? tmp->head : tmp;
573 if (in_movement || !push)
602 return cause == NULL;
661 LOG(
llevError,
"Tried to add button-link without map.\n");
679 obp->
value = connected;
697 if (op->
map == NULL) {
698 LOG(
llevError,
"remove_button_link() in object without map.\n");
702 LOG(
llevError,
"remove_button_linked() in unlinked object.\n");
707 for (olp = &obp->
link; (ol = *olp); olp = &ol->
next)
716 LOG(
llevError,
"remove_button_linked(): couldn't find object.\n");
735 for (ol = obp->
link; ol; ol = ol->
next)
736 if (ol->
ob == button && ol->
id == button->
count)
757 for (ol = obp->
link; ol; ol = ol->
next)
758 if (ol->
ob == button && ol->
id == button->
count)
800 && (!trig->
race || (tmp->arch->name == trig->
race))
801 && (!trig->
title || (tmp->title == trig->
title))
836 }
else if (!match && !trig->
last_sp)
bool object_value_set(const object *op, const char *const key)
Determine if an extra value is set.
#define UP_OBJ_FACE
Only thing that changed was the face.
int16_t maxhp
Max hit points.
@ llevError
Error, serious thing.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define QUERY_FLAG(xyz, p)
objectlink * next
Next item to link to.
method_ret ob_trigger(object *op, object *cause, int state)
An object is triggered by another one.
oblinkpt * next
Next value in the list.
oblinkpt * buttons
Linked list of linked lists of buttons.
struct archetype * arch
Pointer to archetype.
#define EVENT_TRIGGER
Button pushed, lever pulled, etc.
float speed
Frequency of object 'moves' relative to server tick rate.
float speed_left
How much speed is left to spend this round.
struct mapstruct * map
Pointer to the map in which this object is present.
object * ob
Item to link to.
#define SET_ANIMATION(ob, newanim)
int8_t direction
Means the object is moving that way.
tag_t count
Unique object number for this object.
Used to link together several object links.
#define FOR_ABOVE_PREPARE(op_, it_)
Constructs a loop iterating over all objects above an object.
sstring title
Of foo, etc.
char path[HUGE_BUF]
Filename of the map.
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Execute an event on the specified object.
#define FLAG_ACTIVATE_ON_PUSH
connected object is activated when 'pushed'
Plugin animator file specs[Config] name
#define FLAG_ALIVE
Object can fight (or be fought)
int16_t y
Position in the map for this object.
static event_registration m
void object_update(object *op, int action)
object_update() updates the array which represents the map.
static uint32_t NROF(const object *const ob)
Returns ob->nrof, unless it is 0, in which case return 1.
#define object_decrease_nrof_by_one(xyz)
int32_t last_heal
Last healed.
Used to link together several objects.
objectlink * link
Items for this value.
#define FOR_ABOVE_FINISH()
Finishes FOR_ABOVE_PREPARE().
object clone
An object from which to do object_copy()
long value
Used as connected value in buttons/gates.
MoveType move_type
Type of movement this object uses.
void void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the specified map.
#define FLAG_FREED
Object is in the list of free objects.
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)
void object_update_speed(object *op)
Updates the speed of an object.
uint8_t type
PLAYER, BULLET, etc.
void move_firewall(object *op)
Move for FIREWALL.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
MoveType move_on
Move types affected moving on to this space.
int32_t food
How much food in stomach.
sstring race
Human, goblin, dragon, etc.
#define MAX_BUF
Used for all kinds of things.
#define MSG_TYPE_DIALOG
NPCs, magic mouths, and altars.
object * head
Points to the main object of a large body.
int32_t weight
Attributes of the object.
int8_t wc
Weapon Class, lower WC increases probability of hitting.
object * object_decrease_nrof(object *op, uint32_t i)
Decreases a specified number from the amount of an object.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring slaying
Which race to do double damage to.
sstring name
The name of the object, obviously...
int16_t maxsp
Max spell points.
int32_t last_sp
As last_heal, but for spell points.
#define FLAG_ACTIVATE_ON_RELEASE
connected object is activated when 'released'
sstring msg
If this is a book/sign/magic mouth/etc.
#define CLEAR_FLAG(xyz, p)
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
#define NUM_ANIMATIONS(ob)
#define FLAG_ANIMATE
The object looks at archetype for faces.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
void free_objectlink(objectlink *ol)
Recursively frees all objectlinks.
#define FLAG_UNPAID
Object hasn't been paid for yet.
uint8_t state
How the object was last drawn (animation)
sstring name
More definite name, like "generate_kobold".
#define FLAG_IS_LINKED
The object is linked with other objects.
uint32_t nrof
Number of objects.
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.
object * more
Pointer to the rest of a large body of objects.
#define MSG_TYPE_DIALOG_ALTAR
A message from an altar.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
objectlink * get_objectlink(void)
Allocates a new objectlink structure, initialises it, and returns a pointer to it.
@ llevDebug
Only for debugging purposes.
oblinkpt * get_objectlinkpt(void)
Allocates a new oblinkpt structure, initialises it, and returns a pointer to it.