X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 154 (tree) |
|---|---|
| Time | 2016-10-15 20:13:42 |
| Author | |
ミッション開始時に人の座標と向きをランダム補正するように
| @@ -140,9 +140,10 @@ | ||
| 140 | 140 | //! @brief 人追加 |
| 141 | 141 | //! @param data 人のポイントデータ (pointdata構造体) |
| 142 | 142 | //! @param infodata 参照する人情報のポイントデータ (〃) |
| 143 | +//! @param RandomFlag ランダム補正を有効にする | |
| 143 | 144 | //! @return 成功:データ番号(0以上) 失敗:-1 |
| 144 | 145 | //! @attention 無効な人の種類番号が指定された場合は 通称:謎人間 が登場します。テクスチャはマップテクスチャ0番が使用され、HPは 0 が指定(=即死)されます。 |
| 145 | -int ObjectManager::AddHumanIndex(pointdata data, pointdata infodata) | |
| 146 | +int ObjectManager::AddHumanIndex(pointdata data, pointdata infodata, bool RandomFlag) | |
| 146 | 147 | { |
| 147 | 148 | int GetHumanFlag; |
| 148 | 149 | HumanParameter HumanParam; |
| @@ -168,10 +169,20 @@ | ||
| 168 | 169 | int runmodel[TOTAL_RUNMODE]; |
| 169 | 170 | Resource->GetHumanModel(upmodel, armmodel, &legmodel, walkmodel, runmodel); |
| 170 | 171 | |
| 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 | + | |
| 171 | 182 | for(int j=0; j<MAX_HUMAN; j++){ |
| 172 | 183 | if( HumanIndex[j].GetEnableFlag() == false ){ |
| 173 | 184 | //初期化する |
| 174 | - HumanIndex[j].SetPosData(data.x, data.y, data.z, data.r); | |
| 185 | + HumanIndex[j].SetPosData(px, py, pz, rx); | |
| 175 | 186 | HumanIndex[j].SetParamData(infodata.p2, data.id, data.p4, infodata.p3, true); |
| 176 | 187 | if( GetHumanFlag == 0 ){ |
| 177 | 188 | int id = Resource->GetHumanTexture(infodata.p2); |
| @@ -1376,7 +1387,7 @@ | ||
| 1376 | 1387 | Resource->AddHumanTexture(humaninfodata.p2); |
| 1377 | 1388 | |
| 1378 | 1389 | //人として追加 |
| 1379 | - AddHumanIndex(data, humaninfodata); | |
| 1390 | + AddHumanIndex(data, humaninfodata, true); | |
| 1380 | 1391 | } |
| 1381 | 1392 | } |
| 1382 | 1393 |
| @@ -99,7 +99,7 @@ | ||
| 99 | 99 | SoundManager *GameSound; //!< ゲーム効果音管理クラス |
| 100 | 100 | MIFInterface *MIFdata; //!< MIFコントロールクラス |
| 101 | 101 | |
| 102 | - int AddHumanIndex(pointdata data, pointdata infodata); | |
| 102 | + int AddHumanIndex(pointdata data, pointdata infodata, bool RandomFlag); | |
| 103 | 103 | int AddWeaponIndex(pointdata data); |
| 104 | 104 | int AddSmallObjectIndex(pointdata data); |
| 105 | 105 | void SetHumanBlood(float x, float y, float z, int damage, bool CollideMap); |