OSDN Git Service

[Feature] 狂戦士化の発作の呪い効果を追加
authoriks <iks3@users.noreply.github.com>
Mon, 12 Apr 2021 16:46:11 +0000 (01:46 +0900)
committeriks <iks3@users.noreply.github.com>
Thu, 15 Apr 2021 14:13:10 +0000 (23:13 +0900)
lib/edit/e_info.txt
src/info-reader/kind-info-tokens-table.cpp
src/inventory/inventory-curse.cpp
src/object-enchant/tr-types.h
src/object-enchant/trc-types.h
src/perception/identification.cpp
src/player-info/self-info.cpp
src/player/player-status-flags.cpp

index ad2fce4..7d2ef36 100644 (file)
@@ -414,7 +414,7 @@ X:32:10
 W:0:5:0:500
 C:0:0:18:0
 F:IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
-G:1/3:F:RES_CURSE
+G:1/3:RES_CURSE
 
 #J0#
 #J0# 岸さんの訳です
@@ -769,7 +769,7 @@ C:0:10:0:-3
 F:INT | WIS | POWERFUL
 F:VORPAL | VAMPIRIC | SLAY_DRAGON
 F:SLAY_ANIMAL | SLAY_ORC | SLAY_TROLL | SLAY_GIANT | SLAY_HUMAN
-F:DRAIN_EXP | AGGRAVATE
+F:DRAIN_EXP | AGGRAVATE | BERS_RAGE
 F:HEAVY_CURSE | CURSED | XTRA_DICE
 G:1/1:KILL_DRAGON | KILL_ANIMAL | KILL_ORC | KILL_TROLL | KILL_GIANT | KILL_HUMAN
 G:1/3:HARD_SPELL
