From 336828faaba120b0ce9ac2b7ec07edfa5e0f1dd0 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 22 Jan 2020 15:39:51 -0500 Subject: [PATCH 1/4] rewrote frozen lungs code --- CalPlayer/CalamityPlayerMiscEffects.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index e4301bf1cf..932162dbcb 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -297,7 +297,8 @@ namespace CalamityMod.CalPlayer player.buffImmune[BuffID.Electrified] = true; // Reduce breath meter while in icy water instead of chilling - if (player.arcticDivingGear) + bool canBreath = ((modPlayer.sirenBoobs && NPC.downedBoss3) || (modPlayer.sirenBoobsAlt && NPC.downedBoss3) || player.gills || player.merman); + if (player.arcticDivingGear || canBreath) { player.buffImmune[ModContent.BuffType()] = true; } @@ -308,7 +309,7 @@ namespace CalamityMod.CalPlayer player.buffImmune[BuffID.Chilled] = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { - if (Main.myPlayer == player.whoAmI && !player.gills && !player.merman) + if (Main.myPlayer == player.whoAmI) { player.AddBuff(ModContent.BuffType(), 2, false); } From c93ae31fc1fd5de784267f40c20f4e8116d5c8d9 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 22 Jan 2020 15:40:06 -0500 Subject: [PATCH 2/4] ele axe uses idstatic i frames --- Projectiles/Summon/ElementalAxeMinion.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index e8a29c54ae..00d3c6afe2 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; projectile.tileCollide = false; projectile.extraUpdates = 1; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 4; } public override void AI() @@ -260,7 +262,6 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.immune[projectile.owner] = 4; target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); From 9ff91acb344f9de692402d795994773a6dd5878f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 22 Jan 2020 16:15:19 -0500 Subject: [PATCH 3/4] guidelight of oblivion resprites --- CalPlayer/CalamityPlayer.cs | 46 +++++++++++----------- Items/Weapons/Summon/LanternoftheSoul.cs | 3 +- Items/Weapons/Summon/LanternoftheSoul.png | Bin 1296 -> 1174 bytes Projectiles/Summon/LanternFlame.cs | 21 ++++++---- Projectiles/Summon/LanternFlame.png | Bin 997 -> 822 bytes Projectiles/Summon/LanternSoul.cs | 20 ++++++++-- Projectiles/Summon/LanternSoul.png | Bin 558 -> 2188 bytes 7 files changed, 55 insertions(+), 35 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8133b175a2..cbe86a8e08 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6601,6 +6601,29 @@ namespace CalamityMod.CalPlayer } player.DropTombstone(coinsOwned, deathText, 0); } + else if (CalamityWorld.death && deathModeBlizzardTime > 1980) + { + deathModeBlizzardTime = 0; + PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was chilled to the bone by the frigid environment."); + NetworkText deathText = damageSource.GetDeathText(player.name); + if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) + { + NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); + } + if (Main.netMode == NetmodeID.Server) + { + NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); + } + else if (Main.netMode == NetmodeID.SinglePlayer) + { + Main.NewText(deathText.ToString(), 225, 25, 25, false); + } + if (player.whoAmI == Main.myPlayer && player.difficulty == 0) + { + player.DropCoins(); + } + player.DropTombstone(coinsOwned, deathText, 0); + } else if (SCalLore) { PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.Male ? player.name + " was consumed by his inner hatred." : player.name + " was consumed by her inner hatred."); @@ -6667,29 +6690,6 @@ namespace CalamityMod.CalPlayer } player.DropTombstone(coinsOwned, deathText, 0); } - else if (CalamityWorld.death && deathModeBlizzardTime > 1980) - { - deathModeBlizzardTime = 0; - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was chilled to the bone by the frigid environment."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); - } else { PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); diff --git a/Items/Weapons/Summon/LanternoftheSoul.cs b/Items/Weapons/Summon/LanternoftheSoul.cs index cba56d8f19..812ea0b3e1 100644 --- a/Items/Weapons/Summon/LanternoftheSoul.cs +++ b/Items/Weapons/Summon/LanternoftheSoul.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Guidelight of Oblivion"); - Tooltip.SetDefault("Summons a lantern turret to fight for you"); + Tooltip.SetDefault("Shadows dream of endless fire, flames devour and embers swoop\n" + + "Summons a lantern turret to fight for you"); } public override void SetDefaults() diff --git a/Items/Weapons/Summon/LanternoftheSoul.png b/Items/Weapons/Summon/LanternoftheSoul.png index 2f2f239a4b6074bc340a988a8d17224106c3b861..14f434d0b6571afa443d96e66365989bcf826847 100644 GIT binary patch literal 1174 zcmV;H1Zn$;P)Px(P)S5VRA_P&6 zhDHAXUGNJk7HmLBT~r{o3zk%>Ds>l-C~8q#VJTU-&Bbw?#J6EF^V*yfPwX^_&CKN4 zBy%4>{^mR1IdklAK-@n0rM=3vmK}i4%RhGAJ~ley0Bmm609dWQ=z5*RzV31eqz>Vn zhPml_*#THiXS?n^H**4j;?i>$I;P<`u+wyW4bRk;0azND2H>OR2LP-k#{tMSs{mX{ zOaSmpq5{DBn)lZ>jUV$i@iRO%?#0?qwTA$FTS*(+bIqy|(_gjn4nQ*DH~_b*>n_0T zY{57#Gvb|R%8KRC8SWY<{UEd1i7^1ml}*Fs_sx?Iz$fmcosSLjsmB0ZzHkd@u9cD@51Ffy<{NRY_HgDv|2z24fkCSt4b4o@kF!b zy3py9$@IOy%ogm<^mzcjdF3w9F)CzMs2*08R&U10uu&uAa}y50%38&!-jqFLyq8fS zvq2+4p)>r_SwelV-|qiz#ITJ_3)`%+f%0vyF}C;^7Ba1>O-4_>J_~eu!9C4p($O5f z+;f&F9M1tzda-82u8i8)=G!e}K;G3oMaFR7F>HV0%!n6r8f}!}g@s4PeyZYR(9S0R zG20iRGraGyHT;&(HfLvn?8KM@JICPkO>Nie#_{os;a=EdVv0@m6v~x$i)VbRG8<&n zCi;dIyQzftS=AE|cI}|;{Tl2=^bLzftL4JZQAWjX(9^$P;$v8-Ca`-Hdwu%*C4Pp5 zJwjt=kAot*hLwNyhBD~sKj^$`6J5h%yH+=3hnZv%!o-^m1{m*Z{Z@zE7Jx)i2KM51F zyM9S{__)&PON!6VaE!rtp%7S?zJ+)sUEM*gif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U002ovPDHLk GV1fW#WP3XR diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs index d912c1f3a3..61f464b669 100644 --- a/Projectiles/Summon/LanternFlame.cs +++ b/Projectiles/Summon/LanternFlame.cs @@ -3,10 +3,13 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Summon { public class LanternFlame : ModProjectile { + private bool playSound = true; + public override void SetStaticDefaults() { DisplayName.SetDefault("Flame"); @@ -28,14 +31,14 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.65f / 255f); + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 1f / 255f, 0f, 0f); projectile.frameCounter++; if (projectile.frameCounter > 4) { projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame >= 4) { projectile.frame = 0; } @@ -113,10 +116,9 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -126,17 +128,22 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.ShadowFlame, 180); + target.AddBuff(ModContent.BuffType(), 180); + if (playSound) + { + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); + } + playSound = false; } } } diff --git a/Projectiles/Summon/LanternFlame.png b/Projectiles/Summon/LanternFlame.png index 3009ead2138f69b06c5a4c22476e120420930559..70b7fc439e715f1b54ff75db52f7fe0b5cfd7742 100644 GIT binary patch literal 822 zcmV-61Ihe}P)Px%@JU2LR9J<*n9pkyK@`V7Q#a8_n!;)|AtDG-@FqP-#G4nvdJ{Z(@(<`AAox#+ ze}#B#JPKYU2nM~hXzC@R6=I`}@kbJ6JtQyPo$MqbZ@5Il*^=$!MDqNrn!0ugfXx@xnMks~^ZOX2 z%K^aO=9Aa~t?LgB!1s?G0P2|{I%5B@5xalh`rXKP@$usCPf8ypJ7oV{zRC>t)4q=A z$((U3K*S2Y7CNFl$g1762Ux4SpZ1kRiG(XRPMaYi*4NNJDv9#&v+@==+9z2(@kvPP zSRE1TnWFd>tK3pEI7CM@p=!09+Tl$f5??11Ax5&q*4L1d2P&d@w{|D;hx~<;0OWS+ z6Ju7D9Z{cl1|PQeNM4rPy9p_|n2RK)SGfak)c{m;mj}K&6kM#_-bFt;?rlSh+`@z z(f`#Obi{tY4Zxe{gWu2fsygDBN>5Ps$k>I1oUtfDcozCq72l-tc1;R^#)&hL7u0=@ zk%&3)R)LWAIC}G1wv@20ib+1&d8qGKT}0a?hV{K%#nKv=iSE|2B^_~8kBO1+|G{hJBblv$+DVKrSzIJ!dPU< zJNr{?A+^J{i0}GyhbXw{tK9FnW~VwM1LN6YXM@~Xsqf{cW=G@rx&ipJl9rk2h*Qs2 z=ey0wZJGW)XI9M-TYUGJxUNoJRq^?Krf2{XLCEs<3 zFSf6V-5`zK1K3&8d~n|Y91KqdA0EHd5tncO0SB-Px&pGibPRA_tBq;eyp$-3q%IB#z(q|)vpey#k(ij;D(kDhdfUTcoUf$* zxQlE>`m8P9EC6uf&O68J5n6-`iLP>XO!+)`BH0aOUGlD$6tbn2TJXtv9Etpw>j6pK z+@w-#D6{8orC3ib5eeNa$BO2-`s%!nd*!D+0z+|TA0Ze938#@q}Yd^AuB$G@l zgdK9UX1`y12EgU+48TZYpGa3SRZ<8>5*Yv=G>z=oe#3^+AaXqjUCHGI>CnrbK#M|)h?{mg4x@s15nP6S)Mid zhGt>=mNr{rz$O*7$s7W!);it?0B>qkJ_`9GP;cmTU=n~sR8 zjU5l#k#3NqeC_x$}^^I`R)6;Oq9T z2ap?0I3k*#YB@I#x-0C(@lhY(#h04W&K{ATi%2HWs~+iY*4p*#R)t+oIg0F0^(_xz zI-geS*rApqIt+vxDE69x`|P-mqTH;Hf%ZV^*>3K&{d8m;n}6vjRy}vxjwf0=$sANhMN(-` zjT|?+T9N(As7SB0Pv_Hm6Qk@AMOE5GGJCUyoa210yV4#=>eJjoJq zVL4~}NfwdBkw~1sjM>w(6G3LMsV)Teh#Jjb3W2U4pTGM66=&H|$5TARdUl|{K`SDO Tp<8Vn00000NkvXXu0mjf$ 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + Player player = Main.player[projectile.owner]; - if (projectile.localAI[0] == 0f) + if (count == 0f) { projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - projectile.localAI[0] += 1f; + count += 1f; } if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { diff --git a/Projectiles/Summon/LanternSoul.png b/Projectiles/Summon/LanternSoul.png index 335f855c50597b20adc22f09a261bb5956da2461..b7f6c92e8c82960a46b8426cb04378321278fb36 100644 GIT binary patch literal 2188 zcma)8c{JOJ7XDGMmYLexp{1y;C{;ssk#^Fe_NA>QV=YaK#9m7wrKlm25=(-?{gkd(ZjqcNgS+E8|l_QbGU#oH8{r ze8{yL0KfwXoaCZUs7xl;@B}?H)(7fG&#wW1fRU-;UE8oiI?CGXyxsW$aE8x>l4Zd~ zSYN4qb?YTrL-kC3|2To~rak6=tlGVbQ(-KdUWrqU!!Epaji0j>eakO@A;JE^)+2+g z#EXx8r;lJ#8J0x+`jw8&kh#%{iv$+&%bbCBV5phXVvKDAL^baPIu{+G%7PINN`dN?WgZF2nSPeP_B%<(NqwL#kn z2j%cXCz~PbuW>%|E%0PSd>!nGvQseKtW&YDA_t=fRqj+YyQJf&?xXQsnFW3M!4OF4 zf)4F?(LpsR+kDJx$(1X)_G+7b&huV;TOYlgcVR6qg1zJO653t3tHG5#0nAa|nxHsD zybk(cf(^O4BLjCp5_Xn$ATn5Wu>0+C^e7{R7efF6-PGrtQy3MEf!9R2oE!{cg90J} zUvYu_vB;M2DJ7eC+tk$uK&pndF`aIkhH)(!_s@qnMRRuhs4d%&GE^n*c6hT4E-MK` zSWlZcj9$KmNggn8ny}{u4DD#M{;ZN!Kax@q~Lmp*A+o=e5T)(-#)^ z(zFr-*Ed|Y^NiuXq5FEk;-cbEko@6B)ciF$M)m^L6N&u;7p>VKGi9xxxwxAe(2NME z<*9Rg-_j`53}2(X$N-#KK@wi+XtrJ5M-`D7TcUZk-+Sgaj+#irr<(bLv|bV zwy>8y7KFkRc9I!X{ZEF|XIQt9RZ+K}70!vJF8!=MHqYOUn$#_up8%J!chbDKuV-Kp zQL}-@o3qifUJQKs{vP!NC+fj&8z3S`dUA%(37RbM=KAsdXWmbB8_;tK4Ju^eiBJ3c zh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ayX$hJuV{KYU* zaR+-Q%s7nfAu)Micdn+oz*PZKXYbccOqqq7{rlRyEHogm-8K>56p*|rYo!$9vn~15 zl{qwWVtzz}`Z{%2ghr#ryj)SFfQRW3cxn5F z(i~g7pOrMf%8`z>VdP>4<+4jz_ysSsQk4IwwJvZnbmPz2q8QR=-5*=6EIj)N9|3xn qqQ}Jd$c^Uy55fLd&q>UpA3(Ck;0W2g8^?Vw0MmO`hV}Yxaeo8y(utA) literal 558 zcmV+}0@3}6P)NklHpG_y!o+ZV+L;jPJFhihs|f$7}~&V%Wro3@~M=Mwx7DUW~vS62*JNkp^llwPfjS6)6zwaM|)uG27hL31&5zK;uqJFT8CeQB! z)47R7V0!CLNL+}jYl7+5H?ML>ISqWBE%Bf48;7oQ1s$@4R}u(}vMqR@RT zX`%*Ja%kan{63<&MX=~%I-4N6arg7yDn7)Q}wP1CNa#n)rd(R*t0@DYN zBbr+Tvj7&>!oJ*iePSCu5nN&%UYd`RHPC(bcJo)1)W}G8i_lXOt{jfbN9Y+H-8{ID zXl@bA0+@?nWfVFe=95=8kkVW1$TKhviz`C zaRn=lw@ls+Rgr2m}<>gf@z)J3&UJa&U1pr3LKsSqERXMB$N@^>}+7HqyBD&2$GmBth wPxA&O-7UhEuL!k*(DMy?>Lj{1L8(OmNxJ`1mViZf00000NkvXXu0mjf0DCw5E&u=k From d304a88786abd69328f35fde57e0a8616d2bc587 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 22 Jan 2020 16:33:48 -0500 Subject: [PATCH 4/4] death message code cleanup --- CalPlayer/CalamityPlayer.cs | 183 ++++++------------------------------ 1 file changed, 28 insertions(+), 155 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index cbe86a8e08..06e7287c0e 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6532,186 +6532,59 @@ namespace CalamityMod.CalPlayer player.palladiumRegen = false; player.iceBarrier = false; player.crystalLeaf = false; + + PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); if (abyssDeath) { if (Main.rand.NextBool(2)) { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " is food for the Wyrms."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " is food for the Wyrms."); } else { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason("Oxygen failed to reach " + player.name + " from the depths of the Abyss."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason("Oxygen failed to reach " + player.name + " from the depths of the Abyss."); } } else if (specialDeath) { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was defeated."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " was defeated."); } else if (CalamityWorld.death && deathModeBlizzardTime > 1980) { deathModeBlizzardTime = 0; - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was chilled to the bone by the frigid environment."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " was chilled to the bone by the frigid environment."); } else if (SCalLore) { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.Male ? player.name + " was consumed by his inner hatred." : player.name + " was consumed by her inner hatred."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.Male ? player.name + " was consumed by his inner hatred." : player.name + " was consumed by her inner hatred."); } else if (CalamityWorld.armageddon && areThereAnyDamnBosses) { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " failed the challenge at hand."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " failed the challenge at hand."); } else if (CalamityWorld.bossRushActive && bossRushImmunityFrameCurseTimer > 0) { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was destroyed by a mysterious force."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); - } - else - { - PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " was destroyed by a mysterious force."); } + NetworkText deathText = damageSource.GetDeathText(player.name); + if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) + { + NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); + } + if (Main.netMode == NetmodeID.Server) + { + NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); + } + else if (Main.netMode == NetmodeID.SinglePlayer) + { + Main.NewText(deathText.ToString(), 225, 25, 25, false); + } + if (player.whoAmI == Main.myPlayer && player.difficulty == 0) + { + player.DropCoins(); + } + player.DropTombstone(coinsOwned, deathText, 0); + if (player.whoAmI == Main.myPlayer) { try