Rename UpgradeOnDamage to UpgradeOnDamageState

The trait works for 'Undamaged' as well and no longer requires a damage state change to trigger either, so this trait name is more accurate.
This commit is contained in:
reaperrr
2016-08-14 20:52:10 +02:00
parent 7f8607e85b
commit b174d00be9
3 changed files with 9 additions and 9 deletions

View File

@@ -507,7 +507,7 @@
<Compile Include="Traits\Upgrades\DisableOnUpgrade.cs" /> <Compile Include="Traits\Upgrades\DisableOnUpgrade.cs" />
<Compile Include="Traits\Upgrades\UpgradableTrait.cs" /> <Compile Include="Traits\Upgrades\UpgradableTrait.cs" />
<Compile Include="Traits\Upgrades\UpgradeActorsNear.cs" /> <Compile Include="Traits\Upgrades\UpgradeActorsNear.cs" />
<Compile Include="Traits\Upgrades\UpgradeOnDamage.cs" /> <Compile Include="Traits\Upgrades\UpgradeOnDamageState.cs" />
<Compile Include="Traits\Upgrades\UpgradeOnTerrain.cs" /> <Compile Include="Traits\Upgrades\UpgradeOnTerrain.cs" />
<Compile Include="Traits\Upgrades\UpgradeManager.cs" /> <Compile Include="Traits\Upgrades\UpgradeManager.cs" />
<Compile Include="Traits\Valued.cs" /> <Compile Include="Traits\Valued.cs" />

View File

@@ -14,7 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits namespace OpenRA.Mods.Common.Traits
{ {
[Desc("Applies an upgrade to the actor at specified damage states.")] [Desc("Applies an upgrade to the actor at specified damage states.")]
public class UpgradeOnDamageInfo : ITraitInfo, Requires<UpgradeManagerInfo>, Requires<HealthInfo> public class UpgradeOnDamageStateInfo : ITraitInfo, Requires<UpgradeManagerInfo>, Requires<HealthInfo>
{ {
[UpgradeGrantedReference, FieldLoader.Require] [UpgradeGrantedReference, FieldLoader.Require]
[Desc("The upgrades to grant.")] [Desc("The upgrades to grant.")]
@@ -32,17 +32,17 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Are upgrades irrevocable once the conditions have been met?")] [Desc("Are upgrades irrevocable once the conditions have been met?")]
public readonly bool GrantPermanently = false; public readonly bool GrantPermanently = false;
public object Create(ActorInitializer init) { return new UpgradeOnDamage(init.Self, this); } public object Create(ActorInitializer init) { return new UpgradeOnDamageState(init.Self, this); }
} }
public class UpgradeOnDamage : INotifyDamageStateChanged, INotifyCreated public class UpgradeOnDamageState : INotifyDamageStateChanged, INotifyCreated
{ {
readonly UpgradeOnDamageInfo info; readonly UpgradeOnDamageStateInfo info;
readonly UpgradeManager um; readonly UpgradeManager um;
readonly Health health; readonly Health health;
bool granted; bool granted;
public UpgradeOnDamage(Actor self, UpgradeOnDamageInfo info) public UpgradeOnDamageState(Actor self, UpgradeOnDamageStateInfo info)
{ {
this.info = info; this.info = info;
um = self.Trait<UpgradeManager>(); um = self.Trait<UpgradeManager>();

View File

@@ -397,7 +397,7 @@
WithInfantryBody: WithInfantryBody:
AttackSequence: attack AttackSequence: attack
IdleSequences: idle1,idle2 IdleSequences: idle1,idle2
UpgradeOnDamage@CRITICAL: UpgradeOnDamageState@CRITICAL:
Upgrades: criticalspeed Upgrades: criticalspeed
ValidDamageStates: Critical ValidDamageStates: Critical
GrantPermanently: true GrantPermanently: true
@@ -476,10 +476,10 @@
Weapons: SmallDebris Weapons: SmallDebris
Pieces: 3, 7 Pieces: 3, 7
Range: 2c0, 5c0 Range: 2c0, 5c0
UpgradeOnDamage@DAMAGED: UpgradeOnDamageState@DAMAGED:
Upgrades: damagedspeed Upgrades: damagedspeed
ValidDamageStates: Heavy ValidDamageStates: Heavy
UpgradeOnDamage@CRITICAL: UpgradeOnDamageState@CRITICAL:
Upgrades: criticalspeed Upgrades: criticalspeed
ValidDamageStates: Critical ValidDamageStates: Critical
SpeedMultiplier@DAMAGED: SpeedMultiplier@DAMAGED: