変愚蛮怒のメインリポジトリです
Revision | a129a85b76812b68e4796dcff94ef24f215372ec (tree) |
---|---|
Time | 2014-01-18 14:54:11 |
Author | deskull <deskull@0568...> |
Commiter | deskull |
Add Doxygen comment to 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 | + | |
1 | 9 | #include "angband.h" |
2 | 10 | |
3 | 11 | #define MAX_SNIPE_POWERS 16 |
4 | 12 | |
13 | +/*! スナイパー技能情報のtypedef */ | |
5 | 14 | typedef struct snipe_power snipe_power; |
15 | + | |
16 | +/*! スナイパー技能情報の構造体 */ | |
6 | 17 | struct snipe_power |
7 | 18 | { |
8 | 19 | int min_lev; |
@@ -10,6 +21,7 @@ struct snipe_power | ||
10 | 21 | const char *name; |
11 | 22 | }; |
12 | 23 | |
24 | +/*! スナイパー技能の解説メッセージ */ | |
13 | 25 | static const char *snipe_tips[MAX_SNIPE_POWERS] = |
14 | 26 | { |
15 | 27 | #ifdef JP |
@@ -49,6 +61,7 @@ static const char *snipe_tips[MAX_SNIPE_POWERS] = | ||
49 | 61 | #endif |
50 | 62 | }; |
51 | 63 | |
64 | +/*! スナイパー技能テーブル */ | |
52 | 65 | snipe_power snipe_powers[MAX_SNIPE_POWERS] = |
53 | 66 | { |
54 | 67 | /* Level gained, cost, name */ |
@@ -89,7 +102,10 @@ snipe_power snipe_powers[MAX_SNIPE_POWERS] = | ||
89 | 102 | #endif |
90 | 103 | }; |
91 | 104 | |
92 | - | |
105 | +/*! | |
106 | + * @brief スナイパーの集中度加算 | |
107 | + * @return 常にTRUEを返す | |
108 | + */ | |
93 | 109 | static bool snipe_concentrate(void) |
94 | 110 | { |
95 | 111 | if ((int)p_ptr->concent < (2 + (p_ptr->lev + 5) / 10)) p_ptr->concent++; |
@@ -113,6 +129,11 @@ static bool snipe_concentrate(void) | ||
113 | 129 | return (TRUE); |
114 | 130 | } |
115 | 131 | |
132 | +/*! | |
133 | + * @brief スナイパーの集中度リセット | |
134 | + * @param msg TRUEならばメッセージを表示する | |
135 | + * @return なし | |
136 | + */ | |
116 | 137 | void reset_concentration(bool msg) |
117 | 138 | { |
118 | 139 | if (msg) |
@@ -136,6 +157,11 @@ void reset_concentration(bool msg) | ||
136 | 157 | p_ptr->update |= (PU_MONSTERS); |
137 | 158 | } |
138 | 159 | |
160 | +/*! | |
161 | + * @brief スナイパーの集中度によるダメージボーナスを加算する | |
162 | + * @param tdam 算出中のダメージ | |
163 | + * @return 集中度修正を加えたダメージ | |
164 | + */ | |
139 | 165 | int boost_concentration_damage(int tdam) |
140 | 166 | { |
141 | 167 | tdam *= (10 + p_ptr->concent); |
@@ -144,6 +170,10 @@ int boost_concentration_damage(int tdam) | ||
144 | 170 | return (tdam); |
145 | 171 | } |
146 | 172 | |
173 | +/*! | |
174 | + * @brief スナイパーの技能リストを表示する | |
175 | + * @return なし | |
176 | + */ | |
147 | 177 | void display_snipe_list(void) |
148 | 178 | { |
149 | 179 | int i; |
@@ -181,19 +211,23 @@ void display_snipe_list(void) | ||
181 | 211 | } |
182 | 212 | |
183 | 213 | |
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 | |
197 | 231 | */ |
198 | 232 | static int get_snipe_power(int *sn, bool only_browse) |
199 | 233 | { |
@@ -402,8 +436,16 @@ static int get_snipe_power(int *sn, bool only_browse) | ||
402 | 436 | return (TRUE); |
403 | 437 | } |
404 | 438 | |
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) | |
407 | 449 | { |
408 | 450 | monster_race *r_ptr = &r_info[m_ptr->r_idx]; |
409 | 451 | bool seen = is_seen(m_ptr); |
@@ -494,9 +536,12 @@ int tot_dam_aux_snipe (int mult, monster_type *m_ptr) | ||
494 | 536 | return (mult); |
495 | 537 | } |
496 | 538 | |
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を返す。 | |
500 | 545 | */ |
501 | 546 | static bool cast_sniper_spell(int spell) |
502 | 547 | { |
@@ -549,10 +594,9 @@ static bool cast_sniper_spell(int spell) | ||
549 | 594 | return (is_fired); |
550 | 595 | } |
551 | 596 | |
552 | - | |
553 | -/* | |
554 | - * do_cmd_cast calls this function if the player's class | |
555 | - * is 'mindcrafter'. | |
597 | +/*! | |
598 | + * @brief スナイパー技能コマンドのメインルーチン / | |
599 | + * @return なし | |
556 | 600 | */ |
557 | 601 | void do_cmd_snipe(void) |
558 | 602 | { |
@@ -614,9 +658,9 @@ void do_cmd_snipe(void) | ||
614 | 658 | p_ptr->window |= (PW_SPELL); |
615 | 659 | } |
616 | 660 | |
617 | -/* | |
618 | - * do_cmd_cast calls this function if the player's class | |
619 | - * is 'mindcrafter'. | |
661 | +/*! | |
662 | + * @brief スナイパー技能コマンドの表示 / | |
663 | + * @return なし | |
620 | 664 | */ |
621 | 665 | void do_cmd_snipe_browse(void) |
622 | 666 | { |