変愚蛮怒のメインリポジトリです
Revisión | a35b2358a4eb8eb1935ce8059a24a353aa0e8e7c (tree) |
---|---|
Tiempo | 2020-03-08 22:55:01 |
Autor | deskull <deskull@user...> |
Commiter | deskull |
[Feature] #39581 広域マップでは変異による武器ドロップ処理が起こらないよう変更.当該処理を drop_weapons() に分離. / In wild map, a player doesn't drop weapons. That process is divided to drop_weapons().
@@ -2225,35 +2225,10 @@ static void process_world_aux_mutation(player_type *creature_ptr) | ||
2225 | 2225 | |
2226 | 2226 | if ((creature_ptr->muta2 & MUT2_DISARM) && one_in_(10000)) |
2227 | 2227 | { |
2228 | - INVENTORY_IDX slot = 0; | |
2229 | - object_type *o_ptr = NULL; | |
2230 | - | |
2231 | 2228 | disturb(creature_ptr, FALSE, TRUE); |
2232 | 2229 | msg_print(_("足がもつれて転んだ!", "You trip over your own feet!")); |
2233 | 2230 | 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); | |
2257 | 2232 | } |
2258 | 2233 | } |
2259 | 2234 |
@@ -3809,3 +3809,38 @@ bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn) | ||
3809 | 3809 | screen_load(); |
3810 | 3810 | return TRUE; |
3811 | 3811 | } |
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 | +} |
@@ -82,6 +82,7 @@ extern bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec); | ||
82 | 82 | extern bool set_superstealth(player_type *creature_ptr, bool set); |
83 | 83 | extern void do_poly_wounds(player_type *creature_ptr); |
84 | 84 | 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); | |
85 | 86 | |
86 | 87 | extern const kamae kamae_shurui[MAX_KAMAE]; |
87 | 88 | extern const kamae kata_shurui[MAX_KATA]; |
@@ -72,11 +72,12 @@ typedef struct debug_spell_command | ||
72 | 72 | spell_functions command_function; |
73 | 73 | } debug_spell_command; |
74 | 74 | |
75 | -#define SPELL_MAX 2 | |
75 | +#define SPELL_MAX 3 | |
76 | 76 | debug_spell_command debug_spell_commands_list[SPELL_MAX] = |
77 | 77 | { |
78 | 78 | { 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 } } } | |
80 | 81 | }; |
81 | 82 | |
82 | 83 | /*! |
@@ -88,7 +89,7 @@ static bool do_cmd_debug_spell(player_type *creature_ptr) | ||
88 | 89 | char tmp_val[50] = "\0"; |
89 | 90 | int tmp_int; |
90 | 91 | |
91 | - if (!get_string("SPELL:", tmp_val, 32)) return FALSE; | |
92 | + if (!get_string("SPELL: ", tmp_val, 32)) return FALSE; | |
92 | 93 | |
93 | 94 | for (int i = 0; i < SPELL_MAX; i++) |
94 | 95 | { |
@@ -98,18 +99,22 @@ static bool do_cmd_debug_spell(player_type *creature_ptr) | ||
98 | 99 | { |
99 | 100 | case 2: |
100 | 101 | (*(debug_spell_commands_list[i].command_function.spell2.spell_function))(creature_ptr); |
102 | + return TRUE; | |
101 | 103 | break; |
102 | 104 | case 3: |
103 | 105 | tmp_val[0] = '\0'; |
104 | 106 | if (!get_string("POWER:", tmp_val, 32)) return FALSE; |
105 | 107 | tmp_int = atoi(tmp_val); |
106 | 108 | (*(debug_spell_commands_list[i].command_function.spell3.spell_function))(creature_ptr, tmp_int); |
109 | + return TRUE; | |
107 | 110 | break; |
108 | 111 | default: |
109 | 112 | break; |
110 | 113 | } |
111 | 114 | } |
112 | 115 | |
116 | + msg_format("Command not found."); | |
117 | + | |
113 | 118 | return FALSE; |
114 | 119 | } |
115 | 120 |