diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 4f7541c45..998057b57 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -309,14 +309,23 @@ get_food(region *r) peasantfood = 0; } if (hungry > 0) { - /* nicht gefütterte dämonen hungern */ + static int demon_hunger = -1; + if (demon_hunger<0) { + demon_hunger = get_param_int(global.parameters, "hunger.demons", 0); + } + if (demon_hunger==0) { + /* nicht gefütterte dämonen hungern */ #ifdef PEASANT_HUNGRY_DAEMONS_HAVE_FULL_SKILLS - /* wdw special rule */ - hunger(hungry, u); + /* wdw special rule */ + hunger(hungry, u); #else - if (hunger(hungry, u)) fset(u, UFL_HUNGER); + if (hunger(hungry, u)) fset(u, UFL_HUNGER); #endif /* used to be: hunger(hungry, u); */ + } else { + /* no damage, but set the hungry-flag */ + fset(u, UFL_HUNGER); + } } } } diff --git a/src/common/gamecode/study.c b/src/common/gamecode/study.c index c8fe8f8a1..1827a55aa 100644 --- a/src/common/gamecode/study.c +++ b/src/common/gamecode/study.c @@ -457,8 +457,28 @@ teach_cmd(unit * u, struct order * ord) } return 0; } -/* ------------------------------------------------------------- */ +static double +study_speedup(unit * u) +{ + static int rule = -1; + if (rule<0) { + rule = get_param_int(global.parameters, "study.speedup", 0); + } + if (rule==1) { + double age = 0; + int i; + for (i=0;i!=u->skill_size;++i) { + skill * sv = u->skills+i; + double time = sv->level*(sv->level+1)/2.0; + age += time; + } + if (age < turn) { + return 2.0-age/turn; + } + } + return 1.0; +} int learn_cmd(unit * u, order * ord) { @@ -674,6 +694,8 @@ learn_cmd(unit * u, order * ord) teach->value -= u->number * 10; } + multi *= study_speedup(u); + days = (int)((u->number * 30 + teach->value) * multi); /* the artacademy currently improves the learning of entertainment diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 8a593795b..67ee541a7 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -1871,7 +1871,7 @@ int hits(troop at, troop dt, weapon * awp) { fighter *af = at.fighter, *df = dt.fighter; - const armor_type * armor, * shield; + const armor_type * armor, * shield = 0; int skdiff = 0; int dist = get_unitrow(af, df->side) + get_unitrow(df, af->side) - 1; weapon * dwp = select_weapon(dt, false, dist>1); @@ -1899,7 +1899,9 @@ hits(troop at, troop dt, weapon * awp) skdiff = skilldiff(at, dt, dist); /* Verteidiger bekommt eine Rüstung */ armor = select_armor(dt, true); - shield = select_armor(dt, false); + if (weapon->type->flags & WTF_USESHIELD) { + shield = select_armor(dt, false); + } if (contest(skdiff, dt, armor, shield)) { if (bdebug) { debug_hit(at, awp, dt, dwp, skdiff, dist, true); diff --git a/src/common/kernel/item.h b/src/common/kernel/item.h index 9f0915d4f..d592a94b0 100644 --- a/src/common/kernel/item.h +++ b/src/common/kernel/item.h @@ -197,6 +197,7 @@ typedef struct armor_type { #define WTF_SIEGE 0x20 #define WTF_ARMORPIERCING 0x40 /* armor has only half value */ #define WTF_HORSEBONUS 0x80 +#define WTF_USESHIELD 0x100 typedef struct weapon_type { const item_type * itype; diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index ef5dd5126..4beef377e 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -665,6 +665,7 @@ xml_readweapon(xmlXPathContextPtr xpath, item_type * itype) if (xml_bvalue(node, "blunt", false)) flags |= WTF_BLUNT; if (xml_bvalue(node, "siege", false)) flags |= WTF_SIEGE; if (xml_bvalue(node, "horse", (flags&WTF_MISSILE)==0)) flags |= WTF_HORSEBONUS; + if (xml_bvalue(node, "useshield", true)) flags |= WTF_USESHIELD; propValue = xmlGetProp(node, BAD_CAST "skill"); assert(propValue!=NULL); diff --git a/src/res/e2k9.xml b/src/res/e2k9.xml index 7ff121455..af068c6d2 100644 --- a/src/res/e2k9.xml +++ b/src/res/e2k9.xml @@ -10,7 +10,7 @@ - + @@ -23,6 +23,7 @@ + @@ -119,8 +120,10 @@ + + diff --git a/src/res/e2k9/equipment.xml b/src/res/e2k9/equipment.xml index 38cee0469..59fa6d5a4 100644 --- a/src/res/e2k9/equipment.xml +++ b/src/res/e2k9/equipment.xml @@ -10,4 +10,9 @@ - + + + + + + diff --git a/src/res/e2k9/luxuries.xml b/src/res/e2k9/luxuries.xml new file mode 100644 index 000000000..6c5094a19 --- /dev/null +++ b/src/res/e2k9/luxuries.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/res/e2k9/spells.xml b/src/res/e2k9/spells.xml index 24bc6f4ca..ef31d931c 100644 --- a/src/res/e2k9/spells.xml +++ b/src/res/e2k9/spells.xml @@ -21,7 +21,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -166,7 +166,7 @@ - + @@ -289,13 +289,13 @@ - + - + @@ -436,7 +436,7 @@ - + @@ -506,9 +506,10 @@ + - + @@ -533,7 +534,7 @@ - + diff --git a/src/res/equipment.xml b/src/res/equipment.xml index 45c03abf8..4686c5e35 100644 --- a/src/res/equipment.xml +++ b/src/res/equipment.xml @@ -374,11 +374,6 @@ - - - - - diff --git a/src/res/eressea/equipment.xml b/src/res/eressea/equipment.xml index 916733b0a..d21b97173 100644 --- a/src/res/eressea/equipment.xml +++ b/src/res/eressea/equipment.xml @@ -11,4 +11,9 @@ + + + + + diff --git a/src/res/weapons/greatsword-2.xml b/src/res/weapons/greatsword-2.xml index 1441c378d..5fc1c9042 100644 --- a/src/res/weapons/greatsword-2.xml +++ b/src/res/weapons/greatsword-2.xml @@ -7,7 +7,7 @@ - + diff --git a/src/res/weapons/halberd-2.xml b/src/res/weapons/halberd-2.xml index bb581b8d3..35ff1e900 100644 --- a/src/res/weapons/halberd-2.xml +++ b/src/res/weapons/halberd-2.xml @@ -8,7 +8,7 @@ - + diff --git a/src/res/weapons/rustygreatsword-2.xml b/src/res/weapons/rustygreatsword-2.xml index 5a27f3431..818fac553 100644 --- a/src/res/weapons/rustygreatsword-2.xml +++ b/src/res/weapons/rustygreatsword-2.xml @@ -7,7 +7,7 @@ - + diff --git a/src/res/weapons/rustyhalberd-2.xml b/src/res/weapons/rustyhalberd-2.xml index 2ac33f681..c1fce385b 100644 --- a/src/res/weapons/rustyhalberd-2.xml +++ b/src/res/weapons/rustyhalberd-2.xml @@ -8,7 +8,7 @@ - +