• 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

Revision154 (tree)
Time2016-10-15 20:13:42
Authorxops-mikan

Log Message

ミッション開始時に人の座標と向きをランダム補正するように

Change Summary

Incremental Difference

--- trunk/objectmanager.cpp (revision 153)
+++ trunk/objectmanager.cpp (revision 154)
@@ -140,9 +140,10 @@
140140 //! @brief 人追加
141141 //! @param data 人のポイントデータ (pointdata構造体)
142142 //! @param infodata 参照する人情報のポイントデータ (〃)
143+//! @param RandomFlag ランダム補正を有効にする
143144 //! @return 成功:データ番号(0以上) 失敗:-1
144145 //! @attention 無効な人の種類番号が指定された場合は 通称:謎人間 が登場します。テクスチャはマップテクスチャ0番が使用され、HPは 0 が指定(=即死)されます。
145-int ObjectManager::AddHumanIndex(pointdata data, pointdata infodata)
146+int ObjectManager::AddHumanIndex(pointdata data, pointdata infodata, bool RandomFlag)
146147 {
147148 int GetHumanFlag;
148149 HumanParameter HumanParam;
@@ -168,10 +169,20 @@
168169 int runmodel[TOTAL_RUNMODE];
169170 Resource->GetHumanModel(upmodel, armmodel, &legmodel, walkmodel, runmodel);
170171
172+ float px = data.x;
173+ float py = data.y;
174+ float pz = data.z;
175+ float rx = data.r;
176+ if( RandomFlag == true ){
177+ px += 0.001f*GetRand(100*2) - 0.1f;
178+ pz += 0.001f*GetRand(100*2) - 0.1f;
179+ rx += DegreeToRadian(0.01f)*GetRand(80*2) - DegreeToRadian(0.8f);
180+ }
181+
171182 for(int j=0; j<MAX_HUMAN; j++){
172183 if( HumanIndex[j].GetEnableFlag() == false ){
173184 //初期化する
174- HumanIndex[j].SetPosData(data.x, data.y, data.z, data.r);
185+ HumanIndex[j].SetPosData(px, py, pz, rx);
175186 HumanIndex[j].SetParamData(infodata.p2, data.id, data.p4, infodata.p3, true);
176187 if( GetHumanFlag == 0 ){
177188 int id = Resource->GetHumanTexture(infodata.p2);
@@ -1376,7 +1387,7 @@
13761387 Resource->AddHumanTexture(humaninfodata.p2);
13771388
13781389 //人として追加
1379- AddHumanIndex(data, humaninfodata);
1390+ AddHumanIndex(data, humaninfodata, true);
13801391 }
13811392 }
13821393
--- trunk/objectmanager.h (revision 153)
+++ trunk/objectmanager.h (revision 154)
@@ -99,7 +99,7 @@
9999 SoundManager *GameSound; //!< ゲーム効果音管理クラス
100100 MIFInterface *MIFdata; //!< MIFコントロールクラス
101101
102- int AddHumanIndex(pointdata data, pointdata infodata);
102+ int AddHumanIndex(pointdata data, pointdata infodata, bool RandomFlag);
103103 int AddWeaponIndex(pointdata data);
104104 int AddSmallObjectIndex(pointdata data);
105105 void SetHumanBlood(float x, float y, float z, int damage, bool CollideMap);