X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 152 (tree) |
|---|---|
| Time | 2016-09-22 21:41:35 |
| Author | |
コンソールのコマンドを3個追加(bd1・pd1・sky)、コマンド判定時のバグを修正
| @@ -1114,7 +1114,8 @@ | ||
| 1114 | 1114 | |
| 1115 | 1115 | |
| 1116 | 1116 | //背景空読み込み |
| 1117 | - Resource.LoadSkyModelTexture(MIFdata.GetSkynumber()); | |
| 1117 | + SkyNumber = MIFdata.GetSkynumber(); | |
| 1118 | + Resource.LoadSkyModelTexture(SkyNumber); | |
| 1118 | 1119 | |
| 1119 | 1120 | //サウンド初期化 |
| 1120 | 1121 | GameSound->InitWorldSound(); |
| @@ -1214,7 +1215,7 @@ | ||
| 1214 | 1215 | ObjMgr.Recovery(); |
| 1215 | 1216 | |
| 1216 | 1217 | //背景空読み込み |
| 1217 | - Resource.LoadSkyModelTexture(MIFdata.GetSkynumber()); | |
| 1218 | + Resource.LoadSkyModelTexture(SkyNumber); | |
| 1218 | 1219 | |
| 1219 | 1220 | return 0; |
| 1220 | 1221 | } |
| @@ -1908,7 +1909,7 @@ | ||
| 1908 | 1909 | human *myHuman = ObjMgr.GetPlayerHumanObject(); |
| 1909 | 1910 | |
| 1910 | 1911 | //フォグとカメラを設定 |
| 1911 | - d3dg->SetFog(MIFdata.GetSkynumber()); | |
| 1912 | + d3dg->SetFog(SkyNumber); | |
| 1912 | 1913 | if( Camera_F1mode == false ){ |
| 1913 | 1914 | int scopemode = myHuman->GetScopeMode(); |
| 1914 | 1915 | float viewangle = 0.0f; |
| @@ -2677,6 +2678,11 @@ | ||
| 2677 | 2678 | //「コマンド名_X」分の文字数に達しているかどうか |
| 2678 | 2679 | if( strlen(cmd)+2 > strlen(NewCommand) ){ return false; } |
| 2679 | 2680 | |
| 2681 | + //数字が与えられているか | |
| 2682 | + for(int i=strlen(cmd)+1; NewCommand[i] != '\0'; i++){ | |
| 2683 | + if( ((NewCommand[i] < '0')||('9' < NewCommand[i]))&&(NewCommand[i] != '+')&&(NewCommand[i] != '-') ){ return false; } | |
| 2684 | + } | |
| 2685 | + | |
| 2680 | 2686 | //与えられた数字を調べる |
| 2681 | 2687 | *num = atoi(&(NewCommand[ strlen(cmd)+1 ])); |
| 2682 | 2688 | return true; |
| @@ -2738,9 +2744,10 @@ | ||
| 2738 | 2744 | |
| 2739 | 2745 | //コマンドリスト |
| 2740 | 2746 | if( strcmp(NewCommand, "help") == 0 ){ |
| 2741 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "help human result event mif ver"); | |
| 2747 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "help human result event ver"); | |
| 2748 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "mif bd1 pd1"); | |
| 2742 | 2749 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "info view center map aiinfo <NUM>"); |
| 2743 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "tag radar inmap"); | |
| 2750 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "tag radar inmap sky <NUM>"); | |
| 2744 | 2751 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "ff revive kill <NUM> treat <NUM> nodamage <NUM>"); |
| 2745 | 2752 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "break <NUM> newobj <NUM>"); |
| 2746 | 2753 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "bot nofight caution stop estop speed"); |
| @@ -2747,6 +2754,74 @@ | ||
| 2747 | 2754 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "ss clear"); |
| 2748 | 2755 | } |
| 2749 | 2756 | |
| 2757 | + //人の統計情報 | |
| 2758 | + if( strcmp(NewCommand, "human") == 0 ){ | |
| 2759 | + int alivemyfriend = 0; | |
| 2760 | + int myfriend = 0; | |
| 2761 | + int aliveenemy = 0; | |
| 2762 | + int enemy = 0; | |
| 2763 | + int myteamid; | |
| 2764 | + | |
| 2765 | + //プレイヤーのチーム番号を取得 | |
| 2766 | + ObjMgr.GetPlayerHumanObject()->GetParamData(NULL, NULL, NULL, &myteamid); | |
| 2767 | + | |
| 2768 | + for(int i=0; i<MAX_HUMAN; i++){ | |
| 2769 | + int teamid; | |
| 2770 | + bool deadflag; | |
| 2771 | + human *thuman = ObjMgr.GeHumanObject(i); | |
| 2772 | + if( thuman->GetEnableFlag() == true ){ | |
| 2773 | + //死亡状態とチーム番号を取得 | |
| 2774 | + deadflag = thuman->GetDeadFlag(); | |
| 2775 | + thuman->GetParamData(NULL, NULL, NULL, &teamid); | |
| 2776 | + | |
| 2777 | + //カウント | |
| 2778 | + if( teamid == myteamid ){ | |
| 2779 | + myfriend += 1; | |
| 2780 | + if( deadflag == false ){ alivemyfriend += 1; } | |
| 2781 | + } | |
| 2782 | + else{ | |
| 2783 | + enemy += 1; | |
| 2784 | + if( deadflag == false ){ aliveenemy += 1; } | |
| 2785 | + } | |
| 2786 | + } | |
| 2787 | + } | |
| 2788 | + | |
| 2789 | + sprintf(str, "Friend:%d/%d Enemy:%d/%d Total:%d/%d", | |
| 2790 | + alivemyfriend, myfriend, aliveenemy, enemy, alivemyfriend + aliveenemy, myfriend + enemy); | |
| 2791 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2792 | + } | |
| 2793 | + | |
| 2794 | + //暫定リザルト表示 | |
| 2795 | + if( strcmp(NewCommand, "result") == 0 ){ | |
| 2796 | + float rate; | |
| 2797 | + if( MainGameInfo.fire == 0 ){ | |
| 2798 | + rate = 0.0f; | |
| 2799 | + } | |
| 2800 | + else{ | |
| 2801 | + rate = (float)MainGameInfo.ontarget / MainGameInfo.fire * 100; | |
| 2802 | + } | |
| 2803 | + | |
| 2804 | + sprintf(str, "Time %02d:%02d / Fired %d / On target %d", framecnt/(int)GAMEFPS/60, framecnt/(int)GAMEFPS%60, MainGameInfo.fire, MainGameInfo.ontarget); | |
| 2805 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2806 | + sprintf(str, "AR rate %.1f%% / Kill %d / HS %d", rate, MainGameInfo.kill, MainGameInfo.headshot); | |
| 2807 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2808 | + } | |
| 2809 | + | |
| 2810 | + //イベントタスク表示 | |
| 2811 | + if( strcmp(NewCommand, "event") == 0 ){ | |
| 2812 | + for(int i=0; i<TOTAL_EVENTLINE; i++){ | |
| 2813 | + signed char p4 = Event[i].GetNextP4(); | |
| 2814 | + pointdata data; | |
| 2815 | + if( PointData.SearchPointdata(&data, 0x08, 0, 0, 0, p4, 0) == 0 ){ | |
| 2816 | + sprintf(str, "Event %d No task.", i); | |
| 2817 | + } | |
| 2818 | + else{ | |
| 2819 | + sprintf(str, "Event %d [%d][%d][%d][%d]", i, data.p1, data.p2, data.p3, data.p4); | |
| 2820 | + } | |
| 2821 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2822 | + } | |
| 2823 | + } | |
| 2824 | + | |
| 2750 | 2825 | //MIFの情報表示 |
| 2751 | 2826 | if( strcmp(NewCommand, "mif") == 0 ){ |
| 2752 | 2827 | bool AddonFlag = GameInfoData.selectaddon; |
| @@ -2825,72 +2900,113 @@ | ||
| 2825 | 2900 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); |
| 2826 | 2901 | } |
| 2827 | 2902 | |
| 2828 | - //人の統計情報 | |
| 2829 | - if( strcmp(NewCommand, "human") == 0 ){ | |
| 2830 | - int alivemyfriend = 0; | |
| 2831 | - int myfriend = 0; | |
| 2832 | - int aliveenemy = 0; | |
| 2833 | - int enemy = 0; | |
| 2834 | - int myteamid; | |
| 2903 | + //ブロックデータの情報 | |
| 2904 | + if( strcmp(NewCommand, "bd1") == 0 ){ | |
| 2905 | + bool AddonFlag = GameInfoData.selectaddon; | |
| 2906 | + int MissionID = GameInfoData.selectmission_id; | |
| 2907 | + char str2[MAX_PATH]; | |
| 2908 | + char str3[MAX_PATH]; | |
| 2909 | + char fname1[_MAX_PATH]; | |
| 2910 | + char fname2[_MAX_PATH]; | |
| 2911 | + char flagstr1[4]; | |
| 2912 | + char flagstr2[4]; | |
| 2835 | 2913 | |
| 2836 | - //プレイヤーのチーム番号を取得 | |
| 2837 | - ObjMgr.GetPlayerHumanObject()->GetParamData(NULL, NULL, NULL, &myteamid); | |
| 2914 | + //ファイル名表示 | |
| 2915 | + strcpy(str, "Filename : "); | |
| 2916 | + if( AddonFlag == true ){ | |
| 2917 | + MIFdata.GetDatafilePath(str2, str3); | |
| 2918 | + str2[(MAX_CONSOLELEN - strlen(str) - 1)] = '\0'; | |
| 2919 | + strcat(str, str2); | |
| 2920 | + } | |
| 2921 | + else{ | |
| 2922 | + GameParamInfo.GetOfficialMission(MissionID, NULL, NULL, str2, NULL, NULL); | |
| 2923 | + str2[(MAX_CONSOLELEN - strlen(str) - 8 - 1)] = '\0'; | |
| 2924 | + strcat(str, str2); | |
| 2925 | + strcat(str, OFFICIALMISSION_BD1); | |
| 2926 | + } | |
| 2927 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2838 | 2928 | |
| 2839 | - for(int i=0; i<MAX_HUMAN; i++){ | |
| 2840 | - int teamid; | |
| 2841 | - bool deadflag; | |
| 2842 | - human *thuman = ObjMgr.GeHumanObject(i); | |
| 2843 | - if( thuman->GetEnableFlag() == true ){ | |
| 2844 | - //死亡状態とチーム番号を取得 | |
| 2845 | - deadflag = thuman->GetDeadFlag(); | |
| 2846 | - thuman->GetParamData(NULL, NULL, NULL, &teamid); | |
| 2929 | + //合計ブロック数表示 | |
| 2930 | + sprintf(str, "TotalBlocks : %d", BlockData.GetTotaldatas()); | |
| 2931 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2847 | 2932 | |
| 2848 | - //カウント | |
| 2849 | - if( teamid == myteamid ){ | |
| 2850 | - myfriend += 1; | |
| 2851 | - if( deadflag == false ){ alivemyfriend += 1; } | |
| 2852 | - } | |
| 2853 | - else{ | |
| 2854 | - enemy += 1; | |
| 2855 | - if( deadflag == false ){ aliveenemy += 1; } | |
| 2856 | - } | |
| 2857 | - } | |
| 2933 | + //マップテクスチャの読み込み状況表示 | |
| 2934 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "Texture : "); | |
| 2935 | + for(int i=0; i<(TOTAL_BLOCKTEXTURE/2); i++){ | |
| 2936 | + //テクスチャIDを取得 | |
| 2937 | + BlockData.GetTexture(fname1, i); | |
| 2938 | + BlockData.GetTexture(fname2, i + (TOTAL_BLOCKTEXTURE/2)); | |
| 2939 | + | |
| 2940 | + //テクスチャが読み込まれているか判定 | |
| 2941 | + if( d3dg->GetMapTextureID(i) == -1 ){ strcpy(flagstr1, "NG"); } | |
| 2942 | + else{ strcpy(flagstr1, "OK"); } | |
| 2943 | + if( d3dg->GetMapTextureID(i + (TOTAL_BLOCKTEXTURE/2)) == -1 ){ strcpy(flagstr2, "NG"); } | |
| 2944 | + else{ strcpy(flagstr2, "OK"); } | |
| 2945 | + | |
| 2946 | + //表示 | |
| 2947 | + sprintf(str, " %02d_%s %-31s %02d_%s %s", i, flagstr1, fname1, i + (TOTAL_BLOCKTEXTURE/2), flagstr2, fname2); | |
| 2948 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2858 | 2949 | } |
| 2859 | - | |
| 2860 | - sprintf(str, "Friend:%d/%d Enemy:%d/%d Total:%d/%d", | |
| 2861 | - alivemyfriend, myfriend, aliveenemy, enemy, alivemyfriend + aliveenemy, myfriend + enemy); | |
| 2862 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2863 | 2950 | } |
| 2864 | 2951 | |
| 2865 | - //暫定リザルト表示 | |
| 2866 | - if( strcmp(NewCommand, "result") == 0 ){ | |
| 2867 | - float rate; | |
| 2868 | - if( MainGameInfo.fire == 0 ){ | |
| 2869 | - rate = 0.0f; | |
| 2952 | + //ポイントデータの情報 | |
| 2953 | + if( strcmp(NewCommand, "pd1") == 0 ){ | |
| 2954 | + bool AddonFlag = GameInfoData.selectaddon; | |
| 2955 | + int MissionID = GameInfoData.selectmission_id; | |
| 2956 | + char str2[MAX_PATH]; | |
| 2957 | + char str3[MAX_PATH]; | |
| 2958 | + pointdata pdata; | |
| 2959 | + int TotalPoints = PointData.GetTotaldatas(); | |
| 2960 | + int HumanPoints = 0; | |
| 2961 | + int WeaponPoints = 0; | |
| 2962 | + int OjectPoints = 0; | |
| 2963 | + int HumaninfoPoints = 0; | |
| 2964 | + int PathPoints = 0; | |
| 2965 | + int EventPoints = 0; | |
| 2966 | + | |
| 2967 | + //ファイル名表示 | |
| 2968 | + strcpy(str, "Filename : "); | |
| 2969 | + if( AddonFlag == true ){ | |
| 2970 | + MIFdata.GetDatafilePath(str3, str2); | |
| 2971 | + str2[(MAX_CONSOLELEN - strlen(str) - 1)] = '\0'; | |
| 2972 | + strcat(str, str2); | |
| 2870 | 2973 | } |
| 2871 | 2974 | else{ |
| 2872 | - rate = (float)MainGameInfo.ontarget / MainGameInfo.fire * 100; | |
| 2975 | + GameParamInfo.GetOfficialMission(MissionID, NULL, NULL, str2, str3, NULL); | |
| 2976 | + strcat(str2, str3); | |
| 2977 | + str2[(MAX_CONSOLELEN - strlen(str) - 4 - 1)] = '\0'; | |
| 2978 | + strcat(str, str2); | |
| 2979 | + strcat(str, ".pd1"); | |
| 2873 | 2980 | } |
| 2981 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2874 | 2982 | |
| 2875 | - sprintf(str, "Time %02d:%02d / Fired %d / On target %d", framecnt/(int)GAMEFPS/60, framecnt/(int)GAMEFPS%60, MainGameInfo.fire, MainGameInfo.ontarget); | |
| 2983 | + //合計ポイント数表示 | |
| 2984 | + sprintf(str, "TotalPoints : %d", TotalPoints); | |
| 2876 | 2985 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); |
| 2877 | - sprintf(str, "AR rate %.1f%% / Kill %d / HS %d", rate, MainGameInfo.kill, MainGameInfo.headshot); | |
| 2986 | + | |
| 2987 | + //各種ポイント数を数えて表示 | |
| 2988 | + for(int i=0; i<TotalPoints; i++){ | |
| 2989 | + if( PointData.Getdata(&pdata, i) != 0 ){ continue; } | |
| 2990 | + | |
| 2991 | + if( (pdata.p1 == 1)||(pdata.p1 == 6) ){ HumanPoints += 1; } | |
| 2992 | + if( (pdata.p1 == 2)||(pdata.p1 == 7) ){ WeaponPoints += 1; } | |
| 2993 | + if( pdata.p1 == 5 ){ OjectPoints += 1; } | |
| 2994 | + if( pdata.p1 == 4 ){ HumaninfoPoints += 1; } | |
| 2995 | + if( (pdata.p1 == 3)||(pdata.p1 == 8) ){ PathPoints += 1; } | |
| 2996 | + if( (10 <= pdata.p1)&&(pdata.p1 <= 19) ){ EventPoints += 1; } | |
| 2997 | + } | |
| 2998 | + sprintf(str, "HumanPoints : %-3d WeaponPoints : %-3d SmallOjectPoints : %-3d", HumanPoints, WeaponPoints, OjectPoints); | |
| 2878 | 2999 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); |
| 2879 | - } | |
| 3000 | + sprintf(str, "HumaninfoPoints : %-3d AIpathPoints : %-3d EventPoints : %-3d", HumaninfoPoints, PathPoints, EventPoints); | |
| 3001 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2880 | 3002 | |
| 2881 | - //イベントタスク表示 | |
| 2882 | - if( strcmp(NewCommand, "event") == 0 ){ | |
| 2883 | - for(int i=0; i<TOTAL_EVENTLINE; i++){ | |
| 2884 | - signed char p4 = Event[i].GetNextP4(); | |
| 2885 | - pointdata data; | |
| 2886 | - if( PointData.SearchPointdata(&data, 0x08, 0, 0, 0, p4, 0) == 0 ){ | |
| 2887 | - sprintf(str, "Event %d No task.", i); | |
| 2888 | - } | |
| 2889 | - else{ | |
| 2890 | - sprintf(str, "Event %d [%d][%d][%d][%d]", i, data.p1, data.p2, data.p3, data.p4); | |
| 2891 | - } | |
| 2892 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2893 | - } | |
| 3003 | + //無効なポイント数を逆算で求める | |
| 3004 | + sprintf(str, "InvalidPoints : %d", TotalPoints - (HumanPoints + WeaponPoints + OjectPoints + HumaninfoPoints + PathPoints + EventPoints)); | |
| 3005 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3006 | + | |
| 3007 | + //人のテクスチャ数を取得 | |
| 3008 | + sprintf(str, "HumanTextures : %d/%d", Resource.GetHumanTextures(), MAX_LOADHUMANTEXTURE); | |
| 3009 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 2894 | 3010 | } |
| 2895 | 3011 | |
| 2896 | 3012 | //デバック用文字の表示 |
| @@ -3003,6 +3119,20 @@ | ||
| 3003 | 3119 | } |
| 3004 | 3120 | } |
| 3005 | 3121 | |
| 3122 | + //背景空の変更 | |
| 3123 | + if( GetCommandNum("sky", &id) == true ){ | |
| 3124 | + if( (0 <= id)&&(id <= 5) ){ | |
| 3125 | + SkyNumber = id; | |
| 3126 | + | |
| 3127 | + //リソース再構築 | |
| 3128 | + Resource.CleanupSkyModelTexture(); | |
| 3129 | + Resource.LoadSkyModelTexture(SkyNumber); | |
| 3130 | + | |
| 3131 | + sprintf(str, "Select SkyNumber %d.", id); | |
| 3132 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3133 | + } | |
| 3134 | + } | |
| 3135 | + | |
| 3006 | 3136 | //全ての死者を蘇生する |
| 3007 | 3137 | if( strcmp(NewCommand, "revive") == 0 ){ |
| 3008 | 3138 | for(int i=0; i<MAX_HUMAN; i++){ |
| @@ -158,6 +158,7 @@ | ||
| 158 | 158 | class maingame : public D3Dscene |
| 159 | 159 | { |
| 160 | 160 | //class EventControl Event[TOTAL_EVENTLINE]; //!< イベント制御クラス |
| 161 | + int SkyNumber; //!< 背景空番号 | |
| 161 | 162 | float mouse_rx; //!< マウスによる水平軸角度 |
| 162 | 163 | float mouse_ry; //!< マウスによる垂直軸角度 |
| 163 | 164 | float view_rx; //!< マウス角度とカメラ角度の差(水平軸) |
| @@ -267,6 +267,21 @@ | ||
| 267 | 267 | return -1; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | +//! @brief 読み込んでいる人のテクスチャ数を取得 | |
| 271 | +//! @return テクスチャ数(最大 MAX_LOADHUMANTEXTURE) | |
| 272 | +int ResourceManager::GetHumanTextures() | |
| 273 | +{ | |
| 274 | + int Textures = 0; | |
| 275 | + | |
| 276 | + for(int i=0; i<MAX_LOADHUMANTEXTURE; i++){ | |
| 277 | + if( human_texture_Param[i] != -1 ){ | |
| 278 | + Textures += 1; | |
| 279 | + } | |
| 280 | + } | |
| 281 | + | |
| 282 | + return Textures; | |
| 283 | +} | |
| 284 | + | |
| 270 | 285 | //! @brief 人のテクスチャ番号を取得 |
| 271 | 286 | //! @param id 人の種類ID |
| 272 | 287 | //! @return 成功:テクスチャID 失敗:-1 |
| @@ -95,6 +95,7 @@ | ||
| 95 | 95 | void GetHumanModel(int out_upmodel[], int out_armmodel[], int *legmodel, int out_walkmodel[], int out_runmodel[]); |
| 96 | 96 | void CleanupHumanModel(); |
| 97 | 97 | int AddHumanTexture(int id); |
| 98 | + int GetHumanTextures(); | |
| 98 | 99 | int GetHumanTexture(int id); |
| 99 | 100 | void CleanupHumanTexture(); |
| 100 | 101 | int LoadWeaponModelTexture(); |