- Rundenzählung für Parteien überarbeitet, noch einmal. Sollte jetzt endlich zu den Regeln passen.
This commit is contained in:
Enno Rehling 2006-04-07 21:49:38 +00:00
parent 029a187be0
commit 07fbf26a4a
1 changed files with 27 additions and 6 deletions

View File

@ -69,7 +69,7 @@
#define dbgprintf(a) fprintf a; #define dbgprintf(a) fprintf a;
static FILE *bdebug; static FILE *bdebug;
#undef COUNT_DF
#undef DELAYED_OFFENSE /* non-guarding factions cannot attack after moving */ #undef DELAYED_OFFENSE /* non-guarding factions cannot attack after moving */
#define TACTICS_RANDOM 5 /* define this as 1 to deactivate */ #define TACTICS_RANDOM 5 /* define this as 1 to deactivate */
@ -1577,6 +1577,7 @@ do_combatspell(troop at, int row)
if (level > 0) { if (level > 0) {
pay_spell(mage, sp, level, 1); pay_spell(mage, sp, level, 1);
at.fighter->action_counter++; 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) { if (!standard_attack && af->person[ta.index].last_action < b->turn) {
af->person[ta.index].last_action = b->turn; af->person[ta.index].last_action = b->turn;
af->action_counter++; af->action_counter++;
af->side->bf->lastturn = b->turn;
} }
} }
if (standard_attack) { if (standard_attack) {
@ -1995,14 +1997,17 @@ attack(battle *b, troop ta, const att *a, int numattack)
else return; else return;
} }
if (!td.fighter) return; if (!td.fighter) return;
#ifdef COUNT_DF
if (td.fighter->person[td.index].last_action < b->turn) { if (td.fighter->person[td.index].last_action < b->turn) {
td.fighter->person[td.index].last_action = b->turn; td.fighter->person[td.index].last_action = b->turn;
td.fighter->action_counter++; td.fighter->action_counter++;
td.fighter->side->bf->lastturn = b->turn;
} }
#endif
if (ta.fighter->person[ta.index].last_action < b->turn) { if (ta.fighter->person[ta.index].last_action < b->turn) {
ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->person[ta.index].last_action = b->turn;
ta.fighter->action_counter++; ta.fighter->action_counter++;
ta.fighter->side->bf->lastturn = b->turn;
} }
reload = true; reload = true;
if (hits(ta, td, wp)) { if (hits(ta, td, wp)) {
@ -2027,13 +2032,17 @@ attack(battle *b, troop ta, const att *a, int numattack)
case AT_NATURAL: case AT_NATURAL:
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
if (!td.fighter) return; if (!td.fighter) return;
#ifdef COUNT_DF
if(td.fighter->person[td.index].last_action < b->turn) { if(td.fighter->person[td.index].last_action < b->turn) {
td.fighter->person[td.index].last_action = b->turn; td.fighter->person[td.index].last_action = b->turn;
td.fighter->action_counter++; td.fighter->action_counter++;
td.fighter->side->bf->lastturn = b->turn;
} }
#endif
if(ta.fighter->person[ta.index].last_action < b->turn) { if(ta.fighter->person[ta.index].last_action < b->turn) {
ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->person[ta.index].last_action = b->turn;
ta.fighter->action_counter++; ta.fighter->action_counter++;
ta.fighter->side->bf->lastturn = b->turn;
} }
if (hits(ta, td, NULL)) { if (hits(ta, td, NULL)) {
terminate(td, ta, a->type, a->data.dice, false); 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: case AT_DRAIN_ST:
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
if (!td.fighter) return; if (!td.fighter) return;
#ifdef COUNT_DF
if(td.fighter->person[td.index].last_action < b->turn) { if(td.fighter->person[td.index].last_action < b->turn) {
td.fighter->person[td.index].last_action = b->turn; td.fighter->person[td.index].last_action = b->turn;
td.fighter->action_counter++; td.fighter->action_counter++;
td.fighter->side->bf->lastturn = b->turn;
} }
#endif
if(ta.fighter->person[ta.index].last_action < b->turn) { if(ta.fighter->person[ta.index].last_action < b->turn) {
ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->person[ta.index].last_action = b->turn;
ta.fighter->action_counter++; ta.fighter->action_counter++;
ta.fighter->side->bf->lastturn = b->turn;
} }
if (hits(ta, td, NULL)) { if (hits(ta, td, NULL)) {
int c = dice_rand(a->data.dice); 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: case AT_DRAIN_EXP:
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
if (!td.fighter) return; if (!td.fighter) return;
#ifdef COUNT_DF
if(td.fighter->person[td.index].last_action < b->turn) { if(td.fighter->person[td.index].last_action < b->turn) {
td.fighter->person[td.index].last_action = b->turn; td.fighter->person[td.index].last_action = b->turn;
td.fighter->action_counter++; td.fighter->action_counter++;
td.fighter->side->bf->lastturn = b->turn;
} }
#endif
if(ta.fighter->person[ta.index].last_action < b->turn) { if(ta.fighter->person[ta.index].last_action < b->turn) {
ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->person[ta.index].last_action = b->turn;
ta.fighter->action_counter++; ta.fighter->action_counter++;
ta.fighter->side->bf->lastturn = b->turn;
} }
if (hits(ta, td, NULL)) { if (hits(ta, td, NULL)) {
drain_exp(td.fighter->unit, dice_rand(a->data.dice)); 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: case AT_DAZZLE:
td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset); td = select_opponent(b, ta, melee_range[0]-offset, melee_range[1]-offset);
if (!td.fighter) return; if (!td.fighter) return;
#ifdef COUNT_DF
if(td.fighter->person[td.index].last_action < b->turn) { if(td.fighter->person[td.index].last_action < b->turn) {
td.fighter->person[td.index].last_action = b->turn; td.fighter->person[td.index].last_action = b->turn;
td.fighter->action_counter++; td.fighter->action_counter++;
td.fighter->side->bf->lastturn = b->turn;
} }
#endif
if(ta.fighter->person[ta.index].last_action < b->turn) { if(ta.fighter->person[ta.index].last_action < b->turn) {
ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->person[ta.index].last_action = b->turn;
ta.fighter->action_counter++; ta.fighter->action_counter++;
ta.fighter->side->bf->lastturn = b->turn;
} }
if (hits(ta, td, NULL)) { if (hits(ta, td, NULL)) {
dazzle(b, &td); 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) { if(ta.fighter->person[ta.index].last_action < b->turn) {
ta.fighter->person[ta.index].last_action = b->turn; ta.fighter->person[ta.index].last_action = b->turn;
ta.fighter->action_counter++; ta.fighter->action_counter++;
ta.fighter->side->bf->lastturn = b->turn;
} }
if (td.fighter->unit->ship) { if (td.fighter->unit->ship) {
td.fighter->unit->ship->damage += DAMAGE_SCALE * dice_rand(a->data.dice); 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(s, b->sides) {
cv_foreach(s2, 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; cont = true;
s->bf->lastturn = b->turn; break;
s2->bf->lastturn = b->turn;
} }
} cv_next(s2); } cv_next(s2);
if (cont) break;
} cv_next(s); } cv_next(s);
printf(" %d", b->turn); printf(" %d", b->turn);