fix #1070; allow GiveCashCrateAction to generate a cashtick
This commit is contained in:
@@ -9,12 +9,15 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.Mods.RA.Effects;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class GiveCashCrateActionInfo : CrateActionInfo
|
class GiveCashCrateActionInfo : CrateActionInfo
|
||||||
{
|
{
|
||||||
public int Amount = 2000;
|
public int Amount = 2000;
|
||||||
|
public bool UseCashTick = false;
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new GiveCashCrateAction(init.self, this); }
|
public override object Create(ActorInitializer init) { return new GiveCashCrateAction(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +32,11 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
var amount = (info as GiveCashCrateActionInfo).Amount;
|
var amount = (info as GiveCashCrateActionInfo).Amount;
|
||||||
collector.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(amount);
|
collector.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(amount);
|
||||||
|
|
||||||
|
if ((info as GiveCashCrateActionInfo).UseCashTick)
|
||||||
|
w.Add(new CashTick(amount, 20, 1, collector.CenterLocation, collector.Owner.ColorRamp.GetColor(0)));
|
||||||
});
|
});
|
||||||
|
|
||||||
base.Activate(collector);
|
base.Activate(collector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ CRATE:
|
|||||||
GiveCashCrateAction:
|
GiveCashCrateAction:
|
||||||
Amount: 1000
|
Amount: 1000
|
||||||
SelectionShares: 20
|
SelectionShares: 20
|
||||||
Effect: dollar
|
UseCashTick: yes
|
||||||
RevealMapCrateAction:
|
RevealMapCrateAction:
|
||||||
SelectionShares: 1
|
SelectionShares: 1
|
||||||
Effect: reveal-map
|
Effect: reveal-map
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ CRATE:
|
|||||||
GiveCashCrateAction:
|
GiveCashCrateAction:
|
||||||
Amount: 1000
|
Amount: 1000
|
||||||
SelectionShares: 50
|
SelectionShares: 50
|
||||||
Effect: dollar
|
UseCashTick: yes
|
||||||
LevelUpCrateAction:
|
LevelUpCrateAction:
|
||||||
SelectionShares: 40
|
SelectionShares: 40
|
||||||
ExplodeCrateAction@fire:
|
ExplodeCrateAction@fire:
|
||||||
|
|||||||
Reference in New Issue
Block a user