* 使用されていない変数はコメントアウトではなく削除した.
* 英語版や他のプラットフォームとの互換をとるためにどうしても必要な部分の警告は
除去できなかった.
* 他のコンパイラでは別の警告が残っている, もしくは新たに警告されるかもしれない.
* 警告を黙らせる必要も薄れたので, makefile.bccからは -w- を除去.
cptr virtue[MAX_VIRTUE] =
{
#ifdef JP
- "¾ð",
-#else
- "Compassion",
-#endif
-
-#ifdef JP
- "ÍÀ",
-#else
- "Honour",
-#endif
-
-#ifdef JP
- "˵",
-#else
- "Justice",
-#endif
-
-#ifdef JP
- "µ¾",
-#else
- "Sacrifice",
-#endif
-
-#ifdef JP
- "¼±",
-#else
- "Knowledge",
-#endif
-
-#ifdef JP
- "À¿",
-#else
- "Faith",
-#endif
-
-#ifdef JP
- "·¼",
-#else
- "Enlightenment",
-#endif
-
-#ifdef JP
- "Èë",
-#else
- "Mysticism",
-#endif
-
-#ifdef JP
- "±¿",
-#else
- "Chance",
-#endif
-
-#ifdef JP
-"Á³",
-#else
- "Nature",
-#endif
-
-#ifdef JP
- "Ĵ",
-#else
- "Harmony",
-#endif
-
-#ifdef JP
- "³è",
-#else
- "Vitality",
+ "¾ð",
+ "ÍÀ",
+ "˵",
+ "µ¾",
+ "¼±",
+ "À¿",
+ "·¼",
+ "Èë",
+ "±¿",
+ "Á³",
+ "Ĵ",
+ "³è",
+ "Ȉ",
+ "Ǧ",
+ "Àá",
+ "¶Ð",
+ "ͦ",
+ "¸Ä",
+#else
+ "Compassion",
+ "Honour",
+ "Justice",
+ "Sacrifice",
+ "Knowledge",
+ "Faith",
+ "Enlightenment",
+ "Mysticism",
+ "Chance",
+ "Nature",
+ "Harmony",
+ "Vitality",
+ "Unlife",
+ "Patience",
+ "Temperance",
+ "Diligence",
+ "Valour",
+ "Individualism",
#endif
-
-#ifdef JP
- "Ȉ",
-#else
- "Unlife",
-#endif
-
-#ifdef JP
- "Ǧ",
-#else
- "Patience",
-#endif
-
-#ifdef JP
- "Àá",
-#else
- "Temperance",
-#endif
-
-#ifdef JP
- "¶Ð",
-#else
- "Diligence",
-#endif
-
-#ifdef JP
- "ͦ",
-#else
- "Valour",
-#endif
-
-#ifdef JP
- "¸Ä",
-#else
- "Individualism",
-#endif
-
};
bool compare_virtue(int type, int num, int tekitou)
{
- int vir;
- if (virtue_number(type))
- vir = p_ptr->virtues[virtue_number(type)-1];
- else
- vir = 0;
-
- switch(tekitou)
- {
- case VIRTUE_LARGE:
- if (vir > num) return TRUE;
- else return FALSE;
- break;
- case VIRTUE_SMALL:
- if (vir < num) return TRUE;
- else return FALSE;
- break;
- default:
- break;
- }
- return FALSE;
+ int vir;
+ if (virtue_number(type))
+ vir = p_ptr->virtues[virtue_number(type) - 1];
+ else
+ vir = 0;
+
+ switch (tekitou)
+ {
+ case VIRTUE_LARGE:
+ if (vir > num) return TRUE;
+ else return FALSE;
+ case VIRTUE_SMALL:
+ if (vir < num) return TRUE;
+ else return FALSE;
+ }
+
+ return FALSE;
}
int virtue_number(int type)
{
- int i;
-
- /* Search */
- for (i = 0; i < 8; i++)
- {
- if (p_ptr->vir_types[i] == type) return i+1;
- }
+ int i;
+ /* Search */
+ for (i = 0; i < 8; i++)
+ {
+ if (p_ptr->vir_types[i] == type) return i + 1;
+ }
- /* No match */
- return 0;
-
+ /* No match */
+ return 0;
}
/* Aux function */
static void get_random_virtue(int which)
{
- int type = 0;
+ int type = 0;
- /* Randomly choose a type */
- while (!(type) || virtue_number(type))
- {
- switch (randint1(29))
- {
- case 1: case 2: case 3:
- type = V_SACRIFICE;
- break;
- case 4: case 5: case 6:
- type = V_COMPASSION;
- break;
- case 7: case 8: case 9: case 10: case 11: case 12:
- type = V_VALOUR;
- break;
- case 13: case 14: case 15: case 16: case 17:
- type = V_HONOUR;
- break;
- case 18: case 19: case 20: case 21:
- type = V_JUSTICE;
- break;
- case 22: case 23:
- type = V_TEMPERANCE;
- break;
- case 24: case 25:
- type = V_HARMONY;
- break;
- case 26: case 27: case 28:
- type = V_PATIENCE;
- break;
- default:
- type = V_DILIGENCE;
- }
- }
-
- /* Chosen */
-
- p_ptr->vir_types[which] = type;
+ /* Randomly choose a type */
+ while (!(type) || virtue_number(type))
+ {
+ switch (randint1(29))
+ {
+ case 1: case 2: case 3:
+ type = V_SACRIFICE;
+ break;
+ case 4: case 5: case 6:
+ type = V_COMPASSION;
+ break;
+ case 7: case 8: case 9: case 10: case 11: case 12:
+ type = V_VALOUR;
+ break;
+ case 13: case 14: case 15: case 16: case 17:
+ type = V_HONOUR;
+ break;
+ case 18: case 19: case 20: case 21:
+ type = V_JUSTICE;
+ break;
+ case 22: case 23:
+ type = V_TEMPERANCE;
+ break;
+ case 24: case 25:
+ type = V_HARMONY;
+ break;
+ case 26: case 27: case 28:
+ type = V_PATIENCE;
+ break;
+ default:
+ type = V_DILIGENCE;
+ break;
+ }
+ }
+ /* Chosen */
+ p_ptr->vir_types[which] = type;
}
-/* Select virtues & reset values for a new character */
-
-void get_virtues(void)
+static s16b get_realm_virtues(byte realm)
{
- int i = 0, j = 0;
-
- /* Reset */
- for (i = 0; i < 8; i++)
- {
- p_ptr->virtues[i]=0;
- p_ptr->vir_types[i]=0;
- }
-
- i = 0;
-
- /* Get pre-defined types */
- /* 1 or more virtues based on class */
- switch (p_ptr->pclass)
- {
- case CLASS_WARRIOR:
- case CLASS_SAMURAI:
- p_ptr->vir_types[i++] = V_VALOUR;
- p_ptr->vir_types[i++] = V_HONOUR;
- break;
- case CLASS_MAGE:
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- p_ptr->vir_types[i++] = V_ENCHANT;
- break;
- case CLASS_PRIEST:
- p_ptr->vir_types[i++] = V_FAITH;
- p_ptr->vir_types[i++] = V_TEMPERANCE;
- break;
- case CLASS_ROGUE:
- p_ptr->vir_types[i++] = V_HONOUR;
- break;
- case CLASS_RANGER:
- case CLASS_ARCHER:
- p_ptr->vir_types[i++] = V_NATURE;
- p_ptr->vir_types[i++] = V_TEMPERANCE;
- break;
- case CLASS_PALADIN:
- p_ptr->vir_types[i++] = V_JUSTICE;
- p_ptr->vir_types[i++] = V_VALOUR;
- p_ptr->vir_types[i++] = V_HONOUR;
- p_ptr->vir_types[i++] = V_FAITH;
- break;
- case CLASS_WARRIOR_MAGE:
- case CLASS_RED_MAGE:
- p_ptr->vir_types[i++] = V_ENCHANT;
- p_ptr->vir_types[i++] = V_VALOUR;
- break;
- case CLASS_CHAOS_WARRIOR:
- p_ptr->vir_types[i++] = V_CHANCE;
- p_ptr->vir_types[i++] = V_INDIVIDUALISM;
- break;
- case CLASS_MONK:
- case CLASS_FORCETRAINER:
- p_ptr->vir_types[i++] = V_FAITH;
- p_ptr->vir_types[i++] = V_HARMONY;
- p_ptr->vir_types[i++] = V_TEMPERANCE;
- p_ptr->vir_types[i++] = V_PATIENCE;
- break;
- case CLASS_MINDCRAFTER:
- case CLASS_MIRROR_MASTER:
- p_ptr->vir_types[i++] = V_HARMONY;
- p_ptr->vir_types[i++] = V_ENLIGHTEN;
- p_ptr->vir_types[i++] = V_PATIENCE;
- break;
- case CLASS_HIGH_MAGE:
- case CLASS_SORCERER:
- p_ptr->vir_types[i++] = V_ENLIGHTEN;
- p_ptr->vir_types[i++] = V_ENCHANT;
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
- case CLASS_TOURIST:
- p_ptr->vir_types[i++] = V_ENLIGHTEN;
- p_ptr->vir_types[i++] = V_CHANCE;
- break;
- case CLASS_IMITATOR:
- p_ptr->vir_types[i++] = V_CHANCE;
- break;
- case CLASS_BLUE_MAGE:
- p_ptr->vir_types[i++] = V_CHANCE;
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
- case CLASS_BEASTMASTER:
- p_ptr->vir_types[i++] = V_NATURE;
- p_ptr->vir_types[i++] = V_CHANCE;
- p_ptr->vir_types[i++] = V_VITALITY;
- break;
- case CLASS_MAGIC_EATER:
- p_ptr->vir_types[i++] = V_ENCHANT;
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
- case CLASS_BARD:
- p_ptr->vir_types[i++] = V_HARMONY;
- p_ptr->vir_types[i++] = V_COMPASSION;
- break;
- case CLASS_CAVALRY:
- p_ptr->vir_types[i++] = V_VALOUR;
- p_ptr->vir_types[i++] = V_HARMONY;
- break;
- case CLASS_BERSERKER:
- p_ptr->vir_types[i++] = V_VALOUR;
- p_ptr->vir_types[i++] = V_INDIVIDUALISM;
- break;
- case CLASS_SMITH:
- p_ptr->vir_types[i++] = V_HONOUR;
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
- case CLASS_NINJA:
- p_ptr->vir_types[i++] = V_PATIENCE;
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- p_ptr->vir_types[i++] = V_FAITH;
- p_ptr->vir_types[i++] = V_UNLIFE;
- break;
-
- };
-
-
- /* Get one virtue based on race */
- switch (p_ptr->prace)
- {
- case RACE_HUMAN: case RACE_HALF_ELF: case RACE_DUNADAN:
- p_ptr->vir_types[i++] = V_INDIVIDUALISM;
- break;
- case RACE_ELF: case RACE_SPRITE: case RACE_ENT:
- p_ptr->vir_types[i++] = V_NATURE;
- break;
- case RACE_HOBBIT: case RACE_HALF_OGRE:
- p_ptr->vir_types[i++] = V_TEMPERANCE;
- break;
- case RACE_DWARF: case RACE_KLACKON: case RACE_ANDROID:
- p_ptr->vir_types[i++] = V_DILIGENCE;
- break;
- case RACE_GNOME: case RACE_CYCLOPS:
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
- case RACE_HALF_ORC: case RACE_AMBERITE: case RACE_KOBOLD:
- p_ptr->vir_types[i++] = V_HONOUR;
- break;
- case RACE_HALF_TROLL: case RACE_BARBARIAN:
- p_ptr->vir_types[i++] = V_VALOUR;
- break;
- case RACE_HIGH_ELF: case RACE_KUTA:
- p_ptr->vir_types[i++] = V_VITALITY;
- break;
- case RACE_HALF_GIANT: case RACE_GOLEM: case RACE_ANGEL: case RACE_DEMON:
- p_ptr->vir_types[i++] = V_JUSTICE;
- break;
- case RACE_HALF_TITAN:
- p_ptr->vir_types[i++] = V_HARMONY;
- break;
- case RACE_YEEK:
- p_ptr->vir_types[i++] = V_SACRIFICE;
- break;
- case RACE_MIND_FLAYER:
- p_ptr->vir_types[i++] = V_ENLIGHTEN;
- break;
- case RACE_DARK_ELF: case RACE_DRACONIAN: case RACE_S_FAIRY:
- p_ptr->vir_types[i++] = V_ENCHANT;
- break;
- case RACE_NIBELUNG:
- p_ptr->vir_types[i++] = V_PATIENCE;
- break;
- case RACE_IMP:
- p_ptr->vir_types[i++] = V_FAITH;
- break;
- case RACE_ZOMBIE: case RACE_SKELETON:
- case RACE_VAMPIRE: case RACE_SPECTRE:
- p_ptr->vir_types[i++] = V_UNLIFE;
- break;
- case RACE_BEASTMAN:
- p_ptr->vir_types[i++] = V_CHANCE;
- break;
- }
-
- /* Get a virtue for realm1 */
- if (p_ptr->realm1)
- {
- switch(p_ptr->realm1)
- {
- case REALM_LIFE:
- if (virtue_number(V_VITALITY))
- p_ptr->vir_types[i++] = V_TEMPERANCE;
- else p_ptr->vir_types[i++] = V_VITALITY;
- break;
- case REALM_SORCERY:
- if (virtue_number(V_KNOWLEDGE))
- p_ptr->vir_types[i++] = V_ENCHANT;
- else p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
- case REALM_NATURE:
- if (virtue_number(V_NATURE))
- p_ptr->vir_types[i++] = V_HARMONY;
- else p_ptr->vir_types[i++] = V_NATURE;
- break;
- case REALM_CHAOS:
- if (virtue_number(V_CHANCE))
- p_ptr->vir_types[i++] = V_INDIVIDUALISM;
- else p_ptr->vir_types[i++] = V_CHANCE;
- break;
- case REALM_DEATH:
- p_ptr->vir_types[i++] = V_UNLIFE;
- break;
- case REALM_TRUMP:
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
- case REALM_ARCANE:
- break;
- case REALM_ENCHANT:
- if (virtue_number(V_ENCHANT))
- p_ptr->vir_types[i++] = V_INDIVIDUALISM;
- else p_ptr->vir_types[i++] = V_ENCHANT;
- break;
- case REALM_DAEMON:
- if (virtue_number(V_JUSTICE))
- p_ptr->vir_types[i++] = V_FAITH;
- else p_ptr->vir_types[i++] = V_JUSTICE;
- break;
- case REALM_CRUSADE:
- if (virtue_number(V_JUSTICE))
- p_ptr->vir_types[i++] = V_HONOUR;
- else p_ptr->vir_types[i++] = V_JUSTICE;
- break;
- };
- }
-
- /* Get a virtue for realm2 */
-
- if (p_ptr->realm2)
- {
- switch(p_ptr->realm2)
- {
+ switch (realm)
+ {
case REALM_LIFE:
- if (virtue_number(V_VITALITY))
- p_ptr->vir_types[i++] = V_TEMPERANCE;
- else p_ptr->vir_types[i++] = V_VITALITY;
- break;
+ if (virtue_number(V_VITALITY)) return V_TEMPERANCE;
+ else return V_VITALITY;
case REALM_SORCERY:
- if (virtue_number(V_ENCHANT))
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- else p_ptr->vir_types[i++] = V_ENCHANT;
- break;
+ if (virtue_number(V_KNOWLEDGE)) return V_ENCHANT;
+ else return V_KNOWLEDGE;
case REALM_NATURE:
- if (virtue_number(V_NATURE))
- p_ptr->vir_types[i++] = V_HARMONY;
- else p_ptr->vir_types[i++] = V_NATURE;
- break;
+ if (virtue_number(V_NATURE)) return V_HARMONY;
+ else return V_NATURE;
case REALM_CHAOS:
- if (virtue_number(V_CHANCE))
- p_ptr->vir_types[i++] = V_INDIVIDUALISM;
- else p_ptr->vir_types[i++] = V_CHANCE;
- break;
+ if (virtue_number(V_CHANCE)) return V_INDIVIDUALISM;
+ else return V_CHANCE;
case REALM_DEATH:
- p_ptr->vir_types[i++] = V_UNLIFE;
- break;
+ return V_UNLIFE;
case REALM_TRUMP:
- p_ptr->vir_types[i++] = V_KNOWLEDGE;
- break;
+ return V_KNOWLEDGE;
case REALM_ARCANE:
- break;
+ return 0;
case REALM_ENCHANT:
- if (virtue_number(V_ENCHANT))
- p_ptr->vir_types[i++] = V_INDIVIDUALISM;
- else p_ptr->vir_types[i++] = V_ENCHANT;
- break;
+ if (virtue_number(V_ENCHANT)) return V_INDIVIDUALISM;
+ else return V_ENCHANT;
case REALM_DAEMON:
- if (virtue_number(V_JUSTICE))
- p_ptr->vir_types[i++] = V_FAITH;
- else p_ptr->vir_types[i++] = V_JUSTICE;
- break;
+ if (virtue_number(V_JUSTICE)) return V_FAITH;
+ else return V_JUSTICE;
case REALM_CRUSADE:
- if (virtue_number(V_JUSTICE))
- p_ptr->vir_types[i++] = V_HONOUR;
- else p_ptr->vir_types[i++] = V_JUSTICE;
- break;
- };
- }
-
- /* Eliminate doubles */
- for (i = 0; i < 8; i++)
- {
- for (j = i+1; j < 8; j++)
- {
- if ((p_ptr->vir_types[j] != 0)
- && (p_ptr->vir_types[j] == p_ptr->vir_types[i]))
- p_ptr->vir_types[j] = 0;
- }
- }
-
- /* Fill in the blanks */
-
- for (i = 0; i < 8; i++)
- {
- if (p_ptr->vir_types[i]==0) get_random_virtue(i);
- }
+ if (virtue_number(V_JUSTICE)) return V_HONOUR;
+ else return V_JUSTICE;
+ };
+
+ return 0;
}
-void chg_virtue(int virtue, int amount)
+/* Select virtues & reset values for a new character */
+
+void get_virtues(void)
{
- int i = 0;
+ int i = 0, j = 0;
+ s16b tmp_vir;
- for (i = 0; i < 8; i++)
- {
- if (p_ptr->vir_types[i] == virtue)
+ /* Reset */
+ for (i = 0; i < 8; i++)
{
- if (amount > 0)
- {
- if ((amount + p_ptr->virtues[i] > 50) && one_in_(2))
- {
- p_ptr->virtues[i] = MAX(p_ptr->virtues[i], 50);
- return;
- }
- if ((amount + p_ptr->virtues[i] > 80) && one_in_(2))
- {
- p_ptr->virtues[i] = MAX(p_ptr->virtues[i], 80);
- return;
- }
- if ((amount + p_ptr->virtues[i] > 100) && one_in_(2))
- {
- p_ptr->virtues[i] = MAX(p_ptr->virtues[i], 100);
- return;
- }
- if (amount + p_ptr->virtues[i] > 125)
- p_ptr->virtues[i] = 125;
- else
- p_ptr->virtues[i] = p_ptr->virtues[i] + amount;
- }
- else
- {
- if ((amount + p_ptr->virtues[i] < -50) && one_in_(2))
- {
- p_ptr->virtues[i] = MIN(p_ptr->virtues[i], -50);
- return;
- }
- if ((amount + p_ptr->virtues[i] < -80) && one_in_(2))
+ p_ptr->virtues[i] = 0;
+ p_ptr->vir_types[i] = 0;
+ }
+
+ i = 0;
+
+ /* Get pre-defined types */
+ /* 1 or more virtues based on class */
+ switch (p_ptr->pclass)
+ {
+ case CLASS_WARRIOR:
+ case CLASS_SAMURAI:
+ p_ptr->vir_types[i++] = V_VALOUR;
+ p_ptr->vir_types[i++] = V_HONOUR;
+ break;
+ case CLASS_MAGE:
+ p_ptr->vir_types[i++] = V_KNOWLEDGE;
+ p_ptr->vir_types[i++] = V_ENCHANT;
+ break;
+ case CLASS_PRIEST:
+ p_ptr->vir_types[i++] = V_FAITH;
+ p_ptr->vir_types[i++] = V_TEMPERANCE;
+ break;
+ case CLASS_ROGUE:
+ p_ptr->vir_types[i++] = V_HONOUR;
+ break;
+ case CLASS_RANGER:
+ case CLASS_ARCHER:
+ p_ptr->vir_types[i++] = V_NATURE;
+ p_ptr->vir_types[i++] = V_TEMPERANCE;
+ break;
+ case CLASS_PALADIN:
+ p_ptr->vir_types[i++] = V_JUSTICE;
+ p_ptr->vir_types[i++] = V_VALOUR;
+ p_ptr->vir_types[i++] = V_HONOUR;
+ p_ptr->vir_types[i++] = V_FAITH;
+ break;
+ case CLASS_WARRIOR_MAGE:
+ case CLASS_RED_MAGE:
+ p_ptr->vir_types[i++] = V_ENCHANT;
+ p_ptr->vir_types[i++] = V_VALOUR;
+ break;
+ case CLASS_CHAOS_WARRIOR:
+ p_ptr->vir_types[i++] = V_CHANCE;
+ p_ptr->vir_types[i++] = V_INDIVIDUALISM;
+ break;
+ case CLASS_MONK:
+ case CLASS_FORCETRAINER:
+ p_ptr->vir_types[i++] = V_FAITH;
+ p_ptr->vir_types[i++] = V_HARMONY;
+ p_ptr->vir_types[i++] = V_TEMPERANCE;
+ p_ptr->vir_types[i++] = V_PATIENCE;
+ break;
+ case CLASS_MINDCRAFTER:
+ case CLASS_MIRROR_MASTER:
+ p_ptr->vir_types[i++] = V_HARMONY;
+ p_ptr->vir_types[i++] = V_ENLIGHTEN;
+ p_ptr->vir_types[i++] = V_PATIENCE;
+ break;
+ case CLASS_HIGH_MAGE:
+ case CLASS_SORCERER:
+ p_ptr->vir_types[i++] = V_ENLIGHTEN;
+ p_ptr->vir_types[i++] = V_ENCHANT;
+ p_ptr->vir_types[i++] = V_KNOWLEDGE;
+ break;
+ case CLASS_TOURIST:
+ p_ptr->vir_types[i++] = V_ENLIGHTEN;
+ p_ptr->vir_types[i++] = V_CHANCE;
+ break;
+ case CLASS_IMITATOR:
+ p_ptr->vir_types[i++] = V_CHANCE;
+ break;
+ case CLASS_BLUE_MAGE:
+ p_ptr->vir_types[i++] = V_CHANCE;
+ p_ptr->vir_types[i++] = V_KNOWLEDGE;
+ break;
+ case CLASS_BEASTMASTER:
+ p_ptr->vir_types[i++] = V_NATURE;
+ p_ptr->vir_types[i++] = V_CHANCE;
+ p_ptr->vir_types[i++] = V_VITALITY;
+ break;
+ case CLASS_MAGIC_EATER:
+ p_ptr->vir_types[i++] = V_ENCHANT;
+ p_ptr->vir_types[i++] = V_KNOWLEDGE;
+ break;
+ case CLASS_BARD:
+ p_ptr->vir_types[i++] = V_HARMONY;
+ p_ptr->vir_types[i++] = V_COMPASSION;
+ break;
+ case CLASS_CAVALRY:
+ p_ptr->vir_types[i++] = V_VALOUR;
+ p_ptr->vir_types[i++] = V_HARMONY;
+ break;
+ case CLASS_BERSERKER:
+ p_ptr->vir_types[i++] = V_VALOUR;
+ p_ptr->vir_types[i++] = V_INDIVIDUALISM;
+ break;
+ case CLASS_SMITH:
+ p_ptr->vir_types[i++] = V_HONOUR;
+ p_ptr->vir_types[i++] = V_KNOWLEDGE;
+ break;
+ case CLASS_NINJA:
+ p_ptr->vir_types[i++] = V_PATIENCE;
+ p_ptr->vir_types[i++] = V_KNOWLEDGE;
+ p_ptr->vir_types[i++] = V_FAITH;
+ p_ptr->vir_types[i++] = V_UNLIFE;
+ break;
+ };
+
+ /* Get one virtue based on race */
+ switch (p_ptr->prace)
+ {
+ case RACE_HUMAN: case RACE_HALF_ELF: case RACE_DUNADAN:
+ p_ptr->vir_types[i++] = V_INDIVIDUALISM;
+ break;
+ case RACE_ELF: case RACE_SPRITE: case RACE_ENT:
+ p_ptr->vir_types[i++] = V_NATURE;
+ break;
+ case RACE_HOBBIT: case RACE_HALF_OGRE:
+ p_ptr->vir_types[i++] = V_TEMPERANCE;
+ break;
+ case RACE_DWARF: case RACE_KLACKON: case RACE_ANDROID:
+ p_ptr->vir_types[i++] = V_DILIGENCE;
+ break;
+ case RACE_GNOME: case RACE_CYCLOPS:
+ p_ptr->vir_types[i++] = V_KNOWLEDGE;
+ break;
+ case RACE_HALF_ORC: case RACE_AMBERITE: case RACE_KOBOLD:
+ p_ptr->vir_types[i++] = V_HONOUR;
+ break;
+ case RACE_HALF_TROLL: case RACE_BARBARIAN:
+ p_ptr->vir_types[i++] = V_VALOUR;
+ break;
+ case RACE_HIGH_ELF: case RACE_KUTA:
+ p_ptr->vir_types[i++] = V_VITALITY;
+ break;
+ case RACE_HALF_GIANT: case RACE_GOLEM: case RACE_ANGEL: case RACE_DEMON:
+ p_ptr->vir_types[i++] = V_JUSTICE;
+ break;
+ case RACE_HALF_TITAN:
+ p_ptr->vir_types[i++] = V_HARMONY;
+ break;
+ case RACE_YEEK:
+ p_ptr->vir_types[i++] = V_SACRIFICE;
+ break;
+ case RACE_MIND_FLAYER:
+ p_ptr->vir_types[i++] = V_ENLIGHTEN;
+ break;
+ case RACE_DARK_ELF: case RACE_DRACONIAN: case RACE_S_FAIRY:
+ p_ptr->vir_types[i++] = V_ENCHANT;
+ break;
+ case RACE_NIBELUNG:
+ p_ptr->vir_types[i++] = V_PATIENCE;
+ break;
+ case RACE_IMP:
+ p_ptr->vir_types[i++] = V_FAITH;
+ break;
+ case RACE_ZOMBIE: case RACE_SKELETON:
+ case RACE_VAMPIRE: case RACE_SPECTRE:
+ p_ptr->vir_types[i++] = V_UNLIFE;
+ break;
+ case RACE_BEASTMAN:
+ p_ptr->vir_types[i++] = V_CHANCE;
+ break;
+ }
+
+ /* Get a virtue for realms */
+ if (p_ptr->realm1)
+ {
+ tmp_vir = get_realm_virtues(p_ptr->realm1);
+ if (tmp_vir) p_ptr->vir_types[i++] = tmp_vir;
+ }
+ if (p_ptr->realm2)
+ {
+ tmp_vir = get_realm_virtues(p_ptr->realm2);
+ if (tmp_vir) p_ptr->vir_types[i++] = tmp_vir;
+ }
+
+ /* Eliminate doubles */
+ for (i = 0; i < 8; i++)
+ {
+ for (j = i + 1; j < 8; j++)
{
- p_ptr->virtues[i] = MIN(p_ptr->virtues[i], -80);
- return;
+ if ((p_ptr->vir_types[j] != 0) && (p_ptr->vir_types[j] == p_ptr->vir_types[i]))
+ p_ptr->vir_types[j] = 0;
}
- if ((amount + p_ptr->virtues[i] < -100) && one_in_(2))
+ }
+
+ /* Fill in the blanks */
+ for (i = 0; i < 8; i++)
+ {
+ if (p_ptr->vir_types[i] == 0) get_random_virtue(i);
+ }
+}
+
+void chg_virtue(int virtue, int amount)
+{
+ int i = 0;
+
+ for (i = 0; i < 8; i++)
+ {
+ if (p_ptr->vir_types[i] == virtue)
{
- p_ptr->virtues[i] = MIN(p_ptr->virtues[i], -100);
- return;
+ if (amount > 0)
+ {
+ if ((amount + p_ptr->virtues[i] > 50) && one_in_(2))
+ {
+ p_ptr->virtues[i] = MAX(p_ptr->virtues[i], 50);
+ return;
+ }
+ if ((amount + p_ptr->virtues[i] > 80) && one_in_(2))
+ {
+ p_ptr->virtues[i] = MAX(p_ptr->virtues[i], 80);
+ return;
+ }
+ if ((amount + p_ptr->virtues[i] > 100) && one_in_(2))
+ {
+ p_ptr->virtues[i] = MAX(p_ptr->virtues[i], 100);
+ return;
+ }
+ if (amount + p_ptr->virtues[i] > 125)
+ p_ptr->virtues[i] = 125;
+ else
+ p_ptr->virtues[i] = p_ptr->virtues[i] + amount;
+ }
+ else
+ {
+ if ((amount + p_ptr->virtues[i] < -50) && one_in_(2))
+ {
+ p_ptr->virtues[i] = MIN(p_ptr->virtues[i], -50);
+ return;
+ }
+ if ((amount + p_ptr->virtues[i] < -80) && one_in_(2))
+ {
+ p_ptr->virtues[i] = MIN(p_ptr->virtues[i], -80);
+ return;
+ }
+ if ((amount + p_ptr->virtues[i] < -100) && one_in_(2))
+ {
+ p_ptr->virtues[i] = MIN(p_ptr->virtues[i], -100);
+ return;
+ }
+ if (amount + p_ptr->virtues[i] < -125)
+ p_ptr->virtues[i] = -125;
+ else
+ p_ptr->virtues[i] = p_ptr->virtues[i] + amount;
+ }
+ p_ptr->update |= (PU_BONUS);
+ return;
}
- if (amount + p_ptr->virtues[i] < -125)
- p_ptr->virtues[i] = -125;
- else
- p_ptr->virtues[i] = p_ptr->virtues[i] + amount;
- }
- p_ptr->update |= (PU_BONUS);
- return;
}
- }
-
}
void set_virtue(int virtue, int amount)
{
- int i = 0;
+ int i = 0;
- for (i = 0; i < 8; i++)
- {
- if (p_ptr->vir_types[i] == virtue)
+ for (i = 0; i < 8; i++)
{
- p_ptr->virtues[i] = amount;
- return;
+ if (p_ptr->vir_types[i] == virtue)
+ {
+ p_ptr->virtues[i] = amount;
+ return;
+ }
}
- }
}
-void dump_virtues(FILE * OutFile)
+void dump_virtues(FILE *OutFile)
{
- int v_nr = 0;
+ int v_nr = 0;
- if (!OutFile) return;
+ if (!OutFile) return;
for (v_nr = 0; v_nr < 8; v_nr++)
{
char v_name [20];
-
int tester = p_ptr->virtues[v_nr];
strcpy(v_name, virtue[(p_ptr->vir_types[v_nr])-1]);
- if (p_ptr->vir_types[v_nr] == 0 || p_ptr->vir_types[v_nr] >
- MAX_VIRTUE)
+ if (p_ptr->vir_types[v_nr] == 0 || p_ptr->vir_types[v_nr] > MAX_VIRTUE)
#ifdef JP
- fprintf(OutFile, "¤ª¤Ã¤È¡£%s¤Î¾ðÊó¤Ê¤·¡£", v_name);
+ fprintf(OutFile, "¤ª¤Ã¤È¡£%s¤Î¾ðÊó¤Ê¤·¡£", v_name);
#else
- fprintf(OutFile, "Oops. No info about %s.", v_name);
+ fprintf(OutFile, "Oops. No info about %s.", v_name);
#endif
else if (tester < -100)
#ifdef JP
- fprintf(OutFile, "[%s]¤ÎÂжË",
+ fprintf(OutFile, "[%s]¤ÎÂжË",
#else
- fprintf(OutFile, "You are the polar opposite of %s.",
+ fprintf(OutFile, "You are the polar opposite of %s.",
#endif
- v_name);
+ v_name);
else if (tester < -80)
#ifdef JP
- fprintf(OutFile, "[%s]¤ÎÂçŨ",
+ fprintf(OutFile, "[%s]¤ÎÂçŨ",
#else
- fprintf(OutFile, "You are an arch-enemy of %s.",
+ fprintf(OutFile, "You are an arch-enemy of %s.",
#endif
- v_name);
+ v_name);
else if (tester < -60)
#ifdef JP
- fprintf(OutFile, "[%s]¤Î¶¯Å¨",
+ fprintf(OutFile, "[%s]¤Î¶¯Å¨",
#else
- fprintf(OutFile, "You are a bitter enemy of %s.",
+ fprintf(OutFile, "You are a bitter enemy of %s.",
#endif
- v_name);
+ v_name);
else if (tester < -40)
#ifdef JP
- fprintf(OutFile, "[%s]¤ÎŨ",
+ fprintf(OutFile, "[%s]¤ÎŨ",
#else
- fprintf(OutFile, "You are an enemy of %s.",
+ fprintf(OutFile, "You are an enemy of %s.",
#endif
- v_name);
+ v_name);
else if (tester < -20)
#ifdef JP
- fprintf(OutFile, "[%s]¤Îºá¼Ô",
+ fprintf(OutFile, "[%s]¤Îºá¼Ô",
#else
- fprintf(OutFile, "You have sinned against %s.",
+ fprintf(OutFile, "You have sinned against %s.",
#endif
- v_name);
+ v_name);
else if (tester < 0)
#ifdef JP
- fprintf(OutFile, "[%s]¤ÎÌÂÆ»¼Ô",
+ fprintf(OutFile, "[%s]¤ÎÌÂÆ»¼Ô",
#else
- fprintf(OutFile, "You have strayed from the path of %s.",
+ fprintf(OutFile, "You have strayed from the path of %s.",
#endif
- v_name);
- else if (tester == 0)
+ v_name);
+ else if (tester == 0)
#ifdef JP
- fprintf(OutFile,"[%s]¤ÎÃæΩ¼Ô",
+ fprintf(OutFile,"[%s]¤ÎÃæΩ¼Ô",
#else
- fprintf(OutFile,"You are neutral to %s.",
+ fprintf(OutFile,"You are neutral to %s.",
#endif
- v_name);
+ v_name);
else if (tester < 20)
#ifdef JP
- fprintf(OutFile,"[%s]¤Î¾®ÆÁ¼Ô",
+ fprintf(OutFile,"[%s]¤Î¾®ÆÁ¼Ô",
#else
- fprintf(OutFile,"You are somewhat virtuous in %s.",
+ fprintf(OutFile,"You are somewhat virtuous in %s.",
#endif
- v_name);
+ v_name);
else if (tester < 40)
#ifdef JP
- fprintf(OutFile,"[%s]¤ÎÃæÆÁ¼Ô",
+ fprintf(OutFile,"[%s]¤ÎÃæÆÁ¼Ô",
#else
- fprintf(OutFile,"You are virtuous in %s.",
+ fprintf(OutFile,"You are virtuous in %s.",
#endif
- v_name);
+ v_name);
else if (tester < 60)
#ifdef JP
- fprintf(OutFile,"[%s]¤Î¹âÆÁ¼Ô",
+ fprintf(OutFile,"[%s]¤Î¹âÆÁ¼Ô",
#else
- fprintf(OutFile,"You are very virtuous in %s.",
+ fprintf(OutFile,"You are very virtuous in %s.",
#endif
- v_name);
+ v_name);
else if (tester < 80)
#ifdef JP
- fprintf(OutFile,"[%s]¤ÎÇƼÔ",
+ fprintf(OutFile,"[%s]¤ÎÇƼÔ",
#else
- fprintf(OutFile,"You are a champion of %s.",
+ fprintf(OutFile,"You are a champion of %s.",
#endif
- v_name);
+ v_name);
else if (tester < 100)
#ifdef JP
- fprintf(OutFile,"[%s]¤Î°ÎÂç¤ÊÇƼÔ",
+ fprintf(OutFile,"[%s]¤Î°ÎÂç¤ÊÇƼÔ",
#else
- fprintf(OutFile,"You are a great champion of %s.",
+ fprintf(OutFile,"You are a great champion of %s.",
#endif
- v_name);
+ v_name);
else
#ifdef JP
- fprintf(OutFile,"[%s]¤Î¶ñ¸½¼Ô",
+ fprintf(OutFile,"[%s]¤Î¶ñ¸½¼Ô",
#else
- fprintf(OutFile,"You are the living embodiment of %s.",
+ fprintf(OutFile,"You are the living embodiment of %s.",
#endif
- v_name);
+ v_name);
fprintf(OutFile, "\n");
}
-
-
}
-
switch ( c ){
case 'Q':
birth_quit();
- break;
case 'S':
- return (FALSE);
- break;
+ return FALSE;
case ESCAPE:
break;
case ' ':
switch (c){
case 'Q':
birth_quit();
- break;
case 'S':
return (FALSE);
case ESCAPE:
void add_history_from_pref_line(cptr t)
{
- int line_size = strlen(t);
int limit = (sizeof histpref_buf) - 1;
int i;
void have_nightmare(int r_idx)
{
bool happened = FALSE;
-
- int power = 100;
-
monster_race *r_ptr = &r_info[r_idx];
-
+ int power = r_ptr->level + 10;
char m_name[80];
cptr desc = r_name + r_ptr->name;
-
- power = r_ptr->level + 10;
-
-#ifdef JP
- if (0)
-#else
+ /* Describe it */
+#ifndef JP
if (!(r_ptr->flags1 & RF1_UNIQUE))
-#endif
-
- {
- /* Describe it */
sprintf(m_name, "%s %s", (is_a_vowel(desc[0]) ? "an" : "a"), desc);
-
- if (r_ptr->flags1 & RF1_FRIENDS)
- {
- power /= 2;
- }
- }
else
- {
- /* Describe it */
+#endif
sprintf(m_name, "%s", desc);
- power *= 2;
+ if (!(r_ptr->flags1 & RF1_UNIQUE))
+ {
+ if (r_ptr->flags1 & RF1_FRIENDS) power /= 2;
}
+ else power *= 2;
if (saving_throw(p_ptr->skill_sav * 100 / power))
{
#ifdef JP
- msg_format("Ì´¤ÎÃæ¤Ç%s¤ËÄɤ¤¤«¤±¤é¤ì¤¿¡£", m_name);
+ msg_format("Ì´¤ÎÃæ¤Ç%s¤ËÄɤ¤¤«¤±¤é¤ì¤¿¡£", m_name);
#else
- msg_format("%^s chases you through your dreams.", m_name);
+ msg_format("%^s chases you through your dreams.", m_name);
#endif
-
/* Safe */
return;
}
{
/* Something silly happens... */
#ifdef JP
-msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
+ msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
#else
msg_format("You behold the %s visage of %s!",
#endif
/* Something frightening happens... */
#ifdef JP
-msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
+ msg_format("%s%s¤Î´é¤ò¸«¤Æ¤·¤Þ¤Ã¤¿¡ª",
#else
msg_format("You behold the %s visage of %s!",
#endif
r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
- switch(p_ptr->prace)
+ switch (p_ptr->prace)
{
/* Imps may make a saving throw */
case RACE_IMP:
int bact = bldg->actions[i];
int bcost;
bool paid = FALSE;
- bool set_reward = FALSE;
int amt;
/* Flush messages XXX XXX XXX */
return;
}
- if (!bcost) set_reward = TRUE;
-
switch (bact)
{
case BACT_NOTHING:
- /* Do nothing */
+ /* Do nothing */
break;
case BACT_RESEARCH_ITEM:
paid = identify_fully(FALSE);
case 10000: return 25000;
default: return 0;
}
-
- return 0; /* Paranoia */
}
/* Process the monsters (backwards) */
for (i = m_max - 1; i >= 1; i--)
{
- monster_race *r_ptr;
/* Access the monster */
m_ptr = &m_list[i];
/* Ignore "dead" monsters */
if (!m_ptr->r_idx) continue;
- r_ptr = &r_info[m_ptr->r_idx];
/* Calculate "upkeep" for pets */
if (is_pet(m_ptr))
/* Get a spell from the user */
- choice = (always_show_list || use_menu) ? ESCAPE:1;
+ choice = (always_show_list || use_menu) ? ESCAPE : 1;
while (!flag)
{
- if( choice==ESCAPE ) choice = ' ';
- else if( !get_com(out_val, &choice, TRUE) )break;
+ if (choice == ESCAPE) choice = ' ';
+ else if (!get_com(out_val, &choice, TRUE))break;
if (use_menu && choice != ' ')
{
- switch(choice)
+ switch (choice)
{
case '0':
{
screen_load();
- return (FALSE);
- break;
+ return FALSE;
}
case '8':
/* Abort if needed */
- if (!flag) return (FALSE);
+ if (!flag) return FALSE;
/* Save the choice */
(*sn) = spell;
#endif /* ALLOW_REPEAT -- TNB */
/* Success */
- return (TRUE);
+ return TRUE;
}
int item, sval, use_realm = 0, j, line;
int spell = -1;
int num = 0;
- int increment = 0;
byte spells[64];
char temp[62*4];
object_type *o_ptr;
- magic_type *s_ptr;
cptr q, s;
sval = o_ptr->sval;
use_realm = tval2realm(o_ptr->tval);
- if ((p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_RED_MAGE) && is_magic(use_realm))
- {
- if (o_ptr->tval == REALM2_BOOK) increment = 32;
- else if (o_ptr->tval != REALM1_BOOK) increment = 64;
- }
/* Track the object kind */
object_kind_track(o_ptr->k_idx);
prt("No spells to browse.", 0, 0);
#endif
(void)inkey();
-
+
/* Restore the screen */
screen_load();
return;
- }
+ }
/* Clear lines, position cursor (really should use strlen here) */
Term_erase(14, 14, 255);
Term_erase(14, 12, 255);
Term_erase(14, 11, 255);
- /* Access the spell */
- if (!is_magic(use_realm))
- {
- s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
- }
- else
- {
- s_ptr = &mp_ptr->info[use_realm - 1][spell];
- }
-
- roff_to_buf(spell_tips[technic2magic(use_realm)-1][spell] ,62, temp, sizeof(temp));
- for(j=0, line = 11;temp[j];j+=(1+strlen(&temp[j])))
+ roff_to_buf(spell_tips[technic2magic(use_realm) - 1][spell], 62, temp, sizeof(temp));
+ for (j = 0, line = 11; temp[j]; j += 1 + strlen(&temp[j]))
{
prt(&temp[j], line, 15);
line++;
fire_ball_hide(GF_WOUNDS, dir, damroll(5+((plev - 5) / 3), 15), 0);
break;
case 21: /* Word of Recall */
- if (!word_of_recall()) return FALSE;
- break;
+ return word_of_recall();
case 22: /* Alter Reality */
alter_reality();
break;
break;
case 19: /* Teleport to town */
return tele_town();
- break;
case 20: /* Self knowledge */
(void)self_knowledge();
break;
(void)teleport_player_level();
break;
case 22: /* Word of Recall */
- if (!word_of_recall()) return FALSE;
- break;
+ return word_of_recall();
case 23: /* Dimension Door */
#ifdef JP
msg_print("¼¡¸µ¤ÎÈ⤬³«¤¤¤¿¡£ÌÜŪÃϤòÁª¤ó¤Ç²¼¤µ¤¤¡£");
int dir;
int beam;
int plev = p_ptr->lev;
- bool no_trump = FALSE;
if (p_ptr->pclass == CLASS_MAGE) beam = plev;
else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
break;
case 14: /* Summon Animals */
if (!(summon_specific(-1, py, px, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
- no_trump = TRUE;
+ {
+#ifdef JP
+ msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
+#else
+ msg_print("No animals arrive.");
+#endif
+ }
break;
case 15: /* Herbal Healing */
(void)hp_player(500);
msg_print(NULL);
}
- if (no_trump)
-#ifdef JP
-msg_print("ưʪ¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("No animals arrive.");
-#endif
-
-
return TRUE;
}
sleep_monsters();
hp_player(300);
}
- break;
}
break;
case 9: /* Chaos Bolt */
return ident_spell(FALSE);
else
return identify_fully(FALSE);
- break;
case 27: /* Mimic vampire */
(void)set_mimic(10+plev/2 + randint1(10+plev/2), MIMIC_VAMPIRE, FALSE);
break;
static bool cast_trump_spell(int spell, bool success)
{
int dir;
- int beam;
int plev = p_ptr->lev;
int summon_lev = plev * 2 / 3 + randint1(plev/2);
int dummy = 0;
bool no_trump = FALSE;
bool unique_okay = FALSE;
-
- if (p_ptr->pclass == CLASS_MAGE) beam = plev;
- else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
- else beam = plev / 2;
-
if (summon_lev < 1) summon_lev = 1;
if (!success || (randint1(50+plev) < plev/10)) unique_okay = TRUE;
switch (spell)
case 14: /* Word of Recall */
if (success)
{
- if (!word_of_recall()) return FALSE;
+ return word_of_recall();
}
break;
case 15: /* Banish */
int beam;
int plev = p_ptr->lev;
int dummy = 0;
- bool no_trump = FALSE;
if (p_ptr->pclass == CLASS_MAGE) beam = plev;
else if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER) beam = plev + 10;
break;
case 25: /* Conjure Elemental */
if (!summon_specific(-1, py, px, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
- no_trump = TRUE;
+ {
+#ifdef JP
+ msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
+#else
+ msg_print("No Elementals arrive.");
+#endif
+ }
break;
case 26: /* Teleport Level */
#ifdef JP
(void)detect_all(DETECT_RAD_DEFAULT);
break;
case 30: /* Word of Recall */
- if (!word_of_recall()) return FALSE;
- break;
+ return word_of_recall();
case 31: /* Clairvoyance */
chg_virtue(V_KNOWLEDGE, 1);
chg_virtue(V_ENLIGHTEN, 1);
msg_print(NULL);
}
- if (no_trump)
-#ifdef JP
-msg_print("¥¨¥ì¥á¥ó¥¿¥ë¤Ï¸½¤ì¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("No Elementals arrive.");
-#endif
-
return TRUE;
}
{
int plev = p_ptr->lev;
int dummy = 0;
- bool no_trump = FALSE;
switch (spell)
{
break;
case 15: /* Mana Branding */
return choose_ele_attack();
- break;
case 16: /* Telepathy */
(void)set_tim_esp(randint1(30) + 25, FALSE);
break;
if (summon_specific(-1, py, px, plev, SUMMON_GOLEM, PM_FORCE_PET))
{
#ifdef JP
-msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
+ msg_print("¥´¡¼¥ì¥à¤òºî¤Ã¤¿¡£");
#else
- msg_print("You make a golem.");
+ msg_print("You make a golem.");
#endif
}
else
{
- no_trump = TRUE;
+#ifdef JP
+ msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
+#else
+ msg_print("No Golems arrive.");
+#endif
}
break;
case 23: /* Magic armor */
break;
case 26: /* Total Knowledge */
return identify_fully(FALSE);
- break;
case 27: /* Enchant Weapon */
return enchant_spell(randint0(4) + 1, randint0(4) + 1, 0);
- break;
case 28: /* Enchant Armor */
return enchant_spell(0, 0, randint0(3) + 2);
- break;
case 29: /* Brand Weapon */
brand_weapon(randint0(18));
break;
#endif
break;
case 31: /* Immune */
- return (choose_ele_immune(13 + randint1(13)));
- break;
+ return choose_ele_immune(13 + randint1(13));
default:
msg_format("You cast an unknown Craft spell: %d.", spell);
msg_print(NULL);
}
- if (no_trump)
-#ifdef JP
-msg_print("¤¦¤Þ¤¯¥´¡¼¥ì¥à¤òºî¤ì¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("No Golems arrive.");
-#endif
-
return TRUE;
}
}
}
-static bool select_magic_eater(bool only_browse)
+static int select_magic_eater(bool only_browse)
{
int ext=0;
char choice;
- bool flag, redraw, request_list;
+ bool flag, request_list;
int tval = 0;
int ask = TRUE, i = 0;
char out_val[160];
/* Nothing chosen yet */
flag = FALSE;
- /* No redraw yet */
- redraw = FALSE;
-
/* Build a prompt */
#ifdef JP
(void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
}
}
- if(!get_com(out_val, &choice, FALSE)) break;
+ if (!get_com(out_val, &choice, FALSE)) break;
if (use_menu && choice != ' ')
{
- switch(choice)
+ switch (choice)
{
case '0':
{
screen_load();
- return (FALSE);
- break;
+ return 0;
}
case '8':
u32b need_mana;
/* Music singed by player */
- if(p_ptr->pclass != CLASS_BARD) return;
- if(!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
+ if (p_ptr->pclass != CLASS_BARD) return;
+ if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
spell = p_ptr->magic_num2[0];
s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
need_mana *= 0x8000;
- if (((u16b)(p_ptr->csp) < (need_mana / 0x10000)) || (p_ptr->anti_magic))
+ if (((u32b)p_ptr->csp < (need_mana / 0x10000)) || (p_ptr->anti_magic))
{
stop_singing();
return;
{
p_ptr->csp -= (u16b) (need_mana / 0x10000);
need_mana = (need_mana & 0xffff);
- if (p_ptr->csp_frac < need_mana)
+ if ((u32b)p_ptr->csp_frac < need_mana)
{
p_ptr->csp--;
p_ptr->csp_frac += (u16b)(0x10000L - need_mana);
object_type *o_ptr;
u32b flgs[TR_FLAG_SIZE];
- s16b k_idx;
byte a;
char c;
/* Access object */
o_ptr = &inventory[i];
- /* Object kind */
- k_idx = o_ptr->k_idx;
-
/* Acquire "known" flags */
object_flags_known(o_ptr, flgs);
char buf[1024];
int line, counter, test, numentries;
int line_num = 0;
- bool found = FALSE;
/* Build the filename */
if (buf[2] == '*')
{
/* Default lines */
- found = TRUE;
break;
}
else if (buf[2] == 'M')
{
if (r_info[entry].flags1 & RF1_MALE)
{
- found = TRUE;
break;
}
}
{
if (r_info[entry].flags1 & RF1_FEMALE)
{
- found = TRUE;
break;
}
}
/* Is it the right monster? */
if (test == entry)
{
- found = TRUE;
break;
}
}
bool aware = FALSE;
bool known = FALSE;
+#ifndef JP
bool append_name = FALSE;
+#endif
bool show_weapon = FALSE;
bool show_armour = FALSE;
/* Color the object */
modstr = amulet_adj[indexx];
- if (aware) append_name = TRUE;
-
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware ? "%¤Î¥¢¥ß¥å¥ì¥Ã¥È" : "¥¢¥ß¥å¥ì¥Ã¥È";
basenm = "& Amulet~";
else
basenm = aware ? "& # Amulet~" : "& # Amulet~";
+
+ if (aware) append_name = TRUE;
#endif
break;
/* Color the object */
modstr = ring_adj[indexx];
- if (aware) append_name = TRUE;
-
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware ? "%¤Î»ØÎØ" : "»ØÎØ";
basenm = "& Ring~";
else
basenm = aware ? "& # Ring~" : "& # Ring~";
+
+ if (aware) append_name = TRUE;
#endif
if (!k_ptr->to_h && !k_ptr->to_d && (o_ptr->to_h || o_ptr->to_d)) show_weapon = TRUE;
/* Color the object */
modstr = staff_adj[indexx];
- if (aware) append_name = TRUE;
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware ? "%¤Î¾ó" : "¾ó";
basenm = "& Staff~";
else
basenm = aware ? "& # Staff~" : "& # Staff~";
+
+ if (aware) append_name = TRUE;
#endif
break;
/* Color the object */
modstr = wand_adj[indexx];
- if (aware) append_name = TRUE;
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware? "%¤ÎËâË¡ËÀ":"ËâË¡ËÀ";
basenm = "& Wand~";
else
basenm = aware ? "& # Wand~" : "& # Wand~";
+
+ if (aware) append_name = TRUE;
#endif
break;
/* Color the object */
modstr = rod_adj[indexx];
- if (aware) append_name = TRUE;
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware? "%¤Î¥í¥Ã¥É":"¥í¥Ã¥É";
basenm = "& Rod~";
else
basenm = aware ? "& # Rod~" : "& # Rod~";
+
+ if (aware) append_name = TRUE;
#endif
break;
{
/* Color the object */
modstr = scroll_adj[indexx];
- if (aware) append_name = TRUE;
+
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware ? "%¤Î´¬Êª" : "´¬Êª";
basenm = "& Scroll~";
else
basenm = aware ? "& Scroll~ titled \"#\"" : "& Scroll~ titled \"#\"";
+
+ if (aware) append_name = TRUE;
#endif
break;
/* Color the object */
modstr = potion_adj[indexx];
- if (aware) append_name = TRUE;
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware ? "%¤ÎÌô" : "Ìô";
basenm = "& Potion~";
else
basenm = aware ? "& # Potion~" : "& # Potion~";
+
+ if (aware) append_name = TRUE;
#endif
break;
/* Color the object */
modstr = food_adj[indexx];
- if (aware) append_name = TRUE;
if (((plain_descriptions) && (aware)) || o_ptr->ident & IDENT_STOREB)
#ifdef JP
basenm = aware ? "%¤Î¥¥Î¥³" : "¥¥Î¥³";
basenm = "& Mushroom~";
else
basenm = aware ? "& # Mushroom~" : "& # Mushroom~";
+
+ if (aware) append_name = TRUE;
#endif
break;
{
if (known && o_ptr->name1) basenm = a_name + a_info[o_ptr->name1].name;
else basenm = get_object_name(o_ptr);
+#ifndef JP
append_name = FALSE;
+#endif
}
/* Start dumping the result */
{
int x3, y3, dx, dy;
int changex, changey;
- int midval;
int length;
int i;
bool retval, firstsuccede;
x3 = (x1 + x2) / 2;
y3 = (y1 + y2) / 2;
}
- /* cache midvalue */
+ /* cache c_ptr */
c_ptr = &cave[y3][x3];
- midval = cave[y3][x3].feat;
if (is_solid_grid(c_ptr))
{
/* move midpoint a bit to avoid problem. */
y3 += dy;
x3 += dx;
c_ptr = &cave[y3][x3];
- midval = cave[y3][x3].feat;
}
if (is_floor_grid(c_ptr))
{
screen_load();
return (FALSE);
- break;
}
case '8':
#endif
/* bg */
-static void delete_bg()
+static void delete_bg(void)
{
if (hBG != NULL)
{
}
}
-static int init_bg()
+static int init_bg(void)
{
char * bmfile = bg_bitmap_file;
int i, j;
delete_bg();
-
+
wnddc = GetDC(hwnd);
dcimage = CreateCompatibleDC(wnddc);
dcbg = CreateCompatibleDC(wnddc);
-
+
bmimage = LoadImage(NULL, "bg.bmp", LR_LOADFROMFILE, 0, 0, 0);
if (!bmimage) quit("bg.bmp¤¬Æɤߤ³¤á¤Ê¤¤¡ª");
bmimage_old = SelectObject(dcimage, bmimage);
-
+
CreateCompatibleBitmap();
ReleaseDC(hwnd, wnddc);
term_data *td = &data[i];
/* Update resized windows */
- if ((td->cols != td->t.wid) || (td->rows != td->t.hgt))
+ if ((td->cols != (uint)td->t.wid) || (td->rows != (uint)td->t.hgt))
{
/* Activate */
Term_activate(&td->t);
#
# Set any compiler options
-CCOPTS = -Od -jb -j1 -Hc -tW -lGn -e$(EXE_FILE) -w- \
+CCOPTS = -Od -jb -j1 -Hc -tW -lGn -e$(EXE_FILE) \
-D_WIN32_WINNT=0x0400 -DWINVER=0x0400 \
-DUSE_TRANSPARENCY $(JP_OPT)
object_type *o_ptr;
- object_kind *k_ptr;
-
char o_name[MAX_NLEN];
char m_name[80];
bool blinked;
bool touched = FALSE, fear = FALSE, alive = TRUE;
bool explode = FALSE;
- bool resist_drain = FALSE;
bool do_silly_attack = (one_in_(2) && p_ptr->image);
int syouryaku = 0;
int get_damage = 0;
*/
if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
{
- k_ptr = &k_info[o_ptr->k_idx];
j_ptr->pval = o_ptr->pval / o_ptr->number;
o_ptr->pval -= j_ptr->pval;
}
case RBE_EXP_VAMP:
{
s32b d = damroll(60, 6) + (p_ptr->exp / 100) * MON_DRAIN_LIFE;
+ bool resist_drain;
/* Obvious */
obvious = TRUE;
if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
/* Special message */
- if ((m_ptr->ml) && (did_heal))
+ if (m_ptr->ml && did_heal)
{
#ifdef JP
msg_format("%s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", m_name);
}
case RBE_DR_MANA:
{
- bool did_heal = FALSE;
-
/* Obvious */
obvious = TRUE;
p_ptr->csp_frac = 0;
}
- if (m_ptr->hp < m_ptr->maxhp) did_heal = TRUE;
-
p_ptr->redraw |= (PR_MANA);
break;
int i, y, x, y1, x1, best;
cave_type *c_ptr;
- bool use_sound = FALSE;
bool use_scent = FALSE;
monster_type *m_ptr = &m_list[m_idx];
/* If we can hear noises, advance towards them */
if (c_ptr->cost)
{
- use_sound = TRUE;
best = 999;
}
{
if (!only_browse) screen_load();
return (FALSE);
- break;
}
case '8':
return psychometry();
else
return ident_spell(FALSE);
- break;
case 8:
/* Mindwave */
#ifdef JP
return dimension_door();
/* mirror of recall */
case 17:
- if(!word_of_recall())return FALSE;
- break;
+ return word_of_recall();
/* multi-shadow */
case 18:
set_multishadow(6+randint1(6),FALSE);
}
case 7:
return ident_spell(FALSE);
- break;
case 8:
set_tim_ffall(randint1(20) + 20, FALSE);
break;
(void)inkey();
}
}
-
- screen_load();
}
monster_race *r_ptr = &r_info[r_idx];
bool old = FALSE;
- bool sin = FALSE;
int m, n, r;
#ifdef JP
char jverb_buf[64];
+#else
+ bool sin = FALSE;
#endif
int msex = 0;
}
/* Descriptions */
- if (1)
{
char buf[2048];
hooked_roff("¤òÅݤ¹¤³¤È¤Ï");
#endif
/* Group some variables */
- if (TRUE)
{
long i, j;
/* Drops gold and/or items */
if (drop_gold || drop_item)
{
- /* No "n" needed */
- sin = FALSE;
-
/* Intro */
#ifdef JP
hooked_roff(format("%^s¤Ï", wd_he[msex]));
#else
hooked_roff(format("%^s may carry", wd_he[msex]));
+
+ /* No "n" needed */
+ sin = FALSE;
#endif
hooked_roff("°ì¤Ä¤Î");
#else
hooked_roff(" a");
-#endif
-
sin = TRUE;
+#endif
}
/* Two drops */
p = "¾å¼Á¤Ê";
#else
p = " good";
-#endif
-
sin = FALSE;
+#endif
}
/* Okay */
/* Handle singular "an" */
#ifndef JP
if (sin) hooked_roff("n");
-#endif
sin = FALSE;
+#endif
/* Dump "object(s)" */
if (p) hooked_roff(p);
/* Treasures */
if (drop_gold)
{
+#ifndef JP
/* Cancel prefix */
if (!p) sin = FALSE;
/* Handle singular "an" */
-#ifndef JP
if (sin) hooked_roff("n");
-#endif
sin = FALSE;
+#endif
/* Dump "treasure(s)" */
if (p) hooked_roff(p);
/* Reset the cursor */
Term_gotoxy(0, 0);
+#ifndef JP
/* A title (use "The" for non-uniques) */
-#ifdef JP
- if (0)
-#else
if (!(r_ptr->flags1 & RF1_UNIQUE))
-#endif
-
{
Term_addstr(-1, TERM_WHITE, "The ");
}
+#endif
/* Dump the name */
Term_addstr(-1, TERM_WHITE, (r_name + r_ptr->name));
bool place_monster_one(int who, int y, int x, int r_idx, u32b mode)
{
int i;
- int rune_dam = 0;
cave_type *c_ptr;
/* Notice */
note_spot(y, x);
- rune_dam = 1000;
}
else return FALSE;
}
#endif
teleport_away(m_idx, 10, FALSE);
p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
- break;
}
else
{
msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
#else
char m_name_self[80];
-
+
/* hisself */
monster_desc(m_name_self, m_ptr, 0x23);
}
teleport_away(m_idx, 10, FALSE);
p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
- break;
}
else
{
}
break;
}
-
+
/* Something is wrong */
else return FALSE;
}
{
screen_load();
return (FALSE);
- break;
}
case '8':
#else
return "resist acid every 50+d50 turns";
#endif
- break;
case ESSENCE_TMP_RES_ELEC:
#ifdef JP
#else
return "resist elec every 50+d50 turns";
#endif
- break;
case ESSENCE_TMP_RES_FIRE:
#ifdef JP
#else
return "resist fire every 50+d50 turns";
#endif
- break;
case ESSENCE_TMP_RES_COLD:
#ifdef JP
#else
return "resist cold every 50+d50 turns";
#endif
- break;
case TR_IMPACT:
#ifdef JP
#else
return "earthquake every 100+d100 turns";
#endif
- break;
}
}
{
case EGO_AMU_IDENT:
#ifdef JP
-return "´ÕÄê : 10 ¥¿¡¼¥óËè";
+ return "´ÕÄê : 10 ¥¿¡¼¥óËè";
#else
return "identify every 10 turns";
#endif
- break;
case EGO_AMU_CHARM:
#ifdef JP
-return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 200 ¥¿¡¼¥óËè";
+ return "¥â¥ó¥¹¥¿¡¼Ì¥Î» : 200 ¥¿¡¼¥óËè";
#else
return "charm monster every 200 turns";
#endif
- break;
case EGO_AMU_JUMP:
#ifdef JP
-return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
+ return "¥·¥ç¡¼¥È¡¦¥Æ¥ì¥Ý¡¼¥È : 10+d10 ¥¿¡¼¥óËè";
#else
return "blink every 10+d10 turns";
#endif
- break;
case EGO_AMU_TELEPORT:
#ifdef JP
-return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
+ return "¥Æ¥ì¥Ý¡¼¥È : 50+d50 ¥¿¡¼¥óËè";
#else
return "teleport every 50+d50 turns";
#endif
- break;
case EGO_AMU_D_DOOR:
#ifdef JP
-return "¼¡¸µ¤ÎÈâ : 200 ¥¿¡¼¥óËè";
+ return "¼¡¸µ¤ÎÈâ : 200 ¥¿¡¼¥óËè";
#else
return "dimension door every 200 turns";
#endif
- break;
case EGO_AMU_RES_FIRE_:
#ifdef JP
-return "²Ð±ê¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
+ return "²Ð±ê¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
#else
return "resist fire every 50+d50 turns";
#endif
- break;
case EGO_AMU_RES_COLD_:
#ifdef JP
-return "Î䵤¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
+ return "Î䵤¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
#else
return "resist cold every 50+d50 turns";
#endif
- break;
case EGO_AMU_RES_ELEC_:
#ifdef JP
-return "ÅÅ·â¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
+ return "ÅÅ·â¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
#else
return "resist elec every 50+d50 turns";
#endif
- break;
case EGO_AMU_RES_ACID_:
#ifdef JP
-return "»À¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
+ return "»À¤Ø¤ÎÂÑÀ : 50+d50¥¿¡¼¥óËè";
#else
return "resist acid every 50+d50 turns";
#endif
- break;
case EGO_AMU_DETECTION:
#ifdef JP
-return "Á´´¶ÃÎ : 55+d55¥¿¡¼¥óËè";
+ return "Á´´¶ÃÎ : 55+d55¥¿¡¼¥óËè";
#else
return "detect all floor every 55+d55 turns";
#endif
- break;
}
}
}
{
s16b this_o_idx, next_o_idx = 0;
- char n1, n2, which = ' ';
+ char which = ' ';
int j, k, i1, i2, e1, e2;
/* Inventory screen */
if (!command_wrk)
{
- /* Extract the legal requests */
- n1 = I2A(i1);
- n2 = I2A(i2);
-
/* Redraw if needed */
if (command_see) get_item_label = show_inven(menu_line);
}
/* Equipment screen */
else
{
- /* Extract the legal requests */
- n1 = I2A(e1 - INVEN_RARM);
- n2 = I2A(e2 - INVEN_RARM);
-
/* Redraw if needed */
if (command_see) get_item_label = show_equip(menu_line);
}
#if 0
case '\n':
case '\r':
-#endif
{
/* Choose "default" inventory item */
if (!command_wrk)
done = TRUE;
break;
}
+#endif
case 'w':
{
{
s16b this_o_idx;
- object_type *o_ptr;
-
cptr q, s;
int item;
return (FALSE);
}
- /* Access the object */
- o_ptr = &o_list[this_o_idx];
-
/* Pick up the object */
py_pickup_aux(this_o_idx);
else if (level < 40) return 2500+(level-30)*350L;
else if (level < 50) return 6000+(level-40)*800L;
else return 14000+(level-50)*2000L;
- break;
}
case TV_CAPTURE:
bool flag = FALSE;
bool done = FALSE;
- bool plural = FALSE;
-
-
+#ifndef JP
/* Extract plural */
- if (j_ptr->number != 1) plural = TRUE;
+ bool plural = (j_ptr->number != 1);
+#endif
/* Describe object */
object_desc(o_name, j_ptr, FALSE, 0);
{
screen_load();
return;
- break;
}
case '8':
{
int y = 0, x = 0, i;
cave_type *c_ptr;
- monster_type *m_ptr;
for (i = 0; i < 6; i++)
{
x = px + ddx_ddd[dir];
c_ptr = &cave[y][x];
- /* Get the monster */
- m_ptr = &m_list[c_ptr->m_idx];
-
/* Hack -- attack monsters */
if (c_ptr->m_idx)
py_attack(y, x, 0);
{
if (command == -3)
{
- int gain_sp;
#ifdef JP
- if ((gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, "£È£Ð¤«¤é£Í£Ð¤Ø¤Î̵ËŤÊÊÑ´¹", -1)))
+ int gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, "£È£Ð¤«¤é£Í£Ð¤Ø¤Î̵ËŤÊÊÑ´¹", -1) / 5;
#else
- if ((gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, "thoughtless convertion from HP to SP", -1)))
+ int gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, "thoughtless convertion from HP to SP", -1) / 5;
#endif
+ if (gain_sp)
{
- p_ptr->csp += gain_sp / 5;
+ p_ptr->csp += gain_sp;
if (p_ptr->csp > p_ptr->msp)
{
p_ptr->csp = p_ptr->msp;
}
else if (command == -4)
{
- if (p_ptr->csp >= p_ptr->lev/5)
+ if (p_ptr->csp >= p_ptr->lev / 5)
{
p_ptr->csp -= p_ptr->lev / 5;
hp_player(p_ptr->lev);
ul -= MAXREAD;
hp += MAXREAD;
}
- if (_lread(fh, (LPSTR)hp, (WORD)ul) != (WORD)ul)
+ if (_lread(fh, (LPSTR)hp, (WORD)ul) != ul)
return 0;
return ulT;
}
lpRGB = (RGBQUAD FAR *)((LPSTR)lpInfo + lpInfo->biSize);
/* copy colors from the color table to the LogPalette structure */
- for (i = 0; i < lpInfo->biClrUsed; i++, lpRGB++)
+ for (i = 0; i < (WORD)lpInfo->biClrUsed; i++, lpRGB++)
{
npPal->palPalEntry[i].peRed = lpRGB->rgbRed;
npPal->palPalEntry[i].peGreen = lpRGB->rgbGreen;
{
register int i = 0, j, m = 0;
- int pr, pc, pa, clev/*, al*/;
+ int pr, clev/*, al*/;
high_score the_score;
char buf[1024], out_val[256];
if (highscore_seek(j)) break;
if (highscore_read(&the_score)) break;
pr = atoi(the_score.p_r);
- pc = atoi(the_score.p_c);
- pa = atoi(the_score.p_a);
clev = atoi(the_score.cur_lev);
#ifdef JP
void race_score(int race_num)
{
register int i = 0, j, m = 0;
- int pr, pc, pa, clev, lastlev;
+ int pr, clev, lastlev;
high_score the_score;
char buf[1024], out_val[256], tmp_str[80];
if (highscore_seek(j)) break;
if (highscore_read(&the_score)) break;
pr = atoi(the_score.p_r);
- pc = atoi(the_score.p_c);
- pa = atoi(the_score.p_a);
clev = atoi(the_score.cur_lev);
if (pr == race_num)
bool is_art = FALSE;
bool ignore = FALSE;
- bool plural = FALSE;
bool do_kill = FALSE;
cptr note_kill = NULL;
+#ifndef JP
+ /* Get the "plural"-ness */
+ bool plural = (o_ptr->number > 1);
+#endif
+
/* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Extract the flags */
object_flags(o_ptr, flgs);
- /* Get the "plural"-ness */
- if (o_ptr->number > 1) plural = TRUE;
-
/* Check for artifact */
if ((artifact_p(o_ptr) || o_ptr->art_name)) is_art = TRUE;
void fetch(int dir, int wgt, bool require_los)
{
int ty, tx, i;
- bool flag;
cave_type *c_ptr;
object_type *o_ptr;
char o_name[MAX_NLEN];
/* Use a direction */
ty = py; /* Where to drop the item */
tx = px;
- flag = FALSE;
do
{
int radius = 2;
int dt = 0;
int dam = 0;
- bool ident = FALSE;
bool angry = FALSE;
object_kind *k_ptr = &k_info[k_idx];
case SV_POTION_SLOWNESS:
dt = GF_OLD_SLOW;
dam = 5;
- ident = TRUE;
angry = TRUE;
break;
case SV_POTION_POISON:
dt = GF_POIS;
dam = 3;
- ident = TRUE;
angry = TRUE;
break;
case SV_POTION_BLINDNESS:
dt = GF_DARK;
- ident = TRUE;
angry = TRUE;
break;
case SV_POTION_CONFUSION: /* Booze */
dt = GF_OLD_CONF;
- ident = TRUE;
angry = TRUE;
break;
case SV_POTION_SLEEP:
dt = GF_OLD_SLEEP;
angry = TRUE;
- ident = TRUE;
break;
case SV_POTION_RUINATION:
case SV_POTION_DETONATIONS:
dt = GF_SHARDS;
dam = damroll(25, 25);
angry = TRUE;
- ident = TRUE;
break;
case SV_POTION_DEATH:
dt = GF_DEATH_RAY; /* !! */
dam = k_ptr->level * 10;
angry = TRUE;
radius = 1;
- ident = TRUE;
break;
case SV_POTION_SPEED:
dt = GF_OLD_SPEED;
- ident = TRUE;
break;
case SV_POTION_CURE_LIGHT:
dt = GF_OLD_HEAL;
dam = damroll(2, 3);
- ident = TRUE;
break;
case SV_POTION_CURE_SERIOUS:
dt = GF_OLD_HEAL;
dam = damroll(4, 3);
- ident = TRUE;
break;
case SV_POTION_CURE_CRITICAL:
case SV_POTION_CURING:
dt = GF_OLD_HEAL;
dam = damroll(6, 3);
- ident = TRUE;
break;
case SV_POTION_HEALING:
dt = GF_OLD_HEAL;
dam = damroll(10, 10);
- ident = TRUE;
break;
case SV_POTION_RESTORE_EXP:
dt = GF_STAR_HEAL;
dam = 0;
radius = 1;
- ident = TRUE;
break;
case SV_POTION_LIFE:
dt = GF_STAR_HEAL;
dam = damroll(50, 50);
radius = 1;
- ident = TRUE;
break;
case SV_POTION_STAR_HEALING:
dt = GF_OLD_HEAL;
dam = damroll(50, 50);
radius = 1;
- ident = TRUE;
break;
case SV_POTION_RESTORE_MANA: /* MANA */
dt = GF_MANA;
dam = damroll(10, 10);
radius = 1;
- ident = TRUE;
break;
default:
/* Do nothing */ ;
*/
void pause_line(int row)
{
- int i;
prt("", row, 0);
#ifdef JP
put_str("[ ²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤ ]", row, 26);
put_str("[Press any key to continue]", row, 23);
#endif
- i = inkey();
+ (void)inkey();
prt("", row, 0);
}
#endif
/* Not enough buffer size */
- if (write_pt + 3 >= bufsize) break;
+ if ((size_t)(write_pt + 3) >= bufsize) break;
tbuf[write_pt++] = ch[0];
line_len++;
*/
/* if (cursed_p(o_ptr)) */
- if (1)
{
if (have_flag(flgs, TR_TY_CURSE))
{
if (r_ptr->flags7 & (RF7_KAGE)) continue;
/* Get the "name" */
-/* if (r_ptr->flags1 & (RF1_QUESTOR)) */
- if (0)
+ /*
+ else if (r_ptr->flags1 & (RF1_QUESTOR))
{
sprintf(nam, "[Q] %s", name);
}
+ */
else if (r_ptr->flags1 & (RF1_UNIQUE))
{
sprintf(nam, "[U] %s", name);
static void spoil_mon_info(cptr fname)
{
char buf[1024];
- int msex, i, l, n=0;
- bool breath, magic;
- u32b flags1, flags2, flags3, flags4, flags5, flags6, flags7;
+ int i, l, n = 0;
+ u32b flags1;
u16b why = 2;
s16b *who;
/* Extract the flags */
flags1 = r_ptr->flags1;
- flags2 = r_ptr->flags2;
- flags3 = r_ptr->flags3;
- flags4 = r_ptr->flags4;
- flags5 = r_ptr->flags5;
- flags6 = r_ptr->flags6;
- flags7 = r_ptr->flags7;
- breath = FALSE;
- magic = FALSE;
-
- /* Extract a gender (if applicable) */
- if (flags1 & (RF1_FEMALE)) msex = 2;
- else if (flags1 & (RF1_MALE)) msex = 1;
- else msex = 0;
-
/* Prefix */
if (flags1 & (RF1_QUESTOR))
bool omoi = FALSE;
bool yoiyami = FALSE;
bool down_saving = FALSE;
- bool have_dd_s, have_dd_t, have_sw, have_kabe;
+#if 0
+ bool have_dd_s = FALSE, have_dd_t = FALSE;
+#endif
+ bool have_sw = FALSE, have_kabe = FALSE;
bool easy_2weapon = FALSE;
s16b this_o_idx, next_o_idx = 0;
player_race *tmp_rp_ptr;
}
}
- have_dd_s = FALSE;
- have_dd_t = FALSE;
- have_sw = FALSE;
- have_kabe = FALSE;
for (i = 0; i < INVEN_PACK; i++)
{
+#if 0
if ((inventory[i].tval == TV_SORCERY_BOOK) && (inventory[i].sval == 2)) have_dd_s = TRUE;
if ((inventory[i].tval == TV_TRUMP_BOOK) && (inventory[i].sval == 1)) have_dd_t = TRUE;
+#endif
if ((inventory[i].tval == TV_NATURE_BOOK) && (inventory[i].sval == 2)) have_sw = TRUE;
if ((inventory[i].tval == TV_ENCHANT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE;
}
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
+#if 0
if ((o_ptr->tval == TV_SORCERY_BOOK) && (o_ptr->sval == 3)) have_dd_s = TRUE;
if ((o_ptr->tval == TV_TRUMP_BOOK) && (o_ptr->sval == 1)) have_dd_t = TRUE;
+#endif
if ((o_ptr->tval == TV_NATURE_BOOK) && (o_ptr->sval == 2)) have_sw = TRUE;
if ((o_ptr->tval == TV_ENCHANT_BOOK) && (o_ptr->sval == 2)) have_kabe = TRUE;
}
*/
void check_experience(void)
{
- int i;
bool level_reward = FALSE;
bool level_mutation = FALSE;
bool level_inc_stat = FALSE;
bool android = (p_ptr->prace == RACE_ANDROID ? TRUE : FALSE);
- /* Note current level */
- i = p_ptr->lev;
-
/* Hack -- lower limit */
if (p_ptr->exp < 0) p_ptr->exp = 0;
/* Remove the first object from the list. */
excise_object_idx(o_idx);
-
+
/* Find end of the list. */
i = c_ptr->o_idx;
while (o_list[i].next_o_idx)
i = o_list[i].next_o_idx;
-
+
/* Add after the last object. */
o_list[i].next_o_idx = o_idx;
}
}
- /* End this grid */
- return query;
+ /* NOTREACHED */
}
#endif /* ALLOW_EASY_FLOOR */