void UpdateSkill(string skillName, float WaitAnimationTime, float DestroyEffectTime, byte[] player, byte[] skill)
 {
     this.skill = Tools.DeserializeObject<BaseSkill>(skill);
     this.fromPlayer = Tools.DeserializeObject<Player>(player);
     this.skillName = skillName;
     this.WaitAnimationTime = WaitAnimationTime;
     this.DestroyTime = DestroyEffectTime;
 }
Example #2
0
        public bool BuyItem(Player player, int indexItem)
        {
            if (indexItem > itens.Count)
                throw new IndexOutOfRangeException();

            IItem item = (IItem)itens[indexItem].Clone();

            if (player.Gold < item.Custo) {
                return false;
            } else {
                player.Inventario.Add(item);
                player.Gold -= item.Custo;
                return true;
            }
        }
Example #3
0
 public virtual void ApplySkillEffect(Player targetPlayer, RTSController from)
 {
     switch (type) {
         case SkillType.BUFF:
             this.ApplyBuff(from.GetPlayer);
             break;
         case SkillType.DEBUFF:
             this.ApplyDebuff(targetPlayer, from);
             break;
         case SkillType.ATTACK:
             this.ApplyDamage(targetPlayer, from);
             break;
         case SkillType.ULTIMATE:
             this.ApplyDamage(targetPlayer, from);
             this.ApplyDebuff(targetPlayer, from);
             break;
     }
 }
Example #4
0
 public Inventario(Player player)
 {
     itens = new List<IItem>();
     this.player = player;
 }
Example #5
0
 public virtual void ApplyEffect(Player player)
 {
     throw new System.NotImplementedException();
 }
Example #6
0
 private void SkillDamage(Player targetPlayer)
 {
     targetPlayer.Hp -= this.damage;
     targetPlayer.DamageCount += this.damage;
 }
Example #7
0
        protected virtual void ApplyKnockBack(Player targetPlayer, RTSController from)
        {
            if (!targetPlayer.Controller)
                throw new SkillException("Controller was not found.");

            Debug.Log("DmgCount" + targetPlayer.DamageCount);
            Debug.Log("Knockback factory" + this.knockBackFactory);

            Debug.Log((targetPlayer.DamageCount / this.knockBackFactory));

            Ray ray = new Ray(from.transform.position, targetPlayer.Controller.transform.position);

            // TODO: Verificar como será feito o KNOCKBACK.

            Vector3 knockback = ray.direction * ((targetPlayer.DamageCount / 100) / this.knockBackFactory);

            Debug.Log(knockback);

            targetPlayer.Controller.transform.Translate(knockback);
        }
Example #8
0
        /// <summary>
        /// Apply a debuff to target player, that skill need to be a debuff skill.
        /// </summary>
        /// <param name="targetPlayer"></param>
        protected virtual void ApplyDebuff(Player targetPlayer, RTSController from)
        {
            if (type != SkillType.DEBUFF)
                throw new SkillException("This isn't a Buff Skill.");

            if (this.damage > 0)
                this.SkillDamage(targetPlayer);

            targetPlayer.setSlowed(3);
            this.ApplyKnockBack(targetPlayer, from);
        }
Example #9
0
        /// <summary>
        /// Apply the skill damage to target player, that skill need to be an attack skill.
        /// </summary>
        /// <param name="targetPlayer"></param>
        protected virtual void ApplyDamage(Player targetPlayer, RTSController from)
        {
            if (type != SkillType.ATTACK)
                throw new SkillException("This isn't an Attack Skill.");

            this.SkillDamage(targetPlayer);

            this.ApplyKnockBack(targetPlayer, from);
            this.ApplyCooldown();
        }
Example #10
0
 /// <summary>
 /// Apply a buff to target player, that skill need to be a buff skill.
 /// </summary>
 /// <param name="targetPlayer"></param>
 protected virtual void ApplyBuff(Player targetPlayer)
 {
     if (type != SkillType.BUFF)
         throw new SkillException("This isn't a Buff Skill.");
 }