Re-added Epidemic Shredder
This commit is contained in:
1 parent
87e96ed2ab
commit
268eee7c6a
4 files changed
+131
No files matched your search
@@ -0,0 +1,47 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class EpidemicShredder : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Epidemic Shredder");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 34;
|
||||
item.height = 34;
|
||||
item.damage = 75;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 12;
|
||||
item.useTime = 12;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.knockBack = 4.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
item.shoot = ModContent.ProjectileType<EpidemicShredderProjectile>();
|
||||
item.shootSpeed = 18f;
|
||||
item.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.ChlorophyteBar, 20);
|
||||
recipe.AddIngredient(ItemID.Nanites, 150);
|
||||
recipe.AddIngredient(ModContent.ItemType<PlagueCellCluster>(), 15);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 816 B |
@@ -0,0 +1,84 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class EpidemicShredderProjectile : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Epidemic Shredder");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 34;
|
||||
projectile.height = 34;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 6;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 4;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation += Math.Sign(projectile.velocity.X) * MathHelper.ToRadians(10f);
|
||||
if (projectile.ai[0] > 0f)
|
||||
{
|
||||
projectile.ai[0] -= 1f;
|
||||
}
|
||||
if (projectile.timeLeft < 580f)
|
||||
{
|
||||
projectile.velocity = (projectile.velocity * 18f + projectile.DirectionTo(Main.player[projectile.owner].Center) * 18f) / 19f;
|
||||
if (Main.player[projectile.owner].Hitbox.Intersects(projectile.Hitbox))
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
if (projectile.penetrate > 1)
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, projectile.velocity, mod.ProjectileType("PlagueSeeker"), (int)(projectile.damage * 0.1f), 2f, projectile.owner);
|
||||
projectile.ai[0] = 12f; //0.2th of a second cooldown
|
||||
}
|
||||
projectile.penetrate--;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
int projectileIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType<PlagueSeeker>(), (int)(projectile.damage * 0.1f), 2f, projectile.owner);
|
||||
Main.projectile[projectileIndex].Calamity().forceRogue = true;
|
||||
projectile.ai[0] = 12f; //0.2th of a second cooldown
|
||||
}
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 816 B |
Reference in new issue
Block a user