Exemplo n.º 1
0
    public P_FanKeevWeiChu() : base(CardName)
    {
        Point = 5;
        Index = 30;
        foreach (PTime Time in new PTime[] {
            PTime.Injure.AfterAcceptInjure
        })
        {
            MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
                return(new PTrigger(CardName)
                {
                    IsLocked = false,
                    Player = Player,
                    Time = Time,
                    AIPriority = 100,
                    Condition = (PGame Game) => {
                        PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                        if (!(InjureTag.InjureSource is PBlock))
                        {
                            return false;
                        }
                        else
                        {
                            PBlock Block = (PBlock)InjureTag.InjureSource;
                            return Player.Equals(InjureTag.ToPlayer) && InjureTag.Injure > 0 && InjureTag.InjureSource != null && !Player.Equals(Block.Lord) && Block.HouseNumber == 1;
                        }
                    },
                    AICondition = (PGame Game) => {
                        PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                        PBlock Block = (PBlock)InjureTag.InjureSource;
                        return Player.TeamIndex != Block.Lord.TeamIndex;
                    },
                    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));
                        PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                        PBlock Block = (PBlock)InjureTag.InjureSource;

                        Block.Lord = Player;
                        PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Block.Index.ToString()));
                        PNetworkManager.NetworkServer.TellClients(new PRefreshBlockBasicOrder(Block));

                        #region 成就:我的地盘我做主
                        if (Block.BusinessType.Equals(PBusinessType.Castle))
                        {
                            PArch.Announce(Game, Player, "我的地盘我做主");
                        }
                        #endregion

                        Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                        Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                    }
                });
            });
        }
    }
Exemplo n.º 2
0
 public P_YooChiinKuTsung() : base(CardName)
 {
     Point = 3;
     Index = 16;
     foreach (PTime Time in new PTime[] {
         PTime.Injure.EmitInjure
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 10,
                 Condition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.Equals(InjureTag.FromPlayer) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && InjureTag.ToPlayer.Area.HandCardArea.CardNumber > 0;
                 },
                 AICondition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     if (Player.TeamIndex == InjureTag.ToPlayer.TeamIndex)
                     {
                         if (Player.General is P_IzayoiMiku && InjureTag.ToPlayer.General is P_Gabriel)
                         {
                             return false;
                         }
                         return InjureTag.Injure >= InjureTag.ToPlayer.Money || (InjureTag.Injure >= 6000 && InjureTag.Injure + Player.Money >= 2 * (InjureTag.ToPlayer.Money - InjureTag.Injure));
                     }
                     else
                     {
                         return InjureTag.Injure < InjureTag.ToPlayer.Money && InjureTag.Injure <= 1000 && InjureTag.ToPlayer.Area.HandCardArea.CardNumber >= 2 && PAiCardExpectation.FindMostValuableToGet(Game, Player, InjureTag.ToPlayer).Value > 3000;
                     }
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     PNetworkManager.NetworkServer.TellClients(new PPushTextOrder(User.Index.ToString(), "欲擒故纵:防止伤害", PPushType.Information.Name));
                     InjureTag.Injure = 0;
                     for (int i = 0; i < 2; ++i)
                     {
                         if (Target.Area.HandCardArea.CardNumber > 0)
                         {
                             PCard Got = Game.GetCardFrom(User, Target, true, false);
                             #region 成就:七擒七纵
                             if (Got.Model is P_NanManHsiang && User.Area.HandCardArea.CardList.Contains(Got))
                             {
                                 PArch.Announce(Game, User, "七擒七纵");
                             }
                             #endregion
                         }
                     }
                 })
             });
         });
     }
 }
Exemplo n.º 3
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));
                 }
             });
         });
     }
 }
