Ejemplo n.º 1
0
        public void ShowDiamond(CatchedData cd, Fish fish)
        {
            GoldEffectData ged = new GoldEffectData();

            ged.GameObj = Initobj(m_DiamondObj);


            ged.GameObj.transform.position = UIManager.Instance.WordToScenePoint(fish.Position) + (new Vector3(Utility.RandFloat(), Utility.RandFloat(), 0) * 0.45f);

            /*ged.m_Tween.m_Pos = ged.GameObj.transform.GetComponent<TweenPosition>();
             * ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponent<TweenScale>();*/
            ged.m_Tween.m_Pos   = ged.GameObj.transform.GetComponents <DOTweenAnimation>()[0];
            ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponents <DOTweenAnimation>()[1];
            ged.ScaleGoldTR(1.0f, 0.6f);
            ged.m_DelayTime = 2;
            ged.GoldNum     = 1;
            ged.PlayTween(true);
            ged.m_Tween.m_Pos.enabled = false;
            ged.ScaleGoldTR(1.0f, fish.IsBossFish() ? 1.0f : 0.6f);

            Vector3 vecGoldEndpos = Vector3.one;

            vecGoldEndpos = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat);
            DOTween.To(() => ged.GameObj.transform.position, x => ged.GameObj.transform.position = x, vecGoldEndpos, 2);
            ged.m_vecpathend = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat);
            m_diamondList.Add(ged);
        }
Ejemplo n.º 2
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);
 }
Ejemplo n.º 3
0
 public void SetDeadData(float delay, bool deadAction, CatchedData cd)
 {
     Delay = delay;
     if (deadAction)
     {
         DeadType = FishDeadType.DEAD_ACTION;
     }
     else
     {
         DeadType = FishDeadType.DEAD_IMMEDIATE;
     }
     this.CatchData = cd;
 }
Ejemplo n.º 4
0
        public void ShowBossFishSpecailEft(CatchedData cd, Fish fish)
        {
            GameObject go = GameObject.Instantiate(m_BossFishSpecailEftObj) as GameObject;

            go.transform.SetParent(SceneBoot.Instance.UIPanelTransform, false);
            go.transform.position = SceneRuntime.WorldToNGUI(fish.Position);
            GlobalEffectData bossFishEft = new GlobalEffectData(go, 0, 5);

            GlobalEffectMgr.Instance.AddEffect(bossFishEft);
            // GlobalEffectMgr.SetEffectOnUI(go);

            //sceneModel.Instance.PlayBack(BackAnimType.BACK_ANIM_BOSS);
        }
