Exemple #1
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        base.damage(damage, type, knockback);

        if (facingLeft == true)
        {
            xForce = knockback * .01f;
        }
        else
        {
            xForce = -knockback * .01f;
        }

        switch (type)
        {
        case AbstractDamageCollider.DamageType.light:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.medium:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.heavy:
            _anim.SetTrigger("IsHit");
            break;
        }
    }
Exemple #2
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        base.damage(damage, type, knockback);

        if (facingLeft == true)
        {
            xForce = knockback * .01f;
        }
        else
        {
            xForce = -knockback * .01f;
        }

        if (state == EnemyStates.stun)
        {
            // Don't trigger anything if enemy is stunned.
            return;
        }

        switch (type)
        {
        case AbstractDamageCollider.DamageType.light:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.medium:
            _anim.SetTrigger("IsHit2");
            break;

        case AbstractDamageCollider.DamageType.heavy:
            _anim.SetTrigger("IsHit2");
            break;
        }
    }
Exemple #3
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        base.damage(damage, type, knockback);

        if (invincible || _enraged)
        {
            // Can't hurt this boy.
            return;
        }

        if (facingLeft == true)
        {
            xForce = damage * .005f;
        }
        else
        {
            xForce = -damage * .005f;
        }

        switch (type)
        {
        case AbstractDamageCollider.DamageType.light:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.medium:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.heavy:
            _anim.SetTrigger("IsHit");
            break;
        }
    }
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        base.damage(damage, type, knockback);

        if (isInvincible)
        {
            // Can't hurt this boy.
            return;
        }

        switch (type)
        {
        case AbstractDamageCollider.DamageType.light:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.medium:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.heavy:
            _anim.SetTrigger("IsHit");
            break;
        }

        if (_bossHealth <= 0)
        {
            // Boos is dead. Or is it?
            SendMessageUpwards("bossDead", SendMessageOptions.DontRequireReceiver);
        }
    }
Exemple #5
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        base.damage(damage, type, knockback);

        if (facingLeft == true)
        {
            xForce = knockback * .01f;
        }
        else
        {
            xForce = -knockback * .01f;
        }

        robotHealthBarAnim.SetFloat("Health", _enemHealth);

        switch (type)
        {
        case AbstractDamageCollider.DamageType.light:
            _anim.SetTrigger("IsHit");
            break;

        case AbstractDamageCollider.DamageType.medium:
            _anim.SetTrigger("IsHit2");
            break;

        case AbstractDamageCollider.DamageType.heavy:
            _anim.SetTrigger("IsHit2");
            _anim.SetBool("IsStunned", true);
            setState(EnemyStates.stun);
            break;
        }
    }
Exemple #6
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        if (state != BossAction.attack && state != BossAction.move)
        {
            // Can't damage him any other time than move and attack.
            return;
        }

        _anim.SetTrigger("IsHit");
        _bossHealth -= damage;
        if (_bossHealth <= 0)
        {
            // Boos is dead. Or is it?
            if (bossState == BOSS_STATE_MELEE)
            {
                // Nope, boss is actually serious now.
                bossState = BOSS_STATE_RANGED;

                // Trunk fall SFX.
                playSoundClip(clips[2], false);

                // Set bossDying. The battle is effectively over, but the player doesn't know it yet.
                SendMessageUpwards("bossDying", SendMessageOptions.DontRequireReceiver);

                setBossAction(BossAction.stun);
            }
            else
            {
                // YOU CAN'T KILL THIS ONE TODAY!
                stun(1f);
                _bossHealth = 400f;
                SendMessageUpwards("bossDead", SendMessageOptions.DontRequireReceiver);
            }
        }
    }
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        if (!invincible && _enemHealth > 0)
        {
            if (_enraged)
            {
                // Only takes half damage if enraged.
                damage /= 2;
            }

            _enemHealth -= damage;

            if (_useRage)
            {
                _rageLevel += damage;
                rageMeter.addRageLevel(damage);
                if (!_enraged && _rageLevel >= damageToRage)
                {
                    // Boss is now enraged.
                    _enraged = true;
                }
            }
            if (_enemHealth <= 0)
            {
                // Enemy is dead. Set state.
                setState(EnemyStates.dead);
                // Don't do anything else. Make-Dead code will handle the rest.
                return;
            }
        }
    }
Exemple #8
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        // Only has one hitpoint.
        parrotState = ParrotState.die;
        _anim.SetTrigger("Die");

        // Got hit by something. Drop item.
        drop(healItem);
    }
Exemple #9
0
 public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
 {
     if (damage > 0)
     {
         // Yup, that's it. Kill him off.
         _anim.SetTrigger("IsHit");
         setState(EnemyStates.dead);
     }
 }
Exemple #10
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type = AbstractDamageCollider.DamageType.light, int knockback = 0)
    {
        base.damage(damage, type, knockback);

        if (invincible)
        {
            // Can't hurt this boy.
            return;
        }

        // Dies from one hit. Deal with it.
        _anim.SetTrigger("Death");
    }
Exemple #11
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        // Spider only takes one kind of damage. Hacking override.
        damage = 100;
        base.damage(damage, type, knockback);

        if (isInvincible)
        {
            // Can't hurt this boy.
            return;
        }

        // Spider just takes damage from one source. Make it show.
        _anim.SetTrigger("IsHit");
    }
Exemple #12
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        base.damage(damage, type, knockback);

        if (isInvincible)
        {
            // Can't hurt this boy.
            return;
        }

        if (_bossHealth <= 0)
        {
            // Boos is dead. Or is it?
            SendMessageUpwards("bossDead", SendMessageOptions.DontRequireReceiver);
        }
    }
Exemple #13
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        if (!isVulnerable)
        {
            // Can't damage him any other time than move and attack.
            return;
        }

        _bossHealth -= damage;
        if (_bossHealth <= 0)
        {
            // Boos is dead. Or is it?
            SendMessageUpwards("bossDead", SendMessageOptions.DontRequireReceiver);
        }
        else
        {
            // Boss is hit. Stun that noise!
            stun(5);
        }
    }
Exemple #14
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        if (state != BossAction.attack && state != BossAction.move)
        {
            // Can't damage him any other time than move and attack.
            return;
        }

        _bossHealth -= damage;
        if (_bossHealth <= 0)
        {
            // Boos is dead. Or is it?
            if (bossState == BOSS_STATE_FINAL)
            {
                SendMessageUpwards("bossDead", SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                stun(1f);
            }
        }
    }
Exemple #15
0
    public override void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
    {
        if (tempInvuln != true)
        {
            // Hit a player! Do death!
            tempInvuln      = true;
            tempInvulnTimer = 1f;

            if (type == AbstractDamageCollider.DamageType.stunAttack)
            {
                StartCoroutine(stunAttack());
            }
            else if (type == AbstractDamageCollider.DamageType.stunMove)
            {
                StartCoroutine(stunMove());
            }
            else if (type == AbstractDamageCollider.DamageType.stunAll)
            {
                StartCoroutine(stunAttack());
                StartCoroutine(stunMove());
            }
            else
            {
                // Normal hit. Show knockback anim.
                _anim.SetTrigger("IsHit");
                setState(PlayerStates.stunned);
            }

            if (playerHealth > 0)
            {
                playerHealth -= damage;
                if (playerHealth <= 0)
                {
                    // Player dead, yo.
                    SendMessageUpwards("playerDied", null, SendMessageOptions.DontRequireReceiver);
                }
            }
        }
    }
Exemple #16
0
 public virtual void damage(int damage, AbstractDamageCollider.DamageType type, int knockback)
 {
 }