Beispiel #1
0
 public P_ChiiHsingPaao() : base(CardName, PCardType.DefensorCard)
 {
     Point = 4;
     Index = 52;
     foreach (PTime Time in new PTime[] {
         PTime.Card.AfterBecomeTargetTime
     })
     {
         MoveInEquipTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = true,
                 Player = Player,
                 Time = Time,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return UseCardTag.TargetList.Contains(Player) && UseCardTag.Card.Type.Equals(PCardType.AmbushCard);
                 },
                 Effect = (PGame Game ) => {
                     AnnouceUseEquipmentSkill(Player);
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     UseCardTag.TargetList.Remove(Player);
                 }
             });
         });
     }
 }
Beispiel #2
0
 public P_KevAnKuanHuo() : base(CardName)
 {
     Point = 2;
     Index = 9;
     foreach (PTime Time in new PTime[] {
         PTime.Card.AfterBecomeTargetTime
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 100,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return UseCardTag.TargetList.Count >= 2 && UseCardTag.TargetList.Contains(Player) && UseCardTag.Card.Type.Equals(PCardType.SchemeCard);
                 },
                 Effect = (PGame Game) => {
                     List <PPlayer> Targets = new List <PPlayer>();
                     Game.Monitor.CallTime(PTime.Card.AfterEmitTargetTime, new PUseCardTag(Card, Player, Targets));
                     Game.CardManager.MoveCard(Card, Player.Area.HandCardArea, Game.CardManager.SettlingArea);
                     Game.Monitor.CallTime(PTime.Card.AfterBecomeTargetTime, new PUseCardTag(Card, Player, Targets));
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     #region 成就:不辞劳苦
                     if (UseCardTag.Card.Model is P_IITaiLao)
                     {
                         PArch.Announce(Game, Player, "不辞劳苦");
                     }
                     #endregion
                     UseCardTag.TargetList.Remove(Player);
                     PTrigger GetMoneyTrigger = null;
                     GetMoneyTrigger = new PTrigger(CardName + "[摸500]")
                     {
                         IsLocked = true,
                         Player = Player,
                         Time = PTime.Card.EndSettleTime,
                         Condition = (PGame _Game) => {
                             PUseCardTag _UseCardTag = _Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                             return _UseCardTag.Card.Equals(UseCardTag.Card);
                         },
                         Effect = (PGame _Game) => {
                             _Game.GetMoney(Player, 500);
                             Game.Monitor.RemoveTrigger(GetMoneyTrigger);
                         }
                     };
                     Game.Monitor.AddTrigger(GetMoneyTrigger);
                     Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                     Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                 }
             });
         });
     }
 }
Beispiel #3
0
 public P_HunShuiMoYoo() : base(CardName)
 {
     Point = 4;
     Index = 20;
     foreach (PTime Time in new PTime[] {
         PTime.Card.EndSettleTime
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 100,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return UseCardTag.TargetList.Count >= 2;
                 },
                 AICondition = (PGame Game) => {
                     if (Player.General is P_WuZhao && Player.RemainLimit(PSkillInfo.女权.Name))
                     {
                         return false;
                     }
                     int Value = 0;
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     UseCardTag.TargetList.ForEach((PPlayer _Player) => {
                         if (_Player.CanBeInjured && !(_Player.Defensor != null && _Player.Defensor.Model is P_YooHsi))
                         {
                             Value += PAiTargetChooser.InjureExpect(Game, Player, Player, _Player, 500, Card);
                         }
                     });
                     return Value >= 1000 && !Player.OutOfGame && P_PanYue.XianJuTest(Game, Player);
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.Injure(User, Target, 500, Card);
                 })
             });
         });
     }
 }
Beispiel #4
0
 public P_YinYooehChiiang() : base(CardName, PCardType.WeaponCard)
 {
     Point = 3;
     Index = 45;
     foreach (PTime Time in new PTime[] {
         PTime.Card.EndSettleTime
     })
     {
         MoveInEquipTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return !Game.NowPlayer.Equals(Player) && UseCardTag.User.Equals(Player);
                 },
                 Effect = (PGame Game) => {
                     AnnouceUseEquipmentSkill(Player);
                     PPlayer TargetPlayer = null;
                     if (Player.IsAI)
                     {
                         TargetPlayer = PAiTargetChooser.InjureTarget(Game, Player, Player, PTrigger.Except(Player), 1000, Card);
                     }
                     else
                     {
                         TargetPlayer = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Player), CardName);
                     }
                     if (TargetPlayer != null)
                     {
                         Game.Injure(Player, TargetPlayer, 1000, Card);
                     }
                 }
             });
         });
     }
 }
