forked from github/server
some cleaning
This commit is contained in:
parent
94ae1a1c7c
commit
ae7eefa47c
1 changed files with 25 additions and 22 deletions
|
@ -1117,12 +1117,32 @@ icebergs(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if KARMA_MODULE
|
||||||
|
static void
|
||||||
|
karma_update(void)
|
||||||
|
{
|
||||||
|
faction * f;
|
||||||
|
/* lycanthropen werden werwölfe */
|
||||||
|
for (f = factions; f; f=f->next) {
|
||||||
|
if (f->alive) {
|
||||||
|
int level = fspecial(f, FS_LYCANTROPE);
|
||||||
|
if (level > 0) {
|
||||||
|
unit * u;
|
||||||
|
for(u = f->units; u; u=u->nextF) {
|
||||||
|
if (rng_int()%100 < 2*level) {
|
||||||
|
ADDMSG(&u->faction->msgs,
|
||||||
|
msg_message("becomewere", "unit region", u, u->region));
|
||||||
|
fset(u, UFL_WERE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
randomevents(void)
|
randomevents(void)
|
||||||
{
|
{
|
||||||
#if KARMA_MODULE
|
|
||||||
faction *f;
|
|
||||||
#endif /* KARMA_MODULE */
|
|
||||||
region *r;
|
region *r;
|
||||||
unit *u;
|
unit *u;
|
||||||
|
|
||||||
|
@ -1218,21 +1238,7 @@ randomevents(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if KARMA_MODULE
|
#if KARMA_MODULE
|
||||||
/* lycanthropen werden werwölfe */
|
karma_update();
|
||||||
for (f = factions; f; f=f->next) {
|
|
||||||
if (f->alive) {
|
|
||||||
int level = fspecial(f, FS_LYCANTROPE);
|
|
||||||
if (level > 0) {
|
|
||||||
for(u = f->units; u; u=u->nextF) {
|
|
||||||
if (rng_int()%100 < 2*level) {
|
|
||||||
ADDMSG(&u->faction->msgs,
|
|
||||||
msg_message("becomewere", "unit region", u, u->region));
|
|
||||||
fset(u, UFL_WERE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Chaos */
|
/* Chaos */
|
||||||
|
@ -1246,15 +1252,12 @@ randomevents(void)
|
||||||
chaoscounts(r, -(int) (i * ((double) (rng_int() % 10)) / 100.0));
|
chaoscounts(r, -(int) (i * ((double) (rng_int() % 10)) / 100.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HERBS_ROT
|
|
||||||
/* Kräuter verrotten */
|
|
||||||
for (r = regions; r; r = r->next) {
|
for (r = regions; r; r = r->next) {
|
||||||
for (u = r->units; u; u=u->next) {
|
for (u = r->units; u; u=u->next) {
|
||||||
item **itmp = &u->items, *hbag = *i_find(&u->items, olditemtype[I_SACK_OF_CONSERVATION]);
|
item **itmp = &u->items, *hbag = *i_find(&u->items, olditemtype[I_SACK_OF_CONSERVATION]);
|
||||||
int rot_chance = HERBROTCHANCE;
|
int rot_chance = HERBROTCHANCE;
|
||||||
|
|
||||||
if (hbag) rot_chance = (HERBROTCHANCE*2)/5;
|
if (hbag) rot_chance = (HERBROTCHANCE*2)/5;
|
||||||
|
|
||||||
while (*itmp) {
|
while (*itmp) {
|
||||||
item * itm = *itmp;
|
item * itm = *itmp;
|
||||||
int n = itm->number;
|
int n = itm->number;
|
||||||
|
|
Loading…
Reference in a new issue