• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisiona129a85b76812b68e4796dcff94ef24f215372ec (tree)
Time2014-01-18 14:54:11
Authordeskull <deskull@0568...>
Commiterdeskull

Log Message

Add Doxygen comment to snipe.c.

Change Summary

Incremental Difference

--- a/src/snipe.c
+++ b/src/snipe.c
@@ -1,8 +1,19 @@
1+/*!
2+ * @file snipe.c
3+ * @brief スナイパー技能の実装 / Sniping
4+ * @date 2014/01/18
5+ * @author
6+ * 2014 Deskull rearranged comment for Doxygen.\n
7+ */
8+
19 #include "angband.h"
210
311 #define MAX_SNIPE_POWERS 16
412
13+/*! スナイパー技能情報のtypedef */
514 typedef struct snipe_power snipe_power;
15+
16+/*! スナイパー技能情報の構造体 */
617 struct snipe_power
718 {
819 int min_lev;
@@ -10,6 +21,7 @@ struct snipe_power
1021 const char *name;
1122 };
1223
24+/*! スナイパー技能の解説メッセージ */
1325 static const char *snipe_tips[MAX_SNIPE_POWERS] =
1426 {
1527 #ifdef JP
@@ -49,6 +61,7 @@ static const char *snipe_tips[MAX_SNIPE_POWERS] =
4961 #endif
5062 };
5163
64+/*! スナイパー技能テーブル */
5265 snipe_power snipe_powers[MAX_SNIPE_POWERS] =
5366 {
5467 /* Level gained, cost, name */
@@ -89,7 +102,10 @@ snipe_power snipe_powers[MAX_SNIPE_POWERS] =
89102 #endif
90103 };
91104
92-
105+/*!
106+ * @brief スナイパーの集中度加算
107+ * @return 常にTRUEを返す
108+ */
93109 static bool snipe_concentrate(void)
94110 {
95111 if ((int)p_ptr->concent < (2 + (p_ptr->lev + 5) / 10)) p_ptr->concent++;
@@ -113,6 +129,11 @@ static bool snipe_concentrate(void)
113129 return (TRUE);
114130 }
115131
132+/*!
133+ * @brief スナイパーの集中度リセット
134+ * @param msg TRUEならばメッセージを表示する
135+ * @return なし
136+ */
116137 void reset_concentration(bool msg)
117138 {
118139 if (msg)
@@ -136,6 +157,11 @@ void reset_concentration(bool msg)
136157 p_ptr->update |= (PU_MONSTERS);
137158 }
138159
160+/*!
161+ * @brief スナイパーの集中度によるダメージボーナスを加算する
162+ * @param tdam 算出中のダメージ
163+ * @return 集中度修正を加えたダメージ
164+ */
139165 int boost_concentration_damage(int tdam)
140166 {
141167 tdam *= (10 + p_ptr->concent);
@@ -144,6 +170,10 @@ int boost_concentration_damage(int tdam)
144170 return (tdam);
145171 }
146172
173+/*!
174+ * @brief スナイパーの技能リストを表示する
175+ * @return なし
176+ */
147177 void display_snipe_list(void)
148178 {
149179 int i;
@@ -181,19 +211,23 @@ void display_snipe_list(void)
181211 }
182212
183213
184-/*
185- * Allow user to choose a mindcrafter power.
186- *
187- * If a valid spell is chosen, saves it in '*sn' and returns TRUE
188- * If the user hits escape, returns FALSE, and set '*sn' to -1
189- * If there are no legal choices, returns FALSE, and sets '*sn' to -2
190- *
191- * The "prompt" should be "cast", "recite", or "study"
192- * The "known" should be TRUE for cast/pray, FALSE for study
193- *
194- * nb: This function has a (trivial) display bug which will be obvious
195- * when you run it. It's probably easy to fix but I haven't tried,
196- * sorry.
214+/*!
215+ * @brief スナイパー技能を選択する
216+ * @param sn 選択した特殊技能ID、キャンセルの場合-1、不正な選択の場合-2を返す
217+ * @param only_browse 一覧を見るだけの場合TRUEを返す
218+ * @return 発動可能な魔法を選択した場合TRUE、キャンセル処理か不正な選択が行われた場合FALSEを返す。
219+ * Allow user to choose a mindcrafter power.\n
220+ *\n
221+ * If a valid spell is chosen, saves it in '*sn' and returns TRUE\n
222+ * If the user hits escape, returns FALSE, and set '*sn' to -1\n
223+ * If there are no legal choices, returns FALSE, and sets '*sn' to -2\n
224+ *\n
225+ * The "prompt" should be "cast", "recite", or "study"\n
226+ * The "known" should be TRUE for cast/pray, FALSE for study\n
227+ *\n
228+ * nb: This function has a (trivial) display bug which will be obvious\n
229+ * when you run it. It's probably easy to fix but I haven't tried,\n
230+ * sorry.\n
197231 */
198232 static int get_snipe_power(int *sn, bool only_browse)
199233 {
@@ -402,8 +436,16 @@ static int get_snipe_power(int *sn, bool only_browse)
402436 return (TRUE);
403437 }
404438
405-
406-int tot_dam_aux_snipe (int mult, monster_type *m_ptr)
439+/*!
440+ * @brief スナイバー技能のスレイ倍率計算を行う /
441+ * Calcurate magnification of snipe technics
442+ * @param mult スナイバー技能のスレイ効果以前に算出している多要素の倍率(/10倍)
443+ * @param flgs スナイバー技能に使用する武器のスレイフラグ配列
444+ * @param m_ptr 目標となるモンスターの構造体参照ポインタ
445+ * @param mode スナイバー技能のスレイ型ID
446+ * @return スレイの倍率(/10倍)
447+ */
448+int tot_dam_aux_snipe(int mult, monster_type *m_ptr)
407449 {
408450 monster_race *r_ptr = &r_info[m_ptr->r_idx];
409451 bool seen = is_seen(m_ptr);
@@ -494,9 +536,12 @@ int tot_dam_aux_snipe (int mult, monster_type *m_ptr)
494536 return (mult);
495537 }
496538
497-/*
498- * do_cmd_cast calls this function if the player's class
499- * is 'mindcrafter'.
539+
540+/*!
541+ * @brief スナイパー技能の発動 /
542+ * do_cmd_cast calls this function if the player's class is 'snipe'.
543+ * @param spell 発動する特殊技能のID
544+ * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
500545 */
501546 static bool cast_sniper_spell(int spell)
502547 {
@@ -549,10 +594,9 @@ static bool cast_sniper_spell(int spell)
549594 return (is_fired);
550595 }
551596
552-
553-/*
554- * do_cmd_cast calls this function if the player's class
555- * is 'mindcrafter'.
597+/*!
598+ * @brief スナイパー技能コマンドのメインルーチン /
599+ * @return なし
556600 */
557601 void do_cmd_snipe(void)
558602 {
@@ -614,9 +658,9 @@ void do_cmd_snipe(void)
614658 p_ptr->window |= (PW_SPELL);
615659 }
616660
617-/*
618- * do_cmd_cast calls this function if the player's class
619- * is 'mindcrafter'.
661+/*!
662+ * @brief スナイパー技能コマンドの表示 /
663+ * @return なし
620664 */
621665 void do_cmd_snipe_browse(void)
622666 {
Show on old repository browser