From bcca725608575f5e1c24110356d5ffad25d1e125 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 11 Sep 2004 20:06:07 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000244 http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000251 http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000213 - Die 10% Regel war noch aktiv. defines vor den includes, boese! --- src/common/kernel/battle.c | 67 ++++++++++++-------------------------- 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 9828a4ebe..84b71e28c 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -12,28 +12,6 @@ * prior permission by the authors of Eressea. */ -#define SHOW_KILLS -#undef DELAYED_OFFENSE /* non-guarding factions cannot attack after moving */ - -#define TACTICS_RANDOM 5 /* define this as 1 to deactivate */ -#define CATAPULT_INITIAL_RELOAD 4 /* erster schuss in runde 1 + rand() % INITIAL */ -#define CATAPULT_STRUCTURAL_DAMAGE - -#define BASE_CHANCE 70 /* 70% Basis-Überlebenschance */ -#ifdef NEW_COMBATSKILLS_RULE -#define TDIFF_CHANGE 5 /* 5% höher pro Stufe */ -#define DAMAGE_QUOTIENT 2 /* damage += skilldiff/DAMAGE_QUOTIENT */ -#else -#define TDIFF_CHANGE 10 -# define DAMAGE_QUOTIENT 1 /* damage += skilldiff/DAMAGE_QUOTIENT */ -#endif - -typedef enum combatmagic { - DO_PRECOMBATSPELL, - DO_POSTCOMBATSPELL -} combatmagic_t; - - #include #include "eressea.h" #include "battle.h" @@ -87,19 +65,30 @@ typedef enum combatmagic { #include #include -#ifdef HAVE_ZLIB -# include -# define dbgprintf(a) gzprintf a; -gzFile bdebug; -#elif HAVE_BZ2LIB -# include -# define dbgprintf(a) bz2printf a; -BZFILE *bdebug; +#define dbgprintf(a) fprintf a; +static FILE *bdebug; + +#define SHOW_KILLS +#undef DELAYED_OFFENSE /* non-guarding factions cannot attack after moving */ + +#define TACTICS_RANDOM 5 /* define this as 1 to deactivate */ +#define CATAPULT_INITIAL_RELOAD 4 /* erster schuss in runde 1 + rand() % INITIAL */ +#define CATAPULT_STRUCTURAL_DAMAGE + +#define BASE_CHANCE 70 /* 70% Basis-Überlebenschance */ +#ifdef NEW_COMBATSKILLS_RULE +#define TDIFF_CHANGE 5 /* 5% höher pro Stufe */ +#define DAMAGE_QUOTIENT 2 /* damage += skilldiff/DAMAGE_QUOTIENT */ #else -# define dbgprintf(a) fprintf a; -FILE *bdebug; +#define TDIFF_CHANGE 10 +# define DAMAGE_QUOTIENT 1 /* damage += skilldiff/DAMAGE_QUOTIENT */ #endif +typedef enum combatmagic { + DO_PRECOMBATSPELL, + DO_POSTCOMBATSPELL +} combatmagic_t; + /* external variables */ boolean nobattledebug = false; @@ -3171,16 +3160,8 @@ make_battle(region * r) char zFilename[MAX_PATH]; sprintf(zText, "%s/battles", basepath()); makedir(zText, 0700); -#ifdef HAVE_ZLIB - sprintf(zFilename, "%s/battle-%d-%s.log.gz", zText, obs_count, simplename(r)); - bdebug = gzopen(zFilename, "w"); -#elif HAVE_BZ2LIB - sprintf(zFilename, "%s/battle-%d-%s.log.bz2", zText, obs_count, simplename(r)); - bdebug = BZ2_bzopen(zFilename, "w");+ -#else sprintf(zFilename, "%s/battle-%d-%s.log", zText, obs_count, simplename(r)); bdebug = fopen(zFilename, "w"); -#endif if (!bdebug) log_error(("battles können nicht debugged werden\n")); else { dbgprintf((bdebug, "In %s findet ein Kampf statt:\n", rname(r, NULL))); @@ -3240,13 +3221,7 @@ free_battle(battle * b) int max_fac_no = 0; if (bdebug) { -#ifdef HAVE_ZLIB - gzclose(bdebug); -#elif HAVE_BZ2LIB - BZ2_bzclose(bdebug); -#else fclose(bdebug); -#endif } for (bf=b->factions;bf;bf=bf->next) {