Skip to content

Commit

Permalink
Increased DRP maximum spin to 150% of the old value.
Browse files Browse the repository at this point in the history
 * This means its maximum fire rate is one shot per 1s -> 0.66s
 * The change is implemented by adding an extra 50% on top of its rate buildup scale.
 * This means it takes the same 90s to spin up to 66% (its old max spin), then takes another 40s to hit its new top speed.
 * Its aim rate is terrible above the new 60%, so keep firing in one direction to use the new fire rate. It is really meant for hammering in one direction.

Also reduced Zenith range 8800 -> 8600 to accentuate the range difference slightly more.
  • Loading branch information
GoogleFrog committed Apr 5, 2024
1 parent 31b8c7d commit e54be82
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
24 changes: 13 additions & 11 deletions scripts/raveparty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,22 @@ local spinScriptAccel = 0.05
local maxSpin = math.pi/3

local spinMult = 0
local targetSpin = 1
local MAX_SPIN = 1.5
local targetSpin = MAX_SPIN
local gunNum = 1
local aimSpeedMult = 1
local reloadChange = 0
local lastAimFrame = false

local function UpdateSpin(gainSpin, loseSpin)
local stunned_or_inbuild = spGetUnitIsStunned(unitID)
reloadChange = (stunned_or_inbuild and 0) or (spGetUnitRulesParam(unitID, "lowpower") == 1 and 0) or (GG.att_ReloadChange[unitID] or 1)
reloadChange = ((stunned_or_inbuild and 0) or (spGetUnitRulesParam(unitID, "lowpower") == 1 and 0) or (GG.att_ReloadChange[unitID] or 1)) * MAX_SPIN
if gainSpin then
spinMult = spinMult + (0.022*spinMult - 0.042)*spinMult + 0.033
local gain = math.max(0.01, (0.022*math.min(1, spinMult) - 0.042)*spinMult + 0.033)
spinMult = spinMult + gain
end
if spinMult > 1 then
spinMult = 1
if spinMult > MAX_SPIN then
spinMult = MAX_SPIN
end

--local xpos = select(1, Spring.GetUnitPosition(unitID))
Expand All @@ -105,9 +107,9 @@ local function UpdateSpin(gainSpin, loseSpin)
spinMult = minSpinMult
end
end
aimSpeedMult = 1 - math.pow(math.min(1, (math.max(0.5, spinMult) - 0.4)*1.8), 4/3)*0.7
aimSpeedMult = math.max(0.09, 1 - math.pow((math.max(0.5, spinMult) - 0.4)*1.8, 4/3)*0.7)
Spin(spindle, x_axis, spinMult*maxSpin, spinScriptAccel)
Spring.SetUnitRulesParam(unitID, "speed_bar", spinMult, LOS_ACCESS)
Spring.SetUnitRulesParam(unitID, "speed_bar", spinMult / MAX_SPIN, LOS_ACCESS)
end

local function SpinThread()
Expand Down Expand Up @@ -162,10 +164,10 @@ function script.AimWeapon(num, heading, pitch)

if headDiff > 0.85 then
targetSpin = 0.5
elseif headDiff > 0.05 then
targetSpin = 1 - headDiff*0.5/0.85
elseif headDiff > 0.02 then
targetSpin = 1 - headDiff*0.6
else
targetSpin = 1
targetSpin = MAX_SPIN
end

local spindlePitch = -pitch + (num - 1)* math.pi/3
Expand Down Expand Up @@ -207,7 +209,7 @@ end