Ejemplo n.º 5
0
        //鱼被捕获调用接口,弹出金币
        public void FishCatched(Fish fish, CatchedData cd)
        {
            if (fish.IsBossFish())
            {
                //GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.catch_bossfish);
            }
            m_GoldEffect.ShowGoldEffect(cd, fish);
            //KonnoTool.ShowBossCatched(SceneRuntime.WorldToNGUI(fish.Position), cd.GoldNum);

            if (fish.IsBossFish())
            {
                //BossFish彩蛋特效
                m_GoldEffect.ShowBossFishSpecailEft(cd, fish);
            }
            //卡片掉落
            ushort nReward = fish.GetDropReward();

            if (nReward != 0)
            {
                tagRewardOnce pReward;
                if (!FishConfig.Instance.m_RewardConfig.RewardMap.TryGetValue(nReward, out pReward))
                {
                    return;
                }
                for (int i = 0; i < pReward.RewardItemVec.Count; i++)
                {
                    tagItemConfig itemConfig;
                    uint          uItemid = pReward.RewardItemVec[i].ItemID;
                    if (!FishConfig.Instance.m_ItemInfo.m_ItemMap.TryGetValue(uItemid, out itemConfig))
                    {
                        continue;
                    }
                    if (itemConfig.ItemTypeID == EItemType.IT_Currey) //钻石特殊处理
                    {
                        m_GoldEffect.ShowDiamond(cd, fish);
                    }
                    else //其他卡片
                    {
                        if (SceneRuntime.SceneModel.PlayerMgr.GetPlayer(cd.ClientSeat) == null)
                        {
                            continue;
                        }
                        Vector2 vecPos = SceneRuntime.SceneModel.PlayerMgr.GetPlayer(cd.ClientSeat).Launcher.LauncherPos;

                        /*SceneRuntime.SceneModel.LogicUI.MoveDropCard(SceneRuntime.WorldToNGUI(fish.Position),
                         *  new Vector3(vecPos.x, vecPos.y, 0), (ushort) uItemid);*/
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public static void ComputeGoldNum(CatchedData cd)
        {
            cd.GoldNum = 0;
            ushort rate = BulletSetting.BulletRate[cd.RateIndex];

            for (int i = 0; i < cd.FishList.Count; ++i)
            {
                if (cd.FishList[i].FishType >= FishSetting.FishDataList.Length)
                {
                    Debug.Log("错误的鱼类型:" + cd.FishList[i].FishType);
                }
                if (cd.CatchType == (byte)CatchedType.CATCHED_SKILL)
                {
                    cd.GoldNum += FishSetting.FishDataList[cd.FishList[i].FishType].Gold * SkillSetting.SkillDataList[cd.SubType].multiple;
                }
                else
                {
                    cd.GoldNum += rate * FishSetting.FishDataList[cd.FishList[i].FishType].Gold;
                }
            }
        }
Ejemplo n.º 7
0
 public void ProcessDelayOverFreeze(NetFishDeadTime[] fishList, CatchedData cd)
 {
 }
Ejemplo n.º 8
0
 public void CatchFish(CatchedData cd)
 {
     PlayerRole.Instance.HandeCatchFishData(cd);
     //PlayMusic(cd);
     //m_LogicUI.ShowWonderfulUI(cd);
 }
Ejemplo n.º 9
0
        public void FishCatched(NetCmdPack pack)
        {
            Debug.Log("FishCatched");
            NetCmdCatched cmd = (NetCmdCatched)pack.cmd;
            byte          clientSeat;
            byte          id;

            SceneRuntime.BuuletIDToSeat(cmd.BulletID, out clientSeat, out id);
            CatchBulletData cbd = SceneRuntime.BulletMgr.GetBullet(clientSeat, id);

            if (cbd.IsValid() == false)
            {
                return;
            }
            if (SceneRuntime.PlayerMgr.GetPlayer(clientSeat) == null)
            {
                return;
            }
            bool        bNotDelay = Utility.GetTickCount() - pack.tick < ConstValue.FISH_OVER_TIME;
            CatchedData cd        = new CatchedData();

            cd.CatchType  = (byte)CatchedType.CATCHED_BULLET;
            cd.ClientSeat = clientSeat;
            cd.FishList   = new List <CatchFishData>();
            ushort lockfishid = 0;

            if (cbd.BulletObj != null)
            {
                if (cbd.BulletObj.LauncherType == 4)
                {
                    lockfishid = cbd.BulletObj.LockedFishID;
                }
                cd.SubType   = cbd.BulletObj.LauncherType;
                cd.RateIndex = cbd.BulletObj.RateIndex;
            }
            else
            {
                cd.SubType   = cbd.LauncherType;
                cd.RateIndex = cbd.RateIndex;
            }

            if (bNotDelay == false)
            {
                ProcessDelayOver(cmd.Fishs, cd);
                return;
            }

            CatchLithingList cll = null;
            BlendData        bd  = new BlendData(Color.red, 0.6f, 0, 0, 0.4f);

            if (cmd.Fishs != null)
            {
                for (int i = 0; i < cmd.Fishs.Length; ++i)
                {
                    NetFishCatched nfc = cmd.Fishs[i];
                    CatchFishData  cfd = SceneRuntime.FishMgr.FindFish(nfc.FishID);
                    if (cfd.IsValidFishType() == false)
                    {
                        continue;
                    }
                    Fish fish = cfd.FishObj;
                    if (fish != null && fish.FishID == lockfishid)
                    {
                        cbd.BulletObj.ClearLockFishID();//只有穿透子弹才需要清空锁定,其他子弹发生碰撞就销毁了。
                    }
                    switch ((FishCatchEventType)nfc.CatchEvent)
                    {
                    case FishCatchEventType.CATCH_EVENT_EFFECT:
                        if (fish == null || fish.Catched)
                        {
                            continue;
                        }

                        if (fish.HasOpt == false)
                        {
                            FishOptReduction ff = new FishOptReduction(1.0f, new ReductionData(1.0f, 0, 0, 0.5f), 0, bd);
                            fish.AddOpt(ff);
                        }
                        break;

                    case FishCatchEventType.CATCH_EVENT_ATTACK:
                        if (fish == null || fish.Catched)
                        {
                            continue;
                        }
                        FishOptReduction ff1 = new FishOptReduction(0.5f, new ReductionData(0.5f, 0, 0, 0.5f), 0, bd);
                        fish.AddOpt(ff1);
                        if (FishResManager.Instance.GetFishData(fish.FishType).ClipLength[(int)FishClipType.CLIP_GONGJI] != 0)
                        {
                            FishOptAction foa = new FishOptAction(FishClipType.CLIP_GONGJI, 1.5f);
                            fish.AddOpt(foa);
                        }
                        break;

                    case FishCatchEventType.CATCH_EVENT_CATCHED:
                        if (fish != null)
                        {
                            FishOptReduction deadRed = new FishOptReduction(1.0f, new ReductionData(0, 0, 1.0f, 0), 0, bd);
                            FishOptAction    fod     = new FishOptAction(FishClipType.CLIP_SIWANG, 1.0f);
                            fod.SetDeadData(0, false, cd);
                            fish.ClearOpt();
                            fish.AddOpt(fod);
                            fish.AddOpt(deadRed);
                            fish.SetCatched(clientSeat);

                            fish.SetDropReward(nfc.nReward);
                        }
                        else
                        {
                            SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
                        }
                        cd.FishList.Add(cfd);
                        break;

                    case FishCatchEventType.CATCH_EVENT_CATCHED_LIGHTING_MAIN:
                        if (fish != null)
                        {
                            FishOptReduction deadRed = new FishOptReduction(1.0f, new ReductionData(0, 0, 2.0f, 0), 0, null);
                            FishOptAction    fod     = new FishOptAction(FishClipType.CLIP_SIWANG, 1.0f);
                            fod.SetDeadData(1, false, cd);
                            fish.ClearOpt();
                            fish.AddOpt(fod);
                            fish.AddOpt(deadRed);
                            fish.SetCatched(clientSeat);
                            fish.SetDropReward(nfc.nReward);
                            if (cll == null)
                            {
                                cll = new CatchLithingList();
                            }
                            cll.AddMainFish(fish);
                        }
                        else
                        {
                            SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
                        }
                        cd.FishList.Add(cfd);
                        break;

                    case FishCatchEventType.CATCH_EVENT_CATCHED_LIGHTING:
                        if (fish != null)
                        {
                            FishOptReduction deadRed = new FishOptReduction(1.0f, new ReductionData(0, 0, 2.0f, 0), 0, null);
                            FishOptAction    fod     = new FishOptAction(FishClipType.CLIP_SIWANG, 1.0f);
                            fod.SetDeadData(1, false, cd);
                            fish.ClearOpt();
                            fish.AddOpt(fod);
                            fish.AddOpt(deadRed);
                            fish.SetCatched(clientSeat);
                            fish.SetDropReward(nfc.nReward);

                            CatchFishData cfd2 = SceneRuntime.FishMgr.FindFish(nfc.LightingFishID);
                            if (cfd2.IsValidFishType())
                            {
                                if (cll == null)
                                {
                                    cll = new CatchLithingList();
                                }
                                cll.AddSubFish(cfd2.FishObj, fish);
                            }
                        }
                        else
                        {
                            SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
                        }
                        cd.FishList.Add(cfd);
                        break;
                    }
                }
            }
            if (cd.FishList.Count > 0)
            {
                SceneRuntime.ComputeGoldNum(cd);
                SceneRuntime.SceneModel.CatchFish(cd);
            }

            SceneRuntime.PlayerMgr.FishCatch(clientSeat, cmd.Combo);
            if (cbd.BulletObj != null)
            {
                cbd.BulletObj.GoldNum += cd.GoldNum;
                SceneRuntime.EffectMgr.PlayFishNet(cbd.BulletObj.Position, cd.SubType);
            }
            if (cd.SubType != 4)
            {
                SceneRuntime.BulletMgr.RemoveBullet(clientSeat, id);
            }

            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);
            //    }
            //}
        }
Ejemplo n.º 10
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);
            //    }
            //}
        }
Ejemplo n.º 11
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);
            //    }
            //}
        }
