コード例 #1
0
 public SeedTower_7Stack(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli board ve index setlemelerini yapiyor. effects ve stats i initialize ediyor.
     stats.baseRange = 1.1f;
     targetStrategy = new NearestMinionTargetStrategy();
 }
コード例 #2
0
 public NitrogenBombTower(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli board ve index setlemelerini yapiyor. effects ve stats i initialize ediyor.
     stats.baseRange = 3.0f;
     targetStrategy = new FarthestMinionTargetStrategy();
 }
コード例 #3
0
ファイル: LaserTower.cs プロジェクト: btasdoven/ScienceWars
        public LaserTower(Board board, int indexOnBoard)
            : base(board, indexOnBoard)
        {
            stats.baseRange = 1.1f;

            targets = new Minion[SIMULTANEOUS_TARGET_LIMIT];
            nextAttackTimes = new float[SIMULTANEOUS_TARGET_LIMIT];
        }
コード例 #4
0
ファイル: Tower.cs プロジェクト: btasdoven/ScienceWars
 protected Tower(Board board, int indexOnBoard)
 {
     instanceId = idGenerator++;
     this.board = board;
     this.indexOnBoard = indexOnBoard;
     stats = new TowerStats();
     effects = new LinkedList<ITowerEffect>();
     targetStrategy = new NearestMinionTargetStrategy();
 }
コード例 #5
0
        public Collection<Minion> selectTargetsFromBoard(Board board, Vector3 selectionPoint, int targetCount, float minRange, float maxRange, MinionStateSelection minionState)
        {
            Collection<Minion> minionsInRange = new Collection<Minion>();
            Collection<Minion> minionsUnderAttack = new Collection<Minion>();

            foreach (var v in board.minions)
            {
                if (v.Value.destroyable == true || (minionState != MinionStateSelection.ANY && ((v.Value.minionState == Minion.MinionState.DEAD && minionState == MinionStateSelection.ALIVE)
                     || (v.Value.minionState == Minion.MinionState.ALIVE && minionState == MinionStateSelection.DEAD))))
                    continue;

                Vector3 minionCoor = v.Value.getWorldPosition();
                float dist = (selectionPoint - minionCoor).magnitude;

                if (v.Value.isUntargetable() == false && dist >= minRange && dist <= maxRange)
                    minionsInRange.Add(v.Value);
            }

            if (targetCount >= minionsInRange.Count)
                return minionsInRange;

            for (int i = 0; i < targetCount; i++)
            {
                if (minionsInRange.Count > 0)
                {
                    float current = float.MinValue;
                    int index = -1;

                    for (int j = 0; j < minionsInRange.Count; j++)
                    {
                        Vector3 minionCoor = minionsInRange.ElementAt(j).getWorldPosition();
                        float dist = (selectionPoint - minionCoor).magnitude;
                        if (dist > current)
                        {
                            index = j;
                            current = dist;
                        }
                    }

                    if (index != -1)
                    {
                        minionsUnderAttack.Add(minionsInRange.ElementAt(index));
                        minionsInRange.RemoveAt(index);
                    }
                }
                else
                    return minionsUnderAttack;
            }

            return minionsUnderAttack;
        }
コード例 #6
0
ファイル: Player.cs プロジェクト: btasdoven/ScienceWars
        // alinan root minionlardan sadece player'in science type'ina uygun olanlari true olacak. Diger minionlar unlocked bile olsalar, science type uygun degilse bu listede false olacaklar.
        //Upgrade edileni true yap, upgrade olani da false yap ki yapilabilecek minionlar listesinden parent olan cikmis olsun.
        public Player(User user, Game game)
        {
            readyInQueue = false;
            loadedTheGame = false;

            this.user = user;
            this.game = game;
            this.board = (Board)Activator.CreateInstance(TypeIdGenerator.getBoardType(user.selectedBoardTypeId));
            board.player = this;

            cash = 20000;
            income = 1200;
            healthPoints = 10; // 5000000;

            playerState = PlayerState.ALIVE;

            initializeAvailableMinions();
        }
