From e063b4697a844ac925f6dc041375ecf13bea67ce Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 31 Oct 2019 18:26:42 -0400 Subject: [PATCH] Added Hell's Sun (unobtainable) --- CalamityMod.cs | 1 + Items/Weapons/Rogue/HellsSun.cs | 106 ++++++++++++++++++++++++++++ Items/Weapons/Rogue/HellsSun.png | Bin 0 -> 499 bytes Projectiles/Rogue/ExplosiveSun.cs | 91 ++++++++++++++++++++++++ Projectiles/Rogue/ExplosiveSun.png | Bin 0 -> 406 bytes Projectiles/Rogue/ExplosiveSun2.png | Bin 0 -> 503 bytes Projectiles/Rogue/ExplosiveSun3.png | Bin 0 -> 670 bytes Projectiles/Rogue/HellsSunProj.cs | 95 +++++++++++++++++++++++++ Projectiles/Rogue/HellsSunProj.png | Bin 0 -> 499 bytes 9 files changed, 293 insertions(+) create mode 100644 Items/Weapons/Rogue/HellsSun.cs create mode 100644 Items/Weapons/Rogue/HellsSun.png create mode 100644 Projectiles/Rogue/ExplosiveSun.cs create mode 100644 Projectiles/Rogue/ExplosiveSun.png create mode 100644 Projectiles/Rogue/ExplosiveSun2.png create mode 100644 Projectiles/Rogue/ExplosiveSun3.png create mode 100644 Projectiles/Rogue/HellsSunProj.cs create mode 100644 Projectiles/Rogue/HellsSunProj.png diff --git a/CalamityMod.cs b/CalamityMod.cs index 883ccb4ef2..641bd5c8fd 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1710,6 +1710,7 @@ namespace CalamityMod spikyBallList = new List() //There's more to come { + ModContent.ItemType() ModContent.ItemType() }; diff --git a/Items/Weapons/Rogue/HellsSun.cs b/Items/Weapons/Rogue/HellsSun.cs new file mode 100644 index 0000000000..43fcabf8f0 --- /dev/null +++ b/Items/Weapons/Rogue/HellsSun.cs @@ -0,0 +1,106 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.CalPlayer; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class HellsSun : RogueWeapon + { + private static int damage = 250; + private static int knockBack = 5; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hell's Sun"); + Tooltip.SetDefault("Shoots a gravity-defying spiky ball. Stacks up to 10.\n" + + "Once stationary, periodically emits small suns that explode on hit\n" + + "Stealth strikes emit suns at a faster rate and last for a longer amount of time\n" + + "Right click to delete all existing spiky balls"); + } + + public override void SafeSetDefaults() + { + item.damage = damage; + item.Calamity().rogue = true; + item.noMelee = true; + item.noUseGraphic = true; + item.width = 1; + item.height = 1; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 1; + item.knockBack = knockBack; + item.value = Item.buyPrice(0, 12, 0, 0); + item.rare = 10; + item.Calamity().postMoonLordRarity = 12;; + item.UseSound = SoundID.Item1; + item.maxStack = 10; + + item.shootSpeed = 5f; + item.shoot = ModContent.ProjectileType(); + + } + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + return true; + } + else + { + int UseMax = item.stack - 1; + + if (player.ownedProjectileCounts[item.shoot] > UseMax) + { + return false; + } + else + { + 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) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = false; + if (player.altFunctionUse == 2) + { + modPlayer.killSpikyBalls = true; + return false; + } + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth].penetrate = -1; + Main.projectile[stealth].timeLeft = 2400; + return false; + } + return true; + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + /*public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + + recipe.AddIngredient(ItemID.SpikyBall, 100); + recipe.AddIngredient(ModContent.ItemType(), 10); + r.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + }*/ + } +} diff --git a/Items/Weapons/Rogue/HellsSun.png b/Items/Weapons/Rogue/HellsSun.png new file mode 100644 index 0000000000000000000000000000000000000000..130f9037b446c667d8c3d5e085dfe16440aec27b GIT binary patch literal 499 zcmV4ugq_e;|QlEhfulD06PJ4Ma64LGYfVP$`br?ruQot?whNj^Lu{(^_~N;tBzU`4z|5OFU~KLw zn7DB{+VE;IkdD=V1mgKyV0tvn?=*%h_W1tP1n6wlBCnTT2ag}U4Cy#KatdU7=_u8{ z8UKsY>*_r2Y}L@uVSBb)(9h|Y?;Ggnxm20wUu$7*=H6)Zy*iJ}m$K!?({O{8Zm)n3 ztIN@b0UZLSPiOy`_+Rp}pMUS}fLaKR?)J}tece2EBB9@sl@b31b2D(NBz&yE0000I pbVXQnMOaBjI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1j)o=e_^{ literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/ExplosiveSun.cs b/Projectiles/Rogue/ExplosiveSun.cs new file mode 100644 index 0000000000..0da1cbeb43 --- /dev/null +++ b/Projectiles/Rogue/ExplosiveSun.cs @@ -0,0 +1,91 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ExplosiveSun : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosive Sun"); + } + + public override void SetDefaults() + { + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 115; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.light = 0.5f; + projectile.alpha = 50; + projectile.scale = 1.2f; + projectile.timeLeft = 600; + projectile.tileCollide = false; + projectile.Calamity().rogue = true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + //Changes the texture of the projectile + if (projectile.ai[0] == 1f) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ExplosiveSun2"); + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 30, 30)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + if (projectile.ai[0] == 2f) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ExplosiveSun3"); + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 34, 34)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 192; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.damage /= 2; + projectile.Damage(); + if (Main.rand.NextBool(3)) + { + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14, 0.5f); + } + for (int num621 = 0; num621 < 5; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 10; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } + } +} diff --git a/Projectiles/Rogue/ExplosiveSun.png b/Projectiles/Rogue/ExplosiveSun.png new file mode 100644 index 0000000000000000000000000000000000000000..21391d0538e2c758eafdce00871e6f3092e15475 GIT binary patch literal 406 zcmV;H0crk;P)HK~y-)?UlVsLqQOQzwrhxq%e(9ViT~iNFi9JGo^@)t0xalztaB>>f0<~EH3>J9Px%Vk^%J!5)t4Z!HG3qb4UMCX??0J6g) zo$tK>aDIQQ^TU4P!45R`u8#(DWpcGoF@iM=`)piaHsheNxg9iZw_TALr)TQ=%8 zl|Ko<;{6SPYAvI5#;$mixgQXjrenV^U(PfF+wV~-WAPdTF;8==4W{W=jgOleV16I~ zt6gerH)$T*i!!Za9w$sKTgHRAgWt$wgT4JwD}0`s`=)7N8f!&z&VN0QjIHx${=82C z-G3I|btX^%000tnMObu2SV=}YPjYExZggREX>V=-F@#v`?*IS*07*qoM6N<$g6;jU AV*mgE literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/ExplosiveSun2.png b/Projectiles/Rogue/ExplosiveSun2.png new file mode 100644 index 0000000000000000000000000000000000000000..e30cba51d0e51438ec878c5a7121cd0938ddce50 GIT binary patch literal 503 zcmV&wcIhlq#6}SD3498RJcWf% zktYa2urY;&-F1SgtPDvCIYG&Rau&CHX7?_C3gM1qn!TObo4s$onb|#IMTs8HQz|ve ztWr+zR`R#C>c;;qVk*P=+|k2pbE@#1kZG>{Dkp#Zp52Y?-SI|BF$egq&G zeFNatOJ+nWo+y6?^4t(RDUC+jx&**)cK|qS9suz2IF0}s7kg^{87aE}_`NXzjhn03 zU%#7~{RQG!Wv$=)U=~>-DiSH_ca3Sr`vL{vSnRqT4nhFRRTqGLcbduh@%5Pilm<_R zT_b-F$^tMQ1ps*UlCe)A5F2%=vvnprF_2lJBca#p`B8IM;IHmcT<3~7TDU?X4BsX( zr?rY*mr96lXL5oO0v7AvR~D4Avrb_%j#Hj7uHWCGZKZb zWBsr(z1o>)use`GZ(rLT<2=^L61zUH?T%+jfjD0GJJ$x^tCzxDmw%^UpO?@$EX|SH t0000IbVXQnMOaBjI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1jbk))fE% literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/ExplosiveSun3.png b/Projectiles/Rogue/ExplosiveSun3.png new file mode 100644 index 0000000000000000000000000000000000000000..31fd6c3f7bccb95169da0eafc535c0e43a218ee7 GIT binary patch literal 670 zcmV;P0%84$P)prncrf`*h zA)@9pNcwxgj80@Hc81^kLKn36w5{%_U#sU}e*(b9_KH+$&m(vAjmQuw&J*`d1~c_; z?4sKfPAC$k7UfWKhSHCT7wV5+KO#iRla=YB+B-sIzP|k|;~_`971h(WdZP-vvAr%; zsPkg08kZlwlsmsyV=-F@#v`?*IS*07*qoM6N<$ Ef(pVoC;$Ke literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/HellsSunProj.cs b/Projectiles/Rogue/HellsSunProj.cs new file mode 100644 index 0000000000..dac4480671 --- /dev/null +++ b/Projectiles/Rogue/HellsSunProj.cs @@ -0,0 +1,95 @@ +using System; +using Terraria; +using Terraria.ID; +using Microsoft.Xna.Framework; +using Terraria.ModLoader; +using CalamityMod.Projectiles.Typeless; +using CalamityMod.CalPlayer; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + public class HellsSunProj : ModProjectile + { + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hell's Sun"); + } + + public override void SetDefaults() + { + projectile.width = 15; + projectile.height = 15; + projectile.friendly = true; + projectile.Calamity().rogue = true; + projectile.tileCollide = false; + projectile.penetrate = 20; + projectile.timeLeft = 1200; + + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 30; + } + + public override void AI() + { + projectile.ai[0] += 1f; + + if (projectile.ai[0] >= 90f) + { + projectile.velocity.X *= 0.98f; + projectile.velocity.Y *= 0.98f; + projectile.localAI[1]++; + if (projectile.Calamity().stealthStrike == true) + { + if ((double) projectile.localAI[1] >= 15.0) + { + Vector2 velocity = projectile.velocity; + Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2_1.Normalize(); + Vector2 vector2_2 = vector2_1 * ((float) Main.rand.Next(10, 41) * 0.1f); + if (Main.rand.Next(3) == 0) + vector2_2 *= 2f; + Vector2 vector2_3 = velocity * 0.25f + vector2_2; + Vector2 vector2_5 = vector2_3 * 0.8f; + Projectile.NewProjectile(projectile.Center.X - vector2_5.X, projectile.Center.Y - vector2_5.Y, vector2_5.X, vector2_5.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, Main.rand.Next(3), 0.0f); + projectile.localAI[1] = 0.0f; + } + } + else + { + if ((double) projectile.localAI[1] >= 30.0) + { + Vector2 velocity = projectile.velocity; + Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2_1.Normalize(); + Vector2 vector2_2 = vector2_1 * ((float) Main.rand.Next(10, 41) * 0.1f); + if (Main.rand.Next(3) == 0) + vector2_2 *= 2f; + Vector2 vector2_3 = velocity * 0.25f + vector2_2; + Vector2 vector2_5 = vector2_3 * 0.8f; + Projectile.NewProjectile(projectile.Center.X - vector2_5.X, projectile.Center.Y - vector2_5.Y, vector2_5.X, vector2_5.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, Main.rand.Next(3), 0.0f); + projectile.localAI[1] = 0.0f; + } + } + } + else + { + projectile.rotation += 0.3f * (float)projectile.direction; + } + + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.killSpikyBalls == true) + { + projectile.active = false; + projectile.netUpdate = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + } +} diff --git a/Projectiles/Rogue/HellsSunProj.png b/Projectiles/Rogue/HellsSunProj.png new file mode 100644 index 0000000000000000000000000000000000000000..130f9037b446c667d8c3d5e085dfe16440aec27b GIT binary patch literal 499 zcmV4ugq_e;|QlEhfulD06PJ4Ma64LGYfVP$`br?ruQot?whNj^Lu{(^_~N;tBzU`4z|5OFU~KLw zn7DB{+VE;IkdD=V1mgKyV0tvn?=*%h_W1tP1n6wlBCnTT2ag}U4Cy#KatdU7=_u8{ z8UKsY>*_r2Y}L@uVSBb)(9h|Y?;Ggnxm20wUu$7*=H6)Zy*iJ}m$K!?({O{8Zm)n3 ztIN@b0UZLSPiOy`_+Rp}pMUS}fLaKR?)J}tece2EBB9@sl@b31b2D(NBz&yE0000I pbVXQnMOaBjI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1j)o=e_^{ literal 0 HcmV?d00001