Ejemplo n.º 1
0
    public override void AnnouceInvokeJudge(PGame Game, PPlayer Player, PCard Card)
    {
        base.AnnouceInvokeJudge(Game, Player, Card);
        int Result = Game.Judge(Player, new Func <int>(() => {
            if (AIExpect(Game, Player, Player.Position) < -1000)
            {
                return(1);
            }
            return(6);
        })());

        if (Result != 1)
        {
            PBlock Block = Player.Position;
            int[]  dx = { 1, -1, 0, 0 };
            int[]  dy = { 0, 0, 1, -1 };
            int    OriginalX = Block.X;
            int    OriginalY = Block.Y;
            int    x, y;
            Game.GetHouse(Block, 1);
            for (int i = 0; i < 4; ++i)
            {
                x = OriginalX;
                y = OriginalY;
                do
                {
                    x += dx[i];
                    y += dy[i];
                    PBlock TempBlock = Game.Map.FindBlockByCoordinate(x, y);
                    if (TempBlock != null)
                    {
                        if (TempBlock.Lord != null)
                        {
                            Game.GetHouse(TempBlock, 1);
                        }
                    }
                    else
                    {
                        break;
                    }
                } while (true);
            }
        }
        Game.CardManager.MoveCard(Card, Player.Area.AmbushCardArea, Game.CardManager.ThrownCardHeap);
    }