コード例 #7
0
        public Collection<Minion> selectTargetsFromBoard(Board board, Vector3 selectionPoint, int targetCount, float minRange, float maxRange, MinionStateSelection minionState)
        {
            Collection<Minion> minionsInRange = new Collection<Minion>();

            foreach (var v in board.minions)
            {
                if (targetCount == minionsInRange.Count)    // istenilen miktara ulasmissak return et.
                    return minionsInRange;

                if (v.Value.destroyable == true || ( minionState != MinionStateSelection.ANY && ((v.Value.minionState == Minion.MinionState.DEAD && minionState == MinionStateSelection.ALIVE)
                     || (v.Value.minionState == Minion.MinionState.ALIVE && minionState == MinionStateSelection.DEAD))))
                    continue;

                Vector3 minionCoor = v.Value.getWorldPosition();
                float dist = (selectionPoint - minionCoor).magnitude;

                if (v.Value.isUntargetable() == false && dist >= minRange && dist <= maxRange)      // hedef istenilen range'de mi?
                    minionsInRange.Add(v.Value);
            }

            return minionsInRange; // bu kadar bulabildim napalim.
        }
コード例 #8
0
ファイル: PhysicsTower.cs プロジェクト: btasdoven/ScienceWars
 protected PhysicsTower(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #9
0
 public OneToAllTower_strong(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #10
0
 public RadiationTower(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli board ve index setlemelerini yapiyor. effects ve stats i initialize ediyor.
     stats.baseRange = 3.0f;
 }
コード例 #11
0
 public ContagiousTower_extra(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #12
0
 public DroseraTower_starving(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #13
0
 public DroseraTower_hungry(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #14
0
 public ContagiousTower_effective(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #15
0
ファイル: BiologyTower.cs プロジェクト: btasdoven/ScienceWars
 protected BiologyTower(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli setlemeleri yapiyor. bir sey yapmaya gerek yok
 }
コード例 #16
0
 public PetrolBombTower(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli board ve index setlemelerini yapiyor. effects ve stats i initialize ediyor.
     stats.baseRange = 2.5f;
 }
コード例 #17
0
 public OneToAllTower_toxic(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #18
0
        private const int _simultaneousTargetLimit = 2; // ayni anda en fazla kac miniona saldirabilir.

        #endregion Fields

        #region Constructors

        public LaserTower_Twin(Board board, int indexOnBoard)
            : base(board, indexOnBoard)
        {
        }
コード例 #19
0
 public BallistaTower_fireBolt(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #20
0
 public TrypanophobiaTower_Scary(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli board ve index setlemelerini yapiyor. effects ve stats i initialize ediyor.
     stats.baseRange = 1.2f;
 }
コード例 #21
0
 public DroseraTower_crazy(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #22
0
        private const int _simultaneousTargetLimit = 3; // ayni anda en fazla kac miniona saldirabilir.

        #endregion Fields

        #region Constructors

        public LaserTower_Triplet(Board board, int indexOnBoard)
            : base(board, indexOnBoard)
        {
        }
コード例 #23
0
 public ContagiousTower(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli board ve index setlemelerini yapiyor. effects ve stats i initialize ediyor.
     stats.baseRange = 0.9f;
 }
コード例 #24
0
 public NailTrapTower_MoreSlow(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
     // base constructor gerekli board ve index setlemelerini yapiyor. effects ve stats i initialize ediyor.
     stats.baseRange = 2.0f;
 }
コード例 #25
0
 public DroseraTower_insane(Board board, int indexOnBoard)
     : base(board, indexOnBoard)
 {
 }
コード例 #26
0
        private const int _simultaneousTargetLimit = 4; // ayni anda en fazla kac miniona saldirabilir.

        #endregion Fields

        #region Constructors

        public LaserTower_Quadruplet(Board board, int indexOnBoard)
            : base(board, indexOnBoard)
        {
        }