X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。
| Revision | 238 (tree) |
|---|---|
| Time | 2020-04-07 02:09:10 |
| Author | |
エフェクト処理全般を、独自の計算処理から本家XOPS同等の計算処理へ置き換え。
| @@ -2679,19 +2679,28 @@ | ||
| 2679 | 2679 | } |
| 2680 | 2680 | |
| 2681 | 2681 | //! @brief コンストラクタ |
| 2682 | -effect::effect(float x, float y, float z, float size, float rotation, int count, int texture, int settype) | |
| 2682 | +effect::effect(float x, float y, float z, float size, float rotation, int texture, int count) | |
| 2683 | 2683 | { |
| 2684 | 2684 | pos_x = x; |
| 2685 | 2685 | pos_y = y; |
| 2686 | 2686 | pos_z = z; |
| 2687 | - model_size = size; | |
| 2687 | + move_x = 0.0f; | |
| 2688 | + move_y = 0.0f; | |
| 2689 | + move_z = 0.0f; | |
| 2690 | + addmove_y = 0.0f; | |
| 2688 | 2691 | rotation_x = 0.0f; |
| 2689 | 2692 | rotation_y = 0.0f; |
| 2690 | 2693 | rotation_texture = rotation; |
| 2694 | + addrotation_texture = 0.0f; | |
| 2695 | + model_size = size; | |
| 2696 | + addmodel_size = 0.0f; | |
| 2697 | + id_texture = texture; | |
| 2698 | + brightness = 0; | |
| 2699 | + addbrightness = 0; | |
| 2700 | + alpha = 1.0f; | |
| 2701 | + add_alpha = 0.0f; | |
| 2691 | 2702 | cnt = count; |
| 2692 | - setcnt = count; | |
| 2693 | - id_texture = texture; | |
| 2694 | - type = settype; | |
| 2703 | + type = EFFECT_NORMAL; | |
| 2695 | 2704 | if( cnt > 0 ){ |
| 2696 | 2705 | EnableFlag = true; |
| 2697 | 2706 | } |
| @@ -2698,7 +2707,6 @@ | ||
| 2698 | 2707 | else{ |
| 2699 | 2708 | EnableFlag = false; |
| 2700 | 2709 | } |
| 2701 | - alpha = 1.0f; | |
| 2702 | 2710 | } |
| 2703 | 2711 | |
| 2704 | 2712 | //! @brief ディストラクタ |
| @@ -2709,36 +2717,42 @@ | ||
| 2709 | 2717 | //! @param in_move_x X軸移動量 |
| 2710 | 2718 | //! @param in_move_y Y軸移動量 |
| 2711 | 2719 | //! @param in_move_z Z軸移動量 |
| 2720 | +//! @param in_addmove_y Y軸移動量の加算量 | |
| 2721 | +//! @param rotation 回転角度 | |
| 2722 | +//! @param addrotation 回転角度の加算量 | |
| 2712 | 2723 | //! @param size 描画倍率 |
| 2713 | -//! @param rotation 回転角度 | |
| 2714 | -//! @param count 描画フレーム数 | |
| 2715 | -//! @param texture テクスチャの認識番号 | |
| 2724 | +//! @param addsize 描画倍率 | |
| 2725 | +//! @param count カウント | |
| 2716 | 2726 | //! @param settype エフェクトの種類 (Effect_Type を組み合せる) |
| 2717 | -//! @param init オブジェクトを初期化 | |
| 2718 | -void effect::SetParamData(float in_move_x, float in_move_y, float in_move_z, float size, float rotation, int count, int texture, int settype, bool init) | |
| 2727 | +void effect::SetParamData(float in_move_x, float in_move_y, float in_move_z, float in_addmove_y, float rotation, float addrotation, float size, float addsize, int count, int settype) | |
| 2719 | 2728 | { |
| 2720 | 2729 | move_x = in_move_x; |
| 2721 | 2730 | move_y = in_move_y; |
| 2722 | 2731 | move_z = in_move_z; |
| 2732 | + addmove_y = in_addmove_y; | |
| 2733 | + rotation_x = addrotation; | |
| 2734 | + rotation_y = 0.0f; | |
| 2735 | + rotation_texture = rotation; | |
| 2736 | + addrotation_texture = addrotation; | |
| 2723 | 2737 | model_size = size; |
| 2724 | - rotation_texture = rotation; | |
| 2738 | + addmodel_size = addsize; | |
| 2725 | 2739 | cnt = count; |
| 2726 | - setcnt = count; | |
| 2727 | - id_texture = texture; | |
| 2728 | 2740 | type = settype; |
| 2741 | +} | |
| 2729 | 2742 | |
| 2730 | - if( type & EFFECT_TRANSLUCENT ){ | |
| 2731 | - set_alpha = 0.5f; | |
| 2732 | - } | |
| 2733 | - else{ | |
| 2734 | - set_alpha = 1.0f; | |
| 2735 | - } | |
| 2736 | - alpha = set_alpha; | |
| 2737 | - | |
| 2738 | - if( init == true ){ | |
| 2739 | - rotation_x = 0.0f; | |
| 2740 | - rotation_y = 0.0f; | |
| 2741 | - } | |
| 2743 | +//! @brief テクスチャを設定 | |
| 2744 | +//! @param id テクスチャ認識番号 | |
| 2745 | +//! @param in_brightness 明るさ | |
| 2746 | +//! @param in_addbrightness 明るさの加算量 | |
| 2747 | +//! @param in_alpha 透明度 | |
| 2748 | +//! @param in_addalpha 透明度の加算量 | |
| 2749 | +void effect::SetTexture(int id, int in_brightness, int in_addbrightness, float in_alpha, float in_addalpha) | |
| 2750 | +{ | |
| 2751 | + id_texture = id; | |
| 2752 | + brightness = in_brightness; | |
| 2753 | + addbrightness = in_addbrightness; | |
| 2754 | + alpha = in_alpha; | |
| 2755 | + add_alpha = in_addalpha; | |
| 2742 | 2756 | } |
| 2743 | 2757 | |
| 2744 | 2758 | //! @brief 横軸と縦軸の向きを設定 |
| @@ -2789,7 +2803,7 @@ | ||
| 2789 | 2803 | //初期化されていなければ処理しない |
| 2790 | 2804 | if( EnableFlag == false ){ return 0; } |
| 2791 | 2805 | |
| 2792 | - //カウントが終了したら、処理しないように設定 | |
| 2806 | + //カウントが終了していれば、処理しないように設定 | |
| 2793 | 2807 | if( cnt <= 0 ){ |
| 2794 | 2808 | EnableFlag = false; |
| 2795 | 2809 | return 2; |
| @@ -2805,33 +2819,29 @@ | ||
| 2805 | 2819 | pos_x += move_x; |
| 2806 | 2820 | pos_y += move_y; |
| 2807 | 2821 | pos_z += move_z; |
| 2822 | + move_y += addmove_y; | |
| 2808 | 2823 | |
| 2809 | - //特殊処理を実行 | |
| 2810 | - if( type & EFFECT_DISAPPEAR ){ //消す | |
| 2811 | - alpha -= set_alpha/setcnt; | |
| 2824 | + //回転 | |
| 2825 | + rotation_texture += addrotation_texture; | |
| 2826 | + | |
| 2827 | + //拡大 | |
| 2828 | + model_size += addmodel_size; | |
| 2829 | + | |
| 2830 | + //明るさと透明度 | |
| 2831 | + brightness += addbrightness; | |
| 2832 | + alpha += add_alpha; | |
| 2833 | + | |
| 2834 | + //透明度がマイナスになったら、処理しないように設定 | |
| 2835 | + if( alpha <= 0.0f ){ | |
| 2836 | + EnableFlag = false; | |
| 2837 | + cnt = 0; | |
| 2838 | + return 2; | |
| 2812 | 2839 | } |
| 2813 | - if( type & EFFECT_DISAPPEARHALF ){ //半分の時間で消す | |
| 2814 | - if( setcnt/2 > cnt ){ | |
| 2815 | - alpha -= set_alpha/(setcnt/2); | |
| 2816 | - } | |
| 2840 | + | |
| 2841 | + //カウントが 255 未満ならば、カウントを 1 引く | |
| 2842 | + if( cnt < 255 ){ | |
| 2843 | + cnt -= 1; | |
| 2817 | 2844 | } |
| 2818 | - if( type & EFFECT_MAGNIFY ){ //拡大 | |
| 2819 | - model_size += model_size/50; | |
| 2820 | - } | |
| 2821 | - if( type & EFFECT_ROTATION ){ //回転 | |
| 2822 | - if( rotation_texture > 0.0f ){ | |
| 2823 | - rotation_texture += DegreeToRadian(1); | |
| 2824 | - } | |
| 2825 | - else{ | |
| 2826 | - rotation_texture -= DegreeToRadian(1); | |
| 2827 | - } | |
| 2828 | - } | |
| 2829 | - if( type & EFFECT_FALL ){ //落下 | |
| 2830 | - move_y = (move_y - 0.17f) * 0.98f; | |
| 2831 | - } | |
| 2832 | - | |
| 2833 | - //カウントを 1 引く | |
| 2834 | - cnt -= 1; | |
| 2835 | 2845 | return 1; |
| 2836 | 2846 | } |
| 2837 | 2847 |
| @@ -326,21 +326,26 @@ | ||
| 326 | 326 | class effect : public object |
| 327 | 327 | { |
| 328 | 328 | protected: |
| 329 | - int type; //!< 種類 | |
| 330 | - float rotation_y; //!< 回転角度 | |
| 331 | 329 | float move_x; //!< X軸移動量 |
| 332 | 330 | float move_y; //!< Y軸移動量 |
| 333 | 331 | float move_z; //!< Z軸移動量 |
| 334 | - float rotation_texture; //!< 回転角度 | |
| 335 | - float alpha; //!< 透明度 | |
| 336 | - float set_alpha; //!< スタート時の透明度 | |
| 332 | + float addmove_y; //!< Y軸移動量の加算量 | |
| 333 | + float rotation_y; //!< 回転角度 | |
| 334 | + float rotation_texture; //!< 回転角度 | |
| 335 | + float addrotation_texture; //!< 回転角度の加算量 | |
| 336 | + float addmodel_size; //!< 描画サイズ | |
| 337 | + int brightness; //!< 明るさ | |
| 338 | + int addbrightness; //!< 明るさの加算量 | |
| 339 | + float alpha; //!< 透明度 | |
| 340 | + float add_alpha; //!< 透明度の加算量 | |
| 337 | 341 | int cnt; //!< カウント |
| 338 | - int setcnt; //!< 設定されたカウント | |
| 342 | + int type; //!< 種類 | |
| 339 | 343 | |
| 340 | 344 | public: |
| 341 | - effect(float x = 0.0f, float y = 0.0f, float z = 0.0f, float size = 1.0f, float rotation = 0.0f, int count = 0, int texture = 0, int settype = 0); | |
| 345 | + effect(float x = 0.0f, float y = 0.0f, float z = 0.0f, float size = 1.0f, float rotation = 0.0f, int texture = -1, int count = 0); | |
| 342 | 346 | ~effect(); |
| 343 | - virtual void SetParamData(float in_move_x, float in_move_y, float in_move_z, float size, float rotation, int count, int texture, int settype, bool init); | |
| 347 | + virtual void SetParamData(float in_move_x, float in_move_y, float in_move_z, float in_addmove_y, float rotation, float addrotation, float size, float addsize, int count, int settype); | |
| 348 | + virtual void SetTexture(int id, int in_brightness, int in_addbrightness, float in_alpha, float in_addalpha); | |
| 344 | 349 | virtual void SetRxRy(float rx, float ry); |
| 345 | 350 | virtual int GetTextureID(); |
| 346 | 351 | virtual void GetMove(float *mx, float *my, float *mz); |
| @@ -404,14 +409,8 @@ | ||
| 404 | 409 | //! エフェクトの種類を表す定数 |
| 405 | 410 | enum Effect_Type { |
| 406 | 411 | EFFECT_NORMAL = 0x00, //!< ノーマル |
| 407 | - EFFECT_DISAPPEAR = 0x01, //!< 消す | |
| 408 | - EFFECT_DISAPPEARHALF = 0x02, //!< 半分の時間で消す | |
| 409 | - EFFECT_TRANSLUCENT = 0x04, //!< 半透明 | |
| 410 | - EFFECT_MAGNIFY = 0x08, //!< 拡大 | |
| 411 | - EFFECT_ROTATION = 0x10, //!< 回転 | |
| 412 | - EFFECT_FALL = 0x20, //!< 落下 | |
| 413 | - EFFECT_NOBILLBOARD = 0x40, //!< ビルボード化しない | |
| 414 | - EFFECT_COLLIDEMAP = 0x80 //!< マップとの当たり判定 | |
| 412 | + EFFECT_NOBILLBOARD = 0x01, //!< ビルボード化しない | |
| 413 | + EFFECT_COLLIDEMAP = 0x02 //!< マップとの当たり判定 | |
| 415 | 414 | }; |
| 416 | 415 | |
| 417 | 416 | #endif |
| \ No newline at end of file |
| @@ -518,18 +518,26 @@ | ||
| 518 | 518 | //! @param move_x X軸移動量 |
| 519 | 519 | //! @param move_y Y軸移動量 |
| 520 | 520 | //! @param move_z Z軸移動量 |
| 521 | +//! @param addmove_y Y軸移動量の加算量 | |
| 522 | +//! @param rotation 回転角度 | |
| 523 | +//! @param addrotation 回転角度の加算量 | |
| 521 | 524 | //! @param size 描画倍率 |
| 522 | -//! @param rotation 回転角度 | |
| 523 | -//! @param count 描画フレーム数 | |
| 525 | +//! @param addsize 描画倍率 | |
| 524 | 526 | //! @param texture テクスチャの認識番号 |
| 527 | +//! @param brightness 明るさ | |
| 528 | +//! @param addbrightness 明るさの加算量 | |
| 529 | +//! @param alpha 透明度 | |
| 530 | +//! @param addalpha 透明度の加算量 | |
| 525 | 531 | //! @param settype エフェクトの種類 (Effect_Type を組み合せる) |
| 532 | +//! @param count 描画フレーム数 | |
| 526 | 533 | //! @return 成功:データ番号(0以上) 失敗:-1 |
| 527 | -int ObjectManager::AddEffect(float pos_x, float pos_y, float pos_z, float move_x, float move_y, float move_z, float size, float rotation, int count, int texture, int settype) | |
| 534 | +int ObjectManager::AddEffect(float pos_x, float pos_y, float pos_z, float move_x, float move_y, float move_z, float addmove_y, float rotation, float addrotation, float size, float addsize, int texture, int brightness, int addbrightness, float alpha, float addalpha, int settype, int count) | |
| 528 | 535 | { |
| 529 | 536 | for(int i=0; i<MAX_EFFECT; i++){ |
| 530 | 537 | if( EffectIndex[i].GetEnableFlag() == false ){ |
| 531 | 538 | EffectIndex[i].SetPosData(pos_x, pos_y, pos_z, 0.0f); |
| 532 | - EffectIndex[i].SetParamData(move_x, move_y, move_z, size, rotation, count, texture, settype, true); | |
| 539 | + EffectIndex[i].SetParamData(move_x, move_y, move_z, addmove_y, rotation, addrotation, size, addsize, count, settype); | |
| 540 | + EffectIndex[i].SetTexture(texture, brightness, addbrightness, alpha, addalpha); | |
| 533 | 541 | EffectIndex[i].SetEnableFlag(true); |
| 534 | 542 | return i; |
| 535 | 543 | } |
| @@ -546,10 +554,14 @@ | ||
| 546 | 554 | //! @param pos_z Z座標 |
| 547 | 555 | //! @param size 描画倍率 |
| 548 | 556 | //! @param rotation 回転角度 |
| 557 | +//! @param texture テクスチャの認識番号 | |
| 558 | +//! @param brightness 明るさ | |
| 559 | +//! @param addbrightness 明るさの加算量 | |
| 560 | +//! @param alpha 透明度 | |
| 561 | +//! @param addalpha 透明度の加算量 | |
| 549 | 562 | //! @param count 描画フレーム数 |
| 550 | -//! @param texture テクスチャの認識番号 | |
| 551 | 563 | //! @return 成功:データ番号(0以上) 失敗:-1 |
| 552 | -int ObjectManager::AddMapEffect(int id, int face, float pos_x, float pos_y, float pos_z, float size, float rotation, int count, int texture) | |
| 564 | +int ObjectManager::AddMapEffect(int id, int face, float pos_x, float pos_y, float pos_z, float size, float rotation, int texture, int brightness, int addbrightness, float alpha, float addalpha, int count) | |
| 553 | 565 | { |
| 554 | 566 | blockdata data; |
| 555 | 567 | float vx, vy, vz; |
| @@ -569,8 +581,9 @@ | ||
| 569 | 581 | for(int i=0; i<MAX_EFFECT; i++){ |
| 570 | 582 | if( EffectIndex[i].GetEnableFlag() == false ){ |
| 571 | 583 | EffectIndex[i].SetPosData(pos_x, pos_y, pos_z, 0.0f); |
| 572 | - EffectIndex[i].SetParamData(0.0f, 0.0f, 0.0f, size, rotation, count, texture, EFFECT_DISAPPEARHALF | EFFECT_NOBILLBOARD, true); | |
| 584 | + EffectIndex[i].SetParamData(0.0f, 0.0f, 0.0f, 0.0f, rotation, 0.0f, size, 0.0f, count, EFFECT_NOBILLBOARD); | |
| 573 | 585 | EffectIndex[i].SetRxRy(rx, ry); |
| 586 | + EffectIndex[i].SetTexture(texture, brightness, addbrightness, alpha, addalpha); | |
| 574 | 587 | EffectIndex[i].SetEnableFlag(true); |
| 575 | 588 | return i; |
| 576 | 589 | } |
| @@ -584,12 +597,12 @@ | ||
| 584 | 597 | //! @param y Y座標 |
| 585 | 598 | //! @param z Z座標 |
| 586 | 599 | //! @param damage ダメージ |
| 587 | -//! @param CollideMap マップへの付着 | |
| 588 | -void ObjectManager::SetHumanBlood(float x, float y, float z, int damage, bool CollideMap) | |
| 600 | +//! @param flowing 流血の有無 | |
| 601 | +void ObjectManager::SetHumanBlood(float x, float y, float z, int damage, bool flowing) | |
| 589 | 602 | { |
| 590 | 603 | int addtype; |
| 591 | 604 | |
| 592 | - if( CollideMap == false ){ | |
| 605 | + if( flowing == false ){ | |
| 593 | 606 | addtype = EFFECT_NORMAL; |
| 594 | 607 | } |
| 595 | 608 | else{ |
| @@ -597,10 +610,12 @@ | ||
| 597 | 610 | } |
| 598 | 611 | |
| 599 | 612 | if( GameConfig.GetBloodFlag() == true ){ |
| 600 | - AddEffect(x, y, z, 0.0f, 0.0f, 0.0f, 10.0f, DegreeToRadian(10)*GetRand(18), (int)(GAMEFPS * 0.4f), Resource->GetEffectBloodTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY | EFFECT_TRANSLUCENT | addtype); | |
| 601 | - for(int i=0; i<(damage/10); i++){ | |
| 602 | - float rx = DegreeToRadian(10)*GetRand(36); | |
| 603 | - AddEffect(x + cos(rx)*1.0f, y + (float)(GetRand(20)-10)/10, z + sin(rx)*1.0f, cos(rx)*0.5f, GetRand(5)*0.1f + 0.5f, sin(rx)*0.5f, 5.0f, DegreeToRadian(10)*GetRand(18), (int)(GAMEFPS * 0.5f), Resource->GetEffectBloodTexture(), EFFECT_FALL | EFFECT_TRANSLUCENT | addtype); | |
| 613 | + AddEffect(x, y, z, 0.0f, 0.0f, 0.0f, 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, 10.0f, 0.2f, Resource->GetEffectBloodTexture(), 10, 0, 0.5f, -0.04f, addtype, (int)(GAMEFPS * 0.4f)); | |
| 614 | + if( flowing == true ){ | |
| 615 | + for(int i=0; i<(damage/10); i++){ | |
| 616 | + float rx = DegreeToRadian(10)*GetRand(36); | |
| 617 | + AddEffect(x + cos(rx)*1.0f, y + (float)(GetRand(20)-10)/10, z + sin(rx)*1.0f, cos(rx)*0.5f, GetRand(5)*0.1f + 0.5f, sin(rx)*0.5f, -0.09f, DegreeToRadian(10)*GetRand(36), 0.0f, GetRand(40)*0.1f+0.1f, 0.1f, Resource->GetEffectBloodTexture(), 10, 0, 1.0f, 0.0f, addtype, (int)(GAMEFPS * 0.5f)); | |
| 618 | + } | |
| 604 | 619 | } |
| 605 | 620 | } |
| 606 | 621 | } |
| @@ -859,7 +874,7 @@ | ||
| 859 | 874 | void ObjectManager::HitBulletMap(float x, float y, float z, int teamID) |
| 860 | 875 | { |
| 861 | 876 | //エフェクト(煙)を描画 |
| 862 | - AddEffect(x, y, z, 0.0f, 0.05f, 0.0f, 5.0f, DegreeToRadian(10)*GetRand(18), (int)(GAMEFPS * 0.5f), Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY); | |
| 877 | + AddEffect(x, y, z, 0.0f, 0.05f, 0.0f, 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, 3.0f, 0.24f, Resource->GetEffectSmokeTexture(), 20, 0, 0.63f, -0.03f, EFFECT_NORMAL, 20); | |
| 863 | 878 | |
| 864 | 879 | //効果音を再生 |
| 865 | 880 | GameSound->HitMap(x, y, z, teamID); |
| @@ -979,7 +994,10 @@ | ||
| 979 | 994 | SmallObjectIndex[HitSmallObject_id].HitBullet(attacks); |
| 980 | 995 | |
| 981 | 996 | //エフェクト(煙)を描画 |
| 982 | - AddEffect(x, y, z, 0.0f, 0.05f, 0.0f, 5.0f, DegreeToRadian(10)*GetRand(18), (int)(GAMEFPS * 0.5f), Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY); | |
| 997 | + //AddEffect(x, y, z, 0.01f*(GetRand(101)-50), 0.01f*(GetRand(101)-50), 0.01f*(GetRand(101)-50), 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, 1.0f, 0.1f, Resource->GetEffectSmokeTexture(), 10, 0, 0.625f, -0.047f, EFFECT_NORMAL, 255); | |
| 998 | + //AddEffect(x, y, z, 0.01f*(GetRand(101)-50), 0.01f*(GetRand(101)-50), 0.01f*(GetRand(101)-50), 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, 1.0f, 0.1f, Resource->GetEffectSmokeTexture(), 10, 0, 0.625f, -0.047f, EFFECT_NORMAL, 255); | |
| 999 | + AddEffect(x, y, z, 0.0f, 0.0f, 0.0f, 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, 1.0f, 0.1f, Resource->GetEffectSmokeTexture(), 10, 0, 0.625f, -0.047f, EFFECT_NORMAL, 255); | |
| 1000 | + AddEffect(x, y, z, 0.0f, 0.01f*(GetRand(10)-5), 0.0f, 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, 1.0f, 0.1f, Resource->GetEffectSmokeTexture(), 10, 0, 0.625f, -0.047f, EFFECT_NORMAL, 255); | |
| 983 | 1001 | |
| 984 | 1002 | //効果音を再生 |
| 985 | 1003 | int id; |
| @@ -1172,14 +1190,17 @@ | ||
| 1172 | 1190 | } |
| 1173 | 1191 | |
| 1174 | 1192 | //エフェクト(フラッシュ)の描画 |
| 1175 | - AddEffect(gx, gy, gz, 0.0f, 0.0f, 0.0f, 30.0f, 0.0f, 2, Resource->GetEffectMflashTexture(), EFFECT_NORMAL); | |
| 1193 | + AddEffect(gx, gy, gz, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 40.0f, 0.0f, Resource->GetEffectMflashTexture(), 0, 0, 0.63f, 0.0f, EFFECT_NORMAL, 2); | |
| 1176 | 1194 | |
| 1177 | 1195 | //エフェクト(煙)の描画 |
| 1178 | - float rnd = DegreeToRadian(10)*GetRand(18); | |
| 1179 | - AddEffect(gx+1.0f, gy+1.0f, gz+1.0f, 0.1f, 0.2f, 0.1f, 50.0f, rnd, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_ROTATION | EFFECT_TRANSLUCENT); | |
| 1180 | - AddEffect(gx-1.0f, gy-1.0f, gz-1.0f, -0.1f, 0.2f, -0.1f, 50.0f, rnd*-1, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_ROTATION | EFFECT_TRANSLUCENT); | |
| 1181 | - AddEffect(gx-1.0f, gy-1.0f, gz+1.0f, -0.1f, 0.2f, 0.1f, 50.0f, rnd, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_ROTATION | EFFECT_TRANSLUCENT); | |
| 1182 | - AddEffect(gx+1.0f, gy+1.0f, gz-1.0f, 0.1f, 0.2f, -0.1f, 50.0f, rnd*-1, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_ROTATION | EFFECT_TRANSLUCENT); | |
| 1196 | + AddEffect(gx, gy, gz, 0.0f, 0.1f, 0.0f, 0.0f, | |
| 1197 | + DegreeToRadian(10)*GetRand(36), 0.0f, 36.0f, 0.2f, Resource->GetEffectSmokeTexture(), 220, 0, 0.6f, -0.01f, EFFECT_NORMAL, 50); | |
| 1198 | + AddEffect(gx + ((float)GetRand(7)/10-0.3f), gy + ((float)GetRand(5)/10-0.2f), gz + ((float)GetRand(7)/10-0.3f), (float)GetRand(5)/10-0.2f, (float)GetRand(3)/10, (float)GetRand(5)/10-0.2f, 0.0f, | |
| 1199 | + DegreeToRadian(10)*GetRand(36), 0.0f, ((float)GetRand(11)+25.0f)*2, 0.3f, Resource->GetEffectSmokeTexture(), 0, 0, 0.47f, -0.004f, EFFECT_NORMAL, 120); | |
| 1200 | + AddEffect(gx + ((float)GetRand(13)/10-0.6f), gy + ((float)GetRand(11)/10-0.5f), gz + ((float)GetRand(13)/10-0.6f), (float)GetRand(7)/10-0.3f, (float)GetRand(7)/10-0.3f, (float)GetRand(7)/10-0.3f, 0.0f, | |
| 1201 | + DegreeToRadian(10)*GetRand(36), DegreeToRadian(1), ((float)GetRand(21)+20.0f)*2, 0.2f, Resource->GetEffectSmokeTexture(), 0, 0, 0.4f, -0.004f, EFFECT_NORMAL, 100); | |
| 1202 | + AddEffect(gx + ((float)GetRand(13)/10-0.6f), gy + ((float)GetRand(11)/10-0.5f), gz + ((float)GetRand(13)/10-0.6f), (float)GetRand(7)/10-0.3f, (float)GetRand(7)/10-0.3f, (float)GetRand(7)/10-0.3f, 0.0f, | |
| 1203 | + DegreeToRadian(10)*GetRand(36), DegreeToRadian(-1), ((float)GetRand(21)+20.0f)*2, 0.2f, Resource->GetEffectSmokeTexture(), 0, 0, 0.4f, -0.004f, EFFECT_NORMAL, 100); | |
| 1183 | 1204 | |
| 1184 | 1205 | //効果音を再生 |
| 1185 | 1206 | GameSound->GrenadeExplosion(gx, gy, gz, teamid); |
| @@ -1222,10 +1243,9 @@ | ||
| 1222 | 1243 | |
| 1223 | 1244 | //エフェクト(煙)の描画 |
| 1224 | 1245 | float rnd = DegreeToRadian(10)*GetRand(18); |
| 1225 | - AddEffect(hx+1.0f, hy+1.0f, hz+1.0f, 0.0f, 0.05f, 0.0f, 10.0f, rnd, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY | EFFECT_ROTATION); | |
| 1226 | - AddEffect(hx-1.0f, hy-1.0f, hz-1.0f, 0.0f, 0.05f, 0.0f, 10.0f, rnd*-1, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY | EFFECT_ROTATION); | |
| 1227 | - AddEffect(hx-1.0f, hy-1.0f, hz+1.0f, 0.0f, 0.05f, 0.0f, 10.0f, rnd, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY | EFFECT_ROTATION); | |
| 1228 | - AddEffect(hx+1.0f, hy+1.0f, hz-1.0f, 0.0f, 0.05f, 0.0f, 10.0f, rnd*-1, (int)GAMEFPS * 3, Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY | EFFECT_ROTATION); | |
| 1246 | + AddEffect(hx+1.0f, hy+1.0f, hz+1.0f, 0.1f, 0.05f, 0.1f, 0.0f, rnd, 0, GetRand(30)*0.1f+30.0f, 0.1f, Resource->GetEffectSmokeTexture(), 10, 0, 1.0f, -1.0f / (GAMEFPS * 3), EFFECT_NORMAL, (int)GAMEFPS * 3); | |
| 1247 | + AddEffect(hx+1.0f, hy-1.0f, hz-1.0f, 0.2f, 0.05f, -0.2f, 0.0f, rnd*-1, 0, GetRand(30)*0.1f+30.0f, 0.1f, Resource->GetEffectSmokeTexture(), 10, 0, 1.0f, -1.0f / (GAMEFPS * 3), EFFECT_NORMAL, (int)GAMEFPS * 3); | |
| 1248 | + AddEffect(hx-1.0f, hy-1.0f, hz-1.0f, -0.3f, 0.05f, -0.3f, 0.0f, rnd, 0, GetRand(30)*0.1f+30.0f, 0.1f, Resource->GetEffectSmokeTexture(), 10, 0, 1.0f, -1.0f / (GAMEFPS * 3), EFFECT_NORMAL, (int)GAMEFPS * 3); | |
| 1229 | 1249 | } |
| 1230 | 1250 | } |
| 1231 | 1251 |
| @@ -2010,8 +2030,9 @@ | ||
| 2010 | 2030 | int weapon_paramid; |
| 2011 | 2031 | WeaponParameter ParamData; |
| 2012 | 2032 | float x, y, z; |
| 2013 | - float flashsize, smokesize, yakkyousize; | |
| 2014 | - float rx, mx, my, mz; | |
| 2033 | + float flashsize, smokesize1, smokesize2, yakkyousize; | |
| 2034 | + float rx, emx, emy, emz; | |
| 2035 | + float mx, my, mz; | |
| 2015 | 2036 | |
| 2016 | 2037 | //人の座標と角度を取得 |
| 2017 | 2038 | HumanIndex[humanid].GetPosData(&pos_x, &pos_y, &pos_z, NULL); |
| @@ -2023,18 +2044,24 @@ | ||
| 2023 | 2044 | |
| 2024 | 2045 | //マズルフラッシュと煙のサイズを決定 |
| 2025 | 2046 | flashsize = 0.06f * ParamData.attacks; |
| 2026 | - smokesize = flashsize; | |
| 2027 | - yakkyousize = 0.01f * ParamData.attacks; | |
| 2047 | + smokesize1 = 0.04f * ParamData.attacks; | |
| 2048 | + smokesize2 = 0.032f * ParamData.attacks; | |
| 2049 | + yakkyousize = 0.012f * ParamData.attacks; | |
| 2028 | 2050 | if( ParamData.silencer == true ){ |
| 2029 | - flashsize /= 2; | |
| 2051 | + flashsize = 1.2f; | |
| 2030 | 2052 | } |
| 2031 | 2053 | |
| 2032 | - //薬莢の移動量を決定 | |
| 2054 | + //煙の移動ベクトルを決定 | |
| 2033 | 2055 | rx = rotation_x*-1 + (float)M_PI/2; |
| 2034 | - mx = cos(rx - (float)M_PI/2) * ParamData.yakkyou_sx /10; | |
| 2035 | - my = (ParamData.yakkyou_sy + (GetRand(3)-1)) /10; | |
| 2036 | - mz = sin(rx - (float)M_PI/2) * ParamData.yakkyou_sx /10; | |
| 2056 | + emx = cos(rx)*cos(armrotation_y); | |
| 2057 | + emy = sin(armrotation_y); | |
| 2058 | + emz = sin(rx)*cos(armrotation_y); | |
| 2037 | 2059 | |
| 2060 | + //薬莢の移動量を決定 | |
| 2061 | + mx = cos(rx - (float)M_PI/2) * ParamData.yakkyou_sx * 0.12f; | |
| 2062 | + my = (ParamData.yakkyou_sy + (GetRand(3)-1)) * 0.12f; | |
| 2063 | + mz = sin(rx - (float)M_PI/2) * ParamData.yakkyou_sx * 0.12f; | |
| 2064 | + | |
| 2038 | 2065 | //行列でエフェクト座標を計算 |
| 2039 | 2066 | d3dg->SetWorldTransformHumanWeapon(pos_x, pos_y + 16.0f, pos_z, ParamData.flashx/10, ParamData.flashy/10, ParamData.flashz/10, rotation_x, armrotation_y*-1, 1.0f); |
| 2040 | 2067 | d3dg->GetWorldTransformPos(&x, &y, &z); |
| @@ -2041,7 +2068,7 @@ | ||
| 2041 | 2068 | d3dg->ResetWorldTransform(); |
| 2042 | 2069 | |
| 2043 | 2070 | //マズルフラッシュ描画 |
| 2044 | - AddEffect(x, y, z, 0.0f, 0.0f, 0.0f, flashsize, DegreeToRadian(10)*GetRand(18), 1, Resource->GetEffectMflashTexture(), EFFECT_NORMAL); | |
| 2071 | + AddEffect(x, y, z, 0.0f, 0.0f, 0.0f, 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, flashsize, 0.0f, Resource->GetEffectMflashTexture(), 0, 0, 0.63f, 0.0f, EFFECT_NORMAL, 1); | |
| 2045 | 2072 | |
| 2046 | 2073 | //行列でエフェクト座標を計算 |
| 2047 | 2074 | d3dg->SetWorldTransformHumanWeapon(pos_x, pos_y + 16.0f, pos_z, ParamData.flashx/10, ParamData.flashy/10, ParamData.flashz/10 - 0.1f, rotation_x, armrotation_y*-1, 1.0f); |
| @@ -2049,7 +2076,8 @@ | ||
| 2049 | 2076 | d3dg->ResetWorldTransform(); |
| 2050 | 2077 | |
| 2051 | 2078 | //エフェクト(煙)の描画 |
| 2052 | - AddEffect(x, y, z, 0.0f, 0.05f, 0.0f, smokesize, DegreeToRadian(10)*GetRand(18), (int)(GAMEFPS/3), Resource->GetEffectSmokeTexture(), EFFECT_DISAPPEAR | EFFECT_MAGNIFY | EFFECT_ROTATION); | |
| 2079 | + AddEffect(x, y, z, emx*0.15f, emy*0.15f + 0.02f, emz*0.15f, 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, smokesize1, 0.3f, Resource->GetEffectSmokeTexture(), 0, 0, 0.47f, -0.047f, EFFECT_NORMAL, 12); | |
| 2080 | + AddEffect(x, y, z, emx*0.45f, emy*0.45f, emz*0.45f, 0.0f, DegreeToRadian(10)*GetRand(36), 0.0f, smokesize2, 0.36f, Resource->GetEffectSmokeTexture(), 0, 0, 0.47f, -0.055f, EFFECT_NORMAL, 10); | |
| 2053 | 2081 | |
| 2054 | 2082 | //行列でエフェクト座標を計算 |
| 2055 | 2083 | d3dg->SetWorldTransformHumanWeapon(pos_x, pos_y + 16.0f, pos_z, ParamData.yakkyou_px/10, ParamData.yakkyou_py/10, ParamData.yakkyou_pz/10, rotation_x, armrotation_y*-1, 1.0f); |
| @@ -2057,7 +2085,7 @@ | ||
| 2057 | 2085 | d3dg->ResetWorldTransform(); |
| 2058 | 2086 | |
| 2059 | 2087 | //薬莢描画 |
| 2060 | - AddEffect(x, y, z, mx, my, mz, yakkyousize, DegreeToRadian(10)*GetRand(18), (int)(GAMEFPS/2), Resource->GetEffectYakkyouTexture(), EFFECT_ROTATION | EFFECT_FALL); | |
| 2088 | + AddEffect(x, y, z, mx, my, mz, -0.15f, DegreeToRadian(10)*GetRand(36), DegreeToRadian(GetRand(61)-30), yakkyousize, 0.0f, Resource->GetEffectYakkyouTexture(), 0, 0, 1.0f, 0.0f, EFFECT_NORMAL, (int)(GAMEFPS*0.75f)); | |
| 2061 | 2089 | } |
| 2062 | 2090 | |
| 2063 | 2091 | //! @brief 武器をリロード |
| @@ -2700,7 +2728,7 @@ | ||
| 2700 | 2728 | int id, face; |
| 2701 | 2729 | float pos_x, pos_y, pos_z; |
| 2702 | 2730 | if( CollideBlood(&(EffectIndex[i]), &id, &face, &pos_x, &pos_y, &pos_z) == true ){ |
| 2703 | - AddMapEffect(id, face, pos_x, pos_y, pos_z, 10.0f, DegreeToRadian(10)*GetRand(18), (int)GAMEFPS * 20, Resource->GetEffectBloodTexture()); | |
| 2731 | + AddMapEffect(id, face, pos_x, pos_y, pos_z, 10.0f, DegreeToRadian(10)*GetRand(18), Resource->GetEffectBloodTexture(), 0, 0, 1.0f, -0.002f, (int)GAMEFPS * 20); | |
| 2704 | 2732 | EffectIndex[i].SetEnableFlag(false); |
| 2705 | 2733 | } |
| 2706 | 2734 | else{ |
| @@ -79,7 +79,7 @@ | ||
| 79 | 79 | class smallobject *SmallObjectIndex; //!< 小物オブジェクト |
| 80 | 80 | class bullet *BulletIndex; //!< 弾オブジェクト |
| 81 | 81 | class grenade *GrenadeIndex; //!< 手榴弾オブジェクト |
| 82 | - class effect *EffectIndex; //!< エフェクトオブジェクト | |
| 82 | + class effect *EffectIndex; //!< エフェクトオブジェクト | |
| 83 | 83 | |
| 84 | 84 | unsigned int framecnt; //!< フレーム数のカウント |
| 85 | 85 |
| @@ -110,7 +110,7 @@ | ||
| 110 | 110 | int AddHumanIndex(pointdata data, pointdata infodata, bool RandomFlag); |
| 111 | 111 | int AddWeaponIndex(pointdata data); |
| 112 | 112 | int AddSmallObjectIndex(pointdata data); |
| 113 | - void SetHumanBlood(float x, float y, float z, int damage, bool CollideMap); | |
| 113 | + void SetHumanBlood(float x, float y, float z, int damage, bool flowing); | |
| 114 | 114 | bool CollideHuman(human *in_humanA, human *in_humanB); |
| 115 | 115 | bool CollideBullet(bullet *in_bullet); |
| 116 | 116 | void HitBulletMap(float x, float y, float z, int teamID); |
| @@ -131,8 +131,8 @@ | ||
| 131 | 131 | int AddHumanIndex(float px, float py, float pz, float rx, int CharacterID, int TeamID, int WeaponID[]); |
| 132 | 132 | int AddVisualWeaponIndex(int WeaponID, bool loadbullet); |
| 133 | 133 | int AddSmallObjectIndex(float px, float py, float pz, float rx, int paramID, bool MapColl); |
| 134 | - int AddEffect(float pos_x, float pos_y, float pos_z, float move_x, float move_y, float move_z, float size, float rotation, int count, int texture, int settype); | |
| 135 | - int AddMapEffect(int id, int face, float pos_x, float pos_y, float pos_z, float size, float rotation, int count, int texture); | |
| 134 | + int AddEffect(float pos_x, float pos_y, float pos_z, float move_x, float move_y, float move_z, float addmove_y, float rotation, float addrotation, float size, float addsize, int texture, int brightness, int addbrightness, float alpha, float addalpha, int settype, int count); | |
| 135 | + int AddMapEffect(int id, int face, float pos_x, float pos_y, float pos_z, float size, float rotation, int texture, int brightness, int addbrightness, float alpha, float addalpha, int count); | |
| 136 | 136 | void LoadPointData(); |
| 137 | 137 | void Recovery(); |
| 138 | 138 | void SetAddCollisionFlag(bool flag); |