Diverser Kleinkram für WdW:

- Papyrus-Dummy-Item
- NO_RANDOM_BRAINEATERS
- ...
This commit is contained in:
Christian Schlittchen 2005-09-11 20:16:04 +00:00
parent b915bf74f3
commit b917430561
15 changed files with 304 additions and 6 deletions

View File

@ -0,0 +1,32 @@
/* vi: set ts=2:
*
* Eressea PB(E)M host Copyright (C) 1998-2005
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
* Enno Rehling (enno@eressea-pbem.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 "alliance.h"
#include <attrib.h>
attrib_type at_alliance = {
"alliance",
NULL,
NULL,
NULL,
a_writedefault,
a_readdefault,
ATF_UNIQUE
};
void
init_alliance(void)
{
at_register(&at_alliance);
}

View File

@ -0,0 +1,26 @@
/* vi: set ts=2:
*
*
* Eressea PB(E)M host Copyright (C) 1998-2005
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
* Enno Rehling (enno@eressea-pbem.de)
*
* This program may not be used, modified or distributed without
* prior permission by the authors of Eressea.
*/
#ifndef H_ATTRIBUTE_ALLIANCE
#define H_ATTRIBUTE_ALLIANCE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_alliance;
extern void init_alliance(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -74,4 +74,7 @@ init_attributes(void)
init_ugroup(); init_ugroup();
#endif #endif
init_variable(); init_variable();
#ifdef WDW_PYRAMID
init_alliance();
#endif
} }

View File

@ -1873,6 +1873,19 @@ report_building(FILE *F, const region * r, const building * b, const faction * f
if (i != '!' && i != '?' && i != '.') if (i != '!' && i != '?' && i != '.')
scat("."); scat(".");
#if WDW_PYRAMID
if(b->type == bt_find("wdw_pyramid")) {
attrib *a = a_find(b->attribs, &at_alliance));
if(f->alliance && f->alliance->id == a->data.i) {
scat("Die Größenstufe dieser Pyramide ist ");
icat(wdw_pyramid_level(b));
scat(". Die nächste Größenstufe wird mit ");
icat(wdw_pyramid_size_for_next_level(b));
scat(" Größenpunkten erreicht. Baukosten pro Größenpunkt: ");
}
}
#endif
rparagraph(F, buf, 2, 0); rparagraph(F, buf, 2, 0);
if (mode<see_lighthouse) return; if (mode<see_lighthouse) return;

View File

@ -916,6 +916,13 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
u->building = b; u->building = b;
fset(u, UFL_OWNER); fset(u, UFL_OWNER);
#if WDW_PYRAMID
if(b->type == bt_find("wdw_pyramid") && u->faction->alliance != NULL) {
attrib * a = a_add(&b->attribs, a_new(&at_alliance));
a->data.i = u->faction->alliance->id;
}
#endif
newbuilding = true; newbuilding = true;
} }
@ -947,6 +954,7 @@ build_building(unit * u, const building_type * btype, int want, order * ord)
b->size += built; b->size += built;
update_lighthouse(b); update_lighthouse(b);
ADDMSG(&u->faction->msgs, msg_message("buildbuilding", ADDMSG(&u->faction->msgs, msg_message("buildbuilding",
"building unit size", b, u, built)); "building unit size", b, u, built));
} }

View File

