def __init__(self, gameObject): self.gameObject = gameObject notify = DirectNotifyGlobal.directNotify.newCategory('RepairGameFSM') MinigameFSM.__init__(self, 'RepairGameFSM') self.defaultTransitions = { 'Init': ['Intro', 'Final', 'Off'], 'Intro': ['Idle', 'Complete', 'Final', 'Off'], 'Idle': ['MincroGame', 'CycleComplete', 'Final', 'Outro', 'Intro', 'Off'], 'MincroGame': ['MincroGame', 'CycleComplete', 'Idle', 'Final', 'Outro', 'Off'], 'CycleComplete': ['Outro', 'Idle', 'Final', 'Off'], 'Outro': ['Off', 'Final'], 'Final': ['Off'], 'Off': [] }
def __init__(self, gameObject): self.gameObject = gameObject notify = DirectNotifyGlobal.directNotify.newCategory('RepairGameFSM') MinigameFSM.__init__(self, 'RepairGameFSM') self.defaultTransitions = { 'Init': [ 'Intro', 'Final', 'Off'], 'Intro': [ 'Idle', 'Complete', 'Final', 'Off'], 'Idle': [ 'MincroGame', 'CycleComplete', 'Final', 'Outro', 'Intro', 'Off'], 'MincroGame': [ 'MincroGame', 'CycleComplete', 'Idle', 'Final', 'Outro', 'Off'], 'CycleComplete': [ 'Outro', 'Idle', 'Final', 'Off'], 'Outro': [ 'Off', 'Final'], 'Final': [ 'Off'], 'Off': [] }
def __init__(self, gameObject): self.gameObject = gameObject MinigameFSM.__init__(self, 'PotionGameFSM') self.defaultTransitions = { 'Intro': [ 'Tutorial', 'RecipeSelect'], 'RecipeSelect': [ 'Tutorial', 'StartGame', 'Reset', 'ExitRequest', 'Exit'], 'Tutorial': [ 'Tutorial', 'RecipeSelect', 'Eval', 'Input', 'StartGame', 'SwitchRequest', 'ExitRequest', 'Reset', 'Exit'], 'ChestOpened': [ 'RecipeSelect', 'Eval', 'Input', 'Anim', 'Tutorial', 'ExitRequest', 'SwitchRequest', 'Results', 'Exit'], 'StartGame': [ 'Tutorial', 'Anim'], 'Anim': [ 'Eval', 'Reset', 'Results'], 'Eval': [ 'Results', 'Anim', 'Input', 'Tutorial', 'ExitRequest', 'SwitchRequest', 'Eval'], 'Input': [ 'Tutorial', 'StartGame', 'ExitRequest', 'SwitchRequest', 'Results', 'Anim', 'Eval', 'Reset', 'Exit'], 'Results': [ 'Reset', 'Exit', 'Tutorial', 'ExitRequest'], 'Reset': [ 'Reset', 'RecipeSelect', 'Tutorial', 'ExitRequest', 'SwitchRequest'], 'SwitchRequest': [ 'SwitchRequest', 'Reset', 'Eval', 'Tutorial', 'ExitRequest'], 'ExitRequest': [ 'ExitRequest', 'Exit', 'Eval', 'RecipeSelect', 'Tutorial', 'SwitchRequest'], 'Exit': [] } if not (self.Sfxs): PotionGameFSM.Sfxs = { 'Lose': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_LOSE), 'Win': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_WIN), 'Fill': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_FILL), 'Wrong': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_WRONG), 'NoDrop': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_CANTPLACE), 'Flip': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_FLIP), 'Drop1': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_DROP), 'Drop2': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_DROP_2), 'SoftDrop1': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_DROP_SOFT), 'SoftDrop2': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_DROP_SOFT_2), 'Match': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_MATCH), 'SoulMade': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_SOULMADE), 'SoulMatch': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_SOULMATCH) } self.matchMade = False self.ingredientMade = False self.gameStarted = False self.resultsShown = False self.animSeq = None if base.localAvatar.guiMgr.seaChestActive: base.localAvatar.guiMgr.hideSeaChest()
def destroy(self): if self.animSeq: self.animSeq.pause() self.animSeq = None MinigameFSM.destroy(self)
def __init__(self, gameObject): self.gameObject = gameObject MinigameFSM.__init__(self, 'PotionGameFSM') self.defaultTransitions = { 'Intro': ['Tutorial', 'RecipeSelect'], 'RecipeSelect': ['Tutorial', 'StartGame', 'Reset', 'ExitRequest', 'Exit'], 'Tutorial': [ 'Tutorial', 'RecipeSelect', 'Eval', 'Input', 'StartGame', 'SwitchRequest', 'ExitRequest', 'Reset', 'Exit' ], 'ChestOpened': [ 'RecipeSelect', 'Eval', 'Input', 'Anim', 'Tutorial', 'ExitRequest', 'SwitchRequest', 'Results', 'Exit' ], 'StartGame': ['Tutorial', 'Anim'], 'Anim': ['Eval', 'Reset', 'Results'], 'Eval': [ 'Results', 'Anim', 'Input', 'Tutorial', 'ExitRequest', 'SwitchRequest', 'Eval' ], 'Input': [ 'Tutorial', 'StartGame', 'ExitRequest', 'SwitchRequest', 'Results', 'Anim', 'Eval', 'Reset', 'Exit' ], 'Results': ['Reset', 'Exit', 'Tutorial', 'ExitRequest'], 'Reset': [ 'Reset', 'RecipeSelect', 'Tutorial', 'ExitRequest', 'SwitchRequest' ], 'SwitchRequest': ['SwitchRequest', 'Reset', 'Eval', 'Tutorial', 'ExitRequest'], 'ExitRequest': [ 'ExitRequest', 'Exit', 'Eval', 'RecipeSelect', 'Tutorial', 'SwitchRequest' ], 'Exit': [] } if not (self.Sfxs): PotionGameFSM.Sfxs = { 'Lose': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_LOSE), 'Win': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_WIN), 'Fill': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_FILL), 'Wrong': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_WRONG), 'NoDrop': SoundGlobals.loadSfx( SoundGlobals.SFX_MINIGAME_POTION_CANTPLACE), 'Flip': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_FLIP), 'Drop1': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_DROP), 'Drop2': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_DROP_2), 'SoftDrop1': SoundGlobals.loadSfx( SoundGlobals.SFX_MINIGAME_POTION_DROP_SOFT), 'SoftDrop2': SoundGlobals.loadSfx( SoundGlobals.SFX_MINIGAME_POTION_DROP_SOFT_2), 'Match': SoundGlobals.loadSfx(SoundGlobals.SFX_MINIGAME_POTION_MATCH), 'SoulMade': SoundGlobals.loadSfx( SoundGlobals.SFX_MINIGAME_POTION_SOULMADE), 'SoulMatch': SoundGlobals.loadSfx( SoundGlobals.SFX_MINIGAME_POTION_SOULMATCH) } self.matchMade = False self.ingredientMade = False self.gameStarted = False self.resultsShown = False self.animSeq = None if base.localAvatar.guiMgr.seaChestActive: base.localAvatar.guiMgr.hideSeaChest()