Merge pull request #8261 from Mailaender/cyborgs
Added the Tiberian Sun cyborg logic
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
<Compile Include="Activities\VoxelHarvesterDockSequence.cs" />
|
<Compile Include="Activities\VoxelHarvesterDockSequence.cs" />
|
||||||
<Compile Include="SpriteLoaders\TmpTSLoader.cs" />
|
<Compile Include="SpriteLoaders\TmpTSLoader.cs" />
|
||||||
<Compile Include="Traits\Buildings\TiberianSunRefinery.cs" />
|
<Compile Include="Traits\Buildings\TiberianSunRefinery.cs" />
|
||||||
|
<Compile Include="Traits\Render\WithPermanentInjury.cs" />
|
||||||
<Compile Include="Traits\Render\WithVoxelWalkerBody.cs" />
|
<Compile Include="Traits\Render\WithVoxelWalkerBody.cs" />
|
||||||
<Compile Include="Traits\Render\WithVoxelUnloadBody.cs" />
|
<Compile Include="Traits\Render\WithVoxelUnloadBody.cs" />
|
||||||
<Compile Include="Traits\Render\WithVoxelWaterBody.cs" />
|
<Compile Include="Traits\Render\WithVoxelWaterBody.cs" />
|
||||||
|
|||||||
46
OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs
Normal file
46
OpenRA.Mods.TS/Traits/Render/WithPermanentInjury.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see COPYING.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using OpenRA.Mods.Common.Traits;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.TS.Traits
|
||||||
|
{
|
||||||
|
[Desc("Change the sprite after a certain amount of damage is taken, even when the hitpoints are regenerated.")]
|
||||||
|
public class WithPermanentInjuryInfo : ITraitInfo
|
||||||
|
{
|
||||||
|
public readonly DamageState TriggeringDamageStage = DamageState.Critical;
|
||||||
|
|
||||||
|
public readonly string InjuredSequencePrefix = "crippled-";
|
||||||
|
|
||||||
|
public object Create(ActorInitializer init) { return new WithPermanentInjury(init, this); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WithPermanentInjury : INotifyDamage, IRenderInfantrySequenceModifier
|
||||||
|
{
|
||||||
|
readonly WithPermanentInjuryInfo info;
|
||||||
|
|
||||||
|
bool isInjured;
|
||||||
|
|
||||||
|
public bool IsModifyingSequence { get { return isInjured; } }
|
||||||
|
public string SequencePrefix { get { return info.InjuredSequencePrefix; } }
|
||||||
|
|
||||||
|
public WithPermanentInjury(ActorInitializer init, WithPermanentInjuryInfo info)
|
||||||
|
{
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Damaged(Actor self, AttackInfo e)
|
||||||
|
{
|
||||||
|
if (e.DamageState == info.TriggeringDamageStage)
|
||||||
|
isInjured = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -62,16 +62,9 @@ CYBORG:
|
|||||||
Armament:
|
Armament:
|
||||||
Weapon: Vulcan3
|
Weapon: Vulcan3
|
||||||
AttackFrontal:
|
AttackFrontal:
|
||||||
TakeCover:
|
|
||||||
DamageModifiers:
|
|
||||||
Prone50Percent: 50
|
|
||||||
Prone60Percent: 60
|
|
||||||
Prone70Percent: 70
|
|
||||||
Prone100Percent: 100
|
|
||||||
Prone350Percent: 350
|
|
||||||
DamageTriggers: TriggerProne
|
|
||||||
WithInfantryBody:
|
WithInfantryBody:
|
||||||
IdleSequences: idle1,idle2
|
IdleSequences: idle1,idle2
|
||||||
|
WithPermanentInjury:
|
||||||
|
|
||||||
CYC2:
|
CYC2:
|
||||||
Inherits: ^Infantry
|
Inherits: ^Infantry
|
||||||
@@ -105,16 +98,9 @@ CYC2:
|
|||||||
Weapon: CyCannon
|
Weapon: CyCannon
|
||||||
LocalOffset: 170,85,683
|
LocalOffset: 170,85,683
|
||||||
AttackFrontal:
|
AttackFrontal:
|
||||||
TakeCover:
|
|
||||||
DamageModifiers:
|
|
||||||
Prone50Percent: 50
|
|
||||||
Prone60Percent: 60
|
|
||||||
Prone70Percent: 70
|
|
||||||
Prone100Percent: 100
|
|
||||||
Prone350Percent: 350
|
|
||||||
DamageTriggers: TriggerProne
|
|
||||||
WithInfantryBody:
|
WithInfantryBody:
|
||||||
IdleSequences: idle1,idle2
|
IdleSequences: idle1,idle2
|
||||||
|
WithPermanentInjury:
|
||||||
|
|
||||||
MHIJACK:
|
MHIJACK:
|
||||||
Inherits: ^Infantry
|
Inherits: ^Infantry
|
||||||
|
|||||||
@@ -761,12 +761,12 @@ cyc2:
|
|||||||
Start: 95
|
Start: 95
|
||||||
Length: 15
|
Length: 15
|
||||||
ShadowStart: 403
|
ShadowStart: 403
|
||||||
prone-run:
|
crippled-run:
|
||||||
Start: 110
|
Start: 110
|
||||||
Length: 9
|
Length: 9
|
||||||
Facings: 8
|
Facings: 8
|
||||||
ShadowStart: 418
|
ShadowStart: 418
|
||||||
prone-stand:
|
crippled-stand:
|
||||||
Start: 110
|
Start: 110
|
||||||
Facings: 8
|
Facings: 8
|
||||||
Stride: 9
|
Stride: 9
|
||||||
@@ -786,16 +786,11 @@ cyc2:
|
|||||||
Length: 6
|
Length: 6
|
||||||
Facings: 8
|
Facings: 8
|
||||||
ShadowStart: 520
|
ShadowStart: 520
|
||||||
prone-shoot:
|
crippled-shoot:
|
||||||
Start: 260
|
Start: 260
|
||||||
Length: 6
|
Length: 6
|
||||||
Facings: 8
|
Facings: 8
|
||||||
ShadowStart: 568
|
ShadowStart: 568
|
||||||
standup-0: # TODO: N/A as they only crawl when severly damaged
|
|
||||||
Start: 260
|
|
||||||
Length: 2
|
|
||||||
Facings: 8
|
|
||||||
ShadowStart: 568
|
|
||||||
die5: flameguy # TODO: walking animation unused
|
die5: flameguy # TODO: walking animation unused
|
||||||
Start: 42
|
Start: 42
|
||||||
Length: 104
|
Length: 104
|
||||||
@@ -823,12 +818,12 @@ cyborg:
|
|||||||
Start: 71
|
Start: 71
|
||||||
Length: 15
|
Length: 15
|
||||||
ShadowStart: 441
|
ShadowStart: 441
|
||||||
prone-run:
|
crippled-run:
|
||||||
Start: 86
|
Start: 86
|
||||||
Length: 6
|
Length: 6
|
||||||
Facings: 8
|
Facings: 8
|
||||||
ShadowStart: 456
|
ShadowStart: 456
|
||||||
prone-stand:
|
crippled-stand:
|
||||||
Start: 86
|
Start: 86
|
||||||
Facings: 8
|
Facings: 8
|
||||||
Stride: 6
|
Stride: 6
|
||||||
@@ -846,16 +841,11 @@ cyborg:
|
|||||||
Length: 6
|
Length: 6
|
||||||
Facings: 8
|
Facings: 8
|
||||||
ShadowStart: 534
|
ShadowStart: 534
|
||||||
prone-shoot:
|
crippled-shoot:
|
||||||
Start: 212
|
Start: 212
|
||||||
Length: 6
|
Length: 6
|
||||||
Facings: 8
|
Facings: 8
|
||||||
ShadowStart: 582
|
ShadowStart: 582
|
||||||
standup-0: # TODO: N/A as they don't do that
|
|
||||||
Start: 260
|
|
||||||
Length: 2
|
|
||||||
Facings: 8
|
|
||||||
ShadowStart: 630
|
|
||||||
die5: # TODO: unused running frame 322 and following
|
die5: # TODO: unused running frame 322 and following
|
||||||
Start: 292
|
Start: 292
|
||||||
Length: 14
|
Length: 14
|
||||||
|
|||||||
Reference in New Issue
Block a user