Example #1
0
 private void Awake()
 {
     this.controller    = GameObject.Find("BattleController").GetComponent <GameState_Controller>();
     this.field         = transform.parent.GetComponent <Player_UI>();
     this.agentName     = field.GetName();
     this.currentState  = AI_States.Idle;
     this.previousState = MainGameStates.SetupGame;
     this.updateNeeded  = false;
 }
        private void Awake()
        {
            //Modulok beállítása
            this.modules = Module_Controller.CreateModuleController(this, factory, client);

            //Interakciók beállítása
            this.interactions = new Interactions(this, modules);

            //Játékfázisok beállítása
            this.orderChangeState     = new OrderChangeState(modules, this, interactions);
            this.preparationState     = new PreparationState(modules, this, interactions);
            this.starterDrawState     = new StarterDrawState(modules, this, interactions);
            this.settingRoleState     = new SettingRoleState(modules, this, interactions);
            this.selectFightTypeState = new SelectFightTypeState(modules, this, interactions);
            this.summonState          = new SummonState(modules, this, interactions);
            this.revealCardsState     = new RevealCardsState(modules, this, interactions);
            this.quickSkillState      = new QuickSkillState(modules, this, interactions);
            this.mainSkillState       = new MainSkillState(modules, this, interactions);
            this.compareState         = new CompareState(modules, this, interactions);
            this.lateSkillState       = new LateSkillState(modules, this, interactions);
            this.cardPutAwayState     = new CardPutAwayState(modules, this, interactions);
            this.blindMatchState      = new BlindMatchState(modules, this, interactions);
            this.resultState          = new ResultState(modules, this, interactions);

            //Játékfázisok és státuszok alapértékezése
            this.currentPhase           = MainGameStates.SetupGame;
            this.currentStat            = CardStatType.NotDecided;
            this.currentAction          = SkillEffectAction.None;
            this.currentSelectionType   = CardListTarget.None;
            this.currentKey             = -1;
            this.currentActiveCard      = -1;
            this.lastWinnerKey          = -1;
            this.phaseChange            = true;
            this.firstRound             = true;
            this.displayedMessageStatus = false;
            this.blindMatch             = false;
            this.actionFinished         = true;
            this.turnFinished           = true;
            this.skillFinished          = true;
            this.changedOrder           = false;
            this.lateSkillKeys          = new List <int>();
            this.instantWin             = false;
            this.negatedSkills          = false;

            rng = new System.Random();
        }
Example #3
0
        private void CheckForTurn()
        {
            //Ha az aktív kulcs az övé és az aktuális fázisban még nem váltottunk, illetve engedélyezett az akció
            if (this.playerKey == controller.GetCurrentKey() &&
                (controller.GetGameState() != previousState) &&
                GameState_Controller.readyForAction)
            {
                //Fázis meghatározása
                switch (controller.GetGameState())
                {
                case MainGameStates.SetStat: this.currentState = AI_States.ChooseStat; break;

                case MainGameStates.SummonCard: this.currentState = AI_States.SummonCard; break;

                case MainGameStates.NormalSkills: this.currentState = AI_States.DecideSkill; break;

                default: this.currentState = AI_States.Idle; break;
                }
                previousState = controller.GetGameState();
                updateNeeded  = true;
            }
        }
 public void ChangePhase(MainGameStates nextPhase)
 {
     GameState_Controller.readyForAction = false;
     currentPhase = nextPhase;
     phaseChange  = true;
 }