Esempio n. 1
0
    protected override void Activated()
    {
        Ramses.Confactory.ConfactoryFinder.Instance.Get <ConCurrentPhase>().SetCurrentPhase(GamePhase.Turns);

        _cardInteractionTranslator.CardPlayRequestEvent  += OnCardPlayRequestEvent;
        _cardInteractionTranslator.DrawCardsRequestEvent += OnDrawCardsRequestEvent;

        _coinTranslator.CoinRequestEvent += OnCoinRequestEvent;

        _skillTranslator.SkillUseRequestEvent += OnSkillUseRequestEvent;

        _conPlayer.RegisteredPlayerDisconnectedEvent += OnRegisteredPlayerDisconnectedEvent;

        _turnSystem.TurnStartedEvent     += OnTurnStartedEvent;
        _turnSystem.TurnSystemEndedEvent += OnTurnSysemEndedEvent;

        _skillEffects.SkillEffectDoneEvent += OnSkillEffectDoneEvent;

        for (int i = 0; i < game.GamePlayers.Length; i++)
        {
            game.GamePlayers[i].PlayCardEvent             += OnPlayCardEvent;
            game.GamePlayers[i].SkillPouch.SkillUsedEvent += OnSkillUsedEvent;
            _turnSystem.AddTurnTickets(game.GamePlayers[i].PlayerIndex); // Player index used as id because the index does not change on device change.
            _turnSystem.SetPriorityLevelOfTicket(game.GamePlayers[i].PlayerIndex, Enum.GetNames(typeof(Skill)).Length - Ramses.Confactory.ConfactoryFinder.Instance.Get <ConSkills>().GetIndexValueOfSkill(game.GamePlayers[i].SkillPouch.Skill));
        }

        _turnSystem.StartTurnSystem();

        Debug.Log("PlayerTurnsBlock Activated");
    }
Esempio n. 2
0
    protected override void Activated()
    {
        //NextBlock(); // TODO: Make block functionality and run it before NextBlock call.
        //return;
        ConfactoryFinder.Instance.Get <ConCurrentPhase>().SetCurrentPhase(GamePhase.Skills);
        Debug.Log("Activated Skill: " + gameBlockInfo.SecondsForEachSkillSelectionTurn);

        _turnSystem.TurnStartedEvent     += OnTurnStartedEvent;
        _turnSystem.TurnSystemEndedEvent += OnTurnSysemEndedEvent;

        PutSkillAsside(); // Puts random skill aside so the last player can choose from that skill or his own.

        for (int i = 0; i < game.GamePlayers.Length; i++)
        {
            game.GamePlayers[i].SkillPouch.SetSkill(Skill.None);
            game.GamePlayers[i].SkillPouch.SkillSetEvent += OnSkillSetEvent;
            _turnSystem.AddTurnTickets(game.GamePlayers[i].PlayerIndex);
            // TODO: Set priority level on who choses skills first.
        }

        _turnSystem.StartTurnSystem();
    }