Skip to content

Commit

Permalink
Merge remote-tracking branch 'darkademic/dev' into WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Inq8 committed Jan 16, 2024
2 parents 8118798 + 68b161a commit 24a20f2
Show file tree
Hide file tree
Showing 16 changed files with 145 additions and 41 deletions.
2 changes: 1 addition & 1 deletion OpenRA.Mods.CA/Activities/CruiseMissileFly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public CruiseMissileFly(Actor self, Target t, CruiseMissile cm, WDist maxAltitud
length = Math.Max((targetPos - launchPos).Length / this.cm.Info.Speed, 1);
facing = (targetPos - launchPos).Yaw;
cm.Facing = GetEffectiveFacing();
trackingActive = !trackTarget;
trackingActive = trackTarget;
this.maxAltitude = maxAltitude;
this.maxTargetMovement = maxTargetMovement;
launchAngleDegrees = (int)(cm.Info.LaunchAngle.Angle / (1024f / 360f));
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.CA/Traits/CruiseMissile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CruiseMissileInfo : MissileBaseInfo
public readonly string DescendingCondition = null;

[Desc("If true, missile will track target.")]
public readonly bool TrackTarget = true;
public readonly bool TrackTarget = false;

public override object Create(ActorInitializer init) { return new CruiseMissile(init, this); }
}
Expand Down
60 changes: 60 additions & 0 deletions OpenRA.Mods.CA/Traits/TargetSpecificOrderVoice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#region Copyright & License Information
/**
* Copyright (c) The OpenRA Combined Arms Developers (see CREDITS).
* This file is part of OpenRA Combined Arms, which is free software.
* It is made available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version. For more information, see COPYING.
*/
#endregion

using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

namespace OpenRA.Mods.CA.Traits
{
[Desc("Lists valid factions for ProvidesPrerequisiteValidatedFaction.")]
public class TargetSpecificOrderVoiceInfo : TraitInfo
{
[Desc("Order strings which trigger the custom voice line.")]
public readonly HashSet<string> Orders = new();

[Desc("The `TargetTypes` from `Targetable` with their corresponding voice lines.")]
public readonly Dictionary<string, string> TargetTypeVoices = default;

[VoiceReference]
[Desc("Voice line to use if no target type is matched.")]
public readonly string DefaultVoice = null;

public override object Create(ActorInitializer init) { return new TargetSpecificOrderVoice(init, this); }
}

public class TargetSpecificOrderVoice : IOrderVoice
{
public readonly TargetSpecificOrderVoiceInfo Info;

public TargetSpecificOrderVoice(ActorInitializer init, TargetSpecificOrderVoiceInfo info)
{
Info = info;
}

string IOrderVoice.VoicePhraseForOrder(Actor self, Order order)
{
if (order.OrderString == null || !Info.Orders.Contains(order.OrderString))
return null;

if (order.Target.Type == TargetType.Invalid || order.Target.Type == TargetType.Terrain)
return Info.DefaultVoice;

var enabledTargetTypes = order.Target.Actor.GetEnabledTargetTypes();
var matchingTargetType = enabledTargetTypes.FirstOrDefault(t => Info.TargetTypeVoices.ContainsKey(t));

if (matchingTargetType != null)
return Info.TargetTypeVoices[matchingTargetType];

return Info.DefaultVoice;
}
}
}
6 changes: 3 additions & 3 deletions mods/ca/audio/voices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ TanyaVoice:
Zapped: tandeth1
Build: laugh1
Kill: gotit1,lefty1
Demolish: keepem1,tuffguy1
Demolish: keepem1,bombit1
Poisoned: tandeth1

