Diverse wdw-Fixes

This commit is contained in:
Christian Schlittchen 2006-05-07 21:11:49 +00:00
parent 78d222138e
commit 10b1306b30
13 changed files with 82 additions and 30 deletions

View File

@ -1089,12 +1089,14 @@ quit(void)
if (f->flags & FFL_QUIT) { if (f->flags & FFL_QUIT) {
if (EnhancedQuit()) { if (EnhancedQuit()) {
const char * token = get_variable(f->attribs, "quit"); const char * token = get_variable(f->attribs, "quit");
int f2_id = atoi36(token); if(token != NULL) {
faction *f2 = findfaction(f2_id); int f2_id = atoi36(token);
faction *f2 = findfaction(f2_id);
assert(f2_id>0); assert(f2_id>0);
assert(f2!=NULL); assert(f2!=NULL);
transfer_faction(f, f2); transfer_faction(f, f2);
}
} }
destroyfaction(f); destroyfaction(f);
} }

View File

@ -98,8 +98,9 @@ use_hornofdancing(struct unit * u, const struct item_type * itype,
#define SPEEDUP 2 #define SPEEDUP 2
static int static int
use_trappedairelemental(struct unit * u, int shipId, useonother_trappedairelemental(struct unit * u, int shipId,
const struct item_type * itype, const struct item_type * itype,
int amount, struct order * ord) int amount, struct order * ord)
{ {
@ -131,10 +132,25 @@ use_trappedairelemental(struct unit * u, int shipId,
return 0; return 0;
} }
static int
use_trappedairelemental(struct unit * u,
const struct item_type * itype,
int amount, struct order * ord)
{
ship *sh = u->ship;
if(sh == NULL) {
cmistake(u, ord, 20, MSG_MOVE);
return -1;
}
return useonother_trappedairelemental(u, sh->no, itype, amount,ord);
}
void void
register_artrewards(void) register_artrewards(void)
{ {
at_register(&at_peaceimmune); at_register(&at_peaceimmune);
register_function((pf_generic)use_hornofdancing, "use_hornofdancing"); register_function((pf_generic)use_hornofdancing, "use_hornofdancing");
register_function((pf_generic)use_trappedairelemental, "use_trappedairelemental"); register_function((pf_generic)use_trappedairelemental, "use_trappedairelemental");
register_function((pf_generic)useonother_trappedairelemental, "useonother_trappedairelemental");
} }

View File

@ -306,6 +306,7 @@ victorycondition(const alliance * al, const char * name)
if (!found) return 0; if (!found) return 0;
} }
return 1; return 1;
} else if (strcmp(name, "phoenix")==0) { } else if (strcmp(name, "phoenix")==0) {
faction_list * flist = al->members; faction_list * flist = al->members;
for (;flist;flist=flist->next) { for (;flist;flist=flist->next) {
@ -315,7 +316,24 @@ victorycondition(const alliance * al, const char * name)
} }
} }
return 0; return 0;
} else if (strcmp(name, "pyramid")==0) { } else if (strcmp(name, "pyramid")==0) {
/* Logik:
* - if (pyr > last_passed_size && pyr > all_others) {
* pyr->passed->counter++;
* for(all_other_pyrs) {
* pyr->passed->counter=0;
* }
*
* if(pyr->passed->counter >= 3) {
* set(pyr, passed);
* pyr->owner->set_attrib(pyra);
* }
* last_passed_size = pyr->size;
* }
*/
faction_list * flist = al->members; faction_list * flist = al->members;
for (;flist;flist=flist->next) { for (;flist;flist=flist->next) {
faction * f = flist->data; faction * f = flist->data;

View File

@ -1452,6 +1452,7 @@ do_combatmagic(battle *b, combatmagic_t was)
const spell * sp = co->sp; const spell * sp = co->sp;
int level = co->level; int level = co->level;
double power = co->force; double power = co->force;
if (sp->sp_function==NULL) { if (sp->sp_function==NULL) {
log_error(("spell '%s' has no function.\n", sp->sname)); log_error(("spell '%s' has no function.\n", sp->sname));
} else { } else {

View File

@ -531,6 +531,7 @@ max_skill(faction * f, skill_t sk)
int ac = listlen(f->alliance->members); /* number of factions */ int ac = listlen(f->alliance->members); /* number of factions */
int al = allied_skilllimit(f, sk); /* limit per alliance */ int al = allied_skilllimit(f, sk); /* limit per alliance */
int fl = (al+ac-1)/ac; /* faction limit */ int fl = (al+ac-1)/ac; /* faction limit */
/* the following ist _very_ weird, please examine */
int sc = al - allied_skillcount(f, sk); int sc = al - allied_skillcount(f, sk);
if (sc==0) return count_skill(f, sk); if (sc==0) return count_skill(f, sk);
return fl; return fl;

View File

@ -1049,27 +1049,27 @@ sp_flee(fighter * fi, int level, double power, spell * sp)
int int
sp_hero(fighter * fi, int level, double power, spell * sp) sp_hero(fighter * fi, int level, double power, spell * sp)
{ {
battle *b = fi->side->battle; battle *b = fi->side->battle;
unit *mage = fi->unit; unit *mage = fi->unit;
/* Immer aus der ersten Reihe nehmen */ /* Immer aus der ersten Reihe nehmen */
int minrow = FIGHT_ROW; int minrow = FIGHT_ROW;
int maxrow = BEHIND_ROW-1; int maxrow = BEHIND_ROW;
int df_bonus = 0; int df_bonus = 0;
int force = 0; int force = 0;
int allies; int allies;
int targets = 0; int targets = 0;
sprintf(buf, "%s zaubert %s", unitname(mage), sprintf(buf, "%s zaubert %s", unitname(mage),
spell_name(sp, default_locale)); spell_name(sp, default_locale));
switch(sp->id) { switch(sp->id) {
case SPL_HERO: case SPL_HERO:
df_bonus = (int)(power/5); df_bonus = (int)(power/5);
force = lovar(get_force(power, 4)); force = max(1, lovar(get_force(power, 4)));
break; break;
default: default:
df_bonus = 1; df_bonus = 1;
force = (int)power; force = max(1, (int)power);
} }
scat(":"); scat(":");
battlerecord(b, buf); battlerecord(b, buf);

View File

@ -841,7 +841,7 @@ check_mages(void)
} }
if (mages>maxmages) { if (mages>maxmages) {
log_error(("faction %s has %d of max %d magicians.\n", log_error(("faction %s has %d of max %d magicians.\n",
factionid(u->faction), mages, maxmages)); factionid(f), mages, maxmages));
} }
} }
} }

View File

@ -183,7 +183,15 @@
</type> </type>
<text locale="de">"In dieser Gegend steht das Korn besonders gut im Feld. ($int36($id))"</text> <text locale="de">"In dieser Gegend steht das Korn besonders gut im Feld. ($int36($id))"</text>
<text locale="fr">"($int36($id))"</text> <text locale="fr">"($int36($id))"</text>
<text locale="en">"The grain in this region is esecially healthy. ($int36($id))"</text> <text locale="en">"The grain in this region is especially healthy. ($int36($id))"</text>
</message>
<message name="curseinfo::shipspeedup" section="events">
<type>
<arg name="id" type="int"/>
</type>
<text locale="de">"Die Winde scheinen dieses Schiff besonders zu beguenstigen. ($int36($id))"</text>
<text locale="fr">"($int36($id))"</text>
<text locale="en">"The winds seem to favor this ship. ($int36($id))"</text>
</message> </message>
<message name="curseinfo::holyground" section="events"> <message name="curseinfo::holyground" section="events">
<type> <type>

View File

@ -680,7 +680,7 @@
<attack type="4" damage="5d30"/> <attack type="4" damage="5d30"/>
<attack type="6" spell="powerful_dragonbreath"/> <attack type="6" spell="powerful_dragonbreath"/>
</race> </race>
<race name="dragon" magres="0.700000" maxaura="1.000000" regaura="2.000000" recruitcost="50000" weight="10000" capacity="1000000" speed="1.500000" hp="900" ac="6" damage="2d30" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes"> <race name="dragon" magres="0.700000" maxaura="1.000000" regaura="2.000000" recruitcost="50000" weight="10000" capacity="1000000" speed="1.500000" hp="900" ac="6" damage="2d30" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" giveitem="yes" resistbash="yes">
<ai splitsize="2" killpeasants="yes" learn="yes"/> <ai splitsize="2" killpeasants="yes" learn="yes"/>
<function name="name" value="namedragon"/> <function name="name" value="namedragon"/>
<function name="age" value="agedragon"/> <function name="age" value="agedragon"/>

View File

@ -88,9 +88,9 @@
</strings> </strings>
<resources> <resources>
<resource name="phoenixfeather"> <resource name="phoenixfeather" notlost="yes">
<function name="change" value="changeitem"/> <function name="change" value="changeitem"/>
<item weight="0"/> <item weight="0" notlost="yes"/>
</resource> </resource>
</resources> </resources>

View File

@ -19,26 +19,35 @@
</construction> </construction>
<construction skill="building" minskill="11" maxsize="12" reqsize="1"> <construction skill="building" minskill="11" maxsize="12" reqsize="1">
<requirement type="iron" quantity="10"/> <requirement type="iron" quantity="10"/>
<requirement type="log" quantity="10"/>
<requirement type="mallorn" quantity="10"/> <requirement type="mallorn" quantity="10"/>
<requirement type="stone" quantity="10"/> <requirement type="stone" quantity="10"/>
</construction> </construction>
<construction skill="building" minskill="11" maxsize="16" reqsize="1"> <construction skill="building" minskill="11" maxsize="16" reqsize="1">
<requirement type="laen" quantity="1"/>
<requirement type="iron" quantity="10"/> <requirement type="iron" quantity="10"/>
<requirement type="log" quantity="10"/>
<requirement type="mallorn" quantity="10"/> <requirement type="mallorn" quantity="10"/>
<requirement type="stone" quantity="10"/> <requirement type="stone" quantity="10"/>
</construction> </construction>
<construction skill="building" minskill="11" maxsize="20" reqsize="1"> <construction skill="building" minskill="11" maxsize="20" reqsize="1">
<requirement type="laen" quantity="5"/>
<requirement type="iron" quantity="10"/> <requirement type="iron" quantity="10"/>
<requirement type="log" quantity="10"/>
<requirement type="mallorn" quantity="10"/> <requirement type="mallorn" quantity="10"/>
<requirement type="stone" quantity="10"/> <requirement type="stone" quantity="10"/>
</construction> </construction>
<construction skill="building" minskill="11" maxsize="24" reqsize="1"> <construction skill="building" minskill="11" maxsize="24" reqsize="1">
<requirement type="laen" quantity="10"/>
<requirement type="iron" quantity="10"/> <requirement type="iron" quantity="10"/>
<requirement type="log" quantity="10"/>
<requirement type="mallorn" quantity="10"/> <requirement type="mallorn" quantity="10"/>
<requirement type="stone" quantity="10"/> <requirement type="stone" quantity="10"/>
</construction> </construction>
<construction skill="building" minskill="11" maxsize="28" reqsize="1"> <construction skill="building" minskill="11" maxsize="28" reqsize="1">
<requirement type="laen" quantity="10"/>
<requirement type="iron" quantity="10"/> <requirement type="iron" quantity="10"/>
<requirement type="log" quantity="10"/>
<requirement type="mallorn" quantity="10"/> <requirement type="mallorn" quantity="10"/>
<requirement type="stone" quantity="10"/> <requirement type="stone" quantity="10"/>
</construction> </construction>

View File

@ -159,7 +159,6 @@
<attack type="4" damage="5d30"/> <attack type="4" damage="5d30"/>
<attack type="4" damage="3d20"/> <attack type="4" damage="3d20"/>
<attack type="4" damage="3d20"/> <attack type="4" damage="3d20"/>
<attack type="4" damage="5d30"/>
<attack type="6" spell="drain_skills"/> <attack type="6" spell="drain_skills"/>
<attack type="6" spell="aura_of_fear"/> <attack type="6" spell="aura_of_fear"/>
<precombatspell spell="shadowcall"/> <precombatspell spell="shadowcall"/>
@ -173,11 +172,7 @@
<attack type="4" damage="5d30"/> <attack type="4" damage="5d30"/>
<attack type="4" damage="3d20"/> <attack type="4" damage="3d20"/>
<attack type="4" damage="3d20"/> <attack type="4" damage="3d20"/>
<attack type="4" damage="5d30"/> <precombatspell spell="frighten"/>
<attack type="6" spell="drain_skills"/>
<attack type="6" spell="aura_of_fear"/>
<precombatspell spell="bloodthirst"/>
<precombatspell spell="heroic_song"/>
</race> </race>
<race name="bastet" magres="0.950000" maxaura="1.000000" regaura="3.000000" recruitcost="2500000" weight="100" capacity="100000" speed="2.000000" hp="2700" ac="10" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="12" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" resistcut="yes" resistpierce="yes" shapeshift="yes"> <race name="bastet" magres="0.950000" maxaura="1.000000" regaura="3.000000" recruitcost="2500000" weight="100" capacity="100000" speed="2.000000" hp="2700" ac="10" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="12" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" resistcut="yes" resistpierce="yes" shapeshift="yes">
<ai splitsize="1" learn="yes"/> <ai splitsize="1" learn="yes"/>
@ -188,7 +183,6 @@
<attack type="4" damage="5d30"/> <attack type="4" damage="5d30"/>
<attack type="4" damage="3d20"/> <attack type="4" damage="3d20"/>
<attack type="4" damage="3d20"/> <attack type="4" damage="3d20"/>
<attack type="4" damage="5d30"/>
<attack type="6" spell="drain_skills"/> <attack type="6" spell="drain_skills"/>
<attack type="6" spell="aura_of_fear"/> <attack type="6" spell="aura_of_fear"/>
<precombatspell spell="heroic_song"/> <precombatspell spell="heroic_song"/>

View File

@ -10,7 +10,10 @@ function update_phoenix()
end end
f = get_faction(0) f = get_faction(0)
if (f~=nil) then if (f~=nil) then
local r, nregions = 0 local r
local nregions
nregions = 0
for r in regions() do for r in regions() do
nregions = nregions+1 nregions = nregions+1
end end