Files
CalamityModPublic/Projectiles/Summon/MagicBat.cs
T
GinYuH 74b7abc666 a lot of fixes
1- Boss checklist reordering
2- Fixed Temporal Bats dealing rogue damage
3- Fixed Mineral Mortar shark rotations
4- Adjusted glowmask for dropped Eradicator.
5- Astral Arcanum rarity and price fixes
6- Removed boss Draconic Swarmer's bestiary entry
7- Fixed Brimseeker balls dealing no damage
8- Repair Units can no longer be homed in on
9- Fixed Lab/Exo Screens not breaking with walls
10- Anechoic Coating buff grammar fix
11- Bouncy Spiky Ball spelling fixes
12- Correct Seeking Scorcher pierce amount in tooltip
13- Virid Vanguard grammar fix
2022-06-13 11:21:08 -04:00

52 lines
1.8 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class MagicBat : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Baseball Bat");
ProjectileID.Sets.MinionShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 20;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.timeLeft = 150;
Projectile.minion = true;
Projectile.minionSlots = 0f;
}
public override void AI() => Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
public override Color? GetAlpha(Color lightColor) => new Color(80, 200, 120, Projectile.alpha);
public override void Kill(int timeLeft)
{
for (int i = 0; i < 10; i++)
{
Vector2 dspeed = new Vector2(Main.rand.NextFloat(-7f, 7f), Main.rand.NextFloat(-7f, 7f));
int dust = Dust.NewDust(Projectile.Center, 1, 1, 67, dspeed.X, dspeed.Y, 50, default, 1.2f);
Main.dust[dust].noGravity = true;
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
}
}