summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-05-05 20:36:13 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-05 20:37:56 -0600
commit29148e68da590ce351902fc493e7b58a38bf7346 (patch)
tree702fc70fda67f495008e7c6adfbfdeaba3f4ee75 /crawl-ref
parent320abf6e435df7a6f2b5f4d475ca74adc65ea602 (diff)
downloadcrawl-ref-29148e68da590ce351902fc493e7b58a38bf7346.tar.gz
crawl-ref-29148e68da590ce351902fc493e7b58a38bf7346.zip
Hacks to get Hellfire working as intended.
About half of this code is to get the attack to show the flavour as "hellfire bolt". This could probably be redone by having the attack class have some kind of projectile name field.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/art-func.h3
-rw-r--r--crawl-ref/source/artefact.h2
-rw-r--r--crawl-ref/source/attack.cc16
-rw-r--r--crawl-ref/source/itemname.cc19
4 files changed, 36 insertions, 4 deletions
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h
index d8a642d40a..a636f31092 100644
--- a/crawl-ref/source/art-func.h
+++ b/crawl-ref/source/art-func.h
@@ -896,14 +896,15 @@ static setup_missile_type _HELLFIRE_launch(item_def* item, bolt* beam,
&& beam->item->base_type == OBJ_MISSILES
&& !is_artefact(*(beam->item)));
beam->item->special = SPMSL_EXPLODING; // so that it mulches
+ beam->item->props[HELLFIRE_BOLT_KEY].get_bool() = true;
- beam->flavour = BEAM_HELLFIRE;
beam->name = "hellfire bolt";
*ammo_name = "a hellfire bolt";
beam->colour = LIGHTRED;
beam->glyph = DCHAR_FIRED_ZAP;
bolt *expl = new bolt(*beam);
+ expl->flavour = BEAM_HELLFIRE;
expl->is_explosion = true;
expl->damage = dice_def(2, 5);
expl->name = "hellfire";
diff --git a/crawl-ref/source/artefact.h b/crawl-ref/source/artefact.h
index 4843ed515a..ad66e8d346 100644
--- a/crawl-ref/source/artefact.h
+++ b/crawl-ref/source/artefact.h
@@ -17,6 +17,8 @@ struct bolt;
#define ARTEFACT_NAME_KEY "artefact_name"
#define ARTEFACT_APPEAR_KEY "artefact_appearance"
+#define HELLFIRE_BOLT_KEY "hellfire_bolt"
+
enum unrand_flag_type
{
UNRAND_FLAG_NONE = 0x00,
diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc
index e2a3aa23db..0727a3e8a7 100644
--- a/crawl-ref/source/attack.cc
+++ b/crawl-ref/source/attack.cc
@@ -1915,6 +1915,22 @@ bool attack::apply_damage_brand(const char *what)
case SPWPN_ANTIMAGIC:
antimagic_affects_defender(damage_done);
break;
+
+ default:
+ if (using_weapon() && is_unrandom_artefact(*weapon)
+ && weapon->special == UNRAND_HELLFIRE)
+ {
+ calc_elemental_brand_damage(BEAM_HELLFIRE,
+ defender->is_monster()
+ ? defender->as_monster()->res_hellfire()
+ : 0,
+ defender->is_icy() ? "melt" : "burn",
+ what);
+ defender->expose_to_element(BEAM_HELLFIRE);
+ attacker->god_conduct(DID_UNHOLY, 2 + random2(3));
+ attacker->god_conduct(DID_FIRE, 10 + random2(5));
+ }
+ break;
}
if (damage_brand == SPWPN_CHAOS && brand != SPWPN_CHAOS && !ret
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 3cac5fb1ca..4f9975f966 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1230,6 +1230,9 @@ string ego_type_string(const item_def &item, bool terse)
else
return "";
case OBJ_MISSILES:
+ // HACKHACKHACK
+ if (item.props.exists(HELLFIRE_BOLT_KEY))
+ return "hellfire";
return _missile_brand_name(get_ammo_brand(item),
terse ? MBN_TERSE : MBN_BRAND);
default:
@@ -1381,8 +1384,13 @@ string item_def::name_aux(description_level_type desc, bool terse, bool ident,
{
special_missile_type brand = get_ammo_brand(*this);
- if (!terse && _missile_brand_is_prefix(brand))
- buff << _missile_brand_name(brand, MBN_NAME) << ' ';
+ if (!terse)
+ {
+ if (props.exists(HELLFIRE_BOLT_KEY))
+ buff << "hellfire ";
+ else if (_missile_brand_is_prefix(brand))
+ buff << _missile_brand_name(brand, MBN_NAME) << ' ';
+ }
buff << ammo_name(static_cast<missile_type>(item_typ));
@@ -1393,7 +1401,12 @@ string item_def::name_aux(description_level_type desc, bool terse, bool ident,
&& !basename && !qualname && !dbname)
{
if (terse)
- buff << " (" << _missile_brand_name(brand, MBN_TERSE) << ")";
+ {
+ if (props.exists(HELLFIRE_BOLT_KEY))
+ buff << " (hellfire)";
+ else
+ buff << " (" << _missile_brand_name(brand, MBN_TERSE) << ")";
+ }
else if (_missile_brand_is_postfix(brand))
buff << " of " << _missile_brand_name(brand, MBN_NAME);
}