Exemplo n.º 4
0
 public P_ShangWuChoouTii() : base(CardName)
 {
     Point = 5;
     Index = 28;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 105,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Game.PlayerList.Exists((PPlayer _Player) => !_Player.Equals(Player) && _Player.Distance(Player) <= 3);
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, (PGame Game, PPlayer _Player) => !_Player.Equals(Player) && _Player.Distance(Player) <= 3,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Target.Tags.CreateTag(PTag.NoLadderTag);
                     PTrigger StepZero = null;
                     StepZero = new PTrigger(CardName + "[步数变为0]")
                     {
                         IsLocked = true,
                         Player = null,
                         Time = PPeriod.WalkingStage.Start,
                         Condition = (PGame _Game) => {
                             return Target.Equals(_Game.NowPlayer);
                         },
                         Effect = (PGame _Game) => {
                             Target.Tags.PopTag <PTag>(PTag.NoLadderTag.Name);
                             PNetworkManager.NetworkServer.TellClients(new PPushTextOrder(Target.Index.ToString(), CardName + "效果触发", PPushType.Information.Name));
                             _Game.TagManager.FindPeekTag <PStepCountTag>(PStepCountTag.TagName).StepCount = 0;
                             _Game.Monitor.RemoveTrigger(StepZero);
                         }
                     };
                     Game.Monitor.AddTrigger(StepZero);
                     #region 成就:留客
                     if (User.Equals(Target.Position.Lord) && Target.Position.BusinessType.Equals(PBusinessType.ShoppingCenter))
                     {
                         PArch.Announce(Game, User, "留客");
                     }
                     #endregion
                 })
             });
         });
     }
 }
Exemplo n.º 5
0
 public P_WeiWeiChiuChao() : base(CardName)
 {
     Point = 1;
     Index = 2;
     foreach (PTime Time in new PTime[] {
         PTime.Injure.AcceptInjure
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 100,
                 Condition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.Equals(InjureTag.ToPlayer) && InjureTag.FromPlayer != null && InjureTag.Injure > 0;
                 },
                 AICondition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     if (InjureTag.FromPlayer.General is P_LiuJi)
                     {
                         if (InjureTag.FromPlayer.TeamIndex == Player.TeamIndex)
                         {
                             return InjureTag.FromPlayer.Money <= 3600;
                         }
                         else
                         {
                             return false;
                         }
                     }
                     return Player.Money <= InjureTag.Injure || (InjureTag.Injure >= 3000 && InjureTag.FromPlayer.TeamIndex != Player.TeamIndex);
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     if (Game.PkPoint(User, Target) == 1)
                     {
                         PNetworkManager.NetworkServer.TellClients(new PPushTextOrder(User.Index.ToString(), "围魏救赵:防止伤害", PPushType.Information.Name));
                         #region 成就:千钧一发
                         if (Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure >= 10000)
                         {
                             PArch.Announce(Game, User, "千钧一发");
                         }
                         #endregion
                         Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure = 0;
                     }
                 })
             });
         });
     }
 }
Exemplo n.º 6
0
 public P_TaTsaaoChingShev() : base(CardName)
 {
     Point = 3;
     Index = 13;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 95,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && AIEmitTargets(Game, Player).Count > 0;
                 },
                 AICondition = (PGame Game) => {
                     if (Player.General is P_WuZhao && Player.RemainLimit(PSkillInfo.女权.Name))
                     {
                         return false;
                     }
                     return AIInHandExpectation(Game, Player) > 900;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.ThrowHouse(Target, Target, CardName);
                     Game.TagManager.PopTag <PTag>("竹篮打水");
                 },
                                           #region 成就:竹篮打水
                                           (PGame Game, PPlayer User, List <PPlayer> Target) => {
                     Game.TagManager.CreateTag(new PTag("竹篮打水"));
                 }, (PGame Game, PPlayer User, List <PPlayer> Target) => {
                     if (Game.TagManager.PopTag <PTag>("竹篮打水") != null)
                     {
                         PArch.Announce(Game, User, "竹篮打水");
                     }
                 })
                          #endregion
             });
         });
     }
 }
