X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 213 (tree) |
|---|---|
| Time | 2018-12-01 15:28:38 |
| Author | |
コンソールのコマンドを1個追加(ailevel)、コンソールのaiinfo・nodamageコマンドの仕様変更。
| @@ -1730,6 +1730,35 @@ | ||
| 1730 | 1730 | MoveNavi->MovePathNowState(); |
| 1731 | 1731 | } |
| 1732 | 1732 | |
| 1733 | +//! @brief AIレベルを設定 | |
| 1734 | +//! @param level AIレベル | |
| 1735 | +void AIcontrol::SetAIlevel(int level) | |
| 1736 | +{ | |
| 1737 | + if( (level < -1)||(TOTAL_PARAMETERINFO_AILEVEL <= level) ){ return; } | |
| 1738 | + | |
| 1739 | + if( level == -1 ){ | |
| 1740 | + //AIレベルを取得 | |
| 1741 | + int paramid; | |
| 1742 | + HumanParameter paramdata; | |
| 1743 | + ctrlhuman->GetParamData(¶mid, NULL, NULL, NULL); | |
| 1744 | + Param->GetHuman(paramid, ¶mdata); | |
| 1745 | + AIlevel = paramdata.AIlevel; | |
| 1746 | + } | |
| 1747 | + else{ | |
| 1748 | + AIlevel = level; | |
| 1749 | + } | |
| 1750 | + | |
| 1751 | + //設定値を取得 | |
| 1752 | + Param->GetAIlevel(AIlevel, &LevelParam); | |
| 1753 | +} | |
| 1754 | + | |
| 1755 | +//! @brief AIレベルを取得 | |
| 1756 | +//! @return AIレベル | |
| 1757 | +int AIcontrol::GetAIlevel() | |
| 1758 | +{ | |
| 1759 | + return AIlevel; | |
| 1760 | +} | |
| 1761 | + | |
| 1733 | 1762 | //! @brief 指定した場所へ待機させる |
| 1734 | 1763 | //! @param px X座標 |
| 1735 | 1764 | //! @param pz Z座標 |
| @@ -119,6 +119,8 @@ | ||
| 119 | 119 | ~AIcontrol(); |
| 120 | 120 | void SetClass(class ObjectManager *in_ObjMgr, int in_ctrlid, class BlockDataInterface *in_blocks, class PointDataInterface *in_Points, class ParameterInfo *in_Param, class Collision *in_CollD, class SoundManager *in_GameSound); |
| 121 | 121 | void Init(); |
| 122 | + void SetAIlevel(int level); | |
| 123 | + int GetAIlevel(); | |
| 122 | 124 | void SetHoldWait(float px, float pz, float rx); |
| 123 | 125 | void SetHoldTracking(int id); |
| 124 | 126 | void SetCautionMode(); |
| @@ -2446,6 +2446,7 @@ | ||
| 2446 | 2446 | int hp; |
| 2447 | 2447 | char modestr[32]; |
| 2448 | 2448 | int EnemyID; |
| 2449 | + int AIlevel; | |
| 2449 | 2450 | float mposx, mposz; |
| 2450 | 2451 | int movemode; |
| 2451 | 2452 | pointdata ppdata; |
| @@ -2453,6 +2454,7 @@ | ||
| 2453 | 2454 | hp = ObjMgr.GetHumanObject(AIdebuginfoID)->GetHP(); |
| 2454 | 2455 | HumanAI[AIdebuginfoID].GetBattleMode(NULL, modestr); |
| 2455 | 2456 | EnemyID = HumanAI[AIdebuginfoID].GetEnemyHumanID(); |
| 2457 | + AIlevel = HumanAI[AIdebuginfoID].GetAIlevel(); | |
| 2456 | 2458 | HumanAI[AIdebuginfoID].GetMoveTargetPos(&mposx, &mposz, &movemode); |
| 2457 | 2459 | HumanAI[AIdebuginfoID].GetPathPointData(&ppdata); |
| 2458 | 2460 |
| @@ -2462,7 +2464,7 @@ | ||
| 2462 | 2464 | sprintf(str, "(X:%.2f Y:%.2f Z:%.2f RX:%.2f HP:%d)", posx, posy, posz, rx, hp); |
| 2463 | 2465 | d3dg->Draw2DTextureDebugFontText(20 +1, 150 +1, str, d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f)); |
| 2464 | 2466 | d3dg->Draw2DTextureDebugFontText(20, 150, str, d3dg->GetColorCode(1.0f,1.0f,0.0f,1.0f)); |
| 2465 | - sprintf(str, "Mode:%s TargetEnemyID:%d", modestr, EnemyID); | |
| 2467 | + sprintf(str, "Mode:%s TargetEnemyID:%d AIlevel:%d", modestr, EnemyID, AIlevel); | |
| 2466 | 2468 | d3dg->Draw2DTextureDebugFontText(20 +1, 170 +1, str, d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f)); |
| 2467 | 2469 | d3dg->Draw2DTextureDebugFontText(20, 170, str, d3dg->GetColorCode(1.0f,1.0f,0.0f,1.0f)); |
| 2468 | 2470 | sprintf(str, "PointPath:[%d][%d][%d][%d]", ppdata.p1, ppdata.p2, ppdata.p3, ppdata.p4); |
| @@ -2881,8 +2883,8 @@ | ||
| 2881 | 2883 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "tag radar inmap sky <NUM> dark"); |
| 2882 | 2884 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "ff revive kill <NUM> treat <NUM> nodamage <NUM>"); |
| 2883 | 2885 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "newobj <NUM> break <NUM> delhuman <NUM> delweapon <NUM> delobj <NUL>"); |
| 2884 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "bot nofight caution stop estop speed"); | |
| 2885 | - AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "window ss clear exit"); | |
| 2886 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "nofight caution ailevel <NUM> bot stop estop"); | |
| 2887 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "speed window ss clear exit"); | |
| 2886 | 2888 | } |
| 2887 | 2889 | |
| 2888 | 2890 | //人の統計情報 |
| @@ -3345,6 +3347,13 @@ | ||
| 3345 | 3347 | } |
| 3346 | 3348 | } |
| 3347 | 3349 | } |
| 3350 | + else if( strcmp(NewCommand, "aiinfo") == 0 ){ | |
| 3351 | + if( AIdebuginfoID != -1 ){ | |
| 3352 | + //人が指定されていたら、無効化 | |
| 3353 | + AIdebuginfoID = -1; | |
| 3354 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "Disable AI Debug information."); | |
| 3355 | + } | |
| 3356 | + } | |
| 3348 | 3357 | |
| 3349 | 3358 | //オブジェクトのタグを表示 |
| 3350 | 3359 | if( strcmp(NewCommand, "tag") == 0 ){ |
| @@ -3488,6 +3497,15 @@ | ||
| 3488 | 3497 | } |
| 3489 | 3498 | } |
| 3490 | 3499 | } |
| 3500 | + else if( strcmp(NewCommand, "nodamage") == 0 ){ | |
| 3501 | + if( InvincibleID != -1 ){ | |
| 3502 | + //人が指定されていたら、無効化 | |
| 3503 | + ObjMgr.GetHumanObject(InvincibleID)->SetInvincibleFlag(false); | |
| 3504 | + sprintf(str, "Not invincible Human[%d].", InvincibleID); | |
| 3505 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3506 | + InvincibleID = -1; | |
| 3507 | + } | |
| 3508 | + } | |
| 3491 | 3509 | |
| 3492 | 3510 | //殺害 |
| 3493 | 3511 | if( GetCommandNum("kill", &id) == true ){ |
| @@ -3645,6 +3663,32 @@ | ||
| 3645 | 3663 | AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "Set cautious AI."); |
| 3646 | 3664 | } |
| 3647 | 3665 | |
| 3666 | + //AIレベル設定 | |
| 3667 | + if( GetCommandNum("ailevel", &id) == true ){ | |
| 3668 | + if( id == -1 ){ | |
| 3669 | + //AIレベルをデフォルト値へ戻す | |
| 3670 | + for(int i=0; i<MAX_HUMAN; i++){ | |
| 3671 | + HumanAI[i].SetAIlevel(-1); | |
| 3672 | + } | |
| 3673 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "Set all human AI-level to default."); | |
| 3674 | + } | |
| 3675 | + if( (0 <= id)&&(id < TOTAL_PARAMETERINFO_AILEVEL) ){ | |
| 3676 | + //AIレベルを指定値へ上書き | |
| 3677 | + for(int i=0; i<MAX_HUMAN; i++){ | |
| 3678 | + HumanAI[i].SetAIlevel(id); | |
| 3679 | + } | |
| 3680 | + sprintf(str, "Set all human to AI-level [%d].", id); | |
| 3681 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), str); | |
| 3682 | + } | |
| 3683 | + } | |
| 3684 | + else if( strcmp(NewCommand, "ailevel") == 0 ){ | |
| 3685 | + //AIレベルをデフォルト値へ戻す | |
| 3686 | + for(int i=0; i<MAX_HUMAN; i++){ | |
| 3687 | + HumanAI[i].SetAIlevel(-1); | |
| 3688 | + } | |
| 3689 | + AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "Set all human AI-level to default."); | |
| 3690 | + } | |
| 3691 | + | |
| 3648 | 3692 | //AIの処理を停止 |
| 3649 | 3693 | if( strcmp(NewCommand, "stop") == 0 ){ |
| 3650 | 3694 | if( AIstop == false ){ |