Skip to content

Commit

Permalink
Introduce a Cybran version of the Absolver (FAForever#5869)
Browse files Browse the repository at this point in the history
Co-authored-by: (Jip) Willem Wijnia <[email protected]>
Co-authored-by: (Jip) Willem Wijnia <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2024
1 parent eea17d3 commit 91a3cf4
Show file tree
Hide file tree
Showing 25 changed files with 496 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/ui/help/unitdescription.lua
Original file line number Diff line number Diff line change
Expand Up @@ -623,5 +623,6 @@ Description = {
['drlk001'] = "<LOC Unit_Description_0462> Mobile Anti-Air unit. Armed with a high-speed missiles, excellent against enemy gunships or air-fighters. Capable of switching weapon to anti-land attack but with smaller damage.",
['dalk003'] = "<LOC Unit_Description_0463> Mobile Anti-Air unit. Armed with a high-impact projectiles, excellent against enemy gunships or air-fighters.",
['dslk004'] = "<LOC Unit_Description_0464> Mobile Anti-Air unit. Armed with a long-range lasers, excellent against enemy gunships or air-fighters. Capable of switching weapon to anti-land attack but with smaller damage.",
['srl0310'] = "<LOC Unit_Description_srl0310> Mobile support unit. Designed to attack and destroy enemy shields. Weapon system only very briefly stuns enemy units.",

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local CIridiumRocketProjectile = import('/lua/cybranprojectiles.lua').CIridiumRocketProjectile
CDFRocketIridium03 = Class(CIridiumRocketProjectile) {

FxImpactUnit = import('/lua/EffectTemplates.lua').CNeutronClusterBombHitUnit01,
FxImpactProp = import('/lua/EffectTemplates.lua').CNeutronClusterBombHitUnit01,
FxImpactLand = import('/lua/EffectTemplates.lua').CNeutronClusterBombHitLand01,
FxImpactWater = import('/lua/EffectTemplates.lua').CNeutronClusterBombHitWater01,

OnImpact = function(self, targetType, targetEntity)
CIridiumRocketProjectile.OnImpact(self, targetType, targetEntity)
local army = self:GetArmy()
CreateLightParticle( self, -1, army, 2, 1, 'glow_03', 'ramp_red_06' )
CreateLightParticle( self, -1, army, 1, 3, 'glow_03', 'ramp_antimatter_02' )
if targetType == 'Shield' then
Damage(
self,
{0,0,0},
targetEntity,
self.Data,
'Normal'
)
end
end,
}

TypeClass = CDFRocketIridium03
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
ProjectileBlueprint {
Audio = {
Impact = Sound {
Bank = 'Impacts',
Cue = 'CYB_Expl_Med_Impact',
LodCutoff = 'Weapon_LodCutoff',
},
ImpactTerrain = Sound {
Bank = 'Impacts',
Cue = 'Impact_Land_Gen_CYBRAN',
LodCutoff = 'Weapon_LodCutoff',
},
ImpactWater = Sound {
Bank = 'Impacts',
Cue = 'Impact_Water_Splash_CYBRAN',
LodCutoff = 'Weapon_LodCutoff',
},
},
Categories = {
'PROJECTILE',
'INDIRECTFIRE',
'MISSILE',
},
Defense = {
Health = 1,
MaxHealth = 1,
},
Display = {
ImpactEffects = {
Scale = 1,
Type = 'Medium03',
},
Mesh = {
LODs = {
{
AlbedoName = '/units/SRL0310/SRL0310_albedo.dds',
NormalsName = '/units/SRL0310/SRL0310_normalsts.dds',
SpecularName = '/units/SRL0310/SRL0310_specteam.dds',
LODCutoff = 150,
ShaderName = 'TMeshAlpha',
},
},
},
StrategicIconSize = 1,
UniformScale = 0.03,
},
General = {
Category = 'Missile',
EntityCategory = {
'PROJECTILE',
'INDIRECTFIRE',
'MISSILE',
},
Faction = 'Cybran',
Weapon = 'Othismash EMP Missile',
},
Interface = {
HelpText = 'Othismash EMP Missile',
},
Physics = {
Acceleration = 20,
DestroyOnWater = true,
InitialSpeed = 0,
MaxSpeed = 80,
MaxZigZag = 5,
TrackTarget = true,
LeadTarget = true,
TurnRate = 20,
VelocityAlign = true,
ZigZagFrequency = 0.2,
},
}
Binary file added textures/ui/common/icons/units/SRL0310_icon.dds
Binary file not shown.
2 changes: 1 addition & 1 deletion units/DAL0310/DAL0310_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ UnitBlueprint{
Water = true,
},
},
}
}
Binary file added units/SRL0310/SRL0310_ADeath01.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_ADeath02.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_ADeath03.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_ADeath04.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_ADeath05.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_AFold.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_ARun.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_ASwim.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_ATransformWater.sca
Binary file not shown.
Binary file added units/SRL0310/SRL0310_AWalk.sca
Binary file not shown.
89 changes: 89 additions & 0 deletions units/SRL0310/SRL0310_Script.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
local CLandUnit = import('/lua/cybranunits.lua').CLandUnit
local CDFRocketIridiumWeapon = import('/lua/cybranweapons.lua').CDFRocketIridiumWeapon

