1 #include "specific-object/bloody-moon.h"
2 #include "artifact/fixed-art-types.h"
3 #include "core/player-update-types.h"
4 #include "object-enchant/object-boost.h"
5 #include "object-enchant/tr-types.h"
6 #include "player-base/player-race.h"
7 #include "racial/racial-android.h"
8 #include "system/artifact-type-definition.h"
9 #include "system/item-entity.h"
10 #include "system/player-type-definition.h"
11 #include "system/redrawing-flags-updater.h"
12 #include "util/bit-flags-calculator.h"
13 #include "view/display-messages.h"
16 * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
17 * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
18 * @param o_ptr 対象のオブジェクト構造体 (ブラッディムーン)のポインタ
20 void get_bloody_moon_flags(ItemEntity *o_ptr)
22 o_ptr->art_flags = ArtifactsInfo::get_instance().get_artifact(FixedArtifactId::BLOOD).flags;
24 int dummy = randint1(2) + randint1(2);
25 for (int i = 0; i < dummy; i++) {
26 int flag = randint0(26);
28 o_ptr->art_flags.set(TR_KILL_UNDEAD + flag - 20);
29 } else if (flag == 19) {
30 o_ptr->art_flags.set(TR_KILL_ANIMAL);
31 } else if (flag == 18) {
32 o_ptr->art_flags.set(TR_SLAY_HUMAN);
34 o_ptr->art_flags.set(TR_CHAOTIC + flag);
39 for (int i = 0; i < dummy; i++) {
40 one_resistance(o_ptr);
43 for (int i = 0; i < 2; i++) {
44 int tmp = randint0(11);
46 o_ptr->art_flags.set(TR_STR + tmp);
48 o_ptr->art_flags.set(TR_STEALTH + tmp - 6);
54 * @brief Let's dance a RONDO!!
55 * @param player_ptr プレイヤーへの参照ポインタ
56 * @param o_ptr ブラッディ・ムーンへの参照ポインタ
57 * @return オブジェクト情報に異常がない限りTRUE
59 bool activate_bloody_moon(PlayerType *player_ptr, ItemEntity *o_ptr)
61 if (!o_ptr->is_specific_artifact(FixedArtifactId::BLOOD)) {
65 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
66 get_bloody_moon_flags(o_ptr);
67 if (PlayerRace(player_ptr).equals(PlayerRaceType::ANDROID)) {
68 calc_android_exp(player_ptr);
72 StatusRedrawingFlag::BONUS,
73 StatusRedrawingFlag::HP,
75 RedrawingFlagsUpdater::get_instance().set_flags(flags);