public ContagiousMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 5;
     damageList.Add(new Damage(0, DamageType.FIRE));
     movementSpeed = 3.0f;
 }
示例#2
0
 protected Missile(Tower ownerTower, Minion targetMinion)
 {
     instanceId = idGenerator++;
     this.ownerTower = ownerTower;
     this.targetMinion = targetMinion;
     this.position = ownerTower.getWorldPosition();
 }
 public Ballista_lavaBoltMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 3.0f;
     damageList.Add(new Damage(25, DamageType.PHYSICAL));
     damageList.Add(new Damage(50, DamageType.FIRE));
 }
示例#4
0
        protected float movementSpeed = 5; // TODO Minion statstan al

        #endregion Fields

        #region Constructors

        protected Missile(Vector3 startWorldPosition, Tower ownerTower, Minion targetMinion)
        {
            instanceId = idGenerator++;
            this.targetMinion = targetMinion;
            this.ownerTower = ownerTower;
            this.position = startWorldPosition;
        }
 public TrypanophobiaMissile(Tower ownerTower, Minion targetMinion, float runBackTime)
     : base(ownerTower, targetMinion)
 {
     this.runBackTime = runBackTime;
     movementSpeed = 5.0f;
     damageList.Add(new Damage(60, DamageType.PHYSICAL));
 }
 public SeedTowerPlantMissile(Tower ownerTower, Vector3 startWorldPosition, Minion targetMinion)
     : base(startWorldPosition, ownerTower, targetMinion)
 {
     this.startWorldPosition = startWorldPosition;
     movementSpeed = 5.0f;
     damageList.Add(new Damage(50, DamageType.FIRE));
 }
 public OneToAll_toxicMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 3.0f;
     damageList.Add(new Damage(20, DamageType.PHYSICAL));
     damageList.Add(new Damage(40, DamageType.POISON));
 }
 public PetrolBombMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 5.0f;
     damageList.Add(new Damage(0, DamageType.POISON));
     targetPosition = targetMinion.getWorldPosition();
     targetBoard = targetMinion.position.board;
 }
示例#9
0
 public NailTrapMissile(Tower ownerTower, Minion targetMinion,float slowAmount,float dmgPerSecond)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 50.0f;
     damageList.Add(new Damage(0, DamageType.POISON));
     targetPosition = targetMinion.getWorldPosition();
     targetBoard = targetMinion.position.board;
     this.slowAmount = slowAmount;
     this.dmgPerSecond = dmgPerSecond;
 }
示例#10
0
 public SeedTowerMissile(Tower ownerTower, Minion targetMinion, int numOfTarget)
     : base(ownerTower, targetMinion)
 {
     Random random = new Random();
     Vector3 offset = new Vector3((float)(random.NextDouble() - 0.5f) / 4.0f,
                                     0.0f,
                                     (float)(random.NextDouble() - 0.5f) / 4.0f);
     this.numOfTarget = numOfTarget;
     targetPosition = targetMinion.getWorldPosition() + offset;
     movementSpeed = 3.0f;
     damageList.Add(new Damage(0, DamageType.FIRE));
 }
示例#11
0
        public CatapultMissile(Tower ownerTower, Minion targetMinion)
            : base(ownerTower, targetMinion)
        {
            position.y += 0.4f;             // catapult'un atis yuksekligi. Simdilik böyle yazdım.
                                            // İleride bu yükseklik zımbırtısını nası atacaz server'a bakalım

            targetPosition = targetMinion.getWorldPosition();

            calcSpeedDirection();

            damageList.Add(new Damage(20,DamageType.PHYSICAL));
        }
        public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion)
        {
            RawMessage msg = new RawMessage();
            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_Zombie_Raise)));

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("iid", minion.instanceId);

                foreach (var receiverPlayer in receiverPlayers)
                    receiverPlayer.user.session.client.SendMessage(msg);
            }
        }
示例#13
0
        public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion, MinionEffect effect)
        {
            RawMessage msg = new RawMessage();
            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GAddEffectOnMinion)));

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("iid", minion.instanceId);
                msg.putInt("tid", TypeIdGenerator.getMinionEffectId(effect.GetType()));

                foreach (var receiverPlayer in receiverPlayers)
                    receiverPlayer.user.session.client.SendMessage(msg);
            }
        }
        public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion, float runBackTime)
        {
            RawMessage msg = new RawMessage();
            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_Trypanophobia_addEffect)));

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("iid", minion.instanceId);
                msg.putFloat("t", runBackTime);

                foreach (var receiverPlayer in receiverPlayers)
                    receiverPlayer.user.session.client.SendMessage(msg);
            }
        }
        public static void sendMessage(ICollection<Player> receiverPlayers, LaserTower tower, Minion targetedMinion)
        {
            RawMessage msg = new RawMessage();
            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GTower_LaserTower_untarget)));

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("tiob", tower.indexOnBoard);
                msg.putInt("tbid", tower.board.instanceId);
                msg.putInt("miid", targetedMinion.instanceId);

                foreach (var receiverPlayer in receiverPlayers)
                    receiverPlayer.user.session.client.SendMessage(msg);
            }
        }
        public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion)
        {
            RawMessage msg = new RawMessage();
            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinionPositionInfo)));

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("iid", minion.instanceId);
                msg.putInt("bid", minion.position.board.instanceId);
                msg.putInt("cid", minion.position.pathPosition.pointIndex);
                msg.putFloat("t", minion.position.pathPosition.ratio);

                foreach (var receiverPlayer in receiverPlayers)
                    receiverPlayer.user.session.client.SendMessage(msg);
            }
        }
        public static void sendMessage(ICollection<Player> receiverPlayers, Minion minion, ICollection<Minion> otherMinions)
        {
            RawMessage msg = new RawMessage();
            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GMinion_QuantumSoldier_teleport)));

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("iid", minion.instanceId);
                msg.putFloat("ds", 1.3f);

                int [] minionInstanceIDs = new int[otherMinions.Count];

                int index = 0;
                foreach (var minionTarget in otherMinions)
                {
                    minionInstanceIDs[index++] = minionTarget.instanceId;
                }

                msg.putIntArray("mids", minionInstanceIDs);

                foreach (var receiverPlayer in receiverPlayers)
                    receiverPlayer.user.session.client.SendMessage(msg);
            }
        }
