From 53e91f511b7e10e159c9191a6749482394034a30 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 Nov 2019 16:35:06 -0500 Subject: [PATCH 01/10] added abyssal crate --- CalPlayer/CalamityPlayer.cs | 94 +++++++++------- Items/Fishing/SulphurCatches/AbyssalCrate.cs | 100 ++++++++++++++++++ Items/Fishing/SulphurCatches/AbyssalCrate.png | Bin 0 -> 3235 bytes Tiles/Abyss/AbyssalCrateTile.cs | 54 ++++++++++ Tiles/Abyss/AbyssalCrateTile.png | Bin 0 -> 703 bytes 5 files changed, 210 insertions(+), 38 deletions(-) create mode 100644 Items/Fishing/SulphurCatches/AbyssalCrate.cs create mode 100644 Items/Fishing/SulphurCatches/AbyssalCrate.png create mode 100644 Tiles/Abyss/AbyssalCrateTile.cs create mode 100644 Tiles/Abyss/AbyssalCrateTile.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ab1fafc19d..4f9471fcdb 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -14,6 +14,7 @@ using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Fishing; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.BrimstoneCragCatches; +using CalamityMod.Items.Fishing.SulphurCatches; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.Mounts; @@ -7603,6 +7604,10 @@ namespace CalamityMod.CalPlayer abyssPosX = true; } } + if (ZoneAbyss || ZoneSulphur) + { + abyssPosX = true; + } if (alluringBait) { @@ -7827,6 +7832,10 @@ namespace CalamityMod.CalPlayer { biomeCrateList.Add(ModContent.ItemType()); } + if (abyssPosX) + { + biomeCrateList.Add(ModContent.ItemType()); + } if (player.ZoneCorrupt) { biomeCrateList.Add(ItemID.CorruptFishingCrate); @@ -8065,6 +8074,11 @@ namespace CalamityMod.CalPlayer } } + if (power >= 60 && player.FindBuffIndex(BuffID.Gills) > -1 && NPC.downedPlantBoss && Main.rand.NextBool(25) && power < 160) + { + caughtType = ModContent.ItemType(); + } + if (junk) { if (abyssPosX && power < 40) @@ -8094,54 +8108,58 @@ namespace CalamityMod.CalPlayer return; }*/ - if (power >= 20) + if (abyssPosX) { - if (power >= 40) + if (caughtType == ItemID.WoodenCrate) { - if (abyssPosX && Main.rand.NextBool(15) && power < 80) + caughtType = ItemID.WoodenCrate; + } + else if (caughtType == ItemID.IronCrate) + { + caughtType = ItemID.IronCrate; + } + else if (caughtType == ItemID.GoldenCrate) + { + caughtType = ItemID.GoldenCrate; + } + else if (caughtType == ItemID.FrogLeg) + { + caughtType = ItemID.FrogLeg; + } + else if (caughtType == ItemID.BalloonPufferfish) + { + caughtType = ItemID.BalloonPufferfish; + } + else if (caughtType == ItemID.ZephyrFish) + { + caughtType = ItemID.ZephyrFish; + } + else if (power >= 40) + { + if (Main.rand.NextBool(15) && power < 80) { caughtType = ModContent.ItemType(); } - if (power >= 60) + if (Main.rand.NextBool(25) && power < 160) { - if (player.FindBuffIndex(BuffID.Gills) > -1 && NPC.downedPlantBoss && Main.rand.NextBool(25) && power < 160) + caughtType = ModContent.ItemType(); + } + if (power >= 110) + { + if (abyssPosX && Main.rand.NextBool(25) && power < 240) { - caughtType = ModContent.ItemType(); - } - if (abyssPosX && Main.rand.NextBool(25) && power < 160) - { - caughtType = ModContent.ItemType(); - } - if (power >= 80) - { - if (abyssPosX && Main.hardMode && Main.rand.NextBool(15) && power < 210) - { - switch (Main.rand.Next(4)) - { - case 0: - caughtType = ModContent.ItemType(); - break; //movement acc - case 1: - caughtType = ModContent.ItemType(); - break; //regen acc - case 2: - caughtType = ModContent.ItemType(); - break; //defense acc - case 3: - caughtType = ModContent.ItemType(); - break; //light pet - } - } - if (power >= 110) - { - if (abyssPosX && Main.rand.NextBool(25) && power < 240) - { - caughtType = ModContent.ItemType(); - } - } + caughtType = ModContent.ItemType(); } } } + else if (player.cratePotion && Main.rand.NextBool(5)) //20% + { + caughtType = ModContent.ItemType(); + } + else if (!player.cratePotion && Main.rand.NextBool(10)) //10% + { + caughtType = ModContent.ItemType(); + } } } diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs new file mode 100644 index 0000000000..d47c54242a --- /dev/null +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -0,0 +1,100 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Pets; +using CalamityMod.Items.Potions; +using CalamityMod.Tiles.Abyss; +using CalamityMod.World; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Fishing.SulphurCatches +{ + public class AbyssalCrate : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Abyssal Crate"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + + public override void SetDefaults() + { + item.maxStack = 999; + item.consumable = true; + item.width = 32; + item.height = 32; + item.rare = 2; + item.value = Item.sellPrice(gold: 1); + item.createTile = ModContent.TileType(); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + } + + public override bool CanRightClick() + { + return true; + } + + public override void RightClick(Player player) + { + //Modded materials + DropHelper.DropItem(player, ItemID.Starfish, 2, 3); + DropHelper.DropItem(player, ItemID.Seashell, 2, 3); + DropHelper.DropItem(player, ItemID.Coral, 2, 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f, 2, 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f, 2, 3); + if (NPC.downedPlantBoss || CalamityWorld.downedCalamitas) + { + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f, 5, 10); + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f, 5, 10); + } + if (NPC.downedGolem) + { + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.25f, 5, 10); + } + if (CalamityWorld.downedPolterghast) + { + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.25f, 5, 10); + } + + // Equipment + DropHelper.DropItemFromSetCondition(player, Main.hardMode, 0.2f, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType()); + + //Bait + DropHelper.DropItemChance(player, ItemID.MasterBait, 10, 1, 2); + DropHelper.DropItemChance(player, ItemID.JourneymanBait, 5, 1, 3); + DropHelper.DropItemChance(player, ItemID.ApprenticeBait, 3, 2, 3); + + //Potions + DropHelper.DropItemChance(player, ItemID.ObsidianSkinPotion, 10, 1, 3); + DropHelper.DropItemChance(player, ItemID.SwiftnessPotion, 10, 1, 3); + DropHelper.DropItemChance(player, ItemID.IronskinPotion, 10, 1, 3); + DropHelper.DropItemChance(player, ItemID.NightOwlPotion, 10, 1, 3); + DropHelper.DropItemChance(player, ItemID.ShinePotion, 10, 1, 3); + DropHelper.DropItemChance(player, ItemID.MiningPotion, 10, 1, 3); + DropHelper.DropItemChance(player, ItemID.HeartreachPotion, 10, 1, 3); + DropHelper.DropItemChance(player, ItemID.TrapsightPotion, 10, 1, 3); //Dangersense Potion + DropHelper.DropItemChance(player, ModContent.ItemType(), 10, 1, 3); + if (Main.hardMode) + { + DropHelper.DropItem(player, Main.rand.Next(100) >= 49 ? ItemID.GreaterHealingPotion: ItemID.GreaterManaPotion, 5, 10); + } + else + { + DropHelper.DropItem(player, Main.rand.Next(100) >= 49 ? ItemID.HealingPotion : ItemID.ManaPotion, 5, 10); + } + + //Money + DropHelper.DropItem(player, ItemID.SilverCoin, 10, 90); + DropHelper.DropItemChance(player, ItemID.GoldCoin, 0.5f, 1, 5); + } + } +} diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.png b/Items/Fishing/SulphurCatches/AbyssalCrate.png new file mode 100644 index 0000000000000000000000000000000000000000..880d23c93e4388412aca094453fb83fa1b13bf85 GIT binary patch literal 3235 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 + } + } +} diff --git a/Tiles/Abyss/AbyssalCrateTile.png b/Tiles/Abyss/AbyssalCrateTile.png new file mode 100644 index 0000000000000000000000000000000000000000..d5ddbe9f984e3725bc6d2b5fb70894c7693f9831 GIT binary patch literal 703 zcmV;w0zmzVP)Px%c}YY;R9J=Wm@#NmQ51&1t4T0~npUfn)>c#mMZrO;MGzcyRzY04s*{U@xO5Q* zmrm*~h|qRcH%mbpONWA>AX?fODO$BrB$6O;c=;ReF)uHZ+(Q55<-T{$y}94}bKc2w z-Pt|>a`_$rewM%0=|Ek(dL2M<`4s?zLq`Gl@p-kQ{9L}rHP!=Qt+E2ZmQIrYr&5;8 zzGK5)!0v-XEfWiqQzGG@N#^8*^DW~)y@DTuB&P0{_bt68GR9t-vmr$JR zEtxB~F14Ld?z>i3a#}C z^;x#5BstsZ$wRv5^3VuDau24jfXU!JY+l1;5?MFo!*=0vp}={ zsG^FePeVkG*`&_qFtqzt^*!XLyA4q1mVOH;(=@XS!I70%xMbI;jbNEHa8$ zzUJF8(C@8RFkdJ*LhC)X{kI@5X-9Ua^1@Pa-T~|#JYMf4{?M5bZ=J&A6tEF`Y7x;6 zv{UU&N1fMksW|VA?R-+wbtzmzlI>G0DOK2f?|>Jl>*dvwciobS>w~252&FSw2T)!u zwR~$~JtK*P9mkOoK^w32sYK_4BjogcD4odyP^(rtdcU(ZopAtPzDJ(exjm{oziZWw l@ Date: Mon, 25 Nov 2019 19:46:26 -0600 Subject: [PATCH 02/10] We have been living without nanomachines this whole damn time, son. --- Items/Accessories/DraedonsHeart.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 2d23a0d311..1557e30b42 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -48,6 +48,7 @@ namespace CalamityMod.Items.Accessories recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.Nanites, 250); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); From c64fdf142d7cf79b0226a0886d18f2afb4cc3ff1 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 25 Nov 2019 21:06:50 -0500 Subject: [PATCH 03/10] todo: i'll fix global tile kill tile --- Tiles/CalamityGlobalTile.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 1129e0cdbd..7ad42caefa 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -149,9 +149,13 @@ namespace CalamityMod.Tiles } } - public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) + public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem) { - if (Main.tile[i, j].type != ModContent.TileType() && Main.tile[i, j].type != ModContent.TileType() && Main.tileSolid[Main.tile[i, j].type]) + // TODO -- holy shit THAT IS NOT HOW YOU NULL CHECK OH MY GOD THIS EXPLAINS EVERYTHING + if(Main.tile[i,j] is null) + return; + + if (Main.tile[i, j].type != ModContent.TileType() && Main.tile[i, j].type != ModContent.TileType() && Main.tileSolid[Main.tile[i, j].type]) { if (Main.tile[i + 1, j] != null) { From a5c218d53e6efa489adab41d2307f39150068b69 Mon Sep 17 00:00:00 2001 From: Shucks Date: Mon, 25 Nov 2019 20:57:34 -0600 Subject: [PATCH 04/10] Tank was so loud it wouldnt play the use sound --- Sounds/Item/TankCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sounds/Item/TankCannon.cs b/Sounds/Item/TankCannon.cs index 871422338e..47305976e9 100644 --- a/Sounds/Item/TankCannon.cs +++ b/Sounds/Item/TankCannon.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Sounds.Item public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) { soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1.85f; + soundInstance.Volume = volume * 1.1f; soundInstance.Pan = pan; soundInstance.Pitch = (float)Main.rand.Next(-25, 26) * 0.01f; Main.PlaySoundInstance(soundInstance); From 1b8ec4a8a695a8b5615725a1d6d44ffafcba1030 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 Nov 2019 23:47:58 -0500 Subject: [PATCH 05/10] added god's paranoia (and some other fixes) --- Items/Fishing/SulphurCatches/AbyssalCrate.cs | 4 +- Items/Weapons/Rogue/GodsParanoia.cs | 114 ++++++++ Items/Weapons/Rogue/GodsParanoia.png | Bin 0 -> 485 bytes Projectiles/Rogue/GodsParanoiaDart.cs | 106 ++++++++ Projectiles/Rogue/GodsParanoiaDart.png | Bin 0 -> 518 bytes Projectiles/Rogue/GodsParanoiaProj.cs | 260 +++++++++++++++++++ Projectiles/Rogue/GodsParanoiaProj.png | Bin 0 -> 485 bytes Projectiles/Rogue/TotalityFlask.cs | 2 + 8 files changed, 484 insertions(+), 2 deletions(-) create mode 100644 Items/Weapons/Rogue/GodsParanoia.cs create mode 100644 Items/Weapons/Rogue/GodsParanoia.png create mode 100644 Projectiles/Rogue/GodsParanoiaDart.cs create mode 100644 Projectiles/Rogue/GodsParanoiaDart.png create mode 100644 Projectiles/Rogue/GodsParanoiaProj.cs create mode 100644 Projectiles/Rogue/GodsParanoiaProj.png diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index d47c54242a..44abd00e0f 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -52,9 +52,9 @@ namespace CalamityMod.Items.Fishing.SulphurCatches DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f, 5, 10); DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f, 5, 10); } - if (NPC.downedGolem) + if (NPC.downedGolemBoss) { - DropHelper.DropItemChance(player, ModContent.ItemType(), 0.25f, 5, 10); + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.25f, 5, 10); } if (CalamityWorld.downedPolterghast) { diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs new file mode 100644 index 0000000000..532604548d --- /dev/null +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -0,0 +1,114 @@ +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.CalPlayer; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class GodsParanoia : RogueWeapon + { + private static int damage = 250; + private static int knockBack = 5; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("God's Paranoia"); + Tooltip.SetDefault(@"Shoots a speedy homing spiky ball. Stacks up to 10. +Attaches to enemies and summons localized storm of god slayer kunai +Stealth strikes home in faster and summon kunai at a faster rate +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, 18, 0, 0); + item.rare = 10; + item.Calamity().postMoonLordRarity = 14; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.maxStack = 10; + + item.shootSpeed = 5f; + item.shoot = ModContent.ProjectileType(); + + } + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + if (player.ownedProjectileCounts[item.shoot] > 0) + { + return true; + } + else + { + return false; + } + } + 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), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + 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, 200); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/GodsParanoia.png b/Items/Weapons/Rogue/GodsParanoia.png new file mode 100644 index 0000000000000000000000000000000000000000..ea832bffbc801878652f43d14333593d9823d6c6 GIT binary patch literal 485 zcmV3NJv6KcPb=;29aD_qoD>f zD1vtX0)q@13W6FM0+*7wL(p)^mOCiia0tmeT~sRZg2lb|HXL8`6-VFSat^=eob!Bn z&UsE`SL3DWbeh6j*G7D1DfziQ0Ts{k~9WQ~qXNJIq>eHMEdxgx6 z?bQT^)Q;3LT#e5~`4E0;eobJpbnnmwlQUD`ex(Y2R07d_xemTr2ffX~oN9Q`n0>MgKK={AD8eP@T?)@E^#_Ye;;g+=2iA01|XXSad~LNk%$Pa%p95 bbYXO9Z*BlFgjnqF00000NkvXXu0mjf`M2O@ literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs new file mode 100644 index 0000000000..ed6d0fbbf5 --- /dev/null +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -0,0 +1,106 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + public class GodsParanoiaDart : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Kunai"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.Calamity().rogue = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.timeLeft = 600; + projectile.aiStyle = 27; + } + + public override void AI() + { + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (MathHelper.Pi / 2); + + projectile.velocity.X *= 1.025f; + projectile.velocity.Y *= 1.025f; + if (projectile.velocity.X > 12f) + { + projectile.velocity.X = 12f; + } + if (projectile.velocity.Y > 12f) + { + projectile.velocity.Y = 12f; + } + + int num822 = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 1f); + Dust dust = Main.dust[num822]; + dust.velocity *= 0.1f; + Main.dust[num822].scale = 1.3f; + Main.dust[num822].noGravity = true; + } + + 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 = -1; + projectile.damage /= 2; + projectile.Damage(); + for (int num621 = 0; num621 < 2; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + Main.dust[num622].scale = 0.5f; + 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 < 5; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(3) ? 56 : 242, 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, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + Main.dust[num624].scale = 0.5f; + if (Main.rand.NextBool(2)) + { + Main.dust[num624].scale = 0.5f; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft > 595) + return false; + + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/GodsParanoiaDart.png b/Projectiles/Rogue/GodsParanoiaDart.png new file mode 100644 index 0000000000000000000000000000000000000000..4833e866eec8e8bd1c8ab48c4f6c1f402981686c GIT binary patch literal 518 zcmV+h0{Q)kP)dcLV`b~ZK_NkhMubQOu{FgsQBzPv&f)Ha3r=@_rtib&xqI_` zzCVKSSq&VTzXwk3*$Y&#^x{anLY$(XFSlCH1Is_@7y`6MM5Ib#cCy zB92RE%}(si_F%PFkg zqs3Iz@4Iz7Covou3F1G6aCzbeI9ZR*0!Nc=hWv3vxScSo;VGx!<8wVCVS z{^DJ*H{2e;TBngSV}0#)gx;|;%JAbGc=h3ZH0}0BupajlfBt<;NTq$z%f0+0x_60g zeM;Zc%)~#_nTuR&VR#7u000tnMObu2SV=}YPjYExZggREX>V=-F@#v`?*IS*07*qo IM6N<$f_nPvB>(^b literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs new file mode 100644 index 0000000000..45a9dd9594 --- /dev/null +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -0,0 +1,260 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Rogue +{ + public class GodsParanoiaProj : ModProjectile + { + public int kunaiStabbing = 12; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("God's Paranoia"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 15; + projectile.height = 15; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.Calamity().rogue = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.extraUpdates = 1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f); + if (Main.rand.NextBool(2)) + { + int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, Main.rand.NextBool(3) ? 56 : 242, 0f, 0f, 0, default, 0.5f); + Main.dust[num137].alpha = projectile.alpha; + Main.dust[num137].velocity *= 0f; + Main.dust[num137].noGravity = true; + } + + if (projectile.ai[0] == 1f) + { + if (projectile.Calamity().stealthStrike) + { + kunaiStabbing += 2; + } + else + { + kunaiStabbing++; + } + if (kunaiStabbing >= 20) + { + kunaiStabbing = 0; + float startOffsetX = Main.rand.NextFloat(100f, 200f) * (Main.rand.NextBool() ? -1f : 1f); + float startOffsetY = Main.rand.NextFloat(100f, 200f) * (Main.rand.NextBool() ? -1f : 1f); + Vector2 startPos = new Vector2(projectile.position.X + startOffsetX, projectile.position.Y + startOffsetY); + float dx = projectile.position.X - startPos.X; + float dy = projectile.position.Y - startPos.Y; + + // Add some randomness / inaccuracy + dx += Main.rand.NextFloat(-5f, 5f); + dy += Main.rand.NextFloat(-5f, 5f); + float speed = Main.rand.NextFloat(20f, 25f); + float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); + dist = speed / dist; + dx *= dist; + dy *= dist; + Vector2 kunaiSp = new Vector2(dx, dy); + float angle = Main.rand.NextFloat(MathHelper.TwoPi); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 3; i++) + { + int idx = Projectile.NewProjectile(startPos, kunaiSp, ModContent.ProjectileType(), projectile.damage, 1f, projectile.owner, 0f, 0f); + Main.projectile[idx].rotation = angle; + } + } + } + int num988 = 15; + bool flag54 = false; + bool flag55 = false; + float[] var_2_2CB4E_cp_0 = projectile.localAI; + int var_2_2CB4E_cp_1 = 0; + float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1]; + var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + } + else + { + projectile.rotation += 0.2f * (float)projectile.direction; + float pcx = projectile.Center.X; + float pcy = projectile.Center.Y; + float var1 = 800f; + bool flag = false; + for (int npcvar = 0; npcvar < 200; npcvar++) + { + if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1)) + { + float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2); + float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2); + float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3); + if (var4 < var1) + { + var1 = var4; + pcx = var2; + pcy = var3; + flag = true; + } + } + } + if (flag) + { + float homingstrenght = (projectile.Calamity().stealthStrike ? 14f : 7f); + Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float var6 = pcx - vector1.X; + float var7 = pcy - vector1.Y; + float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7); + var8 = homingstrenght / var8; + var6 *= var8; + var7 *= var8; + projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f; + } + } + + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.killSpikyBalls == true) + { + projectile.active = false; + projectile.netUpdate = true; + } + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + int num28 = 10; + Point[] array2 = new Point[num28]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + } +} diff --git a/Projectiles/Rogue/GodsParanoiaProj.png b/Projectiles/Rogue/GodsParanoiaProj.png new file mode 100644 index 0000000000000000000000000000000000000000..ea832bffbc801878652f43d14333593d9823d6c6 GIT binary patch literal 485 zcmV3NJv6KcPb=;29aD_qoD>f zD1vtX0)q@13W6FM0+*7wL(p)^mOCiia0tmeT~sRZg2lb|HXL8`6-VFSat^=eob!Bn z&UsE`SL3DWbeh6j*G7D1DfziQ0Ts{k~9WQ~qXNJIq>eHMEdxgx6 z?bQT^)Q;3LT#e5~`4E0;eobJpbnnmwlQUD`ex(Y2R07d_xemTr2ffX~oN9Q`n0>MgKK={AD8eP@T?)@E^#_Ye;;g+=2iA01|XXSad~LNk%$Pa%p95 bbYXO9Z*BlFgjnqF00000NkvXXu0mjf`M2O@ literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/TotalityFlask.cs b/Projectiles/Rogue/TotalityFlask.cs index 1c2dfdd49b..d370bb1eee 100644 --- a/Projectiles/Rogue/TotalityFlask.cs +++ b/Projectiles/Rogue/TotalityFlask.cs @@ -24,6 +24,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.aiStyle = 68; projectile.timeLeft = 180; projectile.Calamity().rogue = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; } public override void AI() From e5d723fb0304da696b7816cea1515d8cf3fa3413 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 Nov 2019 23:49:00 -0500 Subject: [PATCH 06/10] bol classification --- CalamityMod.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/CalamityMod.cs b/CalamityMod.cs index 717fb2ed9c..317f574198 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1782,6 +1782,7 @@ namespace CalamityMod spikyBallList = new List() //There's more to come { + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType() }; From b423b8764248206933fe9e75ec9f1334e340ba7d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 26 Nov 2019 09:31:44 -0500 Subject: [PATCH 07/10] added profaned partisan + bug fixes --- CalamityMod.cs | 1 + Items/Weapons/Rogue/ProfanedPartisan.cs | 71 +++++++++++ Items/Weapons/Rogue/ProfanedPartisan.png | Bin 0 -> 1185 bytes NPCs/CalamityGlobalNPC.cs | 2 +- Projectiles/Rogue/GodsParanoiaProj.cs | 15 +-- Projectiles/Rogue/LuminousStrikerProj.cs | 2 +- Projectiles/Rogue/PartisanExplosion.cs | 47 ++++++++ Projectiles/Rogue/PartisanExplosion.png | Bin 0 -> 423 bytes Projectiles/Rogue/ProfanedPartisanproj.cs | 113 ++++++++++++++++++ Projectiles/Rogue/ProfanedPartisanproj.png | Bin 0 -> 1185 bytes Projectiles/Rogue/ProfanedPartisanspear.cs | 124 ++++++++++++++++++++ Projectiles/Rogue/ProfanedPartisanspear.png | Bin 0 -> 707 bytes 12 files changed, 359 insertions(+), 16 deletions(-) create mode 100644 Items/Weapons/Rogue/ProfanedPartisan.cs create mode 100644 Items/Weapons/Rogue/ProfanedPartisan.png create mode 100644 Projectiles/Rogue/PartisanExplosion.cs create mode 100644 Projectiles/Rogue/PartisanExplosion.png create mode 100644 Projectiles/Rogue/ProfanedPartisanproj.cs create mode 100644 Projectiles/Rogue/ProfanedPartisanproj.png create mode 100644 Projectiles/Rogue/ProfanedPartisanspear.cs create mode 100644 Projectiles/Rogue/ProfanedPartisanspear.png diff --git a/CalamityMod.cs b/CalamityMod.cs index 317f574198..6d8529d01f 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1738,6 +1738,7 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType() }; daggerList = new List() diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs new file mode 100644 index 0000000000..ddbd1ad856 --- /dev/null +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -0,0 +1,71 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + + +namespace CalamityMod.Items.Weapons.Rogue +{ + //TODO -- Add a proper tooltip and balance the weapon, set Stealth Strike to true and what not + //(aka add a shoot method cuz it doesnt have it [holy shit this is so bad and outdated]) + public class ProfanedPartisan : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Profaned Partisan"); + Tooltip.SetDefault(@"Fires an unholy spear that explodes on death +Stealth strikes spawn smaller spears to fly along side it"); + } + + public override void SafeSetDefaults() + { + item.damage = 1500; + item.knockBack = 8f; + item.crit += 15; + + item.width = 56; + item.height = 56; + item.useStyle = 1; + item.noMelee = true; + item.noUseGraphic = true; + + item.value = Item.buyPrice(1, 40, 0, 0); + item.useTime = 15; + item.useAnimation = 15; + item.UseSound = SoundID.Item1; + item.rare = 10; + item.Calamity().postMoonLordRarity = 13; + item.Calamity().rogue = true; + + item.autoReuse = true; + item.shootSpeed = 6f; + item.shoot = ModContent.ProjectileType(); + } + + 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.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + + public override void AddRecipes() + { + + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 200); + recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType (), 25); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/ProfanedPartisan.png b/Items/Weapons/Rogue/ProfanedPartisan.png new file mode 100644 index 0000000000000000000000000000000000000000..defd077056f52f6e60325dc83037c2d12b8f076c GIT binary patch literal 1185 zcmV;S1YY}zP)Qy-+U<>Wy1sykIjCf|1M+47!BDoRBmUhGb-nkH)o;ZEPK*Y&OS> zw-4Pp>(^>o%jx;wou2nR=RN)P|9rGnJf+&-wX!W0^)@K3a4wf!JJPM zvwBbi=GMOpXFmnv-n)5OduZK@D^2UV=7Q032=~0$_Ke?|*H^_5^d5MH^yXn~FvafY0A)0pg?v zVpBq3WE6ng5A=63?MHtApsnj90Hcwp0=RKEXe7Cn0vHaS%V=M=Cz!PdC2Ll=bco6_ zJq0i`1H{Qm_WbtZB><}3OBBH74cmd)*-=ZT5OVbCvOU49-=)WOFP1f>-o5(5CIEi@ z^C}Sc+MIh-KrpEX)73d4=k-)6fLkMDz`|w6OjSGtt)5%z*1wq#hbI%(IaN}k$&HQc zbp=LFWPgG}uAycH0E3}>DLp4DlscDAMM2Osk69;inF^*CJ) 0) { npc.lifeMax = (int)(npc.lifeMax * 3.5); npc.damage += 100; diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 45a9dd9594..b3896de0ed 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -84,7 +84,6 @@ namespace CalamityMod.Projectiles.Rogue } } int num988 = 15; - bool flag54 = false; bool flag55 = false; float[] var_2_2CB4E_cp_0 = projectile.localAI; int var_2_2CB4E_cp_1 = 0; @@ -95,15 +94,7 @@ namespace CalamityMod.Projectiles.Rogue flag55 = true; } int num989 = (int)projectile.ai[1]; - if (projectile.localAI[0] >= (float)(60 * num988)) - { - flag54 = true; - } - else if (num989 < 0 || num989 >= 200) - { - flag54 = true; - } - else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + if ((projectile.localAI[0] <= (float)(60 * num988)) && (num989 > 0 || num989 <= 200) && Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) { projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; projectile.gfxOffY = Main.npc[num989].gfxOffY; @@ -112,10 +103,6 @@ namespace CalamityMod.Projectiles.Rogue Main.npc[num989].HitEffect(0, 1.0); } } - else - { - flag54 = true; - } } else { diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 5b427df7a4..1662b770df 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Rogue } speed.Normalize(); speed *= ((float)Main.rand.Next(30, 61) * 0.1f) * 2f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, mod.ProjectileType("LuminousShard"), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Rogue/PartisanExplosion.cs b/Projectiles/Rogue/PartisanExplosion.cs new file mode 100644 index 0000000000..051b40897f --- /dev/null +++ b/Projectiles/Rogue/PartisanExplosion.cs @@ -0,0 +1,47 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + //TODO -- Make the dust from the explosion not look like ass, reduce timeleft if neccesary + public class PartisanExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Profaned Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 100; + projectile.height = 100; + projectile.Calamity().rogue = true; + projectile.friendly = true; + projectile.timeLeft = 10; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + + public override void AI() + { + for (int i = 0; i < 7; i++) + { + float speedx = Main.rand.NextFloat(-0.9f, 0.9f); + float speedy = Main.rand.NextFloat(-0.9f, 0.9f); + int d = Dust.NewDust(projectile.position, 33, 33, 244, speedx, speedy, 120, default(Color), 2.6f); + Main.dust[d].position = projectile.Center; + } + } + } +} diff --git a/Projectiles/Rogue/PartisanExplosion.png b/Projectiles/Rogue/PartisanExplosion.png new file mode 100644 index 0000000000000000000000000000000000000000..73557dc73066ac4ad0ebf0ae0dfde4afad828438 GIT binary patch literal 423 zcmeAS@N?(olHy`uVBq!ia0vp^3qY8I4M=vMPuB%fY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPgflb}j)c(cpNIEes5dCY~;iAr-gYUNRJ9VBk1naA5!Q zbSGwSrG?l1f3SR(qzs;}elF{r5}E*QYiO 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + //Rotating 45 degrees if shooting right + if (projectile.spriteDirection == 1) + { + projectile.rotation += MathHelper.ToRadians(45f); + drawOffsetX = -26; + drawOriginOffsetX = 13; + drawOriginOffsetY = 2; + } + //Rotating 45 degrees if shooting right + if (projectile.spriteDirection == -1) + { + projectile.rotation -= MathHelper.ToRadians(45f); + drawOffsetX = 2; + drawOriginOffsetX = -13; + drawOriginOffsetY = 2; + } + + if (Main.rand.Next(3) == 0) + { + int d = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, projectile.velocity.X, projectile.velocity.Y, 100, default(Color), 1.1f); + Main.dust[d].position = projectile.Center; + Main.dust[d].velocity *= 0.3f; + Main.dust[d].velocity += projectile.velocity * 0.85f; + } + Lighting.AddLight(projectile.Center, 1f, 0.8f, 0.2f); + + if (projectile.Calamity().stealthStrike) //Stealth strike + { + Vector2 spearposition = new Vector2(projectile.Center.X + Main.rand.NextFloat(-15f, 15f), projectile.Center.Y + Main.rand.NextFloat(-15f, 15f)); + Vector2 spearspeed = new Vector2(projectile.velocity.X, projectile.velocity.Y); + stealthStrikeTimer++; + if (stealthStrikeTimer >= 18) + { + Projectile.NewProjectile(spearposition, spearspeed, ModContent.ProjectileType(), projectile.damage/2, projectile.knockBack, projectile.owner, 0f, 0f); + stealthStrikeTimer = 0; + } + } + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 20; i++) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 2.6f); + } + Main.PlaySound(2, projectile.position, 45); + Vector2 explode = new Vector2(0f, 0f); + Projectile.NewProjectile(projectile.Center, explode, ModContent.ProjectileType(), projectile.damage, projectile.knockBack * 1.3f, projectile.owner); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + } +} diff --git a/Projectiles/Rogue/ProfanedPartisanproj.png b/Projectiles/Rogue/ProfanedPartisanproj.png new file mode 100644 index 0000000000000000000000000000000000000000..defd077056f52f6e60325dc83037c2d12b8f076c GIT binary patch literal 1185 zcmV;S1YY}zP)Qy-+U<>Wy1sykIjCf|1M+47!BDoRBmUhGb-nkH)o;ZEPK*Y&OS> zw-4Pp>(^>o%jx;wou2nR=RN)P|9rGnJf+&-wX!W0^)@K3a4wf!JJPM zvwBbi=GMOpXFmnv-n)5OduZK@D^2UV=7Q032=~0$_Ke?|*H^_5^d5MH^yXn~FvafY0A)0pg?v zVpBq3WE6ng5A=63?MHtApsnj90Hcwp0=RKEXe7Cn0vHaS%V=M=Cz!PdC2Ll=bco6_ zJq0i`1H{Qm_WbtZB><}3OBBH74cmd)*-=ZT5OVbCvOU49-=)WOFP1f>-o5(5CIEi@ z^C}Sc+MIh-KrpEX)73d4=k-)6fLkMDz`|w6OjSGtt)5%z*1wq#hbI%(IaN}k$&HQc zbp=LFWPgG}uAycH0E3}>DLp4DlscDAMM2Osk69;inF^*CJ) 280) + projectile.timeLeft = 280; + } + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + if (projectile.ai[1] != 1f) + { + projectile.velocity.X = -projectile.velocity.X; + projectile.velocity.Y = -projectile.velocity.Y; + projectile.ai[1] = 1f; + projectile.ai[0] = 1f; + projectile.extraUpdates = 2; + if (projectile.timeLeft > 280) + projectile.timeLeft = 280; + } + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + if (projectile.ai[0] == 1f) + timer++; + if (timer >= 5) + projectile.penetrate = 1; + float pcx = projectile.Center.X; + float pcy = projectile.Center.Y; + if (timer >= 10) + { + float var1 = 800f; + bool flag = false; + for (int npcvar = 0; npcvar < 200; npcvar++) + { + if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1)) + { + float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2); + float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2); + float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3); + if (var4 < var1) + { + var1 = var4; + pcx = var2; + pcy = var3; + flag = true; + } + } + } + if (flag) + { + float homingstrenght = 7f; + Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float var6 = pcx - vector1.X; + float var7 = pcy - vector1.Y; + float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7); + var8 = homingstrenght / var8; + var6 *= var8; + var7 *= var8; + projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D tex = Main.projectileTexture[projectile.type]; + spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Rogue/ProfanedPartisanspear.png b/Projectiles/Rogue/ProfanedPartisanspear.png new file mode 100644 index 0000000000000000000000000000000000000000..ba106c5d7880468c37fc1d1e5658c72a4e995529 GIT binary patch literal 707 zcmV;!0zCbRP)`vxd0((Zp0M{s-PE223oZ zjoK~%@#KUC*xrjNfJkV|kmhGi#H$7T_8YZbW#fY-9v2PcR5U=T&;%fRKV>|w-gZcZ zJoL5%K*0@@++GGJx zlZOB}l1b@)ZBw^SE4$VJ;ry%yXsxZg8QSv#B=*$jYN4qCa!(#Q+C~#Q0Ib(Lj@GMB zUmO3KsCi(|3%)9ZEPZpz(Ne5g?>KA8Q2a}UP2HbKpuNKB4V}$zK(A+bGwNz-O?t%m z)N!EKJA&7^kJKTluC$!DF63vgg_Y}X;t9IDsg=h!G{DJolM3L}{7V2fp4|l?cIFrW z;m{99^S*uzK&{dS;OnP$@ER-oOF-Z3OC-%zrnCG*twnlu?!?PF_$e*cH?4h1yHon- zwq#@uveQ{?2ouC>_KSz|J0TNI9c{g&qa$8>^BI85`LOnEDgMKTPb{R;8-9niL%O`Q zH5%f7*75S9AsX9Jj>b#n?*PQ36AGZwG~ayl#qw~7|I%3Ma^cZs->j}&JgP0Z_S+vm zvDilam)trUx7vHAZzm3W{YFgeV@?%3D83))JW^tL>jSG`XvBX2Ou*?TZZY~N0000I pbVXQnMOaBjI!|(GWo~p~bZKvH05ODE?C$^o002ovPDHLkV1k4bQC Date: Tue, 26 Nov 2019 09:43:45 -0500 Subject: [PATCH 08/10] made shit obtainable/penumbra changes --- CalPlayer/CalamityPlayer.cs | 2 +- Items/Armor/UmbraphileBoots.cs | 4 ++-- Items/Armor/UmbraphileHood.cs | 1 + Items/Armor/UmbraphileRegalia.cs | 4 ++-- Items/Potions/PenumbraPotion.cs | 4 ++-- Items/Weapons/Rogue/TotalityBreakers.cs | 4 ++-- NPCs/Crags/Scryllar.cs | 2 +- NPCs/Crags/ScryllarRage.cs | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4f9471fcdb..0c3bab0409 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -10991,7 +10991,7 @@ namespace CalamityMod.CalPlayer // Penumbra Potion provides 10% stealth regen while moving, 20% at night and 30% during an eclipse if (penumbra) { - if (Main.eclipse) + if (Main.eclipse || umbraphileSet) stealthGenMoving += 0.3f; else if (!Main.dayTime) stealthGenMoving += 0.2f; diff --git a/Items/Armor/UmbraphileBoots.cs b/Items/Armor/UmbraphileBoots.cs index ae41c31220..85b691ee5d 100644 --- a/Items/Armor/UmbraphileBoots.cs +++ b/Items/Armor/UmbraphileBoots.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Armor player.Calamity().throwingCrit += 6; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 14); @@ -40,6 +40,6 @@ namespace CalamityMod.Items.Armor recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } diff --git a/Items/Armor/UmbraphileHood.cs b/Items/Armor/UmbraphileHood.cs index 487b149322..53da9fde5e 100644 --- a/Items/Armor/UmbraphileHood.cs +++ b/Items/Armor/UmbraphileHood.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Items.Armor modPlayer.rogueStealthMax += 1.15f; player.setBonus = "Rogue weapons have a chance to create explosions on hit\n" + "Stealth strikes always create an explosion\n" + + "Penumbra potions always build stealth at max effectiveness\n" + "Rogue stealth builds while not attacking and not moving, up to a max of 115\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + diff --git a/Items/Armor/UmbraphileRegalia.cs b/Items/Armor/UmbraphileRegalia.cs index ea973e1551..c8545e1b95 100644 --- a/Items/Armor/UmbraphileRegalia.cs +++ b/Items/Armor/UmbraphileRegalia.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor player.Calamity().throwingCrit += 10; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 18); @@ -37,6 +37,6 @@ namespace CalamityMod.Items.Armor recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } diff --git a/Items/Potions/PenumbraPotion.cs b/Items/Potions/PenumbraPotion.cs index 351bab149d..5c39f016fa 100644 --- a/Items/Potions/PenumbraPotion.cs +++ b/Items/Potions/PenumbraPotion.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Potions { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); - recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ItemID.LunarTabletFragment, 2); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Potions recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); recipe.AddIngredient(ModContent.ItemType(), 30); - recipe.AddIngredient(ItemID.LunarTabletFragment); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index 1dc9f814de..648507d2d6 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -48,7 +48,7 @@ Stealth strikes leak tar as they fly"); return true; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.MolotovCocktail, 50); @@ -58,6 +58,6 @@ Stealth strikes leak tar as they fly"); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 089d7d5475..0df4b4c2f4 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -269,7 +269,7 @@ namespace CalamityMod.NPCs.Crags { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); } - //DropHelper.DropItemChance(npc, ModContent.ItemType(), CalamityWorld.defiled ? 0.05f : 0.02f); + DropHelper.DropItemChance(npc, ModContent.ItemType(), CalamityWorld.defiled ? 0.05f : 0.02f); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 9f553390ae..2b1bc4e56b 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -269,7 +269,7 @@ namespace CalamityMod.NPCs.Crags { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); } - //DropHelper.DropItemChance(npc, ModContent.ItemType(), CalamityWorld.defiled ? 0.05f : 0.02f); + DropHelper.DropItemChance(npc, ModContent.ItemType(), CalamityWorld.defiled ? 0.05f : 0.02f); } public override void HitEffect(int hitDirection, double damage) From 476bf516392861ce08d6857b8917bab763f4765a Mon Sep 17 00:00:00 2001 From: Tymon Date: Tue, 26 Nov 2019 17:18:01 +0100 Subject: [PATCH 09/10] Heart bug fix --- CalPlayer/CalamityPlayer.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0c3bab0409..774b397423 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -10457,7 +10457,8 @@ namespace CalamityMod.CalPlayer player.armorEffectDrawShadow = false; player.armorEffectDrawShadowSubtle = false; } - if (CalamityWorld.ironHeart && !Main.gameMenu) + + if (CalamityWorld.ironHeart && !Main.gameMenu) { Texture2D ironHeart = ModContent.GetTexture("CalamityMod/ExtraTextures/IronHeart"); Main.heartTexture = Main.heart2Texture = ironHeart; @@ -10468,37 +10469,35 @@ namespace CalamityMod.CalPlayer Texture2D heart4 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart4"); Texture2D heart5 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart5"); Texture2D heart6 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart6"); - Texture2D heartOriginal = ModContent.GetTexture("CalamityMod/ExtraTextures/HeartOriginal"); //Life fruit - Texture2D heartOriginal2 = ModContent.GetTexture("CalamityMod/ExtraTextures/HeartOriginal2"); //Life crystal + Texture2D heartOriginal = ModContent.GetTexture("Terraria/Heart2"); //Life fruit + Texture2D heartOriginal2 = ModContent.GetTexture("Terraria/Heart"); //Life crystal int totalFruit = (mFruit ? 1 : 0) + (bOrange ? 1 : 0) + (eBerry ? 1 : 0) + (dFruit ? 1 : 0); + switch (totalFruit) { default: Main.heart2Texture = heartOriginal; - Main.heartTexture = heartOriginal2; break; case 4: Main.heart2Texture = heart6; - Main.heartTexture = heartOriginal2; break; case 3: Main.heart2Texture = heart5; - Main.heartTexture = heartOriginal2; break; case 2: Main.heart2Texture = heart4; - Main.heartTexture = heartOriginal2; break; case 1: Main.heart2Texture = heart3; - Main.heartTexture = heartOriginal2; break; } + + Main.heartTexture = heartOriginal2; } if (revivify) { From 96dfcfb90187965af6b5975ba97d56769783ff9a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 26 Nov 2019 11:32:54 -0500 Subject: [PATCH 10/10] dynamo stem cells and rarity fixes --- CalPlayer/CalamityPlayer.cs | 2 + Items/Accessories/DynamoStemCells.cs | 34 +++++++++ Items/Accessories/DynamoStemCells.png | Bin 0 -> 1128 bytes Items/CalamityGlobalItem.cs | 10 +++ Items/Materials/DepthCells.cs | 4 +- Items/Materials/Ectoblood.cs | 2 +- Items/Materials/Lumenite.cs | 4 +- Items/Materials/SolarVeil.cs | 4 +- Items/TreasureBags/BumblebirbBag.cs | 2 + Projectiles/Ranged/Minibirb.cs | 95 ++++++++++++++++++++++++++ Projectiles/Ranged/Minibirb.png | Bin 0 -> 3181 bytes 11 files changed, 150 insertions(+), 7 deletions(-) create mode 100644 Items/Accessories/DynamoStemCells.cs create mode 100644 Items/Accessories/DynamoStemCells.png create mode 100644 Projectiles/Ranged/Minibirb.cs create mode 100644 Projectiles/Ranged/Minibirb.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0c3bab0409..5efe2e5cf6 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -368,6 +368,7 @@ namespace CalamityMod.CalPlayer public bool oldDie = false; public bool ursaSergeant = false; public bool thiefsDime = false; + public bool dynamoStemCells = false; //public bool dukeScales = false; public bool sandWaifu = false; public bool sandBoobWaifu = false; @@ -1065,6 +1066,7 @@ namespace CalamityMod.CalPlayer oldDie = false; ursaSergeant = false; thiefsDime = false; + dynamoStemCells = false; //dukeScales = false; daedalusReflect = false; diff --git a/Items/Accessories/DynamoStemCells.cs b/Items/Accessories/DynamoStemCells.cs new file mode 100644 index 0000000000..32eadb71c3 --- /dev/null +++ b/Items/Accessories/DynamoStemCells.cs @@ -0,0 +1,34 @@ +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; +using CalamityMod.CalPlayer; + +namespace CalamityMod.Items.Accessories +{ + public class DynamoStemCells : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dynamo Stem Cells"); + Tooltip.SetDefault(@"15% increased movement speed +Ranged weapons have a chance to fire miniature birbs"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(4, 4)); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.value = Item.buyPrice(0, 60, 0, 0); + item.accessory = true; + item.expert = true; + item.rare = 10; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().dynamoStemCells = true; + player.moveSpeed += 0.15f; + } + } +} diff --git a/Items/Accessories/DynamoStemCells.png b/Items/Accessories/DynamoStemCells.png new file mode 100644 index 0000000000000000000000000000000000000000..656d88f962d333a1e4ba1f7f0c9d4103b5999b6f GIT binary patch literal 1128 zcmV-u1eg1XP)Px(B1uF+RCt{2n@?yJR}{v7^ZFWFqhbv45Bd;-w2DNE7@_qcM!GNESU0Y8(`9IB zx7ivL7hSmNt}d*b;;x0#6iF2lDFqQlBvoQ*O_WG9(nkBHi~GJe&duCRTWDt{o^SK= zm^=5)ch5QZ-uZD85zs(a4S+^#Jpj|SNAZi-KX|?ufG_JmrtWLB)<^C309;#aW%geS z{qTRSNX~riXmtZ{yS5NR;;`9zp4oo9RtJ(1=!@4x0JG7P%=U#kj+blj+2S4m2H)QV zK-a;I0Q@j~E!9qrB|rAQ3Ul0f%ukNKle+Nz_;2oyDfc0#irOCU`faFQX@BHpQKe~}>*KB`wV(Z0R_p86b?XRY;7njw;`?mw| z?N8G&z=e^)RD&ZUlR#3(!|(M1OJjcK;zJivP4=ir9} znH^m^o33Ncd=vMkGTRq7b7|c?{O21nB& zlavF>;!Qo>5y1Vqh0ONFWp!xZ%gj6gYgfG%0ZiPRiUH1klXmQ{vyz;aZ(p6);DsDW zWxc;gQxNr*w9~p5m)d&z+g+i*1W9^eA zjlkFy_kF|b?k$tW$IJFp{yJ{-^#QPD)!G=KyOEy37N%Wx|1v)p0et-+o$bEL8)Mbu zh9^$}n3$afV5seQ?26lOzq!r5A#7dO<8Cag0H7Nddu@n1ciDB_`bspK1GoN9K`iKHGzq${s zD6-eiUS+rVmYhnZC3|&|w$byKJ+kMXbhKTUs$)s~TCJCmy`9>ByX)GO8rl2bWn`}- zBYQ^njO-cNGqUHaJbSJ@8QC+kXJjv=^2XT69!B=6rk9WG)$_^TqZHZGxh<(V+>1fJvS(z^$X-y@acpGI$exkCkjfil$;e)1 zWn`}-BYQr{tL%T{8rchyJzqZA6YrXApWRzIWKYf{5k1Mso{_!6>)6Pikv$`OM)r*C u8QBY}I*yI(8QC+k7gBj+EE(CWto{P&4F= 80) + { + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(position.X, position.Y, speedX * 1.25f, speedY * 1.25f, ModContent.ProjectileType(), (int)((double)damage * 2), 2f, player.whoAmI, 0f, 0f); + } + } + } return true; } #endregion diff --git a/Items/Materials/DepthCells.cs b/Items/Materials/DepthCells.cs index c691e4e86e..99883c849a 100644 --- a/Items/Materials/DepthCells.cs +++ b/Items/Materials/DepthCells.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Materials item.width = 26; item.height = 26; item.maxStack = 999; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 3; + item.value = Item.sellPrice(silver: 80); + item.rare = 6; } } } diff --git a/Items/Materials/Ectoblood.cs b/Items/Materials/Ectoblood.cs index d4c7665ac7..b97a4eeb68 100644 --- a/Items/Materials/Ectoblood.cs +++ b/Items/Materials/Ectoblood.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Materials item.height = 32; item.maxStack = 999; item.value = Item.sellPrice(silver: 16); - item.rare = 8; + item.rare = 7; } } } diff --git a/Items/Materials/Lumenite.cs b/Items/Materials/Lumenite.cs index 59398bad8b..f2d646d97b 100644 --- a/Items/Materials/Lumenite.cs +++ b/Items/Materials/Lumenite.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Materials item.width = 26; item.height = 26; item.maxStack = 999; - item.value = Item.sellPrice(silver: 36); - item.rare = 3; + item.value = Item.sellPrice(silver: 80); + item.rare = 6; } } } diff --git a/Items/Materials/SolarVeil.cs b/Items/Materials/SolarVeil.cs index c605f053a3..73c0f18375 100644 --- a/Items/Materials/SolarVeil.cs +++ b/Items/Materials/SolarVeil.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Materials item.width = 26; item.height = 26; item.maxStack = 999; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 3; + item.value = Item.sellPrice(silver: 80); + item.rare = 6; } } } diff --git a/Items/TreasureBags/BumblebirbBag.cs b/Items/TreasureBags/BumblebirbBag.cs index 5c940ca6f8..cdffbaeb33 100644 --- a/Items/TreasureBags/BumblebirbBag.cs +++ b/Items/TreasureBags/BumblebirbBag.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Accessories; using CalamityMod.NPCs.Bumblebirb; using CalamityMod.World; using Terraria; @@ -47,6 +48,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); } } diff --git a/Projectiles/Ranged/Minibirb.cs b/Projectiles/Ranged/Minibirb.cs new file mode 100644 index 0000000000..636f3edb17 --- /dev/null +++ b/Projectiles/Ranged/Minibirb.cs @@ -0,0 +1,95 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class Minibirb : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Minibirb"); + Main.projFrames[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.light = 0.25f; + projectile.extraUpdates = 1; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 51, 1f, 0f); + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 51, 1f, 0f); + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 1) + { + projectile.frame = 0; + } + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? MathHelper.Pi : 0f); + + float pcx = projectile.Center.X; + float pcy = projectile.Center.Y; + float var1 = 800f; + bool flag = false; + for (int npcvar = 0; npcvar < 200; npcvar++) + { + if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1)) + { + float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2); + float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2); + float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3); + if (var4 < var1) + { + var1 = var4; + pcx = var2; + pcy = var3; + flag = true; + } + } + } + if (flag) + { + float homingstrenght = 10f; + Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); + float var6 = pcx - vector1.X; + float var7 = pcy - vector1.Y; + float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7); + var8 = homingstrenght / var8; + var6 *= var8; + var7 *= var8; + projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f; + } + } + } +} diff --git a/Projectiles/Ranged/Minibirb.png b/Projectiles/Ranged/Minibirb.png new file mode 100644 index 0000000000000000000000000000000000000000..274cf8ce263cef33985756da5d9913f53d61477e GIT binary patch literal 3181 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 TWftrz00000NkvXXu0mjf)S>h( literal 0 HcmV?d00001