Beispiel #5
0
 public P_TsaangLang() : base(CardName, PCardType.TrafficCard)
 {
     Point = 3;
     Index = 57;
     foreach (PTime Time in new PTime[] {
         PTime.Injure.EmitInjure
     })
     {
         MoveInEquipTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 50,
                 Condition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     bool CardSource = InjureTag.InjureSource != null && InjureTag.InjureSource is PCard && ((PCard)InjureTag.InjureSource).Model is PSchemeCardModel;
                     if (CardSource)
                     {
                         PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                         if (UseCardTag != null && UseCardTag.TargetList.Count == 1 && UseCardTag.Card.Type.Equals(PCardType.SchemeCard))
                         {
                             return Player.Equals(InjureTag.FromPlayer) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && InjureTag.ToPlayer.Area.OwnerCardNumber > 0;
                         }
                     }
                     return false;
                 },
                 Effect = (PGame Game ) => {
                     AnnouceUseEquipmentSkill(Player);
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     Game.GetCardFrom(Player, InjureTag.ToPlayer);
                 }
             });
         });
     }
 }
Beispiel #6
0
    private List <PPlayer> AIEmitTargets(PGame Game, PPlayer Player)
    {
        PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);

        return(UseCardTag.TargetList);
    }
Beispiel #7
0
 public PCardArch() : base("卡牌类成就")
 {
     TriggerList.Add(new PTrigger("吃掉电脑屏幕")
     {
         IsLocked = true,
         Time     = PTime.EndGameTime,
         Effect   = (PGame Game) => {
             Game.GetWinner().ForEach((PPlayer Player) => {
                 if (Player.Area.HandCardArea.CardNumber >= 17)
                 {
                     Announce(Game, Player, "吃掉电脑屏幕");
                 }
             });
         }
     });
     TriggerList.Add(new PTrigger("海天一色")
     {
         IsLocked = true,
         Time     = PTime.DieTime,
         Effect   = (PGame Game) => {
             PDyingTag DyingTag   = Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName);
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             if (InjureTag != null && DyingTag != null && DyingTag.Player.Equals(InjureTag.ToPlayer) && InjureTag.InjureSource is PCard && ((PCard)InjureTag.InjureSource).Model is P_ManTiienKuoHai)
             {
                 PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                 if (UseCardTag != null && UseCardTag.User != null && UseCardTag.Card.Equals(InjureTag.InjureSource))
                 {
                     Announce(Game, UseCardTag.User, "海天一色");
                 }
             }
         }
     });
     TriggerList.Add(new PTrigger("口蜜腹剑")
     {
         IsLocked = true,
         Time     = PTime.DieTime,
         Effect   = (PGame Game) => {
             PDyingTag DyingTag   = Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName);
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             if (InjureTag != null && DyingTag != null && DyingTag.Player.Equals(InjureTag.ToPlayer) && InjureTag.InjureSource is PCard && ((PCard)InjureTag.InjureSource).Model is P_HsiaoLiTsaangTao)
             {
                 PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                 if (UseCardTag != null && UseCardTag.User != null && UseCardTag.Card.Equals(InjureTag.InjureSource))
                 {
                     Announce(Game, UseCardTag.User, "口蜜腹剑");
                 }
             }
         }
     });
     #region 出其不意
     string Chuqby = "出其不意";
     TriggerList.Add(new PTrigger("出其不意[初始化]")
     {
         IsLocked = true,
         Time     = PPeriod.StartTurn.During,
         Effect   = (PGame Game) => {
             Game.NowPlayer.Tags.CreateTag(new PUsedTag(Chuqby, 1));
         }
     });
     TriggerList.Add(new PTrigger("出其不意[使用暗度陈仓]")
     {
         IsLocked  = true,
         Time      = PTime.Card.EndSettleTime,
         Condition = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             return(UseCardTag.TargetList.Contains(Game.NowPlayer) && UseCardTag.Card.Model is P_AnTuCheevnTsaang);
         },
         Effect = (PGame Game) => {
             Game.NowPlayer.Tags.FindPeekTag <PUsedTag>(PUsedTag.TagNamePrefix + Chuqby).Count = 1;
         }
     });
     TriggerList.Add(new PTrigger("出其不意")
     {
         IsLocked  = true,
         Time      = PTime.PurchaseLandTime,
         Condition = (PGame Game) => {
             PPurchaseLandTag PurchaseLandTag = Game.TagManager.FindPeekTag <PPurchaseLandTag>(PPurchaseLandTag.TagName);
             return(PurchaseLandTag.Player.Equals(Game.NowPlayer) && PurchaseLandTag.Block.IsBusinessLand && Game.NowPlayer.Tags.FindPeekTag <PUsedTag>(PUsedTag.TagNamePrefix + Chuqby).Count > 0);
         },
         Effect = (PGame Game) => {
             Announce(Game, Game.NowPlayer, "出其不意");
         }
     });
     #endregion
     #region 百足之虫
     string Baizzc = "百足之虫";
     MultiPlayerTriggerList.Add((PPlayer Player) =>
                                new PTrigger("百足之虫[初始化]")
     {
         IsLocked = true,
         Time     = PTime.StartGameTime,
         Effect   = (PGame Game) => {
             Player.Tags.CreateTag(new PUsedTag(Baizzc, 2));
         }
     });
     MultiPlayerTriggerList.Add((PPlayer Player) =>
                                new PTrigger("百足之虫[使用借尸还魂]")
     {
         IsLocked  = true,
         Time      = PTime.Card.EndSettleTime,
         Condition = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             return(UseCardTag.TargetList.Contains(Player) && UseCardTag.Card.Model is P_ChiehShihHuanHun);
         },
         Effect = (PGame Game) => {
             PUsedTag UsedTag = Player.Tags.FindPeekTag <PUsedTag>(PUsedTag.TagNamePrefix + Baizzc);
             UsedTag.Count++;
             if (UsedTag.Count >= UsedTag.Limit)
             {
                 Announce(Game, Player, Baizzc);
             }
         }
     });
     #endregion
     #region 护花使者
     string Huhsz = "护花使者";
     MultiPlayerTriggerList.Add((PPlayer Player) =>
                                new PTrigger("护花使者[初始化]")
     {
         IsLocked = true,
         Time     = PPeriod.StartTurn.Start,
         Effect   = (PGame Game) => {
             Player.Tags.PopTag <PHuszTag>(PHuszTag.TagName);
         }
     });
     TriggerList.Add(new PTrigger("护花使者[使用调虎离山]")
     {
         IsLocked  = true,
         Time      = PTime.Card.EndSettleTime,
         Condition = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             return(UseCardTag.Card.Model is P_TiaoHuLiShan);
         },
         Effect = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             UseCardTag.TargetList.ForEach((PPlayer Player) => {
                 if (!Player.Tags.ExistTag(PHuszTag.TagName) && Player.TeamIndex == UseCardTag.User.TeamIndex)
                 {
                     Player.Tags.CreateTag(new PHuszTag(UseCardTag.User));
                 }
             });
         }
     });
     TriggerList.Add(new PTrigger("护花使者")
     {
         IsLocked  = true,
         Time      = PTime.Injure.StartSettle,
         Condition = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             return(InjureTag.ToPlayer != null && InjureTag.ToPlayer.Tags.ExistTag(PHuszTag.TagName));
         },
         Effect = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             Announce(Game, InjureTag.ToPlayer.Tags.FindPeekTag <PHuszTag>(PHuszTag.TagName).User, Huhsz);
         }
     });
     #endregion
     TriggerList.Add(new PTrigger("搬石砸脚")
     {
         IsLocked = true,
         Time     = PTime.Card.EndSettleTime,
         Effect   = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             if (UseCardTag.Card.Model is P_PaaoChuanYinYoo &&
                 UseCardTag.TargetList.TrueForAll((PPlayer Player) => Player.TeamIndex == UseCardTag.User.TeamIndex))
             {
                 Announce(Game, UseCardTag.User, "搬石砸脚");
             }
         }
     });
     #region 水至清则无鱼
     string Shuizqzwy = "水至清则无鱼";
     TriggerList.Add(new PTrigger("水至清则无鱼[初始化]")
     {
         IsLocked = true,
         Time     = PTime.Card.AfterEmitTargetTime,
         Effect   = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             if (UseCardTag.Card.Model is P_HunShuiMoYoo)
             {
                 UseCardTag.User.Tags.CreateTag(new PCardInjureTag(UseCardTag.Card, 0));
             }
         }
     });
     TriggerList.Add(new PTrigger("水至清则无鱼[增量计算]")
     {
         IsLocked = true,
         Time     = PTime.Injure.EndSettle,
         Effect   = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             if (InjureTag.Injure > 0 && InjureTag.FromPlayer != null &&
                 InjureTag.InjureSource is PCard && ((PCard)InjureTag.InjureSource).Model is P_HunShuiMoYoo &&
                 InjureTag.FromPlayer.Tags.ExistTag(PCardInjureTag.TagName + P_HunShuiMoYoo.CardName))
             {
                 InjureTag.FromPlayer.Tags.FindPeekTag <PCardInjureTag>(PCardInjureTag.TagName + P_HunShuiMoYoo.CardName).TotalInjure += InjureTag.Injure;
             }
         }
     });
     TriggerList.Add(new PTrigger("水至清则无鱼")
     {
         IsLocked = true,
         Time     = PTime.Card.EndSettleTime,
         Effect   = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             if (UseCardTag.Card.Model is P_HunShuiMoYoo && UseCardTag.User.Tags.ExistTag(PCardInjureTag.TagName + P_HunShuiMoYoo.CardName))
             {
                 PCardInjureTag CardInjureTag = UseCardTag.User.Tags.PopTag <PCardInjureTag>(PCardInjureTag.TagName + P_HunShuiMoYoo.CardName);
                 if (CardInjureTag.TotalInjure >= 3500)
                 {
                     Announce(Game, UseCardTag.User, Shuizqzwy);
                 }
             }
         }
     });
     #endregion
     #region 逃出生天
     string Taocst = "逃出生天";
     TriggerList.Add(new PTrigger("逃出生天[初始化]")
     {
         IsLocked = true,
         Time     = PPeriod.StartTurn.During,
         Effect   = (PGame Game) => {
             Game.NowPlayer.Tags.CreateTag(new PUsedTag(Taocst, 1));
         }
     });
     TriggerList.Add(new PTrigger("逃出生天[使用金蝉脱壳]")
     {
         IsLocked  = true,
         Time      = PTime.Card.EndSettleTime,
         Condition = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             return(Game.NowPlayer.Equals(UseCardTag.User) && UseCardTag.Card.Model is P_ChinChaanToowChiiao);
         },
         Effect = (PGame Game) => {
             Game.NowPlayer.Tags.FindPeekTag <PUsedTag>(PUsedTag.TagNamePrefix + Taocst).Count = 1;
         }
     });
     TriggerList.Add(new PTrigger("逃出生天")
     {
         IsLocked  = true,
         Time      = PPeriod.SettleStage.Before,
         Condition = (PGame Game) => {
             return(Game.NowPlayer.Tags.FindPeekTag <PUsedTag>(PUsedTag.TagNamePrefix + Taocst).Count > 0 &&
                    (Game.NowPlayer.Position.GetMoneyStopPercent > 0 || Game.NowPlayer.Position.GetMoneyStopSolid > 0));
         },
         Effect = (PGame Game) => {
             Announce(Game, Game.NowPlayer, Taocst);
         }
     });
     #endregion
     #region 无处可逃
     string Wuckt = "无处可逃";
     TriggerList.Add(new PTrigger("无处可逃[初始化]")
     {
         IsLocked = true,
         Time     = PTime.Card.AfterEmitTargetTime,
         Effect   = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             if (UseCardTag.Card.Model is P_KuanMevnChoTsev)
             {
                 UseCardTag.User.Tags.CreateTag(new PCardInjureTag(UseCardTag.Card, 0));
             }
         }
     });
     TriggerList.Add(new PTrigger("无处可逃[增量计算]")
     {
         IsLocked = true,
         Time     = PTime.Injure.EndSettle,
         Effect   = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             if (InjureTag.Injure > 0 && InjureTag.FromPlayer != null &&
                 InjureTag.InjureSource is PCard && ((PCard)InjureTag.InjureSource).Model is P_KuanMevnChoTsev &&
                 InjureTag.FromPlayer.Tags.ExistTag(PCardInjureTag.TagName + P_KuanMevnChoTsev.CardName))
             {
                 InjureTag.FromPlayer.Tags.FindPeekTag <PCardInjureTag>(PCardInjureTag.TagName + P_KuanMevnChoTsev.CardName).TotalInjure += InjureTag.Injure;
             }
         }
     });
     TriggerList.Add(new PTrigger("无处可逃")
     {
         IsLocked = true,
         Time     = PTime.Card.EndSettleTime,
         Effect   = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             if (UseCardTag.Card.Model is P_KuanMevnChoTsev && UseCardTag.User.Tags.ExistTag(PCardInjureTag.TagName + P_KuanMevnChoTsev.CardName))
             {
                 PCardInjureTag CardInjureTag = UseCardTag.User.Tags.PopTag <PCardInjureTag>(PCardInjureTag.TagName + P_KuanMevnChoTsev.CardName);
                 if (CardInjureTag.TotalInjure >= 7000)
                 {
                     Announce(Game, UseCardTag.User, Wuckt);
                 }
             }
         }
     });
     #endregion
     TriggerList.Add(new PTrigger("不安好心")
     {
         IsLocked = true,
         Time     = PTime.DieTime,
         Effect   = (PGame Game) => {
             PDyingTag DyingTag   = Game.TagManager.FindPeekTag <PDyingTag>(PDyingTag.TagName);
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             if (InjureTag != null && DyingTag != null && DyingTag.Player.Equals(InjureTag.ToPlayer) && InjureTag.InjureSource is PCard && ((PCard)InjureTag.InjureSource).Model is P_ChiaTaoFaKuo)
             {
                 PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                 if (UseCardTag != null && UseCardTag.User != null && UseCardTag.Card.Equals(InjureTag.InjureSource))
                 {
                     Announce(Game, UseCardTag.User, "不安好心");
                 }
             }
         }
     });
     #region 装疯卖傻
     string Zhuangfms = "装疯卖傻";
     MultiPlayerTriggerList.Add((PPlayer Player) =>
                                new PTrigger("装疯卖傻[初始化]")
     {
         IsLocked = true,
         Time     = PPeriod.StartTurn.Start,
         Effect   = (PGame Game) => {
             Player.Tags.PopTag <PZhuangfmsTag>(PZhuangfmsTag.TagName);
         }
     });
     TriggerList.Add(new PTrigger("装疯卖傻[使用假痴不癫]")
     {
         IsLocked  = true,
         Time      = PTime.Card.EndSettleTime,
         Condition = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             return(UseCardTag.Card.Model is P_ChiaChiihPuTien);
         },
         Effect = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             UseCardTag.TargetList.ForEach((PPlayer Player) => {
                 if (!Player.Tags.ExistTag(PZhuangfmsTag.TagName) && Player.TeamIndex == UseCardTag.User.TeamIndex)
                 {
                     Player.Tags.CreateTag(new PZhuangfmsTag(UseCardTag.User));
                 }
             });
         }
     });
     TriggerList.Add(new PTrigger("装疯卖傻")
     {
         IsLocked  = true,
         Time      = PTime.Injure.StartSettle,
         Condition = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             return(InjureTag.ToPlayer != null && InjureTag.ToPlayer.Tags.ExistTag(PZhuangfmsTag.TagName));
         },
         Effect = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             Announce(Game, InjureTag.ToPlayer.Tags.FindPeekTag <PZhuangfmsTag>(PZhuangfmsTag.TagName).User, Zhuangfms);
         }
     });
     #endregion
     #region  病相怜
     TriggerList.Add(new PTrigger("同病相怜")
     {
         IsLocked  = true,
         Time      = PTime.Injure.AcceptInjure,
         Condition = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             return(InjureTag.ToPlayer != null && InjureTag.Injure > 0 && InjureTag.ToPlayer.Tags.ExistTag(PTag.LockedTag.Name) &&
                    InjureTag.InjureSource is PCard && ((PCard)InjureTag.InjureSource).Model is P_ShanTien);
         },
         Effect = (PGame Game) => {
             PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
             Announce(Game, InjureTag.ToPlayer, "同病相怜");
         }
     });
     #endregion
     #region 谁是赢家
     string Uzuyj = "谁是赢家";
     MultiPlayerTriggerList.Add((PPlayer Player) =>
                                new PTrigger("谁是赢家[初始化]")
     {
         IsLocked = true,
         Time     = PPeriod.StartTurn.Start,
         Effect   = (PGame Game) => {
             Player.Tags.PopTag <PTag>(Uzuyj);
         }
     });
     TriggerList.Add(new PTrigger("谁是赢家[使用走为上计]")
     {
         IsLocked  = true,
         Time      = PTime.Card.EndSettleTime,
         Condition = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             return(UseCardTag.Card.Model is P_TsouWeiShangChi);
         },
         Effect = (PGame Game) => {
             PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             UseCardTag.TargetList.ForEach((PPlayer Player) => {
                 if (!Player.Tags.ExistTag(Uzuyj))
                 {
                     Player.Tags.CreateTag(new PTag(Uzuyj)
                     {
                         Visible = false
                     });
                 }
             });
         }
     });
     TriggerList.Add(new PTrigger("谁是赢家")
     {
         IsLocked = true,
         Time     = PTime.EndGameTime,
         Effect   = (PGame Game) => {
             Game.GetWinner().ForEach((PPlayer Player) => {
                 if (Player.Tags.ExistTag(Uzuyj))
                 {
                     Announce(Game, Player, Uzuyj);
                 }
             });
         }
     });
     #endregion
 }
 public P_ShevngTungChiHsi() : base(CardName)
 {
     Point = 1;
     Index = 6;
     foreach (PTime Time in new PTime[] {
         PTime.Card.AfterEmitTargetTime
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 100,
                 Condition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     return UseCardTag.TargetList.Count == 1 && UseCardTag.Card.Type.Equals(PCardType.SchemeCard) && !UseCardTag.Card.Name.Equals(P_ChinChaanToowChiiao.CardName);
                 },
                 AICondition = (PGame Game) => {
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     if (UseCardTag.Card.Model.Name.Equals(P_ManTiienKuoHai.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_WeiWeiChiuChao.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_CheevnHuoTaChieh.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_LiTaiTaaoChiang.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ShunShouChiienYang.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_TaTsaaoChingShev.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_KuanMevnChoTsev.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ChihSangMaHuai.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_FanChienChi.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ChiehTaoShaJevn.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_PaaoChuanYinYoo.CardName) ||
                         UseCardTag.Card.Model.Name.Equals(P_ChiaTaoFaKuo.CardName))
                     {
                         return UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex && UseCardTag.User.TeamIndex != Player.TeamIndex;
                     }
                     else if (UseCardTag.Card.Name.Equals(P_WuChungShevngYou.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_AnTuCheevnTsaang.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_ChiehShihHuanHun.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_YooenChiaoChinKung.CardName) ||
                              UseCardTag.Card.Model.Name.Equals(P_TsouWeiShangChi.CardName))
                     {
                         return UseCardTag.TargetList[0].TeamIndex != Player.TeamIndex;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_YooChiinKuTsung.CardName))
                     {
                         return UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex && Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure <= 3000;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_ChiinTsevChiinWang.CardName))
                     {
                         return UseCardTag.User.TeamIndex != Player.TeamIndex && PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                             if (Player.TeamIndex == _Player.TeamIndex)
                             {
                                 return PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                             }
                             else
                             {
                                 return -PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                             }
                         }).Value - PAiMapAnalyzer.ChangeFaceExpect(Game, UseCardTag.TargetList[0]) * (UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex ? 1 : -1) >= 3000;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_ShangWuChoouTii.CardName))
                     {
                         int NowValue = PAiMapAnalyzer.Expect(Game, UseCardTag.TargetList[0], UseCardTag.TargetList[0].Position) * (UseCardTag.TargetList[0].TeamIndex == Player.TeamIndex ? 1 : -1);
                         int MaxValue = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                             if (_Player.TeamIndex == Player.TeamIndex)
                             {
                                 return PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                             }
                             else
                             {
                                 return -PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                             }
                         }, true).Value;
                         return MaxValue - NowValue >= 3000;
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_KuungCheevngChi.CardName))
                     {
                         KeyValuePair <PPlayer, int> Target = PMath.Max(Game.Enemies(Player), (PPlayer _Player) => _Player.Area.HandCardArea.CardNumber);
                         return Target.Value >= 3 && !UseCardTag.TargetList[0].Equals(Target.Key);
                     }
                     else if (UseCardTag.Card.Model.Name.Equals(P_HsiaoLiTsaangTao.CardName))
                     {
                         return UseCardTag.User.TeamIndex != Player.TeamIndex && (UseCardTag.TargetList[0].TeamIndex != Player.TeamIndex || UseCardTag.TargetList[0].Area.EquipmentCardArea.CardNumber > 0 || UseCardTag.TargetList[0].Money <= 500);
                     }
                     return false;
                 },
                 Effect = (PGame Game) => {
                     List <PPlayer> Targets = new List <PPlayer>();
                     Game.Monitor.CallTime(PTime.Card.AfterEmitTargetTime, new PUseCardTag(Card, Player, Targets));
                     Game.CardManager.MoveCard(Card, Player.Area.HandCardArea, Game.CardManager.SettlingArea);
                     Game.Monitor.CallTime(PTime.Card.AfterBecomeTargetTime, new PUseCardTag(Card, Player, Targets));
                     PUseCardTag UseCardTag = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
                     PPlayer Target = null;
                     if (Player.IsUser)
                     {
                         List <PPlayer> TargetList = new List <PPlayer>()
                         {
                             null
                         };
                         TargetList.AddRange(Game.PlayerList.FindAll((PPlayer _Player) => !_Player.Equals(UseCardTag.TargetList[0]) && _Player.IsAlive));
                         List <string> TargetNameList = TargetList.ConvertAll((PPlayer _Player) => {
                             if (_Player == null)
                             {
                                 return "令该计策牌无效";
                             }
                             else
                             {
                                 return "转移给:" + _Player.Name;
                             }
                         });
                         Target = TargetList[PNetworkManager.NetworkServer.ChooseManager.Ask(Player, "选择一项", TargetNameList.ToArray())];
                     }
                     else
                     {
                         if (UseCardTag.Card.Model.Name.Equals(P_ManTiienKuoHai.CardName))
                         {
                             Target = PAiTargetChooser.InjureTarget(Game, UseCardTag.User, Player, PTrigger.Except(UseCardTag.TargetList[0]), 700, UseCardTag.Card, true);
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_KuanMevnChoTsev.CardName) ||
                                  UseCardTag.Card.Model.Name.Equals(P_ChiaTaoFaKuo.CardName))
                         {
                             Target = PAiTargetChooser.InjureTarget(Game, UseCardTag.User, Player, PTrigger.Except(UseCardTag.TargetList[0]), 1000, UseCardTag.Card, true);
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ChihSangMaHuai.CardName))
                         {
                             Target = PAiTargetChooser.InjureTarget(Game, Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).FromPlayer, Player, null, Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure, Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).InjureSource, true);
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ChiinTsevChiinWang.CardName))
                         {
                             Target = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                                 if (Player.TeamIndex == _Player.TeamIndex)
                                 {
                                     return PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                                 }
                                 else
                                 {
                                     return -PAiMapAnalyzer.ChangeFaceExpect(Game, _Player);
                                 }
                             }).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_TaTsaaoChingShev.CardName))
                         {
                             List <PPlayer> PossibleEnemies = Game.Enemies(Player).FindAll((PPlayer _Player) => Player.HasHouse);
                             if (PossibleEnemies.Count > 0)
                             {
                                 Target = PossibleEnemies[PMath.RandInt(0, PossibleEnemies.Count - 1)];
                             }
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ChiehShihHuanHun.CardName))
                         {
                             int MaxMoney = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                                 return _Player.Money;
                             }).Value;
                             Target = PMath.Max(Game.PlayerList, (PPlayer _Player) => {
                                 int Delta = Math.Min(10000, MaxMoney - _Player.Money) - 2000 * _Player.Area.HandCardArea.CardNumber - (int)PMath.Sum(_Player.Area.EquipmentCardArea.CardList.ConvertAll((PCard _Card) => (double)_Card.Model.AIInEquipExpectation(Game, _Player)));
                                 if (_Player.TeamIndex == Player.TeamIndex)
                                 {
                                     return Delta;
                                 }
                                 else
                                 {
                                     return -Delta;
                                 }
                             }).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_WuChungShevngYou.CardName) ||
                                  UseCardTag.Card.Name.Equals(P_AnTuCheevnTsaang.CardName))
                         {
                             Target = PAiCardExpectation.MostValuableCardUser(Game, Game.Teammates(Player));
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_ShangWuChoouTii.CardName))
                         {
                             Target = PMath.Max(Game.AlivePlayers(), (PPlayer _Player) => {
                                 if (_Player.TeamIndex == Player.TeamIndex)
                                 {
                                     return PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                                 }
                                 else
                                 {
                                     return -PAiMapAnalyzer.Expect(Game, _Player, _Player.Position);
                                 }
                             }, true).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_KuungCheevngChi.CardName))
                         {
                             Target = PMath.Max(Game.Enemies(Player), (PPlayer _Player) => _Player.Area.HandCardArea.CardNumber).Key;
                         }
                         else if (UseCardTag.Card.Model.Name.Equals(P_TsouWeiShangChi.CardName))
                         {
                             Target = PMath.Max(Game.Teammates(Player), (PPlayer _Player) => PAiMapAnalyzer.OutOfGameExpect(Game, Player)).Key;
                         }
                     }
                     if (Target == null || Target == UseCardTag.TargetList[0])
                     {
                         PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder("声东击西:无效"));
                         #region 成就:地府的公正
                         if (UseCardTag.Card.Model is P_ChiehShihHuanHun)
                         {
                             PArch.Announce(Game, Player, "地府的公正");
                         }
                         #endregion
                         UseCardTag.TargetList.Clear();
                     }
                     else
                     {
                         PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder("声东击西:转移给" + Target.Name));
                         UseCardTag.TargetList[0] = Target;
                     }
                     Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                     Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                 }
             });
         });
     }
 }
Beispiel #9
0
 public PCardTriggerInstaller() : base("卡牌移入移出区域")
 {
     TriggerList.Add(new PTrigger("游戏开始时摸牌")
     {
         IsLocked = true,
         Time     = PTime.StartGameTime,
         Effect   = (PGame Game) => {
             Game.PlayerList.ForEach((PPlayer Player) => {
                 Game.GetCard(Player, Config.StartGameCardCount);
                 int LuckyCardCount = 0;
                 while (LuckyCardCount < 3 && Player.IsUser && PNetworkManager.NetworkServer.ChooseManager.AskYesOrNo(Player, "是否使用手气卡?剩余次数=" + (3 - LuckyCardCount)))
                 {
                     Game.CardManager.ThrowAll(Player.Area);
                     LuckyCardCount++;
                     Game.GetCard(Player, Config.StartGameCardCount);
                 }
             });
         }
     });
     TriggerList.Add(new PTrigger("卡牌移入手牌装载触发器")
     {
         IsLocked  = true,
         Time      = PTime.Card.EnterAreaTime,
         Condition = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             return(MoveTagFlag.Destination.IsHandCardArea());
         },
         Effect = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             PPlayer Accepter         = MoveTagFlag.Destination.Owner;
             MoveTagFlag.Card.MoveInHandTriggerList = MoveTagFlag.Card.Model.MoveInHandTriggerList.ConvertAll((Func <PPlayer, PCard, PTrigger> Trigger) => Trigger(Accepter, MoveTagFlag.Card));
             MoveTagFlag.Card.MoveInHandTriggerList.ForEach((PTrigger Trigger) => {
                 Game.Monitor.AddTrigger(Trigger);
             });
         }
     });
     TriggerList.Add(new PTrigger("卡牌移出手牌摘下触发器")
     {
         IsLocked  = true,
         Time      = PTime.Card.LeaveAreaTime,
         Condition = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             return(MoveTagFlag.Source.IsHandCardArea());
         },
         Effect = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             PPlayer Giver            = MoveTagFlag.Source.Owner;
             MoveTagFlag.Card.MoveInHandTriggerList.ForEach((PTrigger Trigger) => {
                 Game.Monitor.RemoveTrigger(Trigger);
             });
         }
     });
     TriggerList.Add(new PTrigger("卡牌移入装备区装载触发器")
     {
         IsLocked  = true,
         Time      = PTime.Card.EnterAreaTime,
         Condition = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             return(MoveTagFlag.Destination.IsEquipmentArea());
         },
         Effect = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             PPlayer Accepter         = MoveTagFlag.Destination.Owner;
             MoveTagFlag.Card.MoveInEquipTriggerList = MoveTagFlag.Card.Model.MoveInEquipTriggerList.ConvertAll((Func <PPlayer, PCard, PTrigger> Trigger) => Trigger(Accepter, MoveTagFlag.Card));
             MoveTagFlag.Card.MoveInEquipTriggerList.ForEach((PTrigger Trigger) => {
                 Game.Monitor.AddTrigger(Trigger);
             });
         }
     });
     TriggerList.Add(new PTrigger("卡牌移出装备区摘下触发器")
     {
         IsLocked  = true,
         Time      = PTime.Card.LeaveAreaTime,
         Condition = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             return(MoveTagFlag.Source.IsEquipmentArea());
         },
         Effect = (PGame Game) => {
             PMoveCardTag MoveTagFlag = Game.TagManager.FindPeekTag <PMoveCardTag>(PMoveCardTag.TagName);
             PPlayer Giver            = MoveTagFlag.Source.Owner;
             MoveTagFlag.Card.MoveInEquipTriggerList.ForEach((PTrigger Trigger) => {
                 Game.Monitor.RemoveTrigger(Trigger);
             });
         }
     });
     TriggerList.Add(new PTrigger("通知客户端卡牌指定目标")
     {
         IsLocked = true,
         Time     = PTime.Card.AfterEmitTargetTime,
         Effect   = (PGame Game) => {
             PUseCardTag UseCardTag    = Game.TagManager.FindPeekTag <PUseCardTag>(PUseCardTag.TagName);
             PPlayer User              = UseCardTag.User;
             PCard Card                = UseCardTag.Card;
             List <PPlayer> TargetList = UseCardTag.TargetList;
             if (User != null && Card != null && TargetList != null && !TargetList.Contains(null))
             {
                 PNetworkManager.NetworkServer.TellClients(new PPushTextOrder(User.Index.ToString(), Card.Model.Name, PPushType.Information.Name));
                 if (Card.Name.Equals(Card.Model.Name))
                 {
                     PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(User.Name + "使用了" + Card.Name));
                 }
                 else
                 {
                     PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder(User.Name + "把" + Card.Name + "当做" + Card.Model.Name + "使用"));
                 }
                 PNetworkManager.NetworkServer.TellClients(new PShowInformationOrder("目标:" + string.Join(",", TargetList.ConvertAll((PPlayer Player) => Player.Name))));
             }
         }
     });
 }