forked from FAForever/fa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a Cybran version of the Absolver (FAForever#5869)
Co-authored-by: (Jip) Willem Wijnia <[email protected]> Co-authored-by: (Jip) Willem Wijnia <[email protected]>
- Loading branch information
1 parent
eea17d3
commit 91a3cf4
Showing
25 changed files
with
496 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
projectiles/CIFOthismashEMPMissile01/CIFOthismashEMPMissile01_Script.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
72 changes: 72 additions & 0 deletions
72
projectiles/CIFOthismashEMPMissile01/CIFOthismashEMPMissile01_proj.bp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,4 +246,4 @@ UnitBlueprint{ | |
Water = true, | ||
}, | ||
}, | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.