added slurper pole and chaotic spread rod

removed stealth strike variable from eater of shoals
added wooden fishing pole to early bloom rod
This commit is contained in:
termigator1359 committed 2019-11-03 16:22:55 -05:00
1 parent fff5c31ffb
commit 3b4aa86fa4
12 files changed
+411 -11

No files matched your search

+59
View File
@@ -0,0 +1,59 @@
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Items.Materials;
namespace CalamityMod.Items.Fishing
{
public class ChaoticSpreadRod : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Chaotic Spread Rod");
Tooltip.SetDefault("Fires three to five lines at once. Can fish in lava.\n" +
"The battlefield is a scene of constant chaos.\n" +
"The winner will be the one who controls that chaos, both the pole and the fish.");
}
public override void SetDefaults()
{
//item.CloneDefaults(2289); //Wooden Fishing Pole
item.width = 24;
item.height = 28;
item.useAnimation = 8;
item.useTime = 8;
item.useStyle = 1;
item.UseSound = SoundID.Item1;
item.fishingPole = 45;
item.shootSpeed = 16f;
item.shoot = ModContent.ProjectileType<ChaoticSpreadBobber>();
item.value = Item.buyPrice(0, 80, 0, 0);
item.rare = 8;
ItemID.Sets.CanFishInLava[item.type] = 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)
{
for (int index = 0; index < Main.rand.Next(3,6); ++index) //3 to 5 bobbers
{
float SpeedX = speedX + (float)Main.rand.Next(-75, 76) * 0.05f;
float SpeedY = speedY + (float)Main.rand.Next(-75, 76) * 0.05f;
int linecolor = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, 0, 0f, player.whoAmI, 0.0f, 0.0f);
}
return false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.HotlineFishingHook);
recipe.AddIngredient(ModContent.ItemType<CruptixBar>(), 8);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+1
View File
@@ -53,6 +53,7 @@ namespace CalamityMod.Items.Fishing
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.WoodFishingPole); //wood -> fossilized wood
recipe.AddIngredient(ModContent.ItemType<UeliaceBar>(), 10);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
+3 -2
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Fishing
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Eater of Shoals");
Tooltip.SetDefault("Fires ten lines at once. Line never snaps.\n" +
Tooltip.SetDefault("Fires ten lines at once. Line never snaps and can fish from lava.\n" +
"The devourer enjoyed eating fish as much as eating gods.");
}
@@ -32,6 +32,7 @@ namespace CalamityMod.Items.Fishing
item.value = Item.buyPrice(1, 80, 0, 0);
item.rare = 10;
item.Calamity().postMoonLordRarity = 14;
ItemID.Sets.CanFishInLava[item.type] = true;
}
public override void HoldItem(Player player)
@@ -48,7 +49,7 @@ namespace CalamityMod.Items.Fishing
int linecolor = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, 0, 0f, player.whoAmI, 0.0f, 0.0f);
if (Main.rand.NextBool(2)) //randomizing line color
{
Main.projectile[linecolor].Calamity().stealthStrike = true; //probably should use a different variable
Main.projectile[linecolor].localAI[0] = 1;
}
}
return false;
+37
View File
@@ -0,0 +1,37 @@
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Items.Materials;
namespace CalamityMod.Items.Fishing
{
public class SlurperPole : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Slurper Pole");
Tooltip.SetDefault("Can fish in lava.\n" +
"It is the burning lava of the soul that has a furnace within--a very volcano of grief and sorrow.");
}
public override void SetDefaults()
{
//item.CloneDefaults(2289); //Wooden Fishing Pole
item.width = 24;
item.height = 28;
item.useAnimation = 8;
item.useTime = 8;
item.useStyle = 1;
item.UseSound = SoundID.Item1;
item.fishingPole = 25;
item.shootSpeed = 14f;
item.shoot = ModContent.ProjectileType<SlurperBobber>();
item.value = Item.buyPrice(0, 4, 0, 0);
item.rare = 3;
ItemID.Sets.CanFishInLava[item.type] = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+4 -8
View File
@@ -1,6 +1,7 @@
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Fishing;
using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -225,14 +226,9 @@ namespace CalamityMod.NPCs.Crags
public override void NPCLoot()
{
if (CalamityWorld.downedProvidence && Main.rand.NextBool(2))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<Bloodstone>());
}
if (Main.hardMode && Main.rand.NextBool(3))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<EssenceofChaos>());
}
DropHelper.DropItemCondition(npc, ModContent.ItemType<Bloodstone>(), CalamityWorld.downedProvidence, 2, 1, 1);
DropHelper.DropItemCondition(npc, ModContent.ItemType<EssenceofChaos>(), Main.hardMode, 3, 1, 1);
DropHelper.DropItemChance(npc, ModContent.ItemType<SlurperPole>(), 10);
}
public override void HitEffect(int hitDirection, double damage)
+153
View File
@@ -0,0 +1,153 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Fishing;
namespace CalamityMod.Projectiles.Typeless
{
public class ChaoticSpreadBobber : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Chaotic Bobber");
}
public override void SetDefaults()
{
//projectile.CloneDefaults(360); //Wooden Bobber
projectile.width = 14;
projectile.height = 14;
projectile.aiStyle = 61;
projectile.bobber = true;
projectile.penetrate = -1;
}
public override bool PreDrawExtras(SpriteBatch spriteBatch)
{
Lighting.AddLight(projectile.Center, 0.4f, 0f, 0f);
Player player = Main.player[projectile.owner];
if (projectile.bobber && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].holdStyle > 0)
{
float pPosX = player.MountedCenter.X;
float pPosY = player.MountedCenter.Y;
pPosY += Main.player[projectile.owner].gfxOffY;
int type = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type;
float gravDir = Main.player[projectile.owner].gravDir;
if (type == ModContent.ItemType<ChaoticSpreadRod>())
{
pPosX += (float)(65 * Main.player[projectile.owner].direction);
if (Main.player[projectile.owner].direction < 0)
{
pPosX -= 13f;
}
pPosY -= 30f * gravDir;
}
if (gravDir == -1f)
{
pPosY -= 12f;
}
Vector2 value = new Vector2(pPosX, pPosY);
value = Main.player[projectile.owner].RotatedRelativePoint(value + new Vector2(8f), true) - new Vector2(8f);
float projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X;
float projPosY = projectile.position.Y + (float)projectile.height * 0.5f - value.Y;
Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY));
float rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f;
bool flag2 = true;
if (projPosX == 0f && projPosY == 0f)
{
flag2 = false;
}
else
{
float projPosXY = (float)Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY));
projPosXY = 12f / projPosXY;
projPosX *= projPosXY;
projPosY *= projPosXY;
value.X -= projPosX;
value.Y -= projPosY;
projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X;
projPosY = projectile.position.Y + (float)projectile.height * 0.5f - value.Y;
}
while (flag2)
{
float num = 12f;
float num2 = (float)Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY));
float num3 = num2;
if (float.IsNaN(num2) || float.IsNaN(num3))
{
flag2 = false;
}
else
{
if (num2 < 20f)
{
num = num2 - 8f;
flag2 = false;
}
num2 = 12f / num2;
projPosX *= num2;
projPosY *= num2;
value.X += projPosX;
value.Y += projPosY;
projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X;
projPosY = projectile.position.Y + (float)projectile.height * 0.1f - value.Y;
if (num3 > 12f)
{
float num4 = 0.3f;
float num5 = Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y);
if (num5 > 16f)
{
num5 = 16f;
}
num5 = 1f - num5 / 16f;
num4 *= num5;
num5 = num3 / 80f;
if (num5 > 1f)
{
num5 = 1f;
}
num4 *= num5;
if (num4 < 0f)
{
num4 = 0f;
}
num5 = 1f - projectile.localAI[0] / 100f;
num4 *= num5;
if (projPosY > 0f)
{
projPosY *= 1f + num4;
projPosX *= 1f - num4;
}
else
{
num5 = Math.Abs(projectile.velocity.X) / 3f;
if (num5 > 1f)
{
num5 = 1f;
}
num5 -= 0.5f;
num4 *= num5;
if (num4 > 0f)
{
num4 *= 2f;
}
projPosY *= 1f + num4;
projPosX *= 1f - num4;
}
}
rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f;
Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)value.X / 16, (int)(value.Y / 16f), new Microsoft.Xna.Framework.Color(138, 50, 73, 100)); //dark red
Main.spriteBatch.Draw(Main.fishingLineTexture, new Vector2(value.X - Main.screenPosition.X + (float)Main.fishingLineTexture.Width * 0.5f, value.Y - Main.screenPosition.Y + (float)Main.fishingLineTexture.Height * 0.5f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.fishingLineTexture.Width, (int)num)), color2, rotation2, new Vector2((float)Main.fishingLineTexture.Width * 0.5f, 0f), 1f, SpriteEffects.None, 0f);
}
}
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

