Skip to content

Commit

Permalink
Remove the Deflect Missiles spell
Browse files Browse the repository at this point in the history
The RMsl spell was removed in 6993651,
and most of the arguments for its renewal also apply to DMsl. It's true
that it requires much more investment, but that also makes it much more
marginal: we carry around the code and design complexity of multiple
missile repulsion levels, and the notion of non-expiring "permabuff"
spells, for a spell that essentially duplicates an item property but
stronger, without it even being something that most characters will
have any opportunity or reason to learn.

After this commit, the design is crisper and easier to learn: there's
one level of missile repulsion and you get it from armour, gods, or
intrinsically; spells don't come into it.
  • Loading branch information
emilazy authored and ebering committed Apr 18, 2020
1 parent 53a3069 commit c449921
Show file tree
Hide file tree
Showing 35 changed files with 25 additions and 179 deletions.
2 changes: 1 addition & 1 deletion crawl-ref/docs/develop/levels/syntax.txt
Expand Up @@ -988,7 +988,7 @@ MONS: (list of monsters)
Setting enchantments:
---------------------
You may give a monster any number of enchantments. It may
start hasted, blind, have permanent DMsl, etc. The syntax is
start hasted, blind, have permanent RMsl, etc. The syntax is
"ench:<name>:<degree>:<duration>" or "perm_ench:<name>:<degree>".
The <degree> and <duration> fields may be omitted. Note that
the enchantment will start the moment the monster is created and
Expand Down
4 changes: 2 additions & 2 deletions crawl-ref/docs/options_guide.txt
Expand Up @@ -1205,9 +1205,9 @@ spell_slot ^= <regex>:<list of spell letters>
Examples:
* if you want Apportation to be placed on A:
spell_slot ^= Apportation:A
* if you want Deflect Missiles to be placed on r normally or R if
* if you want Ozocubu's Armour to be placed on r normally or R if
r is unavailable:
spell_slot ^= Deflect:rR
spell_slot ^= Ozocubu's Armour:rR
* if you want the first "Bolt" spell to be placed on a, even if
there is already a non-bolt spell there:
spell_slot ^= Bolt:+a
Expand Down
4 changes: 3 additions & 1 deletion crawl-ref/source/actor.h
Expand Up @@ -276,7 +276,9 @@ class actor
virtual int shield_bypass_ability(int tohit) const = 0;
virtual void shield_block_succeeded(actor *foe);
virtual int missile_deflection() const = 0; // 1 = RMsl, 2 = DMsl
virtual void ablate_deflection() = 0;
virtual void ablate_deflection()
{
}

// Combat-related virtual class methods
virtual int unadjusted_body_armour_penalty() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion crawl-ref/source/attribute-type.h
Expand Up @@ -63,8 +63,8 @@ enum attribute_type
ATTR_BARBS_POW, // How badly we are currently skewered
#if TAG_MAJOR_VERSION == 34
ATTR_REPEL_MISSILES, // Repel missiles active
#endif
ATTR_DEFLECT_MISSILES, // Deflect missiles active
#endif
ATTR_PORTAL_PROJECTILE, // Accuracy bonus during portal projectile
ATTR_GOD_WRATH_XP, // How much XP before our next god wrath check?
ATTR_GOD_WRATH_COUNT, // Number of stored retributions
Expand Down
2 changes: 0 additions & 2 deletions crawl-ref/source/book-data.h
Expand Up @@ -73,7 +73,6 @@ static const vector<spell_type> spellbook_templates[] =
SPELL_CAUSE_FEAR,
SPELL_VIOLENT_UNRAVELLING,
SPELL_SILENCE,
SPELL_DEFLECT_MISSILES,
SPELL_DISCORD,
},

Expand Down Expand Up @@ -186,7 +185,6 @@ static const vector<spell_type> spellbook_templates[] =
{ // Book of the Sky
SPELL_SUMMON_LIGHTNING_SPIRE,
SPELL_SILENCE,
SPELL_DEFLECT_MISSILES,
SPELL_CONJURE_BALL_LIGHTNING,
SPELL_TORNADO,
},
Expand Down
7 changes: 0 additions & 7 deletions crawl-ref/source/dat/descript/da/items.txt
Expand Up @@ -129,13 +129,6 @@ mener, at besværgelserne ikke funktionelt adskiller sig fra allerede kendte
udgaver, men bogen er fortsat populær for sit bizarre billedsprog og sine
kryptiske sidebemærkninger.
%%%%
book of enchantments

