summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/food.cc6
-rw-r--r--crawl-ref/source/monplace.cc27
-rw-r--r--crawl-ref/source/religion.cc34
-rw-r--r--crawl-ref/source/spells3.cc65
4 files changed, 73 insertions, 59 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 712ffef62b..13cfb87116 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -364,9 +364,9 @@ static bool _butcher_corpse(int corpse_id, bool first_corpse = true,
{
start_delay(DELAY_OFFER_CORPSE, 0, corpse_id);
- // Kiku torments if you butcher a corpse while praying
- bool kiku_torments = (you.religion == GOD_KIKUBAAQUDGHA && you.piety > 120);
- if (kiku_torments)
+ // Kiku torments if you butcher a corpse while praying.
+ if (you.religion == GOD_KIKUBAAQUDGHA
+ && you.piety >= piety_breakpoint(4)))
{
simple_god_message(" inflicts torment against the living!");
torment(TORMENT_GENERIC, you.pos());
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index ccb4e943d2..9c77d0c8c7 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -1292,28 +1292,27 @@ static monster_type _pick_random_zombie()
monster_type pick_local_zombifiable_monster_type(int power)
{
- // Generates a dummy zombie likely to be found
+ // Generates a dummy zombie likely to be found.
// Ripped wholly from _define_zombie().
power = std::min(27, power);
// How OOD this zombie can be.
int relax = 5;
- // Pick an appropriate creature to make a zombie out of,
- // levelwise. The old code was generating absolutely
- // incredible OOD zombies.
+ // Pick an appropriate creature to make a zombie out of, levelwise.
+ // The old code was generating absolutely incredible OOD zombies.
int cls;
while (true)
{
cls = _pick_random_zombie();
bool ignore_rarity = false;
- // On certain branches, zombie creation will fail if we use
- // the mons_rarity() functions, because (for example) there
- // are NO zombifiable "native" abyss creatures. Other branches
- // where this is a problem are hell levels and the crypt.
- // we have to watch for summoned zombies on other levels, too,
- // such as the Temple, HoB, and Slime Pits.
+ // On certain branches, zombie creation will fail if we use the
+ // mons_rarity() functions, because (for example) there are NO
+ // zombifiable "native" abyss creatures. Other branches where
+ // this is a problem are Hell levels and the Crypt. We have to
+ // watch for summoned zombies on other levels, too, such as the
+ // Temple, the Hall of Blades and the Slime Pits.
if (you.level_type != LEVEL_DUNGEON
|| player_in_hell()
|| player_in_branch(BRANCH_HALL_OF_ZOT)
@@ -1333,7 +1332,7 @@ monster_type pick_local_zombifiable_monster_type(int power)
if (!ignore_rarity && mons_rarity(cls) == 0)
continue;
- // Check for rarity.. and OOD - identical to mons_place()
+ // Check for rarity.. and OOD - identical to mons_place().
int level, diff, chance;
level = mons_level(cls) - 4;
@@ -1348,9 +1347,9 @@ monster_type pick_local_zombifiable_monster_type(int power)
break;
}
- // Every so often, we'll relax the OOD restrictions. Avoids
- // infinite loops (if we don't do this, things like creating
- // a large skeleton on level 1 may hang the game!).
+ // Every so often, we'll relax the OOD restrictions. This
+ // avoids infinite loops. If we don't do this, things like
+ // creating a large skeleton on level 1 may hang the game!
if (one_chance_in(5))
relax++;
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 78fbe43c8f..6e729cbe23 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3126,7 +3126,7 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
switch (you.religion)
{
case GOD_YREDELEMNUL:
- case GOD_KIKUBAAQUDGHA: // note: reapers aren't undead
+ case GOD_KIKUBAAQUDGHA:
case GOD_MAKHLEB:
case GOD_BEOGH:
case GOD_LUGONU:
@@ -3161,7 +3161,6 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
retval = true;
break;
- case GOD_KIKUBAAQUDGHA: // note: reapers aren't undead
case GOD_MAKHLEB:
case GOD_BEOGH:
case GOD_LUGONU:
@@ -3201,7 +3200,6 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known,
case DID_LIVING_KILLED_BY_SERVANT:
switch (you.religion)
{
- case GOD_KIKUBAAQUDGHA: // note: reapers aren't undead
case GOD_VEHUMET:
case GOD_MAKHLEB:
case GOD_TROG:
@@ -6914,9 +6912,9 @@ static bool _bless_weapon(god_type god, brand_type brand, int colour)
{
torment(TORMENT_GENERIC, you.pos());
- // Bloodify surrounding squares.
+ // Bloodify surrounding squares (75% chance).
for (radius_iterator ri(you.pos(), 2, true, true); ri; ++ri)
- if (random2(4) != 2) // 75% of tiles will get bloodied
+ if (!is_bloodcovered(*ri) && !one_chance_in(4))
env.map(*ri).property |= FPROP_BLOODY;
}
@@ -7032,7 +7030,7 @@ static bool _altar_prayer()
did_bless = _bless_weapon(GOD_LUGONU, SPWPN_DISTORTION, MAGENTA);
}
- // Kikubaaqudgha blesses weapons with pain, or gives you a Necronomicon
+ // Kikubaaqudgha blesses weapons with pain, or gives you a Necronomicon.
if (you.religion == GOD_KIKUBAAQUDGHA
&& !you.num_gifts[GOD_KIKUBAAQUDGHA]
&& !player_under_penance()
@@ -7052,21 +7050,23 @@ static bool _altar_prayer()
_bless_weapon(GOD_KIKUBAAQUDGHA, SPWPN_PAIN, RED);
did_bless = kiku_did_bless_weapon;
}
- else mpr("You have no weapon to bloody with pain.");
+ else
+ mpr("You have no weapon to bloody with pain.");
- // If not, ask if the player wants a Necronomicon
+ // If not, ask if the player wants a Necronomicon.
if (!kiku_did_bless_weapon)
{
if (!yesno("Do you wish to receive the Necronomicon?", true, 'n'))
- return(false);
+ return (false);
int thing_created = items(1, OBJ_BOOKS, BOOK_NECRONOMICON, true, 1,
MAKE_ITEM_RANDOM_RACE,
0, 0, you.religion);
+
if (thing_created == NON_ITEM)
- return(false);
+ return (false);
- move_item_to_grid( &thing_created, you.pos() );
+ move_item_to_grid(&thing_created, you.pos());
if (thing_created != NON_ITEM)
{
@@ -7079,8 +7079,10 @@ static bool _altar_prayer()
mitm[thing_created].inscription = "god gift";
}
}
- return(did_bless); // Return early so we don't offer our Necronomicon to Kiku
- } // end kiku gifting
+
+ // Return early so we don't offer our Necronomicon to Kiku.
+ return (did_bless);
+ }
offer_items();
@@ -7709,7 +7711,7 @@ bool god_likes_butchery(god_type god)
|| god == GOD_MAKHLEB
|| god == GOD_TROG
|| god == GOD_LUGONU
- || (god == GOD_KIKUBAAQUDGHA && you.piety > 120));
+ || (god == GOD_KIKUBAAQUDGHA && you.piety >= piety_breakpoint(4));
}
bool god_hates_butchery(god_type god)
@@ -8033,9 +8035,9 @@ int piety_breakpoint(int i)
{
int breakpoints[MAX_GOD_ABILITIES] = { 30, 50, 75, 100, 120 };
if (i >= MAX_GOD_ABILITIES || i < 0)
- return 255;
+ return (255);
else
- return breakpoints[i];
+ return (breakpoints[i]);
}
// Returns true if the Shining One doesn't mind your using unchivalric
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 501b8aabdd..32c056d2c1 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -647,28 +647,33 @@ bool cast_summon_horrible_things(int pow, god_type god)
bool receive_corpses(int pow, coord_def where)
{
+#if DEBUG_DIAGNOSTICS
// pow = invocations * 4, ranges from 0 to 108
- mprf(MSGCH_DIAGNOSTICS, "Receive_corpses power: %d", pow);
- // Kiku gives branch-appropriate corpses (like shadow creatures)
- int expected_extra_corpses = (pow / 36); // 1 at 0 inv, 7 at 7 inv
- int corpse_delivery_radius = 3;
+ mprf(MSGCH_DIAGNOSTICS, "receive_corpses() power: %d", pow);
+#endif
- // We should get the same # of corpses in a hallway as in an open room.
+ // Kiku gives branch-appropriate corpses (like shadow creatures).
+ int expected_extra_corpses = pow / 36; // 1 at 0 Inv, 7 at 7 Inv.
+ int corpse_delivery_radius = 3;
+
+ // We should get the same number of corpses in a hallway as in an
+ // open room.
int spaces_for_corpses = 0;
- for (radius_iterator ri(where, corpse_delivery_radius, true, true, true); ri; ++ri)
+ for (radius_iterator ri(where, corpse_delivery_radius, true, true, true);
+ ri; ++ri)
+ {
if (mons_class_can_pass(MONS_HUMAN, grd(*ri)))
spaces_for_corpses++;
+ }
int percent_chance_a_square_receives_extra_corpse = // can be > 100
- (int)(
- ((float) expected_extra_corpses) /
- ((float) spaces_for_corpses)
- * 100.0
- );
+ (int)(((float)expected_extra_corpses) / ((float)spaces_for_corpses)
+ * 100.0);
int corpses_generated = 0;
- for (radius_iterator ri(where, corpse_delivery_radius, false, true, false); ri; ++ri)
+ for (radius_iterator ri(where, corpse_delivery_radius, false, true, false);
+ ri; ++ri)
{
bool square_is_walkable = mons_class_can_pass(MONS_HUMAN, grd(*ri));
@@ -676,12 +681,13 @@ bool receive_corpses(int pow, coord_def where)
bool square_gets_corpse =
(random2(100) < percent_chance_a_square_receives_extra_corpse) ||
(square_is_player_square && random2(100) < 97);
+
if (!square_is_walkable || !square_gets_corpse)
continue;
corpses_generated++;
- // Find an appropriate monster corpse
+ // Find an appropriate monster corpse.
monster_type mon_type = MONS_PROGRAM_BUG;
int adjusted_power = 0;
for (int i = 0; i < 200 && !mons_class_can_be_zombified(mon_type); i++)
@@ -690,43 +696,50 @@ bool receive_corpses(int pow, coord_def where)
mon_type = pick_local_zombifiable_monster_type(adjusted_power);
}
- // Create corpse object
+ // Create corpse object.
monsters dummy;
dummy.type = mon_type;
int index_of_corpse_created = get_item_slot();
+
if (mons_genus(mon_type) == MONS_HYDRA)
dummy.number = random2(20) + 1;
- int valid_corpse = fill_out_corpse(&dummy, mitm[index_of_corpse_created], false);
- if (!valid_corpse)
+
+ int valid_corpse = fill_out_corpse(&dummy,
+ mitm[index_of_corpse_created],
+ false);
+ if (valid_corpse == -1)
{
mitm[index_of_corpse_created].clear();
continue;
}
+
mitm[index_of_corpse_created].props["DoNotDropHide"] = true;
ASSERT(valid_corpse >= 0);
- // Higher power means fresher corpses.
- // One out of ten corpses will always be rotten.
- // (Perhaps this should be different for ghouls.)
+ // Higher power means fresher corpses. One out of ten corpses
+ // will always be rotten. (Perhaps this should be different for
+ // ghouls.)
int rottedness = 200 -
- ((random2(10) == 5) ?
- random2(175 - pow) :
- random2(100 + random2(75)));
+ (!one_chance_in(10) ? random2(175 - pow)
+ : random2(100 + random2(75)));
+
mitm[index_of_corpse_created].special = rottedness;
// Place the corpse.
- move_item_to_grid( &index_of_corpse_created, *ri );
+ move_item_to_grid(&index_of_corpse_created, *ri);
}
if (corpses_generated)
{
simple_god_message(" delivers you corpses!");
maybe_update_stashes();
- return true;
- } else {
+ return (true);
+ }
+ else
+ {
simple_god_message(" can find no living being to slaughter for you!");
- return false;
+ return (false);
}
}