Example #1
0
        //---------------------------------------------------------------------
        // 客户端提交开始极速状态,需要广播给客户端
        void _c2sBeginRapid(List <string> vec_param)
        {
            // 解析数据
            int  index           = 0;
            uint et_player_rpcid = uint.Parse(vec_param[++index]);

            // 处理请求
            CLogicTurret turret = mScene.getTurret(et_player_rpcid);

            if (turret != null)
            {
                turret.c2sBeginRapid();
            }
        }
Example #2
0
        //---------------------------------------------------------------------
        void randomFireState(float elapsed_tm)
        {
            float random = getRandom01();

            int   max_index  = 4;
            float base_value = 1f / max_index;

            if (random > base_value * --max_index)
            {
                if (mAttentionFireFish == null)
                {
                    return;
                }
                mAttentionFireFish = findMaxVibIdFish();
                change2attentionFireState();
            }
            else if (random > base_value * --max_index)
            {
                mfFireTimeSpan       = 0.2f;
                mAutoFireTargetAngle = randomTurretAngle();
                mTurret.c2sBeginLongpress();
                change2longFireState();
            }
            else if (random > base_value * --max_index)
            {
                mfFireTimeSpan       = 0.1f;
                mAutoFireTargetAngle = randomTurretAngle();
                mTurret.c2sBeginRapid();
                change2rapidFireState();
            }
            else
            {
                startStrafeFire(randomTurretAngle(), randomTurretAngle(), getRandomRange(10, 30));
                change2strafeFireState();
            }
        }