forked from github/server
- Grundgerüst für Siegbedingungen
- make depend funktioniert wieder
This commit is contained in:
parent
9d2681e329
commit
fea1a8a1db
|
@ -3,8 +3,7 @@ TARGETS = subdirs
|
|||
SUBDIRS = \
|
||||
common \
|
||||
eressea \
|
||||
mapper \
|
||||
tools
|
||||
mapper
|
||||
|
||||
# askalon
|
||||
|
||||
|
|
|
@ -711,6 +711,11 @@ enum {
|
|||
SEASON_AUTUMN
|
||||
};
|
||||
|
||||
/* Siegbedingungen */
|
||||
|
||||
#define VICTORY_NONE 0
|
||||
#define VICTORY_MURDER 1
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
|
||||
#define MAXSPEED 21
|
||||
|
|
|
@ -55,6 +55,9 @@ typedef struct faction {
|
|||
int number; /* enno: unterschied zu num_people ? */
|
||||
int money;
|
||||
int score;
|
||||
#ifdef VICTORY_DELAY
|
||||
unsigned char victory_delay;
|
||||
#endif
|
||||
#ifndef FAST_REGION
|
||||
vset regions;
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
/* vi: set ts=2:
|
||||
*
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea-pbem.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
*
|
||||
* This program may not be used, modified or distributed without
|
||||
* prior permission by the authors of Eressea.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <eressea.h>
|
||||
#include "victoryconditions.h"
|
||||
|
||||
/* kernel includes */
|
||||
#include <region.h>
|
||||
#include <faction.h>
|
||||
|
||||
/* util includes */
|
||||
#include <attrib.h>
|
||||
|
||||
/* libc includes */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if VICTORY_CONDITION == VICTORY_MURDER
|
||||
|
||||
static void
|
||||
print_winners_murder(void)
|
||||
{
|
||||
/* Eine oder mehrere Parteien haben endgültig gewonnen. Ausgeben. */
|
||||
}
|
||||
|
||||
static boolean
|
||||
is_winner_murder(const faction *f)
|
||||
{
|
||||
/* Prüfen, ob Conditions erfüllt sind. */
|
||||
/* Wenn ja, counter erhöhen, sonst counter auf 0 */
|
||||
/* Wenn counter == VICTORY_DELAY: Partei hat gewonnen */
|
||||
}
|
||||
|
||||
static void
|
||||
check_victory_murder(void)
|
||||
{
|
||||
faction *f;
|
||||
int condfulfilled = 0;
|
||||
int winners = 0;
|
||||
|
||||
for(f=factions; f; f=f->next) {
|
||||
if(f->no != 0 && is_winner_murder(f)) {
|
||||
f->victory_delay++;
|
||||
condfulfilled++;
|
||||
if(f->victory_delay == VICTORY_DELAY)
|
||||
winners++;
|
||||
} else {
|
||||
f->victory_delay = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(winners > 0) {
|
||||
print_winners_murder();
|
||||
} else if(condfulfilled > 0) {
|
||||
for(f=factions; f; f=f->next) {
|
||||
if(f->victory_delay > 0) {
|
||||
/* Meldung an alle, dass Partei x die Siegbedingung in der n-ten Woche
|
||||
* erfüllt */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
check_victory(void)
|
||||
{
|
||||
#if VICTORY_CONDITION == VICTORY_MURDER
|
||||
check_victory_murder();
|
||||
#endif
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
/* vi: set ts=2:
|
||||
*
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea-pbem.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
*
|
||||
* This program may not be used, modified or distributed without
|
||||
* prior permission by the authors of Eressea.
|
||||
*/
|
||||
|
||||
extern void check_victory(void);
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/* vi: set ts=2:
|
||||
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
|
||||
| | Enno Rehling <enno@eressea-pbem.de>
|
||||
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
|
||||
| (c) 1998 - 2001 | Henning Peters <faroul@beyond.kn-bremen.de>
|
||||
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
|
||||
+-------------------+ Stefan Reich <reich@halbling.de>
|
||||
|
||||
This program may not be used, modified or distributed
|
||||
without prior permission by the authors of Eressea.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Contains defines for the "murder variant" game (vinyambar) .
|
||||
* Include this file from settings.h to make eressea work.
|
||||
*/
|
||||
#define GAME_ID 0
|
||||
#define RESOURCE_CONVERSION 1
|
||||
#define NEW_RESOURCEGROWTH 1
|
||||
#define LARGE_CASTLES 1
|
||||
#define GROWING_TREES 1
|
||||
#define REMOVENMRNEWBIE 1
|
||||
#define NMRTIMEOUT 4
|
||||
#define HUNGER_DISABLES_LONGORDERS 1
|
||||
#define REDUCED_PEASANTGROWTH 1
|
||||
#define RACE_ADJUSTMENTS 1
|
||||
#define TEACHDIFFERENCE 2
|
||||
#define PEASANT_ADJUSTMENT 1
|
||||
#define SKILLPOINTS 0
|
||||
#define NEW_MIGRATION 1
|
||||
#define PEASANTS_DO_NOT_STARVE 0
|
||||
|
||||
#define VICTORY_CONDITION VICTORY_MURDER
|
||||
#define VICTORY_DELAY 4
|
||||
|
|
@ -5,6 +5,7 @@ endif
|
|||
|
||||
# Hier definieren, damit nicht '@gcc'
|
||||
CC = gcc-3.0 -D_GNU_SOURCE
|
||||
DEPEND = @gcc-3.0 -MM -MG -r
|
||||
# CC = gcc -D_GNU_SOURCE
|
||||
AR = ar
|
||||
CTAGS = ctags-exuberant
|
||||
|
|
|
@ -4535,7 +4535,7 @@
|
|||
</type>
|
||||
<locale name="de">
|
||||
<nr section="events">
|
||||
<text>"$faction($from) spendete $int($amount) Silber an $faction($to)."</text>
|
||||
<text>"$faction($from) gibt $faction($to) ein Almosen von $int($amount) Silber."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
<locale name="en">
|
||||
|
|
Loading…
Reference in New Issue