make cash ticks consistent with per-player shroud and observers

This commit is contained in:
Matthias Mailänder
2013-05-11 13:01:33 +02:00
parent 05d187d327
commit f4a4afbb69
4 changed files with 5 additions and 5 deletions

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Activities
foreach (var ns in self.TraitsImplementing<INotifySold>()) foreach (var ns in self.TraitsImplementing<INotifySold>())
ns.Sold(self); ns.Sold(self);
if (refund > 0 && self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally) if (refund > 0 && self.Owner.IsAlliedWith(self.World.RenderPlayer))
self.World.AddFrameEndTask(w => w.Add(new CashTick(refund, 30, 2, self.CenterLocation, self.Owner.Color.RGB))); self.World.AddFrameEndTask(w => w.Add(new CashTick(refund, 30, 2, self.CenterLocation, self.Owner.Color.RGB)));
self.Destroy(); self.Destroy();

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA
// 2 hundreds because of GetMultiplier and info.Percentage. // 2 hundreds because of GetMultiplier and info.Percentage.
var bounty = cost * GetMultiplier(self) * info.Percentage / 10000; var bounty = cost * GetMultiplier(self) * info.Percentage / 10000;
if (bounty > 0 && e.Attacker.World.LocalPlayer != null && e.Attacker.Owner.Stances[e.Attacker.World.LocalPlayer] == Stance.Ally) if (bounty > 0 && e.Attacker.Owner.IsAlliedWith(self.World.RenderPlayer))
e.Attacker.World.AddFrameEndTask(w => w.Add(new CashTick(bounty, 20, 1, self.CenterLocation, e.Attacker.Owner.Color.RGB))); e.Attacker.World.AddFrameEndTask(w => w.Add(new CashTick(bounty, 20, 1, self.CenterLocation, e.Attacker.Owner.Color.RGB)));
e.Attacker.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(bounty); e.Attacker.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(bounty);

View File

@@ -92,7 +92,7 @@ namespace OpenRA.Mods.RA
if (Info.ShowTicks && currentDisplayValue > 0 && --currentDisplayTick <= 0) if (Info.ShowTicks && currentDisplayValue > 0 && --currentDisplayTick <= 0)
{ {
var temp = currentDisplayValue; var temp = currentDisplayValue;
if (self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally) if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
self.World.AddFrameEndTask(w => w.Add(new CashTick(temp, Info.TickLifetime, Info.TickVelocity, self.CenterLocation, self.Owner.Color.RGB))); self.World.AddFrameEndTask(w => w.Add(new CashTick(temp, Info.TickLifetime, Info.TickVelocity, self.CenterLocation, self.Owner.Color.RGB)));
currentDisplayTick = Info.TickRate; currentDisplayTick = Info.TickRate;
currentDisplayValue = 0; currentDisplayValue = 0;