OSDN Git Service

[Implement] #37324 アーティファクトの発動に森林生成を追加 / Added Tree Creation for the activation of...
authorHourier <hourier@users.sourceforge.jp>
Thu, 8 Oct 2020 14:54:01 +0000 (23:54 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Fri, 13 Nov 2020 10:24:31 +0000 (19:24 +0900)
src/art-definition/random-art-effects.h
src/mspell/mspell-summon.c
src/object-activation/activation-others.c
src/object-activation/activation-others.h
src/object-activation/activation-switcher.c
src/object-enchant/activation-info-table.c
src/object-enchant/activation-info-table.h
src/object-enchant/object-boost.c

index ee6bc99..6645e63 100644 (file)
@@ -43,7 +43,9 @@ typedef enum random_art_activation_type {
     ACT_BR_DRAGON = 40,
     ACT_BA_FIRE_4 = 41,
     ACT_BA_NUKE_1 = 42,
-    /* 42 - 50 unused */
+    /* 43 - 48 unused */
+    ACT_TREE_CREATION = 49,
+    ACT_ANIM_DEAD = 50,
     ACT_CONFUSE = 51,
     ACT_SLEEP = 52,
     ACT_QUAKE = 53,
@@ -68,6 +70,7 @@ typedef enum random_art_activation_type {
     ACT_SUMMON_HOUND = 75,
     ACT_SUMMON_DAWN = 76,
     ACT_SUMMON_OCTOPUS = 77,
+    /* 78 - 79 unused */
     ACT_CHOIR_SINGS = 80,
     ACT_CURE_LW = 81,
     ACT_CURE_MW = 82,
@@ -121,6 +124,7 @@ typedef enum random_art_activation_type {
     ACT_PHASE_DOOR = 136,
     ACT_DETECT_ALL_MONS = 137,
     ACT_ULTIMATE_RESIST = 138,
+    /* 139 - 245 unused */
     ACT_FALLING_STAR = 246,
     ACT_STRAIN_HASTE = 247,
     ACT_TELEPORT_LEVEL = 248,
@@ -131,4 +135,5 @@ typedef enum random_art_activation_type {
     ACT_MURAMASA = 253,
     ACT_BLOODY_MOON = 254,
     ACT_CRIMSON = 255,
+    ACT_MAX = 255, /* ダミー、最大値と合わせること / Dummy. Please match the value as max value */
 } random_art_activation_type;
index e4a0cfa..31d5ee0 100644 (file)
@@ -61,7 +61,8 @@ MONSTER_NUMBER summon_Kin(player_type *target_ptr, POSITION y, POSITION x, int r
     return count;
 }
 
-static void decide_summon_kin_caster(player_type *target_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type, concptr m_name, const bool known)
+static void decide_summon_kin_caster(
+    player_type *target_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type, concptr m_name, concptr m_poss, const bool known)
 {
     floor_type *floor_ptr = target_ptr->current_floor_ptr;
     monster_type *m_ptr = &floor_ptr->m_list[m_idx];
@@ -83,6 +84,9 @@ static void decide_summon_kin_caster(player_type *target_ptr, MONSTER_IDX m_idx,
             msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
     } else if (mon_to_player || (mon_to_mon && known && see_either)) {
         monster_race *r_ptr = &r_info[m_ptr->r_idx];
+#ifdef JP
+        (void)m_poss;
+#endif
         _(msg_format("%sが魔法で%sを召喚した。", m_name, ((r_ptr->flags1 & RF1_UNIQUE) ? "手下" : "仲間")),
             msg_format("%^s magically summons %s %s.", m_name, m_poss, ((r_ptr->flags1 & RF1_UNIQUE) ? "minions" : "kin")));
     }
@@ -113,7 +117,7 @@ void spell_RF6_S_KIN(player_type *target_ptr, POSITION y, POSITION x, MONSTER_ID
 
     disturb(target_ptr, TRUE, TRUE);
     bool known = monster_near_player(floor_ptr, m_idx, t_idx);
-    decide_summon_kin_caster(target_ptr, m_idx, t_idx, target_type, m_name, known);
+    decide_summon_kin_caster(target_ptr, m_idx, t_idx, target_type, m_name, m_poss, known);
     int count = 0;
     switch (m_ptr->r_idx) {
     case MON_MENELDOR:
index 986298f..876a92e 100644 (file)
@@ -42,6 +42,7 @@
 #include "system/floor-type-definition.h"
 #include "system/object-type-definition.h"
 #include "target/target-getter.h"
+#include "util/quarks.h"
 #include "view/display-messages.h"
 
 bool activate_sunlight(player_type *user_ptr)
@@ -337,7 +338,7 @@ bool activate_protection_rune(player_type *user_ptr)
 bool activate_light(player_type *user_ptr, concptr name)
 {
     msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
-    lite_area(user_ptr, damroll(2, 15), 3);
+    (void)lite_area(user_ptr, damroll(2, 15), 3);
     return TRUE;
 }
 
@@ -346,3 +347,18 @@ bool activate_recall(player_type *user_ptr)
     msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
     return recall_player(user_ptr, randint0(21) + 15);
 }
+
+bool activate_tree_creation(player_type *user_ptr, object_type *o_ptr, concptr name)
+{
+    msg_format(_("%s%sから明るい緑の光があふれ出た...", "The %s%s wells with clear light..."), name, quark_str(o_ptr->art_name));
+    return tree_creation(user_ptr, user_ptr->y, user_ptr->x);
+}
+
+bool activate_animate_dead(player_type *user_ptr, object_type *o_ptr)
+{
+    msg_print(_("黄金色の光が溢れ出た...", "It emitted a golden light..."));
+    if (o_ptr->name1 > 0)
+        msg_print(_("ぴぴるぴるぴるぴぴるぴ~♪", "Pipiru piru piru pipiru pii"));
+
+    return animate_dead(user_ptr, 0, user_ptr->y, user_ptr->x);
+}
index 74e106e..dda2a36 100644 (file)
@@ -37,3 +37,5 @@ bool activate_exploding_rune(player_type *user_ptr);
 bool activate_protection_rune(player_type *user_ptr);
 bool activate_light(player_type *user_ptr, concptr name);
 bool activate_recall(player_type *user_ptr);
+bool activate_tree_creation(player_type *user_ptr, object_type *o_ptr, concptr name);
+bool activate_animate_dead(player_type *user_ptr, object_type *o_ptr);
index b1fd025..2a251eb 100644 (file)
@@ -123,6 +123,10 @@ bool switch_activation(player_type *user_ptr, object_type *o_ptr, const activati
         return activate_breath_cold(user_ptr, o_ptr);
     case ACT_BR_DRAGON:
         return activate_dragon_breath(user_ptr, o_ptr);
+    case ACT_TREE_CREATION:
+        return activate_tree_creation(user_ptr, o_ptr, name);
+    case ACT_ANIM_DEAD:
+        return activate_animate_dead(user_ptr, o_ptr);
     case ACT_CONFUSE:
         return activate_confusion(user_ptr);
     case ACT_SLEEP:
index e8eead6..807a8ba 100644 (file)
@@ -138,5 +138,8 @@ const activation_type activation_info[] = { { "SUNLIGHT", ACT_SUNLIGHT, 10, 250,
     { "STRAIN_HASTE", ACT_STRAIN_HASTE, 10, 1000, { 120, 100 }, _("体力と引き換えに加速", "haste with strain") },
     { "GRAND_CROSS", ACT_GRAND_CROSS, 30, 15000, { 250, 200 }, _("グランド・クロス", "grand cross") },
     { "TELEPORT_LEVEL", ACT_TELEPORT_LEVEL, 10, 1500, { 100, 200 }, _("テレポート・レベル", "teleort level") },
-    { "ARTS_FALLING_STAR", ACT_FALLING_STAR, 20, 5500, { 30, 50 }, _("魔剣・流れ星", "blade arts 'falling star'") }, { NULL, 0, 0, 0, { 0, 0 }, "" }
+    { "ARTS_FALLING_STAR", ACT_FALLING_STAR, 20, 5500, { 30, 50 }, _("魔剣・流れ星", "blade arts 'falling star'") },
+    { "ANIM_DEAD", ACT_ANIM_DEAD, 30, 2000, { 10, 10 }, _("死者復活", "animate dead") },
+    { "TREE_CREATION", ACT_TREE_CREATION, 50, 25000, { 1000, 0 }, _("森林生成", "tree creation") },
+    { NULL, 0, 0, 0, { 0, 0 }, "" },
 };
index b4ce797..fad085f 100644 (file)
@@ -14,4 +14,5 @@ typedef struct activation_type {
     concptr desc;
 } activation_type;
 
-extern const activation_type activation_info[];
+#define MAX_ACTIVATION_TYPE 131
+extern const activation_type activation_info[MAX_ACTIVATION_TYPE];
index b202bd1..a26f17a 100644 (file)
@@ -390,9 +390,8 @@ void one_activation(object_type *o_ptr)
 {
     int type = 0;
     PERCENTAGE chance = 0;
-
     while (randint1(100) >= chance) {
-        type = randint1(255);
+        type = randint1(ACT_MAX);
         switch (type) {
         case ACT_SUNLIGHT:
         case ACT_BO_MISS_1:
@@ -480,8 +479,9 @@ void one_activation(object_type *o_ptr)
         case ACT_DIM_DOOR:
             chance = 10;
             break;
-        case ACT_SUMMON_UNDEAD:
+        case ACT_TREE_CREATION:
         case ACT_SUMMON_DEMON:
+        case ACT_SUMMON_UNDEAD:
         case ACT_WRAITH:
         case ACT_INVULN:
         case ACT_ALCHEMY:
@@ -492,7 +492,6 @@ void one_activation(object_type *o_ptr)
         }
     }
 
-    /* A type was chosen... */
     o_ptr->xtra2 = (byte)type;
     add_flag(o_ptr->art_flags, TR_ACTIVATE);
     o_ptr->timeout = 0;