-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It'll show a timer to the enemy with the real name. Will play SCUD Storm launched notification when activated, but won't do anything else otherwise.
- Loading branch information
1 parent
72ad483
commit bbb849e
Showing
7 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#region Copyright & License Information | ||
/* | ||
* Copyright (c) The OpenRA Developers and Contributors | ||
* This file is part of OpenRA, which is free software. It is made | ||
* available to you under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation, either version 3 of | ||
* the License, or (at your option) any later version. For more | ||
* information, see COPYING. | ||
*/ | ||
#endregion | ||
|
||
using OpenRA.Mods.Common.Traits; | ||
using OpenRA.Traits; | ||
|
||
namespace OpenRA.Mods.GenSDK.Traits | ||
{ | ||
[Desc("Fake power that does nothing but play activation voices/sounds when activated.")] | ||
public class FakePowerInfo : SupportPowerInfo | ||
{ | ||
public override object Create(ActorInitializer init) { return new FakePower(init.Self, this); } | ||
} | ||
|
||
public class FakePower : SupportPower, IResolveOrder | ||
{ | ||
public readonly FakePowerInfo FakePowerInfo; | ||
|
||
public FakePower(Actor self, FakePowerInfo info) | ||
: base(self, info) | ||
{ | ||
FakePowerInfo = info; | ||
} | ||
|
||
public override void SelectTarget(Actor self, string order, SupportPowerManager manager) | ||
{ | ||
self.World.IssueOrder(new Order(order, manager.Self, false)); | ||
} | ||
|
||
public override void Activate(Actor self, Order order, SupportPowerManager manager) | ||
{ | ||
base.Activate(self, order, manager); | ||
|
||
Activation(self); | ||
} | ||
|
||
void IResolveOrder.ResolveOrder(Actor self, Order order) | ||
{ | ||
if (order.OrderString.Contains(Info.OrderName)) | ||
Activation(self); | ||
} | ||
|
||
void Activation(Actor self) | ||
{ | ||
PlayLaunchSounds(); | ||
if (self.Owner.IsAlliedWith(self.World.RenderPlayer)) | ||
Game.Sound.Play(SoundType.World, FakePowerInfo.LaunchSound); | ||
else | ||
Game.Sound.Play(SoundType.World, FakePowerInfo.IncomingSound); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters