summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-23 17:32:18 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-23 17:32:18 +0000
commit68631458c7c936fb0fed22b87feb888fc3ee5d75 (patch)
tree08759eb1fb56964a90b3d3129e2e63431d62d07d /crawl-ref
parent703d6fb9ec810cf6cdcc2a6ddd1efc4b8631c797 (diff)
downloadcrawl-ref-68631458c7c936fb0fed22b87feb888fc3ee5d75.tar.gz
crawl-ref-68631458c7c936fb0fed22b87feb888fc3ee5d75.zip
TSO no longer makes summons permanent or enslaved monsters permanently friendly, but he will increase summon/charm duration for the ally in combat.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6640 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/monstuff.cc6
-rw-r--r--crawl-ref/source/religion.cc60
2 files changed, 29 insertions, 37 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a560c32151..571eda7fba 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -409,7 +409,7 @@ static void _give_monster_experience( monsters *victim,
{
if (you.religion == GOD_SHINING_ONE || you.religion == GOD_BEOGH
|| player_under_penance()
- || one_chance_in(3))
+ || !one_chance_in(3))
{
return;
}
@@ -2224,7 +2224,7 @@ static bool _choose_random_patrol_target_grid(monsters *mon)
int count_grids = 0;
for (radius_iterator ri(mon->patrol_point, LOS_RADIUS, true, false);
ri; ++ri)
- {
+ {
// Don't bother for the current position. If everything fails,
// we'll stay here anyway.
if ( *ri == mon->pos() )
@@ -2347,7 +2347,7 @@ static void _mark_neighbours_target_unreachable(monsters *mon)
{
if ( *ri == mon->pos() )
continue;
-
+
if (mgrd(*ri) == NON_MONSTER)
continue;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 705830d21e..2b280e49f2 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1291,6 +1291,22 @@ static bool _tso_blessing_holy_arm(monsters* mon)
return (true);
}
+static bool _increase_ench_duration(monsters *mon,
+ mon_enchant ench,
+ const int increase)
+{
+ // Durations are saved as 16-bit signed ints, so clamp at the largest such.
+ const int MARSHALL_MAX = (1 << 15) - 1;
+
+ const int newdur = std::min(ench.duration + increase, MARSHALL_MAX);
+ if (ench.duration >= newdur)
+ return false;
+
+ ench.duration = newdur;
+ mon->update_ench(ench);
+ return true;
+}
+
static int _tso_blessing_extend_stay(monsters* mon)
{
if (!mon->has_ench(ENCH_ABJ))
@@ -1298,25 +1314,12 @@ static int _tso_blessing_extend_stay(monsters* mon)
mon_enchant abj = mon->get_ench(ENCH_ABJ);
- const int increase = 300 + random2(300);
- const int threshold = (increase + random2(increase)) * 2;
-
- // Extend the time an abjurable monster has before disappearing.
- abj.duration += increase;
-
- // If the extended stay is long enough, make it permanent. Note
- // that we have to delete the enchantment without removing the
- // enchantment effect, in order to keep the monster from
- // disappearing.
- if (abj.duration >= threshold)
- {
- mon->del_ench(ENCH_ABJ, true, false);
- return 2;
- }
- else
- mon->update_ench(abj);
-
- return 1;
+ // [ds] Disabling permanence for balance reasons, but extending duration
+ // increase. These numbers are tenths of a player turn. Holy monsters
+ // get a much bigger boost than random beasties.
+ const int base_increase = mon->holiness() == MH_HOLY? 1100 : 500;
+ const int increase = base_increase + random2(base_increase);
+ return _increase_ench_duration(mon, abj, increase);
}
static bool _tso_blessing_friendliness(monsters* mon)
@@ -1324,21 +1327,10 @@ static bool _tso_blessing_friendliness(monsters* mon)
if (!mon->has_ench(ENCH_CHARM))
return (false);
- mon->attitude = ATT_FRIENDLY;
-
- // The monster is not really *created* friendly, but should it
- // become hostile later on, it won't count as a good kill.
- mon->flags |= MF_CREATED_FRIENDLY;
-
- mons_make_god_gift(mon, GOD_SHINING_ONE);
-
- // If the monster is charmed, make it permanently friendly. Note
- // that we have to delete the enchantment without removing the
- // enchantment effect, in order to keep the monster from turning
- // hostile.
- mon->del_ench(ENCH_CHARM, true, false);
-
- return (true);
+ // [ds] Just increase charm duration, no permanent friendliness.
+ const int base_increase = 700;
+ return _increase_ench_duration(mon, mon->get_ench(ENCH_CHARM),
+ base_increase + random2(base_increase));
}
// If you don't currently have any followers, send a small band to help