Exemplo n.º 7
0
 public P_FuTiChoouHsin() : base(CardName)
 {
     Point = 4;
     Index = 19;
     foreach (PTime Time in new PTime[] {
         PTime.Injure.AfterAcceptInjure
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 60,
                 Condition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.Equals(InjureTag.ToPlayer) && InjureTag.FromPlayer != null && InjureTag.Injure > 0 && InjureTag.InjureSource != null && (InjureTag.InjureSource is PBlock) && ((PBlock)InjureTag.InjureSource).HouseNumber > 0;
                 },
                 AICondition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     PBlock Block = (PBlock)InjureTag.InjureSource;
                     return Block.Lord != null && Block.Lord.TeamIndex != Player.TeamIndex && (PAiMapAnalyzer.HouseValue(Game, Block.Lord, Block) >= 5400 || Player.Money <= 3000);
                 },
                 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));
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     PBlock Block = (PBlock)InjureTag.InjureSource;
                     #region 成就:破釜沉舟
                     if (Block.HouseNumber >= 10)
                     {
                         PArch.Announce(Game, Player, "破釜沉舟");
                     }
                     #endregion
                     Game.LoseHouse(Block, Block.HouseNumber);
                     Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                     Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                 }
             });
         });
     }
 }
Exemplo n.º 8
0
 public P_ChihSangMaHuai() : base(CardName)
 {
     Point = 5;
     Index = 26;
     foreach (PTime Time in new PTime[] {
         PTime.Injure.AcceptInjure
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 200,
                 Condition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.Equals(InjureTag.ToPlayer) && InjureTag.FromPlayer != null && InjureTag.Injure > 0 && Game.PlayerList.Exists((PPlayer _Player) => !_Player.Equals(InjureTag.FromPlayer) && !_Player.Equals(Player));
                 },
                 AICondition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.Money <= InjureTag.Injure || (InjureTag.FromPlayer.TeamIndex != Player.TeamIndex && Game.Enemies(Player).Count < 2 && InjureTag.Injure >= 3000) && AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, (PGame Game, PPlayer _Player) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return !_Player.Equals(InjureTag.FromPlayer) && !_Player.Equals(Player);
                 },
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     PNetworkManager.NetworkServer.TellClients(new PPushTextOrder(User.Index.ToString(), "转移伤害给" + Target.Name, PPushType.Information.Name));
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     InjureTag.ToPlayer = Target;
                     #region 成就:弹弹弹
                     if (Target.Money <= InjureTag.Injure)
                     {
                         PArch.Announce(Game, User, "弹弹弹");
                     }
                     #endregion
                 })
             });
         });
     }
 }
Exemplo n.º 9
0
 public P_IITaiLao() : base(CardName)
 {
     Point = 1;
     Index = 4;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 21,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     if (Player.General is P_WuZhao && Player.RemainLimit(PSkillInfo.女权.Name))
                     {
                         return false;
                     }
                     return PMath.Min(Player.Area.HandCardArea.CardList.FindAll((PCard _Card) => !_Card.Equals(Card)).ConvertAll((PCard _Card) => _Card.AIInHandExpectation(Game, Player))) <= 1000;
                 },
                 Effect = MakeMultiTargetNormalEffect(Player, Card, AIEmitTargets,
                                                      PTrigger.NoCondition,
                                                      (PGame Game, PPlayer User, PPlayer Target) => {
                     PCard Got = Game.GetCard(Target);
                     #region 成就:躺尸
                     if (Got.Model is P_ChiehShihHuanHun && User.Area.HandCardArea.CardList.Contains(Got))
                     {
                         PArch.Announce(Game, User, "躺尸");
                     }
                     #endregion
                     Game.ThrowCard(Target, Target);
                 })
             });
         });
     }
 }
Exemplo n.º 10
0
 public P_ChiinTsevChiinWang() : base(CardName)
 {
     Point = 3;
     Index = 18;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 25,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets,
                                           (PGame Game, PPlayer _Player) => {
                     int MaxMoney = PMath.Max(Game.PlayerList, (PPlayer __Player) => __Player.Money).Value;
                     return _Player.Money == MaxMoney;
                 },
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.ChangeFace(Target);
                     #region 成就:草头天子
                     if (User.Equals(Target))
                     {
                         PArch.Announce(Game, User, "草头天子");
                     }
                     #endregion
                 })
             });
         });
     }
 }
