• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision5fd0642bba99c0813e7bdb9119eb04f9feea6590 (tree)
Time2019-02-23 20:10:54
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 クリムゾンの処理を fire_crimson() に分離。 / Separate activation of Crimson to fire_crimson().

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1958,43 +1958,10 @@ bool activate_artifact(object_type *o_ptr)
19581958
19591959 case ACT_CRIMSON:
19601960 {
1961- int num = 1;
1962- int i;
1963- BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
1964- int tx, ty;
1965-
19661961 /* Only for Crimson */
19671962 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1968-
19691963 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1970-
1971- if (!get_aim_dir(&dir)) return FALSE;
1972-
1973- /* Use the given direction */
1974- tx = p_ptr->x + 99 * ddx[dir];
1975- ty = p_ptr->y + 99 * ddy[dir];
1976-
1977- /* Hack -- Use an actual "target" */
1978- if ((dir == 5) && target_okay())
1979- {
1980- tx = target_col;
1981- ty = target_row;
1982- }
1983-
1984- if (p_ptr->pclass == CLASS_ARCHER)
1985- {
1986- /* Extra shot at level 10 */
1987- if (p_ptr->lev >= 10) num++;
1988-
1989- /* Extra shot at level 30 */
1990- if (p_ptr->lev >= 30) num++;
1991-
1992- /* Extra shot at level 45 */
1993- if (p_ptr->lev >= 45) num++;
1994- }
1995-
1996- for (i = 0; i < num; i++)
1997- project(0, p_ptr->lev / 20 + 1, ty, tx, p_ptr->lev*p_ptr->lev * 6 / 50, GF_ROCKET, flg, -1);
1964+ if(!fire_crimson()) return FALSE;
19981965 break;
19991966 }
20001967
--- a/src/externs.h
+++ b/src/externs.h
@@ -1036,6 +1036,7 @@ extern bool shock_power(void);
10361036 extern bool booze(player_type *creature_ptr);
10371037 extern bool detonation(player_type *creature_ptr);
10381038 extern void blood_curse_to_enemy(MONSTER_IDX m_idx);
1039+extern bool fire_crimson(void);
10391040
10401041
10411042 /* bldg.c */
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -4623,4 +4623,45 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
46234623 }
46244624 }
46254625 } while (one_in_(5));
4626-}
\ No newline at end of file
4626+}
4627+
4628+
4629+bool fire_crimson(void)
4630+{
4631+ int num = 1;
4632+ int i;
4633+ BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
4634+ POSITION tx, ty;
4635+ DIRECTION dir;
4636+
4637+ if (!get_aim_dir(&dir)) return FALSE;
4638+
4639+ /* Use the given direction */
4640+ tx = p_ptr->x + 99 * ddx[dir];
4641+ ty = p_ptr->y + 99 * ddy[dir];
4642+
4643+ /* Hack -- Use an actual "target" */
4644+ if ((dir == 5) && target_okay())
4645+ {
4646+ tx = target_col;
4647+ ty = target_row;
4648+ }
4649+
4650+ if (p_ptr->pclass == CLASS_ARCHER)
4651+ {
4652+ /* Extra shot at level 10 */
4653+ if (p_ptr->lev >= 10) num++;
4654+
4655+ /* Extra shot at level 30 */
4656+ if (p_ptr->lev >= 30) num++;
4657+
4658+ /* Extra shot at level 45 */
4659+ if (p_ptr->lev >= 45) num++;
4660+ }
4661+
4662+ for (i = 0; i < num; i++)
4663+ project(0, p_ptr->lev / 20 + 1, ty, tx, p_ptr->lev*p_ptr->lev * 6 / 50, GF_ROCKET, flg, -1);
4664+
4665+ return TRUE;
4666+}
4667+
Show on old repository browser