- herbs do not rot

- hungry demons can only go down
This commit is contained in:
Enno Rehling 2009-05-30 12:16:08 +00:00
parent 3ca03e3145
commit ad9dc82cfd
3 changed files with 30 additions and 5 deletions

View File

@ -1069,10 +1069,26 @@ demon_skillchanges(void)
for (u = r->units; u; u = u->next) {
if (u->race == new_race[RC_DAEMON]) {
skill * sv = u->skills;
int upchance = 15;
int downchance = 10;
if (fval(u, UFL_HUNGER)) {
/* hungry demons only go down, never up in skill */
static int rule_hunger = -1;
if (rule_hunger<0) {
rule_hunger = get_param_int(global.parameters, "hunger.demon.skill", 0);
}
if (rule_hunger) {
upchance = 0;
downchance = 15;
}
}
while (sv!=u->skills+u->skill_size) {
if (sv->level>0 && rng_int() % 100 < 25) {
int roll = rng_int() % 100;
if (sv->level>0 && roll < upchance+downchance) {
int weeks = 1+rng_int()%3;
if (rng_int() % 100 < 40) {
if (roll < downchance) {
reduce_skill(u, sv, weeks);
} else {
while (weeks--) learn_skill(u, sv->id, 1.0);
@ -1133,14 +1149,21 @@ karma_update(void)
static void
rotting_herbs(void)
{
static int rule_rot = -1;
region * r;
if (rule_rot<0) {
rule_rot = get_param_int(global.parameters, "rules.economy.herbrot", HERBROTCHANCE);
}
if (rule_rot==0) return;
for (r = regions; r; r = r->next) {
unit * u;
for (u = r->units; u; u=u->next) {
item **itmp = &u->items, *hbag = *i_find(itmp, olditemtype[I_SACK_OF_CONSERVATION]);
int rot_chance = HERBROTCHANCE;
int rot_chance = rule_rot;
if (hbag) rot_chance = (HERBROTCHANCE*2)/5;
if (hbag) rot_chance = (rot_chance*2)/5;
while (*itmp) {
item * itm = *itmp;
int n = itm->number;

View File

@ -116,6 +116,7 @@
<param name="nmr.removenewbie" value="0"/>
<param name="GiveRestriction" value="3"/>
<param name="hunger.long" value="0"/>
<param name="hunger.demon.skill" value="1"/>
<param name="init_spells" value="0"/>
<param name="hunger.damage" value="1d9+9"/>
<param name="recruit.allow_merge" value="1"/>
@ -132,6 +133,7 @@
<param name="rules.magic.playerschools" value="gwyrrd illaun draig cerddor"/>
<param name="rules.economy.taxation" value="1"/>
<param name="rules.economy.roqf" value="5"/>
<param name="rules.economy.herbrot" value="0"/>
<param name="rules.give" value="11"/> <!-- only self + peasants + ondeath -->
<param name="rules.help.mask" value="fight guard money"/>
<param name="movement.shipspeed.skillbonus" value="7"/>

View File

@ -64,7 +64,7 @@
<familiar race="giantturtle"/>
</race>
<race name="halfling" magres="0.05" maxaura="1.0" regaura="1.0" recruitcost="100" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveitem="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<race name="halfling" defensemodifier="1" magres="0.05" maxaura="1.0" regaura="1.0" recruitcost="100" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveitem="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<function name="itemdrop" value="defaultdrops"/>
<param name="other_race" value="dwarf"/>