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; }
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; } }
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; } }
public Inventario(Player player) { itens = new List<IItem>(); this.player = player; }
public virtual void ApplyEffect(Player player) { throw new System.NotImplementedException(); }
private void SkillDamage(Player targetPlayer) { targetPlayer.Hp -= this.damage; targetPlayer.DamageCount += this.damage; }
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); }
/// <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); }
/// <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(); }
/// <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."); }