home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 1.5)
-
- import Bladex
- import InitDataField
- import AuxFuncs
- import Actions
- OFF = 0
- ON = 1
- DEAD = 0
- ALIVE = 1
- tipos_antorcha = ('Antorcha', 'Antorchaenpared', 'Palangana')
-
- class TorchObj:
- pass
-
-
- def ExtingueGradual(torchobj, torchspot, torchfire, intensity_var, fire_var, fire_int, OnEndExtinctionFunc, OnEndExtinctionArgs):
- if torchspot.Intensity > 0.0:
- torchspot.Intensity = torchspot.Intensity - intensity_var
- else:
- torchspot.Intensity = 0
- fire_int = fire_int + fire_var
- torchfire.Intensity = fire_int
- if torchfire.Intensity >= 30.0:
- torchobj.LiveStatus = DEAD
- torchobj.LightStatus = OFF
- if OnEndExtinctionFunc:
- apply(OnEndExtinctionFunc, OnEndExtinctionArgs)
-
- return None
-
- Bladex.AddScheduledFunc(Bladex.GetTime() + 0.1, ExtingueGradual, (torchobj, torchspot, torchfire, intensity_var, fire_var, fire_int, OnEndExtinctionFunc, OnEndExtinctionArgs))
-
-
- def ExtingueAntorcha(torch_name, OnEndExtinctionFunc = '', OnEndExtinctionArgs = ()):
- torch = Bladex.GetEntity(torch_name)
- torchspot = AuxFuncs.GetSpot(torch)
- torchfire = AuxFuncs.GetFire(torch)
- torchobj = torch.Data.torchobjdata
- if torchspot.Intensity <= 0.0:
- return None
-
- intensity_var = torchspot.Intensity / 20.0
- fire_var = (30.0 - torchfire.Intensity) / 60.0
- fire_int = torchfire.Intensity
- Bladex.AddScheduledFunc(Bladex.GetTime() + 0.1, ExtingueGradual, (torchobj, torchspot, torchfire, intensity_var, fire_var, fire_int, OnEndExtinctionFunc, OnEndExtinctionArgs))
-
-
- def EnciendeGradual(torchobj, torchspot, torchfire, intensity_var, fire_var, fire_int):
- torchspot.Intensity = torchspot.Intensity + intensity_var
- fire_int = fire_int - fire_var
- torchfire.Intensity = fire_int
- if torchspot.Intensity >= torchobj.LightIntensity:
- torchobj.LightStatus = ON
- return None
-
- Bladex.AddScheduledFunc(Bladex.GetTime() + 0.1, EnciendeGradual, (torchobj, torchspot, torchfire, intensity_var, fire_var, fire_int))
-
-
- def EnciendeAntorcha(torch_name):
- torch = Bladex.GetEntity(torch_name)
- torchspot = AuxFuncs.GetSpot(torch)
- torchfire = AuxFuncs.GetFire(torch)
- torchobj = torch.Data.torchobjdata
- if torchobj.LightStatus == ON:
- return None
-
- intensity_var = torchobj.LightIntensity / 20.0
- fire_var = (10.0 - torchobj.FireIntensity) / 20.0
- torchfire.Intensity = 10.0
- fire_int = torchfire.Intensity
- Bladex.AddScheduledFunc(Bladex.GetTime() + 0.1, EnciendeGradual, (torchobj, torchspot, torchfire, intensity_var, fire_var, fire_int))
-
-
- def EnciendeEstaAntorcha(person_name, event_name):
- pj = Bladex.GetEntity(person_name)
- pj.DelAnmEventFunc(event_name)
- torch = pj.Data.obj_used
- torchobj = torch.Data.torchobjdata
- objright = Bladex.GetEntity(pj.InvRight)
- objrighttorch = objright.Data.torchobjdata
- if objrighttorch.LightStatus == OFF and torchobj.LightStatus == ON:
- EnciendeAntorcha(objright.Name)
- if objrighttorch.Life > 0.0:
- Bladex.AddScheduledFunc(Bladex.GetTime() + objrighttorch.Life, ExtingueAntorcha, (objright.Name,))
-
- else:
- EnciendeAntorcha(torch.Name)
- if torchobj.Life > 0.0:
- Bladex.AddScheduledFunc(Bladex.GetTime() + torchobj.Life, ExtingueAntorcha, (torch.Name,))
-
-
-
- def TorchUseFunc(torch_name, use_from):
- torch = Bladex.GetEntity(torch_name)
- pj = Bladex.GetEntity('Player1')
- objright = Bladex.GetEntity(pj.InvRight)
- if objright and torch.Kind in tipos_antorcha and objright.Kind in tipos_antorcha:
- torchobj = torch.Data.torchobjdata
- objrighttorch = objright.Data.torchobjdata
- if objrighttorch.LightStatus == OFF and torchobj.LightStatus == OFF and objrighttorch.LightStatus == ON and torchobj.LightStatus == ON:
- return None
-
- if torchobj.LiveStatus == DEAD or objrighttorch.LiveStatus == DEAD:
- return None
-
- Actions.QuickTurnToFaceEntity('Player1', torch_name)
- difalt = -(torch.Position[1] - (pj.Position[1] + pj.Dist2Floor))
- chartype = Bladex.GetCharType(pj.CharType, pj.CharTypeExt)
- if difalt <= chartype.MaxTake1:
- pj.LaunchAnmType('fire_g')
- elif difalt <= chartype.MaxTake2:
- pj.LaunchAnmType('fire0')
- elif difalt <= chartype.MaxTake3:
- pj.LaunchAnmType('fire1')
- elif difalt <= chartype.MaxTake4:
- pj.LaunchAnmType('fire2')
- elif difalt <= chartype.MaxTake5:
- pj.LaunchAnmType('fire3')
- else:
- return None
- if UseFunc:
- UseFunc(torch.Name, objright.Name)
-
- pj.AddAnmEventFunc('SetAlightEvent', EnciendeEstaAntorcha)
-
-
-
- def SetUsable(obj_name, light_int = 3.0, fire_int = 3.0, life = -1):
- obj = Bladex.GetEntity(obj_name)
- if obj.Kind not in tipos_antorcha:
- return None
-
- torchobj = TorchObj()
- torchobj.LightIntensity = light_int
- torchobj.FireIntensity = fire_int
- torchobj.Life = life
- if AuxFuncs.GetSpot(obj).Intensity == 0.0:
- torchobj.LightStatus = OFF
- else:
- torchobj.LightStatus = ON
- if life == 0:
- torchobj.LiveStatus = DEAD
- else:
- torchobj.LiveStatus = ALIVE
- InitDataField.Initialise(obj)
- obj.Data.torchobjdata = torchobj
- if obj.Kind != 'Antorcha':
- obj.UseFunc = TorchUseFunc
-
-
- UseFunc = None
-