Ejemplo n.º 12
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);
            //    }
            //}
        }
Ejemplo n.º 13
0
        public void UseSkillTornado(NetCmdPack pack)
        {
            NetCmdSkillTornado cmd = (NetCmdSkillTornado)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_TORNADO;
            cd.FishList   = new List <CatchFishData>();
            cd.ClientSeat = clientSeat;
            cd.RateIndex  = SceneRuntime.PlayerMgr.GetPlayer(cd.ClientSeat).RateIndex;

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

            Vector3[] pos = new Vector3[3];
            SceneRuntime.PlayerMgr.PlayCD(SkillSetting.SkillDataList[(byte)SkillType.SKILL_TORNADO].CDTime);

            /*SceneRuntime.SceneModel.LogicUI.PlayCD(SkillSetting.SkillDataList[(byte) SkillType.SKILL_TORNADO].CDTime,
             *  SkillType.SKILL_TORNADO);*/
            GetTornadoPos(pos);
            GameObject effect = SceneRuntime.EffectMgr.GetSkillEffect(1);

            effect.transform.localPosition = new Vector3(0, 0, 500);
            GlobalEffectData gfd = new GlobalEffectData(effect, 0, 5.0f);

            GlobalEffectMgr.Instance.AddEffect(gfd);
            //SceneObjMgr.Instance.PlayBack(BackAnimType.BACK_ANIM_JF);

            for (int i = 0; i < 3; ++i)
            {
                effect = SceneRuntime.EffectMgr.GetSkillEffect(0);
                Vector3 p = pos[i];
                p.y -= 50;
                effect.transform.localPosition = pos[i];
                gfd = new GlobalEffectData(effect, 0, 5.0f);
                GlobalEffectMgr.Instance.AddEffect(gfd);
            }
            SceneRuntime.PlayerMgr.PlaySkillAvatarEft(clientSeat);
            if (cmd.fishID != null)
            {
                for (int i = 0; i < cmd.fishID.Length; ++i)
                {
                    CatchFishData cfd = SceneRuntime.FishMgr.FindFish(cmd.fishID[i].FishID);
                    if (cfd.FishObj != null)
                    {
                        Fish fish = cfd.FishObj;
                        fish.StopLaugh(false);
                        float d1     = new Vector2(fish.Position.x - pos[0].x, fish.Position.y - pos[0].y).sqrMagnitude;
                        float d2     = new Vector2(fish.Position.x - pos[1].x, fish.Position.y - pos[1].y).sqrMagnitude;
                        float d3     = new Vector2(fish.Position.x - pos[2].x, fish.Position.y - pos[2].y).sqrMagnitude;
                        int   posidx = (d1 < d2) ? (d1 < d3 ? 0 : 2) : (d2 < d3 ? 1 : 2);

                        float transRot  = -Utility.Range(1000, 2000);
                        float pathRot   = -Utility.Range(3000, 5000);
                        float speed     = Utility.Range(4, 8);
                        float transTime = Utility.Range(0.3f, 0.6f);
                        int   idx       = Utility.Range(0, PathManager.Instance.LongJuanFeng.Length);

                        float delay = Utility.LerpFloat(FishSetting.FishDeadTime.LongJuanFeng_Dead_Time1,
                                                        FishSetting.FishDeadTime.LongJuanFeng_Dead_Time2, Utility.Range(0.0f, 1.0f));
                        ReductionData rd = new ReductionData();
                        rd.Speed     = 0;
                        rd.Duration1 = delay;
                        FishOptReduction f   = new FishOptReduction(0.0f, rd);
                        FishOptPath      fop = new FishOptPath(PathManager.Instance.LongJuanFeng[idx], transRot, pathRot,
                                                               speed, transTime, pos[posidx] + new Vector3(0, 50, 0));
                        fop.SetDeadData(delay, false, cd);
                        fish.ClearOpt();
                        fish.AddOpt(fop);
                        fish.SetCatched(clientSeat);
                        cd.FishList.Add(cfd);

                        fish.SetDropReward(cmd.fishID[i].nReward);
                    }
                    else if (cfd.IsValidFishType())
                    {
                        // SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat, SceneRuntime.GetFishGold(cfd.FishType, cd.RateIndex));
                        byte multiple = (byte)SkillSetting.SkillDataList[(byte)SkillType.SKILL_TORNADO].multiple;
                        SceneRuntime.PlayerMgr.UpdatePlayerGold(clientSeat,
                                                                SceneRuntime.GetFishGold(cfd.FishType, multiple));

                        cd.FishList.Add(cfd);
                    }
                }
            }
            SceneRuntime.ComputeGoldNum(cd);
            //SceneRuntime.SceneModel.CatchFish(cd);
            //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);
            //    }
            //}
        }
