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

View File

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

View File

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