2002-05-09 11:44:16 +02:00
|
|
|
|
/* 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 "regioncurse.h"
|
|
|
|
|
|
|
|
|
|
/* kernel includes */
|
2002-05-09 13:41:20 +02:00
|
|
|
|
#include <region.h>
|
|
|
|
|
#include <message.h>
|
|
|
|
|
#include <nrmessage.h>
|
|
|
|
|
#include <objtypes.h>
|
|
|
|
|
#include <curse.h>
|
2002-05-10 19:51:20 +02:00
|
|
|
|
#include <unit.h>
|
|
|
|
|
#include <magic.h>
|
2002-05-09 11:44:16 +02:00
|
|
|
|
|
|
|
|
|
/* util includes */
|
|
|
|
|
#include <message.h>
|
2002-05-09 14:19:15 +02:00
|
|
|
|
#include <functions.h>
|
2002-05-09 11:44:16 +02:00
|
|
|
|
|
|
|
|
|
/* libc includes */
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
2002-05-09 19:34:43 +02:00
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
|
|
2002-05-09 14:19:15 +02:00
|
|
|
|
int
|
2002-05-09 14:48:19 +02:00
|
|
|
|
cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
2002-05-09 11:44:16 +02:00
|
|
|
|
{
|
|
|
|
|
message * msg;
|
|
|
|
|
|
|
|
|
|
unused(typ);
|
|
|
|
|
unused(self);
|
|
|
|
|
unused(obj);
|
|
|
|
|
|
|
|
|
|
assert(typ == TYP_REGION);
|
|
|
|
|
|
|
|
|
|
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
|
|
|
|
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
|
|
|
msg_release(msg);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-10 19:51:20 +02:00
|
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
|
/* CurseInfo mit Spezialabfragen
|
2002-05-09 19:34:43 +02:00
|
|
|
|
*/
|
2002-05-09 11:44:16 +02:00
|
|
|
|
|
2002-05-10 19:51:20 +02:00
|
|
|
|
/*
|
|
|
|
|
* godcursezone
|
|
|
|
|
*/
|
2002-05-09 11:44:16 +02:00
|
|
|
|
static int
|
2002-05-09 22:08:57 +02:00
|
|
|
|
cinfo_cursed_by_the_gods(const locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
2002-05-09 11:44:16 +02:00
|
|
|
|
{
|
|
|
|
|
region *r;
|
|
|
|
|
message * msg;
|
|
|
|
|
|
|
|
|
|
unused(typ);
|
|
|
|
|
unused(self);
|
|
|
|
|
|
|
|
|
|
assert(typ == TYP_REGION);
|
|
|
|
|
r = (region *)obj;
|
|
|
|
|
if (rterrain(r)!=T_OCEAN){
|
|
|
|
|
msg = msg_message("curseinfo::godcurse", "id", c->no);
|
|
|
|
|
} else {
|
|
|
|
|
msg = msg_message("curseinfo::godcurseocean", "id", c->no);
|
|
|
|
|
}
|
|
|
|
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
|
|
|
msg_release(msg);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2002-05-11 21:45:54 +02:00
|
|
|
|
static struct curse_type ct_godcursezone = {
|
|
|
|
|
"godcursezone",
|
|
|
|
|
CURSETYP_NORM, 0, (NO_MERGE),
|
|
|
|
|
"Diese Region wurde von den G<>ttern verflucht. Stinkende Nebel ziehen "
|
|
|
|
|
"<EFBFBD>ber die tote Erde, furchbare Kreaturen ziehen <20>ber das Land. Die Brunnen "
|
|
|
|
|
"sind vergiftet, und die wenigen essbaren Fr<46>chte sind von einem rosa Pilz "
|
|
|
|
|
"<EFBFBD>berzogen. Niemand kann hier lange <20>berleben.",
|
|
|
|
|
cinfo_cursed_by_the_gods,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2002-05-10 19:51:20 +02:00
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
|
/*
|
|
|
|
|
* C_GBDREAM
|
|
|
|
|
*/
|
2002-05-09 11:44:16 +02:00
|
|
|
|
static int
|
2002-05-09 22:08:57 +02:00
|
|
|
|
cinfo_dreamcurse(const locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
2002-05-09 11:44:16 +02:00
|
|
|
|
{
|
2002-05-09 13:17:31 +02:00
|
|
|
|
message * msg;
|
|
|
|
|
|
2002-05-09 11:44:16 +02:00
|
|
|
|
unused(self);
|
|
|
|
|
unused(typ);
|
|
|
|
|
unused(obj);
|
|
|
|
|
assert(typ == TYP_REGION);
|
|
|
|
|
|
|
|
|
|
if (c->effect > 0){
|
|
|
|
|
msg = msg_message("curseinfo::gooddream", "id", c->no);
|
|
|
|
|
}else{
|
|
|
|
|
msg = msg_message("curseinfo::baddream", "id", c->no);
|
|
|
|
|
}
|
|
|
|
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
|
|
|
msg_release(msg);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2002-05-11 21:45:54 +02:00
|
|
|
|
static struct curse_type ct_gbdream = {
|
|
|
|
|
"gbdream",
|
|
|
|
|
CURSETYP_NORM, 0, (NO_MERGE),
|
|
|
|
|
"",
|
|
|
|
|
cinfo_dreamcurse
|
|
|
|
|
};
|
|
|
|
|
|
2002-05-10 19:51:20 +02:00
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
|
/*
|
|
|
|
|
* C_MAGICSTREET
|
|
|
|
|
* erzeugt Stra<EFBFBD>ennetz
|
|
|
|
|
*/
|
2002-05-09 11:44:16 +02:00
|
|
|
|
static int
|
2002-05-09 22:08:57 +02:00
|
|
|
|
cinfo_magicstreet(const locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
2002-05-09 11:44:16 +02:00
|
|
|
|
{
|
2002-05-09 13:17:31 +02:00
|
|
|
|
message * msg;
|
|
|
|
|
|
2002-05-09 11:44:16 +02:00
|
|
|
|
unused(typ);
|
|
|
|
|
unused(self);
|
|
|
|
|
unused(obj);
|
|
|
|
|
|
|
|
|
|
assert(typ == TYP_REGION);
|
|
|
|
|
|
2002-05-09 13:17:31 +02:00
|
|
|
|
/* Warnung vor Aufl<66>sung */
|
2002-05-09 11:44:16 +02:00
|
|
|
|
if (c->duration <= 2){
|
2002-05-09 13:17:31 +02:00
|
|
|
|
msg = msg_message("curseinfo::magicstreet", "id", c->no);
|
|
|
|
|
} else {
|
|
|
|
|
msg = msg_message("curseinfo::magicstreetwarn", "id", c->no);
|
2002-05-09 11:44:16 +02:00
|
|
|
|
}
|
2002-05-09 19:34:43 +02:00
|
|
|
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
|
|
|
msg_release(msg);
|
2002-05-09 11:44:16 +02:00
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2002-05-10 19:51:20 +02:00
|
|
|
|
static struct curse_type ct_magicstreet = {
|
|
|
|
|
"magicstreet",
|
|
|
|
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
|
|
|
|
"Es scheint sich um einen elementarmagischen Zauber zu handeln, der alle "
|
|
|
|
|
"Pfade und Wege so gut festigt, als w<>ren sie gepflastert. Wie auf einer "
|
|
|
|
|
"Stra<EFBFBD>e kommt man so viel besser und schneller vorw<72>rts.",
|
|
|
|
|
cinfo_magicstreet
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
|
|
2002-05-09 19:34:43 +02:00
|
|
|
|
static int
|
2002-05-09 22:08:57 +02:00
|
|
|
|
cinfo_antimagiczone(const locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
2002-05-09 19:34:43 +02:00
|
|
|
|
{
|
|
|
|
|
message * msg;
|
|
|
|
|
|
|
|
|
|
unused(typ);
|
|
|
|
|
unused(self);
|
|
|
|
|
unused(obj);
|
|
|
|
|
|
|
|
|
|
assert(typ == TYP_REGION);
|
|
|
|
|
|
2002-05-10 19:51:20 +02:00
|
|
|
|
/* Magier sp<73>ren eine Antimagiezone */
|
|
|
|
|
if (self == 2 || self == 1){
|
2002-05-09 19:34:43 +02:00
|
|
|
|
msg = msg_message("curseinfo::antimagiczone", "id", c->no);
|
|
|
|
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
|
|
|
msg_release(msg);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-05-10 19:51:20 +02:00
|
|
|
|
static struct curse_type ct_antimagiczone = {
|
|
|
|
|
"antimagiczone",
|
|
|
|
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
|
|
|
|
"Dieser Zauber scheint magische Energien irgendwie abzuleiten und "
|
|
|
|
|
"so alle in der Region gezauberten Spr<70>che in ihrer Wirkung zu "
|
|
|
|
|
"schw<EFBFBD>chen oder ganz zu verhindern.",
|
|
|
|
|
cinfo_antimagiczone
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* alle Magier k<>nnen eine Antimagiezone wahrnehmen */
|
|
|
|
|
static int
|
|
|
|
|
cansee_antimagiczone(const struct faction *viewer, curse *c, const void * obj, typ_t typ, int self)
|
|
|
|
|
{
|
|
|
|
|
region *r;
|
|
|
|
|
unit *u = NULL;
|
|
|
|
|
unit *mage = c->magician;
|
|
|
|
|
|
|
|
|
|
unused(typ);
|
|
|
|
|
|
|
|
|
|
assert(typ == TYP_REGION);
|
|
|
|
|
r = (region *)obj;
|
|
|
|
|
for (u = r->units; u; u = u->next) {
|
|
|
|
|
if (u->faction==viewer){
|
|
|
|
|
if (u==mage){
|
|
|
|
|
self = 2;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (is_mage(u)){
|
|
|
|
|
self = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
2002-05-09 19:34:43 +02:00
|
|
|
|
static int
|
2002-05-09 22:08:57 +02:00
|
|
|
|
cinfo_farvision(const locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
2002-05-09 19:34:43 +02:00
|
|
|
|
{
|
|
|
|
|
message * msg;
|
|
|
|
|
|
|
|
|
|
unused(typ);
|
|
|
|
|
unused(obj);
|
|
|
|
|
|
|
|
|
|
assert(typ == TYP_REGION);
|
|
|
|
|
|
|
|
|
|
/* Magier sp<73>ren eine farvision */
|
|
|
|
|
if (self != 0){
|
|
|
|
|
msg = msg_message("curseinfo::farvision", "id", c->no);
|
|
|
|
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
|
|
|
msg_release(msg);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-10 19:51:20 +02:00
|
|
|
|
static struct curse_type ct_farvision = {
|
|
|
|
|
"farvision",
|
|
|
|
|
CURSETYP_NORM, 0, (NO_MERGE),
|
|
|
|
|
"",
|
|
|
|
|
cinfo_farvision
|
|
|
|
|
};
|
|
|
|
|
|
2002-05-09 19:34:43 +02:00
|
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
static struct curse_type ct_fogtrap = {
|
|
|
|
|
"fogtrap",
|
|
|
|
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
|
|
|
|
"",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_maelstrom = {
|
|
|
|
|
"maelstrom",
|
|
|
|
|
CURSETYP_NORM, 0, (M_DURATION | M_VIGOUR),
|
|
|
|
|
"Dieser Zauber verursacht einen gigantischen magischen Strudel. Der "
|
|
|
|
|
"Mahlstrom wird alle Schiffe, die in seinen Sog geraten, schwer "
|
|
|
|
|
"besch<EFBFBD>digen.",
|
|
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_blessedharvest = {
|
|
|
|
|
"blessedharvest",
|
|
|
|
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
|
|
|
|
"Dieser Fruchtbarkeitszauber erh<72>ht die Ertr<74>ge der Felder.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_drought = {
|
|
|
|
|
"drought",
|
|
|
|
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
|
|
|
|
"Dieser Zauber strahlt starke negative Energien aus. Warscheinlich "
|
|
|
|
|
"ist er die Ursache der D<>rre." ,
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_badlearn = {
|
|
|
|
|
"badlearn",
|
|
|
|
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
|
|
|
|
"Dieser Zauber scheint die Ursache f<>r die Schlaflosigkeit und "
|
|
|
|
|
"Mattigkeit zu sein, unter der die meisten Leute hier leiden und "
|
|
|
|
|
"die dazu f<>hrt, das Lernen weniger Erfolg bringt. ",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
/* Tr<54>bsal-Zauber */
|
|
|
|
|
static struct curse_type ct_depression = {
|
|
|
|
|
"depression",
|
|
|
|
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
|
|
|
|
|
"Wie schon zu vermuten war, sind der ewig graue Himmel und die "
|
|
|
|
|
"depressive Stimmung in der Region nicht nat<61>rlich. Dieser Fluch "
|
|
|
|
|
"hat sich wie ein bleiernes Tuch auf die Gem<65>ter der Bev<65>lkerung "
|
|
|
|
|
"gelegt und eh er nicht gebrochen oder verklungen ist, wird keiner "
|
|
|
|
|
"sich an Gaukelleien erfreuen k<>nnen.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Astralblock, auf Astralregion */
|
|
|
|
|
static struct curse_type ct_astralblock = {
|
|
|
|
|
"astralblock",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
/* Unterhaltungsanteil vermehren */
|
|
|
|
|
static struct curse_type ct_generous = {
|
|
|
|
|
"generous",
|
|
|
|
|
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR | M_MAXEFFECT ),
|
|
|
|
|
"Dieser Zauber beeinflusst die allgemeine Stimmung in der Region positiv. "
|
|
|
|
|
"Die gute Laune macht die Leute freigiebiger.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
/* verhindert Attackiere regional */
|
|
|
|
|
static struct curse_type ct_peacezone = {
|
|
|
|
|
"peacezone",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"Dieser machtvoller Beeinflussungszauber erstickt jeden Streit schon im "
|
|
|
|
|
"Keim.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
/* erschwert geordnete Bewegungen */
|
|
|
|
|
static struct curse_type ct_disorientationzone = {
|
|
|
|
|
"disorientationzone",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
/* erniedigt Magieresistenz von nicht-aliierten Einheiten, wirkt nur 1x
|
|
|
|
|
* pro Einheit */
|
|
|
|
|
static struct curse_type ct_badmagicresistancezone = {
|
|
|
|
|
"badmagicresistancezone",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"Dieses Lied, das irgendwie in die magische Essenz der Region gewoben "
|
|
|
|
|
"ist, schw<68>cht die nat<61>rliche Widerstandskraft gegen eine "
|
|
|
|
|
"Verzauberung. Es scheint jedoch nur auf bestimmte Einheiten zu wirken.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
/* erh<72>ht Magieresistenz von aliierten Einheiten, wirkt nur 1x pro
|
|
|
|
|
* Einheit */
|
|
|
|
|
static struct curse_type ct_goodmagicresistancezone = {
|
|
|
|
|
"goodmagicresistancezone",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"Dieser Lied, das irgendwie in die magische Essenz der Region gewoben "
|
|
|
|
|
"ist, verst<73>rkt die nat<61>rliche Widerstandskraft gegen eine "
|
|
|
|
|
"Verzauberung. Es scheint jedoch nur auf bestimmte Einheiten zu wirken.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_riotzone = {
|
|
|
|
|
"riotzone",
|
|
|
|
|
CURSETYP_NORM, 0, (M_DURATION),
|
|
|
|
|
"Eine Wolke negativer Energie liegt <20>ber der Region.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_holyground = {
|
|
|
|
|
"holyground",
|
|
|
|
|
CURSETYP_NORM, 0, (M_VIGOUR_ADD),
|
|
|
|
|
"Verschiedene Naturgeistern sind im Boden der Region gebunden und "
|
|
|
|
|
"besch<EFBFBD>tzen diese vor dem der dunklen Magie des lebenden Todes.",
|
|
|
|
|
cinfo_region
|
|
|
|
|
};
|
2002-05-09 14:36:43 +02:00
|
|
|
|
|
2002-05-09 14:19:15 +02:00
|
|
|
|
void
|
|
|
|
|
register_regioncurse(void)
|
2002-05-09 13:41:20 +02:00
|
|
|
|
{
|
2002-05-09 14:19:15 +02:00
|
|
|
|
register_function((pf_generic)cinfo_cursed_by_the_gods, "curseinfo::cursed_by_the_gods");
|
|
|
|
|
register_function((pf_generic)cinfo_dreamcurse, "curseinfo::dreamcurse");
|
|
|
|
|
register_function((pf_generic)cinfo_magicstreet, "curseinfo::magicstreet");
|
2002-05-09 19:34:43 +02:00
|
|
|
|
|
2002-05-10 19:51:20 +02:00
|
|
|
|
register_function((pf_generic)cansee_antimagiczone, "cursecansee::antimagiczone");
|
|
|
|
|
|
2002-05-09 19:34:43 +02:00
|
|
|
|
ct_register(&ct_fogtrap);
|
|
|
|
|
ct_register(&ct_antimagiczone);
|
|
|
|
|
ct_register(&ct_farvision);
|
|
|
|
|
ct_register(&ct_gbdream);
|
|
|
|
|
ct_register(&ct_maelstrom);
|
|
|
|
|
ct_register(&ct_blessedharvest);
|
|
|
|
|
ct_register(&ct_drought);
|
|
|
|
|
ct_register(&ct_badlearn);
|
|
|
|
|
ct_register(&ct_depression);
|
|
|
|
|
ct_register(&ct_astralblock);
|
|
|
|
|
ct_register(&ct_generous);
|
|
|
|
|
ct_register(&ct_peacezone);
|
|
|
|
|
ct_register(&ct_disorientationzone);
|
|
|
|
|
ct_register(&ct_magicstreet);
|
|
|
|
|
ct_register(&ct_badmagicresistancezone);
|
|
|
|
|
ct_register(&ct_goodmagicresistancezone);
|
|
|
|
|
ct_register(&ct_riotzone);
|
|
|
|
|
ct_register(&ct_godcursezone);
|
|
|
|
|
ct_register(&ct_holyground);
|
2002-05-09 13:41:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
2002-05-09 19:34:43 +02:00
|
|
|
|
|