Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/shipassault.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ function script.BlockShot(num, targetID)
if num == 2 and GG.OverkillPrevention_CheckBlock(unitID, targetID, 400.1, 90, false, false, true) then
return true
end
if num == 2 then
local reloadState = Spring.GetUnitWeaponState(unitID, 3, 'reloadState')
return not (reloadState and (reloadState < 0 or reloadState < Spring.GetGameFrame()))
end
return false
end

Expand All @@ -95,7 +99,7 @@ function script.AimWeapon(num, heading, pitch)
WaitForTurn(sleeves, x_axis)
StartThread(RestoreAfterDelay)
return true
elseif num == 2 then
elseif num == 2 or num == 3 then
return true
end
end
Expand All @@ -114,7 +118,7 @@ function script.Shot(num)
EmitSfx(gunPieces[gun_1].flare, 1024)
Move(gunPieces[gun_1].flare, z_axis, 0)
StartThread(Recoil, gunPieces[gun_1].barrel)
elseif num == 2 then
elseif num == 2 or num == 3 then
missileNum = missileNum + 1
if missileNum > 4 then missileNum = 1 end
EmitSfx(missiles[missileNum], 1025)
Expand Down
56 changes: 52 additions & 4 deletions units/shipassault.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ return { shipassault = {
builder = false,
buildPic = [[shipassault.png]],
canGuard = true,
canManualFire = true,
canMove = true,
canPatrol = true,
category = [[SHIP]],
Expand All @@ -31,6 +32,7 @@ return { shipassault = {
selectionscalemult = 1.18,
selectionwidthscalemult = 1.25,
selectioninherit = 1,
manualfire_desc = [[Fire Special Weapon: Fire a rocket salvo.]]
},

explodeAs = [[BIG_UNITEX]],
Expand Down Expand Up @@ -80,6 +82,12 @@ return { shipassault = {
badTargetCategory = [[SWIM LAND SHIP HOVER]],
onlyTargetCategory = [[SWIM LAND SINK TURRET FLOAT SHIP HOVER]],
},

{
def = [[MISSILE_SALVO]],
badTargetCategory = [[SWIM LAND SHIP HOVER]],
onlyTargetCategory = [[SWIM LAND SINK TURRET FLOAT SHIP HOVER]],
},

},

Expand All @@ -96,6 +104,7 @@ return { shipassault = {
craterMult = 0,

customParams = {
combatRange = 225,
force_ignore_ground = [[1]],
slot = [[5]],
muzzleEffectFire = [[custom:HEAVY_CANNON_MUZZLE]],
Expand Down Expand Up @@ -140,15 +149,12 @@ return { shipassault = {
},

MISSILE = {
name = [[Destroyer Missiles]],
name = [[Destroyer Missile]],
areaOfEffect = 48,
cegTag = [[missiletrailyellow]],
collideFriendly = false,
craterBoost = 1,
craterMult = 2,
customParams = {
combatRange = 265,
},
damage = {
default = 400.01,
},
Expand Down Expand Up @@ -177,6 +183,48 @@ return { shipassault = {
weaponType = [[StarburstLauncher]],
weaponVelocity = 1800,
},

MISSILE_SALVO = {
name = [[Destroyer Missile Salvo]],
areaOfEffect = 48,
avoidFeature = false,
avoidFriendly = false,
avoidNeutral = false,
burst = 4,
burstrate = 0.1,
cegTag = [[missiletrailyellow]],
collideFriendly = false,
commandfire = true,
craterBoost = 1,
craterMult = 2,
damage = {
default = 400.01,
},

edgeEffectiveness = 0.5,
fireStarter = 100,
fixedLauncher = true,
flightTime = 4,
impulseBoost = 0,
impulseFactor = 0.4,
interceptedByShieldType = 2,
model = [[wep_m_hailstorm.s3o]],
noSelfDamage = true,
range = 800,
reloadtime = 64,
smokeTrail = true,
soundHit = [[weapon/missile/missile_fire12]],
soundStart = [[weapon/missile/missile_fire10]],
startVelocity = 100,
tolerance = 4000,
turnrate = 30000,
turret = true,
--waterWeapon = true,
weaponAcceleration = 300,
weaponTimer = 1,
weaponType = [[StarburstLauncher]],
weaponVelocity = 1800,
},

},

Expand Down