- Noch ein Fehler beim Löschen von Attributen.

- Noch mehr Mallornwaffen in externer Datei.
This commit is contained in:
Enno Rehling 2004-06-12 10:16:48 +00:00
parent e8138e4dee
commit 614da4d857
6 changed files with 85 additions and 149 deletions

View File

@ -313,109 +313,8 @@ init_oldweapons(void)
} }
} }
/** begin mallornspear **/
resource_type rt_mallornspear = {
{ "mallornspear", "mallornspear_p" },
{ "mallornspear", "mallornspear_p" },
RTF_ITEM,
&res_changeitem
};
static requirement mat_mallornspear[] = {
{I_MALLORN, 1},
{0, 0}
};
static construction cons_mallornspear = {
SK_WEAPONSMITH, 5, /* skill, minskill */
-1, 1, mat_mallornspear /* maxsize, reqsize, materials */
};
item_type it_mallornspear = {
&rt_mallornspear, /* resourcetype */
ITF_WEAPON, 100, 0, /* flags, weight, capacity */
&cons_mallornspear /* construction */
};
weapon_type wt_mallornspear = {
&it_mallornspear, /* item_type */
{ "1d10+1", "1d12+3" }, /* on foot, on horse */
WTF_PIERCE, /* flags */
SK_SPEAR, 5, /* skill, minskill */
0, 0, 0.15, 0, /* offmod, defmod, magres, reload */
wm_spear /* modifiers */
};
/** end mallornspear **/
/** begin mallornlance **/
resource_type rt_mallornlance = {
{ "mallornlance", "mallornlance_p" },
{ "mallornlance", "mallornlance_p" },
RTF_ITEM,
&res_changeitem
};
static requirement mat_mallornlance[] = {
{I_MALLORN, 2},
{0, 0}
};
static construction cons_mallornlance = {
SK_WEAPONSMITH, 5, /* skill, minskill */
-1, 1, mat_mallornlance /* maxsize, reqsize, materials */
};
item_type it_mallornlance = {
&rt_mallornlance, /* resourcetype */
ITF_WEAPON, 100, 0, /* flags, weight, capacity */
&cons_mallornlance /* construction */
};
weapon_type wt_mallornlance = {
&it_mallornlance, /* item_type */
{ "1d5+1", "2d6+2" }, /* on foot, on horse */
WTF_PIERCE, /* flags */
SK_SPEAR, 5, /* skill, minskill */
0, 0, 0.15, 0, /* offmod, defmod, magres, reload */
wm_lance /* modifiers */
};
/** end mallornlance **/
/** begin mallorncrossbow **/
resource_type rt_mallorncrossbow = {
{ "mallorncrossbow", "mallorncrossbow_p" },
{ "mallorncrossbow", "mallorncrossbow_p" },
RTF_ITEM,
&res_changeitem
};
static requirement mat_mallorncrossbow[] = {
{I_MALLORN, 1},
{0, 0}
};
static construction cons_mallorncrossbow = {
SK_WEAPONSMITH, 5, /* skill, minskill */
-1, 1, mat_mallorncrossbow /* maxsize, reqsize, materials */
};
item_type it_mallorncrossbow = {
&rt_mallorncrossbow, /* resourcetype */
ITF_WEAPON, 100, 0, /* flags, weight, capacity */
&cons_mallorncrossbow /* construction */
};
weapon_type wt_mallorncrossbow = {
&it_mallorncrossbow, /* item_type */
{ "3d3+5", "3d3+5" }, /* on foot, on horse */
WTF_MISSILE|WTF_PIERCE, /* flags */
SK_CROSSBOW, 5, /* skill, minskill */
0, 0, 0.15, 0 /* offmod, defmod, magres, reload */
};
/** end mallorncrossbow **/
void void
register_weapons(void) { register_weapons(void) {
rt_register(&rt_mallornspear);
it_register(&it_mallornspear);
wt_register(&wt_mallornspear);
rt_register(&rt_mallornlance);
it_register(&it_mallornlance);
wt_register(&wt_mallornlance);
rt_register(&rt_mallorncrossbow);
it_register(&it_mallorncrossbow);
wt_register(&wt_mallorncrossbow);
register_function((pf_generic)attack_catapult, "attack_catapult"); register_function((pf_generic)attack_catapult, "attack_catapult");
register_function((pf_generic)attack_firesword, "attack_firesword"); register_function((pf_generic)attack_firesword, "attack_firesword");
} }

View File

@ -243,7 +243,7 @@ change_effect (unit * u, const potion_type * effect, int delta)
a=a->nexttype; a=a->nexttype;
} }
if (a!=NULL && data->value+delta==0) { if (a!=NULL && data->value+delta==0) {
a_remove(ap, a); a_remove(&u->attribs, a);
return 0; return 0;
} else if (a!=NULL) { } else if (a!=NULL) {
data->value += delta; data->value += delta;

View File

@ -108,7 +108,7 @@ erase_border(border * b)
border ** bp = get_borders_i(b->from, b->to); border ** bp = get_borders_i(b->from, b->to);
attrib ** ap = &b->attribs; attrib ** ap = &b->attribs;
while (*ap) a_remove(ap, *ap); while (*ap) a_remove(&b->attribs, *ap);
assert(*bp!=NULL || !"error: border is not registered"); assert(*bp!=NULL || !"error: border is not registered");
if (*bp==b) { if (*bp==b) {
@ -217,7 +217,7 @@ age_borders(void)
deleted = bnew; deleted = bnew;
break; break;
} }
a_remove(ap, a); a_remove(&b->attribs, a);
} }
else ap=&a->next; else ap=&a->next;
} }

