Example #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();
            }
        }
    }
Example #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();
        }
    }
Example #3
0
 public void IcicleHurt(int damage)
 {
     healthPool -= damage;
     healthBar.updateHealth(healthPool);
     CamShake.AddTrauma(0.7f);
     canHurt = true;
     DoRoar();
 }
Example #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);
    }
Example #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;
    }
Example #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();
        }
    }
    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();
        }
    }
Example #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);
        }
    }
Example #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);
        }
    }
Example #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);
        }
    }
Example #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();
        }
    }
Example #12
0
 void Shake()
 {
     CamShake.AddTrauma(1.0f);
 }
Example #13
0
 void JumpShake()
 {
     CamShake.AddTrauma(0.8f);
 }