Change InitialStance to Defend for human players
This commit is contained in:
@@ -24,8 +24,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Set to a value >1 to override weapons maximum range for this.")]
|
[Desc("Set to a value >1 to override weapons maximum range for this.")]
|
||||||
public readonly int ScanRadius = -1;
|
public readonly int ScanRadius = -1;
|
||||||
|
|
||||||
[Desc("Possible values are HoldFire, ReturnFire, Defend and AttackAnything.")]
|
[Desc("Possible values are HoldFire, ReturnFire, Defend and AttackAnything.",
|
||||||
public readonly UnitStance InitialStance = UnitStance.AttackAnything;
|
"Used for computer-controlled players, both Lua-scripted and regular Skirmish AI alike.")]
|
||||||
|
public readonly UnitStance InitialStanceAI = UnitStance.AttackAnything;
|
||||||
|
|
||||||
|
[Desc("Possible values are HoldFire, ReturnFire, Defend and AttackAnything. Used for human players.")]
|
||||||
|
public readonly UnitStance InitialStance = UnitStance.Defend;
|
||||||
|
|
||||||
[Desc("Allow the player to change the unit stance.")]
|
[Desc("Allow the player to change the unit stance.")]
|
||||||
public readonly bool EnableStances = true;
|
public readonly bool EnableStances = true;
|
||||||
@@ -63,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
attack = self.Trait<AttackBase>();
|
attack = self.Trait<AttackBase>();
|
||||||
Stance = info.InitialStance;
|
Stance = self.Owner.IsBot || !self.Owner.Playable ? info.InitialStanceAI : info.InitialStance;
|
||||||
PredictedStance = Stance;
|
PredictedStance = Stance;
|
||||||
at = self.TraitOrDefault<AttackFollow>();
|
at = self.TraitOrDefault<AttackFollow>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2266,6 +2266,17 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add InitialStance for bots
|
||||||
|
if (engineVersion < 20151025)
|
||||||
|
{
|
||||||
|
if (depth == 1 && node.Key == "AutoTarget")
|
||||||
|
{
|
||||||
|
var stance = node.Value.Nodes.FirstOrDefault(n => n.Key == "InitialStance");
|
||||||
|
if (stance != null)
|
||||||
|
node.Value.Nodes.Add(new MiniYamlNode("InitialStanceAI", stance.Value.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ ARTY:
|
|||||||
AttackFrontal:
|
AttackFrontal:
|
||||||
WithMuzzleOverlay:
|
WithMuzzleOverlay:
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: Defend
|
InitialStanceAI: Defend
|
||||||
SpawnActorOnDeath:
|
SpawnActorOnDeath:
|
||||||
Actor: ARTY.Husk
|
Actor: ARTY.Husk
|
||||||
Explodes:
|
Explodes:
|
||||||
@@ -488,7 +488,7 @@ MLRS:
|
|||||||
WithReloadingTurret:
|
WithReloadingTurret:
|
||||||
AmmoPoolName: primary
|
AmmoPoolName: primary
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: Defend
|
InitialStanceAI: Defend
|
||||||
RenderRangeCircle:
|
RenderRangeCircle:
|
||||||
SpawnActorOnDeath:
|
SpawnActorOnDeath:
|
||||||
Actor: MLRS.Husk
|
Actor: MLRS.Husk
|
||||||
@@ -526,6 +526,7 @@ STNK:
|
|||||||
AttackFrontal:
|
AttackFrontal:
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: HoldFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
Targetable:
|
Targetable:
|
||||||
SpawnActorOnDeath:
|
SpawnActorOnDeath:
|
||||||
Actor: STNK.Husk
|
Actor: STNK.Husk
|
||||||
|
|||||||
@@ -126,6 +126,8 @@ fremen:
|
|||||||
Range: 4c768
|
Range: 4c768
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
ScanRadius: 7
|
ScanRadius: 7
|
||||||
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
Armament@PRIMARY:
|
Armament@PRIMARY:
|
||||||
Weapon: Fremen_S
|
Weapon: Fremen_S
|
||||||
Armament@SECONDARY:
|
Armament@SECONDARY:
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ siege_tank:
|
|||||||
Weapon: UnitExplodeMed
|
Weapon: UnitExplodeMed
|
||||||
EmptyWeapon: UnitExplodeMed
|
EmptyWeapon: UnitExplodeMed
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: Defend
|
InitialStanceAI: Defend
|
||||||
Selectable:
|
Selectable:
|
||||||
Class: siegetank
|
Class: siegetank
|
||||||
SpawnActorOnDeath:
|
SpawnActorOnDeath:
|
||||||
@@ -245,7 +245,7 @@ missile_tank:
|
|||||||
LocalOffset: -128,128,171, -128,-128,171
|
LocalOffset: -128,128,171, -128,-128,171
|
||||||
AttackFrontal:
|
AttackFrontal:
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: Defend
|
InitialStanceAI: Defend
|
||||||
Explodes:
|
Explodes:
|
||||||
Weapon: UnitExplodeMed
|
Weapon: UnitExplodeMed
|
||||||
EmptyWeapon: UnitExplodeMed
|
EmptyWeapon: UnitExplodeMed
|
||||||
@@ -394,6 +394,7 @@ stealth_raider:
|
|||||||
IsPlayerPalette: true
|
IsPlayerPalette: true
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: HoldFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
-MustBeDestroyed:
|
-MustBeDestroyed:
|
||||||
|
|
||||||
deviator:
|
deviator:
|
||||||
@@ -423,7 +424,7 @@ deviator:
|
|||||||
LocalOffset: -299,0,85
|
LocalOffset: -299,0,85
|
||||||
AttackFrontal:
|
AttackFrontal:
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: Defend
|
InitialStanceAI: Defend
|
||||||
Explodes:
|
Explodes:
|
||||||
Weapon: UnitExplodeLarge
|
Weapon: UnitExplodeLarge
|
||||||
EmptyWeapon: UnitExplodeLarge
|
EmptyWeapon: UnitExplodeLarge
|
||||||
|
|||||||
@@ -654,7 +654,7 @@ Rules:
|
|||||||
Health:
|
Health:
|
||||||
HP: 200
|
HP: 200
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: Defend
|
InitialStanceAI: Defend
|
||||||
SNIPER.soviets:
|
SNIPER.soviets:
|
||||||
Inherits: SNIPER
|
Inherits: SNIPER
|
||||||
Buildable:
|
Buildable:
|
||||||
|
|||||||
@@ -273,6 +273,7 @@ HELI:
|
|||||||
CanHover: True
|
CanHover: True
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: HoldFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: HoldFire
|
||||||
WithSpriteRotorOverlay:
|
WithSpriteRotorOverlay:
|
||||||
Offset: 0,0,85
|
Offset: 0,0,85
|
||||||
AmmoPool:
|
AmmoPool:
|
||||||
@@ -326,6 +327,7 @@ HIND:
|
|||||||
CanHover: True
|
CanHover: True
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: HoldFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: HoldFire
|
||||||
WithSpriteRotorOverlay:
|
WithSpriteRotorOverlay:
|
||||||
AmmoPool:
|
AmmoPool:
|
||||||
Ammo: 24
|
Ammo: 24
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ DOG:
|
|||||||
Voice: Attack
|
Voice: Attack
|
||||||
AttackMove:
|
AttackMove:
|
||||||
Voice: Move
|
Voice: Move
|
||||||
|
AutoTarget:
|
||||||
|
InitialStance: AttackAnything
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, Infantry
|
TargetTypes: Ground, Infantry
|
||||||
WithInfantryBody:
|
WithInfantryBody:
|
||||||
@@ -517,7 +519,8 @@ SNIPER:
|
|||||||
RevealsShroud:
|
RevealsShroud:
|
||||||
Range: 6c0
|
Range: 6c0
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: ReturnFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
Armament@PRIMARY:
|
Armament@PRIMARY:
|
||||||
Weapon: Sniper
|
Weapon: Sniper
|
||||||
Armament@GARRISONED:
|
Armament@GARRISONED:
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ SS:
|
|||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
VisualBounds: 38,38
|
VisualBounds: 38,38
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: ReturnFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
DetectCloaked:
|
DetectCloaked:
|
||||||
CloakTypes: Underwater
|
CloakTypes: Underwater
|
||||||
Range: 4c0
|
Range: 4c0
|
||||||
@@ -98,7 +99,8 @@ MSUB:
|
|||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
VisualBounds: 44,44
|
VisualBounds: 44,44
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: ReturnFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
DetectCloaked:
|
DetectCloaked:
|
||||||
CloakTypes: Underwater
|
CloakTypes: Underwater
|
||||||
Range: 4c0
|
Range: 4c0
|
||||||
|
|||||||
@@ -723,7 +723,8 @@ STNK:
|
|||||||
RevealsShroud:
|
RevealsShroud:
|
||||||
Range: 6c0
|
Range: 6c0
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: ReturnFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
Armament:
|
Armament:
|
||||||
Weapon: APTusk
|
Weapon: APTusk
|
||||||
LocalOffset: 400,0,0
|
LocalOffset: 400,0,0
|
||||||
|
|||||||
@@ -272,5 +272,6 @@ STNK:
|
|||||||
Voice: Attack
|
Voice: Attack
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
InitialStance: HoldFire
|
InitialStance: HoldFire
|
||||||
|
InitialStanceAI: ReturnFire
|
||||||
-MustBeDestroyed:
|
-MustBeDestroyed:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user