if ((creature_ptr->muta2 & MUT2_DISARM) && one_in_(10000))
{
- INVENTORY_IDX slot = 0;
- object_type *o_ptr = NULL;
-
disturb(creature_ptr, FALSE, TRUE);
msg_print(_("足がもつれて転んだ!", "You trip over your own feet!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, randint1(creature_ptr->wt / 6), _("転倒", "tripping"), -1);
-
- msg_print(NULL);
- if (has_melee_weapon(creature_ptr, INVEN_RARM))
- {
- slot = INVEN_RARM;
- o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
-
- if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2))
- {
- o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
- slot = INVEN_LARM;
- }
- }
- else if (has_melee_weapon(creature_ptr, INVEN_LARM))
- {
- o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
- slot = INVEN_LARM;
- }
- if (slot && !object_is_cursed(o_ptr))
- {
- msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
- drop_from_inventory(creature_ptr, slot, 1);
- }
+ drop_weapons(creature_ptr);
}
}
screen_load();
return TRUE;
}
+
+bool_hack drop_weapons(player_type *creature_ptr)
+{
+ INVENTORY_IDX slot = 0;
+ object_type *o_ptr = NULL;
+
+ if (creature_ptr->wild_mode) return FALSE;
+
+ msg_print(NULL);
+ if (has_melee_weapon(creature_ptr, INVEN_RARM))
+ {
+ slot = INVEN_RARM;
+ o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
+
+ if (has_melee_weapon(creature_ptr, INVEN_LARM) && one_in_(2))
+ {
+ o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
+ slot = INVEN_LARM;
+ }
+ }
+ else if (has_melee_weapon(creature_ptr, INVEN_LARM))
+ {
+ o_ptr = &creature_ptr->inventory_list[INVEN_LARM];
+ slot = INVEN_LARM;
+ }
+
+ if (slot && !object_is_cursed(o_ptr))
+ {
+ msg_print(_("武器を落としてしまった!", "You drop your weapon!"));
+ drop_from_inventory(creature_ptr, slot, 1);
+ return TRUE;
+ }
+
+ return FALSE;
+}
extern bool set_superstealth(player_type *creature_ptr, bool set);
extern void do_poly_wounds(player_type *creature_ptr);
extern void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effect_msg);
+extern bool_hack drop_weapons(player_type *creature_ptr);
extern const kamae kamae_shurui[MAX_KAMAE];
extern const kamae kata_shurui[MAX_KATA];
spell_functions command_function;
} debug_spell_command;
-#define SPELL_MAX 2
+#define SPELL_MAX 3
debug_spell_command debug_spell_commands_list[SPELL_MAX] =
{
{ 2, "vanish dungeon", {.spell2 = { vanish_dungeon } } },
- { 3, "true healing", {.spell3 = { true_healing } } }
+ { 3, "true healing", {.spell3 = { true_healing } } },
+ { 2, "drop weapons", {.spell2 = { drop_weapons } } }
};
/*!
char tmp_val[50] = "\0";
int tmp_int;
- if (!get_string("SPELL:", tmp_val, 32)) return FALSE;
+ if (!get_string("SPELL: ", tmp_val, 32)) return FALSE;
for (int i = 0; i < SPELL_MAX; i++)
{
{
case 2:
(*(debug_spell_commands_list[i].command_function.spell2.spell_function))(creature_ptr);
+ return TRUE;
break;
case 3:
tmp_val[0] = '\0';
if (!get_string("POWER:", tmp_val, 32)) return FALSE;
tmp_int = atoi(tmp_val);
(*(debug_spell_commands_list[i].command_function.spell3.spell_function))(creature_ptr, tmp_int);
+ return TRUE;
break;
default:
break;
}
}
+ msg_format("Command not found.");
+
return FALSE;
}