This commit is contained in:
mountaindrew10 committed 2022-03-18 15:03:39 -05:00
commit 69a61ba0ff
58 files changed
+191 -116

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Buffs.StatBuffs
// Otherwise, Rage Mode ends instantly.
else
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/RageEnd"), player.position);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/RageEnd"), player.position);
player.DelBuff(buffIndex--); // TML documentation requires you to decrement buffIndex if deleting the buff during Update.
mp.rageModeActive = false;
mp.rage = 0f;
+12 -12
View File
@@ -2895,7 +2895,7 @@ namespace CalamityMod.CalPlayer
{
int seconds = CalamityUtils.SecondsToFrames(15f);
player.AddBuff(ModContent.BuffType<Buffs.StatBuffs.DivineBless>(), seconds, false);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AngelicAllianceActivation"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/AngelicAllianceActivation"), player.Center);
// Spawn an archangel for every minion you have
float angelAmt = 0f;
@@ -3003,7 +3003,7 @@ namespace CalamityMod.CalPlayer
{
brimflameFrenzy = true;
player.AddBuff(ModContent.BuffType<BrimflameFrenzyBuff>(), 10 * 60, true);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BrimflameAbility"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/AbilitySounds/BrimflameAbility"), player.Center);
for (int num502 = 0; num502 < 36; num502++)
{
int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
@@ -3036,7 +3036,7 @@ namespace CalamityMod.CalPlayer
if (player.whoAmI == Main.myPlayer)
player.AddCooldown(BloodflareRangedSet.ID, 1800);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/BloodflareRangerActivation"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/BloodflareRangerActivation"), player.Center);
for (int d = 0; d < 64; d++)
{
int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, (int)CalamityDusts.Phantoplasm, 0f, 0f, 0, default, 1f);
@@ -3083,7 +3083,7 @@ namespace CalamityMod.CalPlayer
player.AddBuff(ModContent.BuffType<AbyssalMadness>(), 300, false);
}
player.AddCooldown(OmegaBlue.ID, 1800);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/OmegaBlueAbility"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/OmegaBlueAbility"), player.Center);
for (int i = 0; i < 66; i++)
{
int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 2.6f);
@@ -3095,7 +3095,7 @@ namespace CalamityMod.CalPlayer
}
if (dsSetBonus)
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DemonshadeEnrage"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/DemonshadeEnrage"), player.Center);
for (int num502 = 0; num502 < 36; num502++)
{
int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
@@ -3131,7 +3131,7 @@ namespace CalamityMod.CalPlayer
}
if (plagueReaper && !player.HasCooldown(PlagueBlackout.ID))
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/PlagueReaperAbility"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/PlagueReaperAbility"), player.Center);
player.AddCooldown(PlagueBlackout.ID, 1800);
}
if (forbiddenCirclet && forbiddenCooldown <= 0)
@@ -3205,7 +3205,7 @@ namespace CalamityMod.CalPlayer
// Gael's Greatsword replaces Rage Mode with an uber skull attack
if (gaelRageAttackCooldown == 0 && player.ActiveItem().type == ModContent.ItemType<GaelsGreatsword>() && rage > 0f)
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/SilvaDispel"), player.Center);
for (int i = 0; i < 3; i++)
Dust.NewDust(player.position, 120, 120, 218, 0f, 0f, 100, default, 1.5f);
@@ -3249,7 +3249,7 @@ namespace CalamityMod.CalPlayer
player.AddBuff(ModContent.BuffType<RageMode>(), 2);
// Play Rage Activation sound
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/RageActivate"), player.position);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/RageActivate"), player.position);
// TODO -- improve Rage activation visuals
for (int num502 = 0; num502 < 64; num502++)
@@ -3280,7 +3280,7 @@ namespace CalamityMod.CalPlayer
player.AddBuff(ModContent.BuffType<AdrenalineMode>(), AdrenalineDuration);
// Play Adrenaline Activation sound
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AdrenalineActivate"), player.position);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/AdrenalineActivate"), player.position);
// TODO -- improve Adrenaline activation visuals
for (int num502 = 0; num502 < 64; num502++)
@@ -4250,7 +4250,7 @@ namespace CalamityMod.CalPlayer
Main.dust[sVeilDustIndex2].noLight = false;
}
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/SilvaDispel"), player.Center);
NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0);
}
@@ -4324,7 +4324,7 @@ namespace CalamityMod.CalPlayer
player.GiveIFrames(player.longInvince ? 100 : 60, true);
rogueStealth += 0.5f;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaActivation"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/SilvaActivation"), player.Center);
for (int i = 0; i < 10; i++)
{
@@ -4499,7 +4499,7 @@ namespace CalamityMod.CalPlayer
{
if (silvaCountdown == silvaReviveDuration && !hasSilvaEffect)
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaActivation"), (int)player.position.X, (int)player.position.Y);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/SilvaActivation"), (int)player.position.X, (int)player.position.Y);
player.AddBuff(ModContent.BuffType<SilvaRevival>(), silvaReviveDuration);
+3 -3
View File
@@ -371,7 +371,7 @@ namespace CalamityMod.CalPlayer
if (playFullRageSound)
{
playFullRageSound = false;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullRage"), (int)player.position.X, (int)player.position.Y);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/FullRage"), (int)player.position.X, (int)player.position.Y);
}
}
else
@@ -417,7 +417,7 @@ namespace CalamityMod.CalPlayer
if (playFullAdrenalineSound)
{
playFullAdrenalineSound = false;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/FullAdrenaline"), (int)player.position.X, (int)player.position.Y);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/FullAdrenaline"), (int)player.position.X, (int)player.position.Y);
}
}
else
@@ -1155,7 +1155,7 @@ namespace CalamityMod.CalPlayer
silvaCountdown -= 1;
if (silvaCountdown <= 0)
{
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), player.Center);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AbilitySounds/SilvaDispel"), player.Center);
player.AddCooldown(SilvaRevive.ID, CalamityUtils.SecondsToFrames(5 * 60));
}
+3
View File
@@ -156,6 +156,7 @@ namespace CalamityMod.CalPlayer
return;
ModPacket packet = mod.GetPacket(256);
packet.Write((byte)CalamityModMessageType.CooldownAddition);
packet.Write(player.whoAmI);
cd.Write(packet);
player.SendPacket(packet, server);
}
@@ -166,6 +167,7 @@ namespace CalamityMod.CalPlayer
return;
ModPacket packet = mod.GetPacket(256);
packet.Write((byte)CalamityModMessageType.CooldownRemoval);
packet.Write(player.whoAmI);
packet.Write(cooldownIDs.Count);
foreach (string id in cooldownIDs)
packet.Write(CooldownRegistry.Get(id).netID);
@@ -178,6 +180,7 @@ namespace CalamityMod.CalPlayer
return;
ModPacket packet = mod.GetPacket(1024);
packet.Write((byte)CalamityModMessageType.SyncCooldownDictionary);
packet.Write(player.whoAmI);
packet.Write(cooldowns.Count);
foreach (CooldownInstance cd in cooldowns.Values)
cd.Write(packet);
+1 -1
View File
@@ -13,6 +13,6 @@ namespace CalamityMod.Cooldowns
public override Color CooldownStartColor => new Color(216, 60, 90);
public override Color CooldownEndColor => new Color(251, 106, 150);
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/BloodflareRangerRecharge");
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/AbilitySounds/BloodflareRangerRecharge");
}
}
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Cooldowns
public override Color CooldownStartColor => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - instance.Completion);
public override Color CooldownEndColor => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - instance.Completion);
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/BrimflameRecharge");
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/AbilitySounds/BrimflameRecharge");
//Add red eyes to the icon
+2
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using Terraria.Audio;
namespace CalamityMod.Cooldowns
{
@@ -12,6 +13,7 @@ namespace CalamityMod.Cooldowns
public override Color OutlineColor => outlineColor;
public override Color CooldownStartColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - instance.Completion);
public override Color CooldownEndColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - instance.Completion);
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/AbilitySounds/ChaosStateOver");
//It's the same cooldown with different skins each time, basically.
public string skinTexture;
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Cooldowns
public override Color OutlineColor => instance.timeLeft > 1500 ? new Color(231, 164, 1) : new Color(72, 135, 205);
public override Color CooldownStartColor => instance.timeLeft > 1500 ? Color.Lerp(new Color(98, 110, 179), new Color(216, 176, 80), (instance.timeLeft - 1500) / 300f) : new Color(98, 110, 179);
public override Color CooldownEndColor => instance.timeLeft > 1500 ? Color.Lerp(new Color(179, 132, 98), new Color(216, 176, 80), (instance.timeLeft - 1500) / 300f) : new Color(179, 132, 98);
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/OmegaBlueRecharge");
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/AbilitySounds/OmegaBlueRecharge");
public override void OnCompleted()
{
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Cooldowns
public override Color OutlineColor => new Color(174, 237, 122);
public override Color CooldownStartColor => Color.DarkSlateGray;
public override Color CooldownEndColor => Color.DarkSlateGray;
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/PlagueReaperRecharge");
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/AbilitySounds/PlagueReaperRecharge");
public override void OnCompleted()
{
+2
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using Terraria.Audio;
namespace CalamityMod.Cooldowns
{
@@ -11,5 +12,6 @@ namespace CalamityMod.Cooldowns
public override Color OutlineColor => new Color(255, 142, 165);
public override Color CooldownStartColor => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), instance.Completion);
public override Color CooldownEndColor => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), instance.Completion);
public override LegacySoundStyle EndSound => instance.player.Calamity().mod.GetLegacySoundSlot(Terraria.ModLoader.SoundType.Custom, "Sounds/Custom/AbilitySounds/PotionSicknessOver");
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

