Crossfire Server, Branches 1.12  R18729
time.c
Go to the documentation of this file.
1 /*
2  * static char *rcsid_time_c =
3  * "$Id: time.c 11578 2009-02-23 22:02:27Z lalo $";
4  */
5 
6 /*
7  CrossFire, A Multiplayer game for X-windows
8 
9  Copyright (C) 2006 Mark Wedel & Crossfire Development Team
10  Copyright (C) 1992 Frank Tore Johansen
11 
12  This program is free software; you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or
15  (at your option) any later version.
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, write to the Free Software
24  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 
26  The authors can be reached via e-mail at crossfire-devel@real-time.com
27 */
28 
35 #include <global.h>
36 #include <spells.h>
37 #ifndef __CEXTRACT__
38 #include <sproto.h>
39 #endif
40 
51 void remove_door(object *op) {
52  int i;
53  object *tmp;
54 
55  for (i = 1; i < 9; i += 2)
56  if ((tmp = present(DOOR, op->map, op->x+freearr_x[i], op->y+freearr_y[i])) != NULL) {
57  tmp->speed = 0.1;
58  update_ob_speed(tmp);
59  tmp->speed_left = -0.2;
60  }
61 
62  if (op->other_arch) {
63  tmp = arch_to_object(op->other_arch);
64  tmp->x = op->x;
65  tmp->y = op->y;
66  tmp->map = op->map;
67  tmp->level = op->level;
68  insert_ob_in_map(tmp, op->map, op, 0);
69  }
70  remove_ob(op);
71  free_object(op);
72 }
73 
80 void remove_locked_door(object *op) {
81  int i;
82  object *tmp;
83 
84  for (i = 1; i < 9; i += 2) {
85  tmp = present(LOCKED_DOOR, op->map, op->x+freearr_x[i], op->y+freearr_y[i]);
86  if (tmp && tmp->slaying == op->slaying) {/* same key both doors */
87  tmp->speed = 0.1;
88  update_ob_speed(tmp);
89  tmp->speed_left = -0.2;
90  }
91  }
92  if (op->other_arch) {
93  tmp = arch_to_object(op->other_arch);
94  tmp->x = op->x;
95  tmp->y = op->y;
96  tmp->map = op->map;
97  tmp->level = op->level;
98  insert_ob_in_map(tmp, op->map, op, 0);
99  }
100  remove_ob(op);
101  free_object(op);
102 }
103 
114 static void generate_monster_inv(object *gen) {
115  int i;
116  int nx, ny;
117  object *op, *head = NULL;
118  const char *code;
119  int qty = 0;
120 
121  /* Code below assumes the generator is on a map, as it tries
122  * to place the monster on the map. So if the generator
123  * isn't on a map, complain and exit.
124  */
125  if (gen->map == NULL) {
126  LOG(llevError,"Generator (%s) not on a map?\n", gen->name);
127  return;
128  }
129 
130  /*First count number of objects in inv*/
131  for (op = gen->inv; op; op = op->below)
132  qty++;
133  if (!qty) {
134  LOG(llevError,"Generator (%s) has no inventory in generate_monster_inv?\n", gen->name);
135  return;/*No inventory*/
136  }
137  qty=rndm(0,qty-1);
138  for (op=gen->inv;qty;qty--)
139  op=op->below;
140  i=find_multi_free_spot_within_radius(op, gen, &nx, &ny);
141  if (i==-1)
142  return;
143  head=object_create_clone(op);
146  if (rndm(0, 9))
147  generate_artifact(head, gen->map->difficulty);
148  code = get_ob_key_value(gen, "generator_code");
149  if (code) {
150  set_ob_key_value(head, "generator_code", code, 1);
151  }
152  insert_ob_in_map_at(head,gen->map,gen,0,nx,ny);
153  if (QUERY_FLAG(head, FLAG_FREED)) return;
154  fix_multipart_object(head);
155  if (HAS_RANDOM_ITEMS(head))
156  create_treasure(head->randomitems, head, GT_APPLY,
157  gen->map->difficulty, 0);
158 }
159 
168 static void generate_monster_arch(object *gen) {
169  int i;
170  int nx, ny;
171  object *op, *head = NULL, *prev = NULL;
172  archetype *at = gen->other_arch;
173  const char *code;
174 
175  if(gen->other_arch == NULL) {
176  LOG(llevError, "Generator without other_arch: %s\n", gen->name);
177  return;
178  }
179  /* Code below assumes the generator is on a map, as it tries
180  * to place the monster on the map. So if the generator
181  * isn't on a map, complain and exit.
182  */
183  if (gen->map == NULL) {
184  LOG(llevError,"Generator (%s) not on a map?\n", gen->name);
185  return;
186  }
187  i = find_multi_free_spot_within_radius(&at->clone, gen, &nx, &ny);
188  if (i == -1) return;
189  while (at != NULL) {
190  op = arch_to_object(at);
191  op->x = nx + at->clone.x;
192  op->y = ny + at->clone.y;
193 
194  if (head != NULL)
195  op->head = head, prev->more=op;
196 
197  if (rndm(0, 9)) generate_artifact(op, gen->map->difficulty);
198 
199  code = get_ob_key_value(gen, "generator_code");
200  if (code) {
201  set_ob_key_value(head, "generator_code", code, 1);
202  }
203 
204  insert_ob_in_map(op, gen->map, gen,0);
205  if (QUERY_FLAG(op, FLAG_FREED)) return;
206  if(HAS_RANDOM_ITEMS(op))
208  gen->map->difficulty, 0);
209  if(head == NULL)
210  head = op;
211  prev = op;
212  at = at->more;
213  }
214 }
215 
222 static void generate_monster(object *gen) {
223  sint8 children;
224  sint8 max_children;
225  sint8 x, y;
226  object *tmp;
227  const char *code, *value;
228 
229  if (GENERATE_SPEED(gen)&&rndm(0, GENERATE_SPEED(gen)-1))
230  return;
231 
232  value = get_ob_key_value(gen, "generator_max_map");
233  if (value) {
234  max_children = (sint8)strtol(value, NULL, 10);
235  if (max_children < 1)
236  return;
237  code = get_ob_key_value(gen, "generator_code");
238  if (code) {
239  /* Generator has a limit and has created some,
240  * so count how many already exist
241  */
242  children = 0;
243  for (x = 0; x < MAP_WIDTH(gen->map); x++) {
244  for (y = 0; y < MAP_HEIGHT(gen->map); y++) {
245  for (tmp = GET_MAP_OB(gen->map, x, y); tmp != NULL; tmp = tmp->above) {
246  value = get_ob_key_value(tmp, "generator_code");
247  if (value && value == code) {
248  children++;
249  }
250  }
251  }
252  }
253  /* and return without generating if there are already enough */
254  if (children >= max_children+1)
255  return;
256  } else {
257  /* Generator has a limit, but hasn't created anything yet,
258  * so no need to count, just set code and go
259  */
260  value = get_ob_key_value(gen, "generator_name");
261  if (value) {
262  set_ob_key_value(gen, "generator_code", value, 1);
263  } else if (gen->name) {
264  set_ob_key_value(gen, "generator_code", gen->name, 1);
265  } else {
266  set_ob_key_value(gen, "generator_code", "generator", 1);
267  }
268  }
269  } /* If this has a max map generator limit */
270 
273  else
275 }
276 
284 static void remove_force(object *op) {
285  if (--op->duration > 0) {
286  check_spell_expiry(op);
287  return;
288  }
289 
290  switch (op->subtype) {
291  case FORCE_CONFUSION:
292  if (op->env != NULL) {
294  draw_ext_info(NDI_UNIQUE, 0, op->env,
296  "You regain your senses.", NULL);
297  }
298  break;
299 
301  /* The force is into the item that was created */
302  if (op->env != NULL && op->inv != NULL) {
303  object *inv = op->inv;
304  object *pl = get_player_container(op);
305 
306  remove_ob(inv);
307  inv->weight = (inv->nrof ? (sint32)(op->env->weight/inv->nrof) : op->env->weight);
308  if (op->env->env) {
309  insert_ob_in_ob(inv, op->env->env);
310  if (pl) {
311  char name[HUGE_BUF];
312 
313  query_short_name(inv, name, HUGE_BUF);
315  "Your %s recovers its original form.",
316  "Your %s recovers its original form.",
317  name);
318  }
319  } else {
320  /* Object on map */
321  inv->x = op->env->x;
322  inv->y = op->env->y;
323  insert_ob_in_map(inv, op->env->map, NULL, 0);
324  }
325  inv = op->env;
326  remove_ob(op);
327  free_object(op);
328  remove_ob(inv);
329  }
330  return;
331 
332  default:
333  break;
334  }
335 
336  if (op->env != NULL) {
338  change_abil(op->env, op);
339  fix_object(op->env);
340  }
341  remove_ob(op);
342  free_object(op);
343 }
344 
351 static void animate_trigger(object *op) {
352  if ((unsigned char)++op->stats.wc >= NUM_ANIMATIONS(op)) {
353  op->stats.wc = 0;
354  check_trigger(op, NULL);
355  } else {
356  SET_ANIMATION(op, op->stats.wc);
358  }
359 }
360 
367 static void move_hole(object *op) { /* 1 = opening, 0 = closing */
368  object *next, *tmp;
369 
370  if (op->value) { /* We're opening */
371  if (--op->stats.wc <= 0) { /* Opened, let's stop */
372  op->stats.wc = 0;
373  op->speed = 0;
374  update_ob_speed(op);
375 
376  /* Hard coding this makes sense for holes I suppose */
377  op->move_on = MOVE_WALK;
378  for (tmp = op->above; tmp != NULL; tmp = next) {
379  next = tmp->above;
380  ob_move_on(op, tmp, tmp);
381  }
382  }
383 
384  op->state = op->stats.wc;
385  animate_object(op, 0);
387  return;
388  }
389  /* We're closing */
390  op->move_on = 0;
391 
392  op->stats.wc++;
393  if ((int)op->stats.wc >= NUM_ANIMATIONS(op))
394  op->stats.wc = NUM_ANIMATIONS(op)-1;
395 
396  op->state = op->stats.wc;
397  animate_object(op, 0);
399  if ((unsigned char)op->stats.wc == (NUM_ANIMATIONS(op)-1)) {
400  op->speed = 0;
401  update_ob_speed(op); /* closed, let's stop */
402  return;
403  }
404 }
405 
426 object *stop_item(object *op) {
427  if (free_no_drop(op))
428  return NULL;
429 
430  if (op->map == NULL)
431  return op;
432 
433  switch (op->type) {
434  case THROWN_OBJ: {
435  object *payload = op->inv;
436 
437  if (payload == NULL)
438  return NULL;
439  remove_ob(payload);
440  remove_ob(op);
441  free_object(op);
442  return payload;
443  }
444 
445  case ARROW:
446  if (op->speed >= MIN_ACTIVE_SPEED)
447  op = fix_stopped_arrow(op);
448  return op;
449 
450  default:
451  return op;
452  }
453 }
454 
466 void fix_stopped_item(object *op, mapstruct *map, object *originator) {
467  if (map == NULL)
468  return;
469  if (QUERY_FLAG(op, FLAG_REMOVED))
470  insert_ob_in_map(op, map, originator, 0);
471  else if (op->type == ARROW)
472  merge_ob(op, NULL); /* only some arrows actually need this */
473 }
474 
483 object *fix_stopped_arrow(object *op) {
484  if (free_no_drop(op))
485  return NULL;
486 
487  if (rndm(0, 99) < op->stats.food) {
488  /* Small chance of breaking */
489  remove_ob(op);
490  free_object(op);
491  return NULL;
492  }
493 
494  op->direction = 0;
495  op->move_on = 0;
496  op->move_type = 0;
497  op->speed = 0;
498  update_ob_speed(op);
499  op->stats.wc = op->stats.sp;
500  op->stats.dam = op->stats.hp;
501  op->attacktype = op->stats.grace;
502  if (op->slaying != NULL)
504 
505  if (op->skill != NULL)
507 
508  if (op->spellarg != NULL) {
509  op->slaying = add_string(op->spellarg);
510  free(op->spellarg);
511  op->spellarg = NULL;
512  } else
513  op->slaying = NULL;
514 
515  /* Reset these to zero, so that can_merge will work properly */
516  op->spellarg = NULL;
517  op->stats.sp = 0;
518  op->stats.hp = 0;
519  op->stats.grace = 0;
520  op->level = 0;
521  op->face = op->arch->clone.face;
522  op->owner = NULL; /* So that stopped arrows will be saved */
524  return op;
525 }
526 
536 int free_no_drop(object *op) {
537  if (!QUERY_FLAG(op, FLAG_NO_DROP)) {
538  return 0;
539  }
540 
541  if (!QUERY_FLAG(op, FLAG_REMOVED)) {
542  remove_ob(op);
543  }
544 
545  free_object2(op, 1);
546  return 1;
547 }
548 
559 static void change_object(object *op) { /* Doesn`t handle linked objs yet */
560  object *tmp, *env;
561  int i, j;
562 
563  if (op->other_arch == NULL) {
564  LOG(llevError, "Change object (%s) without other_arch error.\n", op->name);
565  return;
566  }
567 
568  /* In non-living items only change when food value is 0 */
569  if (!QUERY_FLAG(op, FLAG_ALIVE)) {
570  if (op->stats.food-- > 0)
571  return;
572  else
573  op->stats.food = 1; /* so 1 other_arch is made */
574  }
575  env = op->env;
576  remove_ob(op);
577  for (i = 0; i < NROFNEWOBJS(op); i++) {
578  tmp = arch_to_object(op->other_arch);
579  if (op->type == LAMP)
580  tmp->stats.food = op->stats.food-1;
581  tmp->stats.hp = op->stats.hp; /* The only variable it keeps. */
582  if (env) {
583  tmp->x = env->x,
584  tmp->y = env->y;
585  tmp = insert_ob_in_ob(tmp, env);
586  } else {
587  j = find_first_free_spot(tmp, op->map, op->x, op->y);
588  if (j == -1) /* No free spot */
589  free_object(tmp);
590  else {
591  tmp->x = op->x+freearr_x[j],
592  tmp->y = op->y+freearr_y[j];
593  insert_ob_in_map(tmp, op->map, op, 0);
594  }
595  }
596  }
597  free_object(op);
598 }
599 
610 void move_firewall(object *op) {
611  object *spell;
612 
613  if (!op->map)
614  return; /* dm has created a firewall in his inventory */
615 
616  spell = op->inv;
617  if (!spell) {
618  LOG(llevError, "move_firewall: no spell specified (%s, %s, %d, %d)\n", op->name, op->map->name, op->x, op->y);
619  return;
620  }
621 
622  cast_spell(op, op, op->stats.sp ? op->stats.sp : rndm(1, 8), spell, NULL);
623 }
624 
625 
639 void move_player_mover(object *op) {
640  object *victim, *nextmover;
641  int dir = op->stats.sp;
642  sint16 nx, ny;
643  mapstruct *m;
644 
645  /* Determine direction now for random movers so we do the right thing */
646  if (!dir)
647  dir = rndm(1, 8);
648 
649  for (victim = GET_MAP_OB(op->map, op->x, op->y); victim != NULL; victim = victim->above) {
650  if (QUERY_FLAG(victim, FLAG_ALIVE)
651  && !QUERY_FLAG(victim, FLAG_WIZPASS)
652  && (victim->move_type&op->move_type || !victim->move_type)) {
653 
654  if (victim->head)
655  victim = victim->head;
656 
657  if (QUERY_FLAG(op, FLAG_LIFESAVE)&&op->stats.hp-- < 0) {
658  remove_ob(op);
659  free_object(op);
660  return;
661  }
662  nx = op->x+freearr_x[dir];
663  ny = op->y+freearr_y[dir];
664  m = op->map;
665  if (get_map_flags(m, &m, nx, ny, &nx, &ny)&P_OUT_OF_MAP) {
666  LOG(llevError, "move_player_mover: Trying to push player off the map! map=%s (%d, %d)\n", m->path, op->x, op->y);
667  return;
668  }
669 
670  if (should_director_abort(op, victim))
671  return;
672 
673  for (nextmover = GET_MAP_OB(m, nx, ny); nextmover != NULL; nextmover = nextmover->above) {
674  if (nextmover->type == PLAYERMOVER)
675  nextmover->speed_left = -.99;
676  if (QUERY_FLAG(nextmover, FLAG_ALIVE)) {
677  op->speed_left = -1.1; /* wait until the next thing gets out of the way */
678  }
679  }
680 
681  if (victim->type == PLAYER) {
682  /* only level >= 1 movers move people */
683  if (op->level) {
684  /* Following is a bit of hack. We need to make sure it
685  * is cleared, otherwise the player will get stuck in
686  * place. This can happen if the player used a spell to
687  * get to this space.
688  */
689  victim->contr->fire_on = 0;
690  victim->speed_left = -FABS(victim->speed);
691  move_player(victim, dir);
692  } else
693  return;
694  } else
695  move_object(victim, dir);
696 
697  if (!op->stats.maxsp && op->attacktype)
698  op->stats.maxsp = 2.0;
699 
700  if (op->attacktype) { /* flag to paralyze the player */
701  victim->speed_left = -FABS(op->stats.maxsp*victim->speed/op->speed);
702  /* Not sure why, but for some chars on metalforge, they
703  * would sometimes get -inf speed_left, and from the
704  * description, it could only happen here, so just put
705  * a lower sanity limit. My only guess is that the
706  * mover has 0 speed.
707  */
708  if (victim->speed_left < -5.0)
709  victim->speed_left = -5.0;
710  }
711  }
712  }
713 }
714 
724 int process_object(object *op) {
726  return 0;
727 
728  /* Lauwenmark: Handle for plugin time event */
729  if (execute_event(op, EVENT_TIME, NULL, NULL, NULL, SCRIPT_FIX_NOTHING) != 0)
730  return 0;
731 
732  if (QUERY_FLAG(op, FLAG_MONSTER))
733  if (move_monster(op) || QUERY_FLAG(op, FLAG_FREED))
734  return 1;
735 
736  if ((QUERY_FLAG(op, FLAG_ANIMATE) && op->anim_speed == 0)
737  || (op->temp_animation_id && op->temp_anim_speed == 0)) {
738  op->state++;
739  if (op->type == PLAYER)
740  animate_object(op, op->facing);
741  else
742  animate_object(op, op->direction);
743 
744  if (QUERY_FLAG(op, FLAG_SEE_ANYWHERE))
745  make_sure_seen(op);
746  }
747  if (QUERY_FLAG(op, FLAG_CHANGING) && !op->state) {
748  change_object(op);
749  return 1;
750  }
752  generate_monster(op);
753 
754  if (QUERY_FLAG(op, FLAG_IS_USED_UP) && --op->stats.food <= 0) {
755  if (QUERY_FLAG(op, FLAG_APPLIED))
756  remove_force(op);
757  else {
758  remove_ob(op);
759  if (QUERY_FLAG(op, FLAG_SEE_ANYWHERE))
760  make_sure_not_seen(op);
761  free_object(op);
762  }
763  return 1;
764  }
765  return (ob_process(op) == METHOD_OK ? 1 : 0);
766 }
767 
768 void legacy_remove_force(object *op) {
769  remove_force(op);
770 }
771 
772 void legacy_animate_trigger(object *op) {
773  animate_trigger(op);
774 }
775 
776 void legacy_move_hole(object *op) {
777  move_hole(op);
778 }
char path[HUGE_BUF]
Definition: map.h:384
signed char sint8
Definition: global.h:80
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, sint16 x, sint16 y, sint16 *nx, sint16 *ny)
Definition: map.c:330
#define FLAG_NO_DROP
Definition: define.h:585
Definition: player.h:146
#define MOVE_WALK
Definition: define.h:700
#define UP_OBJ_FACE
Definition: object.h:356
MoveType move_type
Definition: object.h:277
int find_multi_free_spot_within_radius(object *ob, object *gen, int *hx, int *hy)
Definition: object.c:3052
const char * get_ob_key_value(const object *op, const char *const key)
Definition: object.c:3701
int move_player(object *op, int dir)
Definition: player.c:2741
MoveType move_on
Definition: object.h:280
signed short sint16
Definition: global.h:72
int free_no_drop(object *op)
Definition: time.c:536
long strtol(register char *str, char **ptr, register int base)
Definition: porting.c:339
#define FABS(x)
Definition: define.h:61
signed int sint32
Definition: global.h:64
#define FLAG_IS_USED_UP
Definition: define.h:556
#define FLAG_FRIENDLY
Definition: define.h:542
static void generate_monster(object *gen)
Definition: time.c:222
void unflag_inv(object *op, int flag)
Definition: object.c:2894
#define MSG_TYPE_ITEM
Definition: newclient.h:334
object * insert_ob_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Definition: object.c:1761
#define DOOR
Definition: define.h:135
#define HUGE_BUF
Definition: define.h:83
#define SET_ANIMATION(ob, newanim)
Definition: global.h:247
struct treasureliststruct * randomitems
Definition: object.h:236
#define MAP_HEIGHT(m)
Definition: map.h:99
object clone
Definition: object.h:326
sint16 duration
Definition: object.h:254
short freearr_x[SIZEOFFREE]
Definition: object.c:75
object * merge_ob(object *op, object *top)
Definition: object.c:1724
void draw_ext_info(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
Definition: standalone.c:171
const char * slaying
Definition: object.h:172
#define NROFNEWOBJS(xyz)
Definition: define.h:688
#define FLAG_CONFUSED
Definition: define.h:608
void update_object(object *op, int action)
Definition: object.c:1112
uint8 subtype
Definition: object.h:190
void check_spell_expiry(object *spell)
Definition: spell_util.c:1854
struct obj * above
Definition: object.h:146
method_ret ob_process(object *op)
Definition: ob_methods.c:79
void fix_stopped_item(object *op, mapstruct *map, object *originator)
Definition: time.c:466
#define FLAG_SEE_ANYWHERE
Definition: define.h:615
sint16 x
Definition: object.h:179
void make_sure_seen(const object *op)
Definition: los.c:644
sint16 sp
Definition: living.h:83
uint8 temp_anim_speed
Definition: object.h:271
static void animate_trigger(object *op)
Definition: time.c:351
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
Definition: standalone.c:175
struct archt * other_arch
Definition: object.h:264
Definition: object.h:321
#define PLAYER
Definition: define.h:113
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END
Definition: newclient.h:481
sint16 maxsp
Definition: living.h:84
#define FLAG_REMOVED
Definition: define.h:528
sint16 hp
Definition: living.h:81
void remove_locked_door(object *op)
Definition: time.c:80
short freearr_y[SIZEOFFREE]
Definition: object.c:81
static void remove_force(object *op)
Definition: time.c:284
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
Definition: treasure.c:499
int rndm(int min, int max)
Definition: utils.c:174
char * name
Definition: map.h:349
void fix_multipart_object(object *tmp)
Definition: object.c:4007
object * stop_item(object *op)
Definition: time.c:426
int change_abil(object *op, object *tmp)
Definition: living.c:443
void remove_ob(object *op)
Definition: object.c:1515
#define FLAG_ALIVE
Definition: define.h:526
static void move_hole(object *op)
Definition: time.c:367
object * get_player_container(object *op)
Definition: object.c:356
float speed_left
Definition: object.h:182
int move_monster(object *op)
Definition: monster.c:566
sint32 weight
Definition: object.h:216
#define METHOD_OK
Definition: ob_methods.h:42
struct mapdef * map
Definition: object.h:155
#define FLAG_CHANGING
Definition: define.h:559
int should_director_abort(object *op, object *victim)
Definition: apply.c:81
int find_first_free_spot(const object *ob, mapstruct *m, int x, int y)
Definition: object.c:3240
sint16 dam
Definition: living.h:87
uint16 temp_animation_id
Definition: object.h:270
#define MSG_TYPE_ATTRIBUTE
Definition: newclient.h:327
const char * name
Definition: object.h:167
struct obj * env
Definition: object.h:151
object * fix_stopped_arrow(object *op)
Definition: time.c:483
object * present(uint8 type, mapstruct *m, int x, int y)
Definition: object.c:2782
struct obj * below
Definition: object.h:145
struct archt * more
Definition: object.h:325
uint16 difficulty
Definition: map.h:364
void generate_artifact(object *op, int difficulty)
Definition: treasure.c:1906
#define FLAG_IS_A_TEMPLATE
Definition: define.h:671
#define MSG_TYPE_ITEM_CHANGE
Definition: newclient.h:559
object * object_create_clone(object *asrc)
Definition: object.c:3608
uint32 nrof
Definition: object.h:184
#define P_OUT_OF_MAP
Definition: map.h:272
sint8 facing
Definition: object.h:186
sint16 y
Definition: object.h:179
struct pl * contr
Definition: object.h:134
#define LOCKED_DOOR
Definition: define.h:132
#define FORCE_CONFUSION
Definition: spells.h:171
#define FREE_AND_CLEAR_STR(xyz)
Definition: global.h:283
char * spellarg
Definition: object.h:260
float speed
Definition: object.h:181
#define QUERY_FLAG(xyz, p)
Definition: define.h:514
uint8 state
Definition: object.h:200
#define CLEAR_FLAG(xyz, p)
Definition: define.h:512
object * insert_ob_in_ob(object *op, object *where)
Definition: object.c:2510
void legacy_remove_force(object *op)
Definition: time.c:768
#define GENERATE_SPEED(xyz)
Definition: define.h:746
method_ret ob_move_on(object *op, object *victim, object *originator)
Definition: ob_methods.c:122
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
Definition: object.c:1992
const char * skill
Definition: object.h:174
sint8 wc
Definition: living.h:79
void move_firewall(object *op)
Definition: time.c:610
#define LAMP
Definition: define.h:263
#define EVENT_TIME
Definition: plugin.h:69
#define THROWN_OBJ
Definition: define.h:170
void animate_object(object *op, int dir)
Definition: anim.c:186
void legacy_animate_trigger(object *op)
Definition: time.c:772
#define FLAG_ANIMATE
Definition: define.h:538
static void generate_monster_arch(object *gen)
Definition: time.c:168
void move_player_mover(object *op)
Definition: time.c:639
uint32 attacktype
Definition: object.h:193
#define FLAG_GENERATOR
Definition: define.h:544
sint8 direction
Definition: object.h:185
struct obj * owner
Definition: object.h:228
sint16 grace
Definition: living.h:85
int set_ob_key_value(object *op, const char *key, const char *value, int add_key)
Definition: object.c:3826
void free_object2(object *ob, int free_inventory)
Definition: object.c:1258
#define NUM_ANIMATIONS(ob)
Definition: global.h:255
living stats
Definition: object.h:219
struct archt * arch
Definition: object.h:263
#define MAP_WIDTH(m)
Definition: map.h:97
#define PLAYERMOVER
Definition: define.h:154
#define FLAG_APPLIED
Definition: define.h:531
int move_object(object *op, int dir)
Definition: move.c:53
void query_short_name(const object *op, char *buf, size_t size)
Definition: item.c:551
int execute_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Definition: standalone.c:225
#define FLAG_LIFESAVE
Definition: define.h:602
uint32 fire_on
Definition: player.h:181
void update_ob_speed(object *op)
Definition: object.c:1008
sstring add_string(const char *str)
Definition: shstr.c:116
#define MIN_ACTIVE_SPEED
Definition: define.h:1063
#define GET_MAP_OB(M, X, Y)
Definition: map.h:193
#define FORCE_TRANSFORMED_ITEM
Definition: spells.h:173
#define FLAG_MONSTER
Definition: define.h:541
uint8 anim_speed
Definition: object.h:268
struct obj * inv
Definition: object.h:148
#define NDI_UNIQUE
Definition: newclient.h:219
struct obj * head
Definition: object.h:154
void LOG(LogLevel logLevel, const char *format,...)
Definition: logger.c:63
#define ARROW
Definition: define.h:125
static void change_object(object *op)
Definition: time.c:559
int check_trigger(object *op, object *cause)
Definition: button.c:525
void free_object(object *ob)
Definition: object.c:1238
Definition: map.h:346
New_Face * face
Definition: object.h:183
#define FLAG_WIZPASS
Definition: define.h:611
void make_sure_not_seen(const object *op)
Definition: los.c:667
static void generate_monster_inv(object *gen)
Definition: time.c:114
sint16 level
Definition: object.h:202
void fix_object(object *op)
Definition: living.c:900
void legacy_move_hole(object *op)
Definition: time.c:776
struct obj * more
Definition: object.h:153
object * arch_to_object(archetype *at)
Definition: arch.c:576
#define FLAG_CONTENT_ON_GEN
Definition: define.h:670
#define SCRIPT_FIX_NOTHING
Definition: global.h:451
sint32 value
Definition: object.h:201
#define HAS_RANDOM_ITEMS(op)
Definition: define.h:470
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Definition: spell_util.c:1308
uint8 type
Definition: object.h:189
int process_object(object *op)
Definition: time.c:724
sint32 food
Definition: living.h:89
#define FLAG_FREED
Definition: define.h:529
void remove_door(object *op)
Definition: time.c:51