From 06c217771584fddc2c11f71ae3af12cace5a004d Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Fri, 20 Feb 2004 09:17:32 +0000 Subject: [PATCH] - Pyramidenregionfindezauber. Setzen des Attributs in passenden Regionen fehlt noch. --- src/common/kernel/message.c | 2 +- src/common/kernel/spell.c | 121 ++++++++++++++++++++++++++++++++++++ src/common/kernel/spell.h | 7 +++ src/common/settings-wdw.h | 1 + src/eressea/korrektur.c | 5 ++ src/res/messages.xml | 20 ++++++ 6 files changed, 155 insertions(+), 1 deletion(-) diff --git a/src/common/kernel/message.c b/src/common/kernel/message.c index 7af6fe39f..64dd3d578 100644 --- a/src/common/kernel/message.c +++ b/src/common/kernel/message.c @@ -498,7 +498,7 @@ new_message(struct faction * receiver, const char* sig, ...) args[i] = (void*)va_arg(marker, const resource_type *); break; case 'x': - args[i] = (void*)oldresourcetype[(resource_t)va_arg(marker, resource_t)]; + args[i] = (void*)oldresourcetype[(resource_t)va_arg(marker, int)]; break; case 't': args[i] = (void*)va_arg(marker, int); diff --git a/src/common/kernel/spell.c b/src/common/kernel/spell.c index c603cf802..11885a403 100644 --- a/src/common/kernel/spell.c +++ b/src/common/kernel/spell.c @@ -88,6 +88,12 @@ attrib_type at_unitdissolve = { "unitdissolve", NULL, NULL, NULL, a_writedefault, a_readdefault }; +#ifdef WDW_PYRAMIDSPELL +attrib_type at_wdwpyramid = { + "wdwpyramid", NULL, NULL, NULL, a_writedefault, a_readdefault +}; +#endif + /* ----------------------------------------------------------------------- */ #ifdef TODO @@ -7217,6 +7223,43 @@ sp_becomewyrm(castorder *co) return co->level; } +/* ------------------------------------------------------------- */ +/* Name: WDW-Pyramidenfindezauber + * Stufe: unterschiedlich + * Gebiet: alle + * Wirkung: + * gibt an, ob sich der Magier in einer Pyramidenbauregion + * befindet. + * + * Flags: + */ +static int +sp_wdwpyramid(castorder *co) +{ + region *r = co->rt; + unit *mage = (unit *)co->magician; + int cast_level = co->level; + + if(!(landregion(rterrain(r)))){ + cmistake(mage, strdup(co->order), 186, MSG_MAGIC); + return 0; + } + + if(a_find(r->attribs, &at_wdwpyramid) != NULL) { + add_message(&mage->faction->msgs, new_message(mage->faction, + "wdw_pyramidspell_found%u:mage%r:region%s:command", + mage, r, strdup(co->order))); + + } else { + add_message(&mage->faction->msgs, new_message(mage->faction, + "wdw_pyramidspell_notfound%u:mage%r:region%s:command", + mage, r, strdup(co->order))); + } + + return cast_level; +} + + /* ------------------------------------------------------------- */ /* Name: Alltagszauber, hat je nach Gebiet anderen Namen * Stufe: 1 @@ -10389,6 +10432,83 @@ spell spelldaten[] = (spell_f)sp_immolation, patzer }, +#ifdef WDW_PYRAMIDSPELL + {SPL_WDWPYRAMID_TRAUM, "Traum von den Göttern", + "Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine " + "Region für den Pyramidenbau geeignet ist.", + NULL, + NULL, + M_TRAUM, (0), 5, 4, + { + {R_AURA, 2, SPC_FIX}, + {R_PLAIN_3, 1, SPC_FIX}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}}, + (spell_f)sp_wdwpyramid, patzer + }, + + {SPL_WDWPYRAMID_ASTRAL, "Göttliches Netz", + "Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine " + "Region für den Pyramidenbau geeignet ist.", + NULL, + NULL, + M_ASTRAL, (0), 5, 3, + { + {R_AURA, 4, SPC_FIX}, + {R_WISE, 1, SPC_FIX}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}}, + (spell_f)sp_wdwpyramid, patzer + }, + + {SPL_WDWPYRAMID_DRUIDE, "Kraft der Natur", + "Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine " + "Region für den Pyramidenbau geeignet ist.", + NULL, + NULL, + M_DRUIDE, (0), 5, 5, + { + {R_AURA, 3, SPC_FIX}, + {R_MALLORN, 5, SPC_FIX}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}}, + (spell_f)sp_wdwpyramid, patzer + }, + + {SPL_WDWPYRAMID_BARDE, "Gesang der Götter", + "Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine " + "Region für den Pyramidenbau geeignet ist.", + NULL, + NULL, + M_BARDE, (0), 5, 4, + { + {R_AURA, 2, SPC_FIX}, + {R_HIGHLAND_3, 1, SPC_FIX}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}}, + (spell_f)sp_wdwpyramid, patzer + }, + + {SPL_WDWPYRAMID_CHAOS, "Göttliche Macht", + "Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine " + "Region für den Pyramidenbau geeignet ist.", + NULL, + NULL, + M_CHAOS, (0), 5, 5, + { + {R_AURA, 1, SPC_FIX}, + {R_PERMAURA, 1, SPC_FIX}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}}, + (spell_f)sp_wdwpyramid, patzer + }, +#endif + /* SPL_NOSPELL MUSS der letzte Spruch der Liste sein*/ {SPL_NOSPELL, "Keiner", NULL, NULL, NULL, 0, 0, 0, 0, @@ -10396,3 +10516,4 @@ spell spelldaten[] = NULL, NULL } }; + diff --git a/src/common/kernel/spell.h b/src/common/kernel/spell.h index 80f929c86..98f0d9320 100644 --- a/src/common/kernel/spell.h +++ b/src/common/kernel/spell.h @@ -212,6 +212,13 @@ enum { SPL_FIREODEM, /* 181 */ SPL_ICEODEM, SPL_ACIDODEM, +#ifdef WDW_PYRAMIDSPELL + SPL_WDWPYRAMID_TRAUM, + SPL_WDWPYRAMID_ASTRAL, + SPL_WDWPYRAMID_DRUIDE, + SPL_WDWPYRAMID_BARDE, + SPL_WDWPYRAMID_CHAOS, +#endif MAXALLSPELLS, NO_SPELL = (spellid_t) -1 }; diff --git a/src/common/settings-wdw.h b/src/common/settings-wdw.h index 8991ed0ba..917e7c9cf 100644 --- a/src/common/settings-wdw.h +++ b/src/common/settings-wdw.h @@ -53,6 +53,7 @@ #define AUTOALLIANCE (HELP_FIGHT) #define WDW_PHOENIX +#define WDW_PYRAMIDSPELL #define NEW_STARTEQUIPMENT #define MAILITPATH "/usr/sbin:$HOME/bin:/bin:/usr/bin:/usr/local/bin" diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 0c9c510f2..8c3cf5b13 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -274,6 +274,11 @@ show_newspells(void) * terminieren */ spellid_t newspellids[] = { + SPL_WDWPYRAMID_TRAUM, + SPL_WDWPYRAMID_ASTRAL, + SPL_WDWPYRAMID_DRUIDE, + SPL_WDWPYRAMID_BARDE, + SPL_WDWPYRAMID_CHAOS, SPL_NOSPELL }; diff --git a/src/res/messages.xml b/src/res/messages.xml index e44e57f30..425ac1812 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -5618,4 +5618,24 @@ "$int($votes) members of $alliance($alliance) tried to kick you out of the alliance." "$int($votes) members of $alliance($alliance) tried to kick you out of the alliance." + + + + + + + "$unit($unit) in $region($region): '$command' - In dieser Regione können Pyramiden gebaut werden." + "$unit($unit) in $region($region): '$command' - Pyramids may be build in this region." + "$unit($unit) in $region($region): '$command' - Pyramids may be build in this region." + + + + + + + + "$unit($unit) in $region($region): '$command' - In dieser Regione können keine Pyramiden gebaut werden." + "$unit($unit) in $region($region): '$command' - No pyramids may be build in this region." + "$unit($unit) in $region($region): '$command' - No pyramids may be build in this region." +