Beispiel #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);
     }
 }
    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));
    }
    private void LoadBGM()
    {
        List <string> list  = new List <string>();
        List <string> list2 = new List <string>();

        for (int i = 0; i < base.hierarchyData.batteWaves.Length; i++)
        {
            if (!list2.Contains(base.hierarchyData.batteWaves[i].bgmId) && !BattleFunctionUtility.IsEmptyPath(base.hierarchyData.batteWaves[i].bgmId))
            {
                list2.Add(base.hierarchyData.batteWaves[i].bgmId);
            }
            if (!list2.Contains(base.hierarchyData.batteWaves[i].changedBgmId) && !BattleFunctionUtility.IsEmptyPath(base.hierarchyData.batteWaves[i].changedBgmId) && !BoolExtension.AllMachValue(false, base.hierarchyData.batteWaves[i].enemiesBossFlag))
            {
                list2.Add(base.hierarchyData.batteWaves[i].changedBgmId);
            }
        }
        for (int j = 0; j < list2.Count; j++)
        {
            list.Add(ResourcesPath.CreatePath(new string[]
            {
                "BGM",
                list2[j],
                "sound"
            }));
        }
        base.stateManager.soundManager.PreLoadAudio(list.ToArray(), list2.ToArray());
    }
Beispiel #4
0
    private IEnumerator RoundStartScreenFunction()
    {
        int speedLimitRoundCount = base.hierarchyData.speedClearRound - base.battleStateData.totalRoundNumber;

        speedLimitRoundCount++;
        if (base.hierarchyData.limitRound > 0 && base.hierarchyData.speedClearRound > 0)
        {
            base.stateManager.uiControl.ApplyRoundLimitStartRevivalText(!BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartApRevival), !BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartHpRevival));
            base.stateManager.uiControl.ApplyRoundChallengeStartRevivalText(false, false);
            base.stateManager.SetBattleScreen(BattleScreen.RoundStartActionsLimit);
            if (speedLimitRoundCount > 0)
            {
                while (base.stateManager.battleUiComponents.roundLimitStart.AnimationTimeCheck())
                {
                    yield return(null);
                }
                base.stateManager.SetBattleScreen(BattleScreen.RoundStartActionsChallenge);
                while (base.stateManager.battleUiComponents.roundChallengeStart.AnimationIsPlaying())
                {
                    yield return(null);
                }
            }
            else
            {
                while (base.stateManager.battleUiComponents.roundLimitStart.AnimationIsPlaying())
                {
                    yield return(null);
                }
            }
        }
        else if (base.hierarchyData.limitRound > 0 && base.hierarchyData.speedClearRound <= 0)
        {
            base.stateManager.uiControl.ApplyRoundLimitStartRevivalText(!BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartApRevival), !BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartHpRevival));
            base.stateManager.SetBattleScreen(BattleScreen.RoundStartActionsLimit);
            while (base.stateManager.battleUiComponents.roundLimitStart.AnimationIsPlaying())
            {
                yield return(null);
            }
        }
        else if (base.hierarchyData.limitRound <= 0 && base.hierarchyData.speedClearRound > 0)
        {
            if (speedLimitRoundCount > 0)
            {
                base.stateManager.uiControl.ApplyRoundChallengeStartRevivalText(!BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartApRevival), !BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartHpRevival));
                base.stateManager.SetBattleScreen(BattleScreen.RoundStartActionsChallenge);
                while (base.stateManager.battleUiComponents.roundChallengeStart.AnimationIsPlaying())
                {
                    yield return(null);
                }
            }
            else
            {
                base.stateManager.uiControl.ApplyRoundStartRevivalText(!BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartApRevival), !BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartHpRevival));
                base.stateManager.SetBattleScreen(BattleScreen.RoundStartActions);
                IEnumerator wait = base.stateManager.time.WaitForCertainPeriodTimeAction(base.stateManager.stateProperty.RoundStartActionWaitSecond, null, null);
                while (wait.MoveNext())
                {
                    yield return(null);
                }
            }
        }
        else
        {
            base.stateManager.uiControl.ApplyRoundStartRevivalText(!BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartApRevival), !BoolExtension.AllMachValue(false, base.battleStateData.isRoundStartHpRevival));
            base.stateManager.SetBattleScreen(BattleScreen.RoundStartActions);
            IEnumerator wait2 = base.stateManager.time.WaitForCertainPeriodTimeAction(base.stateManager.stateProperty.RoundStartActionWaitSecond, null, null);
            while (wait2.MoveNext())
            {
                yield return(null);
            }
        }
        yield break;
    }
Beispiel #5
0
 public void TargetManualSelectAndApplyUIFunction(CharacterStateControl currentCharacters = null)
 {
     if (currentCharacters != null && currentCharacters.IsSelectedSkill)
     {
         CharacterStateControl targetCharacter = null;
         if (base.battleStateData.isPossibleTargetSelect && Input.GetKeyUp(KeyCode.Mouse0) && BoolExtension.AllMachValue(false, new bool[]
         {
             base.battleStateData.isShowMenuWindow,
             base.battleStateData.isShowRevivalWindow
         }) && !base.stateManager.uiControl.GetIsClickedUI())
         {
             Ray        ray = base.hierarchyData.cameraObject.camera3D.ScreenPointToRay(Input.mousePosition);
             RaycastHit raycastHit;
             if (Physics.Raycast(ray, out raycastHit, float.PositiveInfinity, base.battleStateData.characterColliderLayerMask))
             {
                 CharacterParams         component       = raycastHit.collider.gameObject.GetComponent <CharacterParams>();
                 CharacterStateControl[] totalCharacters = base.battleStateData.GetTotalCharacters();
                 foreach (CharacterStateControl characterStateControl in totalCharacters)
                 {
                     if (characterStateControl.CharacterParams == component)
                     {
                         targetCharacter = characterStateControl;
                         break;
                     }
                 }
             }
         }
         this.SetTarget(currentCharacters, targetCharacter);
     }
     else
     {
         this.AllHideTargetIcon();
     }
 }