From 1fc11f4fa15c7240f420234af7c717f6aa41e427 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 14 May 2020 17:12:14 -0400 Subject: [PATCH] added aurora blazer --- CalPlayer/CalamityPlayer.cs | 7 +- Dusts/AstralBlue.png | Bin 274 -> 187 bytes Dusts/AstralOrange.png | Bin 273 -> 185 bytes Items/TreasureBags/AstrageldonBag.cs | 7 +- Items/Weapons/Ranged/AuroraBlazer.cs | 59 ++++++++++++++ Items/Weapons/Ranged/AuroraBlazer.png | Bin 0 -> 850 bytes Items/Weapons/Ranged/AuroraBlazerGlow.png | Bin 0 -> 253 bytes ModSupport/WeakReferenceSupport.cs | 2 +- NPCs/AstrumAureus/AstrumAureus.cs | 2 + Projectiles/Ranged/AuroraFire.cs | 89 ++++++++++++++++++++++ Projectiles/Ranged/AuroraFire.png | Bin 0 -> 148 bytes 11 files changed, 160 insertions(+), 6 deletions(-) create mode 100644 Items/Weapons/Ranged/AuroraBlazer.cs create mode 100644 Items/Weapons/Ranged/AuroraBlazer.png create mode 100644 Items/Weapons/Ranged/AuroraBlazerGlow.png create mode 100644 Projectiles/Ranged/AuroraFire.cs create mode 100644 Projectiles/Ranged/AuroraFire.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 601b824f61..09fc053b22 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -8354,7 +8354,7 @@ namespace CalamityMod.CalPlayer // Bow and Book else if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || - item.type == ModContent.ItemType()) + item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"); int offsetX = 10; @@ -8373,6 +8373,11 @@ namespace CalamityMod.CalPlayer texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"); offsetX = 9; } + else if (item.type == ModContent.ItemType()) + { + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow"); + offsetX = 44; + } Vector2 vector13 = new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)); Vector2 vector14 = vector13; diff --git a/Dusts/AstralBlue.png b/Dusts/AstralBlue.png index 691796f1c9b2e94f04241988d7362a78244d0c43..04b49e54e3de729fc72774d6ab6e0ea2e0ad1cbe 100644 GIT binary patch delta 146 zcmbQlw3~5)VSTBmi(`mIZ*sx{%M*V~p47ivuKfSv(U~2l4Xig+*x12{TZTf4vRzkF})li#xh!D`rYgX@4w+1geww>L5Xf;YwAmKmgJls%rn va;1OfUcVR~5IFaHpP_*P&*d4643=FM9r}C=${DyB7#KWV{an^LB{Ts5G=@6f delta 233 zcmdnZIEiV3VLeN_qpu?a!^VE@KZ&di3=EtF9+AZi419+{nDKc2iWH!rM2TxeNpOBz zNqJ&XDnmhHW?qS2UTTSgiJpO;*`J=|`#?3#o-U3d7XE85Z{%$?;Awf-b4ce+^Ngm6 z8ZT#bu=eznw4N6~I#FZaq2=~RtA);<@p`giN#b6=q~bm8hk2b@ZWq`8I9S6W<6seE z`DWr`C3n|8FR5vN4USh^+%a%z*xxRHru_h8%i*bq{NiPPCIg>KoDp$G&iCXhAoWQA)a~X$090euE#mtbqtv7;nRNC1Yvq#w@-hQp y9v1+Leh6$PIAfFw{`%O=(Twdjzi;N3&8&6yHNsl;HPHY700{s|MNUMnLSTYzyh1|& delta 232 zcmdnVIFV_BVLeN_qpu?a!^VE@KZ&di3=EtF9+AZi419+{nDKc2iWH!rM2TxeNpOBz zNqJ&XDnmhHW?qS2UTTSgiJpO;*`J=|`#?2Ko-U3d7XE85ALMK`5NLULC5^l4>Z_c? zlh!1r9_4)VrbXq!L+dvmo_~;wIFr*MGu7nI@2tM>i3L0IBAP!}d~E(HV9`*p2K9l_n{zhhw gc4@xoCo>`|8K!n7pF6SJ5#$dBPgg&ebxsLQ0FGQ;O8@`> diff --git a/Items/TreasureBags/AstrageldonBag.cs b/Items/TreasureBags/AstrageldonBag.cs index 4acd405307..5a76c89f86 100644 --- a/Items/TreasureBags/AstrageldonBag.cs +++ b/Items/TreasureBags/AstrageldonBag.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Mounts; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.World; @@ -34,10 +35,7 @@ namespace CalamityMod.Items.TreasureBags item.rare = 9; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void OpenBossBag(Player player) { @@ -50,6 +48,7 @@ namespace CalamityMod.Items.TreasureBags // Weapons DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); // Equipment diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs new file mode 100644 index 0000000000..3364382d01 --- /dev/null +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -0,0 +1,59 @@ +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class AuroraBlazer : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aurora Blazer"); + Tooltip.SetDefault("Spews astral flames that travel in a star-shaped patterns\n" + + "60% chance to not consume gel"); + } + + public override void SetDefaults() + { + item.damage = 101; + item.ranged = true; + item.useTime = 15; + item.useAnimation = 15; + item.knockBack = 2f; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 7.5f; + item.useAmmo = AmmoID.Gel; + + item.width = 68; + item.height = 36; + item.useStyle = 5; + item.noMelee = true; + item.UseSound = SoundID.Item34; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; + } + + 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 + Main.rand.NextFloat(-15f, 15f) * 0.05f; + float SpeedY = speedY + Main.rand.NextFloat(-15f, 15f) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4, 11), 0f); + return false; + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow"); + Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f); + spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + + public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 60; + } +} diff --git a/Items/Weapons/Ranged/AuroraBlazer.png b/Items/Weapons/Ranged/AuroraBlazer.png new file mode 100644 index 0000000000000000000000000000000000000000..567a768453c142d9ecc49f9caeff44c93bee0bb7 GIT binary patch literal 850 zcmV-Y1FigtP)`n-npEgfu9)DO!valv3~m7ZxgrZUn)F zKfs@&D{-NSAiA-e78DVwAccZh!Qw_ijEo`yu?SLE#zk@x=FJ@Mq#w4zeKzIJ%)K+2 z^US&DURvNkW4t!i%sM{5I9phc@dq~h2W~aCZT15wYJf%Fj_)g1oSxbJ`Xw47{4+yB z-@ctcet0Z(zMj+rX0)*LmEC&)SQ#oc0T!R#?#q;Dh)^h(4mJOF!Ekvv)wYOw{gTF; z%!sG~&tJbxomVsTycsaJ@FMd$FHc>_JpTA&J=G2w6AckMIiz%OEc=S@4WJvLdeSoE z#L!Cu{@RgL`__%?skYu^xL# z)|^8^Xrx!#6=P$mRk5leaV@jOaQ9TbRj@@ilp7Q?BQM_g?taL(cL0n&c@K0=s8rj} z-(G{+4qD71IqAtEq5To>%_^a~!Avu}Tw;XwRK47wYoNHN+9!P*Vv+SKOfOfc5r(dX zyt>3Qz{C1^m9$4RL~v)BP()cu?_O&J_1o>~?;M|7NRO+>Lv@6%!uur}BCN~*R6uV< z>&+^wjhuHMW3A&F(GX$X3{f^Zk{d-dMECV=-F@#v`?*IS*07*qoM6N<$g39NRxBvhE literal 0 HcmV?d00001 diff --git a/Items/Weapons/Ranged/AuroraBlazerGlow.png b/Items/Weapons/Ranged/AuroraBlazerGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..91533ab0b137555082b08434af646506469aca16 GIT binary patch literal 253 zcmeAS@N?(olHy`uVBq!ia0vp^E|gW!U_%O?Xxrg*wI zhGg7(dt*0mvw=wKL*~f_+(Nqch@f~0ILXlzHj`jz#`7^se%5QRZ0y?N+{s*SY3)cJ{ u)ur`7u26|<1Q2<;S@{=brskC-mSpDVF&MT)ym=3lW$<+Mb6Mw<&;$U|OI_sv literal 0 HcmV?d00001 diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 93e95f268a..4749e0d6ca 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -357,7 +357,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("AstrumAureus", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(),ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] at Night in the Astral Biome"; string despawn = CalamityUtils.ColorMessage("Astrum Aureus’ program has been executed. Initiate recall.", new Color(0xFF, 0xD7, 0x00)); diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 4299c68e61..20b3e3f30b 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -8,6 +8,7 @@ using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.TownNPCs; using CalamityMod.World; @@ -357,6 +358,7 @@ namespace CalamityMod.NPCs.AstrumAureus // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); // Vanity diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs new file mode 100644 index 0000000000..aae7dae614 --- /dev/null +++ b/Projectiles/Ranged/AuroraFire.cs @@ -0,0 +1,89 @@ +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 AuroraFire : ModProjectile + { + private const int framesBeforeTurning = 70; + private bool initialized = false; + private int radianAmt = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aurora"); + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + } + + public override void AI() + { + if (projectile.ai[0] % 2 == 0) + projectile.ai[0]++; + + if (!initialized) + { + int pointCount = (int)projectile.ai[0]; + radianAmt = 180 + (int)(360 / (pointCount * 2)); + projectile.timeLeft = framesBeforeTurning * pointCount - 1; + initialized = true; + } + + //Velocity movement + projectile.localAI[1]++; + if (projectile.localAI[1] % framesBeforeTurning == 0) + { + projectile.velocity = projectile.velocity.RotatedBy(MathHelper.ToRadians(radianAmt)); + } + + //Dust behavior + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 4f) + { + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.DustType(), + ModContent.DustType() + }); + for (int i = 0; i < 5; i++) + { + int astral = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f); + Dust dust = Main.dust[astral]; + dust.noGravity = true; + dust.velocity *= 0f; + dust.scale *= Main.rand.NextFloat(); + } + } + + //rotation code for when sproot + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + } +} diff --git a/Projectiles/Ranged/AuroraFire.png b/Projectiles/Ranged/AuroraFire.png new file mode 100644 index 0000000000000000000000000000000000000000..983260eb072b8727c0a51e9d46e9d6a08bc460b1 GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 z0|Vb-5N14{zaj-F$X?><>&pIsor6J7WfsE<1)z|kr;B5V#p&cf|Nq-Fn=%SBPd&Jz maWPw;lttEq6^+hE9T+mXnN^!s2qgd&GkCiCxvX