Esempio n. 1
0
    public override void PlayerPunched(int damage, PlayerPunch punch)
    {
        if (state == WizardState.PickingCups)
        {
            if (motor.IsRealCupInFront())
            {
                Invoke("DoCupRecover", 4.0f);

                motor.DoCupStun();
            }
            else
            {
                state = WizardState.Idle;
                DoScreenSweep();
            }
        }
        if (state == WizardState.CupStunned)
        {
            healthPool -= damage;
            healthBar.updateHealth(healthPool);
            CamShake.AddTrauma(0.2f);
            audioSource.PlayOneShot(hurtSound);

            if (healthPool < 0)
            {
                DoDie();
            }
            else
            {
                motor.DoCupHurt();
            }
        }
    }
Esempio n. 2
0
    public override void PlayerPunched(int damage, PlayerPunch punch)
    {
        if (state == BlackbeardState.Idle)
        {
            motor.DoGuard();
        }

        if (state == BlackbeardState.Stunned && canGetHurt)
        {
            healthPool -= damage;
            healthBar.updateHealth(healthPool);
            CamShake.AddTrauma(0.7f);

            if (healthPool <= 0)
            {
                DoDie();
            }
            else
            {
                DoHurt(punch);
            }

            player.BossHurt();
        }

        if (state == BlackbeardState.Cannon && cannonballBackfire)
        {
            DoStun();
            DoCannonReturn();
        }
    }
Esempio n. 3
0
 public void IcicleHurt(int damage)
 {
     healthPool -= damage;
     healthBar.updateHealth(healthPool);
     CamShake.AddTrauma(0.7f);
     canHurt = true;
     DoRoar();
 }
Esempio n. 4
0
    public void OnLookAtIrrwish(float distT, float facingT, float opaqueness)
    {
        float totalFactor = facingT * Mathf.Clamp(_dmgFacingFactor, _minFacingDmg, 1.0f) * (1.0f - opaqueness);

        if (_shake)
        {
            _shake.ReduceTrauma = false;
            _shake.AddTrauma(totalFactor * Time.deltaTime);
        }

        float dmg = Mathf.Lerp(_dmgClose, _dmgFar, distT) * totalFactor;

        ChangeHealth(dmg * Time.deltaTime);
    }
Esempio n. 5
0
    public override void PlayerPunched(int damage, PlayerPunch punch)
    {
        Camera.main.GetComponent <AudioSource>().PlayOneShot(punchSound);

        health -= damage;
        if (health <= 0)
        {
            GameController.controller.Win(2.0f);
        }

        healthBar.updateHealth(health);
        CamShake.AddTrauma(0.7f);
        vel -= 250.0f;
    }
Esempio n. 6
0
    void DoHurt(int dmg, PlayerPunch punch)
    {
        sound.playHurt();
        CamShake.AddTrauma(0.7f);

        motor.DoHurt(punch);
        healthpool -= dmg;
        healthBar.updateHealth(healthpool);
        if (healthpool <= 0)
        {
            GameController.controller.Win(4.0f);
            sound.playDeath();
            state = ChinbaldState.Dead;
            motor.DoDeath();
            player.BossDied();
        }
    }
Esempio n. 7
0
    void DoHurt(int dmg)
    {
        ClearInputQueue();

        attacking = false;

        state       = PlayerState.Hurt;
        healthpool -= dmg;
        healthBar.updateHealth(healthpool);
        CamShake.AddTrauma(1.0f);
        ani.SetTrigger("PlayerHurt");

        if (healthpool <= 0)
        {
            GameController.controller.GameOver();
            state = PlayerState.Dead;
            ani.SetTrigger("death");
            boss.PlayerDied();
        }
    }
Esempio n. 8
0
    public void tickDown()
    {
        if (left)
        {
            left.tickDown();
            CamShake.AddTrauma(0.2f);
        }

        if (center)
        {
            center.tickDown();
            CamShake.AddTrauma(0.2f);
        }

        if (right)
        {
            right.tickDown();
            CamShake.AddTrauma(0.2f);
        }
    }
Esempio n. 9
0
    public void collapse()
    {
        if (left)
        {
            left.fall();
            CamShake.AddTrauma(0.5f);
        }

        if (right)
        {
            left.fall();
            CamShake.AddTrauma(0.5f);
        }

        if (center)
        {
            center.fall();
            CamShake.AddTrauma(0.5f);
        }
    }
Esempio n. 10
0
    public void OnTap()
    {
        if (shakeTicks > 0)
        {
            return;
        }

        tapDamage++;
        CamShake.AddTrauma(0.1f);

        if (tapDamage >= 3)
        {
            tapDamage = 0;
            tickDown();
            CamShake.AddTrauma(0.3f);
        }
        else
        {
            shake(3);
        }
    }
Esempio n. 11
0
    public override void PlayerPunched(int dmg, PlayerPunch punch)
    {
        //TODO: Create a specific timing window during the roar to hurt him.
        if (state == YetiState.Roar && canHurt)
        {
            healthPool -= dmg;
            healthBar.updateHealth(healthPool);
            CamShake.AddTrauma(0.7f);

            if (healthPool <= 0)
            {
                DoDie();
            }
            else
            {
                //DoHurt (punch);
            }

            player.BossHurt();
        }
    }
Esempio n. 12
0
 void Shake()
 {
     CamShake.AddTrauma(1.0f);
 }
Esempio n. 13
0
 void JumpShake()
 {
     CamShake.AddTrauma(0.8f);
 }