MMMMMMMMMicrowave moment
This commit is contained in:
1 parent
bf5d932c5f
commit
60cd06464f
7 files changed
+163
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using CalamityMod.Projectiles.Melee.Yoyos;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class TheMicrowave : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Microwave");
|
||||
//Tooltip.SetDefault("MMMMMMMMMMMMMM, 13th letter of the alphabet moments");
|
||||
Tooltip.SetDefault("Baking enemies in the astral infection\n\n" +
|
||||
"Summons an aura around the yoyo that damages nearby enemies");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.CloneDefaults(ItemID.TheEyeOfCthulhu);
|
||||
item.damage = 100;
|
||||
item.useTime = 22;
|
||||
item.useAnimation = 22;
|
||||
item.useStyle = 5;
|
||||
item.channel = true;
|
||||
item.melee = true;
|
||||
item.knockBack = 3f;
|
||||
item.value = Item.buyPrice(0, 95, 0, 0);
|
||||
item.rare = 9;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<TheMicrowaveProj>();
|
||||
ItemID.Sets.Yoyo[item.type] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 733 B |
@@ -0,0 +1,53 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class MicrowaveAura : ModProjectile
|
||||
{
|
||||
private int radius = 100;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Microwave");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.CloneDefaults(ProjectileID.SoulDrain);
|
||||
aiType = 476;
|
||||
projectile.magic = false;
|
||||
projectile.melee = true;
|
||||
projectile.usesIDStaticNPCImmunity = true;
|
||||
projectile.idStaticNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180);
|
||||
}
|
||||
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
|
||||
{
|
||||
float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft());
|
||||
float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight());
|
||||
float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft());
|
||||
float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight());
|
||||
|
||||
float minDist = dist1;
|
||||
if (dist2 < minDist)
|
||||
minDist = dist2;
|
||||
if (dist3 < minDist)
|
||||
minDist = dist3;
|
||||
if (dist4 < minDist)
|
||||
minDist = dist4;
|
||||
|
||||
return minDist <= radius;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,75 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
{
|
||||
public class TheMicrowaveProj : ModProjectile
|
||||
{
|
||||
private int radius = 100;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
//DisplayName.SetDefault("Bootleg Lacerator");
|
||||
DisplayName.SetDefault("Microwave");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.CloneDefaults(ProjectileID.TheEyeOfCthulhu);
|
||||
projectile.width = 16;
|
||||
projectile.height = 16;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
aiType = 555;
|
||||
projectile.melee = true;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<MicrowaveAura>(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
|
||||
//dust circle
|
||||
int numDust = (int)(0.2f * MathHelper.TwoPi * radius);
|
||||
float angleIncrement = MathHelper.TwoPi / (float)numDust;
|
||||
Vector2 dustOffset = new Vector2(radius, 0f);
|
||||
dustOffset = dustOffset.RotatedByRandom(MathHelper.TwoPi);
|
||||
for (int i = 0; i < numDust; i++)
|
||||
{
|
||||
dustOffset = dustOffset.RotatedBy(angleIncrement);
|
||||
int dustType = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.DustType<AstralOrange>(),
|
||||
ModContent.DustType<AstralBlue>()
|
||||
});
|
||||
int dust = Dust.NewDust(projectile.Center, 1, 1, dustType);
|
||||
Main.dust[dust].position = projectile.Center + dustOffset;
|
||||
Main.dust[dust].fadeIn = 1f;
|
||||
Main.dust[dust].velocity *= 0.2f;
|
||||
Main.dust[dust].scale = 0.1599999999f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Rectangle frame = new Rectangle(0, 0, 20, 16);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/Yoyos/TheMicrowaveProjGlow"), projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 386 B |
Binary file not shown.
|
After Width: | Height: | Size: 167 B |
Reference in new issue
Block a user