From 1c2ed3aedafed7e458559b0b708e2786f71657fd Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 20 Jun 2007 18:28:47 +0000 Subject: [PATCH] old weapons code that is no longer needed since all weapons have been in XML for a long time. --- src/common/items/itemtypes.c | 1 - src/common/items/weapons.c | 76 ------------------------------------ src/common/items/weapons.h | 1 - src/common/kernel/battle.c | 2 - 4 files changed, 80 deletions(-) diff --git a/src/common/items/itemtypes.c b/src/common/items/itemtypes.c index beb5ae2c3..1046e1871 100644 --- a/src/common/items/itemtypes.c +++ b/src/common/items/itemtypes.c @@ -33,7 +33,6 @@ register_itemtypes(void) void init_itemtypes(void) { - init_weapons(); init_seed(); init_mallornseed(); } diff --git a/src/common/items/weapons.c b/src/common/items/weapons.c index 410550811..cbd5b155a 100644 --- a/src/common/items/weapons.c +++ b/src/common/items/weapons.c @@ -43,35 +43,6 @@ enum { #define BASH (1<<2) #define ARMORPIERCING (1<<3) -typedef struct weapondata { - double magres; - const char *damfoot; - const char *damhorse; - item_t item; - skill_t skill; - char attmod; - char defmod; - boolean rear; - boolean is_magic; - struct reload { - int type; - char time; - } reload; - char damage_type; -} weapondata; - -static weapondata weapontable[WP_MAX + 1] = -/* MagRes, Schaden/Fuß, Schaden/Pferd, Item, Skill, OffMod, DefMod, - * missile, is_magic */ -{ - /* Unbewaffnet */ - {0.00, "1d5+0", "1d6+0", MAX_ITEMS, SK_MELEE, 0, 0, false, false, { 0, 0}, BASH }, - /* Dummy */ - {0.00, "0d0+0", "0d0+0", MAX_ITEMS, SK_MELEE, 0, 0, false, false, { 0, 0}, 0 } -}; - -weapon_type * oldweapontype[WP_MAX]; - static boolean attack_firesword(const troop * at, const struct weapon_type * wtype, int *casualties) { @@ -177,56 +148,9 @@ attack_catapult(const troop * at, const struct weapon_type * wtype, int * casual if (casualties) *casualties = d; return false; /* keine weitren attacken */ } - -static void -init_oldweapons(void) -{ - int w; - for (w=0;w!=WP_MAX && weapontable[w].item!=MAX_ITEMS;++w) { - const char * damage[2]; - item_type * itype = olditemtype[weapontable[w].item]; - int minskill = 1, wflags = WTF_NONE; - int m; - weapon_mod * modifiers = NULL; - boolean (*no_special_attack)(const troop *, const struct weapon_type *, int *) = NULL; - - assert(itype!=NULL || !"item not initialized"); - - if (weapontable[w].rear) wflags |= WTF_MISSILE; - if (weapontable[w].is_magic) wflags |= WTF_MAGICAL; - if (weapontable[w].damage_type & CUT) wflags |= WTF_CUT; - if (weapontable[w].damage_type & PIERCE) wflags |= WTF_PIERCE; - if (weapontable[w].damage_type & BASH) wflags |= WTF_BLUNT; - if (weapontable[w].damage_type & ARMORPIERCING) wflags |= WTF_ARMORPIERCING; - - damage[0] = weapontable[w].damfoot; - damage[1] = weapontable[w].damhorse; - - oldweapontype[w] = new_weapontype(itype, wflags, weapontable[w].magres, damage, weapontable[w].attmod, weapontable[w].defmod, weapontable[w].reload.time, weapontable[w].skill, minskill); - oldweapontype[w]->modifiers = modifiers; - oldweapontype[w]->attack = no_special_attack; - -#ifdef SCORE_MODULE - if (itype->construction->materials==NULL) { - itype->score = 6000; - } else for (m=0;itype->construction->materials[m].number;++m) { - const resource_type * rtype = itype->construction->materials[m].rtype; - int score = rtype->itype?rtype->itype->score:5; - itype->score = 2*itype->construction->materials[m].number * score; - } -#endif - } -} - void register_weapons(void) { register_function((pf_generic)attack_catapult, "attack_catapult"); register_function((pf_generic)attack_firesword, "attack_firesword"); } - -void -init_weapons(void) -{ - init_oldweapons(); -} diff --git a/src/common/items/weapons.h b/src/common/items/weapons.h index 8028d6472..61cbdc292 100644 --- a/src/common/items/weapons.h +++ b/src/common/items/weapons.h @@ -17,7 +17,6 @@ extern "C" { #endif extern void register_weapons(void); -extern void init_weapons(void); #ifdef __cplusplus } diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 365b246fc..65849feb4 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -111,8 +111,6 @@ static int obs_count = 0; static const double EFFECT_PANIC_SPELL = 0.25; static const double TROLL_REGENERATION = 0.10; -extern weapon_type * oldweapontype[]; - /* Nach dem alten System: */ static int missile_range[2] = {FIGHT_ROW, BEHIND_ROW}; static int melee_range[2] = {FIGHT_ROW, FIGHT_ROW};