@ -330,7 +330,7 @@ static construction castle_bld[MAXBUILDINGS] = {
building_type bt_castle = { building_type bt_castle = {
"castle", "castle",
BFL_NONE, BTF_NONE,
1, 4, -1, 1, 4, -1,
0, 0, 0, 1.0, 0, 0, 0, 1.0,
NULL, NULL,
@ -338,6 +338,83 @@ building_type bt_castle = {
castle_name castle_name
}; };
#if WDW_PYRAMID
static requirement wdw_pyramid_req[][] = {
{{R_STONE, 100, 0}, {R_WOOD, 100, 0}, {R_IRON, 100, 0}, {NORESOURCE, 0, 0.0 }},
{{R_STONE, 1, 0}, {R_WOOD, 1, 0}, {R_IRON, 1, 0}, {NORESOURCE, 0, 0.0 }},
{{R_STONE, 1, 0}, {R_WOOD, 1, 0}, {R_IRON, 1, 0},
{R_MALLORN, 1, 0}, {NORESOURCE, 0, 0.0 }},
{{R_STONE, 1, 0}, {R_WOOD, 1, 0}, {R_IRON, 1, 0},
{R_LAEN, 1, 0}, {NORESOURCE, 0, 0.0 }},
{{R_STONE, 1, 0}, {R_WOOD, 1, 0}, {R_IRON, 1, 0},
{R_TOADSLIME, 1, 0}, {NORESOURCE, 0, 0.0 }},
{{R_STONE, 1, 0}, {R_WOOD, 1, 0}, {R_IRON, 1, 0},
{R_BALM, 1, 0.0 }, {R_SPICES, 1, 0.0 }, {R_JEWELERY, 1, 0.0 },
{R_MYRRH, 1, 0.0 }, {R_OIL, 1, 0.0 }, {R_SILK, 1, 0.0 },
{R_INCENSE, 1, 0.0 }, {NORESOURCE, 0, 0.0 }}
}
static construction wdw_pyramid_bld[] = {
{ SK_BUILDING, 10, 1, 1, pyramid_req[0], wdw_pyramid_bld[0] }, /* 0 -> 1 */
{ SK_BUILDING, 3, 6, 1, pyramid_req[1], wdw_pyramid_bld[1] }, /* -> 7 */
{ SK_BUILDING, 4, 1, 1, pyramid_req[2], wdw_pyramid_bld[2] }, /* -> 8 */
{ SK_BUILDING, 5, 13, 1, pyramid_req[1], wdw_pyramid_bld[3] }, /* -> 21 */
{ SK_BUILDING, 6, 1, 1, pyramid_req[3], wdw_pyramid_bld[4] }, /* -> 22 */
{ SK_BUILDING, 7, 41, 1, pyramid_req[1], wdw_pyramid_bld[5] }, /* -> 63 */
{ SK_BUILDING, 8, 1, 1, pyramid_req[4], wdw_pyramid_bld[6] }, /* -> 64 */
{ SK_BUILDING, 9, 125, 1, pyramid_req[1], wdw_pyramid_bld[7] }, /* -> 189 */
{ SK_BUILDING, 10, 1, 1, pyramid_req[5], wdw_pyramid_bld[8] }, /* -> 190 */
{ SK_BUILDING, 100, 100000, 1, pyramid_req[0], NULL } /* should never be seen */
}
int
wdw_pyramid_level(const struct building *b)
{
int size = 0;
int level;
for(level=0; wdw_pyramid_bld[level].improvement != NULL; level++) {
size += wdw_pyramid_bld[level].maxsize;
if(size > b->size) break;
}
return level;
}
int
wdw_pyramid_size_for_next_level(const struct building *b)
{
int size = 0;
int level;
for(level=0; wdw_pyramid_bld[level].improvement != NULL; level++) {
size += wdw_pyramid_bld[level].maxsize;
if(size > b->size) {
return size - b->size;
}
}
return INT_MAX;
}
static const char *
wdw_pyramid_name(int bsize)
{
return "wdw_pyramid";
}
building_type bt_wdw_pyramid = {
"wdw_pyramid",
BTF_INDESTRUCTIBLE,
1, 4, -1,
0, 0, 0, 1.0,
NULL,
&wdw_pyramid_bld[0],
wdw_pyramid_name
};
#endif
/* for finding out what was meant by a particular building string */ /* for finding out what was meant by a particular building string */
static local_names * bnames; static local_names * bnames;
@ -376,6 +453,11 @@ register_buildings(void)
register_function((pf_generic)init_smithy, "init_smithy"); register_function((pf_generic)init_smithy, "init_smithy");
register_function((pf_generic)castle_name, "castle_name"); register_function((pf_generic)castle_name, "castle_name");
bt_register(&bt_castle); bt_register(&bt_castle);
#if WDW_PYRAMID
register_function((pf_generic)wdw_pyramid_name, "wdw_pyramid_name");
bt_register(&bt_wdw_pyramid);
#endif
} }
building_type * building_type *

View File

@ -143,6 +143,11 @@ extern struct unit * buildingowner(const struct region * r, const struct buildin
extern attrib_type at_nodestroy; extern attrib_type at_nodestroy;
extern attrib_type at_building_action; extern attrib_type at_building_action;
#if WDW_PYRAMID
extern int wdw_pyramid_size(const struct building *b);
extern int wdw_pyramid_size_for_next_level(const struct building *b);
#endif
typedef struct building_action { typedef struct building_action {
building * b; building * b;
char * fname; char * fname;

View File

@ -145,6 +145,8 @@ random_in_teleport_plane(void)
if (f0==NULL) return; if (f0==NULL) return;
/* Für WDW abschaltbar machen */
#if NO_RANDOM_BRAINEATERS == 1
for (r=regions; r; r=r->next) { for (r=regions; r; r=r->next) {
if (rplane(r) != get_astralplane() || rterrain(r) != T_ASTRAL) continue; if (rplane(r) != get_astralplane() || rterrain(r) != T_ASTRAL) continue;
@ -159,6 +161,7 @@ random_in_teleport_plane(void)
next = rand() % 100; next = rand() % 100;
} }
} }
#endif
} }
plane * plane *

View File

@ -55,6 +55,7 @@
#undef XECMD_MODULE #undef XECMD_MODULE
#define WDW_PHOENIX #define WDW_PHOENIX
#define WDW_PYRAMIDSPELL #define WDW_PYRAMIDSPELL
/* #define WDW_PYRAMID 1 */
#define KEEP_UNZIPPED 1 #define KEEP_UNZIPPED 1
#define NO_RANDOM_BRAINEATERS 1

View File

@ -149,5 +149,12 @@
<requirement type="money" quantity="100"/> <requirement type="money" quantity="100"/>
</construction> </construction>
</building> </building>
<building name="pyramid" capacity="1" maxcapacity="10000" nodestroy="yes">
<construction skill="sk_building" minskill="10" reqsize="1">
<requirement type="iron" quantity="100"/>
<requirement type="log" quantity="100"/>
<requirement type="stone" quantity="100"/>
</construction>
</building>
</buildings> </buildings>

View File

@ -815,6 +815,16 @@
<text locale="de">Zitadelle</text> <text locale="de">Zitadelle</text>
</string> </string>
<!-- wdw Pyramide -->
<string name="wdw_pyramid">
<text locale="de">Pyramide</text>
<text locale="en">pyramid</text>
</string>
<string name="pyramid">
<text locale="de">Pyramide</text>
<text locale="en">pyramid</text>
</string>
<!--Items --> <!--Items -->
<string name="sphereofinv"> <string name="sphereofinv">
<text locale="de">Sphäre der Unsichtbarkeit</text> <text locale="de">Sphäre der Unsichtbarkeit</text>
@ -852,7 +862,14 @@
<text locale="de">Sonnensegel</text> <text locale="de">Sonnensegel</text>
<text locale="en">solar sails</text> <text locale="en">solar sails</text>
</string> </string>
<string name="papyrus">
<text locale="de">Papyrus</text>
<text locale="en">papyrus</text>
</string>
<string name="papyrus_p">
<text locale="de">Papyri</text>
<text locale="en">papyri</text>
</string>
<string name="elfspoil"> <string name="elfspoil">
<text locale="de">Elfenohr</text> <text locale="de">Elfenohr</text>
<text locale="en">elven ear</text> <text locale="en">elven ear</text>

View File

@ -2561,7 +2561,7 @@
<arg name="target" type="unit"/> <arg name="target" type="unit"/>
<arg name="report" type="string"/> <arg name="report" type="string"/>
</type> </type>
<text locale="de">"$unit($spy) gelang es Informationen über $unit($target) herauszubekommen: '$report'."</text> <text locale="de">"$unit($spy) gelang es, Informationen über $unit($target) herauszubekommen: '$report'."</text>
<text locale="fr">"$unit($spy) managed to gather information about $unit($target): '$report'."</text> <text locale="fr">"$unit($spy) managed to gather information about $unit($target): '$report'."</text>
<text locale="en">"$unit($spy) managed to gather information about $unit($target): '$report'."</text> <text locale="en">"$unit($spy) managed to gather information about $unit($target): '$report'."</text>
</message> </message>

View File

@ -2,7 +2,6 @@
<races> <races>
<race name="halfling" magres="0.050000" maxaura="1.000000" regaura="1.000000" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1.000000" hp="18" ac="0" damage="1d5" unarmedattack="-2" unarmeddefense="-2" attackmodifier="0" defensemodifier="0" playerrace="yes" walk="yes" giveitem="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes"> <race name="halfling" magres="0.050000" maxaura="1.000000" regaura="1.000000" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1.000000" hp="18" ac="0" damage="1d5" unarmedattack="-2" unarmeddefense="-2" attackmodifier="0" defensemodifier="0" playerrace="yes" walk="yes" giveitem="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" attackrandom="yes" moverandom="yes" learn="yes"></ai> <ai splitsize="10000" attackrandom="yes" moverandom="yes" learn="yes"></ai>
<function name="itemdrop" value="halflingspoil"></function>
<skill name="sk_crossbow" modifier="0"></skill> <skill name="sk_crossbow" modifier="0"></skill>
<skill name="sk_mining" modifier="1"></skill> <skill name="sk_mining" modifier="1"></skill>
<skill name="sk_bow" modifier="-1"></skill> <skill name="sk_bow" modifier="-1"></skill>
@ -65,4 +64,102 @@
<precombatspell spell="176"/> <precombatspell spell="176"/>
</race> </race>
<race name="ghast" magres="0.600000" maxaura="1.000000" regaura="1.000000" recruitcost="5" weight="1000" capacity="540" speed="1.000000" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" nolearn="yes" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" nogive="no">
<ai splitsize="2000" aggression="0.02" killpeasants="yes" moverandom="yes"/>
<function name="name" value="nameghoul"/>
<skill name="sk_crossbow" modifier="1"/>
<skill name="sk_bow" modifier="1"/>
<skill name="sk_catapult" modifier="1"/>
<skill name="sk_riding" modifier="1"/>
<skill name="sk_melee" modifier="1"/>
<skill name="sk_polearm" modifier="1"/>
<skill name="sk_tactics" modifier="1"/>
<skill name="sk_stamina" modifier="1"/>
<skill name="sk_unarmed" modifier="1"/>
<attack type="4" damage="2d8"/>
<attack type="3" damage="1d5"/>
<attack type="3" damage="1d5"/>
<attack type="2" damage="1d30"/>
<attack type="2" damage="1d30"/>
</race>
<race name="ghoul" magres="0.300000" maxaura="1.000000" regaura="1.000000" recruitcost="5" weight="1000" capacity="540" speed="1.000000" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" nolearn="yes" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" nogive="no">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<function name="name" value="nameghoul"/>
<function name="age" value="ageghoul"/>
<skill name="sk_crossbow" modifier="1"/>
<skill name="sk_bow" modifier="1"/>
<skill name="sk_catapult" modifier="1"/>
<skill name="sk_riding" modifier="1"/>
<skill name="sk_melee" modifier="1"/>
<skill name="sk_polearm" modifier="1"/>
<skill name="sk_tactics" modifier="1"/>
<skill name="sk_stamina" modifier="1"/>
<skill name="sk_unarmed" modifier="1"/>
<attack type="4" damage="2d6"/>
<attack type="3" damage="1d2"/>
<attack type="3" damage="1d2"/>
<attack type="2" damage="1d30"/>
</race>
<race name="juju-zombie" magres="0.500000" maxaura="1.000000" regaura="1.000000" recruitcost="8" weight="1000" capacity="540" speed="1.000000" hp="80" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" nolearn="yes" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistbash="yes" resistcut="yes" resistpierce="yes" nogive="no">
<ai splitsize="2000" aggression="0.02" killpeasants="yes" moverandom="yes"/>
<function name="name" value="namezombie"/>
<skill name="sk_crossbow" modifier="1"/>
<skill name="sk_bow" modifier="1"/>
<skill name="sk_catapult" modifier="1"/>
<skill name="sk_riding" modifier="1"/>
<skill name="sk_melee" modifier="1"/>
<skill name="sk_polearm" modifier="1"/>
<skill name="sk_tactics" modifier="1"/>
<skill name="sk_stamina" modifier="1"/>
<skill name="sk_unarmed" modifier="1"/>
<attack type="1" damage="1d7"/>
<attack type="3" damage="1d1"/>
<attack type="3" damage="1d1"/>
</race>
<race name="zombie" magres="0.200000" maxaura="1.000000" regaura="1.000000" recruitcost="4" weight="1000" capacity="540" speed="1.000000" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" scarepeasants="yes" walk="yes" nolearn="yes" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" nogive="no">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<function name="name" value="namezombie"/>
<function name="age" value="agezombie"/>
<skill name="sk_crossbow" modifier="1"/>
<skill name="sk_bow" modifier="1"/>
<skill name="sk_catapult" modifier="1"/>
<skill name="sk_riding" modifier="1"/>
<skill name="sk_melee" modifier="1"/>
<skill name="sk_polearm" modifier="1"/>
<skill name="sk_tactics" modifier="1"/>
<skill name="sk_stamina" modifier="1"/>
<skill name="sk_unarmed" modifier="1"/>
<attack type="1" damage="1d7"/>
</race>
<race name="skeletonlord" magres="0.300000" maxaura="1.000000" regaura="1.000000" recruitcost="2" weight="1000" capacity="540" speed="1.000000" hp="60" ac="4" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" nolearn="yes" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" nogive="no">
<ai splitsize="2000" aggression="0.02" killpeasants="yes" moverandom="yes"/>
<function name="name" value="nameskeleton"/>
<skill name="sk_crossbow" modifier="1"/>
<skill name="sk_bow" modifier="1"/>
<skill name="sk_catapult" modifier="1"/>
<skill name="sk_riding" modifier="1"/>
<skill name="sk_melee" modifier="1"/>
<skill name="sk_polearm" modifier="1"/>
<skill name="sk_tactics" modifier="1"/>
<skill name="sk_stamina" modifier="1"/>
<skill name="sk_unarmed" modifier="1"/>
<attack type="1" damage="1d7"/>
<attack type="1" damage="1d7"/>
</race>
<race name="skeleton" magres="0.100000" maxaura="1.000000" regaura="1.000000" recruitcost="0" weight="500" capacity="540" speed="1.000000" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" nolearn="yes" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" nogive="no">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<function name="name" value="nameskeleton"/>
<function name="age" value="ageskeleton"/>
<skill name="sk_crossbow" modifier="1"/>
<skill name="sk_bow" modifier="1"/>
<skill name="sk_catapult" modifier="1"/>
<skill name="sk_riding" modifier="1"/>
<skill name="sk_melee" modifier="1"/>
<skill name="sk_polearm" modifier="1"/>
<skill name="sk_tactics" modifier="1"/>
<skill name="sk_stamina" modifier="1"/>
<skill name="sk_unarmed" modifier="1"/>
<attack type="1" damage="1d7"/>
</race>
</races> </races>

View File

@ -30,4 +30,8 @@
<resource name="emerald" appearance="gem"> <resource name="emerald" appearance="gem">
<item weight="0"></item> <item weight="0"></item>
</resource> </resource>
<resource name="papyrus">
<item weight="1">
</item>
</resource>
</resources> </resources>