En grimoire, der indeholder et sortiment af magiske forbandelser og
fortryllelser, som glimter og glitrer, når man bladrer i den. Den bedårende
anakronistiske titel afspejler en tidligere, mere ufuldstændig forståelse af
disse to magiske skoler.
%%%%
book of fixed level

En bog med magiske besværgelser.
Expand Down
7 changes: 0 additions & 7 deletions crawl-ref/source/dat/descript/de/items.txt
Expand Up @@ -130,13 +130,6 @@ Zaubersprüche funktionell nicht anders als Einsen sind, die schon bekannt sind,
aber das Buch bleibt für seine einzig bizarre Bilder und kryptische
Abschweifungen interessant.
%%%%
book of enchantments

Ein Zauberbuch, das ein Sortiment von magischen Flüchen und Zaubern enthält,
die Funkeln und Schimmer als die Seiten zugeworfen wird. Der wunderlich
unzeitgemäße Titel reflektiert ein früheres, unvollständigeres geheimnisvolles
Verständnis dieser zwei Schulen von Zauberei.
%%%%
book of fixed level

Ein Buch mit Zaubersprüchen.
Expand Down
7 changes: 0 additions & 7 deletions crawl-ref/source/dat/descript/fi/items.txt
Expand Up @@ -115,13 +115,6 @@ käytännössä eroa mitenkään jo aiemmin tunnetuista loitsuista, mutta kirja
edelleen suosiossa sen ainutlaatuisen eriskummallisen kuvaston ja kryptisten
poikkeamien takia.
%%%%
book of enchantments

Tämä kirja sisältää valikoiman Manipulaatioita ja Lumouksia, ja sen sivut
kimaltelevat ja hohtavat käännettäessä. Epätavallisen aikaan sopimaton otsikko
kuvastaa aikaisempaa, epätäydellisempää ymmärrystä näistä kahdesta magian
koulukunnasta.
%%%%
book of fixed level

Taikoja sisältävä kirja.
Expand Down
7 changes: 0 additions & 7 deletions crawl-ref/source/dat/descript/fr/items.txt
Expand Up @@ -212,13 +212,6 @@ valoir que les sorts ne sont fonctionnellement pas différents de ceux déjà
connus, mais le livre reste populaire pour l'extraordinaire bizarrerie de son
imagerie et pour ses digressions cryptiques.
%%%%
book of enchantments

Un livre contenant un assortiment de Malédictions et de Charmes magiques qui
crépitent et chatoient lorsque les pages sont tournées; Le titre quelque peu
anachronique reflète une plus ancienne et incomplète compréhension de ces deux
écoles de magie.
%%%%
book of envenomations

Un livre de sorts qui brille d'une lumière verte. La première édition de ce
Expand Down
7 changes: 0 additions & 7 deletions crawl-ref/source/dat/descript/fr/spells.txt
Expand Up @@ -233,13 +233,6 @@ Debugging Ray spell

Un rayon provoquant des dégâts massif (1500 pv) et qui touche toujours.
%%%%
Deflect Missiles spell

Ce sort protège le sorcier de toutes attaques par projectiles, en les rendant
plus facile à esquiver. Ce sort est extrêmement efficace contre les attaques
mono-cible et pénétrantes. Chaque fois qu'un projectile est dévié, le sort
risque d'expirer avec des chances plus faibles à haute puissance.
%%%%
Dig spell

Ce sort forme des tunnels au travers la pierre brute.
Expand Down
4 changes: 2 additions & 2 deletions crawl-ref/source/dat/descript/items.txt
Expand Up @@ -169,8 +169,8 @@ and cryptic digressions to describe spells drawn from the mystic's visions.
%%%%
book of enchantments

A spellbook containing an assortment of powerful Hexes and Charms, which
sparkles and shimmers as the pages are flipped.
A spellbook containing an assortment of powerful Hexes, which sparkles and
shimmers as the pages are flipped.
%%%%
book of fire

Expand Down
6 changes: 0 additions & 6 deletions crawl-ref/source/dat/descript/ja/items.txt
Expand Up @@ -118,12 +118,6 @@ book of dreams
これらの呪文は機能的にはすでに知られているものと違いはないと主張する。しかし、
この本はその比類なき奇妙な描写や謎めいた余談のため、依然として人気がある。
%%%%
book of enchantments

