eliminate SkillCap feature, it was stupid and not used by any game, ever

This commit is contained in:
Enno Rehling 2015-11-23 20:58:51 +01:00
parent a1b6befa7d
commit 0a47f0e398
4 changed files with 16 additions and 31 deletions

View File

@ -128,8 +128,8 @@ const troop no_troop = { 0, 0 };
#define DAMAGE_SKILL_BONUS (1<<4) #define DAMAGE_SKILL_BONUS (1<<4)
static int max_turns; static int max_turns;
static int damage_rules; static int rule_damage;
static int loot_rules; static int rule_loot;
static int skill_formula; static int skill_formula;
static int rule_cavalry_skill; static int rule_cavalry_skill;
static int rule_population_damage; static int rule_population_damage;
@ -157,7 +157,7 @@ static void init_rules(void)
rule_anon_battle = config_get_int("rules.stealth.anon_battle", 1) != 0; rule_anon_battle = config_get_int("rules.stealth.anon_battle", 1) != 0;
rule_cavalry_mode = config_get_int("rules.cavalry.mode", 1); rule_cavalry_mode = config_get_int("rules.cavalry.mode", 1);
rule_cavalry_skill = config_get_int("rules.cavalry.skill", 2); rule_cavalry_skill = config_get_int("rules.cavalry.skill", 2);
loot_rules = config_get_int("rules.combat.loot", rule_loot = config_get_int("rules.combat.loot",
LOOT_MONSTERS | LOOT_OTHERS | LOOT_KEEPLOOT); LOOT_MONSTERS | LOOT_OTHERS | LOOT_KEEPLOOT);
/* new formula to calculate to-hit-chance */ /* new formula to calculate to-hit-chance */
skill_formula = config_get_int("rules.combat.skill_formula", skill_formula = config_get_int("rules.combat.skill_formula",
@ -166,16 +166,16 @@ static void init_rules(void)
max_turns = config_get_int("rules.combat.turns", COMBAT_TURNS); max_turns = config_get_int("rules.combat.turns", COMBAT_TURNS);
/* damage calculation */ /* damage calculation */
if (config_get_int("rules.combat.critical", 1)) { if (config_get_int("rules.combat.critical", 1)) {
damage_rules |= DAMAGE_CRITICAL; rule_damage |= DAMAGE_CRITICAL;
} }
if (config_get_int("rules.combat.melee_bonus", 1)) { if (config_get_int("rules.combat.melee_bonus", 1)) {
damage_rules |= DAMAGE_MELEE_BONUS; rule_damage |= DAMAGE_MELEE_BONUS;
} }
if (config_get_int("rules.combat.missile_bonus", 1)) { if (config_get_int("rules.combat.missile_bonus", 1)) {
damage_rules |= DAMAGE_MISSILE_BONUS; rule_damage |= DAMAGE_MISSILE_BONUS;
} }
if (config_get_int("rules.combat.skill_bonus", 1)) { if (config_get_int("rules.combat.skill_bonus", 1)) {
damage_rules |= DAMAGE_SKILL_BONUS; rule_damage |= DAMAGE_SKILL_BONUS;
} }
} }
@ -1222,7 +1222,7 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
} }
if (type != AT_COMBATSPELL && type != AT_SPELL) { if (type != AT_COMBATSPELL && type != AT_SPELL) {
if (damage_rules & DAMAGE_CRITICAL) { if (rule_damage & DAMAGE_CRITICAL) {
double kritchance = (sk * 3 - sd) / 200.0; double kritchance = (sk * 3 - sd) / 200.0;
kritchance = _max(kritchance, 0.005); kritchance = _max(kritchance, 0.005);
@ -1240,19 +1240,19 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
if (awtype != NULL && fval(awtype, WTF_MISSILE)) { if (awtype != NULL && fval(awtype, WTF_MISSILE)) {
/* missile weapon bonus */ /* missile weapon bonus */
if (damage_rules & DAMAGE_MISSILE_BONUS) { if (rule_damage & DAMAGE_MISSILE_BONUS) {
da += af->person[at.index].damage_rear; da += af->person[at.index].damage_rear;
} }
} }
else { else {
/* melee bonus */ /* melee bonus */
if (damage_rules & DAMAGE_MELEE_BONUS) { if (rule_damage & DAMAGE_MELEE_BONUS) {
da += af->person[at.index].damage; da += af->person[at.index].damage;
} }
} }
/* Skilldifferenzbonus */ /* Skilldifferenzbonus */
if (damage_rules & DAMAGE_SKILL_BONUS) { if (rule_damage & DAMAGE_SKILL_BONUS) {
da += _max(0, (sk - sd) / DAMAGE_QUOTIENT); da += _max(0, (sk - sd) / DAMAGE_QUOTIENT);
} }
} }
@ -2577,20 +2577,20 @@ static void loot_items(fighter * corpse)
itm->number -= loot; itm->number -= loot;
maxloot -= loot; maxloot -= loot;
if (is_monsters(u->faction) && (loot_rules & LOOT_MONSTERS)) { if (is_monsters(u->faction) && (rule_loot & LOOT_MONSTERS)) {
looting = 1; looting = 1;
} }
else if (loot_rules & LOOT_OTHERS) { else if (rule_loot & LOOT_OTHERS) {
looting = 1; looting = 1;
} }
else if (loot_rules & LOOT_SELF) { else if (rule_loot & LOOT_SELF) {
looting = 2; looting = 2;
} }
if (looting) { if (looting) {
if (mustloot) { if (mustloot) {
maxrow = LAST_ROW; maxrow = LAST_ROW;
} }
else if (loot_rules & LOOT_KEEPLOOT) { else if (rule_loot & LOOT_KEEPLOOT) {
int lootchance = 50 + b->keeploot; int lootchance = 50 + b->keeploot;
if (rng_int() % 100 < lootchance) { if (rng_int() % 100 < lootchance) {
maxrow = BEHIND_ROW; maxrow = BEHIND_ROW;

View File

@ -213,12 +213,6 @@ int LongHunger(const struct unit *u)
return config_get_int("hunger.long", 0); return config_get_int("hunger.long", 0);
} }
int SkillCap(skill_t sk)
{
if (sk == SK_MAGIC) return 0; /* no caps on magic */
return config_get_int("skill.maxlevel", 0);
}
int NMRTimeout(void) int NMRTimeout(void)
{ {
return config_get_int("nmr.timeout", 0); return config_get_int("nmr.timeout", 0);

View File

@ -1365,10 +1365,6 @@ int eff_skill(const unit * u, const skill *sv, const region *r)
int mlevel = sv->level + get_modifier(u, sv->id, sv->level, r, false); int mlevel = sv->level + get_modifier(u, sv->id, sv->level, r, false);
if (mlevel > 0) { if (mlevel > 0) {
int skillcap = SkillCap(sv->id);
if (skillcap>0 && mlevel > skillcap) {
return skillcap;
}
return mlevel; return mlevel;
} }
} }

View File

@ -535,7 +535,7 @@ static double study_speedup(unit * u, skill_t s, study_rule_t rule)
int study_cmd(unit * u, order * ord) int study_cmd(unit * u, order * ord)
{ {
region *r = u->region; region *r = u->region;
int p, cap; int p;
magic_t mtyp; magic_t mtyp;
int l; int l;
int studycost, days; int studycost, days;
@ -563,11 +563,6 @@ int study_cmd(unit * u, order * ord)
cmistake(u, ord, 77, MSG_EVENT); cmistake(u, ord, 77, MSG_EVENT);
return 0; return 0;
} }
cap = SkillCap(sk);
if (cap > 0 && cap <= effskill(u, sk, 0)) {
cmistake(u, ord, 771, MSG_EVENT);
return 0;
}
/* Hack: Talente mit Malus -99 koennen nicht gelernt werden */ /* Hack: Talente mit Malus -99 koennen nicht gelernt werden */
if (u_race(u)->bonus[sk] == -99) { if (u_race(u)->bonus[sk] == -99) {
cmistake(u, ord, 771, MSG_EVENT); cmistake(u, ord, 771, MSG_EVENT);