From f21b665eb1ce46f7cecb6e9f48461e33f3ad0893 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 18 Dec 2024 13:42:36 +0000 Subject: [PATCH] Replacing self:GetBlueprint() `self:GetBlueprint()` > `self.Blueprint` --- effects/Entities/SCUDeath01/SCUDeath01_script.lua | 2 +- .../UEFBillyNukeEffect01_script.lua | 2 +- lua/RemoteViewing.lua | 12 ++++++------ lua/ScenarioFramework.lua | 2 +- lua/SimCallbacks.lua | 2 +- lua/sim/Prop.lua | 2 +- lua/sim/Unit.lua | 4 ++-- .../components/SemiBallisticComponent.lua | 2 +- lua/sim/units/SlowAmphibiousLandUnit.lua | 2 +- lua/sim/units/SlowHoverLandUnit.lua | 2 +- .../units/components/TransportUnitComponent.lua | 2 +- lua/sim/units/cybran/CConstructionEggUnit.lua | 4 ++-- lua/sim/units/cybran/CConstructionTemplate.lua | 2 +- lua/sim/units/seraphim/SAirFactoryUnit.lua | 2 +- lua/sim/units/seraphim/SEnergyBallUnit.lua | 6 +++--- lua/sim/units/uef/TMobileFactoryUnit.lua | 4 ++-- lua/sim/units/uef/TPodTowerUnit.lua | 14 +++++++------- lua/sim/weapon.lua | 2 +- lua/sim/weapons/aeon/AQuantumBeamGenerator.lua | 2 +- .../AIFGuidedMissile02_Script.lua | 2 +- projectiles/X1Mercy_proj/X1Mercy_script.lua | 2 +- units/UAS0302/UAS0302_Script.lua | 2 +- units/UAS0401/UAS0401_script.lua | 2 +- units/UEA0104/UEA0104_Script.lua | 4 ++-- units/UEA0107/UEA0107_Script.lua | 4 ++-- units/UEB0203/UEB0203_script.lua | 2 +- units/UEB0303/UEB0303_script.lua | 2 +- units/UEB1101/UEB1101_script.lua | 2 +- units/UEB1103/UEB1103_script.lua | 2 +- units/UEB1104/UEB1104_Script.lua | 2 +- units/UEB1201/UEB1201_script.lua | 2 +- units/UEB1202/UEB1202_script.lua | 2 +- units/UEB1301/UEB1301_script.lua | 2 +- units/UEB1302/UEB1302_script.lua | 2 +- units/UEB4302/UEB4302_script.lua | 2 +- units/UEL0307/UEL0307_script.lua | 4 ++-- units/UEL0401/UEL0401_script.lua | 2 +- units/UES0304/UES0304_script.lua | 4 ++-- units/UES0305/UES0305_script.lua | 2 +- units/UES0401/UES0401_script.lua | 4 ++-- units/URA0104/URA0104_script.lua | 10 +++++----- units/URA0107/URA0107_Script.lua | 8 ++++---- units/URA0401/URA0401_script.lua | 4 ++-- units/URL0402/URL0402_script.lua | 2 +- units/URS0201/URS0201_script.lua | 2 +- units/XSB1103/XSB1103_script.lua | 2 +- units/ZEB9603/ZEB9603_script.lua | 2 +- 47 files changed, 76 insertions(+), 76 deletions(-) diff --git a/effects/Entities/SCUDeath01/SCUDeath01_script.lua b/effects/Entities/SCUDeath01/SCUDeath01_script.lua index cd01020d58..fb3f218dfd 100644 --- a/effects/Entities/SCUDeath01/SCUDeath01_script.lua +++ b/effects/Entities/SCUDeath01/SCUDeath01_script.lua @@ -14,7 +14,7 @@ SCUDeath01 = Class(NullShell) { ---@param self SCUDeath01 OnCreate = function(self) NullShell.OnCreate(self) - local myBlueprint = self:GetBlueprint() + local myBlueprint = self.Blueprint -- Play the "NukeExplosion" sound if myBlueprint.Audio.NukeExplosion then diff --git a/effects/Entities/UEFBillyNukeEffect01/UEFBillyNukeEffect01_script.lua b/effects/Entities/UEFBillyNukeEffect01/UEFBillyNukeEffect01_script.lua index c4a90fb888..637eed587d 100644 --- a/effects/Entities/UEFBillyNukeEffect01/UEFBillyNukeEffect01_script.lua +++ b/effects/Entities/UEFBillyNukeEffect01/UEFBillyNukeEffect01_script.lua @@ -11,7 +11,7 @@ UEFNukeEffect01 = Class(NullShell) { ---@param self UEFNukeEffect01 EffectThread = function(self) - local scale = self:GetBlueprint().Display.UniformScale + local scale = self.Blueprint.Display.UniformScale local scaleChange = 0.30 * scale self:SetScaleVelocity(scaleChange,scaleChange,scaleChange) diff --git a/lua/RemoteViewing.lua b/lua/RemoteViewing.lua index 4cdceb093a..1afefc6f96 100644 --- a/lua/RemoteViewing.lua +++ b/lua/RemoteViewing.lua @@ -21,7 +21,7 @@ function RemoteViewing(SuperClass) end, OnStopBeingBuilt = function(self,builder,layer) - self.Sync.Abilities = self:GetBlueprint().Abilities + self.Sync.Abilities = self.Blueprint.Abilities self:SetMaintenanceConsumptionInactive() SuperClass.OnStopBeingBuilt(self,builder,layer) end, @@ -35,19 +35,19 @@ function RemoteViewing(SuperClass) end, DisableRemoteViewingButtons = function(self) - self.Sync.Abilities = self:GetBlueprint().Abilities + self.Sync.Abilities = self.Blueprint.Abilities self.Sync.Abilities.TargetLocation.Active = false self:RemoveToggleCap('RULEUTC_IntelToggle') end, EnableRemoteViewingButtons = function(self) - self.Sync.Abilities = self:GetBlueprint().Abilities + self.Sync.Abilities = self.Blueprint.Abilities self.Sync.Abilities.TargetLocation.Active = true self:AddToggleCap('RULEUTC_IntelToggle') end, TargetLocationThread = function(self) - local Cost = CreateEconomyEvent(self, self:GetBlueprint().Economy.InitialRemoteViewingEnergyDrain * (self.EnergyMaintAdjMod or 1), 0, 1, self.SetWorkProgress) + local Cost = CreateEconomyEvent(self, self.Blueprint.Economy.InitialRemoteViewingEnergyDrain * (self.EnergyMaintAdjMod or 1), 0, 1, self.SetWorkProgress) WaitFor(Cost) self:SetWorkProgress(0.0) RemoveEconomyEvent(self, Cost) @@ -74,7 +74,7 @@ function RemoteViewing(SuperClass) end if self.RemoteViewingData.VisibleLocation and self.RemoteViewingData.DisableCounter == 0 and self.RemoteViewingData.IntelButton then - local bp = self:GetBlueprint() + local bp = self.Blueprint self:SetMaintenanceConsumptionActive() -- Create new visible area if not self.RemoteViewingData.Satellite then @@ -156,7 +156,7 @@ function RemoteViewing(SuperClass) end, EnableResourceMonitor = function(self) - local recharge = self:GetBlueprint().Intel.ReactivateTime or 10 + local recharge = self.Blueprint.Intel.ReactivateTime or 10 WaitSeconds(recharge) self.RemoteViewingData.DisableCounter = self.RemoteViewingData.DisableCounter - 1 self:CreateVisibleEntity() diff --git a/lua/ScenarioFramework.lua b/lua/ScenarioFramework.lua index 3b4e1797ef..754ac30be8 100644 --- a/lua/ScenarioFramework.lua +++ b/lua/ScenarioFramework.lua @@ -216,7 +216,7 @@ function OverrideKilled(self, instigator, type, overkillRatio) end self.Dead = true - local bp = self:GetBlueprint() + local bp = self.Blueprint if self.Layer == 'Water' and bp.Physics.MotionType == 'RULEUMT_Hover' then self:PlayUnitSound('HoverKilledOnWater') end diff --git a/lua/SimCallbacks.lua b/lua/SimCallbacks.lua index 824e7a6522..4b50a18637 100644 --- a/lua/SimCallbacks.lua +++ b/lua/SimCallbacks.lua @@ -881,7 +881,7 @@ local function SetWorldCameraToUnitIconAngle(location, zoom) end local function ShowRaisedPlatforms(self) - local plats = self:GetBlueprint().Physics.RaisedPlatforms + local plats = self.Blueprint.Physics.RaisedPlatforms if not plats then return end local pos = self:GetPosition() local entities = {} diff --git a/lua/sim/Prop.lua b/lua/sim/Prop.lua index f78a189152..a602268656 100644 --- a/lua/sim/Prop.lua +++ b/lua/sim/Prop.lua @@ -32,7 +32,7 @@ Prop = Class(moho.prop_methods) { -- caching self.Trash = TrashBag() self.EntityId = self:GetEntityId() - self.Blueprint = self:GetBlueprint() + self.Blueprint = self.Blueprint self.CachePosition = self:GetPosition() -- set reclaim values diff --git a/lua/sim/Unit.lua b/lua/sim/Unit.lua index 2537e59a22..20ea624f93 100644 --- a/lua/sim/Unit.lua +++ b/lua/sim/Unit.lua @@ -246,7 +246,7 @@ Unit = ClassUnit(moho.unit_methods, IntelComponent, VeterancyComponent, DebugUni ---@param self Unit OnCreate = function(self) - local bp = self:GetBlueprint() + local bp = self.Blueprint -- cache often accessed values into inner table self.Blueprint = bp @@ -5461,7 +5461,7 @@ DummyUnit = ClassDummyUnit(moho.unit_methods, DebugUnitComponent) { self.Layer = UnitGetCurrentLayer(self) -- cache often accessed values into inner table - self.Blueprint = self:GetBlueprint() + self.Blueprint = self.Blueprint end, --- Typically called by functions diff --git a/lua/sim/projectiles/components/SemiBallisticComponent.lua b/lua/sim/projectiles/components/SemiBallisticComponent.lua index a238b424d8..ce33167f8a 100644 --- a/lua/sim/projectiles/components/SemiBallisticComponent.lua +++ b/lua/sim/projectiles/components/SemiBallisticComponent.lua @@ -167,7 +167,7 @@ SemiBallisticComponent = ClassSimple { ---@return number AverageVerticalVelocityThroughTurn = function(self, targetAngle, currentAngle) local averageVerticalVelocity = 1/(targetAngle-currentAngle) * (MathCos(currentAngle) - MathCos(targetAngle)) - averageVerticalVelocity = averageVerticalVelocity * self:GetBlueprint().Physics.MaxSpeed + averageVerticalVelocity = averageVerticalVelocity * self.Blueprint.Physics.MaxSpeed return averageVerticalVelocity end, diff --git a/lua/sim/units/SlowAmphibiousLandUnit.lua b/lua/sim/units/SlowAmphibiousLandUnit.lua index 64a0bd0f19..1eacbdead1 100644 --- a/lua/sim/units/SlowAmphibiousLandUnit.lua +++ b/lua/sim/units/SlowAmphibiousLandUnit.lua @@ -34,7 +34,7 @@ SlowAmphibiousLandUnit = ClassUnit(AmphibiousLandUnit) { -- the layer change is called before `OnCreate` is when a unit is created, hence the field `self.Blueprint` may not exist - local mult = (self.Blueprint or self:GetBlueprint()).Physics.WaterSpeedMultiplier + local mult = (self.Blueprint or self.Blueprint).Physics.WaterSpeedMultiplier if new == 'Seabed' then self:SetSpeedMult(mult) else diff --git a/lua/sim/units/SlowHoverLandUnit.lua b/lua/sim/units/SlowHoverLandUnit.lua index 005a6fb0f8..d5e6a6bca2 100644 --- a/lua/sim/units/SlowHoverLandUnit.lua +++ b/lua/sim/units/SlowHoverLandUnit.lua @@ -38,7 +38,7 @@ SlowHoverLandUnit = ClassUnit(HoverLandUnit) { -- The mult is applied twice thanks to an engine bug, so careful when adjusting it -- Newspeed = oldspeed * mult * mult - local mult = (self.Blueprint or self:GetBlueprint()).Physics.WaterSpeedMultiplier + local mult = (self.Blueprint or self.Blueprint).Physics.WaterSpeedMultiplier if new == 'Water' then self:SetSpeedMult(mult) else diff --git a/lua/sim/units/components/TransportUnitComponent.lua b/lua/sim/units/components/TransportUnitComponent.lua index b243a66392..fde12c46d7 100644 --- a/lua/sim/units/components/TransportUnitComponent.lua +++ b/lua/sim/units/components/TransportUnitComponent.lua @@ -90,7 +90,7 @@ BaseTransport = ClassSimple { -- We need to determine how to handle the cargo -- Units in internal storage are just killed/destroyed, and relevant numbers tallied up -- Units in external storage have anims, effects, etc. and OnImpact is called for them - if damageType == "TransportDamage" or self:GetBlueprint().Transport.StorageSlots ~= 0 then + if damageType == "TransportDamage" or self.Blueprint.Transport.StorageSlots ~= 0 then cargoDamageType = "TransportDamage" -- This damage type makes sure we skip death effects for internal cargo cacheCargo = false else diff --git a/lua/sim/units/cybran/CConstructionEggUnit.lua b/lua/sim/units/cybran/CConstructionEggUnit.lua index e0e71fa209..4391e7cb50 100644 --- a/lua/sim/units/cybran/CConstructionEggUnit.lua +++ b/lua/sim/units/cybran/CConstructionEggUnit.lua @@ -35,7 +35,7 @@ CConstructionEggUnit = ClassUnit(CStructureUnit) { -- prevent the unit from being reclaimed self:SetReclaimable(false) - local bp = self:GetBlueprint() + local bp = self.Blueprint local buildUnit = bp.Economy.BuildUnit local pos = self:GetPosition() local aiBrain = self:GetAIBrain() @@ -51,7 +51,7 @@ CConstructionEggUnit = ClassUnit(CStructureUnit) { self:ForkThread(function() self.OpenAnimManip = CreateAnimator(self) self.Trash:Add(self.OpenAnimManip) - self.OpenAnimManip:PlayAnim(self:GetBlueprint().Display.AnimationOpen, false):SetRate(0.1) + self.OpenAnimManip:PlayAnim(self.Blueprint.Display.AnimationOpen, false):SetRate(0.1) self:PlaySound(bp.Audio['EggOpen']) WaitFor(self.OpenAnimManip) diff --git a/lua/sim/units/cybran/CConstructionTemplate.lua b/lua/sim/units/cybran/CConstructionTemplate.lua index 77b5528a00..abc53b658e 100644 --- a/lua/sim/units/cybran/CConstructionTemplate.lua +++ b/lua/sim/units/cybran/CConstructionTemplate.lua @@ -44,7 +44,7 @@ CConstructionTemplate = ClassSimple { ---@param self CConstructionTemplate OnCreate = function(self) -- cache the total amount of drones - self.BuildBotTotal = self:GetBlueprint().BuildBotTotal or + self.BuildBotTotal = self.Blueprint.BuildBotTotal or math.min(math.ceil((10 + self:GetBuildRate()) / 15), 10) end, diff --git a/lua/sim/units/seraphim/SAirFactoryUnit.lua b/lua/sim/units/seraphim/SAirFactoryUnit.lua index 710cbf09fa..aaea8e0e8d 100644 --- a/lua/sim/units/seraphim/SAirFactoryUnit.lua +++ b/lua/sim/units/seraphim/SAirFactoryUnit.lua @@ -53,7 +53,7 @@ SAirFactoryUnit = ClassUnit(AirFactoryUnit) { self:SetBlockCommandQueue(true) if unitBeingBuilt and not unitBeingBuilt.Dead and EntityCategoryContains(categories.AIR, unitBeingBuilt) then unitBeingBuilt:DetachFrom(true) - local bp = self:GetBlueprint() + local bp = self.Blueprint self:DetachAll(bp.Display.BuildAttachBone or 0) end diff --git a/lua/sim/units/seraphim/SEnergyBallUnit.lua b/lua/sim/units/seraphim/SEnergyBallUnit.lua index 726bd37356..7d5e1baefd 100644 --- a/lua/sim/units/seraphim/SEnergyBallUnit.lua +++ b/lua/sim/units/seraphim/SEnergyBallUnit.lua @@ -39,12 +39,12 @@ SEnergyBallUnit = ClassUnit(SHoverLandUnit) { KillingState = State { LifeThread = function(self) - WaitSeconds(self:GetBlueprint().Lifetime) + WaitSeconds(self.Blueprint.Lifetime) ChangeState(self, self.DeathState) end, Main = function(self) - local bp = self:GetBlueprint() + local bp = self.Blueprint local aiBrain = self:GetAIBrain() -- Queue up random moves @@ -92,7 +92,7 @@ SEnergyBallUnit = ClassUnit(SHoverLandUnit) { end, ComputeWaitTime = function(self) - local timeLeft = self:GetBlueprint().Lifetime - self.timeAlive + local timeLeft = self.Blueprint.Lifetime - self.timeAlive local maxWait = 75 if timeLeft < 7.5 and timeLeft > 2.5 then diff --git a/lua/sim/units/uef/TMobileFactoryUnit.lua b/lua/sim/units/uef/TMobileFactoryUnit.lua index 9d89451811..9eceafed9e 100644 --- a/lua/sim/units/uef/TMobileFactoryUnit.lua +++ b/lua/sim/units/uef/TMobileFactoryUnit.lua @@ -29,8 +29,8 @@ TMobileFactoryUnit = ClassUnit(AmphibiousLandUnit) { ---@param builder Unit ---@param layer Layer StartBeingBuiltEffects = function(self, builder, layer) - self:SetMesh(self:GetBlueprint().Display.BuildMeshBlueprint, true) - if self:GetBlueprint().General.UpgradesFrom ~= builder.UnitId then + self:SetMesh(self.Blueprint.Display.BuildMeshBlueprint, true) + if self.Blueprint.General.UpgradesFrom ~= builder.UnitId then self:HideBone(0, true) self.OnBeingBuiltEffectsBag:Add(self:ForkThread(CreateBuildCubeThread, builder, self.OnBeingBuiltEffectsBag)) end diff --git a/lua/sim/units/uef/TPodTowerUnit.lua b/lua/sim/units/uef/TPodTowerUnit.lua index 1f68251b9e..ff94d0acd9 100644 --- a/lua/sim/units/uef/TPodTowerUnit.lua +++ b/lua/sim/units/uef/TPodTowerUnit.lua @@ -100,7 +100,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) { ---@param order string OnStartBuild = function(self, unitBeingBuilt, order) TStructureUnit.OnStartBuild(self, unitBeingBuilt, order) - local unitid = self:GetBlueprint().General.UpgradesTo + local unitid = self.Blueprint.General.UpgradesTo if unitBeingBuilt.UnitId == unitid and order == 'Upgrade' then self.NowUpgrading = true ChangeState(self, self.UpgradingState) @@ -116,7 +116,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) { ---@param self TPodTowerUnit ---@param podData any SetPodConsumptionRebuildRate = function(self, podData) - local bp = self:GetBlueprint() + local bp = self.Blueprint -- Get build rate of tower local buildRate = bp.Economy.BuildRate @@ -160,7 +160,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) { PodAttached = PodAttached + 1 end if PodAttached == PodPresent and self.OpeningAnimationStarted then - local bp = self:GetBlueprint() + local bp = self.Blueprint if not self.OpenAnim then return end self.OpenAnim:SetRate(1.5) self.OpeningAnimationStarted = false @@ -177,7 +177,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) { self:RequestRefreshUI() if not self.OpeningAnimationStarted then self.OpeningAnimationStarted = true - local bp = self:GetBlueprint() + local bp = self.Blueprint if not self.OpenAnim then self.OpenAnim = CreateAnimator(self) self.Trash:Add(self.OpenAnim) @@ -198,7 +198,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) { -- This pod may have to be passed to another unit after it upgrades. We cannot let the trash clean it up -- when this unit is destroyed at the tail end of the upgrade. Make sure the unit dies properly elsewhere. self.TowerCaptured = nil - local bp = self:GetBlueprint() + local bp = self.Blueprint for _, v in bp.Economy.EngineeringPods do if v.CreateWithUnit and not self.PodData[v.PodName].Active then if not self.PodData then @@ -230,7 +230,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) { self:SetPodConsumptionRebuildRate(self.PodData[self.Rebuilding]) ChangeState(self, self.RebuildingPodState) end - local bp = self:GetBlueprint() + local bp = self.Blueprint while true and not self.Rebuilding do for _, v in bp.Economy.EngineeringPods do -- Check if all the pods are active @@ -325,7 +325,7 @@ TPodTowerUnit = ClassUnit(TStructureUnit) { self:InitializeTower() end - local bp = self:GetBlueprint().Display + local bp = self.Blueprint.Display self:DestroyTarmac() self:PlayUnitSound('UpgradeStart') self:DisableDefaultToggleCaps() diff --git a/lua/sim/weapon.lua b/lua/sim/weapon.lua index a2dceee73b..93f19d3bb1 100644 --- a/lua/sim/weapon.lua +++ b/lua/sim/weapon.lua @@ -102,7 +102,7 @@ Weapon = ClassWeapon(WeaponMethods, DebugWeaponComponent) { ---@param self Weapon OnCreate = function(self) -- Store blueprint for improved access pattern, see benchmark on blueprints - local bp = self:GetBlueprint() + local bp = self.Blueprint self.Blueprint = bp -- Legacy information stored for backwards compatibility diff --git a/lua/sim/weapons/aeon/AQuantumBeamGenerator.lua b/lua/sim/weapons/aeon/AQuantumBeamGenerator.lua index 9481124761..f1fdfc0079 100644 --- a/lua/sim/weapons/aeon/AQuantumBeamGenerator.lua +++ b/lua/sim/weapons/aeon/AQuantumBeamGenerator.lua @@ -32,7 +32,7 @@ AQuantumBeamGenerator = ClassWeapon(DefaultBeamWeapon) { ---@param self AQuantumBeamGenerator PlayFxWeaponUnpackSequence = function(self) - local bp = self:GetBlueprint() + local bp = self.Blueprint for _, v in self.FxUpackingChargeEffects do for i, j in bp.RackBones[self.CurrentRackSalvoNumber].MuzzleBones do CreateAttachedEmitter(self.unit, j, self.unit.Army, v):ScaleEmitter(self.FxUpackingChargeEffectScale) diff --git a/projectiles/AIFGuidedMissile02/AIFGuidedMissile02_Script.lua b/projectiles/AIFGuidedMissile02/AIFGuidedMissile02_Script.lua index f23cd169a5..3a274555df 100644 --- a/projectiles/AIFGuidedMissile02/AIFGuidedMissile02_Script.lua +++ b/projectiles/AIFGuidedMissile02/AIFGuidedMissile02_Script.lua @@ -12,7 +12,7 @@ local VisionMarker = import("/lua/sim/vizmarker.lua").VisionMarkerOpti AIFGuidedMissile02 = ClassProjectile(AGuidedMissileProjectile) { OnImpact = function(self, TargetType, TargetEntity) - local bp = self:GetBlueprint().Audio + local bp = self.Blueprint.Audio local snd = bp['Impact' .. TargetType] if snd then self:PlaySound(snd) diff --git a/projectiles/X1Mercy_proj/X1Mercy_script.lua b/projectiles/X1Mercy_proj/X1Mercy_script.lua index f9d0aba239..ae2b38c90a 100644 --- a/projectiles/X1Mercy_proj/X1Mercy_script.lua +++ b/projectiles/X1Mercy_proj/X1Mercy_script.lua @@ -43,7 +43,7 @@ X1Mercy = Class(AMiasmaProjectile) { --WARN(tostring(TargetType) .. " - " .. tostring(TargetEntity)) --Sounds for all other impacts, ie: Impact - local bp = self:GetBlueprint().Audio + local bp = self.Blueprint.Audio local snd = bp['Impact'.. TargetType] if snd then self:PlaySound(snd) diff --git a/units/UAS0302/UAS0302_Script.lua b/units/UAS0302/UAS0302_Script.lua index 2b8c3f614d..3176147291 100644 --- a/units/UAS0302/UAS0302_Script.lua +++ b/units/UAS0302/UAS0302_Script.lua @@ -19,7 +19,7 @@ UAS0302 = ClassUnit(ASeaUnit) { OnCreate = function(self) ASeaUnit.OnCreate(self) for i = 1, 3 do - self.Trash:Add(CreateAnimator(self):PlayAnim(self:GetBlueprint().Weapon[i].AnimationOpen)) + self.Trash:Add(CreateAnimator(self):PlayAnim(self.Blueprint.Weapon[i].AnimationOpen)) end end, } diff --git a/units/UAS0401/UAS0401_script.lua b/units/UAS0401/UAS0401_script.lua index 1b8b3f1c2f..919feaa546 100644 --- a/units/UAS0401/UAS0401_script.lua +++ b/units/UAS0401/UAS0401_script.lua @@ -212,7 +212,7 @@ UAS0401 = ClassUnit(ASeaUnit, ExternalFactoryComponent) { OnKilled = function(self, instigator, type, overkillRatio) ExternalFactoryComponent.OnKilled(self, instigator, type, overkillRatio) - local watchBone = self:GetBlueprint().WatchBone or 0 + local watchBone = self.Blueprint.WatchBone or 0 self:ForkThread(function() local pos = self:GetPosition() diff --git a/units/UEA0104/UEA0104_Script.lua b/units/UEA0104/UEA0104_Script.lua index 70e0ab99e4..de38c8a6a6 100644 --- a/units/UEA0104/UEA0104_Script.lua +++ b/units/UEA0104/UEA0104_Script.lua @@ -49,7 +49,7 @@ UEA0104 = ClassUnit(AirTransport) { self.LandingAnimManip = CreateAnimator(self) self.LandingAnimManip:SetPrecedence(0) self.Trash:Add(self.LandingAnimManip) - self.LandingAnimManip:PlayAnim(self:GetBlueprint().Display.AnimationLand):SetRate(1) + self.LandingAnimManip:PlayAnim(self.Blueprint.Display.AnimationLand):SetRate(1) self:ForkThread(self.ExpandThread) end, @@ -110,7 +110,7 @@ UEA0104 = ClassUnit(AirTransport) { end, GetUnitSizes = function(self) - local bp = self:GetBlueprint() + local bp = self.Blueprint if self:GetFractionComplete() < 1.0 then return bp.SizeX, bp.SizeY, bp.SizeZ * 0.5 else diff --git a/units/UEA0107/UEA0107_Script.lua b/units/UEA0107/UEA0107_Script.lua index f368e643d1..3ee956b0e6 100644 --- a/units/UEA0107/UEA0107_Script.lua +++ b/units/UEA0107/UEA0107_Script.lua @@ -43,7 +43,7 @@ UEA0107 = ClassUnit(AirTransport) { self.LandingAnimManip = CreateAnimator(self) self.LandingAnimManip:SetPrecedence(0) self.Trash:Add(self.LandingAnimManip) - self.LandingAnimManip:PlayAnim(self:GetBlueprint().Display.AnimationLand):SetRate(1) + self.LandingAnimManip:PlayAnim(self.Blueprint.Display.AnimationLand):SetRate(1) self:ForkThread(self.ExpandThread) end, @@ -99,7 +99,7 @@ UEA0107 = ClassUnit(AirTransport) { end, GetUnitSizes = function(self) - local bp = self:GetBlueprint() + local bp = self.Blueprint if self:GetFractionComplete() < 1.0 then return bp.SizeX, bp.SizeY, bp.SizeZ * 0.5 else diff --git a/units/UEB0203/UEB0203_script.lua b/units/UEB0203/UEB0203_script.lua index 876d75334c..ecf858e670 100644 --- a/units/UEB0203/UEB0203_script.lua +++ b/units/UEB0203/UEB0203_script.lua @@ -14,7 +14,7 @@ local TSeaFactoryUnit = import("/lua/terranunits.lua").TSeaFactoryUnit UEB0203 = ClassUnit(TSeaFactoryUnit) { OnCreate = function(self) TSeaFactoryUnit.OnCreate(self) - self.BuildPointSlider = CreateSlider(self, self:GetBlueprint().Display.BuildAttachBone or 0, -5, 0, 0, -1) + self.BuildPointSlider = CreateSlider(self, self.Blueprint.Display.BuildAttachBone or 0, -5, 0, 0, -1) self.Trash:Add(self.BuildPointSlider) end, diff --git a/units/UEB0303/UEB0303_script.lua b/units/UEB0303/UEB0303_script.lua index 1f7cf4cd99..64853ae710 100644 --- a/units/UEB0303/UEB0303_script.lua +++ b/units/UEB0303/UEB0303_script.lua @@ -14,7 +14,7 @@ local TSeaFactoryUnit = import("/lua/terranunits.lua").TSeaFactoryUnit UEB0303 = ClassUnit(TSeaFactoryUnit) { OnCreate = function(self) TSeaFactoryUnit.OnCreate(self) - self.BuildPointSlider = CreateSlider(self, self:GetBlueprint().Display.BuildAttachBone or 0, -15, 0, 0, -1) + self.BuildPointSlider = CreateSlider(self, self.Blueprint.Display.BuildAttachBone or 0, -15, 0, 0, -1) self.Trash:Add(self.BuildPointSlider) end, diff --git a/units/UEB1101/UEB1101_script.lua b/units/UEB1101/UEB1101_script.lua index 766ccd455e..8b253907b5 100644 --- a/units/UEB1101/UEB1101_script.lua +++ b/units/UEB1101/UEB1101_script.lua @@ -50,7 +50,7 @@ UEB1101 = ClassUnit(TEnergyCreationUnit) { OpeningState = State { Main = function(self) - local bp = self:GetBlueprint() + local bp = self.Blueprint if bp.Audio.Activate then self:PlaySound(bp.Audio.Activate) end diff --git a/units/UEB1103/UEB1103_script.lua b/units/UEB1103/UEB1103_script.lua index 80c4d6821b..cc4de3c7d1 100644 --- a/units/UEB1103/UEB1103_script.lua +++ b/units/UEB1103/UEB1103_script.lua @@ -27,7 +27,7 @@ UEB1103 = ClassUnit(TMassCollectionUnit) { self.AnimationManipulator = CreateAnimator(self) self.Trash:Add(self.AnimationManipulator) end - self.AnimationManipulator:PlayAnim(self:GetBlueprint().Display.AnimationOpen, true) + self.AnimationManipulator:PlayAnim(self.Blueprint.Display.AnimationOpen, true) end, OnProductionPaused = function(self) diff --git a/units/UEB1104/UEB1104_Script.lua b/units/UEB1104/UEB1104_Script.lua index e680c60944..12ad880640 100644 --- a/units/UEB1104/UEB1104_Script.lua +++ b/units/UEB1104/UEB1104_Script.lua @@ -49,7 +49,7 @@ UEB1104 = ClassUnit(TMassFabricationUnit) { ActiveState = State { Main = function(self) - local myBlueprint = self:GetBlueprint() + local myBlueprint = self.Blueprint -- Play the "activate" sound if myBlueprint.Audio.Activate then diff --git a/units/UEB1201/UEB1201_script.lua b/units/UEB1201/UEB1201_script.lua index 21ab8b80eb..5de089f414 100644 --- a/units/UEB1201/UEB1201_script.lua +++ b/units/UEB1201/UEB1201_script.lua @@ -20,7 +20,7 @@ UEB1201 = ClassUnit(TEnergyCreationUnit) { ActiveState = State { Main = function(self) -- Play the "Activate" sound - local myBlueprint = self:GetBlueprint() + local myBlueprint = self.Blueprint if myBlueprint.Audio.Activate then self:PlaySound(myBlueprint.Audio.Activate) end diff --git a/units/UEB1202/UEB1202_script.lua b/units/UEB1202/UEB1202_script.lua index 522120cda9..67f60102fe 100644 --- a/units/UEB1202/UEB1202_script.lua +++ b/units/UEB1202/UEB1202_script.lua @@ -27,7 +27,7 @@ UEB1202 = ClassUnit(TMassCollectionUnit) { self.AnimationManipulator = CreateAnimator(self) self.Trash:Add(self.AnimationManipulator) end - self.AnimationManipulator:PlayAnim(self:GetBlueprint().Display.AnimationOpen, true) + self.AnimationManipulator:PlayAnim(self.Blueprint.Display.AnimationOpen, true) end, OnProductionPaused = function(self) diff --git a/units/UEB1301/UEB1301_script.lua b/units/UEB1301/UEB1301_script.lua index c1dbd7a19f..34c603c384 100644 --- a/units/UEB1301/UEB1301_script.lua +++ b/units/UEB1301/UEB1301_script.lua @@ -20,7 +20,7 @@ UEB1301 = ClassUnit(TEnergyCreationUnit) { ActiveState = State { Main = function(self) -- Play the "activate" sound - local myBlueprint = self:GetBlueprint() + local myBlueprint = self.Blueprint if myBlueprint.Audio.Activate then self:PlaySound(myBlueprint.Audio.Activate) end diff --git a/units/UEB1302/UEB1302_script.lua b/units/UEB1302/UEB1302_script.lua index ef654e74a0..802c5b2431 100644 --- a/units/UEB1302/UEB1302_script.lua +++ b/units/UEB1302/UEB1302_script.lua @@ -20,7 +20,7 @@ UEB1302 = ClassUnit(TMassCollectionUnit) { self.AnimationManipulator = CreateAnimator(self) self.Trash:Add(self.AnimationManipulator) end - self.AnimationManipulator:PlayAnim(self:GetBlueprint().Display.AnimationOpen, true) + self.AnimationManipulator:PlayAnim(self.Blueprint.Display.AnimationOpen, true) end, OnStartBuild = function(self, unitBeingBuilt, order) diff --git a/units/UEB4302/UEB4302_script.lua b/units/UEB4302/UEB4302_script.lua index 3d03ba7e84..8f8ab3dd05 100644 --- a/units/UEB4302/UEB4302_script.lua +++ b/units/UEB4302/UEB4302_script.lua @@ -18,7 +18,7 @@ UEB4302 = ClassUnit(TStructureUnit) { AntiNuke = ClassWeapon(TAMInterceptorWeapon) { IdleState = State(TAMInterceptorWeapon.IdleState) { OnGotTarget = function(self) - local bp = self:GetBlueprint() + local bp = self.Blueprint --only say we've fired if the parent fire conditions are met if (bp.WeaponUnpackLockMotion != true or (bp.WeaponUnpackLocksMotion == true and not self.unit:IsUnitState('Moving'))) then if (bp.CountedProjectile == false) or self:CanFire() then diff --git a/units/UEL0307/UEL0307_script.lua b/units/UEL0307/UEL0307_script.lua index c0d181eed8..a0cf154faf 100644 --- a/units/UEL0307/UEL0307_script.lua +++ b/units/UEL0307/UEL0307_script.lua @@ -34,7 +34,7 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { TShieldLandUnit.OnStopBeingBuilt(self, builder, layer) self.TargetPointer = self:GetWeapon(1) --save the pointer weapon for later - this is extra clever since the pointer weapon has to be first! - self.TargetLayerCaps = self:GetBlueprint().Weapon[1].FireTargetLayerCapsTable --we save this to the unit table so dont have to call every time. + self.TargetLayerCaps = self.Blueprint.Weapon[1].FireTargetLayerCapsTable --we save this to the unit table so dont have to call every time. self.PointerEnabled = true --a flag to let our thread know whether we should turn on our pointer. end, @@ -50,7 +50,7 @@ UEL0307 = ClassUnit(TShieldLandUnit, ShieldEffectsComponent) { self.RotatorManipulator:SetAccel(5) self.RotatorManipulator:SetTargetSpeed(30) if not self.AnimationManipulator then - local myBlueprint = self:GetBlueprint() + local myBlueprint = self.Blueprint self.AnimationManipulator = CreateAnimator(self) self.AnimationManipulator:PlayAnim(myBlueprint.Display.AnimationOpen) self.Trash:Add(self.AnimationManipulator) diff --git a/units/UEL0401/UEL0401_script.lua b/units/UEL0401/UEL0401_script.lua index 58156e03b9..8ca2ce7748 100644 --- a/units/UEL0401/UEL0401_script.lua +++ b/units/UEL0401/UEL0401_script.lua @@ -80,7 +80,7 @@ UEL0401 = ClassUnit(TMobileFactoryUnit, ExternalFactoryComponent) { TMobileFactoryUnit.OnStopBeingBuilt(self, builder, layer) ExternalFactoryComponent.OnStopBeingBuilt(self, builder, layer) self.PrepareToBuildManipulator = CreateAnimator(self) - self.PrepareToBuildManipulator:PlayAnim(self:GetBlueprint().Display.AnimationBuild, false):SetRate(0) + self.PrepareToBuildManipulator:PlayAnim(self.Blueprint.Display.AnimationBuild, false):SetRate(0) self.ReleaseEffectsBag = {} self.AttachmentSliderManip = CreateSlider(self, self.BuildAttachBone) ChangeState(self, self.IdleState) diff --git a/units/UES0304/UES0304_script.lua b/units/UES0304/UES0304_script.lua index ea0519685b..cbd1c3237d 100644 --- a/units/UES0304/UES0304_script.lua +++ b/units/UES0304/UES0304_script.lua @@ -18,7 +18,7 @@ UES0304 = ClassUnit(TSubUnit) { CruiseMissiles = ClassWeapon(TIFCruiseMissileLauncherSub) { PlayFxMuzzleChargeSequence = function(self, muzzle) --We don't need to wait for the rotator to finish because MuzzleChargeDelay = 1 in the bp will do that for us. - self.Rotator = CreateRotator(self.unit, self:GetBlueprint().RackBones[self.CurrentRackSalvoNumber].RackBone, 'z', 90, 90, 90, 90) + self.Rotator = CreateRotator(self.unit, self.Blueprint.RackBones[self.CurrentRackSalvoNumber].RackBone, 'z', 90, 90, 90, 90) TIFCruiseMissileLauncherSub.PlayFxMuzzleChargeSequence(self, muzzle) end, @@ -40,7 +40,7 @@ UES0304 = ClassUnit(TSubUnit) { PlayFxMuzzleChargeSequence = function(self, muzzle) --We don't need to wait for the rotator to finish because MuzzleChargeDelay = 1 in the bp will do that for us. - self.Rotator = CreateRotator(self.unit, self:GetBlueprint().RackBones[self.CurrentRackSalvoNumber].RackBone, 'z', 90, 90, 90, 90) + self.Rotator = CreateRotator(self.unit, self.Blueprint.RackBones[self.CurrentRackSalvoNumber].RackBone, 'z', 90, 90, 90, 90) TIFCruiseMissileLauncherSub.PlayFxMuzzleChargeSequence(self, muzzle) end, diff --git a/units/UES0305/UES0305_script.lua b/units/UES0305/UES0305_script.lua index 444a68f1e3..a6c3fb47bf 100644 --- a/units/UES0305/UES0305_script.lua +++ b/units/UES0305/UES0305_script.lua @@ -67,7 +67,7 @@ UES0305 = ClassUnit(TSeaUnit) { StartBeingBuiltEffects = function(self, builder, layer) self:HideBone(0, true) self.BeingBuiltShowBoneTriggered = false - if self:GetBlueprint().General.UpgradesFrom ~= builder.UnitId then + if self.Blueprint.General.UpgradesFrom ~= builder.UnitId then self.OnBeingBuiltEffectsBag:Add(self:ForkThread(CreateBuildCubeThread, builder, self.OnBeingBuiltEffectsBag)) end end, diff --git a/units/UES0401/UES0401_script.lua b/units/UES0401/UES0401_script.lua index 13ccbb0f30..1fb7fa6597 100644 --- a/units/UES0401/UES0401_script.lua +++ b/units/UES0401/UES0401_script.lua @@ -51,8 +51,8 @@ UES0401 = ClassUnit(AircraftCarrier, ExternalFactoryComponent) { end, StartBeingBuiltEffects = function(self, builder, layer) - self:SetMesh(self:GetBlueprint().Display.BuildMeshBlueprint, true) - if self:GetBlueprint().General.UpgradesFrom ~= builder.UnitId then + self:SetMesh(self.Blueprint.Display.BuildMeshBlueprint, true) + if self.Blueprint.General.UpgradesFrom ~= builder.UnitId then self:HideBone(0, true) self.OnBeingBuiltEffectsBag:Add(self:ForkThread(CreateBuildCubeThread, builder, self.OnBeingBuiltEffectsBag)) end diff --git a/units/URA0104/URA0104_script.lua b/units/URA0104/URA0104_script.lua index bc1fe46580..bbbe3d1bb5 100644 --- a/units/URA0104/URA0104_script.lua +++ b/units/URA0104/URA0104_script.lua @@ -35,7 +35,7 @@ URA0104 = ClassUnit(AirTransport) { AirTransport.OnCreate(self) if not self.OpenAnim then self.OpenAnim = CreateAnimator(self) - self.OpenAnim:PlayAnim(self:GetBlueprint().Display.AnimationOpen, false):SetRate(0) + self.OpenAnim:PlayAnim(self.Blueprint.Display.AnimationOpen, false):SetRate(0) self.Trash:Add(self.OpenAnim) end end, @@ -44,12 +44,12 @@ URA0104 = ClassUnit(AirTransport) { AirTransport.OnStopBeingBuilt(self,builder,layer) self.AnimManip = CreateAnimator(self) self.Trash:Add(self.AnimManip) - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationTakeOff, false):SetRate(1) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationTakeOff, false):SetRate(1) if not self.OpenAnim then self.OpenAnim = CreateAnimator(self) self.Trash:Add(self.OpenAnim) end - self.OpenAnim:PlayAnim(self:GetBlueprint().Display.AnimationOpen, false):SetRate(1) + self.OpenAnim:PlayAnim(self.Blueprint.Display.AnimationOpen, false):SetRate(1) end, ---@param self URA0104 @@ -61,9 +61,9 @@ URA0104 = ClassUnit(AirTransport) { if ((new == 'Top' or new == 'Up') and old == 'Down') then self.AnimManip:SetRate(-1) elseif (new == 'Down') then - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationLand, false):SetRate(1.5) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationLand, false):SetRate(1.5) elseif (new == 'Up') then - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationTakeOff, false):SetRate(1) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationTakeOff, false):SetRate(1) end end, diff --git a/units/URA0107/URA0107_Script.lua b/units/URA0107/URA0107_Script.lua index 3400234e35..dcec087f0c 100644 --- a/units/URA0107/URA0107_Script.lua +++ b/units/URA0107/URA0107_Script.lua @@ -32,7 +32,7 @@ URA0107 = ClassUnit(AirTransport) { AirTransport.OnStopBeingBuilt(self,builder,layer) self.AnimManip = CreateAnimator(self) self.Trash:Add(self.AnimManip) - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationTakeOff, false):SetRate(1) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationTakeOff, false):SetRate(1) end, ---@param self URA0107 @@ -44,12 +44,12 @@ URA0107 = ClassUnit(AirTransport) { if ((new == 'Top' or new == 'Up') and old == 'Down') then self.AnimManip:SetRate(-1) elseif (new == 'Down') then - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationLand, false):SetRate(1.5) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationLand, false):SetRate(1.5) -- NOTE: We need to add funtionality to fit this guy on the platform -- elseif (new == 'Bottom') then --- self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationIdle, true):SetRate(1) +-- self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationIdle, true):SetRate(1) elseif (new == 'Up') then - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationTakeOff, false):SetRate(1) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationTakeOff, false):SetRate(1) end end, diff --git a/units/URA0401/URA0401_script.lua b/units/URA0401/URA0401_script.lua index ab019e9199..cee2edd364 100644 --- a/units/URA0401/URA0401_script.lua +++ b/units/URA0401/URA0401_script.lua @@ -94,9 +94,9 @@ URA0401 = ClassUnit(CAirUnit) { if ((new == 'Top' or new == 'Up') and old == 'Down') then self.AnimManip:SetRate(-1) elseif (new == 'Down') then - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationLand, false):SetRate(1.5) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationLand, false):SetRate(1.5) elseif (new == 'Up') then - self.AnimManip:PlayAnim(self:GetBlueprint().Display.AnimationTakeOff, false):SetRate(1) + self.AnimManip:PlayAnim(self.Blueprint.Display.AnimationTakeOff, false):SetRate(1) end end, } diff --git a/units/URL0402/URL0402_script.lua b/units/URL0402/URL0402_script.lua index 59ce429651..0a8ca67900 100644 --- a/units/URL0402/URL0402_script.lua +++ b/units/URL0402/URL0402_script.lua @@ -321,7 +321,7 @@ URL0402 = ClassUnit(CWalkingLandUnit) { CWalkingLandUnit.OnMotionHorzEventChange(self, new, old) if (old == 'Stopped') then - local bpDisplay = self:GetBlueprint().Display + local bpDisplay = self.Blueprint.Display if bpDisplay.AnimationWalk and self.Animator then self.Animator:SetDirectionalAnim(true) self.Animator:SetRate(bpDisplay.AnimationWalkRate) diff --git a/units/URS0201/URS0201_script.lua b/units/URS0201/URS0201_script.lua index 924a28955e..0e9f352e04 100644 --- a/units/URS0201/URS0201_script.lua +++ b/units/URS0201/URS0201_script.lua @@ -56,7 +56,7 @@ URS0201 = ClassUnit(CSeaUnit) { end, LayerChangeTrigger = function(self, new, old) - local bp = self.Blueprint or self:GetBlueprint() + local bp = self.Blueprint or self.Blueprint if new == 'Land' then self:DisableUnitIntel('Layer', 'Sonar') self:SetSpeedMult(bp.Physics.LandSpeedMultiplier or 1) diff --git a/units/XSB1103/XSB1103_script.lua b/units/XSB1103/XSB1103_script.lua index 1e6c25e0ed..a3e68cdce5 100644 --- a/units/XSB1103/XSB1103_script.lua +++ b/units/XSB1103/XSB1103_script.lua @@ -27,7 +27,7 @@ XSB1103 = ClassUnit(SMassCollectionUnit) { self.AnimationManipulator = CreateAnimator(self) self.Trash:Add(self.AnimationManipulator) end - self.AnimationManipulator:PlayAnim(self:GetBlueprint().Display.AnimationActivate, true) + self.AnimationManipulator:PlayAnim(self.Blueprint.Display.AnimationActivate, true) end, OnProductionPaused = function(self) diff --git a/units/ZEB9603/ZEB9603_script.lua b/units/ZEB9603/ZEB9603_script.lua index 1f7cf4cd99..64853ae710 100644 --- a/units/ZEB9603/ZEB9603_script.lua +++ b/units/ZEB9603/ZEB9603_script.lua @@ -14,7 +14,7 @@ local TSeaFactoryUnit = import("/lua/terranunits.lua").TSeaFactoryUnit UEB0303 = ClassUnit(TSeaFactoryUnit) { OnCreate = function(self) TSeaFactoryUnit.OnCreate(self) - self.BuildPointSlider = CreateSlider(self, self:GetBlueprint().Display.BuildAttachBone or 0, -15, 0, 0, -1) + self.BuildPointSlider = CreateSlider(self, self.Blueprint.Display.BuildAttachBone or 0, -15, 0, 0, -1) self.Trash:Add(self.BuildPointSlider) end,