home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 56 / CDPowerplay56Disc2.iso / demos / blade / data1.cab / Program_Executable_Files / Lib / pocimac.py < prev    next >
Encoding:
Python Source  |  2000-10-27  |  15.0 KB  |  528 lines

  1. import OnInitTake
  2. import ReadGSFile
  3. import Bladex
  4. import Actions
  5. import CharStats
  6. import whrandom
  7. import GenFX
  8. import Reference
  9. import AuxFuncs
  10.  
  11.  
  12.  
  13. POTION_STATE_USED = 0
  14. POTION_STATE_UNUSED = 1
  15.  
  16. POTION_TYPE_EAT = 0
  17. POTION_TYPE_DRINK_RIGHT = 1
  18. POTION_TYPE_GULP = 2
  19. POTION_TYPE_DRINK_LEFT = 3
  20.  
  21. POWERUP_TYPE_LIFE = 0
  22. POWERUP_TYPE_ATTACK = 1
  23.  
  24. POWERUP_DEACTIVATED     = 2
  25. POWERUP_ACTIVATED = 1
  26.  
  27. #B_PARTICLE_GTYPE_BLEND=1
  28.  
  29.  
  30. def RestoreWounds(EntityName, woundfactor=0.0):
  31.     me= Bladex.GetEntity(EntityName)    
  32.     woundlist= []    
  33.     for i in range (32):
  34.         if me.GetWoundedZone(i):
  35.             woundlist.append(i)
  36.     
  37.     while len(woundlist) and len(woundlist)/11.0 > woundfactor:
  38.         if woundlist.count(3):
  39.             wound2clear= 3 # Head
  40.         elif whrandom.randint(0,1):
  41.             wound2clear= whrandom.choice(woundlist)
  42.         else:
  43.             wound2clear= woundlist[0]
  44.         me.SetWoundedZone(wound2clear, 0)
  45.         woundlist.remove(wound2clear)
  46.  
  47. def RestoreWoundsToLifeLevel(EntityName):
  48.     me= Bladex.GetEntity(EntityName)
  49.     woundfactor= 1.0- (me.Life / CharStats.GetCharMaxLife(me.Kind,me.Level))
  50.     RestoreWounds(EntityName, woundfactor)
  51.  
  52. class Pocima:
  53.     def __init__(self,pot):
  54.         self.Hand = 0
  55.         self.Estado = POTION_STATE_UNUSED
  56.         self.Increment = 25
  57.         self.MaxLife = 200
  58.         self.DrinkFunc = 0
  59.         self.DrinkFuncArguments = ()
  60.         self.Sonido=0
  61.         self.Type = POTION_TYPE_DRINK_RIGHT
  62.         self.OHand = ""        
  63.         self.PowerPotion = 0
  64.         self.TimeStartPowerPotion = 5.0
  65.         self.TimePowerPotion = 10.0
  66.         self.OldFDefense = 0.0
  67.         self.OldFAttack    = 0.0
  68.         self.FDefense = 4.0
  69.         self.FAttack = 4.0
  70.         self.PowerUpEstado = POWERUP_DEACTIVATED
  71.         self.LifePowerUpI = 0
  72.         self.LifePowerUp = 100
  73.         self.FadeDelta = (0.2 /60.0)
  74.         self.CuresPoison= 0
  75.  
  76.  
  77.     def IncrementLife(self):
  78.         UsedBy2 = Bladex.GetEntity(self.entity)
  79.         UsedBy = self        
  80.  
  81.         if (UsedBy.PowerUpEstado == POWERUP_ACTIVATED):
  82.             if (UsedBy.LifePowerUpI < UsedBy.LifePowerUp):
  83.                 life = UsedBy2.Life + 1.0
  84.  
  85.                 if life <= self.MaxLife:
  86.                     UsedBy.LifePowerUpI = UsedBy.LifePowerUpI + 1.0
  87.                     UsedBy2.Life =  life
  88.                     RestoreWoundsToLifeLevel(UsedBy2.Name)
  89.  
  90.                 timenext = 0.50
  91.  
  92.                 Bladex.AddScheduledFunc(Bladex.GetTime() + timenext,self.IncrementLife,())
  93.             else:
  94.                 UsedBy.PowerUpEstado = POTION_STATE_USED
  95.  
  96.     def ActivatePowerUp(self,sector,entity):        
  97.         #UsedBy = Bladex.GetEntity(entity)
  98.         UsedBy = self        
  99.         
  100.         if (UsedBy.PowerUpEstado == POWERUP_DEACTIVATED):            
  101.             self.entity = entity
  102.             UsedBy.PowerUpEstado = POWERUP_ACTIVATED
  103.             Bladex.AddScheduledFunc(Bladex.GetTime() + 0.50,self.IncrementLife,())
  104.  
  105.     def DeactivatePowerUp(self,sector,entity):        
  106.         if (entity == self.entity):
  107.             #UsedBy = Bladex.GetEntity(entity)
  108.             UsedBy = self
  109.  
  110.             if (UsedBy.PowerUpEstado == POWERUP_ACTIVATED):
  111.                 UsedBy.PowerUpEstado = POWERUP_DEACTIVATED
  112.  
  113.     def FinishPowerAtack(self,entity):        
  114.         UsedBy = Bladex.GetEntity(entity)
  115.         if UsedBy.Data.PowerPotion==1 :
  116.             UsedBy.SelfIlum = 0.0
  117.             UsedBy.Data.FDefense = self.OldFDefense
  118.             UsedBy.Data.FAttack = self.OldFAttack
  119.             UsedBy.Data.PowerPotion = 2
  120.  
  121.     def StartPowerAtack(self):    
  122.         if (self.PowerUpEstado == POWERUP_ACTIVATED):            
  123.             UsedBy = Bladex.GetEntity(self.entity)
  124.             UsedBy.SelfIlum = 1.0
  125.             self.OldFDefense = 1.0
  126.             self.OldFAttack = 1.0
  127.  
  128.             UsedBy.Data.FDefense = self.FDefense
  129.             UsedBy.Data.FAttack = self.FAttack
  130.             UsedBy.Data.PowerPotion = 1
  131.  
  132.             Bladex.AddScheduledFunc(Bladex.GetTime() + self.TimePowerPotion,self.FinishPowerAtack,(self.entity,))
  133.  
  134.     def ActivatePowerUpAtack(self,sector,entity):
  135.         if (self.PowerUpEstado == POWERUP_DEACTIVATED):
  136.             UsedBy = Bladex.GetEntity(entity)            
  137.  
  138.             if (UsedBy.Data.PowerPotion == 0):                
  139.                 self.PowerUpEstado = POWERUP_ACTIVATED
  140.                 self.entity = entity
  141.                 Bladex.AddScheduledFunc(Bladex.GetTime() + self.TimeStartPowerPotion,self.StartPowerAtack,())
  142.     
  143.     def DeactivatePowerUpAtack(self,sector,entity):
  144.         if (entity == self.entity):
  145.             self.PowerUpEstado = POWERUP_DEACTIVATED            
  146.  
  147.     def Reset(self,Players = 0):
  148.         #UsedBy = Bladex.GetEntity(self.entity)
  149.  
  150.         if (self.Type == POWERUP_TYPE_LIFE):
  151.             UsedBy = self
  152.  
  153.             UsedBy.PowerUpEstado = POWERUP_DEACTIVATED
  154.             UsedBy.LifePowerUpI = 0.0
  155.         else:
  156.             for name in Players:
  157.                 ent = Bladex.GetEntity(name)
  158.                 ent.Data.PowerPotion = 0
  159.                 ent.Data.FDefense = 1.0
  160.                 ent.Data.FAttack = 1.0
  161.                 ent.SelfIlum = 0.0
  162.  
  163.     def FadeOut(self,entity,timer):        
  164.         poc = Bladex.GetEntity(entity)
  165.         poc.Alpha = poc.Alpha - poc.Data.FadeDelta
  166.         if len(poc.Lights):
  167.             poc.Lights = [(poc.Alpha/2, poc.Lights[0][1], poc.Lights[0][2])]
  168.  
  169.         if poc.Alpha <= 0:
  170.             poc.SubscribeToList("Pin")
  171.  
  172. def RestoreHand(entidad):    
  173.     char = Bladex.GetEntity(entidad)
  174.     char.AddAnmEventFunc("ChangeREvent",Actions.ToggleWEvent)
  175.     char.LaunchAnmType("Chg_r")
  176.  
  177. def TakePotionUsed():
  178.     pass
  179.  
  180. def PocimaNoSoltada(entidad):
  181.     Reference.debugprint("PocimaNoSoltada")
  182.     char = Bladex.GetEntity(entidad)    
  183.     object = Bladex.GetEntity(char.Data.obj_used)
  184.     
  185.     if object.Data.Estado == POTION_STATE_USED:
  186.         SoltarPocima(entidad,0)
  187.     else:
  188.         object.ExcludeHitFor(char)
  189.         inv = char.GetInventory()
  190.  
  191.         if object.Data.Type == POTION_TYPE_DRINK_LEFT:
  192.             # In Combat and using left hand's second slot
  193.             inv.LinkLeftHand2("None")
  194.             impulse = char.Rel2AbsVector(1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)
  195.             object.Impulse(impulse[0],impulse[1],impulse[2])
  196.         else:
  197.             inv.LinkRightHand("None")        
  198.             
  199.             if object.Data.Hand == 1:
  200.                 char.AnmEndedFunc = RestoreHand
  201.  
  202.             inv.RemoveObject(char.Data.obj_used)
  203.             impulse = char.Rel2AbsVector(-1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)    
  204.             object.Impulse(impulse[0],impulse[1],impulse[2])    
  205.  
  206. def SoltarFood(Entidad):
  207.     char = Bladex.GetEntity(Entidad)
  208.     char.AnmEndedFunc = ""
  209.     inv = char.GetInventory()
  210.     inv.LinkRightHand("None")
  211.     inv.RemoveObject(char.Data.obj_used)        
  212.     Actions.TakeStraightRecover(Entidad)
  213.  
  214. def SoltarPocima(Entidad,Evento = 0):
  215.     char = Bladex.GetEntity(Entidad)
  216.     char.AnmEndedFunc = ""
  217.     if Evento:
  218.         char.DelAnmEventFunc(Evento)
  219.     object = Bladex.GetEntity(char.Data.obj_used)
  220.     object.ExcludeHitFor(char)
  221.     object.TimerFunc = object.Data.FadeOut
  222.     object.SubscribeToList("Timer60")
  223.  
  224.     inv = char.GetInventory()
  225.  
  226.     if object.Data.Type == POTION_TYPE_DRINK_LEFT:
  227.         # In Combat and using left hand's second slot
  228.         inv.LinkLeftHand2("None")
  229.         inv.RemoveObject(char.Data.obj_used)
  230.         impulse = char.Rel2AbsVector(1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)
  231.         object.Impulse(impulse[0],impulse[1],impulse[2])
  232.     else:
  233.         inv.LinkRightHand("None")        
  234.         
  235.         if object.Data.Hand == 1:            
  236.             char.AnmEndedFunc = RestoreHand
  237.         else:
  238.             char.AnmEndedFunc= Actions.TakeStraightRecover
  239.         inv.RemoveObject(char.Data.obj_used)
  240.         impulse = char.Rel2AbsVector(-1000.0 * object.Mass, -1000.0 * object.Mass, 0.0)    
  241.         object.Impulse(impulse[0],impulse[1],impulse[2])
  242.  
  243.     OnInitTake.AddOnInitTakeEvent(object.Name,TakePotionUsed)
  244.     
  245.  
  246. def RestorePowerPotion(Entidad,Potion):
  247.     char = Bladex.GetEntity(Entidad)
  248.  
  249.     char.Data.FDefense = Potion.OldFDefense
  250.     char.Data.FAttack = Potion.OldFAttack
  251.     char.Data.PowerPotion = 0
  252.  
  253. def BeberPocima(Entidad,Evento):
  254.     char = Bladex.GetEntity(Entidad)
  255.     char.DelAnmEventFunc(Evento)
  256.     Poti = Bladex.GetEntity(char.Data.obj_used)
  257.     Pot = Poti.Data    
  258.     Pot.Estado = POTION_STATE_USED
  259.  
  260.     if (Pot.PowerPotion):        
  261.         Pot.OldFDefense = char.Data.FDefense
  262.         Pot.OldFAttack = char.Data.FAttack
  263.         
  264.         char.Data.FDefense = Pot.FDefense
  265.         char.Data.FAttack = Pot.FAttack
  266.         char.Data.PowerPotion = 1
  267.         Bladex.AddScheduledFunc(Bladex.GetTime() + Pot.TimePowerPotion,RestorePowerPotion,(Entidad,Pot))
  268.         GenFX.AddPersonItemFX(Entidad, Poti.Name, Pot.TimePowerPotion)
  269.     else:
  270.         if Poti.Kind == "PocimaTodo":
  271.             char.Life = CharStats.GetCharMaxLife(char.Kind,char.Level)
  272.             # Restore wounds
  273.             RestoreWounds(Entidad)
  274.         else:
  275.             Life = char.Life + Pot.Increment
  276.             LimitLife = CharStats.GetCharMaxLife(char.Kind,char.Level)
  277.  
  278.             if (Life > LimitLife):
  279.                 char.Life = LimitLife
  280.             else:
  281.                 char.Life = Life
  282.             RestoreWoundsToLifeLevel(Entidad)
  283.  
  284.         if Pot.CuresPoison:
  285.             char.Data.UnVenom ()
  286.             
  287.     Pot.Sonido.Play(char.Position[0],char.Position[1],char.Position[2],0)
  288.  
  289.     if (Pot.DrinkFunc <> 0):
  290.         Bladex.AddScheduledFunc(Bladex.GetTime(),Pot.DrinkFunc,Pot.DrinkFuncArguments)
  291.  
  292. def CreateMiguillas(Entidad,Evento):
  293.     char = Bladex.GetEntity(Entidad)    
  294.     Poti = Bladex.GetEntity(char.Data.obj_used)    
  295.  
  296.     miguillas=Bladex.CreateEntity("Miguillas", "Entity Particle System D1",0,0,0)
  297.     #miguillas.D=-3600, 0, 0
  298.     miguillas.ParticleType="Miguillas"
  299.     miguillas.YGravity=10000.0
  300.     miguillas.Friction=0.2
  301.     miguillas.RandomVelocity=10.0
  302.     miguillas.PPS=200
  303.     miguillas.Time2Live=32
  304.     miguillas.DeathTime=Bladex.GetTime() + 0.1
  305.  
  306.     Poti.Link(miguillas)
  307.     
  308.     if Evento == "Bocado1Event":        
  309.         Poti.TimerFunc = Poti.Data.FadeOut
  310.         Poti.SubscribeToList("Timer60")
  311.  
  312.     #Pot.Estado = POTION_STATE_UNUSED
  313.  
  314.  
  315. def UsePotion3(Entity):    
  316.     char = Bladex.GetEntity(Entity)    
  317.     UsePotion2(char.Data.obj_used)
  318.  
  319. def UsePotion2(NombrePocima):    
  320.     Reference.debugprint("UsePotion2")        
  321.     Pocima = Bladex.GetEntity(NombrePocima)
  322.     #Pocima.Data.Estado = POTION_STATE_USED
  323.     Char = Bladex.GetEntity(Pocima.Data.UsedBy)
  324.     Reference.debugprint(Char.AnmEndedFunc)
  325.     #Char.HitFunc = TirarPocima    
  326.     Char.AnmEndedFunc= Actions.TakeStraightRecover
  327.  
  328.     if (Pocima.Data.Type==POTION_TYPE_EAT):        
  329.         Char.LaunchAnmType("eat00")
  330.         Char.AddAnmEventFunc("Bocado1Event",CreateMiguillas)
  331.         Char.AddAnmEventFunc("Bocado2Event",CreateMiguillas)
  332.         Char.AnmEndedFunc= SoltarFood
  333.     elif (Pocima.Data.Type == POTION_TYPE_DRINK_RIGHT):
  334.         Char.LaunchAnmType("drink")    
  335.         Char.AddAnmEventFunc("PickBottle",PickPotion)
  336.     elif (Pocima.Data.Type == POTION_TYPE_GULP):
  337.         Char.LaunchAnmType("gulp00")    
  338.     else:
  339.         print 'Unknown Potion Type' + `Pocima.Data.Type`
  340.  
  341.     Char.AddAnmEventFunc("drinkingEvent",BeberPocima)
  342.     print 'should throw bottle with event ThrowBottle in animation '+Char.AnimName
  343.     Char.AddAnmEventFunc("ThrowBottle",SoltarPocima)
  344.     
  345.  
  346.   
  347. def UsePotion(NombrePocima,TipoUso):
  348.     Pocima = Bladex.GetEntity(NombrePocima)
  349.     Pocima.Data.Hand = 0
  350.     Char = Bladex.GetEntity(Pocima.Data.UsedBy)
  351.     Char.Data.obj_used = NombrePocima    
  352.     Char.AnmEndedFunc = PocimaNoSoltada
  353.  
  354.     if (TipoUso == Actions.USE_FROM_INV and Pocima.Data.Estado == POTION_STATE_UNUSED):
  355.         # Use from inventory        
  356.         Pocima.Data.Type = 1
  357.         if not Char.InvRight:
  358.             UsePotion2(NombrePocima)
  359.         else:
  360.             if Char.InCombat:
  361.                 if not Char.InvLeft2:
  362.                     Pocima.Data.Type = 3                    
  363.                     Char.LaunchAnmType("attack_drink")
  364.                     Char.AddAnmEventFunc("PickBottle",PickPotion)
  365.                     Char.AddAnmEventFunc("drinkingEvent",BeberPocima)        
  366.                     Char.AddAnmEventFunc("ThrowBottle",SoltarPocima)
  367.  
  368.             elif Actions.IsRightHandStandardObject(Char.Name):
  369.                 if Actions.TryDropRight(Char.Name):    
  370.                     Actions.DropReleaseEventHandler(Char.Name, "DropRightEvent")
  371.                 if not Char.InvRight:                    
  372.                     UsePotion2(NombrePocima)
  373.             else:
  374.                 Char.AddAnmEventFunc("ChangeREvent",Actions.ToggleWEvent)
  375.                 Char.LaunchAnmType("Chg_r")
  376.                 Pocima.Data.Hand = 1
  377.                 Pocima.Data.OHand = Char.InvRight
  378.                 Char.AnmEndedFunc=UsePotion3
  379.     elif (TipoUso == Actions.USE_FROM_TAKE and Pocima.Data.Estado == POTION_STATE_UNUSED):
  380.         # Automatic use from take         
  381.         
  382.         if (Pocima.Data.Type <> POTION_TYPE_EAT):            
  383.             Pocima.Data.Type = POTION_TYPE_GULP
  384.             Char.AnmEndedFunc=UsePotion3
  385.         else:            
  386.             Char.AnmEndedFunc=UsePotion3
  387.  
  388.  
  389. def PickPotion(Entidad,Evento):
  390.     char=Bladex.GetEntity(Entidad)
  391.     char.DelAnmEventFunc(Evento)
  392.     Pocima = char.Data.obj_used        
  393.     object = Bladex.GetEntity(char.Data.obj_used)
  394.  
  395.     inv = char.GetInventory()
  396.     if object.Data.Type==3:
  397.         inv.LinkLeftHand2(Pocima)
  398.     else:
  399.         inv.LinkRightHand(Pocima)
  400.  
  401. def CreatePotion(Nombre,Increment = 25,MaxLife = 180):
  402.     Pot = Bladex.GetEntity(Nombre)
  403.     Pot.Static = 0
  404.     Pot.Data = Pocima(Pot)
  405.     Pot.UseFunc = UsePotion    
  406.     Pot.Data.Increment = Increment
  407.     Pot.Data.MaxLife = MaxLife
  408.  
  409.     kind = Pot.Kind
  410.     
  411.     if kind == "Pocima25":
  412.         Pot.Data.Increment = 25
  413.     elif kind == "Pocima50":
  414.         Pot.Data.Increment = 50
  415.     elif kind == "Pocima100":
  416.         Pot.Data.Increment = 100
  417.     elif kind == "Pocima200":
  418.         Pot.Data.Increment = 200
  419.  
  420.     Pot.Data.CuresPoison= 1
  421.     
  422.     Pot.Data.Sonido = Bladex.CreateSound('..\\..\\Sounds\\Drink.wav', 'Drinking')
  423.     Pot.Data.Sonido.Volume=1
  424.     Pot.Data.Sonido.MinDistance=10000
  425.     Pot.Data.Sonido.MaxDistance=20000
  426.     
  427.     return Pot.Data
  428.  
  429.  
  430. def CreateFood(Nombre,Increment = 25,MaxLife = 180):
  431.     Pot = Bladex.GetEntity(Nombre)
  432.     Pot.Static = 0
  433.     Pot.Data = Pocima(Pot)
  434.     Pot.UseFunc = UsePotion
  435.     Pot.Data.Increment = Increment
  436.     Pot.Data.MaxLife = MaxLife
  437.  
  438.     Pot.Data.Type = POTION_TYPE_EAT    
  439.     Pot.Data.Sonido = Bladex.CreateSound('..\\..\\Sounds\\bugbite-bone2.wav', 'Eating')
  440.     #Pot.Data.Sound = Bladex.CreateSound('..\\..\\Sounds\\Drink.wav', 'Drinking')
  441.     Pot.Data.Sonido.Volume=1
  442.     Pot.Data.Sonido.MinDistance=10000
  443.     Pot.Data.Sonido.MaxDistance=20000
  444.  
  445.     Pot.Data.FadeDelta = (0.8 /60.0)
  446.         
  447.     kind = Pot.Kind
  448.     if kind   == "Queso":
  449.         Pot.Data.Increment = 10
  450.     elif kind == "Paletilla":
  451.         Pot.Data.Increment = 10    
  452.     elif kind == "Manzana":        
  453.         Pot.Data.Increment = 5
  454.     elif kind == "Setas":
  455.         Pot.Data.Increment = 5
  456.     elif kind == "Seta":
  457.         Pot.Data.Increment = 5
  458.     elif kind == "Rabano":
  459.         Pot.Data.Increment = 5
  460.         Pot.Data.CuresPoison= 1
  461.     elif kind == "Raiz":
  462.         Pot.Data.Increment = 5
  463.     elif kind == "Saquito":
  464.         Pot.Data.Increment = 5
  465.     elif kind == "Hogaza":
  466.         Pot.Data.Increment = 10
  467.     #elif kind == "Mendrugo":
  468.     #    Pot.Data.Increment = 10    
  469.     
  470.     return Pot.Data
  471.  
  472. def CreatePowerPotion(Nombre,FD = 4.0,FA = 4.0,Time = 10):
  473.     PowerPot = CreatePotion(Nombre)
  474.     PowerPot.TimePowerPotion = Time
  475.     PowerPot.PowerPotion = 1
  476.     PowerPot.FDefense = FD
  477.     PowerPot.FAttack = FA
  478.     PowerPot.Increment = 0
  479.     PowerPot.CuresPoison = 0
  480.     pp                = Bladex.GetEntity(Nombre)
  481.     pp.FiresIntensity = [ 45 ]
  482.     pp.Lights         = [ (0.50000,0.050000,(0,128,255)) ]
  483.     pp.SelfIlum       = 1    
  484.     spot = AuxFuncs.GetSpot(pp)
  485.     if spot:
  486.         spot.Visible      = 0
  487.         spot.CastShadows  = 0
  488.     
  489.  
  490.  
  491.  
  492. def CreatePowerUp(Sector,Name,Life = 100,MaxLife = 100):
  493.     res=ReadGSFile.ReadGhostSectorFile(Sector)
  494.  
  495.     for igs in res:
  496.         Bladex.AddTriggerSector(igs["Name"],igs["Grupo"],igs["FloorHeight"],igs["RoofHeight"],igs["Vertex"])
  497.  
  498.     PowerUp = Pocima(0)
  499.  
  500.     Bladex.SetTriggerSectorFunc(Name, "OnLeave", PowerUp.DeactivatePowerUp)
  501.     Bladex.SetTriggerSectorFunc(Name, "OnEnter", PowerUp.ActivatePowerUp)
  502.     
  503.     PowerUp.Type = POWERUP_TYPE_LIFE
  504.     PowerUp.LifePowerUp = Life
  505.     PowerUp.MaxLife = MaxLife
  506.  
  507.     return PowerUp
  508.  
  509. def CreatePowerUpAtack(Sector,Name,FD = 4.0,FA = 4.0,TimeD = 10,TimeL = 5):
  510.     res=ReadGSFile.ReadGhostSectorFile(Sector)
  511.  
  512.     for igs in res:
  513.         Bladex.AddTriggerSector(igs["Name"],igs["Grupo"],igs["FloorHeight"],igs["RoofHeight"],igs["Vertex"])
  514.  
  515.     PowerUp = Pocima(0)
  516.  
  517.     Bladex.SetTriggerSectorFunc(Name, "OnLeave", PowerUp.DeactivatePowerUpAtack)
  518.     Bladex.SetTriggerSectorFunc(Name, "OnEnter", PowerUp.ActivatePowerUpAtack)
  519.  
  520.     PowerUp.Type = POWERUP_TYPE_ATTACK
  521.     PowerUp.TimeStartPowerPotion = TimeL
  522.     PowerUp.TimePowerPotion = TimeD        
  523.     PowerUp.FDefense = FD
  524.     PowerUp.FAttack = FA
  525.  
  526.  
  527.     return PowerUp
  528.