Exemplo n.º 1
0
 public PChiaTaoFaKuoTriggerInstaller() : base("假道伐虢的记录")
 {
     TriggerList.Add(new PTrigger("假道伐虢[开始记录]")
     {
         IsLocked = true,
         Time     = PPeriod.StartTurn.During,
         Effect   = (PGame Game) => {
             Game.TagManager.PopTag <PChiaTaoFaKuoTag>(PChiaTaoFaKuoTag.TagName);
             Game.TagManager.CreateTag(new PChiaTaoFaKuoTag(new List <PPlayer>()));
         }
     });
     TriggerList.Add(new PTrigger("假道伐虢[经过土地]")
     {
         IsLocked = true,
         Time     = PTime.MovePositionTime,
         Effect   = (PGame Game) => {
             PTransportTag TransportTag = Game.TagManager.FindPeekTag <PTransportTag>(PTransportTag.TagName);
             PPlayer Lord = TransportTag.Destination.Lord;
             if (Lord != null && !Lord.Equals(Game.NowPlayer))
             {
                 PChiaTaoFaKuoTag ChiaTaoFaKuoTag = Game.TagManager.FindPeekTag <PChiaTaoFaKuoTag>(PChiaTaoFaKuoTag.TagName);
                 if (!ChiaTaoFaKuoTag.LordList.Contains(Lord))
                 {
                     ChiaTaoFaKuoTag.LordList.Add(Lord);
                 }
             }
         }
     });
 }
 public PTransportTriggerInstaller() : base("移动位置")
 {
     TriggerList.Add(new PTrigger("移动位置")
     {
         IsLocked = true,
         Time     = PTime.MovePositionTime,
         Effect   = (PGame Game) => {
             PTransportTag Tag = Game.TagManager.FindPeekTag <PTransportTag>(PTransportTag.TagName);
             if (Tag.Player != null && Tag.Destination != null)
             {
                 Tag.Player.Position = Tag.Destination;
                 PNetworkManager.NetworkServer.TellClients(new PMovePositionOrder(Tag.Player.Index.ToString(), Tag.Destination.Index.ToString()));
             }
         }
     });
 }