Example #1
0
    // Use this for initialization
    void Start()
    {
        initCatSpawnTimer = catSpawnTimer;

        ballsCasted           = false;
        ballDirChosen         = false;
        ellipseBallsOnTheMove = false;
        RainCounter           = 0;
        waitBallTimer         = waitToSendBalls;
        initialRainTimer      = RainTimer;
        initialFirstRainBall  = FirstRainBall;

        CastingBalls       = false;
        CastingPlatforms   = false;
        platformLocsChosen = false;
        platformsOut       = false;

        initAbilityBuffer = P4AbilityBuffer;

        BBspawnLeftStart.localPosition  = BigBallSpawnerLeft.localPosition;
        BBspawnRightStart.localPosition = BigBallSpawnerRight.localPosition;

        BM = GameObject.FindObjectOfType <PuppetBossManager>();

        SORL = GameObject.FindObjectOfType <StartOrResetLevel>();

        fightOver = false;
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        StartingLoc       = transform.localPosition;
        StartSpawnTimer   = SpawnDollsTimer;
        startingFadeValue = fadeAwayValue;
        player            = GameObject.FindGameObjectWithTag("Player");
        playerFound       = false;
        playerStruck      = false;
        hoveredBack       = false;
        readyToHoverBack  = false;
        waitedToHover     = false;

        movingToSpawnDolls      = false;
        SpawnedDolls            = false;
        backFromSpawning        = false;
        OGspotFound             = false;
        pausedBeforeSecondSpawn = false;
        firstDollSpawned        = false;

        HandsAreIdle          = false;
        sr                    = GetComponent <SpriteRenderer>();
        startLeftStrikeTimer  = LeftStrikeTimer;
        startRightStrikeTimer = RightStrikeTimer; //was divided by 2? idk

        LeftHandToStrike  = true;
        RightHandToStrike = false;

        beginPhaseRelocate = false;
        DollsAreOut        = false;
        waitForRightStrike = false;

        BossManager = FindObjectOfType <PuppetBossManager>();
    }
    // Update is called once per frame
    void FixedUpdate()
    {
        if (FindObjectOfType <PuppetBossManager>() != null)
        {
            BM = FindObjectOfType <PuppetBossManager>();
        }

        if (SORL.StartFight)
        {
            //if (BM.phaseOneActivated)
            {
                phase1Timer -= Time.deltaTime;
                if (!phase1HandsSpawned && phase1Timer <= 0)
                {
                    Instantiate(Phase1HandsL, Phase1HandsSpawnL.position, Quaternion.identity);
                    Instantiate(Phase1HandsR, Phase1HandsSpawnR.position, Quaternion.identity);
                    Instantiate(Puppeteer, BossSpawn.position, Quaternion.identity);
                    phase1HandsSpawned = true;
                }
            }

            if (BM.phaseTwoActivated)
            {
                phase2Timer -= Time.deltaTime;
                if (!phase2HandsSpawned && phase2Timer <= 0)
                {
                    Instantiate(Phase2HandsL, Phase1HandsSpawnL.position, Quaternion.identity);
                    Instantiate(Phase2HandsR, Phase1HandsSpawnR.position, Quaternion.identity);
                    phase2HandsSpawned = true;
                }
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        spawnTime = SpawnDollAfterXSeconds;

        BM = GameObject.FindObjectOfType <PuppetBossManager>();

        SORL = GameObject.FindObjectOfType <StartOrResetLevel>();
    }
Example #5
0
    // Use this for initialization
    void Start()
    {
        StartingPos = transform.position;
        hasSwitched = false;

        BM       = FindObjectOfType <PuppetBossManager>();
        sr       = GetComponent <SpriteRenderer>();
        sr.color = new Color(1f, 1f, 1f, 0f);
    }
    //[SerializeField]
    // Use this for initialization
    void Start()
    {
        phase1HandsSpawned = false;
        phase2HandsSpawned = false;
        SORL = FindObjectOfType <StartOrResetLevel>();

        phase2Timer = 2f;
        phase1Timer = 2f;

        BM = FindObjectOfType <PuppetBossManager>();
    }
Example #7
0
    // Use this for initialization
    void Start()
    {
        FirstGroundHit     = false;
        hitWall            = false;
        hitCeiling         = false;
        FallDown           = false;
        player             = GameObject.FindWithTag("Player");
        circulationCounter = 0;

        BM = GameObject.FindObjectOfType <PuppetBossManager>();
    }
Example #8
0
    // Use this for initialization
    void Start()
    {
        EHM         = GetComponent <EnemyHealthManager>();
        SORL        = FindObjectOfType <StartOrResetLevel>();
        BossManager = GameObject.FindObjectOfType <PuppetBossManager>();

        firstDollShot      = false;
        secondDollShot     = false;
        thirdDollShot      = false;
        hasWaitedToShoot   = false;
        startingSpawn      = CeilingSpawn.localPosition;
        startShootingTimer = 3f;
    }
Example #9
0
    // Use this for initialization
    void Start()
    {
        StartingLoc       = transform.localPosition;
        StartSpawnTimer   = SpawnDollsTimer;
        startingFadeValue = fadeAwayValue;
        player            = GameObject.FindGameObjectWithTag("Player");
        playerFound       = false;
        playerStruck      = false;
        hoveredBack       = false;
        readyToHoverBack  = false;
        waitedToHover     = false;

        movingToSpawnDolls      = false;
        SpawnedDolls            = false;
        backFromSpawning        = false;
        OGspotFound             = false;
        pausedBeforeSecondSpawn = false;
        firstDollSpawned        = false;

        currentStrikeCountLeft  = 0;
        currentStrikeCountRight = 0;

        HandsAreIdle          = false;
        sr                    = GetComponent <SpriteRenderer>();
        sr.color              = new Color(1f, 1f, 1f, 0f);
        startLeftStrikeTimer  = LeftStrikeTimer;
        startRightStrikeTimer = RightStrikeTimer; //was divided by 2? idk

        LeftHandToStrike  = true;
        RightHandToStrike = false;

        beginPhaseRelocate = false;
        DollsAreOut        = false;
        waitForRightStrike = false;

        SpawnEdgeDollLocation = transform;
        BossManager           = FindObjectOfType <PuppetBossManager>();

        anim = GetComponent <Animator>();

        if (GameObject.Find("Phase 2 Hand Left(Clone)") != null)
        {
            LeftHand = GameObject.Find("Phase 2 Hand Left(Clone)").GetComponent <Phase2HandsHealthManager>();
        }

        if (GameObject.Find("Phase 2 Hand Right(Clone)") != null)
        {
            RightHand = GameObject.Find("Phase 2 Hand Right(Clone)").GetComponent <P2HandsNew>();
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (GameObject.FindObjectOfType <PuppetBossManager>() != null)
        {
            BM = GameObject.FindObjectOfType <PuppetBossManager>();
        }



        if (BM.GetComponent <EnemyHealthManager>().enemyHealth <= 0)
        {
            Destroy(gameObject);
        }
    }
    // Update is called once per frame
    void FixedUpdate()
    {
        if (FindObjectOfType <PuppetBossManager>() != null)
        {
            BM = GameObject.FindObjectOfType <PuppetBossManager>();
        }

        if (BM.phaseOneActivated || BM.phaseTwoActivated)
        {
            SpawnDollAfterXSeconds -= Time.deltaTime;
            if (SpawnDollAfterXSeconds <= 0)
            {
                SpawnDollAfterXSeconds = spawnTime;
                girlSpawn.Play();
                Instantiate(RunningDoll, RunningDollEmitLocation.position, Quaternion.identity);
            }
        }
    }
Example #12
0
    void FixedUpdate()
    {
        if (FindObjectOfType <PuppetBossManager>() != null)
        {
            BossManager = GameObject.FindObjectOfType <PuppetBossManager>();
        }

        if (BossManager.phaseOneActivated)
        {
            startShootingTimer -= Time.deltaTime;
            if (startShootingTimer <= 0)
            {
                Shoot3Dolls();
                if (thirdDollShot && hasWaitedToShoot)
                {
                    hasWaitedToShoot = false;
                    firstDollShot    = false;
                    secondDollShot   = false;
                    thirdDollShot    = false;
                }
            }
        }
    }
Example #13
0
    // Use this for initialization
    void Start()
    {
        PSTimer             = PlatformSpawnTimer;
        UpPlatformCounter   = 0;
        DownPlatformCounter = 0;
        PlatformCount       = 0;
        PlatformChosen      = false;

        AerialSpawnChosen = false;
        AerialsFlying     = false;
        PlatformsOut      = false;
        AbilityFinished   = false;
        OneAerialOut      = false;
        CannonIsOut       = false;
        P3Buffer          = P3AbilityBuffer;

        P3abilitySwitch = Random.Range(0, 2);

        StartTimeBetweenAerials = TimeBetweenAerials;

        BM = GameObject.FindObjectOfType <PuppetBossManager>();

        SORL = GameObject.FindObjectOfType <StartOrResetLevel>();
    }
Example #14
0
    void FixedUpdate()
    {
        if (FindObjectOfType <PuppetBossManager>() != null)
        {
            BM = GameObject.FindObjectOfType <PuppetBossManager>();
        }

        if (BM.phaseThreeActivated)
        {
            Instantiate(deathEffect, transform.position, Quaternion.identity);
            Destroy(gameObject);
        }

        if (!FirstGroundHit)
        {
            transform.position = new Vector3(transform.position.x, transform.position.y - moveSpeed, transform.position.z);
            if (transform.position.y <= -4.1)
            {
                FirstGroundHit = true;
            }
        }
        else if (FirstGroundHit && !hitWall)
        {
            if (FromLeftHand)
            {
                transform.position = new Vector3(transform.position.x - moveSpeed, transform.position.y, transform.position.z);
                if (transform.position.x <= -9.6)
                {
                    hitWall = true;
                }
            }
            if (FromRightHand)
            {
                transform.position = new Vector3(transform.position.x + moveSpeed, transform.position.y, transform.position.z);
                if (transform.position.x >= 9.6)
                {
                    hitWall = true;
                }
            }
        }
        else if (hitWall && !hitCeiling)
        {
            transform.position = new Vector3(transform.position.x, transform.position.y + moveSpeed, transform.position.z);
            if (transform.position.y >= 4.1)
            {
                hitCeiling = true;
            }
        }
        else if (hitCeiling && !FallDown)
        {
            if (FromLeftHand)
            {
                transform.position = new Vector3(transform.position.x + moveSpeed, transform.position.y, transform.position.z);
                if (transform.position.x >= player.transform.position.x)
                {
                    giggleSound.Play();
                    FallDown = true;
                }
            }
            if (FromRightHand)
            {
                transform.position = new Vector3(transform.position.x - moveSpeed, transform.position.y, transform.position.z);
                if (transform.position.x <= player.transform.position.x)
                {
                    giggleSound.Play();
                    FallDown = true;
                }
            }
        }
        else if (FallDown)
        {
            transform.position = new Vector3(transform.position.x, transform.position.y - moveSpeed, transform.position.z);
            if (transform.position.y <= -4.1)
            {
                circulationCounter++;
                FirstGroundHit = false;
                hitWall        = false;
                hitCeiling     = false;
                FallDown       = false;
                if (circulationCounter == maxAmtCirculations)
                {
                    Instantiate(deathEffect, transform.position, Quaternion.identity);
                    Destroy(gameObject);
                }
                //Destroy(gameObject);
            }
        }
    }
Example #15
0
    void FixedUpdate()
    {
        if (FindObjectOfType <PuppetBossManager>() != null)
        {
            BM = GameObject.FindObjectOfType <PuppetBossManager>();
        }

        if (BM.phaseThreeActivated && BM.hasMovedForPhase3)
        {
            if (AbilityFinished)
            {
                P3AbilityBuffer -= Time.deltaTime;
                if (P3AbilityBuffer <= 0)
                {
                    AbilityFinished = false;
                    P3AbilityBuffer = P3Buffer;
                }
            }



            if (P3abilitySwitch == 0 && !AbilityFinished)
            {
                SpawnPlatforms();
                if (PlatformCount > 13)
                {
                    PlatformCount   = 0;
                    AbilityFinished = true;
                    P3abilitySwitch = 1;
                }
            }
            else if (P3abilitySwitch == 1 && !AbilityFinished)
            {
                if (!CannonIsOut)
                {
                    CannonIsOut = true;
                    Instantiate(BouncyBallCannon, CannonSpawnLoc.position, Quaternion.Euler(0f, 0f, 180f));
                    StartCoroutine(waitBouncyBalls(12f));
                }
            }
            else if (false)//(P3abilitySwitch == 1 && !AbilityFinished)
            {
                if (!AerialSpawnChosen)
                {
                    AerialSpawnRandomizer = Random.Range(0, 2);
                    AerialSpawnChosen     = true;
                }

                if (AerialSpawnRandomizer == 0)
                {
                    if (!OneAerialOut)
                    {
                        SpawnAirplane();
                        OneAerialOut = true;
                    }
                    else
                    {
                        TimeBetweenAerials -= Time.deltaTime;
                        if (TimeBetweenAerials <= 0)
                        {
                            AerialSpawnChosen  = false;
                            TimeBetweenAerials = StartTimeBetweenAerials;
                            SpawnRocketship();
                            OneAerialOut    = false;
                            AbilityFinished = true;
                            P3abilitySwitch = 0;
                        }
                    }
                }
                else
                {
                    if (!OneAerialOut)
                    {
                        SpawnRocketship();
                        OneAerialOut       = true;
                        TimeBetweenAerials = TimeBetweenAerials / 2;
                    }
                    else
                    {
                        TimeBetweenAerials -= Time.deltaTime;
                        if (TimeBetweenAerials <= 0)
                        {
                            AerialSpawnChosen  = false;
                            TimeBetweenAerials = StartTimeBetweenAerials;
                            SpawnAirplane();
                            OneAerialOut    = false;
                            AbilityFinished = true;
                            P3abilitySwitch = 0;
                            P3AbilityBuffer = P3AbilityBuffer + 4.5f;
                        }
                    }
                }
            }
        }
    }
Example #16
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (FindObjectOfType <PuppetBossManager>() != null)
        {
            BM = GameObject.FindObjectOfType <PuppetBossManager>();
        }


        if (BM.hasMovedForPhase4 && !fightOver)
        {
            P4AbilityBuffer -= Time.deltaTime;

            catSpawnTimer -= Time.deltaTime;
            if (catSpawnTimer <= 0)
            {
                catVroom.Play(); // Sound
                Instantiate(CatDeploy, CatSpawn.position, Quaternion.identity);
                catSpawnTimer = initCatSpawnTimer;
            }

            if (!ballsCasted && P4AbilityBuffer <= 0 && !CastingPlatforms)
            {
                CastInitialBalls();
                CastingBalls = true;
            }
            else if (ballsCasted)
            {
                if (!ellipseBallsOnTheMove)
                {
                    waitToSendBalls -= Time.deltaTime;
                }
                if (waitToSendBalls <= 0 && !ellipseBallsOnTheMove)
                {
                    ellipticalBalls.moveBalls = true;
                    if (!ballDirChosen)
                    {
                        ballDirRandomizer = Random.Range(0, 2);
                        Debug.Log(ballDirRandomizer);
                        ballDirChosen = true;
                    }

                    if (ballDirRandomizer == 0 && !ellipseBallsOnTheMove) //go left
                    {
                        if (ellipticalBalls.moveSpeedX > 0)
                        {
                            ellipticalBalls.moveSpeedX = -ellipticalBalls.moveSpeedX;
                        }
                        ellipseBallsOnTheMove = true;
                        waitToSendBalls       = waitBallTimer;
                    }
                    else //go right
                    {
                        if (ellipticalBalls.moveSpeedX < 0)
                        {
                            ellipticalBalls.moveSpeedX = -ellipticalBalls.moveSpeedX;
                        }
                        ellipseBallsOnTheMove = true;
                        waitToSendBalls       = waitBallTimer;
                    }
                    //waitToSendBalls = waitBallTimer;
                }
                else if (ellipseBallsOnTheMove)
                {
                    FirstRainBall -= Time.deltaTime;
                    if (FirstRainBall <= 0)
                    {
                        RainTimer -= Time.deltaTime;
                    }

                    if (RainTimer <= 0)
                    {
                        RainTimer = initialRainTimer;
                        CastRainOfBalls();
                        if (RainCounter >= 8)
                        {
                            //P4AbilityBuffer = 100;
                            P4AbilityBuffer           = initAbilityBuffer;
                            ballsCasted               = false;
                            ballDirChosen             = false;
                            ellipseBallsOnTheMove     = false;
                            RainCounter               = 0;
                            ellipticalBalls.moveBalls = false;
                            CastingPlatforms          = true;
                            //BigBallSpawnerLeft.localPosition = BBspawnLeftStart.localPosition;
                            //BigBallSpawnerRight.localPosition = BBspawnRightStart.localPosition;
                            RainTimer     = initialRainTimer;
                            FirstRainBall = initialFirstRainBall;
                        }
                    }
                }
            }

            if (P4AbilityBuffer <= 0 && CastingPlatforms)
            {
                CastPlatforms();
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     BM            = GameObject.FindObjectOfType <PuppetBossManager>();
     fightComplete = false;
 }