これはページがめくれるとかすかに輝く、呪術と秘術を詰め合わせた呪文書だ。
奇妙で時代遅れの表題は、
古い時代に2つの魔法領域が不完全で不可解な理解であったことを反映している。
%%%%
book of fixed level

これは魔法の呪文書だ。
Expand Down
6 changes: 0 additions & 6 deletions crawl-ref/source/dat/descript/ko/items.txt
Expand Up @@ -124,12 +124,6 @@ book of dreams
다를 게 없다고 주장하지만, 책에 그려진 굉장히 기묘한 그림들과 수수께끼 같은
여담 덕분에 사람들 사이에서 유명하다.
%%%%
book of enchantments

책장을 넘길 때마다 반짝거리며 빛이 나는, 저주술과 매혹술에 대한 종합서적이다.
이 시대착오적인 제목은, 저주술과 매혹술에 대한 불완전한 예전의 마법적 이해를
상징한다.
%%%%
book of fixed level

평범한 마법책이다.
Expand Down
7 changes: 0 additions & 7 deletions crawl-ref/source/dat/descript/spells.txt
Expand Up @@ -406,13 +406,6 @@ Debugging Ray spell

Fires a ray which does massive damage (1500 hp) and always hits.
%%%%
Deflect Missiles spell

Protects the caster from all kinds of projectile attacks, making them
significantly easier to dodge. It is highly effective against both
single-target and penetrating attacks. Each time a missile is deflected the
spell has a chance of expiring, with a lower chance of expiry at high power.
%%%%
Dig spell

Digs a tunnel through unworked rock.
Expand Down
5 changes: 0 additions & 5 deletions crawl-ref/source/dat/descript/status.txt
Expand Up @@ -59,11 +59,6 @@ RMsl status

You repel missiles, improving your chance to evade them.
%%%%
DMsl status

You deflect missiles, greatly improving your chance to evade them. This effect
has a chance to expire with every projectile it deflects.
%%%%
Touch status

Your attacks deal no damage, but have a chance of confusing monsters that they
Expand Down
5 changes: 0 additions & 5 deletions crawl-ref/source/dat/descript/zh/items.txt
Expand Up @@ -95,11 +95,6 @@ book of dreams
虽然有些人批评说本书中收录的法术与已知的法术并无本质区别,
本书奇特的文风与不拘一格的奇思妙想还是吸引了很多读者。
%%%%
book of enchantments

本书中收录了一些妖术系和附魔系的法术。翻动的时候书页会发光,还会有小火花出现。
本书的标题放在这个时代显得格格不入,这也反映了古代法师们对这两个学派的不了解。
%%%%
book of fixed level