Exemplo n.º 11
0
 public P_LiTaiTaaoChiang() : base(CardName)
 {
     Point = 2;
     Index = 11;
     foreach (PTime Time in new PTime[] {
         PTime.Injure.AcceptInjure
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 80,
                 Condition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.Equals(InjureTag.ToPlayer) && InjureTag.FromPlayer != null && InjureTag.Injure > 0 && Player.HasHouse;
                 },
                 AICondition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.Money <= InjureTag.Injure || (InjureTag.Injure >= 1000 + PAiMapAnalyzer.MaxValueHouse(Game, Player).Value&& InjureTag.FromPlayer.TeamIndex != Player.TeamIndex);
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     PNetworkManager.NetworkServer.TellClients(new PPushTextOrder(User.Index.ToString(), "李代桃僵:防止伤害", PPushType.Information.Name));
                     #region 成就:桃李不言
                     if (Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure >= User.Money)
                     {
                         PArch.Announce(Game, User, "桃李不言");
                     }
                     #endregion
                     Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName).Injure = 0;
                     Game.ThrowHouse(Target, User, CardName);
                 })
             });
         });
     }
 }
Exemplo n.º 12
0
 public P_ShunShouChiienYang() : base(CardName)
 {
     Point = 2;
     Index = 12;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 120,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Game.PlayerList.Find((PPlayer _Player) => _Player.Area.CardNumber > 0 && !_Player.Equals(Player)) != null;
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, (PGame Game, PPlayer _Player) => {
                     return _Player.Area.CardNumber > 0 && !_Player.Equals(Player);
                 },
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     PCard Got = Game.GetCardFrom(User, Target, true, true, true);
                     #region 成就:名副其实
                     if (Got.Model is P_HsiYooYangToow && User.Area.HandCardArea.CardList.Contains(Got))
                     {
                         PArch.Announce(Game, User, "名副其实");
                     }
                     #endregion
                 })
             });
         });
     }
 }
Exemplo n.º 13
0
 public P_CheevnHuoTaChieh() : base(CardName)
 {
     Point = 1;
     Index = 5;
     foreach (PTime Time in new PTime[] {
         PTime.Injure.AcceptInjure
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 10,
                 Condition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return !Player.Equals(InjureTag.ToPlayer) && InjureTag.Injure > 0 && InjureTag.ToPlayer != null && InjureTag.ToPlayer.Area.HandCardArea.CardNumber + InjureTag.ToPlayer.Area.EquipmentCardArea.CardNumber > 0;
                 },
                 AICondition = (PGame Game) => {
                     PInjureTag InjureTag = Game.TagManager.FindPeekTag <PInjureTag>(PInjureTag.TagName);
                     return Player.TeamIndex != InjureTag.ToPlayer.TeamIndex && PAiCardExpectation.FindMostValuableToGet(Game, Player, InjureTag.ToPlayer).Value > 3000;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     PCard Got = Game.GetCardFrom(User, Target);
                     #region 成就:分一杯羹
                     if (Got.Model is P_MuNiuLiuMa && User.Area.HandCardArea.CardList.Contains(Got))
                     {
                         PArch.Announce(Game, User, "分一杯羹");
                     }
                     #endregion
                 })
             });
         });
     }
 }
Exemplo n.º 14
0
 public P_KuuJouChi() : base(CardName)
 {
     Point = 6;
     Index = 34;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 20,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return Player.Money >= 3000;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.LoseMoney(Target, 1000);
                     #region 成就:最后一滴血
                     if (User.Equals(Target) && !User.IsAlive)
                     {
                         PArch.Announce(Game, User, "最后一滴血");
                     }
                     #endregion
                     Game.GetCard(Target);
                 })
             });
         });
     }
 }
Exemplo n.º 15
0
 public P_WuChungShevngYou() : base(CardName)
 {
     Point = 2;
     Index = 7;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 140,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     List <PCard> Gots = Game.GetCard(Target, 2);
                     #region 成就:鸿运当头
                     if (Gots.Exists((PCard Got) => Got.Model is P_WuChungShevngYou && User.Area.HandCardArea.CardList.Contains(Got)))
                     {
                         PArch.Announce(Game, User, "鸿运当头");
                     }
                     #endregion
                 })
             });
         });
     }
 }
