[Hide Content]From 58abac7b728be1fb5a2867cb8d3640947a259ad4 Mon Sep 17 00:00:00 2001
From: Sage <SageBasilMint@gmail.com>
Date: Wed, 22 Jan 2014 03:35:40 +0000
Subject: [PATCH] Change Finisher to blow up and make spectrals out of
creatures it kills.
---
crawl-ref/source/art-data.txt | 2 ++
crawl-ref/source/art-func.h | 9 +++++++++
crawl-ref/source/describe.cc | 2 ++
crawl-ref/source/enum.h | 1 +
crawl-ref/source/mon-stuff.cc | 4 +++-
crawl-ref/source/util/art-data.pl | 3 ++-
crawl-ref/source/wiz-item.cc | 4 ++++
7 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/crawl-ref/source/art-data.txt b/crawl-ref/source/art-data.txt
index aad30e0..6008afa 100644
--- a/crawl-ref/source/art-data.txt
+++ b/crawl-ref/source/art-data.txt
@@ -384,6 +384,7 @@ BRAND: SPWPN_PAIN
INT: 5
MAGIC: 30
+ENUM: FINISHER
NAME: scythe "Finisher"
OBJ: OBJ_WEAPONS/WPN_SCYTHE
PLUS: +3/+5
@@ -392,6 +393,7 @@ TILE: urand_finisher
TILE_EQ: finisher
BRAND: SPWPN_SPEED
STR: 3
+BOOL: dchan
NAME: sling "Punk"
OBJ: OBJ_WEAPONS/WPN_SLING
diff --git a/crawl-ref/source/art-func.h b/crawl-ref/source/art-func.h
index e51887b..f8f5e59 100644
--- a/crawl-ref/source/art-func.h
+++ b/crawl-ref/source/art-func.h
@@ -931,3 +931,12 @@ static void _ELEMENTAL_STAFF_melee_effects(item_def* item, actor* attacker,
defender->name(DESC_THE).c_str());
defender->hurt(attacker, d);
}
+
+static void _FINISHER_melee_effects(item_def* item, actor* attacker,
+ actor* defender, bool mondied, int dam)
+{
+ if (defender->is_monster())
+ {
+ ((monster*)defender)->flags |= MF_EXPLODE_KILL;
+ }
+}
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index f38a2ac..85c1011 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -258,6 +258,7 @@ static vector<string> _randart_propnames(const item_def& item,
{ "Clar", ARTP_CLARITY, 2 },
{ "RMsl", ARTP_RMSL, 2 },
{ "Regen", ARTP_REGENERATION, 2 },
+ { "DChan", ARTP_DCHAN, 2 },
};
// For randart jewellery, note the base jewellery type if it's not
@@ -445,6 +446,7 @@ static string _randart_descrip(const item_def &item)
{ ARTP_RMSL, "It protects you from missiles.", false},
{ ARTP_FOG, "It can be evoked to emit clouds of fog.", false},
{ ARTP_REGENERATION, "It increases your rate of regeneration.", false},
+ { ARTP_DCHAN, "It claims the souls of its victims.", false},
};
for (unsigned i = 0; i < ARRAYSZ(propdescs); ++i)
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 953997e..2499f22 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -3220,6 +3220,7 @@ enum artefact_prop_type
ARTP_FOG,
#endif
ARTP_REGENERATION,
+ ARTP_DCHAN,
ARTP_NO_UPGRADE,
ARTP_NUM_PROPERTIES
};
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 4445198..c837d9d 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -2102,7 +2102,9 @@ int monster_die(monster* mons, killer_type killer,
bless_follower();
}
- if (you.duration[DUR_DEATH_CHANNEL] && gives_xp)
+ if ((you.duration[DUR_DEATH_CHANNEL]
+ || you.scan_artefacts(ARTP_DCHAN, true))
+ && gives_xp)
_make_spectral_thing(mons, !death_message);
break;
}
diff --git a/crawl-ref/source/util/art-data.pl b/crawl-ref/source/util/art-data.pl
index 15b7163..dddaedc 100755
--- a/crawl-ref/source/util/art-data.pl
+++ b/crawl-ref/source/util/art-data.pl
@@ -32,6 +32,7 @@ my %field_type = (
CORPSE_VIOLATING => "bool",
CURSED => "num",
DAM => "num",
+ DCHAN => "bool",
DEX => "num",
ELEC => "bool",
EV => "num",
@@ -485,7 +486,7 @@ my @art_order = (
"NOSPELL", "RND_TELE", "NOTELEP", "ANGRY", "METAB", "\n",
"MUTATE", "ACC", "DAM", "CURSED", "STEALTH", "MP", "\n",
"BASE_DELAY", "HP", "CLARITY", "BASE_ACC", "BASE_DAM", "\n",
- "RMSL", "FOG", "REGEN", "NO_UPGRADE", "\n",
+ "RMSL", "FOG", "REGEN", "DCHAN", "NO_UPGRADE", "\n",
"}",
"equip_func", "unequip_func", "world_reacts_func", "melee_effects_func",
diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc
index 3171bab..0da1ab8 100644
--- a/crawl-ref/source/wiz-item.cc
+++ b/crawl-ref/source/wiz-item.cc
@@ -285,6 +285,7 @@ static const char* _prop_name[] =
"+Fog",
#endif
"Regen",
+ "DChan",
"noupg",
};
@@ -336,6 +337,7 @@ static int8_t _prop_type[] =
ARTP_VAL_BOOL, //FOG
#endif
ARTP_VAL_ANY, //REGENERATION
+ ARTP_VAL_BOOL, //DCHAN
ARTP_VAL_BOOL, //NO_UPGRADE
};
@@ -1388,6 +1390,7 @@ static void _debug_rap_stats(FILE *ostat)
1, //ARTP_FOG
#endif
1, //ARTP_REGENERATION
+ 1, //ARTP_DCHAN
0, //ARTP_NO_UPGRADE
};
COMPILE_CHECK(ARRAYSZ(good_or_bad) == ARTP_NUM_PROPERTIES);
@@ -1543,6 +1546,7 @@ static void _debug_rap_stats(FILE *ostat)
"ARTP_FOG",
#endif
"ARTP_REGENERATION",
+ "ARTP_DCHAN",
"ARTP_NO_UPGRADE",
};
COMPILE_CHECK(ARRAYSZ(rap_names) == ARTP_NUM_PROPERTIES);
--
1.7.9.5