public override void AnnouceInvokeJudge(PGame Game, PPlayer Player, PCard Card) { base.AnnouceInvokeJudge(Game, Player, Card); int Result = Game.Judge(Player, new Func <int>(() => { if (Player.Area.EquipmentCardArea.CardNumber > 0) { return(6); } else { return(5); } })()); if (Result != 6) { if (Player.Area.EquipmentCardArea.CardNumber > 0) { Game.ThrowCard(Player, Player, false, true); } if (Game.GetNextPlayer(Player).Area.AmbushCardArea.CardList.Exists((PCard _Card) => _Card.Model is P_HsienChing)) { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.GetNextPlayer(Game.GetNextPlayer(Player)).Area.AmbushCardArea); } else { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.GetNextPlayer(Player).Area.AmbushCardArea); } } else { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.CardManager.ThrownCardHeap); } }
public override void AnnouceInvokeJudge(PGame Game, PPlayer Player, PCard Card) { base.AnnouceInvokeJudge(Game, Player, Card); int Result = Game.Judge(Player, new Func <int>(() => { if (Game.Enemies(Player).Count > Game.Teammates(Player, false).Count&& !(Game.Teammates(Player, false).Exists((PPlayer _Player) => _Player.Money <= 1000))) { return(6); } return(2); })()); if (Result != 2) { Game.LoseMoney(Player, 1000); if (Game.GetNextPlayer(Player).Area.AmbushCardArea.CardList.Exists((PCard _Card) => _Card.Model is P_WevnI)) { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.GetNextPlayer(Game.GetNextPlayer(Player)).Area.AmbushCardArea); } else { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.GetNextPlayer(Player).Area.AmbushCardArea); } } else { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.CardManager.ThrownCardHeap); } }
public override void AnnouceInvokeJudge(PGame Game, PPlayer Player, PCard Card) { base.AnnouceInvokeJudge(Game, Player, Card); int Result1 = Game.Judge(Player, 6); int Result2 = Game.Judge(Player, 6); if (Result1 + Result2 <= 5) { Game.Injure(null, Player, 6000, Card); Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.CardManager.ThrownCardHeap); } else { if (Game.GetNextPlayer(Player).Area.AmbushCardArea.CardList.Exists((PCard _Card) => _Card.Model is P_ShanTien)) { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.GetNextPlayer(Game.GetNextPlayer(Player)).Area.AmbushCardArea); } else { Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.GetNextPlayer(Player).Area.AmbushCardArea); } } }
/// <summary> /// 将一个玩家移出游戏对其的收益,无卡牌收益嵌套 /// </summary> /// <param name="Game"></param> /// <param name="Player"></param> /// <param name="Including">是否包含其行走阶段</param> /// <returns></returns> public static int OutOfGameExpect(PGame Game, PPlayer Player, bool Including = false, bool IncludingOnly = false) { if (Player.OutOfGame) { return(0); } int Sum = 0; // 一轮其他角色可能造成的过路费收益总和的相反数 if (!IncludingOnly) { PPlayer _Player = Game.NowPlayer; if (Player.Equals(Game.NowPlayer)) { _Player = Game.GetNextPlayer(_Player); } for (; !_Player.Equals(Player); _Player = Game.GetNextPlayer(_Player)) { if (_Player.Equals(Game.NowPlayer) && Game.NowPeriod.IsAfter(PPeriod.WalkingStage)) { continue; } int Temp = 0; List <PBlock> Blocks = NextBlocks(Game, _Player); Blocks.ForEach((PBlock Block) => { int BlockTemp = 0; if (Block.Lord != null && Player.Equals(Block.Lord)) { BlockTemp = Math.Max(0, PAiTargetChooser.InjureExpect(Game, Player, Player, _Player, Block.Toll, Block)); } if (_Player.General is P_Newton) { PBlock PossibleBlock = Game.Map.NextStepBlock(Block, P_Newton.Grx_Next(Game, _Player.Position).Value); if (PossibleBlock.Lord != null && Player.Equals(PossibleBlock.Lord)) { BlockTemp = Math.Min(BlockTemp, Math.Max(0, PAiTargetChooser.InjureExpect(Game, Player, Player, _Player, Block.Toll, Block))); } else { BlockTemp = 0; } } Temp -= BlockTemp; }); Sum += Temp / Math.Max(1, Blocks.Count); } } int SumSelf = 0; if (Including) { List <PBlock> Blocks = NextBlocks(Game, Player); Blocks.ForEach((PBlock Block) => { int BlockTemp = 0; if (Block.Lord != null && Player.TeamIndex != Block.Lord.TeamIndex) { BlockTemp = Math.Max(0, -PAiTargetChooser.InjureExpect(Game, Player, Block.Lord, Player, Block.Toll, Block)); } if (Player.General is P_Newton) { PBlock PossibleBlock = Game.Map.NextStepBlock(Block, P_Newton.Grx_Next(Game, Player.Position).Value); if (PossibleBlock.Lord != null && Player.TeamIndex != PossibleBlock.Lord.TeamIndex) { BlockTemp = Math.Max(BlockTemp, Math.Max(0, -PAiTargetChooser.InjureExpect(Game, Player, Block.Lord, Player, Block.Toll, Block))); } else { BlockTemp = 0; } } SumSelf += BlockTemp; }); SumSelf /= Math.Max(1, Blocks.Count); } return(Sum + SumSelf); }