fix 704 -- parachute offsets are configurable, and sensible now for infantry
This commit is contained in:
@@ -25,6 +25,7 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
|
|
||||||
readonly Actor cargo;
|
readonly Actor cargo;
|
||||||
|
|
||||||
|
int2 offset;
|
||||||
float altitude;
|
float altitude;
|
||||||
const float fallRate = .3f;
|
const float fallRate = .3f;
|
||||||
|
|
||||||
@@ -44,9 +45,13 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
else
|
else
|
||||||
anim.PlayFetchIndex("stand", () => 0);
|
anim.PlayFetchIndex("stand", () => 0);
|
||||||
anim.Tick();
|
anim.Tick();
|
||||||
|
|
||||||
|
var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();
|
||||||
|
|
||||||
paraAnim = new Animation("parach");
|
paraAnim = new Animation(pai != null ? pai.ParachuteSprite : "parach");
|
||||||
paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));
|
paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));
|
||||||
|
|
||||||
|
if (pai != null) offset = pai.Offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick(World world)
|
public void Tick(World world)
|
||||||
@@ -71,7 +76,7 @@ namespace OpenRA.Mods.RA.Effects
|
|||||||
var pos = location - new float2(0, altitude);
|
var pos = location - new float2(0, altitude);
|
||||||
yield return new Renderable(anim.Image, location - .5f * anim.Image.size, "shadow", 0);
|
yield return new Renderable(anim.Image, location - .5f * anim.Image.size, "shadow", 0);
|
||||||
yield return new Renderable(anim.Image, pos - .5f * anim.Image.size, palette, 2);
|
yield return new Renderable(anim.Image, pos - .5f * anim.Image.size, palette, 2);
|
||||||
yield return new Renderable(paraAnim.Image, pos - .5f * paraAnim.Image.size, palette, 3);
|
yield return new Renderable(paraAnim.Image, pos - .5f * paraAnim.Image.size + offset, palette, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -346,6 +346,7 @@
|
|||||||
<Compile Include="Captures.cs" />
|
<Compile Include="Captures.cs" />
|
||||||
<Compile Include="Activities\CaptureActor.cs" />
|
<Compile Include="Activities\CaptureActor.cs" />
|
||||||
<Compile Include="InvisibleToEnemy.cs" />
|
<Compile Include="InvisibleToEnemy.cs" />
|
||||||
|
<Compile Include="ParachuteAttachment.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||||
|
|||||||
26
OpenRA.Mods.RA/ParachuteAttachment.cs
Normal file
26
OpenRA.Mods.RA/ParachuteAttachment.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2011 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 System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.RA
|
||||||
|
{
|
||||||
|
class ParachuteAttachmentInfo : TraitInfo<ParachuteAttachment>
|
||||||
|
{
|
||||||
|
public readonly string ParachuteSprite = "parach";
|
||||||
|
public readonly int2 Offset = new int2(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
class ParachuteAttachment {}
|
||||||
|
}
|
||||||
@@ -102,6 +102,8 @@
|
|||||||
GivesBounty:
|
GivesBounty:
|
||||||
GpsDot:
|
GpsDot:
|
||||||
String:Infantry
|
String:Infantry
|
||||||
|
ParachuteAttachment:
|
||||||
|
Offset: 0,-10
|
||||||
|
|
||||||
^Ship:
|
^Ship:
|
||||||
AppearsOnRadar:
|
AppearsOnRadar:
|
||||||
|
|||||||
Reference in New Issue
Block a user