home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 56 / CDPowerplay56Disc2.iso / demos / blade / data1.cab / Program_Executable_Files / Lib / Sparks.py < prev    next >
Encoding:
Text File  |  2000-10-27  |  16.1 KB  |  428 lines

  1. import Bladex
  2. import B3DLib
  3. import Reference
  4. import netgame
  5. import Damage
  6. import Water
  7. import whrandom
  8. import Breakings
  9. import Blood
  10.  
  11. def ThrowSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  12.     obj= Bladex.GetEntity(hitting_entity)
  13.     try:
  14.         if obj and obj.Data.NoFXOnHit:
  15.             return
  16.     except: pass
  17.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  18.     if mod<5000.0:
  19.         return
  20.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  21.     chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  22.  
  23. def ThrowMetalSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  24.     obj= Bladex.GetEntity(hitting_entity)
  25.     try:
  26.         if obj and obj.Data.NoFXOnHit:
  27.             return
  28.     except: pass
  29.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  30.     if mod<5000.0:
  31.         return
  32.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  33.     chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  34.  
  35.     # sound
  36.     on_hit_info= Reference.MaterialOnHitInfo['Metal']
  37.     sound= on_hit_info[0]
  38.  
  39.     if sound:
  40.         sound.Stop()
  41.         sound.Play(xhit_point, yhit_point, zhit_point, 0)
  42.  
  43. def ThrowDustAndSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  44.     obj= Bladex.GetEntity(hitting_entity)
  45.     try:
  46.         if obj and obj.Data.NoFXOnHit:
  47.             return
  48.     except: pass
  49.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  50.     if mod<5000.0:
  51.         return
  52.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  53.     chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  54.     
  55.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  56.     polvillo.ParticleType="MediumDust"
  57.     polvillo.YGravity=200
  58.     polvillo.Friction=0.2
  59.     polvillo.PPS=200
  60.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  61.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  62.     polvillo.RandomVelocity=40.0
  63.     polvillo.RandomVelocity_V=1.0
  64.  
  65. def ThrowWoodenSparks(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,wcx,wcy,wcz,wdx,wdy,wdz):
  66.     obj= Bladex.GetEntity(hitting_entity)
  67.     try:
  68.         if obj and obj.Data.NoFXOnHit:
  69.             return
  70.     except: pass
  71.     mod=B3DLib.Modulo(ximpulse, yimpulse, zimpulse)
  72.     if mod<5000.0:
  73.         return
  74.     
  75.     # spark
  76.     sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  77.     spark= Bladex.CreateSpark("Wood",xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],      0.75,2000,60,0,80,   75,46,21,   6,3,2,    900,15.0/60.0,1.0/60.0,0)
  78.     spark.RasterMode="BlendingAlpha"
  79.     
  80.     # dust
  81.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  82.     polvillo.ParticleType="MediumDust"
  83.     polvillo.YGravity=200
  84.     polvillo.Friction=0.2
  85.     polvillo.PPS=250
  86.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  87.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  88.     polvillo.RandomVelocity=40.0
  89.     polvillo.RandomVelocity_V=1.0
  90.     
  91.     # sound
  92.     on_hit_info= Reference.MaterialOnHitInfo['MaderaTablas']
  93.     sound= on_hit_info[0]
  94.  
  95.     if sound:
  96.         sound.Stop()
  97.         sound.Play(xhit_point, yhit_point, zhit_point, 0)
  98.  
  99.  
  100. def SetSparkling(obj_name):
  101.     obj=Bladex.GetEntity(obj_name)
  102.     if obj.HitFunc:
  103.         print "Este objeto ya es rompible o chispeante."
  104.         return
  105.     obj.Static=0
  106.     obj.HitFunc=ThrowSparks
  107.     return obj
  108.     
  109. def SetDustySparkling(obj_name):
  110.     obj=Bladex.GetEntity(obj_name)
  111.     if obj.HitFunc:
  112.         print "Este objeto ya es rompible o chispeante."
  113.         return
  114.     obj.Static=0
  115.     obj.HitFunc=ThrowDustAndSparks
  116.     return obj
  117.  
  118. def SetWoodenSparkling(obj_name):
  119.     obj=Bladex.GetEntity(obj_name)
  120.     if obj.HitFunc:
  121.         print "Este objeto ya es chispeante."
  122.         return
  123.     obj.Static=0
  124.     obj.HitFunc=ThrowWoodenSparks        
  125.     return obj
  126.  
  127. def SetMetalSparkling(obj_name):
  128.     obj=Bladex.GetEntity(obj_name)
  129.     if obj.HitFunc:
  130.         print "Este objeto ya es rompible o chispeante."
  131.         return
  132.     obj.Static=0
  133.     obj.HitFunc=ThrowMetalSparks
  134.     return obj
  135.  
  136. import pdb
  137.  
  138. def ThrowSparksShield(hit_entity, hitting_entity, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse,DamageType):
  139.     hitting_ent=Bladex.GetEntity(hitting_entity)
  140.         
  141.     hitting_ent.MessageEvent(Reference.MESSAGE_STOP_WEAPON,0,0)
  142.     
  143.     skip_sparks=0
  144.     try:
  145.         if hitting_ent.Data.NoFXOnHit:
  146.             skip_sparks=1
  147.     except: pass
  148.     if not skip_sparks:
  149.         sparkdir=B3DLib.Normalize((-ximpulse, -yimpulse, -zimpulse))
  150.         chispa=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],0.5,3000,2000,0,100, 160, 120, 40, 30, 24, 0,800,10.0/60.0,1.0/60.0,1)
  151.     hit_ent=Bladex.GetEntity(hit_entity)
  152.     
  153.     datos_esc=Reference.DefaultObjectData[hit_ent.Kind]
  154.     if datos_esc[0]==Reference.OBJ_SHIELD:
  155.         Reference.DefaultObjectData[hit_ent.Kind][3].Play(xhit_point, yhit_point, zhit_point, 0)
  156.     else:
  157.         if datos_esc[0]==Reference.OBJ_WEAPON:
  158.             if Reference.GiveWeaponFlag(hit_entity)<>Reference.W_FLAG_1H:
  159.                 Reference.DefaultObjectData[hit_ent.Kind][5][6].Play(xhit_point, yhit_point, zhit_point, 0)    
  160.  
  161.     VictimName=hit_ent.Parent
  162.     AttackerName=hitting_ent.Parent
  163.     pj=Bladex.GetEntity(VictimName)
  164.     
  165.     if hitting_ent.Arrow and (hitting_ent.Parent):
  166.         pdb.set_trace()
  167.     
  168.     pj.DamageFunc(VictimName, AttackerName, hitting_entity, DamageType, 0, -1, xhit_point, yhit_point, zhit_point, 1)
  169.     
  170.     if netgame.GetNetState() == 1:
  171.         netgame.CallEventSound(hit_entity,4)
  172.     
  173.     if hitting_ent.Arrow and (not hitting_ent.Parent):        
  174.         hitting_ent.Stop()
  175.         # Check type of damage
  176.         impact= hitting_ent.GraspPos ("Impact")
  177.         centre= hitting_ent.Position
  178.         impact2centre= centre[0]-impact[0], centre[1]-impact[1], centre[2]-impact[2]
  179.         abs_pos= xhit_point+impact2centre[0], yhit_point+impact2centre[1], zhit_point+impact2centre[2]
  180.         rel_pos= hit_ent.Abs2RelPoint(abs_pos[0], abs_pos[1], abs_pos[2])
  181.         # To bring it closer to centre, multiply vector by < 1.0
  182.         hitting_ent.Position= rel_pos[0]*0.8, rel_pos[1], rel_pos[2]*0.8
  183.         hit_ent.Link(hitting_ent)
  184.         sticktime= (1.0)/hitting_ent.Mass
  185.         Bladex.AddScheduledFunc (Bladex.GetTime()+sticktime, Damage.StuckWeaponFall, (hitting_ent.Name, hit_ent.Name), hitting_ent.Name+"_StuckWeaponFall")
  186.         if hitting_ent.StickFunc:
  187.             hitting_ent.StickFunc (hitting_entity, hit_entity)
  188.  
  189.  
  190. def SetShieldArea(obj_name, cone, height, radius):
  191.     esc=Bladex.GetEntity(obj_name)
  192.     if not esc.Weapon:
  193.         esc.Static=1
  194.     esc.Weapon=1
  195.     esc.Cone=cone
  196.     esc.Height=height
  197.     esc.Radius=radius
  198.     esc.HitShieldFunc=ThrowSparksShield
  199.     return esc
  200.  
  201. def MakeShield(obj_name):
  202.     esc=Bladex.GetEntity(obj_name)
  203.     if not esc.Weapon:
  204.         esc.Static=1
  205.     esc.Weapon=1
  206.     datos_esc=Reference.DefaultObjectData[esc.Kind]
  207.  
  208.     if datos_esc[0]==Reference.OBJ_SHIELD:
  209.         esc.Cone=datos_esc[4]
  210.         esc.Height=datos_esc[5]
  211.         esc.Radius=datos_esc[6]
  212.         if datos_esc[7]:
  213.             Breakings.SetBreakableWS(obj_name)
  214.     else:
  215.         esc.Cone=3.1416
  216.         esc.Height=2000
  217.         esc.Radius=750
  218.         if datos_esc[0]==Reference.OBJ_STANDARD or datos_esc[0]==Reference.OBJ_WEAPON:
  219.             if Reference.GiveWeaponFlag(obj_name)<>Reference.W_FLAG_1H:
  220.                 esc.Cone=datos_esc[5][1]
  221.                 esc.Height=datos_esc[5][2]
  222.                 esc.Radius=datos_esc[5][3]
  223.                 if datos_esc[5][5]:
  224.                     Breakings.SetBreakableWS(obj_name)
  225.             else:
  226.                 print "MakeShield. Unexpected weapon FLAG"
  227.         else:
  228.             print "MakeShield. Unexpected type of object"
  229.         
  230.  
  231.     esc.HitShieldFunc=ThrowSparksShield
  232.     return esc
  233.  
  234. stones_active=0
  235. max_stones_active=4
  236.  
  237. def RemoveStone(obj_name):
  238.     global stones_active
  239.     Piedra= Bladex.GetEntity(obj_name)
  240.     if Piedra:
  241.         Piedra.SubscribeToList("Pin")
  242.         stones_active= stones_active-1
  243.  
  244. def DropStone(x,y,z,dx=1,dy=1,dz=1, Pname= "Piedra_01"):
  245.     global stones_active
  246.     
  247.     if stones_active<max_stones_active:    
  248.         Piedra=Bladex.CreateEntity("Piedrita", Pname, x,y,z, "Physic")
  249.         #Piedra.Mass= 1
  250.         Piedra.Scale= 0.075 + whrandom.random()*0.13        
  251.         
  252.         mod=B3DLib.Modulo(dx,dy,dz)    
  253.         dx=dx/mod + whrandom.random()*0.4 - whrandom.random()*0.4
  254.         dy=dy/mod + whrandom.random()*0.4 - whrandom.random()*0.4
  255.         dz=dz/mod + whrandom.random()*0.4 - whrandom.random()*0.4    
  256.         dx,dy,dz= B3DLib.Scale((dx,dy,dz),mod)
  257.         
  258.         Piedra.ExclusionGroup=1
  259.         Piedra.ImpulseC(x+(whrandom.random()*200.0-100.0), y+(whrandom.random()*-100.0), z+(whrandom.random()*200.0-100.0),dx,dy,dz)
  260.         
  261.         Piedra.OnStopFunc= RemoveStone
  262.         stones_active=stones_active+1
  263.         return Piedra
  264.     else:
  265.         return None
  266.         
  267. def SectorThrowSparks(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):    
  268.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  269.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  270.     sparkdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)    
  271.     spark=Bladex.CreateSpark("Chispa", xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],   0.5,3000,2000,0,100,   160,120,40,   30,24,0,     800,10.0/60.0,1.0/60.0,1)        
  272.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  273.     polvillo.ParticleType="MediumDust"
  274.     polvillo.YGravity=200
  275.     polvillo.Friction=0.2
  276.     polvillo.PPS=200
  277.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  278.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  279.     polvillo.RandomVelocity=40.0
  280.     polvillo.RandomVelocity_V=1.0    
  281.     nstones= whrandom.randint(0,max_stones_active)
  282.     stone_startx= xhit_point+x_norm*200.0
  283.     stone_starty= yhit_point+y_norm*200.0
  284.     stone_startz= zhit_point+z_norm*200.0
  285.     stone_impx= x_norm*2000
  286.     stone_impy= y_norm*2000
  287.     stone_impz= z_norm*2000    
  288.     for i in range(nstones):
  289.         DropStone(stone_startx, stone_starty, stone_startz, stone_impx, stone_impy, stone_impz)    
  290.  
  291. def SectorThrowSnow(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  292.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  293.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  294.     sparkdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)    
  295.     spark= Bladex.CreateSpark("Snow",xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],      0.8,400,100,10,20, 200,200,200, 56,56,56,        600,90.0/60.0,1.0/60.0,0)
  296.     spark.RasterMode="BlendingAlpha"    
  297.  
  298.     tierra1=Bladex.CreateEntity("SnowDust", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  299.     tierra1.ParticleType="SnowDust"
  300.     tierra1.YGravity=200.0
  301.     tierra1.Friction=0.15
  302.     tierra1.PPS=200
  303.     tierra1.Time2Live=64
  304.     tierra1.Velocity=sparkdir[0]*2000.0, sparkdir[1]*2000.0, sparkdir[2]*2000.0    
  305.     tierra1.RandomVelocity=10.0
  306.     tierra1.DeathTime=Bladex.GetTime()+0.05
  307.  
  308.  
  309. def SectorThrowWood(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  310.     #astilla
  311.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  312.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  313.     sparkdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)    
  314.     spark= Bladex.CreateSpark("Wood",xhit_point, yhit_point, zhit_point, sparkdir[0], sparkdir[1], sparkdir[2],      0.75,2000,60,0,80,   75,46,21,   6,3,2,    900,15.0/60.0,1.0/60.0,0)
  315.     spark.RasterMode="BlendingAlpha"
  316.     
  317.     polvillo=Bladex.CreateEntity("PolvoGolpe", "Entity Particle System D1", xhit_point, yhit_point, zhit_point)
  318.     polvillo.ParticleType="MediumDust"
  319.     polvillo.YGravity=200
  320.     polvillo.Friction=0.2
  321.     polvillo.PPS=250
  322.     polvillo.DeathTime=Bladex.GetTime()+2.0/60.0
  323.     polvillo.Velocity=sparkdir[0]*500, sparkdir[1]*500, sparkdir[2]*500
  324.     polvillo.RandomVelocity=40.0
  325.     polvillo.RandomVelocity_V=1.0
  326.  
  327. def SectorThrowWater(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  328.     #astilla
  329.     D=B3DLib.Normalize((ximpulse, yimpulse, zimpulse))    
  330.     TWO_NdotD= 2.0 * (D[0]*x_norm + D[1]*y_norm + D[2]*z_norm)
  331.     reflectdir= (D[0]-x_norm*TWO_NdotD, D[1]-y_norm*TWO_NdotD, D[2]-z_norm*TWO_NdotD)
  332.     
  333.     Aguita1=Bladex.CreateEntity("Cristales", "Entity Particle System D1",xhit_point, yhit_point, zhit_point)
  334.     Aguita1.ParticleType="Splash"
  335.     Aguita1.PPS=1024
  336.     Aguita1.YGravity=2500.0
  337.     Aguita1.Friction=0
  338.     Aguita1.Velocity=reflectdir[0]*2500.0, reflectdir[1]*2500.0, reflectdir[2]*2500.0
  339.     Aguita1.RandomVelocity=15.0
  340.     Aguita1.Time2Live=32
  341.     Aguita1.DeathTime=Bladex.GetTime()+0.10
  342.     Aguita1.Reflects=0
  343.     
  344.     Aguita2=Bladex.CreateEntity("Cristales","Entity Particle System Dobj", 0, 0, 0)
  345.     Aguita2.ObjectName=entity_name
  346.     Aguita2.ParticleType= "Splash"
  347.     Aguita2.PPS= 1024
  348.     Aguita2.YGravity= 4500.0
  349.     Aguita2.Friction= 0.1
  350.     Aguita2.RandomVelocity= 13.0
  351.     Aguita2.Time2Live= 64
  352.     Aguita2.DeathTime= Bladex.GetTime()+0.2
  353.     Aguita2.Reflects=0
  354.  
  355. def GenericSectorOnHit(sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material):
  356.     try:
  357.         obj= Bladex.GetEntity(entity_name)
  358.         if obj.Data.NoFXOnHit:
  359.             return
  360.     except: pass    
  361.     if Reference.MaterialOnHitInfo.has_key(material):    
  362.         on_hit_info= Reference.MaterialOnHitInfo[material]
  363.     else:
  364.         on_hit_info= Reference.MaterialOnHitInfo['default']
  365.     sound= on_hit_info[0]
  366.     func=  on_hit_info[1]
  367.  
  368.     if sound:
  369.         sound.Stop()
  370.         sound.Play(xhit_point, yhit_point, zhit_point, 0)
  371.     if func:
  372.         func (sector_index, entity_name, xhit_point, yhit_point, zhit_point, ximpulse, yimpulse, zimpulse, x_norm, y_norm, z_norm, material)
  373.     
  374. def SetSectorOnHitFuncs():
  375.     GolpeGrava= Bladex.CreateSound('..\\..\\sounds\\golpe_grava.wav', 'GolpeGrava')
  376.     GolpeGrava.SetPitchVar(1, -8000, 8000, 0, 0)
  377.     
  378.     GolpeNieve= Bladex.CreateSound('..\\..\\sounds\\golpe-nieve.wav', 'GolpeNieve')
  379.     GolpeNieve.SetPitchVar(1, -8000, 8000, 0, 0)
  380.  
  381.     GolpeTierra= Bladex.CreateSound('..\\..\\sounds\\golpe_hierba.wav', 'GolpeTierra')
  382.     GolpeTierra.SetPitchVar(1, -8000, 8000, 0, 0)
  383.  
  384.     GolpeAgua= Bladex.CreateSound('..\\..\\sounds\\golpe_agua.wav', 'GolpeAgua')
  385.     GolpeAgua.SetPitchVar(1, -8000, 8000, 0, 0)
  386.  
  387.     GolpeHierba= Bladex.CreateSound('..\\..\\sounds\\golpe_hierba2.wav', 'GolpeHierba')
  388.     GolpeHierba.SetPitchVar(1, -8000, 8000, 0, 0)
  389.  
  390.     GolpeMaderaTablas= Bladex.CreateSound('..\\..\\sounds\\golpe_maderamed.wav', 'GolpeMaderaTablas')
  391.     GolpeMaderaTablas.SetPitchVar(1, -8000, 8000, 0, 0)
  392.  
  393.     GolpeMaderaTablas= Bladex.CreateSound('..\\..\\sounds\\golpe_maderamed.wav', 'GolpeMaderaTablas')
  394.     GolpeMaderaTablas.SetPitchVar(1, -8000, 8000, 0, 0)
  395.     
  396.     GolpeMadera= Bladex.CreateSound('..\\..\\sounds\\M-GOLPESHEAVY4.wav', 'GolpeMadera')
  397.     GolpeMadera.SetPitchVar(1, -8000, 8000, 0, 0)
  398.     
  399.     GolpeMetal= Bladex.CreateSound('..\\..\\sounds\\GOLPE-ARMADUR-1.wav', 'GolpeMetal')
  400.     GolpeMetal.SetPitchVar(1, -8000, 8000, 0, 0)
  401.     
  402.     GolpeCristal= Bladex.CreateSound('..\\..\\sounds\\golpe-cristal-4.wav', 'GolpeCristal')
  403.     GolpeCristal.SetPitchVar(1, -8000, 8000, 0, 0)
  404.  
  405.  
  406.     Reference.MaterialOnHitInfo['default']= [GolpeGrava, SectorThrowSparks]        
  407.  
  408.     Reference.MaterialOnHitInfo['Grava']=       [GolpeGrava, SectorThrowSparks]
  409.     Reference.MaterialOnHitInfo['Piedra']=      [GolpeGrava, SectorThrowSparks]
  410.     Reference.MaterialOnHitInfo['Nieve']=       [GolpeNieve, SectorThrowSnow]
  411.     Reference.MaterialOnHitInfo['Hierba']=      [GolpeHierba, None]
  412.     Reference.MaterialOnHitInfo['Tierra']=      [GolpeTierra, None]
  413.     
  414.     Reference.MaterialOnHitInfo['Madera']=      [GolpeMadera, SectorThrowWood]
  415.     Reference.MaterialOnHitInfo['MaderaTablas']=[GolpeMaderaTablas, SectorThrowWood]
  416.     Reference.MaterialOnHitInfo['Barro']=       [None, None]
  417.     Reference.MaterialOnHitInfo['Water']=       [GolpeAgua, SectorThrowWater]
  418.     Reference.MaterialOnHitInfo['Metal']=       [GolpeMetal, SectorThrowSparks]
  419.     Reference.MaterialOnHitInfo['Cristal']=     [GolpeCristal, None]
  420.  
  421.     if netgame.GetNetState() == 0:    
  422.         for i in range (Bladex.nSectors()):
  423.             sector= Bladex.GetSector(i)
  424.             if not sector.OnHit:
  425.                 sector.OnHit= GenericSectorOnHit
  426.  
  427.  
  428. SetSectorOnHitFuncs()