OSDN Git Service

[Refactor] #37353 人間トランプの処理を become_living_trump() に統合。 / Integrate realm magic of...
authordeskull <deskull@users.sourceforge.jp>
Thu, 28 Feb 2019 12:46:23 +0000 (21:46 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 28 Feb 2019 12:46:23 +0000 (21:46 +0900)
src/mutation.c
src/mutation.h
src/realm-craft.c
src/realm-trump.c

index c230065..5fa1b19 100644 (file)
@@ -2356,3 +2356,19 @@ bool mutation_power_aux(int power)
 
        return TRUE;
 }
+
+become_living_trump(player_type *creature_ptr)
+{
+       MUTATION_IDX mutation;
+
+       if (one_in_(7))
+               mutation = 12; /* Teleport control */
+       else
+               mutation = 77; /* Random teleportation (uncontrolled) */
+
+       /* Gain the mutation */
+       if (gain_mutation(creature_ptr, mutation))
+       {
+               msg_print(_("あなたは生きているカードに変わった。", "You have turned into a Living Trump."));
+       }
+}
index 023fc30..06a0c0e 100644 (file)
@@ -6,3 +6,4 @@ extern void dump_mutations(FILE *OutFile);
 extern void do_cmd_knowledge_mutations(void);
 extern int calc_mutant_regenerate_mod(void);
 extern bool mutation_power_aux(int power);
+extern become_living_trump(player_type *creature_ptr);
index 0d9778c..3ecd133 100644 (file)
@@ -479,26 +479,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("人間トランプ", "Living Trump");
                if (desc) return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。",
                        "Gives mutation which makes you teleport randomly or makes you able to teleport at will.");
-
-               {
-                       if (cast)
-                       {
-                               MUTATION_IDX mutation;
-
-                               if (one_in_(7))
-                                       /* Teleport control */
-                                       mutation = 12;
-                               else
-                                       /* Random teleportation (uncontrolled) */
-                                       mutation = 77;
-
-                               /* Gain the mutation */
-                               if (gain_mutation(p_ptr, mutation))
-                               {
-                                       msg_print(_("あなたは生きているカードに変わった。", "You have turned into a Living Trump."));
-                               }
-                       }
-               }
+               if (cast) become_living_trump(p_ptr);
                break;
 
        case 31:
index 4736321..8784042 100644 (file)
@@ -445,26 +445,7 @@ concptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("人間トランプ", "Living Trump");
                if (desc) return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。",
                        "Gives mutation which makes you teleport randomly or makes you able to teleport at will.");
-
-               {
-                       if (cast)
-                       {
-                               int mutation;
-
-                               if (one_in_(7))
-                                       /* Teleport control */
-                                       mutation = 12;
-                               else
-                                       /* Random teleportation (uncontrolled) */
-                                       mutation = 77;
-
-                               /* Gain the mutation */
-                               if (gain_mutation(p_ptr, mutation))
-                               {
-                                       msg_print(_("あなたは生きているカードに変わった。", "You have turned into a Living Trump."));
-                               }
-                       }
-               }
+               if (cast) become_living_trump(p_ptr);
                break;
 
        case 23: