def TestDef(pObject, pEvent):
# pSound = App.TGSound_Create("sfx/Bridge/Crew/Engineering/ge015.mp3", "EPE", 0)
# pSound.SetSFX(0)
# pSound.SetInterface(1)
# App.g_kSoundManager.PlaySound("EPE")
pGame = App.Game_GetCurrentGame()
pEpisode = pGame.GetCurrentEpisode()
pMission = pEpisode.GetCurrentMission()
pPlayer = MissionLib.GetPlayer()
pPower = pPlayer.GetPowerSubsystem()
pShields = pPlayer.GetShields()
pSet = pPlayer.GetContainingSet()
pBridge = App.g_kSetManager.GetSet('bridge')
Hull = pPlayer.GetHull()
WarpCore = pPlayer.GetPowerSubsystem()
Chance = App.g_kSystemWrapper.GetRandomNumber(99)
PowerCondition1 = pPower.GetCondition()
PowerCondition = pPower.GetConditionPercentage()
PowerDisability = pPower.GetDisabledPercentage()
if not (WarpCore):
pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 1, 0, 0)
return
if (WarpCore):
if not (PowerCondition <= PowerDisability):
# pSound = App.TGSound_Create("sfx/Bridge/Crew/Engineering/PowerDisabled.mp3", "EPE", 0)
# pSound.SetSFX(0)
# pSound.SetInterface(1)
# App.g_kSoundManager.PlaySound("EPE")
pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 1, 0, 0)
return
if (PowerCondition <= PowerDisability):
# pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 1, 0, 0)
if (Chance >= 5):
# pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 1, 0, 0)
return
if (Chance < 5):
pSound = App.TGSound_Create("sfx/Bridge/Crew/Engineering/ge015.mp3", "EPE1", 0)
pSound.SetSFX(0)
pSound.SetInterface(1)
App.g_kSoundManager.PlaySound("EPE1")
pPlayer.DestroySystem(Hull)
pPlayer.DestroySystem(WarpCore)
pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 1, 0, 0)
return
pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 1, 0, 0)
pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 1, 0, 0)
pStatusTimer = MissionLib.CreateTimer(Lib.LibEngineering.GetEngineeringNextEventType(), __name__ + ".TestDef", App.g_kUtopiaModule.GetGameTime() + 3, 0, 0)