function script.FireWeapon(num)
Sleep(33)
if spinMult < 1 then
if spinMult < MAX_SPIN then
UpdateSpin(true)
end
end
Expand Down
24 changes: 12 additions & 12 deletions units/raveparty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ return { raveparty = {
craterMult = 3,

customParams = {
script_reload = [[6]],
script_reload = [[4]],
reaim_time = 1,
},
damage = {
Expand All @@ -113,7 +113,7 @@ return { raveparty = {
myGravity = 0.1,
range = 9600,
rgbColor = [[1 0.1 0.1]],
reloadtime = 5,
reloadtime = 3.5,
size = 15,
sizeDecay = 0.03,
soundHit = [[explosion/mini_nuke]],
Expand All @@ -139,7 +139,7 @@ return { raveparty = {
burntime = 240,
burnchance = 1,

script_reload = [[6]],
script_reload = [[4]],
reaim_time = 1,

area_damage = 1,
Expand All @@ -161,7 +161,7 @@ return { raveparty = {
myGravity = 0.1,
range = 9600,
rgbColor = [[0.9 0.3 0]],
reloadtime = 5,
reloadtime = 3.5,
size = 15,
sizeDecay = 0.03,
soundHit = [[weapon/missile/nalpalm_missile_hit]],
Expand All @@ -183,7 +183,7 @@ return { raveparty = {
craterMult = 1,

customParams = {
script_reload = [[6]],
script_reload = [[4]],
reaim_time = 1,
},

Expand All @@ -201,7 +201,7 @@ return { raveparty = {
myGravity = 0.1,
range = 9600,
rgbColor = [[0.7 0.7 0]],
reloadtime = 5,
reloadtime = 3.5,
size = 15,
sizeDecay = 0.03,
soundHit = [[weapon/cannon/earthshaker]],
Expand All @@ -228,7 +228,7 @@ return { raveparty = {
smoothexponent = [[0.45]],
movestructures = [[1]],

script_reload = [[6]],
script_reload = [[4]],
reaim_time = 1,
},

Expand All @@ -244,7 +244,7 @@ return { raveparty = {
myGravity = 0.1,
range = 9600,
rgbColor = [[0.1 1 0.1]],
reloadtime = 5,
reloadtime = 3.5,
size = 15,
sizeDecay = 0.03,
soundHit = [[explosion/ex_large4]],
Expand All @@ -265,7 +265,7 @@ return { raveparty = {
craterMult = 0.5,

customParams = {
script_reload = [[6]],
script_reload = [[4]],
reaim_time = 1,
},

Expand All @@ -286,7 +286,7 @@ return { raveparty = {
paralyzeTime = 25,
range = 9600,
rgbColor = [[0.1 0.1 1]],
reloadtime = 5,
reloadtime = 3.5,
size = 15,
sizeDecay = 0.03,
soundHit = [[weapon/more_lightning]],
Expand All @@ -310,7 +310,7 @@ return { raveparty = {
customparams = {
timeslow_damagefactor = 10,
nofriendlyfire = "needs hax",
script_reload = [[6]],
script_reload = [[4]],
reaim_time = 1,
timeslow_overslow_frames = 2*30, --2 seconds before slow decays
},
Expand All @@ -329,7 +329,7 @@ return { raveparty = {
myGravity = 0.1,
range = 9600,
rgbColor = [[0.7 0 0.7]],
reloadtime = 5,
reloadtime = 3.5,
size = 15,
sizeDecay = 0.03,
soundHit = [[weapon/aoe_aura2]],
Expand Down
8 changes: 4 additions & 4 deletions units/zenith.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ return { zenith = {
interceptedByShieldType = 2,
noSelfDamage = false,
model = [[asteroid.s3o]],
range = 8800,
range = 8600,
reloadtime = 1.2,
smokeTrail = true,
soundHit = [[weapon/cannon/supergun_bass_boost]],
Expand Down Expand Up @@ -203,7 +203,7 @@ return { zenith = {
interceptedByShieldType = 2,
noSelfDamage = false,
model = [[asteroid.s3o]],
range = 8800,
range = 8600,
reloadtime = 1.2,
smokeTrail = true,
soundHit = [[weapon/cannon/supergun_bass_boost]],
Expand Down Expand Up @@ -263,7 +263,7 @@ return { zenith = {
interceptedByShieldType = 2,
noSelfDamage = false,
model = [[asteroid.s3o]],
range = 8800,
range = 8600,
reloadtime = 1.2,
smokeTrail = true,
soundHit = [[weapon/cannon/supergun_bass_boost]],
Expand Down Expand Up @@ -325,7 +325,7 @@ return { zenith = {
interceptedByShieldType = 2,
noSelfDamage = false,
model = [[asteroid.s3o]],
range = 8800,
range = 8600,
reloadtime = 1.2,
smokeTrail = true,
soundHit = [[weapon/cannon/supergun_bass_boost]],
Expand Down

0 comments on commit e54be82

Please sign in to comment.