noch ein wenig hin und her geschiebe

This commit is contained in:
Katja Zedel 2002-05-09 20:28:55 +00:00
parent a2311e518b
commit 4c096ba6f6
4 changed files with 252 additions and 200 deletions

View File

@ -672,28 +672,6 @@ is_cursed_with(attrib *ap, curse *c)
return false; return false;
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static int
read_skill(FILE * F, curse * c)
{
int skill;
if (global.data_version<CURSETYPE_VERSION) {
int men;
fscanf(F, "%d %d", &skill, &men);
} else {
fscanf(F, "%d", &skill);
}
c->data = (void*)skill;
return 0;
}
static int
write_skill(FILE * F, const curse * c)
{
fprintf(F, "%d ", (int)c->data);
return 0;
}
/* ------------------------------------------------------------- */
/* cursedata */ /* cursedata */
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* /*
@ -709,28 +687,6 @@ write_skill(FILE * F, const curse * c)
* int (*write)(FILE * F, const curse * c); * int (*write)(FILE * F, const curse * c);
* } curse_type; * } curse_type;
*/ */
static struct curse_type ct_stormwind = { "stormwind",
CURSETYP_NORM, 0, NO_MERGE,
"",
NULL
};
static struct curse_type ct_flyingship = { "flyingship",
CURSETYP_NORM, 0, NO_MERGE,
"",
NULL
};
static struct curse_type ct_nodrift = { "nodrift",
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
"Der Zauber auf diesem Schiff ist aus den elementaren Magien der Luft "
"und des Wassers gebunden. Der dem Wasser verbundene Teil des Zaubers "
"läßt es leichter durch die Wellen gleiten und der der Luft verbundene "
"Teil scheint es vor widrigen Winden zu schützen."
};
static struct curse_type ct_shipdisorientation = { "shipdisorientation",
CURSETYP_NORM, 0, NO_MERGE,
"Dieses Schiff hat sich verfahren."
};
static struct curse_type ct_magicwalls = { "magicwalls", static struct curse_type ct_magicwalls = { "magicwalls",
CURSETYP_NORM, 0, NO_MERGE, CURSETYP_NORM, 0, NO_MERGE,
"Die Macht dieses Zaubers ist fast greifbar und tief in die Mauern " "Die Macht dieses Zaubers ist fast greifbar und tief in die Mauern "
@ -757,82 +713,6 @@ static struct curse_type ct_nocostbuilding = { "nocostbuilding",
cinfo_region cinfo_region
}; };
static struct curse_type ct_auraboost = { "auraboost",
CURSETYP_NORM, CURSE_SPREADMODULO, (NO_MERGE),
"Dieser Zauber greift irgendwie in die Verbindung zwischen Magier "
"und Magischer Essenz ein. Mit positiver Ausrichtung kann er wohl "
"wie ein Fokus für Aura wirken, jedoch genauso für das Gegenteil "
"benutzt werden."
};
static struct curse_type ct_slavery = { "slavery",
CURSETYP_NORM, 0, NO_MERGE,
"Dieser mächtige Bann scheint die Einheit ihres freien Willens "
"zu berauben. Solange der Zauber wirkt, wird sie nur den Befehlen "
"ihres neuen Herrn gehorchen."
};
static struct curse_type ct_calmmonster = { "calmmonster",
CURSETYP_NORM, CURSE_SPREADNEVER, NO_MERGE,
"Dieser Beeinflussungszauber scheint die Einheit einem ganz "
"bestimmten Volk wohlgesonnen zu machen."
};
static struct curse_type ct_oldrace = { "oldrace",
CURSETYP_NORM, CURSE_SPREADALWAYS, NO_MERGE,
"",
NULL
};
static struct curse_type ct_fumble = { "fumble",
CURSETYP_NORM, CURSE_SPREADNEVER, NO_MERGE,
"Eine Wolke negativer Energie umgibt die Einheit."
};
static struct curse_type ct_speed = { "speed",
CURSETYP_UNIT, CURSE_SPREADNEVER, M_MEN,
"Diese Einheit bewegt sich doppelt so schnell."
};
static struct curse_type ct_orcish = { "orcish",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"Dieser Zauber scheint die Einheit zu 'orkisieren'. Wie bei Orks "
"ist eine deutliche Neigung zur Fortpflanzung zu beobachten."
};
static struct curse_type ct_magicboost = { "magicboost",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"",
NULL
};
static struct curse_type ct_insectfur = { "insectfur",
CURSETYP_UNIT, CURSE_SPREADMODULO, ( M_MEN | M_DURATION ),
"Dieser Zauber schützt vor den Auswirkungen der Kälte."
};
static struct curse_type ct_strength = { "strength",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"Dieser Zauber vermehrt die Stärke der verzauberten Personen um ein "
"vielfaches."
};
static struct curse_type ct_worse = { "worse",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
""
};
static struct curse_type ct_magicresistance = { "magicresistance",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"Dieser Zauber verstärkt die natürliche Widerstandskraft gegen eine "
"Verzauberung.",
NULL
};
static struct curse_type ct_itemcloak = { "itemcloak",
CURSETYP_UNIT, CURSE_SPREADNEVER, M_DURATION,
"Dieser Zauber macht die Ausrüstung unsichtbar."
};
static struct curse_type ct_sparkle = { "sparkle",
CURSETYP_UNIT, CURSE_SPREADMODULO, ( M_MEN | M_DURATION ),
"Dieser Zauber ist einer der ersten, den junge Magier in der Schule lernen."
};
static struct curse_type ct_skillmod = { "skillmod",
CURSETYP_NORM, CURSE_SPREADMODULO, M_MEN,
"",
cinfo_unit,
NULL,
read_skill, write_skill
};
void * void *
resolve_curse(void * id) resolve_curse(void * id)
@ -843,30 +723,15 @@ resolve_curse(void * id)
void void
register_curses(void) register_curses(void)
{ {
ct_register(&ct_auraboost); register_unitcurse();
ct_register(&ct_stormwind); register_regioncurse();
ct_register(&ct_flyingship); register_shipcurse();
ct_register(&ct_nodrift); register_buildingcurse();
ct_register(&ct_magicwalls); ct_register(&ct_magicwalls);
ct_register(&ct_strongwall); ct_register(&ct_strongwall);
ct_register(&ct_magicrunes); ct_register(&ct_magicrunes);
ct_register(&ct_slavery);
ct_register(&ct_shipdisorientation);
ct_register(&ct_calmmonster);
ct_register(&ct_oldrace);
ct_register(&ct_fumble);
ct_register(&ct_nocostbuilding); ct_register(&ct_nocostbuilding);
ct_register(&ct_speed);
ct_register(&ct_orcish);
ct_register(&ct_magicboost);
ct_register(&ct_insectfur);
ct_register(&ct_strength);
ct_register(&ct_worse);
ct_register(&ct_magicresistance);
ct_register(&ct_itemcloak);
ct_register(&ct_sparkle);
ct_register(&ct_skillmod);
} }

View File

@ -41,7 +41,7 @@ cinfo_ship(const locale * lang, const void * obj, typ_t typ, curse *c, int self)
unused(obj); unused(obj);
assert(typ == TYP_SHIP); assert(typ == TYP_SHIP);
if (self){ /* owner or inside */ if (self != 0){ /* owner or inside */
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no); msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
} else { } else {
msg = msg_message(mkname("curseinfo", "shipunknown"), "id", c->no); msg = msg_message(mkname("curseinfo", "shipunknown"), "id", c->no);
@ -63,7 +63,7 @@ cinfo_shipnodrift(const locale * lang, void * obj, typ_t typ, curse *c, int self
assert(typ == TYP_SHIP); assert(typ == TYP_SHIP);
sh = (ship*)obj; sh = (ship*)obj;
if (self){ if (self != 0){
sprintf(buf, "%s ist mit guten Wind gesegnet", sh->name); sprintf(buf, "%s ist mit guten Wind gesegnet", sh->name);
if (c->duration <= 2){ if (c->duration <= 2){
scat(", doch der Zauber beginnt sich bereits aufzulösen"); scat(", doch der Zauber beginnt sich bereits aufzulösen");
@ -94,9 +94,37 @@ cinfo_disorientation(void * obj, typ_t typ, curse *c, int self)
return 1; return 1;
} }
static struct curse_type ct_stormwind = { "stormwind",
CURSETYP_NORM, 0, NO_MERGE,
"",
NULL
};
static struct curse_type ct_flyingship = { "flyingship",
CURSETYP_NORM, 0, NO_MERGE,
"",
NULL
};
static struct curse_type ct_nodrift = { "nodrift",
CURSETYP_NORM, 0, ( M_DURATION | M_VIGOUR ),
"Der Zauber auf diesem Schiff ist aus den elementaren Magien der Luft "
"und des Wassers gebunden. Der dem Wasser verbundene Teil des Zaubers "
"läßt es leichter durch die Wellen gleiten und der der Luft verbundene "
"Teil scheint es vor widrigen Winden zu schützen."
};
static struct curse_type ct_shipdisorientation = { "shipdisorientation",
CURSETYP_NORM, 0, NO_MERGE,
"Dieses Schiff hat sich verfahren."
};
void void
register_shipcurse(void) register_shipcurse(void)
{ {
register_function((pf_generic)cinfo_disorientation, "curseinfo::disorientation"); register_function((pf_generic)cinfo_disorientation, "curseinfo::disorientation");
register_function((pf_generic)cinfo_shipnodrift, "curseinfo::shipnodrift"); register_function((pf_generic)cinfo_shipnodrift, "curseinfo::shipnodrift");
ct_register(&ct_stormwind);
ct_register(&ct_flyingship);
ct_register(&ct_nodrift);
ct_register(&ct_shipdisorientation);
} }

View File

@ -36,6 +36,7 @@
#include <assert.h> #include <assert.h>
/* ------------------------------------------------------------- */
int int
cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -64,7 +65,7 @@ cinfo_unit_onlyowner(const struct locale * lang, const void * obj, typ_t typ, st
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
u = (struct unit *)obj; u = (struct unit *)obj;
if (self){ if (self != 0){
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no); msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
nr_render(msg, lang, buf, sizeof(buf), NULL); nr_render(msg, lang, buf, sizeof(buf), NULL);
msg_release(msg); msg_release(msg);
@ -73,9 +74,10 @@ cinfo_unit_onlyowner(const struct locale * lang, const void * obj, typ_t typ, st
return 0; return 0;
} }
/* CurseInfo mit Spezialabfragen */ /* ------------------------------------------------------------- */
/*
/* C_AURA */ * C_AURA
*/
/* erhöht/senkt regeneration und maxaura um effect% */ /* erhöht/senkt regeneration und maxaura um effect% */
static int static int
cinfo_auraboost(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_auraboost(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
@ -85,7 +87,7 @@ cinfo_auraboost(const struct locale * lang, const void * obj, typ_t typ, struct
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
u = (struct unit *)obj; u = (struct unit *)obj;
if (self){ if (self != 0){
if (c->effect > 100){ if (c->effect > 100){
sprintf(buf, "%s fühlt sich von starken magischen Energien " sprintf(buf, "%s fühlt sich von starken magischen Energien "
"durchströmt. (%s)", u->name, curseid(c)); "durchströmt. (%s)", u->name, curseid(c));
@ -97,8 +99,27 @@ cinfo_auraboost(const struct locale * lang, const void * obj, typ_t typ, struct
} }
return 0; return 0;
} }
static struct curse_type ct_auraboost = {
"auraboost",
CURSETYP_NORM, CURSE_SPREADMODULO, (NO_MERGE),
"Dieser Zauber greift irgendwie in die Verbindung zwischen Magier "
"und Magischer Essenz ein. Mit positiver Ausrichtung kann er wohl "
"wie ein Fokus für Aura wirken, jedoch genauso für das Gegenteil "
"benutzt werden.",
cinfo_auraboost
};
/* Magic Boost - Gabe des Chaos */
static struct curse_type ct_magicboost = {
"magicboost",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"",
NULL
};
/* C_SLAVE */ /* ------------------------------------------------------------- */
/*
* C_SLAVE
*/
static int static int
cinfo_slave(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_slave(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -108,15 +129,25 @@ cinfo_slave(const struct locale * lang, const void * obj, typ_t typ, struct curs
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
u = (unit *)obj; u = (unit *)obj;
if (self){ if (self != 0){
sprintf(buf, "%s wird noch %d Woche%s unter unserem Bann stehen. (%s)", sprintf(buf, "%s wird noch %d Woche%s unter unserem Bann stehen. (%s)",
u->name, c->duration, (c->duration == 1)? "":"n", curseid(c)); u->name, c->duration, (c->duration == 1)? "":"n", curseid(c));
return 1; return 1;
} }
return 0; return 0;
} }
static struct curse_type ct_slavery = { "slavery",
CURSETYP_NORM, 0, NO_MERGE,
"Dieser mächtige Bann scheint die Einheit ihres freien Willens "
"zu berauben. Solange der Zauber wirkt, wird sie nur den Befehlen "
"ihres neuen Herrn gehorchen.",
cinfo_slave
};
/* C_CALM */ /* ------------------------------------------------------------- */
/*
* C_CALM
*/
static int static int
cinfo_calm(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_calm(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -130,7 +161,7 @@ cinfo_calm(const struct locale * lang, const void * obj, typ_t typ, struct curse
if (c->magician){ if (c->magician){
rc = c->magician->irace; rc = c->magician->irace;
f = c->magician->faction; f = c->magician->faction;
if (self) { if (self != 0) {
sprintf(buf, "%s mag %s", u->name, factionname(f)); sprintf(buf, "%s mag %s", u->name, factionname(f));
} else { } else {
sprintf(buf, "%s scheint %s zu mögen", u->name, LOC(f->locale, rc_name(rc, 1))); sprintf(buf, "%s scheint %s zu mögen", u->name, LOC(f->locale, rc_name(rc, 1)));
@ -143,7 +174,17 @@ cinfo_calm(const struct locale * lang, const void * obj, typ_t typ, struct curse
} }
return 0; return 0;
} }
/* C_SPEED */ static struct curse_type ct_calmmonster = { "calmmonster",
CURSETYP_NORM, CURSE_SPREADNEVER, NO_MERGE,
"Dieser Beeinflussungszauber scheint die Einheit einem ganz "
"bestimmten Volk wohlgesonnen zu machen.",
cinfo_calm
};
/* ------------------------------------------------------------- */
/*
* C_SPEED
*/
static int static int
cinfo_speed(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_speed(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -155,7 +196,7 @@ cinfo_speed(const struct locale * lang, const void * obj, typ_t typ, struct curs
u = (unit *)obj; u = (unit *)obj;
cu = (curse_unit *)c->data; cu = (curse_unit *)c->data;
if (self){ if (self != 0){
sprintf(buf, "%d Person%s von %s %s noch %d Woche%s beschleunigt. (%s)", sprintf(buf, "%d Person%s von %s %s noch %d Woche%s beschleunigt. (%s)",
cu->cursedmen, (cu->cursedmen == 1)? "":"en", u->name, cu->cursedmen, (cu->cursedmen == 1)? "":"en", u->name,
(cu->cursedmen == 1)? "ist":"sind", c->duration, (cu->cursedmen == 1)? "ist":"sind", c->duration,
@ -165,7 +206,17 @@ cinfo_speed(const struct locale * lang, const void * obj, typ_t typ, struct curs
} }
return 0; return 0;
} }
/* C_ORC */ static struct curse_type ct_speed = {
"speed",
CURSETYP_UNIT, CURSE_SPREADNEVER, M_MEN,
"Diese Einheit bewegt sich doppelt so schnell.",
cinfo_speed
};
/* ------------------------------------------------------------- */
/*
* C_ORC
*/
static int static int
cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -176,7 +227,7 @@ cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
u = (unit *)obj; u = (unit *)obj;
if (self){ if (self != 0){
msg = msg_message(mkname("curseinfo", c->type->cname), "unit id", u, c->no); msg = msg_message(mkname("curseinfo", c->type->cname), "unit id", u, c->no);
nr_render(msg, lang, buf, sizeof(buf), NULL); nr_render(msg, lang, buf, sizeof(buf), NULL);
msg_release(msg); msg_release(msg);
@ -184,8 +235,18 @@ cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse
} }
return 0; return 0;
} }
static struct curse_type ct_orcish = {
"orcish",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"Dieser Zauber scheint die Einheit zu 'orkisieren'. Wie bei Orks "
"ist eine deutliche Neigung zur Fortpflanzung zu beobachten.",
cinfo_orc
};
/* C_KAELTESCHUTZ */ /* ------------------------------------------------------------- */
/*
* C_KAELTESCHUTZ
*/
static int static int
cinfo_kaelteschutz(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_kaelteschutz(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -197,7 +258,7 @@ cinfo_kaelteschutz(const struct locale * lang, const void * obj, typ_t typ, stru
u = (unit *)obj; u = (unit *)obj;
cu = (curse_unit *)c->data; cu = (curse_unit *)c->data;
if (self){ if (self != 0){
sprintf(buf, "%d Person%s von %s %s sich vor Kälte geschützt. (%s)", sprintf(buf, "%d Person%s von %s %s sich vor Kälte geschützt. (%s)",
cu->cursedmen, (cu->cursedmen == 1)? "":"en", u->name, cu->cursedmen, (cu->cursedmen == 1)? "":"en", u->name,
(cu->cursedmen == 1)? "fühlt":"fühlen", (cu->cursedmen == 1)? "fühlt":"fühlen",
@ -206,8 +267,17 @@ cinfo_kaelteschutz(const struct locale * lang, const void * obj, typ_t typ, stru
} }
return 0; return 0;
} }
static struct curse_type ct_insectfur = {
"insectfur",
CURSETYP_UNIT, CURSE_SPREADMODULO, ( M_MEN | M_DURATION ),
"Dieser Zauber schützt vor den Auswirkungen der Kälte.",
cinfo_kaelteschutz
};
/* C_SPARKLE */ /* ------------------------------------------------------------- */
/*
* C_SPARKLE
*/
static int static int
cinfo_sparkle(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_sparkle(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -261,8 +331,16 @@ cinfo_sparkle(const struct locale * lang, const void * obj, typ_t typ, struct cu
return 1; return 1;
} }
static struct curse_type ct_sparkle = { "sparkle",
CURSETYP_UNIT, CURSE_SPREADMODULO, ( M_MEN | M_DURATION ),
"Dieser Zauber ist einer der ersten, den junge Magier in der Schule lernen.",
NULL
};
/* C_STRENGTH */ /* ------------------------------------------------------------- */
/*
* C_STRENGTH
*/
static int static int
cinfo_strength(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_strength(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -272,14 +350,24 @@ cinfo_strength(const struct locale * lang, const void * obj, typ_t typ, struct c
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
unused(obj); unused(obj);
if (self){ if (self != 0){
sprintf(buf, "Die Leute strotzen nur so vor Kraft. (%s)", sprintf(buf, "Die Leute strotzen nur so vor Kraft. (%s)",
curseid(c)); curseid(c));
return 1; return 1;
} }
return 0; return 0;
} }
/* C_ALLSKILLS */ static struct curse_type ct_strength = { "strength",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"Dieser Zauber vermehrt die Stärke der verzauberten Personen um ein "
"vielfaches.",
NULL
};
/* ------------------------------------------------------------- */
/*
* C_ALLSKILLS (Alp)
*/
static int static int
cinfo_allskills(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_allskills(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -289,29 +377,24 @@ cinfo_allskills(const struct locale * lang, const void * obj, typ_t typ, struct
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
if (self){ if (self != 0){
sprintf(buf, "Wird von einem Alp geritten. (%s)", curseid(c)); sprintf(buf, "Wird von einem Alp geritten. (%s)", curseid(c));
return 1; return 1;
} }
return 0; return 0;
} }
/* C_SKILL */ static struct curse_type ct_worse = {
static int "worse",
cinfo_skill(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
{ "",
unit *u = (unit *)obj; NULL
int sk = (int)c->data; };
unused(typ); /* ------------------------------------------------------------- */
if (self){ /*
sprintf(buf, "%s ist in %s ungewöhnlich ungeschickt. (%s)", u->name, * C_ITEMCLOAK
skillname((skill_t)sk, u->faction->locale), curseid(c)); */
return 1;
}
return 0;
}
/* C_ITEMCLOAK */
static int static int
cinfo_itemcloak(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_itemcloak(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
@ -321,13 +404,20 @@ cinfo_itemcloak(const struct locale * lang, const void * obj, typ_t typ, struct
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
u = (unit *)obj; u = (unit *)obj;
if (self) { if (self != 0) {
sprintf(buf, "Die Ausrüstung von %s scheint unsichtbar. (%s)", sprintf(buf, "Die Ausrüstung von %s scheint unsichtbar. (%s)",
u->name, curseid(c)); u->name, curseid(c));
return 1; return 1;
} }
return 0; return 0;
} }
static struct curse_type ct_itemcloak = {
"itemcloak",
CURSETYP_UNIT, CURSE_SPREADNEVER, M_DURATION,
"Dieser Zauber macht die Ausrüstung unsichtbar.",
cinfo_itemcloak
};
/* ------------------------------------------------------------- */
static int static int
cinfo_fumble(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self) cinfo_fumble(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
@ -337,15 +427,85 @@ cinfo_fumble(const struct locale * lang, const void * obj, typ_t typ, struct cur
assert(typ == TYP_UNIT); assert(typ == TYP_UNIT);
if (self){ if (self != 0){
sprintf(buf, "%s kann sich kaum konzentrieren.i (%s)", sprintf(buf, "%s kann sich kaum konzentrieren. (%s)",
u->name, curseid(c)); u->name, curseid(c));
return 1; return 1;
} }
return 0; return 0;
} }
static struct curse_type ct_fumble = {
"fumble",
CURSETYP_NORM, CURSE_SPREADNEVER, NO_MERGE,
"Eine Wolke negativer Energie umgibt die Einheit.",
cinfo_fumble
};
/* ------------------------------------------------------------- */
static struct curse_type ct_oldrace = { "oldrace",
CURSETYP_NORM, CURSE_SPREADALWAYS, NO_MERGE,
"",
NULL
};
static struct curse_type ct_magicresistance = { "magicresistance",
CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN,
"Dieser Zauber verstärkt die natürliche Widerstandskraft gegen eine "
"Verzauberung.",
NULL
};
/* ------------------------------------------------------------- */
/*
* C_SKILL
*/
static int
read_skill(FILE * F, curse * c)
{
int skill;
if (global.data_version<CURSETYPE_VERSION) {
int men;
fscanf(F, "%d %d", &skill, &men);
} else {
fscanf(F, "%d", &skill);
}
c->data = (void*)skill;
return 0;
}
static int
write_skill(FILE * F, const curse * c)
{
fprintf(F, "%d ", (int)c->data);
return 0;
}
static int
cinfo_skill(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{
unit *u = (unit *)obj;
int sk = (int)c->data;
unused(typ);
if (self != 0){
sprintf(buf, "%s ist in %s ungewöhnlich ungeschickt. (%s)", u->name,
skillname((skill_t)sk, u->faction->locale), curseid(c));
return 1;
}
return 0;
}
static struct curse_type ct_skillmod = {
"skillmod",
CURSETYP_NORM, CURSE_SPREADMODULO, M_MEN,
"",
cinfo_unit,
NULL,
read_skill, write_skill
};
/* ------------------------------------------------------------- */
void void
register_unitcurse(void) register_unitcurse(void)
{ {
@ -362,4 +522,22 @@ register_unitcurse(void)
register_function((pf_generic)cinfo_skill, "curseinfo::skill"); register_function((pf_generic)cinfo_skill, "curseinfo::skill");
register_function((pf_generic)cinfo_itemcloak, "curseinfo::itemcloak"); register_function((pf_generic)cinfo_itemcloak, "curseinfo::itemcloak");
register_function((pf_generic)cinfo_fumble, "curseinfo::fumble"); register_function((pf_generic)cinfo_fumble, "curseinfo::fumble");
ct_register(&ct_auraboost);
ct_register(&ct_magicboost);
ct_register(&ct_slavery);
ct_register(&ct_calmmonster);
ct_register(&ct_speed);
ct_register(&ct_orcish);
ct_register(&ct_insectfur);
ct_register(&ct_sparkle);
ct_register(&ct_strength);
ct_register(&ct_worse);
ct_register(&ct_skillmod);
ct_register(&ct_itemcloak);
ct_register(&ct_fumble);
ct_register(&ct_oldrace);
ct_register(&ct_magicresistance);
} }

View File

@ -13,26 +13,7 @@
#ifndef _UCURSE_H #ifndef _UCURSE_H
#define _UCURSE_H #define _UCURSE_H
/* Die sollen ganz sicher nicht an andere module exporiert werden, sondern in
* einer register-funktion registriert werden:
int cinfo_unit(const struct locale *, void *, enum typ_t, struct curse *, int);
int cinfo_unit_onlyowner(const struct locale *, void *, enum typ_t, struct curse *, int);
*/
/* altlasten */
/*
int cinfo_auraboost(void *, enum typ_t, struct curse *, int);
int cinfo_slave(void *, enum typ_t, struct curse *, int);
int cinfo_calm(void *, enum typ_t, struct curse *, int);
int cinfo_speed(void *, enum typ_t, struct curse *, int);
int cinfo_orc(void *, enum typ_t, struct curse *, int);
int cinfo_kaelteschutz(void *, enum typ_t, struct curse *, int);
int cinfo_sparkle(void *, enum typ_t, struct curse *, int);
int cinfo_strength(void *, enum typ_t, struct curse *, int);
int cinfo_allskills(void *, enum typ_t, struct curse *, int);
int cinfo_skill(void *, enum typ_t, struct curse *, int);
int cinfo_itemcloak(void *, enum typ_t, struct curse *, int);
int cinfo_fumble(void *, enum typ_t, struct curse *, int);
*/
struct curse; struct curse;
struct locale; struct locale;
extern int cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self); extern int cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);