Beispiel #1
0
    public IBossState DoState(BossStateManager boss)
    {
        if (boss.isDead)
        {
            this.ExitState(boss);
            return(boss.deathState);
        }

        if (TurnSystem.isPlayerTurn && boss.isHurt)
        {
            this.ExitState(boss);
            return(boss.hurtState);
        }
        else if (boss.isOverdrive)
        {
            this.ExitState(boss);
            return(boss.overdriveState);
        }
        else if (TurnSystem.isPlayerTurn)
        {
            return(boss.idleInactiveState);
        }
        else
        {
            //this means its now THE ENEMY'S TURN. Go straight into attack...
            this.ExitState(boss);
            return(boss.attackState);
        }
        //so basically... pay attention to the TuRNSYSTEM.
    }
    public IBossState DoState(BossStateManager boss)
    {
        if (boss.animator.GetCurrentAnimatorStateInfo(0).normalizedTime > 1)
        {
            //anim has ended
            this.ExitState(boss);
            if (boss.isDead)
            {
                return(boss.deathState);
            }

            if (boss.isOverdrive)
            {
                //this overDriveStart invocation..should only run ... once wtf...
                //boss.overdriveStart?.Invoke();
                return(boss.overdriveState);
            }
            else
            {
                return(boss.idleInactiveState);
            }
        }
        else
        {
            return(boss.hurtState);
        }
    }
 public void InitState(BossStateManager boss)
 {
     boss.overdriveRig.SetActive(true);
     boss.animator.Play(boss.BOSS_OVERDRIVE_ANIM_NAME);
     SoundManager.Instance.Play(boss.overdriveSE);
     //ghetto fix. moving boss.overDriveStart?.Invoke() to the exitState of hurtState
     //cause race condition
     boss.overdriveStart?.Invoke();
 }
    public void InitState(BossStateManager boss)
    {
        //activate rig
        boss.hurtRig.SetActive(true);
        boss.animator.Play(boss.BOSS_HURT_ANIM_NAME);
        AudioClip randomHurtClip = boss.hurtAudioClips[Random.Range(0, boss.hurtAudioClips.Count)];

        SoundManager.Instance.PlayVoice(randomHurtClip);
    }
 public void ExitState(BossStateManager boss)
 {
     boss.deathRig.SetActive(false);
     boss.questClearedEvent.EnableQuestClearedMenu();
     //invoke quest cleared NOW
     //actually, invoke bossIsDead now
     //play victory music
     //the VICTORY UI screen will play the music!
 }
 // Start is called before the first frame update
 void Start()
 {
     setTimer = timer;
     bossMng  = GetComponent <BossStateManager>();
     for (int i = 0; i < 5; i++)
     {
         timerArray[i] = -1;
     }
 }
Beispiel #7
0
    // Start is called before the first frame update
    void Start()
    {
        bossMng = GetComponent <BossStateManager>();

        upper  = transform.position.y + 2;
        downer = transform.position.y;

        timer1 = timer;
    }
    public void InitState(BossStateManager boss)
    {
        //turn on rig. play animation on loop
        boss.deathRig.SetActive(true);
        boss.animator.Play(boss.BOSS_DEATH_ANIM_NAME);
        //play the audio scream from here...but play explosions in the rig anim keyframes
        //AudioClip deathScream
        SoundManager.Instance.PlayVoice(boss.deathScreamSE);

        //invoke a delegate to block the screen UI from input so we can watch death animation.
    }
 public IBossState DoState(BossStateManager boss)
 {
     if (boss.animator.GetCurrentAnimatorStateInfo(0).normalizedTime > 1)
     {
         this.ExitState(boss);
         return(boss.gameOverState);
     }
     else
     {
         return(boss.deathState);
     }
 }
Beispiel #10
0
    public void SetOverdriveBar(int amount)
    {
        //amount is currentHealth. OD amount is maxHealth - amount
        int overdriveValue = (int)healthBar.slider.maxValue - amount;

        overDriveSlider.value = overdriveValue;
        if (overdriveValue >= overDriveSlider.maxValue)
        {
            //activate ze delegate!!
            //let boss know we've reached overdrive.
            BossStateManager bossState = FindObjectOfType <BossStateManager>();
            bossState.InitOverdrive();
            healthBar.setHealthEvent -= SetOverdriveBar;
            Destroy(this.gameObject, 2.3f);
        }
    }
 public IBossState DoState(BossStateManager boss)
 {
     if (boss.animator.GetCurrentAnimatorStateInfo(0).normalizedTime > 1)
     {
         //if the animation is done playing. then go back to inactive state.
         this.ExitState(boss);
         if (boss.isOverdrive)
         {
             return(boss.overdriveState);
         }
         else
         {
             return(boss.idleInactiveState);
         }
     }
     else
     {
         return(boss.attackState);
     }
 }
    public void InitState(BossStateManager boss)
    {
        //activate rig and play anim
        boss.attackRig.SetActive(true);
        boss.animator.Play(boss.BOSS_ATTACK_ANIM_NAME);
        //create a random integer. and play that animation
        GameObject selectedBossSkill = boss.bossSkillPrefabs[Random.Range(0, 3)];
        //instantiate this bitch.
        //add target later on
        AudioClip randomAttackClip = boss.attackAudioClips[Random.Range(0, boss.attackAudioClips.Count)];

        SoundManager.Instance.PlayVoice(randomAttackClip);
        GameObject skillInstance = GameObject.Instantiate(selectedBossSkill);

        skillInstance.SetActive(true);
        skillInstance.GetComponent <Animator>().SetTrigger("triggerSkill");

        //this only plays the RIGS animation. not the skill objects.
        //make sure here we pick a random skill..then we wait for animator to finish b4 going back to IdleInactive state.
        //remember to ExitState properly, change bools , call the right delegates etc.
        //the TurnSystem.cs must listen to when the Boss is done attacking.
    }
