OSDN Git Service

ケケソキ
[hengbandforosx/hengbandosx.git] / src / mane.c
index 9cfa440..79a8d03 100644 (file)
@@ -15,7 +15,7 @@
 
 static int damage;
 
-void mane_info(char *p, int power, int dam)
+static void mane_info(char *p, int power, int dam)
 {
        int plev = p_ptr->lev;
 #ifdef JP
@@ -111,7 +111,7 @@ cptr            p = "ǽ
        /* No redraw yet */
        redraw = FALSE;
 
-       num = mane_num;
+       num = p_ptr->mane_num;
 
        /* Build a prompt (accept all spells) */
 #ifdef JP
@@ -163,7 +163,7 @@ put_str("
                                for (i = 0; i < num; i++)
                                {
                                        /* Access the spell */
-                                       spell = monster_powers[mane_spell[i]];
+                                       spell = monster_powers[p_ptr->mane_spell[i]];
 
                                        chance = spell.manefail;
 
@@ -173,11 +173,9 @@ put_str("
                                        /* Reduce failure rate by INT/WIS adjustment */
                                        chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[spell.use_stat]] + adj_mag_stat[p_ptr->stat_ind[A_DEX]] - 2) / 2;
 
-                                       if (spell.manedam) chance = chance * mane_dam[i] / spell.manedam;
+                                       if (spell.manedam) chance = chance * p_ptr->mane_dam[i] / spell.manedam;
 
-                                       if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
-                                       if (p_ptr->pseikaku == SEIKAKU_KIREMONO) chance -= 3;
-                                       if ((p_ptr->pseikaku == SEIKAKU_GAMAN) || (p_ptr->pseikaku == SEIKAKU_CHIKARA)) chance++;
+                                       chance += p_ptr->to_m_chance;
 
                                        /* Extract the minimum failure rate */
                                        minfail = adj_mag_fail[p_ptr->stat_ind[spell.use_stat]];
@@ -193,7 +191,7 @@ put_str("
                                        if (chance > 95) chance = 95;
 
                                        /* Get info */
-                                       mane_info(comment, mane_spell[i], (baigaesi ? mane_dam[i]*2 : mane_dam[i]));
+                                       mane_info(comment, p_ptr->mane_spell[i], (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]));
 
                                        /* Dump the spell --(-- */
                                        sprintf(psi_desc, "  %c) %-30s %3d%%%s",
@@ -237,7 +235,7 @@ put_str("
                }
 
                /* Save the spell index */
-               spell = monster_powers[mane_spell[i]];
+               spell = monster_powers[p_ptr->mane_spell[i]];
 
                /* Verify it */
                if (ask)
@@ -246,9 +244,9 @@ put_str("
 
                        /* Prompt */
 #ifdef JP
-(void) strnfmt(tmp_val, 78, "%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©", monster_powers[mane_spell[i]].name);
+(void) strnfmt(tmp_val, 78, "%s¤ò¤Þ¤Í¤Þ¤¹¤«¡©", monster_powers[p_ptr->mane_spell[i]].name);
 #else
-                       (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[mane_spell[i]].name);
+                       (void)strnfmt(tmp_val, 78, "Use %s? ", monster_powers[p_ptr->mane_spell[i]].name);
 #endif
 
 
@@ -279,7 +277,7 @@ put_str("
        /* Save the choice */
        (*sn) = i;
 
-       damage = (baigaesi ? mane_dam[i]*2 : mane_dam[i]);
+       damage = (baigaesi ? p_ptr->mane_dam[i]*2 : p_ptr->mane_dam[i]);
 
        /* Success */
        return (TRUE);
@@ -294,8 +292,10 @@ static bool use_mane(int spell)
 {
        int             dir;
        int             plev = p_ptr->lev;
-       bool    unique_okay = FALSE;
-       if (randint1(50+plev) < plev/10) unique_okay = TRUE;
+       u32b mode = (PM_ALLOW_GROUP | PM_FORCE_PET);
+       u32b u_mode = 0L;
+
+       if (randint1(50+plev) < plev/10) u_mode = PM_ALLOW_UNIQUE;
 
 
        /* spell code */
@@ -364,8 +364,7 @@ else msg_print("
                
                        fire_rocket(GF_ROCKET, dir, damage, 2);
                break;
-       case MS_ARROW_1:
-       case MS_ARROW_2:
+       case MS_SHOOT:
                if (!get_aim_dir(&dir)) return FALSE;
 #ifdef JP
 else msg_print("Ìð¤òÊü¤Ã¤¿¡£");
@@ -375,16 +374,11 @@ else msg_print("
                
                        fire_bolt(GF_ARROW, dir, damage);
                break;
-       case MS_ARROW_3:
-       case MS_ARROW_4:
-               if (!get_aim_dir(&dir)) return FALSE;
-#ifdef JP
-else msg_print("¥Ü¥ë¥È¤ò·â¤Ã¤¿¡£");
-#else
-                       else msg_print("You fires a bolt.");
-#endif
-               
-                       fire_bolt(GF_ARROW, dir, damage);
+       case MS_XXX2:
+               break;
+       case MS_XXX3:
+               break;
+       case MS_XXX4:
                break;
        case MS_BR_ACID:
                if (!get_aim_dir(&dir)) return FALSE;
@@ -943,7 +937,8 @@ msg_print("̵
                        msg_print("hek!");
                msg_print(NULL);
 
-               p_ptr->energy += (randint1(200)+1200);
+               /* Hack */
+               p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
 
                /* Redraw map */
                p_ptr->redraw |= (PR_MAP);
@@ -1083,7 +1078,7 @@ msg_print("
 #endif
                for (k = 0;k < 4; k++)
                {
-                       (void)summon_kin_player(TRUE, plev, target_row, target_col, TRUE);
+                       (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
                }
                break;
        }
@@ -1099,7 +1094,7 @@ msg_print("
 #endif
                if (max_cyber > 4) max_cyber = 4;
                for (k = 0;k < max_cyber; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, TRUE, TRUE, TRUE, FALSE, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
                break;
        }
        case MS_S_MONSTER:
@@ -1112,7 +1107,7 @@ msg_print("
                        msg_print("You summons help.");
 #endif
                for (k = 0;k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, 0, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
                break;
        }
        case MS_S_MONSTERS:
@@ -1125,7 +1120,7 @@ msg_print("
                        msg_print("You summons monsters!");
 #endif
                for (k = 0;k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, 0, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
                break;
        }
        case MS_S_ANT:
@@ -1138,7 +1133,7 @@ msg_print("
                        msg_print("You summons ants.");
 #endif
                for (k = 0;k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, TRUE, TRUE, TRUE, FALSE, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
                break;
        }
        case MS_S_SPIDER:
@@ -1151,7 +1146,7 @@ msg_print("
                        msg_print("You summons spiders.");
 #endif
                for (k = 0;k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, TRUE, TRUE, TRUE, FALSE, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
                break;
        }
        case MS_S_HOUND:
@@ -1164,7 +1159,7 @@ msg_print("
                        msg_print("You summons hounds.");
 #endif
                for (k = 0;k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, TRUE, TRUE, TRUE, FALSE, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
                break;
        }
        case MS_S_HYDRA:
@@ -1177,7 +1172,7 @@ msg_print("
                        msg_print("You summons hydras.");
 #endif
                for (k = 0;k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, TRUE, TRUE, TRUE, FALSE, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
                break;
        }
        case MS_S_ANGEL:
@@ -1190,7 +1185,7 @@ msg_print("ŷ
                        msg_print("You summons angel!");
 #endif
                for (k = 0;k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, TRUE, TRUE, TRUE, FALSE, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
                break;
        }
        case MS_S_DEMON:
@@ -1203,7 +1198,7 @@ msg_print("
                        msg_print("You summons a demon from the Courts of Chaos!");
 #endif
                for (k = 0;k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
                break;
        }
        case MS_S_UNDEAD:
@@ -1216,7 +1211,7 @@ msg_print("
                        msg_print("You summons an undead adversary!");
 #endif
                for (k = 0;k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
                break;
        }
        case MS_S_DRAGON:
@@ -1229,7 +1224,7 @@ msg_print("
                        msg_print("You summons dragon!");
 #endif
                for (k = 0;k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
                break;
        }
        case MS_S_HI_UNDEAD:
@@ -1242,7 +1237,7 @@ msg_print("
                        msg_print("You summons greater undead!");
 #endif
                for (k = 0;k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
                break;
        }
        case MS_S_HI_DRAGON:
@@ -1255,7 +1250,7 @@ msg_print("
                        msg_print("You summons ancient dragons!");
 #endif
                for (k = 0;k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
                break;
        }
        case MS_S_AMBERITE:
@@ -1263,12 +1258,12 @@ msg_print("
                int k;
                if (!target_set(TARGET_KILL)) return FALSE;
 #ifdef JP
-msg_print("¥¢¥ó¥Ð¡¼¤Î²¦¤ò¾¤´­¤·¤¿¡ª");
+msg_print("¥¢¥ó¥Ð¡¼¤Î²¦²¤ò¾¤´­¤·¤¿¡ª");
 #else
                        msg_print("You summons Lords of Amber!");
 #endif
                for (k = 0;k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, TRUE, TRUE, TRUE, TRUE, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
                break;
        }
        case MS_S_UNIQUE:
@@ -1281,9 +1276,9 @@ msg_print("
                        msg_print("You summons special opponents!");
 #endif
                for (k = 0;k < 4; k++)
-                       if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, TRUE, TRUE, TRUE, TRUE, FALSE)) count++;
+                       if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
                for (k = count;k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, TRUE, TRUE, TRUE, unique_okay, FALSE);
+                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
                break;
        }
        default:
@@ -1320,7 +1315,7 @@ msg_print("
                return TRUE;
        }
 
-       if (!mane_num)
+       if (!p_ptr->mane_num)
        {
 #ifdef JP
 msg_print("¤Þ¤Í¤é¤ì¤ë¤â¤Î¤¬²¿¤â¤Ê¤¤¡ª");
@@ -1334,7 +1329,7 @@ msg_print("
        /* get power */
        if (!get_mane_power(&n, baigaesi)) return FALSE;
 
-       spell = monster_powers[mane_spell[n]];
+       spell = monster_powers[p_ptr->mane_spell[n]];
 
        /* Spell failure chance */
        chance = spell.manefail;
@@ -1380,16 +1375,16 @@ msg_print("
                sound(SOUND_ZAP);
 
                /* Cast the spell */
-               cast = use_mane(mane_spell[n]);
+               cast = use_mane(p_ptr->mane_spell[n]);
 
                if (!cast) return FALSE;
        }
 
-       mane_num--;
-       for (j = n; j < mane_num;j++)
+       p_ptr->mane_num--;
+       for (j = n; j < p_ptr->mane_num;j++)
        {
-               mane_spell[j] = mane_spell[j+1];
-               mane_dam[j] = mane_dam[j+1];
+               p_ptr->mane_spell[j] = p_ptr->mane_spell[j+1];
+               p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
        }
 
        /* Take a turn */