protected void SetState(Type stateType)
    {
        BattleStateBase battleStateBase = this.currentState;

        this.currentState = this.stateList[stateType];
        this.currentState.OnStartState((!IMono.op_True(battleStateBase)) ? null : battleStateBase.GetOnStartNextState(), stateType);
    }
예제 #2
0
 protected override void AwakeThisState()
 {
     this.subStateCharacterDeadCheckFunction = new SubStateMultiCharacterDeadCheckFunction(delegate()
     {
         base.stateManager.roundFunction.SetResult(true, false, false);
     }, delegate(bool isNextWave)
     {
         base.stateManager.roundFunction.SetResult(false, true, isNextWave);
     }, delegate(bool isNextWave)
     {
         base.stateManager.roundFunction.SetResult(false, false, isNextWave);
     }, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateCharacterDeadCheckFunction);
     this.subStateCharacterRevivalFunction = new SubStateMultiCharacterRevivalFunction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateCharacterRevivalFunction);
     this.subStateSkillDetailsFunction = new SubStateMultiSkillDetailsFunction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateSkillDetailsFunction);
     this.subStateEnemyTurnStartAction = new SubStateEnemyTurnStartAction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateEnemyTurnStartAction);
     this.subStatePlayInvocationEffectAction = new SubStatePlayInvocationEffectAction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStatePlayInvocationEffectAction);
     this.subStatePlayerCharacterAndSkillSelectFunction = new SubStateMultiPlayerCharacterAndSkillSelectFunction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStatePlayerCharacterAndSkillSelectFunction);
     this.subStateOnHitPoisonDamageFunction = new SubStateOnHitPoisonDamageFunction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateOnHitPoisonDamageFunction);
     this.subStateRoundStartAction = new SubStateMultiRoundStartAction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateRoundStartAction);
     this.subStatePlayChipEffect = new SubStatePlayChipEffect(null, new Action <EventState>(base.SendEventState), () => this.isSkillEnd);
     base.AddState(this.subStatePlayChipEffect);
     this.subStateWaitRandomSeedSync = new SubStateWaitRandomSeedSync(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateWaitRandomSeedSync);
     this.subStateWaitAllPlayers = new SubStateWaitAllPlayers(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateWaitAllPlayers);
     this.subStateMultiWaitEnemySkillSelect = new SubStateMultiWaitEnemySkillSelect(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateMultiWaitEnemySkillSelect);
     this.subStateMultiAreaRandomDamageHitFunction = new SubStateMultiAreaRandomDamageHitFunction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateMultiAreaRandomDamageHitFunction);
     this.subStateWaitForCertainPeriodTimeAction = new SubStateWaitForCertainPeriodTimeAction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateWaitForCertainPeriodTimeAction);
     base.AddState(new SubStatePlayStageEffect(null, new Action <EventState>(base.SendEventState)));
     this.subStateInstantDeathFunction = new SubStateInstantDeathFunction(null, new Action <EventState>(base.SendEventState));
     base.AddState(this.subStateInstantDeathFunction);
 }
 public void OnStartState(Action onStartNextState = null, Type stateType = null)
 {
     this.nextType = stateType;
     BattleStateBase._currentState = this;
     if (!this.isAwake)
     {
         this.AwakeThisState();
         this.isAwake = true;
     }
     this.EnabledThisState();
     if (this.onStart != null)
     {
         this.onStart();
     }
     if (onStartNextState != null)
     {
         onStartNextState();
     }
     this.runningMainRoutine = this.BasedMainRoutine();
     this._isRunning         = true;
     base.StartCoroutine(this.runningMainRoutine);
 }
 protected void RemoveState(BattleStateBase state)
 {
     this.RemoveState(state.GetType());
 }
 protected void AddState(BattleStateBase state)
 {
     this.stateList.Add(state.GetType(), state);
 }