diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-29 12:30:20 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-29 12:30:20 +0000 |
commit | 90b272a317a96b72679acd8bd21f5ac9af77d000 (patch) | |
tree | dd4dd783f4ec6f93e5c0e9870a222f802ca1d524 /crawl-ref/source | |
parent | 537d9d5e0f922b3b0731f922d0eac7fd94dc2c27 (diff) | |
download | crawl-ref-90b272a317a96b72679acd8bd21f5ac9af77d000.tar.gz crawl-ref-90b272a317a96b72679acd8bd21f5ac9af77d000.zip |
Beogh conversion fixes for trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2660 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/beam.cc | 21 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 3 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/view.h | 3 |
8 files changed, 48 insertions, 8 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index abbcefe830..2f4543b9f6 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3648,6 +3648,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) @@ -3684,6 +3685,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) ); @@ -3721,6 +3730,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 @@ -3832,6 +3843,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)) @@ -3961,6 +3980,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 072cbe0bbd..4a5a9c7f5d 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -549,9 +549,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) @@ -567,6 +575,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 ac004b16f3..5cf5aa1168 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -5235,7 +5235,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 81c9a7d05b..3dbe99cb1a 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -461,7 +461,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 48fa354a65..3934a834d7 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2863,7 +2863,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); @@ -2872,7 +2872,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 26dad22080..669b474e72 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -47,7 +47,7 @@ void divine_retribution(god_type god); 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 773509411b..8449a5ac1c 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -653,7 +653,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; @@ -687,7 +687,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 4acd54669b..20052a2d15 100644 --- a/crawl-ref/source/view.h +++ b/crawl-ref/source/view.h @@ -70,6 +70,9 @@ void init_char_table(char_set_type set); void init_feature_table(); void init_monsters_seens(); +/* 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 - |