summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-27 13:39:13 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-27 13:39:13 +0000
commit1d255b7b1ec01d6685a1f57c5583a8a362bc98c0 (patch)
treee8efd1fd37d7baac4bd3db48be3e459365902d1d
parent9b2e7b1002d1917e65b15e2e6b69936774b5e02e (diff)
downloadcrawl-ref-1d255b7b1ec01d6685a1f57c5583a8a362bc98c0.tar.gz
crawl-ref-1d255b7b1ec01d6685a1f57c5583a8a362bc98c0.zip
Backport r10426 and r10427.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10428 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/dungeon.cc15
-rw-r--r--crawl-ref/source/monstuff.cc15
-rw-r--r--crawl-ref/source/mutation.cc2
-rw-r--r--crawl-ref/source/spl-cast.cc3
-rw-r--r--crawl-ref/source/traps.cc7
5 files changed, 27 insertions, 15 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index f5b72b4a9f..93418cf7eb 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -2789,10 +2789,10 @@ static bool _shaft_is_in_corridor(const coord_def& c)
const coord_def adjs[] = { coord_def(-1,0), coord_def(1,0),
coord_def(0,-1), coord_def(0,1) };
- for ( unsigned int i = 0; i < ARRAYSZ(adjs); ++i )
+ for (unsigned int i = 0; i < ARRAYSZ(adjs); ++i)
{
const coord_def spot = c + adjs[i];
- if ( !inside_level_bounds(spot) || grd(spot) < DNGN_SHALLOW_WATER )
+ if (!inside_level_bounds(spot) || grd(spot) < DNGN_SHALLOW_WATER)
return (true);
}
return (false);
@@ -2827,7 +2827,7 @@ static void _place_traps(int level_number)
if (ts.type == TRAP_SHAFT && level_number <= 7)
{
// Disallow shaft construction in corridors!
- if ( _shaft_is_in_corridor(ts.pos) )
+ if (_shaft_is_in_corridor(ts.pos))
{
// Choose again!
ts.type = random_trap_for_place(level_number);
@@ -4819,8 +4819,8 @@ static void _vault_grid( vault_placement &place,
{
const trap_type trap =
(f.trap == TRAP_INDEPTH)
- ? random_trap_for_place(place.level_number)
- : static_cast<trap_type>(f.trap);
+ ? random_trap_for_place(place.level_number)
+ : static_cast<trap_type>(f.trap);
place_specific_trap(where, trap);
}
@@ -7497,7 +7497,8 @@ static void _roguey_level(int level_number, spec_room &sr, bool make_stairs)
bool place_specific_trap(const coord_def& where, trap_type spec_type)
{
- if (spec_type == TRAP_RANDOM || spec_type == TRAP_NONTELEPORT)
+ if (spec_type == TRAP_RANDOM || spec_type == TRAP_NONTELEPORT
+ || spec_type == TRAP_SHAFT && !is_valid_shaft_level())
{
trap_type forbidden1 = NUM_TRAPS;
trap_type forbidden2 = NUM_TRAPS;
@@ -7511,9 +7512,7 @@ bool place_specific_trap(const coord_def& where, trap_type spec_type)
forbidden1 = TRAP_SHAFT;
do
- {
spec_type = static_cast<trap_type>( random2(NUM_TRAPS) );
- }
while (spec_type == forbidden1 || spec_type == forbidden2);
}
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index e61e9074f5..e671a44084 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -5143,10 +5143,16 @@ bool mons_avoids_cloud(const monsters *monster, cloud_type cl_type,
case CLOUD_STINK:
if (mons_res_poison(monster) > 0)
return (false);
+
if (extra_careful)
return (true);
+
+ if (mons_intel(monster) >= I_ANIMAL && mons_res_poison(monster) < 0)
+ return (true);
+
if (x_chance_in_y(monster->hit_dice - 1, 5))
return (false);
+
if (monster->hit_points >= random2avg(19, 2))
return (false);
break;
@@ -5158,6 +5164,12 @@ bool mons_avoids_cloud(const monsters *monster, cloud_type cl_type,
if (extra_careful)
return (true);
+ if (mons_intel(monster) >= I_ANIMAL && mons_res_fire(monster) < 0)
+ return (true);
+
+ if (mons_intel(monster) >= I_ANIMAL && mons_res_cold(monster) < 0)
+ return (true);
+
if (monster->hit_points >= 15 + random2avg(46, 5))
return (false);
break;
@@ -5169,6 +5181,9 @@ bool mons_avoids_cloud(const monsters *monster, cloud_type cl_type,
if (extra_careful)
return (true);
+ if (mons_intel(monster) >= I_ANIMAL && mons_res_poison(monster) < 0)
+ return (true);
+
if (monster->hit_points >= random2avg(37, 4))
return (false);
break;
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index 4d9ea1e480..e9f0337dca 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -276,7 +276,7 @@ mutation_def mutation_defs[] = {
"cold resistance"
},
{ MUT_SHOCK_RESISTANCE, 2, 1, false, false,
- {"You are immune to electric shocks.", "", ""},
+ {"You are resistant to electric shocks.", "", ""},
{"You feel insulated.", "", ""},
{"You feel conductive.", "", ""},
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index a71cee4c16..1ea11adf47 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -2283,12 +2283,13 @@ static unsigned int _breakpoint_rank(int val, const int breakpoints[],
unsigned int result = 0;
while (result < num_breakpoints && val >= breakpoints[result])
++result;
+
return result;
}
const char* spell_hunger_string( spell_type spell )
{
- if ( you.is_undead == US_UNDEAD )
+ if (you.is_undead == US_UNDEAD)
return "N/A";
const int hunger = spell_hunger(spell);
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 216901f4f1..605d23cfbb 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -1273,11 +1273,8 @@ bool is_valid_shaft_level(const level_id &place)
return (false);
// Disallow shafts on the first two levels.
- if (place == BRANCH_MAIN_DUNGEON
- && you.your_level < 2)
- {
+ if (place == BRANCH_MAIN_DUNGEON && you.your_level < 2)
return (false);
- }
// Don't generate shafts in branches where teleport control
// is prevented. Prevents player from going down levels without
@@ -1330,7 +1327,7 @@ level_id generic_shaft_dest(level_pos lpos)
// be created during level generation time.
// Include level 27 of the main dungeon here, but don't restrict
// shaft creation (so don't set branch.dangerous_bottom_level).
- if ((branch.dangerous_bottom_level)
+ if (branch.dangerous_bottom_level
&& lid.depth == branch.depth
&& (branch.depth - curr_depth) > 1)
{