Renormalize line endings and fix copyright headers again.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -20,8 +20,8 @@ namespace OpenRA.Mods.RA
|
||||
[ActorReference]
|
||||
public readonly string UnitType = "badr.bomber";
|
||||
[ActorReference]
|
||||
public readonly string FlareType = null;
|
||||
|
||||
public readonly string FlareType = null;
|
||||
|
||||
public readonly int FlareTime = 25 * 60 * 2; // 2 minutes
|
||||
|
||||
public override object Create(ActorInitializer init) { return new AirstrikePower(init.self, this); }
|
||||
@@ -40,12 +40,12 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
new LocationInit( order.TargetLocation ),
|
||||
new OwnerInit( self.Owner ),
|
||||
}) : null;
|
||||
|
||||
if (flare != null)
|
||||
{
|
||||
flare.QueueActivity(new Wait(info.FlareTime));
|
||||
flare.QueueActivity(new RemoveSelf());
|
||||
}) : null;
|
||||
|
||||
if (flare != null)
|
||||
{
|
||||
flare.QueueActivity(new Wait(info.FlareTime));
|
||||
flare.QueueActivity(new RemoveSelf());
|
||||
}
|
||||
|
||||
var a = w.CreateActor(info.UnitType, new TypeDictionary
|
||||
|
||||
@@ -46,40 +46,40 @@ namespace OpenRA.Mods.RA
|
||||
w.Add(new DelayedAction((Info as GpsPowerInfo).RevealDelay * 25,
|
||||
() => { Granted = true; RefreshGps(self); }));
|
||||
});
|
||||
}
|
||||
|
||||
public void Selling(Actor self)
|
||||
{
|
||||
DisableGps();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Selling(Actor self)
|
||||
{
|
||||
DisableGps();
|
||||
}
|
||||
|
||||
public void Sold(Actor self) { }
|
||||
|
||||
public void Damaged(Actor self, AttackInfo e)
|
||||
{
|
||||
if (e.DamageState == DamageState.Dead)
|
||||
{
|
||||
{
|
||||
DisableGps();
|
||||
}
|
||||
}
|
||||
|
||||
void DisableGps()
|
||||
{
|
||||
Granted = false;
|
||||
RefreshGps(self);
|
||||
}
|
||||
|
||||
void DisableGps()
|
||||
{
|
||||
Granted = false;
|
||||
RefreshGps(self);
|
||||
}
|
||||
|
||||
void RefreshGps(Actor self)
|
||||
{
|
||||
if (self.World.LocalPlayer != null)
|
||||
self.World.LocalShroud.Disabled = self.World.ActorsWithTrait<GpsPower>()
|
||||
.Any(p => p.Actor.Owner.Stances[self.World.LocalPlayer] == Stance.Ally &&
|
||||
p.Trait.Granted);
|
||||
}
|
||||
|
||||
public void StanceChanged(Actor self, Player a, Player b, Stance oldStance, Stance newStance)
|
||||
{
|
||||
RefreshGps(self);
|
||||
}
|
||||
{
|
||||
if (self.World.LocalPlayer != null)
|
||||
self.World.LocalShroud.Disabled = self.World.ActorsWithTrait<GpsPower>()
|
||||
.Any(p => p.Actor.Owner.Stances[self.World.LocalPlayer] == Stance.Ally &&
|
||||
p.Trait.Granted);
|
||||
}
|
||||
|
||||
public void StanceChanged(Actor self, Player a, Player b, Stance oldStance, Stance newStance)
|
||||
{
|
||||
RefreshGps(self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
#endregion
|
||||
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -22,8 +22,8 @@ namespace OpenRA.Mods.RA
|
||||
[ActorReference]
|
||||
public string UnitType = "badr";
|
||||
[ActorReference]
|
||||
public string FlareType = "flare";
|
||||
|
||||
public string FlareType = "flare";
|
||||
|
||||
public readonly int FlareTime = 25 * 60 * 2; // 2 minutes
|
||||
|
||||
public override object Create(ActorInitializer init) { return new ParatroopersPower(init.self, this); }
|
||||
@@ -45,12 +45,12 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
new LocationInit( order.TargetLocation ),
|
||||
new OwnerInit( self.Owner ),
|
||||
}) : null;
|
||||
|
||||
if (flare != null)
|
||||
{
|
||||
flare.QueueActivity(new Wait(info.FlareTime));
|
||||
flare.QueueActivity(new RemoveSelf());
|
||||
}) : null;
|
||||
|
||||
if (flare != null)
|
||||
{
|
||||
flare.QueueActivity(new Wait(info.FlareTime));
|
||||
flare.QueueActivity(new RemoveSelf());
|
||||
}
|
||||
|
||||
var a = w.CreateActor(info.UnitType, new TypeDictionary
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
#region Copyright & License Information
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* 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. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
class SupportPowerChargeBarInfo : ITraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new SupportPowerChargeBar(init.self); }
|
||||
}
|
||||
|
||||
class SupportPowerChargeBar : ISelectionBar
|
||||
{
|
||||
Actor self;
|
||||
public SupportPowerChargeBar(Actor self) { this.self = self; }
|
||||
|
||||
public float GetValue()
|
||||
{
|
||||
// only people we like should see our charge status.
|
||||
if (self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] != Stance.Ally)
|
||||
return 0;
|
||||
|
||||
var spm = self.Owner.PlayerActor.Trait<SupportPowerManager>();
|
||||
var power = spm.GetPowersForActor(self).FirstOrDefault(sp => !sp.Disabled);
|
||||
|
||||
if (power == null) return 0;
|
||||
|
||||
return 1 - (float)power.RemainingTime / power.TotalTime;
|
||||
}
|
||||
|
||||
public Color GetColor() { return Color.Magenta; }
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
class SupportPowerChargeBarInfo : ITraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new SupportPowerChargeBar(init.self); }
|
||||
}
|
||||
|
||||
class SupportPowerChargeBar : ISelectionBar
|
||||
{
|
||||
Actor self;
|
||||
public SupportPowerChargeBar(Actor self) { this.self = self; }
|
||||
|
||||
public float GetValue()
|
||||
{
|
||||
// only people we like should see our charge status.
|
||||
if (self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] != Stance.Ally)
|
||||
return 0;
|
||||
|
||||
var spm = self.Owner.PlayerActor.Trait<SupportPowerManager>();
|
||||
var power = spm.GetPowersForActor(self).FirstOrDefault(sp => !sp.Disabled);
|
||||
|
||||
if (power == null) return 0;
|
||||
|
||||
return 1 - (float)power.RemainingTime / power.TotalTime;
|
||||
}
|
||||
|
||||
public Color GetColor() { return Color.Magenta; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,11 +34,11 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
init.world.ActorAdded += ActorAdded;
|
||||
init.world.ActorRemoved += ActorRemoved;
|
||||
}
|
||||
|
||||
static string MakeKey(SupportPower sp)
|
||||
{
|
||||
return sp.Info.AllowMultiple ? sp.Info.OrderName + "_" + sp.self.ActorID : sp.Info.OrderName;
|
||||
}
|
||||
|
||||
static string MakeKey(SupportPower sp)
|
||||
{
|
||||
return sp.Info.AllowMultiple ? sp.Info.OrderName + "_" + sp.self.ActorID : sp.Info.OrderName;
|
||||
}
|
||||
|
||||
void ActorAdded(Actor a)
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA
|
||||
return;
|
||||
|
||||
foreach (var t in a.TraitsImplementing<SupportPower>())
|
||||
{
|
||||
{
|
||||
var key = MakeKey(t);
|
||||
|
||||
if (Powers.ContainsKey(key))
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.RA
|
||||
return;
|
||||
|
||||
foreach (var t in a.TraitsImplementing<SupportPower>())
|
||||
{
|
||||
{
|
||||
var key = MakeKey(t);
|
||||
Powers[key].Instances.Remove(t);
|
||||
if (Powers[key].Instances.Count == 0 && !Powers[key].Disabled)
|
||||
@@ -99,17 +99,17 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
if (Powers.ContainsKey(key))
|
||||
Powers[key].Target();
|
||||
}
|
||||
|
||||
static readonly SupportPowerInstance[] NoInstances = {};
|
||||
|
||||
public IEnumerable<SupportPowerInstance> GetPowersForActor(Actor a)
|
||||
{
|
||||
if (a.Owner != self.Owner || !a.HasTrait<SupportPower>())
|
||||
return NoInstances;
|
||||
|
||||
return a.TraitsImplementing<SupportPower>()
|
||||
.Select(t => Powers[MakeKey(t)]);
|
||||
}
|
||||
|
||||
static readonly SupportPowerInstance[] NoInstances = {};
|
||||
|
||||
public IEnumerable<SupportPowerInstance> GetPowersForActor(Actor a)
|
||||
{
|
||||
if (a.Owner != self.Owner || !a.HasTrait<SupportPower>())
|
||||
return NoInstances;
|
||||
|
||||
return a.TraitsImplementing<SupportPower>()
|
||||
.Select(t => Powers[MakeKey(t)]);
|
||||
}
|
||||
|
||||
public class SupportPowerInstance
|
||||
|
||||
Reference in New Issue
Block a user