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> #include <attrib.h>
attrib_type at_aggressive = { attrib_type at_aggressive = {
"aggressive", "aggressive",
NULL, NULL,
NULL, NULL,
NULL, NULL,
a_writedefault, a_writedefault,
a_readdefault, a_readdefault,
ATF_UNIQUE ATF_UNIQUE

View File

@ -655,7 +655,6 @@ void use_birthdayamulet(region * r, unit * magician, int amount, struct order *
enum { enum {
IS_RESOURCE, IS_RESOURCE,
IS_PRODUCT, IS_PRODUCT,
IS_LUXURY,
IS_MAGIC, IS_MAGIC,
/* wird für ZEIGE gebraucht */ /* wird für ZEIGE gebraucht */
IS_ITEM, IS_ITEM,
@ -727,34 +726,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_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 */ { /* I_AMULET_OF_HEALING */
{"Amulett der Heilung", "Amulette der Heilung", "Amulett", "Amulette"}, {"Amulett der Heilung", "Amulette der Heilung", "Amulett", "Amulette"},
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
@ -1017,14 +988,12 @@ init_olditems(void)
const char * appearance[2]; const char * appearance[2];
int weight = itemdata[i].gewicht; int weight = itemdata[i].gewicht;
int capacity = 0; int capacity = 0;
int price;
attrib * a; attrib * a;
item_type * itype; item_type * itype;
if (itemdata[i].flags & FL_ITEM_CURSED) iflags |= ITF_CURSED; 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_NOTLOST) iflags |= ITF_NOTLOST;
if (itemdata[i].flags & FL_ITEM_NOTINBAG) iflags |= ITF_BIG; 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; if (itemdata[i].flags & FL_ITEM_ANIMAL) iflags |= ITF_ANIMAL;
name[0]=NULL; name[0]=NULL;
@ -1073,10 +1042,6 @@ init_olditems(void)
/* itemdata::typ Analyse. IS_PRODUCT und IS_MAGIC sind so gut wie egal. */ /* itemdata::typ Analyse. IS_PRODUCT und IS_MAGIC sind so gut wie egal. */
switch (itemdata[i].typ) { switch (itemdata[i].typ) {
case IS_LUXURY:
price = itemdata[i].preis;
rtype->ltype = new_luxurytype(itype, price);
break;
case IS_RESOURCE: case IS_RESOURCE:
rtype->flags |= RTF_LIMITED; rtype->flags |= RTF_LIMITED;
itype->flags |= ITF_NOBUILDBESIEGED; itype->flags |= ITF_NOBUILDBESIEGED;
@ -1422,8 +1387,6 @@ static const char * names[] = {
static int static int
item_score(item_t i) item_score(item_t i)
{ {
const luxury_type * ltype;
switch (i) { switch (i) {
case I_IRON: case I_IRON:
case I_WOOD: case I_WOOD:
@ -1438,16 +1401,6 @@ item_score(item_t i)
return 60; return 60;
case I_LAENSWORD: case I_LAENSWORD:
return 400; 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_HEALING:
case I_AMULET_OF_TRUE_SEEING: case I_AMULET_OF_TRUE_SEEING:
case I_RING_OF_INVISIBILITY: case I_RING_OF_INVISIBILITY:

View File

@ -101,41 +101,41 @@ typedef struct resource_limit {
#define EUNUSABLE -4; #define EUNUSABLE -4;
typedef struct itemtype_list { typedef struct itemtype_list {
struct itemtype_list * next; struct itemtype_list * next;
const struct item_type * type; const struct item_type * type;
} itemtype_list; } itemtype_list;
typedef struct item_type { typedef struct item_type {
resource_type * rtype; resource_type * rtype;
/* --- constants --- */ /* --- constants --- */
unsigned int flags; unsigned int flags;
int weight; int weight;
int capacity; int capacity;
struct construction * construction; struct construction * construction;
/* --- functions --- */ /* --- functions --- */
int (*use)(struct unit * user, const struct item_type * itype, int amount, struct order * ord); 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); 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); boolean (*give)(const struct unit * src, const struct unit * dest, const struct item_type * itm, int number, struct order * ord);
#ifdef SCORE_MODULE #ifdef SCORE_MODULE
int score; int score;
#endif #endif
struct item_type * next; struct item_type * next;
} item_type; } item_type;
extern const item_type * finditemtype(const char * name, const struct locale * lang); extern const item_type * finditemtype(const char * name, const struct locale * lang);
extern void init_itemnames(void); extern void init_itemnames(void);
typedef struct luxury_type { typedef struct luxury_type {
struct luxury_type * next; struct luxury_type * next;
const item_type * itype; const item_type * itype;
int price; int price;
} luxury_type; } luxury_type;
extern luxury_type * luxurytypes; extern luxury_type * luxurytypes;
typedef struct potion_type { typedef struct potion_type {
struct potion_type * next; struct potion_type * next;
const item_type * itype; const item_type * itype;
int level; int level;
} potion_type; } potion_type;
extern potion_type * potiontypes; extern potion_type * potiontypes;
@ -183,18 +183,18 @@ typedef struct armor_type {
#define WTF_ARMORPIERCING 0x40 /* armor has only half value */ #define WTF_ARMORPIERCING 0x40 /* armor has only half value */
typedef struct weapon_type { typedef struct weapon_type {
const item_type * itype; const item_type * itype;
const char * damage[2]; const char * damage[2];
unsigned int flags; unsigned int flags;
skill_t skill; skill_t skill;
int minskill; int minskill;
int offmod; int offmod;
int defmod; int defmod;
double magres; double magres;
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 *, const struct weapon_type *, 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);
@ -264,13 +264,6 @@ enum {
I_WAGON, I_WAGON,
I_CATAPULT, I_CATAPULT,
I_SPEAR, I_SPEAR,
I_BALM,
I_SPICES,
I_JEWELERY,
I_MYRRH,
I_OIL,
I_SILK,
I_INCENSE,
/* alte Artefakte */ /* alte Artefakte */
I_AMULET_OF_HEALING, I_AMULET_OF_HEALING,
I_AMULET_OF_TRUE_SEEING, I_AMULET_OF_TRUE_SEEING,
@ -310,14 +303,6 @@ enum {
R_WAGON, R_WAGON,
R_CATAPULT, R_CATAPULT,
R_SPEAR, R_SPEAR,
/* luxury */
R_BALM,
R_SPICES,
R_JEWELERY,
R_MYRRH,
R_OIL,
R_SILK,
R_INCENSE,
/**/ /**/
R_AMULET_OF_HEALING, R_AMULET_OF_HEALING,
R_AMULET_OF_TRUE_SEEING, 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))); 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])); a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
} }
for (i=I_LAENSWORD;i!=I_DRACHENBLUT;++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))); 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])); a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
} }
for (i=I_LAENSWORD;i!=I_DRACHENBLUT;++i) { for (i=I_LAENSWORD;i!=I_DRACHENBLUT;++i) {

View File

@ -1,6 +1,29 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<resources> <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 --> <!-- XE items -->
<resource name="skillpotion"> <resource name="skillpotion">
<!-- gives user one free learning attempt --> <!-- gives user one free learning attempt -->