|
From: <gi...@cr...> - 2013-07-28 22:05:24
|
via 1cebcb06b4d110ab7306ff819c1bc0bc433dcac8 (commit)
via beff8de9a48da71fc033a37655b62a44bc0179ac (commit)
via 026feb9927ef49fd67d38e93b48ea727509e3e3a (commit)
via cb1013aeb5f06b8dec0304a751b2ce24250f765a (commit)
from 40d0fac4d07506d333b512350c2454f70454ac5a (commit)
-----------------------------------------------------------------------
commit 1cebcb06b4d110ab7306ff819c1bc0bc433dcac8
Author: Chris Campbell <chr...@gm...>
Date: Sun Jul 28 22:58:51 2013 +0100
Don't rebrand to brands that your god hates
commit beff8de9a48da71fc033a37655b62a44bc0179ac
Author: Chris Campbell <chr...@gm...>
Date: Sun Jul 28 22:39:02 2013 +0100
Increase vorpal brand damage to from 1/8 to 1/6 on average
Still weaker than elemental brands against non-resistant enemies, but
stronger against enemies with 1 level of resistance.
commit 026feb9927ef49fd67d38e93b48ea727509e3e3a
Author: Chris Campbell <chr...@gm...>
Date: Sun Jul 28 22:05:42 2013 +0100
Fix vorpalisation explosion colours being random
commit cb1013aeb5f06b8dec0304a751b2ce24250f765a
Author: Chris Campbell <chr...@gm...>
Date: Sun Jul 28 22:04:47 2013 +0100
Let vorpalise weapon rebrand weapons (argonaut)
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/dat/descript/items.txt | 7 +-
crawl-ref/source/item_use.cc | 124 +++++++++++++++++++++++++------
crawl-ref/source/melee_attack.cc | 2 +-
3 files changed, 106 insertions(+), 27 deletions(-)
diff --git a/crawl-ref/source/dat/descript/items.txt b/crawl-ref/source/dat/descript/items.txt
index 68ccfa9..c29c9ca 100644
--- a/crawl-ref/source/dat/descript/items.txt
+++ b/crawl-ref/source/dat/descript/items.txt
@@ -2374,10 +2374,9 @@ scroll of torment:quote
scroll of vorpalise weapon
This scroll enchants the wielded weapon so as to make it far more effective at
-inflicting harm on its wielder's enemies. Using it on a weapon already affected
-by some kind of permanent branding is not advised. On the other hand, the
-scroll can make permanent the temporary branding of weapons obtained from some
-spells.
+inflicting harm on its wielder's enemies. The scroll can make permanent the
+temporary branding of weapons obtained from some spells, or can be used on a
+weapon that is already permanently branded to randomly select a new brand.
Brands that are closely tied to one of the gods (Trog, Lugonu, Kikubaaqudgha,
the Shining One) cannot be affixed this way. Xom, on the other hand, wouldn't
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 4b6cd87..4af2692 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -42,6 +42,7 @@
#include "player-equip.h"
#include "player-stats.h"
#include "potion.h"
+#include "random.h"
#include "religion.h"
#include "shout.h"
#include "skills.h"
@@ -2327,7 +2328,7 @@ static bool _drink_fountain()
}
static void _explosion(coord_def where, actor *agent, beam_type flavour,
- string name, string cause)
+ int colour, string name, string cause)
{
bolt beam;
beam.is_explosion = true;
@@ -2339,12 +2340,77 @@ static void _explosion(coord_def where, actor *agent, beam_type flavour,
beam.damage = dice_def(5, 8);
beam.ex_size = 5;
beam.flavour = flavour;
+ beam.colour = colour;
beam.hit = AUTOMATIC_HIT;
beam.name = name;
beam.loudness = 10;
beam.explode(true, false);
}
+static void _rebrand_weapon(item_def& wpn)
+{
+ const int old_brand = get_weapon_brand(wpn);
+ int new_brand = old_brand;
+ const string itname = wpn.name(DESC_YOUR);
+
+ // you can't rebrand blessed weapons but trying will get you some cleansing flame
+ switch (wpn.sub_type)
+ {
+ case WPN_BLESSED_FALCHION:
+ case WPN_BLESSED_LONG_SWORD:
+ case WPN_BLESSED_SCIMITAR:
+ case WPN_EUDEMON_BLADE:
+ case WPN_BLESSED_DOUBLE_SWORD:
+ case WPN_BLESSED_GREAT_SWORD:
+ case WPN_BLESSED_TRIPLE_SWORD:
+ case WPN_SACRED_SCOURGE:
+ case WPN_TRISHULA:
+ return;
+ }
+
+ // now try and find an appropriate brand
+ while (old_brand == new_brand || god_hates_item(wpn))
+ {
+ if (is_range_weapon(wpn))
+ {
+ new_brand = random_choose_weighted(
+ 30, SPWPN_FLAME,
+ 30, SPWPN_FROST,
+ 20, SPWPN_VENOM,
+ 20, SPWPN_VORPAL,
+ 12, SPWPN_EVASION,
+ 5, SPWPN_ELECTROCUTION,
+ 3, SPWPN_CHAOS,
+ 0);
+ }
+ else
+ {
+ new_brand = random_choose_weighted(
+ 30, SPWPN_FLAMING,
+ 30, SPWPN_FREEZING,
+ 20, SPWPN_VENOM,
+ 15, SPWPN_DRAINING,
+ 15, SPWPN_VORPAL,
+ 15, SPWPN_ELECTROCUTION,
+ 12, SPWPN_PROTECTION,
+ 8, SPWPN_VAMPIRICISM,
+ 3, SPWPN_CHAOS,
+ 0);
+ }
+ set_item_ego_type(wpn, OBJ_WEAPONS, new_brand);
+ }
+
+ if (old_brand == SPWPN_DISTORTION)
+ {
+ // you can't get rid of distortion this easily
+ mprf("%s twongs alarmingly.", itname.c_str());
+
+ // from unwield_item
+ MiscastEffect(&you, NON_MONSTER, SPTYP_TRANSLOCATION, 9, 90,
+ "distortion unbrand");
+ }
+}
+
// Returns true if a message has already been printed (which will identify
// the scroll).
static bool _vorpalise_weapon(bool already_known)
@@ -2372,11 +2438,19 @@ static bool _vorpalise_weapon(bool already_known)
return true;
}
- // If there's a permanent brand, fail.
+ // If there's a permanent brand, try to rebrand it
+ bool rebranded = false;
if (you.duration[DUR_WEAPON_BRAND] == 0)
- return false;
+ {
+ rebranded = true;
+ _rebrand_weapon(wpn);
+ }
+
+ // Might be rebranding to/from protection or evasion.
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
- // There's a temporary brand, attempt to make it permanent.
+ // There's a temporary or new brand, attempt to make it permanent
const string itname = wpn.name(DESC_YOUR);
bool success = true;
bool msg = true;
@@ -2384,15 +2458,25 @@ static bool _vorpalise_weapon(bool already_known)
switch (get_weapon_brand(wpn))
{
case SPWPN_VORPAL:
- if (get_vorpal_type(wpn) != DVORP_CRUSHING)
- mprf("%s's sharpness seems more permanent.", itname.c_str());
- else
- mprf("%s's heaviness feels very stable.", itname.c_str());
+ case SPWPN_PROTECTION:
+ case SPWPN_EVASION:
+ if (rebranded)
+ {
+ alert_nearby_monsters();
+ mprf("%s emits a brilliant flash of light!",itname.c_str());
+ }
+ else // should be VORPAL only
+ {
+ if (get_vorpal_type(wpn) != DVORP_CRUSHING)
+ mprf("%s's sharpness seems more permanent.", itname.c_str());
+ else
+ mprf("%s's heaviness feels very stable.", itname.c_str());
+ }
break;
case SPWPN_FLAME:
case SPWPN_FLAMING:
- mprf("%s is engulfed in an explosion of flames!", itname.c_str());
+ mprf("%s is engulfed in an explosion of fire!", itname.c_str());
immolation(10, IMMOLATION_AFFIX, already_known);
break;
@@ -2406,29 +2490,26 @@ static bool _vorpalise_weapon(bool already_known)
success = false;
}
else
- mprf("%s is covered with a thick layer of frost!", itname.c_str());
+ mprf("%s is covered with a thin layer of ice!", itname.c_str());
break;
case SPWPN_DRAINING:
+ case SPWPN_VAMPIRICISM:
mprf("%s thirsts for the lives of mortals!", itname.c_str());
drain_exp(true, 100);
break;
case SPWPN_VENOM:
- if (cast_los_attack_spell(SPELL_OLGREBS_TOXIC_RADIANCE, 60,
- (already_known) ? &you : NULL, true)
- != SPRET_SUCCESS)
- {
- canned_msg(MSG_OK);
- success = false;
- }
+ if (rebranded)
+ mprf("%s drips with poison.", itname.c_str());
else
mprf("%s seems more permanently poisoned.", itname.c_str());
+ toxic_radiance_effect(&you, 1);
break;
case SPWPN_ELECTROCUTION:
mprf("%s releases a massive orb of lightning.", itname.c_str());
- _explosion(you.pos(), &you, BEAM_ELECTRICITY, "electricity",
+ _explosion(you.pos(), &you, BEAM_ELECTRICITY, LIGHTCYAN, "electricity",
"electrocution affixation");
break;
@@ -2437,8 +2518,7 @@ static bool _vorpalise_weapon(bool already_known)
// need to affix it immediately, otherwise transformation will break it
you.duration[DUR_WEAPON_BRAND] = 0;
xom_is_stimulated(200);
- // but the eruption _is_ guaranteed. What it will do is not.
- _explosion(you.pos(), &you, BEAM_CHAOS, "chaos eruption", "chaos affixation");
+ _explosion(you.pos(), &you, BEAM_CHAOS, BLACK, "chaos eruption", "chaos affixation");
switch (random2(coinflip() ? 2 : 4))
{
case 3:
@@ -2498,8 +2578,8 @@ static bool _vorpalise_weapon(bool already_known)
case SPWPN_HOLY_WRATH:
mprf("%s emits a blast of cleansing flame.", itname.c_str());
- _explosion(you.pos(), &you, BEAM_HOLY, "cleansing flame",
- "holy wrath affixation");
+ _explosion(you.pos(), &you, BEAM_HOLY, YELLOW, "cleansing flame",
+ rebranded ? "holy wrath rebrand" : "holy wrath affixation");
success = false;
break;
diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc
index f4d97ea..879df00 100644
--- a/crawl-ref/source/melee_attack.cc
+++ b/crawl-ref/source/melee_attack.cc
@@ -3261,7 +3261,7 @@ bool melee_attack::apply_damage_brand()
break;
case SPWPN_VORPAL:
- special_damage = 1 + random2(damage_done) / 4;
+ special_damage = 1 + random2(damage_done) / 3;
// Note: Leaving special_damage_message empty because there isn't one.
break;
--
Dungeon Crawl Stone Soup
|