Exemplo n.º 16
0
    public P_ShuShangKaaiHua() : base(CardName)
    {
        Point = 5;
        Index = 29;
        foreach (PTime Time in new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        })
        {
            MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
                return(new PTrigger(CardName)
                {
                    IsLocked = false,
                    Player = Player,
                    Time = Time,
                    AIPriority = 100,
                    Condition = (PGame Game) => {
                        return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Game.Map.BlockList.Exists((PBlock Block) => Block.Lord != null);
                    },
                    AICondition = (PGame Game) => {
                        return PMath.Max(Game.Map.BlockList.FindAll((PBlock Block) => Block.Lord != null && Block.Lord.TeamIndex == Player.TeamIndex), (PBlock Block) => {
                            return PAiMapAnalyzer.HouseValue(Game, Block.Lord, Block);
                        }).Value >= 2500;
                    },
                    Effect = (PGame Game) => {
                        List <PPlayer> Targets = new List <PPlayer>();
                        Game.Monitor.CallTime(PTime.Card.AfterEmitTargetTime, new PUseCardTag(Card, Player, Targets));
                        if (Player.Area.EquipmentCardArea.CardList.Contains(Card))
                        {
                            Game.CardManager.MoveCard(Card, Player.Area.EquipmentCardArea, Game.CardManager.SettlingArea);
                        }
                        else
                        {
                            Game.CardManager.MoveCard(Card, Player.Area.HandCardArea, Game.CardManager.SettlingArea);
                        }
                        Game.Monitor.CallTime(PTime.Card.AfterBecomeTargetTime, new PUseCardTag(Card, Player, Targets));

                        PBlock Target = null;
                        if (Player.IsAI)
                        {
                            Target = AIEmitTarget(Game, Player);
                        }
                        else
                        {
                            Target = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(Player, "树上开花[选择有主土地]", (PBlock Block) => Block.Lord != null);
                        }
                        if (Target != null)
                        {
                            PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Target.Index.ToString()));
                            Game.GetHouse(Target, 1);
                            #region 成就:花开富贵
                            if (Target.BusinessType.Equals(PBusinessType.Park))
                            {
                                PArch.Announce(Game, Player, "花开富贵");
                            }
                            #endregion
                        }

                        Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                        Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                    }
                });
            });
        }
    }
Exemplo n.º 17
0
 public P_KuungCheevngChi() : base(CardName)
 {
     Point = 6;
     Index = 32;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 30,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return Game.NowPeriod.Equals(PPeriod.FirstFreeTime) && AIInHandExpectation(Game, Player) >= 1000;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.CardManager.ThrowAll(Target.Area.HandCardArea);
                     if (Target.Tags.ExistTag(PKuungCheevngChiTag.TagName))
                     {
                         Target.Tags.PopTag <PKuungCheevngChiTag>(PKuungCheevngChiTag.TagName);
                     }
                     Target.Tags.CreateTag(new PKuungCheevngChiTag());
                     #region 成就:挥泪斩马谡
                     if (!Target.Equals(User))
                     {
                         PArch.Announce(Game, User, "挥泪斩马谡");
                     }
                     #endregion
                     PTrigger KuungCheevngChiTrigger = null;
                     Game.Monitor.AddTrigger(KuungCheevngChiTrigger = new PTrigger("空城状态更新")
                     {
                         IsLocked = true,
                         Player = Target,
                         Time = PPeriod.EndTurn.During,
                         Condition = (PGame _Game) => {
                             return Target.Equals(_Game.NowPlayer);
                         },
                         Effect = (PGame _Game) => {
                             if (Target.Tags.ExistTag(PKuungCheevngChiTag.TagName))
                             {
                                 if (--Target.Tags.FindPeekTag <PKuungCheevngChiTag>(PKuungCheevngChiTag.TagName).Value <= 0)
                                 {
                                     Target.Tags.PopTag <PKuungCheevngChiTag>(PKuungCheevngChiTag.TagName);
                                 }
                                 PNetworkManager.NetworkServer.TellClients(new PRefreshMarkStringOrder(Target));
                             }
                             if (!Target.Tags.ExistTag(PKuungCheevngChiTag.TagName))
                             {
                                 _Game.Monitor.RemoveTrigger(KuungCheevngChiTrigger);
                             }
                         }
                     });
                 })
             });
         });
     }
 }
