diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-12 14:39:38 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-12 14:39:38 +0000 |
commit | 1bff3c05ddd42eda0d5310b4d1f2671aae52815d (patch) | |
tree | f368dee0160428d811be9f91e403a5cdec83c3c8 /crawl-ref/source/player.cc | |
parent | a6faebe0c260af46518fa09ed6fce3992ce478a2 (diff) | |
download | crawl-ref-1bff3c05ddd42eda0d5310b4d1f2671aae52815d.tar.gz crawl-ref-1bff3c05ddd42eda0d5310b4d1f2671aae52815d.zip |
Implement the Petrify spell in a rather basic variant, and replace the
player spell "Paralyse" with it, i.e. not the wand/potion/misc. effects.
Petrify is a 4th level spell of the Enchantment/Transmigrations school
(a unique combination, I believe), all other values (incl. the level)
were shamelessly stolen from Paralysis.
Anyway, it consists of two elements (so I actually added TWO new
enchantments), Petrifying and Petrified.
A monster that is petrifying cannot move around but can perform actions
like hitting adjacent monsters or casting spells at a slowed rate (1.5
of the normal cost). Once this sub-enchantment runs out (happens faster)
the monster cannot move or act anymore, so it works like Paralysis. The
damage you do during stabbing is one third of what you'd do otherwise,
for both states of enchantment, and for both stabbing counts as
unchivalric behaviour.
It has not been implemented as a monster spell, and ghosts of characters
that had it will use Paralyse instead. Consequently, the effect on the
player (in self targetting) only handles the Petrified part.
Numbers, esp. enchantment timeout, will need tweaking. They're currently
Petrifying:
cturn = 50 / _mod_speed(10, mons->speed);
Petrified:
cturn = std::max(8, 150 / (1 + modded_speed(mons, 5)))
because I wanted the first to always run out faster than the second, but
at the same time make the ratio of Petrifying/Petrified tilt in favour
of the first for powerful monsters. The numbers are more or less made
up, and tested with different monsters in wizard mode. Still, could be
anything between too weak and overpowered, though the latter is more
likely.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5761 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 5bd01e2ff6..5434768742 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2234,7 +2234,7 @@ int player_evasion() int ev = 10 + 2 * size_factor; // Repulsion fields and size are all that matters when paralysed. - if (you.paralysed()) + if (you.cannot_move()) { ev = 2 + size_factor; if (player_mutation_level(MUT_REPULSION_FIELD) > 0) @@ -2611,18 +2611,18 @@ bool player_beheld_by( const monsters *mon ) return false; } -// removes a monster from the list of beholders -// if force == true (e.g. monster dead) or one of -// several cases is met +// Removes a monster from the list of beholders if force == true +// (e.g. monster dead) or one of several cases is met. void update_beholders(const monsters *mon, bool force) { - if (!player_beheld_by(mon)) // not in list? + if (!player_beheld_by(mon)) // Not in list? return; - // is an update even necessary? + // Is an update even necessary? if (force || !mons_near(mon) || mons_friendly(mon) || mon->submerged() - || mon->has_ench(ENCH_CONFUSION) || mons_is_paralysed(mon) || mon->asleep() - || silenced(you.x_pos, you.y_pos) || silenced(mon->x, mon->y)) + || mon->has_ench(ENCH_CONFUSION) || mons_cannot_move(mon) + || mon->asleep() || silenced(you.x_pos, you.y_pos) + || silenced(mon->x, mon->y)) { const std::vector<int> help = you.beheld_by; you.beheld_by.clear(); @@ -3875,9 +3875,11 @@ void display_char_status() if (you.duration[DUR_BEHELD]) mpr( "You are beheld." ); - // how exactly did you get to show the status? + // How exactly did you get to show the status? if (you.duration[DUR_PARALYSIS]) mpr( "You are paralysed." ); + if (you.duration[DUR_PETRIFIED]) + mpr( "You are petrified." ); if (you.duration[DUR_SLEEP]) mpr( "You are asleep." ); @@ -5346,7 +5348,7 @@ level_id actor::shaft_dest() const bool actor::airborne() const { - return (is_levitating() || (flight_mode() == FL_FLY && !paralysed())); + return (is_levitating() || (flight_mode() == FL_FLY && !cannot_move())); } bool actor::can_pass_through(int x, int y) const @@ -5770,7 +5772,7 @@ bool player::cannot_speak() const if (silenced(x_pos, y_pos)) return (true); - if (you.duration[DUR_PARALYSIS]) // we allow talking during sleep ;) + if (you.cannot_move()) // we allow talking during sleep ;) return (true); // No transform that prevents the player from speaking yet. @@ -6090,6 +6092,11 @@ bool player::paralysed() const return (duration[DUR_PARALYSIS]); } +bool player::cannot_move() const +{ + return (duration[DUR_PARALYSIS] || duration[DUR_PETRIFIED]); +} + bool player::confused() const { return (duration[DUR_CONF]); @@ -6409,6 +6416,20 @@ void player::paralyse(int str) paralysis = 13; } +void player::petrify(int str) +{ + int &petrif(duration[DUR_PETRIFIED]); + + mprf( "You %s the ability to move!", + petrif ? "still haven't" : "suddenly lose" ); + + if (str > petrif && (petrif < 3 || one_chance_in(petrif))) + petrif = str; + + if (petrif > 13) + petrif = 13; +} + void player::slow_down(int str) { ::slow_player( str ); @@ -6587,7 +6608,7 @@ bool player::asleep() const bool player::cannot_act() const { - return (asleep() || paralysed()); + return (asleep() || cannot_move()); } bool player::can_throw_rocks() const |