Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty the default of TrailSequences in NukePower #16546

Merged
merged 2 commits into from May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions OpenRA.Mods.Common/Traits/SupportPowers/NukePower.cs
Expand Up @@ -9,7 +9,7 @@
*/
#endregion

using OpenRA.Effects;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Effects;
using OpenRA.Traits;
Expand Down Expand Up @@ -52,7 +52,7 @@ class NukePowerInfo : SupportPowerInfo, IRulesetLoaded, Requires<BodyOrientation
public readonly string TrailImage = null;

[Desc("Loop a randomly chosen sequence of TrailImage from this list while this projectile is moving.")]
[SequenceReference("TrailImage")] public readonly string[] TrailSequences = { "idle" };
[SequenceReference("TrailImage")] public readonly string[] TrailSequences = { };
abcdefg30 marked this conversation as resolved.
Show resolved Hide resolved

[Desc("Interval in ticks between each spawned Trail animation.")]
public readonly int TrailInterval = 1;
Expand Down Expand Up @@ -101,6 +101,9 @@ class NukePowerInfo : SupportPowerInfo, IRulesetLoaded, Requires<BodyOrientation
public override object Create(ActorInitializer init) { return new NukePower(init.Self, this); }
public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
{
if (!string.IsNullOrEmpty(TrailImage) && !TrailSequences.Any())
throw new YamlException("At least one entry in TrailSequences must be defined when TrailImage is defined.");

WeaponInfo weapon;
var weaponToLower = (MissileWeapon ?? string.Empty).ToLowerInvariant();
if (!rules.Weapons.TryGetValue(weaponToLower, out weapon))
Expand Down
1 change: 1 addition & 0 deletions mods/d2k/rules/structures.yaml
Expand Up @@ -1164,6 +1164,7 @@ palace:
FlightVelocity: 384
TrailInterval: 0
TrailImage: large_trail
TrailSequences: idle
ProduceActorPower@fremen:
Description: Recruit Fremen
LongDesc: Elite infantry unit armed with assault rifles and rockets\n Strong vs Infantry, Vehicles\n Weak vs Artillery\n Special Ability: Invisibility
Expand Down
1 change: 1 addition & 0 deletions mods/ts/rules/nod-support.yaml
Expand Up @@ -376,6 +376,7 @@ NAMISL:
TrailImage: small_smoke_trail
TrailPalette: effectalpha75
TrailInterval: 0
TrailSequences: idle
WithNukeLaunchOverlay:
SelectionDecorations:

Expand Down