- OPTION ZEITUNG implementiert. Noch nicht ganz fertig, ich überlege

noch, die Optionsmimik komplett umzustricken, um Optionen mit
	einem Parameter auch ohne Hack möglich zu machen.
- Neue Spezialeigenschaft FS_UNDEAD. Wir sollten dringend darüber
	nachdenken, bestimmte Eigenschaften von Einheiten (etwa
	Untot-sein) besser zu generalisieren, so gibt es andauernd
	Inkonsistenzen.
This commit is contained in:
Christian Schlittchen 2001-02-28 18:25:25 +00:00
parent c5cd0ff666
commit 867d0f85ff
8 changed files with 94 additions and 25 deletions

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: attributes.c,v 1.8 2001/02/18 12:20:20 enno Exp $
* $Id: attributes.c,v 1.9 2001/02/28 18:25:23 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -26,6 +26,7 @@
#include "iceberg.h"
#include "hate.h"
#include "overrideroads.h"
#include "option.h"
/* util includes */
#include <attrib.h>
@ -55,4 +56,5 @@ init_attributes(void)
init_hate();
/* at_reduceproduction */
init_reduceproduction();
init_option();
}

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: laws.c,v 1.29 2001/02/25 19:31:38 enno Exp $
* $Id: laws.c,v 1.30 2001/02/28 18:25:24 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -64,6 +64,9 @@
#include <goodies.h>
#include <rand.h>
/* attributes includes */
#include <attributes/option.h>
/* libc includes */
#include <stdio.h>
#include <math.h>
@ -1689,6 +1692,27 @@ set_passw(void)
case K_SEND:
s = getstrtoken();
o = findoption(s);
/* Sonderbehandlung Zeitungsoption */
if (o == O_NEWS) {
attrib *a = a_find(u->faction->attribs, &at_option_news);
if(a) a->data.i = 0;
while((s = getstrtoken())) {
if(findparam(s) == P_NOT) {
a_removeall(&u->faction->attribs, &at_option_news);
break;
} else {
int sec = atoi(s);
if(sec != 0) {
if(!a) a_add(&u->faction->attribs, a_new(&at_option_news));
a->data.i = a->data.i & (1<<(sec-1));
}
}
}
break;
}
if (o == -1) {
cmistake(u, S->s, 135, MSG_EVENT);
} else {
@ -2791,7 +2815,7 @@ monthly_healing(void)
for (u = r->units; u; u = u->next) {
int umhp;
if((race[u->race].flags & RCF_NOHEAL) || fval(u, FL_HUNGER))
if((race[u->race].flags & RCF_NOHEAL) || fval(u, FL_HUNGER) || fspecial(u->faction, FS_UNDEAD))
continue;
if(rterrain(r) == T_OCEAN && !u->ship && !(race[u->race].flags & RCF_SWIM))

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: report.c,v 1.17 2001/02/24 12:50:47 enno Exp $
* $Id: report.c,v 1.18 2001/02/28 18:25:24 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -30,6 +30,7 @@
/* attributes includes */
#include <attributes/overrideroads.h>
#include <attributes/option.h>
/* gamecode includes */
#include "creation.h"
@ -1790,6 +1791,25 @@ report(FILE *F, faction * f)
if (f->options & (int) pow(2, op)) {
scat(" ");
scat(options[op]);
if(op == O_NEWS) {
attrib *a = a_find(f->attribs, &at_option_news);
if(!a) {
/* Zur Altlastenbeseitigung */
f->options = f->options & ~op;
} else {
int sec = a->data.i;
int i;
scat("(");
for(i=1; sec != 0; i *= 2) {
if(sec & i) {
icat(i);
sec = sec & ~i;
if(sec) scat(",");
}
}
scat(")");
}
}
flag++;
}
}
@ -3098,8 +3118,6 @@ writeadresses(void)
F = cfopen(zText, "w");
if (!F) return;
/* adressen liste */
for (f = factions; f; f = f->next) {
if (f->no != MONSTER_FACTION) {
fprintf(F, "%s:%s:%s\n", factionname(f), f->email, f->banner);
@ -3108,6 +3126,28 @@ writeadresses(void)
fclose(F);
}
static void
writenewssubscriptions(void)
{
char zText[MAX_PATH];
FILE *F;
faction *f;
sprintf(zText, "%s/news-subscriptions", basepath());
F = cfopen(zText, "w");
if (!F) return;
for(f=factions; f; f=f->next) {
attrib *a = a_find(f->attribs, &at_option_news);
if(!a) {
fprintf(F, "%s:0\n", f->email);
} else {
fprintf(F, "%s:%d\n", f->email, a->data.i);
}
}
fclose(F);
}
static void
writeforward(void)
{
@ -3258,6 +3298,7 @@ report_summary(summary * s, summary * o, boolean full)
#endif
printf("Schreibe Liste der Adressen (adressen)...\n");
writeadresses();
writenewssubscriptions();
writeforward();
{

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: eressea.c,v 1.23 2001/02/25 19:31:39 enno Exp $
* $Id: eressea.c,v 1.24 2001/02/28 18:25:24 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -240,7 +240,7 @@ const char *options[MAXOPTIONS] =
"STATISTIK",
"DEBUG",
"ZIPPED",
"MERIAN",
"ZEITUNG", /* Option hat Sonderbehandlung! */
"MATERIALPOOL",
"ADRESSEN",
"BZIP2",

View File

@ -528,7 +528,7 @@ enum {
O_STATISTICS, /* 16 */
O_DEBUG, /* 32 */
O_COMPRESS, /* 64 */
O_MERIAN, /* 128 */
O_NEWS, /* 128 */
O_MATERIALPOOL, /* 256 */
O_ADRESSEN, /* 512 */
O_BZIP2, /* 1024 - crkurz compatible flag */

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: karma.c,v 1.2 2001/01/26 16:19:39 enno Exp $
* $Id: karma.c,v 1.3 2001/02/28 18:25:25 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -238,6 +238,15 @@ struct fspecialdata fspecials[MAXFACTIONSPECIALS] = {
"Ein einmal erklärter Jihad kann nicht wieder rückgängig gemacht "
"werden.",
true
},
/* TODO: is_undead() und Sonderbehandlungen von Untoten */
{
"Untot",
"Personen einer Partei mit dieser Eigenschaft bekommen automatisch doppelt "
"soviele Trefferpunkte wie normale Angehörige der entsprechenden Rasse, "
"verlieren jedoch ihre Fähigkeit zur Regeneration erlittenen Schadens "
"komplett.",
false
}
};

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: karma.h,v 1.2 2001/01/26 16:19:39 enno Exp $
* $Id: karma.h,v 1.3 2001/02/28 18:25:25 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -34,6 +34,7 @@ typedef enum {
FS_MAGICIMMUNE,
FS_VARIEDMAGIC,
FS_JIHAD,
FS_UNDEAD,
MAXFACTIONSPECIALS
} fspecial_t;

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: race.c,v 1.7 2001/02/24 12:50:48 enno Exp $
* $Id: race.c,v 1.8 2001/02/28 18:25:25 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -39,6 +39,7 @@
#include "pathfinder.h"
#include "ship.h"
#include "skill.h"
#include "karma.h"
/* util includes */
#include <attrib.h>
@ -1898,19 +1899,10 @@ unit_max_hp(const unit * u)
p = pow(effskill(u, SK_AUSDAUER) / 2.0, 1.5) * 0.2;
h += (int) (h * p + 0.5);
return h;
if(fspecial(u->faction, FS_UNDEAD)) {
h *= 2;
}
int
unit_old_max_hp(unit * u)
{
int h;
double p;
h = race[u->race].hitpoints / 2;
p = pow(effskill(u, SK_AUSDAUER) / 2.0, 1.5) * 0.2;
h += (int) (h * p + 0.5);
return h;
}