From 649e6cdfd630155071f5e29b68f58cbafec13a53 Mon Sep 17 00:00:00 2001 From: Azraeel <45247351+Azraeel@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:32:42 +0900 Subject: [PATCH] V1.79 (#286) * Fix Additional RoF Errors * Fix Major Bugs in Shield.lua * Move OnDamage to QUIET Base Repo * V1.79 Release Point & Changelog --- changelog/V1.79.md | 10 + hook/lua/aeonweapons.lua | 1 + hook/lua/shield.lua | 84 +++--- hook/lua/sim/Unit.lua | 9 +- mod_info.lua | 2 +- .../BlackOpsUnleashed/BRLK001/BRLK001_unit.bp | 242 ++++++++++++++++++ .../BlackOpsUnleashed/BSA0310/BSA0310_unit.bp | 9 +- units/Total Mayhem/BRPT3ML/BRPT3ML_unit.bp | 17 +- units/Vanilla/UEL0401/UEL0401_unit.bp | 2 +- units/Vanilla/XSB3304/XSB3304_unit.bp | 2 +- 10 files changed, 316 insertions(+), 62 deletions(-) create mode 100644 changelog/V1.79.md create mode 100644 units/BlackOpsUnleashed/BRLK001/BRLK001_unit.bp diff --git a/changelog/V1.79.md b/changelog/V1.79.md new file mode 100644 index 0000000..f8dcf6a --- /dev/null +++ b/changelog/V1.79.md @@ -0,0 +1,10 @@ +# Game Balance & Game Patch Changelog + +## Version 1.79 - 2024-12-30 +### General Changes + +- **General Changes** + - Fix Shield.lua Personal Shields initializing legacy code instead of the New Shield.lua Code + - Fix Shield.lua not carrying default values resulting in some Nil Values + - Shield.lua now applies to all Shield Types (Personal, Bubble, and etc) meaning that Personal Shields now interact correctly with AoE Weapons not allowing AoE to damage the base Health of the Unit. The Shield is now treated as an additional health layer to the Unit and no longer carries it's own collision sphere/box. Damage that overkills the shield now applies onto the base health of the unit. + - Fix Multiple Units with Rate Of Fire Errors (many having too short of Rate of Fires) diff --git a/hook/lua/aeonweapons.lua b/hook/lua/aeonweapons.lua index cbc5c81..0e285f2 100644 --- a/hook/lua/aeonweapons.lua +++ b/hook/lua/aeonweapons.lua @@ -1,6 +1,7 @@ --- /lua/aeonweapons.lua --- Default definitions of Aeon weapons --- Credit to Jip (FAF) for GC TractorClaw Rework +--- QUIET's First Overhaul, Courtesy of FAF! local Entity = import('/lua/sim/Entity.lua').Entity local Weapon = import('/lua/sim/weapon.lua').Weapon diff --git a/hook/lua/shield.lua b/hook/lua/shield.lua index 9eda42f..8924d2b 100644 --- a/hook/lua/shield.lua +++ b/hook/lua/shield.lua @@ -97,6 +97,25 @@ local IEffectOffsetEmitter = moho.IEffect.OffsetEmitter local CategoriesOverspill = categories.SHIELD * categories.DEFENSE +-- default values for a shield specification table (to be passed to native code) +local DEFAULT_OPTIONS = { + Mesh = '', + MeshZ = '', + ImpactMesh = '', + ImpactEffects = '', + Size = 10, + ShieldMaxHealth = 250, + ShieldRechargeTime = 10, + ShieldEnergyDrainRechargeTime = 10, + ShieldVerticalOffset = -1, + ShieldRegenRate = 1, + ShieldRegenStartTime = 5, + PassOverkillDamage = false, + + -- flags for mods + -- SkipAttachmentCheck = false, -- defaults to nil, same as false +} + LargestShieldDiameter = 0 for k, bp in __blueprints do -- check for blueprints that have a shield and a shield size set @@ -118,6 +137,9 @@ Shield = Class(QCEShield) { --LOG("We've entered LCE Version of Shield.lua"), __init = function(self, spec) + -- Apply default options + local spec = TableAssimilate(spec, DEFAULT_OPTIONS) + _c_CreateShield(self, spec) end, @@ -152,7 +174,7 @@ Shield = Class(QCEShield) { self.OffHealth = -1 -- copy over information from specifiaction - self.Size = spec.Size or 10 + self.Size = spec.Size self.Owner = spec.Owner self.MeshBp = spec.Mesh self.MeshZBp = spec.MeshZ @@ -323,11 +345,6 @@ Shield = Class(QCEShield) { local brain = self.Brain local position = EntityGetPosition(self.Owner) - -- Safety Check for nil shield size - if self.Size == nil then - self.Size = 10 - end - -- diameter where other shields overlap with us or are contained by us local diameter = LargestShieldDiameter + self.Size @@ -428,10 +445,18 @@ Shield = Class(QCEShield) { end, GetOverkill = function(self,instigator,amount,type) + -- Like armor damage, first multiply by armor reduction, then apply handicap + -- See SimDamage.cpp (DealDamage function) for how this should work + amount = amount * (self.Owner:GetArmorMult(type)) + amount = amount * (1.0 - ArmyGetHandicap(self.Army)) + local finalVal = amount - EntityGetHealth(self) + if finalVal < 0 or type == "FAF_AntiShield" then + finalVal = 0 + end + return finalVal end, OnDamage = function(self, instigator, amount, vector, damageType) - -- only applies to trees if damageType == "TreeForce" or damageType == "TreeFire" then return @@ -499,13 +524,9 @@ Shield = Class(QCEShield) { -- do damage logic for shield if self.Owner ~= instigator then + --LOG("Calling OnGetDamageAbsorption") local absorbed = self:OnGetDamageAbsorption(instigator, amount, dmgType) - -- Safety Check for nil shield size - if self.Size == nil then - self.Size = 10 - end - -- take some damage EntityAdjustHealth(self, instigator, -absorbed) @@ -580,7 +601,6 @@ Shield = Class(QCEShield) { end, RegenStartThread = function(self) - local AdjustHealth = AdjustHealth local GetHealth = GetHealth local GetMaxHealth = GetMaxHealth @@ -616,7 +636,6 @@ Shield = Class(QCEShield) { end, CreateImpactEffect = function(self, vector) - if IsDestroyed(self) then return end @@ -751,12 +770,6 @@ Shield = Class(QCEShield) { end, CreateShieldMesh = function(self) - - -- Safety Check for nil shield size - if self.Size == nil then - self.Size = 10 - end - local vec = VectorCached vec[1] = 0 vec[2] = self.ShieldVerticalOffset @@ -821,7 +834,6 @@ Shield = Class(QCEShield) { OnState = State { Main = function(self) - local GetHealth = GetHealth local GetMaxHealth = GetMaxHealth local GetResourceConsumed = moho.unit_methods.GetResourceConsumed @@ -888,7 +900,6 @@ Shield = Class(QCEShield) { OffState = State { Main = function(self) - self.Enabled = false -- No regen during off state @@ -920,7 +931,6 @@ Shield = Class(QCEShield) { DamageRechargeState = State { Main = function(self) - -- No regen during off state if self.RegenThread then KillThread(self.RegenThread) @@ -948,7 +958,6 @@ Shield = Class(QCEShield) { EnergyDrainRechargeState = State { Main = function(self) - -- No regen during off state if self.RegenThread then KillThread(self.RegenThread) @@ -992,8 +1001,9 @@ Shield = Class(QCEShield) { } -- Unit shields typically hug the shape of the unit -QCEUnitShield = UnitShield -UnitShield = Class(QCEUnitShield){ +UnitShield = Class(Shield){ + + RemainEnabledWhenAttached = true, OnCreate = function(self,spec) @@ -1032,8 +1042,9 @@ UnitShield = Class(QCEUnitShield){ end, CreateShieldMesh = function(self) - - self:SetCollisionShape( 'Box', self.CollisionCenterX, self.CollisionCenterY, self.CollisionCenterZ, self.CollisionSizeX, self.CollisionSizeY, self.CollisionSizeZ) + -- Personal shields (unit shields) don't handle collisions anymore. + -- This is done in the Unit's OnDamage function instead. + self:SetCollisionShape('None') self.Owner:SetMesh(self.OwnerShieldMesh,true) @@ -1066,8 +1077,7 @@ UnitShield = Class(QCEUnitShield){ } -- AntiArtillery shields are typical bubbles but only intercept certain projectiles -QCEAntiArtilleryShield = AntiArtilleryShield -AntiArtilleryShield = Class(QCEAntiArtilleryShield){ +AntiArtilleryShield = Class(Shield){ OnCreate = function(self, spec) Shield.OnCreate(self, spec) @@ -1137,8 +1147,7 @@ AntiArtilleryShield = Class(QCEAntiArtilleryShield){ } -- Hunker Shields take no damage while on -- -QCEDomeHunkerShield = DomeHunkerShield -DomeHunkerShield = Class(QCEDomeHunkerShield) { +DomeHunkerShield = Class(Shield) { OnCollisionCheckWeapon = function(self, firingWeapon) return true @@ -1154,8 +1163,7 @@ DomeHunkerShield = Class(QCEDomeHunkerShield) { } -- Hunker Shields are time limited shields that take no damage -- -QCEPersonalHunkerShield = PersonalHunkerShield -PersonalHunkerShield = Class(QCEPersonalHunkerShield) { +PersonalHunkerShield = Class(Shield) { OnCreate = function(self, spec) Shield.OnCreate(self, spec) @@ -1196,8 +1204,7 @@ PersonalHunkerShield = Class(QCEPersonalHunkerShield) { } -QCEProjectedShield = ProjectedShield -ProjectedShield = Class(QCEProjectedShield){ +ProjectedShield = Class(Shield){ OnDamage = function(self,instigator,amount,vector,type) @@ -1268,11 +1275,6 @@ ProjectedShield = Class(QCEProjectedShield){ local WaitTicks = coroutine.yield if not self.Dead then - - -- Safety Check for nil shield size - if self.Size == nil then - self.Size = 10 - end local army = self.Army diff --git a/hook/lua/sim/Unit.lua b/hook/lua/sim/Unit.lua index 8325c7d..746223e 100644 --- a/hook/lua/sim/Unit.lua +++ b/hook/lua/sim/Unit.lua @@ -33,13 +33,10 @@ Unit = Class(QCEUnit) { excessDamageRatio = -excess / maxHealth end - - Kill( self, instigator, damageType, excessDamageRatio) - + Kill( self, instigator, damageType, excessDamageRatio) end - - end - + end + -- Handle incoming OC damage for ACUs if damageType == 'Overcharge' and LOUDENTITY(categories.COMMAND, self) then diff --git a/mod_info.lua b/mod_info.lua index 4e98821..56e08ae 100644 --- a/mod_info.lua +++ b/mod_info.lua @@ -1,6 +1,6 @@ name = "QUIET" author = "QUIET Team" -version = 1.78 +version = 1.79 description = "QUIET is a massive collection of Bug Fixes, Game Rebalance, & Other Various Actions" exclusive = false ui_only = false diff --git a/units/BlackOpsUnleashed/BRLK001/BRLK001_unit.bp b/units/BlackOpsUnleashed/BRLK001/BRLK001_unit.bp new file mode 100644 index 0000000..997ac9a --- /dev/null +++ b/units/BlackOpsUnleashed/BRLK001/BRLK001_unit.bp @@ -0,0 +1,242 @@ +UnitBlueprint { + Merge = true, + BlueprintId = 'brlk001', + + Weapon = { + { + advancedTracking = true, + AlwaysRecheckTarget = true, + + Audio = { + Fire = Sound { Bank = 'URSWeapon', Cue = 'URS0202_Nano_Dart', LodCutoff = 'Weapon_LodCutoff' }, + }, + + BallisticArc = 'RULEUBA_None', + + CannotAttackGround = true, + + CollideFriendly = false, + + Damage = 100, + DamageType = 'Normal', + + DisplayName = 'Nanodart Launcher AA', + + FireTargetLayerCapsTable = { + Land = 'Air', + }, + + FiringTolerance = 10, + + Label = 'AAGun', + + MaxRadius = 48, + + MuzzleSalvoDelay = 0.1, + MuzzleSalvoSize = 6, + + MuzzleVelocity = 32, + + ProjectileId = '/projectiles/CAANanoDart03/CAANanoDart03_proj.bp', + ProjectileLifetime = 4, + + RackBones = { + { + MuzzleBones = { + 'Turret_Muzzle_01', + 'Turret_Muzzle_04', + 'Turret_Muzzle_02', + 'Turret_Muzzle_05', + 'Turret_Muzzle_03', + 'Turret_Muzzle_06', + }, + RackBone = 'Turret_Barrel01', + }, + }, + + RangeCategory = 'UWRC_AntiAir', + + RateOfFire = 10/6, -- 360 DPS Air + + TargetCheckInterval = 0.5, + + TargetPriorities = { + 'SPECIALHIGHPRI', + 'HIGHPRIAIR', + 'BOMBER', + 'GROUNDATTACK', + 'MOBILE', + }, + + TargetRestrictDisallow = 'UNTARGETABLE,SATELLITE', + + ToggleWeapon = 'GroundGun', + + TrackingRadius = 1.2, + + TurretBoneMuzzle = 'Turret_Muzzle_01', + TurretBonePitch = 'Turret_Barrel01', + TurretBoneYaw = 'Turret01', + + TurretPitch = 35, + TurretPitchRange = 60, + TurretPitchSpeed = 80, + + TurretYaw = 0, + TurretYawRange = 180, + TurretYawSpeed = 80, + + Turreted = true, + }, + { + AlwaysRecheckTarget = true, + + BallisticArc = 'RULEUBA_None', + + BeamCollisionDelay = 0.2, + BeamLifetime = 0, + + CannotAttackGround = true, + ContinuousBeam = true, + + CollideFriendly = false, + + Damage = 0.1, + DamageFriendly = false, + DamageType = 'Normal', + + DisplayName = 'Targeting Laser', + + FireTargetLayerCapsTable = { + Land = 'Air', + }, + + FiringTolerance = 2, + + Label = 'Lazor', + + MaxRadius = 50, + + PreferPrimaryWeaponTarget = true, + ProjectileLifetimeUsesMultiplier = 1.1, + + RackBones = { + { + MuzzleBones = { 'Lazor' }, + RackBone = 'Lazor', + }, + }, + + RateOfFire = 2, + + ReTargetOnMiss = true, + + TargetCheckInterval = 0.5, + TargetPriorities = { + 'SPECIALHIGHPRI', + 'HIGHPRIAIR', + 'BOMBER', + 'GROUNDATTACK', + 'MOBILE', + }, + TargetRestrictDisallow = 'UNTARGETABLE,SATELLITE', + TrackingRadius = 1.2, + + TurretBoneMuzzle = 'Lazor', + TurretBonePitch = 'Lazor', + TurretBoneYaw = 'Lazor', + + TurretPitch = 0, + TurretPitchRange = 180, + TurretPitchSpeed = 180, + + TurretYaw = 0, + TurretYawRange = 180, + TurretYawSpeed = 180, + + Turreted = true, + UseFiringSolutionInsteadOfAimBone = true, + }, + { + AlwaysRecheckTarget = true, + + Audio = { + Fire = Sound { Bank = 'URSWeapon', Cue = 'URS0202_Nano_Dart', LodCutoff = 'Weapon_LodCutoff' }, + }, + + BallisticArc = 'RULEUBA_None', + + CollideFriendly = false, + + Damage = 100, + DamageType = 'Normal', + + DisplayName = 'Nanodart Ground Launcher', + + FireTargetLayerCapsTable = { + Land = 'Land', + }, + + FiringRandomness = 0.6, + FiringTolerance = 2, + + Label = 'GroundGun', + + MaxRadius = 30, + + MuzzleSalvoDelay = 0.5, + MuzzleSalvoSize = 6, + + MuzzleVelocity = 10, + + ProjectileId = '/projectiles/CAANanoDart05/CAANanoDart05_proj.bp', + ProjectileLifetime = 3, + + RackBones = { + { + MuzzleBones = { + 'Turret_Muzzle_01', + 'Turret_Muzzle_04', + 'Turret_Muzzle_02', + 'Turret_Muzzle_05', + 'Turret_Muzzle_03', + 'Turret_Muzzle_06', + }, + RackBone = 'Turret_Barrel01', + }, + }, + + RackSalvoReloadTime = 2, + + RangeCategory = 'UWRC_DirectFire', + + RateOfFire = 10/30, + + TargetCheckInterval = 1, + TargetPriorities = { + 'SPECIALHIGHPRI', + 'MOBILE', + 'STRUCTURE DEFENSE', + 'ALLUNITS', + }, + TargetRestrictDisallow = 'UNTARGETABLE', + + ToggleWeapon = 'AAGun', + + TrackingRadius = 1.1, + + TurretBoneMuzzle = 'Turret_Muzzle_01', + TurretBonePitch = 'Turret_Barrel01', + TurretBoneYaw = 'Turret01', + + TurretPitch = 35, + TurretPitchRange = 60, + TurretPitchSpeed = 90, + + TurretYaw = 0, + TurretYawRange = 180, + TurretYawSpeed = 60, + Turreted = true, + }, + }, +} diff --git a/units/BlackOpsUnleashed/BSA0310/BSA0310_unit.bp b/units/BlackOpsUnleashed/BSA0310/BSA0310_unit.bp index d37304e..b2a5eac 100644 --- a/units/BlackOpsUnleashed/BSA0310/BSA0310_unit.bp +++ b/units/BlackOpsUnleashed/BSA0310/BSA0310_unit.bp @@ -27,10 +27,12 @@ UnitBlueprint { }, Weapon = { - -- Missiles -- - { + RenderFireClock = true, + + RateOfFire = 10/24, + TargetPriorities = { 'SPECIALHIGHPRI', "STRUCTURE * ANTIAIR", @@ -43,9 +45,7 @@ UnitBlueprint { "ALLUNITS", }, }, - -- Shield Drain Autoguns x 2 -- - { }, @@ -57,6 +57,5 @@ UnitBlueprint { { }, - }, } diff --git a/units/Total Mayhem/BRPT3ML/BRPT3ML_unit.bp b/units/Total Mayhem/BRPT3ML/BRPT3ML_unit.bp index dd20d23..a524f58 100644 --- a/units/Total Mayhem/BRPT3ML/BRPT3ML_unit.bp +++ b/units/Total Mayhem/BRPT3ML/BRPT3ML_unit.bp @@ -1,7 +1,7 @@ UnitBlueprint { Merge = true, BlueprintId = "brpt3ml", - + Weapon = { { AboveWaterTargetsOnly = true, @@ -10,9 +10,9 @@ UnitBlueprint { BallisticArc = 'RULEUBA_HighArc', CollideFriendly = false, - Damage = 125, + Damage = 136, DamageRadius = 3.5, - DamageType = 'Normal', -- unique penalty to this unit -- + DamageType = 'Normal', DamageFriendly = false, DisplayName = 'Light Quarnon Cannon', @@ -31,7 +31,7 @@ UnitBlueprint { MaxRadius = 88, MinRadius = 22, - MuzzleSalvoDelay = 0.8, -- 3.2 seconds to discharge + MuzzleSalvoDelay = 0.6, -- 2.4 seconds to discharge MuzzleSalvoSize = 4, @@ -42,10 +42,13 @@ UnitBlueprint { ProjectileLifetime = 12, RangeCategory = 'UWRC_IndirectFire', + + RenderFireClock = true, + RackSalvoFiresAfterCharge = true, - RateOfFire = 1, -- rate controlled by charge - every 5 seconds = 500/5 + RateOfFire = 10/76, - TargetCheckInterval = 1, + TargetCheckInterval = 0.5, TargetPriorities = { 'SPECIALHIGHPRI', @@ -55,7 +58,7 @@ UnitBlueprint { }, TargetRestrictDisallow = 'UNTARGETABLE', - TrackingRadius = 1.05, + TrackingRadius = 1.1, TurretBoneMuzzle = 'muzzle01', TurretBonePitch = 'Left_Arm_B01', diff --git a/units/Vanilla/UEL0401/UEL0401_unit.bp b/units/Vanilla/UEL0401/UEL0401_unit.bp index a25b637..7a5abcc 100644 --- a/units/Vanilla/UEL0401/UEL0401_unit.bp +++ b/units/Vanilla/UEL0401/UEL0401_unit.bp @@ -57,7 +57,7 @@ UnitBlueprint { }, { - RateOfFire = 10/10, + RateOfFire = 10/15, }, { diff --git a/units/Vanilla/XSB3304/XSB3304_unit.bp b/units/Vanilla/XSB3304/XSB3304_unit.bp index 13849f4..8379d81 100644 --- a/units/Vanilla/XSB3304/XSB3304_unit.bp +++ b/units/Vanilla/XSB3304/XSB3304_unit.bp @@ -63,7 +63,7 @@ UnitBlueprint { RangeCategory = 'UWRC_AntiAir', - RateOfFire = 10/1, + RateOfFire = 10/6, TargetCheckInterval = 0.5,