forked from github/server
remove the XONTORMIA & WEREWOLF commands.
This commit is contained in:
parent
1b24f14da0
commit
f11005c686
|
@ -160,7 +160,6 @@ set (LIB_SRC
|
|||
modules/score.c
|
||||
modules/weather.c
|
||||
modules/wormhole.c
|
||||
modules/xecmd.c
|
||||
modules/xmas.c
|
||||
triggers/changefaction.c
|
||||
triggers/changerace.c
|
||||
|
|
|
@ -88,7 +88,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include <util/rng.h>
|
||||
#include <util/xml.h>
|
||||
|
||||
#include <modules/xecmd.h>
|
||||
#include <attributes/otherfaction.h>
|
||||
|
||||
/* libc includes */
|
||||
|
@ -3639,8 +3638,6 @@ void check_long_orders(unit * u)
|
|||
cmistake(u, ord, 52, MSG_EVENT);
|
||||
}
|
||||
break;
|
||||
case K_WEREWOLF:
|
||||
/* don't know what WEREWOLF does... */
|
||||
default:
|
||||
cmistake(u, ord, 52, MSG_EVENT);
|
||||
}
|
||||
|
@ -3696,7 +3693,10 @@ void update_long_order(unit * u)
|
|||
case K_BUY:
|
||||
case K_SELL:
|
||||
/* Wenn die Einheit handelt, muß der Default-Befehl gelöscht
|
||||
* werden. */
|
||||
* werden.
|
||||
* Wird je diese Ausschliesslichkeit aufgehoben, muss man aufpassen
|
||||
* mit der Reihenfolge von Kaufen, Verkaufen etc., damit es Spielern
|
||||
* nicht moeglich ist, Schulden zu machen. */
|
||||
trade = true;
|
||||
break;
|
||||
|
||||
|
@ -3706,13 +3706,6 @@ void update_long_order(unit * u)
|
|||
set_order(&u->thisorder, NULL);
|
||||
break;
|
||||
|
||||
case K_WEREWOLF:
|
||||
set_order(&u->thisorder, copy_order(ord));
|
||||
break;
|
||||
|
||||
/* Wird je diese Ausschliesslichkeit aufgehoben, muss man aufpassen
|
||||
* mit der Reihenfolge von Kaufen, Verkaufen etc., damit es Spielern
|
||||
* nicht moeglich ist, Schulden zu machen. */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4580,10 +4573,6 @@ void init_processor(void)
|
|||
|
||||
p += 10;
|
||||
add_proc_order(p, K_GUARD, &guard_on_cmd, 0, "Bewache (an)");
|
||||
#if XECMD_MODULE
|
||||
/* can do together with guard */
|
||||
add_proc_order(p, K_XE, &xecmd, 0, "Zeitung");
|
||||
#endif
|
||||
|
||||
p += 10;
|
||||
add_proc_global(p, &encounters, "Zufallsbegegnungen");
|
||||
|
|
|
@ -54,7 +54,7 @@ use_skillpotion(struct unit *u, const struct item_type *itype, int amount,
|
|||
while (sv != u->skills + u->skill_size) {
|
||||
int i;
|
||||
for (i = 0; i != 3; ++i)
|
||||
learn_skill(u, sv->id, 1.0);
|
||||
learn_skill(u, (skill_t)sv->id, 1.0);
|
||||
++sv;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,18 +99,6 @@ boolean sqlpatch = false;
|
|||
boolean battledebug = false;
|
||||
int turn = 0;
|
||||
|
||||
#if XECMD_MODULE
|
||||
attrib_type at_xontormiaexpress = {
|
||||
"xontormiaexpress",
|
||||
DEFAULT_INIT,
|
||||
DEFAULT_FINALIZE,
|
||||
DEFAULT_AGE,
|
||||
a_writeint,
|
||||
a_readint,
|
||||
ATF_UNIQUE
|
||||
};
|
||||
#endif
|
||||
|
||||
int NewbieImmunity(void)
|
||||
{
|
||||
static int value = -1;
|
||||
|
@ -458,8 +446,6 @@ const char *keywords[MAXKEYWORDS] = {
|
|||
"INFO",
|
||||
"PRAEFIX",
|
||||
"PFLANZEN",
|
||||
"WERWESEN",
|
||||
"XONTORMIA",
|
||||
"ALLIANZ",
|
||||
"BEANSPRUCHEN",
|
||||
"PROMOTION",
|
||||
|
@ -3021,9 +3007,8 @@ void attrib_init(void)
|
|||
register_function((pf_generic) & minimum_wage, "minimum_wage");
|
||||
|
||||
at_register(&at_germs);
|
||||
#if XECMD_MODULE
|
||||
at_register(&at_xontormiaexpress); /* required for old datafiles */
|
||||
#endif
|
||||
|
||||
at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */
|
||||
at_register(&at_speedup);
|
||||
at_register(&at_building_action);
|
||||
}
|
||||
|
|
|
@ -458,10 +458,6 @@ extern "C" {
|
|||
# define count_unit(u) 1
|
||||
#endif
|
||||
|
||||
#if XECMD_MODULE
|
||||
extern struct attrib_type at_xontormiaexpress;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -447,8 +447,6 @@ int is_exclusive(const order * ord)
|
|||
|
||||
switch (kwd) {
|
||||
case K_MOVE:
|
||||
case K_WEREWOLF:
|
||||
/* these should not become persistent */
|
||||
case K_ROUTE:
|
||||
case K_DRIVE:
|
||||
case K_WORK:
|
||||
|
@ -513,7 +511,6 @@ int is_long(const order * ord)
|
|||
case K_BUY:
|
||||
case K_SELL:
|
||||
case K_MOVE:
|
||||
case K_WEREWOLF:
|
||||
case K_ROUTE:
|
||||
case K_DRIVE:
|
||||
case K_WORK:
|
||||
|
@ -573,7 +570,6 @@ int is_persistent(const order * ord)
|
|||
int persist = ord->_persistent != 0;
|
||||
switch (kwd) {
|
||||
case K_MOVE:
|
||||
case K_WEREWOLF:
|
||||
case NOKEYWORD:
|
||||
/* lang, aber niemals persistent! */
|
||||
return false;
|
||||
|
|
|
@ -137,8 +137,6 @@ typedef enum {
|
|||
K_INFO, /* set player-info */
|
||||
K_PREFIX,
|
||||
K_PLANT,
|
||||
K_WEREWOLF,
|
||||
K_XE,
|
||||
K_ALLIANCE,
|
||||
K_CLAIM,
|
||||
K_PROMOTION,
|
||||
|
|
|
@ -1,108 +0,0 @@
|
|||
/* vi: set ts=2:
|
||||
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
|
||||
| | Enno Rehling <enno@eressea.de>
|
||||
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
|
||||
| (c) 1998 - 2003 | 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.
|
||||
*/
|
||||
|
||||
#include <platform.h>
|
||||
#include <kernel/config.h>
|
||||
|
||||
#if XECMD_MODULE
|
||||
#include "xecmd.h"
|
||||
|
||||
#include <items/xerewards.h>
|
||||
|
||||
#include "xecmd.h"
|
||||
|
||||
/* kernel includes */
|
||||
#include <kernel/faction.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/order.h>
|
||||
#include <kernel/region.h>
|
||||
#include <kernel/save.h>
|
||||
#include <kernel/ship.h>
|
||||
#include <kernel/unit.h>
|
||||
|
||||
/* util includes */
|
||||
#include <util/attrib.h>
|
||||
#include <util/base36.h>
|
||||
#include <util/parser.h>
|
||||
|
||||
/* libc includes */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
static void xe_givelaen(unit * u, struct order *ord)
|
||||
{
|
||||
unit *u2 = getunitg(u->region, u->faction);
|
||||
|
||||
if (!u2) {
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found",
|
||||
""));
|
||||
return;
|
||||
}
|
||||
i_change(&u2->items, olditemtype[I_LAEN], 5);
|
||||
}
|
||||
|
||||
static void xe_givepotion(unit * u, struct order *ord)
|
||||
{
|
||||
unit *u2 = getunitg(u->region, u->faction);
|
||||
|
||||
if (!u2) {
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found",
|
||||
""));
|
||||
return;
|
||||
}
|
||||
i_change(&u2->items, it_find("skillpotion"), 1);
|
||||
}
|
||||
|
||||
static void xe_giveballon(unit * u, struct order *ord)
|
||||
{
|
||||
unit *u2 = getunitg(u->region, u->faction);
|
||||
ship *sh;
|
||||
|
||||
if (!u2) {
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_unit_not_found",
|
||||
""));
|
||||
return;
|
||||
}
|
||||
|
||||
sh = new_ship(st_find("balloon"), u2->region, u2->faction->locale);
|
||||
sh->size = 5;
|
||||
ship_setname(sh, "Xontormia-Ballon");
|
||||
leave(u2, true);
|
||||
u_set_ship(u2, sh);
|
||||
}
|
||||
|
||||
int xecmd(unit * u, order * ord)
|
||||
{
|
||||
faction *f = u->faction;
|
||||
|
||||
if (a_find(f->attribs, &at_xontormiaexpress)) {
|
||||
if (get_keyword(ord) == K_XE) {
|
||||
param_t param;
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
param = findparam(getstrtoken(), f->locale);
|
||||
if (param == P_XEPOTION) {
|
||||
xe_givepotion(u, ord);
|
||||
} else if (param == P_XEBALLOON) {
|
||||
xe_giveballon(u, ord);
|
||||
} else if (param == P_XELAEN) {
|
||||
xe_givelaen(u, ord);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,26 +0,0 @@
|
|||
/* vi: set ts=2:
|
||||
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
|
||||
| | Enno Rehling <enno@eressea.de>
|
||||
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
|
||||
| (c) 1998 - 2003 | 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.
|
||||
*/
|
||||
|
||||
#ifndef H_MOD_XECMD_H
|
||||
#define H_MOD_XECMD_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if XECMD_MODULE
|
||||
int xecmd(struct unit *u, struct order *ord);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -44,7 +44,6 @@
|
|||
#define SCORE_MODULE 1
|
||||
#define MUSEUM_MODULE 1
|
||||
#define ARENA_MODULE 1
|
||||
#define XECMD_MODULE 1
|
||||
#define DUNGEON_MODULE 0
|
||||
#define CHANGED_CROSSBOWS 0 /* use the WTF_ARMORPIERCING flag */
|
||||
#undef GLOBAL_WARMING /* number of turns before global warming sets in */
|
||||
|
|
|
@ -22,6 +22,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "log.h"
|
||||
#include "storage.h"
|
||||
|
||||
#include <critbit.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -261,6 +263,16 @@ int a_age(attrib ** p)
|
|||
return (*p != NULL);
|
||||
}
|
||||
|
||||
static critbit_tree cb_deprecated = { 0 };
|
||||
|
||||
void at_deprecate(const char * name, int (*reader)(attrib *, void *, struct storage *))
|
||||
{
|
||||
char buffer[64];
|
||||
size_t len = strlen(name);
|
||||
len = cb_new_kv(name, len, &reader, sizeof(reader), buffer);
|
||||
cb_insert(&cb_deprecated, buffer, len);
|
||||
}
|
||||
|
||||
int a_read(struct storage *store, attrib ** attribs, void *owner)
|
||||
{
|
||||
int key, retval = AT_READ_OK;
|
||||
|
@ -275,14 +287,26 @@ int a_read(struct storage *store, attrib ** attribs, void *owner)
|
|||
key = __at_hashkey(zText);
|
||||
|
||||
while (key != -1) {
|
||||
int (*reader)(attrib *, void *, struct storage *) = 0;
|
||||
attrib_type *at = at_find(key);
|
||||
if (!at) {
|
||||
attrib * na = 0;
|
||||
|
||||
if (at) {
|
||||
reader = at->read;
|
||||
na = a_new(at);
|
||||
} else {
|
||||
const void * kv;
|
||||
cb_find_prefix(&cb_deprecated, zText, strlen(zText)+1, &kv, 1, 0);
|
||||
if (kv) {
|
||||
cb_get_kv(kv, &reader, sizeof(reader));
|
||||
} else {
|
||||
fprintf(stderr, "attribute hash: %d (%s)\n", key, zText);
|
||||
assert(at || !"attribute not registered");
|
||||
}
|
||||
if (at->read) {
|
||||
attrib *na = a_new(at);
|
||||
int i = at->read(na, owner, store);
|
||||
}
|
||||
if (reader) {
|
||||
int i = reader(na, owner, store);
|
||||
if (na) {
|
||||
switch (i) {
|
||||
case AT_READ_OK:
|
||||
a_add(attribs, na);
|
||||
|
@ -295,6 +319,7 @@ int a_read(struct storage *store, attrib ** attribs, void *owner)
|
|||
assert(!"invalid return value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(!"fehler: keine laderoutine für attribut");
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ extern "C" {
|
|||
} attrib_type;
|
||||
|
||||
extern void at_register(attrib_type * at);
|
||||
extern void at_deprecate(const char * name, int (*reader)(attrib *, void *, struct storage *));
|
||||
|
||||
extern attrib *a_select(attrib * a, const void *data,
|
||||
boolean(*compare) (const attrib *, const void *));
|
||||
|
|
Loading…
Reference in New Issue