Fix Main.screenW in other minion AIs

This commit is contained in:
Ozzatron committed 2023-10-14 13:16:00 -04:00
1 parent ce1c300882
commit 1ecdf86d95
3 files changed
+18 -5

No files matched your search

@@ -10,10 +10,16 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides
{
public static class HornetMinionAI
{
// Shorter range when the minion has no target yet: 40 tiles
private const float MinEnemyDistanceDetection = 640f;
// Longer range when a target is already acquired: 75 tiles
private const float MaxEnemyDistanceDetection = 1200f;
private static float EnemyDistanceDetection { get => Target is null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection; }
private const int FireRate = 40;
private const float ProjectileVelocity = 20f;
private static float EnemyDistanceDetection { get => (Target is null) ? Main.screenWidth / 2f : MaxEnemyDistanceDetection; }
private static NPC Target { get; set; }
public static bool DoHornetMinionAI(Projectile proj)
@@ -7,10 +7,16 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides
{
public static class ImpMinionAI
{
// Shorter range when the minion has no target yet: 40 tiles
private const float MinEnemyDistanceDetection = 640f;
// Longer range when a target is already acquired: 75 tiles
private const float MaxEnemyDistanceDetection = 1200f;
private static float EnemyDistanceDetection { get => Target is null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection; }
private const int FireRate = 75;
private const float ProjectileVelocity = 20f;
private static float EnemyDistanceDetection { get => (Target is null) ? Main.screenWidth / 2f : MaxEnemyDistanceDetection; }
private static NPC Target { get; set; }
public static bool DoImpMinionAI(Projectile proj)
@@ -10,10 +10,11 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides
{
public static class RavenMinionAI
{
// 60 tiles of enemy detection distance radius; a screen of diameter.
// Shorter range when the minion has no target yet: 60 tiles
// This is half of the width of a 1920x1080 screen.
private const float MinEnemyDistanceDetection = 960f;
// 150 tiles of enemy detection distance radius.
// Longer range when a target is already acquired: 150 tiles
private const float MaxEnemyDistanceDetection = 2400f;
// The detection distance dynamically updates.