From 07fbf26a4ae08e023da2992857897aa0e4b72795 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 7 Apr 2006 21:49:38 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D87?= =?UTF-8?q?6=20-=20Rundenz=C3=A4hlung=20f=C3=BCr=20Parteien=20=C3=BCberarb?= =?UTF-8?q?eitet,=20noch=20einmal.=20Sollte=20jetzt=20endlich=20zu=20den?= =?UTF-8?q?=20Regeln=20passen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/battle.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 10a364f6a..8ebad9764 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -69,7 +69,7 @@ #define dbgprintf(a) fprintf a; static FILE *bdebug; - +#undef COUNT_DF #undef DELAYED_OFFENSE /* non-guarding factions cannot attack after moving */ #define TACTICS_RANDOM 5 /* define this as 1 to deactivate */ @@ -1577,6 +1577,7 @@ do_combatspell(troop at, int row) if (level > 0) { pay_spell(mage, sp, level, 1); at.fighter->action_counter++; + at.fighter->side->bf->lastturn = b->turn; } } } @@ -1981,6 +1982,7 @@ attack(battle *b, troop ta, const att *a, int numattack) if (!standard_attack && af->person[ta.index].last_action < b->turn) { af->person[ta.index].last_action = b->turn; af->action_counter++; + af->side->bf->lastturn = b->turn; } } if (standard_attack) { @@ -1995,14 +1997,17 @@ attack(battle *b, troop ta, const att *a, int numattack) else return; } if (!td.fighter) return; - +#ifdef COUNT_DF if (td.fighter->person[td.index].last_action < b->turn) { td.fighter->person[td.index].last_action = b->turn; td.fighter->action_counter++; + td.fighter->side->bf->lastturn = b->turn; } +#endif if (ta.fighter->person[ta.index].last_action < b->turn) { ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->action_counter++; + ta.fighter->side->bf->lastturn = b->turn; } reload = true; if (hits(ta, td, wp)) { @@ -2027,13 +2032,17 @@ attack(battle *b, troop ta, const att *a, int numattack) case AT_NATURAL: td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); if (!td.fighter) return; +#ifdef COUNT_DF if(td.fighter->person[td.index].last_action < b->turn) { td.fighter->person[td.index].last_action = b->turn; td.fighter->action_counter++; + td.fighter->side->bf->lastturn = b->turn; } +#endif if(ta.fighter->person[ta.index].last_action < b->turn) { ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->action_counter++; + ta.fighter->side->bf->lastturn = b->turn; } if (hits(ta, td, NULL)) { terminate(td, ta, a->type, a->data.dice, false); @@ -2042,13 +2051,17 @@ attack(battle *b, troop ta, const att *a, int numattack) case AT_DRAIN_ST: td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); if (!td.fighter) return; +#ifdef COUNT_DF if(td.fighter->person[td.index].last_action < b->turn) { td.fighter->person[td.index].last_action = b->turn; td.fighter->action_counter++; + td.fighter->side->bf->lastturn = b->turn; } +#endif if(ta.fighter->person[ta.index].last_action < b->turn) { ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->action_counter++; + ta.fighter->side->bf->lastturn = b->turn; } if (hits(ta, td, NULL)) { int c = dice_rand(a->data.dice); @@ -2065,13 +2078,17 @@ attack(battle *b, troop ta, const att *a, int numattack) case AT_DRAIN_EXP: td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); if (!td.fighter) return; +#ifdef COUNT_DF if(td.fighter->person[td.index].last_action < b->turn) { td.fighter->person[td.index].last_action = b->turn; td.fighter->action_counter++; + td.fighter->side->bf->lastturn = b->turn; } +#endif if(ta.fighter->person[ta.index].last_action < b->turn) { ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->action_counter++; + ta.fighter->side->bf->lastturn = b->turn; } if (hits(ta, td, NULL)) { drain_exp(td.fighter->unit, dice_rand(a->data.dice)); @@ -2080,13 +2097,17 @@ attack(battle *b, troop ta, const att *a, int numattack) case AT_DAZZLE: td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); if (!td.fighter) return; +#ifdef COUNT_DF if(td.fighter->person[td.index].last_action < b->turn) { td.fighter->person[td.index].last_action = b->turn; td.fighter->action_counter++; + td.fighter->side->bf->lastturn = b->turn; } +#endif if(ta.fighter->person[ta.index].last_action < b->turn) { ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->action_counter++; + ta.fighter->side->bf->lastturn = b->turn; } if (hits(ta, td, NULL)) { dazzle(b, &td); @@ -2098,6 +2119,7 @@ attack(battle *b, troop ta, const att *a, int numattack) if(ta.fighter->person[ta.index].last_action < b->turn) { ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->action_counter++; + ta.fighter->side->bf->lastturn = b->turn; } if (td.fighter->unit->ship) { td.fighter->unit->ship->damage += DAMAGE_SCALE * dice_rand(a->data.dice); @@ -3290,13 +3312,12 @@ battle_report(battle * b) cv_foreach(s, b->sides) { cv_foreach(s2, b->sides) { - if (s->alive-s->removed > 0 && s2->alive-s2->removed > 0 && enemy(s, s2)) - { + if (s->alive-s->removed > 0 && s2->alive-s2->removed > 0 && enemy(s, s2)) { cont = true; - s->bf->lastturn = b->turn; - s2->bf->lastturn = b->turn; + break; } } cv_next(s2); + if (cont) break; } cv_next(s); printf(" %d", b->turn);