DogVoice:
Expand Down Expand Up @@ -267,7 +267,7 @@ CommandoVoice:
Move: rcmon1,ronit1,rgotit1
Attack: ronit1,rgotit1,rnoprblm1
Action: ronit1,rgotit1,rnoprblm1
Demolish: rnoprblm1
Demolish: rbombit1
Die: ramyell1
Burned: ramyell1
Zapped: ramyell1
Expand Down Expand Up @@ -804,7 +804,7 @@ SealVoice:
Select: iseasea, iseaseb, iseasec, iseased
Move: iseamoa, iseamob, iseamoc
Attack: iseaata, iseaatb, iseaatc
Demolish: iseaexa, iseaexb, iseaexd
Demolish: iseaexa, iseaexb, iseaexc
Action: iseafea
Die: iseadia, iseadib, iseadic
Build: iseasec
Expand Down
Binary file added mods/ca/bits/audio/rbombit1.aud
Binary file not shown.
Binary file modified mods/ca/bits/diskray.shp
Binary file not shown.
18 changes: 18 additions & 0 deletions mods/ca/rules/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ Player:
bdrone.upgrade: 1
abur.upgrade: 1
bjet.upgrade: 1
thwk.upgrade: 1
tow.upgrade: 1
pointdef.upgrade: 1
hypersonic.upgrade: 1
Expand Down Expand Up @@ -1152,6 +1153,7 @@ Player:
bdrone.upgrade: 1
abur.upgrade: 1
bjet.upgrade: 1
thwk.upgrade: 1
tow.upgrade: 1
pointdef.upgrade: 1
hypersonic.upgrade: 1
Expand Down Expand Up @@ -1380,6 +1382,7 @@ Player:
bdrone.upgrade: 1
abur.upgrade: 1
bjet.upgrade: 1
thwk.upgrade: 1
tow.upgrade: 1
pointdef.upgrade: 1
hypersonic.upgrade: 1
Expand Down Expand Up @@ -1608,6 +1611,7 @@ Player:
bdrone.upgrade: 1
abur.upgrade: 1
bjet.upgrade: 1
thwk.upgrade: 1
tow.upgrade: 1
pointdef.upgrade: 1
hypersonic.upgrade: 1
Expand Down Expand Up @@ -1804,6 +1808,7 @@ Player:
bdrone.upgrade: 1
abur.upgrade: 1
bjet.upgrade: 1
thwk.upgrade: 1
tow.upgrade: 1
pointdef.upgrade: 1
hypersonic.upgrade: 1
Expand Down Expand Up @@ -2023,6 +2028,7 @@ Player:
htnk.hover: 40
htnk.drone: 40
v3rl: 3
thwk: 3
titn: 40
titn.rail: 40
jugg: 10
Expand Down Expand Up @@ -2059,6 +2065,7 @@ Player:
yak: 2
disr: 10
kiro: 2
disc: 2
a10: 5
a10.upg: 5
auro: 5
Expand Down Expand Up @@ -2115,6 +2122,7 @@ Player:
jjet: 8
bjet: 8
kiro: 4
disc: 4
deva: 4
pac: 4
ss: 10
Expand Down Expand Up @@ -2294,6 +2302,7 @@ Player:
htnk.hover: 40
htnk.drone: 40
v3rl: 3
thwk: 3
titn: 40
titn.rail: 40
jugg: 10
Expand Down Expand Up @@ -2330,6 +2339,7 @@ Player:
yak: 2
disr: 10
kiro: 2
disc: 2
a10: 5
a10.upg: 5
auro: 5
Expand Down Expand Up @@ -2386,6 +2396,7 @@ Player:
jjet: 8
bjet: 8
kiro: 3
disc: 3
deva: 3
pac: 3
ss: 10
Expand Down Expand Up @@ -2532,6 +2543,7 @@ Player:
htnk.hover: 40
htnk.drone: 40
v3rl: 3
thwk: 3
titn: 40
titn.rail: 40
jugg: 10
Expand Down Expand Up @@ -2568,6 +2580,7 @@ Player:
yak: 2
disr: 10
kiro: 2
disc: 2
a10: 5
a10.upg: 5
auro: 5
Expand Down Expand Up @@ -2621,6 +2634,7 @@ Player:
jjet: 8
bjet: 8
kiro: 2
disc: 2
deva: 2
pac: 2
ss: 10
Expand Down Expand Up @@ -2767,6 +2781,7 @@ Player:
htnk.hover: 40
htnk.drone: 40
v3rl: 3
thwk: 3
titn: 40
titn.rail: 40
jugg: 10
Expand Down Expand Up @@ -2803,6 +2818,7 @@ Player:
yak: 2
disr: 10
kiro: 2
disc: 2
a10: 5
a10.upg: 5
auro: 5
Expand Down Expand Up @@ -2856,6 +2872,7 @@ Player:
jjet: 8
bjet: 8
kiro: 1
disc: 1
deva: 1
pac: 1
ss: 10
Expand Down Expand Up @@ -2932,6 +2949,7 @@ Player:
yak: 2
disr: 10
kiro: 2
disc: 2
a10: 5
a10.upg: 5
auro: 5
Expand Down
23 changes: 17 additions & 6 deletions mods/ca/rules/aircraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4080,6 +4080,10 @@ VERT:
Weapon: VertigoBomb
LocalOffset: 2,0,-43
PauseOnCondition: !ammo
Armament@DECLOAK:
Name: secondary
Weapon: VertigoBombTargeter
PauseOnCondition: !ammo
AttackAircraft:
FacingTolerance: 80
PersistentTargeting: false
Expand All @@ -4103,6 +4107,7 @@ VERT:
Ammo: 1
ReloadDelay: 180
AmmoCondition: ammo
Armaments: primary
WithAmmoPipsDecoration:
Position: BottomLeft
Margin: 4, 3
Expand Down Expand Up @@ -4176,6 +4181,9 @@ VERT:
GrantConditionOnDamageState@UNCLOAK:
Condition: cloak-force-disabled
ValidDamageStates: Critical
-RangeMultiplier@SEEK:
-RangeMultiplier@SEEK2:
-RangeMultiplier@SEEK3:

