From 2b81efc7467fe53824c31126a75d0f50b2d17310 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 9 Oct 2019 23:00:12 -0400 Subject: [PATCH 1/2] added gacruxian mollusk --- CalPlayer/CalamityPlayer.cs | 14 ++- .../GacruxianMollusk.cs | 53 ++++++++++ .../GacruxianMollusk.png | Bin Items/Fishing/ArcturusAstroidean.cs | 1 + Items/Fishing/AstralCrate.cs | 6 ++ Projectiles/Rogue/GacruxianHome.cs | 93 ++++++++++++++++++ Projectiles/Rogue/GacruxianHome.png | Bin 0 -> 651 bytes Projectiles/Rogue/GacruxianProj.cs | 76 ++++++++++++++ Projectiles/Rogue/GacruxianProj.png | Bin 0 -> 651 bytes 9 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 Items/CalamityCustomThrowingDamage/GacruxianMollusk.cs rename Items/{Fishing => CalamityCustomThrowingDamage}/GacruxianMollusk.png (100%) create mode 100644 Projectiles/Rogue/GacruxianHome.cs create mode 100644 Projectiles/Rogue/GacruxianHome.png create mode 100644 Projectiles/Rogue/GacruxianProj.cs create mode 100644 Projectiles/Rogue/GacruxianProj.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 16f439252f..7eb2ab350b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6810,7 +6810,7 @@ namespace CalamityMod.CalPlayer #region Fishing public override void CatchFish(Item fishingRod, Item bait, int power, int liquidType, int poolSize, int worldLayer, int questFish, ref int caughtType, ref bool junk) { - if (ZoneAstral) + if (ZoneAstral && liquidType == 0) //Astral Infection, fishing in water { if (caughtType == ItemID.WoodenCrate) { @@ -6856,6 +6856,10 @@ namespace CalamityMod.CalPlayer { caughtType = mod.ItemType("UrsaSergeant"); } + else if (Main.rand.NextBool(25)) + { + caughtType = mod.ItemType("GacruxianMollusk"); + } else { caughtType = mod.ItemType("TwinklingPollox"); @@ -6946,6 +6950,14 @@ namespace CalamityMod.CalPlayer } } } + + public override void GetFishingLevel(Item fishingRod, Item bait, ref int fishingLevel) + { + if ((ZoneAstral || ZoneAbyss || ZoneSulphur) && bait.type = mod.ItemType("ArcturusAstroidean")) + { + fishingLevel = (int)(fishingLevel * 1.1f); + } + } #endregion #region Frame Effects diff --git a/Items/CalamityCustomThrowingDamage/GacruxianMollusk.cs b/Items/CalamityCustomThrowingDamage/GacruxianMollusk.cs new file mode 100644 index 0000000000..4c2bcf405f --- /dev/null +++ b/Items/CalamityCustomThrowingDamage/GacruxianMollusk.cs @@ -0,0 +1,53 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Items.CalamityCustomThrowingDamage +{ + public class GacruxianMollusk : CalamityDamageItem + { + public static int BaseDamage = 50; + public static float Knockback = 5f; + public static float Speed = 8f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gacruxian Mollusk"); + Tooltip.SetDefault("Releases homing sparks while traveling\n" + + "Stealth strikes release homing snails that create even more sparks"); + } + + public override void SafeSetDefaults() + { + item.damage = BaseDamage; + item.rare = 4; + item.knockBack = Knockback; + item.autoReuse = true; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 1; + item.width = 24; + item.height = 22; + item.UseSound = SoundID.Item1; + item.noMelee = true; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("GacruxianProj"); + item.shootSpeed = Speed; + item.value = Item.buyPrice(0, 0, 20, 0); + item.GetGlobalItem(mod).rogue = true; + //item.maxStack = 999; not consumable because imagine knowing how to fish up more than one of an item + //item.consumable = 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) + { + if (player.GetCalamityPlayer().StealthStrikeAvailable()) + { + int p = Projectile.NewProjectile(position, new Vector2(speedX, speedY), mod.ProjectileType("GacruxianProj"), damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[p].GetCalamityProj().stealthStrike = true; + return false; + } + return true; + } + } +} diff --git a/Items/Fishing/GacruxianMollusk.png b/Items/CalamityCustomThrowingDamage/GacruxianMollusk.png similarity index 100% rename from Items/Fishing/GacruxianMollusk.png rename to Items/CalamityCustomThrowingDamage/GacruxianMollusk.png diff --git a/Items/Fishing/ArcturusAstroidean.cs b/Items/Fishing/ArcturusAstroidean.cs index 96b50b37ca..6371d59e2c 100644 --- a/Items/Fishing/ArcturusAstroidean.cs +++ b/Items/Fishing/ArcturusAstroidean.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Fishing public override void SetStaticDefaults() { DisplayName.SetDefault("Arcturus Astroidean"); + Tooltip.SetDefault("Increases fishing power if used in the Astral Infection or Sulphurous Sea"); } public override void SetDefaults() diff --git a/Items/Fishing/AstralCrate.cs b/Items/Fishing/AstralCrate.cs index d7877430ff..7751341ac0 100644 --- a/Items/Fishing/AstralCrate.cs +++ b/Items/Fishing/AstralCrate.cs @@ -22,6 +22,12 @@ namespace CalamityMod.Items.Fishing item.height = 32; item.rare = 2; item.value = Item.sellPrice(gold: 1); + item.createTile = mod.TileType("AstralCrate"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; } public override bool CanRightClick() diff --git a/Projectiles/Rogue/GacruxianHome.cs b/Projectiles/Rogue/GacruxianHome.cs new file mode 100644 index 0000000000..28fad66f41 --- /dev/null +++ b/Projectiles/Rogue/GacruxianHome.cs @@ -0,0 +1,93 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class GacruxianHome : ModProjectile + { + private int sparkTrailTimer = 10; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mollusk"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.aiStyle = 18; + projectile.friendly = true; + projectile.GetGlobalProjectile(mod).rogue = true; + projectile.penetrate = 5; + projectile.timeLeft = 180; + projectile.ignoreWater = true; + aiType = 274; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + sparkTrailTimer--; + if (Main.rand.NextBool(4)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + if (sparkTrailTimer == 0) + { + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, mod.ProjectileType("UltimusCleaverDust"), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[proj].GetGlobalProjectile(mod).forceRogue = true; + } + sparkTrailTimer = 10; + } + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 600f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 25f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 10; i++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} diff --git a/Projectiles/Rogue/GacruxianHome.png b/Projectiles/Rogue/GacruxianHome.png new file mode 100644 index 0000000000000000000000000000000000000000..4a4defcff858ba7555f7ec6d00fc65469369c758 GIT binary patch literal 651 zcmV;60(AX}P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00G%aL_t(Y$Gz0SOH@%5$MMhPNRE=4 zIR-Imv zWQ#FSc`e?%%1l!`-`TwT?z{K!`~KcJC*vP+U~sJJeKp$%8djF0dgr(3%)q*ixIT9wu6y@ zeRVJ1cz+Yj_TL7#3ccX!@MIuLhaeNY@7+;IOlyeX#ld@EykiRF3#;JMtIt&lhH|ID z)b}zdeVD*{Rc$=M`D2&BqnTm^XU0y%N*2C=zQG|dU3>}pTbe*memj_}jDVBdVh4iv z&AH}u2(m%>$GcC!_)Prl>y8yYoqhmv;YLeO6=A6ydoHP-5S68hbO??PjAo$w>}Uk% zE?%j7aP!24crp1H%#}-3-$NDEMk;*}!JShNvEHFacE+9g{LKuQFVBPCq+@p#dg>;8 z_PV&1I~9WL-okK(zo%g-srN98N{QlH?`xIkJK_#r`0-6D1Z%S>M0+w-e(mod).rogue = true; + } + + public override void AI() + { + if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer) + { + sparkTrailTimer--; + if (Main.rand.NextBool(4)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + if (sparkTrailTimer == 0) + { + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, mod.ProjectileType("GacruxianHome"), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + } + sparkTrailTimer = 10; + } + } + else + { + sparkTrailTimer--; + if (Main.rand.NextBool(4)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + if (sparkTrailTimer == 0) + { + if (projectile.owner == Main.myPlayer) + { + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, mod.ProjectileType("UltimusCleaverDust"), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[proj].GetGlobalProjectile(mod).forceRogue = true; + } + sparkTrailTimer = 10; + } + } + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i <= 10; i++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("AstralOrange"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} diff --git a/Projectiles/Rogue/GacruxianProj.png b/Projectiles/Rogue/GacruxianProj.png new file mode 100644 index 0000000000000000000000000000000000000000..4a4defcff858ba7555f7ec6d00fc65469369c758 GIT binary patch literal 651 zcmV;60(AX}P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00G%aL_t(Y$Gz0SOH@%5$MMhPNRE=4 zIR-Imv zWQ#FSc`e?%%1l!`-`TwT?z{K!`~KcJC*vP+U~sJJeKp$%8djF0dgr(3%)q*ixIT9wu6y@ zeRVJ1cz+Yj_TL7#3ccX!@MIuLhaeNY@7+;IOlyeX#ld@EykiRF3#;JMtIt&lhH|ID z)b}zdeVD*{Rc$=M`D2&BqnTm^XU0y%N*2C=zQG|dU3>}pTbe*memj_}jDVBdVh4iv z&AH}u2(m%>$GcC!_)Prl>y8yYoqhmv;YLeO6=A6ydoHP-5S68hbO??PjAo$w>}Uk% zE?%j7aP!24crp1H%#}-3-$NDEMk;*}!JShNvEHFacE+9g{LKuQFVBPCq+@p#dg>;8 z_PV&1I~9WL-okK(zo%g-srN98N{QlH?`xIkJK_#r`0-6D1Z%S>M0+w-e Date: Wed, 9 Oct 2019 22:10:10 -0500 Subject: [PATCH 2/2] I wanted to erase the changes to biofusillade i was making but now its forcing me to commit --- Items/Weapons/GammaFusillade.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/GammaFusillade.cs b/Items/Weapons/GammaFusillade.cs index d46bcaf24f..984b12ef88 100644 --- a/Items/Weapons/GammaFusillade.cs +++ b/Items/Weapons/GammaFusillade.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons item.autoReuse = true; item.shoot = mod.ProjectileType("GammaLaser"); item.shootSpeed = 20f; - item.GetGlobalItem(mod).postMoonLordRarity = 12; + item.GetGlobalItem().postMoonLordRarity = 12; } public override void AddRecipes()