Skip to content

Commit

Permalink
Merge remote-tracking branch 'darkademic/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Inq8 committed Dec 14, 2023
2 parents 5c37d32 + a2d7310 commit 44a5571
Show file tree
Hide file tree
Showing 52 changed files with 406 additions and 105 deletions.
4 changes: 4 additions & 0 deletions OpenRA.Mods.CA/Activities/EnterCarrierMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ protected override void OnEnterComplete(Actor self, Actor targetActor)
foreach (var pool in ammoPools)
while (pool.GiveAmmo(self, 1))
{ }
var aircraft = self.TraitOrDefault<Aircraft>();
if (aircraft != null)
aircraft.RemoveInfluence();
});
}
}
Expand Down
7 changes: 0 additions & 7 deletions OpenRA.Mods.CA/Traits/AirstrikeSlave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ namespace OpenRA.Mods.CA.Traits
[Desc("Can be slaved to a spawner.")]
public class AirstrikeSlaveInfo : BaseSpawnerSlaveInfo
{
[Desc("Move this close to the spawner, before entering it.")]
public readonly WDist LandingDistance = new WDist(5 * 1024);

[Desc("We consider this is close enought to the spawner and enter it, instead of trying to reach 0 distance." +
"This allows the spawned unit to enter the spawner while the spawner is moving.")]
public readonly WDist CloseEnoughDistance = new WDist(128);

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

Expand Down
8 changes: 4 additions & 4 deletions OpenRA.Mods.CA/Traits/CarrierMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class CarrierMasterInfo : BaseSpawnerMasterInfo
public readonly int RearmTicks = 150;

[GrantedConditionReference]
[Desc("The condition to grant to self right after launching a spawned unit. (Used by V3 to make immobile.)")]
[Desc("The condition to grant to self right after launching a spawned unit.")]
public readonly string LaunchingCondition = null;

[GrantedConditionReference]
Expand Down Expand Up @@ -273,7 +273,7 @@ void ITick.Tick(Actor self)
foreach (var slaveEntry in SlaveEntries)
{
var carrierSlaveEntry = slaveEntry as CarrierSlaveEntry;
if (carrierSlaveEntry.Actor.CurrentActivity is EnterCarrierMaster)
if (carrierSlaveEntry.Actor.IsInWorld && carrierSlaveEntry.Actor.CurrentActivity is EnterCarrierMaster)
slaveIsEntering = true;

if (CarrierMasterInfo.RearmAsGroup && numLaunched > 0)
Expand All @@ -284,9 +284,9 @@ void ITick.Tick(Actor self)
}

if (slaveIsEntering && beingEnteredToken == Actor.InvalidConditionToken)
self.GrantCondition(CarrierMasterInfo.BeingEnteredCondition);
beingEnteredToken = self.GrantCondition(CarrierMasterInfo.BeingEnteredCondition);
else if (!slaveIsEntering && beingEnteredToken != Actor.InvalidConditionToken)
self.RevokeCondition(beingEnteredToken);
beingEnteredToken = self.RevokeCondition(beingEnteredToken);

// range check
RangeCheck(self);
Expand Down
3 changes: 0 additions & 3 deletions OpenRA.Mods.CA/Traits/CarrierSlave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ namespace OpenRA.Mods.CA.Traits
[Desc("Can be slaved to a spawner.")]
public class CarrierSlaveInfo : BaseSpawnerSlaveInfo
{
[Desc("Move this close to the spawner, before entering it.")]
public readonly WDist LandingDistance = new WDist(5 * 1024);

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

Expand Down
118 changes: 118 additions & 0 deletions OpenRA.Mods.CA/Traits/Render/RenderLine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#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.Graphics;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
using OpenRA.Traits;

namespace OpenRA.Mods.CA.Traits.Render
{
[Desc(".")]
public class RenderLineInfo : ConditionalTraitInfo
{
[Desc("Color of the line.")]
public readonly Color Color = Color.FromArgb(128, Color.White);

[Desc("Line width.")]
public readonly float Width = 1;

[Desc("Line angle.")]
public readonly WAngle Angle = WAngle.Zero;

[Desc("Line length.")]
public readonly WDist Length = WDist.Zero;

[Desc("Dash length.")]
public readonly WDist DashLength = WDist.Zero;

[Desc("Fade duration in ticks.")]
public readonly int FadeTicks = 0;

[Desc("If true, fade in as well as out.")]
public readonly bool FadeIn = true;

public override object Create(ActorInitializer init) { return new RenderLine(init.Self, this); }
}

public class RenderLine : ConditionalTrait<RenderLineInfo>, INotifyCreated, IRenderAnnotations, ITick
{
readonly RenderLineInfo info;
int currentAlpha;
int ticksUntilFaded;
int fadePerTick;

public RenderLine(Actor self, RenderLineInfo info)
: base(info)
{
this.info = info;
currentAlpha = info.Color.ToAhsv().A;
ticksUntilFaded = info.FadeTicks;
fadePerTick = info.FadeTicks > 0 ? currentAlpha / info.FadeTicks : 0;
}

protected override void Created(Actor self)
{
base.Created(self);
}

void ITick.Tick(Actor self)
{
if (info.FadeTicks == 0)
return;

if (--ticksUntilFaded <= 0)
{
ticksUntilFaded = info.FadeTicks;

if (info.FadeIn)
fadePerTick *= -1;
else
currentAlpha = info.Color.ToAhsv().A;
}

currentAlpha -= fadePerTick;
}

public IEnumerable<IRenderable> LineRenderables(Actor self, WorldRenderer wr)
{
if (!self.Owner.IsAlliedWith(self.World.RenderPlayer))
yield break;

if (IsTraitDisabled)
yield break;

var dashLength = info.DashLength == WDist.Zero ? info.Length : info.DashLength;
var dashVector = new WVec(0, -dashLength.Length, 0);
dashVector = dashVector.Rotate(WRot.FromYaw(info.Angle));

var currentDashStartPos = self.CenterPosition;
var lengthTravelled = WDist.Zero;
var color = Color.FromArgb(currentAlpha, info.Color);

while (lengthTravelled.Length < info.Length.Length)
{
lengthTravelled = lengthTravelled + (dashLength * 2);
yield return new LineAnnotationRenderable(currentDashStartPos, currentDashStartPos + dashVector, info.Width, color);
currentDashStartPos += (dashVector * 2);
}
}

IEnumerable<IRenderable> IRenderAnnotations.RenderAnnotations(Actor self, WorldRenderer wr)
{
return LineRenderables(self, wr);
}

bool IRenderAnnotations.SpatiallyPartitionable { get { return false; } }
}
}
2 changes: 1 addition & 1 deletion OpenRA.Mods.CA/Traits/TargetedAttackAbility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public TargetedAttackAbilityOrderGenerator(Actor self, TargetedAttackAbility abi
info = ability.Info;

selectedWithAbility = self.World.Selection.Actors
.Where(a => a.Info.HasTraitInfo<TargetedAttackAbilityInfo>() && a != self && a.Owner == self.Owner)
.Where(a => a.Info.HasTraitInfo<TargetedAttackAbilityInfo>() && a != self && a.Owner == self.Owner && !a.IsDead)
.Select(a => new TraitPair<TargetedAttackAbility>(a, a.Trait<TargetedAttackAbility>()))
.Where(s => s.Trait.Info.Type == ability.Info.Type);
}
Expand Down
2 changes: 1 addition & 1 deletion mods/ca/maps/ca-composition-tester/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1570,4 +1570,4 @@ Actors:
TurretFacing: 192
Owner: Multi2

Rules: composition-tester-rules-base.yaml, rules.yaml
Rules: ca|rules/custom/composition-tester.yaml, rules.yaml
2 changes: 1 addition & 1 deletion mods/ca/maps/ca-composition-tournament/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,6 @@ Actors:
Owner: Neutral
Location: 104,118

Rules: ca|maps/ca-composition-tester/composition-tester-rules-base.yaml, rules.yaml
Rules: ca|rules/custom/composition-tester.yaml, rules.yaml

Weapons: weapons.yaml
2 changes: 1 addition & 1 deletion mods/ca/maps/ca-prologue-03/ca-prologue-03.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WorldLoaded = function()
InitUSSR()

ObjectiveLocateForces = GDI.AddObjective("Locate all GDI forces.")
ObjectiveExit = GDI.AddObjective("Find an safe exit route.")
ObjectiveExit = GDI.AddObjective("Find a safe exit route.")

SetupReveals({ Reveal1, Reveal3, Reveal4 })

Expand Down
2 changes: 1 addition & 1 deletion mods/ca/maps/ca01-crossrip/ca01.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Squads = {
MaxTime = DateTime.Minutes(6)
},
{
Infantry = { "e3", "e1", "e1", "e3", "shok", "e1", { "shok", "n8" }, "e1", "e2", "e3", "e4" }, -- 2510
Infantry = { "e3", "e1", "e1", "e3", "shok", "e1", { "shok", "e8" }, "e1", "e2", "e3", "e4" }, -- 2510
Vehicles = { { "3tnk", "3tnk.atomic" }, "4tnk", "btr.ai", { "katy", "v2rl" }, "ttra" }, -- 5475 (+800)
MinTime = DateTime.Minutes(6)
}
Expand Down
6 changes: 6 additions & 0 deletions mods/ca/maps/ca04-containment/rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ OCAR.CHPR:
OCAR.Husk:
Inherits@GDIPAL: ^GDIPalette

SEAS:
RevealsShroud:
Range: 4c512
MinRange: 0
-RevealsShroud@GAPGEN:

SAPC:
ExternalCondition@FORCEUNCLOAK:
Condition: cloak-force-disabled
Expand Down
1 change: 1 addition & 0 deletions mods/ca/maps/ca04-containment/weapons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ FireballLauncher:
Speed: 200

FLAK-SEAS-AG:
Range: 4c512
Warhead@1Dam: SpreadDamage
Versus:
None: 100
Expand Down
2 changes: 1 addition & 1 deletion mods/ca/maps/ca06-conspiracy/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3926,4 +3926,4 @@ Rules: ca|rules/campaign-rules.yaml, ca|rules/campaign-tooltips.yaml, ca|rules/c

Weapons: ca|weapons/campaign.yaml, weapons.yaml

Notifications: ca|rules/map/force-cabal-eva.yaml
Notifications: ca|rules/custom/force-cabal-eva.yaml
4 changes: 2 additions & 2 deletions mods/ca/maps/ca07-subversion/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4155,7 +4155,7 @@ Actors:
Owner: Neutral
Location: 75,67
BattleTankPatroller1: mtnk
Owner: Neutral
Owner: GDI
Facing: 0
Location: 75,68
BattleTankPatrol2: waypoint
Expand Down Expand Up @@ -4382,4 +4382,4 @@ Rules: ca|rules/campaign-rules.yaml, ca|rules/campaign-tooltips.yaml, ca|rules/c

Weapons: ca|weapons/campaign.yaml, weapons.yaml

Notifications: ca|rules/map/force-cabal-eva.yaml
Notifications: ca|rules/custom/force-cabal-eva.yaml
2 changes: 1 addition & 1 deletion mods/ca/maps/ca08-salvation/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1871,4 +1871,4 @@ Rules: ca|rules/campaign-rules.yaml, ca|rules/campaign-tooltips.yaml, ca|rules/c

Weapons: ca|weapons/campaign.yaml

Notifications: ca|rules/map/force-cabal-eva.yaml
Notifications: ca|rules/custom/force-cabal-eva.yaml
2 changes: 1 addition & 1 deletion mods/ca/maps/ca09-zenith/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4418,4 +4418,4 @@ Rules: ca|rules/campaign-rules.yaml, ca|rules/campaign-tooltips.yaml, ca|rules/c

Weapons: ca|weapons/campaign.yaml, weapons.yaml

Notifications: ca|rules/map/force-cabal-eva.yaml
Notifications: ca|rules/custom/force-cabal-eva.yaml
2 changes: 1 addition & 1 deletion mods/ca/maps/ca10-awakening/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1775,4 +1775,4 @@ Rules: ca|rules/campaign-rules.yaml, ca|rules/campaign-tooltips.yaml, ca|rules/c

Weapons: ca|weapons/campaign.yaml

Notifications: ca|rules/map/force-cabal-eva.yaml
Notifications: ca|rules/custom/force-cabal-eva.yaml
8 changes: 5 additions & 3 deletions mods/ca/maps/ca11-abasement/ca11.lua
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,15 @@ SignalTransmitterDiscovered = function()
end

BaseFlipNotification = function()
Trigger.AfterDelay(DateTime.Seconds(3), function()
Trigger.AfterDelay(AdjustTimeForGameSpeed(DateTime.Seconds(4)), function()
if not IsFirstBaseFlipped then
IsFirstBaseFlipped = true
Media.DisplayMessage("Your efforts are appreciated. The Brotherhood will provide support.", "Nod Commander", HSLColor.FromHex("FF0000"))
MediaCA.PlaySound("seth_appreciate.aud", 2)
Media.DisplayMessage("The Brotherhood appreciates your efforts. We will begin deploying our troops to assist you.", "Nod Commander", HSLColor.FromHex("FF0000"))
elseif not IsSecondBaseFlipped then
IsSecondBaseFlipped = true
Media.DisplayMessage("Kane will be pleased. Now we must focus our efforts and secure the Signal Transmitter!", "Nod Commander", HSLColor.FromHex("FF0000"))
MediaCA.PlaySound("seth_kanepleased.aud", 2)
Media.DisplayMessage("Kane will be pleased. Now focus your efforts on securing the Signal Transmitter.", "Nod Commander", HSLColor.FromHex("FF0000"))
end
end)
end
Binary file added mods/ca/maps/ca11-abasement/seth_appreciate.aud
Binary file not shown.
Binary file added mods/ca/maps/ca11-abasement/seth_kanepleased.aud
Binary file not shown.
24 changes: 18 additions & 6 deletions mods/ca/maps/ca26-foothold/ca26.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ ReinforcementsInterval = {
hard = DateTime.Minutes(5)
}

HarvesterDeathDelayTime = {
easy = DateTime.Seconds(30),
normal = DateTime.Seconds(25),
hard = DateTime.Seconds(20),
}

Squads = {
ScrinMain = {
Delay = {
Expand All @@ -22,9 +28,9 @@ Squads = {
hard = DateTime.Minutes(3)
},
AttackValuePerSecond = {
easy = { { MinTime = 0, Value = 20 }, { MinTime = DateTime.Minutes(14), Value = 50 } },
normal = { { MinTime = 0, Value = 50 }, { MinTime = DateTime.Minutes(12), Value = 100 } },
hard = { { MinTime = 0, Value = 80 }, { MinTime = DateTime.Minutes(10), Value = 160 } },
easy = { { MinTime = 0, Value = 20 }, { MinTime = DateTime.Minutes(13), Value = 50 } },
normal = { { MinTime = 0, Value = 50 }, { MinTime = DateTime.Minutes(11), Value = 100 } },
hard = { { MinTime = 0, Value = 80 }, { MinTime = DateTime.Minutes(9), Value = 160 } },
},
QueueProductionStatuses = {
Infantry = false,
Expand All @@ -42,9 +48,11 @@ Squads = {
},
ScrinWater = {
Delay = {
normal = DateTime.Minutes(7),
hard = DateTime.Minutes(6)
},
AttackValuePerSecond = {
normal = { { MinTime = 0, Value = 20 } },
hard = { { MinTime = 0, Value = 28 }, { MinTime = DateTime.Minutes(10), Value = 55 } },
},
QueueProductionStatuses = {
Expand All @@ -56,6 +64,10 @@ Squads = {
ProducerActors = nil,
ProducerTypes = { Infantry = { "port" }, Vehicles = { "wsph" } },
Units = {
normal = {
{ Vehicles = { "intl.ai2", { "seek", "lace" } }, },
{ Vehicles = { { "seek", "lace" }, { "seek", "lace" }, { "seek", "lace" } }, },
},
hard = {
{ Vehicles = { "intl", "intl.ai2", "seek" }, },
{ Vehicles = { "seek", "seek", "seek" }, },
Expand Down Expand Up @@ -342,7 +354,7 @@ BeginScrinAttacks = function()
InitAirAttackSquad(Squads.ScrinAir, Scrin, GDI, { "harv.td", "msam", "hsam", "nuke", "nuk2", "orca", "a10", "a10.upg", "auro", "htnk", "htnk.drone", "htnk.ion", "htnk.hover", "titn", "titn.rail" })
end)

if Difficulty == "hard" then
if Difficulty ~= "easy" then
Trigger.AfterDelay(Squads.ScrinWater.Delay[Difficulty], function()
InitAttackSquad(Squads.ScrinWater, Scrin)
end)
Expand All @@ -352,11 +364,11 @@ end
InitTibLifeforms = function()

if Difficulty ~= "hard" then
Blob2.Destroy()
Blob1.Destroy()
end

if Difficulty == "easy" then
Blob1.Destroy()
Blob2.Destroy()
Blob3.Destroy()
return
end
Expand Down
Loading

0 comments on commit 44a5571

Please sign in to comment.