示例#1
0
        public override void UpdateStatus(FightStatus fightStatus)
        {
            fightStatus.currentTurnPlayerId = 0;
            if (fightStatus != FightStatus.local || fightStatus.localPlayerId != concernedEntity)
            {
                return;
            }
            switch (FightCastManager.currentCastType)
            {
            case FightCastManager.CurrentCastType.Spell:
                FightCastManager.StopCastingSpell(cancelled: true);
                break;

            case FightCastManager.CurrentCastType.Companion:
                FightCastManager.StopInvokingCompanion(cancelled: true);
                break;

            default:
                throw new ArgumentOutOfRangeException();

            case FightCastManager.CurrentCastType.None:
                break;
            }
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.SetNoInteractionPhase();
            }
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                instance.EndLocalPlayerTurn();
            }
            if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
            {
                AbstractPlayerUIRework view = entityStatus.view;
                if (null != view)
                {
                    view.SetUIInteractable(interactable: false);
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 60, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\TurnEndedEvent.cs");
            }
        }
        public override void UpdateStatus(FightStatus fightStatus)
        {
            fightStatus.currentTurnPlayerId = concernedEntity;
            foreach (CharacterStatus item in fightStatus.EnumerateEntities((CharacterStatus c) => c.ownerId == concernedEntity))
            {
                item.actionUsed = false;
            }
            fightStatus.NotifyEntityPlayableStateChanged();
            if (fightStatus != FightStatus.local || fightStatus.localPlayerId != concernedEntity)
            {
                return;
            }
            FightMap current = FightMap.current;

            if (null != current)
            {
                current.SetMovementPhase();
            }
            FightUIRework instance = FightUIRework.instance;

            if (null != instance)
            {
                instance.StartLocalPlayerTurn();
            }
            if (fightStatus.TryGetEntity(concernedEntity, out PlayerStatus entityStatus))
            {
                AbstractPlayerUIRework view = entityStatus.view;
                if (null != view)
                {
                    view.SetUIInteractable(interactable: true);
                }
            }
            else
            {
                Log.Error(FightEventErrors.PlayerNotFound(concernedEntity), 55, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\Events\\TurnStartedEvent.cs");
            }
        }