diff options
-rw-r--r-- | crawl-ref/source/delay.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 12 |
3 files changed, 24 insertions, 9 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 1fc478fee5..a5748db171 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -186,6 +186,12 @@ static int recite_to_monsters(int x, int y, int pow, int unused) // permanently neutral, but same message as enchantment mons->attitude = ATT_NEUTRAL; mons->flags |= MF_WAS_NEUTRAL; + + // give half of the monster's xp + unsigned int exp_gain = 0, avail_gain = 0; + gain_exp( exper_value(mons) / 2 + 1, &exp_gain, &avail_gain ); + mons->flags |= MF_GOT_HALF_XP; + simple_monster_message(mons, " seems impressed!"); break; } diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index e5b8d4c830..6d128a61ec 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -3907,12 +3907,19 @@ static void mons_lose_attack_energy(monsters *attacker, int wpn_speed, bool monster_attack(int monster_attacking) { monsters *attacker = &menv[monster_attacking]; - - if (mons_friendly(attacker) && !mons_is_confused(attacker)) + + // Friendly monsters and neutral monsters that you got half XP from + // won't attack unless confused. + if ((mons_friendly(attacker) + || (mons_neutral(attacker) + && testbits(attacker->flags, MF_GOT_HALF_XP))) + && !mons_is_confused(attacker)) + { return false; + } - // in case the monster hasn't noticed you - // bumping into will change that + // In case the monster hasn't noticed you, bumping into it will + // change that. behaviour_event( attacker, ME_ALERT, MHITYOU ); melee_attack attk(attacker, &you); attk.attack(); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 15172b45c5..092e2689f9 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3480,7 +3480,7 @@ static bool moral_beings_on_level_attitude_change() { monster->attitude = ATT_HOSTILE; behaviour_event(monster, ME_ALERT, MHITYOU); - // for now CREATED_FRIENDLY/WAS_NEUTRAL stays + // for now CREATED_FRIENDLY/WAS_NEUTRAL/GOT_HALF_XP stays success = true; } @@ -3818,9 +3818,11 @@ void good_god_holy_attitude_change(monsters *holy) holy->attitude = ATT_NEUTRAL; - // not really *created* neutral, but should it become - // hostile later on, it won't count as a good kill + // not really *created* neutral, and you don't really get half XP + // for it, but should it become hostile later on, it won't count as + // a good kill holy->flags |= MF_WAS_NEUTRAL; + holy->flags |= MF_GOT_HALF_XP; // to avoid immobile "followers" behaviour_event(holy, ME_ALERT, MHITNOT); @@ -3874,8 +3876,8 @@ void beogh_convert_orc(monsters *orc, bool emergency, orc->attitude = ATT_FRIENDLY; - // not really "created" friendly, but should it become - // hostile later on, it won't count as a good kill + // not really "created" friendly, but should it become hostile later + // on, it won't count as a good kill orc->flags |= MF_CREATED_FRIENDLY; orc->flags |= MF_GOD_GIFT; |