一本魔法书。
Expand Down
11 changes: 3 additions & 8 deletions crawl-ref/source/mon-cast.cc
Expand Up @@ -1864,7 +1864,9 @@ bool setup_mons_cast(const monster* mons, bolt &pbolt, spell_type spell_cast,
case SPELL_SIREN_SONG:
case SPELL_AVATAR_SONG:
case SPELL_REPEL_MISSILES:
#if TAG_MAJOR_VERSION == 34
case SPELL_DEFLECT_MISSILES:
#endif
case SPELL_SUMMON_SCARABS:
#if TAG_MAJOR_VERSION == 34
case SPELL_HUNTING_CRY:
Expand Down Expand Up @@ -6645,11 +6647,6 @@ void mons_cast(monster* mons, bolt pbolt, spell_type spell_cast,
mons->add_ench(mon_enchant(ENCH_REPEL_MISSILES));
return;

case SPELL_DEFLECT_MISSILES:
simple_monster_message(*mons, " begins deflecting missiles!");
mons->add_ench(mon_enchant(ENCH_DEFLECT_MISSILES));
return;

case SPELL_SUMMON_SCARABS:
{
const int num_scarabs = 1 + random2(mons->spell_hd(spell_cast) / 5 + 1);
Expand Down Expand Up @@ -7939,9 +7936,6 @@ static bool _ms_waste_of_time(monster* mon, mon_spell_slot slot)
case SPELL_REPEL_MISSILES:
return mon->has_ench(ENCH_REPEL_MISSILES);

case SPELL_DEFLECT_MISSILES:
return mon->has_ench(ENCH_DEFLECT_MISSILES);

case SPELL_CONFUSION_GAZE:
return !foe || !mon->can_see(*foe);

Expand Down Expand Up @@ -8031,6 +8025,7 @@ static bool _ms_waste_of_time(monster* mon, mon_spell_slot slot)
case SPELL_CONTROL_UNDEAD:
case SPELL_DAZZLING_FLASH:
case SPELL_REGENERATION:
case SPELL_DEFLECT_MISSILES:
#endif
case SPELL_NO_SPELL:
return true;
Expand Down
7 changes: 1 addition & 6 deletions crawl-ref/source/mon-ench.cc
Expand Up @@ -935,11 +935,6 @@ void monster::remove_enchantment_effect(const mon_enchant &me, bool quiet)
simple_monster_message(*this, " is no longer repelling missiles.");
break;

case ENCH_DEFLECT_MISSILES:
if (!quiet)
simple_monster_message(*this, " is no longer deflecting missiles.");
break;

case ENCH_RESISTANCE:
if (!quiet)
simple_monster_message(*this, " is no longer unusually resistant.");
Expand Down Expand Up @@ -2032,8 +2027,8 @@ static const char *enchant_names[] =
#endif
"sap magic", "shroud", "phantom_mirror", "bribed", "permabribed",
"corrosion", "gold_lust", "drained", "repel missiles",
"deflect missiles",
#if TAG_MAJOR_VERSION == 34
"deflect missiles",
"negative_vuln", "condensation_shield",
#endif
"resistant", "hexed", "corpse_armour",
Expand Down
3 changes: 0 additions & 3 deletions crawl-ref/source/mon-info.cc
Expand Up @@ -96,7 +96,6 @@ static map<enchant_type, monster_info_flags> trivial_ench_mb_mappings = {
{ ENCH_SHROUD, MB_SHROUD },
{ ENCH_CORROSION, MB_CORROSION },
{ ENCH_REPEL_MISSILES, MB_REPEL_MSL },
{ ENCH_DEFLECT_MISSILES, MB_DEFLECT_MSL },
{ ENCH_RESISTANCE, MB_RESISTANCE },
{ ENCH_HEXED, MB_HEXED },
{ ENCH_BRILLIANCE_AURA, MB_BRILLIANCE_AURA },
Expand Down Expand Up @@ -1432,8 +1431,6 @@ vector<string> monster_info::attributes() const
v.emplace_back("paralysed");
if (is(MB_REPEL_MSL))
v.emplace_back("repelling missiles");
if (is(MB_DEFLECT_MSL))
v.emplace_back("deflecting missiles");
if (is(MB_FEAR_INSPIRING))
v.emplace_back("inspiring fear");
if (is(MB_BREATH_WEAPON))
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/mon-info.h
Expand Up @@ -59,7 +59,6 @@ enum monster_info_flags
#if TAG_MAJOR_VERSION == 34
MB_BLEEDING,
#endif
MB_DEFLECT_MSL,
#if TAG_MAJOR_VERSION == 34
MB_PREP_RESURRECT,
#endif
Expand Down
3 changes: 0 additions & 3 deletions crawl-ref/source/mon-place.cc
Expand Up @@ -1253,9 +1253,6 @@ static monster* _place_monster_aux(const mgen_data &mg, const monster *leader,
if (mon->has_spell(SPELL_REPEL_MISSILES))
mon->add_ench(ENCH_REPEL_MISSILES);

if (mon->has_spell(SPELL_DEFLECT_MISSILES))
mon->add_ench(ENCH_DEFLECT_MISSILES);

mon->flags |= MF_JUST_SUMMONED;

// Don't leave shifters in their starting shape.
Expand Down
8 changes: 4 additions & 4 deletions crawl-ref/source/mon-spell.h
Expand Up @@ -339,7 +339,7 @@ static const mon_spellbook mspell_list[] =
{
{ SPELL_LIGHTNING_BOLT, 16, MON_SPELL_WIZARD },
{ SPELL_AIRSTRIKE, 32, MON_SPELL_WIZARD },
{ SPELL_DEFLECT_MISSILES, 16, MON_SPELL_WIZARD },
{ SPELL_REPEL_MISSILES, 16, MON_SPELL_WIZARD },
}
},

Expand All @@ -360,7 +360,7 @@ static const mon_spellbook mspell_list[] =
{
{ SPELL_WIND_BLAST, 50, MON_SPELL_NATURAL | MON_SPELL_BREATH },
{ SPELL_AIRSTRIKE, 29, MON_SPELL_NATURAL },
{ SPELL_DEFLECT_MISSILES, 29, MON_SPELL_NATURAL },
{ SPELL_REPEL_MISSILES, 29, MON_SPELL_NATURAL },
}
},

Expand Down Expand Up @@ -1762,7 +1762,7 @@ static const mon_spellbook mspell_list[] =
{ SPELL_MASS_CONFUSION, 11, MON_SPELL_WIZARD },
{ SPELL_STRIP_RESISTANCE, 11, MON_SPELL_WIZARD },
{ SPELL_HASTE, 11, MON_SPELL_WIZARD },
{ SPELL_DEFLECT_MISSILES, 11, MON_SPELL_WIZARD },
{ SPELL_REPEL_MISSILES, 11, MON_SPELL_WIZARD },
{ SPELL_INVISIBILITY, 11, MON_SPELL_WIZARD | MON_SPELL_EMERGENCY },
}
},
Expand Down Expand Up @@ -1967,7 +1967,7 @@ static const mon_spellbook mspell_list[] =
{ SPELL_LIGHTNING_BOLT, 14, MON_SPELL_WIZARD },
{ SPELL_AIRSTRIKE, 14, MON_SPELL_WIZARD },
{ SPELL_AIR_ELEMENTALS, 14, MON_SPELL_WIZARD },
{ SPELL_DEFLECT_MISSILES, 14, MON_SPELL_WIZARD },
{ SPELL_REPEL_MISSILES, 14, MON_SPELL_WIZARD },
}
},

