1 #include "spell-realm/spells-nature.h"
2 #include "flavor/flavor-describer.h"
3 #include "flavor/object-flavor-types.h"
4 #include "floor/floor-object.h"
5 #include "object-enchant/tr-types.h"
6 #include "object-hook/hook-armor.h"
7 #include "object-hook/hook-checker.h"
8 #include "object/item-tester-hooker.h"
9 #include "object/item-use-flags.h"
10 #include "racial/racial-android.h"
11 #include "util/bit-flags-calculator.h"
12 #include "view/display-messages.h"
16 * @param caster_ptr 錆止め実行者の参照ポインタ
17 * @return ターン消費を要する処理を行ったならばTRUEを返す
19 bool rustproof(player_type *caster_ptr)
21 item_tester_hook = object_is_armour;
22 concptr q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
23 concptr s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
25 object_type *o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, 0);
29 GAME_TEXT o_name[MAX_NLEN];
30 describe_flavor(caster_ptr, o_name, o_ptr, OD_OMIT_PREFIX | OD_NAME_ONLY);
31 add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
32 if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr)) {
34 msg_format("%sは新品同様になった!", o_name);
36 msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
42 msg_format("%sは腐食しなくなった。", o_name);
44 msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
46 calc_android_exp(caster_ptr);