変愚蛮怒のメインリポジトリです
Revision | 98a7bb13c8b28077873a62a3a32594e8eb0052c9 (tree) |
---|---|
Time | 2004-02-20 19:07:04 |
Author | nothere <nothere@0568...> |
Commiter | nothere |
博物館のアイテムを取り除き展示をやめるコマンドをTObandより移植. 取り
除かれたアイテムはゲームから消滅する.
@@ -4111,6 +4111,88 @@ msg_print(" | ||
4111 | 4111 | |
4112 | 4112 | |
4113 | 4113 | /* |
4114 | + * Remove an item from museum (Originally from TOband) | |
4115 | + */ | |
4116 | +static void museum_remove_object(void) | |
4117 | +{ | |
4118 | + int i; | |
4119 | + int item; | |
4120 | + object_type *o_ptr; | |
4121 | + char o_name[MAX_NLEN]; | |
4122 | + char out_val[160]; | |
4123 | + | |
4124 | + /* Empty? */ | |
4125 | + if (st_ptr->stock_num <= 0) | |
4126 | + { | |
4127 | +#ifdef JP | |
4128 | + msg_print("博物館には何も置いてありません。"); | |
4129 | +#else | |
4130 | + msg_print("Museum is empty."); | |
4131 | +#endif | |
4132 | + | |
4133 | + return; | |
4134 | + } | |
4135 | + | |
4136 | + /* Find the number of objects on this and following pages */ | |
4137 | + i = st_ptr->stock_num - store_top; | |
4138 | + | |
4139 | + /* And then restrict it to the current page */ | |
4140 | + if (i > 12) i = 12; | |
4141 | + | |
4142 | + /* Prompt */ | |
4143 | +#ifdef JP | |
4144 | + sprintf(out_val, "どのアイテムの展示をやめさせますか?"); | |
4145 | +#else | |
4146 | + sprintf(out_val, "Which item do you want to order to remove? "); | |
4147 | +#endif | |
4148 | + | |
4149 | + /* Get the item number to be removed */ | |
4150 | + if (!get_stock(&item, out_val, 0, i - 1)) return; | |
4151 | + | |
4152 | + /* Get the actual index */ | |
4153 | + item = item + store_top; | |
4154 | + | |
4155 | + /* Get the actual item */ | |
4156 | + o_ptr = &st_ptr->stock[item]; | |
4157 | + | |
4158 | + /* Description */ | |
4159 | + object_desc(o_name, o_ptr, 0); | |
4160 | + | |
4161 | +#ifdef JP | |
4162 | + msg_print("展示をやめさせたアイテムは二度と見ることはできません!"); | |
4163 | + if (!get_check(format("本当に%sの展示をやめさせますか?", o_name))) return; | |
4164 | +#else | |
4165 | + msg_print("You cannot see items which is removed from the Museum!"); | |
4166 | + if (!get_check(format("Really order to remove %s from the Museum? ", o_name))) return; | |
4167 | +#endif | |
4168 | + | |
4169 | + /* Message */ | |
4170 | +#ifdef JP | |
4171 | + msg_format("%sの展示をやめさせた。", o_name); | |
4172 | +#else | |
4173 | + msg_format("You ordered to remove %s.", o_name); | |
4174 | +#endif | |
4175 | + | |
4176 | + /* Remove the items from the home */ | |
4177 | + store_item_increase(item, -o_ptr->number); | |
4178 | + store_item_optimize(item); | |
4179 | + | |
4180 | + /* The item is gone */ | |
4181 | + | |
4182 | + /* Nothing left */ | |
4183 | + if (st_ptr->stock_num == 0) store_top = 0; | |
4184 | + | |
4185 | + /* Nothing left on that screen */ | |
4186 | + else if (store_top >= st_ptr->stock_num) store_top -= 12; | |
4187 | + | |
4188 | + /* Redraw everything */ | |
4189 | + display_inventory(); | |
4190 | + | |
4191 | + return; | |
4192 | +} | |
4193 | + | |
4194 | + | |
4195 | +/* | |
4114 | 4196 | * Hack -- set this to leave the store |
4115 | 4197 | */ |
4116 | 4198 | static bool leave_store = FALSE; |
@@ -4470,11 +4552,18 @@ static void store_process_command(void) | ||
4470 | 4552 | /* Hack -- Unknown command */ |
4471 | 4553 | default: |
4472 | 4554 | { |
4555 | + if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r')) | |
4556 | + { | |
4557 | + museum_remove_object(); | |
4558 | + } | |
4559 | + else | |
4560 | + { | |
4473 | 4561 | #ifdef JP |
4474 | - msg_print("そのコマンドは店の中では使えません。"); | |
4562 | + msg_print("そのコマンドは店の中では使えません。"); | |
4475 | 4563 | #else |
4476 | - msg_print("That command does not work in stores."); | |
4564 | + msg_print("That command does not work in stores."); | |
4477 | 4565 | #endif |
4566 | + } | |
4478 | 4567 | |
4479 | 4568 | break; |
4480 | 4569 | } |
@@ -4630,28 +4719,28 @@ void do_cmd_store(void) | ||
4630 | 4719 | if (cur_store_num == STORE_HOME) |
4631 | 4720 | { |
4632 | 4721 | #ifdef JP |
4633 | - prt("g) アイテムを取る", 21, 27); | |
4634 | - prt("d) アイテムを置く", 22, 27); | |
4635 | - prt("x) 家のアイテムを調べる", 23,27); | |
4722 | + prt("g) アイテムを取る", 21, 27); | |
4723 | + prt("d) アイテムを置く", 22, 27); | |
4724 | + prt("x) 家のアイテムを調べる", 23,27); | |
4636 | 4725 | #else |
4637 | - prt("g) Get an item.", 21, 27); | |
4638 | - prt("d) Drop an item.", 22, 27); | |
4639 | - prt("x) eXamine an item in the home.", 23,27); | |
4726 | + prt("g) Get an item.", 21, 27); | |
4727 | + prt("d) Drop an item.", 22, 27); | |
4728 | + prt("x) eXamine an item in the home.", 23,27); | |
4640 | 4729 | #endif |
4641 | - | |
4642 | 4730 | } |
4643 | 4731 | |
4644 | 4732 | /* Museum commands */ |
4645 | 4733 | else if (cur_store_num == STORE_MUSEUM) |
4646 | 4734 | { |
4647 | 4735 | #ifdef JP |
4648 | - prt("d) アイテムを置く", 21, 27); | |
4649 | - prt("x) 博物館のアイテムを調べる", 23,27); | |
4736 | + prt("d) アイテムを置く", 21, 27); | |
4737 | + prt("r) アイテムの展示をやめる", 22, 27); | |
4738 | + prt("x) 博物館のアイテムを調べる", 23, 27); | |
4650 | 4739 | #else |
4651 | - prt("d) Drop an item.", 21, 27); | |
4652 | - prt("x) eXamine an item in the museum.", 23,27); | |
4740 | + prt("d) Drop an item.", 21, 27); | |
4741 | + prt("r) order to Remove an item.", 22, 27); | |
4742 | + prt("x) eXamine an item in the museum.", 23, 27); | |
4653 | 4743 | #endif |
4654 | - | |
4655 | 4744 | } |
4656 | 4745 | |
4657 | 4746 | /* Shop commands XXX XXX XXX */ |
@@ -4662,11 +4751,10 @@ void do_cmd_store(void) | ||
4662 | 4751 | prt("s) アイテムを売る", 22, 30); |
4663 | 4752 | prt("x) 商品を調べる", 23,30); |
4664 | 4753 | #else |
4665 | - prt("p) Purchase an item.", 21, 30); | |
4666 | - prt("s) Sell an item.", 22, 30); | |
4667 | - prt("x) eXamine an item in the shop", 23,30); | |
4754 | + prt("p) Purchase an item.", 21, 30); | |
4755 | + prt("s) Sell an item.", 22, 30); | |
4756 | + prt("x) eXamine an item in the shop", 23,30); | |
4668 | 4757 | #endif |
4669 | - | |
4670 | 4758 | } |
4671 | 4759 | |
4672 | 4760 | #ifdef JP |
@@ -4674,7 +4762,7 @@ void do_cmd_store(void) | ||
4674 | 4762 | |
4675 | 4763 | prt("i/e) 持ち物/装備の一覧", 21, 56); |
4676 | 4764 | |
4677 | - if( rogue_like_commands == TRUE ) | |
4765 | + if (rogue_like_commands) | |
4678 | 4766 | { |
4679 | 4767 | prt("w/T) 装備する/はずす", 22, 56); |
4680 | 4768 | } |
@@ -4685,7 +4773,7 @@ void do_cmd_store(void) | ||
4685 | 4773 | #else |
4686 | 4774 | prt("i/e) Inventry/Equipment list", 21, 56); |
4687 | 4775 | |
4688 | - if( rogue_like_commands == TRUE ) | |
4776 | + if (rogue_like_commands) | |
4689 | 4777 | { |
4690 | 4778 | prt("w/T) Wear/Take off equipment", 22, 56); |
4691 | 4779 | } |