1 #include "monster-floor/monster-death-util.h"
2 #include "monster-race/monster-race.h"
3 #include "monster-race/race-flags1.h"
4 #include "monster-race/race-indice-types.h"
5 #include "monster/monster-info.h"
6 #include "monster/smart-learn-types.h"
7 #include "system/angband-system.h"
8 #include "system/floor-type-definition.h"
9 #include "system/monster-entity.h"
10 #include "system/monster-race-info.h"
11 #include "system/player-type-definition.h"
12 #include "util/bit-flags-calculator.h"
15 * @brief モンスターを倒した際の財宝svalを返す
16 * @param r_idx 倒したモンスターの種族ID
19 * Hack -- Return the "automatic coin type" of a monster race
20 * Used to allocate proper treasure when "Creeping coins" die
21 * Note the use of actual "monster names"
23 static int get_coin_type(MonsterRaceId r_idx)
26 case MonsterRaceId::COPPER_COINS:
28 case MonsterRaceId::SILVER_COINS:
30 case MonsterRaceId::GOLD_COINS:
32 case MonsterRaceId::MITHRIL_COINS:
33 case MonsterRaceId::MITHRIL_GOLEM:
35 case MonsterRaceId::ADAMANT_COINS:
42 MonsterDeath::MonsterDeath(FloorType &floor, MONSTER_IDX m_idx, bool drop_item)
44 , m_ptr(&floor.m_list[m_idx])
46 this->r_ptr = &this->m_ptr->get_monrace();
47 this->do_gold = this->r_ptr->drop_flags.has_none_of({
48 MonsterDropType::ONLY_ITEM,
49 MonsterDropType::DROP_GOOD,
50 MonsterDropType::DROP_GREAT,
52 this->do_item = this->r_ptr->drop_flags.has_not(MonsterDropType::ONLY_GOLD);
53 this->do_item |= this->r_ptr->drop_flags.has_any_of({ MonsterDropType::DROP_GOOD, MonsterDropType::DROP_GREAT });
54 this->cloned = this->m_ptr->mflag2.has(MonsterConstantFlagType::CLONED);
55 this->force_coin = get_coin_type(this->m_ptr->r_idx);
56 this->drop_chosen_item = drop_item && !this->cloned && !floor.inside_arena && !AngbandSystem::get_instance().is_phase_out() && !this->m_ptr->is_pet();