• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision22 (tree)
Time2015-02-01 20:21:00
Authorxops-mikan

Log Message

デバック用コンソール機能を追加、そのコマンドに対応するための機能拡張

Change Summary

Incremental Difference

--- trunk/window.h (revision 21)
+++ trunk/window.h (revision 22)
@@ -39,6 +39,7 @@
3939
4040 #include <windows.h>
4141 #include <mmsystem.h>
42+#include <time.h>
4243
4344 #pragma comment(lib, "winmm.lib")
4445
@@ -46,6 +47,7 @@
4647 float GetFps(int getcnt);
4748 bool ControlFps();
4849 unsigned int GetTimeMS();
50+void GetTimeName(char *str);
4951 void InitRand();
5052 int GetRand(int num);
5153
--- trunk/gamemain.cpp (revision 21)
+++ trunk/gamemain.cpp (revision 22)
@@ -222,7 +222,7 @@
222222
223223 //マップを描画
224224 d3dg->ResetWorldTransform();
225- d3dg->DrawMapdata();
225+ d3dg->DrawMapdata(false);
226226
227227 //オブジェクトを描画
228228 ObjMgr.Render(camera_x, camera_y, camera_z, 0);
@@ -245,11 +245,11 @@
245245 if( (int)(15.0f*GAMEFPS) <= framecnt ){
246246 effect = 1.0f;
247247 }
248- d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,effect));
248+ d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,effect));
249249
250250 //上下の黒縁描画
251251 d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, 40, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
252- d3dg->Draw2DBox(0, SCREEN_HEIGTH - 40, SCREEN_WIDTH, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
252+ d3dg->Draw2DBox(0, SCREEN_HEIGHT - 40, SCREEN_WIDTH, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
253253
254254 //プロジェクト名
255255 if( ((int)(0.5f*GAMEFPS) < framecnt)&&(framecnt < (int)(4.0f*GAMEFPS)) ){
@@ -258,7 +258,7 @@
258258 sprintf(str, GAMENAME" project", 0, 0);
259259 if( framecnt < (int)(1.5f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 0.5f, false); }
260260 if( framecnt > (int)(3.0f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 3.0f, true); }
261- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - strlen(str)*22/2, SCREEN_HEIGTH - 140, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,effectA), 22, 22);
261+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - strlen(str)*22/2, SCREEN_HEIGHT - 140, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,effectA), 22, 22);
262262 }
263263
264264 //スタッフ名・その1
@@ -299,7 +299,7 @@
299299 if( framecnt < (int)(13.0f*GAMEFPS) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 12.0f, false); }
300300 if( ((int)(16.0f*GAMEFPS) < framecnt)&&(framecnt < (int)(17.0f*GAMEFPS)) ){ effectA = GetEffectAlpha(framecnt, 1.0f, 1.0f, 16.0f, true); }
301301 if( framecnt >= (int)(17.0f*GAMEFPS) ){ effectA = 0.0f; }
302- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - strlen(str)*22/2, (SCREEN_HEIGTH-11)/2, str, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,effectA), 22, 22);
302+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - strlen(str)*22/2, (SCREEN_HEIGHT-11)/2, str, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,effectA), 22, 22);
303303 }
304304 }
305305
@@ -390,7 +390,7 @@
390390 GameSound->InitWorldSound();
391391
392392 mainmenu_mouseX = SCREEN_WIDTH/2;
393- mainmenu_mouseY = SCREEN_HEIGTH/2;
393+ mainmenu_mouseY = SCREEN_HEIGHT/2;
394394
395395 //標準ミッションのスクロールバーの設定
396396 if( TOTAL_OFFICIALMISSION > TOTAL_MENUITEMS ){
@@ -453,7 +453,7 @@
453453 if( mainmenu_mouseX < 0 ){ mainmenu_mouseX = 0; }
454454 if( mainmenu_mouseX > SCREEN_WIDTH-1 ){ mainmenu_mouseX = SCREEN_WIDTH-1; }
455455 if( mainmenu_mouseY < 0 ){ mainmenu_mouseY = 0; }
456- if( mainmenu_mouseY > SCREEN_HEIGTH-1 ){ mainmenu_mouseY = SCREEN_HEIGTH-1; }
456+ if( mainmenu_mouseY > SCREEN_HEIGHT-1 ){ mainmenu_mouseY = SCREEN_HEIGHT-1; }
457457
458458 //ESCキーを処理
459459 if( inputCtrl->CheckKeyDown(GetEscKeycode()) ){
@@ -575,7 +575,7 @@
575575
576576 //マップを描画
577577 d3dg->ResetWorldTransform();
578- d3dg->DrawMapdata();
578+ d3dg->DrawMapdata(false);
579579
580580 //オブジェクトを描画
581581 ObjMgr.Render(camera_x, camera_y, camera_z, 0);
@@ -738,9 +738,9 @@
738738
739739 //マウスカーソル描画(赤線)
740740 d3dg->Draw2DBox(0, mainmenu_mouseY-1, SCREEN_WIDTH, mainmenu_mouseY+1, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
741- d3dg->Draw2DBox(mainmenu_mouseX-1, 0, mainmenu_mouseX+1, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
741+ d3dg->Draw2DBox(mainmenu_mouseX-1, 0, mainmenu_mouseX+1, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
742742 d3dg->Draw2DLine(0, mainmenu_mouseY, SCREEN_WIDTH, mainmenu_mouseY, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
743- d3dg->Draw2DLine(mainmenu_mouseX, 0, mainmenu_mouseX, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
743+ d3dg->Draw2DLine(mainmenu_mouseX, 0, mainmenu_mouseX, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
744744
745745 //ゲームのロゴマーク描画
746746 d3dg->Draw2DTexture(20, 25, gametitle, 480, 80, 1.0f);
@@ -752,7 +752,7 @@
752752 else{
753753 effect = 0.0f;
754754 }
755- d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,effect));
755+ d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,effect));
756756 }
757757
758758 void mainmenu::Destroy()
@@ -840,9 +840,9 @@
840840
841841 //固定文字描画
842842 d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 60*4, 30, "BRIEFING", D3DCOLOR_COLORVALUE(1.0f,1.0f,0.0f,effectA), 60, 42);
843- d3dg->Draw2DTextureFontText(SCREEN_WIDTH - 210 - effectB_sizeW*20/2, SCREEN_HEIGTH - 37 - effectB_sizeH/2,
843+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH - 210 - effectB_sizeW*20/2, SCREEN_HEIGHT - 37 - effectB_sizeH/2,
844844 "LEFT CLICK TO BEGIN", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,effectB), effectB_sizeW, effectB_sizeH);
845- d3dg->Draw2DTextureFontText(SCREEN_WIDTH - 210 - 18*20/2, SCREEN_HEIGTH - 37 - 26/2, "LEFT CLICK TO BEGIN", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 18, 26);
845+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH - 210 - 18*20/2, SCREEN_HEIGHT - 37 - 26/2, "LEFT CLICK TO BEGIN", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 18, 26);
846846
847847 //ブリーフィング画像描画
848848 if( TwoTexture == false ){
@@ -976,7 +976,14 @@
976976 view_rx = 0.0f;
977977 view_ry = 0.0f;
978978 Camera_Debugmode = false;
979+ tag = false;
980+ wireframe = false;
981+ CenterLine = false;
979982 Camera_F1mode = false;
983+ InvincibleID = -1;
984+ PlayerAI = false;
985+ AIstop = false;
986+ AINoFight = false;
980987 framecnt = 0;
981988 start_framecnt = 0;
982989 end_framecnt = 0;
@@ -989,6 +996,22 @@
989996 MainGameInfo.kill = 0;
990997 MainGameInfo.headshot = 0;
991998
999+#ifdef ENABLE_DEBUGCONSOLE
1000+ Show_Console = false;
1001+
1002+ //コンソール用初期化
1003+ InfoConsoleData = new ConsoleData [MAX_CONSOLELINES];
1004+ InputConsoleData = new ConsoleData;
1005+ for(int i=0; i<MAX_CONSOLELINES; i++){
1006+ InfoConsoleData[i].color = D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f);
1007+ InfoConsoleData[i].textdata[0] = NULL;
1008+ }
1009+ InputConsoleData->color = D3DCOLOR_COLORVALUE(1.0f,1.0f,0.0f,1.0f);
1010+ InputConsoleData->textdata[0] = NULL;
1011+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Game Debug Console.");
1012+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), " Command list >help");
1013+#endif
1014+
9921015 GameState->NextState();
9931016 return 0;
9941017 }
@@ -1088,143 +1111,57 @@
10881111 inputCtrl->GetInputState(true);
10891112 inputCtrl->MoveMouseCenter();
10901113
1091- //前後左右の移動(走り)操作かチェック
1092- if( CheckInputControl(KEY_MOVEFORWARD, 0) ){
1093- ObjMgr.MoveForward(PlayerID);
1094- }
1095- if( CheckInputControl(KEY_MOVEBACKWARD, 0) ){
1096- ObjMgr.MoveBack(PlayerID);
1097- }
1098- if( CheckInputControl(KEY_MOVELEFT, 0) ){
1099- ObjMgr.MoveLeft(PlayerID);
1100- }
1101- if( CheckInputControl(KEY_MOVERIGHT, 0) ){
1102- ObjMgr.MoveRight(PlayerID);
1103- }
1114+ //マウスの移動量取得
1115+ int x, y;
1116+ float MouseSensitivity;
1117+ inputCtrl->GetMouseMovement(&x, &y);
11041118
1105- //歩き操作かチェック
1106- if( CheckInputControl(KEY_WALK, 0) ){
1107- ObjMgr.MoveWalk(PlayerID);
1108- }
1119+ //視点の移動量計算
1120+ float mang;
1121+ if( myHuman->GetScopeMode() == 0 ){ mang = 0.01f; }
1122+ if( myHuman->GetScopeMode() == 1 ){ mang = 0.0032f; }
1123+ if( myHuman->GetScopeMode() == 2 ){ mang = 0.0060f; }
1124+ MouseSensitivity = (float)M_PI/180 * mang * GameConfig.GetMouseSensitivity();
11091125
1110- //ジャンプ操作かチェック
1111- if( CheckInputControl(KEY_JUMP, 1) ){
1112- ObjMgr.MoveJump(PlayerID);
1126+ //マウス反転(オプション設定)が有効ならば、反転する。
1127+ if( GameConfig.GetInvertMouseFlag() == true ){
1128+ y *= -1;
11131129 }
11141130
1115- if( Camera_Debugmode == true ){ //デバックモードならば
1116- //発砲操作かチェック
1117- if( CheckInputControl(KEY_Shot, 0) ){
1118- //前回の発射より、4フレーム分よりも時間が経っていれば
1119- if( bullettime + 4*((int)GAMEFPS) < GetTimeMS() ){
1120- float x, y, z, rx, ry;
1121- x = camera_x;
1122- y = camera_y;
1123- z = camera_z;
1124- rx = camera_rx;
1125- ry = camera_ry;
1131+ if( Camera_Debugmode == false ){ //通常モードならば
1132+ if( myHuman->GetHP() > 0 ){
1133+ //マウスによる向きを計算
1134+ mouse_rx += x * MouseSensitivity;
1135+ mouse_ry -= y * MouseSensitivity;
11261136
1127- //未使用の弾オブジェクトを取得
1128- bullet* newbullet = ObjMgr.GetNewBulletObject();
1129- if( newbullet != NULL ){
1130- //弾オブジェクトを設定
1131- newbullet->SetPosData(x, y, z, rx, ry);
1132- newbullet->SetParamData(40, 5, 10, 1024, ObjMgr.GetPlayerID(), true);
1133- newbullet->SetDrawFlag(true);
1134- GameSound->ShotWeapon(x, y, z, 0, 1024, true);
1137+ //キー操作による向きを計算
1138+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x00)) ){ mouse_ry += (float)M_PI/180 * 3; } // [↑]
1139+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x01)) ){ mouse_ry -= (float)M_PI/180 * 3; } // [↓]
1140+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x02)) ){ mouse_rx -= (float)M_PI/180 * 3; } // [←]
1141+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x03)) ){ mouse_rx += (float)M_PI/180 * 3; } // [→]
11351142
1136- //スコアに加算
1137- MainGameInfo.fire += 1;
1138-
1139- //発射時間を記憶(連射間隔判定用)
1140- bullettime = GetTimeMS();
1141- }
1142- }
1143+ if( mouse_ry > (float)M_PI/18*7 ) mouse_ry = (float)M_PI/18*7;
1144+ if( mouse_ry < (float)M_PI/18*7 *-1 ) mouse_ry = (float)M_PI/18*7 *-1;
11431145 }
11441146 }
1145- else{ //デバックモードでなければ
1146- HumanParameter humandata;
1147- int id_param;
1148- bool zombie;
1149- int keymode;
1147+ else{ //デバックモードならば
1148+ //キー操作によりカメラ座標を計算
1149+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x00)) ){ camera_x += 2.0f; } // [↑]
1150+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x01)) ){ camera_x -= 2.0f; } // [↓]
1151+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x02)) ){ camera_z += 2.0f; } // [←]
1152+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x03)) ){ camera_z -= 2.0f; } // [→]
1153+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x48)) ){ camera_y += 2.0f; } //[NUM +]
1154+ if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x49)) ){ camera_y -= 2.0f; } //[NUM -]
11501155
1151- //ゾンビかどうか判定
1152- myHuman->GetParamData(&id_param, NULL, NULL, NULL);
1153- GameParamInfo.GetHuman(id_param, &humandata);
1154- if( humandata.type == 2 ){
1155- zombie = true;
1156- }
1157- else{
1158- zombie = false;
1159- }
1160-
1161- //連射モードを取得
1162- if( zombie == true ){
1163- keymode = 1;
1164- }
1165- else if( myHuman->GetWeaponBlazingmode() == false ){
1166- keymode = 1;
1167- }
1168- else{
1169- keymode = 0;
1170- }
1171-
1172- //発砲操作かチェック
1173- if( CheckInputControl(KEY_Shot, keymode) ){
1174-
1175- if( zombie == false ){
1176- //弾の発射に成功すれば
1177- if( ObjMgr.ShotWeapon(PlayerID) == 1 ){
1178- //スコアに加算
1179- MainGameInfo.fire += 1;
1180-
1181- //プレイヤーの向きを取得
1182- ObjMgr.GetPlayerHumanObject()->GetRxRy(&mouse_rx, &mouse_ry);
1183- }
1184- }
1185- else{
1186- for(int i=0; i<MAX_HUMAN; i++){
1187- human *EnemyHuman = ObjMgr.GeHumanObject(i);
1188- if( ObjMgr.CheckZombieAttack(myHuman, EnemyHuman) == true ){
1189- ObjMgr.HitZombieAttack(EnemyHuman);
1190- }
1191- }
1192- }
1193-
1194- }
1156+ //マウス移動をカメラの向きとして適用
1157+ //camera_rx -= x*0.0025f;
1158+ //camera_ry -= y*0.0025f;
1159+ camera_rx -= x * MouseSensitivity;
1160+ camera_ry -= y * MouseSensitivity;
1161+ if( camera_ry > (float)M_PI/18*7 ) camera_ry = (float)M_PI/18*7;
1162+ if( camera_ry < (float)M_PI/18*7 *-1 ) camera_ry = (float)M_PI/18*7 *-1;
11951163 }
11961164
1197- //リロード操作かチェック
1198- if( CheckInputControl(KEY_RELOAD, 1) ){
1199- ObjMgr.ReloadWeapon(PlayerID);
1200- }
1201-
1202- //武器の切り替え操作かチェック
1203- if( CheckInputControl(KEY_SWITCHWEAPON, 1) ){
1204- ObjMgr.ChangeWeapon(PlayerID, -1);
1205- }
1206- if( CheckInputControl(KEY_WEAPON1, 1) ){
1207- ObjMgr.ChangeWeapon(PlayerID, 0);
1208- }
1209- if( CheckInputControl(KEY_WEAPON2, 1) ){
1210- ObjMgr.ChangeWeapon(PlayerID, 1);
1211- }
1212-
1213- //武器の廃棄操作かチェック
1214- if( CheckInputControl(KEY_DROPWEAPON, 1) ){
1215- ObjMgr.DumpWeapon(PlayerID);
1216- }
1217-
1218- //スコープ操作かチェック
1219- if( CheckInputControl(KEY_ZOOM, 1) ){
1220- ObjMgr.ChangeScopeMode(PlayerID);
1221- }
1222-
1223- //連射モード変更操作かチェック
1224- if( CheckInputControl(KEY_ShotMODE, 1) ){
1225- ObjMgr.ChangeShotMode(PlayerID);
1226- }
1227-
12281165 //ゲーム終了操作かチェック
12291166 if( inputCtrl->CheckKeyDown(GetEscKeycode()) ){
12301167 GameState->PushBackSpaceKey();
@@ -1244,22 +1181,6 @@
12441181 }
12451182 }
12461183
1247- //カメラ操作
1248- if( Camera_F1mode == true ){
1249- if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x0C) ) ){ //NUM8
1250- view_ry -= (float)M_PI/180 * 2;
1251- }
1252- if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x09) ) ){ //NUM5
1253- view_ry += (float)M_PI/180 * 2;
1254- }
1255- if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x08) ) ){ //NUM4
1256- view_rx -= (float)M_PI/180 * 2;
1257- }
1258- if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x0A) ) ){ //NUM6
1259- view_rx += (float)M_PI/180 * 2;
1260- }
1261- }
1262-
12631184 //画面のUI変更操作かチェック
12641185 if( inputCtrl->CheckKeyDown( GetFunctionKeycode(2) ) ){
12651186 if( Camera_F2mode == 2 ){
@@ -1275,216 +1196,311 @@
12751196 GameState->PushF12Key();
12761197 }
12771198
1278- //裏技・上昇の操作かチェック
1279- if( (inputCtrl->CheckKeyNow( GetFunctionKeycode(5) ))&&(inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x0F))) ){ // F5 + [ENTER]
1280- Cmd_F5 = true;
1281- }
1282- else{
1283- Cmd_F5 = false;
1284- }
1199+#ifdef ENABLE_DEBUGCONSOLE
1200+ //デバック用コンソールの表示操作かチェック
1201+ if( inputCtrl->CheckKeyDown( GetFunctionKeycode(11) ) ){
1202+ if( Show_Console == false ){
1203+ Show_Console = true;
12851204
1286- //裏技・弾追加の操作かチェック
1287- if( inputCtrl->CheckKeyNow( GetFunctionKeycode(6) ) ){
1288- if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x0F)) ){ // [ENTER]
1289- ObjMgr.CheatAddBullet(PlayerID);
1205+ strcpy(InputConsoleData->textdata, CONSOLE_PROMPT);
12901206 }
1207+ else{
1208+ Show_Console = false;
1209+ }
12911210 }
12921211
1293- //裏技・武器変更の操作かチェック
1294- if( inputCtrl->CheckKeyNow( GetFunctionKeycode(7) ) ){
1295- if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x02)) ){ // [←]
1296- int id_param = myHuman->GetMainWeaponTypeNO();
1212+ if( Show_Console == false ){
1213+#endif
12971214
1298- //次の武器番号を計算
1299- if( id_param >= TOTAL_PARAMETERINFO_WEAPON-1 ){ id_param = 0; }
1300- else{ id_param += 1; }
1215+ if( PlayerAI == false ){
13011216
1302- ObjMgr.CheatNewWeapon(PlayerID, id_param);
1303- }
1304- if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x03)) ){ // [→]
1305- int id_param = myHuman->GetMainWeaponTypeNO();
1217+ //前後左右の移動(走り)操作かチェック
1218+ if( CheckInputControl(KEY_MOVEFORWARD, 0) ){
1219+ ObjMgr.MoveForward(PlayerID);
1220+ }
1221+ if( CheckInputControl(KEY_MOVEBACKWARD, 0) ){
1222+ ObjMgr.MoveBack(PlayerID);
1223+ }
1224+ if( CheckInputControl(KEY_MOVELEFT, 0) ){
1225+ ObjMgr.MoveLeft(PlayerID);
1226+ }
1227+ if( CheckInputControl(KEY_MOVERIGHT, 0) ){
1228+ ObjMgr.MoveRight(PlayerID);
1229+ }
13061230
1307- //次の武器番号を計算
1308- if( id_param <= 0 ){ id_param = TOTAL_PARAMETERINFO_WEAPON-1; }
1309- else{ id_param -= 1; }
1231+ //歩き操作かチェック
1232+ if( CheckInputControl(KEY_WALK, 0) ){
1233+ ObjMgr.MoveWalk(PlayerID);
1234+ }
13101235
1311- ObjMgr.CheatNewWeapon(PlayerID, id_param);
1312- }
1313- }
1236+ //ジャンプ操作かチェック
1237+ if( CheckInputControl(KEY_JUMP, 1) ){
1238+ ObjMgr.MoveJump(PlayerID);
1239+ }
13141240
1315- //裏技・人変更の操作かチェック
1316- if( inputCtrl->CheckKeyNow( GetFunctionKeycode(8) ) ){
1317- int Player_HumanID;
1241+ if( Camera_Debugmode == true ){ //デバックモードならば
1242+ //発砲操作かチェック
1243+ if( CheckInputControl(KEY_Shot, 0) ){
1244+ //前回の発射より、4フレーム分よりも時間が経っていれば
1245+ if( bullettime + 4*((int)GAMEFPS) < GetTimeMS() ){
1246+ float x, y, z, rx, ry;
1247+ x = camera_x;
1248+ y = camera_y;
1249+ z = camera_z;
1250+ rx = camera_rx;
1251+ ry = camera_ry;
13181252
1319- if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x02)) ){ // [←]
1320- //現在のプレイヤー番号を取得
1321- Player_HumanID = ObjMgr.GetPlayerID();
1253+ //未使用の弾オブジェクトを取得
1254+ bullet* newbullet = ObjMgr.GetNewBulletObject();
1255+ if( newbullet != NULL ){
1256+ //弾オブジェクトを設定
1257+ newbullet->SetPosData(x, y, z, rx, ry);
1258+ newbullet->SetParamData(40, 5, 10, 1024, ObjMgr.GetPlayerID(), true);
1259+ newbullet->SetDrawFlag(true);
1260+ GameSound->ShotWeapon(x, y, z, 0, 1024, true);
13221261
1323- //次の人を計算
1324- Player_HumanID += 1;
1325- if( Player_HumanID >= MAX_HUMAN ){ Player_HumanID = 0; }
1262+ //スコアに加算
1263+ MainGameInfo.fire += 1;
13261264
1327- //対象プレイヤー番号を適用
1328- ObjMgr.SetPlayerID(Player_HumanID);
1265+ //発射時間を記憶(連射間隔判定用)
1266+ bullettime = GetTimeMS();
1267+ }
1268+ }
1269+ }
1270+ }
1271+ else{ //デバックモードでなければ
1272+ HumanParameter humandata;
1273+ int id_param;
1274+ bool zombie;
1275+ int keymode;
13291276
1330- //プレイヤーの向きを取得
1331- ObjMgr.GetPlayerHumanObject()->GetRxRy(&mouse_rx, &mouse_ry);
1332- }
1333- if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x03)) ){ // [→]
1334- //現在のプレイヤー番号を取得
1335- Player_HumanID = ObjMgr.GetPlayerID();
1277+ //ゾンビかどうか判定
1278+ myHuman->GetParamData(&id_param, NULL, NULL, NULL);
1279+ GameParamInfo.GetHuman(id_param, &humandata);
1280+ if( humandata.type == 2 ){
1281+ zombie = true;
1282+ }
1283+ else{
1284+ zombie = false;
1285+ }
13361286
1337- //次の人を計算
1338- Player_HumanID -= 1;
1339- if( Player_HumanID < 0 ){ Player_HumanID = MAX_HUMAN-1; }
1287+ //連射モードを取得
1288+ if( zombie == true ){
1289+ keymode = 1;
1290+ }
1291+ else if( myHuman->GetWeaponBlazingmode() == false ){
1292+ keymode = 1;
1293+ }
1294+ else{
1295+ keymode = 0;
1296+ }
13401297
1341- //対象プレイヤー番号を適用
1342- ObjMgr.SetPlayerID(Player_HumanID);
1298+ //発砲操作かチェック
1299+ if( CheckInputControl(KEY_Shot, keymode) ){
13431300
1344- //プレイヤーの向きを取得
1345- ObjMgr.GetPlayerHumanObject()->GetRxRy(&mouse_rx, &mouse_ry);
1346- }
1347- }
1301+ if( zombie == false ){
1302+ //弾の発射に成功すれば
1303+ if( ObjMgr.ShotWeapon(PlayerID) == 1 ){
1304+ //スコアに加算
1305+ MainGameInfo.fire += 1;
13481306
1349- //裏技・人追加の操作かチェック
1350- if( inputCtrl->CheckKeyNow( GetFunctionKeycode(9) ) ){
1351- if( (inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x00)))||(inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x01))) ){ // [↑]・[↓]
1352- float x, y, z, r;
1353- int param, dataid, team;
1354- int selectweapon;
1355- weapon *weapon[TOTAL_HAVEWEAPON];
1356- int weapon_paramid[TOTAL_HAVEWEAPON];
1357- for(int i=0; i<TOTAL_HAVEWEAPON; i++){
1358- weapon[i] = NULL;
1359- weapon_paramid[i] = 0;
1307+ //プレイヤーの向きを取得
1308+ ObjMgr.GetPlayerHumanObject()->GetRxRy(&mouse_rx, &mouse_ry);
1309+ }
1310+ }
1311+ else{
1312+ for(int i=0; i<MAX_HUMAN; i++){
1313+ human *EnemyHuman = ObjMgr.GeHumanObject(i);
1314+ if( ObjMgr.CheckZombieAttack(myHuman, EnemyHuman) == true ){
1315+ ObjMgr.HitZombieAttack(EnemyHuman);
1316+ }
1317+ }
1318+ }
1319+
1320+ }
13601321 }
1361- int id;
13621322
1363- //プレイヤーの座標や武器を取得
1364- myHuman->GetPosData(&x, &y, &z, &r);
1365- myHuman->GetParamData(&param, &dataid, NULL, &team);
1366- myHuman->GetWeapon(&selectweapon, weapon);
1367- for(int i=0; i<TOTAL_HAVEWEAPON; i++){
1368- if( weapon[i] != NULL ){
1369- weapon[i]->GetParamData(&weapon_paramid[i], NULL, NULL);
1323+ //リロード操作かチェック
1324+ if( CheckInputControl(KEY_RELOAD, 1) ){
1325+ ObjMgr.ReloadWeapon(PlayerID);
1326+ }
1327+
1328+ //武器の切り替え操作かチェック
1329+ if( CheckInputControl(KEY_SWITCHWEAPON, 1) ){
1330+ ObjMgr.ChangeWeapon(PlayerID, -1);
1331+ }
1332+ if( CheckInputControl(KEY_WEAPON1, 1) ){
1333+ ObjMgr.ChangeWeapon(PlayerID, 0);
1334+ }
1335+ if( CheckInputControl(KEY_WEAPON2, 1) ){
1336+ ObjMgr.ChangeWeapon(PlayerID, 1);
1337+ }
1338+
1339+ //武器の廃棄操作かチェック
1340+ if( CheckInputControl(KEY_DROPWEAPON, 1) ){
1341+ ObjMgr.DumpWeapon(PlayerID);
1342+ }
1343+
1344+ //スコープ操作かチェック
1345+ if( CheckInputControl(KEY_ZOOM, 1) ){
1346+ ObjMgr.ChangeScopeMode(PlayerID);
1347+ }
1348+
1349+ //連射モード変更操作かチェック
1350+ if( CheckInputControl(KEY_ShotMODE, 1) ){
1351+ ObjMgr.ChangeShotMode(PlayerID);
1352+ }
1353+
1354+ //カメラ操作
1355+ if( Camera_F1mode == true ){
1356+ if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x0C) ) ){ //NUM8
1357+ view_ry -= (float)M_PI/180 * 2;
13701358 }
1359+ if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x09) ) ){ //NUM5
1360+ view_ry += (float)M_PI/180 * 2;
1361+ }
1362+ if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x08) ) ){ //NUM4
1363+ view_rx -= (float)M_PI/180 * 2;
1364+ }
1365+ if( inputCtrl->CheckKeyNow( OriginalkeycodeToDinputdef(0x0A) ) ){ //NUM6
1366+ view_rx += (float)M_PI/180 * 2;
1367+ }
13711368 }
13721369
1373- //プレイヤーの目の前の座標を取得
1374- x += cos(r*-1 + (float)M_PI/2)*10.0f;
1375- y += 5.0f;
1376- z += sin(r*-1 + (float)M_PI/2)*10.0f;
1370+ //裏技・上昇の操作かチェック
1371+ if( (inputCtrl->CheckKeyNow( GetFunctionKeycode(5) ))&&(inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x0F))) ){ // F5 + [ENTER]
1372+ Cmd_F5 = true;
1373+ }
1374+ else{
1375+ Cmd_F5 = false;
1376+ }
13771377
1378- //人を追加
1379- id = ObjMgr.AddHumanIndex(x, y, z, r, param, team, weapon_paramid);
1380- if( id >= 0 ){
1381- ObjMgr.ChangeWeapon(id, selectweapon);
1378+ //裏技・弾追加の操作かチェック
1379+ if( inputCtrl->CheckKeyNow( GetFunctionKeycode(6) ) ){
1380+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x0F)) ){ // [ENTER]
1381+ ObjMgr.CheatAddBullet(PlayerID);
1382+ }
1383+ }
13821384
1383- //AIを設定
1384- HumanAI[id].Init();
1385- if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x00)) ){ // [↑]
1386- HumanAI[id].SetHoldTracking(dataid);
1385+ //裏技・武器変更の操作かチェック
1386+ if( inputCtrl->CheckKeyNow( GetFunctionKeycode(7) ) ){
1387+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x02)) ){ // [←]
1388+ int id_param = myHuman->GetMainWeaponTypeNO();
1389+
1390+ //次の武器番号を計算
1391+ if( id_param >= TOTAL_PARAMETERINFO_WEAPON-1 ){ id_param = 0; }
1392+ else{ id_param += 1; }
1393+
1394+ ObjMgr.CheatNewWeapon(PlayerID, id_param);
13871395 }
1388- if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x01)) ){ // [↓]
1389- HumanAI[id].SetHoldWait(x, z, r);
1396+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x03)) ){ // [→]
1397+ int id_param = myHuman->GetMainWeaponTypeNO();
1398+
1399+ //次の武器番号を計算
1400+ if( id_param <= 0 ){ id_param = TOTAL_PARAMETERINFO_WEAPON-1; }
1401+ else{ id_param -= 1; }
1402+
1403+ ObjMgr.CheatNewWeapon(PlayerID, id_param);
13901404 }
13911405 }
1392- }
1393- }
13941406
1395- //裏技・腕表示の操作かチェック
1396- if( inputCtrl->CheckKeyDown( GetHomeKeycode() ) ){
1397- if( Camera_HOMEmode == false ){
1398- Camera_HOMEmode = true;
1399- }
1400- else{
1401- Camera_HOMEmode = false;
1402- }
1403- }
1407+ //裏技・人変更の操作かチェック
1408+ if( inputCtrl->CheckKeyNow( GetFunctionKeycode(8) ) ){
1409+ int Player_HumanID;
14041410
1405- //デバックモード使用操作かチェック
1406-#ifdef _DEBUG
1407- if( inputCtrl->CheckKeyDown( GetFunctionKeycode(4) ) ){
1408-#else
1409- if( 0 ){
1410-#endif
1411- if( Camera_Debugmode == false ){
1412- Camera_Debugmode = true;
1413- }
1414- else{
1415- Camera_Debugmode = false;
1416- }
1411+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x02)) ){ // [←]
1412+ //現在のプレイヤー番号を取得
1413+ Player_HumanID = ObjMgr.GetPlayerID();
14171414
1418- //デバックモード開始時のカメラ設定
1419- if( Camera_Debugmode == true ){
1420- camera_x = 100.0f;
1421- camera_y = 100.0f;
1422- camera_z = -100.0f;
1423- camera_rx = (float)M_PI/180*135;
1424- camera_ry = (float)M_PI/180*(-40);
1425- }
1426- }
1415+ //次の人を計算
1416+ Player_HumanID += 1;
1417+ if( Player_HumanID >= MAX_HUMAN ){ Player_HumanID = 0; }
14271418
1428- //ゲーム実行情報の表示操作かチェック
1429- if( inputCtrl->CheckKeyDown( GetFunctionKeycode(11) ) ){
1430- if( ShowInfo_Debugmode == false ){
1431- ShowInfo_Debugmode = true;
1432- }
1433- else{
1434- ShowInfo_Debugmode = false;
1435- }
1436- }
1419+ //対象プレイヤー番号を適用
1420+ ObjMgr.SetPlayerID(Player_HumanID);
14371421
1438- //マウスの移動量取得
1439- int x, y;
1440- float MouseSensitivity;
1441- inputCtrl->GetMouseMovement(&x, &y);
1422+ //プレイヤーの向きを取得
1423+ ObjMgr.GetPlayerHumanObject()->GetRxRy(&mouse_rx, &mouse_ry);
1424+ }
1425+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x03)) ){ // [→]
1426+ //現在のプレイヤー番号を取得
1427+ Player_HumanID = ObjMgr.GetPlayerID();
14421428
1443- //視点の移動量計算
1444- float mang;
1445- if( myHuman->GetScopeMode() == 0 ){ mang = 0.01f; }
1446- if( myHuman->GetScopeMode() == 1 ){ mang = 0.0032f; }
1447- if( myHuman->GetScopeMode() == 2 ){ mang = 0.0060f; }
1448- MouseSensitivity = (float)M_PI/180 * mang * GameConfig.GetMouseSensitivity();
1429+ //次の人を計算
1430+ Player_HumanID -= 1;
1431+ if( Player_HumanID < 0 ){ Player_HumanID = MAX_HUMAN-1; }
14491432
1450- //マウス反転(オプション設定)が有効ならば、反転する。
1451- if( GameConfig.GetInvertMouseFlag() == true ){
1452- y *= -1;
1453- }
1433+ //対象プレイヤー番号を適用
1434+ ObjMgr.SetPlayerID(Player_HumanID);
14541435
1455- if( Camera_Debugmode == false ){ //通常モードならば
1456- if( myHuman->GetHP() > 0 ){
1457- //マウスによる向きを計算
1458- mouse_rx += x * MouseSensitivity;
1459- mouse_ry -= y * MouseSensitivity;
1436+ //プレイヤーの向きを取得
1437+ ObjMgr.GetPlayerHumanObject()->GetRxRy(&mouse_rx, &mouse_ry);
1438+ }
1439+ }
14601440
1461- //キー操作による向きを計算
1462- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x00)) ){ mouse_ry += (float)M_PI/180 * 3; } // [↑]
1463- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x01)) ){ mouse_ry -= (float)M_PI/180 * 3; } // [↓]
1464- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x02)) ){ mouse_rx -= (float)M_PI/180 * 3; } // [←]
1465- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x03)) ){ mouse_rx += (float)M_PI/180 * 3; } // [→]
1441+ //裏技・人追加の操作かチェック
1442+ if( inputCtrl->CheckKeyNow( GetFunctionKeycode(9) ) ){
1443+ if( (inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x00)))||(inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x01))) ){ // [↑]・[↓]
1444+ float x, y, z, r;
1445+ int param, dataid, team;
1446+ int selectweapon;
1447+ weapon *weapon[TOTAL_HAVEWEAPON];
1448+ int weapon_paramid[TOTAL_HAVEWEAPON];
1449+ for(int i=0; i<TOTAL_HAVEWEAPON; i++){
1450+ weapon[i] = NULL;
1451+ weapon_paramid[i] = 0;
1452+ }
1453+ int id;
14661454
1467- if( mouse_ry > (float)M_PI/18*7 ) mouse_ry = (float)M_PI/18*7;
1468- if( mouse_ry < (float)M_PI/18*7 *-1 ) mouse_ry = (float)M_PI/18*7 *-1;
1455+ //プレイヤーの座標や武器を取得
1456+ myHuman->GetPosData(&x, &y, &z, &r);
1457+ myHuman->GetParamData(&param, &dataid, NULL, &team);
1458+ myHuman->GetWeapon(&selectweapon, weapon);
1459+ for(int i=0; i<TOTAL_HAVEWEAPON; i++){
1460+ if( weapon[i] != NULL ){
1461+ weapon[i]->GetParamData(&weapon_paramid[i], NULL, NULL);
1462+ }
1463+ }
1464+
1465+ //プレイヤーの目の前の座標を取得
1466+ x += cos(r*-1 + (float)M_PI/2)*10.0f;
1467+ y += 5.0f;
1468+ z += sin(r*-1 + (float)M_PI/2)*10.0f;
1469+
1470+ //人を追加
1471+ id = ObjMgr.AddHumanIndex(x, y, z, r, param, team, weapon_paramid);
1472+ if( id >= 0 ){
1473+ ObjMgr.ChangeWeapon(id, selectweapon);
1474+
1475+ //AIを設定
1476+ HumanAI[id].Init();
1477+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x00)) ){ // [↑]
1478+ HumanAI[id].SetHoldTracking(dataid);
1479+ }
1480+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x01)) ){ // [↓]
1481+ HumanAI[id].SetHoldWait(x, z, r);
1482+ }
1483+ }
1484+ }
1485+ }
1486+
1487+ //裏技・腕表示の操作かチェック
1488+ if( inputCtrl->CheckKeyDown( GetHomeKeycode() ) ){
1489+ if( Camera_HOMEmode == false ){
1490+ Camera_HOMEmode = true;
1491+ }
1492+ else{
1493+ Camera_HOMEmode = false;
1494+ }
1495+ }
14691496 }
1470- }
1471- else{ //デバックモードならば
1472- //キー操作によりカメラ座標を計算
1473- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x00)) ){ camera_x += 2.0f; } // [↑]
1474- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x01)) ){ camera_x -= 2.0f; } // [↓]
1475- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x02)) ){ camera_z += 2.0f; } // [←]
1476- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x03)) ){ camera_z -= 2.0f; } // [→]
1477- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x48)) ){ camera_y += 2.0f; } //[NUM +]
1478- if( inputCtrl->CheckKeyNow(OriginalkeycodeToDinputdef(0x49)) ){ camera_y -= 2.0f; } //[NUM -]
14791497
1480- //マウス移動をカメラの向きとして適用
1481- //camera_rx -= x*0.0025f;
1482- //camera_ry -= y*0.0025f;
1483- camera_rx -= x * MouseSensitivity;
1484- camera_ry -= y * MouseSensitivity;
1485- if( camera_ry > (float)M_PI/18*7 ) camera_ry = (float)M_PI/18*7;
1486- if( camera_ry < (float)M_PI/18*7 *-1 ) camera_ry = (float)M_PI/18*7 *-1;
1498+#ifdef ENABLE_DEBUGCONSOLE
14871499 }
1500+ if( Show_Console == true ){
1501+ InputConsole();
1502+ }
1503+#endif
14881504
14891505 time_input = GetTimeMS() - time;
14901506 }
@@ -1507,7 +1523,7 @@
15071523 GameParamInfo.GetWeapon(weaponid, &data);
15081524
15091525 //プレイヤー(オブジェクト)の向きを設定
1510- if( myHuman->GetHP() > 0 ){
1526+ if( (PlayerAI == false)&&(myHuman->GetHP() > 0) ){
15111527 myHuman->SetRxRy(mouse_rx, mouse_ry);
15121528 }
15131529
@@ -1530,9 +1546,10 @@
15301546 //-----------------------------------
15311547
15321548 time = GetTimeMS();
1533- int PlayerID = ObjMgr.GetPlayerID();
1534- for(int i=0; i<MAX_HUMAN; i++){
1535- if( i != PlayerID ){
1549+ if( AIstop == false ){
1550+ int PlayerID = ObjMgr.GetPlayerID();
1551+ for(int i=0; i<MAX_HUMAN; i++){
1552+ if( (PlayerAI == false)&&(i == PlayerID) ){ continue; }
15361553 //AIを実行
15371554 HumanAI[i].Process();
15381555 }
@@ -1588,6 +1605,11 @@
15881605 float x, y, z;
15891606 myHuman->GetPosData(&x, &y, &z, NULL);
15901607
1608+ if( PlayerAI == true ){
1609+ //プレイヤーの向きを取得
1610+ ObjMgr.GetPlayerHumanObject()->GetRxRy(&mouse_rx, &mouse_ry);
1611+ }
1612+
15911613 //カメラワークを求める
15921614 if( Camera_Debugmode == true ){
15931615 //
@@ -1630,6 +1652,18 @@
16301652 //ダメージを受けていれば、レッドフラッシュを描画する
16311653 redflash_flag = myHuman->CheckHit();
16321654
1655+ //-----------------------------------
1656+
1657+#ifdef ENABLE_DEBUGCONSOLE
1658+ //デバック用コンソールを表示しており、かつミッション終了のカウントが始まっていなければ〜
1659+ if( (Show_Console == true)&&(end_framecnt == 0) ){
1660+ //デバック用コンソールのメイン処理
1661+ ProcessConsole();
1662+ }
1663+#endif
1664+
1665+ //-----------------------------------
1666+
16331667 framecnt += 1;
16341668 if( start_framecnt < (int)(1.0f*GAMEFPS) ){ //ミッション開始中なら
16351669 start_framecnt += 1;
@@ -1692,12 +1726,14 @@
16921726 //Zバッファを初期化
16931727 d3dg->ResetZbuffer();
16941728
1695- //中心線描画(デバック用)
1696- //d3dg->Centerline();
1729+ if( CenterLine == true ){
1730+ //中心線描画(デバック用)
1731+ d3dg->Centerline();
1732+ }
16971733
16981734 //マップを描画
16991735 d3dg->ResetWorldTransform();
1700- d3dg->DrawMapdata();
1736+ d3dg->DrawMapdata(wireframe);
17011737
17021738 //プレイヤーの描画有無の決定
17031739 int DrawPlayer = 0;
@@ -1766,30 +1802,30 @@
17661802
17671803 //レッドフラッシュ描画
17681804 if( redflash_flag == true ){
1769- d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
1805+ d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
17701806 redflash_flag = false;
17711807 }
17721808
17731809 //スコープ表示
17741810 if( (Camera_F1mode == false)&&(myHuman->GetScopeMode() == 1) ){
1775- d3dg->Draw2DTexture(0, 0, Resource.GetScopeTexture(), SCREEN_WIDTH, SCREEN_HEIGTH, 1.0f);
1776- d3dg->Draw2DLine(SCREEN_WIDTH/2-49, SCREEN_HEIGTH/2, SCREEN_WIDTH/2-4, SCREEN_HEIGTH/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1777- d3dg->Draw2DLine(SCREEN_WIDTH/2+4, SCREEN_HEIGTH/2, SCREEN_WIDTH/2+49, SCREEN_HEIGTH/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1778- d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGTH/2-49, SCREEN_WIDTH/2, SCREEN_HEIGTH/2-4, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1779- d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGTH/2+4, SCREEN_WIDTH/2, SCREEN_HEIGTH/2+49, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1780- d3dg->Draw2DBox(SCREEN_WIDTH/2-50, SCREEN_HEIGTH/2-1, SCREEN_WIDTH/20+50, SCREEN_HEIGTH/2+1, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
1781- d3dg->Draw2DBox(SCREEN_WIDTH/2-1, SCREEN_HEIGTH/2-50, SCREEN_WIDTH/2+1, SCREEN_HEIGTH/2+50, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
1811+ d3dg->Draw2DTexture(0, 0, Resource.GetScopeTexture(), SCREEN_WIDTH, SCREEN_HEIGHT, 1.0f);
1812+ d3dg->Draw2DLine(SCREEN_WIDTH/2-49, SCREEN_HEIGHT/2, SCREEN_WIDTH/2-4, SCREEN_HEIGHT/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1813+ d3dg->Draw2DLine(SCREEN_WIDTH/2+4, SCREEN_HEIGHT/2, SCREEN_WIDTH/2+49, SCREEN_HEIGHT/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1814+ d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGHT/2-49, SCREEN_WIDTH/2, SCREEN_HEIGHT/2-4, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1815+ d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGHT/2+4, SCREEN_WIDTH/2, SCREEN_HEIGHT/2+49, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1816+ d3dg->Draw2DBox(SCREEN_WIDTH/2-50, SCREEN_HEIGHT/2-1, SCREEN_WIDTH/20+50, SCREEN_HEIGHT/2+1, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
1817+ d3dg->Draw2DBox(SCREEN_WIDTH/2-1, SCREEN_HEIGHT/2-50, SCREEN_WIDTH/2+1, SCREEN_HEIGHT/2+50, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
17821818 }
17831819 if( (Camera_F1mode == false)&&(myHuman->GetScopeMode() == 2) ){
1784- d3dg->Draw2DTexture(0, 0, Resource.GetScopeTexture(), SCREEN_WIDTH, SCREEN_HEIGTH, 1.0f);
1785- d3dg->Draw2DLine(0, SCREEN_HEIGTH/2, SCREEN_WIDTH, SCREEN_HEIGTH/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1786- d3dg->Draw2DLine(SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1787- d3dg->Draw2DBox(0, SCREEN_HEIGTH/2-1, SCREEN_WIDTH, SCREEN_HEIGTH/2+1, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
1788- d3dg->Draw2DBox(SCREEN_WIDTH/2-1, 0, SCREEN_WIDTH/2+1, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
1820+ d3dg->Draw2DTexture(0, 0, Resource.GetScopeTexture(), SCREEN_WIDTH, SCREEN_HEIGHT, 1.0f);
1821+ d3dg->Draw2DLine(0, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1822+ d3dg->Draw2DLine(SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1823+ d3dg->Draw2DBox(0, SCREEN_HEIGHT/2-1, SCREEN_WIDTH, SCREEN_HEIGHT/2+1, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
1824+ d3dg->Draw2DBox(SCREEN_WIDTH/2-1, 0, SCREEN_WIDTH/2+1, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.5f));
17891825 }
17901826
17911827 //目隠し表示
1792- if( hp > 0 ){
1828+ if( (Camera_Debugmode == false)&&(hp > 0) ){
17931829
17941830 int scopemode = myHuman->GetScopeMode();
17951831 float addang;
@@ -1802,22 +1838,22 @@
18021838
18031839 //上
18041840 if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx)*cos(camera_ry + addang) * adddist, camera_y + sin(camera_ry + addang) * adddist, camera_z + sin(camera_rx)*cos(camera_ry + addang) * adddist) == true ){
1805- d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1841+ d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT/2, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
18061842 }
18071843
18081844 //下
18091845 if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx)*cos(camera_ry - addang) * adddist, camera_y + sin(camera_ry - addang) * adddist, camera_z + sin(camera_rx)*cos(camera_ry - addang) * adddist) == true ){
1810- d3dg->Draw2DBox(0, SCREEN_HEIGTH/2, SCREEN_WIDTH, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1846+ d3dg->Draw2DBox(0, SCREEN_HEIGHT/2, SCREEN_WIDTH, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
18111847 }
18121848
18131849 //左
18141850 if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx + addang)*cos(camera_ry) * adddist, camera_y + sin(camera_ry) * adddist, camera_z + sin(camera_rx + addang)*cos(camera_ry) * adddist) == true ){
1815- d3dg->Draw2DBox(0, 0, SCREEN_WIDTH/2, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1851+ d3dg->Draw2DBox(0, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
18161852 }
18171853
18181854 //右
18191855 if( CollD.CheckALLBlockInside(camera_x + cos(camera_rx - addang)*cos(camera_ry) * adddist, camera_y + sin(camera_ry) * adddist, camera_z + sin(camera_rx - addang)*cos(camera_ry) * adddist) == true ){
1820- d3dg->Draw2DBox(SCREEN_WIDTH/2, 0, SCREEN_WIDTH, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
1856+ d3dg->Draw2DBox(SCREEN_WIDTH/2, 0, SCREEN_WIDTH, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f));
18211857 }
18221858 }
18231859
@@ -1852,10 +1888,6 @@
18521888 d3dg->Draw2DTextureFontText(10+1, 90+1, str, D3DCOLOR_COLORVALUE(0.1f,0.1f,0.1f,1.0f), 10, 14);
18531889 d3dg->Draw2DTextureFontText(10, 90, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 10, 14);
18541890 }
1855- else{
1856- d3dg->Draw2DTextureFontText(10+1, 10+1, "Debug information [F11]", D3DCOLOR_COLORVALUE(0.1f,0.1f,0.1f,1.0f), 12, 18);
1857- d3dg->Draw2DTextureFontText(10, 10, "Debug information [F11]", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 12, 18);
1858- }
18591891
18601892 //ゲーム実行速度の表示
18611893 if( 1 ){
@@ -1874,17 +1906,17 @@
18741906 //"ウエエエエエエオ"
18751907 str[0] = (signed char)0xB3; str[1] = (signed char)0xB4; str[2] = (signed char)0xB4; str[3] = (signed char)0xB4; str[4] = (signed char)0xB4;
18761908 str[5] = (signed char)0xB4; str[6] = (signed char)0xB4; str[7] = (signed char)0xB5; str[8] = (signed char)0x00;
1877- d3dg->Draw2DTextureFontText(15, SCREEN_HEIGTH - 105, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
1909+ d3dg->Draw2DTextureFontText(15, SCREEN_HEIGHT - 105, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
18781910 //"テトトトトトトナ"
18791911 for(int i=0; str[i] != 0x00; i++){ str[i] += (signed char)0x10; }
1880- d3dg->Draw2DTextureFontText(15, SCREEN_HEIGTH - 105 +32, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
1912+ d3dg->Draw2DTextureFontText(15, SCREEN_HEIGHT - 105 +32, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
18811913 //"ウエエカキキキクケ"
18821914 str[0] = (signed char)0xB3; str[1] = (signed char)0xB4; str[2] = (signed char)0xB4; str[3] = (signed char)0xB6; str[4] = (signed char)0xB7;
18831915 str[5] = (signed char)0xB7; str[6] = (signed char)0xB7; str[7] = (signed char)0xB8; str[8] = (signed char)0xB9; str[9] = (signed char)0x00;
1884- d3dg->Draw2DTextureFontText(15, SCREEN_HEIGTH - 55, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
1916+ d3dg->Draw2DTextureFontText(15, SCREEN_HEIGHT - 55, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
18851917 //"テトトニヌヌヌネノ"
18861918 for(int i=0; str[i] != 0x00; i++){ str[i] += (signed char)0x10; }
1887- d3dg->Draw2DTextureFontText(15, SCREEN_HEIGTH - 55 +32, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
1919+ d3dg->Draw2DTextureFontText(15, SCREEN_HEIGHT - 55 +32, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,0.5f), 32, 32);
18881920
18891921 //右下エリア用文字コード設定
18901922 str[0] = (signed char)0xB0;//'ー';
@@ -1909,7 +1941,7 @@
19091941 if( str[i] == 'A' ){ str[i] = (signed char)0xBB; } //'サ'
19101942 if( str[i] == 'B' ){ str[i] = (signed char)0xBA; } //'コ'
19111943 }
1912- d3dg->Draw2DTextureFontText(25, SCREEN_HEIGTH - 96, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 23, 24);
1944+ d3dg->Draw2DTextureFontText(25, SCREEN_HEIGHT - 96, str, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 23, 24);
19131945
19141946 //HPによる色の決定
19151947 int statecolor;
@@ -1928,20 +1960,20 @@
19281960
19291961 //HP表示
19301962 if( hp >= 80 ){
1931- d3dg->Draw2DTextureFontText(23, SCREEN_HEIGTH - 45, "STATE", statecolor, 18, 24);
1932- d3dg->Draw2DTextureFontText(155, SCREEN_HEIGTH - 45, "FINE", statecolor, 18, 24);
1963+ d3dg->Draw2DTextureFontText(23, SCREEN_HEIGHT - 45, "STATE", statecolor, 18, 24);
1964+ d3dg->Draw2DTextureFontText(155, SCREEN_HEIGHT - 45, "FINE", statecolor, 18, 24);
19331965 }
19341966 else if( hp >= 40 ){
1935- d3dg->Draw2DTextureFontText(23, SCREEN_HEIGTH - 45, "STATE", statecolor, 18, 24);
1936- d3dg->Draw2DTextureFontText(135, SCREEN_HEIGTH - 45, "CAUTION", statecolor, 18, 24);
1967+ d3dg->Draw2DTextureFontText(23, SCREEN_HEIGHT - 45, "STATE", statecolor, 18, 24);
1968+ d3dg->Draw2DTextureFontText(135, SCREEN_HEIGHT - 45, "CAUTION", statecolor, 18, 24);
19371969 }
19381970 else if( hp > 0 ){
1939- d3dg->Draw2DTextureFontText(23, SCREEN_HEIGTH - 45, "STATE", statecolor, 18, 24);
1940- d3dg->Draw2DTextureFontText(140, SCREEN_HEIGTH - 45, "DANGER", statecolor, 18, 24);
1971+ d3dg->Draw2DTextureFontText(23, SCREEN_HEIGHT - 45, "STATE", statecolor, 18, 24);
1972+ d3dg->Draw2DTextureFontText(140, SCREEN_HEIGHT - 45, "DANGER", statecolor, 18, 24);
19411973 }
19421974 else{
1943- d3dg->Draw2DTextureFontText(23, SCREEN_HEIGTH - 45, "STATE", statecolor, 18, 24);
1944- d3dg->Draw2DTextureFontText(155, SCREEN_HEIGTH - 45, "DEAD", statecolor, 18, 24);
1975+ d3dg->Draw2DTextureFontText(23, SCREEN_HEIGHT - 45, "STATE", statecolor, 18, 24);
1976+ d3dg->Draw2DTextureFontText(155, SCREEN_HEIGHT - 45, "DEAD", statecolor, 18, 24);
19451977 }
19461978
19471979 //武器名表示
@@ -1952,13 +1984,13 @@
19521984 if( Camera_F2mode == 1 ){
19531985 //画面周りの線
19541986 d3dg->Draw2DLine(0, 0, SCREEN_WIDTH-1, 0, D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f));
1955- d3dg->Draw2DLine(SCREEN_WIDTH-1, 0, SCREEN_WIDTH-1, SCREEN_HEIGTH-1, D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f));
1956- d3dg->Draw2DLine(0, 0, 0, SCREEN_HEIGTH-1, D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f));
1957- d3dg->Draw2DLine(0, SCREEN_HEIGTH-1, SCREEN_WIDTH-1, SCREEN_HEIGTH-1, D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f));
1987+ d3dg->Draw2DLine(SCREEN_WIDTH-1, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f));
1988+ d3dg->Draw2DLine(0, 0, 0, SCREEN_HEIGHT-1, D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f));
1989+ d3dg->Draw2DLine(0, SCREEN_HEIGHT-1, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f));
19581990
19591991 //武器名表示
1960- d3dg->Draw2DBox(8, SCREEN_HEIGTH - 32, 227, SCREEN_HEIGTH - 7, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.3f));
1961- d3dg->Draw2DTextureFontText(10, SCREEN_HEIGTH - 30, weaponname, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 16, 20);
1992+ d3dg->Draw2DBox(8, SCREEN_HEIGHT - 32, 227, SCREEN_HEIGHT - 7, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.3f));
1993+ d3dg->Draw2DTextureFontText(10, SCREEN_HEIGHT - 30, weaponname, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 16, 20);
19621994 }
19631995
19641996 //イベントメッセージ表示
@@ -1968,20 +2000,20 @@
19682000 float effectA = 1.0f;
19692001 if( message_cnt < (int)(0.2f*GAMEFPS) ){ effectA = GetEffectAlpha(message_cnt, 1.0f, 0.2f, 0.0f, false); }
19702002 if( (int)((TOTAL_EVENTENT_SHOWMESSEC-0.2f)*GAMEFPS) < message_cnt ){ effectA = GetEffectAlpha(message_cnt, 1.0f, 0.2f, (TOTAL_EVENTENT_SHOWMESSEC - 0.2f), true); }
1971- d3dg->Draw2DMSFontTextCenter(0 +1, SCREEN_HEIGTH - 140 +1, SCREEN_WIDTH, 140, messtr, D3DCOLOR_COLORVALUE(0.1f,0.1f,0.1f,effectA));
1972- d3dg->Draw2DMSFontTextCenter(0, SCREEN_HEIGTH - 140, SCREEN_WIDTH, 140, messtr, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,effectA));
2003+ d3dg->Draw2DMSFontTextCenter(0 +1, SCREEN_HEIGHT - 140 +1, SCREEN_WIDTH, 140, messtr, D3DCOLOR_COLORVALUE(0.1f,0.1f,0.1f,effectA));
2004+ d3dg->Draw2DMSFontTextCenter(0, SCREEN_HEIGHT - 140, SCREEN_WIDTH, 140, messtr, D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,effectA));
19732005 }
19742006
19752007 //リロード表示
19762008 if( reloadcnt > 0 ){
1977- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 145 +3, SCREEN_HEIGTH - 180+3, "RELOADING", D3DCOLOR_COLORVALUE(0.2f,0.2f,0.2f,1.0f), 32, 34);
1978- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 145, SCREEN_HEIGTH - 180, "RELOADING", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 32, 34);
2009+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 145 +3, SCREEN_HEIGHT - 180+3, "RELOADING", D3DCOLOR_COLORVALUE(0.2f,0.2f,0.2f,1.0f), 32, 34);
2010+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 145, SCREEN_HEIGHT - 180, "RELOADING", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 32, 34);
19792011 }
19802012
19812013 //武器切り替え表示
19822014 if( selectweaponcnt > 0 ){
1983- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 130 +3, SCREEN_HEIGTH - 180+3, "CHANGING", D3DCOLOR_COLORVALUE(0.2f,0.2f,0.2f,1.0f), 32, 34);
1984- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 130, SCREEN_HEIGTH - 180, "CHANGING", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 32, 34);
2015+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 130 +3, SCREEN_HEIGHT - 180+3, "CHANGING", D3DCOLOR_COLORVALUE(0.2f,0.2f,0.2f,1.0f), 32, 34);
2016+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 130, SCREEN_HEIGHT - 180, "CHANGING", D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), 32, 34);
19852017 }
19862018
19872019 //照準表示
@@ -1991,28 +2023,36 @@
19912023 float alpha = 1.0f - (float)ErrorRange/40.0f;
19922024 if( alpha < 0.0f ){ alpha = 0.0f; }
19932025
1994- d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGTH/2, SCREEN_WIDTH/2, SCREEN_HEIGTH/2+4, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
1995- d3dg->Draw2DLine(SCREEN_WIDTH/2-15, SCREEN_HEIGTH/2+15, SCREEN_WIDTH/2-19, SCREEN_HEIGTH/2+19, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
1996- d3dg->Draw2DLine(SCREEN_WIDTH/2+15, SCREEN_HEIGTH/2+15, SCREEN_WIDTH/2+19, SCREEN_HEIGTH/2+19, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
1997- d3dg->Draw2DLine(SCREEN_WIDTH/2-4, SCREEN_HEIGTH/2+4, SCREEN_WIDTH/2+4, SCREEN_HEIGTH/2+4, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2026+ d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2+4, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
2027+ d3dg->Draw2DLine(SCREEN_WIDTH/2-15, SCREEN_HEIGHT/2+15, SCREEN_WIDTH/2-19, SCREEN_HEIGHT/2+19, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
2028+ d3dg->Draw2DLine(SCREEN_WIDTH/2+15, SCREEN_HEIGHT/2+15, SCREEN_WIDTH/2+19, SCREEN_HEIGHT/2+19, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f));
2029+ d3dg->Draw2DLine(SCREEN_WIDTH/2-4, SCREEN_HEIGHT/2+4, SCREEN_WIDTH/2+4, SCREEN_HEIGHT/2+4, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
19982030
1999- d3dg->Draw2DLine(SCREEN_WIDTH/2-4 - ErrorRange, SCREEN_HEIGTH/2-4 - ErrorRange/2, SCREEN_WIDTH/2-4 - ErrorRange, SCREEN_HEIGTH/2+4 + ErrorRange/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,alpha));
2000- d3dg->Draw2DLine(SCREEN_WIDTH/2+4 + ErrorRange, SCREEN_HEIGTH/2-4 - ErrorRange/2, SCREEN_WIDTH/2+4 + ErrorRange, SCREEN_HEIGTH/2+4 + ErrorRange/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,alpha));
2031+ d3dg->Draw2DLine(SCREEN_WIDTH/2-4 - ErrorRange, SCREEN_HEIGHT/2-4 - ErrorRange/2, SCREEN_WIDTH/2-4 - ErrorRange, SCREEN_HEIGHT/2+4 + ErrorRange/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,alpha));
2032+ d3dg->Draw2DLine(SCREEN_WIDTH/2+4 + ErrorRange, SCREEN_HEIGHT/2-4 - ErrorRange/2, SCREEN_WIDTH/2+4 + ErrorRange, SCREEN_HEIGHT/2+4 + ErrorRange/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,alpha));
20012033 }
20022034 else{ //標準型
2003- d3dg->Draw2DLine(SCREEN_WIDTH/2-13, SCREEN_HEIGTH/2, SCREEN_WIDTH/2-3, SCREEN_HEIGTH/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2004- d3dg->Draw2DLine(SCREEN_WIDTH/2+13, SCREEN_HEIGTH/2, SCREEN_WIDTH/2+3, SCREEN_HEIGTH/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2005- d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGTH/2-13, SCREEN_WIDTH/2, SCREEN_HEIGTH/2-3, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2006- d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGTH/2+13, SCREEN_WIDTH/2, SCREEN_HEIGTH/2+3, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2035+ d3dg->Draw2DLine(SCREEN_WIDTH/2-13, SCREEN_HEIGHT/2, SCREEN_WIDTH/2-3, SCREEN_HEIGHT/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2036+ d3dg->Draw2DLine(SCREEN_WIDTH/2+13, SCREEN_HEIGHT/2, SCREEN_WIDTH/2+3, SCREEN_HEIGHT/2, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2037+ d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGHT/2-13, SCREEN_WIDTH/2, SCREEN_HEIGHT/2-3, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
2038+ d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGHT/2+13, SCREEN_WIDTH/2, SCREEN_HEIGHT/2+3, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f));
20072039
20082040 str[0] = (signed char)0xBD; str[1] = 0x00; //"ス"
2009- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 16 - ErrorRange, SCREEN_HEIGTH/2 - 16, str, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f), 32, 32);
2041+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 16 - ErrorRange, SCREEN_HEIGHT/2 - 16, str, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f), 32, 32);
20102042 str[0] = (signed char)0xBE; str[1] = 0x00; //"セ"
2011- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 16 + ErrorRange, SCREEN_HEIGTH/2 - 16, str, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f), 32, 32);
2043+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 16 + ErrorRange, SCREEN_HEIGHT/2 - 16, str, D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,0.5f), 32, 32);
20122044 }
20132045 }
20142046
2047+ if( tag == true ){
2048+ int color;
2049+ if( ObjMgr.GetObjectInfoTag(camera_x, camera_y, camera_z, camera_rx, camera_ry, &color, str) == true ){
2050+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - strlen(str)*14/2 + 1, SCREEN_HEIGHT/2 + 30 +1 , str, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f), 14, 18);
2051+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - strlen(str)*14/2, SCREEN_HEIGHT/2 + 30, str, color, 14, 18);
2052+ }
2053+ }
20152054
2055+
20162056 //-----------------------------------
20172057
20182058 //Zバッファを初期化
@@ -2042,7 +2082,17 @@
20422082
20432083 //-----------------------------------
20442084
2085+#ifdef ENABLE_DEBUGCONSOLE
2086+ if( Show_Console == true ){
2087+ if( ScreenShot == false ){
2088+ RenderConsole();
2089+ }
2090+ }
2091+#endif
20452092
2093+ //-----------------------------------
2094+
2095+
20462096 //スタート時と終了時のブラックアウト設定
20472097 if( start_framecnt < (int)(1.0f*GAMEFPS) ){
20482098 effect = GetEffectAlpha(start_framecnt, 1.0f, 1.0f, 0.0f, true);
@@ -2053,7 +2103,7 @@
20532103 else{
20542104 effect = 0.0f;
20552105 }
2056- d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGTH, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,effect));
2106+ d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,effect));
20572107
20582108 //終了時の文字表示
20592109 if( end_framecnt > 0 ){
@@ -2068,10 +2118,10 @@
20682118 }
20692119
20702120 if( GameInfoData.missioncomplete == true ){
2071- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 252, SCREEN_HEIGTH/2 + 10, "objective complete", D3DCOLOR_COLORVALUE(1.0f,0.5f,0.0f,effect), 28, 32);
2121+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 252, SCREEN_HEIGHT/2 + 10, "objective complete", D3DCOLOR_COLORVALUE(1.0f,0.5f,0.0f,effect), 28, 32);
20722122 }
20732123 else{
2074- d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 210, SCREEN_HEIGTH/2 + 10, "mission failure", D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,effect), 28, 32);
2124+ d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 210, SCREEN_HEIGHT/2 + 10, "mission failure", D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,effect), 28, 32);
20752125 }
20762126 }
20772127
@@ -2079,6 +2129,481 @@
20792129 time_render = GetTimeMS() - time;
20802130 }
20812131
2132+#ifdef ENABLE_DEBUGCONSOLE
2133+
2134+//! デバック用コンソールに新たな文字列を追加
2135+//! @param color 文字の色
2136+//! @param str 追加する文字列のポインタ
2137+//! @attention 新しい文字列は常に下から追加されます。
2138+//! @attention 表示可能行数(定数:MAX_CONSOLELINES)を上回る場合、最初の行(1行目)を削除し1行ずつずらした上で、一番下の行に追加します。
2139+void maingame::AddInfoConsole(int color, char *str)
2140+{
2141+ for(int i=0; i<MAX_CONSOLELINES; i++){
2142+ if( InfoConsoleData[i].textdata[0] == NULL ){
2143+ InfoConsoleData[i].color = color;
2144+ strcpy(InfoConsoleData[i].textdata, str);
2145+ return;
2146+ }
2147+ }
2148+
2149+ for(int i=1; i<MAX_CONSOLELINES; i++){
2150+ memcpy(&(InfoConsoleData[i-1]), &(InfoConsoleData[i]), sizeof(ConsoleData));
2151+ }
2152+ InfoConsoleData[MAX_CONSOLELINES-1].color = color;
2153+ strcpy(InfoConsoleData[MAX_CONSOLELINES-1].textdata, str);
2154+}
2155+
2156+//! 入力用コンソールに文字を一文字追加
2157+//! @param inchar 追加する文字
2158+void maingame::ConsoleInputText(char inchar)
2159+{
2160+ for(int i=0; i<MAX_CONSOLELEN; i++){
2161+ if( InputConsoleData->textdata[i] == NULL ){
2162+ InputConsoleData->textdata[i] = inchar;
2163+ InputConsoleData->textdata[i+1] = NULL;
2164+ return;
2165+ }
2166+ }
2167+}
2168+
2169+//! 入力用コンソールの文字を一文字削除
2170+void maingame::ConsoleDeleteText()
2171+{
2172+ int s = strlen(InputConsoleData->textdata);
2173+ if( s == strlen(CONSOLE_PROMPT) ){ return; }
2174+ InputConsoleData->textdata[ s-1 ] = NULL;
2175+}
2176+
2177+//! コマンドの判定および引数(整数値)を取得
2178+//! @param cmd 判定するコマンド文字のポインタ
2179+//! @param num 与えられた引数を受け取るポインタ
2180+//! @return 取得:true 判定外:false
2181+bool maingame::GetCommandNum(char *cmd, int *num)
2182+{
2183+ char str[MAX_CONSOLELEN];
2184+
2185+ //コマンド名を調べる
2186+ strcpy(str, NewCommand);
2187+ str[ strlen(cmd) ] = NULL;
2188+ if( strcmp(str, cmd) != 0 ){ return false; }
2189+
2190+ //「コマンド名_X」分の文字数に達しているかどうか
2191+ if( strlen(cmd)+2 > strlen(NewCommand) ){ return false; }
2192+
2193+ //与えられた数字を調べる
2194+ *num = atoi(&(NewCommand[ strlen(cmd)+1 ]));
2195+ return true;
2196+}
2197+
2198+//! デバック用コンソールの入力処理
2199+void maingame::InputConsole()
2200+{
2201+ NewCommand[0] = NULL;
2202+
2203+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x0F)) ){ // [ENTER]
2204+ //何か入力されていれば〜
2205+ if( strcmp(InputConsoleData->textdata, CONSOLE_PROMPT) != 0 ){
2206+ //コンソールに追加し、未処理コマンドとして登録
2207+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), InputConsoleData->textdata);
2208+ strcpy(NewCommand, &(InputConsoleData->textdata[strlen(CONSOLE_PROMPT)]));
2209+ }
2210+
2211+ //入力エリアを初期化
2212+ strcpy(InputConsoleData->textdata, CONSOLE_PROMPT);
2213+ }
2214+ else{
2215+ //数字
2216+ for(int key=0x16; key<=0x1F; key++){
2217+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(key)) ){
2218+ ConsoleInputText(key + 0x1A);
2219+ }
2220+ }
2221+ for(int key=0x04; key<=0x0D; key++){
2222+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(key)) ){
2223+ ConsoleInputText(key + 0x2C);
2224+ }
2225+ }
2226+
2227+ //アルファベット小文字
2228+ for(int key=0x20; key<=0x39; key++){
2229+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(key)) ){
2230+ ConsoleInputText(key + 0x41);
2231+ }
2232+ }
2233+
2234+ //スペース
2235+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x11)) ){ // [SPACE]
2236+ ConsoleInputText(' ');
2237+ }
2238+
2239+ //一文字削除
2240+ if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x0E)) ){ // [BACK]
2241+ ConsoleDeleteText();
2242+ }
2243+ }
2244+}
2245+
2246+//! デバック用コンソールのメイン処理
2247+void maingame::ProcessConsole()
2248+{
2249+ char str[MAX_CONSOLELEN];
2250+ int id;
2251+
2252+ //コマンドリスト
2253+ if( strcmp(NewCommand, "help") == 0 ){
2254+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "help human result");
2255+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "info view center map");
2256+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "tag");
2257+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "revive treat <NUM> nodamage <NUM>");
2258+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "kill <NUM> break <NUM> newobj <NUM>");
2259+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "bot nofight caution stop");
2260+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "ver ss clear");
2261+ }
2262+
2263+ //人の統計情報
2264+ if( strcmp(NewCommand, "human") == 0 ){
2265+ int alivemyfriend = 0;
2266+ int myfriend = 0;
2267+ int aliveenemy = 0;
2268+ int enemy = 0;
2269+ int myteamid;
2270+
2271+ //プレイヤーのチーム番号を取得
2272+ ObjMgr.GetPlayerHumanObject()->GetParamData(NULL, NULL, NULL, &myteamid);
2273+
2274+ for(int i=0; i<MAX_HUMAN; i++){
2275+ int teamid;
2276+ bool deadflag;
2277+ human *thuman = ObjMgr.GeHumanObject(i);
2278+ if( thuman->GetDrawFlag() == true ){
2279+ //死亡状態とチーム番号を取得
2280+ deadflag = thuman->GetDeadFlag();
2281+ thuman->GetParamData(NULL, NULL, NULL, &teamid);
2282+
2283+ //カウント
2284+ if( teamid == myteamid ){
2285+ myfriend += 1;
2286+ if( deadflag == false ){ alivemyfriend += 1; }
2287+ }
2288+ else{
2289+ enemy += 1;
2290+ if( deadflag == false ){ aliveenemy += 1; }
2291+ }
2292+ }
2293+ }
2294+
2295+ sprintf(str, "Friend:%d/%d Enemy:%d/%d Total:%d/%d",
2296+ alivemyfriend, myfriend, aliveenemy, enemy, alivemyfriend + aliveenemy, myfriend + enemy);
2297+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2298+ }
2299+
2300+ //暫定リザルト表示
2301+ if( strcmp(NewCommand, "result") == 0 ){
2302+ float rate;
2303+ if( MainGameInfo.fire == 0 ){
2304+ rate = 0.0f;
2305+ }
2306+ else{
2307+ rate = (float)MainGameInfo.ontarget / MainGameInfo.fire * 100;
2308+ }
2309+
2310+ sprintf(str, "Time %02d:%02d / Fired %d / On target %d", framecnt/(int)GAMEFPS/60, framecnt/(int)GAMEFPS%60, MainGameInfo.fire, MainGameInfo.ontarget);
2311+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2312+ sprintf(str, "AR rate %.1f%% / Kill %d / HS %d", rate, MainGameInfo.kill, MainGameInfo.headshot);
2313+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2314+ }
2315+
2316+ //デバック用文字の表示
2317+ if( strcmp(NewCommand, "info") == 0 ){
2318+ if( ShowInfo_Debugmode == false ){
2319+ ShowInfo_Debugmode = true;
2320+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Show Debug information.");
2321+ }
2322+ else{
2323+ ShowInfo_Debugmode = false;
2324+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Hide Debug information.");
2325+ }
2326+ }
2327+
2328+ //フリーカメラ切り替え
2329+ if( strcmp(NewCommand, "view") == 0 ){
2330+ if( Camera_Debugmode == false ){
2331+ Camera_Debugmode = true;
2332+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Change FreeView mode.");
2333+ }
2334+ else{
2335+ Camera_Debugmode = false;
2336+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Change PlayerView mode.");
2337+ }
2338+
2339+ //デバックモード開始時のカメラ設定
2340+ if( Camera_Debugmode == true ){
2341+ camera_x = 100.0f;
2342+ camera_y = 100.0f;
2343+ camera_z = -100.0f;
2344+ camera_rx = (float)M_PI/180*135;
2345+ camera_ry = (float)M_PI/180*(-40);
2346+ }
2347+ }
2348+
2349+ //3Dの中心線表示
2350+ if( strcmp(NewCommand, "center") == 0 ){
2351+ if( CenterLine == false ){
2352+ CenterLine = true;
2353+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Show World center position.");
2354+ }
2355+ else{
2356+ CenterLine = false;
2357+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Hide World center position.");
2358+ }
2359+ }
2360+
2361+ //マップをワイヤーフレーム化
2362+ if( strcmp(NewCommand, "map") == 0 ){
2363+ if( wireframe == false ){
2364+ wireframe = true;
2365+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Draw map on the Wire frame.");
2366+ }
2367+ else{
2368+ wireframe = false;
2369+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Draw map on the Normal.");
2370+ }
2371+ }
2372+
2373+ //オブジェクトのタグを表示
2374+ if( strcmp(NewCommand, "tag") == 0 ){
2375+ if( tag == false ){
2376+ tag = true;
2377+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Show object information.");
2378+ }
2379+ else{
2380+ tag = false;
2381+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Hide object information.");
2382+ }
2383+ }
2384+
2385+ //全ての死者を蘇生する
2386+ if( strcmp(NewCommand, "revive") == 0 ){
2387+ for(int i=0; i<MAX_HUMAN; i++){
2388+ ObjMgr.HumanResuscitation(i);
2389+ }
2390+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "All human has resuscitation.");
2391+ }
2392+
2393+ //回復する
2394+ if( GetCommandNum("treat", &id) == true ){
2395+ if( (0 <= id)&&(id < MAX_HUMAN) ){
2396+ int param, hp;
2397+ HumanParameter data;
2398+ human *thuman = ObjMgr.GeHumanObject(id);
2399+
2400+ //初期時のHPを取得
2401+ thuman->GetParamData(&param, NULL, NULL, NULL);
2402+ GameParamInfo.GetHuman(param, &data);
2403+ hp = data.hp;
2404+
2405+ //回復
2406+ if( thuman->SetHP(hp) == true ){
2407+ sprintf(str, "Set the HP:%d to Human[%d].", data.hp, id);
2408+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2409+ }
2410+ }
2411+ }
2412+
2413+ //無敵化
2414+ if( GetCommandNum("nodamage", &id) == true ){
2415+ if( (0 <= id)&&(id < MAX_HUMAN) ){
2416+ if( InvincibleID == id ){
2417+ //同じ番号が指定されたらなら、無効化
2418+ InvincibleID = -1;
2419+ ObjMgr.GeHumanObject(id)->SetInvincibleFlag(false);
2420+ sprintf(str, "Not invincible Human[%d].", id);
2421+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2422+ }
2423+ else{
2424+ //既に誰かが指定されていたら、既に指定されている人を無効化
2425+ if( InvincibleID != -1 ){
2426+ ObjMgr.GeHumanObject(InvincibleID)->SetInvincibleFlag(false);
2427+ sprintf(str, "Not invincible Human[%d].", InvincibleID);
2428+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2429+ }
2430+
2431+ //新たに無敵状態の人を指定
2432+ InvincibleID = id;
2433+ ObjMgr.GeHumanObject(id)->SetInvincibleFlag(true);
2434+ sprintf(str, "Invincible Human[%d].", id);
2435+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2436+ }
2437+ }
2438+ }
2439+
2440+ //殺害
2441+ if( GetCommandNum("kill", &id) == true ){
2442+ if( (0 <= id)&&(id < MAX_HUMAN) ){
2443+ human *thuman = ObjMgr.GeHumanObject(id);
2444+ if( thuman->GetDrawFlag() == true ){
2445+ if( thuman->SetHP(0) == true ){
2446+ sprintf(str, "Killed Human[%d].", id);
2447+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2448+ }
2449+ }
2450+ }
2451+ }
2452+
2453+ //小物を破壊
2454+ if( GetCommandNum("break", &id) == true ){
2455+ if( (0 <= id)&&(id < MAX_SMALLOBJECT) ){
2456+ smallobject *tsmallobject = ObjMgr.GetSmallObject(id);
2457+ if( tsmallobject->GetDrawFlag() == true ){
2458+ tsmallobject->Destruction();
2459+ sprintf(str, "Broke SmallObject[%d].", id);
2460+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2461+ }
2462+ }
2463+ }
2464+
2465+ //小物を新規配置
2466+ if( GetCommandNum("newobj", &id) == true ){
2467+ if( (0 <= id)&&(id < TOTAL_PARAMETERINFO_SMALLOBJECT) ){
2468+ int dataid = ObjMgr.AddSmallObjectIndex(camera_x + cos(camera_rx)*20.0f, camera_y, camera_z + sin(camera_rx)*20.0f, camera_rx*-1, id, true);
2469+ if( dataid != -1 ){
2470+ sprintf(str, "Add SmallObject[%d].", dataid);
2471+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2472+ }
2473+ }
2474+ }
2475+
2476+ //プレイヤー操作をAI化
2477+ if( strcmp(NewCommand, "bot") == 0 ){
2478+ if( PlayerAI == false ){
2479+ PlayerAI = true;
2480+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Player is AI control. (bot)");
2481+ }
2482+ else{
2483+ PlayerAI = false;
2484+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Player is User control.");
2485+ }
2486+ }
2487+
2488+ //AIを非戦闘化させる
2489+ if( strcmp(NewCommand, "nofight") == 0 ){
2490+ if( AINoFight == false ){
2491+ AINoFight = true;
2492+ for(int i=0; i<MAX_HUMAN; i++){
2493+ HumanAI[i].SetNoFightFlag(true);
2494+ }
2495+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "AI had no Fight.");
2496+ }
2497+ else{
2498+ AINoFight = false;
2499+ for(int i=0; i<MAX_HUMAN; i++){
2500+ HumanAI[i].SetNoFightFlag(false);
2501+ }
2502+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "AI had Fight.");
2503+ }
2504+ }
2505+
2506+ //AIを警戒させる
2507+ if( strcmp(NewCommand, "caution") == 0 ){
2508+ for(int i=0; i<MAX_HUMAN; i++){
2509+ HumanAI[i].SetCautionMode();
2510+ }
2511+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Set cautious AI.");
2512+ }
2513+
2514+ //AIの処理を停止
2515+ if( strcmp(NewCommand, "stop") == 0 ){
2516+ if( AIstop == false ){
2517+ AIstop = true;
2518+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Stopped AI control.");
2519+ }
2520+ else{
2521+ AIstop = false;
2522+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Started AI control.");
2523+ }
2524+ }
2525+
2526+ /*
2527+ //ミッション達成
2528+ if( strcmp(NewCommand, "comp") == 0 ){
2529+ end_framecnt += 1;
2530+ MainGameInfo.missioncomplete = true;
2531+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Mission complete.");
2532+ }
2533+
2534+ //ミッション失敗
2535+ if( strcmp(NewCommand, "fail") == 0 ){
2536+ end_framecnt += 1;
2537+ MainGameInfo.missioncomplete = false;
2538+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "Mission fail.");
2539+ }
2540+ */
2541+
2542+ //バージョン情報取得
2543+ if( strcmp(NewCommand, "ver") == 0 ){
2544+ sprintf(str, "%s Version:%s", GAMENAME, GAMEVERSION);
2545+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2546+ }
2547+
2548+ //スクリーンショットを撮影
2549+ // ※コンソール画面を削除するため、撮影を1フレーム遅らせる。
2550+ if( ScreenShot == true ){
2551+ char fname[256];
2552+
2553+ //ファイル名を決定
2554+ GetTimeName(fname);
2555+ strcat(fname, ".bmp");
2556+
2557+ //撮影・保存
2558+ if( d3dg->SaveScreenShot(fname) == true ){
2559+ sprintf(str, "Saved Screenshot (File:%s)", fname);
2560+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), str);
2561+ }
2562+ else{
2563+ AddInfoConsole(D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f), "[Error] Save failed.");
2564+ }
2565+ }
2566+ if( strcmp(NewCommand, "ss") == 0 ){
2567+ ScreenShot = true;
2568+ }
2569+ else{
2570+ ScreenShot = false;
2571+ }
2572+
2573+ //コンソールをクリア
2574+ if( strcmp(NewCommand, "clear") == 0 ){
2575+ for(int i=0; i<MAX_CONSOLELINES; i++){
2576+ InfoConsoleData[i].color = D3DCOLOR_COLORVALUE(1.0f,1.0f,1.0f,1.0f);
2577+ InfoConsoleData[i].textdata[0] = NULL;
2578+ }
2579+ }
2580+}
2581+
2582+//! デバック用コンソールの描画処理
2583+void maingame::RenderConsole()
2584+{
2585+ //下地
2586+ d3dg->Draw2DBox(0, 0, SCREEN_WIDTH, (MAX_CONSOLELINES+1)*18 + 5 + 5, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.75f));
2587+
2588+ //表示中の文字
2589+ for(int i=0; i<MAX_CONSOLELINES; i++){
2590+ if( InfoConsoleData[i].textdata[0] != NULL ){
2591+ d3dg->Draw2DTextureFontText(5+1, i*18+5+1, InfoConsoleData[i].textdata, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f), 14, 17);
2592+ d3dg->Draw2DTextureFontText(5, i*18+5, InfoConsoleData[i].textdata, InfoConsoleData[i].color, 14, 17);
2593+ }
2594+ }
2595+
2596+ //入力中の文字
2597+ int cnt;
2598+ for(cnt=0; cnt<MAX_CONSOLELINES; cnt++){
2599+ if( InfoConsoleData[cnt].textdata[0] == NULL ){ break; }
2600+ }
2601+ d3dg->Draw2DTextureFontText(5+1, cnt*18+5+1, InputConsoleData->textdata, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,1.0f), 14, 17);
2602+ d3dg->Draw2DTextureFontText(5, cnt*18+5, InputConsoleData->textdata, InputConsoleData->color, 14, 17);
2603+}
2604+
2605+#endif
2606+
20822607 void maingame::Destroy()
20832608 {
20842609 //ブロックデータ解放
@@ -2090,6 +2615,12 @@
20902615 //背景空解放
20912616 Resource.CleanupSkyModelTexture();
20922617
2618+#ifdef ENABLE_DEBUGCONSOLE
2619+ //コンソール用データを解放
2620+ if( InfoConsoleData != NULL ){ delete [] InfoConsoleData; }
2621+ if( InputConsoleData != NULL ){ delete InputConsoleData; }
2622+#endif
2623+
20932624 GameState->NextState();
20942625 }
20952626
--- trunk/d3dgraphics.cpp (revision 21)
+++ trunk/d3dgraphics.cpp (revision 22)
@@ -840,7 +840,8 @@
840840 }
841841
842842 //! マップデータを描画
843-void D3DGraphics::DrawMapdata()
843+//! @param wireframe ワイヤーフレーム表示
844+void D3DGraphics::DrawMapdata(bool wireframe)
844845 {
845846 //ブロックデータが読み込まれていなければ、処理しない。
846847 if( blockdata == NULL ){ return; }
@@ -849,6 +850,26 @@
849850 D3DMATERIAL9 mtrl = {0};
850851 int textureID;
851852
853+ if( wireframe == true ){
854+ //ワイヤーフレーム表示
855+ for(int i=0; i<bs; i++){
856+ blockdata->Getdata(&data, i);
857+ Drawline(data.x[0], data.y[0], data.z[0], data.x[1], data.y[1], data.z[1]);
858+ Drawline(data.x[1], data.y[1], data.z[1], data.x[2], data.y[2], data.z[2]);
859+ Drawline(data.x[2], data.y[2], data.z[2], data.x[3], data.y[3], data.z[3]);
860+ Drawline(data.x[3], data.y[3], data.z[3], data.x[0], data.y[0], data.z[0]);
861+ Drawline(data.x[4], data.y[4], data.z[4], data.x[5], data.y[5], data.z[5]);
862+ Drawline(data.x[5], data.y[5], data.z[5], data.x[6], data.y[6], data.z[6]);
863+ Drawline(data.x[6], data.y[6], data.z[6], data.x[7], data.y[7], data.z[7]);
864+ Drawline(data.x[7], data.y[7], data.z[7], data.x[4], data.y[4], data.z[4]);
865+ Drawline(data.x[0], data.y[0], data.z[0], data.x[4], data.y[4], data.z[4]);
866+ Drawline(data.x[1], data.y[1], data.z[1], data.x[5], data.y[5], data.z[5]);
867+ Drawline(data.x[2], data.y[2], data.z[2], data.x[6], data.y[6], data.z[6]);
868+ Drawline(data.x[3], data.y[3], data.z[3], data.x[7], data.y[7], data.z[7]);
869+ }
870+ return;
871+ }
872+
852873 //深度バッファ比較関数を設定
853874 //pd3dDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS);
854875
@@ -1355,4 +1376,27 @@
13551376
13561377 //深度バッファ比較関数を元に戻す
13571378 pd3dDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
1379+}
1380+
1381+//! 画面のスクリーンショットを保存
1382+//! @param filename ファイル名
1383+//! @return 成功:true 失敗:false
1384+bool D3DGraphics::SaveScreenShot(char* filename)
1385+{
1386+ LPDIRECT3DSURFACE9 pSurface = NULL;
1387+ HRESULT hr;
1388+
1389+ //サーフェースを作成し、画面を取得
1390+ pd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pSurface);
1391+
1392+ //サーフェイスを画像に出力
1393+ hr = D3DXSaveSurfaceToFile(filename, D3DXIFF_BMP, pSurface, NULL, NULL);
1394+
1395+ //解放
1396+ pSurface->Release();
1397+
1398+ if( hr == D3D_OK ){
1399+ return true;
1400+ }
1401+ return false;
13581402 }
\ No newline at end of file
--- trunk/ai.h (revision 21)
+++ trunk/ai.h (revision 22)
@@ -65,6 +65,7 @@
6565 int battlemode; //!< 戦闘モード
6666 int movemode; //!< 移動モード
6767 bool hold; //!< 移動パスを読まない
68+ bool NoFight; //!< 非戦闘化フラグ
6869 float posx; //!< X座標
6970 float posy; //!< Y座標
7071 float posz; //!< Z座標
@@ -123,6 +124,8 @@
123124 void Init();
124125 void SetHoldWait(float px, float pz, float rx);
125126 void SetHoldTracking(int id);
127+ void SetCautionMode();
128+ void SetNoFightFlag(bool flag);
126129 void Process();
127130 };
128131
--- trunk/objectmanager.cpp (revision 21)
+++ trunk/objectmanager.cpp (revision 22)
@@ -431,6 +431,41 @@
431431 return -1;
432432 }
433433
434+//! 小物追加(ゲーム中用)
435+//! @param px X座標
436+//! @param py Y座標
437+//! @param pz Z座標
438+//! @param rx X軸向き
439+//! @param paramID 種類番号
440+//! @param MapColl 位置修正フラグ
441+//! @return 成功:データ番号(0以上) 失敗:-1
442+int ObjectManager::AddSmallObjectIndex(float px, float py, float pz, float rx, int paramID, bool MapColl)
443+{
444+ //モデルとテクスチャを取得
445+ int model, texture;
446+ if( Resource->GetSmallObjectModelTexture(paramID, &model, &texture) == 1 ){
447+ return -1;
448+ }
449+
450+ for(int j=0; j<MAX_SMALLOBJECT; j++){
451+ if( SmallObjectIndex[j].GetDrawFlag() == false ){
452+ //初期化
453+ SmallObjectIndex[j].SetPosData(px, py, pz, rx);
454+ SmallObjectIndex[j].SetParamData(paramID, 0, true);
455+ SmallObjectIndex[j].SetModel(model, 5.0f);
456+ SmallObjectIndex[j].SetTexture(texture);
457+ SmallObjectIndex[j].SetDrawFlag(true);
458+
459+ //位置修正フラグが有効ならば、マップと判定
460+ if( MapColl == true ){
461+ SmallObjectIndex[j].CollisionMap(CollD);
462+ }
463+ return j;
464+ }
465+ }
466+ return -1;
467+}
468+
434469 //! 出血させる
435470 //! @param x X座標
436471 //! @param y Y座標
@@ -1001,16 +1036,25 @@
10011036 //! 指定したデータ番号のweaponクラスを取得
10021037 //! @param id データ番号
10031038 //! @return 武器オブジェクトのポインタ (無効なデータ番号で NULL)
1004-weapon* ObjectManager::GeWeaponObject(int id)
1039+weapon* ObjectManager::GetWeaponObject(int id)
10051040 {
10061041 if( (id < 0)||(MAX_WEAPON-1 < id) ){ return NULL; }
10071042 return &(WeaponIndex[id]);
10081043 }
10091044
1045+//! 指定したデータ番号のsmallobjectクラスを取得
1046+//! @param id データ番号
1047+//! @return 小物オブジェクトのポインタ (無効なデータ番号で NULL)
1048+smallobject* ObjectManager::GetSmallObject(int id)
1049+{
1050+ if( (id < 0)||(MAX_SMALLOBJECT-1 < id) ){ return NULL; }
1051+ return &(SmallObjectIndex[id]);
1052+}
1053+
10101054 //! 指定したデータ番号のbulletクラスを取得
10111055 //! @param id データ番号
10121056 //! @return 弾オブジェクトのポインタ (無効なデータ番号で NULL)
1013-bullet* ObjectManager::GeBulletObject(int id)
1057+bullet* ObjectManager::GetBulletObject(int id)
10141058 {
10151059 if( (id < 0)||(MAX_BULLET-1 < id) ){ return NULL; }
10161060 return &(BulletIndex[id]);
@@ -1612,6 +1656,28 @@
16121656 GameSound->HitHuman(tx, ty, tz);
16131657 }
16141658
1659+//! 死者を蘇生する
1660+//! @param id 人の番号(0〜MAX_HUMAN-1)
1661+//! @return true:成功 false:失敗
1662+//! @warning 手ぶらのまま蘇生します
1663+//! @attention 無効な人番号が指定された場合や、指定した人が生存していた場合、あるいは謎人間に対して実行した場合、この関数は失敗します。
1664+bool ObjectManager::HumanResuscitation(int id)
1665+{
1666+ if( (id < 0)||(MAX_HUMAN-1 < id) ){ return false; }
1667+
1668+ //使用されていないか、生存していれば処理しない。
1669+ if( HumanIndex[id].GetDrawFlag() == false ){ return false; }
1670+ if( HumanIndex[id].GetDeadFlag() == false ){ return false; }
1671+
1672+ int id_param, dataid, team;
1673+ signed char p4;
1674+ HumanIndex[id].GetParamData(&id_param, &dataid, &p4, &team);
1675+ if( (id_param < 0)||( TOTAL_PARAMETERINFO_HUMAN-1 < id_param) ){ return false; } //謎人間なら処理しない
1676+ HumanIndex[id].SetParamData(id_param, dataid, p4, team, true);
1677+
1678+ return true;
1679+}
1680+
16151681 //! ゲームクリアー・ゲームオーバーの判定
16161682 //! @return ゲームクリアー:1 ゲームオーバー:2 判定なし:0
16171683 //! @attention ゲームクリア―とゲームオーバーが同時に成立する条件では、本家XOPSと同様に「ゲームクリアー」と判定されます。
@@ -1662,6 +1728,129 @@
16621728 return 0;
16631729 }
16641730
1731+//! オブジェクトの情報を取得
1732+//! @param camera_x カメラのX座標
1733+//! @param camera_y カメラのY座標
1734+//! @param camera_z カメラのZ座標
1735+//! @param camera_rx カメラの横軸角度
1736+//! @param camera_ry カメラの縦軸角度
1737+//! @param color 色を取得するポインタ
1738+//! @param infostr 文字を取得するポインタ
1739+//! @return 表示情報あり:true 表示情報なし:false
1740+bool ObjectManager::GetObjectInfoTag(float camera_x, float camera_y, float camera_z, float camera_rx, float camera_ry, int *color, char *infostr)
1741+{
1742+ float dist = 50.0f * 50.0f;
1743+ float px, py, pz;
1744+ float x, y, z, r;
1745+ int Player_teamID;
1746+
1747+ //文字を初期化
1748+ infostr[0] = NULL;
1749+
1750+ //プレイヤーのチーム番号を取得
1751+ HumanIndex[Player_HumanID].GetParamData(NULL, NULL, NULL, &Player_teamID);
1752+
1753+ //人
1754+ for(int i=0; i<MAX_HUMAN; i++){
1755+ //プレイヤー自身なら処理しない
1756+ if( i == Player_HumanID ){ continue; }
1757+
1758+ if( HumanIndex[i].GetDrawFlag() == true ){
1759+ HumanIndex[i].GetPosData(&px, &py, &pz, NULL);
1760+ x = px - camera_x;
1761+ y = py - camera_y;
1762+ z = pz - camera_z;
1763+ r = x*x + y*y + z*z;
1764+ if( r < dist ){
1765+ float rx;
1766+ int team;
1767+
1768+ //視点を基準に対象までの角度を算出(-π〜π)
1769+ rx = atan2(z, x) - camera_rx;
1770+ for(; rx > (float)M_PI; rx -= (float)M_PI*2){}
1771+ for(; rx < (float)M_PI*-1; rx += (float)M_PI*2){}
1772+
1773+ //角度上、視界に入っていれば
1774+ if( abs(rx) < (float)M_PI/18 ){
1775+ HumanIndex[i].GetParamData(NULL, NULL, NULL, &team);
1776+ if( team == Player_teamID ){
1777+ *color = D3DCOLOR_COLORVALUE(0.0f,0.0f,1.0f,1.0f);
1778+ sprintf(infostr, "Human[%d] HP %d : Friend", i, HumanIndex[i].GetHP());
1779+ }
1780+ else{
1781+ *color = D3DCOLOR_COLORVALUE(1.0f,0.0f,0.0f,1.0f);
1782+ sprintf(infostr, "Human[%d] HP %d : Enemy", i, HumanIndex[i].GetHP());
1783+ }
1784+ dist = r;
1785+ }
1786+ }
1787+ }
1788+ }
1789+
1790+ //武器
1791+ for(int i=0; i<MAX_WEAPON; i++){
1792+ if( (WeaponIndex[i].GetDrawFlag() == true)&&(WeaponIndex[i].GetUsingFlag() == false) ){
1793+ int lnbs, nbs;
1794+
1795+ WeaponIndex[i].GetPosData(&px, &py, &pz, NULL);
1796+ WeaponIndex[i].GetParamData(NULL, &lnbs, &nbs);
1797+ x = px - camera_x;
1798+ y = py - camera_y;
1799+ z = pz - camera_z;
1800+ r = x*x + y*y + z*z;
1801+ if( r < dist ){
1802+ float rx, ry;
1803+
1804+ //視点を基準に対象までの角度を算出(-π〜π)
1805+ rx = atan2(z, x) - camera_rx;
1806+ for(; rx > (float)M_PI; rx -= (float)M_PI*2){}
1807+ for(; rx < (float)M_PI*-1; rx += (float)M_PI*2){}
1808+ ry = atan2(y, sqrt(x*x + z*z)) - camera_ry;
1809+
1810+ //角度上、視界に入っていれば
1811+ if( (abs(rx) < (float)M_PI/18)&&(abs(ry) < (float)M_PI/18) ){
1812+ *color = D3DCOLOR_COLORVALUE(0.0f,1.0f,0.0f,1.0f);
1813+ sprintf(infostr, "WeaponIndex[%d] %d:%d", i, lnbs, (nbs - lnbs));
1814+ dist = r;
1815+ }
1816+ }
1817+ }
1818+ }
1819+
1820+ //小物
1821+ for(int i=0; i<MAX_SMALLOBJECT; i++){
1822+ if( SmallObjectIndex[i].GetDrawFlag() == true ){
1823+ SmallObjectIndex[i].GetPosData(&px, &py, &pz, NULL);
1824+ x = px - camera_x;
1825+ y = py - camera_y;
1826+ z = pz - camera_z;
1827+ r = x*x + y*y + z*z;
1828+ if( r < dist ){
1829+ float rx, ry;
1830+
1831+ //視点を基準に対象までの角度を算出(-π〜π)
1832+ rx = atan2(z, x) - camera_rx;
1833+ for(; rx > (float)M_PI; rx -= (float)M_PI*2){}
1834+ for(; rx < (float)M_PI*-1; rx += (float)M_PI*2){}
1835+ ry = atan2(y, sqrt(x*x + z*z)) - camera_ry;
1836+
1837+ //角度上、視界に入っていれば
1838+ if( (abs(rx) < (float)M_PI/18)&&(abs(ry) < (float)M_PI/18) ){
1839+ *color = D3DCOLOR_COLORVALUE(1.0f,1.0f,0.0f,1.0f);
1840+ sprintf(infostr, "SmallObject[%d] HP %d", i, SmallObjectIndex[i].GetHP());
1841+ dist = r;
1842+ }
1843+ }
1844+ }
1845+ }
1846+
1847+ //文字が設定されているかどうかで、有効な処理がされたか判定。
1848+ if( infostr[0] == NULL ){
1849+ return false;
1850+ }
1851+ return true;
1852+}
1853+
16651854 //! オブジェクトの主計算処理
16661855 //! @param cmdF5id 上昇機能(F5裏技)させる人データ番号(-1で機能無効)
16671856 //! @param camera_x カメラのX座標
@@ -1682,12 +1871,16 @@
16821871
16831872 //人オブジェクトの処理
16841873 for(int i=0; i<MAX_HUMAN; i++){
1874+ bool cmdF5;
1875+
16851876 if( i == cmdF5id ){
1686- HumanIndex[i].RunFrame(CollD, BlockData, true);
1877+ cmdF5 = true;
16871878 }
16881879 else{
1689- HumanIndex[i].RunFrame(CollD, BlockData, false);
1880+ cmdF5 = false;
16901881 }
1882+
1883+ HumanIndex[i].RunFrame(CollD, BlockData, cmdF5);
16911884 }
16921885
16931886 //武器オブジェクトの処理
--- trunk/window.cpp (revision 21)
+++ trunk/window.cpp (revision 22)
@@ -175,6 +175,19 @@
175175 return time;
176176 }
177177
178+//! 日時による文字列を取得
179+//! @param str 文字列を受け取るポインタ
180+void GetTimeName(char *str)
181+{
182+ time_t timer;
183+ struct tm *local;
184+
185+ timer = time(NULL);
186+ local = localtime(&timer);
187+
188+ sprintf(str, "%04d%02d%02d%02d%02d%02d", local->tm_year + 1900, local->tm_mon + 1, local->tm_mday, local->tm_hour, local->tm_min, local->tm_sec);
189+}
190+
178191 //! 乱数を初期化
179192 void InitRand()
180193 {
--- trunk/object.h (revision 21)
+++ trunk/object.h (revision 22)
@@ -153,6 +153,7 @@
153153 float totalmove; //!< 合計移動量
154154 int StateGunsightErrorRange; //!< 照準の状態誤差
155155 int ReactionGunsightErrorRange; //!< 照準の反動誤差
156+ bool Invincible; //!< 無敵フラグ
156157
157158 void GunsightErrorRange();
158159 int CheckAndProcessDead(class Collision *CollD);
@@ -168,8 +169,11 @@
168169 virtual void GetMovePos(float *x, float *y, float *z);
169170 virtual void SetModel(int upmodel, int armmodel[], int legmodel, int walkmodel[], int runmodel[]);
170171 virtual int GetHP();
172+ virtual bool SetHP(int in_hp);
171173 virtual bool GetDeadFlag();
172174 virtual void SetTeamID(int id);
175+ virtual bool GetInvincibleFlag();
176+ virtual void SetInvincibleFlag(bool flag);
173177 virtual void SetWeapon(class weapon *in_weapon[]);
174178 virtual int PickupWeapon(class weapon *in_weapon);
175179 virtual void ChangeWeapon(int id = -1);
--- trunk/gamemain.h (revision 21)
+++ trunk/gamemain.h (revision 22)
@@ -32,6 +32,8 @@
3232 #ifndef GAMEMAIN_H
3333 #define GAMEMAIN_H
3434
35+#define ENABLE_DEBUGCONSOLE //!< @brief デバック用コンソールの有効化(コメント化で機能無効)
36+
3537 #define MAINMENU_X 280 //!< メニューの表示 X座標(左上基準)
3638 #define MAINMENU_Y 140 //!< メニューの表示 Y座標(〃)
3739 #define TOTAL_MENUITEMS 8 //!< メニュー1画面に表示するミッション数
@@ -38,7 +40,7 @@
3840 #define MAINMENU_H (TOTAL_MENUITEMS+2)*30 + 25 //!< メニューの表示サイズ・高さ
3941
4042 #define HUDA_WEAPON_POSX (SCREEN_WIDTH - 255) //!< 武器情報を表示する領域・X座標
41-#define HUDA_WEAPON_POSY (SCREEN_HEIGTH - 98) //!< 武器情報を表示する領域・Y座標
43+#define HUDA_WEAPON_POSY (SCREEN_HEIGHT - 98) //!< 武器情報を表示する領域・Y座標
4244 #define HUDA_WEAPON_SIZEW 8 //!< 武器情報を表示する領域・横サイズ(32ピクセルの配置個数)
4345 #define HUDA_WEAPON_SIZEH 3 //!< 武器情報を表示する領域・縦サイズ(32ピクセルの配置個数)
4446
@@ -54,6 +56,12 @@
5456
5557 #define TOTAL_EVENTENT_SHOWMESSEC 5.0f //!< イベントメッセージを表示する秒数
5658
59+#ifdef ENABLE_DEBUGCONSOLE
60+ #define MAX_CONSOLELEN 45 //!< デバック用コンソールの文字数(行)
61+ #define MAX_CONSOLELINES 8 //!< デバック用コンソールの行数
62+ #define CONSOLE_PROMPT ">" //!< デバック用コンソールのプロンプト
63+#endif
64+
5765 #ifndef H_LAYERLEVEL
5866 #define H_LAYERLEVEL 3 //!< Select include file.
5967 #endif
@@ -73,6 +81,14 @@
7381 int headshot; //!< 敵の頭部に命中した数
7482 };
7583
84+#ifdef ENABLE_DEBUGCONSOLE
85+//! コンソールを管理する構造体
86+struct ConsoleData{
87+ int color; //!< 色
88+ char textdata[MAX_CONSOLELEN]; //!< 文字列
89+};
90+#endif
91+
7692 //! @brief オープニング画面管理クラス
7793 //! @details オープニング画面を管理します。
7894 class opening : public D3Dscene
@@ -143,11 +159,18 @@
143159 float view_rx; //!< マウス角度とカメラ角度の差(水平軸)
144160 float view_ry; //!< マウス角度とカメラ角度の差(垂直軸)
145161 bool ShowInfo_Debugmode; //!< 座標などを表示するデバックモード
146- bool Camera_Debugmode; //!< カメラデバックモード
147- bool Camera_F1mode; //!< カメラF1モード
148- int Camera_F2mode; //!< カメラF2モード
162+ bool Camera_Debugmode; //!< カメラデバックモード
163+ bool tag; //!< オブジェクトのタグを表示
164+ bool wireframe; //!< マップをワイヤーフレーム表示
165+ bool CenterLine; //!< 3D空間に中心線を表示
166+ bool Camera_F1mode; //!< カメラF1モード
167+ int Camera_F2mode; //!< カメラF2モード
149168 bool Camera_HOMEmode; //!< カメラHOMEモード
150169 bool Cmd_F5; //!< 裏技F5モード
170+ int InvincibleID; //!< 無敵な人の判定
171+ bool PlayerAI; //!< プレイヤー操作をAIに委ねる
172+ bool AIstop; //!< AI処理を停止する
173+ bool AINoFight; //!< AIが非戦闘化する(戦わない)
151174 int start_framecnt; //!< メインゲーム開始時のカウント
152175 int end_framecnt; //!< メインゲーム終了のカウント
153176 int message_id; //!< 表示中のイベントメッセージ番号
@@ -165,6 +188,21 @@
165188 void Render3D();
166189 void Render2D();
167190
191+#ifdef ENABLE_DEBUGCONSOLE
192+ bool Show_Console; //!< デバック用コンソールを表示
193+ ConsoleData *InfoConsoleData; //!< デバック用コンソールデータ(表示済み)
194+ ConsoleData *InputConsoleData; //!< デバック用コンソールデータ(入力中)
195+ char NewCommand[MAX_CONSOLELEN]; //!< 新たに入力された未処理のコマンド
196+ bool ScreenShot; //!< SSを撮影する
197+ void AddInfoConsole(int color, char *str);
198+ void ConsoleInputText(char inchar);
199+ void ConsoleDeleteText();
200+ bool GetCommandNum(char *cmd, int *num);
201+ void InputConsole();
202+ void ProcessConsole();
203+ void RenderConsole();
204+#endif
205+
168206 public:
169207 maingame();
170208 ~maingame();
--- trunk/ai.cpp (revision 21)
+++ trunk/ai.cpp (revision 22)
@@ -865,6 +865,11 @@
865865 //! 攻撃をキャンセル
866866 bool AIcontrol::ActionCancel()
867867 {
868+ //非戦闘化フラグが有効なら終了
869+ if( NoFight == true ){
870+ return true;
871+ }
872+
868873 //敵が死亡したら終了
869874 if( enemyhuman->GetDeadFlag() == true ){
870875 return true;
@@ -1333,6 +1338,11 @@
13331338 //! 敵を探す
13341339 int AIcontrol::SearchEnemy()
13351340 {
1341+ //非戦闘化フラグが有効なら敵を見つけない
1342+ if( NoFight == true ){
1343+ return 0;
1344+ }
1345+
13361346 if( battlemode == AI_ACTION ){ return 0; }
13371347
13381348 int weaponid = ctrlhuman->GetMainWeaponTypeNO();
@@ -1630,6 +1640,11 @@
16301640 soundlist soundlist[MAX_SOUNDMGR_LIST];
16311641 int soundlists = GameSound->GetWorldSound(posx, posy + VIEW_HEIGHT, posz, teamid, soundlist);
16321642
1643+ //非戦闘化フラグが有効なら、音は聞こえないことにする
1644+ if( NoFight == true ){
1645+ soundlists = 0;
1646+ }
1647+
16331648 //回転と腕の角度
16341649 TurnSeen();
16351650 ArmAngle();
@@ -1708,6 +1723,11 @@
17081723 soundlist soundlist[MAX_SOUNDMGR_LIST];
17091724 int soundlists = GameSound->GetWorldSound(posx, posy + VIEW_HEIGHT, posz, teamid, soundlist);
17101725
1726+ //非戦闘化フラグが有効なら、音は聞こえないことにする
1727+ if( NoFight == true ){
1728+ soundlists = 0;
1729+ }
1730+
17111731 //ランダムパスなら処理実行
17121732 if( movemode == AI_RANDOM ){
17131733 SearchTarget(true);
@@ -1766,6 +1786,7 @@
17661786
17671787 //ステートを初期化
17681788 hold = false;
1789+ NoFight = false;
17691790 battlemode = AI_NORMAL;
17701791 movemode = AI_NULL;
17711792 enemyhuman = NULL;
@@ -1813,6 +1834,29 @@
18131834 target_pointid = id;
18141835 }
18151836
1837+//! 強制的に警戒させる
1838+//! @warning 優先的な走り を実行中の場合、この関数は何もしません。
1839+void AIcontrol::SetCautionMode()
1840+{
1841+ //優先的な走りならば何もしない
1842+ if( movemode == AI_RUN2 ){ return; }
1843+
1844+ if( battlemode == AI_NORMAL ){
1845+ target_posx = posx;
1846+ target_posz = posz;
1847+ }
1848+ battlemode = AI_CAUTION;
1849+ cautioncnt = 160;
1850+}
1851+
1852+//! 非戦闘化フラグを設定
1853+//! @param flag true:戦闘を行わない(非戦闘化) false:戦闘を行う(通常)
1854+//! @attention フラグを有効にすると敵を認識しなくなります。
1855+void AIcontrol::SetNoFightFlag(bool flag)
1856+{
1857+ NoFight = flag;
1858+}
1859+
18161860 //! 処理系関数
18171861 void AIcontrol::Process()
18181862 {
--- trunk/d3dgraphics.h (revision 21)
+++ trunk/d3dgraphics.h (revision 22)
@@ -133,7 +133,7 @@
133133 void SetFog(int skynumber);
134134 void SetCamera(float camera_x, float camera_y, float camera_z, float camera_rx, float camera_ry, float viewangle);
135135 void LoadMapdata(class BlockDataInterface* in_blockdata, char *directory);
136- void DrawMapdata();
136+ void DrawMapdata(bool wireframe);
137137 int GetMapTextureID(int id);
138138 void CleanupMapdata();
139139 void RenderModel(int id_model, int id_texture);
@@ -147,6 +147,7 @@
147147 void Draw2DLine(int x1, int y1, int x2, int y2, int color);
148148 void Draw2DBox(int x1, int y1, int x2, int y2, int color);
149149 void Draw2DTexture(int x, int y, int id, int width, int height, float alpha);
150+ bool SaveScreenShot(char *fname);
150151 };
151152
152153 #endif
\ No newline at end of file
--- trunk/objectmanager.h (revision 21)
+++ trunk/objectmanager.h (revision 22)
@@ -108,13 +108,15 @@
108108 void SetClass(ParameterInfo *in_GameParamInfo, D3DGraphics *in_d3dg, ResourceManager *in_Resource, BlockDataInterface *in_BlockData, PointDataInterface *in_PointData, Collision *in_CollD, SoundManager *in_GameSound, MIFInterface *in_MIFdata);
109109 int AddHumanIndex(float px, float py, float pz, float rx, int CharacterID, int TeamID, int WeaponID[]);
110110 int AddVisualWeaponIndex(int WeaponID, bool loadbullet);
111+ int AddSmallObjectIndex(float px, float py, float pz, float rx, int paramID, bool MapColl);
111112 void LoadPointData();
112113 int GetPlayerID();
113114 void SetPlayerID(int id);
114115 human* GeHumanObject(int id);
115116 human* GetPlayerHumanObject();
116- weapon* GeWeaponObject(int id);
117- bullet* GeBulletObject(int id);
117+ weapon* GetWeaponObject(int id);
118+ smallobject* GetSmallObject(int id);
119+ bullet* GetBulletObject(int id);
118120 bullet* GetNewBulletObject();
119121 grenade* GetNewGrenadeObject();
120122 human* SearchHuman(signed char p4);
@@ -135,7 +137,9 @@
135137 bool CheatNewWeapon(int human_id, int new_weaponID);
136138 bool CheckZombieAttack(human* MyHuman, human* EnemyHuman);
137139 void HitZombieAttack(human* EnemyHuman);
140+ bool HumanResuscitation(int id);
138141 int CheckGameOverorComplete();
142+ bool GetObjectInfoTag(float camera_x, float camera_y, float camera_z, float camera_rx, float camera_ry, int *color, char *infostr);
139143 int Process(int cmdF5id, float camera_x, float camera_y, float camera_z, float camera_rx, float camera_ry);
140144 bool GetHumanShotInfo(int id, int *ontarget, int *kill, int *headshot);
141145 void Render(float camera_x, float camera_y, float camera_z, int HidePlayer);
--- trunk/object.cpp (revision 21)
+++ trunk/object.cpp (revision 22)
@@ -243,6 +243,7 @@
243243 scopemode = 0;
244244 HitFlag = false;
245245 totalmove = 0.0f;
246+ Invincible = false;
246247 }
247248 }
248249
@@ -266,6 +267,20 @@
266267 return hp;
267268 }
268269
270+//! HPを設定
271+//! @param in_hp 新たに設定するHP
272+//! @return 成功:true 失敗:false
273+//! @attention HPが1以上の人に対して実行しないと失敗します。
274+bool human::SetHP(int in_hp)
275+{
276+ if( hp > 0 ){
277+ hp = in_hp;
278+ return true;
279+ }
280+ return false;
281+}
282+
283+
269284 //! 死体かどうか判定
270285 //! @return 死体:true 死体でない:false
271286 //! @warning 完全に静止した状態を「死体」と判定します。倒れている最中の人は対象に含まれないため、hp <= 0 が全て死体と判定されるとは限りません。
@@ -287,6 +302,22 @@
287302 teamid = id;
288303 }
289304
305+//! 無敵フラグを取得
306+//! @return true:無敵 false:通常
307+//! @attention 無敵状態の場合、銃弾・手榴弾の爆発・落下 によるダメージを一切受けません。
308+bool human::GetInvincibleFlag()
309+{
310+ return Invincible;
311+}
312+
313+//! 無敵フラグを設定
314+//! @param flag true:無敵 false:通常
315+//! @attention 無敵状態の場合、銃弾・手榴弾の爆発・落下 によるダメージを一切受けません。
316+void human::SetInvincibleFlag(bool flag)
317+{
318+ Invincible = flag;
319+}
320+
290321 //! 前処理の移動量を取得
291322 //! @param *x X軸移動量を取得するポインタ(NULL可)
292323 //! @param *y Y軸移動量を取得するポインタ(NULL可)
@@ -752,7 +783,9 @@
752783 //! @param attacks 弾の攻撃力
753784 void human::HitBulletHead(int attacks)
754785 {
755- hp -= (int)((float)attacks * HUMAN_DAMAGE_HEAD);
786+ if( Invincible == false ){
787+ hp -= (int)((float)attacks * HUMAN_DAMAGE_HEAD);
788+ }
756789 HitFlag = true;
757790 }
758791
@@ -760,7 +793,9 @@
760793 //! @param attacks 弾の攻撃力
761794 void human::HitBulletUp(int attacks)
762795 {
763- hp -= (int)((float)attacks * HUMAN_DAMAGE_UP);
796+ if( Invincible == false ){
797+ hp -= (int)((float)attacks * HUMAN_DAMAGE_UP);
798+ }
764799 HitFlag = true;
765800 }
766801
@@ -768,7 +803,9 @@
768803 //! @param attacks 弾の攻撃力
769804 void human::HitBulletLeg(int attacks)
770805 {
771- hp -= (int)((float)attacks * HUMAN_DAMAGE_LEG);
806+ if( Invincible == false ){
807+ hp -= (int)((float)attacks * HUMAN_DAMAGE_LEG);
808+ }
772809 HitFlag = true;
773810 }
774811
@@ -775,7 +812,9 @@
775812 //! ゾンビの攻撃がヒット
776813 void human::HitZombieAttack()
777814 {
778- hp -= HUMAN_DAMAGE_ZOMBIEU + GetRand(HUMAN_DAMAGE_ZOMBIEA);
815+ if( Invincible == false ){
816+ hp -= HUMAN_DAMAGE_ZOMBIEU + GetRand(HUMAN_DAMAGE_ZOMBIEA);
817+ }
779818 HitFlag = true;
780819 }
781820
@@ -813,7 +852,7 @@
813852 //ダメージ量を計算し、反映
814853 damage = HUMAN_DAMAGE_GRENADE_LEG - (int)((float)HUMAN_DAMAGE_GRENADE_LEG/MAX_DAMAGE_GRENADE_DISTANCE * r);
815854 if( damage > 0 ){
816- hp -= damage;
855+ if( Invincible == false ){ hp -= damage; }
817856 HitFlag = true;
818857 returncode = 1;
819858 }
@@ -827,7 +866,7 @@
827866 //ダメージ量を計算し、反映
828867 damage = HUMAN_DAMAGE_GRENADE_HEAD - (int)((float)HUMAN_DAMAGE_GRENADE_HEAD/MAX_DAMAGE_GRENADE_DISTANCE * r);
829868 if( damage > 0 ){
830- hp -= damage;
869+ if( Invincible == false ){ hp -= damage; }
831870 HitFlag = true;
832871 returncode = 1;
833872 }
@@ -1277,9 +1316,11 @@
12771316 if( CollD->CheckALLBlockIntersectDummyRay(pos_x, pos_y + offset, pos_z, 0, -1, 0, NULL, NULL, &Dist, move_y*-1 + offset) == true ){
12781317 CollD->CheckALLBlockIntersectRay(pos_x, pos_y + offset, pos_z, 0, -1, 0, &id, &face, &Dist, move_y + offset);
12791318
1280- //ダメージ計算
1281- if( move_y > HUMAN_DAMAGE_MINSPEED ){ hp -= 0; }
1282- else{ hp -= (int)((float)HUMAN_DAMAGE_MAXFALL / abs(HUMAN_DAMAGE_MAXSPEED - (HUMAN_DAMAGE_MINSPEED)) * abs(move_y - (HUMAN_DAMAGE_MINSPEED))); }
1319+ if( Invincible == false ){
1320+ //ダメージ計算
1321+ if( move_y > HUMAN_DAMAGE_MINSPEED ){ hp -= 0; }
1322+ else{ hp -= (int)((float)HUMAN_DAMAGE_MAXFALL / abs(HUMAN_DAMAGE_MAXSPEED - (HUMAN_DAMAGE_MINSPEED)) * abs(move_y - (HUMAN_DAMAGE_MINSPEED))); }
1323+ }
12831324
12841325 FallDistance = (Dist - offset) * -1;
12851326 move_y = 0.0f;