def configure(self): lobbyStart = State(stateID=BattlePassRewardStateID.LOBBY_START, flags=StateFlags.INITIAL) lobbyWait = State(stateID=BattlePassRewardStateID.LOBBY_WAIT) lobbyFinal = State(stateID=BattlePassRewardStateID.LOBBY_FINAL, flags=StateFlags.FINAL) lobbyStart.addTransition(ConditionTransition(isProgressionComplete, priority=1), target=lobbyFinal) lobbyStart.addTransition(ConditionTransition(lambda _: True, priority=0), target=lobbyWait) self.addChildState(lobbyStart) self.addChildState(lobbyWait) self.addChildState(lobbyFinal)
def configure(self): loading = State(stateID=GameplayStateID.GAME_LOADING, flags=StateFlags.INITIAL | StateFlags.SINGULAR) intro = State(stateID=GameplayStateID.INTRO_VIDEO) login = State(stateID=GameplayStateID.LOGIN) loading.addTransition(ConditionTransition( lambda e: helpers.isShowStartupVideo(), invert=False), target=intro) loading.addTransition(ConditionTransition( lambda e: helpers.isShowStartupVideo(), invert=True), target=login) intro.addTransition(StringEventTransition( GUIEventID.INTRO_VIDEO_FINISHED), target=login) self.addChildState(loading) self.addChildState(intro) self.addChildState(login)
def configure(self): rewardStyle = RewardStyleState() rewardAny = RewardAnyState() rewardStyle.addTransition(ConditionTransition(lambda _: True, priority=0), target=rewardAny) self.addChildState(rewardStyle) self.addChildState(rewardAny)
def configure(self): lobbyState = states.LobbyState() choiceState = states.ChoiceState() rewardState = states.RewardState() videoState = states.VideoState() lobbyState.configure() choiceState.configure() rewardState.configure() lobbyState.lobbyWait.addTransition(ConditionTransition( self.__hasChoiceOption, priority=2), target=choiceState.choiceItem) lobbyState.lobbyWait.addTransition(ConditionTransition( self.__hasStyleReward, priority=1), target=videoState) lobbyState.lobbyWait.addTransition(ConditionTransition( self.__hasAnyReward, priority=0), target=rewardState.rewardAny) choiceState.choiceItem.addTransition(ConditionTransition( self.__hasStyleReward, priority=2), target=videoState) choiceState.choiceItem.addTransition(ConditionTransition( self.__hasAnyReward, priority=1), target=rewardState.rewardAny) choiceState.choiceItem.addTransition(ConditionTransition( lambda _: True, priority=0), target=lobbyState.lobbyWait) videoState.addTransition(ConditionTransition(lambda _: True, priority=0), target=rewardState.rewardStyle) rewardState.rewardAny.addTransition(ConditionTransition( isProgressionComplete, priority=1), target=lobbyState.lobbyFinal) rewardState.rewardAny.addTransition(ConditionTransition(lambda _: True, priority=0), target=lobbyState.lobbyWait) self.addState(lobbyState) self.addState(videoState) self.addState(choiceState) self.addState(rewardState)