示例#18
0
 protected virtual Missile createMissile(Minion m)
 {
     return new BallistaMissile(this, m);
 }
示例#19
0
 public AcidMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 5.0f;
     damageList.Add(new Damage(0, DamageType.POISON));
 }
示例#20
0
 public TeslaMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 3.0f;
     damageList.Add(new Damage(120, DamageType.FIRE));
 }
示例#21
0
        /// <summary>
        /// Verilen minionu boarda ekler. 2.Parametrede verilen noktaya goturur.
        /// </summary>
        /// <param name="minion">boarda yerlestirilecek minion</param>
        /// <returns>Bu islem her zaman basarili oldugu icin bir return degeri yoktur.</returns>
        public void AddMinionSpecificPosition(Minion minion, PathPosition position, bool notifyPlayers = true)
        {
            if (boardState != BoardState.COLLAPSING)
            {
                try
                {
                    toBeAddedMinions.Add(minion);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.StackTrace + " : " + e.Message);
                }

                if (minion.position == null)
                    minion.position = new MinionPosition();

                minion.position.board = this;
                minion.position.pathPosition = new PathPosition(position.pointIndex, position.ratio);
                
                if(notifyPlayers)
                    Messages.OutgoingMessages.Game.GMinionPositionInfo.sendMessage(player.game.players, minion);
            }
            else
            {
                minion.destroyable = true;
                Messages.OutgoingMessages.Game.GDestroyMinionInfo.sendMessage(player.game.players, minion);
            }

        }
示例#22
0
        /// <summary>
        /// Verilen minionu boarda ekler. Default olarak minion board'un path'inin ilk noktasina yerlestirilir.
        /// </summary>
        /// <param name="minion">boarda yerlestirilecek minion</param>
        /// <param name="addToEnd">eger bu deger true ise minion board un pathinin son noktasina yerlestirilir (geri yonde ilerleyen minionlar icin).</param>
        /// <returns>Bu islem her zaman basarili oldugu icin bir return degeri yoktur.</returns>
        public void AddMinion(Minion minion, bool addToEnd = false, bool tellUsers = true)
        {
            if (boardState != BoardState.COLLAPSING)
            {
                try
                {
                    toBeAddedMinions.Add(minion);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.StackTrace + " : " + e.Message);
                }

                if (minion.position == null)
                    minion.position = new MinionPosition();
                minion.position.board = this;

                if (!addToEnd)
                    minion.position.pathPosition = getPath().getStartPoint();
                else
                    minion.position.pathPosition = getPath().getEndPoint();

                if(tellUsers)
                    Messages.OutgoingMessages.Game.GMinionPositionInfo.sendMessage(player.game.players,minion);
            }
            else
            {
                minion.destroyable = true;
                Messages.OutgoingMessages.Game.GDestroyMinionInfo.sendMessage(player.game.players,minion);
            }

        }
示例#23
0
 public ElectricityMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 6.0f;
     damageList.Add(new Damage(10, DamageType.PHYSICAL));
 }
示例#24
0
 public abstract void step(Minion minion);
 public Contagious_extraMissile(Tower ownerTower, Minion targetMinion)
     : base(ownerTower, targetMinion)
 {
     movementSpeed = 3.0f;
 }
示例#26
0
 protected virtual Missile createMissile(Minion m)
 {
     return new ContagiousMissile(this, m);
 }
示例#27
0
 /// <summary>
 /// verilen minion'un position.board elemanini 'null'a esitler. Bu minionu iceren liste, iteration sirasinda bu durumu farkedip minionu listeden silecektir.
 /// </summary>
 /// <param name="minion">board'dan cikarilacak minion</param>
 public void RemoveMinion(Minion minion)
 {
     minion.position.board = null;       // burada hashmap uzerinde herhangi bir islem yapmiyoruz. aksi takdirde minionlari gezen foreach iteration'ini bozabiliriz. bu minion daha sonra iteration tarafindan tespit edilip listeden silinecek, sadece board'i null yapmak yeterli.
 }
示例#28
0
 protected virtual Missile createMissile(Minion m)
 {
     return new OneToAllMissile(this, m);
 }