Touch-ups to all of the items

This commit is contained in:
Doze-Zoze committed 2025-08-18 16:29:13 -05:00
1 parent 17df6c476a
commit 89416c175a
21 files changed
+143 -270

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, player.Calamity().mouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI,2);
Projectile.NewProjectile(source, player.Calamity().mouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI,1);
return false;
}
}
+2 -2
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee
public class Excelsus : BaseSwordHoldoutItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public override int ProjectileType => ModContent.ProjectileType<ExcelsusMain>();
public override int ProjectileType => ModContent.ProjectileType<ExcelsusHoldout>();
public override void SetStaticDefaults()
{
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<TheObliterator>();
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.shoot = ModContent.ProjectileType<ExcelsusMain>();
Item.shoot = ModContent.ProjectileType<ExcelsusHoldout>();
Item.shootSpeed = 12f;
base.SetDefaults();
}
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.width = 42;
Item.height = 40;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.damage = 200;
Item.damage = 300;
Item.knockBack = 7.5f;
Item.useTime = 20;
Item.useAnimation = 20;
+11 -18
View File
@@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.knockBack = 5f;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.UseSound = SoundID.Item5;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<DWArrow>();
Item.shootSpeed = 20f;
@@ -67,9 +66,15 @@ namespace CalamityMod.Items.Weapons.Ranged
player.itemTime = 180;
player.itemAnimation = 180;
}
else if (Main.myPlayer == player.whoAmI)
else
{
Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 1016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType<FriendlyLaserWallBeam>(), storedDMG, storedKB, player.whoAmI,-1,1);
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 2 && Main.LocalPlayer.Distance(player.Center) < 1600)
Main.LocalPlayer.Calamity().GeneralScreenShakePower = 2;
if (Main.myPlayer == player.whoAmI)
{
Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 1016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType<FriendlyLaserWallBeam>(), storedDMG, storedKB, player.whoAmI, -1, 1);
}
}
}
}
@@ -84,6 +89,9 @@ namespace CalamityMod.Items.Weapons.Ranged
GeneralParticleHandler.SpawnParticle(new DirectionalPulseRing(player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * (48 + scale * 96), Vector2.Zero, Color.Fuchsia, Vector2.One, 0, scale, scale, 3));
if (player.itemTime == 60)
{
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 5 && Main.LocalPlayer.Distance(player.Center) < 1600)
Main.LocalPlayer.Calamity().GeneralScreenShakePower = 5;
if (Main.myPlayer == player.whoAmI)
{
int p = Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center + Vector2.UnitX.RotatedBy(player.itemRotation) * 1016, Vector2.UnitX.RotatedBy(player.itemRotation), ModContent.ProjectileType<FriendlyLaserWallBeam>(), storedDMG*4, storedKB, player.whoAmI,-0.25f,1);
@@ -105,21 +113,6 @@ namespace CalamityMod.Items.Weapons.Ranged
storedDMG = damage;
storedKB = knockback;
return false;
for (int index = 0; index < 4; ++index)
{
float SpeedX = velocity.X + Main.rand.Next(-20, 21) * 0.05f;
float SpeedY = velocity.Y + Main.rand.Next(-20, 21) * 0.05f;
if (CalamityUtils.CheckWoodenAmmo(type, player))
{
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<DWArrow>(), (int)(damage * 1.5f), knockback, player.whoAmI);
}
else
{
int baseArrow = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
Main.projectile[baseArrow].noDropItem = true;
}
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

