storm surge hitboxxing

also removed dupe textures
This commit is contained in:
Altixal committed 2024-10-18 05:05:53 +07:00
1 parent a9aab710fc
commit 2bac7e286f
5 files changed
+18 -31

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

+2
View File
@@ -9,6 +9,8 @@ namespace CalamityMod.Projectiles.Ranged
public class SeasSearingSpout : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/Melee/BrinySpout";
public override void SetStaticDefaults()
{
Main.projFrames[Type] = 6;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

+16 -31
View File
@@ -1,13 +1,15 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class StormSurgeTornado : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/Melee/BrinySpout";
public override void SetStaticDefaults()
{
Main.projFrames[Type] = 6;
@@ -15,9 +17,8 @@ namespace CalamityMod.Projectiles.Ranged
public override void SetDefaults()
{
Projectile.width = 66;
Projectile.height = 66;
Projectile.scale = 0.5f;
Projectile.width = 160;
Projectile.height = 42;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
@@ -29,35 +30,19 @@ namespace CalamityMod.Projectiles.Ranged
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0f, 1.25f, 1.25f);
if (Projectile.scale <= 2f)
{
Projectile.scale *= 1.03f;
}
if (Projectile.scale >= 2f)
{
Projectile.Kill();
}
Projectile.frameCounter++;
if (Projectile.frameCounter > 2)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame >= 6)
{
Projectile.frame = 0;
}
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Lighting.AddLight(Projectile.Center, 0f, 1.25f, 1.25f);
Projectile.ai[0]++;
Projectile.scale = 0.25f * MathF.Pow(1.03f, Projectile.ai[0]);
if (Projectile.scale >= 1f)
Projectile.Kill();
Projectile.frameCounter++;
Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Type];
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type];
int y6 = framing * Projectile.frame;
Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox);
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB