summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-29 12:09:38 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-29 12:09:38 +0000
commit106be90c4c9f66ab5926836035c7089eacdc8952 (patch)
treef9d2f1d85fc80624d3ba042cf64fdf083944861c
parent86642a73ff3663f40263f20a1a8d2eb1464db071 (diff)
downloadcrawl-ref-106be90c4c9f66ab5926836035c7089eacdc8952.tar.gz
crawl-ref-106be90c4c9f66ab5926836035c7089eacdc8952.zip
Beogh conversion fix. If a Beoghite wakes an orc by hitting
it, it can still join you but with the emergency messages ("I surrender" etc. rather than the happy versions). It's still not perfect but hopefully makes a bit more sense. My solution might be a bit crude. I enforce calling of beogh_follower_convert after a monster has been woken by a hit or bolt by the player. Hmmm... I might have forgotten ranged combat, need to check that. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2658 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc21
-rw-r--r--crawl-ref/source/fight.cc17
-rw-r--r--crawl-ref/source/mon-util.cc3
-rw-r--r--crawl-ref/source/monstuff.cc2
-rw-r--r--crawl-ref/source/religion.cc4
-rw-r--r--crawl-ref/source/religion.h2
-rw-r--r--crawl-ref/source/view.cc4
-rw-r--r--crawl-ref/source/view.h3
8 files changed, 48 insertions, 8 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index ca54f1da3c..11768a210b 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3521,6 +3521,7 @@ static int affect_monster(bolt &beam, monsters *mon)
return (BEAM_STOP);
}
+ bool hit_woke_orc = false;
if (beam.name[0] == '0')
{
if (beam.is_tracer)
@@ -3557,6 +3558,14 @@ static int affect_monster(bolt &beam, monsters *mon)
if (mons_holiness( mon ) == MH_HOLY)
did_god_conduct( DID_ATTACK_HOLY, mon->hit_dice, mon );
+
+ if (you.religion == GOD_BEOGH && mons_species(mon->type) == MONS_ORC
+ && mon->behaviour == BEH_SLEEP && you.species == SP_HILL_ORC
+ && !player_under_penance() && you.piety >= 75)
+ {
+ hit_woke_orc = true;
+ }
+
}
behaviour_event( mon, ME_ANNOY, beam_source(beam) );
@@ -3593,6 +3602,8 @@ static int affect_monster(bolt &beam, monsters *mon)
break;
}
}
+ if (hit_woke_orc)
+ beogh_follower_convert(mon, true);
return (rangeUsed);
// END non-tracer enchantment
@@ -3704,6 +3715,14 @@ static int affect_monster(bolt &beam, monsters *mon)
did_god_conduct( DID_ATTACK_HOLY, mon->hit_dice, mon );
}
+ if (you.religion == GOD_BEOGH && mons_species(mon->type) == MONS_ORC
+ && mon->behaviour == BEH_SLEEP && you.species == SP_HILL_ORC
+ && YOU_KILL(beam.thrower) && !player_under_penance()
+ && you.piety >= 75)
+ {
+ hit_woke_orc = true;
+ }
+
// Don't annoy friendlies if the player's beam did no damage.
// Hostiles will still take umbrage.
if (hurt_final > 0 || !mons_friendly(mon) || !YOU_KILL(beam.thrower))
@@ -3831,6 +3850,8 @@ static int affect_monster(bolt &beam, monsters *mon)
if (wake_mimic && mons_is_mimic( mon->type ))
mimic_alert(mon);
+ else if (hit_woke_orc)
+ beogh_follower_convert(mon, true);
}
return (range_used_on_hit(beam));
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index b5e54645da..4169a5a0d1 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -524,9 +524,17 @@ bool melee_attack::player_attack()
// messages, etc.
player_calc_hit_damage();
+ bool hit_woke_orc = false;
+ if (you.religion == GOD_BEOGH && mons_species(def->type) == MONS_ORC
+ && def->behaviour == BEH_SLEEP && you.species == SP_HILL_ORC
+ && !player_under_penance() && you.piety >= 75 )
+ {
+ hit_woke_orc = true;
+ }
+
// always upset monster regardless of damage
behaviour_event(def, ME_WHACK, MHITYOU);
-
+
player_hurt_monster();
if (damage_done > 0 || !defender_visible)
@@ -542,6 +550,13 @@ bool melee_attack::player_attack()
if (player_check_monster_died())
return (true);
+
+ if (hit_woke_orc)
+ {
+ // call function of orcs first noticing you but with
+ // beaten-up conversion messages (if applicable)
+ beogh_follower_convert(def, true);
+ }
player_sustain_passive_damage();
}
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index ac1a2f54ed..b6c74f5aac 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4906,7 +4906,8 @@ std::string do_mon_str_replacements(const std::string &in_msg,
std::string msg = in_msg;
description_level_type nocap, cap;
- if (monster->attitude == ATT_FRIENDLY && player_monster_visible(monster))
+ if (monster->attitude == ATT_FRIENDLY && !mons_is_unique(monster->type)
+ && player_monster_visible(monster))
{
nocap = DESC_PLAIN;
cap = DESC_PLAIN;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 554a4ab386..9be6f282ca 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -449,7 +449,7 @@ static bool monster_avoided_death(monsters *monster, killer_type killer, int i)
// bias beaten-up-conversion towards the stronger orcs.
&& random2(monster->hit_dice) > 2)
{
- beogh_convert_orc(monster);
+ beogh_convert_orc(monster, true);
return (true);
}
}
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index fa26873f59..a06210368e 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2669,7 +2669,7 @@ static void beogh_orc_spontaneous_conversion_speech(
}
}
-void beogh_convert_orc(monsters *orc)
+void beogh_convert_orc(monsters *orc, bool emergency)
{
ASSERT(mons_species(orc->type) == MONS_ORC);
@@ -2678,7 +2678,7 @@ void beogh_convert_orc(monsters *orc)
std::ostream& chan = msg::streams(MSGCH_MONSTER_ENCHANT);
chan << orc->name(DESC_CAP_THE);
- if (orc->hit_points <= 0)
+ if (emergency || orc->hit_points <= 0)
beogh_orc_emergency_conversion_speech(chan, orc);
else
beogh_orc_spontaneous_conversion_speech(chan, orc);
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index d24a77751e..7b2d8e7b03 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -50,7 +50,7 @@ const char *describe_xom_favour();
bool beogh_water_walk();
void beogh_idol_revenge();
-void beogh_convert_orc(monsters *orc);
+void beogh_convert_orc(monsters *orc, bool emergency);
bool ely_destroy_weapons();
bool trog_burn_books();
bool tso_stab_safe_monster(const actor *act);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 0371313bf1..59ea890bb6 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -642,7 +642,7 @@ static bool mons_was_seen_this_turn(const monsters *mons)
monsters_seen_this_turn.end());
}
-inline static void beogh_follower_convert(monsters *monster)
+void beogh_follower_convert(monsters *monster, bool orc_hit)
{
if (you.species != SP_HILL_ORC)
return;
@@ -676,7 +676,7 @@ inline static void beogh_follower_convert(monsters *monster)
<< std::endl;
return;
}
- beogh_convert_orc(monster);
+ beogh_convert_orc(monster, orc_hit);
}
}
else if (is_orc
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h
index f0d4fa8ce8..129cde3200 100644
--- a/crawl-ref/source/view.h
+++ b/crawl-ref/source/view.h
@@ -64,6 +64,9 @@ enum element_type
void init_char_table(char_set_type set);
void init_feature_table();
+/* called from: beam - fight */
+void beogh_follower_convert(monsters *monster, bool orc_hit = false);
+
// last updated 29may2000 {dlb}
/* ***********************************************************************
* called from: bang - beam - direct - effects - fight - monstuff -