diff options
-rw-r--r-- | crawl-ref/source/enum.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/makeitem.cc | 16 | ||||
-rw-r--r-- | crawl-ref/source/makeitem.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 30 |
4 files changed, 33 insertions, 18 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 2d1321d89b..12905cb746 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1256,7 +1256,7 @@ enum item_status_flag_type // per item flags: ie. ident status, cursed status ISFLAG_CURSED = 0x00000100, // cursed ISFLAG_RESERVED_1 = 0x00000200, // reserved ISFLAG_RESERVED_2 = 0x00000400, // reserved - ISFLAG_RESERVED_3 = 0x00000800, // reserved + ISFLAG_RESERVED_3 = 0x00000800, // reserved ISFLAG_CURSE_MASK = 0x00000F00, // mask of all curse related flags ISFLAG_RANDART = 0x00001000, // special value is seed diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 4fb6754eb9..85de54279c 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -26,7 +26,7 @@ #include "stuff.h" #include "view.h" -static void item_set_appearance(item_def &item); +void item_set_appearance(item_def &item); static bool got_curare_roll(const int item_level) { @@ -2818,7 +2818,7 @@ void init_rod_mp(item_def &item) item.plus2 = random_range(6, 9) * ROD_CHARGE_MULT; else item.plus2 = random_range(9, 14) * ROD_CHARGE_MULT; - + item.plus = item.plus2; } @@ -4085,7 +4085,7 @@ armour_type get_random_body_armour_type(int item_level) armour_type get_random_armour_type(int item_level) { int armtype = random2(3); - + if (random2(35) <= item_level + 10) { armtype = random2(5); @@ -4130,7 +4130,7 @@ armour_type get_random_armour_type(int item_level) armtype = ARM_BOOTS; break; } - + if (armtype == ARM_HELMET && one_chance_in(3)) { armtype = ARM_HELMET + random2(3); @@ -4148,11 +4148,11 @@ armour_type get_random_armour_type(int item_level) } // Sets item appearance to match brands, if any. -static void item_set_appearance(item_def &item) +void item_set_appearance(item_def &item) { if (get_equip_desc(item) != ISFLAG_NO_DESC) return; - + switch (item.base_type) { case OBJ_WEAPONS: @@ -4160,7 +4160,7 @@ static void item_set_appearance(item_def &item) set_equip_desc( item, (coinflip() ? ISFLAG_GLOWING : ISFLAG_RUNED) ); break; - + case OBJ_ARMOUR: // if not given a racial type, and special, give shiny/runed/etc desc. if (get_armour_ego_type( item ) != SPARM_NORMAL @@ -4170,7 +4170,7 @@ static void item_set_appearance(item_def &item) { ISFLAG_GLOWING, ISFLAG_RUNED, ISFLAG_EMBROIDERED_SHINY }; - + set_equip_desc( item, RANDOM_ELEMENT(descs) ); } break; diff --git a/crawl-ref/source/makeitem.h b/crawl-ref/source/makeitem.h index ee74c16f7b..5409f008dc 100644 --- a/crawl-ref/source/makeitem.h +++ b/crawl-ref/source/makeitem.h @@ -22,7 +22,7 @@ enum item_make_species_type MAKE_ITEM_RANDOM_RACE = 250 }; -int items( int allow_uniques, object_class_type force_class, int force_type, +int items( int allow_uniques, object_class_type force_class, int force_type, bool dont_place, int item_level, int item_race, unsigned mapmask = 0, int force_ego = 0 ); @@ -34,5 +34,6 @@ jewellery_type get_random_ring_type(); jewellery_type get_random_amulet_type(); armour_type get_random_body_armour_type(int level); armour_type get_random_armour_type(int item_level); +void item_set_appearance(item_def &item); #endif diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index d08ee595fd..9dff7464af 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -360,13 +360,13 @@ const char* god_lose_power_messages[NUM_GODS][MAX_GOD_ABILITIES] = "walk on water" } }; -void altar_prayer(void); +void altar_prayer(); void dec_penance(god_type god, int val); void dec_penance(int val); void inc_penance(god_type god, int val); void inc_penance(int val); static bool moral_beings_attitude_change(); -static bool beogh_followers_abandon_you(void); +static bool beogh_followers_abandon_you(); static void dock_piety(int piety_loss, int penance); static bool make_god_gifts_disappear(bool level_only = true); static bool make_god_gifts_neutral(bool level_only = true); @@ -767,11 +767,18 @@ static bool blessing_wpn(monsters *mon) if (weapon == NON_ITEM) return false; + bool success; + item_def& wpn(mitm[weapon]); // And enchant or uncurse it. - return enchant_weapon((coinflip()) ? ENCHANT_TO_HIT - : ENCHANT_TO_DAM, true, wpn); + success = enchant_weapon((coinflip()) ? ENCHANT_TO_HIT + : ENCHANT_TO_DAM, true, wpn); + + if (success) + item_set_appearance(wpn); + + return success; } static bool blessing_ac(monsters* mon) @@ -783,6 +790,8 @@ static bool blessing_ac(monsters* mon) if (armour == NON_ITEM && shield == NON_ITEM) return false; + bool success; + int slot; do @@ -796,7 +805,12 @@ static bool blessing_ac(monsters* mon) int ac_change; // And enchant or uncurse it. - return enchant_armour(ac_change, true, arm); + success = enchant_armour(ac_change, true, arm); + + if (success) + item_set_appearance(arm); + + return success; } static bool blessing_balms(monsters *mon) @@ -826,7 +840,7 @@ static bool blessing_healing(monsters *mon, bool extra) return heal_monster(mon, mon->max_hit_points, extra); } -static bool beogh_blessing_reinforcement(void) +static bool beogh_blessing_reinforcement() { bool success = false; @@ -3915,7 +3929,7 @@ static std::string sacrifice_message(god_type god, const item_def &item, return (replace_all(replace_all(msg, "%", ssuffix), "&", be)); } -void altar_prayer(void) +void altar_prayer() { // different message than when first joining a religion mpr( "You prostrate yourself in front of the altar and pray." ); @@ -4501,7 +4515,7 @@ static bool need_free_piety() } //jmf: moved stuff from items::handle_time() -void handle_god_time(void) +void handle_god_time() { if (one_chance_in(100)) { |