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:
@@ -507,7 +507,7 @@
|
||||
<Compile Include="Traits\Upgrades\DisableOnUpgrade.cs" />
|
||||
<Compile Include="Traits\Upgrades\UpgradableTrait.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\UpgradeManager.cs" />
|
||||
<Compile Include="Traits\Valued.cs" />
|
||||
|
||||
@@ -14,7 +14,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[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]
|
||||
[Desc("The upgrades to grant.")]
|
||||
@@ -32,17 +32,17 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Are upgrades irrevocable once the conditions have been met?")]
|
||||
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 Health health;
|
||||
bool granted;
|
||||
|
||||
public UpgradeOnDamage(Actor self, UpgradeOnDamageInfo info)
|
||||
public UpgradeOnDamageState(Actor self, UpgradeOnDamageStateInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
um = self.Trait<UpgradeManager>();
|
||||
@@ -397,7 +397,7 @@
|
||||
WithInfantryBody:
|
||||
AttackSequence: attack
|
||||
IdleSequences: idle1,idle2
|
||||
UpgradeOnDamage@CRITICAL:
|
||||
UpgradeOnDamageState@CRITICAL:
|
||||
Upgrades: criticalspeed
|
||||
ValidDamageStates: Critical
|
||||
GrantPermanently: true
|
||||
@@ -476,10 +476,10 @@
|
||||
Weapons: SmallDebris
|
||||
Pieces: 3, 7
|
||||
Range: 2c0, 5c0
|
||||
UpgradeOnDamage@DAMAGED:
|
||||
UpgradeOnDamageState@DAMAGED:
|
||||
Upgrades: damagedspeed
|
||||
ValidDamageStates: Heavy
|
||||
UpgradeOnDamage@CRITICAL:
|
||||
UpgradeOnDamageState@CRITICAL:
|
||||
Upgrades: criticalspeed
|
||||
ValidDamageStates: Critical
|
||||
SpeedMultiplier@DAMAGED:
|
||||
|
||||
Reference in New Issue
Block a user