Ejemplo n.º 14
0
        public void ShowGoldEffect(CatchedData cd, Fish fish)
        {
            if (MatchJudge.IsMatch() && cd.ClientSeat != SceneRuntime.MyClientSeat)//比赛只显示自己的效果
            {
                return;
            }
            Vector3 vecGoldEndpos = Vector3.one;

            if (MatchJudge.IsMatch())//比赛
            {
                if (cd.ClientSeat == SceneRuntime.MyClientSeat)
                {
                    //vecGoldEndpos = GlobalHallUIMgr.Instance.MatchScorePos();
                }
                else
                {
                    vecGoldEndpos = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat);
                }
            }
            else
            {
                vecGoldEndpos = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat);
            }

            const int perGoldNum = 30;
            //这里的金币用的还是鱼的类型
            Vector3 FishPos = UIManager.Instance.WordToScenePoint(fish.Position);
            //鱼的价值
            uint fishOrgGold = (uint)FishSetting.FishDataList[fish.FishType].Gold;
            uint fishGold    = 0;

            if (cd.CatchType == (byte)CatchedType.CATCHED_SKILL)
            {
                fishGold = fishOrgGold * SkillSetting.SkillDataList[cd.SubType].multiple;
            }
            else
            {
                fishGold = fishOrgGold * BulletSetting.BulletRate[cd.RateIndex];
            }


            if (!MatchJudge.IsMatch() && cd.ClientSeat == SceneRuntime.MyClientSeat)
            {
                //GlobalHallUIMgr.Instance.GameShare.AddGlod((int)fishGold);
            }


            uint goldNum = fishOrgGold / perGoldNum;
            uint perNum  = 0;
            uint lastNum = 0;

            if (goldNum == 0)
            {
                goldNum = 1;
                lastNum = fishGold;
            }
            else
            {
                perNum  = fishGold / goldNum;
                lastNum = perNum + (fishGold - perNum * goldNum);
            }
            uint num = 0;

            for (byte i = 0; i < goldNum; ++i)
            {
                GoldEffectData ged = new GoldEffectData();
                ged.catchedData = cd;

                if (MatchJudge.IsMatch())
                {
                    ged.GameObj = Initobj(m_ScoreObj);
                }
                else
                {
                    ged.GameObj = Initobj(m_GoldObj);
                }

                ged.GameObj.transform.position = FishPos + (new Vector3(Utility.RandFloat() * 100, Utility.RandFloat(), 0)) * (fish.IsBossFish() ? 0.45f : 0.15f);
                //ged.m_Tween.m_Pos = ged.GameObj.transform.GetComponents<DOTweenAnimation>()[0];
                //ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponents<DOTweenAnimation>()[1];

                ged.ScaleGoldTR(1.0f, fish.IsBossFish() ? 1.0f : 0.6f);
                if (i > 0 && !fish.IsBossFish())
                {
                    ged.m_DelayTime += i * 0.1f;
                }
                if (fish.IsBossFish())
                {
                    ged.m_DelayTime = 1.5f;
                }

                if (i == goldNum - 1)
                {
                    ged.GoldNum = lastNum;
                }
                else
                {
                    ged.GoldNum = perNum;
                }
                num           += ged.GoldNum;
                ged.ClientSeat = cd.ClientSeat;
                ged.PlayTween(true);
                ged.m_vecpathend = vecGoldEndpos;

                DOTween.To(() => ged.GameObj.transform.position, r => ged.GameObj.transform.position = r, vecGoldEndpos, 0.5f).SetDelay(1 + i * 0.1f).OnComplete(() =>
                {
                    ged.DsetorySelf();
                }
                                                                                                                                                                 );
            }
            ShowGoldNumLabel(fishGold, FishPos, fish);
        }