When a follower of Elyvilon attempts to heal a hostile monster (via ability or wand) there's a chance, depending on the healing value, max monster hp and monster type, that Ely will make that monster become neutral. If this happens, Ely hands out a bit of piety and his follower gains half of the monster's xp value.
If the pacifying attempt fails, the monster is never healed, though you still lose your ressources (mana, piety, charges).
Killing neutral monsters currently means you won't get any xp. Also, Ely dislikes this and hands out penance for doing so.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3812 c06c8d41-db1a-0410-9941-cceddc491573
QDBILCQHREAKSVXBJJGE2EPNR4ATTQWUZMV7BLJYZWWUI737TSKQC TBLVONZGCKVUXW7NEG4NSDMFIIO6UZOG4FHTJGT6MKSSO3B5J46AC IJNXE4Z7S7X3NG26GFV6UNZVEQ6HPXAKSCNPJEKU5DUQUDYJ34KAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC CGYTZT5QWIEGYKUOLOK7MFXSLJKLYRZONER5ZCDZO5XYWSLG475QC OQ4KB7QCJSK7GSW3DYBARH4DCB75HFKLUSOSOZZZ4IUFKNGFRUDQC QKGDOYIYKE6B36ION5O2DRW65DWWPZMYNWJVH7LJJ7FPGGM2MYAQC ZLQAAP55CJ77XIJN3DZVPT4GTTVLIBFJLIJJKI6L5UBSHX7VUK6AC B62ICMDTN5V7R7RBL4JALFVKEMVOOVLRSJASRNYS6CGFWBEEF5JQC TJRYL3NXPW5IUGEV3YOC7JYWEXCZDBFPLT4AUG4P227WVKVB72ZAC QYQKV4R47PTERXVFQNNWWQVICGSOMBHW6WM5TAZAKLIYOLLPUAJAC WZNB427K3EUNV3FMVXLQTM4UIHER4FIKQXWLUUXRNQC3OQ33VQYAC PVLLIAYFIAU4TQFBIP7B4ARIBUX2CVTSBQECEU6VTONJV4ANHVFAC C5VA63WAQRWPENIMXRPUPZLZJMC77PL2B3A77HYFWDCZU5QDG7VQC ZKT63WH43QIZIFY7QDLCWH3XFGVM7OZXIOAZB3V3TQUJHMJ5O2IQC PAAJWLYMSL5R2NS73EU5AMVTSGQKSK7AZ4P4DWEIVHYYFB3AWEQQC 23I5KJ245D43B6QYWS4TDQYJO2W2PKTDCLFBWPVAFDWS6L7NMGKQC 5UC5TI7B6NWGIGN74QRBZKDBYUMHLM2ZO5ATXEZ6TZOGOLF3JX5QC DOZORMA366M4HB5JKSS27BMCR6ET7QNZNND2B7KV3NVEEPR5H7EAC JM7UAK777RAVDAVLQLEOBRTGNW2B47S5G55XITJXO243IUNZHVYQC ZMED4SUEZTGX762DHBTMAZYNJZDV7RFFKMELFSTCM4KZFX553H5AC static int healing_spell( int healed )
static bool _mons_hostile(const monsters *mon){// needs to be done this way because of friendly/neutral enchantmentsreturn (!mons_friendly(mon) && !mons_neutral(mon));}static bool _can_pacify_monster(const monsters *mon, const int healed){ASSERT(you.religion == GOD_ELYVILON);if (healed < 1)return false;if (mons_friendly(mon) || mons_neutral(mon))return false;// Ely only cares about natural monstersif (mons_holiness(mon) != MH_NATURAL)return false;if (mons_intel(mon->type) <= I_PLANT) // no self-awarenessreturn false;if (mons_is_sleeping(mon)) // not aware of what is happeningreturn false;const int factor = (mons_intel(mon->type) <= I_ANIMAL) ? 3 : // animals(is_player_same_species(mon->type)) ? 2 // same species: 1; // otherconst int random_factor = random2(you.skills[SK_INVOCATIONS] * healed/3);#ifdef DEBUG_DIAGNOSTICSmprf(MSGCH_DIAGNOSTICS,"pacifying %s? max hp: %d, factor: %d, Inv: %d, healed: %d, rnd: %d",mon->name(DESC_PLAIN).c_str(), mon->max_hit_points, factor,you.skills[SK_INVOCATIONS], healed, random_factor);#endifif (mon->max_hit_points < factor * random_factor)return true;return false;}static int _healing_spell( int healed, int dir_x = 100, int dir_y = 100)
mpr("Which direction?", MSGCH_PROMPT);direction( bmove, DIR_DIR, TARG_FRIEND );
if (dir_x == 100 || dir_y == 100){mpr("Which direction?", MSGCH_PROMPT);direction( bmove, DIR_DIR, TARG_FRIEND );}else{bmove.dx = dir_x;bmove.dy = dir_y;bmove.isValid = true;}
canned_msg(MSG_NOTHING_HAPPENS);
simple_god_message(" supports your offer of peace.");simple_monster_message( monster, " turns neutral." );monster->attitude = ATT_NEUTRAL;monster->flags |= MF_WAS_NEUTRAL;// give half of the monster's xpunsigned int exp_gain = 0, avail_gain = 0;gain_exp( exper_value(monster) / 2 + 1, &exp_gain, &avail_gain );monster->flags |= MF_GOT_HALF_XP;// finally give a small piety returngain_piety(1 + random2(healed/15));
if (heal_monster( monster, 5 + roll_dice( pbolt.damage ), false ))
if (YOU_KILL(pbolt.thrower)){if (cast_healing(5 + roll_dice( pbolt.damage ),monster->x - you.x_pos, monster->y - you.y_pos) > 0){pbolt.obvious_effect = true;}pbolt.msg_generated = true; // to avoid duplicate "nothing happens"}else if (heal_monster( monster, 5 + roll_dice( pbolt.damage ), false ))