From 18 Jan, 2021 0:00 UTC: All services will be temporary unavailable for maintenance
  • R/O
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

無人機動兵器ダンジョン探索ゲーム JAVAベース


Commit MetaInfo

修订版36 (tree)
时间2015-07-09 18:55:53
作者manjihq

Log Message

出撃時にキャンセルするとパーツが減った状態になるのを修正

更改概述

差异

--- CarnageHack2/trunk/src/CarnageHack/CarnageHack.java (revision 35)
+++ CarnageHack2/trunk/src/CarnageHack/CarnageHack.java (revision 36)
@@ -24,7 +24,7 @@
2424 */
2525 public final class CarnageHack extends Panel implements ActionListener {
2626
27- public static final String version = "CarnageHack2 V1.3.1 alpha";
27+ public static final String version = "CarnageHack2 V1.3.2 alpha";
2828 public static final ResourceBundle resource;
2929 public static CHArrayList main_weapon_list;
3030 public static CHArrayList sub_weapon_list;
@@ -237,12 +237,12 @@
237237 }
238238
239239 /**
240- * 出撃に伴うパーツの在庫更新
240+ * 設定された機体で出撃可能かどうかをチェック
241241 *
242- * @return 出撃成功時にtrue
242+ * @return 出撃可能な時にtrue
243243 */
244- boolean update_parts() {
245- if (haveparts(main_weapon_list,
244+ boolean check_oke_parts() {
245+ return !(haveparts(main_weapon_list,
246246 hardware.get_mainweapon().get_name()) == false
247247 || haveparts(sub_weapon_list,
248248 hardware.get_subweapon().get_name()) == false
@@ -254,7 +254,16 @@
254254 || haveparts(fueltank_list,
255255 hardware.get_fueltank().get_name()) == false
256256 || haveparts(option_list,
257- hardware.get_option().get_name()) == false) {
257+ hardware.get_option().get_name()) == false);
258+ }
259+
260+ /**
261+ * 出撃に伴うパーツの在庫更新
262+ *
263+ * @return 出撃成功時にtrue
264+ */
265+ boolean update_parts() {
266+ if (check_oke_parts() == false) {
258267 return false;
259268 }
260269 delete_parts(hardware.get_mainweapon().get_name(),
@@ -341,7 +350,7 @@
341350 if (software != null && software.get(0, 0) != null && hardware
342351 != null) {
343352 //go to dungeon!
344- if (update_parts() == false) { //delete used parts
353+ if (check_oke_parts() == false) { //check used parts
345354 //don't have parts
346355 CHutil.MessageBox(resource.getString("noParts"),
347356 resource.getString("noPartsTitle"),
@@ -353,6 +362,13 @@
353362 null, true) == false) {
354363 return;
355364 }
365+ if (update_parts() == false) {
366+ //huh?
367+ CHutil.MessageBox(resource.getString("noParts"),
368+ resource.getString("noPartsTitle"),
369+ null, false);
370+ return;
371+ }
356372 save_data(); //save data now! :D
357373 collected_parts.clear();
358374 //process dungeon...