summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-04 10:08:24 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-07 08:40:36 +0200
commitdcbbee03550116ef26720ccabf543efb15b965a6 (patch)
tree5dda9bf174022463a5a451846a5f0fdac070519f /crawl-ref/source
parentbca0a29a7910c1ee917e90084e308eef70e121e8 (diff)
downloadcrawl-ref-dcbbee03550116ef26720ccabf543efb15b965a6.tar.gz
crawl-ref-dcbbee03550116ef26720ccabf543efb15b965a6.zip
Enable monsters to drink potions of might.
This adds new beam and enchantment types, so probably breaks save compatibility.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/beam.cc15
-rw-r--r--crawl-ref/source/directn.cc4
-rw-r--r--crawl-ref/source/enum.h46
-rw-r--r--crawl-ref/source/fight.cc5
-rw-r--r--crawl-ref/source/item_use.cc1
-rw-r--r--crawl-ref/source/mon-util.cc21
-rw-r--r--crawl-ref/source/mstuff2.cc1
-rw-r--r--crawl-ref/source/religion.cc6
8 files changed, 70 insertions, 29 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index b02b0cd372..5974d3433a 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1393,6 +1393,7 @@ static beam_type _chaos_beam_flavour()
10, BEAM_NAPALM,
10, BEAM_SLOW,
10, BEAM_HASTE,
+ 10, BEAM_MIGHT,
10, BEAM_HEALING,
10, BEAM_PARALYSIS,
10, BEAM_CONFUSION,
@@ -4824,6 +4825,7 @@ bool bolt::has_saving_throw() const
switch (flavour)
{
case BEAM_HASTE:
+ case BEAM_MIGHT:
case BEAM_HEALING:
case BEAM_INVISIBILITY:
case BEAM_DISPEL_UNDEAD:
@@ -5180,6 +5182,18 @@ mon_resist_type bolt::apply_enchantment_to_monster(monsters* mon)
}
return (MON_AFFECTED);
+ case BEAM_MIGHT:
+ if (!mon->has_ench(ENCH_MIGHT)
+ && !mons_is_stationary(mon)
+ && mon->add_ench(ENCH_MIGHT))
+ {
+ if (simple_monster_message(mon, " seems to grow stronger."))
+ {
+ obvious_effect = true;
+ }
+ }
+ return (MON_AFFECTED);
+
case BEAM_HEALING:
if (YOU_KILL(thrower))
{
@@ -5967,6 +5981,7 @@ std::string beam_type_name(beam_type type)
case BEAM_CHAOS: return("chaos");
case BEAM_SLOW: return("slow");
case BEAM_HASTE: return("haste");
+ case BEAM_MIGHT: return("might");
case BEAM_HEALING: return("healing");
case BEAM_PARALYSIS: return("paralysis");
case BEAM_CONFUSION: return("confusion");
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index ed71bbebb1..6e5ce8f30b 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -3000,7 +3000,8 @@ static std::string _describe_mons_enchantment(const monsters &mons,
return "";
}
- if ((ench.ench == ENCH_HASTE || ench.ench == ENCH_BATTLE_FRENZY)
+ if ((ench.ench == ENCH_HASTE || ench.ench == ENCH_BATTLE_FRENZY
+ || ench.ench == ENCH_MIGHT)
&& mons.has_ench(ENCH_BERSERK))
{
return "";
@@ -3025,6 +3026,7 @@ static std::string _describe_mons_enchantment(const monsters &mons,
case ENCH_BERSERK: return "berserk";
case ENCH_BATTLE_FRENZY: return "consumed by blood-lust";
case ENCH_HASTE: return "moving very quickly";
+ case ENCH_MIGHT: return "unusually strong";
case ENCH_CONFUSION: return "bewildered and confused";
case ENCH_INVIS: return "slightly transparent";
case ENCH_CHARM: return "in your thrall";
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index c259776753..0b93720711 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -224,26 +224,27 @@ enum beam_type // beam[].flavour
BEAM_SLOW,
BEAM_FIRST_ENCHANTMENT = BEAM_SLOW,
BEAM_HASTE, // 25
+ BEAM_MIGHT,
BEAM_HEALING,
BEAM_PARALYSIS,
BEAM_CONFUSION,
- BEAM_INVISIBILITY,
- BEAM_DIGGING, // 30
+ BEAM_INVISIBILITY, // 30
+ BEAM_DIGGING,
BEAM_TELEPORT,
BEAM_POLYMORPH,
BEAM_CHARM,
- BEAM_BANISH,
- BEAM_DEGENERATE, // 35
+ BEAM_BANISH, // 35
+ BEAM_DEGENERATE,
BEAM_ENSLAVE_UNDEAD,
BEAM_ENSLAVE_SOUL,
BEAM_PAIN,
- BEAM_DISPEL_UNDEAD,
- BEAM_DISINTEGRATION, // 40
+ BEAM_DISPEL_UNDEAD, // 40
+ BEAM_DISINTEGRATION,
BEAM_ENSLAVE_DEMON,
BEAM_BLINK,
BEAM_PETRIFY,
- BEAM_BACKLIGHT,
- BEAM_PORKALATOR, // 45
+ BEAM_BACKLIGHT, // 45
+ BEAM_PORKALATOR,
BEAM_SLIME,
BEAM_SLEEP,
BEAM_LAST_ENCHANTMENT = BEAM_SLEEP,
@@ -1260,42 +1261,43 @@ enum enchant_type
ENCH_NONE = 0, // 0
ENCH_SLOW,
ENCH_HASTE,
+ ENCH_MIGHT,
ENCH_FEAR,
- ENCH_CONFUSION,
- ENCH_INVIS, // 5
+ ENCH_CONFUSION, // 5
+ ENCH_INVIS,
ENCH_POISON,
ENCH_BERSERK,
ENCH_ROT,
- ENCH_SUMMON,
- ENCH_ABJ, // 10
+ ENCH_SUMMON, // 10
+ ENCH_ABJ,
ENCH_BACKLIGHT,
ENCH_CHARM,
ENCH_STICKY_FLAME,
- ENCH_GLOWING_SHAPESHIFTER,
- ENCH_SHAPESHIFTER, // 15
+ ENCH_GLOWING_SHAPESHIFTER, // 15
+ ENCH_SHAPESHIFTER,
ENCH_TP,
ENCH_SLEEP_WARY,
ENCH_SUBMERGED,
- ENCH_SHORT_LIVED,
- ENCH_PARALYSIS, // 20
+ ENCH_SHORT_LIVED, // 20
+ ENCH_PARALYSIS,
ENCH_SICK,
ENCH_SLEEPY, // Monster can't wake until this wears off.
ENCH_FATIGUE, // Post-berserk fatigue.
- ENCH_HELD, // Caught in a net.
- ENCH_BATTLE_FRENZY, // 25 -- Monster is in a battle frenzy
+ ENCH_HELD, // 25 -- Caught in a net.
+ ENCH_BATTLE_FRENZY, // Monster is in a battle frenzy
ENCH_NEUTRAL,
ENCH_PETRIFYING,
ENCH_PETRIFIED,
- ENCH_LOWERED_MR,
- ENCH_SOUL_RIPE, // 30
+ ENCH_LOWERED_MR, // 30
+ ENCH_SOUL_RIPE,
ENCH_SLOWLY_DYING,
ENCH_EAT_ITEMS,
ENCH_AQUATIC_LAND, // Water monsters lose hp while on land.
- ENCH_SPORE_PRODUCTION,
+ ENCH_SPORE_PRODUCTION, // 35
// Update enchantment names in mon-util.cc when adding or removing
// enchantments.
- NUM_ENCHANTMENTS // 35
+ NUM_ENCHANTMENTS // 36
};
enum enchant_retval
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 41df7d43a2..5b6a56b6b2 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -4186,8 +4186,9 @@ int melee_attack::mons_calc_damage(const mon_attack_def &attk)
damage_max += attk.damage;
damage += 1 + random2(attk.damage);
- // Berserk monsters get bonus damage.
- if (attacker_as_monster()->has_ench(ENCH_BERSERK))
+ // Berserk/mighted/frenzied monsters get bonus damage.
+ if (attacker_as_monster()->has_ench(ENCH_BERSERK)
+ || attacker_as_monster()->has_ench(ENCH_MIGHT))
damage = damage * 3 / 2;
else if (attacker_as_monster()->has_ench(ENCH_BATTLE_FRENZY))
{
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index ff35c58065..f074ea20a0 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4770,6 +4770,7 @@ static void _vulnerability_scroll()
const enchant_type lost_enchantments[] = {
ENCH_SLOW,
ENCH_HASTE,
+ ENCH_MIGHT,
ENCH_FEAR,
ENCH_CONFUSION,
ENCH_INVIS,
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index cd317e0f1d..828f2fa2c1 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -6910,6 +6910,11 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet)
break;
+ case ENCH_MIGHT:
+ if (!quiet)
+ simple_monster_message(this, " no longer looks unusually strong.");
+ break;
+
case ENCH_SLOW:
if (!quiet)
simple_monster_message(this, " is no longer moving slowly.");
@@ -7214,7 +7219,7 @@ void monsters::timeout_enchantments(int levels)
{
case ENCH_POISON: case ENCH_ROT: case ENCH_BACKLIGHT:
case ENCH_STICKY_FLAME: case ENCH_ABJ: case ENCH_SHORT_LIVED:
- case ENCH_SLOW: case ENCH_HASTE: case ENCH_FEAR:
+ case ENCH_SLOW: case ENCH_HASTE: case ENCH_MIGHT: case ENCH_FEAR:
case ENCH_INVIS: case ENCH_CHARM: case ENCH_SLEEP_WARY:
case ENCH_SICK: case ENCH_SLEEPY: case ENCH_PARALYSIS:
case ENCH_PETRIFYING: case ENCH_PETRIFIED:
@@ -7349,6 +7354,7 @@ void monsters::apply_enchantment(const mon_enchant &me)
case ENCH_SLOW:
case ENCH_HASTE:
+ case ENCH_MIGHT:
case ENCH_FEAR:
case ENCH_PARALYSIS:
case ENCH_NEUTRAL:
@@ -8302,6 +8308,7 @@ bool monsters::can_drink_potion(potion_type ptype) const
case POT_BLOOD_COAGULATED:
return (mons_species() == MONS_VAMPIRE);
case POT_SPEED:
+ case POT_MIGHT:
case POT_INVISIBILITY:
// If there are any item using monsters that are permanently
// invisible, this might have to be restricted.
@@ -8330,6 +8337,8 @@ bool monsters::should_drink_potion(potion_type ptype) const
return (hit_points <= max_hit_points / 2);
case POT_SPEED:
return (!has_ench(ENCH_HASTE));
+ case POT_MIGHT:
+ return (!has_ench(ENCH_MIGHT) && foe_distance() <= 2);
case POT_INVISIBILITY:
// We're being nice: friendlies won't go invisible if the player
// won't be able to see them.
@@ -8392,6 +8401,11 @@ item_type_id_state_type monsters::drink_potion_effect(potion_type ptype)
ident = ID_KNOWN_TYPE;
break;
+ case POT_MIGHT:
+ if (enchant_monster_with_flavour(this, this, BEAM_MIGHT))
+ ident = ID_KNOWN_TYPE;
+ break;
+
default:
break;
}
@@ -8472,7 +8486,7 @@ void monsters::react_to_damage(int damage, beam_type flavour)
static const char *enchant_names[] =
{
- "none", "slow", "haste", "fear", "conf", "inv", "pois", "bers",
+ "none", "slow", "haste", "might", "fear", "conf", "inv", "pois", "bers",
"rot", "summon", "abj", "backlit", "charm", "fire",
"gloshifter", "shifter", "tp", "wary", "submerged",
"short-lived", "paralysis", "sick", "sleep", "fatigue", "held",
@@ -8578,8 +8592,7 @@ int mon_enchant::calc_duration(const monsters *mons,
switch (ench)
{
case ENCH_HASTE:
- cturn = 1000 / _mod_speed(25, mons->speed);
- break;
+ case ENCH_MIGHT:
case ENCH_INVIS:
cturn = 1000 / _mod_speed(25, mons->speed);
break;
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index 4ab60f55ee..7c07c0015a 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -2553,6 +2553,7 @@ bool orc_battle_cry(monsters *chief)
&& mons_aligned(boss_index, i)
&& mon->hit_dice < chief->hit_dice
&& !mon->has_ench(ENCH_BERSERK)
+ && !mon->has_ench(ENCH_MIGHT)
&& !mon->cannot_move()
&& !mon->confused()
&& chief->can_see(mon))
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index ae5f91fca3..5ca5c8ae88 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -8169,6 +8169,12 @@ int get_tension(god_type god, bool count_travelling)
exper /= 2;
}
+ if (mons->has_ench(ENCH_MIGHT))
+ {
+ exper *= 5;
+ exper /= 4;
+ }
+
if (mons->has_ench(ENCH_BERSERK))
exper *= 2;