Skip to content

Commit

Permalink
Add ShowTicks to InfiltrateForCash
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR authored and reaperrr committed Nov 15, 2017
1 parent c762453 commit bb60062
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OpenRA.Mods.Cnc/Traits/Infiltration/InfiltrateForCash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class InfiltrateForCashInfo : ITraitInfo
[Desc("Sound the victim will hear when they get robbed.")]
public readonly string Notification = null;

[Desc("Whether to show the cash tick indicators rising from the actor.")]
public readonly bool ShowTicks = true;

public object Create(ActorInitializer init) { return new InfiltrateForCash(this); }
}

Expand All @@ -56,7 +59,8 @@ void INotifyInfiltrated.Infiltrated(Actor self, Actor infiltrator)
if (info.Notification != null)
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);

self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, infiltrator.Owner.Color.RGB, FloatingText.FormatCashTick(toGive), 30)));
if (info.ShowTicks)
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, infiltrator.Owner.Color.RGB, FloatingText.FormatCashTick(toGive), 30)));
}
}
}

0 comments on commit bb60062

Please sign in to comment.