From 614da4d8579a3363c8177651cba58edb0cf8da6c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 12 Jun 2004 10:16:48 +0000 Subject: [PATCH] =?UTF-8?q?-=20Noch=20ein=20Fehler=20beim=20L=C3=B6schen?= =?UTF-8?q?=20von=20Attributen.=20-=20Noch=20mehr=20Mallornwaffen=20in=20e?= =?UTF-8?q?xterner=20Datei.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/items/weapons.c | 101 ------------------------------------ src/common/kernel/alchemy.c | 2 +- src/common/kernel/border.c | 4 +- src/common/kernel/item.c | 2 +- src/common/kernel/magic.c | 88 +++++++++++++++---------------- src/res/resources.xml | 37 +++++++++++++ 6 files changed, 85 insertions(+), 149 deletions(-) diff --git a/src/common/items/weapons.c b/src/common/items/weapons.c index cd975b8b2..da1702d38 100644 --- a/src/common/items/weapons.c +++ b/src/common/items/weapons.c @@ -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"); } diff --git a/src/common/kernel/alchemy.c b/src/common/kernel/alchemy.c index 76a716fc7..889b5b9e0 100644 --- a/src/common/kernel/alchemy.c +++ b/src/common/kernel/alchemy.c @@ -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; diff --git a/src/common/kernel/border.c b/src/common/kernel/border.c index b3723010e..41d26aa2f 100644 --- a/src/common/kernel/border.c +++ b/src/common/kernel/border.c @@ -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; } diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index d1934c2fb..db3a27d21 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -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; } diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index c765c7a0a..099920bc7 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -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; } /* ------------------------------------------------------------- */ diff --git a/src/res/resources.xml b/src/res/resources.xml index 5ddb28762..34fe498e4 100644 --- a/src/res/resources.xml +++ b/src/res/resources.xml @@ -60,6 +60,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +