Files
CalamityModPublic/Projectiles/Summon/MK2FlaskSummon.cs
T
termigator1359 1b22071cf4 squash merge: Removed all unused textures
Removed nearly all unused textures in the entire mod, especially focusing on projectiles.
Apotheosis & the Death Valley Duster weapon line were ignored to prevent merge conflicts.
2020-11-15 14:25:46 -05:00

62 lines
2.4 KiB
C#

using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class MK2FlaskSummon : ModProjectile
{
public override string Texture => "CalamityMod/Items/Weapons/Summon/FuelCellBundle";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Flask");
ProjectileID.Sets.MinionShot[projectile.type] = true;
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
}
public override void SetDefaults()
{
projectile.friendly = true;
projectile.width = 26;
projectile.height = 26;
projectile.minion = true;
projectile.minionSlots = 0f;
projectile.ignoreWater = true;
projectile.tileCollide = true;
projectile.timeLeft = 240;
}
public override void AI()
{
projectile.velocity.Y += 0.2f;
projectile.rotation += 0.1f * (projectile.velocity.X > 0).ToDirectionInt();
}
public override void Kill(int timeLeft)
{
if (Main.myPlayer == projectile.owner)
{
for (int i = 0; i < Main.rand.Next(18, 21); i++)
{
Dust.NewDustPerfect(projectile.Center + Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(10f),
(int)CalamityDusts.Plague,
Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(1f, 4f));
}
Main.PlaySound(SoundID.Item107, projectile.Center);
int idx = Projectile.NewProjectile(projectile.Center, Vector2.UnitY * 6f, ModContent.ProjectileType<PlaguebringerMK2>(), projectile.damage, 4f, projectile.owner);
int beeArrayIndex = 0;
for (int i = 0; i < Main.projectile.Length; i++)
{
if (Main.projectile[i].active && Main.projectile[i].owner == projectile.owner && Main.projectile[i].type == ModContent.ProjectileType<PlaguebringerMK2>())
{
Main.projectile[i].ai[1] = beeArrayIndex;
beeArrayIndex++;
}
}
}
}
public override bool CanDamage() => false;
}
}