예제 #1
0
        public override void Play(EntityWorld world, bool player)
        {
            BoardSystem boardSystem = world.SystemManager.GetSystem <BoardSystem>()[0];
            int         start       = !player ? 0 : boardSystem.Minions.Length - 1;
            int         direction   = !player ? 1 : -1;
            int         end         = !player ? boardSystem.Minions.Length : -1;

            for (int i = start; i != end; i += direction)
            {
                if (boardSystem.Minions[i] != null)
                {
                    MinionComponent minionComponent = boardSystem.Minions[i].GetComponent <MinionComponent>();
                    if (minionComponent.Player == player)
                    {
                        int target = i + direction * -1 * (2 + Power);
                        if (target < boardSystem.Minions.Length && target >= 0 && boardSystem.Minions[target] == null)
                        {
                            boardSystem.Minions[target] = boardSystem.Minions[i];
                            boardSystem.Minions[i]      = null;
                        }
                        break;
                    }
                }
            }
        }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     _BoardSystem = new BoardSystem(boardComp);
     _SpawnSystem = _SpawnSystemFactory.Create(spawnComp);
     _BoardSystem.OnCandyMatch  += _SpawnSystem.RemoveCandyList;
     _BoardSystem.OnRefillBoard += Refill;
     _BoardSystem.OnRemoveCandy += _SpawnSystem.RemoveCandy;
     //StartCoroutine(Test());
 }
예제 #3
0
        public override void Play(EntityWorld world, bool player)
        {
            BoardSystem boardSystem = world.SystemManager.GetSystem <BoardSystem>()[0];

            for (int i = 0; i < 4 + Power; i++)
            {
                boardSystem.Spawn(new ImpCard(content), player);
            }
        }
예제 #4
0
파일: GolemCard.cs 프로젝트: Wekaj/VoidGate
        private void GolemCardAttacked(object sender, AttackEventArgs e)
        {
            BoardSystem boardSystem  = world.SystemManager.GetSystem <BoardSystem>()[0];
            int         secondTarget = e.SecondAttacker + (e.Player ? 1 : -1);

            if (secondTarget >= 0 && secondTarget < boardSystem.Minions.Length)
            {
                if (boardSystem.Minions[secondTarget] != null)
                {
                    boardSystem.Minions[secondTarget].GetComponent <MinionComponent>().Minion.Health -= Attack;
                }
            }
        }
예제 #5
0
파일: HealCard.cs 프로젝트: Wekaj/VoidGate
        public override void Play(EntityWorld world, bool player)
        {
            BoardSystem boardSystem = world.SystemManager.GetSystem <BoardSystem>()[0];

            for (int i = 0; i < boardSystem.Minions.Length; i++)
            {
                if (boardSystem.Minions[i] != null)
                {
                    MinionComponent minionComponent = boardSystem.Minions[i].GetComponent <MinionComponent>();
                    if (minionComponent.Player == player)
                    {
                        minionComponent.Minion.Health += 3 + Power;
                    }
                }
            }
        }
예제 #6
0
        public override void Play(EntityWorld world, bool player)
        {
            BoardSystem boardSystem = world.SystemManager.GetSystem <BoardSystem>()[0];

            for (int i = 0; i < boardSystem.Minions.Length; i++)
            {
                if (boardSystem.Minions[i] != null)
                {
                    MinionComponent minionComponent = boardSystem.Minions[i].GetComponent <MinionComponent>();
                    if (minionComponent.Player == player)
                    {
                        minionComponent.Minion.AddInitiativeModifier(new GrowthModifier(3 + Power));
                    }
                }
            }
        }
예제 #7
0
        public override void Play(EntityWorld world, bool player)
        {
            BoardSystem boardSystem = world.SystemManager.GetSystem <BoardSystem>()[0];

            for (int i = 0; i < boardSystem.Minions.Length; i++)
            {
                if (boardSystem.Minions[i] != null)
                {
                    MinionComponent minionComponent = boardSystem.Minions[i].GetComponent <MinionComponent>();
                    if (minionComponent.Minion.Tag == "Demon")
                    {
                        minionComponent.Minion.AddMaxHealthModifier(new GrowthModifier(2 + Power));
                        minionComponent.Minion.Health += 2 + Power;
                    }
                }
            }
        }
예제 #8
0
파일: LionCard.cs 프로젝트: Wekaj/VoidGate
        private void LionCardPlayed(object sender, PlayerEventArgs e)
        {
            played = true;
            player = e.Player;

            BoardSystem boardSystem = world.SystemManager.GetSystem <BoardSystem>()[0];

            for (int i = 0; i < boardSystem.Minions.Length; i++)
            {
                if (boardSystem.Minions[i] != null)
                {
                    MinionComponent minionComponent = boardSystem.Minions[i].GetComponent <MinionComponent>();
                    if (minionComponent.Minion.Tag == "Animal" && minionComponent.Player == player && minionComponent.Minion != this)
                    {
                        minionComponent.Minion.AddInitiativeModifier(new DeathModifier(3, this));
                    }
                }
            }
        }
예제 #9
0
        public override void Play(EntityWorld world, bool player)
        {
            BoardSystem boardSystem = world.SystemManager.GetSystem <BoardSystem>()[0];
            int         start       = player ? 0 : boardSystem.Minions.Length - 1;
            int         direction   = player ? 1 : -1;
            int         end         = player ? boardSystem.Minions.Length : -1;

            for (int i = start; i != end; i += direction)
            {
                if (boardSystem.Minions[i] != null)
                {
                    MinionComponent minionComponent = boardSystem.Minions[i].GetComponent <MinionComponent>();
                    if (minionComponent.Player != player)
                    {
                        minionComponent.Minion.Health -= 2 + Power;
                        break;
                    }
                }
            }
        }
예제 #10
0
        public void IsBoardSizeValidTest(bool expected, int boardSizeX, int boardSizeY, int boardSizeZ, int goalNum)
        {
            Vector3Int boardSize = new Vector3Int(boardSizeX, boardSizeY, boardSizeZ);

            Assert.AreEqual(expected, BoardSystem.IsBoardSizeValid(boardSize, goalNum));
        }
예제 #11
0
 public void SetUp()
 {
     boardSystem = new BoardSystem();
 }