Merge pull request #6331 from Mailaender/infantry-noidle-fix

Fixed Dune 2000 infantry not showing the waiting animation when ordered to stop firing
This commit is contained in:
Paul Chote
2014-09-06 09:30:55 +12:00
7 changed files with 16 additions and 43 deletions

View File

@@ -142,13 +142,18 @@ namespace OpenRA.Mods.RA.Render
if (DefaultAnimation.HasSequence(idleSequence)) if (DefaultAnimation.HasSequence(idleSequence))
{ {
state = AnimationState.IdleAnimating; state = AnimationState.IdleAnimating;
DefaultAnimation.PlayThen(idleSequence, () => DefaultAnimation.PlayThen(idleSequence, () =>
{ {
DefaultAnimation.PlayRepeating(NormalizeInfantrySequence(self, info.StandAnimations.Random(Game.CosmeticRandom))); DefaultAnimation.PlayRepeating(NormalizeInfantrySequence(self, info.StandAnimations.Random(Game.CosmeticRandom)));
state = AnimationState.Waiting; state = AnimationState.Waiting;
}); });
} }
} }
else
{
DefaultAnimation.PlayRepeating(NormalizeInfantrySequence(self, info.StandAnimations.Random(Game.CosmeticRandom)));
state = AnimationState.Waiting;
}
} }
// TODO: Possibly move this into a separate trait // TODO: Possibly move this into a separate trait
@@ -161,7 +166,7 @@ namespace OpenRA.Mods.RA.Render
if (info.SpawnsCorpse) if (info.SpawnsCorpse)
{ {
SpawnCorpse(self, info.DeathAnimationPrefix + (e.Warhead.DeathType)); SpawnCorpse(self, info.DeathAnimationPrefix + (e.Warhead.DeathType));
} }
} }
public void SpawnCorpse(Actor self, string sequence) public void SpawnCorpse(Actor self, string sequence)

View File

@@ -24,6 +24,8 @@ namespace OpenRA.Mods.RA
public readonly WVec ProneOffset = new WVec(85, 0, -171); public readonly WVec ProneOffset = new WVec(85, 0, -171);
public readonly string ProneSequencePrefix = "prone-";
public override object Create(ActorInitializer init) { return new TakeCover(init, this); } public override object Create(ActorInitializer init) { return new TakeCover(init, this); }
} }
@@ -34,7 +36,7 @@ namespace OpenRA.Mods.RA
bool isProne { get { return remainingProneTime > 0; } } bool isProne { get { return remainingProneTime > 0; } }
public bool IsModifyingSequence { get { return isProne; } } public bool IsModifyingSequence { get { return isProne; } }
public string SequencePrefix { get { return "prone-"; } } public string SequencePrefix { get { return info.ProneSequencePrefix ; } }
public TakeCover(ActorInitializer init, TakeCoverInfo info) public TakeCover(ActorInitializer init, TakeCoverInfo info)
: base(init, info) : base(init, info)

View File

@@ -233,7 +233,7 @@ FREMEN:
Weapon: Slung Weapon: Slung
AttackFrontal: AttackFrontal:
RenderInfantry: RenderInfantry:
IdleAnimations: stand,stand2 IdleAnimations: stand
TakeCover: TakeCover:
Cloak: Cloak:
InitialDelay: 250 InitialDelay: 250
@@ -265,7 +265,7 @@ GRENADIER:
AttackFrontal: AttackFrontal:
TakeCover: TakeCover:
RenderInfantry: RenderInfantry:
IdleAnimations: stand,stand2 IdleAnimations: stand
Explodes: Explodes:
Weapon: UnitExplodeSmall Weapon: UnitExplodeSmall
Chance: 100 Chance: 100

View File

@@ -171,6 +171,7 @@
TargetableUnit: TargetableUnit:
TargetTypes: Ground TargetTypes: Ground
RenderInfantry: RenderInfantry:
TakeCover:
AutoTarget: AutoTarget:
AttackMove: AttackMove:
Passenger: Passenger:

View File

@@ -231,7 +231,7 @@ SARDAUKAR:
Range: 6c0 Range: 6c0
TakeCover: TakeCover:
RenderInfantry: RenderInfantry:
IdleAnimations: stand,stand2 IdleAnimations: stand
Armament@PRIMARY: Armament@PRIMARY:
Weapon: Vulcan Weapon: Vulcan
Armament@SECONDARY: Armament@SECONDARY:

View File

@@ -20,7 +20,7 @@ RIFLE:
AttackFrontal: AttackFrontal:
TakeCover: TakeCover:
RenderInfantry: RenderInfantry:
IdleAnimations: stand,stand2 IdleAnimations: stand
ENGINEER: ENGINEER:
Inherits: ^Infantry Inherits: ^Infantry
@@ -72,7 +72,7 @@ BAZOOKA:
AttackFrontal: AttackFrontal:
TakeCover: TakeCover:
RenderInfantry: RenderInfantry:
IdleAnimations: stand,stand2 IdleAnimations: stand
MEDIC: MEDIC:
Inherits: ^Infantry Inherits: ^Infantry

View File

@@ -3,14 +3,6 @@ rifle:
Start: 206 Start: 206
Facings: -8 Facings: -8
Transpose: true Transpose: true
stand2: DATA
Start: 206
Facings: -8
Transpose: true
stand3: DATA
Start: 206
Facings: -8
Transpose: true
run: DATA run: DATA
Start: 214 Start: 214
Length: 6 Length: 6
@@ -142,10 +134,6 @@ engineer:
Start: 1166 Start: 1166
Facings: -8 Facings: -8
Transpose: true Transpose: true
stand2: DATA
Start: 1166
Facings: -8
Transpose: true
run: DATA run: DATA
Start: 1174 Start: 1174
Length: 6 Length: 6
@@ -182,10 +170,6 @@ medic: # actually thumper
Start: 1402 Start: 1402
Facings: -8 Facings: -8
Transpose: true Transpose: true
stand2: DATA
Start: 1402
Facings: -8
Transpose: true
run: DATA run: DATA
Start: 1410 Start: 1410
Length: 6 Length: 6
@@ -242,10 +226,6 @@ fremen:
Start: 694 Start: 694
Facings: -8 Facings: -8
Transpose: true Transpose: true
stand2: DATA
Start: 694
Facings: -8
Transpose: true
run: DATA run: DATA
Start: 702 Start: 702
Length: 6 Length: 6
@@ -309,14 +289,6 @@ saboteur:
Start: 2149 Start: 2149
Facings: -8 Facings: -8
Transpose: true Transpose: true
stand2: DATA
Start: 2149
Facings: -8
Transpose: true
stand3: DATA
Start: 2149
Facings: -8
Transpose: true
run: DATA run: DATA
Start: 2157 Start: 2157
Length: 6 Length: 6
@@ -370,10 +342,6 @@ sardaukar:
Start: 930 Start: 930
Facings: -8 Facings: -8
Transpose: true Transpose: true
stand2: DATA
Start: 930
Facings: -8
Transpose: true
run: DATA run: DATA
Start: 938 Start: 938
Length: 6 Length: 6
@@ -436,9 +404,6 @@ grenadier: # 2502 - 2749 in 1.06 DATA.R8
stand: stand:
Start: 0 Start: 0
Facings: 8 Facings: 8
stand2:
Start: 8
Facings: 8
idle: idle:
Start: 203 Start: 203
Length: 16 Length: 16