X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fplayer-effects.c;h=18183ba9f5ba7addda5a9d80df36cec6b0c4eccc;hb=738fd652c9f50ec7faa3cfa11bb28790dda8922a;hp=8816205e1ede89a10ebef417ff4077aa23eb1948;hpb=3fc4ae197a922353ff34e9cb7c9558cdd6a57e3e;p=hengband%2Fhengband.git diff --git a/src/player-effects.c b/src/player-effects.c index 8816205e1..18183ba9f 100644 --- a/src/player-effects.c +++ b/src/player-effects.c @@ -13,24 +13,24 @@ */ #include "angband.h" -#include "term.h" -#include "core.h" +#include "gameterm.h" +#include "core/stuff-handler.h" #include "util.h" #include "creature.h" #include "artifact.h" #include "cmd-dump.h" -#include "floor.h" -#include "bldg.h" -#include "birth.h" +#include "floor/floor.h" +#include "market/building.h" +#include "birth/birth.h" #include "grid.h" -#include "mutation.h" +#include "mutation/mutation.h" #include "quest.h" #include "avatar.h" #include "spells-status.h" -#include "realm-song.h" -#include "realm-hex.h" +#include "realm/realm-song.h" +#include "realm/realm-hex.h" #include "object-ego.h" #include "object-hook.h" #include "wild.h" @@ -39,7 +39,7 @@ #include "player-class.h" #include "player-move.h" #include "player-effects.h" -#include "player-race.h" +#include "player/race-info-table.h" #include "player-class.h" #include "player-personality.h" #include "player-sex.h" @@ -48,13 +48,13 @@ #include "snipe.h" #include "files.h" #include "monster-spell.h" -#include "world.h" -#include "objectkind.h" -#include "autopick.h" +#include "world/world.h" +#include "object/object-kind.h" +#include "autopick/autopick-reader-writer.h" #include "save.h" #include "report.h" -#include "view-mainwindow.h" +#include "view/display-main-window.h" /*! * @brief 修行僧の構え能力テーブル @@ -3206,7 +3206,7 @@ bool lose_all_info(player_type *creature_ptr) { object_type *o_ptr = &creature_ptr->inventory_list[i]; if (!o_ptr->k_idx) continue; - if (o_ptr->ident & (IDENT_MENTAL)) continue; + if (OBJECT_IS_FULL_KNOWN(o_ptr)) continue; o_ptr->feeling = FEEL_NONE; o_ptr->ident &= ~(IDENT_EMPTY); @@ -3809,3 +3809,38 @@ bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT immune_turn) 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; +}