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

修订版25 (tree)
时间2015-06-22 18:34:12
作者manjihq

Log Message

ステータス表示の内容を拡充
OKEをクリックしてフォーカスしたときにステータスの内容をそのOKEにするようにした

更改概述

差异

--- CarnageHack2/trunk/src/CarnageHack/Oke.java (revision 24)
+++ CarnageHack2/trunk/src/CarnageHack/Oke.java (revision 25)
@@ -1369,6 +1369,34 @@
13691369 current_software = 1;
13701370 }
13711371 }
1372+
1373+ /**
1374+ * 機体ステータスの処理パラメータ取得
1375+ *
1376+ * @return 現在の処理パラメータ
1377+ */
1378+ public int get_status_param() {
1379+ return param;
1380+ }
1381+
1382+ /**
1383+ * 現在のソフトウェア実行位置Xを取得
1384+ *
1385+ * @return 実行X座標
1386+ */
1387+ public int get_chipx() {
1388+ return chipx;
1389+ }
1390+
1391+ /**
1392+ * 現在のソフトウェア実行位置Yを取得
1393+ *
1394+ * @return 実行Y座標
1395+ */
1396+ public int get_chipy() {
1397+ return chipy;
1398+ }
1399+
13721400 }
13731401 //EOF
13741402
--- CarnageHack2/trunk/src/CarnageHack/OkeDungeon.java (revision 24)
+++ CarnageHack2/trunk/src/CarnageHack/OkeDungeon.java (revision 25)
@@ -253,6 +253,8 @@
253253 //プレイヤーOKEを表示基準にする
254254 viewBaseOke = pcOke;
255255 }
256+ //表示ロックした機体の情報をステータスウィンドウに表示
257+ status.set_oke(viewBaseOke);
256258 }
257259
258260 /**
--- CarnageHack2/trunk/src/CarnageHack/OkeStatusWindow.java (revision 24)
+++ CarnageHack2/trunk/src/CarnageHack/OkeStatusWindow.java (revision 25)
@@ -18,6 +18,7 @@
1818 Label heat;
1919 Label main_bullette;
2020 Label sub_bullette;
21+ Label software;
2122 Label status;
2223 Label option;
2324 Label backpack;
@@ -44,6 +45,7 @@
4445 heat = new Label();
4546 main_bullette = new Label();
4647 sub_bullette = new Label();
48+ software = new Label();
4749 status = new Label();
4850 option = new Label();
4951 backpack = new Label();
@@ -59,6 +61,7 @@
5961 add(heat);
6062 add(main_bullette);
6163 add(sub_bullette);
64+ add(software);
6265 add(status);
6366 add(option);
6467 add(backpack);
@@ -75,6 +78,57 @@
7578 }
7679
7780 /**
81+ * 武器ステータス詳細表示作成
82+ *
83+ * @return 作成した武器詳細
84+ */
85+ String make_weapon_param() {
86+ int param = oke.get_status_param();
87+ int nweapon = param & 1;
88+ int ncount = param >> 1;
89+ StringBuilder wkresult = new StringBuilder();
90+ wkresult.append((nweapon == 0) ? "MAIN" : "SUB");
91+ wkresult.append('[');
92+ wkresult.append(ncount);
93+ wkresult.append(']');
94+ return wkresult.toString();
95+ }
96+
97+ /**
98+ * 方向文字列の作成
99+ *
100+ * @return 作成した方向文字列
101+ */
102+ String make_direction_param() {
103+ switch (oke.get_status_param()) {
104+ case Oke.MOVE_FORWARD:
105+ return "FORWARD";
106+ case Oke.MOVE_BACKWARD:
107+ return "BACKWARD";
108+ case Oke.MOVE_LEFT:
109+ return "LEFT";
110+ case Oke.MOVE_RIGHT:
111+ return "RIGHT";
112+ }
113+ return "?";
114+ }
115+
116+ /**
117+ * 敵味方識別文字列の作成
118+ *
119+ * @return 作成した識別文字列
120+ */
121+ String make_oke_iff() {
122+ switch (oke.get_iff()) {
123+ case Oke.IFF_FRIEND:
124+ return "YOURS";
125+ case Oke.IFF_ENEMY:
126+ return "ENEMY";
127+ }
128+ return "?";
129+ }
130+
131+ /**
78132 * 表示更新
79133 */
80134 public void update() {
@@ -82,33 +136,47 @@
82136 position.setText("X:" + oke.get_x() + " Y:" + oke.get_y()
83137 + " Direction:" + oke.get_degree() + " B" + (oke.get_floor()
84138 + 1) + "F");
85- hp.setText("HP:" + oke.get_hp() + "/" + oke.get_max_hp());
139+ hp.setText("IFF:" + make_oke_iff()
140+ + " HP:" + oke.get_hp() + "/" + oke.get_max_hp());
86141 fuel.setText("FUEL:" + oke.get_fuel() + "/" + oke.get_hardware().
87142 get_fueltank().get_fuel());
88143 heat.setText("HEAT:" + oke.get_tempture());
89144 main_bullette.setText("MAIN:" + oke.get_bullette(0));
90145 sub_bullette.setText("SUB:" + oke.get_bullette(1));
146+ software.setText("CHIP X:" + oke.get_chipx() + " Y:" + oke.get_chipy());
91147 switch (oke.get_status()) {
92148 case Oke.STATUS_NORMAL:
93149 status_str = "NORMAL";
94150 break;
95151 case Oke.STATUS_MOVE:
96- status_str = "MOVE";
152+ status_str = "MOVE ";
153+ status_str += make_direction_param();
97154 break;
98155 case Oke.STATUS_TURN:
99- status_str = "TURN";
156+ status_str = "TURN ";
157+ switch (oke.get_status_param()) {
158+ case Oke.TURN_LEFT:
159+ status_str += "LEFT";
160+ break;
161+ case Oke.TURN_RIGHT:
162+ status_str += "RIGHT";
163+ break;
164+ }
100165 break;
101166 case Oke.STATUS_GET:
102167 status_str = "GET";
103168 break;
104169 case Oke.STATUS_BEFOREFIRE:
105- status_str = "Prepare FIRE";
170+ status_str = "Prepare FIRE ";
171+ status_str += make_weapon_param();
106172 break;
107173 case Oke.STATUS_FIRENOW:
108174 status_str = "FIRE";
175+ status_str += make_weapon_param();
109176 break;
110177 case Oke.STATUS_ENDFIRE:
111178 status_str = "End FIRE";
179+ status_str += make_weapon_param();
112180 break;
113181 case Oke.STATUS_FIGHT:
114182 status_str = "FIGHT";
@@ -118,12 +186,15 @@
118186 break;
119187 case Oke.STATUS_BEFOREJUMP:
120188 status_str = "Prepare JUMP";
189+ status_str += make_direction_param();
121190 break;
122191 case Oke.STATUS_JUMPNOW:
123192 status_str = "JUMP";
193+ status_str += make_direction_param();
124194 break;
125195 case Oke.STATUS_ENDJUMP:
126196 status_str = "End JUMP";
197+ status_str += make_direction_param();
127198 break;
128199 case Oke.STATUS_STAIRS:
129200 status_str = "UP/DOWN STAIRS";
@@ -150,4 +221,14 @@
150221 counterE.setText("E = " + oke.get_counter("E"));
151222 counterF.setText("F = " + oke.get_counter("F"));
152223 }
224+
225+ /**
226+ * 表示対称を設定
227+ *
228+ * @param p 表示対象のOKE
229+ */
230+ public void set_oke(Oke p) {
231+ oke = p;
232+ repaint();
233+ }
153234 }