1 | /* |
1 | /* |
2 | * static char *rcsid_spell_util_c = |
2 | * static char *rcsid_spell_util_c = |
3 | * "$Id: spell_util.c,v 1.3 2006/03/13 21:33:23 root Exp $"; |
3 | * "$Id: spell_util.c,v 1.4 2006/03/13 23:59:29 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
… | |
… | |
473 | * limits one spell effect per space per spell. This is definately |
473 | * limits one spell effect per space per spell. This is definately |
474 | * needed for performance reasons, and just for playability I believe. |
474 | * needed for performance reasons, and just for playability I believe. |
475 | * there are no such things as multispaced spells right now, so |
475 | * there are no such things as multispaced spells right now, so |
476 | * we don't need to worry about the head. |
476 | * we don't need to worry about the head. |
477 | */ |
477 | */ |
478 | if (tmp->type == op->type && tmp->subtype == op->subtype) { |
478 | if (tmp->stats.maxhp == op->stats.maxhp |
479 | tmp->stats.maxhp = MAX(tmp->stats.maxhp,op->stats.maxhp); |
479 | && tmp->type == op->type |
|
|
480 | && tmp->subtype == op->subtype) |
480 | return 0; |
481 | return 0; |
|
|
482 | |
|
|
483 | /* |
|
|
484 | * Combine similar spell effects into one spell effect. Needed for |
|
|
485 | * performance reasons with meteor swarm and the like, but also for |
|
|
486 | * playability reasons. |
|
|
487 | */ |
|
|
488 | if (tmp->arch == op->arch |
|
|
489 | && tmp->type == op->type |
|
|
490 | && tmp->subtype == op->subtype |
|
|
491 | && tmp->owner == op->owner |
|
|
492 | && ((tmp->subtype == SP_EXPLOSION) |
|
|
493 | || (tmp->subtype == SP_CONE && tmp->stats.sp == op->stats.sp)) |
|
|
494 | ) { |
|
|
495 | tmp->stats.dam = MAX (tmp->stats.dam, op->stats.dam); |
|
|
496 | tmp->range = MAX (tmp->range, op->range); |
|
|
497 | tmp->duration = MAX (tmp->duration, op->duration); |
|
|
498 | return 0; |
481 | } |
499 | } |
482 | |
500 | |
483 | /* Perhaps we should also put checks in for no magic and unholy |
501 | /* Perhaps we should also put checks in for no magic and unholy |
484 | * ground to prevent it from moving along? |
502 | * ground to prevent it from moving along? |
485 | */ |
503 | */ |