accessory visuals
This commit is contained in:
1 parent
00e4dcf033
commit
493791c23b
6 files changed
+24
-17
No files matched your search
@@ -60,6 +60,7 @@ using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses.BrainOfCthulhu;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -2353,8 +2354,9 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (fleshTotem && hurtInfo.Damage > 0)
|
||||
{
|
||||
if (fleshTotemManaStorage >= 100)
|
||||
SoundEngine.PlaySound(BloodflareHeadRanged.ActivationSound, Player.Center);
|
||||
SoundStyle Counter = new SoundStyle("CalamityMod/Sounds/Custom/BrainOfCthulhu/BoC_Rev_Shield_Down");
|
||||
if (fleshTotemManaStorage >= 100 && fleshTotemVisual)
|
||||
SoundEngine.PlaySound(Counter with { Volume = 0.75f}, Player.Center);
|
||||
int lostSoulAmount = fleshTotemManaStorage / 25;
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<FleshTotemMinion>()] != 0)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,6 @@ using CalamityMod.NPCs.PlagueEnemies;
|
||||
using CalamityMod.NPCs.TownNPCs;
|
||||
using CalamityMod.Packets;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Mage;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Pets;
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.fleshTotem = true;
|
||||
modPlayer.fleshTotemMinion = true;
|
||||
modPlayer.fleshTotemVisual = !hideVisual;
|
||||
player.statManaMax2 += 30;
|
||||
player.GetCritChance<MagicDamageClass>() += 5;
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
//Main.NewText(pulseMax);
|
||||
if (visuals)
|
||||
{
|
||||
SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center);
|
||||
SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound with { Volume = 0.65f }, Projectile.Center);
|
||||
for (int k = 0; k < 30; k++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.IceTorch, new Vector2(9, 9).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.5f, 0.8f), 0, Color.LightSkyBlue, Main.rand.NextFloat(1.2f, 1.4f));
|
||||
@@ -163,10 +163,10 @@ namespace CalamityMod.Projectiles.Magic
|
||||
dust.color = Color.Cyan;
|
||||
}
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
//When at max, draw glowing eyes on the totem
|
||||
if (modPlayer.fleshTotemManaStorage == 600)
|
||||
Main.EntitySpriteDraw(totemEyes, eyesDrawPosition + Vector2.UnitX * -2f, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
//When at max, draw glowing eyes on the totem
|
||||
if (modPlayer.fleshTotemManaStorage == 600)
|
||||
Main.EntitySpriteDraw(totemEyes, eyesDrawPosition + Vector2.UnitX * -2f, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
public override bool? CanDamage() => false;
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override string Texture => "CalamityMod/Projectiles/Rogue/PhantasmalSoulBlue";
|
||||
public ref float Time => ref Projectile.ai[0];
|
||||
public float dustRotation = 0;
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public bool visuals => Owner.Calamity().fleshTotemVisual; // Enables/disables visuals and sounds based on accessory visibility
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -53,18 +55,18 @@ namespace CalamityMod.Projectiles.Magic
|
||||
float squash = Utils.GetLerpValue(1, 3, Projectile.velocity.Length(), true);
|
||||
if (squash > 0.15f)
|
||||
{
|
||||
Particle fadeInfx = new CustomSpark(Projectile.Center, Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomCircle", false, 15, 0.5f * Projectile.scale, Color.SkyBlue * 0.4f * squash, new Vector2(1 - 0.15f * squash, 1f), true, false, shrinkSpeed: 0.3f * squash);
|
||||
Particle fadeInfx = new CustomSpark(Projectile.Center, Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomCircle", false, 15, 0.5f * Projectile.scale, Color.SkyBlue * 0.4f * squash, new Vector2(1 - 0.15f * squash, 1f), true, false, shrinkSpeed: 0.1f * squash);
|
||||
GeneralParticleHandler.SpawnParticle(fadeInfx);
|
||||
}
|
||||
Particle smoke = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(-0.2f, -0.6f), Color.SkyBlue, 3, Main.rand.NextFloat(0.25f, 0.3f), 1f, Main.rand.NextFloat(-0.2f, 0.2f), false);
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
if (Time > 5)
|
||||
if (Time > 5 && visuals)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
dustRotation += 0.12f;
|
||||
Vector2 dustPos = Projectile.Center + (MathHelper.Pi + dustRotation + MathHelper.PiOver2).ToRotationVector2() * 10f * Projectile.scale;
|
||||
Dust dust = Dust.NewDustPerfect(dustPos, 175, (MathHelper.Pi + dustRotation * Math.Sign(Projectile.velocity.Length())).ToRotationVector2() * 2);
|
||||
Dust dust = Dust.NewDustPerfect(dustPos, DustID.SpectreStaff, (MathHelper.Pi + dustRotation * Math.Sign(Projectile.velocity.Length())).ToRotationVector2() * 2);
|
||||
dust.noGravity = false;
|
||||
dust.scale = Main.rand.NextFloat(0.75f, 1.2f);
|
||||
dust.alpha = Main.rand.Next(100, 170 + 1);
|
||||
@@ -91,12 +93,15 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
if (visuals)
|
||||
{
|
||||
Vector2 sparkVel = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.ToRadians(24f)) * Main.rand.NextFloat(6f, 10f);
|
||||
Color color = Main.hslToRgb(Main.rand.NextFloat(0.3f, 0.5f), 1f, 0.8f);
|
||||
SparkParticle spark = new(Projectile.Center, sparkVel, false, 30, 1.3f, color);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Vector2 sparkVel = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(MathHelper.ToRadians(24f)) * Main.rand.NextFloat(6f, 10f);
|
||||
Color color = Main.hslToRgb(Main.rand.NextFloat(0.3f, 0.5f), 1f, 0.8f);
|
||||
SparkParticle spark = new(Projectile.Center, sparkVel, false, 30, 1.3f, color);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Mage
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class MoonSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Mage";
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 20;
|
||||
|
||||
Reference in new issue
Block a user