Ejemplo n.º 1
0
    public void Damage(IEnemyTargetable attacker)
    {
        Vector3 bloodDir = (GetPosition() - attacker.GetPosition()).normalized;

        Blood_Handler.SpawnBlood(GetPosition(), bloodDir);

        healthSystem.Damage(30);
        if (IsDead())
        {
            FlyingBody.Create(GameAssets.i.pfEnemyFlyingBody, GetPosition(), bloodDir);
            characterBase.DestroySelf();
            Destroy(gameObject);
        }
        else
        {
            // Knockback
            transform.position += bloodDir * 5f;

            /*
             * if (hitUnitAnim != null) {
             *  state = State.Busy;
             *  enemyBase.PlayHitAnimation(bloodDir * (Vector2.one * -1f), SetStateNormal);
             * }
             */
        }
    }
Ejemplo n.º 2
0
    public void Damage(EnemyAim attacker)
    {
        Vector3 bloodDir = (GetPosition() - attacker.GetPosition()).normalized;

        Blood_Handler.SpawnBlood(GetPosition(), bloodDir);

        healthSystem.Damage(1);
        if (IsDead())
        {
            FlyingBody.Create(GameAssets.i.pfEnemyFlyingBody, GetPosition(), bloodDir);
            playerBase.DestroySelf();
            Destroy(gameObject);
        }
        else
        {
            // Knockback
            transform.position += bloodDir * 2.5f;
        }
    }
Ejemplo n.º 3
0
 private void EnemyMain_OnDestroySelf(object sender, EventArgs e)
 {
     characterBase.DestroySelf();
 }