• 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

Revision213 (tree)
Time2018-12-01 15:28:38
Authorxops-mikan

Log Message

コンソールのコマンドを1個追加(ailevel)、コンソールのaiinfo・nodamageコマンドの仕様変更。

Change Summary

Incremental Difference

--- trunk/ai.cpp (revision 212)
+++ trunk/ai.cpp (revision 213)
@@ -1730,6 +1730,35 @@
17301730 MoveNavi->MovePathNowState();
17311731 }
17321732
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(&paramid, NULL, NULL, NULL);
1744+ Param->GetHuman(paramid, &paramdata);
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+
17331762 //! @brief 指定した場所へ待機させる
17341763 //! @param px X座標
17351764 //! @param pz Z座標
--- trunk/ai.h (revision 212)
+++ trunk/ai.h (revision 213)
@@ -119,6 +119,8 @@
119119 ~AIcontrol();
120120 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);
121121 void Init();
122+ void SetAIlevel(int level);
123+ int GetAIlevel();
122124 void SetHoldWait(float px, float pz, float rx);
123125 void SetHoldTracking(int id);
124126 void SetCautionMode();
--- trunk/gamemain.cpp (revision 212)
+++ trunk/gamemain.cpp (revision 213)
@@ -2446,6 +2446,7 @@
24462446 int hp;
24472447 char modestr[32];
24482448 int EnemyID;
2449+ int AIlevel;
24492450 float mposx, mposz;
24502451 int movemode;
24512452 pointdata ppdata;
@@ -2453,6 +2454,7 @@
24532454 hp = ObjMgr.GetHumanObject(AIdebuginfoID)->GetHP();
24542455 HumanAI[AIdebuginfoID].GetBattleMode(NULL, modestr);
24552456 EnemyID = HumanAI[AIdebuginfoID].GetEnemyHumanID();
2457+ AIlevel = HumanAI[AIdebuginfoID].GetAIlevel();
24562458 HumanAI[AIdebuginfoID].GetMoveTargetPos(&mposx, &mposz, &movemode);
24572459 HumanAI[AIdebuginfoID].GetPathPointData(&ppdata);
24582460
@@ -2462,7 +2464,7 @@
24622464 sprintf(str, "(X:%.2f Y:%.2f Z:%.2f RX:%.2f HP:%d)", posx, posy, posz, rx, hp);
24632465 d3dg->Draw2DTextureDebugFontText(20 +1, 150 +1, str, d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f));
24642466 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);
24662468 d3dg->Draw2DTextureDebugFontText(20 +1, 170 +1, str, d3dg->GetColorCode(0.0f,0.0f,0.0f,1.0f));
24672469 d3dg->Draw2DTextureDebugFontText(20, 170, str, d3dg->GetColorCode(1.0f,1.0f,0.0f,1.0f));
24682470 sprintf(str, "PointPath:[%d][%d][%d][%d]", ppdata.p1, ppdata.p2, ppdata.p3, ppdata.p4);
@@ -2881,8 +2883,8 @@
28812883 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "tag radar inmap sky <NUM> dark");
28822884 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "ff revive kill <NUM> treat <NUM> nodamage <NUM>");
28832885 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");
28862888 }
28872889
28882890 //人の統計情報
@@ -3345,6 +3347,13 @@
33453347 }
33463348 }
33473349 }
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+ }
33483357
33493358 //オブジェクトのタグを表示
33503359 if( strcmp(NewCommand, "tag") == 0 ){
@@ -3488,6 +3497,15 @@
34883497 }
34893498 }
34903499 }
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+ }
34913509
34923510 //殺害
34933511 if( GetCommandNum("kill", &id) == true ){
@@ -3645,6 +3663,32 @@
36453663 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "Set cautious AI.");
36463664 }
36473665
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+
36483692 //AIの処理を停止
36493693 if( strcmp(NewCommand, "stop") == 0 ){
36503694 if( AIstop == false ){