removing more hardcoded items from the source.

This commit is contained in:
Enno Rehling 2006-07-12 22:14:16 +00:00
parent 4a74bfdf9d
commit aaf7443d53
4 changed files with 1098 additions and 1127 deletions

View File

@ -600,15 +600,6 @@ set_item(unit * u, item_t it, int value)
void use_birthdayamulet(region * r, unit * magician, int amount, struct order * ord);
enum {
IS_RESOURCE,
IS_PRODUCT,
IS_MAGIC,
/* wird für ZEIGE gebraucht */
IS_ITEM,
IS_RACE
};
/* t_item::flags */
#define FL_ITEM_CURSED (1<<0)
#define FL_ITEM_NOTLOST (1<<1)
@ -647,7 +638,7 @@ typedef struct t_item {
const char *name[4];
/* [0]: Einzahl für eigene; [1]: Mehrzahl für eigene;
* [2]: Einzahl für Fremde; [3]: Mehrzahl für Fremde */
item_t typ;
boolean is_resource;
skill_t skill;
int minskill;
int gewicht;
@ -661,107 +652,94 @@ static t_item itemdata[MAXITEMS] = {
* benutze_funktion; */
{ /* I_IRON */
{"Eisen", "Eisen", "Eisen", "Eisen"},
IS_RESOURCE, SK_MINING, 1, 500, 0, FL_ITEM_NOTLOST, NULL
true, SK_MINING, 1, 500, 0, FL_ITEM_NOTLOST, NULL
},
{ /* I_STONE */
{"Stein", "Steine", "Stein", "Steine"},
IS_RESOURCE, SK_QUARRYING, 1, 6000, 0, FL_ITEM_NOTLOST, NULL
true, SK_QUARRYING, 1, 6000, 0, FL_ITEM_NOTLOST, NULL
},
{ /* I_HORSE */
{"Pferd", "Pferde", "Pferd", "Pferde"},
IS_RESOURCE, SK_HORSE_TRAINING, 1, 5000, 0, FL_ITEM_MOUNT | FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG, NULL
true, SK_HORSE_TRAINING, 1, 5000, 0, FL_ITEM_MOUNT | FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG, NULL
},
{ /* I_AMULET_OF_HEALING */
{"Amulett der Heilung", "Amulette der Heilung", "Amulett", "Amulette"},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_AMULET_OF_TRUE_SEEING 22 */
{"Amulett des wahren Sehens", "Amulette des wahren Sehens", "Amulett",
"Amulette"},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_RING_OF_INVISIBILITY 24 */
{"Ring der Unsichtbarkeit", "Ringe der Unsichtbarkeit", "", ""},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_RING_OF_POWER 25 */
{"Ring der Macht", "Ringe der Macht", "", ""},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_DRAGONHEAD 33 */
{"Drachenkopf", "Drachenköpfe", "Drachenkopf", "Drachenköpfe"},
IS_MAGIC, NOSKILL, 0, 500, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_CHASTITY_BELT 34 */
{"Amulett der Keuschheit", "Amulette der Keuschheit",
"Amulett", "Amulette"},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_LAEN 41 */
{"Laen", "Laen", "Laen", "Laen"},
IS_RESOURCE, SK_MINING, 7, 200, 0, 0, NULL
},
{ /* I_DRACHENBLUT 59 */
{"Drachenblut", "Drachenblut", "Drachenblut", "Drachenblut"},
IS_MAGIC, NOSKILL, 0, 100, 0, 0, NULL
true, SK_MINING, 7, 200, 0, 0, NULL
},
{ /* I_FEENSTIEFEL 60 */
{"Feenstiefel", "Feenstiefel", "Feenstiefel", "Feenstiefel"},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_BIRTHDAYAMULET 69 */
{"Katzenamulett", "Katzenamulette", "Amulett", "Amulette"},
IS_MAGIC, NOSKILL, 0, 100, 0, 0, &use_birthdayamulet
0, NOSKILL, 0, 100, 0, 0, &use_birthdayamulet
},
{ /* I_PEGASUS 60 */
{"Pegasus", "Pegasi", "Pegasus", "Pegasi" },
IS_MAGIC, NOSKILL, 0, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL
0, NOSKILL, 0, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL
},
{ /* I_UNICORN 61 */
{"Elfenpferd", "Elfenpferde", "Elfenpferd", "Elfenpferde"},
IS_MAGIC, NOSKILL, 0, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL
0, NOSKILL, 0, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL
},
{ /* I_DOLPHIN 62 */
{"Delphin", "Delphine", "Delphin", "Delphine"},
IS_MAGIC, NOSKILL, 0, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL
0, NOSKILL, 0, 5000, 0, FL_ITEM_ANIMAL | FL_ITEM_NOTINBAG | FL_ITEM_NOTLOST, NULL
},
{ /* I_RING_OF_NIMBLEFINGER 64 */
{"Ring der flinken Finger", "Ringe der flinken Finger", "", ""},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_TROLLBELT 65 */
{"Gürtel der Trollstärke", "Gürtel der Trollstärke", "", ""},
IS_MAGIC, NOSKILL, 0, 0, 0, 0, NULL
0, NOSKILL, 0, 0, 0, 0, NULL
},
{ /* I_PRESSCARD 67 */
{"Akkredition des Xontormia-Expreß", "Akkreditionen des Xontormia-Expreß",
"Akkredition des Xontormia-Expreß", "Akkreditionen des Xontormia-Expreß"},
IS_MAGIC, NOSKILL, 0, 0, 0, FL_ITEM_CURSED, NULL
0, NOSKILL, 0, 0, 0, FL_ITEM_CURSED, NULL
},
{ /* I_AURAKULUM 69 */
{"Aurafocus", "Aurafocuse", "Amulett", "Amulette"},
IS_MAGIC, NOSKILL, 0, 100, 0, 0, NULL
},
{ /* I_SEASERPENTHEAD 70 */
{"Seeschlangenkopf", "Seeschlangenköpfe",
"Seeschlangenkopf", "Seeschlangenköpfe"},
IS_MAGIC, NOSKILL, 0, 500, 0, 0, NULL
0, NOSKILL, 0, 100, 0, 0, NULL
},
{ /* I_SPHERE_OF_INVISIBILITY */
{"Sphäre der Unsichtbarkeit", "Sphären der Unsichtbarkeit", "", ""},
IS_MAGIC, NOSKILL, 0, 100, 0, 0, NULL
0, NOSKILL, 0, 100, 0, 0, NULL
},
{ /* I_BAG_OF_HOLDING */
{"Zauberbeutel", "Zauberbeutel", "Zauberbeutel", "Zauberbeutel"},
IS_MAGIC, NOSKILL, 0, 100, 0, FL_ITEM_NOTINBAG|FL_ITEM_NOTLOST, NULL
0, NOSKILL, 0, 100, 0, FL_ITEM_NOTINBAG|FL_ITEM_NOTLOST, NULL
},
{ /* I_SACK_OF_CONSERVATION */
{"Magischer Kräuterbeutel", "Magische Kräuterbeutel", "", ""},
IS_MAGIC, NOSKILL, 0, 100, 0, 0, NULL
0, NOSKILL, 0, 100, 0, 0, NULL
},
{ /* I_TACTICCRYSTAL 71 */
{"Traumauge", "Traumaugen", "", ""},
IS_MAGIC, NOSKILL, 0, 100, 0, 0, &use_tacticcrystal
0, NOSKILL, 0, 100, 0, 0, &use_tacticcrystal
},
};
@ -871,7 +849,6 @@ init_olditems(void)
const char * appearance[2];
int weight = itemdata[i].gewicht;
int capacity = 0;
attrib * a;
item_type * itype;
if (itemdata[i].flags & FL_ITEM_CURSED) iflags |= ITF_CURSED;
@ -920,21 +897,16 @@ init_olditems(void)
if (itemdata[i].flags & FL_ITEM_MOUNT) itype->capacity = HORSECAPACITY;
}
/* itemdata::typ Analyse. IS_PRODUCT und IS_MAGIC sind so gut wie egal. */
switch (itemdata[i].typ) {
case IS_RESOURCE:
rtype->flags |= RTF_LIMITED;
a = a_add(&rtype->attribs, a_new(&at_resourcelimit));
{
if (itemdata[i].is_resource) {
attrib * a = a_add(&rtype->attribs, a_new(&at_resourcelimit));
resource_limit * rdata = (resource_limit*)a->data.v;
rtype->flags |= RTF_LIMITED;
if (i==I_HORSE) {
rdata->limit = limit_oldresource;
rdata->produce = produce_oldresource;
}
if (i==I_LAEN || i==I_IRON) rdata->guard |= GUARD_MINING;
}
break;
}
if (itemdata[i].benutze_funktion) {
itype->use = use_olditem;
}

View File

@ -262,10 +262,8 @@ enum {
I_AMULET_OF_TRUE_SEEING,
I_RING_OF_INVISIBILITY,
I_RING_OF_POWER,
I_DRAGONHEAD,
I_CHASTITY_BELT, /* bleibt */
I_LAEN,
I_DRACHENBLUT,
I_FEENSTIEFEL,
I_BIRTHDAYAMULET,
I_PEGASUS,
@ -275,7 +273,6 @@ enum {
I_TROLLBELT,
I_PRESSCARD,
I_AURAKULUM,
I_SEASERPENTHEAD,
I_SPHERE_OF_INVISIBILITY,
I_BAG_OF_HOLDING,
I_SACK_OF_CONSERVATION,
@ -293,10 +290,8 @@ enum {
R_AMULET_OF_TRUE_SEEING,
R_RING_OF_INVISIBILITY,
R_RING_OF_POWER,
R_DRAGONHEAD,
R_CHASTITY_BELT,
R_EOG,
R_DRACHENBLUT,
R_FEENSTIEFEL,
R_BIRTHDAYAMULET,
R_PEGASUS,
@ -306,7 +301,6 @@ enum {
R_TROLLBELT,
R_PRESSCARD,
R_AURAKULUM,
R_SEASERPENTHEAD,
R_SPHERE_OF_INVISIBILITY,
R_BAG_OF_HOLDING,
R_SACK_OF_CONSERVATION,

View File

@ -710,9 +710,6 @@ gm_addquest(const char * email, const char * name, short radius, unsigned int fl
for (i=0;i<=I_HORSE;++i) {
a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
}
for (i=I_LAEN;i!=I_DRACHENBLUT;++i) {
a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
}
/* one initial unit */
u = createunit(center, f, 1, new_race[RC_TEMPLATE]);
@ -775,10 +772,6 @@ gm_addfaction(const char * email, plane * p, region * r)
for (i=0;i<=I_HORSE;++i) {
a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
}
for (i=I_LAEN;i!=I_DRACHENBLUT;++i) {
a_add((attrib**)&a->data.v, make_atgmcreate(olditemtype[i]));
}
/* one initial unit */
u = createunit(r, f, 1, new_race[RC_TEMPLATE]);
u->irace = new_race[RC_GNOME];

View File

@ -1,6 +1,18 @@
<?xml version="1.0"?>
<resources>
<resource name="seaserpenthead">
<item weight="500" score="400"/>
</resource>
<resource name="dragonblood">
<item weight="100" score="100"/>
</resource>
<resource name="dragonhead">
<item weight="500" score="300"/>
</resource>
<resource name="seed" limited="yes">
<item weight="10" score="50">
<construction skill="herbalism" minskill="3" reqsize="1"/>