Added warhead visualization to combat debug overlay.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Warheads
|
||||
@@ -22,6 +23,14 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
public override void DoImpact(WPos pos, Actor firedBy, IEnumerable<int> damageModifiers)
|
||||
{
|
||||
var world = firedBy.World;
|
||||
|
||||
if (world.LocalPlayer != null)
|
||||
{
|
||||
var devMode = world.LocalPlayer.PlayerActor.TraitOrDefault<DeveloperMode>();
|
||||
if (devMode != null && devMode.ShowCombatGeometry)
|
||||
world.WorldActor.Trait<WarheadDebugOverlay>().AddImpact(pos, Spread);
|
||||
}
|
||||
|
||||
var range = Spread[0];
|
||||
var hitActors = world.FindActorsInCircle(pos, range);
|
||||
if (Spread.Length > 1 && Spread[1].Length > 0)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Warheads
|
||||
@@ -50,6 +51,13 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
|
||||
var world = firedBy.World;
|
||||
|
||||
if (world.LocalPlayer != null)
|
||||
{
|
||||
var devMode = world.LocalPlayer.PlayerActor.TraitOrDefault<DeveloperMode>();
|
||||
if (devMode != null && devMode.ShowCombatGeometry)
|
||||
world.WorldActor.Trait<WarheadDebugOverlay>().AddImpact(pos, Range);
|
||||
}
|
||||
|
||||
// This only finds actors where the center is within the search radius,
|
||||
// so we need to search beyond the maximum spread to account for actors with large health radius
|
||||
var hitActors = world.FindActorsInCircle(pos, Range[Range.Length - 1] + TargetExtraSearchRadius);
|
||||
|
||||
Reference in New Issue
Block a user