From b65917bb97ac05882e279e7fd1b25bffda8103bc Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 2 Oct 2005 21:11:17 +0000 Subject: [PATCH] removed I_SWORD and I_RUSTY_SWORD from the source. --- src/common/gamecode/monster.c | 39 +++++++++-------------- src/common/gamecode/randenc.c | 8 +---- src/common/gamecode/report.c | 19 ++++++----- src/common/items/weapons.c | 7 ---- src/common/kernel/item.c | 23 ++++++-------- src/common/kernel/item.h | 5 +-- src/res/equipment.xml | 60 +++++++++++++++++++++++++++++------ src/res/resources.xml | 24 ++++++++++++++ 8 files changed, 109 insertions(+), 76 deletions(-) diff --git a/src/common/gamecode/monster.c b/src/common/gamecode/monster.c index 80d3296c0..6c18e3715 100644 --- a/src/common/gamecode/monster.c +++ b/src/common/gamecode/monster.c @@ -38,6 +38,7 @@ /* kernel includes */ #include +#include #include #include #include @@ -793,42 +794,32 @@ recruit_dracoids(unit * dragon, int size) { faction * f = dragon->faction; region * r = dragon->region; - const struct item_type * weapon = NULL; - order * new_order; + const struct item * weapon = NULL; + order * new_order = NULL; unit *un = createunit(r, f, size, new_race[RC_DRACOID]); fset(un, UFL_ISNEW|UFL_MOVED); name_unit(un); change_money(dragon, -un->number * 50); + equip_unit(un, get_equipment("recruited_dracoid")); - set_level(un, SK_SPEAR, (3 + rand() % 4)); - set_level(un, SK_MELEE, (3 + rand() % 4)); - set_level(un, SK_LONGBOW, (2 + rand() % 3)); - - switch (rand() % 3) { - case 0: - weapon = olditemtype[I_LONGBOW]; - break; - case 1: - weapon = olditemtype[I_SWORD]; - break; - default: - weapon = olditemtype[I_SPEAR]; - break; + un->status = ST_FIGHT; + for (weapon=un->items;weapon;weapon=weapon->next) { + const weapon_type * wtype = weapon->type->rtype->wtype; + if (wtype && (wtype->flags & WTF_MISSILE)) un->status = ST_BEHIND; + sprintf(buf, "%s \"%s\"", keywords[K_STUDY], + skillname(weapon->type->rtype->wtype->skill, f->locale)); + new_order = parse_order(buf, default_locale); } - i_change(&un->items, weapon, un->number); - if (weapon->rtype->wtype->flags & WTF_MISSILE) un->status = ST_BEHIND; - else un->status = ST_FIGHT; - sprintf(buf, "%s \"%s\"", keywords[K_STUDY], - skillname(weapon->rtype->wtype->skill, f->locale)); - new_order = parse_order(buf, default_locale); + if (new_order!=NULL) { #ifdef LASTORDER - set_order(&un->lastorder, new_order); + set_order(&un->lastorder, new_order); #else - addlist(&un->orders, new_order); + addlist(&un->orders, new_order); #endif + } } static order * diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index a7bd95ff5..3ec38ab7c 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -1435,13 +1435,7 @@ randomevents(void) u = createunit(r, findfaction(MONSTER_FACTION), undead, rc); fset(u, UFL_ISNEW|UFL_MOVED); if ((rc == new_race[RC_SKELETON] || rc == new_race[RC_ZOMBIE]) && rand()%10 < 4) { - set_item(u, I_RUSTY_SWORD, undead); - if (rand()%10 < 3) { - set_item(u, I_RUSTY_SHIELD, undead); - } - if (rand()%10 < 2) { - set_item(u, I_RUSTY_CHAIN_MAIL, undead); - } + equip_unit(u, get_equipment("rising_undead")); } for (i=0;i < MAXSKILLS;i++) { diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index b6134426d..2569efce4 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -3066,6 +3066,7 @@ make_summary(void) f = u->faction; if (u->faction->no != MONSTER_FACTION) { skill * sv; + item * itm; s->nunits++; s->playerpop += u->number; @@ -3075,16 +3076,14 @@ make_summary(void) s->spielerpferde += get_item(u, I_HORSE); s->playermoney += get_money(u); s->armed_men += armedmen(u); - s->waffen += get_item(u, I_SWORD); - s->waffen += get_item(u, I_SPEAR); - s->waffen += get_item(u, I_CATAPULT); - s->waffen += get_item(u, I_CROSSBOW); - s->waffen += get_item(u, I_LONGBOW); - s->waffen += get_item(u, I_RUNESWORD); - - s->ruestungen += get_item(u, I_CHAIN_MAIL); - s->ruestungen += get_item(u, I_PLATE_ARMOR); - + for (itm=u->items;itm;itm=itm->next) { + if (itm->type->rtype->wtype) { + s->waffen += itm->number; + } + if (itm->type->rtype->atype) { + 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); diff --git a/src/common/items/weapons.c b/src/common/items/weapons.c index 54bb05ef4..b1d4e88d8 100644 --- a/src/common/items/weapons.c +++ b/src/common/items/weapons.c @@ -60,11 +60,8 @@ enum { WP_CROSSBOW, WP_SPEAR, WP_GREATSWORD, - WP_SWORD, WP_LANCE, - WP_RUSTY_SWORD, WP_RUSTY_GREATSWORD, - WP_RUSTY_AXE, WP_RUSTY_HALBERD, WP_NONE, WP_MAX @@ -125,12 +122,8 @@ static weapondata weapontable[WP_MAX + 1] = {0.00, "1d10+0", "1d12+2", I_SPEAR, SK_SPEAR, 0, 0, false, false, { RL_NONE, 0}, PIERCE }, /* Zweihänder */ {0.00, "2d8+3", "2d8+3", I_GREATSWORD, SK_MELEE, -1, -2, false, false, { RL_NONE, 0}, CUT }, - /* Schwert */ - {0.00, "1d9+2", "1d9+2", I_SWORD, SK_MELEE, 0, 0, false, false, { RL_NONE, 0}, CUT }, /* Lanze */ {0.00, "1d5", "2d6+5", I_LANCE, SK_SPEAR, 0, -2, false, false, { RL_NONE, 0}, PIERCE }, - /* Rostiges Schwert */ - {0.00, "1d9", "1d9", I_RUSTY_SWORD, SK_MELEE, -1, -1, false, false, { RL_NONE, 0}, CUT }, /* Rostiger Zweihänder */ {0.00, "2d8", "2d8", I_RUSTY_GREATSWORD, SK_MELEE, -2, -3, false, false, { RL_NONE, 0}, CUT }, /* Rostige Hellebarde */ diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index a73748adb..f287fea8f 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -893,10 +893,6 @@ static t_item itemdata[MAXITEMS] = { {"Katapult", "Katapulte", "Katapult", "Katapulte"}, IS_PRODUCT, SK_CARTMAKER, 5, {0, 10, 0, 0, 0, 0}, 10000, 0, FL_ITEM_NOTINBAG, NULL }, - { /* I_SWORD */ - {"Schwert", "Schwerter", "Schwert", "Schwerter"}, - IS_PRODUCT, SK_WEAPONSMITH, 3, {1, 0, 0, 0, 0, 0}, 100, 0, 0, NULL - }, { /* I_SPEAR */ {"Speer", "Speere", "Speer", "Speere"}, IS_PRODUCT, SK_WEAPONSMITH, 2, {0, 1, 0, 0, 0, 0}, 100, 0, 0, NULL @@ -1094,10 +1090,6 @@ static t_item itemdata[MAXITEMS] = { {"Zauberbeutel", "Zauberbeutel", "Zauberbeutel", "Zauberbeutel"}, IS_MAGIC, 0, 0, {0, 0, 0, 0, 0, 0}, 100, 0, FL_ITEM_NOTINBAG|FL_ITEM_NOTLOST, NULL }, - { /* I_RUSTY_SWORD */ - {"Schartiges Schwert", "Schartige Schwerter", "Schartiges Schwert", "Schartige Schwerter"}, - IS_PRODUCT, SK_WEAPONSMITH, 3, {1, 0, 0, 0, 0, 0}, 100, 0, 0, NULL - }, { /* I_RUSTY_SHIELD 42 */ {"Rostiger Schild", "Rostige Schilde", "Rostiger Schild", "Rostige Schilde"}, IS_PRODUCT, SK_ARMORER, 2, {1, 0, 0, 0, 0, 0}, 100, 0, 0, NULL @@ -2094,7 +2086,14 @@ init_resources(void) static boolean initialized = false; if (initialized) return; initialized = true; - /* silver was never an item: */ + + /* alte typen registrieren: */ + init_olditems(); + init_oldherbs(); + init_oldpotions(); + init_oldscores(); + + /* silver was never an item: */ r_silver = new_resourcetype(&names[0], NULL, RTF_ITEM|RTF_POOLED); i_silver = new_itemtype(r_silver, ITF_NONE, 1/*weight*/, 0); r_silver->uchange = res_changeitem; @@ -2114,6 +2113,7 @@ init_resources(void) r_unit = new_resourcetype(&names[12], NULL, RTF_NONE); r_unit->uchange = res_changeperson; + oldresourcetype[R_SWORD] = rt_find("sword"); oldresourcetype[R_SILVER] = r_silver; oldresourcetype[R_AURA] = r_aura; oldresourcetype[R_PERMAURA] = r_permaura; @@ -2121,11 +2121,6 @@ init_resources(void) oldresourcetype[R_PEASANTS] = r_peasants; oldresourcetype[R_UNIT] = r_unit; - /* alte typen registrieren: */ - init_olditems(); - init_oldherbs(); - init_oldpotions(); - init_oldscores(); } int diff --git a/src/common/kernel/item.h b/src/common/kernel/item.h index 4ff7f8663..2cc027b28 100644 --- a/src/common/kernel/item.h +++ b/src/common/kernel/item.h @@ -282,7 +282,6 @@ enum { I_HORSE, I_WAGON, I_CATAPULT, - I_SWORD, I_SPEAR, I_CROSSBOW, I_LONGBOW, @@ -338,7 +337,6 @@ enum { I_RING_OF_REGENERATION, I_TOADSLIME, I_BAG_OF_HOLDING, - I_RUSTY_SWORD, I_RUSTY_SHIELD, I_RUSTY_CHAIN_MAIL, I_SACK_OF_CONSERVATION, @@ -356,7 +354,6 @@ enum { R_HORSE, R_WAGON, R_CATAPULT, - R_SWORD, R_SPEAR, R_CROSSBOW, R_LONGBOW, @@ -404,7 +401,6 @@ enum { R_RING_OF_REGENERATION, R_TOADSLIME, R_BAG_OF_HOLDING, - R_RUSTY_SWORD, R_RUSTY_SHIELD, R_RUSTY_CHAIN_MAIL, R_SACK_OF_CONSERVATION, @@ -462,6 +458,7 @@ enum { R_UNIT, /* Einheit (gib x einheit) */ + R_SWORD, /* for spells */ MAX_RESOURCES, /* do not use outside item.c ! */ NORESOURCE = (resource_t) - 1 diff --git a/src/res/equipment.xml b/src/res/equipment.xml index edb68ed31..0381fe0e8 100644 --- a/src/res/equipment.xml +++ b/src/res/equipment.xml @@ -92,7 +92,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -153,18 +153,58 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/res/resources.xml b/src/res/resources.xml index 3e335720f..44c7cf310 100644 --- a/src/res/resources.xml +++ b/src/res/resources.xml @@ -54,6 +54,30 @@ + + + + + + + + + + + + + + + + + + + + + + + +