forked from github/server
more weapons out of the code.
This commit is contained in:
parent
baab10febe
commit
89e8c622c7
8 changed files with 76 additions and 78 deletions
|
@ -2990,7 +2990,6 @@ int * age = NULL;
|
||||||
typedef struct summary {
|
typedef struct summary {
|
||||||
int waffen;
|
int waffen;
|
||||||
int factions;
|
int factions;
|
||||||
int artefakte;
|
|
||||||
int ruestungen;
|
int ruestungen;
|
||||||
int schiffe;
|
int schiffe;
|
||||||
int gebaeude;
|
int gebaeude;
|
||||||
|
@ -3105,12 +3104,6 @@ make_summary(void)
|
||||||
s->ruestungen += itm->number;
|
s->ruestungen += itm->number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s->artefakte += get_item(u, I_AMULET_OF_TRUE_SEEING);
|
|
||||||
s->artefakte += get_item(u, I_RING_OF_INVISIBILITY);
|
|
||||||
s->artefakte += get_item(u, I_SPHERE_OF_INVISIBILITY);
|
|
||||||
s->artefakte += get_item(u, I_SACK_OF_CONSERVATION);
|
|
||||||
s->artefakte += get_item(u, I_RING_OF_POWER);
|
|
||||||
s->artefakte += get_item(u, I_RUNESWORD);
|
|
||||||
|
|
||||||
s->spielerpferde += get_item(u, I_HORSE);
|
s->spielerpferde += get_item(u, I_HORSE);
|
||||||
|
|
||||||
|
@ -3426,7 +3419,6 @@ report_summary(summary * s, summary * o, boolean full)
|
||||||
fprintf(F, "ungezähmte Pferde: %s\n", pcomp(s->pferde, o->pferde));
|
fprintf(F, "ungezähmte Pferde: %s\n", pcomp(s->pferde, o->pferde));
|
||||||
fprintf(F, "gezähmte Pferde: %s\n",
|
fprintf(F, "gezähmte Pferde: %s\n",
|
||||||
pcomp(s->spielerpferde,o->spielerpferde));
|
pcomp(s->spielerpferde,o->spielerpferde));
|
||||||
fprintf(F, "Artefakte: %s\n", pcomp(s->artefakte,o->artefakte));
|
|
||||||
fprintf(F, "Schiffe: %s\n", pcomp(s->schiffe, o->schiffe));
|
fprintf(F, "Schiffe: %s\n", pcomp(s->schiffe, o->schiffe));
|
||||||
fprintf(F, "Gebäude: %s\n", pcomp(s->gebaeude, o->gebaeude));
|
fprintf(F, "Gebäude: %s\n", pcomp(s->gebaeude, o->gebaeude));
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,6 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
static weapon_mod wm_bow[] = {
|
|
||||||
{ 2, WMF_MISSILE_TARGET },
|
|
||||||
{ 0, 0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
static weapon_mod wm_catapult[] = {
|
static weapon_mod wm_catapult[] = {
|
||||||
{ 4, WMF_MISSILE_TARGET },
|
{ 4, WMF_MISSILE_TARGET },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
|
@ -52,11 +47,8 @@ static weapon_mod wm_lance[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
WP_RUNESWORD,
|
|
||||||
WP_FIRESWORD,
|
|
||||||
WP_EOGSWORD,
|
WP_EOGSWORD,
|
||||||
WP_CATAPULT,
|
WP_CATAPULT,
|
||||||
WP_LONGBOW,
|
|
||||||
WP_SPEAR,
|
WP_SPEAR,
|
||||||
WP_LANCE,
|
WP_LANCE,
|
||||||
WP_NONE,
|
WP_NONE,
|
||||||
|
@ -97,16 +89,9 @@ static weapondata weapontable[WP_MAX + 1] =
|
||||||
/* MagRes, Schaden/Fuß, Schaden/Pferd, Item, Skill, OffMod, DefMod,
|
/* MagRes, Schaden/Fuß, Schaden/Pferd, Item, Skill, OffMod, DefMod,
|
||||||
* missile, is_magic */
|
* missile, is_magic */
|
||||||
{
|
{
|
||||||
/* Runenschwert */
|
|
||||||
{0.00, "3d10+10", "3d10+10", I_RUNESWORD, SK_MELEE, 2, 2, false, true, { RL_NONE, 0}, CUT },
|
|
||||||
/* Flammenschwert */
|
|
||||||
{0.30, "3d6+10", "3d6+10", I_FIRESWORD, SK_MELEE, 1, 1, false, false, { RL_NONE, 0}, CUT },
|
|
||||||
/* Laenschwert */
|
|
||||||
{0.30, "3d6+10", "3d6+10", I_LAENSWORD, SK_MELEE, 1, 1, false, false, { RL_NONE, 0}, CUT },
|
{0.30, "3d6+10", "3d6+10", I_LAENSWORD, SK_MELEE, 1, 1, false, false, { RL_NONE, 0}, CUT },
|
||||||
/* Katapult */
|
/* Katapult */
|
||||||
{0.00, "3d10+5", "3d10+5", I_CATAPULT, SK_CATAPULT, 0, 0, true, false, { RL_CATAPULT, 5 }, BASH },
|
{0.00, "3d10+5", "3d10+5", I_CATAPULT, SK_CATAPULT, 0, 0, true, false, { RL_CATAPULT, 5 }, BASH },
|
||||||
/* Langbogen */
|
|
||||||
{0.00, "1d11+1", "1d11+1", I_LONGBOW, SK_LONGBOW, 0, 0, true, false, { RL_NONE, 0 }, PIERCE },
|
|
||||||
/* Speer */
|
/* Speer */
|
||||||
{0.00, "1d10+0", "1d12+2", I_SPEAR, SK_SPEAR, 0, 0, false, false, { RL_NONE, 0}, PIERCE },
|
{0.00, "1d10+0", "1d12+2", I_SPEAR, SK_SPEAR, 0, 0, false, false, { RL_NONE, 0}, PIERCE },
|
||||||
/* Lanze */
|
/* Lanze */
|
||||||
|
@ -120,7 +105,7 @@ static weapondata weapontable[WP_MAX + 1] =
|
||||||
weapon_type * oldweapontype[WP_MAX];
|
weapon_type * oldweapontype[WP_MAX];
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
attack_firesword(const troop * at, int *casualties, int row)
|
attack_firesword(const troop * at, const struct weapon_type * wtype, int *casualties, int row)
|
||||||
{
|
{
|
||||||
fighter *fi = at->fighter;
|
fighter *fi = at->fighter;
|
||||||
troop dt;
|
troop dt;
|
||||||
|
@ -144,7 +129,7 @@ attack_firesword(const troop * at, int *casualties, int row)
|
||||||
int i, k=0;
|
int i, k=0;
|
||||||
for (i=0;i<=at->index;++i) {
|
for (i=0;i<=at->index;++i) {
|
||||||
struct weapon * wp = fi->person[i].melee;
|
struct weapon * wp = fi->person[i].melee;
|
||||||
if (wp!=NULL && wp->type == oldweapontype[WP_FIRESWORD]) ++k;
|
if (wp!=NULL && wp->type == wtype) ++k;
|
||||||
}
|
}
|
||||||
sprintf(buf, "%d Kämpfer aus %s benutz%s Flammenschwert%s:", k, unitname(fi->unit),
|
sprintf(buf, "%d Kämpfer aus %s benutz%s Flammenschwert%s:", k, unitname(fi->unit),
|
||||||
(k==1)?"t sein ":"en ihre",(k==1)?"":"er");
|
(k==1)?"t sein ":"en ihre",(k==1)?"":"er");
|
||||||
|
@ -165,7 +150,7 @@ attack_firesword(const troop * at, int *casualties, int row)
|
||||||
#define CATAPULT_ATTACKS 6
|
#define CATAPULT_ATTACKS 6
|
||||||
|
|
||||||
static boolean
|
static boolean
|
||||||
attack_catapult(const troop * at, int * casualties, int row)
|
attack_catapult(const troop * at, const struct weapon_type * wtype, int * casualties, int row)
|
||||||
{
|
{
|
||||||
fighter *af = at->fighter;
|
fighter *af = at->fighter;
|
||||||
unit *au = af->unit;
|
unit *au = af->unit;
|
||||||
|
@ -184,7 +169,7 @@ attack_catapult(const troop * at, int * casualties, int row)
|
||||||
/* probiere noch weitere attacken, kann nicht schiessen */
|
/* probiere noch weitere attacken, kann nicht schiessen */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
assert(wp->type->itype==olditemtype[I_CATAPULT]);
|
assert(wp->type==wtype);
|
||||||
assert(af->person[at->index].reload==0);
|
assert(af->person[at->index].reload==0);
|
||||||
|
|
||||||
if (it_catapultammo!=NULL) {
|
if (it_catapultammo!=NULL) {
|
||||||
|
@ -245,14 +230,9 @@ init_oldweapons(void)
|
||||||
int minskill = 1, wflags = WTF_NONE;
|
int minskill = 1, wflags = WTF_NONE;
|
||||||
int m;
|
int m;
|
||||||
weapon_mod * modifiers = NULL;
|
weapon_mod * modifiers = NULL;
|
||||||
boolean (*attack)(const troop *, int * deaths, int row) = NULL;
|
boolean (*attack)(const troop *, const struct weapon_type *, int *, int) = NULL;
|
||||||
|
|
||||||
switch (w) {
|
switch (w) {
|
||||||
case WP_RUNESWORD:
|
|
||||||
case WP_FIRESWORD:
|
|
||||||
attack = attack_firesword;
|
|
||||||
minskill = 7;
|
|
||||||
break;
|
|
||||||
case WP_LANCE:
|
case WP_LANCE:
|
||||||
modifiers = wm_lance;
|
modifiers = wm_lance;
|
||||||
break;
|
break;
|
||||||
|
@ -263,9 +243,6 @@ init_oldweapons(void)
|
||||||
case WP_SPEAR:
|
case WP_SPEAR:
|
||||||
modifiers = wm_spear;
|
modifiers = wm_spear;
|
||||||
break;
|
break;
|
||||||
case WP_LONGBOW:
|
|
||||||
modifiers = wm_bow;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(itype!=NULL || !"item not initialized");
|
assert(itype!=NULL || !"item not initialized");
|
||||||
|
|
|
@ -1964,7 +1964,7 @@ attack(battle *b, troop ta, const att *a, int numattack)
|
||||||
* sonst helden mit feuerschwertern zu mächtig */
|
* sonst helden mit feuerschwertern zu mächtig */
|
||||||
if (numattack==0 && wp && wp->type->attack) {
|
if (numattack==0 && wp && wp->type->attack) {
|
||||||
int dead = 0;
|
int dead = 0;
|
||||||
standard_attack = wp->type->attack(&ta, &dead, row);
|
standard_attack = wp->type->attack(&ta, wp->type, &dead, row);
|
||||||
if (!standard_attack) reload = true;
|
if (!standard_attack) reload = true;
|
||||||
af->catmsg += dead;
|
af->catmsg += dead;
|
||||||
if (!standard_attack && af->person[ta.index].last_action < b->turn) {
|
if (!standard_attack && af->person[ta.index].last_action < b->turn) {
|
||||||
|
|
|
@ -51,7 +51,6 @@ extern "C" {
|
||||||
#define luxury_t short
|
#define luxury_t short
|
||||||
#define weapon_t short
|
#define weapon_t short
|
||||||
#define item_t short
|
#define item_t short
|
||||||
#define resource_t short
|
|
||||||
#define spellid_t unsigned int
|
#define spellid_t unsigned int
|
||||||
#else
|
#else
|
||||||
typedef short order_t;
|
typedef short order_t;
|
||||||
|
@ -66,7 +65,6 @@ typedef short potion_t;
|
||||||
typedef short luxury_t;
|
typedef short luxury_t;
|
||||||
typedef short weapon_t;
|
typedef short weapon_t;
|
||||||
typedef short item_t;
|
typedef short item_t;
|
||||||
typedef short resource_t;
|
|
||||||
typedef unsigned int spellid_t;
|
typedef unsigned int spellid_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -597,11 +597,8 @@ give_horses(const unit * s, const unit * d, const item_type * itype, int n, stru
|
||||||
#define LASTLUXURY (I_INCENSE +1)
|
#define LASTLUXURY (I_INCENSE +1)
|
||||||
#define MAXLUXURIES (LASTLUXURY - FIRSTLUXURY)
|
#define MAXLUXURIES (LASTLUXURY - FIRSTLUXURY)
|
||||||
|
|
||||||
#define item2res(itm) (resource_t)(itm+R_MINITEM)
|
|
||||||
|
|
||||||
item_type * olditemtype[MAXITEMS+1];
|
item_type * olditemtype[MAXITEMS+1];
|
||||||
resource_type * oldresourcetype[MAXRESOURCES+1];
|
resource_type * oldresourcetype[MAXRESOURCES+1];
|
||||||
luxury_type * oldluxurytype[MAXLUXURIES+1];
|
|
||||||
potion_type * oldpotiontype[MAXPOTIONS+1];
|
potion_type * oldpotiontype[MAXPOTIONS+1];
|
||||||
|
|
||||||
/*** alte items ***/
|
/*** alte items ***/
|
||||||
|
@ -783,10 +780,6 @@ static t_item itemdata[MAXITEMS] = {
|
||||||
{"Speer", "Speere", "Speer", "Speere"},
|
{"Speer", "Speere", "Speer", "Speere"},
|
||||||
IS_PRODUCT, SK_WEAPONSMITH, 2, {0, 1, 0, 0, 0, 0}, 100, 0, 0, NULL
|
IS_PRODUCT, SK_WEAPONSMITH, 2, {0, 1, 0, 0, 0, 0}, 100, 0, 0, NULL
|
||||||
},
|
},
|
||||||
{ /* I_LONGBOW */
|
|
||||||
{"Bogen", "Bögen", "Bogen", "Bögen"},
|
|
||||||
IS_PRODUCT, SK_WEAPONSMITH, 2, {0, 1, 0, 0, 0, 0}, 100, 0, 0, NULL
|
|
||||||
},
|
|
||||||
{ /* I_BALM */
|
{ /* I_BALM */
|
||||||
{"Balsam", "Balsam", "Balsam", "Balsam"},
|
{"Balsam", "Balsam", "Balsam", "Balsam"},
|
||||||
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 200, 4, 0, NULL
|
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 200, 4, 0, NULL
|
||||||
|
@ -832,11 +825,6 @@ static t_item itemdata[MAXITEMS] = {
|
||||||
{"Ring der Macht", "Ringe der Macht", "", ""},
|
{"Ring der Macht", "Ringe der Macht", "", ""},
|
||||||
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, 0, NULL
|
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, 0, NULL
|
||||||
},
|
},
|
||||||
{ /* I_FIRESWORD */
|
|
||||||
{"Flammenschwert", "Flammenschwerter",
|
|
||||||
"Flammenschwert", "Flammenschwerter"},
|
|
||||||
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 100, 0, 0, NULL
|
|
||||||
},
|
|
||||||
{ /* I_DRAGONHEAD 33 */
|
{ /* I_DRAGONHEAD 33 */
|
||||||
{"Drachenkopf", "Drachenköpfe", "Drachenkopf", "Drachenköpfe"},
|
{"Drachenkopf", "Drachenköpfe", "Drachenkopf", "Drachenköpfe"},
|
||||||
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 500, 0, 0, NULL
|
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 500, 0, 0, NULL
|
||||||
|
@ -899,10 +887,6 @@ static t_item itemdata[MAXITEMS] = {
|
||||||
"Akkredition des Xontormia-Expreß", "Akkreditionen des Xontormia-Expreß"},
|
"Akkredition des Xontormia-Expreß", "Akkreditionen des Xontormia-Expreß"},
|
||||||
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, FL_ITEM_CURSED, NULL
|
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, FL_ITEM_CURSED, NULL
|
||||||
},
|
},
|
||||||
{ /* I_RUNESWORD 68 */
|
|
||||||
{"Runenschwert", "Runenschwerter", "Runenschwert", "Runenschwerter"},
|
|
||||||
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 100, 0, 0, NULL
|
|
||||||
},
|
|
||||||
{ /* I_AURAKULUM 69 */
|
{ /* I_AURAKULUM 69 */
|
||||||
{"Aurafocus", "Aurafocuse", "Amulett", "Amulette"},
|
{"Aurafocus", "Aurafocuse", "Amulett", "Amulette"},
|
||||||
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 100, 0, 0, NULL
|
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 100, 0, 0, NULL
|
||||||
|
@ -1144,7 +1128,6 @@ init_olditems(void)
|
||||||
switch (itemdata[i].typ) {
|
switch (itemdata[i].typ) {
|
||||||
case IS_LUXURY:
|
case IS_LUXURY:
|
||||||
price = itemdata[i].preis;
|
price = itemdata[i].preis;
|
||||||
oldluxurytype[i-FIRSTLUXURY] = new_luxurytype(itype, price);
|
|
||||||
break;
|
break;
|
||||||
case IS_RESOURCE:
|
case IS_RESOURCE:
|
||||||
rtype->flags |= RTF_LIMITED;
|
rtype->flags |= RTF_LIMITED;
|
||||||
|
@ -1161,7 +1144,7 @@ init_olditems(void)
|
||||||
itype->use = use_olditem;
|
itype->use = use_olditem;
|
||||||
}
|
}
|
||||||
olditemtype[i] = itype;
|
olditemtype[i] = itype;
|
||||||
oldresourcetype[item2res(i)] = rtype;
|
oldresourcetype[i] = rtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i!=MAXITEMS; ++i) {
|
for (i=0; i!=MAXITEMS; ++i) {
|
||||||
|
|
|
@ -195,7 +195,7 @@ typedef struct weapon_type {
|
||||||
int reload; /* time to reload this weapon */
|
int reload; /* time to reload this weapon */
|
||||||
weapon_mod * modifiers;
|
weapon_mod * modifiers;
|
||||||
/* --- functions --- */
|
/* --- functions --- */
|
||||||
boolean (*attack)(const struct troop *, int *deaths, int row);
|
boolean (*attack)(const struct troop *, const struct weapon_type *, int *deaths, int row);
|
||||||
} weapon_type;
|
} weapon_type;
|
||||||
|
|
||||||
extern void rt_register(resource_type * it);
|
extern void rt_register(resource_type * it);
|
||||||
|
@ -265,7 +265,6 @@ enum {
|
||||||
I_WAGON,
|
I_WAGON,
|
||||||
I_CATAPULT,
|
I_CATAPULT,
|
||||||
I_SPEAR,
|
I_SPEAR,
|
||||||
I_LONGBOW,
|
|
||||||
I_BALM,
|
I_BALM,
|
||||||
I_SPICES,
|
I_SPICES,
|
||||||
I_JEWELERY,
|
I_JEWELERY,
|
||||||
|
@ -278,7 +277,6 @@ enum {
|
||||||
I_AMULET_OF_TRUE_SEEING,
|
I_AMULET_OF_TRUE_SEEING,
|
||||||
I_RING_OF_INVISIBILITY,
|
I_RING_OF_INVISIBILITY,
|
||||||
I_RING_OF_POWER,
|
I_RING_OF_POWER,
|
||||||
I_FIRESWORD, /* Runenschwert ersetzen durch Flammenschwert */
|
|
||||||
I_DRAGONHEAD,
|
I_DRAGONHEAD,
|
||||||
I_CHASTITY_BELT, /* bleibt */
|
I_CHASTITY_BELT, /* bleibt */
|
||||||
I_LAENSWORD,
|
I_LAENSWORD,
|
||||||
|
@ -294,7 +292,6 @@ enum {
|
||||||
I_RING_OF_NIMBLEFINGER,
|
I_RING_OF_NIMBLEFINGER,
|
||||||
I_TROLLBELT,
|
I_TROLLBELT,
|
||||||
I_PRESSCARD,
|
I_PRESSCARD,
|
||||||
I_RUNESWORD,
|
|
||||||
I_AURAKULUM,
|
I_AURAKULUM,
|
||||||
I_SEASERPENTHEAD,
|
I_SEASERPENTHEAD,
|
||||||
I_SPHERE_OF_INVISIBILITY,
|
I_SPHERE_OF_INVISIBILITY,
|
||||||
|
@ -314,19 +311,19 @@ enum {
|
||||||
R_WAGON,
|
R_WAGON,
|
||||||
R_CATAPULT,
|
R_CATAPULT,
|
||||||
R_SPEAR,
|
R_SPEAR,
|
||||||
R_LONGBOW,
|
/* luxury */
|
||||||
R_BALM,
|
R_BALM,
|
||||||
R_SPICES,
|
R_SPICES,
|
||||||
R_JEWELERY,
|
R_JEWELERY,
|
||||||
R_MYRRH,
|
R_MYRRH,
|
||||||
R_OIL,
|
R_OIL,
|
||||||
R_SILK,
|
R_SILK,
|
||||||
R_INCENSE,
|
R_INCENSE,
|
||||||
|
/**/
|
||||||
R_AMULET_OF_HEALING,
|
R_AMULET_OF_HEALING,
|
||||||
R_AMULET_OF_TRUE_SEEING,
|
R_AMULET_OF_TRUE_SEEING,
|
||||||
R_RING_OF_INVISIBILITY,
|
R_RING_OF_INVISIBILITY,
|
||||||
R_RING_OF_POWER,
|
R_RING_OF_POWER,
|
||||||
R_FIRESWORD,
|
|
||||||
R_DRAGONHEAD,
|
R_DRAGONHEAD,
|
||||||
R_CHASTITY_BELT,
|
R_CHASTITY_BELT,
|
||||||
R_EOGSWORD,
|
R_EOGSWORD,
|
||||||
|
@ -342,7 +339,6 @@ enum {
|
||||||
R_RING_OF_NIMBLEFINGER,
|
R_RING_OF_NIMBLEFINGER,
|
||||||
R_TROLLBELT,
|
R_TROLLBELT,
|
||||||
R_PRESSCARD,
|
R_PRESSCARD,
|
||||||
R_RUNESWORD,
|
|
||||||
R_AURAKULUM,
|
R_AURAKULUM,
|
||||||
R_SEASERPENTHEAD,
|
R_SEASERPENTHEAD,
|
||||||
R_SPHERE_OF_INVISIBILITY,
|
R_SPHERE_OF_INVISIBILITY,
|
||||||
|
@ -360,10 +356,9 @@ enum {
|
||||||
R_PERMAURA, /* Permanente Aura */
|
R_PERMAURA, /* Permanente Aura */
|
||||||
|
|
||||||
MAX_RESOURCES, /* do not use outside item.c ! */
|
MAX_RESOURCES, /* do not use outside item.c ! */
|
||||||
NORESOURCE = (resource_t) - 1
|
NORESOURCE = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct luxury_type * oldluxurytype[];
|
|
||||||
extern struct potion_type * oldpotiontype[];
|
extern struct potion_type * oldpotiontype[];
|
||||||
extern struct item_type * olditemtype[];
|
extern struct item_type * olditemtype[];
|
||||||
extern struct resource_type * oldresourcetype[];
|
extern struct resource_type * oldresourcetype[];
|
||||||
|
|
|
@ -692,6 +692,34 @@ xml_readweapon(xmlXPathContextPtr xpath, item_type * itype)
|
||||||
}
|
}
|
||||||
xmlXPathFreeObject(result);
|
xmlXPathFreeObject(result);
|
||||||
|
|
||||||
|
if (gamecode_enabled) {
|
||||||
|
/* reading weapon/function */
|
||||||
|
xpath->node = node;
|
||||||
|
result = xmlXPathEvalExpression(BAD_CAST "function", xpath);
|
||||||
|
for (k=0;k!=result->nodesetval->nodeNr;++k) {
|
||||||
|
xmlNodePtr node = result->nodesetval->nodeTab[k];
|
||||||
|
xmlChar * property;
|
||||||
|
pf_generic fun;
|
||||||
|
|
||||||
|
parse_function(node, &fun, &property);
|
||||||
|
if (fun==NULL) {
|
||||||
|
log_error(("unknown function name '%s' for item '%s'\n",
|
||||||
|
(const char*)property, itype->rtype->_name[0]));
|
||||||
|
xmlFree(property);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
assert(property!=NULL);
|
||||||
|
if (strcmp((const char*)property, "attack")==0) {
|
||||||
|
wtype->attack = (boolean (*)(const struct troop*, const struct weapon_type *, int*, int))fun;
|
||||||
|
} else {
|
||||||
|
log_error(("unknown function type '%s' for item '%s'\n",
|
||||||
|
(const char*)property, itype->rtype->_name[0]));
|
||||||
|
}
|
||||||
|
xmlFree(property);
|
||||||
|
}
|
||||||
|
xmlXPathFreeObject(result);
|
||||||
|
}
|
||||||
|
|
||||||
xpath->node = node;
|
xpath->node = node;
|
||||||
return wtype;
|
return wtype;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,10 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- museum items -->
|
<!-- luxury items -->
|
||||||
<resource name="museumexitticket">
|
<resource name="oil">
|
||||||
<!-- you get your stuff back when leaving the museum -->
|
|
||||||
<item notlost="yes" weight="0">
|
|
||||||
<function name="use" value="use_museumexitticket"/>
|
|
||||||
</item>
|
|
||||||
</resource>
|
|
||||||
|
|
||||||
<resource name="museumticket">
|
|
||||||
<!-- you get your stuff back when leaving the museum -->
|
|
||||||
<item weight="0">
|
<item weight="0">
|
||||||
<function name="use" value="use_museumticket"/>
|
<function name="use" value="useskillpotion"/>
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
|
@ -110,6 +102,26 @@
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
|
<resource name="runesword">
|
||||||
|
<item weight="100">
|
||||||
|
<weapon minskill="7" cut="true" magical="yes" skill="melee" offmod="2" defmod="2">
|
||||||
|
<function name="attack" value="attack_firesword"/>
|
||||||
|
<damage type="rider" value="3d10+10"/>
|
||||||
|
<damage type="footman" value="3d10+10"/>
|
||||||
|
</weapon>
|
||||||
|
</item>
|
||||||
|
</resource>
|
||||||
|
|
||||||
|
<resource name="firesword">
|
||||||
|
<item weight="100">
|
||||||
|
<weapon minskill="7" magres="0.3" cut="true" skill="melee" offmod="1" defmod="1">
|
||||||
|
<function name="attack" value="attack_firesword"/>
|
||||||
|
<damage type="rider" value="3d6+10"/>
|
||||||
|
<damage type="footman" value="3d6+10"/>
|
||||||
|
</weapon>
|
||||||
|
</item>
|
||||||
|
</resource>
|
||||||
|
|
||||||
<resource name="greatsword">
|
<resource name="greatsword">
|
||||||
<item weight="200">
|
<item weight="200">
|
||||||
<construction skill="weaponsmithing" minskill="4" reqsize="1">
|
<construction skill="weaponsmithing" minskill="4" reqsize="1">
|
||||||
|
@ -195,6 +207,19 @@
|
||||||
</item>
|
</item>
|
||||||
</resource>
|
</resource>
|
||||||
|
|
||||||
|
<resource name="bow">
|
||||||
|
<item weight="100">
|
||||||
|
<construction skill="weaponsmithing" minskill="2" reqsize="1">
|
||||||
|
<requirement type="log" quantity="1"/>
|
||||||
|
</construction>
|
||||||
|
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0">
|
||||||
|
<damage type="rider" value="1d11+1"/>
|
||||||
|
<damage type="footman" value="1d11+1"/>
|
||||||
|
<modifier type="missile_target" value="2"/>
|
||||||
|
</weapon>
|
||||||
|
</item>
|
||||||
|
</resource>
|
||||||
|
|
||||||
<resource name="crossbow">
|
<resource name="crossbow">
|
||||||
<item weight="100">
|
<item weight="100">
|
||||||
<construction skill="weaponsmithing" minskill="3" reqsize="1">
|
<construction skill="weaponsmithing" minskill="3" reqsize="1">
|
||||||
|
|
Loading…
Reference in a new issue