Exemplo n.º 1
0
 def configure(self, initialization):
     avatar = AvatarState(flags=StateFlags.INITIAL | StateFlags.SINGULAR)
     avatar.configure()
     finish = State(GameplayStateID.BATTLE_REPLAY_FINISHED)
     rewind = State(GameplayStateID.BATTLE_REPLAY_REWIND)
     self.addChildState(avatar)
     self.addChildState(finish)
     self.addChildState(rewind)
     initialization.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_BECOME_PLAYER),
                                  target=avatar)
     rewind.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_BECOME_PLAYER),
                          target=avatar)
     avatar.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_FINISHED),
                          target=finish)
     avatar.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_REWIND),
                          target=rewind)
     finish.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_REWIND),
                          target=rewind)
     avatar.exiting.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_NEXT),
                                  target=initialization.nextReplay)
Exemplo n.º 2
0
 def configure(self):
     entering = State(stateID=GameplayStateID.AVATAR_ENTERING,
                      flags=StateFlags.INITIAL | StateFlags.SINGULAR)
     arenaInfo = State(stateID=GameplayStateID.AVATAR_ARENA_INFO)
     showGUI = State(stateID=GameplayStateID.AVATAR_SHOW_GUI)
     arenaLoaded = State(stateID=GameplayStateID.AVATAR_ARENA_LOADED)
     exiting = State(stateID=GameplayStateID.AVATAR_EXITING)
     self.addChildState(entering)
     self.addChildState(arenaInfo)
     self.addChildState(showGUI)
     self.addChildState(arenaLoaded)
     self.addChildState(exiting)
     entering.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_ARENA_INFO),
                            target=arenaInfo)
     arenaInfo.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_SHOW_GUI),
                             target=showGUI)
     arenaInfo.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_ARENA_LOADED),
                             target=arenaLoaded)
     showGUI.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_ARENA_LOADED),
                           target=arenaLoaded)
     arenaLoaded.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_BECOME_NON_PLAYER),
                               target=exiting)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 def configure(self):
     loading = State(stateID=GameplayStateID.BATTLE_REPLAY_LOADING,
                     flags=StateFlags.SINGULAR | StateFlags.INITIAL)
     differs = State(stateID=GameplayStateID.BATTLE_REPLAY_VERSION_DIFFERS)
     starting = State(stateID=GameplayStateID.BATTLE_REPLAY_STARTING)
     nextReplay = State(stateID=GameplayStateID.BATTLE_REPLAY_NEXT)
     loading.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_VERSION_CONFIRMATION),
                           target=differs)
     differs.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_VERSION_CONFIRMED),
                           target=starting)
     self.addChildState(loading)
     self.addChildState(differs)
     self.addChildState(starting)
     self.addChildState(nextReplay)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 def configure(self):
     entering = State(stateID=GameplayStateID.ACCOUNT_ENTERING,
                      flags=StateFlags.INITIAL | StateFlags.SINGULAR)
     showGUI = State(stateID=GameplayStateID.ACCOUNT_SHOW_GUI)
     exiting = State(stateID=GameplayStateID.ACCOUNT_EXITING)
     self.addChildState(entering)
     self.addChildState(showGUI)
     self.addChildState(exiting)
     entering.addTransition(StringEventTransition(
         PlayerEventID.ACCOUNT_SHOW_GUI),
                            target=showGUI)
     showGUI.addTransition(StringEventTransition(
         PlayerEventID.ACCOUNT_BECOME_NON_PLAYER),
                           target=exiting)
     exiting.addTransition(StringEventTransition(
         PlayerEventID.ACCOUNT_BECOME_PLAYER),
                           target=entering)
Exemplo n.º 7
0
 def configure(self, offline):
     account = AccountState(flags=StateFlags.INITIAL | StateFlags.SINGULAR)
     account.configure()
     avatar = AvatarState()
     avatar.configure()
     enteringReplay = State(stateID=GameplayStateID.SERVER_REPLAY_ENTERING)
     exitingReplay = State(stateID=GameplayStateID.SERVER_REPLAY_EXITING)
     rewindReplay = State(GameplayStateID.BATTLE_REPLAY_REWIND)
     finishReplay = State(GameplayStateID.BATTLE_REPLAY_FINISHED)
     self.addChildState(account)
     self.addChildState(avatar)
     self.addChildState(enteringReplay)
     self.addChildState(exitingReplay)
     self.addChildState(rewindReplay)
     self.addChildState(finishReplay)
     offline.addTransition(StringEventTransition(
         PlayerEventID.ACCOUNT_BECOME_PLAYER),
                           target=account)
     offline.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_BECOME_PLAYER),
                           target=avatar)
     account.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_BECOME_PLAYER),
                           target=avatar)
     account.addTransition(StringEventTransition(
         ReplayEventID.SERVER_REPLAY_ENTERING),
                           target=enteringReplay)
     enteringReplay.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_BECOME_PLAYER),
                                  target=avatar)
     enteringReplay.addTransition(StringEventTransition(
         ReplayEventID.SERVER_REPLAY_EXITING),
                                  target=exitingReplay)
     avatar.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_FINISHED),
                          target=finishReplay)
     avatar.addTransition(StringEventTransition(
         ReplayEventID.SERVER_REPLAY_EXITING),
                          target=exitingReplay)
     exitingReplay.addTransition(StringEventTransition(
         PlayerEventID.ACCOUNT_BECOME_PLAYER),
                                 target=account)
     avatar.addTransition(StringEventTransition(
         PlayerEventID.ACCOUNT_BECOME_PLAYER),
                          target=account)
     avatar.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_REWIND),
                          target=rewindReplay)
     rewindReplay.addTransition(StringEventTransition(
         PlayerEventID.AVATAR_BECOME_PLAYER),
                                target=avatar)
     finishReplay.addTransition(StringEventTransition(
         ReplayEventID.REPLAY_REWIND),
                                target=rewindReplay)
     finishReplay.addTransition(StringEventTransition(
         ReplayEventID.SERVER_REPLAY_EXITING),
                                target=exitingReplay)
     self.addTransition(StringEventTransition(
         PlayerEventID.NON_PLAYER_BECOME_PLAYER),
                        target=offline.login)