home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 56 / CDPowerplay56Disc2.iso / demos / blade / data1.cab / Program_Executable_Files / Lib / Water.pyc (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2000-10-27  |  4.9 KB  |  120 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. import Bladex
  5. import ReadGSFile
  6. import Sounds
  7. SndSplash = Sounds.CreateEntitySound('..\\..\\Sounds\\M-CHAPUZONCAIDAALTURA.wav', 'Splash')
  8. SndSplash.Volume = 1
  9. SndSplash.MinDistance = 5000
  10. SndSplash.MaxDistance = 90000
  11. SndGlubGlub = Sounds.CreateEntitySound('..\\..\\Sounds\\M-agua-burbujas.wav', 'GlubGlub')
  12. SndGlubGlub.Volume = 1
  13. SndGlubGlub.MinDistance = 5000
  14. SndGlubGlub.MaxDistance = 90000
  15. Bladex.ReadBitMap('..\\..\\Data\\Salpicadura.bmp', 'SplashParticle')
  16. Bladex.AddParticleGType('Splash', 'SplashParticle', 2, 64)
  17. for i in range(64):
  18.     aux = (64.0 - i) / 64.0
  19.     r = 80
  20.     g = 100
  21.     b = 100
  22.     a = 64 * (1.0 - aux) ** 0.5
  23.     size = aux * 200
  24.     Bladex.SetParticleGVal('Splash', i, r, g, b, a, size)
  25.  
  26. Bladex.ReadBitMap('..\\..\\Data\\Bubble.bmp', 'BubbleParticle')
  27. Bladex.AddParticleGType('Bubble', 'BubbleParticle', 2, 64)
  28. for i in range(64):
  29.     aux = (64.0 - i) / 64.0
  30.     r = 100
  31.     g = 100
  32.     b = 100
  33.     a = 128.0 * (1.0 - aux) ** 0.5
  34.     size = 50
  35.     Bladex.SetParticleGVal('Bubble', i, r, g, b, a, size)
  36.  
  37.  
  38. def SplashWater(x, y, z):
  39.     Aguita = Bladex.CreateEntity('Cristales', 'Entity Particle System D1', x, y, z)
  40.     Aguita.ParticleType = 'Splash'
  41.     Aguita.PPS = 2048
  42.     Aguita.YGravity = 1000.0
  43.     Aguita.Friction = 0
  44.     Aguita.Velocity = (0, -1500, 0)
  45.     Aguita.RandomVelocity = 20.0
  46.     Aguita.Time2Live = 64
  47.     Aguita.DeathTime = Bladex.GetTime() + 0.3
  48.     SndSplash.Position = (x, y, z)
  49.     SndSplash.PlaySound(0)
  50.     Bladex.AddScheduledFunc(Bladex.GetTime() + 0.0, RemueveAgua, (x, y, z, 1000, 1000))
  51.     Bladex.AddScheduledFunc(Bladex.GetTime() + 5.0, DropBubbles, (x, y, z))
  52.  
  53.  
  54. def DropBubbles(x, y, z):
  55.     Aguita = Bladex.CreateEntity('Cristales', 'Entity Particle System D1', x, y, z)
  56.     Aguita.ParticleType = 'Bubble'
  57.     Aguita.PPS = 10
  58.     Aguita.YGravity = -1000.0
  59.     Aguita.Friction = 0.1
  60.     Aguita.Velocity = (0, 1000, 0)
  61.     Aguita.RandomVelocity = 30.0
  62.     Aguita.Time2Live = 64
  63.     Aguita.DeathTime = Bladex.GetTime() + 5.0
  64.     SndGlubGlub.Position = (x, y, z)
  65.     SndGlubGlub.PlaySound(0)
  66.  
  67.  
  68. def RemueveAgua(x, y, z, sx, sz):
  69.     tierra1 = Bladex.CreateEntity('TierraRemoviendose1', 'Entity Particle System D3', x + sx, y, z + sz)
  70.     tierra1.D1 = (-2 * sx, 0, 0)
  71.     tierra1.D2 = (-2 * sx, 0, -2 * sz)
  72.     tierra1.ParticleType = 'Splash'
  73.     tierra1.PPS = 64
  74.     tierra1.YGravity = 200.0
  75.     tierra1.Friction = 0.1
  76.     tierra1.Velocity = (0.0, -400.0, 0.0)
  77.     tierra1.RandomVelocity = 15.0
  78.     tierra1.Time2Live = 64
  79.     tierra1.DeathTime = Bladex.GetTime() + 2.0
  80.     tierra2 = Bladex.CreateEntity('TierraRemoviendose2', 'Entity Particle System D3', x + sx, y, z + sz)
  81.     tierra2.D1 = (-2 * sx, 0, -2 * sz)
  82.     tierra2.D2 = (0, 0, -2 * sz)
  83.     tierra2.ParticleType = 'Splash'
  84.     tierra2.PPS = 64
  85.     tierra2.YGravity = 200.0
  86.     tierra2.Friction = 0.1
  87.     tierra2.Velocity = (0.0, -400.0, 0.0)
  88.     tierra2.RandomVelocity = 15.0
  89.     tierra2.Time2Live = 64
  90.     tierra2.DeathTime = Bladex.GetTime() + 2.0
  91.  
  92. WaterHi = 24000
  93.  
  94. def matame(finado):
  95.     finado.Life = 0
  96.  
  97.  
  98. def OnGlubGlub(sectorindex, entityname):
  99.     finado = Bladex.GetEntity(entityname)
  100.     if finado.Person:
  101.         SplashWater(finado.Position[0], WaterHi - 1, finado.Position[2])
  102.         Bladex.AddScheduledFunc(Bladex.GetTime() + 2.0, matame, (finado,))
  103.         if entityname == 'Player1':
  104.             cam = Bladex.GetEntity('Camera')
  105.             cam.SType = 0
  106.             cam.TType = 0
  107.         
  108.     
  109.  
  110.  
  111. def SetGs(filename, sectorname):
  112.     res = ReadGSFile.ReadGhostSectorFile(filename)
  113.     for igs in res:
  114.         Bladex.AddTriggerSector(igs['Name'], igs['Grupo'], igs['FloorHeight'], igs['RoofHeight'], igs['Vertex'])
  115.     
  116.     Bladex.SetTriggerSectorFunc(sectorname, 'OnEnter', OnGlubGlub)
  117.     char = Bladex.GetEntity('Player1')
  118.     char.SendTriggerSectorMsgs = 1
  119.  
  120.