• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisioncdb51ae1d9d374ea5dc6c5b09518922864532075 (tree)
Time2019-05-08 21:20:15
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 cheat_death() を player-status.c/h へ移動.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -242,7 +242,6 @@ extern void spoil_random_artifact(concptr fname);
242242
243243 /* wizard2.c */
244244 extern void strip_name(char *buf, KIND_OBJECT_IDX k_idx);
245-extern void cheat_death(player_type *creature_ptr);
246245
247246
248247 #ifdef JP
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -4793,3 +4793,106 @@ long calc_score(void)
47934793 return point;
47944794 }
47954795
4796+
4797+void cheat_death(player_type *creature_ptr)
4798+{
4799+ /* Mark social class, reset age, if needed */
4800+ if (creature_ptr->sc) creature_ptr->sc = creature_ptr->age = 0;
4801+
4802+ /* Increase age */
4803+ creature_ptr->age++;
4804+
4805+ /* Mark savefile */
4806+ creature_ptr->noscore |= 0x0001;
4807+
4808+ msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death."));
4809+ msg_print(NULL);
4810+
4811+ (void)life_stream(FALSE, FALSE);
4812+
4813+ if (creature_ptr->pclass == CLASS_MAGIC_EATER)
4814+ {
4815+ int magic_idx;
4816+ for (magic_idx = 0; magic_idx < EATER_EXT * 2; magic_idx++)
4817+ {
4818+ creature_ptr->magic_num1[magic_idx] = creature_ptr->magic_num2[magic_idx] * EATER_CHARGE;
4819+ }
4820+ for (; magic_idx < EATER_EXT * 3; magic_idx++)
4821+ {
4822+ creature_ptr->magic_num1[magic_idx] = 0;
4823+ }
4824+ }
4825+
4826+ /* Restore spell points */
4827+ creature_ptr->csp = creature_ptr->msp;
4828+ creature_ptr->csp_frac = 0;
4829+
4830+ /* Hack -- cancel recall */
4831+ if (creature_ptr->word_recall)
4832+ {
4833+ msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you..."));
4834+ msg_print(NULL);
4835+
4836+ /* Hack -- Prevent recall */
4837+ creature_ptr->word_recall = 0;
4838+ creature_ptr->redraw |= (PR_STATUS);
4839+ }
4840+
4841+ /* Hack -- cancel alter */
4842+ if (creature_ptr->alter_reality)
4843+ {
4844+ /* Hack -- Prevent alter */
4845+ creature_ptr->alter_reality = 0;
4846+ creature_ptr->redraw |= (PR_STATUS);
4847+ }
4848+
4849+ /* Note cause of death */
4850+ (void)strcpy(creature_ptr->died_from, _("死の欺き", "Cheating death"));
4851+
4852+ /* Do not die */
4853+ creature_ptr->is_dead = FALSE;
4854+
4855+ /* Hack -- Prevent starvation */
4856+ (void)set_food(PY_FOOD_MAX - 1);
4857+
4858+ current_floor_ptr->dun_level = 0;
4859+ creature_ptr->inside_arena = FALSE;
4860+ creature_ptr->inside_battle = FALSE;
4861+ leaving_quest = 0;
4862+ creature_ptr->inside_quest = 0;
4863+ if (p_ptr->dungeon_idx) creature_ptr->recall_dungeon = p_ptr->dungeon_idx;
4864+ p_ptr->dungeon_idx = 0;
4865+ if (lite_town || vanilla_town)
4866+ {
4867+ creature_ptr->wilderness_y = 1;
4868+ creature_ptr->wilderness_x = 1;
4869+ if (vanilla_town)
4870+ {
4871+ creature_ptr->oldpy = 10;
4872+ creature_ptr->oldpx = 34;
4873+ }
4874+ else
4875+ {
4876+ creature_ptr->oldpy = 33;
4877+ creature_ptr->oldpx = 131;
4878+ }
4879+ }
4880+ else
4881+ {
4882+ creature_ptr->wilderness_y = 48;
4883+ creature_ptr->wilderness_x = 5;
4884+ creature_ptr->oldpy = 33;
4885+ creature_ptr->oldpx = 131;
4886+ }
4887+ creature_ptr->wild_mode = FALSE;
4888+ creature_ptr->leaving = TRUE;
4889+
4890+ do_cmd_write_nikki(NIKKI_BUNSHOU, 1,
4891+ _(" しかし、生き返った。",
4892+ " but revived."));
4893+
4894+ /* Prepare next floor */
4895+ leave_floor();
4896+ wipe_m_list();
4897+
4898+}
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -669,3 +669,5 @@ extern const s32b player_exp_a[PY_MAX_LEVEL];
669669 #define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
670670 #define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
671671 #define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
672+
673+extern void cheat_death(player_type *creature_ptr);
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -1991,109 +1991,6 @@ void do_cmd_debug(void)
19911991 }
19921992 }
19931993
1994-void cheat_death(player_type *creature_ptr)
1995-{
1996- /* Mark social class, reset age, if needed */
1997- if (creature_ptr->sc) creature_ptr->sc = creature_ptr->age = 0;
1998-
1999- /* Increase age */
2000- creature_ptr->age++;
2001-
2002- /* Mark savefile */
2003- creature_ptr->noscore |= 0x0001;
2004-
2005- msg_print(_("ウィザードモードに念を送り、死を欺いた。", "You invoke wizard mode and cheat death."));
2006- msg_print(NULL);
2007-
2008- (void)life_stream(FALSE, FALSE);
2009-
2010- if (creature_ptr->pclass == CLASS_MAGIC_EATER)
2011- {
2012- int magic_idx;
2013- for (magic_idx = 0; magic_idx < EATER_EXT * 2; magic_idx++)
2014- {
2015- creature_ptr->magic_num1[magic_idx] = creature_ptr->magic_num2[magic_idx] * EATER_CHARGE;
2016- }
2017- for (; magic_idx < EATER_EXT * 3; magic_idx++)
2018- {
2019- creature_ptr->magic_num1[magic_idx] = 0;
2020- }
2021- }
2022-
2023- /* Restore spell points */
2024- creature_ptr->csp = creature_ptr->msp;
2025- creature_ptr->csp_frac = 0;
2026-
2027- /* Hack -- cancel recall */
2028- if (creature_ptr->word_recall)
2029- {
2030- msg_print(_("張りつめた大気が流れ去った...", "A tension leaves the air around you..."));
2031- msg_print(NULL);
2032-
2033- /* Hack -- Prevent recall */
2034- creature_ptr->word_recall = 0;
2035- creature_ptr->redraw |= (PR_STATUS);
2036- }
2037-
2038- /* Hack -- cancel alter */
2039- if (creature_ptr->alter_reality)
2040- {
2041- /* Hack -- Prevent alter */
2042- creature_ptr->alter_reality = 0;
2043- creature_ptr->redraw |= (PR_STATUS);
2044- }
2045-
2046- /* Note cause of death */
2047- (void)strcpy(creature_ptr->died_from, _("死の欺き", "Cheating death"));
2048-
2049- /* Do not die */
2050- creature_ptr->is_dead = FALSE;
2051-
2052- /* Hack -- Prevent starvation */
2053- (void)set_food(PY_FOOD_MAX - 1);
2054-
2055- current_floor_ptr->dun_level = 0;
2056- creature_ptr->inside_arena = FALSE;
2057- creature_ptr->inside_battle = FALSE;
2058- leaving_quest = 0;
2059- creature_ptr->inside_quest = 0;
2060- if (p_ptr->dungeon_idx) creature_ptr->recall_dungeon = p_ptr->dungeon_idx;
2061- p_ptr->dungeon_idx = 0;
2062- if (lite_town || vanilla_town)
2063- {
2064- creature_ptr->wilderness_y = 1;
2065- creature_ptr->wilderness_x = 1;
2066- if (vanilla_town)
2067- {
2068- creature_ptr->oldpy = 10;
2069- creature_ptr->oldpx = 34;
2070- }
2071- else
2072- {
2073- creature_ptr->oldpy = 33;
2074- creature_ptr->oldpx = 131;
2075- }
2076- }
2077- else
2078- {
2079- creature_ptr->wilderness_y = 48;
2080- creature_ptr->wilderness_x = 5;
2081- creature_ptr->oldpy = 33;
2082- creature_ptr->oldpx = 131;
2083- }
2084- creature_ptr->wild_mode = FALSE;
2085- creature_ptr->leaving = TRUE;
2086-
2087- do_cmd_write_nikki(NIKKI_BUNSHOU, 1,
2088- _(" しかし、生き返った。",
2089- " but revived."));
2090-
2091- /* Prepare next floor */
2092- leave_floor();
2093- wipe_m_list();
2094-
2095-}
2096-
20971994
20981995 #else
20991996
Show on old repository browser