index f3a152a..0cfa5e5 100644 (file)
@@ -161,6 +161,7 @@ std::unordered_map<std::string_view, tr_type> k_info_flags = {
     { "DARK_SOURCE", TR_DARK_SOURCE },
     { "SUPPORTIVE", TR_SUPPORTIVE },
     { "RES_CURSE", TR_RES_CURSE },
+    { "BERS_RAGE", TR_BERS_RAGE },
 };
 
 /*!
index 3071115..43e9b19 100644 (file)
@@ -24,6 +24,7 @@
 #include "spell-kind/spells-teleport.h"
 #include "spell/summon-types.h"
 #include "status/bad-status-setter.h"
+#include "status/buff-setter.h"
 #include "system/floor-type-definition.h"
 #include "util/bit-flags-calculator.h"
 #include "util/quarks.h"
 
 #define TRC_P_FLAG_MASK                                                                                                                                        \
     (TRC_TELEPORT_SELF | TRC_CHAINSWORD | TRC_TY_CURSE | TRC_DRAIN_EXP | TRC_ADD_L_CURSE | TRC_ADD_H_CURSE | TRC_CALL_ANIMAL | TRC_CALL_DEMON                  \
-        | TRC_CALL_DRAGON | TRC_COWARDICE | TRC_TELEPORT | TRC_DRAIN_HP | TRC_DRAIN_MANA | TRC_CALL_UNDEAD)
+        | TRC_CALL_DRAGON | TRC_COWARDICE | TRC_TELEPORT | TRC_DRAIN_HP | TRC_DRAIN_MANA | TRC_CALL_UNDEAD | TRC_BERS_RAGE)
 
 static bool is_specific_curse(BIT_FLAGS flag)
 {
     return (flag == TRC_ADD_L_CURSE) || (flag == TRC_ADD_H_CURSE) || (flag == TRC_DRAIN_HP) || (flag == TRC_DRAIN_MANA) || (flag == TRC_CALL_ANIMAL)
         || (flag == TRC_CALL_DEMON) || (flag == TRC_CALL_DRAGON) || (flag == TRC_CALL_UNDEAD) || (flag == TRC_COWARDICE) || (flag == TRC_LOW_MELEE)
-        || (flag == TRC_LOW_AC) || (flag == TRC_HARD_SPELL) || (flag == TRC_FAST_DIGEST) || (flag == TRC_SLOW_REGEN);
+        || (flag == TRC_LOW_AC) || (flag == TRC_HARD_SPELL) || (flag == TRC_FAST_DIGEST) || (flag == TRC_SLOW_REGEN || flag == TRC_BERS_RAGE);
 }
 
 static void choise_cursed_item(player_type *creature_ptr, BIT_FLAGS flag, object_type *o_ptr, int *choices, int *number, int item_num)
@@ -92,6 +93,9 @@ static void choise_cursed_item(player_type *creature_ptr, BIT_FLAGS flag, object
     case TRC_SLOW_REGEN:
         cf = TR_SLOW_REGEN;
         break;
+    case TRC_BERS_RAGE:
+        cf = TR_BERS_RAGE;
+        break;
     default:
         break;
     }
@@ -297,6 +301,22 @@ static void curse_cowardice(player_type *creature_ptr)
     set_afraid(creature_ptr, creature_ptr->afraid + 13 + randint1(26));
 }
 
+/*!
+ * @brief 装備による狂戦士化の発作を引き起こす
+ * @param creature_ptr プレイヤー情報への参照ポインタ
+ */
+static void curse_berserk_rage(player_type *creature_ptr)
+{
+    if (((creature_ptr->cursed & TRC_BERS_RAGE) == 0) || !one_in_(1500))
+        return;
+
+    disturb(creature_ptr, FALSE, TRUE);
+    msg_print(_("ウガァァア!", "RAAAAGHH!"));
+    msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!"));
+    (void)set_shero(creature_ptr, 10 + randint1(creature_ptr->lev), FALSE);
+    (void)set_afraid(creature_ptr, 0);
+}
+
 static void curse_drain_hp(player_type *creature_ptr)
 {
     if (((creature_ptr->cursed & TRC_DRAIN_HP) == 0) || !one_in_(666))
@@ -342,6 +362,7 @@ static void occur_curse_effects(player_type *creature_ptr)
     multiply_high_curse(creature_ptr);
     curse_call_monster(creature_ptr);
     curse_cowardice(creature_ptr);
+    curse_berserk_rage(creature_ptr);
     if ((creature_ptr->cursed & TRC_TELEPORT) && one_in_(200) && !creature_ptr->anti_tele) {
         disturb(creature_ptr, FALSE, TRUE);
         teleport_player(creature_ptr, 40, TELEPORT_PASSIVE);
index db956ca..25342d0 100644 (file)
@@ -157,5 +157,6 @@ enum tr_type {
     TR_DARK_SOURCE = 146,
     TR_SUPPORTIVE = 147,
     TR_RES_CURSE = 148,
-    TR_FLAG_MAX = 149,
+    TR_BERS_RAGE = 149, //!< 狂戦士化の発作
+    TR_FLAG_MAX = 150,
 };
index 89e6f10..659f961 100644 (file)
@@ -24,6 +24,7 @@ enum trc_curse_type {
     TRC_DRAIN_HP = 0x00080000L,
     TRC_DRAIN_MANA = 0x00100000L,
     TRC_CALL_UNDEAD = 0x00200000L,
+    TRC_BERS_RAGE = 0x00400000L,
 };
 
 enum trc_special_type {
index c6f16b0..ddcee56 100644 (file)
@@ -627,6 +627,9 @@ bool screen_object(player_type *player_ptr, object_type *o_ptr, BIT_FLAGS mode)
         info[i++] = _("それは恐怖感を引き起こす。", "It makes you subject to cowardice.");
     }
 
+    if (has_flag(flgs, TR_BERS_RAGE))
+        info[i++] = _("それは狂戦士化の発作を引き起こす。", "It makes you subject to berserker fits.");
+
     if ((has_flag(flgs, TR_TELEPORT)) || (o_ptr->curse_flags & TRC_TELEPORT)) {
         info[i++] = _("それはランダムなテレポートを引き起こす。", "It induces random teleportation.");
     }
index 50c5cbd..fd8733d 100644 (file)
@@ -83,6 +83,9 @@ static void set_curse_info(player_type *creature_ptr, self_info_type *self_ptr)
     if (creature_ptr->cursed & TRC_COWARDICE)
         self_ptr->info[self_ptr->line++] = _("あなたは時々臆病になる。", "You are subject to cowardice.");
 
+    if (creature_ptr->cursed & TRC_BERS_RAGE)
+        self_ptr->info[self_ptr->line++] = _("あなたは狂戦士化の発作を起こす。", "You are subject to berserker fits.");
+
     if (creature_ptr->cursed & TRC_TELEPORT)
         self_ptr->info[self_ptr->line++] = _("あなたの位置はひじょうに不安定だ。", "Your position is very uncertain.");
 
index a319d9f..caffcf3 100644 (file)
@@ -397,6 +397,7 @@ BIT_FLAGS get_player_flags(player_type *creature_ptr, tr_type tr_flag)
         return has_invuln_arrow(creature_ptr);
     case TR_DARK_SOURCE:
     case TR_SUPPORTIVE:
+    case TR_BERS_RAGE:
         return check_equipment_flags(creature_ptr, tr_flag);
 
     case TR_FLAG_MAX:
@@ -1292,6 +1293,8 @@ void update_curses(player_type *creature_ptr)
             creature_ptr->cursed |= TRC_FAST_DIGEST;
         if (has_flag(flgs, TR_SLOW_REGEN))
             creature_ptr->cursed |= TRC_SLOW_REGEN;
+        if (has_flag(flgs, TR_BERS_RAGE))
+            creature_ptr->cursed |= TRC_BERS_RAGE;
 
         creature_ptr->cursed |= (o_ptr->curse_flags & (0xFFFFFFF0L));
         if (o_ptr->name1 == ART_CHAINSWORD)