SRL0310 = Class(CLandUnit) {
Weapons = {
MainGun = Class(CDFRocketIridiumWeapon) {
FxMuzzleFlash = {
'/effects/emitters/cybran_artillery_muzzle_flash_01_emit.bp',
'/effects/emitters/cybran_artillery_muzzle_flash_02_emit.bp',
-- '/effects/emitters/cybran_artillery_muzzle_smoke_01_emit.bp',
'/effects/emitters/cybran_hoplight_muzzle_smoke_01_emit.bp',
},

CreateProjectileAtMuzzle = function(self, muzzle)
local proj = CDFRocketIridiumWeapon.CreateProjectileAtMuzzle(self, muzzle)
if proj and not proj:BeenDestroyed() then
proj:PassData(self:GetBlueprint().DamageToShields)
end
end,
}
},

OnLayerChange = function(self, new, old)
CLandUnit.OnLayerChange(self, new, old)
if self.TransformThread and (new == 'Land' or new == 'Water') then
KillThread(self.TransformThread)
self.TransformThread = nil
end
if new == 'Water' then
self.TransformThread = self:ForkThread(self.LayerTransform, false, old=='Air')
self.Animator:PlayAnim(__blueprints.srl0310.Display.AnimationSwim, true)
elseif new == 'Land' and old ~= 'None' then
self.TransformThread = self:ForkThread(self.LayerTransform, true, old=='Air')
self.Animator:PlayAnim(__blueprints.srl0310.Display.AnimationWalk, true)
end
end,

OnMotionHorzEventChange = function( self, new, old )
CLandUnit.OnMotionHorzEventChange(self, new, old)
if not self.Animator then
self.Animator = CreateAnimator(self, true)
self.Animator:SetDirectionalAnim(true)
end
if old == 'Stopped' and new ~= 'Stopped' then
self.Animator:PlayAnim(self:GetCurrentLayer()=='Water' and __blueprints.srl0310.Display.AnimationSwim or __blueprints.srl0310.Display.AnimationWalk, true)
self.Animator:SetRate(__blueprints.srl0310.Display.AnimationWalkRate or 1)
elseif new == 'Stopped' then
self.Animator:SetRate(0)
end
end,

LayerTransform = function(self, land, instant)
if not self.TransformAnimator then
self.TransformAnimator = CreateAnimator(self)
end

if land then
self:SetImmobile(true)
local dur = __blueprints.srl0310.Physics.LayerTransitionDuration
self.TransformAnimator
:PlayAnim(__blueprints.srl0310.Display.AnimationTransform)
:SetRate(-self.TransformAnimator:GetAnimationDuration() / dur)
:SetAnimationFraction(instant and 0 or 1)
if not instant then
coroutine.yield(dur * 10)
end
self:SetImmobile(false)
--self:RevertCollisionShape()
else
self:SetImmobile(true)
local dur = __blueprints.srl0310.Physics.LayerTransitionDuration
self.TransformAnimator
:PlayAnim(__blueprints.srl0310.Display.AnimationTransform)
:SetRate(self.TransformAnimator:GetAnimationDuration() / dur)
:SetAnimationFraction(instant and 1 or 0)
if not instant then
coroutine.yield(dur * 10)
end
self:SetImmobile(false)
---Collision box partially in the water
--local bp = __blueprints[self.BpId]
--self:SetCollisionShape( 'Box', bp.CollisionOffsetX or 0, bp.CollisionOffsetYSwim or 1, bp.CollisionOffsetZ or 0, bp.SizeX * 0.5, bp.SizeY * 0.5, bp.SizeZ * 0.5)
end
KillThread(self.TransformThread)
self.TransformThread = nil
end,
}

TypeClass = SRL0310
Binary file added units/SRL0310/SRL0310_albedo.dds
Binary file not shown.
Binary file added units/SRL0310/SRL0310_lod0.scm
Binary file not shown.
Binary file added units/SRL0310/SRL0310_lod1.scm
Binary file not shown.
Binary file added units/SRL0310/SRL0310_lod2.scm
Binary file not shown.
Binary file added units/SRL0310/SRL0310_lod3.scm
Binary file not shown.
Binary file added units/SRL0310/SRL0310_normalsts.dds
Binary file not shown.
Binary file added units/SRL0310/SRL0310_specteam.dds
Binary file not shown.
Loading

0 comments on commit 91a3cf4

Please sign in to comment.