Exemplo n.º 18
0
 public P_YooenChiaoChinKung() : base(CardName)
 {
     Point = 4;
     Index = 23;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 75,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, PTrigger.Except(Player),
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     Game.GetCard(Target);
                     PPlayer Another = null;
                     if (User.IsAI)
                     {
                         if (Game.Enemies(User).Exists((PPlayer _Player) => _Player.Money <= 1000) || User.Money > 15000)
                         {
                             Another = PMath.Min(Game.Enemies(User), (PPlayer _Player) => _Player.Money).Key;
                         }
                         else
                         {
                             Another = User;
                         }
                     }
                     else
                     {
                         Another = PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(User, PTrigger.Except(Target), "远交近攻[第二目标]");
                     }
                     if (Another != null)
                     {
                         if (Another.Equals(User))
                         {
                             Game.GetMoney(Another, 1000);
                         }
                         else
                         {
                             Game.LoseMoney(Another, 1000);
                             #region 成就:翻云覆雨
                             if (!Another.IsAlive)
                             {
                                 PArch.Announce(Game, User, "翻云覆雨");
                             }
                             #endregion
                         }
                     }
                 })
             });
         });
     }
 }
Exemplo n.º 19
0
 public P_ChiehTaoShaJevn() : base(CardName)
 {
     Point = 1;
     Index = 3;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 110,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Game.PlayerList.Exists((PPlayer _Player ) => !_Player.Equals(Player) && _Player.Area.EquipmentCardArea.CardNumber > 0);
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null;
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, (PGame Game, PPlayer _Player) => {
                     return !_Player.Equals(Player) && _Player.Area.EquipmentCardArea.CardNumber > 0;
                 },
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     int ChosenResult = -1;
                     if (!Target.HasHouse || User.LandNumber == 0)
                     {
                         if (Target.Area.EquipmentCardArea.CardNumber > 0)
                         {
                             ChosenResult = 1;
                         }
                     }
                     else if (Target.Area.EquipmentCardArea.CardNumber == 0)
                     {
                         ChosenResult = 0;
                     }
                     else
                     {
                         if (Target.IsAI)
                         {
                             ChosenResult = PAiMapAnalyzer.MaxValueHouse(Game, Target).Value > PAiCardExpectation.FindMostValuable(Game, Target, Target, false).Value ? 1 : 0;
                         }
                         else
                         {
                             ChosenResult = PNetworkManager.NetworkServer.ChooseManager.Ask(Target, CardName + "-选择一项", new string[] {
                                 "令" + User.Name + "获得你1座房屋",
                                 "令" + User.Name + "获得你1张装备"
                             });
                         }
                     }
                     if (ChosenResult == 0)
                     {
                         PBlock TargetBlock = null;
                         if (User.IsAI)
                         {
                             TargetBlock = PAiMapAnalyzer.MaxValueHouse(Game, Target).Key;
                         }
                         else
                         {
                             TargetBlock = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(User, "选择一座" + Target.Name + "的房屋", (PBlock Block) => Target.Equals(Block.Lord) && Block.HouseNumber > 0);
                         }
                         if (TargetBlock != null)
                         {
                             Game.LoseHouse(TargetBlock, 1);
                             if (User.IsAI)
                             {
                                 TargetBlock = PAiMapAnalyzer.MaxValueHouse(Game, User, true).Key;
                             }
                             else
                             {
                                 TargetBlock = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(User, "选择一处你的土地放置房屋", (PBlock Block) => User.Equals(Block.Lord));
                             }
                             if (TargetBlock != null)
                             {
                                 Game.GetHouse(TargetBlock, 1);
                             }
                         }
                     }
                     else if (ChosenResult == 1)
                     {
                         PCard Got = Game.GetCardFrom(User, Target, false);
                         #region 成就:老司机
                         if (Got.Model is P_ToouShihChi && User.Area.HandCardArea.CardList.Contains(Got))
                         {
                             PArch.Announce(Game, User, "老司机");
                         }
                         #endregion
                     }
                 })
             });
         });
     }
 }
