Esempio n. 1
0
    public void SetRoute(Vector2 forPlayerDirection, Vector2 start, Vector2 center, Vector2 end, float chaseSpeed, bool chaseMode, Vector2 parentPosition, int pattern)
    {
        //direction = opCurves.SeekDirectionToPlayer(this.gameObject.transform.position, targetPosition);
        direction       = forPlayerDirection;
        bezierStart     = start;
        bezierCenter    = center;
        bezierEnd       = end;
        missileMaxSpeed = chaseSpeed;
        startChase      = chaseMode;
        bossPatternName = (BossPatternName)pattern;
        parentPos       = parentPosition;


        if (bossPatternName == BossPatternName.Side)
        {
            bezierSpeed += 0.9f;
        }

        if (bossPatternName == BossPatternName.Round)
        {
            guidedIsActive = Random.Range(0, 100) > 95 ? true : false;
            if (guidedIsActive == true)
            {
                guidedTimer = Random.Range(2.5f, guidedTimerMax);
            }
        }
    }
Esempio n. 2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        //Debug.Log("Name : BOSSMissile - " +  collision.tag);
        if (this.tag == "Missile")
        {
            this.gameObject.transform.rotation = Quaternion.Euler(new Vector3(0, 0, 0));

            if (collision.tag == "WasteBasket")
            {
                Destroy(this.gameObject);
            }
            switch (collision.tag)
            {
            case "Player":
                //case "WasteBasket":
                //Debug.Log("If Player : " +collision.tag);
                Destroy(this.gameObject);
                break;

            case "PlayerShield":
                this.tag           = "PlayerMissile";
                this.name          = "PlayerMissile";
                enemyTrail.enabled = true;
                missileColor.color = Color.blue;
                //Debug.Log(missileColor);
                //GameManager.Instance.ScoreAdd("Missile");
                PublicValueStorage.Instance.AddMissileScore();
                bossPatternName      = BossPatternName.StateCount;
                direction            = opCurves.SeekDirection(this.gameObject.transform.position, parentPos);
                missileCurrentSpeed *= missileReflectSpeed;
                break;
            }
        }


        else if (this.tag == "PlayerMissile")
        {
            if (collision.tag == "WasteBasket")
            {
                Destroy(this.gameObject);
            }
            switch (collision.tag)
            {
            case "Enemy":
                Destroy(this.gameObject);
                break;
            }
        }
    }
    private void BossMissile()
    {
        if (bossPatternState == BossPatternState.Shuffle)
        {
            bossPatternState = BossPatternState.Selected;
        }
        if (bossPatternState == BossPatternState.Selected)
        {
            bossPatternName  = (BossPatternName)RandomPatternSelect();
            missileSaveStack = Random.Range(missileStackMin, missileStackMax);

            if (alwaysThisPattern != BossPatternName.StateCount)
            {
                bossPatternName = alwaysThisPattern;
            }


            if (bossPatternName == BossPatternName.Side)
            {
                missileSideStack = missileSaveStack;
            }
            if (bossPatternName == BossPatternName.Round)
            {
                variableAngle = Random.Range(-missileFullAngle, missileFullAngle);
                SoundManager.Instance.ShortSpeaker(SoundManager.Speaker.Center, soundMissileRound);
            }

            //Debug.Log("missile Ea : " + missileEa);
            //Debug.Log("missile stack : " + missileSaveStack);

            bossPatternState = BossPatternState.Launch;
        }
        if (bossPatternState == BossPatternState.Launch)
        {
            ShotMissile();
        }
        if (bossPatternState == BossPatternState.Cooldown)
        {
            cooldownTimer += Time.deltaTime;

            if (cooldownTimer >= cooldownTimerCheck)
            {
                bossPatternState = BossPatternState.Shuffle;
                cooldownTimer    = 0;
            }
        }
    }
Esempio n. 4
0
    private void BossMissile()
    {
        if (bossPatternState == BossPatternState.Shuffle)
        {
            bossPatternState = BossPatternState.Selected;
        }


        if (bossPatternState == BossPatternState.Selected)
        {
            bossPatternName  = (BossPatternName)RandomPatternSelect();
            missileSaveStack = Random.Range(missileStackMin, missileStackMax);
            //Debug.Log("Stack is : " + missileSaveStack);


            if (alwaysThisPattern != BossPatternName.StateCount)
            {
                bossPatternName = alwaysThisPattern;
            }


            if (bossPatternName == BossPatternName.Vertical)
            {
                verticalPattern = (VerticalPattern)Random.Range(0, (int)VerticalPattern.StateCount);
            }


            if (bossPatternName == BossPatternName.LineFall)
            {
                speedLF = Random.Range(speedMinLF, speedMaxLF);
                player.InitLineFall(true);
                isLineFallAlive = true;
            }
            else
            {
                player.InitLineFall(false);
            }


            if (bossPatternName == BossPatternName.SlowRailGun)
            {
                speedSRG         = Random.Range(speedMinSRG, speedMaxSRG);
                missileSaveStack = 1;
                isSRGAlive       = true;
            }


            //Debug.Log("Selected : " + bossPatternName);

            bossPatternState = BossPatternState.Launch;
        }


        if (bossPatternState == BossPatternState.Launch)
        {
            ShotMissile();
        }


        if (bossPatternState == BossPatternState.Cooldown)
        {
            cooldownTimerCheck += Time.deltaTime;
            if ((cooldownTimer <= cooldownTimerCheck) && (isLineFallAlive == false || isSRGAlive == false))
            {
                bossPatternState   = BossPatternState.Shuffle;
                cooldownTimerCheck = 0;
            }
        }
    }