Beispiel #13
0
    IEnumerator bossFight()
    {
        bool[] bossReady = new bool[1];
        customEvents.loadAndPlayBGM(new bool[1], Global.makeParamString("1", "woods_boss", "1", "1"));
        StartCoroutine(customEvents.setGOActive(bossReady, Global.makeParamString("ps", "1", "0")));

        yield return(new WaitUntil(() => bossReady[0]));

        BossStateManager b = FindObjectOfType <BossStateManager>();

        b.showLifeBar();
        b.startActivities();

        bool[] bossFightEnd = new bool[1];

        gameControl.pSpawner.StartSpawn(bossFightEnd); //will end when boss fight ends

        yield return(new WaitUntil(() => bossFightEnd[0]));

        Debug.Log("boss fight done");
        gameFlow.incrementPointer();
    }
    private void Start()
    {
        GameObject canvas            = GameObject.FindGameObjectWithTag("MainCanvas");
        GameObject healthBarInstance = Instantiate(healthBarPrefab, canvas.transform);

        healthBar     = healthBarInstance.GetComponent <HealthBar>();
        currentHealth = maxHealth;
        if (healthBar != null)
        {
            healthBar.SetMaxHealth(maxHealth);
        }
        gameOver           = FindObjectOfType <GameOver>();
        questClearedScript = FindObjectOfType <QuestCleared>();
        boss = FindObjectOfType <BossStateManager>();
        TurnSystem turnSystem = FindObjectOfType <TurnSystem>();

        turnSystem.beginPlayerTurn += () => DefenseUp(false);
        turnSystem.beginEnemyTurn  += () => AttackUp(false);
        turnSystem.beginPlayerTurn += () => ResetHealthStatusIcon();

        gameManager = FindObjectOfType <GameManager>();
        //wire up tp TurnSystem
    }
    public IBossState DoState(BossStateManager boss)
    {
        if (boss.isDead)
        {
            this.ExitState(boss);
            return(boss.deathState);
        }

        if (TurnSystem.isPlayerTurn && boss.isHurt)
        {
            this.ExitState(boss);
            return(boss.hurtState);
        }
        else if (TurnSystem.isPlayerTurn)
        {
            return(boss.overdriveState);
        }
        else
        {
            //this means its now THE ENEMY'S TURN. Go straight into attack...
            this.ExitState(boss);
            return(boss.attackState);
        }
    }
Beispiel #16
0
 // Start is called before the first frame update
 void Start()
 {
     bossMng = gameObject.GetComponent <BossStateManager>();
 }
 public void InitState(BossStateManager boss)
 {
     //do nothing
 }
 public IBossState DoState(BossStateManager boss)
 {
     return(boss.gameOverState);
 }
    private void Awake()
    {
        BossStateManager boss = FindObjectOfType <BossStateManager>();

        boss.overdriveStart += ChangePortrait;
    }
 public void ExitState(BossStateManager boss)
 {
     boss.attackRig.SetActive(false);
     boss.endBossTurn?.Invoke();
     //call a delegate that says "DONE ATTACKING", turnSystem will listen.
 }
Beispiel #21
0
 public void ExitState(BossStateManager boss)
 {
     //throw new System.NotImplementedException();
     boss.idleInactiveRig.SetActive(false);
 }
 // Start is called before the first frame update
 void Start()
 {
     setTimer = timer;
     bossMng  = GetComponent <BossStateManager>();
 }
Beispiel #23
0
 void Start()
 {
     boss        = FindObjectOfType <BossStateManager>();
     gameManager = FindObjectOfType <GameManager>();
 }
Beispiel #24
0
 public void InitState(BossStateManager boss)
 {
     //setActive the inactive rig.
     boss.idleInactiveRig.SetActive(true);
     boss.animator.Play(boss.BOSS_INACTIVE_IDLE_ANIM_NAME);
 }
 public void ExitState(BossStateManager boss)
 {
     boss.hurtRig.SetActive(false);
     boss.isHurt = false;
 }
 // Start is called before the first frame update
 void Start()
 {
     bossMng = GetComponent <BossStateManager>();
 }
 public void ExitState(BossStateManager boss)
 {
     boss.overdriveRig.SetActive(false);
 }