OSDN Git Service

[Refactor] #41053 Moved art-definition/*.h to artifact/
[hengband/hengband.git] / src / specific-object / death-crimson.c
1 #include "specific-object/death-crimson.h"
2 #include "artifact/fixed-art-types.h"
3 #include "effect/effect-characteristics.h"
4 #include "effect/effect-processor.h"
5 #include "floor/geometry.h"
6 #include "spell/spell-types.h"
7 #include "system/object-type-definition.h"
8 #include "target/target-checker.h"
9 #include "target/target-getter.h"
10 #include "view/display-messages.h"
11
12 /*!
13  * @brief クリムゾンを発射する / Fire Crimson, evoluting gun.
14  @ @param shooter_ptr 射撃を行うクリーチャー参照
15  * @return キャンセルした場合 false.
16  * @details
17  * Need to analyze size of the window.
18  * Need more color coding.
19  */
20 static bool fire_crimson(player_type *shooter_ptr)
21 {
22     DIRECTION dir;
23     if (!get_aim_dir(shooter_ptr, &dir))
24         return FALSE;
25
26     POSITION tx = shooter_ptr->x + 99 * ddx[dir];
27     POSITION ty = shooter_ptr->y + 99 * ddy[dir];
28     if ((dir == 5) && target_okay(shooter_ptr)) {
29         tx = target_col;
30         ty = target_row;
31     }
32
33     int num = 1;
34     if (shooter_ptr->pclass == CLASS_ARCHER) {
35         if (shooter_ptr->lev >= 10)
36             num++;
37
38         if (shooter_ptr->lev >= 30)
39             num++;
40
41         if (shooter_ptr->lev >= 45)
42             num++;
43     }
44
45     BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
46     for (int i = 0; i < num; i++)
47         (void)project(shooter_ptr, 0, shooter_ptr->lev / 20 + 1, ty, tx, shooter_ptr->lev * shooter_ptr->lev * 6 / 50, GF_ROCKET, flg, -1);
48
49     return TRUE;
50 }
51
52 bool activate_crimson(player_type *user_ptr, object_type *o_ptr)
53 {
54     if (o_ptr->name1 != ART_CRIMSON)
55         return FALSE;
56
57     msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
58     return fire_crimson(user_ptr);
59 }