Skip to content

Commit

Permalink
Buff UEF ACU Drone's rebuild costs (#6591)
Browse files Browse the repository at this point in the history
UEF ACU drone rebuild costs
Mass: 160 -> 60
Energy: 1600 -> 800
Buildtime: 400 -> 200
- The drone build time is now affected by the ACU's buildpower.

- After testing the rebuilding during a stall, it seems like
`CreateEconomyEvent` works in blocks of buildtime in the same way as
silos. Reworking the drone rebuild process to be the same as the
kennel's (`TPodTowerUnit`) would fix this.
- The Drone auto-rebuild toggle is still using the very old gpg system
of removing the drone enhancement when the drone dies. To implement it
correctly there would have to be some UI data set on the ACU to create a
"rebuild drone" button when the drone is destroyed but not rebuilding,
and then that button would issue a sim callback or script task order
that initiates the drone rebuild sim-side.
  • Loading branch information
lL1l1 authored Jan 30, 2025
1 parent 6bade5d commit 9ca7749
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions changelog/snippets/balance.6591.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- (#6591) Buff UEF ACU Drone's rebuild costs by making it half the upgrade's cost. Previously it was too high due to not being changed alongside the upgrade's cost, and had an unreasonable drain for a T1 economy.
Additionally, the drone now rebuilds based off the ACU's buildpower instead of a hardcoded 10 seconds.

- UEF ACU Drone:
- Rebuild mass cost: 160 -> 60
- Rebuild energy cost: 1600 -> 800
- Rebuild time: 10 seconds -> 200 buildtime
6 changes: 6 additions & 0 deletions lua/RuleInit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
-- This is the minimal setup required to load the game rules.

-- Do global init

--[[`number` is `BlueprintOrdinal` from the entity creation dialog, used by all types of blueprints
`BlueprintId` for units
`FileName` for projectiles and meshes (meshes have the file extension stripped)]]
---@type table<number | BlueprintId | FileName, UnitBlueprint | ProjectileBlueprint | MeshBlueprint>
---@diagnostic disable-next-line: lowercase-global
__blueprints = {}

doscript '/lua/system/config.lua'
Expand Down
6 changes: 3 additions & 3 deletions units/UEA0001/UEA0001_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ UnitBlueprint{
UniformScale = 0.1,
},
Economy = {
BuildCostEnergy = 1600,
BuildCostMass = 160,
BuildCostEnergy = 800,
BuildCostMass = 60,
BuildRadius = 8,
BuildRate = 5,
BuildTime = 400,
BuildTime = 200,
BuildableCategory = { "BUILTBYCOMMANDER UEF" },
NaturalProducer = true,
},
Expand Down
6 changes: 4 additions & 2 deletions units/UEL0001/UEL0001_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ local TDFOverchargeWeapon = TerranWeaponFile.TDFOverchargeWeapon
local EffectUtil = import("/lua/effectutilities.lua")
local Buff = import("/lua/sim/buff.lua")

local podBpEco = __blueprints['uea0001']--[[@as UnitBlueprint]].Economy

---@class UEL0001 : ACUUnit
---@field LeftPod TConstructionPodUnit
---@field HasLeftPod boolean
Expand Down Expand Up @@ -234,7 +236,7 @@ UEL0001 = ClassUnit(ACUUnit) {
WaitFor(self.RebuildingPod2)
end
if self.HasLeftPod == true then
self.RebuildingPod = CreateEconomyEvent(self, 1600, 160, 10, self.SetWorkProgress)
self.RebuildingPod = CreateEconomyEvent(self, podBpEco.BuildCostEnergy, podBpEco.BuildCostMass, podBpEco.BuildTime / self:GetBuildRate(), self.SetWorkProgress)
self:RequestRefreshUI()
WaitFor(self.RebuildingPod)
self:SetWorkProgress(0.0)
Expand All @@ -255,7 +257,7 @@ UEL0001 = ClassUnit(ACUUnit) {
WaitFor(self.RebuildingPod)
end
if self.HasRightPod == true then
self.RebuildingPod2 = CreateEconomyEvent(self, 1600, 160, 10, self.SetWorkProgress)
self.RebuildingPod2 = CreateEconomyEvent(self, podBpEco.BuildCostEnergy, podBpEco.BuildCostMass, podBpEco.BuildTime / self:GetBuildRate(), self.SetWorkProgress)
self:RequestRefreshUI()
WaitFor(self.RebuildingPod2)
self:SetWorkProgress(0.0)
Expand Down

0 comments on commit 9ca7749

Please sign in to comment.