Ejemplo n.º 1
0
 protected override void EnabledThisState()
 {
     this.battleWave = base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber];
     this.isFindBoss = !BoolExtension.AllMachValue(false, this.battleWave.enemiesBossFlag);
     this.is1stStart = (base.battleStateData.currentWaveNumber == 0);
     this.isBigBoss  = (this.battleWave.cameraType == 1);
     this.isExtra    = (this.battleWave.floorType == 3);
     if (base.battleMode == BattleMode.PvP)
     {
         base.stateManager.uiControlPvP.ApplySetAlwaysUIColliders(false);
     }
     else
     {
         base.stateManager.uiControl.SetMenuAuto2xButtonEnabled(false);
     }
     this.currentSpeed2x = base.hierarchyData.on2xSpeedPlay;
     base.stateManager.time.SetPlaySpeed(false, false);
     if (this.is1stStart)
     {
         base.stateManager.soundPlayer.TryPlayBGM(this.battleWave.bgmId, 0f);
     }
     else
     {
         base.stateManager.soundPlayer.TryStopBGM(this.battleWave.bgmId);
     }
 }
Ejemplo n.º 2
0
    public void ApplyWaveAndRound(BattleWave battleWave, int roundValue, int maxWave)
    {
        string key = "BattleUI-02";

        if (battleWave.floorType == 3)
        {
            key = "BattleUI-45";
        }
        this.waveAndRoundText.text = string.Format(StringMaster.GetString(key), battleWave.floorNum, maxWave, roundValue);
    }
Ejemplo n.º 3
0
    public void SetValuetextReplacer(BattleWave battleWave, int roundValue, int maxWave)
    {
        string key = "BattleUI-02";

        if (battleWave.floorType == 3)
        {
            key = "BattleUI-45";
        }
        this.waveRoundCount.text = string.Format(StringMaster.GetString(key), battleWave.floorNum, maxWave, roundValue);
    }
    public void OnHitDamageBgmChangeFunction()
    {
        if (base.hierarchyData.batteWaves.Length <= base.battleStateData.currentWaveNumber || base.battleStateData.currentWaveNumber < 0)
        {
            return;
        }
        BattleWave battleWave = base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber];

        if (BoolExtension.AllMachValue(false, battleWave.enemiesBossFlag))
        {
            return;
        }
        if (battleWave.enemiesBossFlag.Length != base.battleStateData.enemies.Length)
        {
            return;
        }
        int num  = 0;
        int num2 = 0;

        for (int i = 0; i < base.battleStateData.enemies.Length; i++)
        {
            if (battleWave.enemiesBossFlag[i])
            {
                num2++;
                if ((float)base.battleStateData.enemies[i].hp / (float)base.battleStateData.enemies[i].extraMaxHp < battleWave.bgmChangeHpPercentage)
                {
                    num++;
                }
            }
        }
        if (num2 > num)
        {
            return;
        }
        base.stateManager.soundPlayer.TryPlayBGM(battleWave.changedBgmId, TimeExtension.GetTimeScaleDivided(base.stateManager.stateProperty.bgmCrossfadeSecond));
    }
