local SSeaUnit = import('/lua/seraphimunits.lua').SSeaUnit
local Buff = import('/lua/sim/Buff.lua')
local EffectTemplate = import('/lua/EffectTemplates.lua')
local Entity = import('/lua/sim/Entity.lua').Entity
local AIUtils = import('/lua/AI/aiutilities.lua')
tcss0201 = Class(SSeaUnit) {
ShieldEffects = {
'/effects/emitters/seraphim_regenerative_aura_01_emit.bp',
},
# Copy of XSL0001_script's RegenBuffThread with slight alterations (Enhancement and RegenField)
RegenBuffThread = function(self)
while not self:IsDead() do
# Get friendly units in the area (including self)
local units = AIUtils.GetOwnUnitsAroundPoint(self:GetAIBrain(), categories.ALLUNITS, self:GetPosition(), self:GetBlueprint().RegenAura.RegenRadius)
# Give them a 5 second regen buff
for _,unit in units do
Buff.ApplyBuff(unit, 'SeraphimRegenFieldMoo')
end
#Wait 5 seconds
WaitSeconds(5)
end
end,
OnStopBeingBuilt = function( self, builder, layer )
SSeaUnit.OnStopBeingBuilt( self, builder, layer )
self.ShieldEffectsBag = {}
end,
OnCreate = function(self)
SSeaUnit.OnCreate(self)
if not self.ShieldEffectsBag then
self.ShieldEffectsBag = {}
end
local bpRA = self:GetBlueprint().RegenAura
if not Buffs['SeraphimRegenFieldMoo'] then
BuffBlueprint {
Name = 'SeraphimRegenFieldMoo',
DisplayName = 'SeraphimRegenFieldMoo',
BuffType = 'COMMANDERAURA',
Stacks = 'REPLACE',
Duration = 5,
Affects = {
RegenPercent = {
Add = 0,
Mult = bpRA.RegenPerSecond or 0.1,
Ceil = bpRA.RegenCeiling,
Floor = bpRA.RegenFloor,
},
},
}
end
table.insert( self.ShieldEffectsBag, CreateAttachedEmitter( self, 'XSS0304', self:GetArmy(), '/effects/emitters/seraphim_regenerative_aura_01_emit.bp' ) )
self.RegenThreadHandle = self:ForkThread(self.RegenBuffThread)
end,
}
UnitBlueprint {
AI = {
GuardRadius = 10,
TargetBones = {
'XSS0304',
},
},
Audio = {
AmbientMove = Sound {
Bank = 'XSL',
Cue = 'XSL0307_Move_Loop',
LodCutoff = 'UnitMove_LodCutoff',
},
Destroyed = Sound {
Bank = 'XSL_Destroy',
Cue = 'XSL_Destroy_Land_Lrg',
LodCutoff = 'UnitMove_LodCutoff',
},
StartMove = Sound {
Bank = 'XSL',
Cue = 'XSL0307_Move_Start',
LodCutoff = 'UnitMove_LodCutoff',
},
StopMove = Sound {
Bank = 'XSL',
Cue = 'XSL0307_Move_Stop',
LodCutoff = 'UnitMove_LodCutoff',
},
UISelection = Sound {
Bank = 'SeraphimSelect',
Cue = 'Seraphim_Select_Naval',
LodCutoff = 'UnitMove_LodCutoff',
},
},
Buffs = {
Regen = {
Level1 = 1,
Level2 = 2,
Level3 = 4,
Level4 = 6,
Level5 = 8,
},
},
BuildIconSortPriority = 50,
Categories = {
'PRODUCTFA',
'SELECTABLE',
'BUILTBYTIER2FACTORY',
'BUILTBYTIER3FACTORY',
'SERAPHIM',
'MOBILE',
'SHIELD',
'DEFENSE',
'NAVAL',
'TECH2',
'VISIBLETORECON',
'RECLAIMABLE',
'OVERLAYMISC',
'DEFENSIVEBOAT',
},
Defense = {
AirThreatLevel = 0,
ArmorType = 'Normal',
EconomyThreatLevel = 0,
Health = 3000,
MaxHealth = 3000,
RegenRate = 30,
SubThreatLevel = 0,
SurfaceThreatLevel = 9,
},
Description = '<LOC tcss0201_desc>Regen Field Generator',
Display = {
Abilities = {
'<LOC ability_regeneration>Regeneration Field',
},
IdleEffects = {
Water = {
Effects = {
{
Bones = {
'XSS0304',
},
Scale = 0.5,
Type = 'SeaIdle01',
},
},
},
},
Mesh = {
IconFadeInZoom = 130,
LODs = {
{
LODCutoff = 120,
LookupName = '/textures/environment/Falloff_seraphim_lookup.dds',
Scrolling = true,
ShaderName = 'Seraphim',
},
{
AlbedoName = 'tcss0201_lod1_albedo.dds',
LODCutoff = 180,
LookupName = '/textures/environment/Falloff_seraphim_lookup.dds',
ShaderName = 'Seraphim',
SpecularName = 'tcss0201_lod1_specteam.dds',
},
},
},
MovementEffects = {
Water = {
Effects = {
{
Bones = {
'XSS0304',
},
Offset = {
0,
0,
-0.5,
},
Scale = 0.9,
Type = 'BackWake',
},
},
},
},
PlaceholderMeshName = 'UXL0009',
SpawnRandomRotation = true,
UniformScale = 0.04,
},
Economy = {
BuildCostEnergy = 12000,
BuildCostMass = 1000,
BuildTime = 3200,
MaintenanceConsumptionPerSecondEnergy = 200,
TeleportEnergyMod = 0.15,
TeleportMassMod = 1,
TeleportTimeMod = 0.01,
},
CollisionOffsetY = -0,
General = {
Category = 'Ship',
Classification = 'RULEUC_MilitaryShip',
CommandCaps = {
RULEUCC_Attack = false,
RULEUCC_CallTransport = false,
RULEUCC_Capture = false,
RULEUCC_Guard = true,
RULEUCC_Move = true,
RULEUCC_Nuke = false,
RULEUCC_Patrol = true,
RULEUCC_Pause = false,
RULEUCC_Reclaim = false,
RULEUCC_Repair = false,
RULEUCC_RetaliateToggle = false,
RULEUCC_Stop = true,
RULEUCC_Transport = false,
},
FactionName = 'Seraphim',
Icon = 'sea',
TechLevel = 'RULEUTL_Advanced',
UnitName = '<LOC tcss0201_name>Ztheris-ioz',
UnitWeight = 1,
},
Intel = {
VisionRadius = 32,
WaterVisionRadius = 32,
},
Interface = {
HelpText = '<LOC tcss0201_help>Regen Field Generator',
},
LifeBarHeight = 0.075,
LifeBarOffset = 1.5,
LifeBarSize = 0.75,
Physics = {
BackUpDistance = 5,
BankingSlope = 0,
BuildOnLayerCaps = {
LAYER_Air = false,
LAYER_Land = false,
LAYER_Orbit = false,
LAYER_Seabed = false,
LAYER_Sub = false,
LAYER_Water = true,
},
CatchUpAcc = 10,
DragCoefficient = 0.2,
MaxAcceleration = 7,
MaxBrake = 7,
MaxSpeed = 7,
MaxSpeedReverse = 7,
MaxSteerForce = 5,
MeshExtentsX = 2.25,
MeshExtentsY = 2,
MeshExtentsZ = 12,
MinSpeedPercent = 0,
MotionType = 'RULEUMT_Water',
TurnRadius = 10,
TurnRate = 60,
},
RegenAura = {
RegenRadius = 36,
RegenCeiling = 600,
RegenFloor = 0,
RegenPerSecond = 0.005,
},
SelectionSizeX = 0.6,
SelectionSizeZ = 1.8,
SelectionThickness = 0.37,
SizeX = 1,
SizeY = 0.8,
SizeZ = 2.6,
StrategicIconName = 'icon_ship2_shield',
StrategicIconSortPriority = 125,
}
Statistics: Posted by RavenCurow — 05 Jun 2015, 00:56
Statistics: Posted by Ithilis_Quo — 04 Jun 2015, 13:49
AmbientEffects = 'ST2PowerAmbient',
ShieldEffects = {
'/effects/emitters/seraphim_regenerative_aura_01_emit.bp',
},
--OnStopBeingBuilt = function(self,builder,layer)
-- SStructureUnit.OnCreate(self,builder,layer)
-- self:DisableUnitIntel('CloakField')
-- end,
# Copy of XSL0001_script's RegenBuffThread with slight alterations (Enhancement and RegenField)
RegenBuffThread = function(self)
while not self:IsDead() do
# Get friendly units in the area (including self)
local units = AIUtils.GetOwnUnitsAroundPoint(self:GetAIBrain(), categories.ALLUNITS, self:GetPosition(), self:GetBlueprint().RegenAura.RegenRadius)
# Give them a 5 second regen buff
for _,unit in units do
Buff.ApplyBuff(unit, 'SeraphimRegenFieldMoo')
end
#Wait 5 seconds
WaitSeconds(5)
end
end,
OnStopBeingBuilt = function(self)
SStructureUnit.OnStopBeingBuilt(self)
self:SetMaintenanceConsumptionActive()
self:DisableUnitIntel('CloakField')
if not self.ShieldEffectsBag then
self.ShieldEffectsBag = {}
end
self.ShieldEffectsBag = {}
local army = self:GetArmy()
if self.AmbientEffects then
for k, v in EffectTemplate[self.AmbientEffects] do
CreateAttachedEmitter(self, 'XSC2201', army, v):ScaleEmitter(0)
end
end
local bp = self:GetBlueprint().RegenAura
if not Buffs['SeraphimRegenFieldMoo'] then
BuffBlueprint {
Name = 'SeraphimRegenFieldMoo',
DisplayName = 'SeraphimRegenFieldMoo',
BuffType = 'COMMANDERAURA',
Stacks = 'REPLACE',
Duration = 5,
Affects = {
RegenPercent = {
Add = 0,
Mult = bp.RegenPerSecond or 0.1,
Ceil = bp.RegenCeiling,
Floor = bp.RegenFloor,
},
#MaxHealth = {
# Add = 0,
# Mult = bp.MaxHealthFactor or 1.0,
# DoNoFill = true,
#},
},
}
end
table.insert( self.ShieldEffectsBag, CreateAttachedEmitter( self, 'XSC2201', self:GetArmy(), '/effects/emitters/seraphim_regenerative_aura_01_emit.bp' ) )
self.RegenThreadHandle = self:ForkThread(self.RegenBuffThread)
end,
RegenAura = {
RegenRadius = 10,
RegenCeiling = 200,
RegenFloor = 0,
RegenPerSecond = 0.1,
MaxHealthFactor = 1.1,
},
Statistics: Posted by RavenCurow — 02 Jun 2015, 07:31
Statistics: Posted by quark036 — 20 May 2015, 02:23
################### CARRIER BUFF ###############
RegenBuffThread = function(self)
local bp = self:GetBlueprint().Enhancements.RegenAura
local unitCat = ParseEntityCategory( bp.UnitCategory or 'BUILTBYTIER3FACTORY + BUILTBYQUANTUMGATE + NEEDMOBILEBUILD')
while not self:IsDead() do
#Get friendly units in the area (including self)
local units = AIUtils.GetOwnUnitsAroundPoint(self:GetAIBrain(), unitCat, self:GetPosition(), bp.Radius)
#Give them a 5 second regen buff
for _,unit in units do
Buff.ApplyBuff(unit, 'SeraphimACURegenAura')
end
#Wait 5 seconds
WaitSeconds(5)
end
end,
CreateEnhancement = function(self, enh)
SWalkingLandUnit.CreateEnhancement(self, enh)
local bp = self:GetBlueprint().Enhancements[enh]
# Regenerative Aura
if enh == 'RegenAura' then
if not Buffs['SeraphimACURegenAura'] then # AURA BUFF
BuffBlueprint {
Name = 'SeraphimACURegenAura',
DisplayName = 'SeraphimACURegenAura',
BuffType = 'COMMANDERAURA',
Stacks = 'REPLACE',
Duration = 5,
Affects = {
RegenPercent = {
Add = 0,
Mult = bp.RegenPerSecond or 0.1,
Ceil = bp.RegenCeiling,
Floor = bp.RegenFloor,
},
},
}
end
BuffFields = {
RegenField = 'SeraphimACURegenBuffField',
},
RegenAura = {
ACUAddHealth = 1000, #added
BuildCostEnergy = 4500,
BuildCostMass = 600,
BuildTime = 600,
Icon = 'nrf',
Name = '<LOC enhancements_0125>Restoration Field',
Radius = 22, # 15
RegenCeiling = 15, # 75
RegenFloor = 0,
RegenPerSecond = 0.02, # 0.0055555555
UnitCategory = 'BUILTBYTIER3FACTORY, BUILTBYQUANTUMGATE, NEEDMOBILEBUILD', #added
},
Statistics: Posted by Ithilis_Quo — 18 May 2015, 21:55
Statistics: Posted by quark036 — 18 May 2015, 03:02
Statistics: Posted by Ithilis_Quo — 17 May 2015, 00:18