summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/makeitem.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-22 23:45:08 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-22 23:45:08 +0000
commitfd8a1db3054ba396dcb149898891d739a06e4fac (patch)
tree5b1ff087345c2576eb2f281323addb2829bfe1c9 /crawl-ref/source/makeitem.cc
parent342644a1df21f8426a0786b114833342847784cd (diff)
downloadcrawl-ref-fd8a1db3054ba396dcb149898891d739a06e4fac.tar.gz
crawl-ref-fd8a1db3054ba396dcb149898891d739a06e4fac.zip
Implement another new unique, this time of my own coding: Maurice the thief.
Equipment: a cloak, a dagger or short sword, and some gold. Spells : Blink, Invisibility, Teleport Self Most importantly, in melee combat Maurice will try to steal items from the player. Due to technical limitations he can only steal item types monsters can carry and only if said item slot is still free. All applicable items get weighted by item value, and if nothing is applicable he will steal some gold instead. If even that isn't possible, he'll complain a bit and teleport away. Maurice is placed in the same depth as Gastronok. He's not actually hard (except for the occasional weapon brand or wand), but rather annoying. :p Stealing from monsters hasn't been implemented, and I don't think it's as interesting. Maurice is currently prevented from stealing items the player has equipped, though I'm considering allowing him to steal a wielded weapon, at least. The limitations of monsters' inventories means that Maurice will never attempt to steal armour (slot already filled) or jewellery (missing slot). Maybe we could try to force valuable items into inappropriate but rarely used slots, e.g. MSLOT_MISC. Other than in the FR (see 2838375) Maurice does not disappear from the level, so you can still hunt him down. He also doesn't get a crossbow or blowgun yet, though that's an interesting idea. However, handing out a secondary weapon would mean that he couldn't steal weapons either. Doesn't have a tile yet, and I have no image of him in my head either. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10776 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r--crawl-ref/source/makeitem.cc47
1 files changed, 35 insertions, 12 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 047dec0917..1ce351d738 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -3456,7 +3456,7 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
if (!melee_only && one_chance_in(9))
{
item.base_type = OBJ_WEAPONS;
- item.sub_type = WPN_CROSSBOW;
+ item.sub_type = WPN_CROSSBOW;
break;
}
// deliberate fall-through
@@ -3748,7 +3748,7 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
case MONS_AGNES:
item.base_type = OBJ_WEAPONS;
- item.sub_type = WPN_LAJATANG;
+ item.sub_type = WPN_LAJATANG;
if (!one_chance_in(3))
level = MAKE_GOOD_ITEM;
break;
@@ -3762,9 +3762,9 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
break;
}
force_item = true;
- item_race = MAKE_ITEM_NO_RACE;
+ item_race = MAKE_ITEM_NO_RACE;
item.base_type = OBJ_WEAPONS;
- item.sub_type = coinflip() ? WPN_DAGGER : WPN_SHORT_SWORD;
+ item.sub_type = coinflip() ? WPN_DAGGER : WPN_SHORT_SWORD;
set_item_ego_type(item, OBJ_WEAPONS,
random_choose_weighted(3, SPWPN_DISTORTION,
2, SPWPN_VENOM,
@@ -3772,10 +3772,16 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
0));
break;
+ case MONS_MAURICE:
+ item_race = MAKE_ITEM_NO_RACE;
+ item.base_type = OBJ_WEAPONS;
+ item.sub_type = coinflip() ? WPN_DAGGER : WPN_SHORT_SWORD;
+ break;
+
case MONS_EUSTACHIO:
item_race = MAKE_ITEM_NO_RACE;
item.base_type = OBJ_WEAPONS;
- item.sub_type = (one_chance_in(3) ? WPN_FALCHION : WPN_SABRE);
+ item.sub_type = (one_chance_in(3) ? WPN_FALCHION : WPN_SABRE);
break;
case MONS_CEREBOV:
@@ -4329,8 +4335,16 @@ void give_armour(monsters *mon, int level)
item.sub_type = ARM_WIZARD_HAT;
break;
+ case MONS_MAURICE:
+ item_race = MAKE_ITEM_NO_RACE;
+ item.base_type = OBJ_ARMOUR;
+ item.sub_type = ARM_CLOAK;
+ force_colour = DARKGREY;
+ break;
+
case MONS_DOWAN:
item_race = MAKE_ITEM_ELVEN;
+ // intentional fall-through
case MONS_DONALD:
case MONS_JESSICA:
case MONS_KOBOLD_DEMONOLOGIST:
@@ -4357,13 +4371,13 @@ void give_armour(monsters *mon, int level)
if (item_race == MAKE_ITEM_RANDOM_RACE)
item_race = MAKE_ITEM_NO_RACE;
item.base_type = OBJ_ARMOUR;
- item.sub_type = ARM_ROBE;
+ item.sub_type = ARM_ROBE;
break;
case MONS_TIAMAT:
item_race = MAKE_ITEM_NO_RACE;
item.base_type = OBJ_ARMOUR;
- item.sub_type = ARM_GOLD_DRAGON_ARMOUR;
+ item.sub_type = ARM_GOLD_DRAGON_ARMOUR;
break;
case MONS_ORC_WIZARD:
@@ -4371,7 +4385,7 @@ void give_armour(monsters *mon, int level)
case MONS_NERGALLE:
item_race = MAKE_ITEM_ORCISH;
item.base_type = OBJ_ARMOUR;
- item.sub_type = ARM_ROBE;
+ item.sub_type = ARM_ROBE;
break;
case MONS_BORIS:
@@ -4383,8 +4397,8 @@ void give_armour(monsters *mon, int level)
case MONS_NECROMANCER:
case MONS_VAMPIRE_MAGE:
item.base_type = OBJ_ARMOUR;
- item.sub_type = ARM_ROBE;
- force_colour = DARKGREY; //mv: always darkgrey
+ item.sub_type = ARM_ROBE;
+ force_colour = DARKGREY; //mv: always darkgrey
break;
case MONS_EUSTACHIO:
@@ -4396,8 +4410,8 @@ void give_armour(monsters *mon, int level)
case MONS_NESSOS:
item_race = MAKE_ITEM_NO_RACE;
item.base_type = OBJ_ARMOUR;
- item.sub_type = ARM_CENTAUR_BARDING;
- force_colour = DARKGREY;
+ item.sub_type = ARM_CENTAUR_BARDING;
+ force_colour = DARKGREY;
break;
default:
@@ -4427,10 +4441,19 @@ void give_armour(monsters *mon, int level)
mitm[thing_created].colour = force_colour;
}
+static void _give_gold(monsters *mon, int level)
+{
+ const int idx = items(0, OBJ_GOLD, 0, true, level, 0);
+ _give_monster_item(mon, idx);
+}
+
void give_item(int mid, int level_number, bool mons_summoned)
{
monsters *mons = &menv[mid];
+ if (mons->type == MONS_MAURICE)
+ _give_gold(mons, level_number);
+
_give_scroll(mons, level_number);
_give_wand(mons, level_number);
_give_potion(mons, level_number);