- 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
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_firesword, "attack_firesword");
}

View File

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

View File

@ -108,7 +108,7 @@ erase_border(border * b)
border ** bp = get_borders_i(b->from, b->to);
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");
if (*bp==b) {
@ -217,7 +217,7 @@ age_borders(void)
deleted = bnew;
break;
}
a_remove(ap, a);
a_remove(&b->attribs, a);
}
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);
if(c->vigour <= 0) {
a_remove(ap, a);
a_remove(&r->attribs, a);
}
if(*ap) ap = &(*ap)->next;
}

View File

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

View File

@ -60,6 +60,43 @@
</item>
</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">
<item weight="200">
<construction skill="sk_weaponsmith" minskill="3" reqsize="1">