Makefiles und gm-commands

This commit is contained in:
Enno Rehling 2001-01-30 20:02:06 +00:00
parent 049fbfb591
commit 5eeacb9fd6
6 changed files with 84 additions and 23 deletions

View File

@ -146,7 +146,7 @@ $(BUILD_DIR) $(PUBLISH_DIR):
# object files:
$(BUILD_DIR)/%:: $(BUILD_DIR)
$(BUILD_DIR)/%.o:: %.c
@echo "Compiling $@ using $(MKFILES)"
@echo "Compiling $@"
$(CC) $(CFLAGS) -o $@ -c $<
##

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: laws.c,v 1.4 2001/01/29 19:15:12 corwin Exp $
* $Id: laws.c,v 1.5 2001/01/30 20:02:05 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -20,19 +20,26 @@
*/
#include <config.h>
#include "eressea.h"
#include <eressea.h>
#include "laws.h"
#include "item.h"
#include "ship.h"
#include "border.h"
#include "faction.h"
#include "alchemy.h"
#include "economy.h"
#include "message.h"
#ifdef USE_GM_COMMANDS
# include <modules/gmcmd.h>
#endif
#ifdef OLD_TRIGGER
# include "old/trigger.h"
#endif
/* kernel includes */
#include <item.h>
#include <ship.h>
#include <border.h>
#include <faction.h>
#include <alchemy.h>
#include <message.h>
#include "skill.h"
#include "magic.h"
#include "randenc.h"
#include "movement.h"
#include "monster.h"
#include "spy.h"
@ -40,24 +47,22 @@
#include "battle.h"
#include "region.h"
#include "unit.h"
#ifdef OLD_TRIGGER
#include "old/trigger.h"
#endif
#include "economy.h"
#include "plane.h"
#include "study.h"
#include "creation.h"
#include "goodies.h"
#include "karma.h"
#include "pool.h"
#include "building.h"
#ifdef GROUPS
#include "group.h"
#endif
/* gamecode includes */
#include "economy.h"
#include "creation.h"
#include "randenc.h"
/* util includes */
#include <event.h>
#include <base36.h>
#include <goodies.h>
#include <rand.h>
/* libc includes */
@ -2958,6 +2963,10 @@ processorders (void)
puts(" - neue Nummern und Reihenfolge");
renumber();
reorder();
#ifdef USE_GM_COMMANDS
puts(" - GM Kommandos");
gmcommands();
#endif
for (r = regions;r;r=r->next) reorder_owners(r);
puts(" - Attribute altern");

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: eressea.h,v 1.5 2001/01/30 19:32:44 enno Exp $
* $Id: eressea.h,v 1.6 2001/01/30 20:02:05 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -403,6 +403,7 @@ enum {
K_PRAY,
K_SORT,
K_SETJIHAD,
K_GM, /* perform GM commands */
MAXKEYWORDS,
NOKEYWORD = (keyword_t) - 1
};

View File

@ -149,7 +149,7 @@ gm_terraform(const char * str, struct unit * u)
if (t!=MAXTERRAINS) terraform(u->region, t);
}
void
static void
gm_command(const char * cmd, struct unit * u)
{
int i;
@ -186,3 +186,28 @@ init_gmcmd(void)
}
}
/*
* execute gm-commands for all units in the game
*/
void
gmcommands(void)
{
region ** rp = &regions;
while (*rp) {
region * r = *rp;
unit **up = &r->units;
while (*up) {
unit * u = *up;
strlist * order;
for (order = u->orders; order; order = order->next)
if (igetkeyword(order->s) == K_GM) {
gm_command(u, order->s);
}
if (u==*up) up = &u->next;
}
if (*rp==r) rp = &r->next;
}
}

View File

@ -1,8 +1,28 @@
/* vi: set ts=2:
*
* $Id: gmcmd.h,v 1.2 2001/01/30 20:02:06 enno Exp $
* 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.
*/
struct attrib;
struct unit;
void init_gmcmd(void);
void gm_command(const char * cmd, struct unit * u);
/* initialize this module */
void gmcommands(void);
/* execute commands */
/*
* doesn't belong in here:
*/
struct attrib * find_key(struct attrib * attribs, int key);

6
src/enno.mk Normal file
View File

@ -0,0 +1,6 @@
#
## enable some new features in the source:
#
USE_GM_COMMANDS = 1
CONVERT_TRIGGERS = 1