Example #1
0
 public void ProcessDelayOver(NetFishDeadTime[] fishList, CatchedData cd)
 {
     if (fishList == null)
     {
         return;
     }
     for (int i = 0; i < fishList.Length; ++i)
     {
         NetFishDeadTime dt  = fishList[i];
         CatchFishData   cfd = SceneRuntime.FishMgr.FindFish(dt.FishID);
         if (cfd.IsValidFishType() == false)
         {
             continue;
         }
         SceneRuntime.PlayerMgr.UpdatePlayerGold(cd.ClientSeat,
                                                 SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
         cd.FishList.Add(cfd);
         if (cfd.FishObj != null)
         {
             SceneRuntime.FishMgr.DestroyFish(cfd.FishObj, false);
         }
     }
     SceneRuntime.ComputeGoldNum(cd);
     //SceneRuntime.SceneModel.CatchFish(cd);
 }
Example #2
0
        public void UseSkillFreeze(NetCmdPack pack)
        {
            bool bNotDelay        = Utility.GetTickCount() - pack.tick < ConstValue.FISH_OVER_TIME;
            NetCmdSkillFreeze cmd = (NetCmdSkillFreeze)pack.cmd;
            byte clientSeat       = SceneRuntime.ServerToClientSeat(cmd.Seat);

            if (SceneRuntime.PlayerMgr.GetPlayer(clientSeat) == null)
            {
                return;
            }


            CatchedData cd = new CatchedData();

            cd.CatchType  = (byte)CatchedType.CATCHED_SKILL;
            cd.SubType    = (byte)SkillType.SKILL_FREEZE;
            cd.FishList   = new List <CatchFishData>();
            cd.ClientSeat = clientSeat;
            cd.RateIndex  = SceneRuntime.PlayerMgr.GetPlayer(cd.ClientSeat).RateIndex;

            RecordSkill(SkillType.SKILL_FREEZE, clientSeat);
            if (bNotDelay == false)
            {
                ProcessDelayOverFreeze(cmd.FishID, cd);
                return;
            }
            CatchLithingList cll    = null;
            GameObject       effect = SceneRuntime.EffectMgr.GetSkillEffect(2);

            effect.transform.localPosition = new Vector3(-17, -18.9f, 100);
            GlobalEffectData gfd = new GlobalEffectData(effect, 0, 5.0f);

            SceneRuntime.PlayerMgr.PlayCD(SkillSetting.SkillDataList[(byte)SkillType.SKILL_FREEZE].CDTime);
            // SceneRuntime.SceneModel.LogicUI.PlayCD(SkillSetting.SkillDataList[(byte) SkillType.SKILL_FREEZE].CDTime,
            //    SkillType.SKILL_FREEZE);
            GlobalEffectMgr.Instance.AddEffect(gfd);
            //SceneObjMgr.Instance.PlayBack(BackAnimType.BACK_ANIM_BD);
            SceneRuntime.PlayerMgr.PlaySkillAvatarEft(clientSeat);

            ReductionData reduction = SkillSetting.SkillDataList[(int)SkillType.SKILL_FREEZE].Reduction;

            BlendData bd = new BlendData();

            bd.BaseTex    = SceneRuntime.EffectMgr.SkillFreezeBaseTex;
            bd.EffectTex  = SceneRuntime.EffectMgr.SkillFreezeEffectTex;
            bd.Blend_Type = (byte)BlendType.BLEND_ADD_TEX;
            bd.Duration1  = 0;
            bd.Duration2  = 2.0f;
            bd.Factor     = 0.5f;

            BlendData bd2 = new BlendData();

            bd2.EffectTex  = SceneRuntime.EffectMgr.SkillFreezeBaseTex;
            bd2.Blend_Type = (byte)BlendType.BLEND_ADD_TEX;
            bd2.Duration1  = reduction.Duration1;
            bd2.Duration2  = reduction.Duration2;
            bd2.Duration3  = reduction.Duration3;
            bd2.Factor     = 0.8f;
            if (cmd.FishID != null)
            {
                for (int i = 0; i < cmd.FishID.Length; ++i)
                {
                    NetFishDeadTime dt   = cmd.FishID[i];
                    CatchFishData   cfd  = SceneRuntime.FishMgr.FindFish(dt.FishID);
                    bool            dead = dt.DeadTime != 0;
                    if (cfd.FishObj != null)
                    {
                        Fish             fish = cfd.FishObj;
                        float            t    = dt.DeadTime * ConstValue.INV255;
                        FishOptReduction fr;
                        if (dead)
                        {
                            if (dt.LightingFishID != 0)
                            {
                                if (cll == null)
                                {
                                    cll = new CatchLithingList();
                                }
                                CatchFishData cfd2 = SceneRuntime.FishMgr.FindFish(dt.LightingFishID);
                                if (cfd2.FishObj != null)
                                {
                                    cll.AddSubFish(cfd2.FishObj, fish);
                                }
                            }

                            fish.Controller.PathEvent.Reset(0, false);
                            ReductionData rd = new ReductionData();
                            rd.Speed     = FishSetting.FishDeadTime.BingDong_Speed;
                            rd.Duration2 = Utility.LerpFloat(FishSetting.FishDeadTime.BingDong_Dead_Time1,
                                                             FishSetting.FishDeadTime.BingDong_Dead_Time2, t);
                            fr           = new FishOptReduction(rd.Speed, rd, 0, bd);
                            fr.DeadType  = FishDeadType.DEAD_IMMEDIATE;
                            fr.CatchData = cd;

                            effect = SceneRuntime.EffectMgr.GetSkillEffect(3);
                            Vector3 pos = fish.Position;
                            pos.z -= 20;
                            effect.transform.localPosition = pos;
                            gfd         = new GlobalEffectData(effect, rd.Duration2, 1.0f);
                            gfd.Scaling = fish.Scaling * Mathf.Max(1.0f, (pos.z / 1000)) * 0.2f;
                            fish.SetCatched(clientSeat);
                            GlobalEffectMgr.Instance.AddEffect(gfd);
                            fish.ClearOpt();
                            fish.AddOpt(fr);
                            cd.FishList.Add(cfd);
                            fish.SetDropReward(dt.nReward);
                        }
                        else
                        {
                            fr = new FishOptReduction(reduction.Speed, reduction, 0, bd2);
                            fish.ClearOpt();
                            fish.AddOpt(fr);
                        }
                    }
                    else if (dead && cfd.IsValidFishType())
                    {
                        // SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
                        byte multiple = (byte)SkillSetting.SkillDataList[(byte)SkillType.SKILL_FREEZE].multiple;
                        SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat,
                                                                SceneRuntime.GetFishGold(cfd.FishType, multiple));

                        cd.FishList.Add(cfd);
                    }
                }
            }
            SceneRuntime.ComputeGoldNum(cd);
            //SceneRuntime.SceneModel.CatchFish(cd);
            if (cll != null)
            {
                ProcessLightingData(cll);
            }
            //SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, cd.GoldNum);
            //if (clientSeat == SceneRuntime.MyClientSeat)
            //{
            //    if (cd.GoldNum != cmd.GoldNum)
            //    {
            //        LogMgr.Log("冰冻:金币不相等:" + cd.GoldNum + "," + cmd.GoldNum);
            //    }
            //    else if (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() != cmd.TotalNum)
            //    {
            //        LogMgr.Log("冰冻:总金币不相等:" + (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel()) + "," + cmd.TotalNum);
            //    }
            //}
        }
