forked from github/server
Set populationdamage=0
rename to rules.combat.populationdamage
This commit is contained in:
parent
56e7060c2f
commit
ef883c23e0
4 changed files with 54 additions and 28 deletions
|
@ -538,28 +538,49 @@ reportcasualties(battle * b, fighter * fig, int dead)
|
|||
msg_release(m);
|
||||
}
|
||||
|
||||
static int
|
||||
contest_classic(int skilldiff, const armor_type * ar, const armor_type * sh)
|
||||
{
|
||||
int p, vw = BASE_CHANCE - TDIFF_CHANGE * skilldiff;
|
||||
double mod = 1.0;
|
||||
|
||||
if (ar != NULL)
|
||||
mod *= (1 + ar->penalty);
|
||||
if (sh != NULL)
|
||||
mod *= (1 + sh->penalty);
|
||||
vw = (int)(100 - ((100 - vw) * mod));
|
||||
|
||||
do {
|
||||
p = rng_int() % 100;
|
||||
vw -= p;
|
||||
}
|
||||
while (vw >= 0 && p >= 90);
|
||||
return (vw <= 0);
|
||||
}
|
||||
|
||||
/** new rule for Eressea 1.5
|
||||
* \param skilldiff - the attack skill with every modifier applied
|
||||
*/
|
||||
static int
|
||||
contest_new(int skilldiff, const troop dt, const armor_type * ar, const armor_type * sh)
|
||||
{
|
||||
double tohit = 0.5 + skilldiff * 0.1;
|
||||
if (tohit<0.5) tohit = 0.5;
|
||||
if (chance(tohit)) {
|
||||
int defense = effskill(dt.fighter->unit, SK_STAMINA);
|
||||
double tosave = defense * 0.05;
|
||||
return !chance(tosave);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
contest(int skilldiff, const armor_type * ar, const armor_type * sh)
|
||||
contest(int skdiff, const troop dt, const armor_type * ar, const armor_type * sh)
|
||||
{
|
||||
if (skill_formula==FORMULA_ORIG) {
|
||||
int p, vw = BASE_CHANCE - TDIFF_CHANGE * skilldiff;
|
||||
double mod = 1.0;
|
||||
|
||||
if (ar != NULL)
|
||||
mod *= (1 + ar->penalty);
|
||||
if (sh != NULL)
|
||||
mod *= (1 + sh->penalty);
|
||||
vw = (int)(100 - ((100 - vw) * mod));
|
||||
|
||||
do {
|
||||
p = rng_int() % 100;
|
||||
vw -= p;
|
||||
}
|
||||
while (vw >= 0 && p >= 90);
|
||||
return (vw <= 0);
|
||||
return contest_classic(skdiff, ar, sh);
|
||||
} else {
|
||||
return 1;
|
||||
return contest_new(skdiff, dt, ar, sh);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1842,7 +1863,7 @@ hits(troop at, troop dt, weapon * awp)
|
|||
/* Verteidiger bekommt eine Rüstung */
|
||||
armor = select_armor(dt, true);
|
||||
shield = select_armor(dt, false);
|
||||
if (contest(skdiff, armor, shield)) {
|
||||
if (contest(skdiff, dt, armor, shield)) {
|
||||
if (bdebug) {
|
||||
debug_hit(at, awp, dt, dwp, skdiff, dist, true);
|
||||
}
|
||||
|
@ -2311,8 +2332,8 @@ PopulationDamage(void)
|
|||
{
|
||||
static double value = -1.0;
|
||||
if (value<0) {
|
||||
const char * str = get_param(global.parameters, "battle.populationdamage");
|
||||
value = str?atof(str):(BATTLE_KILLS_PEASANTS/100.0);
|
||||
int damage = get_param_int(global.parameters, "rules.combat.populationdamage", BATTLE_KILLS_PEASANTS);
|
||||
value = damage/100.0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
@ -2323,9 +2344,11 @@ battle_effects(battle * b, int dead_players)
|
|||
{
|
||||
region * r = b->region;
|
||||
int dead_peasants = MIN(rpeasants(r), (int)(dead_players*PopulationDamage()));
|
||||
deathcounts(r, dead_peasants + dead_players);
|
||||
chaoscounts(r, dead_peasants / 2);
|
||||
rsetpeasants(r, rpeasants(r) - dead_peasants);
|
||||
if (dead_peasants) {
|
||||
deathcounts(r, dead_peasants + dead_players);
|
||||
chaoscounts(r, dead_peasants / 2);
|
||||
rsetpeasants(r, rpeasants(r) - dead_peasants);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3402,7 +3425,7 @@ battle_report(battle * b)
|
|||
}
|
||||
}
|
||||
|
||||
printf(" %d", b->turn);
|
||||
if (verbosity>0) log_stdio(stdout, " %d", b->turn);
|
||||
fflush(stdout);
|
||||
|
||||
for (bf=b->factions;bf;bf=bf->next) {
|
||||
|
@ -4055,7 +4078,7 @@ do_battle(region * r)
|
|||
do_combatmagic(b, DO_PRECOMBATSPELL);
|
||||
|
||||
print_stats(b); /* gibt die Kampfaufstellung aus */
|
||||
log_stdio(stdout, "%s (%d, %d) : ", rname(r, NULL), r->x, r->y);
|
||||
if (verbosity>0) log_stdio(stdout, "%s (%d, %d) : ", rname(r, NULL), r->x, r->y);
|
||||
|
||||
for (;battle_report(b) && b->turn<=max_turns;++b->turn) {
|
||||
if (bdebug) {
|
||||
|
@ -4079,7 +4102,7 @@ do_battle(region * r)
|
|||
#endif /* KARMA_MODULE */
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
if (verbosity>0) log_stdio(stdout, "\n");
|
||||
|
||||
/* Auswirkungen berechnen: */
|
||||
aftermath(b);
|
||||
|
|
|
@ -22,6 +22,7 @@ Kampf:
|
|||
= done (rules.combat_turns)
|
||||
- neue Trefferchanceberechnung
|
||||
- neue Beuteregelung
|
||||
- Gegnerlimits
|
||||
|
||||
Gegenstände:
|
||||
- Waffen mit höherem Schaden.
|
||||
|
@ -29,7 +30,7 @@ Gegenstände:
|
|||
|
||||
Diverse:
|
||||
- neue Terraintypen (weniger Bauern, knappere Ressourcen)
|
||||
- limitierte Rekrutieren von Migranten erlauben
|
||||
- limitiertes Rekrutieren von Migranten erlauben
|
||||
- Parteitarnung fällt weg
|
||||
= done (disable TARNEN)
|
||||
- Monster entfernen
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<xi:include href="common/luxuries.xml" />
|
||||
<xi:include href="common/potions.xml" />
|
||||
<xi:include href="common/resources.xml" />
|
||||
<xi:include href="eressea2/equipment.xml"/>
|
||||
<xi:include href="eressea2/races.xml"/>
|
||||
<xi:include href="eressea2/spells.xml"/>
|
||||
<xi:include href="eressea2/terrains.xml"/>
|
||||
|
@ -102,6 +103,7 @@
|
|||
<param name="rules.combat.skill_bonus" value="0"/>
|
||||
<param name="rules.combat.turns" value="1"/>
|
||||
<param name="rules.combat.unarmed_bonus" value="0"/>
|
||||
<param name="rules.combat.populationdamage" value="0"/>
|
||||
<param name="rules.give" value="3"/> <!-- only self + peasants -->
|
||||
<param name="rules.stamina" value="0"/> <!-- does not affect hp -->
|
||||
<param name="skill.maxlevel" value="10"/>
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
<param name="NewbieImmunity" value="4"/>
|
||||
<param name="hunger.long" value="1"/>
|
||||
<param name="rules.check_overload" value="0"/>
|
||||
<param name="battle.populationdamage" value="0"/>
|
||||
<param name="rules.combat.populationdamage" value="0"/>
|
||||
|
||||
<param name="functions.wage" value="get_wage"/>
|
||||
<param name="functions.maintenance" value="get_maintenance"/>
|
||||
|
|
Loading…
Reference in a new issue