+2 -2
View File
@@ -88,14 +88,14 @@ namespace CalamityMod.Items.Weapons.Melee
effectDescTooltip.text = mainAttunement.function_description;
effectDescTooltip.overrideColor = mainAttunement.tooltipColor;
mainAttunementTooltip.text = "Main Attumenent : [" + mainAttunement.name + "]";
mainAttunementTooltip.text = "Main Attunement : [" + mainAttunement.name + "]";
mainAttunementTooltip.overrideColor = mainAttunement.tooltipColor;
}
//If theres a secondary attunement
if (secondaryAttunement != null)
{
secondaryAttunementTooltip.text = "Secondary Attumenent : [" + secondaryAttunement.name + "]";
secondaryAttunementTooltip.text = "Secondary Attunement : [" + secondaryAttunement.name + "]";
secondaryAttunementTooltip.overrideColor = Color.Lerp(secondaryAttunement.tooltipColor, Color.Gray, 0.5f);
}
}
+4 -4
View File
@@ -35,12 +35,12 @@ namespace CalamityMod.Items.Weapons.Melee
public static int BaseDamage = 800;
public static int PhoenixAttunement_BaseDamage = 800;
public static int PhoenixAttunement_LocalIFrames = 20; //Remember its got one extra update
public static int PhoenixAttunement_LocalIFrames = 30; //Remember its got one extra update
public static float PhoenixAttunement_BoltDamageReduction = 0.5f;
public static float PhoenixAttunement_BoltThrowDamageMultiplier = 1.5f;
public static float PhoenixAttunement_BoltThrowDamageMultiplier = 1f;
public static float PhoenixAttunement_BaseDamageReduction = 0.5f;
public static float PhoenixAttunement_FullChargeDamageBoost = 2.1f;
public static float PhoenixAttunement_ThrowDamageBoost = 3.6f;
public static float PhoenixAttunement_ThrowDamageBoost = 3.2f;
public static int PolarisAttunement_BaseDamage = 1200;
public static int PolarisAttunement_FullChargeDamage = 1900;
@@ -116,7 +116,7 @@ namespace CalamityMod.Items.Weapons.Melee
passiveDescTooltip.text = mainAttunement.passive_description;
passiveDescTooltip.overrideColor = mainAttunement.tooltipPassiveColor;
mainAttunementTooltip.text = "Active Attumenent : [" + mainAttunement.name + "]";
mainAttunementTooltip.text = "Active Attunement : [" + mainAttunement.name + "]";
mainAttunementTooltip.overrideColor = Color.Lerp(mainAttunement.tooltipColor, mainAttunement.tooltipColor2, 0.5f + (float)Math.Sin(Main.GlobalTime) * 0.5f);
blessingTooltip.text = "Passive Blessing : [" + mainAttunement.passive_name + "]";
+3 -3
View File
@@ -126,7 +126,7 @@ namespace CalamityMod.Items.Weapons.Melee
passiveDescTooltip.text = "Your secondary attunement can now provide passive bonuses";
passiveDescTooltip.overrideColor = new Color(163, 163, 163);
mainAttunementTooltip.text = "Active Attumenent : [None]";
mainAttunementTooltip.text = "Active Attunement : [None]";
mainAttunementTooltip.overrideColor = new Color(163, 163, 163);
secondaryAttunementTooltip.text = "Passive Attunement : [None]";
@@ -138,7 +138,7 @@ namespace CalamityMod.Items.Weapons.Melee
effectDescTooltip.text = mainAttunement.function_description + "\n" + mainAttunement.function_description_extra;
effectDescTooltip.overrideColor = mainAttunement.tooltipColor;
mainAttunementTooltip.text = "Active Attumenent : [" + mainAttunement.name + "]";
mainAttunementTooltip.text = "Active Attunement : [" + mainAttunement.name + "]";
mainAttunementTooltip.overrideColor = Color.Lerp(mainAttunement.tooltipColor, mainAttunement.tooltipColor2, 0.5f + (float)Math.Sin(Main.GlobalTime) * 0.5f);
}
@@ -148,7 +148,7 @@ namespace CalamityMod.Items.Weapons.Melee
passiveDescTooltip.text = secondaryAttunement.passive_description;
passiveDescTooltip.overrideColor = secondaryAttunement.tooltipColor;
secondaryAttunementTooltip.text = "Passive Attumenent : [" + secondaryAttunement.name + "]";
secondaryAttunementTooltip.text = "Passive Attunement : [" + secondaryAttunement.name + "]";
secondaryAttunementTooltip.overrideColor = Color.Lerp(Color.Lerp(secondaryAttunement.tooltipColor, secondaryAttunement.tooltipColor2, 0.5f + (float)Math.Sin(Main.GlobalTime) * 0.5f), Color.Gray, 0.5f);
}
}
+2 -2
View File
@@ -116,14 +116,14 @@ namespace CalamityMod.Items.Weapons.Melee
effectDescTooltip.text = mainAttunement.function_description + "\n" + mainAttunement.function_description_extra ;
effectDescTooltip.overrideColor = mainAttunement.tooltipColor;
mainAttunementTooltip.text = "Main Attumenent : [" + mainAttunement.name + "]";
mainAttunementTooltip.text = "Main Attunement : [" + mainAttunement.name + "]";
mainAttunementTooltip.overrideColor = mainAttunement.tooltipColor;
}
//If theres a secondary attunement
if (secondaryAttunement != null)
{
secondaryAttunementTooltip.text = "Secondary Attumenent : [" + secondaryAttunement.name + "]";
secondaryAttunementTooltip.text = "Secondary Attunement : [" + secondaryAttunement.name + "]";
secondaryAttunementTooltip.overrideColor = Color.Lerp(secondaryAttunement.tooltipColor, Color.Gray, 0.5f);
}
}
+6 -11
View File
@@ -53,17 +53,12 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<IceStar>(), 200);
recipe.AddIngredient(ModContent.ItemType<Avalanche>(), 2);
recipe.AddIngredient(ModContent.ItemType<EffluviumBow>(), 2);
recipe.AddIngredient(ModContent.ItemType<GlacialCrusher>(), 2);
recipe.AddIngredient(ModContent.ItemType<Icebreaker>(), 2);
recipe.AddIngredient(ModContent.ItemType<SnowstormStaff>(), 2);
recipe.AddIngredient(ModContent.ItemType<SoulofCryogen>(), 2);
recipe.AddIngredient(ModContent.ItemType<FrostFlare>(), 2);
recipe.AddIngredient(ModContent.ItemType<CryoStone>());
recipe.AddIngredient(ItemID.FrozenKey);
recipe.AddIngredient(ItemID.FrostCore, 2);
recipe.AddIngredient(ModContent.ItemType<IceStar>(), 100);
recipe.AddIngredient(ModContent.ItemType<Avalanche>());
recipe.AddIngredient(ModContent.ItemType<EffluviumBow>());
recipe.AddIngredient(ModContent.ItemType<GlacialCrusher>());
recipe.AddIngredient(ModContent.ItemType<Icebreaker>());
recipe.AddIngredient(ModContent.ItemType<SnowstormStaff>());
recipe.AddIngredient(ModContent.ItemType<EssenceofEleum>(), 10);
recipe.AddTile(TileID.IceMachine);
recipe.SetResult(this);
+34 -25
View File
@@ -197,28 +197,32 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (Main.npc[(int)npc.ai[2]].ModNPC<DevourerofGodsHead>()?.AttemptingToEnterPortal ?? false)
{
Projectile portal = Main.projectile[Main.npc[(int)npc.ai[2]].ModNPC<DevourerofGodsHead>().PortalIndex];
float newOpacity = 1f - Utils.InverseLerp(270f, 100f, npc.Distance(portal.Center), true);
if (Main.netMode != NetmodeID.MultiplayerClient && newOpacity > 0f && npc.Opacity > newOpacity)
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.Opacity = newOpacity;
// Create dust at the portal position.
if (Vector2.Dot((npc.rotation - MathHelper.PiOver2).ToRotationVector2(), Main.npc[(int)npc.ai[2]].velocity) > 0f)
Projectile portal = Main.projectile[Main.npc[(int)npc.ai[2]].ModNPC<DevourerofGodsHead>().PortalIndex];
float newOpacity = 1f - Utils.InverseLerp(270f, 100f, npc.Distance(portal.Center), true);
if (newOpacity > 0f && npc.Opacity > newOpacity)
{
for (int i = 0; i < 2; i++)
{
Dust cosmicMagic = Dust.NewDustPerfect(portal.Center, Main.rand.NextBool() ? 180 : 173);
cosmicMagic.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 8f);
cosmicMagic.scale *= Main.rand.NextFloat(1f, 1.8f);
cosmicMagic.noGravity = true;
}
}
npc.netUpdate = true;
}
npc.Opacity = newOpacity;
if (npc.Opacity < 0.2f)
npc.Opacity = 0f;
// Create dust at the portal position.
if (Vector2.Dot((npc.rotation - MathHelper.PiOver2).ToRotationVector2(), Main.npc[(int)npc.ai[2]].velocity) > 0f)
{
for (int i = 0; i < 2; i++)
{
Dust cosmicMagic = Dust.NewDustPerfect(portal.Center, Main.rand.NextBool() ? 180 : 173);
cosmicMagic.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 8f);
cosmicMagic.scale *= Main.rand.NextFloat(1f, 1.8f);
cosmicMagic.noGravity = true;
}
}
if (npc.Opacity < 0.2f)
npc.Opacity = 0f;
npc.netUpdate = true;
}
}
}
else
npc.alpha = Main.npc[(int)npc.ai[2]].alpha;
@@ -333,17 +337,22 @@ namespace CalamityMod.NPCs.DevourerofGods
public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
{
if ((damage * (crit ? 2D : 1D)) >= npc.life)
if ((damage * (crit ? 2D : 1D)) >= npc.life || (npc.realLife >= 0 && Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying))
{
if (npc.realLife >= 0 && !Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying)
if (npc.realLife >= 0)
{
damage = 0D;
npc.dontTakeDamage = true;
Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying = true;
Main.npc[npc.realLife].life = 1;
Main.npc[npc.realLife].dontTakeDamage = true;
Main.npc[npc.realLife].active = true;
Main.npc[npc.realLife].netUpdate = true;
Main.npc[npc.realLife].life = 1;
if (!Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying)
{
Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying = true;
Main.npc[npc.realLife].dontTakeDamage = true;
Main.npc[npc.realLife].active = true;
Main.npc[npc.realLife].netUpdate = true;
}
}
return false;
}
@@ -179,6 +179,8 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void SendExtraAI(BinaryWriter writer)
{
bool wasDyingBefore = Dying;
// Phase 1 syncs
writer.Write(npc.dontTakeDamage);
writer.Write(spawnedGuardians);
@@ -211,6 +213,13 @@ namespace CalamityMod.NPCs.DevourerofGods
writer.Write(Dying);
writer.Write(DeathAnimationTimer);
writer.Write(DestroyedSegmentCount);
// Be sure to inform clients of the fact that The Devourer of Gods is dying if only the server recieved this packet.
if (Main.netMode == NetmodeID.Server && !wasDyingBefore && Dying)
{
npc.netSpam = 0;
npc.netUpdate = true;
}
}
public override void ReceiveExtraAI(BinaryReader reader)
+37 -28
View File
@@ -217,28 +217,32 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (Main.npc[(int)npc.ai[2]].ModNPC<DevourerofGodsHead>()?.AttemptingToEnterPortal ?? false)
{
Projectile portal = Main.projectile[Main.npc[(int)npc.ai[2]].ModNPC<DevourerofGodsHead>().PortalIndex];
float newOpacity = 1f - Utils.InverseLerp(200f, 130f, npc.Distance(portal.Center), true);
if (Main.netMode != NetmodeID.MultiplayerClient && newOpacity > 0f && npc.Opacity > newOpacity)
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.Opacity = newOpacity;
// Create dust at the portal position.
if (Vector2.Dot((npc.rotation - MathHelper.PiOver2).ToRotationVector2(), Main.npc[(int)npc.ai[2]].velocity) > 0f)
Projectile portal = Main.projectile[Main.npc[(int)npc.ai[2]].ModNPC<DevourerofGodsHead>().PortalIndex];
float newOpacity = 1f - Utils.InverseLerp(270f, 100f, npc.Distance(portal.Center), true);
if (newOpacity > 0f && npc.Opacity > newOpacity)
{
for (int i = 0; i < 2; i++)
{
Dust cosmicMagic = Dust.NewDustPerfect(portal.Center, Main.rand.NextBool() ? 180 : 173);
cosmicMagic.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 8f);
cosmicMagic.scale *= Main.rand.NextFloat(1f, 1.8f);
cosmicMagic.noGravity = true;
}
}
npc.netUpdate = true;
}
npc.Opacity = newOpacity;
if (npc.Opacity < 0.2f)
npc.Opacity = 0f;
// Create dust at the portal position.
if (Vector2.Dot((npc.rotation - MathHelper.PiOver2).ToRotationVector2(), Main.npc[(int)npc.ai[2]].velocity) > 0f)
{
for (int i = 0; i < 2; i++)
{
Dust cosmicMagic = Dust.NewDustPerfect(portal.Center, Main.rand.NextBool() ? 180 : 173);
cosmicMagic.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 8f);
cosmicMagic.scale *= Main.rand.NextFloat(1f, 1.8f);
cosmicMagic.noGravity = true;
}
}
if (npc.Opacity < 0.2f)
npc.Opacity = 0f;
npc.netUpdate = true;
}
}
}
else
npc.alpha = Main.npc[(int)npc.ai[2]].alpha;
@@ -385,22 +389,27 @@ namespace CalamityMod.NPCs.DevourerofGods
}
public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
{
if ((damage * (crit ? 2D : 1D)) >= npc.life)
{
if ((damage * (crit ? 2D : 1D)) >= npc.life || (npc.realLife >= 0 && Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying))
{
if (npc.realLife >= 0 && !Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying)
if (npc.realLife >= 0)
{
damage = 0D;
npc.dontTakeDamage = true;
Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying = true;
Main.npc[npc.realLife].life = 1;
Main.npc[npc.realLife].dontTakeDamage = true;
Main.npc[npc.realLife].active = true;
Main.npc[npc.realLife].netUpdate = true;
Main.npc[npc.realLife].life = 1;
if (!Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying)
{
Main.npc[npc.realLife].ModNPC<DevourerofGodsHead>().Dying = true;
Main.npc[npc.realLife].dontTakeDamage = true;
Main.npc[npc.realLife].active = true;
Main.npc[npc.realLife].netUpdate = true;
}
}
return false;
}
return true;
}
return true;
}
public override bool CheckDead()
+14 -4
View File
@@ -133,6 +133,7 @@ namespace CalamityMod.NPCs.Providence
public override void ReceiveExtraAI(BinaryReader reader)
{
bool wasDyingBefore = Dying;
text = reader.ReadBoolean();
useDefenseFrames = reader.ReadBoolean();
biomeType = reader.ReadInt32();
@@ -149,6 +150,13 @@ namespace CalamityMod.NPCs.Providence
DeathAnimationTimer = reader.ReadInt32();
for (int i = 0; i < 4; i++)
npc.Calamity().newAI[i] = reader.ReadSingle();
// Be sure to inform clients of the fact that Providence is dying if only the server recieved this packet.
if (Main.netMode == NetmodeID.Server && !wasDyingBefore && Dying)
{
npc.netSpam = 0;
npc.netUpdate = true;
}
}
public override void AI()
@@ -1883,8 +1891,6 @@ namespace CalamityMod.NPCs.Providence
{
DespawnSpecificProjectiles(true);
Dying = true;
npc.life = 1;
npc.dontTakeDamage = true;
npc.active = true;
npc.netUpdate = true;
}
@@ -1893,10 +1899,14 @@ namespace CalamityMod.NPCs.Providence
public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit)
{
if (!Dying && (damage * (crit ? 2D : 1D)) >= npc.life)
if ((damage * (crit ? 2D : 1D)) >= npc.life)
{
damage = 0D;
CheckDead();
npc.life = 1;
npc.dontTakeDamage = true;
if (!Dying)
CheckDead();
return false;
}
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class AdrenalineActivate : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class AngelicAllianceActivation : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class BloodflareRangerActivation : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class BloodflareRangerRecharge : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class BrimflameAbility : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class BrimflameRecharge : ModSound
{
@@ -0,0 +1,18 @@
using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class ChaosStateOver : ModSound
{
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
{
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * 1f;
soundInstance.Pan = pan;
Main.PlaySoundInstance(soundInstance);
return soundInstance;
}
}
}
Binary file not shown.
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class DemonshadeEnrage : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class FullAdrenaline : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class FullRage : ModSound
{
File renamed without changes.
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class OmegaBlueAbility : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class OmegaBlueRecharge : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class PlagueReaperAbility : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class PlagueReaperRecharge : ModSound
{
@@ -0,0 +1,18 @@
using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class PotionSicknessOver : ModSound
{
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
{
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * 1f;
soundInstance.Pan = pan;
Main.PlaySoundInstance(soundInstance);
return soundInstance;
}
}
}
Binary file not shown.
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class RageActivate : ModSound
{
File renamed without changes.
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class RageEnd : ModSound
{
File renamed without changes.
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class SilvaActivation : ModSound
{
@@ -2,7 +2,7 @@ using Microsoft.Xna.Framework.Audio;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Sounds.Custom
namespace CalamityMod.Sounds.Custom.AbilitySounds
{
public class SilvaDispel : ModSound
{
File renamed without changes.