Example #3
0
        public void UseSkillDisaster(NetCmdPack pack)
        {
            NetCmdSkillDisaster cmd = (NetCmdSkillDisaster)pack.cmd;
            bool bNotDelay          = Utility.GetTickCount() - pack.tick < ConstValue.FISH_OVER_TIME;
            byte clientSeat         = SceneRuntime.ServerToClientSeat(cmd.Seat);

            if (SceneRuntime.PlayerMgr.GetPlayer(clientSeat) == null)
            {
                return;
            }

            CatchedData cd = new CatchedData();

            cd.CatchType  = (byte)CatchedType.CATCHED_SKILL;
            cd.SubType    = (byte)SkillType.SKILL_DISASTER;
            cd.FishList   = new List <CatchFishData>();
            cd.ClientSeat = clientSeat;
            cd.RateIndex  = SceneRuntime.PlayerMgr.GetPlayer(cd.ClientSeat).RateIndex;

            RecordSkill(SkillType.SKILL_DISASTER, clientSeat);
            if (bNotDelay == false)
            {
                ProcessDelayOver(cmd.FishID, cd);
                return;
            }
            CatchLithingList cll = null;

            SceneRuntime.PlayerMgr.PlayCD(SkillSetting.SkillDataList[(byte)SkillType.SKILL_DISASTER].CDTime);
            //SceneRuntime.SceneModel.LogicUI.PlayCD(SkillSetting.SkillDataList[(byte)SkillType.SKILL_DISASTER].CDTime, SkillType.SKILL_DISASTER);
            GameObject       effect = SceneRuntime.EffectMgr.GetSkillEffect(6);
            GlobalEffectData gfd    = new GlobalEffectData(effect, 0, 5.0f);

            GlobalEffectMgr.Instance.AddEffect(gfd);
            //SceneObjMgr.Instance.PlayBack(BackAnimType.BACK_ANIM_TZ);
            SceneRuntime.PlayerMgr.PlaySkillAvatarEft(clientSeat);

            BlendData bd = new BlendData();

            bd.BaseTex    = SceneRuntime.EffectMgr.SkillDisasterTex;
            bd.EffectTex  = bd.BaseTex;
            bd.Blend_Type = (byte)BlendType.BLEND_ADD_TEX;
            bd.Duration1  = 1.0f;
            bd.Duration2  = 2.0f;
            bd.Factor     = 3.0f;

            FishOptPath pt = new FishOptPath(PathManager.Instance.DouDongPath, 0, 0, 1, 0, Vector3.zero);

            if (cmd.FishID != null)
            {
                for (int i = 0; i < cmd.FishID.Length; ++i)
                {
                    NetFishDeadTime dt  = cmd.FishID[i];
                    CatchFishData   cfd = SceneRuntime.FishMgr.FindFish(dt.FishID);
                    if (cfd.FishObj != null)
                    {
                        Fish fish = cfd.FishObj;
                        fish.StopLaugh(false);
                        float         t  = dt.DeadTime * ConstValue.INV255;
                        ReductionData rd = new ReductionData();

                        float dt1 = Utility.LerpFloat(FishSetting.FishDeadTime.TianZai_Dead_Time1, FishSetting.FishDeadTime.TianZai_Dead_Time1, t);
                        float dt2 = Utility.LerpFloat(FishSetting.FishDeadTime.TianZai_Stay_Time1, FishSetting.FishDeadTime.TianZai_Stay_Time2, t);
                        rd.Duration1 = dt1 + FishSetting.FishDeadTime.TianZai_DouDong_Time;

                        if (dt.LightingFishID != 0)
                        {
                            if (cll == null)
                            {
                                cll = new CatchLithingList();
                            }

                            CatchFishData cfd2 = SceneRuntime.FishMgr.FindFish(dt.LightingFishID);
                            if (cfd2.FishObj != null)
                            {
                                cll.AddSubFish(cfd2.FishObj, fish);
                            }
                        }

                        rd.Duration2 = dt2;
                        rd.Speed     = FishSetting.FishDeadTime.TianZai_Speed;
                        fish.ClearOpt();
                        FishOptOffset foo = new FishOptOffset(FishSetting.FishDeadTime.TianZai_DouDong_Time, PathManager.Instance.DouDongPath);
                        foo.Delay = dt1;
                        fish.AddOpt(foo);

                        FishOptReduction fr = new FishOptReduction(0, rd, rd.Duration1, bd);
                        fr.DeadType  = FishDeadType.DEAD_ACTION;
                        fr.CatchData = cd;
                        fish.SetCatched(clientSeat);
                        fish.AddOpt(fr);
                        fish.SetDropReward(dt.nReward);

                        cd.FishList.Add(cfd);
                    }
                    else if (cfd.IsValidFishType())
                    {
                        // SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
                        byte multiple = (byte)SkillSetting.SkillDataList[(byte)SkillType.SKILL_DISASTER].multiple;
                        SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, multiple));
                        cd.FishList.Add(cfd);
                    }
                }
            }
            SceneRuntime.ComputeGoldNum(cd);
            SceneRuntime.SceneModel.CatchFish(cd);
            if (cll != null)
            {
                cll.DelayTime = 1.0f;
                m_LightinData.Add(cll);
                //ProcessLightingData(cll);
            }
            //SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, cd.GoldNum);
            //if (clientSeat == SceneRuntime.MyClientSeat)
            //{
            //    if (cd.GoldNum != cmd.GoldNum)
            //    {
            //        LogMgr.Log("天灾:金币不相等:" + cd.GoldNum + "," + cmd.GoldNum);
            //    }
            //    else if (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() != cmd.TotalNum)
            //    {
            //        LogMgr.Log("天灾:总金币不相等:" + (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel()) + "," + cmd.TotalNum);
            //    }
            //}
        }