Ejemplo n.º 5
0
 //Create all enemies for this wave
 private IEnumerator createEnemies(BattleWave wave)
 {
     if (wave.Enemy1 != string.Empty)
     {
         createEnemy(0, wave.Enemy1);
         AudioPlayer.main.playSFX("sfx_blight_hit");
         AnimationPlayer.main.playAnimation("anim_element_reflect", field.enemy_arr[0].Transform.position, 2f);
         yield return(new WaitForSeconds(0.4f));
     }
     else
     {
         createDummyEnemy(0);
     }
     if (wave.Enemy2 != string.Empty)
     {
         createEnemy(1, wave.Enemy2);
         AudioPlayer.main.playSFX("sfx_blight_hit");
         AnimationPlayer.main.playAnimation("anim_element_reflect", field.enemy_arr[1].Transform.position, 2f);
         yield return(new WaitForSeconds(0.4f));
     }
     else
     {
         createDummyEnemy(1);
     }
     if (wave.Enemy3 != string.Empty)
     {
         createEnemy(2, wave.Enemy3);
         AudioPlayer.main.playSFX("sfx_blight_hit");
         AnimationPlayer.main.playAnimation("anim_element_reflect", field.enemy_arr[2].Transform.position, 2f);
         yield return(new WaitForSeconds(0.4f));
     }
     else
     {
         createDummyEnemy(2);
     }
 }
 private IEnumerator PlaySkill()
 {
     foreach (CharacterStateControl characterStateControl in this.GetTotalCharacters())
     {
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.AttackStarted);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillStartedApMax);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.AttackCommandedTarget);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillSpecies);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillTargetSpecies);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillDamageStartedSend);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillDamageStartedRecieve);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillAttributeStartedSend);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillAttributeStartedRecieve);
     }
     CharacterStateControl[] totalCharacters = base.stateManager.battleStateData.GetTotalCharacters();
     if (totalCharacters.Where((CharacterStateControl item) => item.stagingChipIdList.Count > 0).Any <CharacterStateControl>())
     {
         base.stateManager.cameraControl.PlayTweenCameraMotion(base.battleStateData.commandSelectTweenTargetCamera, null);
         base.stateManager.cameraControl.SetCameraLengthAction(base.battleStateData.commandSelectTweenTargetCamera);
     }
     base.SetState(this.subStateWaitForCertainPeriodTimeAction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     base.SetState(this.subStatePlayChipEffect.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     if (this.lastCharacter.isEnemy)
     {
         BattleWave battleWave = base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber];
         if (!battleWave.enemiesInfinityApFlag[this.lastCharacter.myIndex])
         {
             this.lastCharacter.currentSkillStatus.OnAttackUseAttackerAp(this.lastCharacter);
         }
     }
     else
     {
         this.lastCharacter.currentSkillStatus.OnAttackUseAttackerAp(this.lastCharacter);
     }
     this.lastCharacter.AddSkillUseCount(this.lastCharacter.isSelectSkill, -1);
     if (this.lastCharacter.currentSkillStatus.skillType == SkillType.Attack)
     {
         base.battleStateData.isInvocationEffectPlaying = true;
     }
     base.stateManager.time.SetPlaySpeed(base.hierarchyData.on2xSpeedPlay, base.battleStateData.isShowMenuWindow);
     base.stateManager.uiControl.ApplyTurnActionBarSwipeout(true);
     base.SetState(this.subStatePlayInvocationEffectAction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     if (this.lastCharacter.currentSkillStatus.skillType == SkillType.Attack)
     {
         base.battleStateData.isInvocationEffectPlaying = false;
     }
     base.stateManager.time.SetPlaySpeed(base.hierarchyData.on2xSpeedPlay, base.battleStateData.isShowMenuWindow);
     if (!this.lastCharacter.isEnemy)
     {
         base.battleStateData.lastAttackPlayerCharacterIndex = this.lastCharacter.myIndex;
     }
     base.stateManager.uiControl.ApplyTurnActionBarSwipeout(false);
     base.stateManager.uiControl.CharacterHudResetAndUpdate(false);
     base.battleStateData.SetChipSkillFlag(false);
     base.battleStateData.isConfusionAttack = base.stateManager.roundFunction.onConfusion;
     base.SetState(this.subStateSkillDetailsFunction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     base.battleStateData.isConfusionAttack = false;
     this.isSkillEnd = true;
     CharacterStateControl[] playerCharacters = base.stateManager.battleStateData.playerCharacters.Where((CharacterStateControl item) => item.stagingChipIdList.Count > 0).ToArray <CharacterStateControl>();
     CharacterStateControl[] enemies          = base.stateManager.battleStateData.enemies.Where((CharacterStateControl item) => item.stagingChipIdList.Count > 0).ToArray <CharacterStateControl>();
     if (playerCharacters.Count <CharacterStateControl>() + enemies.Count <CharacterStateControl>() > 1)
     {
         base.stateManager.cameraControl.PlayTweenCameraMotion(base.battleStateData.commandSelectTweenTargetCamera, null);
         base.stateManager.cameraControl.SetCameraLengthAction(base.battleStateData.commandSelectTweenTargetCamera);
         CharacterStateControl[] characters = base.battleStateData.GetTotalCharacters().Where((CharacterStateControl item) => !item.isDied).ToArray <CharacterStateControl>();
         base.stateManager.threeDAction.ShowAllCharactersAction(characters);
         base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(characters);
     }
     else if (playerCharacters.Count <CharacterStateControl>() == 1)
     {
         string cameraKey = "skillF";
         base.stateManager.cameraControl.PlayCameraMotionActionCharacter(cameraKey, playerCharacters[0]);
         base.stateManager.cameraControl.SetTime(cameraKey, 1f);
         CharacterStateControl[] characters2 = base.battleStateData.playerCharacters.Where((CharacterStateControl item) => !item.isDied).ToArray <CharacterStateControl>();
         base.stateManager.threeDAction.ShowAllCharactersAction(characters2);
         base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(characters2);
     }
     else if (enemies.Count <CharacterStateControl>() == 1)
     {
         string cameraKey2 = "skillF";
         base.stateManager.cameraControl.PlayCameraMotionActionCharacter(cameraKey2, enemies[0]);
         base.stateManager.cameraControl.SetTime(cameraKey2, 1f);
         CharacterStateControl[] characters3 = base.battleStateData.enemies.Where((CharacterStateControl item) => !item.isDied).ToArray <CharacterStateControl>();
         base.stateManager.threeDAction.ShowAllCharactersAction(characters3);
         base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(characters3);
     }
     base.SetState(this.subStateWaitForCertainPeriodTimeAction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     base.SetState(this.subStatePlayChipEffect.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     EffectStatusBase.EffectTriggerType[] triggers = new EffectStatusBase.EffectTriggerType[]
     {
         EffectStatusBase.EffectTriggerType.AttackStarted,
         EffectStatusBase.EffectTriggerType.SkillStartedApMax,
         EffectStatusBase.EffectTriggerType.AttackCommandedTarget,
         EffectStatusBase.EffectTriggerType.SkillSpecies,
         EffectStatusBase.EffectTriggerType.SkillTargetSpecies,
         EffectStatusBase.EffectTriggerType.SkillDamageStartedSend,
         EffectStatusBase.EffectTriggerType.SkillDamageStartedRecieve,
         EffectStatusBase.EffectTriggerType.SkillAttributeStartedSend,
         EffectStatusBase.EffectTriggerType.SkillAttributeStartedRecieve
     };
     foreach (CharacterStateControl characterStateControl2 in this.GetTotalCharacters())
     {
         characterStateControl2.RemovePotencyChip(triggers);
     }
     yield break;
 }