+3 -3
View File
@@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Boss
{
Vector2 dustSpawnPosition = Projectile.Center + Main.rand.NextVector2Circular(6f, 6f);
Vector2 dustVelocity = Projectile.velocity * -1.2f;
float dustScale = Main.rand.NextFloat(0.6f, 0.8f);
float dustScale = Main.rand.NextFloat(0.6f, 0.8f) * Projectile.scale;
Color dustColor = Color.Lerp(Color.White, IsAPassiveFireball ? Color.SkyBlue : Color.Purple, Main.rand.NextFloat(0.5f, 1f));
Dust dust = Dust.NewDustDirect(dustSpawnPosition, 1, 1, DustID.TintableDustLighted, dustVelocity.X, dustVelocity.Y, 0, dustColor, dustScale);
@@ -75,8 +75,8 @@ namespace CalamityMod.Projectiles.Boss
for (int i = 0; i < 3; i++)
{
Vector2 smokeVelocity = -Projectile.velocity * 0.7f + Main.rand.NextVector2Circular(1f, 1f) * 0.65f;
int smokeLifetime = Main.rand.Next(20, 30);
float smokeScale = Main.rand.NextFloat(0.25f, 0.45f);
int smokeLifetime = Main.rand.Next(10, 15) * (Projectile.friendly ? 1 : 2);
float smokeScale = Main.rand.NextFloat(0.25f, 0.45f) * Projectile.scale;
float smokeOpacity = Main.rand.NextFloat(0.7f, 0.9f);
Color flameColor = Color.Lerp(Color.White, IsAPassiveFireball ? Color.SkyBlue : Color.Purple, Main.rand.NextFloat(0.5f, 1f));
+6 -3
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Magic
public ref float laserType => ref Projectile.ai[2];
public bool canDamage => doneAttack && laserFX >= 1f;
public bool doneAttack = false;
public int attackTime = 30;
public int attackTime = 10;
public float laserLength => 3000;
public float laserFX = 0;
public float storedTime = 0;
@@ -74,12 +74,15 @@ namespace CalamityMod.Projectiles.Magic
if (time >= attackTime && !doneAttack)
{
SoundStyle attack = new("CalamityMod/Sounds/Custom/DoGLaserWallBigAttack");
for (int i = 0; i < 2; i++)
SoundEngine.PlaySound(attack with { Volume = 0.3f, Pitch = 0, MaxInstances = -1 }, targetPos);
SoundEngine.PlaySound(attack with { Volume = 0.5f, Pitch = 0, MaxInstances = -1 }, targetPos);
laserFX = 2.5f;
doneAttack = true;
storedTime = time;
Projectile.ForceNetUpdate();
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 3 && Main.LocalPlayer.Distance(Projectile.Center) < 1600)
Main.LocalPlayer.Calamity().GeneralScreenShakePower = 3;
}
float endTime = storedTime + 10;
if (time >= endTime && doneAttack)
-99
View File
@@ -1,99 +0,0 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class ExcelsusBlue : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override void SetDefaults()
{
Projectile.width = 34;
Projectile.height = 34;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Melee;
Projectile.ignoreWater = true;
Projectile.penetrate = 3;
Projectile.timeLeft = 300;
Projectile.alpha = 100;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override void AI()
{
if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < 16f && Projectile.timeLeft > 85)
{
Projectile.velocity *= 1.05f;
}
if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) > 0f && Projectile.timeLeft <= 85)
{
Projectile.velocity *= 0.98f;
}
Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.02f;
if (Main.rand.NextBool(8))
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.BlueFairy, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
Projectile.tileCollide = false;
if (Projectile.timeLeft > 85)
{
Projectile.timeLeft = 85;
}
return false;
}
public override Color? GetAlpha(Color lightColor)
{
if (Projectile.timeLeft < 85)
{
byte b2 = (byte)(Projectile.timeLeft * 3);
byte a2 = (byte)(100f * ((float)b2 / 255f));
return new Color((int)b2, (int)b2, (int)b2, (int)a2);
}
return default(Color);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void PostDraw(Color lightColor)
{
Color color;
if (Projectile.timeLeft < 85)
{
byte b2 = (byte)(Projectile.timeLeft * 3);
byte a2 = (byte)(100f * ((float)b2 / 255f));
color = new Color((int)b2, (int)b2, (int)b2, (int)a2);
}
else
{
color = new Color(255, 255, 255, 100);
}
Vector2 origin = new Vector2(39f, 46f);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/ExcelsusBlueGlow").Value, Projectile.Center - Main.screenPosition, null, color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.timeLeft > 85)
{
Projectile.timeLeft = 85;
}
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

@@ -1,5 +1,6 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using CalamityMod.Projectiles.BaseProjectiles;
@@ -13,11 +14,11 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class ExcelsusMain : BaseSwordHoldoutProjectile, ILocalizedModType
public class ExcelsusHoldout : BaseSwordHoldoutProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override bool useMeleeSpeed => true;
public override bool useMeleeSize => false;
public override bool useMeleeSize => true;
public override int swingWidth => 270;
public override Item BaseItem => ModContent.GetModItem(ModContent.ItemType<Excelsus>()).Item;
public override int AfterImageLength => 0;
@@ -34,13 +35,11 @@ namespace CalamityMod.Projectiles.Melee
{
Projectile.width = 78;
Projectile.height = 94;
Projectile.extraUpdates = 5; //ExtraUpdates help make the VFX smoother
Projectile.extraUpdates = 5; //ExtraUpdates help make collision more accurate
Projectile.noEnchantmentVisuals = true;
}
public override void Spawn(IEntitySource source)
{
//This sets variables for the spear in general, as well as the secondary attack
//The secondary attack is the "default" because it was coded first
var player = Main.player[Projectile.owner];
var modplayer = player.GetModPlayer<BaseSwordHoldoutPlayer>();
StartupTime = 10;
@@ -61,6 +60,23 @@ namespace CalamityMod.Projectiles.Melee
switch (modplayer.swingNum)
{
case 1:
if (inSwing)
{
var veloc = oldPlayerOffset - (Projectile.Center - Main.player[Projectile.owner].Center);
veloc.Normalize();
int sparkLifetime = Main.rand.Next(15, 23);
Vector2 sparkVel = Vector2.UnitY * -9f;
float maxRotationDeviance = 0.4f;
float rotationAngle = Main.rand.NextFloat(-maxRotationDeviance, maxRotationDeviance);
sparkVel = sparkVel.RotatedBy(rotationAngle) * Main.rand.NextFloat(0.3f, 1.0f);
float sparkScale = Main.rand.NextFloat(0.007f, 0.015f);
Vector2 compensatedSparkVel = veloc.RotatedBy(MathHelper.PiOver4 * 0.5f * Projectile.spriteDirection) * Main.rand.NextFloat(2, 5);
Particle spark = new GlowSparkParticle(Projectile.Center + new Vector2(-angle.X.DirectionalSign(), Main.rand.NextFloat(-0.05f, 0.05f)).RotatedBy(Projectile.rotation - 0.7f * Projectile.spriteDirection) * Main.rand.NextFloat(-20, -108) * Projectile.scale, compensatedSparkVel, false, sparkLifetime, sparkScale, Main.rand.NextBool() ? Color.Fuchsia : Color.HotPink, new Vector2(0.5f, 1.3f));
GeneralParticleHandler.SpawnParticle(spark);
}
break;
case 2:
if (swingTimer == (int)(swingTime*0.5f))
@@ -80,10 +96,27 @@ namespace CalamityMod.Projectiles.Melee
}
}
}
if (inSwing)
{
var veloc = oldPlayerOffset - (Projectile.Center - Main.player[Projectile.owner].Center);
veloc.Normalize();
int sparkLifetime = Main.rand.Next(15, 23);
Vector2 sparkVel = Vector2.UnitY * -9f;
float maxRotationDeviance = 0.4f;
float rotationAngle = Main.rand.NextFloat(-maxRotationDeviance, maxRotationDeviance);
sparkVel = sparkVel.RotatedBy(rotationAngle) * Main.rand.NextFloat(0.3f, 1.0f);
float sparkScale = Main.rand.NextFloat(0.007f, 0.015f);
Vector2 compensatedSparkVel = veloc.RotatedBy(MathHelper.PiOver4 * 0.5f * Projectile.spriteDirection) * Main.rand.NextFloat(2, 5);
Particle spark = new GlowSparkParticle(Projectile.Center + new Vector2(-angle.X.DirectionalSign(), Main.rand.NextFloat(-0.05f, 0.05f)).RotatedBy(Projectile.rotation - 0.7f * Projectile.spriteDirection) * Main.rand.NextFloat(20, 108) * Projectile.scale, compensatedSparkVel, false, sparkLifetime, sparkScale, Main.rand.NextBool() ? Color.Cyan : Color.Aqua, new Vector2(0.5f, 1.3f));
GeneralParticleHandler.SpawnParticle(spark);
}
break;
case 0:
if (Main.myPlayer == Projectile.owner)
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center, -angle * 3, ModContent.ProjectileType<ExcelsusPink>(), Projectile.damage * 2, Projectile.knockBack, player.whoAmI);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), player.Center, -angle * 3, ModContent.ProjectileType<ExcelsusJaws>(), Projectile.damage * 2, Projectile.knockBack, player.whoAmI);
player.itemAnimation = BaseItem.useAnimation;
player.itemTime = BaseItem.useTime;
Projectile.Kill();
@@ -122,7 +155,7 @@ namespace CalamityMod.Projectiles.Melee
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 240);
target.AddBuff(ModContent.BuffType<WhisperingDeath>(), 240);
}
}
}
@@ -6,19 +6,22 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class ExcelsusPink : ModProjectile, ILocalizedModType
public class ExcelsusJaws : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Particles/Jaws";
public override void SetDefaults()
{
Projectile.width = 250;
Projectile.height = 250;
Projectile.width = 500;
Projectile.height = 500;
Projectile.DamageType = DamageClass.Melee;
Projectile.ignoreWater = true;
Projectile.penetrate = -1;
@@ -42,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee
}
Projectile.Center = Vector2.Lerp(StartPos, GoalPos, MathHelper.Min(1,MathF.Pow(1 - (Projectile.timeLeft - 5) / 30f,0.5f)));
Projectile.rotation = StartPos.DirectionTo(GoalPos).ToRotation();
offset = 200*MathHelper.Min(1-(Projectile.timeLeft-5)/30f, (Projectile.timeLeft - 5) / 5f);
offset = 200*MathHelper.Min(MathF.Pow(1-(Projectile.timeLeft-5)/30f,0.4f), (Projectile.timeLeft - 5) / 5f);
if (offset < 16)
offset = 16;
if (Projectile.timeLeft == 5)
@@ -67,12 +70,13 @@ namespace CalamityMod.Projectiles.Melee
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + dustVel * 2, 226, dustVel, 0, default, 1f);
dust.shader = GameShaders.Armor.GetSecondaryShader(player.cShield, player);
}
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 5;
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 5 && Main.LocalPlayer.Distance(Projectile.Center) < 1600)
Main.LocalPlayer.Calamity().GeneralScreenShakePower = 5;
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), 0, 0.1f, 0.85f, 36);
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), 0, 0.2f, 1.7f, 36);
GeneralParticleHandler.SpawnParticle(pulse);
Particle explosion2 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Magenta, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, 0.65f, 26);
Particle explosion2 = new DetailedExplosion(Projectile.Center, Vector2.Zero, Color.Magenta, Vector2.One, Main.rand.NextFloat(-5, 5), 0f, 1.3f, 26);
GeneralParticleHandler.SpawnParticle(explosion2);
}
@@ -101,14 +105,13 @@ namespace CalamityMod.Projectiles.Melee
public override bool PreDraw(ref Color lightColor)
{
var tex = ModContent.Request<Texture2D>("CalamityMod/Particles/Jaws").Value;
var tex = TextureAssets.Projectile[Type].Value;
float jawScaleMult = 1f;
jawScaleMult = MathF.Pow(jawScaleMult, 3);
float rotationOff = 0.5f * MathHelper.Min(MathF.Pow(MathHelper.Clamp(1 - (Projectile.timeLeft - 5) / 30f,0,1),0.5f), MathF.Pow(MathHelper.Clamp((Projectile.timeLeft - 5) / 10f,0,1),0.5f));
if (rotationOff < 0.01f)
rotationOff = 0.01f;
float drawRot = Projectile.rotation;// - MathHelper.PiOver2 + (Projectile.spriteDirection == -1 ? -MathHelper.PiOver4 : MathHelper.PiOver4);
float drawRot = Projectile.rotation;
Main.spriteBatch.SetBlendState(BlendState.Additive);
Main.spriteBatch.Draw(tex, Projectile.Center + new Vector2(0, offset).RotatedBy(drawRot) - Main.screenPosition, tex.Frame(2, 1, 0, 0), Color.Fuchsia, Projectile.rotation + rotationOff + MathHelper.PiOver2, new Vector2(tex.Width * 0.25f, tex.Height * 0.5f), jawScaleMult, Projectile.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
Main.spriteBatch.Draw(tex, Projectile.Center + new Vector2(0, -offset).RotatedBy(drawRot) - Main.screenPosition, tex.Frame(2, 1, 1, 0), Color.Aqua, Projectile.rotation - rotationOff + MathHelper.PiOver2, new Vector2(tex.Width * 0.25f, tex.Height * 0.5f), jawScaleMult, Projectile.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
@@ -116,31 +119,9 @@ namespace CalamityMod.Projectiles.Melee
return false;
}
public override void PostDraw(Color lightColor)
{
return;
Color color;
if (Projectile.timeLeft < 85)
{
byte b2 = (byte)(Projectile.timeLeft * 3);
byte a2 = (byte)(100f * ((float)b2 / 255f));
color = new Color((int)b2, (int)b2, (int)b2, (int)a2);
}
else
{
color = new Color(255, 255, 255, 100);
}
Vector2 origin = new Vector2(39f, 46f);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Projectiles/Melee/ExcelsusPinkGlow").Value, Projectile.Center - Main.screenPosition, null, color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.timeLeft > 85)
{
Projectile.timeLeft = 85;
}
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180);
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 360);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

+15 -17
View File
@@ -66,9 +66,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
return true;
}
// localAI[1] is the shot counter. Every 5 frames, The Obliterator tries to fire a laser at a nearby target.
// It has 4 "laser ports" which whirl around in circles with the yoyo. It uses each of these in order.
// localAI[1] counts up to 19 (4 x 5 - 1), then resets back to 0 for a 20-frame cycle.
public override void AI()
{
time++;
@@ -112,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
if (targets.Count == 0)
return;
targets = targets.OrderBy(x => x.Distance(Projectile.Center)).ToList();
Projectile.velocity = Projectile.DirectionTo(targets[0].Center);//.RotatedByRandom(0.3f);
Projectile.velocity = Projectile.DirectionTo(targets[0].Center);
Projectile.Center = targets[0].Center - new Vector2(Projectile.velocity.X * targets[0].width*0.5f, Projectile.velocity.Y * targets[0].height*0.5f);
Projectile.velocity *= 15;
for (var i = 0; i < 20; i++)
@@ -127,21 +124,21 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
if (Main.myPlayer == Projectile.owner)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<MechwormTeleportRift>(), 0, 0, Projectile.owner);
int laserAmount = 8;
for (int i = 0; i < laserAmount; i++)
{
int sparkLifetime = Main.rand.Next(30, 45);
float sparkScale = Main.rand.NextFloat(0.8f, 1f) + 1f * 0.05f;
Color sparkColor = Color.Lerp(Color.Fuchsia, Color.AliceBlue, Main.rand.NextFloat(0.5f));
sparkColor = Color.Lerp(sparkColor, Color.Cyan, Main.rand.NextFloat());
}
int laserAmount = 8;
for (int i = 0; i < laserAmount; i++)
{
int sparkLifetime = Main.rand.Next(30, 45);
float sparkScale = Main.rand.NextFloat(0.8f, 1f) + 1f * 0.05f;
Color sparkColor = Color.Lerp(Color.Fuchsia, Color.AliceBlue, Main.rand.NextFloat(0.5f));
sparkColor = Color.Lerp(sparkColor, Color.Cyan, Main.rand.NextFloat());
if (Main.rand.NextBool(5))
sparkScale *= 1.4f;
if (Main.rand.NextBool(5))
sparkScale *= 1.4f;
Vector2 sparkVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.TwoPi * (i / (float)laserAmount)) * 4;
SparkParticle spark = new SparkParticle(Projectile.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor);
GeneralParticleHandler.SpawnParticle(spark);
}
Vector2 sparkVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.TwoPi * (i / (float)laserAmount)) * 4;
SparkParticle spark = new SparkParticle(Projectile.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor);
GeneralParticleHandler.SpawnParticle(spark);
}
Projectile.localAI[1]++;
Projectile.ResetLocalNPCHitImmunity();
@@ -202,6 +199,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
SparkParticle chompSpark = new(Projectile.Center, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor);
GeneralParticleHandler.SpawnParticle(chompSpark);
}
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/NPCHit/OtherworldlyHit") with { Pitch = -0.45f, Volume = 0.33f }, Projectile.Center);
}
else
target.AddBuff(ModContent.BuffType<WhisperingDeath>(), 180);
+2 -2
View File
@@ -136,8 +136,8 @@ namespace CalamityMod.Projectiles.Rogue
randomLaserCharge -= 1f;
Vector2 velocity = Vector2.UnitX.RotatedBy(Projectile.timeLeft / 120f * MathHelper.TwoPi);
int laserDamage = (int)(Projectile.damage * 0f);
Projectile laser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<FriendlyLaserWallBeam>(), laserDamage, 0f, Projectile.owner, 1.5f);
int laserDamage = (int)(Projectile.damage * 0.15f);
Projectile laser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<FriendlyLaserWallBeam>(), laserDamage, 0f, Projectile.owner, 1.5f,0,2);
if (laser.whoAmI.WithinBounds(Main.maxProjectiles))
{
laser.DamageType = RogueDamageClass.Instance;
+33 -3
View File
@@ -5,6 +5,8 @@ using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Boss;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -283,11 +285,21 @@ namespace CalamityMod.Projectiles.Summon
for (int i = 0; i < 3; i++)
{
Vector2 perturbedSpeed = Projectile.velocity.RotatedBy(MathHelper.Lerp(-0.15f, 0.15f, i / 3f)) * 0.3f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed, ModContent.ProjectileType<MechwormLaser>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
var p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed, ModContent.ProjectileType<DoGFire>(), Projectile.damage, Projectile.knockBack, Projectile.owner,2);
if (Main.projectile.IndexInRange(p))
{
Main.projectile[p].hostile = false;
Main.projectile[p].friendly = true;
Main.projectile[p].DamageType = DamageClass.Summon;
Main.projectile[p].timeLeft = 120;
Main.projectile[p].scale = 0.5f;
Main.projectile[p].usesIDStaticNPCImmunity = false;
Main.projectile[p].usesLocalNPCImmunity = true;
Main.projectile[p].localNPCHitCooldown = 10 * Projectile.MaxUpdates;
}
}
}
SoundEngine.PlaySound(SoundID.Item12, Projectile.Center);
Projectile.netUpdate = true;
}
@@ -323,7 +335,25 @@ namespace CalamityMod.Projectiles.Summon
// On the starting frame of a teleport, spawn portals.
if (Main.myPlayer == Projectile.owner)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), TeleportStartingPoint, Vector2.Zero, ModContent.ProjectileType<MechwormTeleportRift>(), 0, 0f, Projectile.owner);
if (AttackStateTimer != 0)
{
int sparkAmount = 8;
for (int i = 0; i < sparkAmount; i++)
{
int sparkLifetime = Main.rand.Next(30, 45);
float sparkScale = Main.rand.NextFloat(0.8f, 1f) + 1f * 0.05f;
Color sparkColor = Color.Lerp(Color.Fuchsia, Color.AliceBlue, Main.rand.NextFloat(0.5f));
sparkColor = Color.Lerp(sparkColor, Color.Cyan, Main.rand.NextFloat());
if (Main.rand.NextBool(5))
sparkScale *= 1.4f;
Vector2 sparkVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.TwoPi * (i / (float)sparkAmount)) * 4;
SparkParticle spark = new SparkParticle(TeleportStartingPoint, sparkVelocity, false, sparkLifetime, sparkScale, sparkColor);
GeneralParticleHandler.SpawnParticle(spark);
}
Projectile.NewProjectile(Projectile.GetSource_FromThis(), TeleportStartingPoint, Vector2.Zero, ModContent.ProjectileType<MechwormTeleportRift>(), 0, 0f, Projectile.owner);
}
int endGateIndex = Projectile.NewProjectile(Projectile.GetSource_FromThis(), TeleportEndingPoint, Vector2.Zero, ModContent.ProjectileType<MechwormTeleportRift>(), 0, 0f, Projectile.owner);
EndRiftGateUUID = Projectile.GetByUUID(Projectile.owner, endGateIndex);
-73
View File
@@ -1,73 +0,0 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class MechwormLaser : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override string Texture => "CalamityMod/Projectiles/LaserProj";
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionShot[Type] = true;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 5;
Projectile.friendly = true;
Projectile.alpha = 255;
Projectile.penetrate = 4;
Projectile.MaxUpdates = 3;
Projectile.timeLeft = 600;
Projectile.tileCollide = false;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
// Very quickly fade in.
Projectile.alpha = Utils.Clamp(Projectile.alpha - 25, 0, 255);
Lighting.AddLight(Projectile.Center, Color.Cyan.ToVector3());
if (Projectile.ai[1] == 0f)
{
Projectile.localAI[0] += 6f;
if (Projectile.localAI[0] > 30)
Projectile.localAI[0] = 30;
}
else
{
Projectile.localAI[0] -= 6f;
if (Projectile.localAI[0] <= 0f)
{
Projectile.Kill();
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 120);
public override Color? GetAlpha(Color lightColor) => Color.Lerp(Color.Fuchsia, Color.Cyan, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 1.9f + Projectile.identity * 2.4f) * 0.5f + 0.5f);
public override bool PreDraw(ref Color lightColor) => Projectile.DrawBeam(100f, 3f, lightColor);
public override void OnKill(int timeLeft)
{
int dustAmt = Main.rand.Next(3, 7);
for (int d = 0; d < dustAmt; d++)
{
int rainbow = Dust.NewDust(Projectile.Center - Projectile.velocity / 2f, 0, 0, DustID.RainbowTorch, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2.1f);
Main.dust[rainbow].velocity *= 2f;
Main.dust[rainbow].noGravity = true;
}
}
}
}
+15 -8
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.NPCs.Abyss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -81,12 +82,16 @@ namespace CalamityMod.Projectiles.Typeless
if (time >= attackTime && !doneAttack)
{
SoundStyle attack = new("CalamityMod/Sounds/Custom/DoGLaserWallLightAttack");
for (int i = 0; i < 2; i++)
SoundEngine.PlaySound(attack with { Volume = 0.3f, Pitch = 0, MaxInstances = -1}, targetPos);
if (Projectile.scale > 3) {
attack = new("CalamityMod/Sounds/Custom/DoGLaserWallBigAttack");
}
SoundEngine.PlaySound(attack with { Volume = 0.4f, Pitch = 0, MaxInstances = -1}, Vector2.Lerp(targetPos, Main.player[Projectile.owner].Center, laserType == 0 ? 0 : 0.7f));
laserFX = 2.5f;
doneAttack = true;
storedTime = time;
Projectile.ForceNetUpdate();
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < Projectile.ai[2] && Main.LocalPlayer.Distance(Projectile.Center) < 1600)
Main.LocalPlayer.Calamity().GeneralScreenShakePower = Projectile.ai[2];
}
float endTime = storedTime + 10;
if (time >= endTime && doneAttack)
@@ -113,9 +118,9 @@ namespace CalamityMod.Projectiles.Typeless
return true;
return false;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
base.OnHitPlayer(target, info);
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
@@ -138,6 +143,7 @@ namespace CalamityMod.Projectiles.Typeless
Texture2D beam = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomLineThick").Value;
Texture2D bBeam = ModContent.Request<Texture2D>("CalamityMod/Particles/LineThick").Value;
Texture2D angleBeam = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowBlade").Value;
Texture2D angleBeamInside = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowBladeNoBloom").Value;
float opacity = (doneAttack ? 0.65f : 0.35f) * (float)Math.Pow(Math.Min(laserFX, 1), 2);
Color beamColor = drawColor with { A = 0 };
@@ -156,11 +162,12 @@ namespace CalamityMod.Projectiles.Typeless
}
else
{
for (int t = 0; t < (!doneAttack ? 1 : 4 * Projectile.scale); t++)
opacity = 1f;
for (int t = 0; t < (!doneAttack ? 1 : 5); t++)
{
bool inFront = t > 0;
float beamThickness = 16/1960f * Projectile.scale * (inFront ? t/4f : 1) * (laserFX <= 1 ? (float)Math.Pow(Math.Min(laserFX, 1), 2) : laserFX) * Utils.Remap(sine, -1, 1, 0.8f, 1.1f);
Main.EntitySpriteDraw(angleBeam, beamStart - Main.screenPosition, null, beamColor * (1 - t * 0.3f) * opacity * (inFront ? (0.2f + 0.15f * t / Projectile.scale) : 1), directionToTarget.ToRotation() + MathHelper.PiOver2, new Vector2(angleBeam.Width / 2, angleBeam.Height), new Vector2(beamThickness * Projectile.scale, laserLength / 975 * 0.8277f), SpriteEffects.None);
bool notFirstDrawn = t > 0;
float beamThickness = 16/1960f * Projectile.scale * (notFirstDrawn ? t/4f : 1) * (laserFX <= 1 ? (float)Math.Pow(Math.Min(laserFX, 1), 2) : laserFX) * Utils.Remap(sine, -1, 1, 0.8f, 1.1f);
Main.EntitySpriteDraw(notFirstDrawn ? angleBeamInside : angleBeam, beamStart - Main.screenPosition, null, (notFirstDrawn ? Color.Black * opacity : beamColor * opacity) * (notFirstDrawn ? (0.2f + 0.15f * t / Projectile.scale) : 1), directionToTarget.ToRotation() + MathHelper.PiOver2, new Vector2(angleBeam.Width / 2, angleBeam.Height), new Vector2(beamThickness * Projectile.scale, laserLength / 975 * 0.8277f), SpriteEffects.None);
}
}
return false;