change BulletInfo.Arcing to BulletInfo.Angle to allow more control over trajectories

This commit is contained in:
Chris Forbes
2010-07-09 21:05:00 +12:00
parent 40ae25c895
commit 5e1c63ebb5
3 changed files with 11 additions and 11 deletions

View File

@@ -34,11 +34,11 @@ namespace OpenRA.Mods.RA.Effects
public readonly float Inaccuracy = 0; // pixels at maximum range
public readonly string Image = null;
public readonly bool High = false;
public readonly bool Arcing = false;
public readonly int RangeLimit = 0;
public readonly int Arm = 0;
public readonly bool Shadow = false;
public readonly bool Proximity = false;
public readonly float Angle = 0;
public IEffect Create(ProjectileArgs args) { return new Bullet( this, args ); }
}
@@ -87,8 +87,8 @@ namespace OpenRA.Mods.RA.Effects
var altitude = float2.Lerp(Args.srcAltitude, Args.destAltitude, at);
var pos = float2.Lerp(Args.src, Args.dest, at) - new float2(0, altitude);
var highPos = (Info.High || Info.Arcing)
? (pos - new float2(0, (Args.dest - Args.src).Length * height * 4 * at * (1 - at)))
var highPos = (Info.High || Info.Angle > 0)
? (pos - new float2(0, (Args.dest - Args.src).Length * Info.Angle * 4 * at * (1 - at)))
: pos;
world.AddFrameEndTask(w => w.Add(
@@ -121,12 +121,12 @@ namespace OpenRA.Mods.RA.Effects
var altitude = float2.Lerp(Args.srcAltitude, Args.destAltitude, at);
var pos = float2.Lerp(Args.src, Args.dest, at) - new float2(0, altitude);
if (Info.High || Info.Arcing)
if (Info.High || Info.Angle > 0)
{
if (Info.Shadow)
yield return new Renderable(anim.Image, pos - .5f * anim.Image.size, "shadow");
var highPos = pos - new float2(0, (Args.dest - Args.src).Length * height * 4 * at * (1 - at));
var highPos = pos - new float2(0, (Args.dest - Args.src).Length * Info.Angle * 4 * at * (1 - at));
yield return new Renderable(anim.Image, highPos - .5f * anim.Image.size, Args.firedBy.Owner.Palette);
}

View File

@@ -203,7 +203,7 @@ Grenade:
Bullet:
Speed: 5
High: yes
Arcing: yes
Angle: .1
Inaccuracy: 5
Image: BOMB
Warhead:
@@ -354,7 +354,7 @@ Ballistic:
Bullet:
Speed: 12
High: yes
Arcing: yes
Angle: .1
Inaccuracy: 5
Image: 120MM
Warhead:

View File

@@ -229,7 +229,7 @@ Grenade:
Bullet:
Speed: 5
High: true
Arcing: true
Angle: .1
Inaccuracy: 13
Image: BOMB
Warhead:
@@ -358,7 +358,7 @@ MammothTusk:
Bullet:
Speed: 12
High: true
Arcing: true
Angle: .1
Inaccuracy: 80
Image: 120MM
Warhead:
@@ -492,7 +492,7 @@ RedEye:
Bullet:
Speed: 12
High: true
Arcing: true
Angle: .1
Inaccuracy: 120
Image: 120MM
Warhead:
@@ -571,7 +571,7 @@ DepthCharge:
Bullet:
Speed: 5
Image: BOMB
Arcing: true
Angle: .1
High: true
Inaccuracy: 3
Warhead: