diff options
-rw-r--r-- | crawl-ref/source/dat/database/monspeak.txt | 16 | ||||
-rw-r--r-- | crawl-ref/source/dat/database/randname.txt | 4 | ||||
-rw-r--r-- | crawl-ref/source/debug.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 105 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 17 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 2 |
7 files changed, 94 insertions, 64 deletions
diff --git a/crawl-ref/source/dat/database/monspeak.txt b/crawl-ref/source/dat/database/monspeak.txt index 733c014060..3ccefbba50 100644 --- a/crawl-ref/source/dat/database/monspeak.txt +++ b/crawl-ref/source/dat/database/monspeak.txt @@ -954,6 +954,22 @@ VISUAL SPELL:@The_monster@ gestures. @The_monster@ says, "There's only one solution for you. To die." @The_monster@ says, "You can never win." +%%%% +Boris return_speech + +@The_monster@ says, "You haven't seen the last of me!" + +@The_monster@ says, "I'll get you next time!" + +@The_monster@ says, "This isn't over yet!" + +@The_monster@ says, "I'll be back!" + +@The_monster@ says, "This isn't the end, it's only just beginning!" + +@The_monster@ says, "Kill me? I think not!" + +@The_monster@ says, "You cannot defeat me so easily!" ## END Boris ## %%%% # An adventurer hating competition diff --git a/crawl-ref/source/dat/database/randname.txt b/crawl-ref/source/dat/database/randname.txt index 463487e17d..94b4064864 100644 --- a/crawl-ref/source/dat/database/randname.txt +++ b/crawl-ref/source/dat/database/randname.txt @@ -734,10 +734,10 @@ Okrist Oreg -Orik - Orgrim +Orik + Orkrul Orkwin diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 530ed34686..271ebab5e7 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -3557,7 +3557,7 @@ void debug_apply_monster_blessing(monsters* mon) else god = GOD_SHINING_ONE; - if (!bless_follower(mon, god, _force_suitable, true)) + if (!bless_follower(monster_index(mon), god, _force_suitable, true)) mprf("%s won't bless this monster for you!", god_name(god).c_str()); } #endif diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 22f7cd463d..289a7a4aad 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1016,7 +1016,8 @@ void split_potions_into_decay( int obj, int amount, bool need_msg ) item.quantity = amount; item.x = -1; item.y = -1; - item.plus = 0; + // keep description as it was + item.plus = potion.plus; item.plus2 = 0; item.special = 0; item.flags = 0; @@ -1048,12 +1049,13 @@ void split_potions_into_decay( int obj, int amount, bool need_msg ) item_def potion2; potion2.base_type = OBJ_POTIONS; potion2.sub_type = POT_DECAY; - potion2.plus = potion.plus; // are these even needed? - potion2.plus2 = potion.plus2; - potion2.flags = potion.flags; + // keep description as it was + potion2.plus = potion.plus; potion2.quantity = amount; - potion2.special = 0; potion2.colour = potion.colour; + potion2.plus2 = 0; + potion2.flags = 0; + potion2.special = 0; copy_item_to_grid( potion2, you.x_pos, you.y_pos ); } diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 5ae594cb0a..4b3a105d5f 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -34,6 +34,7 @@ #include "beam.h" #include "cloud.h" +#include "database.h" #include "debug.h" #include "delay.h" #include "describe.h" @@ -154,17 +155,17 @@ void get_mimic_item( const monsters *mimic, item_def &item ) item.special = (((mimic->x << 8) + mimic->y) & RANDART_SEED_MASK); } else if (prop < 40) - set_equip_desc( item, ISFLAG_GLOWING ); + set_equip_desc(item, ISFLAG_GLOWING); else if (prop < 60) - set_equip_desc( item, ISFLAG_RUNED ); + set_equip_desc(item, ISFLAG_RUNED); else if (prop < 80) - set_equip_desc( item, ISFLAG_EMBROIDERED_SHINY ); + set_equip_desc(item, ISFLAG_EMBROIDERED_SHINY); else if (prop < 85) - set_equip_race( item, ISFLAG_ORCISH ); + set_equip_race(item, ISFLAG_ORCISH); else if (prop < 90) - set_equip_race( item, ISFLAG_DWARVEN ); + set_equip_race(item, ISFLAG_DWARVEN); else if (prop < 95) - set_equip_race( item, ISFLAG_ELVEN ); + set_equip_race(item, ISFLAG_ELVEN); break; case MONS_SCROLL_MIMIC: @@ -244,7 +245,6 @@ bool curse_an_item( bool decay_potions, bool quiet ) if (decay_potions && !quiet) // just for mummies mpr("You feel nervous for a moment...", MSGCH_MONSTER_SPELL); - /* don't change you.inv_special (just for fun) */ if (you.inv[item].base_type == OBJ_POTIONS) { int amount; @@ -403,15 +403,20 @@ static void _give_monster_experience( monsters *victim, { if (mon->gain_exp(experience)) { + if (you.religion != GOD_SHINING_ONE && you.religion != GOD_BEOGH + || player_under_penance() + || one_chance_in(3)) + { + return; + } + // Randomly bless the follower who gained experience. - if ((((you.religion == GOD_SHINING_ONE - && random2(you.piety) >= piety_breakpoint(0)) - || (you.religion == GOD_BEOGH - && random2(you.piety) >= piety_breakpoint(2))) - && !player_under_penance()) - && !one_chance_in(3)) + if (you.religion == GOD_SHINING_ONE + && random2(you.piety) >= piety_breakpoint(0) + || you.religion == GOD_BEOGH + && random2(you.piety) >= piety_breakpoint(2)) { - bless_follower(mon); + bless_follower(killer_index); } } } @@ -915,8 +920,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) && (you.religion == GOD_MAKHLEB || you.religion == GOD_SHINING_ONE && mons_is_evil_or_unholy(monster)) - && (!player_under_penance() && - random2(you.piety) >= piety_breakpoint(0)))) + && !player_under_penance() + && random2(you.piety) >= piety_breakpoint(0))) { if (you.hp < you.hp_max) { @@ -930,8 +935,8 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) && (you.religion == GOD_MAKHLEB || you.religion == GOD_VEHUMET || you.religion == GOD_SHINING_ONE && mons_is_evil_or_unholy(monster)) - && (!player_under_penance() - && random2(you.piety) >= piety_breakpoint(0))) + && !player_under_penance() + && random2(you.piety) >= piety_breakpoint(0)) { if (you.magic_points < you.max_magic_points) { @@ -941,14 +946,15 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) } // Randomly bless a follower. - if (!created_friendly && gives_xp - && (((you.religion == GOD_SHINING_ONE - && mons_is_evil_or_unholy(monster) - && random2(you.piety) >= piety_breakpoint(0)) - || (you.religion == GOD_BEOGH - && mons_holiness(monster) == MH_NATURAL - && random2(you.piety) >= piety_breakpoint(2))) - && !player_under_penance())) + if (!created_friendly + && gives_xp + && (you.religion == GOD_SHINING_ONE + && mons_is_evil_or_unholy(monster) + && random2(you.piety) >= piety_breakpoint(0) + || you.religion == GOD_BEOGH + && mons_holiness(monster) == MH_NATURAL + && random2(you.piety) >= piety_breakpoint(2)) + && !player_under_penance()) { bless_follower(); } @@ -972,16 +978,20 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) case KILL_MON: /* Monster kills in combat */ case KILL_MON_MISSILE: /* Monster kills by missile or beam */ if (!silent) + { simple_monster_message(monster, _wounded_damaged(monster->type) ? " is destroyed!" : " dies!", MSGCH_MONSTER_DAMAGE, MDAM_DEAD); + } // no piety loss if god gifts killed by other monsters if (mons_friendly(monster) && !testbits(monster->flags,MF_GOD_GIFT)) + { did_god_conduct(DID_FRIEND_DIES, 1 + (monster->hit_dice / 2), true, monster); + } // Trying to prevent summoning abuse here, so we're trying to // prevent summoned creatures from being done_good kills. Only @@ -1065,14 +1075,14 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) if (you.religion == GOD_SHINING_ONE && mons_is_evil_or_unholy(monster) - && (!player_under_penance() - && random2(you.piety) >= piety_breakpoint(0)) + && !player_under_penance() + && random2(you.piety) >= piety_breakpoint(0) && !invalid_monster_index(i)) { monsters *mon = &menv[i]; // Randomly bless the follower who killed. - if (!one_chance_in(3) && bless_follower(mon)) + if (!one_chance_in(3) && bless_follower(i)) break; if (mon->alive() && mon->hit_points < mon->max_hit_points) @@ -1084,16 +1094,14 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) } // Randomly bless the follower who killed. - if (((you.religion == GOD_BEOGH + if (you.religion == GOD_BEOGH && mons_holiness(monster) == MH_NATURAL - && random2(you.piety) >= piety_breakpoint(2)) - && !player_under_penance()) + && random2(you.piety) >= piety_breakpoint(2) + && !player_under_penance() && !one_chance_in(3) && !invalid_monster_index(i)) { - monsters *mon = &menv[i]; - - bless_follower(mon); + bless_follower(i); } } @@ -1102,20 +1110,24 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) /* Monster killed by trap/inanimate thing/itself/poison not from you */ case KILL_MISC: if (!silent) + { simple_monster_message(monster, _wounded_damaged(monster->type) ? " is destroyed!" : " dies!", MSGCH_MONSTER_DAMAGE, MDAM_DEAD); + } break; case KILL_RESET: - /* Monster doesn't die, just goes back to wherever it came from - This must only be called by monsters running out of time (or - abjuration), because it uses the beam variables! Or does it??? */ + // Monster doesn't die, just goes back to wherever it came from + // This must only be called by monsters running out of time (or + // abjuration), because it uses the beam variables! Or does it??? if (!silent) + { simple_monster_message( monster, " disappears in a puff of smoke!" ); + } place_cloud( random_smoke_type(), monster->x, monster->y, 1 + random2(3), @@ -1176,16 +1188,13 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) else { // Provide the player with an ingame clue to Boris' return. -- bwr - const int tmp = random2(6); - simple_monster_message( monster, - (tmp == 0) ? " says, \"You haven't seen the last of me!\"" : - (tmp == 1) ? " says, \"I'll get you next time!\"" : - (tmp == 2) ? " says, \"This isn't over yet!\"" : - (tmp == 3) ? " says, \"I'll be back!\"" : - (tmp == 4) ? " says, \"This isn't the end, it's only just beginning!\"" : - (tmp == 5) ? " says, \"Kill me? I think not!\"" - : " says, \"You cannot defeat me so easily!\"", - MSGCH_TALK ); + std::string msg = getSpeakString("Boris return_speech"); + + if (!msg.empty()) + { + msg = do_mon_str_replacements(msg, monster); + mpr(msg.c_str(), MSGCH_TALK); + } } // Now that Boris is dead, he's a valid target for monster diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index c470de7043..a439530a5b 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1015,6 +1015,7 @@ static bool _tso_blessing_friendliness(monsters *mon) return true; } +// IF you don't currently have any followers, send a small band to help you out. static bool _beogh_blessing_reinforcement() { bool success = false; @@ -1024,16 +1025,17 @@ static bool _beogh_blessing_reinforcement() MONS_ORC, MONS_ORC_WIZARD, MONS_ORC_PRIEST }; + // up to four orcish followers int how_many = random2(4) + 1; for (int i = 0; i < how_many; ++i) { monster_type follower_type = - followers[random2(ARRAYSZ(followers))]; + followers[RANDOM_ELEMENT(followers)]; int monster = create_monster(follower_type, 0, BEH_GOD_GIFT, - you.x_pos, you.y_pos, you.pet_target, - MONS_PROGRAM_BUG); + you.x_pos, you.y_pos, you.pet_target, + MONS_PROGRAM_BUG); if (monster != -1) { monsters *mon = &menv[monster]; @@ -1071,12 +1073,12 @@ static bool _beogh_blessing_priesthood(monsters* mon) // Bless the follower indicated in follower, if any. If there isn't // one, bless a random follower within sight of the player, if any. -bool bless_follower(monsters* follower, +bool bless_follower(int follower, god_type god, bool (*suitable)(const monsters* mon), bool force) { - monsters *mon = NULL; + monsters *mon; std::string pronoun; std::string blessed; @@ -1089,8 +1091,8 @@ bool bless_follower(monsters* follower, bool is_near = false; // If a follower was specified, and it's suitable, pick it. - if (follower && (force || suitable(follower))) - mon = follower; + if (follower != -1 && (force || suitable(&menv[follower]))) + mon = &menv[follower]; // Otherwise, pick a random follower within sight of the player. else { @@ -1110,6 +1112,7 @@ bool bless_follower(monsters* follower, if (!reinforced || coinflip()) { + // try again, or possibly get some more if (_beogh_blessing_reinforcement()) reinforced = true; } diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 16d5e5f7fc..7e972edeef 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -78,7 +78,7 @@ bool tso_stab_safe_monster(const actor *act); bool is_good_follower(const monsters* mon); bool is_orcish_follower(const monsters* mon); bool is_follower(const monsters* mon); -bool bless_follower(monsters* follower = NULL, +bool bless_follower(int follower = -1, god_type god = you.religion, bool (*suitable)(const monsters* mon) = is_follower, bool force = false); |