Skip to content

Commit cea756c

Browse files
committed
- Fixed crash when manually releasing mind controlled slaves.
- Added target painter ability to Pitbull. - Added minimum range to Aurora so it will circle back instead of missing. - Increased Killzone duration from 16s to 30s. - FlashTarget warhead. - WithFlashEffect trait. - Tooltip tweaks.
1 parent a18a209 commit cea756c

15 files changed

Lines changed: 162 additions & 29 deletions

File tree

OpenRA.Mods.CA/Traits/MindController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ public void ResolveOrder(Actor self, Order order)
288288
if (order.Target.Type != TargetType.Actor)
289289
return;
290290

291-
slaves.First(s => s.Actor == order.Target.Actor).Trait.RevokeMindControl(order.Target.Actor, 0);
291+
var slave = slaves.SingleOrDefault(s => s.Actor == order.Target.Actor);
292+
slave.Trait?.RevokeMindControl(order.Target.Actor, 0);
292293

293294
if (Info.SlaveDeployEffect == SlaveDeployEffect.Kill)
294295
{
@@ -485,7 +486,7 @@ public void ReleaseSlaves(Actor self, int ticks)
485486
if (s.Actor.IsDead || s.Actor.Disposed)
486487
continue;
487488

488-
if (s.Trait.Master.Value.Actor != self)
489+
if (s.Trait.Master.HasValue && s.Trait.Master.Value.Actor != self)
489490
continue;
490491

491492
s.Trait.RevokeMindControl(s.Actor, ticks);

OpenRA.Mods.CA/Traits/Render/RenderLine.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#endregion
1010

1111
using System.Collections.Generic;
12-
using System.Linq;
1312
using OpenRA.Graphics;
1413
using OpenRA.Mods.Common.Graphics;
1514
using OpenRA.Mods.Common.Traits;
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#region Copyright & License Information
2+
/**
3+
* Copyright (c) The OpenRA Combined Arms Developers (see CREDITS).
4+
* This file is part of OpenRA Combined Arms, which is free software.
5+
* It is made available to you under the terms of the GNU General Public License
6+
* as published by the Free Software Foundation, either version 3 of the License,
7+
* or (at your option) any later version. For more information, see COPYING.
8+
*/
9+
#endregion
10+
11+
using OpenRA.Mods.Common.Effects;
12+
using OpenRA.Mods.Common.Traits;
13+
using OpenRA.Primitives;
14+
using OpenRA.Traits;
15+
16+
namespace OpenRA.Mods.CA.Traits.Render
17+
{
18+
[Desc("Flashes the target at a set interval.")]
19+
class WithFlashEffectInfo : ConditionalTraitInfo
20+
{
21+
[Desc("Interval in ticks between flashes.")]
22+
public readonly int Interval = 25;
23+
24+
[Desc("Flash color.")]
25+
public readonly Color Color = Color.FromArgb(80, Color.Red);
26+
27+
public override object Create(ActorInitializer init) { return new WithFlashEffect(this); }
28+
}
29+
30+
class WithFlashEffect : ConditionalTrait<WithFlashEffectInfo>, ITick
31+
{
32+
public new readonly WithFlashEffectInfo Info;
33+
int intervalTicks;
34+
35+
public WithFlashEffect(WithFlashEffectInfo info)
36+
: base(info)
37+
{
38+
Info = info;
39+
}
40+
41+
void ITick.Tick(Actor self)
42+
{
43+
if (IsTraitDisabled || !self.IsInWorld)
44+
return;
45+
46+
if (intervalTicks == 0)
47+
{
48+
self.World.AddFrameEndTask(w =>
49+
{
50+
w.Add(new FlashTarget(self, Info.Color, 0.5f, 1, 2, 0));
51+
});
52+
}
53+
54+
intervalTicks++;
55+
56+
if (intervalTicks >= Info.Interval)
57+
intervalTicks = 0;
58+
}
59+
60+
protected override void TraitEnabled(Actor self)
61+
{
62+
intervalTicks = 0;
63+
}
64+
65+
protected override void TraitDisabled(Actor self)
66+
{
67+
intervalTicks = 0;
68+
}
69+
}
70+
}

OpenRA.Mods.CA/Traits/TargetedAttackAbility.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using System.Collections.Generic;
1313
using System.Linq;
1414
using OpenRA.Graphics;
15-
using OpenRA.Mods.Common.Activities;
1615
using OpenRA.Mods.Common.Graphics;
1716
using OpenRA.Mods.Common.Orders;
1817
using OpenRA.Mods.Common.Traits;
@@ -78,6 +77,10 @@ public class TargetedAttackAbilityInfo : PausableConditionalTraitInfo, Requires<
7877
[Desc("Name of the armament used to attack with.")]
7978
public readonly string[] ArmamentNames = { "primary" };
8079

80+
[Desc("If true, the ability is usable with disabled (or reloading) armament(s).",
81+
"Useful if the ability armament has longer range than standard armament(s) where the ability armament(s) being paused would interfere with their targeting.")]
82+
public readonly bool UseDisabledArmaments = false;
83+
8184
[Desc("Ability type. When selecting a group, different types will not be activated together.")]
8285
public readonly string Type = null;
8386

@@ -195,7 +198,7 @@ public bool IsAvailable
195198
get {
196199
return !IsTraitDisabled
197200
&& !IsTraitPaused
198-
&& ((ammoPool != null && ammoPool.HasAmmo) || (ammoPool == null && Armaments.Any(a => !a.IsTraitDisabled && !a.IsReloading)));
201+
&& ((ammoPool != null && ammoPool.HasAmmo) || (ammoPool == null && Armaments.Any(a => Info.UseDisabledArmaments || (!a.IsTraitDisabled && !a.IsReloading))));
199202
}
200203
}
201204

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#region Copyright & License Information
2+
/**
3+
* Copyright (c) The OpenRA Combined Arms Developers (see CREDITS).
4+
* This file is part of OpenRA Combined Arms, which is free software.
5+
* It is made available to you under the terms of the GNU General Public License
6+
* as published by the Free Software Foundation, either version 3 of the License,
7+
* or (at your option) any later version. For more information, see COPYING.
8+
*/
9+
#endregion
10+
11+
using OpenRA.GameRules;
12+
using OpenRA.Mods.Common.Effects;
13+
using OpenRA.Mods.Common.Traits;
14+
using OpenRA.Mods.Common.Warheads;
15+
using OpenRA.Primitives;
16+
17+
namespace OpenRA.Mods.CA.Warheads
18+
{
19+
[Desc("Flashes the target.")]
20+
public class FlashTargetWarhead : TargetDamageWarhead
21+
{
22+
public readonly Color Color = Color.White;
23+
24+
protected override void InflictDamage(Actor victim, Actor firedBy, HitShape shape, WarheadArgs args)
25+
{
26+
victim.World.AddFrameEndTask(w =>
27+
{
28+
w.Add(new FlashTarget(victim, Color, 0.5f, 1, 2, 0));
29+
});
30+
}
31+
}
32+
}

