diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/dat/database/randname.txt | 26 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 42 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 86 |
4 files changed, 105 insertions, 52 deletions
diff --git a/crawl-ref/source/dat/database/randname.txt b/crawl-ref/source/dat/database/randname.txt index 94b4064864..5b6e0624e5 100644 --- a/crawl-ref/source/dat/database/randname.txt +++ b/crawl-ref/source/dat/database/randname.txt @@ -698,9 +698,9 @@ orc name # Other syllables may be borrowed from real life, or made up. # Obvious references to Beogh -Albeogh +Arbeogh -Bogbart +Bogbarth # slavic name, meaning "god's gift" :) Bogdan @@ -711,6 +711,8 @@ Bogmar Bogric +Bogrim + Bogwald Bogward @@ -749,20 +751,30 @@ Agrik Arbolt +Argrim + Arkwar Berold +Bladwarg + Blodwig Boderik +Bolgrim + +Borgoth + Brandogh Brunolf Dorog +Garbold + Gorbash Gorg @@ -777,6 +789,8 @@ Learuk Margrim +Morguth + Morun Murdo @@ -787,12 +801,18 @@ Olfik Olfrun +Ugbert + +Ugrim + Wardok +Wargrak + Worak Wulfoc -Zoruk +Zorug %%%%
\ No newline at end of file diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 4b3a105d5f..03ce726c9e 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -872,16 +872,22 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) if (!created_friendly && gives_xp) { if (mons_holiness(monster) == MH_NATURAL) + { did_god_conduct(DID_KILL_LIVING, monster->hit_dice, true, monster); + } if (mons_holiness(monster) == MH_UNDEAD) + { did_god_conduct(DID_KILL_UNDEAD, monster->hit_dice, true, monster); + } if (mons_holiness(monster) == MH_DEMONIC) + { did_god_conduct(DID_KILL_DEMON, monster->hit_dice, true, monster); + } if (mons_class_flag(monster->type, M_EVIL) && mons_holiness(monster) == MH_NATURAL) @@ -891,18 +897,24 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) } if (_is_mons_mutator_or_rotter(monster)) + { did_god_conduct(DID_KILL_MUTATOR_OR_ROTTER, monster->hit_dice, true, monster); + } // jmf: Trog hates wizards if (mons_is_magic_user(monster)) + { did_god_conduct(DID_KILL_WIZARD, monster->hit_dice, true, monster); + } // Beogh hates priests of other gods. if (mons_class_flag(monster->type, M_PRIEST)) + { did_god_conduct(DID_KILL_PRIEST, monster->hit_dice, true, monster); + } // Holy beings take their gear with them when they die. if (mons_is_holy(monster)) @@ -2575,11 +2587,15 @@ bool choose_any_monster(const monsters* mon) // Find a nearby monster and return its index, including you as a // possibility with probability weight. suitable() should return true // for the type of monster wanted. +// If prefer_named is true, named monsters (including uniques) are twice as +// likely to get chosen compared with non-named ones. int choose_random_nearby_monster(int weight, - bool (*suitable)(const monsters* mon)) + bool (*suitable)(const monsters* mon), + bool prefer_named) { int mons_count = weight; int result = NON_MONSTER; + int mon; int ystart = you.y_pos - 9, xstart = you.x_pos - 9; int yend = you.y_pos + 9, xend = you.x_pos + 9; @@ -2593,12 +2609,20 @@ int choose_random_nearby_monster(int weight, for ( int x = xstart; x < xend; ++x ) if ( see_grid(x,y) && mgrd[x][y] != NON_MONSTER ) { - result = mgrd[x][y]; - - if ( suitable(&menv[result]) && one_chance_in(++mons_count) ) - break; - - result = NON_MONSTER; + mon = mgrd[x][y]; + if (suitable(&menv[mon])) + { + if (prefer_named + && !get_unique_monster_name(&menv[mon]).empty()) + { + mons_count += 2; + // named monsters have doubled chances + if (random2(mons_count) < 2) + result = mon; + } + else if (one_chance_in(++mons_count)) + result = mon; + } } return result; @@ -4706,11 +4730,15 @@ static void _handle_monster_move(int i, monsters *monster) { #if DEBUG if (monster->speed_increment == old_energy) + { mprf(MSGCH_DIAGNOSTICS, "'%s' has same energy as last loop", monster->name(DESC_PLAIN, true).c_str()); + } else + { mprf(MSGCH_DIAGNOSTICS, "'%s' has MORE energy than last loop", monster->name(DESC_PLAIN, true).c_str()); + } #endif monster->speed_increment = old_energy - 10; old_energy = monster->speed_increment; diff --git a/crawl-ref/source/monstuff.h b/crawl-ref/source/monstuff.h index 44e78cfdea..988a793496 100644 --- a/crawl-ref/source/monstuff.h +++ b/crawl-ref/source/monstuff.h @@ -125,7 +125,8 @@ bool simple_monster_message(const monsters *monster, const char *event, bool choose_any_monster(const monsters* mon); int choose_random_nearby_monster(int weight, bool (*suitable)(const monsters* mon) = - choose_any_monster); + choose_any_monster, + bool prefer_named = false); /* *********************************************************************** * called from: acr diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 4448765d2e..9021dd92be 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1026,13 +1026,20 @@ static bool _beogh_blessing_reinforcement() MONS_ORC, MONS_ORC_WIZARD, MONS_ORC_PRIEST }; + const monster_type high_xl_followers[] = { + MONS_ORC_PRIEST, MONS_ORC_WARRIOR, MONS_ORC_KNIGHT, MONS_ORC_WARLORD + }; + // Send up to four followers. int how_many = random2(4) + 1; + monster_type follower_type; for (int i = 0; i < how_many; ++i) { - monster_type follower_type = - followers[RANDOM_ELEMENT(followers)]; + if (random2(you.experience_level) >= 9 && coinflip()) + follower_type = RANDOM_ELEMENT(high_xl_followers); + else + follower_type = RANDOM_ELEMENT(followers); int monster = create_monster(follower_type, 0, BEH_GOD_GIFT, you.x_pos, you.y_pos, you.pet_target, @@ -1040,7 +1047,6 @@ static bool _beogh_blessing_reinforcement() if (monster != -1) { monsters *mon = &menv[monster]; - mon->flags |= MF_ATT_CHANGE_ATTEMPT; success = true; @@ -1079,67 +1085,62 @@ bool bless_follower(int follower, bool (*suitable)(const monsters* mon), bool force) { - monsters *mon; - std::string pronoun; std::string blessed; std::string result; + monsters *mon; - int chance = random2(20); - if (force) - chance = coinflip(); + int chance = (force ? coinflip() : random2(20)); + + if (chance > 2) + return false; bool is_near = false; // If a follower was specified, and it's suitable, pick it. - if (follower != -1 && (force || suitable(&menv[follower]))) - mon = &menv[follower]; // Otherwise, pick a random follower within sight of the player. - else + if (follower == -1 || (!force && !suitable(&menv[follower]))) { - int monster = choose_random_nearby_monster(0, suitable); + // Choose a random follower in LOS, preferably a named one. + follower = choose_random_nearby_monster(0, suitable, true); - if (monster == NON_MONSTER) + if (follower == NON_MONSTER) { - if (chance <= 1) + switch (god) { - switch (god) + case GOD_BEOGH: { - case GOD_BEOGH: - { - // If no follower was chosen, either send - // reinforcement or get out. - bool reinforced = _beogh_blessing_reinforcement(); - - if (!reinforced || coinflip()) - { - // Try again, or possibly send more - // reinforcement. - if (_beogh_blessing_reinforcement()) - reinforced = true; - } + // If no follower was chosen, either send + // reinforcement or get out. + bool reinforced = _beogh_blessing_reinforcement(); - if (reinforced) - { - pronoun = ""; - blessed = "you"; - result = "reinforcement"; - goto blessing_done; - } - break; - } + if (!reinforced || coinflip()) + { + // Try again, or possibly send more reinforcement. + if (_beogh_blessing_reinforcement()) + reinforced = true; + } - default: - break; + if (reinforced) + { + pronoun = ""; + blessed = "you"; + result = "reinforcement"; + goto blessing_done; + } + break; } + + default: + break; } return false; } - mon = &menv[monster]; } + mon = &menv[follower]; is_near = mons_near(mon); pronoun = (mons_is_unique(mon->type)) ? "" : "your "; @@ -1302,7 +1303,10 @@ bool bless_follower(int follower, } blessing_done: - std::string whom = get_unique_monster_name(mon); + std::string whom = ""; + if (follower != NON_MONSTER) + whom = get_unique_monster_name(mon); + if (whom.empty()) whom = pronoun + blessed; |