Exemplo n.º 20
0
    public P_ToouLiangHuanChu() : base(CardName)
    {
        Point = 5;
        Index = 25;
        foreach (PTime Time in new PTime[] {
            PPeriod.FirstFreeTime.During,
            PPeriod.SecondFreeTime.During
        })
        {
            MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
                return(new PTrigger(CardName)
                {
                    IsLocked = false,
                    Player = Player,
                    Time = Time,
                    AIPriority = 70,
                    Condition = (PGame Game) => {
                        return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime()) && Game.Map.BlockList.FindAll((PBlock Block) => Block.Lord != null && !Block.IsBusinessLand).Count >= 2;
                    },
                    AICondition = (PGame Game) => {
                        return MaxLandPair(Game, Player).Value >= 5400;
                    },
                    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));

                        PBlock Land1 = null;
                        PBlock Land2 = null;
                        if (Player.IsAI)
                        {
                            KeyValuePair <PBlock, PBlock> Lands = MaxLandPair(Game, Player).Key;
                            Land1 = Lands.Key;
                            PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Land1.Index.ToString()));
                            Land2 = Lands.Value;
                            PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Land2.Index.ToString()));
                        }
                        else
                        {
                            Land1 = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(Player, "偷梁换柱[第1片土地]", (PBlock Block) => Block.Lord != null && !Block.IsBusinessLand);
                            PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Land1.Index.ToString()));
                            Land2 = PNetworkManager.NetworkServer.ChooseManager.AskToChooseBlock(Player, "偷梁换柱[第2片土地]", (PBlock Block) => Block.Lord != null && !Block.IsBusinessLand && !Block.Equals(Land1));
                            PNetworkManager.NetworkServer.TellClients(new PHighlightBlockOrder(Land2.Index.ToString()));
                        }
                        if (Land1 != null && Land2 != null)
                        {
                            int House1 = Land1.HouseNumber;
                            int House2 = Land2.HouseNumber;
                            #region 成就:偷天换日
                            if (Math.Abs(House1 - House2) >= 5)
                            {
                                PArch.Announce(Game, Player, "偷天换日");
                            }
                            #endregion
                            Game.LoseHouse(Land1, Land1.HouseNumber);
                            Game.LoseHouse(Land2, Land2.HouseNumber);
                            Game.GetHouse(Land1, House2);
                            Game.GetHouse(Land2, House1);
                        }

                        Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                        Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                    }
                });
            });
        }
    }
Exemplo n.º 21
0
 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));
                 }
             });
         });
     }
 }
Exemplo n.º 22
0
 public P_FanChienChi() : base(CardName)
 {
     Point = 6;
     Index = 33;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 65,
                 Condition = PTrigger.Initiative(Player),
                 AICondition = (PGame Game) => {
                     if (Player.General is P_WuZhao && Player.RemainLimit(PSkillInfo.女权.Name))
                     {
                         return false;
                     }
                     return AIInHandExpectation(Game, Player) > 1000 && P_PanYue.XianJuTest(Game, Player);
                 },
                 Effect = MakeNormalEffect(Player, Card, AIEmitTargets, AIEmitTargets,
                                           (PGame Game, PPlayer User, PPlayer Target) => {
                     int ChosenNumber = 1;
                     if (Target.IsAI)
                     {
                         if (Target.General is P_LiuJi)
                         {
                             ChosenNumber = 6;
                         }
                         else
                         {
                             ChosenNumber = PMath.RandInt(1, 6);
                         }
                     }
                     else
                     {
                         ChosenNumber = PNetworkManager.NetworkServer.ChooseManager
                                        .Ask1To6(Target, "反间计[选择1个数字]");
                     }
                     PNetworkManager.NetworkServer.TellClients(new
                                                               PShowInformationOrder(Target.Name + "选择了" + ChosenNumber));
                     int JudgeResult = Game.Judge(Target, 6);
                     if (JudgeResult != ChosenNumber)
                     {
                         // 故弄玄虚失效
                         User.Tags.PopTag <PTag>(Gunxx);
                         int Test = 0;
                         if (Target.IsAI)
                         {
                             int Choose1 = PAiMapAnalyzer.ChangeFaceExpect(Game, Target);
                             int Choose2 = Target.Money <= 1000 ? -30000 : -1000;
                             Test = (Choose1 > Choose2 ? 0 : 1);
                         }
                         else
                         {
                             Test = PNetworkManager.NetworkServer.ChooseManager
                                    .Ask(Target, "反间计[选择一项]", new string[] {
                                 "翻面", "弃1000"
                             });
                         }
                         if (Test == 0)
                         {
                             PNetworkManager.NetworkServer.TellClients(new
                                                                       PShowInformationOrder(Target.Name + "选择了翻面"));
                             Game.ChangeFace(Target);
                         }
                         else
                         {
                             PNetworkManager.NetworkServer.TellClients(new
                                                                       PShowInformationOrder(Target.Name + "选择了弃1000"));
                             Game.LoseMoney(Target, 1000);
                         }
                     }
                 }, (PGame Game, PPlayer User, List <PPlayer> Targets) => {
                     // 为了故弄玄虚成就做的初始化
                     if (Targets.Count > 0)
                     {
                         User.Tags.CreateTag(new PTag(Gunxx)
                         {
                             Visible = false
                         });
                     }
                 }, (PGame Game, PPlayer User, List <PPlayer> Targets) => {
                     // 判定故弄玄虚
                     if (User.Tags.PopTag <PTag>(Gunxx) != null)
                     {
                         PArch.Announce(Game, User, Gunxx);
                     }
                 })
             });
         });
     }
 }