mods/ca/rules/aircraft.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4879,7 +4879,6 @@ DISC:
48794879
ActiveUntilCancelled: true
48804880
CancelOnNewOrder: true
48814881

4882-
48834882
JACK:
48844883
Inherits: ^PlaneTD
48854884
Inherits@AUTOTARGET: ^AutoTargetAllAssaultMove

mods/ca/rules/defaults.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,20 +1986,20 @@
19861986
Limit: 1
19871987
AttachedCondition: observer-attached
19881988

1989-
^SpyIFVTargetable:
1990-
ExternalCondition@SpyIFVTarget:
1991-
Condition: spy-ifv-target
1992-
DamageMultiplier@SpyIFVTarget:
1989+
^TargetPaintable:
1990+
ExternalCondition@PaintedTarget:
1991+
Condition: painted-target
1992+
DamageMultiplier@PaintedTarget:
19931993
Modifier: 133
1994-
RequiresCondition: spy-ifv-target
1995-
WithDecoration@SpyIFVTarget:
1996-
Image: spyifvtarget
1994+
RequiresCondition: painted-target
1995+
WithDecoration@PaintedTarget:
1996+
Image: targetpainter
19971997
Sequence: idle
19981998
Palette: effect
19991999
Position: Top
20002000
ValidRelationships: Ally, Enemy, Neutral
20012001
Margin: 0, 8
2002-
RequiresCondition: spy-ifv-target
2002+
RequiresCondition: painted-target
20032003

20042004
^HoverTrail:
20052005
LeavesTrails:
@@ -2238,7 +2238,7 @@
22382238
Inherits@minidrone: ^MiniDroneAttachable
22392239
Inherits@WatcherParasite: ^WatcherParasiteAttachable
22402240
Inherits@ShadowBeacon: ^ShadowBeaconAttachable
2241-
Inherits@SpyIFVTargetable: ^SpyIFVTargetable
2241+
Inherits@TargetPaintable: ^TargetPaintable
22422242
Inherits@lchrheal: ^LeecherHealable
22432243
Inherits@Blindable: ^Blindable
22442244
Inherits@KillZoneTargetable: ^KillZoneTargetable
@@ -2857,7 +2857,7 @@
28572857
Inherits@TNTPlantable: ^TNTPlantable
28582858
Inherits@minidrone: ^MiniDroneAttachable
28592859
Inherits@WatcherParasite: ^WatcherParasiteAttachable
2860-
Inherits@SpyIFVTargetable: ^SpyIFVTargetable
2860+
Inherits@TargetPaintable: ^TargetPaintable
28612861
Inherits@Blindable: ^Blindable
28622862
Inherits@KillZoneTargetable: ^KillZoneTargetable
28632863
Inherits@Anathema: ^Anathema
@@ -3304,7 +3304,7 @@
33043304
Inherits@gflash: ^GreenFlash
33053305
Inherits@HACKABLE: ^Hackable
33063306
Inherits@WatcherParasite: ^WatcherParasiteAttachable
3307-
Inherits@SpyIFVTargetable: ^SpyIFVTargetable
3307+
Inherits@TargetPaintable: ^TargetPaintable
33083308
Inherits@DefensePolicyDamageReduction: ^DefensePolicyDamageReduction
33093309
WithPalettedOverlay@IRONCURTAIN:
33103310
RequiresCondition: invulnerability && !forceshield

mods/ca/rules/misc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ FLARE.KillZone:
556556
Inherits: FLARE
557557
-RevealsShroud:
558558
KillsSelf:
559-
Delay: 400 # same as for killzone actor
559+
Delay: 750 # matches killzone actor
560560
RemoveInstead: true
561561
-MapEditorData:
562562

@@ -1366,7 +1366,7 @@ killzone:
13661366
Image: killzone
13671367
PlayerPalette: player
13681368
KillsSelf:
1369-
Delay: 400
1369+
Delay: 750 # matches killzone flare
13701370
RemoveInstead: true
13711371
WithRangeCircleCA:
13721372
Type: KillZone

0 commit comments

Comments
 (0)