• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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


Commit MetaInfo

Revisiona35b2358a4eb8eb1935ce8059a24a353aa0e8e7c (tree)
Time2020-03-08 22:55:01
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Feature] #39581 広域マップでは変異による武器ドロップ処理が起こらないよう変更.当該処理を drop_weapons() に分離. / In wild map, a player doesn't drop weapons. That process is divided to drop_weapons().

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -2225,35 +2225,10 @@ static void process_world_aux_mutation(player_type *creature_ptr)
22252225
22262226 if ((creature_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
22272227 {
2228- INVENTORY_IDX slot = 0;
2229- object_type *o_ptr = NULL;
2230-
22312228 disturb(creature_ptr, FALSE, TRUE);
22322229 msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
22332230 take_hit(creature_ptr, DAMAGE_NOESCAPE, randint1(creature_ptr->wt / 6), _("転倒", "tripping"), -1);
2234-
2235- msg_print(NULL);
2236- if (has_melee_weapon(creature_ptr, INVEN_RARM))
2237- {
2238- slot = INVEN_RARM;
2239- o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
2240-
2241- if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2))
2242- {
2243- o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
2244- slot = INVEN_LARM;
2245- }
2246- }
2247- else if (has_melee_weapon(creature_ptr, INVEN_LARM))
2248- {
2249- o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
2250- slot = INVEN_LARM;
2251- }
2252- if (slot && !object_is_cursed(o_ptr))
2253- {
2254- msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
2255- drop_from_inventory(creature_ptr, slot, 1);
2256- }
2231+ drop_weapons(creature_ptr);
22572232 }
22582233 }
22592234
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3809,3 +3809,38 @@ bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn)
38093809 screen_load();
38103810 return TRUE;
38113811 }
3812+
3813+bool_hack drop_weapons(player_type *creature_ptr)
3814+{
3815+ INVENTORY_IDX slot = 0;
3816+ object_type *o_ptr = NULL;
3817+
3818+ if (creature_ptr->wild_mode) return FALSE;
3819+
3820+ msg_print(NULL);
3821+ if (has_melee_weapon(creature_ptr, INVEN_RARM))
3822+ {
3823+ slot = INVEN_RARM;
3824+ o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
3825+
3826+ if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2))
3827+ {
3828+ o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
3829+ slot = INVEN_LARM;
3830+ }
3831+ }
3832+ else if (has_melee_weapon(creature_ptr, INVEN_LARM))
3833+ {
3834+ o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
3835+ slot = INVEN_LARM;
3836+ }
3837+
3838+ if (slot && !object_is_cursed(o_ptr))
3839+ {
3840+ msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
3841+ drop_from_inventory(creature_ptr, slot, 1);
3842+ return TRUE;
3843+ }
3844+
3845+ return FALSE;
3846+}
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -82,6 +82,7 @@ extern bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
8282 extern bool set_superstealth(player_type *creature_ptr, bool set);
8383 extern void do_poly_wounds(player_type *creature_ptr);
8484 extern void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effect_msg);
85+extern bool_hack drop_weapons(player_type *creature_ptr);
8586
8687 extern const kamae kamae_shurui[MAX_KAMAE];
8788 extern const kamae kata_shurui[MAX_KATA];
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -72,11 +72,12 @@ typedef struct debug_spell_command
7272 spell_functions command_function;
7373 } debug_spell_command;
7474
75-#define SPELL_MAX 2
75+#define SPELL_MAX 3
7676 debug_spell_command debug_spell_commands_list[SPELL_MAX] =
7777 {
7878 { 2, "vanish dungeon", {.spell2 = { vanish_dungeon } } },
79- { 3, "true healing", {.spell3 = { true_healing } } }
79+ { 3, "true healing", {.spell3 = { true_healing } } },
80+ { 2, "drop weapons", {.spell2 = { drop_weapons } } }
8081 };
8182
8283 /*!
@@ -88,7 +89,7 @@ static bool do_cmd_debug_spell(player_type *creature_ptr)
8889 char tmp_val[50] = "\0";
8990 int tmp_int;
9091
91- if (!get_string("SPELL:", tmp_val, 32)) return FALSE;
92+ if (!get_string("SPELL: ", tmp_val, 32)) return FALSE;
9293
9394 for (int i = 0; i < SPELL_MAX; i++)
9495 {
@@ -98,18 +99,22 @@ static bool do_cmd_debug_spell(player_type *creature_ptr)
9899 {
99100 case 2:
100101 (*(debug_spell_commands_list[i].command_function.spell2.spell_function))(creature_ptr);
102+ return TRUE;
101103 break;
102104 case 3:
103105 tmp_val[0] = '\0';
104106 if (!get_string("POWER:", tmp_val, 32)) return FALSE;
105107 tmp_int = atoi(tmp_val);
106108 (*(debug_spell_commands_list[i].command_function.spell3.spell_function))(creature_ptr, tmp_int);
109+ return TRUE;
107110 break;
108111 default:
109112 break;
110113 }
111114 }
112115
116+ msg_format("Command not found.");
117+
113118 return FALSE;
114119 }
115120