Compare commits

...

3 Commits

Author SHA1 Message Date
Matthias Mailänder
22a42b7dc9 Manually add game speeds to the linter. 2022-11-18 23:14:54 +01:00
Gustas
c01e4043e8 Introduce MinDistance to AreaBeam projectile 2022-11-17 20:51:28 +01:00
Thomas Christlieb
c8665c98a6 fix misclicks through sidebar 2022-11-16 23:22:39 +01:00
5 changed files with 28 additions and 3 deletions

View File

@@ -32,6 +32,15 @@ namespace OpenRA.Mods.Common.Lint
var language = "en";
var translation = new Translation(language, modData.Manifest.Translations, modData.DefaultFileSystem);
var gameSpeeds = modData.Manifest.Get<GameSpeeds>();
foreach (var speed in gameSpeeds.Speeds.Values)
{
if (!translation.HasMessage(speed.Name))
emitError($"{speed.Name} not present in {language} translation.");
referencedKeys.Add(speed.Name);
}
foreach (var modType in modData.ObjectCreator.GetTypes())
{
foreach (var fieldInfo in modType.GetFields(Binding).Where(m => m.HasAttribute<TranslationReferenceAttribute>()))

View File

@@ -42,6 +42,9 @@ namespace OpenRA.Mods.Common.Projectiles
[Desc("How far beyond the target the projectile keeps on travelling.")]
public readonly WDist BeyondTargetRange = new WDist(0);
[Desc("The minimum distance the beam travels.")]
public readonly WDist MinDistance = WDist.Zero;
[Desc("Damage modifier applied at each range step.")]
public readonly int[] Falloff = { 100, 100 };
@@ -136,7 +139,19 @@ namespace OpenRA.Mods.Common.Projectiles
// Update the target position with the range we shoot beyond the target by
// I.e. we can deliberately overshoot, so aim for that position
var dir = new WVec(0, -1024, 0).Rotate(WRot.FromYaw(towardsTargetFacing));
target += dir * info.BeyondTargetRange.Length / 1024;
var dist = (args.SourceActor.CenterPosition - target).Length;
int extraDist;
if (info.MinDistance.Length > dist)
{
if (info.MinDistance.Length - dist < info.BeyondTargetRange.Length)
extraDist = info.BeyondTargetRange.Length;
else
extraDist = info.MinDistance.Length - dist;
}
else
extraDist = info.BeyondTargetRange.Length;
target += dir * extraDist / 1024;
length = Math.Max((target - headPos).Length / speed.Length, 1);
weaponRange = new WDist(Util.ApplyPercentageModifiers(args.Weapon.Range.Length, args.RangeModifiers));

View File

@@ -1549,7 +1549,7 @@ Container@PLAYER_WIDGETS:
X: WINDOW_RIGHT - WIDTH - 5
Y: 5
Width: 230
Height: 291
Height: 314
ImageCollection: sidebar
ImageName: background-sidebar
ClickThrough: false

View File

@@ -13,6 +13,7 @@ Sound:
Falloff: 0, 0, 100, 0
Range: 0, 0c450, 4c0, 8c0
BeyondTargetRange: 1c0
MinDistance: 5c0
Color: 00FFFFC8
Warhead@1Dam: SpreadDamage
Range: 0, 32

View File

@@ -603,7 +603,7 @@ Container@PLAYER_WIDGETS:
X: WINDOW_RIGHT - 250
Y: 272
Width: 238
Height: 27
Height: 28
ImageCollection: sidebar
ImageName: background-moneybin
ClickThrough: false