*/
#include "angband.h"
-
-#define TY_CURSE_CHANCE 200 /*!<太古の怨念の1ターン毎の発動確率(1/n)*/
-#define CHAINSWORD_NOISE 100 /*!<チェンソーの1ターン毎の発動確率(1/n)*/
+#include "cmd-activate.h"
+#include "cmd-eat.h"
+#include "cmd-item.h"
+#include "cmd-magiceat.h"
+#include "cmd-quaff.h"
+#include "cmd-read.h"
+#include "cmd-usestaff.h"
+#include "cmd-zaprod.h"
+#include "cmd-zapwand.h"
+#include "cmd-pet.h"
static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/
static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/
* @param o_ptr 擬似鑑定を行うオブジェクトの参照ポインタ。
* @return 擬似鑑定結果のIDを返す。
*/
-static byte value_check_aux1(object_type *o_ptr)
+byte value_check_aux1(object_type *o_ptr)
{
/* Artifacts */
if (object_is_artifact(o_ptr))
* @param o_ptr 擬似鑑定を行うオブジェクトの参照ポインタ。
* @return 擬似鑑定結果のIDを返す。
*/
-static byte value_check_aux2(object_type *o_ptr)
+byte value_check_aux2(object_type *o_ptr)
{
/* Cursed items (all of them) */
if (object_is_cursed(o_ptr)) return FEEL_CURSED;
switch (pattern_type)
{
case PATTERN_TILE_END:
- (void)set_poisoned(0);
(void)set_image(0);
- (void)set_stun(0);
- (void)set_cut(0);
- (void)set_blind(0);
- (void)set_afraid(0);
- (void)do_res_stat(A_STR);
- (void)do_res_stat(A_INT);
- (void)do_res_stat(A_WIS);
- (void)do_res_stat(A_DEX);
- (void)do_res_stat(A_CON);
- (void)do_res_stat(A_CHR);
+ (void)restore_all_status();
(void)restore_level();
- (void)hp_player(1000);
+ (void)cure_critical_wounds(1000);
cave_set_feat(p_ptr->y, p_ptr->x, feat_pattern_old);
msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
if (r_ptr->flags2 & RF2_REGENERATE) frac *= 2;
/* Hack -- Regenerate */
- o_ptr->xtra4 += frac;
+ o_ptr->xtra4 += (XTRA16)frac;
/* Do not over-regenerate */
if (o_ptr->xtra4 > o_ptr->xtra5) o_ptr->xtra4 = o_ptr->xtra5;
}
}
-/*!
- * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
- * @return なし
- * @todo mind.cにこの関数を移動させるべき。
- * @note
- * currently this function allows pseudo-id of any object,
- * including silly ones like potions & scrolls, which always
- * get '{average}'. This should be changed, either to stop such
- * items from being pseudo-id'd, or to allow psychometry to
- * detect whether the unidentified potion/scroll/etc is
- * good (Cure Light Wounds, Restore Strength, etc) or
- * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
- */
-bool psychometry(void)
-{
- OBJECT_IDX item;
- object_type *o_ptr;
- char o_name[MAX_NLEN];
- byte feel;
- cptr q, s;
- bool okay = FALSE;
-
- item_tester_no_ryoute = TRUE;
- /* Get an item */
- q = _("どのアイテムを調べますか?", "Meditate on which item? ");
- s = _("調べるアイテムがありません。", "You have nothing appropriate.");
-
- if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
-
- /* Get the item (in the pack) */
- if (item >= 0)
- {
- o_ptr = &inventory[item];
- }
-
- /* Get the item (on the floor) */
- else
- {
- o_ptr = &o_list[0 - item];
- }
-
- /* It is fully known, no information needed */
- if (object_is_known(o_ptr))
- {
- msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
- return TRUE;
- }
-
- /* Check for a feeling */
- feel = value_check_aux1(o_ptr);
-
- /* Get an object description */
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
- /* Skip non-feelings */
- if (!feel)
- {
- msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
- return TRUE;
- }
-
-#ifdef JP
-msg_format("%sは%sという感じがする...",
- o_name, game_inscriptions[feel]);
-#else
- msg_format("You feel that the %s %s %s...",
- o_name, ((o_ptr->number == 1) ? "is" : "are"),
- game_inscriptions[feel]);
-#endif
-
-
- /* We have "felt" it */
- o_ptr->ident |= (IDENT_SENSE);
-
- /* "Inscribe" it */
- o_ptr->feeling = feel;
-
- /* Player touches it */
- o_ptr->marked |= OM_TOUCHED;
-
- /* Combine / Reorder the pack (later) */
- p_ptr->notice |= (PN_COMBINE | PN_REORDER);
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
-
- /* Valid "tval" codes */
- switch (o_ptr->tval)
- {
- case TV_SHOT:
- case TV_ARROW:
- case TV_BOLT:
- case TV_BOW:
- case TV_DIGGING:
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_SWORD:
- case TV_BOOTS:
- case TV_GLOVES:
- case TV_HELM:
- case TV_CROWN:
- case TV_SHIELD:
- case TV_CLOAK:
- case TV_SOFT_ARMOR:
- case TV_HARD_ARMOR:
- case TV_DRAG_ARMOR:
- case TV_CARD:
- case TV_RING:
- case TV_AMULET:
- case TV_LITE:
- case TV_FIGURINE:
- okay = TRUE;
- break;
- }
-
- /* Auto-inscription/destroy */
- autopick_alter_item(item, (bool)(okay && destroy_feeling));
-
- /* Something happened */
- return (TRUE);
-}
/*!
* @brief !!を刻んだ魔道具の時間経過による再充填を知らせる処理 / If player has inscribed the object with "!!", let him know when it's recharged. -LM-
/* Music singed by player */
if (p_ptr->pclass != CLASS_BARD) return;
- if (!p_ptr->magic_num1[0] && !p_ptr->magic_num1[1]) return;
+ if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return;
if (p_ptr->anti_magic)
{
return;
}
- spell = p_ptr->magic_num2[0];
+ spell = SINGING_SONG_ID(p_ptr);
s_ptr = &technic_info[REALM_MUSIC - MIN_TECHNIC][spell];
need_mana = mod_need_mana(s_ptr->smana, spell, REALM_MUSIC);
s64b_sub(&(p_ptr->csp), &(p_ptr->csp_frac), need_mana, need_mana_frac);
p_ptr->redraw |= PR_MANA;
- if (p_ptr->magic_num1[1])
+ if (INTERUPTING_SONG_EFFECT(p_ptr))
{
- p_ptr->magic_num1[0] = p_ptr->magic_num1[1];
- p_ptr->magic_num1[1] = 0;
+ SINGING_SONG_EFFECT(p_ptr) = INTERUPTING_SONG_EFFECT(p_ptr);
+ INTERUPTING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
msg_print(_("歌を再開した。", "You restart singing."));
p_ptr->action = ACTION_SING;
p_ptr->energy_need = 0;
battle_monsters();
}
- else if (turn - old_turn == 150*TURNS_PER_TICK)
+ else if (turn - old_turn == 150 * TURNS_PER_TICK)
{
msg_print(_("申し分けありませんが、この勝負は引き分けとさせていただきます。", "This battle have ended in a draw."));
p_ptr->au += kakekin;
/*
* Nightmare mode activates the TY_CURSE at midnight
- *
* Require exact minute -- Don't activate multiple times in a minute
*/
+
if (ironman_nightmare && (min != prev_min))
{
+
/* Every 15 minutes after 11:00 pm */
if ((hour == 23) && !(min % 15))
{
/* TY_CURSE activates at midnight! */
if (!hour && !min)
{
- int count = 0;
disturb(1, 1);
msg_print(_("遠くで鐘が何回も鳴り、死んだような静けさの中へ消えていった。", "A distant bell tolls many times, fading into an deathly silence."));
- activate_ty_curse(FALSE, &count);
+
+ if (p_ptr->wild_mode)
+ {
+ /* Go into large wilderness view */
+ p_ptr->oldpy = randint1(MAX_HGT - 2);
+ p_ptr->oldpx = randint1(MAX_WID - 2);
+ change_wild_mode();
+
+ /* Give first move to monsters */
+ p_ptr->energy_use = 100;
+
+ /* HACk -- set the encouter flag for the wilderness generation */
+ generate_encounter = TRUE;
+ }
+
+ invoking_midnight_curse = TRUE;
}
}
/* Throw an item */
case 'v':
{
- if (!p_ptr->wild_mode)
- {
- do_cmd_throw();
- }
+ if (!p_ptr->wild_mode) do_cmd_throw(1, FALSE, -1);
break;
}
hack_mutation = FALSE;
}
+ if (invoking_midnight_curse)
+ {
+ int count = 0;
+ activate_ty_curse(FALSE, &count);
+ invoking_midnight_curse = FALSE;
+ }
+
if (p_ptr->inside_battle)
{
for(i = 1; i < m_max; i++)
if (resting < 0)
{
/* Basic resting */
- if (resting == -1)
+ if (resting == COMMAND_ARG_REST_FULL_HEALING)
{
/* Stop resting */
if ((p_ptr->chp == p_ptr->mhp) &&
}
/* Complete resting */
- else if (resting == -2)
+ else if (resting == COMMAND_ARG_REST_UNTIL_DONE)
{
/* Stop resting */
if ((p_ptr->chp == p_ptr->mhp) &&
/*!
* @brief 現在プレイヤーがいるダンジョンの全体処理 / Interact with the current dungeon level.
* @return なし
- * @note
+ * @details
+ * <p>
+ * この関数から現在の階層を出る、プレイヤーがキャラが死ぬ、
+ * ゲームを終了するかのいずれかまでループする。
+ * </p>
+ * <p>
* This function will not exit until the level is completed,\n
* the user dies, or the game is terminated.\n
+ * </p>
*/
static void dungeon(bool load_game)
{
base_level = dun_level;
/* Reset various flags */
- hack_mind = FALSE;
+ is_loading_now = FALSE;
/* Not leaving */
p_ptr->leaving = FALSE;
}
}
- if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] > MUSIC_DETECT))
- p_ptr->magic_num1[0] = MUSIC_DETECT;
+ if ((p_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(p_ptr) > MUSIC_DETECT))
+ SINGING_SONG_EFFECT(p_ptr) = MUSIC_DETECT;
/* Hack -- notice death or departure */
if (!p_ptr->playing || p_ptr->is_dead) return;
/* Reset the object generation level */
object_level = base_level;
- hack_mind = TRUE;
+ is_loading_now = TRUE;
if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
(dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
/* Hack -- Notice death or departure */
if (!p_ptr->playing || p_ptr->is_dead) break;
- /* Handle "leaving" */
- if (p_ptr->leaving) break;
-
/* Count game turns */
turn++;
prevent_turn_overflow();
+ /* Handle "leaving" */
+ if (p_ptr->leaving) break;
+
if (wild_regen) wild_regen--;
}
/* Open the high score file, for reading/writing */
highscore_fd = fd_open(buf, O_RDWR);
+ /* 町名消失バグ対策(#38205) Init the wilderness */
+ process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
+
/* Handle score, show Top scores */
success = send_world_score(TRUE);
msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death."));
msg_print(NULL);
- /* Restore hit points */
- p_ptr->chp = p_ptr->mhp;
- p_ptr->chp_frac = 0;
+ (void)life_stream(FALSE, FALSE);
if (p_ptr->pclass == CLASS_MAGIC_EATER)
{
p_ptr->magic_num1[magic_idx] = 0;
}
}
+
/* Restore spell points */
p_ptr->csp = p_ptr->msp;
p_ptr->csp_frac = 0;
/* Do not die */
p_ptr->is_dead = FALSE;
- /* Hack -- Healing */
- (void)set_blind(0);
- (void)set_confused(0);
- (void)set_poisoned(0);
- (void)set_afraid(0);
- (void)set_paralyzed(0);
- (void)set_image(0);
- (void)set_stun(0);
- (void)set_cut(0);
-
/* Hack -- Prevent starvation */
(void)set_food(PY_FOOD_MAX - 1);