Xyk Activity

Updated the guitars substantially, pretty much finished besides maybe the tooltip
This commit is contained in:
Xyk committed 2024-10-06 11:08:47 -07:00
1 parent ffcd46de8e
commit 806d9b3e06
11 files changed
+201 -23

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 B

After

Width:  |  Height:  |  Size: 3.4 KiB

+3 -2
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon
public override void SetDefaults()
{
Item.damage = 20;
Item.damage = 200;
Item.DamageType = DamageClass.Summon;
Item.shoot = ModContent.ProjectileType<AmphibiansGuitarHoldout>();
@@ -35,7 +35,8 @@ namespace CalamityMod.Items.Weapons.Summon
AddIngredient(ItemID.Frog).
AddIngredient<CoreofCalamity>(3).
AddIngredient<LivingShard>(8).
AddTile(ItemID.MythrilAnvil);
AddTile(TileID.MythrilAnvil).
Register();
}
}
}
@@ -907,7 +907,8 @@ AmphibiansGuitar: {
DisplayName: Amphibian's Guitar
Tooltip:
'''
Summons up to 8 guitars that spin around the target and shoot them down.
Summons up to 8 guitars that spin around you and shoot notes at the target, ocasianally firing spread shots
If all 8 guitars are present some notes become empowered dealing extra damage
"I'll show you suffering!"
'''
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

@@ -3,6 +3,7 @@ using CalamityMod.Items.Weapons.Summon;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.Localization;
using Terraria.ModLoader;
@@ -33,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon
public override void AI()
{
SpawnTimer++;
if (SpawnTimer > 15f && Owner.ownedProjectileCounts[MinionType] < 8)
if (SpawnTimer > 19f && Owner.ownedProjectileCounts[MinionType] < 8)
{
Projectile.NewProjectileDirect(
Projectile.GetSource_FromThis(),
+93 -14
View File
@@ -1,9 +1,15 @@
using CalamityMod.Buffs.Summon;
using System;
using System.Collections.Generic;
using CalamityMod.Buffs.Summon;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using CalamityMod.Projectiles.BaseProjectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Projectiles.Summon
@@ -25,13 +31,17 @@ namespace CalamityMod.Projectiles.Summon
get => (int)Projectile.ai[0];
set => Projectile.ai[0] = MathHelper.Clamp(value, 0, 7);
}
public float rotSpeed = 1;
public int time = 0;
public int shootCount = 0;
private float IntendedRotationAngle => MathHelper.TwoPi / (Owner == null ? 1f : MathHelper.Clamp(Owner.ownedProjectileCounts[Type], 1f, 8f)) * Projectile.ai[0] + Main.GlobalTimeWrappedHourly * 2.4f;
private float IntendedRotationAngle => MathHelper.TwoPi / (Owner == null ? 1f : MathHelper.Clamp(Owner.ownedProjectileCounts[Type], 1f, 8f)) * Projectile.ai[0] + Main.GlobalTimeWrappedHourly * 1.8f;
private Vector2 RotationPosition => Target == null ? Owner.MountedCenter : Target.Center;
// Position is same for targeting and non targeting but is left open to be changed because they may want it changed
private Vector2 RotationPosition => Target == null ? Owner.MountedCenter : Owner.MountedCenter;
private ref float ShootTimer => ref Projectile.ai[1];
public Color useColor = Color.White;
public override void SetDefaults()
{
base.SetDefaults();
@@ -40,37 +50,103 @@ namespace CalamityMod.Projectiles.Summon
public override void MinionAI()
{
Projectile.rotation = IntendedRotationAngle;
float sine = MathHelper.Clamp(Math.Abs((float)Math.Sin(Main.GlobalTimeWrappedHourly * 5f / MathHelper.Pi)), 0f, 1f);
rotSpeed = sine;
if (Projectile.ai[2] == 0f)
{
ShootTimer = Main.rand.NextFloat(60);
// Pitch matches the song if played with proper timing
SoundStyle sound = new("CalamityMod/Sounds/Item/AmphibiansGuitarSummon");
SoundEngine.PlaySound(sound with { Volume = 0.8f, Pitch = ((Projectile.ai[0] == 2 || Projectile.ai[0] == 5) ? -0.15f : 0f) }, Projectile.Center);
ShootTimer = Projectile.ai[0] * 10;
Projectile.ai[2]++;
Projectile.netUpdate = true;
Projectile.netSpam = 0;
}
Vector2 intendedPosition = RotationPosition - Vector2.UnitY.RotatedBy(IntendedRotationAngle) * (Target == null ? 100f : (Target.Size.Length() / 2f) + 100f);
Projectile.Center = Vector2.Lerp(Projectile.Center, intendedPosition, Utils.Remap(Projectile.DistanceSQ(intendedPosition), 6400f, 0f, 0.1f, 0.4f));
Vector2 intendedPosition = RotationPosition - Vector2.UnitY.RotatedBy(IntendedRotationAngle) * (Target == null ? 100f : (Target.Size.Length() / 2f) + (600f - 350 * rotSpeed));
Projectile.Center = Vector2.Lerp(Projectile.Center, intendedPosition, Utils.Remap(Projectile.DistanceSQ(intendedPosition), 6400f, 0f, 0.1f, 0.3f));
if (Target != null)
{
if (ShootTimer > 60f && Main.myPlayer == Projectile.owner)
bool bigShot = shootCount % 3 == 0;
if (ShootTimer > 80f && Main.myPlayer == Projectile.owner)
{
Projectile.NewProjectileDirect(
if (bigShot)
{
SoundStyle fire = new("CalamityMod/Sounds/Item/Evernote");
SoundEngine.PlaySound(fire with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = 10 }, Projectile.Center);
}
else
{
SoundStyle fireSmall = new("CalamityMod/Sounds/Item/WulfrumProsthesisShoot");
SoundEngine.PlaySound(fireSmall with { Volume = 0.3f, Pitch = Main.rand.NextFloat(0.6f, 0.7f) }, Projectile.Center);
}
for (int i = 0; i < (bigShot ? 3 : 1); i++)
{
float rot = i == 1 ? -0.25f : i == 2 ? 0.25f : 0;
Projectile.NewProjectileDirect(
Projectile.GetSource_FromThis(),
Projectile.Center,
CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, 12f),
CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, 18f * (1 - Math.Abs(rot))).RotatedBy(rot),
ProjectileType<AmphibiansGuitarProjectile>(),
Projectile.damage,
Projectile.knockBack,
Projectile.owner,
ai0: (Main.rand.NextBool(2) && Owner.ownedProjectileCounts[Type] == 8).ToInt());
ShootTimer = 0f;
ai0: (Main.rand.NextBool(2) && Owner.ownedProjectileCounts[Type] == 8).ToInt(),
Main.rand.Next(0, 4 + 1),
(bigShot ? 5 : 0));
}
if (bigShot)
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, useColor, "CalamityMod/Particles/HighResFoggyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-10, 10), 0.01f, 0.09f, 17);
GeneralParticleHandler.SpawnParticle(blastRing);
}
shootCount++;
ShootTimer = 0;
Projectile.netUpdate = true;
Projectile.netSpam = 0;
}
if (ShootTimer < 10)
Projectile.Center -= Utils.DirectionTo(Projectile.Center, Target.Center) * 10;
ShootTimer += Main.rand.NextBool(60) ? 2f : 1f;
float rate = Main.GlobalTimeWrappedHourly * 2;
List<Color> eColors = new List<Color>()
{
Color.Red,
Color.Cyan,
Color.Goldenrod,
Color.Magenta,
Color.Lime
};
int colorIndex = (int)(rate / 2 % eColors.Count);
Color currentColor = eColors[colorIndex];
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
useColor = Color.Lerp(Color.White, Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f), 0.7f);
if (Main.rand.NextBool(3))
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(70, 70), ModContent.DustType<LightDust>(), (Utils.DirectionTo(Projectile.Center, intendedPosition) * -9).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 1f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.75f, 1.25f);
dust.color = useColor;
dust.noLightEmittence = true;
}
else
{
Particle spark = new GlowOrbParticle(Projectile.Center + Main.rand.NextVector2Circular(70, 70), (Utils.DirectionTo(Projectile.Center, intendedPosition) * -9).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 1f), false, 7, Main.rand.NextFloat(0.5f, 0.8f), useColor, true, false, false);
GeneralParticleHandler.SpawnParticle(spark);
}
ShootTimer += 1;
}
time++;
}
public override bool? CanDamage() => false;
@@ -79,12 +155,15 @@ namespace CalamityMod.Projectiles.Summon
{
Texture2D texture = TextureAssets.Projectile[Type].Value;
Rectangle frame = texture.Frame(horizontalFrames: 8, frameX: GuitarSprite);
Projectile.DrawProjectileWithBackglow(useColor with { A = 0 }, lightColor, Target == null ? 0 : 8, texture, frame);
Main.EntitySpriteDraw(
texture,
Projectile.Center - Main.screenPosition,
frame,
Color.White,
IntendedRotationAngle,
Projectile.rotation,
frame.Size() * 0.5f,
Projectile.scale,
SpriteEffects.None);
@@ -1,6 +1,13 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using System;
using CalamityMod.Dusts;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Summon
{
@@ -11,19 +18,108 @@ namespace CalamityMod.Projectiles.Summon
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public bool IsHatNote => Projectile.ai[0] != 0f;
public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true;
public Color noteColor = Color.White;
public int time = 0;
public NPC targeted;
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionShot[Type] = true;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 32;
Projectile.timeLeft = 300;
Projectile.localNPCHitCooldown = 10;
Projectile.width = 54;
Projectile.height = 44;
Projectile.timeLeft = 150;
Projectile.localNPCHitCooldown = 20;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.usesLocalNPCImmunity = true;
Projectile.penetrate = -1;
Projectile.extraUpdates = 0;
}
public override void AI()
{
if (time == 0)
{
if (IsHatNote)
Projectile.penetrate = 1;
if (Projectile.ai[2] == 5)
Projectile.extraUpdates = 1;
}
Projectile.scale = 1.6f * Utils.GetLerpValue(-5, 20, time, true);
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
if (time % 10 == 0)
{
if (Projectile.ai[1] < 4)
Projectile.ai[1]++;
else
Projectile.ai[1] = 0;
}
Color chooseColor = Projectile.ai[1] switch
{
0 => Color.Red,
1 => Color.Cyan,
2 => Color.Goldenrod,
3 => Color.Magenta,
_ => Color.Lime,
};
if (time == 0)
noteColor = chooseColor;
else
noteColor = Color.Lerp(noteColor, chooseColor, 0.07f);
Lighting.AddLight(Projectile.Center, noteColor.ToVector3() * 0.5f);
if (time % 3 == 0)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(40, 40), ModContent.DustType<LightDust>(), -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.5f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.85f, 1.35f);
dust.color = noteColor;
dust.noLightEmittence = true;
}
if (Projectile.ai[2] == 5 && time % 2 == 0)
{
Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 8, 0.065f, noteColor * 0.75f, new Vector2(1, 0.3f), true, false, 1f);
GeneralParticleHandler.SpawnParticle(spark);
}
time++;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= IsHatNote ? 1.5f : 1f;
public override void OnKill(int timeLeft)
{
if (IsHatNote)
{
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact with { Volume = 0.8f, Pitch = -0.5f }, Projectile.Center);
}
for (int i = 0; i <= (IsHatNote ? 8 : 4); i++)
{
Particle spark = new SparkParticle(Projectile.Center, Projectile.velocity.RotatedByRandom(IsHatNote ? 100 : 0.5f) * Main.rand.NextFloat(0.4f, 1.3f), false, 15, 1.2f, noteColor);
GeneralParticleHandler.SpawnParticle(spark);
}
}
public override bool PreDraw(ref Color lightColor)
{
Asset<Texture2D> tex = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Summon/Evernote");
Asset<Texture2D> tex2 = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Summon/EvernoteWall");
Asset<Texture2D> glow = ModContent.Request<Texture2D>("CalamityMod/Particles/Light");
Vector2 generalDrawPos = Projectile.Center - Main.screenPosition;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], noteColor with { A = 0 } * 0.4f, 1, tex.Value, true, true);
Main.EntitySpriteDraw(tex.Value, generalDrawPos, null, noteColor with { A = 0 }, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.9f * Utils.GetLerpValue(-5, 20, time, true), 1) * Projectile.scale, SpriteEffects.None);
Main.EntitySpriteDraw(tex.Value, generalDrawPos, null, Color.Lerp(Color.White, noteColor, 0.15f) with { A = 0 }, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.9f * Utils.GetLerpValue(-5, 20, time, true), 1) * Projectile.scale * 0.88f, SpriteEffects.None);
if (IsHatNote)
{
for (int i = 0; i < 3; i++)
Main.EntitySpriteDraw(tex2.Value, generalDrawPos, null, noteColor with { A = 0 }, Main.GlobalTimeWrappedHourly * 7.3f + i * 2, tex2.Size() * 0.5f, Projectile.scale * (0.7f + i * 0.7f) * 0.9f, SpriteEffects.None);
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.
Binary file not shown.