예제 #1
0
    public void Thrown()
    {
        if (state == BossState.GRAB)
        {
            y = BOSS_START_Y;
            if (SCR_Profile.showTutorial == 1)
            {
                speedX = BOSS_TUTORIAL_SPEED_X * -direction;
                speedY = BOSS_TUTORIAL_SPEED_Y;
            }
            else
            {
                speedX = BOSS_THROWN_SPEED_X * -direction;
                speedY = BOSS_THROWN_SPEED_Y;
            }

            RandomRotate();
            RandomFlyPose();

            for (int i = 0; i < 3; i++)
            {
                moneyParticle[i].SetActive(true);
            }

            SCR_GrabbedSound.Stop();
            SCR_Audio.PlayScreamSound();
        }
    }
예제 #2
0
    public void Punch(float px, float py, bool isSecurityGuy)
    {
        if (state >= BossState.FLY_1 && state <= BossState.FLY_6)
        {
            float handicap = BOSS_MIN_HANDICAP + (y / BOSS_HANDICAP_HEIGHT) * (1 - BOSS_MIN_HANDICAP);
            if (handicap > 1)
            {
                handicap = 1;
            }

            speedX += px;
            if (speedX > handicap * BOSS_MAX_SPEED_X)
            {
                speedX = handicap * BOSS_MAX_SPEED_X;
            }
            else if (speedX < -handicap * BOSS_MAX_SPEED_X)
            {
                speedX = -handicap * BOSS_MAX_SPEED_X;
            }

            if (isSecurityGuy)
            {
                maxSpeedY = BOSS_MAX_SPEED_Y_BONUS;
                speedY   += py;
            }
            else
            {
                if (speedY <= BOSS_MAX_SPEED_Y)
                {
                    maxSpeedY = BOSS_MAX_SPEED_Y;
                    speedY   += py;
                    if (speedY > BOSS_MAX_SPEED_Y)
                    {
                        speedY = BOSS_MAX_SPEED_Y;
                    }
                }
            }

            RandomRotate();
            SCR_Gameplay.instance.TriggerTutorial(TutorialStep.CONTINUE);

            RandomFlyPose();

            if (particleID == 0)
            {
                for (int i = 0; i < 3; i++)
                {
                    ParticleSystem.EmissionModule emission = moneyParticle[i].GetComponent <ParticleSystem>().emission;

                    if (size == BossSize.BIG)
                    {
                        emission.rateOverTimeMultiplier = 120;
                    }
                    else
                    {
                        emission.rateOverTimeMultiplier = 40;
                    }

                    moneyParticle[i].GetComponent <ParticleSystem>().startSpeed = Random.Range(py * 0.012f, py * 0.014f);
                    moneyParticle[i].SetActive(true);
                }
                particleID = 1;
            }
            else
            {
                for (int i = 3; i < 6; i++)
                {
                    ParticleSystem.EmissionModule emission = moneyParticle[i].GetComponent <ParticleSystem>().emission;

                    if (size == BossSize.BIG)
                    {
                        emission.rateOverTimeMultiplier = 120;
                    }
                    else
                    {
                        emission.rateOverTimeMultiplier = 40;
                    }

                    moneyParticle[i].GetComponent <ParticleSystem>().startSpeed = Random.Range(py * 0.012f, py * 0.014f);
                    moneyParticle[i].SetActive(true);
                }
                particleID = 0;
            }

            SCR_Audio.PlayScreamSound();
            bubble.GetComponent <SCR_Bubble>().Hit();
        }
    }