summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/delay.cc18
-rw-r--r--crawl-ref/source/enum.h14
-rw-r--r--crawl-ref/source/spells3.cc21
-rw-r--r--crawl-ref/source/spells4.cc33
-rw-r--r--crawl-ref/source/spells4.h2
5 files changed, 46 insertions, 42 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index ad79aca423..7726abc43e 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1161,7 +1161,7 @@ static void _finish_delay(const delay_queue_item &delay)
case DELAY_BUTCHER:
case DELAY_BOTTLE_BLOOD:
{
- const item_def &item = mitm[delay.parm1];
+ item_def &item = mitm[delay.parm1];
if (is_valid_item(item) && item.base_type == OBJ_CORPSES)
{
if (item.sub_type == CORPSE_SKELETON)
@@ -1183,12 +1183,10 @@ static void _finish_delay(const delay_queue_item &delay)
{
mpr("You finish bottling this corpse's blood.");
- item_def &corpse = mitm[delay.parm1];
-
- if (mons_skeleton(corpse.plus) && one_chance_in(3))
- turn_corpse_into_skeleton_and_blood_potions(corpse);
+ if (mons_skeleton(item.plus) && one_chance_in(3))
+ turn_corpse_into_skeleton_and_blood_potions(item);
else
- turn_corpse_into_blood_potions(corpse);
+ turn_corpse_into_blood_potions(item);
}
else
{
@@ -1221,12 +1219,10 @@ static void _finish_delay(const delay_queue_item &delay)
mpr("What a waste.");
}
- item_def &corpse = mitm[delay.parm1];
-
- if (mons_skeleton(corpse.plus) && one_chance_in(3))
- turn_corpse_into_skeleton_and_chunks(corpse);
+ if (mons_skeleton(item.plus) && one_chance_in(3))
+ turn_corpse_into_skeleton_and_chunks(item);
else
- turn_corpse_into_chunks(corpse);
+ turn_corpse_into_chunks(item);
if (you.duration[DUR_BERSERKER]
&& you.berserk_penalty != NO_BERSERK_PENALTY)
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 76aaddfe58..439313189f 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -692,8 +692,8 @@ enum conduct_type
DID_KILL_LIVING,
DID_KILL_UNDEAD,
DID_KILL_DEMON,
- DID_KILL_NATURAL_EVIL, // TSO
- DID_KILL_CHAOTIC, // Zin
+ DID_KILL_NATURAL_EVIL, // TSO
+ DID_KILL_CHAOTIC, // Zin
DID_KILL_WIZARD,
DID_KILL_PRIEST,
DID_KILL_HOLY,
@@ -715,11 +715,11 @@ enum conduct_type
DID_DRINK_BLOOD,
DID_CANNIBALISM,
DID_EAT_MEAT, // unused
- DID_EAT_SOULED_BEING, // Zin
- DID_DELIBERATE_MUTATING, // Zin
- DID_CAUSE_GLOWING, // Zin
- DID_CHAOS, // Zin (used weapon/magic of chaos)
- DID_DESTROY_ORCISH_IDOL, // Beogh
+ DID_EAT_SOULED_BEING, // Zin
+ DID_DELIBERATE_MUTATING, // Zin
+ DID_CAUSE_GLOWING, // Zin
+ DID_CHAOS, // Zin (used weapon/magic of chaos)
+ DID_DESTROY_ORCISH_IDOL, // Beogh
DID_CREATE_LIFE, // unused
NUM_CONDUCTS
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index f097b92073..f356f34e4c 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -283,25 +283,34 @@ int airstrike(int power, dist &beam)
bool cast_bone_shards(int power, bolt &beam)
{
- bool success = false;
-
if (!you.weapon() || you.weapon()->base_type != OBJ_CORPSES)
+ {
canned_msg(MSG_SPELL_FIZZLES);
- else if (you.weapon()->sub_type != CORPSE_SKELETON)
- mpr("The corpse collapses into a mass of pulpy flesh.");
+ return (false);
+ }
+
+ bool success = false;
+
+ if (you.weapon()->sub_type != CORPSE_SKELETON)
+ {
+ mpr("The corpse collapses into a pulpy mess.");
+
+ dec_inv_item_quantity(you.equip[EQ_WEAPON], 1);
+ }
else
{
// Practical max of 100 * 15 + 3000 = 4500.
// Actual max of 200 * 15 + 3000 = 6000.
power *= 15;
- power += mons_weight( you.weapon()->plus );
+ power += mons_weight(you.weapon()->plus);
if (!player_tracer(ZAP_BONE_SHARDS, power, beam))
return (false);
mpr("The skeleton explodes into sharp fragments of bone!");
- dec_inv_item_quantity( you.equip[EQ_WEAPON], 1 );
+ dec_inv_item_quantity(you.equip[EQ_WEAPON], 1);
+
zapping(ZAP_BONE_SHARDS, power, beam);
success = true;
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index aa0896c0b1..0121d43739 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -1010,8 +1010,8 @@ void cast_intoxicate(int pow)
bool backlight_monsters(coord_def where, int pow, int garbage)
{
- UNUSED( pow );
- UNUSED( garbage );
+ UNUSED(pow);
+ UNUSED(garbage);
monsters *monster = monster_at(where);
if (monster == NULL)
@@ -1180,7 +1180,7 @@ bool cast_evaporate(int pow, bolt& beem, int pot_idx)
}
if (coinflip())
- exercise( SK_THROWING, 1 );
+ exercise(SK_THROWING, 1);
// Really fire.
beem.flavour = real_flavour;
@@ -1191,7 +1191,7 @@ bool cast_evaporate(int pow, bolt& beem, int pot_idx)
if (is_blood_potion(potion))
remove_oldest_blood_potion(potion);
- dec_inv_item_quantity( pot_idx, 1 );
+ dec_inv_item_quantity(pot_idx, 1);
return (true);
}
@@ -1201,11 +1201,10 @@ bool cast_evaporate(int pow, bolt& beem, int pot_idx)
// spell out of corpses, thus potentially making it useful.
// Producing helpful potions would break game balance here...
// and producing more than one potion from a corpse, or not
-// using up the corpse might also lead to game balance problems. -- bwr
-void cast_fulsome_distillation( int powc )
+// using up the corpse might also lead to game balance problems. - bwr
+void cast_fulsome_distillation(int pow)
{
- if (powc > 50)
- powc = 50;
+ pow = std::min(50, pow);
int corpse = -1;
@@ -1214,10 +1213,10 @@ void cast_fulsome_distillation( int powc )
{
if (si->base_type == OBJ_CORPSES && si->sub_type == CORPSE_BODY)
{
- snprintf( info, INFO_SIZE, "Distill a potion from %s?",
- si->name(DESC_NOCAP_THE).c_str() );
+ snprintf(info, INFO_SIZE, "Distill a potion from %s?",
+ si->name(DESC_NOCAP_THE).c_str());
- if (yesno( info, true, 0, false ))
+ if (yesno(info, true, 0, false))
{
corpse = si->index();
break;
@@ -1232,7 +1231,7 @@ void cast_fulsome_distillation( int powc )
}
const bool rotten = food_is_rotten(mitm[corpse]);
- const bool big_monster = (mons_type_hit_dice( mitm[corpse].plus ) >= 5);
+ const bool big_monster = (mons_type_hit_dice(mitm[corpse].plus) >= 5);
const bool power_up = (rotten && big_monster);
potion_type pot_type = POT_WATER;
@@ -1264,7 +1263,7 @@ void cast_fulsome_distillation( int powc )
break;
default:
- switch (mons_corpse_effect( mitm[corpse].plus ))
+ switch (mons_corpse_effect(mitm[corpse].plus))
{
case CE_CLEAN:
pot_type = (power_up ? POT_CONFUSION : POT_WATER);
@@ -1298,7 +1297,7 @@ void cast_fulsome_distillation( int powc )
}
// If not powerful enough, we downgrade the potion.
- if (random2(50) > powc + 10 * rotten)
+ if (random2(50) > pow + 10 * rotten)
{
switch (pot_type)
{
@@ -1333,14 +1332,14 @@ void cast_fulsome_distillation( int powc )
mitm[corpse].plus2 = 0;
mitm[corpse].flags = 0;
mitm[corpse].inscription.clear();
- item_colour( mitm[corpse] ); // sets special as well
+ item_colour(mitm[corpse]); // sets special as well
mprf("You extract %s from the corpse.",
mitm[corpse].name(DESC_NOCAP_A).c_str());
// Try to move the potion to the player (for convenience).
- if (move_item_to_player( corpse, 1 ) != 1)
- mpr( "Unfortunately, you can't carry it right now!" );
+ if (move_item_to_player(corpse, 1) != 1)
+ mpr("Unfortunately, you can't carry it right now!");
}
bool cast_fragmentation(int pow, const dist& spd)
diff --git a/crawl-ref/source/spells4.h b/crawl-ref/source/spells4.h
index 15f80501e0..992bb02a94 100644
--- a/crawl-ref/source/spells4.h
+++ b/crawl-ref/source/spells4.h
@@ -28,7 +28,7 @@ void cast_divine_shield();
void cast_detect_secret_doors(int pow);
void cast_discharge(int pow);
bool cast_evaporate(int pow, bolt& beem, int potion);
-void cast_fulsome_distillation(int powc);
+void cast_fulsome_distillation(int pow);
void cast_forescry(int pow);
bool cast_fragmentation(int powc, const dist& spd);
bool cast_apportation(int powc, const coord_def& where);