MCOR:
Inherits: ^HelicopterTD
Expand Down Expand Up @@ -4281,6 +4289,12 @@ DISC:
RevealsShroud@GAPGEN:
Range: 8c0
Type: GroundPosition
TargetSpecificOrderVoice:
Orders: Attack, ForceAttack
TargetTypeVoices:
PowerDrainable: Steal
ResourceDrainable: Steal
DefaultVoice: Attack
Aircraft:
Speed: 56
CruiseAltitude: 2560
Expand All @@ -4306,8 +4320,8 @@ DISC:
Turreted:
TurnSpeed: 512
WithAttackOverlay:
Sequence: charge
Palette: scrin
Sequence: charge
Palette: scrin
WithMuzzleOverlay:
GrantConditionOnAttackCA@PowerDrain:
Condition: powerdraining
Expand All @@ -4323,7 +4337,7 @@ DISC:
RequiresCondition: resourcedraining
WithIdleOverlay@Drain:
Sequence: drain
Palette: effect-ignore-lighting-alpha85
Palette: effect
RequiresCondition: powerdraining || resourcedraining
IsDecoration: true
AmbientSoundCA@Drain:
Expand All @@ -4338,9 +4352,6 @@ DISC:
SpawnActorOnDeath@EMP:
Actor: DISC.Husk.EMP
RequiresCondition: airborne && empdisable && !being-warped
AutoTarget:
InitialStance: HoldFire
InitialStanceAI: AttackAnything
LeavesTrails@2:
Offsets: 0,300,0
MovingInterval: 2
Expand Down
2 changes: 1 addition & 1 deletion mods/ca/rules/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
ExternalCondition@DiscPowerDrain:
Condition: discpowerdrain
Power@DiscPowerDrain:
Power: -10000
Amount: -10000
RequiresCondition: discpowerdrain
WithColoredOverlay@POWERDRAIN:
RequiresCondition: powerdrain || discpowerdrain
Expand Down
3 changes: 2 additions & 1 deletion mods/ca/rules/husks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,7 @@ DISC.Husk:
Inherits: ^HelicopterHusk
Tooltip:
Name: Floating Disc
Aircraft:
TurnSpeed: 12
Speed: 112
LeavesTrails:
Expand All @@ -1985,5 +1986,5 @@ DISC.Husk:
Image: disccrash

DISC.Husk.EMP:
Inherits: HIND.Husk
Inherits: DISC.Husk
Inherits: ^EmpVisualEffect
10 changes: 10 additions & 0 deletions mods/ca/rules/infantry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,11 @@ E7:
-Crushable:
TakeCover:
SpeedModifier: 70
TargetSpecificOrderVoice:
Orders: Attack, ForceAttack
TargetTypeVoices:
Vehicle: Demolish
Structure: Demolish

MEDI:
Inherits: ^Soldier
Expand Down Expand Up @@ -1908,6 +1913,11 @@ RMBO:
-Crushable:
TakeCover:
SpeedModifier: 70
TargetSpecificOrderVoice:
Orders: Attack, ForceAttack
TargetTypeVoices:
Vehicle: Demolish
Structure: Demolish

N6:
Inherits: ^Soldier
Expand Down
Loading

0 comments on commit 24a20f2

Please sign in to comment.