+1 -1
View File
@@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Typeless
}
rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f;
if (projectile.Calamity().stealthStrike == true) //pink line
if (projectile.localAI[0] == 1) //pink line
{
red = 252;
green = 109;
+153
View File
@@ -0,0 +1,153 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Fishing;
namespace CalamityMod.Projectiles.Typeless
{
public class SlurperBobber : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Slurper Bobber");
}
public override void SetDefaults()
{
//projectile.CloneDefaults(360); //Wooden Bobber
projectile.width = 14;
projectile.height = 14;
projectile.aiStyle = 61;
projectile.bobber = true;
projectile.penetrate = -1;
}
public override bool PreDrawExtras(SpriteBatch spriteBatch)
{
Lighting.AddLight(projectile.Center, 0.25f, 0f, 0f);
Player player = Main.player[projectile.owner];
if (projectile.bobber && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].holdStyle > 0)
{
float pPosX = player.MountedCenter.X;
float pPosY = player.MountedCenter.Y;
pPosY += Main.player[projectile.owner].gfxOffY;
int type = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type;
float gravDir = Main.player[projectile.owner].gravDir;
if (type == ModContent.ItemType<SlurperPole>())
{
pPosX += (float)(45 * Main.player[projectile.owner].direction);
if (Main.player[projectile.owner].direction < 0)
{
pPosX -= 13f;
}
pPosY -= 35f * gravDir;
}
if (gravDir == -1f)
{
pPosY -= 12f;
}
Vector2 value = new Vector2(pPosX, pPosY);
value = Main.player[projectile.owner].RotatedRelativePoint(value + new Vector2(8f), true) - new Vector2(8f);
float projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X;
float projPosY = projectile.position.Y + (float)projectile.height * 0.5f - value.Y;
Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY));
float rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f;
bool flag2 = true;
if (projPosX == 0f && projPosY == 0f)
{
flag2 = false;
}
else
{
float projPosXY = (float)Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY));
projPosXY = 12f / projPosXY;
projPosX *= projPosXY;
projPosY *= projPosXY;
value.X -= projPosX;
value.Y -= projPosY;
projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X;
projPosY = projectile.position.Y + (float)projectile.height * 0.5f - value.Y;
}
while (flag2)
{
float num = 12f;
float num2 = (float)Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY));
float num3 = num2;
if (float.IsNaN(num2) || float.IsNaN(num3))
{
flag2 = false;
}
else
{
if (num2 < 20f)
{
num = num2 - 8f;
flag2 = false;
}
num2 = 12f / num2;
projPosX *= num2;
projPosY *= num2;
value.X += projPosX;
value.Y += projPosY;
projPosX = projectile.position.X + (float)projectile.width * 0.5f - value.X;
projPosY = projectile.position.Y + (float)projectile.height * 0.1f - value.Y;
if (num3 > 12f)
{
float num4 = 0.3f;
float num5 = Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y);
if (num5 > 16f)
{
num5 = 16f;
}
num5 = 1f - num5 / 16f;
num4 *= num5;
num5 = num3 / 80f;
if (num5 > 1f)
{
num5 = 1f;
}
num4 *= num5;
if (num4 < 0f)
{
num4 = 0f;
}
num5 = 1f - projectile.localAI[0] / 100f;
num4 *= num5;
if (projPosY > 0f)
{
projPosY *= 1f + num4;
projPosX *= 1f - num4;
}
else
{
num5 = Math.Abs(projectile.velocity.X) / 3f;
if (num5 > 1f)
{
num5 = 1f;
}
num5 -= 0.5f;
num4 *= num5;
if (num4 > 0f)
{
num4 *= 2f;
}
projPosY *= 1f + num4;
projPosX *= 1f - num4;
}
}
rotation2 = (float)Math.Atan2((double)projPosY, (double)projPosX) - 1.57f;
Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)value.X / 16, (int)(value.Y / 16f), new Microsoft.Xna.Framework.Color(227, 79, 79, 100)); //red
Main.spriteBatch.Draw(Main.fishingLineTexture, new Vector2(value.X - Main.screenPosition.X + (float)Main.fishingLineTexture.Width * 0.5f, value.Y - Main.screenPosition.Y + (float)Main.fishingLineTexture.Height * 0.5f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.fishingLineTexture.Width, (int)num)), color2, rotation2, new Vector2((float)Main.fishingLineTexture.Width * 0.5f, 0f), 1f, SpriteEffects.None, 0f);
}
}
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B