From b8973cd5e71fee98a64ebf1911e25d6dc0a7d2f5 Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Thu, 16 Jul 2015 19:10:43 -0500 Subject: [PATCH 1/2] Add some newlines to BulletInfo for readability. --- OpenRA.Mods.Common/Effects/Bullet.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index 5f7d1c702e..f6f3912c59 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -24,22 +24,34 @@ namespace OpenRA.Mods.Common.Effects { [Desc("Projectile speed in WDist / tick, two values indicate variable velocity.")] public readonly WDist[] Speed = { new WDist(17) }; + [Desc("Maximum offset at the maximum range.")] public readonly WDist Inaccuracy = WDist.Zero; + public readonly string Image = null; - [SequenceReference("Image")] public readonly string Sequence = "idle"; + + [SequenceReference("Image")] + public readonly string Sequence = "idle"; + public readonly string Palette = "effect"; + public readonly bool Shadow = false; + [Desc("Trail animation.")] public readonly string Trail = null; + [Desc("Is this blocked by actors with BlocksProjectiles trait.")] public readonly bool Blockable = true; + [Desc("Arc in WAngles, two values indicate variable arc.")] public readonly WAngle[] Angle = { WAngle.Zero }; + [Desc("Interval in ticks between each spawned Trail animation.")] public readonly int TrailInterval = 2; + [Desc("Delay in ticks until trail animaion is spawned.")] public readonly int TrailDelay = 1; + public readonly string TrailPalette = "effect"; public readonly bool TrailUsePlayerPalette = false; public readonly int ContrailLength = 0; From 847ce0d3a7400d8c2e4f1070ca43a90822789d53 Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Thu, 16 Jul 2015 19:19:28 -0500 Subject: [PATCH 2/2] Add some descriptions to BulletInfo. Unhardcode a sequence and a palette in Bullet. --- OpenRA.Mods.Common/Effects/Bullet.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index f6f3912c59..30236ec260 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -28,15 +28,21 @@ namespace OpenRA.Mods.Common.Effects [Desc("Maximum offset at the maximum range.")] public readonly WDist Inaccuracy = WDist.Zero; + [Desc("Image to display.")] public readonly string Image = null; - [SequenceReference("Image")] + [Desc("Loop this sequence of Image while this projectile is moving."), SequenceReference("Image")] public readonly string Sequence = "idle"; + [Desc("The palette used to draw this projectile.")] public readonly string Palette = "effect"; + [Desc("Does this projectile have a shadow?")] public readonly bool Shadow = false; + [Desc("Palette to use for this projectile's shadow if Shadow is true.")] + public readonly string ShadowPalette = "shadow"; + [Desc("Trail animation.")] public readonly string Trail = null; @@ -112,7 +118,7 @@ namespace OpenRA.Mods.Common.Effects if (!string.IsNullOrEmpty(info.Image)) { anim = new Animation(world, info.Image, GetEffectiveFacing); - anim.PlayRepeating("idle"); + anim.PlayRepeating(info.Sequence); } if (info.ContrailLength > 0) @@ -176,7 +182,7 @@ namespace OpenRA.Mods.Common.Effects if (info.Shadow) { var shadowPos = pos - new WVec(0, 0, pos.Z); - foreach (var r in anim.Render(shadowPos, wr.Palette("shadow"))) + foreach (var r in anim.Render(shadowPos, wr.Palette(info.ShadowPalette))) yield return r; }