View File

@ -848,7 +848,7 @@ use_antimagiccrystal(region * r, unit * mage, int amount, strlist * cmdstrings)
force = destr_curse(c, effect, force); force = destr_curse(c, effect, force);
if(c->vigour <= 0) { if(c->vigour <= 0) {
a_remove(ap, a); a_remove(&r->attribs, a);
} }
if(*ap) ap = &(*ap)->next; if(*ap) ap = &(*ap)->next;
} }

View File

@ -1071,60 +1071,60 @@ farcasting(unit *magician, region *r)
double double
magic_resistance(unit *target) magic_resistance(unit *target)
{ {
attrib * a; attrib * a;
curse *c; curse *c;
int n; int n;
/* Bonus durch Rassenmagieresistenz */ /* Bonus durch Rassenmagieresistenz */
double probability = target->race->magres; double probability = target->race->magres;
/* Magier haben einen Resistenzbonus vom Magietalent * 5%*/ /* Magier haben einen Resistenzbonus vom Magietalent * 5%*/
probability += effskill(target, SK_MAGIC)*0.05; probability += effskill(target, SK_MAGIC)*0.05;
/* Auswirkungen von Zaubern auf der Einheit */ /* Auswirkungen von Zaubern auf der Einheit */
c = get_curse(target->attribs, ct_find("magicresistance")); c = get_curse(target->attribs, ct_find("magicresistance"));
if (c) { if (c) {
probability += 0.01 * curse_geteffect(c) * get_cursedmen(target, c); probability += 0.01 * curse_geteffect(c) * get_cursedmen(target, c);
} }
/* Unicorn +10 */ /* Unicorn +10 */
n = get_item(target, I_UNICORN); n = get_item(target, I_UNICORN);
if (n) probability += n*0.1/target->number; if (n) probability += n*0.1/target->number;
/* Auswirkungen von Zaubern auf der Region */ /* Auswirkungen von Zaubern auf der Region */
a = a_find(target->region->attribs, &at_curse); a = a_find(target->region->attribs, &at_curse);
while (a) { while (a) {
curse *c = (curse*)a->data.v; curse *c = (curse*)a->data.v;
unit *mage = c->magician; unit *mage = c->magician;
if (mage!=NULL) { if (mage!=NULL) {
if (c->type == ct_find("goodmagicresistancezone")) { if (c->type == ct_find("goodmagicresistancezone")) {
if (alliedunit(mage, target->faction, HELP_GUARD)) { if (alliedunit(mage, target->faction, HELP_GUARD)) {
probability += curse_geteffect(c)*0.01; probability += curse_geteffect(c)*0.01;
break; break;
} }
} }
else if (c->type == ct_find("badmagicresistancezone")) { else if (c->type == ct_find("badmagicresistancezone")) {
if (alliedunit(mage, target->faction, HELP_GUARD)) { if (alliedunit(mage, target->faction, HELP_GUARD)) {
a = a->nexttype; a = a->nexttype;
continue; continue;
} }
} }
} }
a = a->nexttype; a = a->nexttype;
} }
/* Bonus durch Artefakte */ /* Bonus durch Artefakte */
/* TODO (noch gibs keine)*/ /* TODO (noch gibs keine)*/
/* Bonus durch Gebäude */ /* Bonus durch Gebäude */
{ {
struct building * b = inside_building(target); struct building * b = inside_building(target);
const struct building_type * btype = b?b->type:NULL; const struct building_type * btype = b?b->type:NULL;
/* gesegneter Steinkreis gibt 30% dazu */ /* gesegneter Steinkreis gibt 30% dazu */
if (btype) probability += btype->magresbonus * 0.01; if (btype) probability += btype->magresbonus * 0.01;
} }
return probability; return probability;
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */

View File

@ -60,6 +60,43 @@
</item> </item>
</resource> </resource>
<resource name="mallorncrossbow">
<item weight="100">
<construction skill="sk_weaponsmith" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="sk_bow" offmod="0" defmod="0" reload="0" magres="0.15">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<resource name="mallornspear">
<item weight="100">
<construction skill="sk_weaponsmith" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" skill="sk_polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d10+1"/>
<damage type="rider" value="1d12+3"/>
</weapon>
</item>
</resource>
<resource name="mallornlance">
<item weight="100">
<construction skill="sk_weaponsmith" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" skill="sk_polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d5+1"/>
<damage type="rider" value="2d6+2"/>
</weapon>
</item>
</resource>
<resource name="halberd"> <resource name="halberd">
<item weight="200"> <item weight="200">
<construction skill="sk_weaponsmith" minskill="3" reqsize="1"> <construction skill="sk_weaponsmith" minskill="3" reqsize="1">