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

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. import Bladex
  5. import Reference
  6. siseoacido = Bladex.CreateSound('..\\..\\Sounds\\muerte-acida.wav', 'SiseoAcido')
  7. siseoacido.Volume = 0.7
  8. siseoacido.Scale = 1.14
  9. siseoacido.MinDistance = 5000
  10. siseoacido.MaxDistance = 45000
  11.  
  12. def TakeMe2Init(EntityName):
  13.     me = Bladex.GetEntity(EntityName)
  14.     me.LaunchAnmType('Rlx')
  15.     pos = me.InitPos
  16.     me.Position = (pos[0], pos[1], pos[2])
  17.  
  18.  
  19. class LAVA_AREA:
  20.     entity_name = ''
  21.     entity_damaged = ''
  22.     zoom = 0.1
  23.     texture_name = 'LAVA'
  24.     particle_type = 'LargeFire'
  25.     
  26.     def FuegoInLavaPlayer(self, obj_name, time):
  27.         fuego = Bladex.GetEntity(obj_name)
  28.         char = Bladex.GetEntity(self.entity_damaged)
  29.         fuego.Position = (char.Position[0], char.Position[1], char.Position[2])
  30.  
  31.     
  32.     def LaunchFireInLava(self, entity_name, entity_damaged):
  33.         self.entity_damaged = entity_damaged
  34.         self.entity_name = entity_name
  35.         char = Bladex.GetEntity(entity_damaged)
  36.         siseoacido.Play(char.Position[0], char.Position[1], char.Position[2])
  37.         pfuego = Bladex.CreateEntity(entity_name + '_prtcls', 'Entity Particle System D1', char.Position[0], char.Position[1] + 1000, char.Position[2])
  38.         pfuego.ParticleType = self.particle_type
  39.         pfuego.YGravity = 0.0
  40.         pfuego.Friction = 0.05
  41.         pfuego.PPS = 128
  42.         pfuego.Velocity = (0.0, -1500.0, 0.0)
  43.         pfuego.RandomVelocity = 25.0
  44.         pfuego.Time2Live = 16
  45.         pfuego.FrameFunc = self.FuegoInLavaPlayer
  46.         pfuego.SubscribeToList('Frame')
  47.  
  48.     
  49.     def LavaDefTouchFunc(self, entity_name, entity_damaged, factor):
  50.         self.entity_damaged = entity_damaged
  51.         player = Bladex.GetEntity(entity_damaged)
  52.         if player.Life > 0:
  53.             player.Life = player.Life - factor * 3
  54.         
  55.         if player.Life <= 0:
  56.             player.Wuea = Reference.WUEA_ENDED
  57.             player.LaunchAnmType('dth_burn')
  58.             player.AnmEndedFunc = TakeMe2Init
  59.         
  60.         my_fire = Bladex.GetEntity(entity_name + '_prtcls')
  61.         if not my_fire:
  62.             self.LaunchFireInLava(entity_name, entity_damaged)
  63.             my_fire = Bladex.GetEntity(entity_name + '_prtcls')
  64.         
  65.         my_fire.DeathTime = Bladex.GetTime() + 0.2
  66.  
  67.     
  68.     def CreateLava(self, entity_name, x, y, z, texture = 'LAVA', zoom = 0.1, particle_type = 'LargeFire'):
  69.         self.entity_name = entity_name
  70.         self.texture_name = texture
  71.         self.zoom = zoom
  72.         self.particle_type = particle_type
  73.         tmp_lava = Bladex.CreateEntity(entity_name, 'Entity Lava', x, y, z)
  74.         tmp_lava.TextureName = texture
  75.         tmp_lava.Zoom = zoom
  76.         tmp_lava.TouchFluidFunc = self.LavaDefTouchFunc
  77.  
  78.     
  79.     def __getstate__(self):
  80.         print 'LAVA_AREA.__getstate__()'
  81.         return (1, self.entity_name, self.entity_damaged, self.zoom, self.texture_name, self.particle_type)
  82.  
  83.     
  84.     def __setstate__(self, parm):
  85.         print 'LAVA_AREA.__setstate__()'
  86.         if parm[0] == 1:
  87.             self.entity_name = parm[1]
  88.             self.entity_damaged = parm[2]
  89.             self.zoom = parm[3]
  90.             self.texture_name = parm[4]
  91.             self.particle_type = parm[5]
  92.             if self.entity_name:
  93.                 my_ent = Bladex.GetEntity(self.entity_name)
  94.                 my_ent.TouchFluidFunc = self.LavaDefTouchFunc
  95.             
  96.         else:
  97.             print 'DinObj.__setstate__() -> Version mismatch'
  98.             self.entity_name = ''
  99.             self.entity_damaged = ''
  100.             self.zoom = 0.1
  101.             self.texture_name = 'LAVA'
  102.             self.particle_type = 'LargeFire'
  103.  
  104.  
  105.