diff options
-rw-r--r-- | crawl-ref/source/abl-show.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/clua.cc | 38 | ||||
-rw-r--r-- | crawl-ref/source/delay.cc | 86 | ||||
-rw-r--r-- | crawl-ref/source/describe.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/food.cc | 36 | ||||
-rw-r--r-- | crawl-ref/source/initfile.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 209 | ||||
-rw-r--r-- | crawl-ref/source/religion.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/spells3.cc | 3 |
10 files changed, 201 insertions, 203 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index c656794bdd..005e83db52 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -105,8 +105,8 @@ ability_type god_abilities[MAX_NUM_GODS][MAX_GOD_ABILITIES] = { ABIL_NON_ABILITY, ABIL_TSO_DIVINE_SHIELD, ABIL_NON_ABILITY, ABIL_TSO_CLEANSING_FLAME, ABIL_TSO_SUMMON_DIVINE_WARRIOR }, // Kikubaaqudgha - { ABIL_KIKU_RECEIVE_CORPSE, ABIL_NON_ABILITY, - ABIL_NON_ABILITY, ABIL_NON_ABILITY, ABIL_NON_ABILITY }, + { ABIL_KIKU_RECEIVE_CORPSES, ABIL_NON_ABILITY, ABIL_NON_ABILITY, + ABIL_NON_ABILITY, ABIL_NON_ABILITY }, // Yredelemnul { ABIL_YRED_ANIMATE_REMAINS, ABIL_YRED_RECALL_UNDEAD_SLAVES, ABIL_YRED_ANIMATE_DEAD, ABIL_YRED_DRAIN_LIFE, ABIL_YRED_ENSLAVE_SOUL }, @@ -240,7 +240,7 @@ static const ability_def Ability_List[] = 8, 0, 150, 4, ABFLAG_NONE }, // Kikubaaqudgha - { ABIL_KIKU_RECEIVE_CORPSE, "Recieve Corpses", 5, 0, 1000, 2, ABFLAG_NONE }, + { ABIL_KIKU_RECEIVE_CORPSES, "Receive Corpses", 5, 0, 1000, 2, ABFLAG_NONE }, // Yredelemnul { ABIL_YRED_INJURY_MIRROR, "Injury Mirror", 0, 0, 0, 0, ABFLAG_PIETY }, @@ -728,7 +728,7 @@ static talent _get_talent(ability_type ability, bool check_confused) case ABIL_BEOGH_SMITING: case ABIL_MAKHLEB_MINOR_DESTRUCTION: case ABIL_SIF_MUNA_FORGET_SPELL: - case ABIL_KIKU_RECEIVE_CORPSE: + case ABIL_KIKU_RECEIVE_CORPSES: case ABIL_YRED_ANIMATE_DEAD: case ABIL_MAKHLEB_LESSER_SERVANT_OF_MAKHLEB: case ABIL_ELYVILON_GREATER_HEALING_SELF: @@ -1626,7 +1626,7 @@ static bool _do_ability(const ability_def& abil) exercise(SK_INVOCATIONS, 8 + random2(10)); break; - case ABIL_KIKU_RECEIVE_CORPSE: + case ABIL_KIKU_RECEIVE_CORPSES: receive_corpses(you.skills[SK_INVOCATIONS] * 4, you.pos()); exercise(SK_INVOCATIONS, (coinflip() ? 3 : 2)); break; diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 8a9c7bc5b9..11ac031f5d 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -767,6 +767,10 @@ LUARET1(you_good_god, boolean, LUARET1(you_evil_god, boolean, lua_isstring(ls, 1) ? is_evil_god(str_to_god(lua_tostring(ls, 1))) : is_evil_god(you.religion)) +LUARET1(you_god_likes_fresh_corpses, boolean, + lua_isstring(ls, 1) ? + god_likes_fresh_corpses(str_to_god(lua_tostring(ls, 1))) : + god_likes_fresh_corpses(you.religion)) LUARET1(you_god_likes_butchery, boolean, lua_isstring(ls, 1) ? god_likes_butchery(str_to_god(lua_tostring(ls, 1))) : @@ -907,8 +911,9 @@ static const struct luaL_reg you_lib[] = { "flying", you_flying }, { "transform", you_transform }, - { "god_likes_butchery", you_god_likes_butchery }, - { "can_consume_corpses", you_can_consume_corpses }, + { "god_likes_fresh_corpses", you_god_likes_fresh_corpses }, + { "god_likes_butchery", you_god_likes_butchery }, + { "can_consume_corpses", you_can_consume_corpses }, { "stop_activity", you_stop_activity }, { "taking_stairs", you_taking_stairs }, @@ -2525,14 +2530,14 @@ MDEF(hd) static const char *_monuse_names[] = { - "nothing", "open_doors", "starting_equipment", - "weapons_armour", "magic_items" + "nothing", "open_doors", "starting_equipment", "weapons_armour", + "magic_items" }; -static const char *_monuse_to_str(mon_itemuse_type ityp) +static const char *_monuse_to_str(mon_itemuse_type utyp) { COMPILE_CHECK(ARRAYSZ(_monuse_names) == NUM_MONUSE, c1); - return _monuse_names[ityp]; + return _monuse_names[utyp]; } MDEF(muse) @@ -2544,6 +2549,26 @@ MDEF(muse) return (0); } +static const char *_moneat_names[] = +{ + "nothing", "items", "corpses", "food" +}; + +static const char *_moneat_to_str(mon_itemeat_type etyp) +{ + COMPILE_CHECK(ARRAYSZ(_moneat_names) == NUM_MONEAT, c1); + return _moneat_names[etyp]; +} + +MDEF(meat) +{ + if (const monsterentry *me = mons->find_monsterentry()) + { + PLUARET(string, _moneat_to_str(me->gmon_eat)); + } + return (0); +} + static int l_mons_do_dismiss(lua_State *ls) { // dismiss is only callable from dlua, not from managed VMs (i.e. @@ -2580,6 +2605,7 @@ static MonsAccessor mons_attrs[] = { "y" , l_mons_y }, { "hd" , l_mons_hd }, { "muse", l_mons_muse }, + { "meat", l_mons_meat }, { "dismiss", l_mons_dismiss }, { "experience", l_mons_experience }, }; diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 87cea6699b..81f53d1f2c 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -82,7 +82,6 @@ static bool _recite_mons_useless(const monsters *mon) // Power is maximum 50. static int _recite_to_monsters(coord_def where, int pow, int, actor *) { - monsters *mons = monster_at(where); if (mons == NULL) @@ -354,9 +353,8 @@ void stop_delay( bool stop_stair_travel ) { case DELAY_BUTCHER: case DELAY_BOTTLE_BLOOD: - case DELAY_OFFER_CORPSE: { - // Corpse keeps track of work in plus2 field, see handle_delay(). -- bwr + // Corpse keeps track of work in plus2 field, see handle_delay(). - bwr bool multiple_corpses = false; bool butcher_swap_setup = false; int butcher_swap_weapon = 0; @@ -364,8 +362,7 @@ void stop_delay( bool stop_stair_travel ) for (unsigned int i = 1; i < you.delay_queue.size(); ++i) { if (you.delay_queue[i].type == DELAY_BUTCHER - || you.delay_queue[i].type == DELAY_BOTTLE_BLOOD - || you.delay_queue[i].type == DELAY_OFFER_CORPSE) + || you.delay_queue[i].type == DELAY_BOTTLE_BLOOD) { multiple_corpses = true; } @@ -538,8 +535,7 @@ void stop_delay( bool stop_stair_travel ) static bool _is_butcher_delay(int delay) { - return (delay == DELAY_BUTCHER || delay == DELAY_BOTTLE_BLOOD - || delay == DELAY_OFFER_CORPSE); + return (delay == DELAY_BUTCHER || delay == DELAY_BOTTLE_BLOOD); } void stop_butcher_delay() @@ -665,8 +661,7 @@ bool is_being_butchered(const item_def &item, bool just_first) for (unsigned int i = 0; i < you.delay_queue.size(); ++i) { if (you.delay_queue[i].type == DELAY_BUTCHER - || you.delay_queue[i].type == DELAY_BOTTLE_BLOOD - || you.delay_queue[i].type == DELAY_OFFER_CORPSE) + || you.delay_queue[i].type == DELAY_BOTTLE_BLOOD) { const item_def &corpse = mitm[ you.delay_queue[i].parm1 ]; if (&corpse == &item) @@ -788,31 +783,34 @@ void handle_delay() case DELAY_ARMOUR_ON: mpr("You start putting on your armour.", MSGCH_MULTITURN_ACTION); break; + case DELAY_ARMOUR_OFF: mpr("You start removing your armour.", MSGCH_MULTITURN_ACTION); break; + case DELAY_BUTCHER: case DELAY_BOTTLE_BLOOD: if (!is_valid_item(mitm[delay.parm1])) break; + mprf(MSGCH_MULTITURN_ACTION, "You start %s the %s.", (delay.type == DELAY_BOTTLE_BLOOD ? "bottling blood from" : "butchering"), mitm[delay.parm1].name(DESC_PLAIN).c_str()); // Also for bottling blood - just in case. - if (you.duration[DUR_PRAYER] - && god_hates_butchery(you.religion)) - { + if (you.duration[DUR_PRAYER]) did_god_conduct(DID_DEDICATED_BUTCHERY, 10); - } break; + case DELAY_MEMORISE: mpr("You start memorising the spell.", MSGCH_MULTITURN_ACTION); break; + case DELAY_PASSWALL: mpr("You begin to meditate on the wall.", MSGCH_MULTITURN_ACTION); break; + case DELAY_RECITE: mprf(MSGCH_PLAIN, "You %s", _get_recite_speech("start", you.num_turns + delay.duration).c_str()); @@ -820,9 +818,11 @@ void handle_delay() if (apply_area_visible(_recite_to_monsters, delay.parm1)) viewwindow(true, false); break; + default: break; } + delay.started = true; } @@ -858,8 +858,7 @@ void handle_delay() return; } } - else if (delay.type == DELAY_BUTCHER || delay.type == DELAY_BOTTLE_BLOOD - || delay.type == DELAY_OFFER_CORPSE) + else if (delay.type == DELAY_BUTCHER || delay.type == DELAY_BOTTLE_BLOOD) { if (delay.type == DELAY_BOTTLE_BLOOD && you.experience_level < 6) { @@ -915,16 +914,6 @@ void handle_delay() } } - if (delay.type == DELAY_OFFER_CORPSE) - { - // Don't attempt to offer a rotten corpse. - _pop_delay(); - - // Chain onto the next delay. - handle_delay(); - return; - } - delay.parm2 = 99; // Don't give the message twice. // Vampires won't continue bottling rotting corpses. @@ -942,18 +931,6 @@ void handle_delay() mitm[ delay.parm1 ].plus2++; } } - else if (delay.type == DELAY_OFFER_CORPSE) - { -#ifdef DEBUG_DIAGNOSTICS - mprf("Corpse %d no longer valid!", delay.parm1); -#endif - // Don't attempt to offer an invalid item. - _pop_delay(); - - // Chain onto the next delay. - handle_delay(); - return; - } else { // Corpse is no longer valid! End the butchering normally @@ -1349,37 +1326,6 @@ static void _finish_delay(const delay_queue_item &delay) break; } - case DELAY_OFFER_CORPSE: - { - if (!you.duration[DUR_PRAYER]) - { - stop_delay(); - return; - } - - if (food_is_rotten(mitm[delay.parm1])) - { - simple_god_message(coinflip() ? " refuses to accept that" - " mouldy sacrifice!" - : " demands fresh blood!", - you.religion); - _pop_delay(); - // Chain onto the next delay. - handle_delay(); - } - else - { - offer_corpse(delay.parm1); - StashTrack.update_stash(); // Don't stash-track this corpse anymore. - } - // If we were interrupted while butchering (by poisoning, for - // example) then resumed butchering and finished, swap back from - // butchering tool if appropriate. - if (you.delay_queue.size() == 1) - handle_interrupted_swap(true); - break; - } - case DELAY_DROP_ITEM: // Note: checking if item is droppable is assumed to // be done before setting up this delay... this includes @@ -2111,8 +2057,8 @@ activity_interrupt_type get_activity_interrupt(const std::string &name) static const char *delay_names[] = { "not_delayed", "eat", "vampire_feed", "armour_on", "armour_off", - "jewellery_on", "memorise", "butcher", "bottle_blood", "offer_corpse", - "weapon_swap", "passwall", "drop_item", "multidrop", "ascending_stairs", + "jewellery_on", "memorise", "butcher", "bottle_blood", "weapon_swap", + "passwall", "drop_item", "multidrop", "ascending_stairs", "descending_stairs", "recite", "run", "rest", "travel", "macro", "macro_process_key", "interruptible", "uninterruptible" }; diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 3644ad37f2..462320deee 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -3127,7 +3127,7 @@ std::string describe_favour(god_type which_god) : _describe_favour_generic(which_god); } -static std::string _religion_help( god_type god ) +static std::string _religion_help(god_type god) { std::string result = ""; @@ -3182,6 +3182,12 @@ static std::string _religion_help( god_type god ) } break; + case GOD_BEOGH: + result += "You can pray to sacrifice all orcish remains on your " + "square. Inscribe orcish remains with !p, !* or =p to avoid " + "sacrificing them accidentally."; + break; + case GOD_NEMELEX_XOBEH: result += "You can pray to sacrifice all items on your square. " "Inscribe items with !p, !* or =p to avoid sacrificing " @@ -3200,13 +3206,14 @@ static std::string _religion_help( god_type god ) break; } - if (god_likes_butchery(god)) + if (god_likes_fresh_corpses(god)) { if (!result.empty()) result += " "; - result += "You can sacrifice corpses by dissecting" - " them during prayer."; + result += "You can pray to sacrifice all fresh corpses on your " + "square. Inscribe fresh corpses with !p, !* or =p to avoid " + "sacrificing them accidentally."; } return result; diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 7a18318241..6a602a2c8f 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -58,7 +58,7 @@ enum ability_type ABIL_TSO_DIVINE_SHIELD = 120, // 120 ABIL_TSO_CLEANSING_FLAME, ABIL_TSO_SUMMON_DIVINE_WARRIOR, - ABIL_KIKU_RECEIVE_CORPSE = 130, // 130 + ABIL_KIKU_RECEIVE_CORPSES = 130, // 130 ABIL_YRED_INJURY_MIRROR = 139, ABIL_YRED_ANIMATE_REMAINS, // 140 ABIL_YRED_RECALL_UNDEAD_SLAVES, @@ -834,7 +834,6 @@ enum delay_type DELAY_MEMORISE, DELAY_BUTCHER, DELAY_BOTTLE_BLOOD, - DELAY_OFFER_CORPSE, DELAY_WEAPON_SWAP, // for easy_butcher DELAY_PASSWALL, DELAY_DROP_ITEM, diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index b2e3ac2299..56d3e95e57 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -357,36 +357,32 @@ static bool _butcher_corpse(int corpse_id, bool first_corpse = true, const bool can_sac = you.duration[DUR_PRAYER] && god_likes_butchery(you.religion); - if (can_sac && !rotten) + if (can_sac) { - start_delay(DELAY_OFFER_CORPSE, 0, corpse_id); - - // Kiku torments if you butcher a corpse while praying. - if (you.religion == GOD_KIKUBAAQUDGHA - && you.piety >= piety_breakpoint(4)) + if (!rotten) { - simple_god_message(" inflicts torment against the living!"); - torment(TORMENT_KIKUBAAQUDGHA, you.pos()); - you.piety -= 8 + random2(4); // 8 to 12 + offer_and_butcher_corpse(corpse_id); + + // Kikubaaqudgha torments if you butcher a fresh corpse + // while praying. + if (you.religion == GOD_KIKUBAAQUDGHA + && you.piety >= piety_breakpoint(4)) + { + simple_god_message(" inflicts torment against the living!"); + torment(TORMENT_KIKUBAAQUDGHA, you.pos()); + you.piety -= 8 + random2(4); // 8 to 12 + } } + else + simple_god_message(" refuses to accept that mouldy sacrifice!"); } else { - if (can_sac && rotten) - { - simple_god_message(coinflip() ? " refuses to accept that" - " mouldy sacrifice!" - : " demands fresh blood!", - you.religion); - } - // Start work on the first corpse we butcher. if (first_corpse) mitm[corpse_id].plus2++; - int work_req = 4 - mitm[corpse_id].plus2; - if (work_req < 0) - work_req = 0; + int work_req = std::max(0, 4 - mitm[corpse_id].plus2); delay_type dtype = DELAY_BUTCHER; if (!force_butcher && !rotten diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index ae9f7ca281..cf175bc4db 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -537,7 +537,6 @@ void game_options::set_default_activity_interrupts() "interrupt_memorise = interrupt_armour_on, stat", "interrupt_butcher = interrupt_armour_on, teleport, stat", "interrupt_bottle_blood = interrupt_butcher", - "interrupt_offer_corpse = interrupt_butcher, hungry", "interrupt_vampire_feed = interrupt_butcher", "interrupt_passwall = interrupt_butcher", "interrupt_multidrop = interrupt_butcher", diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 71a236bde8..b03e5fd0a2 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -595,10 +595,10 @@ std::string get_god_likes(god_type which_god, bool verbose) break; } - if (god_likes_butchery(which_god)) + if (god_likes_fresh_corpses(which_god)) { - snprintf(info, INFO_SIZE, "you butcher corpses while praying%s", - verbose ? " (press <w>pc</w> to do so)" : ""); + snprintf(info, INFO_SIZE, "you sacrifice fresh corpses%s", + verbose ? " (by standing over them and <w>p</w>raying)" : ""); likes.push_back(info); } @@ -1390,7 +1390,7 @@ static void _give_nemelex_gift() deck.colour = deck_rarity_to_color(rarity); deck.inscription = "god gift"; - move_item_to_grid( &thing_created, you.pos() ); + move_item_to_grid(&thing_created, you.pos()); simple_god_message(" grants you a gift!"); more(); @@ -2387,7 +2387,7 @@ static bool _god_accepts_prayer(god_type god) return (true); } - if (god_likes_butchery(god)) + if (god_likes_fresh_corpses(god) || god_likes_butchery(god)) return (true); switch (god) @@ -2519,9 +2519,11 @@ void pray() else if (you.religion == GOD_YREDELEMNUL || you.religion == GOD_ELYVILON) you.duration[DUR_PRAYER] = 20; - // Beoghites and Nemelexites offer the items they're standing on. + // Gods that like fresh corpses, Beoghites and Nemelexites offer the + // items they're standing on. if (altar_god == GOD_NO_GOD - && (you.religion == GOD_BEOGH || you.religion == GOD_NEMELEX_XOBEH)) + && (god_likes_fresh_corpses(you.religion) + || you.religion == GOD_BEOGH || you.religion == GOD_NEMELEX_XOBEH)) { offer_items(); } @@ -2938,25 +2940,15 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, } break; - case DID_DEDICATED_BUTCHERY: // a.k.a. field sacrifice + case DID_DEDICATED_BUTCHERY: switch (you.religion) { case GOD_ELYVILON: simple_god_message(" does not appreciate your butchering the " "dead during prayer!"); retval = true; - piety_change = -10; - penance = 10; - break; - - case GOD_OKAWARU: - case GOD_MAKHLEB: - case GOD_TROG: - case GOD_LUGONU: - simple_god_message(" accepts your offering."); - retval = true; - if (random2(level + 10) > 5) - piety_change = 1; + piety_change = -level; + penance = level; break; default: @@ -2968,7 +2960,7 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, switch (you.religion) { case GOD_ELYVILON: - // killing only disapproved during prayer + // Killing is only disapproved of during prayer. if (you.duration[DUR_PRAYER]) { simple_god_message(" does not appreciate your shedding " @@ -3015,7 +3007,7 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, simple_god_message(" accepts your kill."); retval = true; - // Holy gods are easier to please this way + // Holy gods are easier to please this way. if (random2(level + 18 - (is_good_god(you.religion) ? 0 : you.experience_level / 2)) > 4) piety_change = 1; @@ -3039,7 +3031,7 @@ bool did_god_conduct(conduct_type thing_done, int level, bool known, simple_god_message(" accepts your kill."); retval = true; - // Holy gods are easier to please this way + // Holy gods are easier to please this way. if (random2(level + 18 - (is_good_god(you.religion) ? 0 : you.experience_level / 2)) > 3) { @@ -7160,6 +7152,9 @@ bool god_hates_attacking_friend(god_type god, int species) bool god_likes_items(god_type god) { + if (god_likes_fresh_corpses(god)) + return (true); + switch (god) { case GOD_ZIN: case GOD_SHINING_ONE: case GOD_BEOGH: case GOD_NEMELEX_XOBEH: @@ -7167,6 +7162,7 @@ bool god_likes_items(god_type god) case GOD_NO_GOD: case NUM_GODS: case GOD_RANDOM: case GOD_NAMELESS: mprf(MSGCH_ERROR, "Bad god, no biscuit! %d", static_cast<int>(god) ); + default: return (false); } @@ -7177,6 +7173,13 @@ static bool _god_likes_item(god_type god, const item_def& item) if (!god_likes_items(god)) return (false); + if (god_likes_fresh_corpses(god)) + { + return (item.base_type == OBJ_CORPSES + && item.sub_type == CORPSE_BODY + && !food_is_rotten(item)); + } + switch (god) { case GOD_ZIN: @@ -7224,93 +7227,107 @@ static void _give_sac_group_feedback(int which) } // God effects of sacrificing one item from a stack (e.g., a weapon, one -// out of 20 arrows, etc.) Does not modify the actual item in any way. +// out of 20 arrows, etc.). Does not modify the actual item in any way. static piety_gain_t _sacrifice_one_item_noncount(const item_def& item) { piety_gain_t relative_piety_gain = PIETY_NONE; - // item_value() multiplies by quantity. - const int value = item_value(item) / item.quantity; - - switch (you.religion) - { - case GOD_SHINING_ONE: - gain_piety(1); - relative_piety_gain = PIETY_SOME; - break; - - case GOD_BEOGH: + if (god_likes_fresh_corpses(you.religion)) { - const int item_orig = item.orig_monnum - 1; - - int chance = 4; - - if (item_orig == MONS_SAINT_ROKA) - chance += 12; - else if (item_orig == MONS_ORC_HIGH_PRIEST) - chance += 8; - else if (item_orig == MONS_ORC_PRIEST) - chance += 4; - - if (food_is_rotten(item)) - chance--; - else if (item.sub_type == CORPSE_SKELETON) - chance -= 2; - - if (x_chance_in_y(chance, 20)) + if (x_chance_in_y(13, 19)) { gain_piety(1); relative_piety_gain = PIETY_SOME; } - break; } - - case GOD_NEMELEX_XOBEH: - if (you.attribute[ATTR_CARD_COUNTDOWN] && x_chance_in_y(value, 800)) + else + { + switch (you.religion) { - you.attribute[ATTR_CARD_COUNTDOWN]--; -#if DEBUG_DIAGNOSTICS || DEBUG_CARDS || DEBUG_SACRIFICE - mprf(MSGCH_DIAGNOSTICS, "Countdown down to %d", - you.attribute[ATTR_CARD_COUNTDOWN]); -#endif - } - // Nemelex piety gain is fairly fast... at least - // when you have low piety. - if (item.base_type == OBJ_CORPSES && one_chance_in(2 + you.piety/50) - || x_chance_in_y(value/2 + 1, 30 + you.piety/2)) + case GOD_SHINING_ONE: + gain_piety(1); + relative_piety_gain = PIETY_SOME; + break; + + case GOD_BEOGH: { - if (is_artefact(item)) - { - gain_piety(2); - relative_piety_gain = PIETY_LOTS; - } - else + const int item_orig = item.orig_monnum - 1; + + int chance = 4; + + if (item_orig == MONS_SAINT_ROKA) + chance += 12; + else if (item_orig == MONS_ORC_HIGH_PRIEST) + chance += 8; + else if (item_orig == MONS_ORC_PRIEST) + chance += 4; + + if (food_is_rotten(item)) + chance--; + else if (item.sub_type == CORPSE_SKELETON) + chance -= 2; + + if (x_chance_in_y(chance, 20)) { gain_piety(1); relative_piety_gain = PIETY_SOME; } + break; } - if (item.base_type == OBJ_FOOD && item.sub_type == FOOD_CHUNK - || is_blood_potion(item)) - { - // Count chunks and blood potions towards decks of Summoning. - you.sacrifice_value[OBJ_CORPSES] += value; - } - else if (item.base_type == OBJ_CORPSES) + case GOD_NEMELEX_XOBEH: { + // item_value() multiplies by quantity. + const int value = item_value(item) / item.quantity; + + if (you.attribute[ATTR_CARD_COUNTDOWN] && x_chance_in_y(value, 800)) + { + you.attribute[ATTR_CARD_COUNTDOWN]--; +#if DEBUG_DIAGNOSTICS || DEBUG_CARDS || DEBUG_SACRIFICE + mprf(MSGCH_DIAGNOSTICS, "Countdown down to %d", + you.attribute[ATTR_CARD_COUNTDOWN]); +#endif + } + // Nemelex piety gain is fairly fast... at least when you + // have low piety. + if (item.base_type == OBJ_CORPSES && one_chance_in(2 + you.piety/50) + || x_chance_in_y(value/2 + 1, 30 + you.piety/2)) + { + if (is_artefact(item)) + { + gain_piety(2); + relative_piety_gain = PIETY_LOTS; + } + else + { + gain_piety(1); + relative_piety_gain = PIETY_SOME; + } + } + + if (item.base_type == OBJ_FOOD && item.sub_type == FOOD_CHUNK + || is_blood_potion(item)) + { + // Count chunks and blood potions towards decks of + // Summoning. + you.sacrifice_value[OBJ_CORPSES] += value; + } + else if (item.base_type == OBJ_CORPSES) + { #if DEBUG_GIFTS || DEBUG_CARDS || DEBUG_SACRIFICE - mprf(MSGCH_DIAGNOSTICS, "Corpse mass is %d", - item_mass(item)); + mprf(MSGCH_DIAGNOSTICS, "Corpse mass is %d", + item_mass(item)); #endif - you.sacrifice_value[item.base_type] += item_mass(item); + you.sacrifice_value[item.base_type] += item_mass(item); + } + else + you.sacrifice_value[item.base_type] += value; + break; } - else - you.sacrifice_value[item.base_type] += value; - break; - default: - break; + default: + break; + } } return (relative_piety_gain); @@ -7490,7 +7507,9 @@ void offer_items() { // Zin was handled above, and the other gods don't care about // sacrifices. - if (you.religion == GOD_SHINING_ONE) + if (god_likes_fresh_corpses(you.religion)) + simple_god_message(" only cares about fresh corpses!"); + else if (you.religion == GOD_SHINING_ONE) simple_god_message(" only cares about evil items!"); else if (you.religion == GOD_BEOGH) simple_god_message(" only cares about orcish remains!"); @@ -7746,13 +7765,17 @@ bool god_hates_killing(god_type god, const monsters* mon) return (retval); } -bool god_likes_butchery(god_type god) +bool god_likes_fresh_corpses(god_type god) { return (god == GOD_OKAWARU || god == GOD_MAKHLEB || god == GOD_TROG - || god == GOD_LUGONU - || (god == GOD_KIKUBAAQUDGHA && you.piety >= piety_breakpoint(4))); + || god == GOD_LUGONU); +} + +bool god_likes_butchery(god_type god) +{ + return (god == GOD_KIKUBAAQUDGHA && you.piety >= piety_breakpoint(4)); } bool god_hates_butchery(god_type god) @@ -7850,10 +7873,10 @@ static void _god_smites_you(god_type god, const char *message, } } -void offer_corpse(int corpse) +void offer_and_butcher_corpse(int corpse) { // We always give the "good" (piety-gain) message when doing - // dedicated butchery. Uh, call it a feature. + // dedicated butchery. Uh, call it a feature. _print_sacrifice_message(you.religion, mitm[corpse], PIETY_SOME); did_god_conduct(DID_DEDICATED_BUTCHERY, 10); diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h index 9aabab95a1..4583ac2095 100644 --- a/crawl-ref/source/religion.h +++ b/crawl-ref/source/religion.h @@ -77,7 +77,7 @@ void excommunication(god_type new_god = GOD_NO_GOD); void gain_piety(int pgn); void god_speaks(god_type god, const char *mesg); void lose_piety(int pgn); -void offer_corpse(int corpse); +void offer_and_butcher_corpse(int corpse); std::string god_prayer_reaction(); void pray(); void end_prayer(); @@ -93,6 +93,7 @@ std::string god_hates_your_god_reaction(god_type god, god_type your_god = you.religion); bool god_hates_cannibalism(god_type god); bool god_hates_killing(god_type god, const monsters* mon); +bool god_likes_fresh_corpses(god_type god); bool god_likes_butchery(god_type god); bool god_hates_butchery(god_type god); harm_protection_type god_protects_from_harm(god_type god, bool actual = true); diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 55a96db776..0e552a2355 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -728,7 +728,8 @@ bool receive_corpses(int pow, coord_def where) if (corpses_generated) { - simple_god_message(" delivers you corpses!"); + simple_god_message(corpses_generated > 1 ? " delivers you corpses!" + : " delivers you a corpse!"); maybe_update_stashes(); return (true); } |