Example #1
0
 public override void Execute(Entity parEntity)
 {
     if (canAttack)
     {
         Debug.Log("simple Attack");
         parEntity.TakeDamage(this._damage);
         this.GetComponent<Entity>().TakeBreathCost(this._damageToBreath, this._breathMultiplier);
         _currentCoolDown = 0;
         parEntity.transform.DOShakeScale(0.7f, 1, 10).OnComplete(() => parEntity.transform.DOKill(true));
     }
 }
Example #2
0
 private void resolveAttack(Entity other)
 {
     // TODO: Add a timer-thing, so this method is not called every frame. Maybe use Coroutines.
     bool kill = other.TakeDamage(_entity.Stats.Attack);
     if (kill) // Prevent the enemy from hurting the player, if the player kills it first.
     {
         disengageAttack(other);
         other.Die();
         _entity.Stats.ScoreValue += other.Stats.ScoreValue;
         _entity.Stats.Experience += other.Stats.Experience;
         return;
     }
     bool died = _entity.TakeDamage(other.Stats.Attack);
     if (died) _entity.Die();
 }
Example #3
0
 public void Attack(Entity entity)
 {
     entity.TakeDamage(Strength);
 }
Example #4
0
 public override void Execute(Entity parEntity)
 {
     parEntity.TakeDamage(this._damage);
     //this.GetComponent<Entity>().TakeBreathCost(this._damageToBreath, this._breathMultiplier);
     parEntity.transform.DOShakeScale(0.7f, 1, 10).OnComplete(() => parEntity.transform.DOKill(true));
 }