Final touch-ups to Snake Eyes.

This commit is contained in:
Memes authored and Ozzatron committed 2023-08-29 15:11:48 -04:00
1 parent 2401b30db9
commit 3457afbdac
5 files changed
+23 -20

No files matched your search

+3 -3
View File
@@ -1,10 +1,10 @@
using CalamityMod.CustomRecipes;
using System;
using System.Collections.Generic;
using CalamityMod.CustomRecipes;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
@@ -164,7 +164,10 @@ SnakeEyes: {
DisplayName: Snake Eyes
Tooltip:
'''
Summons a mechanical surveillance drone that flies around enemies and mercilessly zaps them with electricity
Summons magnetic orbs to shred your foes with intense polarized energy
The orb will fire a single piercing beam that travels towards enemies
If the beam hits, the orb will teleport and deflect the projectile back
The deflected beam homes into enemies rapidly and explodes on impact
[c/1FFBFF:'Equipped with high-end sensors, little can evade them. Even less are able to escape their ever watchful eyes.]
[c/1FFBFF:An excellent bridge between my experiments with the sight-based soul powered machines and my latest project.']
'''
@@ -45,6 +45,7 @@ UnstableMatter.DisplayName: Unstable Matter
VoltageStream.DisplayName: Voltage Stream
WavePounderBoom.DisplayName: Explosion
WavePounderProjectile.DisplayName: Wave Pounder
SnakeEyesProjectile.DisplayName: Snake Eyes' Beam
// Environmental
AcidDrop.DisplayName: Acid
BrimstoneGeyser.DisplayName: Smoke
@@ -70,5 +71,4 @@ PlagueExplosionGas.DisplayName: Plague Gas
PlagueShot.DisplayName: Plague Shot
PlagueShotBuffer.DisplayName: Plague Shot
WaterShot.DisplayName: Water Shot
WaterShotBuffer.DisplayName: Water Shot
SnakeEyesProjectile.DisplayName: Snake Eyes Projectile
WaterShotBuffer.DisplayName: Water Shot
@@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionShot[Type] = true;
// While this projectile doesn't have afterimages, it keeps track of old positions for its primitive drawcode.
ProjectileID.Sets.TrailingMode[Type] = 2;
ProjectileID.Sets.TrailCacheLength[Type] = 6;
@@ -92,10 +92,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Projectile.timeLeft = 2;
}
for (int i = 0; i < 2; i++)
{
Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, HasRedirected ? 261 : 226, Scale : HasRedirected ? 2f : .5f);
Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, HasRedirected ? 261 : 226, Scale: HasRedirected ? 2f : .5f);
trailDust.velocity = Vector2.Zero;
trailDust.noGravity = true;
}
@@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
{
if (!HasRedirected)
return;
Projectile.ExpandHitboxBy(300);
Projectile.Damage();
+10 -10
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public Player Owner => Main.player[Projectile.owner];
public CalamityPlayer ModdedOwner => Owner.Calamity();
public NPC Target => Owner.Center.MinionHoming(2000f, Owner);
public NPC Target => Owner.Center.MinionHoming(SnakeEyes.EnemyDistanceDetection, Owner);
public enum AIState
{
@@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Projectile.minionSlots = 1f;
Projectile.width = Projectile.height = 22;
Projectile.penetrate = -1;
Projectile.friendly = true;
Projectile.minion = true;
Projectile.tileCollide = false;
@@ -64,9 +64,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
// Checks if the minion can still exist given the player's circumstance.
CheckMinionExistence();
// The minion does not use velocity at all, so to prevent AI breaks, velocity will always be 0.
Projectile.velocity = Vector2.Zero;
// The properties of the minion's pupil, it looks around the target if there's one and to the mouse if there isn't any.
EyeAngle = Projectile.SafeDirectionTo((Target is not null) ? Target.Center : Main.MouseWorld).ToRotation();
EyeOutwardness = Utils.Remap(Projectile.Distance((Target is not null) ? Target.Center : Main.MouseWorld), 0f, 300f, 0f, 5f);
@@ -96,16 +93,18 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
private void IdleState()
{
AITimer += .01f;
// The projectile oscillates in place.
Projectile.Center += Vector2.UnitY * MathF.Sin(Main.GlobalTimeWrappedHourly) / 3f;
Projectile.velocity.Y -= MathF.Cos(AITimer) / 350f;
// If the player's far enough from the minion, he'll teleport somewhere around the player.
if (!Projectile.WithinRange(Owner.Center, 400f))
{
Projectile.Center = Owner.Center + Main.rand.NextVector2Circular(300f, 300f);
DoVFXPulse();
}
if (Target is not null)
SwitchAIState(AIState.Targetting);
}
@@ -172,7 +171,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
DoVFXPulse();
SoundEngine.PlaySound(SoundID.Item91 with { Volume = .8f, Pitch = .5f, PitchVariance = .1f }, Projectile.Center);
HasShot = true;
Projectile.netUpdate = true;
}
@@ -195,12 +194,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
private void SwitchAIState(AIState state)
{
State = state;
AITimer = 0f;
HasTeleported = false;
HasShot = false;
RandomPosition = Vector2.Zero;
Projectile.velocity = Vector2.Zero;
DoVFXPulse(state == AIState.Redirecting);
Projectile.netUpdate = true;