public PRefreshHandCardsOrder() : base("refresh_hand_cards", null, (string[] args) => { PAnimation.AddAnimation("更新手牌区", () => { PUIManager.GetUI <PMapUI>().HandCardArea.Refresh(args); }); }) { }
public PRefreshAmbushOrder() : base("refresh_ambush", null, (string[] args) => { PAnimation.AddAnimation("更新伏兵区", () => { PUIManager.GetUI <PMapUI>().AmbushCardArea.Refresh(args); }); }) { }
public PRefreshEquipmentsOrder() : base("refresh_equipments", null, (string[] args) => { PAnimation.AddAnimation("更新装备区", () => { PUIManager.GetUI <PMapUI>().EquipCardArea.Refresh(args); }); }) { }
/// <summary> /// 跟踪某个玩家的棋子 /// </summary> /// <param name="Player"></param> public void SetTracking(PPlayer Player) { PAnimation.AddAnimation("转换跟踪目标", () => { IsTracking = false; Tracking = PUIManager.GetUI <PMapUI>().Scene.PlayerGroup.GroupUIList[Player.Index].UIBackgroundImage; ChangePerspective(Tracking.position + Config.CameraLockedDistance); IsTracking = true; }); }
public PShowInformationOrder() : base("show_information", null, (string[] args) => { string Information = args[1]; PAnimation.AddAnimation("显示消息[" + Information + "]", () => { PUIManager.GetUI <PMapUI>().AddNewInformation(Information); }, 1, 0.2f); }) { }
public PAnnounceArchOrder() : base("announce_arch", null, (string[] args) => { PPlayer Player = PNetworkManager.NetworkClient.GameStatus.FindPlayer(Convert.ToInt32(args[1])); string ArchName = args[2]; if (Player != null && ArchName != null && PSystem.ArchManager.AnnounceArch(FindInstance <PArchInfo>(ArchName))) { PAnimation.PushAnimation(Player, "获得成就:" + ArchName, PPushType.Information); } }) { }
public PDieOrder() : base("die", null, (string[] args) => { int DiePlayerIndex = Convert.ToInt32(args[1]); PAnimation.AddAnimation("玩家死亡", () => { PNetworkManager.NetworkClient.GameStatus.FindPlayer(DiePlayerIndex).IsAlive = false; PUIManager.GetUI <PMapUI>().PlayerInformationGroup.GroupUIList[DiePlayerIndex].Initialize(PNetworkManager.NetworkClient.GameStatus.FindPlayer(DiePlayerIndex)); PUIManager.GetUI <PMapUI>().Scene.PlayerGroup.GroupUIList[DiePlayerIndex].Close(); }); }) { }
public PPushTextOrder() : base("push_text", null, (string[] args) => { PPlayer Player = PNetworkManager.NetworkClient.GameStatus.FindPlayer(Convert.ToInt32(args[1])); string TextToPush = args[2]; PPushType PushType = FindInstance <PPushType>(args[3]); if (Player != null && PushType != null) { PAnimation.PushAnimation(Player, TextToPush, PushType); } }) { }
/// <summary> /// 播放掷骰子的动画 /// </summary> /// <param name="DiceResult">掷骰子的结果</param> public void Dice(int DiceResult) { PAnimation.AddAnimation("掷骰子", () => { int DiceMiddleResult = PMath.RandInt(1, 6); DiceImage.sprite = DiceSpriteList[DiceMiddleResult - 1]; }, PAnimation.DiceAnimation.FrameNumber, PAnimation.DiceAnimation.TotalTime, () => { PUIManager.AddNewUIAction("掷骰子-显示最终结果", () => { DiceImage.sprite = DiceSpriteList[DiceResult - 1]; }); }, () => { DiceImage.gameObject.SetActive(true); }); }
public PRefreshMoneyOrder() : base("refresh_money", null, (string[] args) => { int PlayerIndex = int.Parse(args[1]); int Money = int.Parse(args[2]); PAnimation.AddAnimation("RefreshMoney-刷新信息栏", () => { if (0 <= PlayerIndex && PlayerIndex < PNetworkManager.NetworkClient.GameStatus.PlayerNumber) { PNetworkManager.NetworkClient.GameStatus.PlayerList[PlayerIndex].Money = Money; } PUIManager.GetUI <PMapUI>().PlayerInformationGroup.Update(PlayerIndex); }); }) { }
public PRefreshHandCardNumberOrder() : base("refresh_hand_card_number", null, (string[] args) => { int PlayerIndex = Convert.ToInt32(args[1]); int HandCardNumber = Convert.ToInt32(args[2]); PAnimation.AddAnimation("RefreshHandCardNumber-刷新信息栏", () => { if (0 <= PlayerIndex && PlayerIndex < PNetworkManager.NetworkClient.GameStatus.PlayerNumber) { PNetworkManager.NetworkClient.GameStatus.PlayerList[PlayerIndex].HandCardNumber = HandCardNumber; PUIManager.GetUI <PMapUI>().PlayerInformationGroup.Update(PlayerIndex); } }); }) { }
public PRefreshMarkStringOrder() : base("refresh_mark_string", null, (string[] args) => { int PlayerIndex = Convert.ToInt32(args[1]); string MarkString = args[2]; PAnimation.AddAnimation("RefreshMarkString-刷新信息栏", () => { if (0 <= PlayerIndex && PlayerIndex < PNetworkManager.NetworkClient.GameStatus.PlayerNumber) { PNetworkManager.NetworkClient.GameStatus.PlayerList[PlayerIndex].MarkString = MarkString; PUIManager.GetUI <PMapUI>().PlayerInformationGroup.Update(PlayerIndex); } }); }) { }
public PGameOverOrder() : base("game_over", null, (string[] args) => { string Winners = args[1]; int WinnerBonus = Convert.ToInt32(args[2]); int GetMoney = 2 + WinnerBonus; PSystem.UserManager.Money += GetMoney; PSystem.UserManager.Write(); PAnimation.AddAnimation("游戏结束", () => { PUIManager.GetUI <PMapUI>().Ask("游戏结束,银两+" + GetMoney, new string[] { "为" + Winners + "的胜利干杯!", "天佑" + Winners + "!" }); }); }) { }
public PCloseDiceOrder() : base("close_dice", null, (string[] args) => { int Frame = 0; PAnimation.AddAnimation("关闭骰子", () => { if (Frame == 0) { Frame = 1; } else { PUIManager.GetUI <PMapUI>().DiceImage.gameObject.SetActive(false); } }, 2, 0.3f); }) { }
public PRefreshBlockBasicOrder() : base("refresh_block_basic", null, (string[] args) => { int BlockIndex = Convert.ToInt32(args[1]); int LordIndex = Convert.ToInt32(args[2]); int HouseNumber = Convert.ToInt32(args[3]); int Price = Convert.ToInt32(args[5]); PBusinessType BusinessType = FindInstance <PBusinessType>(args[4]); PBlock Block = PNetworkManager.NetworkClient.GameStatus.Map.FindBlock(BlockIndex); PPlayer Lord = PNetworkManager.NetworkClient.GameStatus.FindPlayer(LordIndex); if (Block != null && BusinessType != null) { PAnimation.AddAnimation("刷新格子基本信息", () => { PPlayer OriginalLord = Block.Lord; Block.Lord = Lord; Block.Price = Price; Block.HouseNumber = HouseNumber; Block.BusinessType = BusinessType; PUIManager.GetUI <PMapUI>().Scene.BlockGroup.GroupUIList[BlockIndex].InitializeBlock(Block); if (OriginalLord != null) { if (Block.IsBusinessLand) { OriginalLord.BusinessLandNumber--; } else { OriginalLord.NormalLandNumber--; } PUIManager.GetUI <PMapUI>().PlayerInformationGroup.Update(OriginalLord.Index); } if (Lord != null) { if (Block.IsBusinessLand) { Lord.BusinessLandNumber++; } else { Lord.NormalLandNumber++; } PUIManager.GetUI <PMapUI>().PlayerInformationGroup.Update(Lord.Index); } }); } }) { }
public PStartPeriodOrder() : base("start_period", null, (string[] args) => { int NowPlayerIndex = Convert.ToInt32(args[1]); PPeriod Peroid = FindInstance <PPeriod>(args[2]); if (Peroid != null) { PNetworkManager.NetworkClient.GameStatus.NowPeriod = Peroid; PAnimation.AddAnimation("切换阶段为[" + Peroid + "]", () => { PUIManager.GetUI <PMapUI>().PlayerInformationGroup.GroupUIList.ForEach((PPlayerInformationBox Box) => { Box.PeriodText.gameObject.SetActive(false); }); Text CurrentPeriodText = PUIManager.GetUI <PMapUI>().PlayerInformationGroup.GroupUIList[NowPlayerIndex].PeriodText; CurrentPeriodText.text = Peroid.IsFreeTime() ? "空闲时间点" : Peroid.Name; CurrentPeriodText.gameObject.SetActive(true); PUIManager.GetUI <PMapUI>().EndFreeTimeButton.interactable = Peroid.IsFreeTime() && NowPlayerIndex == PSystem.PlayerIndex; }, 1, Config.ChangePeriodTime); } }) { }
public PHighlightBlockOrder() : base("hightlight_block", null, (string[] args) => { int BlockIndex = Convert.ToInt32(args[1]); int Frame = 0; if (PUIManager.IsCurrentUI <PMapUI>() && 0 <= BlockIndex && BlockIndex < PNetworkManager.NetworkClient.GameStatus.Map.BlockList.Count) { PAnimation.AddAnimation("高亮格子", () => { PBlockScene Scene = PUIManager.GetUI <PMapUI>().Scene.BlockGroup.GroupUIList[BlockIndex]; if (Frame == 0) { Frame = 1; Scene.BlockImage.gameObject.GetComponent <MeshRenderer>().material.color = PBlockScene.Config.HighlightedBlockColor; } else { Scene.BlockImage.gameObject.GetComponent <MeshRenderer>().material.color = PBlockScene.Config.DefaultBlockColor; } }, 2, 0.5f); } }) { }
public void PlayPlayerAnimation(PAnimation param) { switch (param) { case PAnimation.Wait: animator.Play(param.ToString()); break; case PAnimation.Run: animator.Play(param.ToString()); break; case PAnimation.Kebiyin_Capture: animator.SetTrigger("Arrest"); break; case PAnimation.Kebiyin_Kill: animator.SetTrigger("Killed"); break; default: break; } }
public PAskOrder() : base("ask", null, (string[] args) => { string Title = args[1]; int OptionNumber = Convert.ToInt32(args[2]); string[] Options = new string[OptionNumber]; string[] ToolTips = new string[OptionNumber]; for (int i = 0; i < OptionNumber; ++i) { Options[i] = args[i + 3]; } bool ToolTipEnabled = true; for (int i = 0; i < OptionNumber; ++i) { if (i + 3 + OptionNumber < args.Length) { ToolTips[i] = args[i + 3 + OptionNumber]; } else { ToolTipEnabled = false; break; } } #region 点将卡和手气卡 if (Title.Contains("点将卡")) { // 选将卡特殊判定 // 必须要有选将卡才启用 // 否则返回1 if (PSystem.UserManager.ChooseGeneral == 0) { PNetworkManager.NetworkClient.Send(new PChooseResultOrder("1")); return; } } if (Title.Contains("手气卡")) { if (PSystem.UserManager.Lucky == 0) { PNetworkManager.NetworkClient.Send(new PChooseResultOrder("1")); return; } } if (Title.Equals("点将")) { for (int i = 0; i < Options.Length; ++i) { if (!PSystem.UserManager.GeneralList.Contains(Options[i])) { Options[i] += "[未获得]"; } } } #endregion PAnimation.AddAnimation("Ask-打开选择框", () => { PUIManager.GetUI <PMapUI>().Ask(Title, Options, ToolTipEnabled ? ToolTips : null); }); }) { }
public void MovePlayer(int Index, Vector3 Destination) { PAnimation.MoveAnimation(GroupUIList[Index].UIBackgroundImage, Destination, PAnimation.MovePlayerAnimation.FrameNumber, PAnimation.MovePlayerAnimation.TotalTime); }
/// <summary> /// Playerの普通の行動Animaiton /// </summary> public void SetNormalAnimation(PAnimation anim) { animator.SetInteger(_Player, (int)anim); }