ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/monster.C
(Generate patch)

Comparing deliantra/server/server/monster.C (file contents):
Revision 1.1 by elmex, Sun Aug 13 17:16:04 2006 UTC vs.
Revision 1.2 by root, Sat Aug 26 23:36:34 2006 UTC

1/* 1/*
2 * static char *rcsid_monster_c = 2 * static char *rcsid_monster_c =
3 * "$Id: monster.C,v 1.1 2006/08/13 17:16:04 elmex Exp $"; 3 * "$Id: monster.C,v 1.2 2006/08/26 23:36:34 root Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
313 /* we have an enemy, just tell him we want him dead */ 313 /* we have an enemy, just tell him we want him dead */
314 enemy->attacked_by = op; /* our ptr */ 314 enemy->attacked_by = op; /* our ptr */
315 enemy->attacked_by_count = op->count; /* our tag */ 315 enemy->attacked_by_count = op->count; /* our tag */
316 } 316 }
317 317
318 if ( QUERY_FLAG(op, FLAG_SLEEP) || QUERY_FLAG(op, FLAG_BLIND) ||
319 ((op->map->darkness>0) && !QUERY_FLAG(op,FLAG_SEE_IN_DARK) &&
320 !QUERY_FLAG(op,FLAG_SEE_INVISIBLE))) {
321 if(!check_wakeup(op,enemy,&rv))
322 return 0;
323 }
324
325 /* check if monster pops out of hidden spot */
326 if(op->hide) do_hidden_move(op);
327
328 if(op->pick_up)
329 monster_check_pickup(op);
330
331 if(op->will_apply)
332 monster_apply_below(op); /* Check for items to apply below */
333
334 /* generate hp, if applicable */ 318 /* generate hp, if applicable */
335 if(op->stats.Con > 0 && op->stats.hp < op->stats.maxhp) { 319 if(op->stats.Con > 0 && op->stats.hp < op->stats.maxhp) {
336 320
337 /* last heal is in funny units. Dividing by speed puts 321 /* last heal is in funny units. Dividing by speed puts
338 * the regeneration rate on a basis of time instead of 322 * the regeneration rate on a basis of time instead of
379 */ 363 */
380 if(QUERY_FLAG(op, FLAG_SCARED) &&!(RANDOM()%20)) { 364 if(QUERY_FLAG(op, FLAG_SCARED) &&!(RANDOM()%20)) {
381 CLEAR_FLAG(op,FLAG_SCARED); /* Time to regain some "guts"... */ 365 CLEAR_FLAG(op,FLAG_SCARED); /* Time to regain some "guts"... */
382 } 366 }
383 367
384 if (execute_event (op, EVENT_MOVE, op->enemy, 0, 0, SCRIPT_FIX_ALL)) 368 if (INVOKE_OBJECT (MOVE, op, ARG_OBJECT (op->enemy)))//TODO: should go away
385 return 0; 369 return 0;
370
371 if ( QUERY_FLAG(op, FLAG_SLEEP) || QUERY_FLAG(op, FLAG_BLIND) ||
372 ((op->map->darkness>0) && !QUERY_FLAG(op,FLAG_SEE_IN_DARK) &&
373 !QUERY_FLAG(op,FLAG_SEE_INVISIBLE))) {
374 if(!check_wakeup(op,enemy,&rv))
375 return 0;
376 }
377
378 /* check if monster pops out of hidden spot */
379 if(op->hide) do_hidden_move(op);
380
381 if(op->pick_up)
382 monster_check_pickup(op);
383
384 if(op->will_apply)
385 monster_apply_below(op); /* Check for items to apply below */
386 386
387 /* If we don't have an enemy, do special movement or the like */ 387 /* If we don't have an enemy, do special movement or the like */
388 if(!enemy) { 388 if(!enemy) {
389 if(QUERY_FLAG(op, FLAG_ONLY_ATTACK)) { 389 if(QUERY_FLAG(op, FLAG_ONLY_ATTACK)) {
390 remove_ob(op); 390 remove_ob(op);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines