Merge pull request #12759 from forcecore/cloak_unhardcoding
Unhardcode disableCloak on critical HP (#12741)
This commit is contained in:
@@ -64,7 +64,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier, INotifyCreated, INotifyHarvesterAction
|
||||
{
|
||||
[Sync] int remainingTime;
|
||||
[Sync] bool damageDisabled;
|
||||
bool isDocking;
|
||||
ConditionManager conditionManager;
|
||||
|
||||
@@ -102,8 +101,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
void INotifyDamage.Damaged(Actor self, AttackInfo e)
|
||||
{
|
||||
damageDisabled = e.DamageState >= DamageState.Critical;
|
||||
if (damageDisabled || Info.UncloakOn.HasFlag(UncloakType.Damage))
|
||||
if (Info.UncloakOn.HasFlag(UncloakType.Damage))
|
||||
Uncloak();
|
||||
}
|
||||
|
||||
@@ -128,7 +126,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
if (!IsTraitDisabled)
|
||||
{
|
||||
if (remainingTime > 0 && !damageDisabled && !isDocking)
|
||||
if (remainingTime > 0 && !isDocking)
|
||||
remainingTime--;
|
||||
|
||||
if (self.IsDisabled())
|
||||
|
||||
@@ -125,9 +125,12 @@
|
||||
CloakDelay: 90
|
||||
CloakSound: trans1.aud
|
||||
UncloakSound: trans1.aud
|
||||
RequiresCondition: cloak
|
||||
RequiresCondition: cloak-crate-collected && !cloak-force-disabled
|
||||
ExternalCondition@CLOAK:
|
||||
Condition: cloak
|
||||
Condition: cloak-crate-collected
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
|
||||
^Vehicle:
|
||||
Inherits@1: ^ExistsInWorld
|
||||
|
||||
@@ -19,7 +19,7 @@ CRATE:
|
||||
GrantExternalConditionCrateAction@cloak:
|
||||
SelectionShares: 5
|
||||
Effect: cloak
|
||||
Condition: cloak
|
||||
Condition: cloak-crate-collected
|
||||
GiveMcvCrateAction:
|
||||
SelectionShares: 0
|
||||
NoBaseSelectionShares: 120
|
||||
|
||||
@@ -547,6 +547,10 @@ STNK:
|
||||
CloakDelay: 90
|
||||
CloakSound: trans1.aud
|
||||
UncloakSound: trans1.aud
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
Armament:
|
||||
Weapon: 227mm.stnk
|
||||
LocalOffset: 213,43,128, 213,-43,128
|
||||
|
||||
@@ -154,6 +154,10 @@ fremen:
|
||||
CloakSound: STEALTH1.WAV
|
||||
UncloakSound: STEALTH2.WAV
|
||||
IsPlayerPalette: true
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
-MustBeDestroyed:
|
||||
Voiced:
|
||||
VoiceSet: FremenVoice
|
||||
@@ -249,6 +253,10 @@ saboteur:
|
||||
UncloakSound: STEALTH2.WAV
|
||||
UncloakOn: Attack, Unload, Infiltrate, Demolish, Move, Damage
|
||||
IsPlayerPalette: true
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
Voiced:
|
||||
VoiceSet: SaboteurVoice
|
||||
|
||||
|
||||
@@ -396,6 +396,10 @@ stealth_raider:
|
||||
CloakSound: STEALTH1.WAV
|
||||
UncloakSound: STEALTH2.WAV
|
||||
IsPlayerPalette: true
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
AutoTarget:
|
||||
InitialStance: HoldFire
|
||||
InitialStanceAI: ReturnFire
|
||||
|
||||
@@ -508,6 +508,10 @@ HIJACKER:
|
||||
UncloakOn: Attack, Unload, Infiltrate, Demolish, Move
|
||||
CloakTypes: Cloak, Hijacker
|
||||
IsPlayerPalette: true
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
Mobile:
|
||||
Speed: 85
|
||||
|
||||
@@ -589,6 +593,10 @@ SNIPER:
|
||||
UncloakSound:
|
||||
UncloakOn: Attack, Unload, Infiltrate, Demolish, Move
|
||||
IsPlayerPalette: true
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
DetectCloaked:
|
||||
CloakTypes: Cloak, Hijacker
|
||||
Range: 6c0
|
||||
|
||||
@@ -36,6 +36,10 @@ SS:
|
||||
UncloakSound: subshow1.aud
|
||||
CloakedCondition: underwater
|
||||
Palette: submerged
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
Armament:
|
||||
Weapon: TorpTube
|
||||
LocalOffset: 0,-171,0, 0,171,0
|
||||
@@ -93,6 +97,10 @@ MSUB:
|
||||
UncloakSound: subshow1.aud
|
||||
CloakedCondition: underwater
|
||||
Palette: submerged
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
Armament@PRIMARY:
|
||||
Weapon: SubMissile
|
||||
LocalOffset: 0,-171,0, 0,171,0
|
||||
|
||||
@@ -626,6 +626,10 @@ HBOX:
|
||||
InitialDelay: 125
|
||||
CloakDelay: 60
|
||||
IsPlayerPalette: true
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
Turreted:
|
||||
TurnSpeed: 255
|
||||
-QuantizeFacingsFromSequence:
|
||||
|
||||
@@ -779,6 +779,10 @@ STNK:
|
||||
CloakSound: appear1.aud
|
||||
UncloakSound: appear1.aud
|
||||
IsPlayerPalette: true
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
DetectCloaked:
|
||||
Range: 7c0
|
||||
-MustBeDestroyed:
|
||||
|
||||
@@ -396,6 +396,10 @@ STNK:
|
||||
UncloakSound: cloak5.aud
|
||||
IsPlayerPalette: true
|
||||
UncloakOn: Attack, Unload, Infiltrate, Demolish, Damage
|
||||
RequiresCondition: !cloak-force-disabled
|
||||
GrantConditionOnDamageState@UNCLOAK:
|
||||
Condition: cloak-force-disabled
|
||||
ValidDamageStates: Critical
|
||||
Armament:
|
||||
Weapon: Dragon
|
||||
LocalOffset: 213,43,298, 213,-43,298
|
||||
|
||||
Reference in New Issue
Block a user