luxusgueter raus aus dem code, rein in die CML files

This commit is contained in:
Enno Rehling 2005-10-30 18:22:28 +00:00
parent eba19999f4
commit db9589bed1
5 changed files with 60 additions and 99 deletions

View File

@ -18,10 +18,10 @@
#include <attrib.h>
attrib_type at_aggressive = {
"aggressive",
NULL,
NULL,
NULL,
"aggressive",
NULL,
NULL,
NULL,
a_writedefault,
a_readdefault,
ATF_UNIQUE

View File

@ -655,7 +655,6 @@ void use_birthdayamulet(region * r, unit * magician, int amount, struct order *
enum {
IS_RESOURCE,
IS_PRODUCT,
IS_LUXURY,
IS_MAGIC,
/* wird für ZEIGE gebraucht */
IS_ITEM,
@ -727,34 +726,6 @@ static t_item itemdata[MAXITEMS] = {
{"Speer", "Speere", "Speer", "Speere"},
IS_PRODUCT, SK_WEAPONSMITH, 2, {0, 1, 0, 0, 0, 0}, 100, 0, 0, NULL
},
{ /* I_BALM */
{"Balsam", "Balsam", "Balsam", "Balsam"},
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 200, 4, 0, NULL
},
{ /* I_SPICES */
{"Gewürz", "Gewürz", "Gewürz", "Gewürz"},
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 200, 5, 0, NULL
},
{ /* I_JEWELERY */
{"Juwel", "Juwelen", "Juwel", "Juwelen"},
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 100, 7, 0, NULL
},
{ /* I_MYRRH */
{"Myrrhe", "Myrrhe", "Myrrhe", "Myrrhe"},
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 200, 5, 0, NULL
},
{ /* I_OIL */
{"Öl", "Öl", "Öl", "Öl"},
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 300, 3, 0, NULL
},
{ /* I_SILK */
{"Seide", "Seide", "Seide", "Seide"},
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 300, 6, 0, NULL
},
{ /* I_INCENSE */
{"Weihrauch", "Weihrauch", "Weihrauch", "Weihrauch"},
IS_LUXURY, 0, 0, {0, 0, 0, 0, 0, 0}, 200, 4, 0, NULL
},
{ /* I_AMULET_OF_HEALING */
{"Amulett der Heilung", "Amulette der Heilung", "Amulett", "Amulette"},
IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 0, 0, 0, NULL
@ -1017,14 +988,12 @@ init_olditems(void)
const char * appearance[2];
int weight = itemdata[i].gewicht;
int capacity = 0;
int price;
attrib * a;
item_type * itype;
if (itemdata[i].flags & FL_ITEM_CURSED) iflags |= ITF_CURSED;
if (itemdata[i].flags & FL_ITEM_NOTLOST) iflags |= ITF_NOTLOST;
if (itemdata[i].flags & FL_ITEM_NOTINBAG) iflags |= ITF_BIG;
if (itemdata[i].typ == IS_LUXURY) iflags |= ITF_LUXURY;
if (itemdata[i].flags & FL_ITEM_ANIMAL) iflags |= ITF_ANIMAL;
name[0]=NULL;
@ -1073,10 +1042,6 @@ init_olditems(void)
/* itemdata::typ Analyse. IS_PRODUCT und IS_MAGIC sind so gut wie egal. */
switch (itemdata[i].typ) {
case IS_LUXURY:
price = itemdata[i].preis;
rtype->ltype = new_luxurytype(itype, price);
break;
case IS_RESOURCE:
rtype->flags |= RTF_LIMITED;
itype->flags |= ITF_NOBUILDBESIEGED;
@ -1422,8 +1387,6 @@ static const char * names[] = {
static int
item_score(item_t i)
{
const luxury_type * ltype;
switch (i) {
case I_IRON:
case I_WOOD:
@ -1438,16 +1401,6 @@ item_score(item_t i)
return 60;
case I_LAENSWORD:
return 400;
case I_BALM:
case I_SPICES:
case I_JEWELERY:
case I_MYRRH:
case I_OIL:
case I_SILK:
case I_INCENSE:
ltype = resource2luxury(olditemtype[i]->rtype);
if (ltype) return ltype->price / 5;
return 0;
case I_AMULET_OF_HEALING:
case I_AMULET_OF_TRUE_SEEING:
case I_RING_OF_INVISIBILITY:

View File

@ -101,41 +101,41 @@ typedef struct resource_limit {
#define EUNUSABLE -4;
typedef struct itemtype_list {
struct itemtype_list * next;
const struct item_type * type;
struct itemtype_list * next;
const struct item_type * type;
} itemtype_list;
typedef struct item_type {
resource_type * rtype;
/* --- constants --- */
unsigned int flags;
int weight;
int capacity;
struct construction * construction;
/* --- functions --- */
int (*use)(struct unit * user, const struct item_type * itype, int amount, struct order * ord);
int (*useonother)(struct unit * user, int targetno, const struct item_type * itype, int amount, struct order * ord);
boolean (*give)(const struct unit * src, const struct unit * dest, const struct item_type * itm, int number, struct order * ord);
resource_type * rtype;
/* --- constants --- */
unsigned int flags;
int weight;
int capacity;
struct construction * construction;
/* --- functions --- */
int (*use)(struct unit * user, const struct item_type * itype, int amount, struct order * ord);
int (*useonother)(struct unit * user, int targetno, const struct item_type * itype, int amount, struct order * ord);
boolean (*give)(const struct unit * src, const struct unit * dest, const struct item_type * itm, int number, struct order * ord);
#ifdef SCORE_MODULE
int score;
#endif
struct item_type * next;
struct item_type * next;
} item_type;
extern const item_type * finditemtype(const char * name, const struct locale * lang);
extern void init_itemnames(void);
typedef struct luxury_type {
struct luxury_type * next;
const item_type * itype;
int price;
struct luxury_type * next;
const item_type * itype;
int price;
} luxury_type;
extern luxury_type * luxurytypes;
typedef struct potion_type {
struct potion_type * next;
const item_type * itype;
int level;
struct potion_type * next;
const item_type * itype;
int level;
} potion_type;
extern potion_type * potiontypes;
@ -183,18 +183,18 @@ typedef struct armor_type {
#define WTF_ARMORPIERCING 0x40 /* armor has only half value */
typedef struct weapon_type {
const item_type * itype;
const char * damage[2];
unsigned int flags;
skill_t skill;
int minskill;
int offmod;
int defmod;
double magres;
int reload; /* time to reload this weapon */
weapon_mod * modifiers;
/* --- functions --- */
boolean (*attack)(const struct troop *, const struct weapon_type *, int *deaths, int row);
const item_type * itype;
const char * damage[2];
unsigned int flags;
skill_t skill;
int minskill;
int offmod;
int defmod;
double magres;
int reload; /* time to reload this weapon */
weapon_mod * modifiers;
/* --- functions --- */
boolean (*attack)(const struct troop *, const struct weapon_type *, int *deaths, int row);
} weapon_type;
extern void rt_register(resource_type * it);
@ -264,13 +264,6 @@ enum {
I_WAGON,
I_CATAPULT,
I_SPEAR,
I_BALM,
I_SPICES,
I_JEWELERY,
I_MYRRH,
I_OIL,
I_SILK,
I_INCENSE,
/* alte Artefakte */
I_AMULET_OF_HEALING,
I_AMULET_OF_TRUE_SEEING,
@ -310,14 +303,6 @@ enum {
R_WAGON,
R_CATAPULT,
R_SPEAR,
/* luxury */
R_BALM,
R_SPICES,
R_JEWELERY,
R_MYRRH,
R_OIL,
R_SILK,
R_INCENSE,
/**/
R_AMULET_OF_HEALING,
R_AMULET_OF_TRUE_SEEING,

View File

@ -706,7 +706,7 @@ gm_addquest(const char * email, const char * name, short radius, unsigned int fl
a_add((attrib**)&a->data.v, make_atgmcreate(resource2item(r_silver)));
for (i=0;i<=I_INCENSE;++i) {
for (i=0;i<=I_SPEAR;++i) {
a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
}
for (i=I_LAENSWORD;i!=I_DRACHENBLUT;++i) {
@ -771,7 +771,7 @@ gm_addfaction(const char * email, plane * p, region * r)
a_add((attrib**)&a->data.v, make_atgmcreate(resource2item(r_silver)));
for (i=0;i<=I_INCENSE;++i) {
for (i=0;i<=I_SPEAR;++i) {
a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
}
for (i=I_LAENSWORD;i!=I_DRACHENBLUT;++i) {

View File

@ -1,6 +1,29 @@
<?xml version="1.0"?>
<resources>
<!-- luxury items -->
<resource name="balm">
<item weight="200"><luxury price="4"/></item>
</resource>
<resource name="spice">
<item weight="200"><luxury price="5"/></item>
</resource>
<resource name="jewel">
<item weight="100"><luxury price="7"/></item>
</resource>
<resource name="myrrh">
<item weight="200"><luxury price="5"/></item>
</resource>
<resource name="oil">
<item weight="300"><luxury price="3"/></item>
</resource>
<resource name="silk">
<item weight="300"><luxury price="6"/></item>
</resource>
<resource name="incense">
<item weight="200"><luxury price="4"/></item>
</resource>
<!-- XE items -->
<resource name="skillpotion">
<!-- gives user one free learning attempt -->