forked from github/server
3449399eec
Forsche Kräuter Meldung steht nur in Regionsmeldung - http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000165 Regionsmeldung "LERNEN Hiebwaffen"
415 lines
10 KiB
C
415 lines
10 KiB
C
/* vi: set ts=2:
|
||
*
|
||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||
* 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 */
|
||
#include <region.h>
|
||
#include <message.h>
|
||
#include <nrmessage.h>
|
||
#include <objtypes.h>
|
||
#include <curse.h>
|
||
#include <unit.h>
|
||
#include <magic.h>
|
||
|
||
/* util includes */
|
||
#include <message.h>
|
||
#include <functions.h>
|
||
|
||
/* libc includes */
|
||
#include <string.h>
|
||
#include <stdlib.h>
|
||
#include <assert.h>
|
||
|
||
/* --------------------------------------------------------------------- */
|
||
|
||
int
|
||
cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
|
||
{
|
||
message * msg;
|
||
|
||
unused(typ);
|
||
unused(self);
|
||
unused(obj);
|
||
|
||
assert(typ == TYP_REGION);
|
||
|
||
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
|
||
if (msg) {
|
||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||
msg_release(msg);
|
||
return 1;
|
||
}
|
||
log_warning(("There is no curseinfo for %s.\n", c->type->cname));
|
||
return 0;
|
||
}
|
||
|
||
|
||
/* --------------------------------------------------------------------- */
|
||
/* CurseInfo mit Spezialabfragen
|
||
*/
|
||
|
||
/*
|
||
* godcursezone
|
||
*/
|
||
static int
|
||
cinfo_cursed_by_the_gods(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||
{
|
||
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);
|
||
}
|
||
if (msg!=NULL) {
|
||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||
msg_release(msg);
|
||
|
||
return 1;
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
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,
|
||
};
|
||
|
||
|
||
/* --------------------------------------------------------------------- */
|
||
/*
|
||
* C_GBDREAM
|
||
*/
|
||
static int
|
||
cinfo_dreamcurse(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||
{
|
||
message * msg;
|
||
|
||
unused(self);
|
||
unused(typ);
|
||
unused(obj);
|
||
assert(typ == TYP_REGION);
|
||
|
||
if (curse_geteffect(c) > 0){
|
||
msg = msg_message("curseinfo::gooddream", "id", c->no);
|
||
} else {
|
||
msg = msg_message("curseinfo::baddream", "id", c->no);
|
||
}
|
||
if (msg!=NULL) {
|
||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||
msg_release(msg);
|
||
return 1;
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
static struct curse_type ct_gbdream = {
|
||
"gbdream",
|
||
CURSETYP_NORM, 0, (NO_MERGE),
|
||
"",
|
||
cinfo_dreamcurse
|
||
};
|
||
|
||
/* --------------------------------------------------------------------- */
|
||
/*
|
||
* C_MAGICSTREET
|
||
* erzeugt Stra<72>ennetz
|
||
*/
|
||
static int
|
||
cinfo_magicstreet(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||
{
|
||
message * msg;
|
||
|
||
unused(typ);
|
||
unused(self);
|
||
unused(obj);
|
||
|
||
assert(typ == TYP_REGION);
|
||
|
||
/* Warnung vor Aufl<66>sung */
|
||
if (c->duration <= 2){
|
||
msg = msg_message("curseinfo::magicstreet", "id", c->no);
|
||
} else {
|
||
msg = msg_message("curseinfo::magicstreetwarn", "id", c->no);
|
||
}
|
||
if (msg!=NULL) {
|
||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||
msg_release(msg);
|
||
return 1;
|
||
}
|
||
return 0;
|
||
}
|
||
|
||
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
|
||
};
|
||
|
||
/* --------------------------------------------------------------------- */
|
||
|
||
static int
|
||
cinfo_antimagiczone(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||
{
|
||
message * msg;
|
||
|
||
unused(typ);
|
||
unused(self);
|
||
unused(obj);
|
||
|
||
assert(typ == TYP_REGION);
|
||
|
||
/* Magier sp<73>ren eine Antimagiezone */
|
||
if (self == 2 || self == 1){
|
||
msg = msg_message("curseinfo::antimagiczone", "id", c->no);
|
||
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
||
msg_release(msg);
|
||
return 1;
|
||
}
|
||
|
||
return 0;
|
||
}
|
||
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;
|
||
}
|
||
|
||
/* --------------------------------------------------------------------- */
|
||
static int
|
||
cinfo_farvision(const struct locale * lang, const void * obj, typ_t typ, curse *c, int self)
|
||
{
|
||
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;
|
||
}
|
||
|
||
static struct curse_type ct_farvision = {
|
||
"farvision",
|
||
CURSETYP_NORM, 0, (NO_MERGE),
|
||
"",
|
||
cinfo_farvision
|
||
};
|
||
|
||
|
||
/* --------------------------------------------------------------------- */
|
||
|
||
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,
|
||
"Dieses 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),
|
||
NULL,
|
||
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
|
||
};
|
||
static struct curse_type ct_healing = {
|
||
"healingzone",
|
||
CURSETYP_NORM, 0, (M_VIGOUR | M_DURATION),
|
||
"Heilung ist in dieser Region magisch beeinflusst.",
|
||
cinfo_region
|
||
};
|
||
|
||
|
||
void
|
||
register_regioncurse(void)
|
||
{
|
||
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");
|
||
|
||
register_function((pf_generic)cansee_antimagiczone, "cursecansee::antimagiczone");
|
||
|
||
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);
|
||
ct_register(&ct_healing);
|
||
}
|
||
|
||
|