summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/abl-show.cc11
-rw-r--r--crawl-ref/source/beam.cc41
-rw-r--r--crawl-ref/source/effects.cc60
-rw-r--r--crawl-ref/source/effects.h2
-rw-r--r--crawl-ref/source/enum.h15
-rw-r--r--crawl-ref/source/religion.cc20
-rw-r--r--crawl-ref/source/spl-cast.cc3
-rw-r--r--crawl-ref/source/xom.cc6
8 files changed, 74 insertions, 84 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 447a72ee43..5e52268867 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -1503,15 +1503,8 @@ static bool _do_ability(const ability_def& abil)
break;
case ABIL_TSO_CLEANSING_FLAME:
- beam.range = 8;
- if (!spell_direction(spd, beam, DIR_NONE, TARG_ENEMY, beam.range))
- return (false);
-
- if (!zapping(ZAP_CLEANSING_FLAME, 20 + you.skills[SK_INVOCATIONS] * 6,
- beam, true))
- {
- return (false);
- }
+ cleansing_flame(10 + (you.skills[SK_INVOCATIONS] * 7) / 6,
+ CLEANSING_FLAME_INVOCATION);
exercise(SK_INVOCATIONS, 3 + random2(6));
break;
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 82da7982c1..f2f15b61b8 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -735,23 +735,6 @@ const zap_info zap_data[] = {
false
},
-
- {
- ZAP_CLEANSING_FLAME,
- "golden flame",
- 200,
- new calcdice_calculator<2, 20, 2, 3>,
- new tohit_calculator<150>,
- YELLOW,
- false,
- BEAM_HOLY,
- DCHAR_FIRED_ZAP,
- true,
- true,
- true
- },
-
-
{
ZAP_BONE_SHARDS,
"spray of bone shards",
@@ -786,7 +769,6 @@ const zap_info zap_data[] = {
false
},
-
{
ZAP_DEGENERATION,
"0",
@@ -802,7 +784,6 @@ const zap_info zap_data[] = {
false
},
-
{
ZAP_STING,
"sting",
@@ -818,7 +799,6 @@ const zap_info zap_data[] = {
false
},
-
{
ZAP_HELLFIRE,
"hellfire",
@@ -1287,7 +1267,6 @@ const zap_info zap_data[] = {
}
};
-
static void _zappy(zap_type z_type, int power, bolt &pbolt)
{
const zap_info* zinfo = NULL;
@@ -3811,8 +3790,8 @@ void bolt::affect_player()
return;
const bool engulfs = (is_explosion || is_big_cloud);
- mprf( "The %s %s you!",
- name.c_str(), (engulfs) ? "engulfs" : "hits" );
+ mprf("The %s %s you!",
+ name.c_str(), engulfs ? "engulfs" : "hits");
// FIXME: Lots of duplicated code here (compare handling of
// monsters)
@@ -3866,14 +3845,14 @@ void bolt::affect_player()
if (!engulfs
&& (flavour == BEAM_MISSILE || flavour == BEAM_MMISSILE))
{
- int blood = hurted/2; // assumes DVORP_PIERCING, factor: 0.5
+ int blood = hurted / 2; // assumes DVORP_PIERCING, factor: 0.5
if (blood > you.hp)
blood = you.hp;
bleed_onto_floor(you.pos(), -1, blood, true);
}
- hurted = check_your_resists( hurted, flavour );
+ hurted = check_your_resists(hurted, flavour);
if (flavour == BEAM_MIASMA && hurted > 0)
{
@@ -4505,7 +4484,7 @@ void bolt::affect_monster(monsters* mon)
{
mprf("The %s %s %s.",
name.c_str(),
- engulfs? "engulfs" : "hits",
+ engulfs ? "engulfs" : "hits",
player_monster_visible(mon) ?
mon->name(DESC_NOCAP_THE).c_str() : "something");
@@ -5053,16 +5032,6 @@ void bolt::refine_for_explosion()
flavour = BEAM_HELLFIRE;
}
- if (name == "golden flame")
- {
- seeMsg = "The flame explodes!";
- hearMsg = "You feel a deep, resonant explosion.";
-
- type = dchar_glyph(DCHAR_FIRED_BURST);
- flavour = BEAM_HOLY;
- ex_size = 2;
- }
-
if (name == "fireball")
{
seeMsg = "The fireball explodes!";
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 523c72da81..b51f8410d7 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -87,12 +87,10 @@ int holy_word_player(int pow, int caster)
aux = "Zin's holy word";
break;
- case HOLY_WORD_SHINING_ONE:
- aux = "The Shining One's holy word";
+ case HOLY_WORD_TSO:
+ aux = "the Shining One's holy word";
break;
}
-
- caster = HOLY_WORD_GENERIC;
}
ouch(hploss, caster,
@@ -208,8 +206,6 @@ int torment_player(int pow, int caster)
aux = "Xom's torment";
break;
}
-
- caster = TORMENT_GENERIC;
}
ouch(hploss, caster, (caster != TORMENT_GENERIC) ? KILLED_BY_MONSTER
@@ -275,8 +271,6 @@ void immolation(int caster, bool known)
const char *aux = "immolation";
bolt beam;
- // The scroll of immolation doesn't affect items.
- beam.affects_items = (caster != IMMOLATION_SCROLL);
if (caster < 0)
{
@@ -290,22 +284,58 @@ void immolation(int caster, bool known)
aux = "a fiery explosion";
break;
}
+ }
+
+ beam.flavour = BEAM_FIRE;
+ beam.type = dchar_glyph(DCHAR_FIRED_BURST);
+ beam.damage = dice_def(3, 10);
+ beam.target = you.pos();
+ beam.name = "fiery explosion";
+ beam.colour = RED;
+ beam.beam_source = NON_MONSTER;
+ beam.thrower = (caster == IMMOLATION_GENERIC) ? KILL_MISC : KILL_YOU;
+ beam.aux_source = aux;
+ beam.ex_size = 2;
+ beam.is_tracer = false;
+ beam.is_explosion = true;
+ beam.effect_known = known;
+ beam.affects_items = (caster != IMMOLATION_SCROLL);
- caster = IMMOLATION_GENERIC;
+ beam.explode();
+}
+
+void cleansing_flame(int pow, int caster)
+{
+ ASSERT(!crawl_state.arena);
+
+ const char *aux = "cleansing flame";
+
+ bolt beam;
+
+ if (caster < 0)
+ {
+ switch (caster)
+ {
+ case CLEANSING_FLAME_TSO:
+ aux = "the Shining One's cleansing flame";
+ break;
+ }
}
- beam.flavour = BEAM_FIRE;
+ beam.flavour = BEAM_HOLY;
beam.type = dchar_glyph(DCHAR_FIRED_BURST);
- beam.damage = dice_def(3, 10);
+ beam.damage = dice_def(2, pow);
beam.target = you.pos();
- beam.name = "fiery explosion";
- beam.colour = RED;
- beam.thrower = (caster == IMMOLATION_GENERIC) ? KILL_MISC : KILL_YOU;
+ beam.name = "golden flame";
+ beam.colour = YELLOW;
+ beam.thrower = (caster == CLEANSING_FLAME_GENERIC
+ || caster == CLEANSING_FLAME_TSO) ? KILL_MISC
+ : KILL_YOU;
+ beam.beam_source = NON_MONSTER;
beam.aux_source = aux;
beam.ex_size = 2;
beam.is_tracer = false;
beam.is_explosion = true;
- beam.effect_known = known;
beam.explode();
}
diff --git a/crawl-ref/source/effects.h b/crawl-ref/source/effects.h
index 0e2db7d125..e2c05fac02 100644
--- a/crawl-ref/source/effects.h
+++ b/crawl-ref/source/effects.h
@@ -114,6 +114,8 @@ int torment_monsters(coord_def where, int pow, int caster);
void immolation(int caster, bool known = false);
+void cleansing_flame(int pow, int caster);
+
// called from: debug
void change_labyrinth(bool msg = false);
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 0db2d35711..73809b4a37 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -399,10 +399,18 @@ enum char_set_type
CSET_ASCII, // flat 7-bit ASCII
CSET_IBM, // 8-bit ANSI/Code Page 437
CSET_DEC, // 8-bit DEC, 0xE0-0xFF shifted for line drawing chars
- CSET_UNICODE, // Unicode.
+ CSET_UNICODE, // Unicode
NUM_CSET
};
+enum cleansing_flame_source_type
+{
+ CLEANSING_FLAME_GENERIC = -1,
+ CLEANSING_FLAME_SPELL = -2, // SPELL_FLAME_OF_CLEANSING
+ CLEANSING_FLAME_INVOCATION = -3, // ABIL_TSO_CLEANSING_FLAME
+ CLEANSING_FLAME_TSO = -4 // TSO effect
+};
+
enum cloud_type
{
CLOUD_NONE,
@@ -1324,7 +1332,7 @@ enum holy_word_source_type
HOLY_WORD_SCROLL = -2,
HOLY_WORD_SPELL = -3, // SPELL_HOLY_WORD
HOLY_WORD_ZIN = -4, // Zin effect
- HOLY_WORD_SHINING_ONE = -5 // TSO effect
+ HOLY_WORD_TSO = -5 // TSO effect
};
enum hunger_state // you.hunger_state
@@ -1343,7 +1351,7 @@ enum immolation_source_type
{
IMMOLATION_GENERIC = -1,
IMMOLATION_SCROLL = -2,
- IMMOLATION_SPELL = -3
+ IMMOLATION_SPELL = -3 // effect when fixing fire brand
};
enum item_status_flag_type // per item flags: ie. ident status, cursed status
@@ -3032,7 +3040,6 @@ enum zap_type
ZAP_PAIN,
ZAP_STICKY_FLAME,
ZAP_DISPEL_UNDEAD,
- ZAP_CLEANSING_FLAME,
ZAP_BONE_SHARDS,
ZAP_BANISHMENT,
ZAP_DEGENERATION,
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index f1d350a261..2b2ad95b1b 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -5547,20 +5547,8 @@ static void _tso_blasts_cleansing_flame(const char *message)
simple_god_message(" blasts you with cleansing flame!",
GOD_SHINING_ONE);
- bolt beam;
- beam.beam_source = NON_MONSTER;
- beam.type = dchar_glyph(DCHAR_FIRED_BURST);
- beam.damage = calc_dice(2, 20 + (you.experience_level * 7) / 3);
- beam.flavour = BEAM_HOLY;
- beam.target = you.pos();
- beam.name = "golden flame";
- beam.colour = YELLOW;
- beam.thrower = KILL_MISC;
- beam.aux_source = "the Shining One's cleansing flame";
- beam.ex_size = 2;
- beam.is_tracer = false;
- beam.is_explosion = true;
- beam.explode();
+ cleansing_flame(20 + (you.experience_level * 7) / 3,
+ CLEANSING_FLAME_TSO);
}
}
@@ -5977,7 +5965,7 @@ static bool _bless_weapon( god_type god, brand_type brand, int colour )
if ( god == GOD_SHINING_ONE )
{
- holy_word(100, HOLY_WORD_SHINING_ONE, you.pos(), true);
+ holy_word(100, HOLY_WORD_TSO, you.pos(), true);
// Un-bloodify surrounding squares.
for (radius_iterator ri(you.pos(), 3, true, true); ri; ++ri)
@@ -7206,4 +7194,4 @@ static void _place_delayed_monsters()
_delayed_done_trigger_pos.clear();
_delayed_success.clear();
_delayed_failure.clear();
-} // _place_delayed_monsters()
+}
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index d80f0b5ec1..94fbf1db09 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -1352,8 +1352,7 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
break;
case SPELL_FLAME_OF_CLEANSING:
- if (!zapping(ZAP_CLEANSING_FLAME, powc, beam, true))
- return (SPRET_ABORT);
+ cleansing_flame(powc, CLEANSING_FLAME_SPELL);
break;
case SPELL_HOLY_WORD:
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index de3c69fa54..b6cf9f9300 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -1086,18 +1086,20 @@ static bool _xom_throw_divine_lightning()
god_speaks(GOD_XOM, "The area is suffused with divine lightning!");
bolt beam;
- beam.beam_source = NON_MONSTER;
+
+ beam.flavour = BEAM_ELECTRICITY;
beam.type = dchar_glyph(DCHAR_FIRED_BURST);
beam.damage = dice_def(3, 30);
- beam.flavour = BEAM_ELECTRICITY;
beam.target = you.pos();
beam.name = "blast of lightning";
beam.colour = LIGHTCYAN;
beam.thrower = KILL_MISC;
+ beam.beam_source = NON_MONSTER;
beam.aux_source = "Xom's lightning strike";
beam.ex_size = 2;
beam.is_tracer = false;
beam.is_explosion = true;
+
beam.explode();
if (you.attribute[ATTR_DIVINE_LIGHTNING_PROTECTION])