public void OnRoleCatchByLottery(Byte FishTypeID, CatchedData cd) { //if (PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() >= FishConfig.Instance.m_LotteryConfig.MaxLotteryFishSum) // return; UInt16 rateIndex = 1; if (cd.CatchType == (Byte)CatchedType.CATCHED_BULLET || cd.CatchType == (Byte)CatchedType.CATCHED_LASER) { rateIndex = BulletSetting.BulletRate[SceneRuntime.PlayerMgr.MySelf.RateIndex]; } else if (cd.CatchType == (Byte)CatchedType.CATCHED_SKILL) { rateIndex = SkillSetting.SkillDataList[cd.SubType].multiple; } UInt32 Score = FishConfig.Instance.m_LotteryConfig.GetFishLotteryScore(FishTypeID) * rateIndex; if (Score == 0) { return; } if (PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() < Byte.MaxValue) { PlayerRole.Instance.RoleInfo.RoleMe.SetLotteryFishSum(Convert.ToByte(PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryFishSum() + 1)); } PlayerRole.Instance.RoleInfo.RoleMe.SetLotteryScore(PlayerRole.Instance.RoleInfo.RoleMe.GetLotteryScore() + Score); tagLotteryScoreChangeEvent pEventLottery = new tagLotteryScoreChangeEvent(); MsgEventHandle.HandleMsg(pEventLottery); }
void PlayMusic(CatchedData cd) { float volume = 1; if (SceneRuntime.PlayerMgr.GetPlayer(cd.ClientSeat) == SceneRuntime.PlayerMgr.MySelf) { volume = 1; } else { volume = 0.30f; } if (cd.CatchType == 2) { GlobalAudioMgr.Instance.PlaySkillMusic(Audio.SkillMusic.m_Skill_0 + cd.SubType, false, false, volume); } else if (cd.CatchType == 0) { byte[] type = { 5, 5, 6, 7, 8 }; GlobalAudioMgr.Instance.PlayOrdianryMusic((Audio.OrdianryMusic)type[cd.SubType], false, false, volume); } else if (cd.CatchType == 1) { byte[] type = { 6, 6, 7, 8, 9 }; GlobalAudioMgr.Instance.PlaySkillMusic((Audio.SkillMusic)type[cd.SubType], false, true, volume); } }
public void ShowBossFishSpecailEft(CatchedData cd, Fish fish) { GameObject go = GameObject.Instantiate(m_BossFishSpecailEftObj) as GameObject; go.transform.SetParent(SceneObjMgr.Instance.UIPanelTransform, false); go.transform.position = SceneRuntime.WorldToNGUI(fish.Position); GlobalEffectData bossFishEft = new GlobalEffectData(go, 0, 5); GlobalEffectMgr.Instance.AddEffect(bossFishEft); // GlobalEffectMgr.SetEffectOnUI(go); SceneObjMgr.Instance.PlayBack(BackAnimType.BACK_ANIM_BOSS); }
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; }
//鱼被捕获调用接口,弹出金币 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.SceneLogic.PlayerMgr.GetPlayer(cd.ClientSeat) == null) { continue; } Vector2 vecPos = SceneRuntime.SceneLogic.PlayerMgr.GetPlayer(cd.ClientSeat).Launcher.LauncherPos; SceneRuntime.SceneLogic.LogicUI.MoveDropCard(SceneRuntime.WorldToNGUI(fish.Position), new Vector3(vecPos.x, vecPos.y, 0), (ushort)uItemid); } } } }
public void ShowDiamond(CatchedData cd, Fish fish) { GoldEffectData ged = new GoldEffectData(); ged.GameObj = Initobj(m_DiamondObj); ged.GameObj.transform.position = SceneRuntime.WorldToNGUI(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.ScaleGoldTR(1.0f, 0.6f); ged.m_DelayTime = 2; ged.GoldNum = 1; ged.PlayTween(true); ged.m_vecpathend = SceneRuntime.GetLauncherGoldIconPos(cd.ClientSeat); m_diamondList.Add(ged); }
public void ShowWonderfulUI(CatchedData cd) { if (SceneRuntime.PlayerMgr.GetPlayer(cd.ClientSeat) == SceneRuntime.PlayerMgr.MySelf && cd.CatchType > 0) { if (cd.CatchType == (byte)CatchedType.CATCHED_SKILL) { if (cd.GoldNum > (SkillSetting.SkillDataList[cd.SubType].multiple * ExtraSetting.WonderFulBase)) { m_Wonderful.ShowWonderfulUI(cd); } } else { if (cd.GoldNum > (BulletSetting.BulletRate[SceneRuntime.PlayerMgr.GetPlayer(cd.ClientSeat).RateIndex] * ExtraSetting.WonderFulBase)) { m_Wonderful.ShowWonderfulUI(cd); } } } }
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; } } }
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 = SceneRuntime.WorldToNGUI(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(), Utility.RandFloat(), 0)) * (fish.IsBossFish()?0.45f:0.15f); ged.m_Tween.m_Pos = ged.GameObj.transform.GetComponent <TweenPosition>(); ged.m_Tween.m_Sclae = ged.GameObj.transform.GetComponent <TweenScale>(); 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; if (SceneRuntime.PlayerMgr.GetPlayer(ged.catchedData.ClientSeat) == SceneRuntime.PlayerMgr.MySelf) { GlobalAudioMgr.Instance.PlayOrdianryMusic(Audio.OrdianryMusic.m_GoldJump); } m_CatchedList.Add(ged); } ShowGoldNumLabel(fishGold, FishPos, fish); }
public void HandeCatchFishData(CatchedData cd) //捕获鱼的结果 { if (cd == null) //判断是否是自己 { return; } int Exp = 0; if (SceneRuntime.ClientToServerSeat(cd.ClientSeat) == PlayerRole.Instance.RoleInfo.RoleMe.GetSeat()) { if (cd.FishList.Count > 0) { for (int i = 0; i < cd.FishList.Count; ++i) { //添加经验 Exp += FishSetting.FishDataList[cd.FishList[i].FishType].Gold; if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() == 0 && PlayerRole.Instance.RoleInfo.RoleMe.GetSeat() != 0xff) //在桌子里 并且不在比赛之中 //PlayerRole.Instance.RoleLottery.OnRoleCatchByLottery(cd.FishList[i].FishType, cd); { if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() == 0) { HandleEvent(EventTargetType.ET_CatchFish, cd.FishList[i].FishType, 1); } } /*if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() == 0 && * PlayerRole.Instance.RoleInfo.RoleMe.GetSeat() != 0xff) //在桌子里 并且不在比赛之中 * RoleGameData.OnHandleCatchFish(cd.FishList[i].FishType); //捕获指定的鱼*/ } } if (cd.CatchType == (Byte)CatchedType.CATCHED_BULLET || cd.CatchType == (Byte)CatchedType.CATCHED_LASER) //技能不算开炮获得金币 { if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() == 0) { HandleEvent(EventTargetType.ET_LauncherGlobel, Convert.ToUInt32(cd.GoldNum), 1); //一炮获得多少金币 } } if (cd.CatchType == (Byte)CatchedType.CATCHED_SKILL) { HandleEvent(EventTargetType.ET_UseSkill, cd.SubType, 1); } } if (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() == 0 && PlayerRole.Instance.RoleInfo.RoleMe.GetSeat() != 0xff) //在桌子里 并且不在比赛之中 { PlayerRole.Instance.OnAddUserExp(Exp); } //根据位置 获得桌子上玩家的对象 //Byte Seat = SceneRuntime.ClientToServerSeat(cd.ClientSeat); //bool IsInMonth = (PlayerRole.Instance.RoleInfo.RoleMe.GetMonthID() != 0); ////如果在战场的话 进行处理 //RoleBase pRole = null; //if (PlayerRole.Instance.RoleInfo.RoleMe.GetSeat() == Seat) // pRole = PlayerRole.Instance.RoleInfo.RoleMe; //else //{ // pRole = PlayerRole.Instance.TableManager.GetTableRole(Seat); //} //if (pRole == null) // return; //添加金币 //if (IsInMonth) //{ // pRole.SetMonthScore((UInt32)(pRole.GetMonthScore() + cd.GoldNum)); // tagMonthChangeEvent pEvent = new tagMonthChangeEvent(pRole.GetUserID()); // MsgEventHandle.HandleMsg(pEvent); //} //else //{ // pRole.SetGlobel((UInt32)(pRole.GetGlobel() + cd.GoldNum)); // if(pRole == PlayerRole.Instance.RoleInfo.RoleMe) // { // tagRoleChangeEvent pEvent = new tagRoleChangeEvent(); // MsgEventHandle.HandleMsg(pEvent); // } // else // { // tagTableChangeEvent pEvent = new tagTableChangeEvent(pRole.GetUserID()); // MsgEventHandle.HandleMsg(pEvent); // } //} }
public void CatchFish(CatchedData cd) { PlayerRole.Instance.HandeCatchFishData(cd); PlayMusic(cd); m_LogicUI.ShowWonderfulUI(cd); }
public void ShowWonderfulUI(CatchedData cd) { if (m_BaseWndObject.activeSelf == true) { if (m_GlobalEffect.IsEnd == false) { m_GlobalEffect.Life = 0; } DestorySelf(); } float lifetime = 3.8f; float efttime = 0.1f; float delaytime = 0.1f; if (cd.CatchType == 2) { switch (cd.SubType) { case (byte)SkillType.SKILL_FREEZE: { lifetime = 3.8f; efttime = 0.2f; delaytime = 0.2f; } break; case (byte)SkillType.SKILL_LIGHTING: { lifetime = 3.8f; efttime = 2.0f; delaytime = 2.0f; } break; case (byte)SkillType.SKILL_TORNADO: { lifetime = 3.8f; efttime = 2.2f; delaytime = 2.2f; } break; } } m_LifeTime = lifetime; m_Scroe = cd.GoldNum; m_BaseWndObject.SetActive(true); m_SocreLabel.text = "0"; //播放特效 GameObject Eft = GameObject.Instantiate(m_EftObj) as GameObject; m_GlobalEffect = new GlobalEffectData(Eft, efttime, 4.5f); GlobalEffectMgr.Instance.AddEffect(m_GlobalEffect); GlobalEffectMgr.SetEffectOnUI(Eft); m_TweenScale.delay = delaytime; m_bDelay = true; m_DelayInterval = delaytime; m_bNumAinm = true; m_TweenScale.ResetToBeginning(); m_TweenScale.PlayForward(); }