Bad ideas fixed @ BaseMinionProjectile.cs (No Changelog).
This commit is contained in:
1 parent
0d6eece7ea
commit
3587f8a538
4 files changed
+14
-8
No files matched your search
@@ -44,9 +44,15 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
/// <see cref="ProjectileID.Sets.DrawScreenCheckFluff"/> is set to this value.<br/>
|
||||
/// Defaults to 1200f (75 tiles).
|
||||
/// </summary>
|
||||
public virtual float MaxEnemyDistanceDetection => 1200f;
|
||||
private const float MinEnemyDistanceDetection = 960f;
|
||||
private float AdaptiveEnemyDistanceDetection => Target == null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection;
|
||||
public virtual float EnemyDistanceDetection => 1200f;
|
||||
|
||||
/// <summary>
|
||||
/// The min distance in which the minion can detect an enemy before it goes to its correspondent enemy distance detection.
|
||||
/// Defaults to 960f (60 tiles), the radius of a 1080p monitor at max zoom.
|
||||
/// </summary>
|
||||
public virtual float MinEnemyDistanceDetection => 960f;
|
||||
|
||||
private float AdaptiveEnemyDistanceDetection => Target == null ? MinEnemyDistanceDetection : EnemyDistanceDetection;
|
||||
|
||||
/// <summary>
|
||||
/// The amount of local I-Frames this minion has.<br/>
|
||||
@@ -103,7 +109,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles
|
||||
ProjectileID.Sets.MinionTargettingFeature[Type] = true;
|
||||
ProjectileID.Sets.TrailingMode[Type] = TrailingMode;
|
||||
ProjectileID.Sets.TrailCacheLength[Type] = TrailCacheLength;
|
||||
ProjectileID.Sets.DrawScreenCheckFluff[Type] = (int)MaxEnemyDistanceDetection;
|
||||
ProjectileID.Sets.DrawScreenCheckFluff[Type] = (int)EnemyDistanceDetection;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public void FollowPlayer()
|
||||
{
|
||||
// If the minion starts to get far, force the minion to go to you.
|
||||
if (Projectile.WithinRange(Owner.Center, MaxEnemyDistanceDetection) && !Projectile.WithinRange(Owner.Center, 300f))
|
||||
if (Projectile.WithinRange(Owner.Center, EnemyDistanceDetection) && !Projectile.WithinRange(Owner.Center, 300f))
|
||||
Projectile.velocity = (Owner.Center - Projectile.Center) / 30f;
|
||||
|
||||
// The minion will change directions to you if it's going away from you, meaning it'll just hover around you.
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.velocity = (Projectile.velocity * 37f + Projectile.SafeDirectionTo(Owner.Center) * 17f) / 40f;
|
||||
|
||||
// Teleport to the owner if sufficiently far away.
|
||||
if (!Projectile.WithinRange(Owner.Center, MaxEnemyDistanceDetection))
|
||||
if (!Projectile.WithinRange(Owner.Center, EnemyDistanceDetection))
|
||||
{
|
||||
Projectile.position = Owner.Center;
|
||||
Projectile.velocity *= 0.3f;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override ref bool AssociatedMinionBool => ref ModdedOwner.CalamarisLament;
|
||||
|
||||
// Increased to be able to target DoG reliably.
|
||||
public override float MaxEnemyDistanceDetection => CalamarisLament.EnemyDistanceDetection;
|
||||
public override float EnemyDistanceDetection => CalamarisLament.EnemyDistanceDetection;
|
||||
|
||||
// It's an Abyss-origin summon, it deserves having visibility in Abyss areas.
|
||||
public override bool PreventTargettingUntilTargetHit => false;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override int AssociatedBuffTypeID => ModContent.BuffType<MutatedTruffleBuff>();
|
||||
public override ref bool AssociatedMinionBool => ref ModdedOwner.MutatedTruffleBool;
|
||||
public override float MinionSlots => 3f;
|
||||
public override float MaxEnemyDistanceDetection => MutatedTruffle.EnemyDistanceDetection;
|
||||
public override float EnemyDistanceDetection => MutatedTruffle.EnemyDistanceDetection;
|
||||
|
||||
public enum AIState { Idle, Dashing, Toothball, Vortex }
|
||||
public AIState State { get => (AIState)Projectile.ai[0]; set => Projectile.ai[0] = (int)value; }
|
||||
|
||||
Reference in new issue
Block a user