Example #4
0
        public void UseSkillLighting(NetCmdPack pack)
        {
            NetCmdSkillLighting cmd = (NetCmdSkillLighting)pack.cmd;
            bool bNotDelay          = Utility.GetTickCount() - pack.tick < ConstValue.FISH_OVER_TIME;
            byte clientSeat         = SceneRuntime.ServerToClientSeat(cmd.Seat);

            if (SceneRuntime.PlayerMgr.GetPlayer(clientSeat) == null)
            {
                return;
            }
            CatchedData cd = new CatchedData();

            cd.CatchType  = (byte)CatchedType.CATCHED_SKILL;
            cd.SubType    = (byte)SkillType.SKILL_LIGHTING;
            cd.FishList   = new List <CatchFishData>();
            cd.ClientSeat = clientSeat;
            cd.RateIndex  = SceneRuntime.PlayerMgr.GetPlayer(cd.ClientSeat).RateIndex;

            RecordSkill(SkillType.SKILL_LIGHTING, clientSeat);
            if (bNotDelay == false)
            {
                ProcessDelayOver(cmd.FishID, cd);
                return;
            }

            SceneRuntime.PlayerMgr.PlayCD(SkillSetting.SkillDataList[(byte)SkillType.SKILL_LIGHTING].CDTime);

            /*SceneRuntime.SceneModel.LogicUI.PlayCD(SkillSetting.SkillDataList[(byte) SkillType.SKILL_LIGHTING].CDTime,
             *  SkillType.SKILL_LIGHTING);*/
            GameObject effect = SceneRuntime.EffectMgr.GetSkillEffect(5);

            effect.transform.localPosition = new Vector3(0, 21.7f, 150);
            GlobalEffectData gfd = new GlobalEffectData(effect, 0, 3.0f);

            GlobalEffectMgr.Instance.AddEffect(gfd);
            //SceneObjMgr.Instance.PlayBack(BackAnimType.BACK_ANIM_SD);
            SceneRuntime.PlayerMgr.PlaySkillAvatarEft(clientSeat);
            CatchLithingList cll            = null;
            float            lightDuration2 = 1.5f;

            if (cmd.FishID != null)
            {
                for (int i = 0; i < cmd.FishID.Length; ++i)
                {
                    NetFishDeadTime dt  = cmd.FishID[i];
                    CatchFishData   cfd = SceneRuntime.FishMgr.FindFish(dt.FishID);
                    if (cfd.FishObj != null)
                    {
                        Fish fish = cfd.FishObj;
                        fish.StopLaugh(false);
                        if (dt.LightingFishID != 0)
                        {
                            if (cll == null)
                            {
                                cll = new CatchLithingList();
                            }
                            CatchFishData cfd2 = SceneRuntime.FishMgr.FindFish(dt.LightingFishID);
                            if (cfd2.FishObj != null)
                            {
                                cll.AddSubFish(cfd2.FishObj, fish);
                            }
                            lightDuration2 = 2.0f;
                        }
                        else
                        {
                            lightDuration2 = 1.5f;
                        }
                        float         t  = dt.DeadTime * ConstValue.INV255;
                        ReductionData rd = new ReductionData();
                        rd.Speed     = 0;
                        rd.Duration1 = Utility.LerpFloat(FishSetting.FishDeadTime.ShanDian_Dead_Time1,
                                                         FishSetting.FishDeadTime.ShanDian_Dead_Time2, t);
                        rd.Duration2 = lightDuration2;
                        rd.Duration3 = 0;

                        BlendData bd = new BlendData();
                        bd.EffectTex  = SceneRuntime.EffectMgr.GetLightingTex(fish.FishType);
                        bd.Blend_Type = (byte)BlendType.BLEND_LERP_TEX;
                        bd.Duration1  = 0.25f;
                        bd.Duration2  = 2.0f;
                        bd.Factor     = 1.0f;
                        fish.ClearOpt();

                        FishOptReduction fr = new FishOptReduction(0.0f, rd, rd.Duration1, bd);
                        fr.DeadType  = FishDeadType.DEAD_IMMEDIATE;
                        fr.CatchData = cd;
                        fish.SetCatched(clientSeat);
                        fish.AddOpt(fr);
                        fish.SetDropReward(dt.nReward);

                        effect = SceneRuntime.EffectMgr.GetSkillEffect(4);
                        gfd    = new GlobalEffectData(fish, effect, rd.Duration1, lightDuration2,
                                                      GlobalEffectPosConverter.LightingPosConvert);
                        GlobalEffectMgr.Instance.AddEffect(gfd);
                        cd.FishList.Add(cfd);
                    }
                    else if (cfd.IsValidFishType())
                    {
                        byte multiple = (byte)SkillSetting.SkillDataList[(byte)SkillType.SKILL_TORNADO].multiple;
                        SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat,
                                                                SceneRuntime.GetFishGold(cfd.FishType, multiple));
                        //SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
                        cd.FishList.Add(cfd);
                    }
                }
            }
            SceneRuntime.ComputeGoldNum(cd);
            //SceneRuntime.SceneModel.CatchFish(cd);
            if (cll != null)
            {
                ProcessLightingData(cll);
            }
            //SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, cd.GoldNum);
            //if (clientSeat == SceneRuntime.MyClientSeat)
            //{
            //    if (cd.GoldNum != cmd.GoldNum)
            //    {
            //        LogMgr.Log("闪电:金币不相等:" + cd.GoldNum + "," + cmd.GoldNum);
            //    }
            //    else if (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel() != cmd.TotalNum)
            //    {
            //        LogMgr.Log("闪电:总金币不相等:" + (PlayerRole.Instance.RoleInfo.RoleMe.GetGlobel()) + "," + cmd.TotalNum);
            //    }
            //}
        }