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 Sep 23, 2024
2 parents d0e0c32 + 4887f05 commit ffbb9e4
Show file tree
Hide file tree
Showing 400 changed files with 768 additions and 708 deletions.
5 changes: 5 additions & 0 deletions OpenRA.Mods.CA/Activities/Upgrade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ protected override void OnFirstRun(Actor self)
host = Target.FromActor(hostActor);
notifyResupplies = host.Actor.TraitsImplementing<INotifyResupply>().ToArray();
}
else
notifyResupplies = Array.Empty<INotifyResupply>();
}

/* Return true to complete. */
Expand Down Expand Up @@ -98,6 +100,9 @@ public override bool Tick(Actor self)

if (!isCloseEnough)
{
if (move == null)
return true;

QueueChild(move.MoveWithinRange(host, upgradeable.Info.UpgradeAtRange - WDist.FromCells(1), targetLineColor: targetLineColor));
return false;
}
Expand Down
5 changes: 4 additions & 1 deletion OpenRA.Mods.CA/Projectiles/PlasmaBeam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,10 @@ void DoImpacts()
ImpactPosition = target,
};

args.Weapon.Impact(Target.FromPos(target), warheadArgs);
if (info.TrackTarget && args.Weapon.TargetActorCenter)
args.Weapon.Impact(args.GuidedTarget, warheadArgs);
else
args.Weapon.Impact(Target.FromPos(target), warheadArgs);
}
}

Expand Down
21 changes: 19 additions & 2 deletions OpenRA.Mods.CA/Traits/Conditions/GrantTimedConditionOnDeploy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ public class GrantTimedConditionOnDeployInfo : PausableConditionalTraitInfo

public readonly bool StartsFullyCharged = false;

[Desc("If true, the condition will be granted instantly (not delayed by animations/activities).")]
public readonly bool Instant = false;

[VoiceReference]
public readonly string Voice = "Action";

Expand Down Expand Up @@ -171,7 +174,15 @@ void IResolveOrder.ResolveOrder(Actor self, Order order)
return;

if (!order.Queued)
self.CancelActivity();
{
if (Info.Instant)
{
Deploy();
return;
}
else
self.CancelActivity();
}

// Turn to the required facing.
if (Info.Facing != -1 && canTurn)
Expand Down Expand Up @@ -202,11 +213,17 @@ public void Deploy()
Game.Sound.Play(SoundType.World, Info.DeploySound, self.CenterPosition);

var wsb = wsbs.FirstEnabledTraitOrDefault();
var hasDeployAnimation = wsb != null && !string.IsNullOrEmpty(Info.DeployAnimation);

// If there is no animation to play just grant the upgrades that are used while deployed.
// Alternatively, play the deploy animation and then grant the upgrades.
if (string.IsNullOrEmpty(Info.DeployAnimation) || wsb == null)
if (Info.Instant || !hasDeployAnimation)
{
OnDeployCompleted();

if (hasDeployAnimation)
wsb.PlayCustomAnimation(self, Info.DeployAnimation);
}
else
{
if (deployingToken == Actor.InvalidConditionToken)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.CA/Traits/TargetedLeapAbility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class TargetedLeapAbilityInfo : PausableConditionalTraitInfo, Requires<Mo

[CursorReference]
[Desc("Cursor to display when targeting a teleport location.")]
public readonly string TargetCursor = "chrono-target";
public readonly string TargetCursor = "ability";

[CursorReference]
[Desc("Cursor to display when the targeted location is blocked.")]
Expand Down
11 changes: 9 additions & 2 deletions OpenRA.Mods.CA/Warheads/FireShrapnelWarhead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class FireShrapnelWarhead : WarheadAS, IRulesetLoaded<WeaponInfo>
[Desc("List of sounds that can be played on impact.")]
public readonly string[] ImpactSounds = Array.Empty<string>();

[Desc("Should the shrapnel target actors in order of distance?")]
public readonly bool TargetClosest = false;

WeaponInfo weapon;

public void RulesetLoaded(Ruleset rules, WeaponInfo info)
Expand Down Expand Up @@ -103,8 +106,12 @@ public override void DoImpact(in Target target, WarheadArgs args)
return true;
return false;
})
.Shuffle(world.SharedRandom);
});

if (TargetClosest)
availableTargetActors = availableTargetActors.OrderBy(x => (x.CenterPosition - epicenter).Length);
else
availableTargetActors = availableTargetActors.Shuffle(world.SharedRandom);

var targetActor = availableTargetActors.GetEnumerator();

Expand Down
Binary file modified mods/ca/bits/audio/ifvmg1.aud
Binary file not shown.
Binary file modified mods/ca/bits/audio/ifvmg2.aud
Binary file not shown.
Binary file removed mods/ca/bits/audio/ifvmg3.aud
Binary file not shown.
Binary file added mods/ca/bits/audio/pitbull-hit1.aud
Binary file not shown.
Binary file added mods/ca/bits/scrin/watched.shp
Binary file not shown.
Binary file modified mods/ca/bits/upg-bjeticon.shp
Binary file not shown.
Binary file modified mods/ca/maps/ca-testing-grounds/map.bin
Binary file not shown.
Loading

0 comments on commit ffbb9e4

Please sign in to comment.