From aebe6104f9758d7105b60d58b96ebf9825fca774 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 20 Mar 2020 12:35:37 -0400 Subject: [PATCH] axe nerf and flak babies --- Buffs/Pets/FlakPetBuff.cs | 28 +++ Buffs/Pets/FlakPetBuff.png | Bin 0 -> 674 bytes CalPlayer/CalamityPlayer.cs | 2 + CalPlayer/CalamityPlayerMiscEffects.cs | 6 +- Items/Critters/BabyFlakHermit.cs | 32 +++ Items/Critters/BabyFlakHermit.png | Bin 0 -> 617 bytes Items/Pets/GeyserShell.cs | 40 +++ Items/Pets/GeyserShell.png | Bin 0 -> 509 bytes NPCs/AcidRain/FlakBaby.cs | 31 ++- Projectiles/Pets/FlakPet.cs | 295 +++++++++++++++++++++++ Projectiles/Pets/FlakPet.png | Bin 0 -> 1312 bytes Projectiles/Summon/ElementalAxeMinion.cs | 8 +- 12 files changed, 432 insertions(+), 10 deletions(-) create mode 100644 Buffs/Pets/FlakPetBuff.cs create mode 100644 Buffs/Pets/FlakPetBuff.png create mode 100644 Items/Critters/BabyFlakHermit.cs create mode 100644 Items/Critters/BabyFlakHermit.png create mode 100644 Items/Pets/GeyserShell.cs create mode 100644 Items/Pets/GeyserShell.png create mode 100644 Projectiles/Pets/FlakPet.cs create mode 100644 Projectiles/Pets/FlakPet.png diff --git a/Buffs/Pets/FlakPetBuff.cs b/Buffs/Pets/FlakPetBuff.cs new file mode 100644 index 0000000000..e77750ff92 --- /dev/null +++ b/Buffs/Pets/FlakPetBuff.cs @@ -0,0 +1,28 @@ +using CalamityMod.Projectiles.Pets; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class FlakPetBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Flak Hermit"); + Description.SetDefault("Little acid buggy"); + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().flakPet = true; + bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); + } + } + } +} diff --git a/Buffs/Pets/FlakPetBuff.png b/Buffs/Pets/FlakPetBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..bc94958e66fc734d3689fe4689b5d49f211387f6 GIT binary patch literal 674 zcmV;T0$u%yP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00HnxL_t(o!_}8PXj4%XfWJs=Fja_V z5J^i@F)y?zR1~9whyfQ79AXx6YaN16N+C-!nNdT4}+{P>d_g|h>UTm%2vJH4q$l2Os(Yt*M`QpzN zJ$+-{3<7T5ppRVdoWifi&C6k1GV@Q4+UAp|p3gi2P9x7Jz5{UY&KUsKUVj516g=Fw zfaGzSQ|1u}_@@DA?h|a-jNd+xPe-Ams)jqbPfD#aSs|WF*Vjh1mN1K zAOQJ91?XK5{$B#}|H}xA@3sN(p71DsUA;V51LhH^H#PzAX?E-45k=QYw7#?zQutB^CeeFUr`!sC`f$>9L0GdBqL%kh` zr%s!3JN^m!H<8V=-F@#v`?*IS*07*qo IM6N<$g1eg=egFUf literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3626899b7d..7021207576 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -211,6 +211,7 @@ namespace CalamityMod.CalPlayer public bool trashMan = false; public int trashManChest = -1; public bool astrophage = false; + public bool flakPet = false; public bool babyGhostBell = false; public bool radiator = false; public bool scalPet = false; @@ -1082,6 +1083,7 @@ namespace CalamityMod.CalPlayer kendra = false; trashMan = false; astrophage = false; + flakPet = false; babyGhostBell = false; radiator = false; scalPet = false; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 5a4e494ec0..81add82dc7 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3065,7 +3065,7 @@ namespace CalamityMod.CalPlayer // Tarragon Summon set bonus life aura if (modPlayer.tarraSummon) { - const int FramesPerHit = 60; + const int FramesPerHit = 80; // Constantly increment the timer every frame. modPlayer.tarraLifeAuraTimer = (modPlayer.tarraLifeAuraTimer + 1) % FramesPerHit; @@ -3073,8 +3073,8 @@ namespace CalamityMod.CalPlayer // If the timer rolls over, it's time to deal damage. Only run this code for the client which is wearing the armor. if (modPlayer.tarraLifeAuraTimer == 0 && player.whoAmI == Main.myPlayer) { - const int BaseDamage = 200; - int damage = (int)(BaseDamage * (player.allDamage + player.minionDamage - 1f)); + const int BaseDamage = 150; + int damage = (int)(BaseDamage * player.MinionDamage()); float range = 300f; for (int i = 0; i < Main.maxNPCs; ++i) diff --git a/Items/Critters/BabyFlakHermit.cs b/Items/Critters/BabyFlakHermit.cs new file mode 100644 index 0000000000..a7a586fbca --- /dev/null +++ b/Items/Critters/BabyFlakHermit.cs @@ -0,0 +1,32 @@ +using CalamityMod.NPCs.AcidRain; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Critters +{ + public class BabyFlakHermit : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Baby Flak Crab"); + } + + public override void SetDefaults() + { + item.useStyle = 1; + item.autoReuse = true; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.maxStack = 999; + item.consumable = true; + item.noUseGraphic = true; + item.value = Item.buyPrice(0, 0, 30, 0); + //item.CloneDefaults(2004); //Lightning Bug item + item.width = 26; + item.height = 24; + item.makeNPC = (short)ModContent.NPCType(); + item.rare = 6; + } + } +} diff --git a/Items/Critters/BabyFlakHermit.png b/Items/Critters/BabyFlakHermit.png new file mode 100644 index 0000000000000000000000000000000000000000..2bd8fd3641ddfc383cfd0a1652806af732356cb8 GIT binary patch literal 617 zcmV-v0+#)WP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00Fm2L_t(Y$JLg4zjy2~krGHbgWuH?_6Z63zV!{R0h6{SnR%5e~JqMPN!Or6E`nR%Qh@ypFxA?@2+| z=sUf4?|Ju}&pqd!`wSd35sAuU!)|^gCilY{OPh>E4B2Efk78~{hh_W(>qeLr&WcLc3kSsqdcQvZeECjSb+*tpwv zKH%*GzN)YFJamshB9MqGwHMpSg=lrsv`=Pp9nXVyf~MEj-Xjr;`iDKX3nWr$Avdh# zk_-JgkjR6BUI6YMY5+{f{fgn`X;mS4zO7>=b;^Z)g4tLAfb(>v0qtE=Bt+7aMm@c@ zcCF_^e-%wcq78t(-30)qVv7J|(kF^x;d9SLLLw5PWH#4ayDJ23y=Z-F-_~#@G75Zk zRmXcFtG?>b!AjiR`+T9S{5@(); + item.buffType = ModContent.BuffType(); + item.rare = 6; + item.UseSound = SoundID.Item2; + } + + public override void UseStyle(Player player) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(item.buffType, 15, true); + } + } + } +} diff --git a/Items/Pets/GeyserShell.png b/Items/Pets/GeyserShell.png new file mode 100644 index 0000000000000000000000000000000000000000..ed760aff16ad76199451c79e69b395cdba5faa2e GIT binary patch literal 509 zcmVPx#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00B!$L_t(I%e|B_OT$1E$A6KwF(E3o zLoKx!L=n2WxQIA7_tW_e+{M|Uh_jQEC=yW-!6?>{m{y3xDVibTBJ-&>xku=%MddM7G+*zMQ=43A&5 z{nMM^pNU0>N0$J!TiXEa^cC^&>{TbX>l*2T-LL>Y^4^#yj-OI3@El&``#v!J!>)q} zfX8&AC9WXR~f*;hOc=i>!72iCX83K8@ai+GWQ~L#Ba%GX+Wl8>b3O1 z)AHhix8{j|2tBvpbslK?+5x#iz2;c}ldq_>u(|hGKIC0)d#)mj;;hQqqPND0zX7*G zb1huW-UR>v01|XXSad~LNk%$Pa%p95bYXO9Z*BlFgjnqF00000NkvXXu0mjfg#q4u literal 0 HcmV?d00001 diff --git a/NPCs/AcidRain/FlakBaby.cs b/NPCs/AcidRain/FlakBaby.cs index 84e372723d..2ceb1bf88d 100644 --- a/NPCs/AcidRain/FlakBaby.cs +++ b/NPCs/AcidRain/FlakBaby.cs @@ -1,5 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Critters; +using CalamityMod.Items.Pets; using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -15,6 +17,7 @@ namespace CalamityMod.NPCs.AcidRain { DisplayName.SetDefault("Baby Flak Crab"); Main.npcFrameCount[npc.type] = 6; + Main.npcCatchable[npc.type] = true; } public override void SetDefaults() @@ -40,7 +43,7 @@ namespace CalamityMod.NPCs.AcidRain banner = npc.type; bannerItem = ModContent.ItemType(); npc.dontTakeDamageFromHostiles = true; - //npc.catchItem = (short)ModContent.ItemType(); + npc.catchItem = (short)ModContent.ItemType(); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { @@ -49,6 +52,27 @@ namespace CalamityMod.NPCs.AcidRain } public override void AI() { + if (npc.localAI[0] == 0f) + { + if (Main.rand.NextBool(20)) + npc.catchItem = (short)ModContent.ItemType(); + npc.localAI[0] = 1f; + npc.velocity.Y = -3f; + npc.netUpdate = true; + } + if (Main.rand.NextBool(8) && npc.catchItem == (short)ModContent.ItemType()) + { + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, (int)CalamityDusts.SulfurousSeaAcid, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 200, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.1f; + Main.dust[dust].velocity.Y += 0.25f; + Main.dust[dust].noLight = true; + if (Main.rand.NextBool(2)) + { + Main.dust[dust].noGravity = false; + Main.dust[dust].scale *= 0.5f; + } + } Player closest = Main.player[Player.FindClosest(npc.Top, 0, 0)]; if (Math.Abs(closest.Center.X - npc.Center.X) > 600f) { @@ -105,7 +129,7 @@ namespace CalamityMod.NPCs.AcidRain } return 0.15f; } - /* + public override void OnCatchNPC(Player player, Item item) { try @@ -115,7 +139,8 @@ namespace CalamityMod.NPCs.AcidRain { return; } - }*/ + } + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) diff --git a/Projectiles/Pets/FlakPet.cs b/Projectiles/Pets/FlakPet.cs new file mode 100644 index 0000000000..1b3e7ce35c --- /dev/null +++ b/Projectiles/Pets/FlakPet.cs @@ -0,0 +1,295 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Pets +{ + public class FlakPet : ModProjectile + { + private int playerStill = 0; + private bool fly = false; + private int idleTimer = 0; + private bool hiding = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flak Hermit"); + Main.projFrames[projectile.type] = 7; + Main.projPet[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + projectile.tileCollide = true; + } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) + { + Player player = Main.player[projectile.owner]; + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + fallThrough = playerDistance > 200f; + return true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + if (!player.active) + { + projectile.active = false; + return; + } + CalamityPlayer modPlayer = player.Calamity(); + if (player.dead) + { + modPlayer.flakPet = false; + } + if (modPlayer.flakPet) + { + projectile.timeLeft = 2; + } + Vector2 vector46 = projectile.position; + if (!fly) + { + projectile.rotation = 0; + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2; + float playerDistance = vector48.Length(); + if (projectile.velocity.Y == 0 && (HoleBelow() || (playerDistance > 110f && projectile.position.X == projectile.oldPosition.X))) + { + projectile.velocity.Y = -5f; + } + projectile.velocity.Y += 0.20f; + if (projectile.velocity.Y > 7f) + { + projectile.velocity.Y = 7f; + } + if (playerDistance > 600f) + { + fly = true; + projectile.velocity.X = 0f; + projectile.velocity.Y = 0f; + } + if (playerDistance > 100f) + { + if (player.position.X - projectile.position.X > 0f) + { + projectile.velocity.X += 0.10f; + if (projectile.velocity.X > 7f) + { + projectile.velocity.X = 7f; + } + } + else + { + projectile.velocity.X -= 0.10f; + if (projectile.velocity.X < -7f) + { + projectile.velocity.X = -7f; + } + } + } + if (playerDistance < 100f) + { + if (projectile.velocity.X != 0f) + { + if (projectile.velocity.X > 0.5f) + { + projectile.velocity.X -= 0.15f; + } + else if (projectile.velocity.X < -0.5f) + { + projectile.velocity.X += 0.15f; + } + else if (projectile.velocity.X < 0.5f && projectile.velocity.X > -0.5f) + { + projectile.velocity.X = 0f; + } + } + } + if (projectile.position.X == projectile.oldPosition.X && projectile.position.Y == projectile.oldPosition.Y && projectile.velocity.X == 0) + { + if (!hiding) + { + idleTimer++; + projectile.frame = 2; + } + if (idleTimer > 300) + { + hiding = true; + if (projectile.frame > 0) + { + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame--; + projectile.frameCounter = 0; + } + if (projectile.frame < 0) + { + projectile.frame = 0; + } + } + } + } + else if (projectile.velocity.Y > 0.3f && projectile.position.Y != projectile.oldPosition.Y) + { + idleTimer = 0; + hiding = false; + projectile.frame = 2; + projectile.frameCounter = 0; + } + else + { + idleTimer = 0; + hiding = false; + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 5) + { + projectile.frame = 2; + } + } + } + else if (fly) + { + float num16 = 0.3f; + projectile.tileCollide = false; + Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float horiPos = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X; + float vertiPos = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y; + vertiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)Main.rand.Next(-10, 21); + horiPos += (float)(60 * -(float)player.direction); + vertiPos -= 60f; + float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + float num21 = 18f; + float num27 = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos)); + if (playerDistance > 1200f) + { + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (playerDistance < 100f) + { + num16 = 0.1f; + if (player.velocity.Y == 0f) + { + ++playerStill; + } + else + { + playerStill = 0; + } + if (playerStill > 60 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + fly = false; + projectile.tileCollide = true; + } + } + if (playerDistance < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.90f; + } + num16 = 0.01f; + } + else + { + if (playerDistance < 100f) + { + num16 = 0.1f; + } + if (playerDistance > 300f) + { + num16 = 1f; + } + playerDistance = num21 / playerDistance; + horiPos *= playerDistance; + vertiPos *= playerDistance; + } + if (projectile.velocity.X <= horiPos) + { + projectile.velocity.X = projectile.velocity.X + num16; + if (num16 > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X = projectile.velocity.X + num16; + } + } + if (projectile.velocity.X > horiPos) + { + projectile.velocity.X = projectile.velocity.X - num16; + if (num16 > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X = projectile.velocity.X - num16; + } + } + if (projectile.velocity.Y <= vertiPos) + { + projectile.velocity.Y = projectile.velocity.Y + num16; + if (num16 > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + } + } + if (projectile.velocity.Y > vertiPos) + { + projectile.velocity.Y = projectile.velocity.Y - num16; + if (num16 > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + } + } + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * projectile.direction; + projectile.frame = 6; + hiding = false; + idleTimer = 0; + } + if (projectile.velocity.X > 0.25f) + { + projectile.spriteDirection = -1; + } + else if (projectile.velocity.X < -0.25f) + { + projectile.spriteDirection = 1; + } + } + + private bool HoleBelow() //pretty much the same as the one used in mantis + { + int tileWidth = 4; + int tileX = (int)(projectile.Center.X / 16f) - tileWidth; + if (projectile.velocity.X > 0) + { + tileX += tileWidth; + } + int tileY = (int)((projectile.position.Y + projectile.height) / 16f); + for (int y = tileY; y < tileY + 2; y++) + { + for (int x = tileX; x < tileX + tileWidth; x++) + { + if (Main.tile[x, y].active()) + { + return false; + } + } + } + return true; + } + } +} diff --git a/Projectiles/Pets/FlakPet.png b/Projectiles/Pets/FlakPet.png new file mode 100644 index 0000000000000000000000000000000000000000..351c9b5a9398fed5709280a8d9e010830165e95d GIT binary patch literal 1312 zcmV+*1>gFKP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00eGHL_t(|+U=Z8ZyQwLjgMj88gqe8)3&)O#nCpBLPb6w>KIs8``_**- ze);tw09O|3FZDs?A=3KfN)3edR+PIb-I^* z|J{24Tv_@6fV-==QYUQm+e9Q}A|YH}YaV@uSE8d{_t}TD5x}3VxU#^dGiSv=d0SK=As z>HZD?&!5M+=isoNIFaa}8C-E}@+sdy&JJ3!AITH?K1Tk))J-rFCM$h`N- zAu{i+W!`&anfEsD4d%U%EA!q1DxLSv>~%tNZmb?b%6s>6uj-KhHWE1qoJy>~sq-7v zN(8Xm-A|Q!ZKKq>AtbUgW<8sb6;z+U+ue7TTRs|DmX9nSm6*u#k(TA7k!AVF@)4Z6 zd?alZu8p+v@=@v1!~oH#xk!8N^5r8@7NOL1raln?Y_>b8?ZlktmngH>)vD7Gz+QK& z2l=@vFMR}QqtyDb*WF5$=OsW*7L3U9k>#Tj5@}gJ3QuJDNM!lw)e%`fvV0^8?^H#3 z`AEx=m%_D?jO0{K(lvkl*K#2eoih9p<)r|T5W==|e-?@N+52dQEt->tT_dUTcm{HE zQkF{d+ZM}5mXAtEq-FUiJdx!ik>#UTM`ZcP@{#D|;PuC(!Z;H}Uo3{lYoM<6E% zk;&v=nd9iV<3=mI_nw`O{ab5mx6s?r+H-5daNb)aB;r`JlAd^R{r&>My?0)lh$Gd% z9uVRim*c;ZleEIQAjiF)LKl+rvXWnT@0~}YeV#bftmGG-C{NnwNpGA}DP9zgsG|~{ zsOURgSqh(z^ti~AP7|dVM-jkey(%QBnIh|#QnFvSZLoVmxp%j8&9!tJmgo7Ag9u37 z?Q*VDQ8)1LZWR5<;(Bg8%>k5_CmabVXQ6MmkS&X=QG7VRUJ4 WZU8ZaSnTfr0000();