Update copyright header. Normalize line endings to LF.
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* 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 LICENSE.
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.GameRules;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Traits
|
||||
public class HealthInfo : ITraitInfo
|
||||
{
|
||||
public readonly int HP = 0;
|
||||
public readonly float Radius = 10;
|
||||
public readonly float Radius = 10;
|
||||
public virtual object Create(ActorInitializer init) { return new Health(init, this); }
|
||||
}
|
||||
|
||||
@@ -38,10 +38,10 @@ namespace OpenRA.Traits
|
||||
}
|
||||
|
||||
public int HP { get { return hp; } }
|
||||
public readonly int MaxHP;
|
||||
public float HPFraction
|
||||
{
|
||||
get { return hp * 1f / MaxHP; }
|
||||
public readonly int MaxHP;
|
||||
public float HPFraction
|
||||
{
|
||||
get { return hp * 1f / MaxHP; }
|
||||
}
|
||||
|
||||
public bool IsDead { get { return hp <= 0; } }
|
||||
@@ -76,14 +76,14 @@ namespace OpenRA.Traits
|
||||
|
||||
var oldState = this.DamageState;
|
||||
|
||||
/* apply the damage modifiers, if we have any. */
|
||||
/* apply the damage modifiers, if we have any. */
|
||||
var modifier = (float)self.TraitsImplementing<IDamageModifier>().Concat(self.Owner.PlayerActor.TraitsImplementing<IDamageModifier>())
|
||||
.Select(t => t.GetDamageModifier(attacker, warhead)).Product();
|
||||
|
||||
damage = (int)(damage * modifier);
|
||||
|
||||
hp -= damage;
|
||||
|
||||
hp -= damage;
|
||||
|
||||
foreach (var nd in self.TraitsImplementing<INotifyDamage>().Concat(self.Owner.PlayerActor.TraitsImplementing<INotifyDamage>()))
|
||||
nd.Damaged(self, new AttackInfo
|
||||
{
|
||||
@@ -92,7 +92,7 @@ namespace OpenRA.Traits
|
||||
DamageState = this.DamageState,
|
||||
PreviousDamageState = oldState,
|
||||
DamageStateChanged = this.DamageState != oldState,
|
||||
Warhead = warhead,
|
||||
Warhead = warhead,
|
||||
PreviousHealth = hp + damage < 0 ? 0 : hp + damage,
|
||||
Health = hp
|
||||
});
|
||||
@@ -102,9 +102,9 @@ namespace OpenRA.Traits
|
||||
hp = 0;
|
||||
|
||||
attacker.Owner.Kills++;
|
||||
self.Owner.Deaths++;
|
||||
|
||||
if( RemoveOnDeath )
|
||||
self.Owner.Deaths++;
|
||||
|
||||
if( RemoveOnDeath )
|
||||
self.Destroy();
|
||||
|
||||
Log.Write("debug", "{0} #{1} killed by {2} #{3}", self.Info.Name, self.ActorID, attacker.Info.Name, attacker.ActorID);
|
||||
|
||||
Reference in New Issue
Block a user