Merge pull request #472 from CalamityTeam/megalodon-line-epicening
Megalodon line epicening
This commit is contained in:
5 files changed
+180
-18
No files matched your search
@@ -10,10 +10,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class Megafleet : ModItem
|
||||
{
|
||||
private int shotType = 1;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Voidragon");
|
||||
Tooltip.SetDefault("Fires void blasts that explode");
|
||||
Tooltip.SetDefault("75% chance to not consume ammo\n" +
|
||||
"Fires void blasts that explode every other shot\n" +
|
||||
"Shoots demon flame tentacles alongside every shot");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -44,22 +48,33 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 95)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-5, 6) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-5, 6) * 0.05f;
|
||||
type = Main.rand.NextBool(2) ? ModContent.ProjectileType<Voidragon>() : type;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
|
||||
if (shotType > 2)
|
||||
shotType = 1;
|
||||
|
||||
if (shotType == 1)
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<Voidragon>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
|
||||
shotType++;
|
||||
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<VoidragonTentacle>(), damage, knockBack, player.whoAmI, (Main.rand.Next(-160, 160) * 0.001f), (Main.rand.Next(-160, 160) * 0.001f));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50 || shotType % 2 == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -9,10 +10,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class Megalodon : ModItem
|
||||
{
|
||||
private int shotType = 0;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Megalodon");
|
||||
Tooltip.SetDefault("50% chance to not consume ammo");
|
||||
Tooltip.SetDefault("50% chance to not consume ammo\n" +
|
||||
"Fires streams of water every other shot");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -45,13 +49,23 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
|
||||
if (shotType > 2)
|
||||
shotType = 1;
|
||||
|
||||
if (shotType == 1)
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<ArcherfishShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
|
||||
shotType++;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
if (shotType > 1)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -60,6 +74,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Megashark);
|
||||
recipe.AddIngredient(ModContent.ItemType<Archerfish>());
|
||||
recipe.AddIngredient(ModContent.ItemType<DepthCells>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<Lumenite>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<Tenebris>(), 5);
|
||||
|
||||
@@ -10,11 +10,15 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class Seadragon : ModItem
|
||||
{
|
||||
private int shotType = 1;
|
||||
private bool rocket = false;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Seadragon");
|
||||
Tooltip.SetDefault("50% chance to not consume ammo\n" +
|
||||
"Has a chance to fire homing rockets that explode into fire shards on death");
|
||||
"Fires streams of water every other shot\n" +
|
||||
"Fires a homing rocket every 18 shots, which explodes into fire shards on death");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -48,17 +52,34 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
if (Main.rand.NextBool(10))
|
||||
|
||||
if (shotType > 17)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<SeaDragonRocket>(), (int)(damage * 1.5), knockBack, player.whoAmI, 0f, 0f);
|
||||
shotType = 1;
|
||||
rocket = true;
|
||||
}
|
||||
|
||||
if (!rocket)
|
||||
{
|
||||
if (shotType % 2 == 1)
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<ArcherfishShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
|
||||
shotType++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<SeaDragonRocket>(), (int)(damage * 5), knockBack, player.whoAmI, 0f, 0f);
|
||||
rocket = false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool ConsumeAmmo(Player player)
|
||||
{
|
||||
if (Main.rand.Next(0, 100) < 50)
|
||||
if (shotType % 2 == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
projectile.friendly = true;
|
||||
projectile.ranged = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = -1;
|
||||
projectile.penetrate = 2;
|
||||
projectile.alpha = 255;
|
||||
projectile.timeLeft = 600;
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
public class VoidragonTentacle : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Voidragon Tentacle");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 40;
|
||||
projectile.height = 40;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 5;
|
||||
projectile.MaxUpdates = 3;
|
||||
projectile.ranged = true;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.localAI[1]++;
|
||||
if (projectile.velocity.X != projectile.velocity.X)
|
||||
{
|
||||
if (Math.Abs(projectile.velocity.X) < 1f)
|
||||
{
|
||||
projectile.velocity.X = -projectile.velocity.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
if (projectile.velocity.Y != projectile.velocity.Y)
|
||||
{
|
||||
if (Math.Abs(projectile.velocity.Y) < 1f)
|
||||
{
|
||||
projectile.velocity.Y = -projectile.velocity.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
Vector2 center10 = projectile.Center;
|
||||
projectile.scale = 1f - projectile.localAI[0];
|
||||
projectile.width = (int)(20f * projectile.scale);
|
||||
projectile.height = projectile.width;
|
||||
projectile.position.X = center10.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = center10.Y - (float)(projectile.height / 2);
|
||||
if (projectile.localAI[0] < 0.1f)
|
||||
{
|
||||
projectile.localAI[0] += 0.01f;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.localAI[0] += 0.025f;
|
||||
}
|
||||
if (projectile.localAI[0] >= 0.95f)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
projectile.velocity.X = projectile.velocity.X + projectile.ai[0] * 1.5f;
|
||||
projectile.velocity.Y = projectile.velocity.Y + projectile.ai[1] * 1.5f;
|
||||
if (projectile.velocity.Length() > 16f)
|
||||
{
|
||||
projectile.velocity.Normalize();
|
||||
projectile.velocity *= 16f;
|
||||
}
|
||||
projectile.ai[0] *= 1.05f;
|
||||
projectile.ai[1] *= 1.05f;
|
||||
if (projectile.scale < 1f && projectile.localAI[1] > 5f)
|
||||
{
|
||||
int dustAmount = 0;
|
||||
while ((float)dustAmount < projectile.scale * 10f)
|
||||
{
|
||||
int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 62, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.3f);
|
||||
Main.dust[dust].position = (Main.dust[dust].position + projectile.Center) / 2f;
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 0.1f;
|
||||
Main.dust[dust].velocity -= projectile.velocity * (1.1f - projectile.scale);
|
||||
Main.dust[dust].fadeIn = (float)(125 + projectile.owner);
|
||||
Main.dust[dust].scale += projectile.scale * 0.75f;
|
||||
dustAmount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<DemonFlames>(), 180); //Apotheosis also inflicts this, so this weapon might as well
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user