Expand Down
12 changes: 2 additions & 10 deletions crawl-ref/source/monster.cc
Expand Up @@ -3174,23 +3174,15 @@ int monster::shield_bypass_ability(int) const

int monster::missile_deflection() const
{
if (has_ench(ENCH_DEFLECT_MISSILES))
return 2;
else if (has_ench(ENCH_REPEL_MISSILES) || scan_artefacts(ARTP_RMSL))
if (has_ench(ENCH_REPEL_MISSILES) || scan_artefacts(ARTP_RMSL))
return 1;
else
return 0;
}

void monster::ablate_deflection()
{
// TODO: deduplicate this code
if (has_ench(ENCH_DEFLECT_MISSILES))
{
if (one_chance_in(2 + spell_hd()))
del_ench(ENCH_DEFLECT_MISSILES);
}
else if (has_ench(ENCH_REPEL_MISSILES))
if (has_ench(ENCH_REPEL_MISSILES))
{
if (one_chance_in(2 + spell_hd()))
del_ench(ENCH_REPEL_MISSILES);
Expand Down
16 changes: 0 additions & 16 deletions crawl-ref/source/player.cc
Expand Up @@ -5613,9 +5613,6 @@ void player::shield_block_succeeded(actor *foe)

int player::missile_deflection() const
{
if (attribute[ATTR_DEFLECT_MISSILES])
return 2;

if (get_mutation_level(MUT_DISTORTION_FIELD) == 3
|| you.wearing_ego(EQ_ALL_ARMOUR, SPARM_REPULSION)
|| scan_artefacts(ARTP_RMSL, true)
Expand All @@ -5627,19 +5624,6 @@ int player::missile_deflection() const
return 0;
}

void player::ablate_deflection()
{
if (attribute[ATTR_DEFLECT_MISSILES])
{
const int power = calc_spell_power(SPELL_DEFLECT_MISSILES, true);
if (one_chance_in(2 + power / 8))
{
attribute[ATTR_DEFLECT_MISSILES] = 0;
mprf(MSGCH_DURATION, "You feel less protected from missiles.");
}
}
}

/**
* What's the base value of the penalties the player receives from their
* body armour?
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/player.h
Expand Up @@ -834,7 +834,6 @@ class player : public actor
int shield_bypass_ability(int tohit) const override;
void shield_block_succeeded(actor *foe) override;
int missile_deflection() const override;
void ablate_deflection() override;

// Combat-related adjusted penalty calculation methods
int unadjusted_body_armour_penalty() const override;
Expand Down

0 comments on commit c449921

Please sign in to comment.