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 :
"");
86 if (!
tmp->stats.food ||
tmp->last_eat <
tmp->stats.food) {
110 part->
speed =
tmp->arch->clone.speed;
111 part->
value =
tmp->arch->clone.value;
119 if ((
tmp->stats.sp +=
tmp->stats.maxsp) > 8)
120 tmp->stats.sp = ((
tmp->stats.sp-1)%8)+1;
128 if ((
tmp->direction +=
tmp->stats.maxsp) > 8)
129 tmp->direction = ((
tmp->direction-1)%8)+1;
164 int tot, any_down = 0, old_value =
op->value;
170 LOG(
llevDebug,
"Internal error in update_button (%s).\n",
op->name);
191 if ((ab->move_type&
tmp->move_on) || ab->move_type == 0)
192 tot += ab->weight*
NROF(ab)+ab->carrying;
195 tmp->value = (tot >=
tmp->weight) ? 1 : 0;
203 if (((head->
move_type&
tmp->move_on) || ab->move_type == 0)
206 || (!strcmp(
tmp->slaying,
"player") && head->
type ==
PLAYER)))
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,
256 op->value = !
op->value;
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;
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");
492 if (
op->stats.exp > 0)
493 op->speed = 1.0/
op->stats.exp;
519 int push = 0, tot = 0;
520 int in_movement =
op->stats.wc ||
op->speed;
524 if (
op->weight > 0) {
534 if ((
tmp->move_type&
op->move_on) ||
tmp->move_type == 0) {
538 if (tot >=
op->weight)
547 if (in_movement || !
push)
557 object *head =
tmp->head ?
tmp->head :
tmp;
561 && (head->
race ==
op->slaying || (!strcmp(
op->slaying,
"player") && head->
type ==
PLAYER))) {
573 if (in_movement || !
push)
589 if (
op->last_sp >= 0) {
592 op->last_sp = -
op->last_sp;
597 op->value = !
op->value;
599 op->last_sp = -
op->last_sp;
600 op->value = !
op->value;
602 return cause == NULL;
621 op->value = !
op->value;
661 LOG(
llevError,
"Tried to add button-link without map.\n");
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");
706 for (obp =
op->map->buttons; obp; obp = obp->
next)
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)
788 && (!trig->
race || (
op->arch->name == trig->
race))
800 && (!trig->
race || (
tmp->arch->name == trig->
race))
void object_remove(object *op)
void object_update(object *op, int action)
#define QUERY_FLAG(xyz, p)
#define SET_ANIMATION(ob, newanim)
#define FOR_ABOVE_PREPARE(op_, it_)
void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
#define FLAG_ACTIVATE_ON_PUSH
static event_registration m
static uint32_t NROF(const object *const ob)
#define object_decrease_nrof_by_one(xyz)
void push(String_Array *array, const char *string)
#define FOR_ABOVE_FINISH()
void move_firewall(object *op)
objectlink * get_objectlink(void)
oblinkpt * get_objectlinkpt(void)
void LOG(LogLevel logLevel, const char *format,...)
bool object_value_set(const object *op, const char *const key)
#define FLAG_ACTIVATE_ON_RELEASE
void query_base_name(const object *op, int plural, char *buf, size_t size)
#define CLEAR_FLAG(xyz, p)
#define NUM_ANIMATIONS(ob)
void object_update_speed(object *op)
object * object_decrease_nrof(object *op, uint32_t i)
#define MSG_TYPE_DIALOG_ALTAR
method_ret ob_trigger(object *op, object *cause, int state)
#define FOR_INV_PREPARE(op_, it_)
void free_objectlink(objectlink *ol)