OSDN Git Service

[Refactor] #37353 型の置換(C_MAKE)。 / Type replacement(C_MAKE).
[hengband/hengband.git] / src / spells-summon.c
index d3d305a..9a9fb93 100644 (file)
@@ -113,26 +113,15 @@ bool cast_summon_greater_demon(void)
 {\r
        PLAYER_LEVEL plev = p_ptr->lev;\r
        OBJECT_IDX item;\r
-       cptr q, s;\r
+       concptr q, s;\r
        int summon_lev;\r
        object_type *o_ptr;\r
 \r
        item_tester_hook = item_tester_offer;\r
        q = _("どの死体を捧げますか? ", "Sacrifice which corpse? ");\r
        s = _("捧げられる死体を持っていない。", "You have nothing to scrifice.");\r
-       if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return FALSE;\r
-\r
-       /* Get the item (in the pack) */\r
-       if (item >= 0)\r
-       {\r
-               o_ptr = &inventory[item];\r
-       }\r
-\r
-       /* Get the item (on the floor) */\r
-       else\r
-       {\r
-               o_ptr = &o_list[0 - item];\r
-       }\r
+       o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));\r
+       if (!o_ptr) return FALSE;\r
 \r
        summon_lev = plev * 2 / 3 + r_info[o_ptr->pval].level;\r
 \r
@@ -176,6 +165,7 @@ bool cast_summon_greater_demon(void)
 bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)\r
 {\r
        bool pet = (bool)(mode & PM_FORCE_PET);\r
+       SYMBOL_CODE symbol = '\0';\r
        if (!pet) mode |= PM_NO_PET;\r
 \r
        switch (p_ptr->mimic_form)\r
@@ -188,7 +178,7 @@ bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
                case RACE_BARBARIAN:\r
                case RACE_BEASTMAN:\r
                case RACE_DUNADAN:\r
-                       summon_kin_type = 'p';\r
+                       symbol = 'p';\r
                        break;\r
                case RACE_HALF_ELF:\r
                case RACE_ELF:\r
@@ -201,82 +191,82 @@ bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
                case RACE_MIND_FLAYER:\r
                case RACE_KUTAR:\r
                case RACE_S_FAIRY:\r
-                       summon_kin_type = 'h';\r
+                       symbol = 'h';\r
                        break;\r
                case RACE_HALF_ORC:\r
-                       summon_kin_type = 'o';\r
+                       symbol = 'o';\r
                        break;\r
                case RACE_HALF_TROLL:\r
-                       summon_kin_type = 'T';\r
+                       symbol = 'T';\r
                        break;\r
                case RACE_HALF_OGRE:\r
-                       summon_kin_type = 'O';\r
+                       symbol = 'O';\r
                        break;\r
                case RACE_HALF_GIANT:\r
                case RACE_HALF_TITAN:\r
                case RACE_CYCLOPS:\r
-                       summon_kin_type = 'P';\r
+                       symbol = 'P';\r
                        break;\r
                case RACE_YEEK:\r
-                       summon_kin_type = 'y';\r
+                       symbol = 'y';\r
                        break;\r
                case RACE_KLACKON:\r
-                       summon_kin_type = 'K';\r
+                       symbol = 'K';\r
                        break;\r
                case RACE_KOBOLD:\r
-                       summon_kin_type = 'k';\r
+                       symbol = 'k';\r
                        break;\r
                case RACE_IMP:\r
-                       if (one_in_(13)) summon_kin_type = 'U';\r
-                       else summon_kin_type = 'u';\r
+                       if (one_in_(13)) symbol = 'U';\r
+                       else symbol = 'u';\r
                        break;\r
                case RACE_DRACONIAN:\r
-                       summon_kin_type = 'd';\r
+                       symbol = 'd';\r
                        break;\r
                case RACE_GOLEM:\r
                case RACE_ANDROID:\r
-                       summon_kin_type = 'g';\r
+                       symbol = 'g';\r
                        break;\r
                case RACE_SKELETON:\r
-                       if (one_in_(13)) summon_kin_type = 'L';\r
-                       else summon_kin_type = 's';\r
+                       if (one_in_(13)) symbol = 'L';\r
+                       else symbol = 's';\r
                        break;\r
                case RACE_ZOMBIE:\r
-                       summon_kin_type = 'z';\r
+                       symbol = 'z';\r
                        break;\r
                case RACE_VAMPIRE:\r
-                       summon_kin_type = 'V';\r
+                       symbol = 'V';\r
                        break;\r
                case RACE_SPECTRE:\r
-                       summon_kin_type = 'G';\r
+                       symbol = 'G';\r
                        break;\r
                case RACE_SPRITE:\r
-                       summon_kin_type = 'I';\r
+                       symbol = 'I';\r
                        break;\r
                case RACE_ENT:\r
-                       summon_kin_type = '#';\r
+                       symbol = '#';\r
                        break;\r
                case RACE_ANGEL:\r
-                       summon_kin_type = 'A';\r
+                       symbol = 'A';\r
                        break;\r
                case RACE_DEMON:\r
-                       summon_kin_type = 'U';\r
+                       symbol = 'U';\r
                        break;\r
                default:\r
-                       summon_kin_type = 'p';\r
+                       symbol = 'p';\r
                        break;\r
                }\r
                break;\r
        case MIMIC_DEMON:\r
-               if (one_in_(13)) summon_kin_type = 'U';\r
-               else summon_kin_type = 'u';\r
+               if (one_in_(13)) symbol = 'U';\r
+               else symbol = 'u';\r
                break;\r
        case MIMIC_DEMON_LORD:\r
-               summon_kin_type = 'U';\r
+               symbol = 'U';\r
                break;\r
        case MIMIC_VAMPIRE:\r
-               summon_kin_type = 'V';\r
+               symbol = 'V';\r
                break;\r
        }\r
-       return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode, '\0');\r
+       return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode, symbol);\r
 }\r