1 #include "core/stuff-handler.h"
2 #include "core/player-redraw-types.h"
3 #include "core/player-update-types.h"
4 #include "core/window-redrawer.h"
5 #include "player/player-status.h"
6 #include "system/player-type-definition.h"
9 * @brief 全更新処理をチェックして処理していく
10 * Handle "player_ptr->update" and "player_ptr->redraw" and "player_ptr->window"
12 void handle_stuff(player_type* player_ptr)
14 if (player_ptr->update)
15 update_creature(player_ptr);
16 if (player_ptr->redraw)
17 redraw_stuff(player_ptr);
18 if (player_ptr->window_flags)
19 window_stuff(player_ptr);
23 * Track the given monster race
25 void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx)
27 player_ptr->monster_race_idx = r_idx;
28 player_ptr->window_flags |= (PW_MONSTER);
32 * Track the given object kind
34 void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx)
36 player_ptr->object_kind_idx = k_idx;
37 player_ptr->window_flags |= (PW_OBJECT);
42 * @param player_ptr プレーヤーへの参照ポインタ
43 * @param m_idx トラッキング対象のモンスターID。0の時キャンセル
46 void health_track(player_type *player_ptr, MONSTER_IDX m_idx)
48 if (m_idx && m_idx == player_ptr->riding)
51 player_ptr->health_who = m_idx;
52 player_ptr->redraw |= (PR_HEALTH);
55 bool update_player(player_type *caster_ptr)
57 caster_ptr->update |= PU_COMBINE | PU_REORDER;
58 caster_ptr->window_flags |= PW_INVEN;
62 bool redraw_player(player_type *caster_ptr)
64 if (caster_ptr->csp > caster_ptr->msp) {
65 caster_ptr->csp = caster_ptr->msp;
68 caster_ptr->redraw |= PR_MANA;
69 caster_ptr->update |= PU_COMBINE | PU_REORDER;
70 caster_ptr->window_flags |= PW_INVEN;