Forged Alliance Forever Forums
Moderator: Morax
vongratz wrote:But the final result is COOOOL !!!!
KillingState = State {
Main = function(self)
local bp = self:GetBlueprint()
local aiBrain = self:GetAIBrain()
local weaponMaxRange = bp.Weapon[1].MaxRadius
local weaponMinRange = bp.Weapon[1].MinRadius
local beamLifetime = bp.Weapon[1].BeamLifetime
#local reaquireTime = bp.Weapon[1].RequireTime
local weapon = self:GetWeapon(1)
local location = self:GetPosition()
while not self:IsDead() do
local targets = aiBrain:GetUnitsAroundPoint( categories.LAND - categories.UNTARGETABLE, location, weaponMaxRange )
local filteredUnits = {}
for k,v in targets do
if VDist3( location, v:GetPosition() ) >= weaponMinRange and v ~= self then
table.insert( filteredUnits, v )
end
end
local target = filteredUnits[Random(1, table.getn(filteredUnits))]
if target then
weapon:SetTargetEntity(target)
else
weapon:SetTargetGround( { location[1] + Random(-20, 20), location[2], location[3] + Random(-20, 20) } )
end
# Wait a tick to let the target update awesomely.
WaitSeconds(.1)
weapon:FireWeapon()
WaitSeconds(beamLifetime)
#WaitSeconds(reaquireTime)
end
end,
},
OnStopBeingBuilt = function(self,builder,layer)
CStructureUnit.OnStopBeingBuilt(self,builder,layer)
ChangeState( self, self.KillingState )
end,
RadiationDairy = Class(DefaultBeamWeapon) {
BeamType = CollisionBeamFile.RadiationBeam,
FxMuzzleFlash = {},
FxChargeMuzzleFlash = {},
FxUpackingChargeEffects = EffectTemplate.CMicrowaveLaserCharge01,
FxUpackingChargeEffectScale = 1,
}
TerrainImpactType = 'LargeBeam01',
TerrainImpactScale = 0.5,
FxBeamStartPoint = EffectTemplate.RadiationStartDairy,
FxBeam = {},
FxBeamEndPoint = {},
SplatTexture = 'czar_mark01_albedo',
ScorchSplatDropTime = 0.25,
if not self:IsDead() then
weapon:FireWeapon()
end
Petricpwnz wrote:biass on his campaign to cleanse and remake every single map of FAF because he is an untolerating reincarnation of mapping hitler
Users browsing this forum: No registered users and 1 guest