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