Exemplo n.º 23
0
 public P_MeiJevnChi() : base(CardName)
 {
     Point = 6;
     Index = 31;
     foreach (PTime Time in new PTime[] {
         PPeriod.FirstFreeTime.During,
         PPeriod.SecondFreeTime.During
     })
     {
         MoveInHandTriggerList.Add((PPlayer Player, PCard Card) => {
             return(new PTrigger(CardName)
             {
                 IsLocked = false,
                 Player = Player,
                 Time = Time,
                 AIPriority = 150,
                 Condition = (PGame Game) => {
                     return Player.Equals(Game.NowPlayer) && (Player.IsAI || Game.Logic.WaitingForEndFreeTime());
                 },
                 AICondition = (PGame Game) => {
                     return AIEmitTargets(Game, Player)[0] != null && AIEmitTargets(Game, Player)[1] != null;
                 },
                 Effect = (PGame Game) => {
                     List <PPlayer> Targets = new List <PPlayer>();
                     if (Player.IsAI)
                     {
                         Targets = AIEmitTargets(Game, Player);
                     }
                     else
                     {
                         Targets.Add(PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.NoCondition, "美人计[第一个目标]"));
                         Targets.Add(PNetworkManager.NetworkServer.ChooseManager.AskForTargetPlayer(Player, PTrigger.Except(Targets[0]), "美人计[第二个目标]"));
                     }
                     Targets.RemoveAll((PPlayer _Player) => _Player == null);
                     if (Targets.Count == 0)
                     {
                         return;
                     }
                     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));
                     if (Targets.Count >= 2)
                     {
                         int Result = Game.PkPoint(Targets[0], Targets[1]);
                         if (Result > 0)
                         {
                             if (Targets[0].Area.OwnerCardNumber > 0)
                             {
                                 Game.ThrowCard(Targets[0], Targets[0]);
                             }
                         }
                         else
                         {
                             Game.LoseMoney(Targets[0], 1000);
                         }
                         if (Result < 0)
                         {
                             if (Targets[1].Area.OwnerCardNumber > 0)
                             {
                                 Game.ThrowCard(Targets[1], Targets[1]);
                             }
                         }
                         else
                         {
                             Game.LoseMoney(Targets[1], 1000);
                         }
                         #region 成就:请尊重女性
                         if (!Targets[0].IsAlive && !Targets[1].IsAlive)
                         {
                             PArch.Announce(Game, Player, "请尊重女性");
                         }
                         #endregion
                     }
                     Game.CardManager.MoveCard(Card, Game.CardManager.SettlingArea, Game.CardManager.ThrownCardHeap);
                     Game.Monitor.CallTime(PTime.Card.EndSettleTime, new PUseCardTag(Card, Player, Targets));
                 }
             });
         });
     }
 }