home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 1.5)
-
- import AuxFuncs
- import Bladex
- LightDictionary = { }
- LightSpeed = 0.02
- LightSetInens = 130.0
- LightSetRadius = 0.03
- LightSetColor = (255, 165, 64)
-
- def AddLightData(objname, Inens = LightSetInens, Radius = LightSetRadius, Color = LightSetColor):
- if not LightDictionary.has_key(objname):
- LightDictionary[objname] = (Inens, Radius, Color)
-
-
-
- def GetLightData(objname):
- global LightSetInens, LightSetRadius, LightSetColor
- if LightDictionary.has_key(objname):
- LightSetInens = LightDictionary[objname][0]
- LightSetRadius = LightDictionary[objname][1]
- LightSetColor = LightDictionary[objname][2]
-
-
-
- def SetLightSpeed(xxx):
- global LightSpeed
- LightSpeed = xxx
-
-
- def SetLightInens(xxx):
- global LightSetInens
- LightSetInens = xxx
-
-
- def SetLightRadius(xxx):
- global LightSetRadius
- LightSetRadius = xxx
-
-
- def SetLightIntesity(LightName, Intens):
- o = Bladex.GetEntity(LightName)
- o.Lights = [
- (LightSetInens * Intens, LightSetRadius, LightSetColor)]
- o.FiresIntensity = [
- 20 - 20 * Intens]
-
-
- def GetLightIntesity(LightName):
- o = Bladex.GetEntity(LightName)
- spot = AuxFuncs.GetSpot(o)
- spot.SizeFactor = spot.Intensity / LightSetInens
- return spot.Intensity / LightSetInens
-
- Bladex.CreateTimer('LightTimer', 0.2)
-
- def TurnOffTimer(e_name, time):
- Intesity = GetLightIntesity(e_name) - LightSpeed * 4
- if Intesity <= 0:
- o = Bladex.GetEntity(e_name)
- o.TimerFunc = ''
- o.RemoveFromList('LightTimer')
- Intesity = 0
-
- SetLightIntesity(e_name, Intesity)
-
-
- def TurnOffLight(LightName):
- o = Bladex.GetEntity(LightName)
- o.SubscribeToList('LightTimer')
- o.TimerFunc = TurnOffTimer
-
-
- def TurnOnTimer(e_name, time):
- global LightSetInens, LightSetRadius
- AuxLightSetInens = LightSetInens
- AuxLightSetRadius = LightSetRadius
- GetLightData(e_name)
- Intesity = GetLightIntesity(e_name) + LightSpeed * 4
- if Intesity >= 1:
- o = Bladex.GetEntity(e_name)
- o.TimerFunc = ''
- o.RemoveFromList('LightTimer')
- Intesity = 1
-
- SetLightIntesity(e_name, Intesity)
- LightSetInens = AuxLightSetInens
- LightSetRadius = AuxLightSetRadius
-
-
- def TurnOnLight(LightName):
- GetLightData(LightName)
- AddLightData(LightName, LightSetInens, LightSetRadius, LightSetColor)
- o = Bladex.GetEntity(LightName)
- o.SubscribeToList('LightTimer')
- o.TimerFunc = TurnOnTimer
-
-