Merge branch '1.4.4' into Dealing-with-problematic-rogue-stuff

This commit is contained in:
Storm2103 committed 2023-07-17 23:22:04 -06:00
commit 35f5faab6d
78 files changed
+1027 -908

No files matched your search

+2 -8
View File
@@ -1413,13 +1413,7 @@ namespace CalamityMod.CalPlayer
percentMaxLifeIncrease += 10;
if (community)
{
float BoostAtZeroBosses = 0.05f;
float BoostPostYharon = 0.2f;
float floatTypeBoost = MathHelper.Lerp(BoostAtZeroBosses, BoostPostYharon, TheCommunity.CalculatePower());
int integerTypeBoost = (int)(floatTypeBoost * 50f);
percentMaxLifeIncrease += integerTypeBoost;
}
percentMaxLifeIncrease += (int)(TheCommunity.CalculatePower() * TheCommunity.HealthMultiplier);
// Shattered Community gives the same max health boost as normal full-power Community (10%)
if (shatteredCommunity)
@@ -7016,7 +7010,7 @@ namespace CalamityMod.CalPlayer
double ratioToUse = DefenseDamageRatio;
if (draedonsHeart)
ratioToUse *= 0.5;
ratioToUse *= DraedonsHeart.DefenseDamageMultiplier;
// Calculate the defense damage taken from this hit.
int defenseDamageTaken = (int)(damage * ratioToUse);
+2 -8
View File
@@ -740,18 +740,12 @@ namespace CalamityMod.CalPlayer
if (community)
{
float BoostAtZeroBosses = 0.05f;
float BoostPostYharon = 0.2f;
float floatTypeBoost = MathHelper.Lerp(BoostAtZeroBosses, BoostPostYharon, TheCommunity.CalculatePower());
int integerTypeBoost = (int)(floatTypeBoost * 50f);
int regenBoost = 1 + (integerTypeBoost / 5);
int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier);
bool lesserEffect = false;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
bool shouldAffect = CalamityLists.alcoholList.Contains(hasBuff);
if (shouldAffect)
lesserEffect = true;
lesserEffect = CalamityLists.alcoholList.Contains(hasBuff);
}
if (Player.lifeRegen < 0)
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
+8 -15
View File
@@ -2658,22 +2658,15 @@ namespace CalamityMod.CalPlayer
if (blueCandle)
Player.moveSpeed += 0.1f;
// TODO -- crit is a float now, and knockback can be boosted for all classes
if (community)
{
float BoostAtZeroBosses = 0.05f;
float BoostPostYharon = 0.2f;
float floatTypeBoost = MathHelper.Lerp(BoostAtZeroBosses, BoostPostYharon, TheCommunity.CalculatePower());
int integerTypeBoost = (int)(floatTypeBoost * 50f);
int critBoost = integerTypeBoost / 2;
float damageBoost = floatTypeBoost * 0.5f;
Player.endurance += floatTypeBoost * 0.25f;
Player.statDefense += integerTypeBoost;
Player.GetDamage<GenericDamageClass>() += damageBoost;
Player.GetCritChance<GenericDamageClass>() += critBoost;
Player.GetKnockback<SummonDamageClass>() += floatTypeBoost;
Player.moveSpeed += floatTypeBoost * 0.5f;
flightTimeMult += floatTypeBoost;
float baseBoost = TheCommunity.CalculatePower();
Player.endurance += baseBoost * TheCommunity.DRMultiplier;
Player.statDefense += (int)(baseBoost * TheCommunity.DefenseMultiplier);
Player.GetDamage<GenericDamageClass>() += baseBoost * TheCommunity.DamageMultiplier;
Player.GetCritChance<GenericDamageClass>() += baseBoost * TheCommunity.CritMultiplier;
Player.moveSpeed += baseBoost * TheCommunity.SpeedMultiplier;
flightTimeMult += baseBoost * TheCommunity.FlightMultiplier;
}
// Shattered Community gives the same wing time boost as normal Community
if (shatteredCommunity)
@@ -2910,7 +2903,7 @@ namespace CalamityMod.CalPlayer
if (yInsignia)
{
Player.GetDamage<MeleeDamageClass>() += 0.1f;
Player.GetDamage<MeleeDamageClass>() += 0.15f;
if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5))
Player.GetDamage<GenericDamageClass>() += 0.1f;
}
-4
View File
@@ -151,7 +151,6 @@ namespace CalamityMod
internal Mod ancientsAwakened = null;
internal Mod bossChecklist = null;
internal Mod census = null;
internal Mod crouchMod = null;
internal Mod dialogueTweak = null;
internal Mod fargos = null;
@@ -182,8 +181,6 @@ namespace CalamityMod
ModLoader.TryGetMod("AAMod", out ancientsAwakened);
bossChecklist = null;
ModLoader.TryGetMod("BossChecklist", out bossChecklist);
census = null;
ModLoader.TryGetMod("Census", out census);
crouchMod = null;
ModLoader.TryGetMod("CrouchMod", out crouchMod);
dialogueTweak = null;
@@ -422,7 +419,6 @@ namespace CalamityMod
ancientsAwakened = null;
bossChecklist = null;
census = null;
crouchMod = null;
dialogueTweak = null;
fargos = null;
+1
View File
@@ -654,6 +654,7 @@ namespace CalamityMod
{ new Tuple<int, int>(NPCID.Plantera, ProjectileID.PoisonSeedPlantera), new int[] { 54, 96, 136, 152, 210 } }, // 144 in non-rev master mode
{ new Tuple<int, int>(NPCID.Plantera, ProjectileID.ThornBall), new int[] { 62, 108, 160, 176, 234 } }, // 162 in non-rev master mode
{ new Tuple<int, int>(NPCID.Plantera, ModContent.ProjectileType<SporeGasPlantera>()), new int[] { 80, 140, 160, 176, 234 } },
{ new Tuple<int, int>(NPCID.Plantera, ModContent.ProjectileType<HomingGasBulb>()), new int[] { 80, 140, 160, 176, 234 } },
{ new Tuple<int, int>(NPCID.HallowBoss, ProjectileID.HallowBossRainbowStreak), new int[] { 90, 120, 160, 176, 234 } },
{ new Tuple<int, int>(NPCID.HallowBoss, ProjectileID.FairyQueenSunDance), new int[] { 100, 140, 184, 200, 270 } },
+14
View File
@@ -9,6 +9,20 @@ namespace CalamityMod.ILEditing
{
public partial class ILChanges
{
#region Rod of Harmony Changes
private static bool ChangeRodOfHarmonyShimmerRequirement(On_Item.orig_CanShimmer orig, Item item)
{
//Rod of Harmony requires Draedong and SCal dead instead of Moon Lord.
if (item.type == ItemID.RodofDiscord)
{
return DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs;
}
return orig(item);
}
#endregion
#region Soaring Insignia Changes
private static void RemoveSoaringInsigniaInfiniteWingTime(ILContext il)
{
+2
View File
@@ -118,6 +118,7 @@ namespace CalamityMod.ILEditing
IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement;
IL_Item.TryGetPrefixStatMultipliersForItem += RelaxPrefixRequirements;
On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
On_Item.CanShimmer += ChangeRodOfHarmonyShimmerRequirement;
// TODO -- Beat Lava Slimes once and for all
// IL.Terraria.NPC.VanillaHitEffect += RemoveLavaDropsFromExpertLavaSlimes;
@@ -144,6 +145,7 @@ namespace CalamityMod.ILEditing
{
VanillaSpawnTownNPCs = null;
labDoorOpen = labDoorClosed = aLabDoorOpen = aLabDoorClosed = exoDoorClosed = exoDoorOpen = -1;
On_Item.CanShimmer -= ChangeRodOfHarmonyShimmerRequirement;
}
}
}
+1 -10
View File
@@ -3,7 +3,6 @@ using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -27,15 +26,7 @@ namespace CalamityMod.Items.Accessories
Item.Calamity().devItem = true;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.AngelicAllianceHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip4");
if (line != null)
line.Text = "Press " + hotkey + " to grace yourself in divinity for 15 seconds";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.AngelicAllianceHotKey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
+1 -9
View File
@@ -5,7 +5,6 @@ using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -28,14 +27,7 @@ namespace CalamityMod.Items.Accessories
Item.rare = ModContent.RarityType<DarkBlue>();
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.AegisHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip5");
if (line != null)
line.Text = "Press " + hotkey + " to activate buffs to all damage, crit chance, and defense";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.AegisHotKey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
+1 -9
View File
@@ -3,7 +3,6 @@ using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -23,14 +22,7 @@ namespace CalamityMod.Items.Accessories
Item.rare = ModContent.RarityType<Turquoise>();
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.AstralArcanumUIHotkey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip3");
if (line != null)
line.Text = "Press " + hotkey + " to toggle teleportation UI while no bosses are alive";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.AstralArcanumUIHotkey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
+1 -9
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System.Linq;
namespace CalamityMod.Items.Accessories
{
@@ -32,14 +31,7 @@ namespace CalamityMod.Items.Accessories
player.Calamity().stealthGenMoving += 0.1f;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.PlaguePackHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip3");
if (line != null)
line.Text = "Press " + hotkey + " to consume 25% of your maximum stealth to perform a swift upwards/diagonal dash which leaves a trail of lightning bolts";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.PlaguePackHotKey);
public override void AddRecipes()
{
+1 -9
View File
@@ -5,7 +5,6 @@ using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System.Linq;
namespace CalamityMod.Items.Accessories
{
@@ -22,14 +21,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.AstralTeleportHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2");
if (line != null)
line.Text = "Press " + hotkey + " to teleport to a random location while no bosses are alive";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.AstralTeleportHotKey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
+16 -34
View File
@@ -3,10 +3,10 @@ using CalamityMod.CalPlayer;
using CalamityMod.Rarities;
using CalamityMod.World;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
private const double ContactDamageReduction = 0.15D;
public const double DefenseDamageMultiplier = 0.5D;
// Duration of Nanomachines in frames.
internal static readonly int NanomachinesDuration = 120;
@@ -23,17 +24,17 @@ namespace CalamityMod.Items.Accessories
// Duration of time where Nanomachines won't accumulate after taking damage, in frames.
internal static readonly int NanomachinePauseAfterDamage = 60;
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(
(ContactDamageReduction * 100).ToString("N0"),
(100 - (DefenseDamageMultiplier * 100)).ToString("N0"),
NanomachinesHealPerFrame * NanomachinesDuration,
NanomachinesDuration / 60);
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 11));
ItemID.Sets.AnimatesAsSoul[Type] = true;
string seconds = NanomachinePauseAfterDamage == 60 ? "second" : "seconds";
string pauseDurationTooltip = $"{NanomachinePauseAfterDamage / 60} {seconds}";
string totalHealTooltip = $"{NanomachinesHealPerFrame * NanomachinesDuration}";
string healDurationTooltip = $"{NanomachinesDuration / 60}";
}
}
public override void SetDefaults()
{
@@ -62,35 +63,16 @@ namespace CalamityMod.Items.Accessories
public override void ModifyTooltips(List<TooltipLine> list)
{
// The 3rd tooltip line "Replaces Adrenaline..." is replaced on Normal or Expert
TooltipLine nanomachineMeterLine = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2");
if (nanomachineMeterLine != null && !CalamityWorld.revenge)
nanomachineMeterLine.Text = "Adds the Nanomachines meter";
// Add the hotkey
list.IntegrateHotkey(CalamityKeybinds.AdrenalineHotKey);
// The 4th tooltip line "Unlike Adrenaline..." is replaced on Normal or Expert
TooltipLine doesntStopOnDamageLine = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip3");
if (doesntStopOnDamageLine != null && !CalamityWorld.revenge)
doesntStopOnDamageLine.Text = "Nanomachines accumulate over time while fighting bosses\n" +
$"Taking damage stops the accumulation for {NanomachinePauseAfterDamage / 60} seconds";
// Add the proper description which changes depending on world difficulty
string desc = this.GetLocalization(CalamityWorld.revenge ? "NanomachinesReplace" : "NanomachinesAdd").Format(NanomachinePauseAfterDamage / 60);
list.FindAndReplace("[NANODESC]", desc);
// The 5th tooltip line "With full Nanomachines" has the & replaced with the hotkey.
string adrenKey = CalamityKeybinds.AdrenalineHotKey.TooltipHotkeyString();
TooltipLine hotkeyLine = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip4");
if (hotkeyLine != null)
{
string tooltipWithHotkey = hotkeyLine.Text.Replace("&", adrenKey);
hotkeyLine.Text = tooltipWithHotkey;
}
// The 6th tooltip line "While healing..." has the @ replaced with full adrenaline DR.
// For whatever reason this method overrides the entire line instead of replacing the character as intended, so we duplicate the line.
// Add the proper DR value
string fullAdrenDRString = (100f * BalancingConstants.FullAdrenalineDR).ToString("N0");
TooltipLine healingDRLine = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip5");
if (healingDRLine != null)
{
string tooltipWithDR = fullAdrenDRString.Replace("@", fullAdrenDRString);
healingDRLine.Text = "While healing, you take " + tooltipWithDR + "% less damage";
}
list.FindAndReplace("[DR]", fullAdrenDRString);
}
}
}
+1 -9
View File
@@ -3,7 +3,6 @@ using CalamityMod.CalPlayer;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.Rarities;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -26,14 +25,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.AegisHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip5");
if (line != null)
line.Text = "Press " + hotkey + " to activate buffs to all damage, crit chance and defense";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.AegisHotKey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
+1 -9
View File
@@ -2,7 +2,6 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using System.Linq;
namespace CalamityMod.Items.Accessories
{
@@ -31,13 +30,6 @@ namespace CalamityMod.Items.Accessories
player.Calamity().stealthGenMoving += 0.1f;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.PlaguePackHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2");
if (line != null)
line.Text = "Press " + hotkey + " to consume 25% of your maximum stealth to perform a swift upwards/diagonal dash which leaves a trail of plagued clouds";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.PlaguePackHotKey);
}
}
+6 -54
View File
@@ -43,7 +43,7 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<ProfanedSoulArtifact>();
@@ -79,66 +79,18 @@ namespace CalamityMod.Items.Accessories
bool draedon = DownedBossSystem.downedExoMechs;
if (!scal || !draedon)
{
string rejectionReason = (!draedon) ? "The soul within this crystal has been defiled by overwhelming energy waves from dangerous mechanations" : "The soul within this crystal has been defiled by the powerful magic of a supreme witch"; //there might be a better way to word the draedon line, not sure
TooltipLine lineLock = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
if (lineLock != null)
{
lineLock.Text = rejectionReason;
lineLock.OverrideColor = new Color(240, 90, 90);
}
int insertIndex = tooltips.FindIndex(x => x.Name == "Tooltip1" && x.Mod == "Terraria");
if (insertIndex != -1)
{
TooltipLine rejectLine = new TooltipLine(this.Mod, "CalamityMod:RejectLine", "Merchants will reject a defiled soul such as this.");
tooltips.Insert(insertIndex + 1, rejectLine);
}
string reject = this.GetLocalizedValue(!draedon ? "ExoMechsLock" : "CalamitasLock") + "\n" + this.GetLocalizedValue("Reject");
tooltips.FindAndReplace("[STATUS]", reject);
TooltipLine linePrice = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Sell price");
if (linePrice != null)
linePrice.Text = "";
}
else
{
TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
int manaCost = (int)(100 * Main.player[Main.myPlayer].manaCost);
if (line != null)
line.Text = "Requires 10 minion slots to use in order to grant the following effects\n" +
"All non-summon weapons are converted into powerful summon variations\n" +
"Falling below 50% life will empower these attacks";
int insertIndex = tooltips.FindIndex(x => x.Name == "Tooltip1" && x.Mod == "Terraria");
if (insertIndex != -1)
{
TooltipLine meleeAttack = new TooltipLine(this.Mod, "CalamityMod:MeleeAttack", "Transforms Melee attacks into a barrage of spears");
meleeAttack.OverrideColor = new Color(240, 90, 90);
tooltips.Insert(insertIndex + 1, meleeAttack);
TooltipLine mageAttack = new TooltipLine(this.Mod, "CalamityMod:MageAttack", $"Transforms Magic attacks into a powerful splitting fireball for {manaCost} mana per cast");
mageAttack.OverrideColor = new Color(58, 131, 228);
tooltips.Insert(insertIndex + 2, mageAttack);
TooltipLine rangedAttack = new TooltipLine(this.Mod, "CalamityMod:RangedAttack", "Transforms Ranged attacks into a flurry of fireballs and meteors");
rangedAttack.OverrideColor = new Color(133, 224, 146);
tooltips.Insert(insertIndex + 3, rangedAttack);
TooltipLine rogueAttack = new TooltipLine(this.Mod, "CalamityMod:RogueAttack", "Transforms Rogue attacks into a deadly crystalline spiral");
rogueAttack.OverrideColor = new Color(233, 116, 81);
tooltips.Insert(insertIndex + 4, rogueAttack);
TooltipLine remainingTip = new TooltipLine(this.Mod, "CalamityMod:RemainingTip", "Summons and empowers the profaned babs to fight alongside you\n" +
"You are no longer affected by burn out when hit\n" +
"Provides buffs depending on the time of day\n" +
"Thinking back, it was a boring life");
tooltips.Insert(insertIndex + 5, remainingTip);
TooltipLine purityTip = new TooltipLine(this.Mod, "CalamityMod:PurityTip", "And so we burn it all in the name of purity");
purityTip.OverrideColor = new Color(255, 191, 73);
tooltips.Insert(insertIndex + 6, purityTip);
}
string manaCost = (100 * Main.player[Main.myPlayer].manaCost).ToString("N0");
string full = this.GetLocalization("FullTooltip").Format(manaCost);
tooltips.FindAndReplace("[STATUS]", full);
}
}
+1 -9
View File
@@ -2,7 +2,6 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using System.Linq;
namespace CalamityMod.Items.Accessories
{
@@ -19,14 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.defense = 2;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.SandCloakHotkey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
if (line != null)
line.Text = "Press " + hotkey + " to consume 10% of your maximum stealth to create a protective dust veil which provides +6 defense and +2 life regen";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.SandCloakHotkey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
+23 -33
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 5));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 5));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
@@ -102,42 +102,32 @@ namespace CalamityMod.Items.Accessories
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
// Stat tooltips are added dynamically.
StringBuilder sb = new StringBuilder(256);
// Add the proper description which changes depending on world difficulty
string desc = CalamityWorld.revenge ? this.GetLocalizedValue("RageModified") : this.GetLocalization("RageAdd").Format(CalamityKeybinds.RageHotKey.TooltipHotkeyString());
tooltips.FindAndReplace("[RAGEDESC]", desc);
// Line 5: If not on Rev+, note that the accessory enables Rage.
TooltipLine rageOverTimeLine = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip4");
if (rageOverTimeLine != null && !CalamityWorld.revenge)
rageOverTimeLine.Text = "Adds the Rage meter\n" + rageOverTimeLine.Text;
// Add the current level
tooltips.FindAndReplace("[LEVEL]", level.ToString());
// Line 9: Current level
sb.Append("Current level: ");
sb.Append(level);
sb.Append(" (+");
sb.Append(level);
sb.Append("% Rage Mode damage)");
tooltips.Add(new TooltipLine(Mod, "Tooltip8", sb.ToString()));
sb.Clear();
if (level < MaxLevel)
// Add the progress
string progressKey = "[PROGRESS]";
TooltipLine progressLine = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Text.Contains(progressKey));
if (progressLine != null)
{
long progressToNextLevel = totalRageDamage - CumulativeLevelCost(level);
long totalToNextLevel = LevelCost(level + 1);
double ratio = (double)progressToNextLevel / totalToNextLevel;
string percent = (100D * ratio).ToString("0.00");
// Line 10: Progress to next level
sb.Append("Progress to next level: ");
sb.Append(percent);
sb.Append('%');
tooltips.Add(new TooltipLine(Mod, "Tooltip9", sb.ToString()));
sb.Clear();
if (level < MaxLevel)
{
long progressToNextLevel = totalRageDamage - CumulativeLevelCost(level);
long totalToNextLevel = LevelCost(level + 1);
double ratio = (double)progressToNextLevel / totalToNextLevel;
string percent = (100D * ratio).ToString("0.00");
progressLine.Text = progressLine.Text.Replace(progressKey, percent);
}
else
progressLine.Text = string.Empty;
}
// Line 11: Total damage dealt
sb.Append("Total Rage Mode damage: ");
sb.Append(totalRageDamage);
tooltips.Add(new TooltipLine(Mod, "Tooltip10", sb.ToString()));
// Add the current cumulative damage
tooltips.FindAndReplace("[DAMAGE]", totalRageDamage.ToString());
}
public override void SaveData(TagCompound tag)
@@ -228,7 +218,7 @@ namespace CalamityMod.Items.Accessories
// Display a level up text notification.
Rectangle textArea = new Rectangle((int)Player.Center.X, (int)Player.Center.Y, 1, 1);
Color textColor = new Color(236, 209, 236);
CombatText.NewText(textArea, textColor, "The Community cracks...", false, false);
CombatText.NewText(textArea, textColor, CalamityUtils.GetTextValueFromModItem<ShatteredCommunity>("LevelUpText"), false, false);
}
}
}
+1 -9
View File
@@ -1,6 +1,5 @@
using CalamityMod.Rarities;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -20,14 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.SpectralVeilHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
if (line != null)
line.Text = "Press " + hotkey + " to consume 25% of your maximum stealth to perform a mid-range teleport and render you momentarily invulnerable";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.SpectralVeilHotKey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
+34 -28
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 10));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 10));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
@@ -39,9 +39,10 @@ namespace CalamityMod.Items.Accessories
// Community and Shattered Community are mutually exclusive
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().shatteredCommunity;
// Returns the total power of the Community, from 0.0 to 1.0 (0% to 100%), based on bosses defeated in the world.
// Returns the total power of the Community, from 0.05 to 0.2, scaling based on bosses defeated in the world.
// Returns the percentage of bosses killed (from 0.0 to 1.0) instead if killsOnly is true
private static readonly int TotalCountedBosses = 42;
internal static float CalculatePower()
internal static float CalculatePower(bool killsOnly = false)
{
int numBosses = 0;
numBosses += NPC.downedSlimeKing.ToInt();
@@ -86,35 +87,40 @@ namespace CalamityMod.Items.Accessories
numBosses += DownedBossSystem.downedYharon.ToInt(); // 40
numBosses += DownedBossSystem.downedExoMechs.ToInt();
numBosses += DownedBossSystem.downedCalamitas.ToInt();
return numBosses / (float)TotalCountedBosses;
float bossDownedRatio = numBosses / (float)TotalCountedBosses;
return killsOnly ? bossDownedRatio : MathHelper.Lerp(0.05f, 0.2f, bossDownedRatio);
}
// Damage stat boosts
public const float DamageMultiplier = 0.5f; // 2.5% to 10% (x100)
public const float CritMultiplier = 25f; // 1.25% to 5%
// Defensive stat boosts
public const float HealthMultiplier = 50f; // 2% to 10% (rounded down)
public const float DRMultiplier = 0.25f; // 1.25% to 5% (x100)
public const float DefenseMultiplier = 50f; // 2 to 10 (rounded down)
// Only while affected by DoT
public const float RegenMultiplier = 10f; // 0 to 2 (rounded down), +1 added independently of the multiplier
// Mobility stat boosts
public const float SpeedMultiplier = 0.5f; // 2.5% to 10% (x100)
public const float FlightMultiplier = 1f; // 5% to 20% (x100)
public override void ModifyTooltips(List<TooltipLine> list)
{
float communityPower = CalculatePower();
float maxHealthIncrease = MathHelper.Lerp(0.025f, 0.1f, communityPower);
int lifeRegenIncrease = (int)(MathHelper.Lerp(0.005f, 0.02f, communityPower)*100);
float critChanceIncrease = MathHelper.Lerp(0.0125f, 0.05f, communityPower);
float damageIncrease = MathHelper.Lerp(0.025f, 0.1f, communityPower);
float damageReductionIncrease = MathHelper.Lerp(0.0125f, 0.05f, communityPower);
int defenseIncrease = (int)(MathHelper.Lerp(0.025f, 0.1f, communityPower)*100);
float summonKnockbackIncrease = MathHelper.Lerp(0.05f, 0.2f, communityPower);
float moveSpeedIncrease = MathHelper.Lerp(0.025f, 0.1f, communityPower);
float flightTimeIncrease = MathHelper.Lerp(0.05f, 0.2f, communityPower);
TooltipLine line = list.LastOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip4");
if (line != null)
line.Text +=
"\nMax health increased by " + (maxHealthIncrease*100).ToString("n1") + "%\n" +
"Life regeneration increased by " + (1+lifeRegenIncrease) + "\n" +
"Critical strike chance increased by " + (critChanceIncrease*100).ToString("n1") + "%\n" +
"Damage increased by " + (damageIncrease*100).ToString("n1") + "%\n" +
"Damage reduction increased by " + (damageReductionIncrease*100).ToString("n1") + "%\n" +
"Defense increased by " + defenseIncrease + "\n" +
"Minion knockback increased by " + (summonKnockbackIncrease*100).ToString("n1") + "%\n" +
"Movement speed increased by " + (moveSpeedIncrease*100).ToString("n1") + "%\n" +
"Flight time increased by " + (flightTimeIncrease*100).ToString("n1") + "%";
float power = CalculatePower();
string statList = this.GetLocalization("StatsList").Format(
(DamageMultiplier * power * 100).ToString("N1"),
(CritMultiplier * power).ToString("N0"),
(int)(HealthMultiplier * power),
(DRMultiplier * power * 100).ToString("N2"),
(int)(DefenseMultiplier * power),
1 + (int)(RegenMultiplier * power),
(SpeedMultiplier * power * 100).ToString("N1"),
(FlightMultiplier * power * 100).ToString("N1"),
(CalculatePower(true) * 100).ToString("N0"));
list.FindAndReplace("[STATS]", statList);
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
-11
View File
@@ -28,17 +28,6 @@ namespace CalamityMod.Items.Accessories.Wings
Item.rare = ItemRarityID.Lime;
Item.accessory = true;
}
public override void ModifyTooltips(List<TooltipLine> tooltips)
{
string down = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "Down");
string jump = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "Jump");
string up = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "Up");
string hoverText = Player.Settings.HoverControl == Player.Settings.HoverControlMode.Hold ? "Hold " + down + " and " + jump + " to hover" : "Press " + down + " to toggle hover\nPress " + up + " to deactivate hover";
TooltipLine hover = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
if (hover != null)
hover.Text = hoverText;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
+1 -2
View File
@@ -23,8 +23,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.yInsignia = true;
player.GetAttackSpeed<MeleeDamageClass>() += 0.1f;
player.GetDamage<TrueMeleeDamageClass>() += 0.1f;
player.GetDamage<TrueMeleeDamageClass>() += 0.15f;
}
public override void AddRecipes()
-4
View File
@@ -1,5 +1,4 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
@@ -39,7 +38,6 @@ namespace CalamityMod.Items.Armor.Auric
public override void UpdateEquip(Player player)
{
var modPlayer = player.Calamity();
modPlayer.fBarrier = true;
player.statLifeMax2 += 100;
player.GetDamage<GenericDamageClass>() += 0.08f;
player.GetCritChance<GenericDamageClass>() += 5;
@@ -51,7 +49,6 @@ namespace CalamityMod.Items.Armor.Auric
AddIngredient<GodSlayerChestplate>().
AddIngredient<BloodflareBodyArmor>().
AddIngredient<TarragonBreastplate>().
AddIngredient<FrostBarrier>().
AddIngredient<AuricBar>(18).
AddTile<CosmicAnvil>().
Register();
@@ -60,7 +57,6 @@ namespace CalamityMod.Items.Armor.Auric
AddIngredient<SilvaArmor>().
AddIngredient<BloodflareBodyArmor>().
AddIngredient<TarragonBreastplate>().
AddIngredient<FrostBarrier>().
AddIngredient<AuricBar>(18).
AddTile<CosmicAnvil>().
Register();
+1 -10
View File
@@ -1,6 +1,5 @@
using CalamityMod.Rarities;
using System.Collections.Generic;
using System.Linq;
using Terraria.ID;
using Terraria.ModLoader;
@@ -23,14 +22,6 @@ namespace CalamityMod.Items.Mounts
Item.rare = ModContent.RarityType<Violet>();
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.ExoChairSlowdownHotkey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
if (line != null)
line.Text = $"Hold {hotkey} while sitting in the throne to move slower for more precision";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.ExoChairSlowdownHotkey);
}
}
+1 -9
View File
@@ -6,7 +6,6 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using System.Linq;
namespace CalamityMod.Items
{
@@ -28,14 +27,7 @@ namespace CalamityMod.Items
Item.Calamity().donorItem = true;
}
public override void ModifyTooltips(List<TooltipLine> list)
{
string hotkey = CalamityKeybinds.NormalityRelocatorHotKey.TooltipHotkeyString();
TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1");
if (line != null)
line.Text = "Press " + hotkey + " to teleport to the position of the mouse";
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.NormalityRelocatorHotKey);
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
@@ -65,7 +65,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings
"AquaSG",
"Atalya",
"Ben-TK",
"Blastitle",
"Cei",
"Cooper",
"CrabBar",
@@ -108,6 +107,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings
"Amadis",
"AstroKnight",
"Blast",
"Blastitle",
"Blockaroz",
"Boffin",
"Bravioli",
+2 -2
View File
@@ -95,11 +95,11 @@ namespace CalamityMod.Items.Weapons.Summon
if (!sufficientSpace)
{
Rectangle displayZone = player.Hitbox;
CombatText.NewText(displayZone, new Color(203, 157, 255), "Insufficient space!", true);
CombatText.NewText(displayZone, new Color(203, 157, 255), CalamityUtils.GetTextValueFromModItem<FlamsteedRing>("NoSpaceTextBottom"), true);
displayZone.Y -= 30;
CombatText.NewText(displayZone, new Color(59, 194, 255), "Cannot Deploy", true);
CombatText.NewText(displayZone, new Color(59, 194, 255), CalamityUtils.GetTextValueFromModItem<FlamsteedRing>("NoSpaceTextTop"), true);
return false;
}
@@ -98,11 +98,11 @@ HadarianWings: {
DisplayName: Hadarian Wings
Tooltip:
'''
This line gets modified below
Horizontal speed: 9.00
Acceleration multiplier: 1.75
Good vertical speed
Flight time: 90
{$CommonItemTooltip.PressDownToHover}
Powered by the Astral Infection
'''
}
@@ -153,7 +153,7 @@ AngelicAlliance: {
Courage, Enlightenment, Bliss. United in Judgement
+2 max minions, 15% increased summon damage, and 8% increased damage to all other classes
Life regeneration is boosted while jumping
This line is modified in the code below. If you can read this, someone probably did something wrong (It was Ben)
Press [KEY] to grace yourself in divinity for 15 seconds
While under the effects of Divine Bless, for every minion you have, an archangel shall be summoned to aid you in combat
Each spawned angel will instantly heal you for two health
All minion attacks inflict Banishing Fire and you are granted a flat health boost of four health per second
@@ -221,7 +221,7 @@ AsgardianAegis: {
+40 max life and increased life regeneration
Grants a supreme god slayer flame dash
Can be used to ram enemies
TOOLTIP LINE HERE
Press [KEY] to activate buffs to all damage, crit chance, and defense
Activating this buff will reduce your movement speed and increase enemy aggro
+20 defense while submerged in liquid
'''
@@ -246,7 +246,7 @@ AstralArcanum: {
Provides immunity to the astral infection debuff
Boosts life regen even while under the effects of a damaging debuff
While under the effects of a damaging debuff you will gain 15 defense
TOOLTIP LINE HERE
Press [KEY] to toggle teleportation UI while no bosses are alive
'''
}
@@ -330,7 +330,7 @@ BlunderBooster: {
12% increased rogue damage and 15% increased rogue projectile velocity
Stealth generates 10% faster
Summons a red lightning aura to surround the player and electrify nearby enemies
TOOLTIP LINE HERE
Press [KEY] to consume 25% of your maximum stealth to perform a swift upwards/diagonal dash which leaves a trail of lightning bolts
This effect has a 1 second cooldown before it can be used again
'''
}
@@ -352,7 +352,7 @@ CelestialJewel: {
'''
Boosts life regen even while under the effects of a damaging debuff
While under the effects of a damaging debuff you will gain 11 defense
TOOLTIP LINE HERE
Press [KEY] to teleport to a random location while no bosses are alive
'''
}
@@ -541,14 +541,24 @@ DraedonsHeart: {
DisplayName: Draedon's Heart
Tooltip:
'''
15% reduced contact damage from enemies
Reduces defense damage taken by 50%
Replaces Adrenaline with the Nanomachines meter
Unlike Adrenaline, you lose no Nanomachines when you take damage, but they stop accumulating for 1 second
With full Nanomachines, press & to heal 360 health over 2 seconds
While healing, you gain 50% damage reduction
{0}% reduced contact damage from enemies
Reduces defense damage taken by {1}%
[NANODESC]
With full Nanomachines, press [KEY] to heal {2} health over {3} {^3:second;seconds}
While healing, you take [DR]% less damage
'Nanomachines, son'
'''
NanomachinesAdd:
'''
Adds the Nanomachines meter
Nanomachines accumulate over time while fighting bosses
Taking damage stops the accumulation for {0} {^0:second;seconds}
'''
NanomachinesReplace:
'''
Replaces Adrenaline with the Nanomachines meter
Unlike Adrenaline, you lose no Nanomachines when you take damage, but they stop accumulating for {0} {^0:second;seconds}
'''
}
DragonScales: {
@@ -640,7 +650,7 @@ ElysianAegis: {
+30 max life
Grants a supreme holy flame dash
Can be used to ram enemies
TOOLTIP LINE HERE
Press [KEY] to activate buffs to all damage, crit chance and defense
Activating this buff will reduce your movement speed and increase enemy aggro
Blessed by the Profaned Flame
'''
@@ -1215,7 +1225,7 @@ PlaguedFuelPack: {
'''
8% increased rogue damage and 15% increased rogue projectile velocity
Stealth generates 10% faster
TOOLTIP LINE HERE
Press [KEY] to consume 25% of your maximum stealth to perform a swift upwards/diagonal dash which leaves a trail of plagued clouds
This effect has a 1 second cooldown before it can be used again
'''
}
@@ -1247,7 +1257,24 @@ ProfanedSoulCrystal: {
Tooltip:
'''
Transforms you into an emissary of the profaned goddess
This tooltip gets modified
[STATUS]
'''
ExoMechsLock: "[c/F05A5A:The soul within this crystal has been defiled by overwhelming energy waves from dangerous mechanations]"
CalamitasLock: "[c/F05A5A:The soul within this crystal has been defiled by the powerful magic of a supreme witch]"
Reject: Merchants will reject a defiled soul such as this.
FullTooltip:
'''
Requires 10 minion slots to use in order to grant the following effects
All non-summon weapons are converted into powerful summon variations
Falling below 50% life will empower these attacks
[c/F05A5A:Transforms Melee attacks into a barrage of spears]
[c/3A83E4:Transforms Magic attacks into a powerful splitting fireball for {0} mana per cast]
[c/85E092:Transforms Ranged attacks into a flurry of fireballs and meteors]
[c/E94571:Transforms Rogue attacks into a deadly crystalline spiral]
Summons and empowers the profaned babs to fight alongside you
Provides buffs depending on the time of day
Thinking back, it was a boring life
[c/FFBF49:And so we burn it all in the name of purity]
'''
}
@@ -1371,7 +1398,7 @@ SandCloak: {
Tooltip:
'''
5% increased movement speed
TOOLTIP LINE HERE
Press [KEY] to consume 10% of your maximum stealth to create a protective dust veil which provides +6 defense and +2 life regen
This effect has a 30 second cooldown before it can be used again
'''
}
@@ -1402,11 +1429,21 @@ ShatteredCommunity: {
Increases damage by 10% and critical strike chance by 5%
Increases max health by 10%, damage reduction by 5%, defense by 10 and life regen by 2
Increases movement speed by 10% and flight time by 20%
You generate rage over time and rage does not fade away out of combat
[RAGEDESC]
Taking damage gives rage, this effect is not hindered by your defensive stats
While Rage Mode is active, taking damage gives only half as much rage
Deal damage with Rage Mode to further empower your wrath
Current level: [LEVEL] (+[LEVEL]% Rage Mode damage)
Progress to next level: [PROGRESS]%
Total Rage Mode damage: [DAMAGE]
'''
RageAdd:
'''
Adds the Rage meter, which generates over time
Rage generates faster when in proximity of enemies
When Rage is maxed, press {0} for a temporary damage boost
'''
RageModified: You generate rage over time and rage does not fade out of combat
}
ShieldoftheHighRuler: {
@@ -1451,7 +1488,7 @@ SpectralVeil: {
DisplayName: Spectral Veil
Tooltip:
'''
TOOLTIP LINE HERE
Press [KEY] to consume 25% of your maximum stealth to perform a mid-range teleport and render you momentarily invulnerable
If you dodge something while invulnerable, you instantly gain full stealth
Teleportation is disabled while Chaos State is active
Stealth generates 15% faster
@@ -1625,12 +1662,18 @@ TheCommunity: {
DisplayName: The Community
Tooltip:
'''
Starts off with weak buffs to all of your stats
The stat buffs become more powerful as you defeat bosses
Reduces the DoT effects of harmful debuffs inflicted on you
[STATS]
'The heart of (most of) the Terraria community'
[c/b00ba5:Thank you to all of my supporters who made this mod a reality!]
'''
StatsList:
'''
Increases damage by {0}% and critical strike chance by {1}%
Increases max health by {2}%, damage reduction by {3}%, and defense by {4}
Increases life regen by {5} while under damage over time effects
Increases movement speed by {6}% and flight time by {7}%
Become more powerful as you defeat bosses ({8}% Power)
'''
}
TheEvolution: {
@@ -1846,8 +1889,7 @@ YharimsInsignia: {
Tooltip:
'''
10% increased damage when under 50% life
10% increased melee speed
10% increased melee and true melee damage
15% increased melee and true melee damage
All melee attacks inflict Holy Flames
Increased melee knockback
'''
@@ -4,7 +4,6 @@ AuricTeslaBodyArmor: {
'''
+100 max life
8% increased damage and 5% increased critical strike chance
You will freeze enemies near you when you are struck
'''
}
@@ -255,7 +255,7 @@ NormalityRelocator: {
DisplayName: Normality Relocator
Tooltip:
'''
This line is modified below
Press [KEY] to teleport to the position of the mouse
Fall speed is doubled for 30 frames after teleporting
Teleportation is disabled while Chaos State is active
Works while in the inventory
@@ -8,7 +8,7 @@ ExoThrone: {
Tooltip:
'''
Materializes a quite cozy and extremely nimble flying Exo throne
Replaced
Hold [KEY] while sitting in the throne to move slower for more precision
'A comfortable gamer is a dangerous gamer'
'''
}
@@ -145,18 +145,6 @@ Cnidarian: {
'''
}
GlacialEmbrace: {
DisplayName: Glacial Embrace
Tooltip:
'''
Summons the power of the ancient ice castle
For each minion slot used, you will gain an additional orbiting shield spike
These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage
They take some time to regenerate after launching themselves at the target, however
On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding
'''
}
CorroslimeStaff: {
DisplayName: Corroslime Staff
Tooltip: Summons a corro slime to fight for you
@@ -334,6 +322,8 @@ EyeOfNight: {
FlamsteedRing: {
DisplayName: Flamsteed Ring
NoSpaceTextTop: Cannot Deploy
NoSpaceTextBottom: Insufficient space!
Tooltip:
'''
Summons a colossal controllable mech
@@ -400,6 +390,18 @@ GastricBelcherStaff: {
'''
}
GlacialEmbrace: {
DisplayName: Glacial Embrace
Tooltip:
'''
Summons the power of the ancient ice castle
For each minion slot used, you will gain an additional orbiting shield spike
These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage
They take some time to regenerate after launching themselves at the target, however
On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding
'''
}
GodspawnHelixStaff: {
DisplayName: Godspawn Helix Staff
Tooltip: Summons astral probes to protect you
+12 -1
View File
@@ -35,9 +35,20 @@ PlanetoidSchematicRecipeCondition: Place a schematic from the lab in the large p
JungleSchematicRecipeCondition: Place a schematic from the lab deep within the jungle in your inventory at least once
UnderworldSchematicRecipeCondition: Place a schematic from the lab near the edges of the underworld in your inventory at least once
IceSchematicRecipeCondition: Place a schematic from the lab within the frozen caverns in your inventory at least once
// Item Messages
// Other CombatText uses and Item Messages
ShiftToExpand: Hold SHIFT to see an expanded description
LearnedSchematic: You learned how to create new things!
CragmawVibeCheck: Vibe check.
AutocannonHot: OUCH! HOT!
NoComputer: No decryption computer installed
ArkParry: Parry!
ClockworkTick: Tick
ClockworkTock: Tock
SevensJackpot: Jackpot!!!
SevensBust: Bust!
SevensDoubles: Doubles!
SevensTriples: Triples!
StylishHammerHit: Stylish!
ThirdSageBlessingText: You have been blessed by the Third Sage!
ThirdSageBlessingText2: The Third Sage has rescinded its blessing...
GenericConsumedText: "[c/8a8a8a:You have already consumed this item]"
@@ -576,6 +576,7 @@ AndroombaFriendly.DisplayName: Androomba Pal
DILF: {
DisplayName: Archmage
Census.SpawnCondition: Defeat Cryogen
Name.Permafrost: Permafrost
Chat: {
@@ -614,6 +615,7 @@ DILF: {
FAP: {
DisplayName: Drunk Princess
Census.SpawnCondition: Have {$Mods.CalamityMod.Items.Potions.FabsolsVodka.DisplayName} [i:CalamityMod/FabsolsVodka] in your inventory in Hardmode
Name.Cirrus: Cirrus
Chat: {
@@ -708,6 +710,7 @@ FAP: {
SEAHOE: {
DisplayName: Sea King
Census.SpawnCondition: Defeat a Giant Clam after defeating the Desert Scourge
Name.Amidias: Amidias
Chat: {
@@ -792,6 +795,7 @@ SEAHOE: {
THIEF: {
DisplayName: Bandit
Census.SpawnCondition: Have a {$ItemName.PlatinumCoin} [i:PlatinumCoin] in your inventory after defeating Skeletron
Name: {
Laura: Laura
@@ -872,6 +876,7 @@ THIEF: {
WITCH: {
DisplayName: Brimstone Witch
Census.SpawnCondition: Defeat Supreme Witch, Calamitas
Name.Calamitas: Calamitas
Chat: {
@@ -72,6 +72,8 @@ HolyFire2.DisplayName: Holy Fire
HolyFlare.DisplayName: Holy Flare
HolyLight.DisplayName: Holy Light
HolySpear.DisplayName: Holy Spear
HomingGasBulb.DisplayName: Homing Gas Bulb
HomingGasBulbSporeGas.DisplayName: Homing Gas Bulb Spore Gas
IceBlast.DisplayName: Ice Blast
IceBomb.DisplayName: Ice Bomb
IceRain.DisplayName: Ice Rain
@@ -138,6 +140,7 @@ SwirlingFire.DisplayName: Fire
ThanatosBeamStart.DisplayName: T Hanos Beam
ThanatosBeamTelegraph.DisplayName: Gamma Disintegration Beam Telegraph
ThanatosLaser.DisplayName: Exo Pulse Laser
ThornBallSpike.DisplayName: Thorn Ball Spike
ToxicCloud.DisplayName: Toxic Cloud
UnstableCrimulanGlob.DisplayName: Unstable Crimulan Glob
UnstableEbonianGlob.DisplayName: Unstable Ebonian Glob
@@ -145,4 +148,6 @@ VileClot.DisplayName: Vile Clot
WaterSpear.DisplayName: Water Spear
YharonBulletHellVortex.DisplayName: Bullet Hell Vortex
YharonFireball.DisplayName: Dragon Fireball
YharonFireball2.DisplayName: Dragon Fireball
YharonFireball2.DisplayName: Dragon Fireball
ThornBallSpike.DisplayName: Thorn Ball Spike
HomingGasBulb.DisplayName: Homing Gas Bulb
@@ -20,9 +20,9 @@ Server: Server
Terminal: Terminal
// Individual entries
// Sulphurous Sea & Abyss
SteamGeyser1.MapEntry: Geyser
AbyssVent1.MapEntry: Steam Vent
ThermalVent1.MapEntry: Thermal Vent
SteamGeyser.MapEntry: Geyser
AbyssVent.MapEntry: Steam Vent
ThermalVent.MapEntry: Thermal Vent
// Brimstone Crag
SpineSapling.MapEntry: Spine Sapling
SpineTree.MapEntry: Giant Spine
@@ -46,19 +46,13 @@ UelibloomOre.MapEntry: Uelibloom
ArenaTile.MapEntry: Arena
AshenChest: {
MapEntry0: "{$ItemName.AshenChest}"
MapEntry1: Locked Ashen Chest
MapEntry0: "{$Mods.CalamityMod.Items.Placeables.AshenChest.DisplayName}"
MapEntry1: Locked {$Mods.CalamityMod.Items.Placeables.AshenChest.DisplayName}
}
AstralChestLocked: {
MapEntry0: "{$ItemName.AstralChest}"
MapEntry1: Locked Astral Chest
MapEntry0: "{$Mods.CalamityMod.Items.Placeables.AstralChest.DisplayName}"
MapEntry1: Locked {$Mods.CalamityMod.Items.Placeables.AstralChest.DisplayName}
}
PlaguedPlateBed.MapEntry: "'Bed'"
SteamGeyser3.MapEntry: Steam Geyser3
SteamGeyser2.MapEntry: Steam Geyser2
ThermalVent3.MapEntry: Thermal Vent3
ThermalVent2.MapEntry: Thermal Vent2
AbyssVent3.MapEntry: Abyss Vent3
AbyssVent2.MapEntry: Abyss Vent2
PlaguedPlateBed.MapEntry: "'Bed'"
@@ -88,6 +88,8 @@ Cooldowns: {
InkBomb: Ink Bomb Cooldown
LifeSteal: Life Steal Cooldown
LionHeartShield: Energy Shell Cooldown
MasterChefShieldDurability: Energy Shield Durability
MasterChefShieldRecharge: Energy Shield Recharge
NebulousCore: Nebulous Core Cooldown
OmegaBlueActive: Abyssal Madness
OmegaBlueCooldown: Abyssal Madness Cooldown
-15
View File
@@ -198,7 +198,6 @@ namespace CalamityMod
{
BossChecklistSupport();
FargosSupport();
CensusSupport();
DialogueTweakSupport();
SummonersAssociationSupport();
}
@@ -828,7 +827,6 @@ namespace CalamityMod
int type = NPCType<SupremeCalamitas>();
List<int> summons = new List<int>() { ItemType<AshesofCalamity>(), ItemType<CeremonialUrn>() };
List<int> collection = new List<int>() { ItemType<CalamitasRelic>(), ItemType<SupremeCalamitasTrophy>(), ItemType<SupremeCataclysmTrophy>(), ItemType<SupremeCatastropheTrophy>(), ItemType<AshenHorns>(), ItemType<SCalMask>(), ItemType<SCalRobes>(), ItemType<SCalBoots>(), ItemType<LoreCalamitas>(), ItemType<LoreCynosure>(), ItemType<BrimstoneJewel>(), ItemType<Levi>(), ItemType<ThankYouPainting>() };
string bossHeadTex = "CalamityMod/NPCs/SupremeCalamitas/HoodedHeadIcon";
AddBoss(bossChecklist, calamity, entryName, order, type, DownedSCal, new Dictionary<string, object>()
{
["spawnItems"] = summons,
@@ -973,19 +971,6 @@ namespace CalamityMod
AddToMutantShop("OldDuke", "BloodwormItem", DownedBoomerDuke, Item.buyPrice(platinum: 2));
}
private static void CensusSupport()
{
Mod censusMod = GetInstance<CalamityMod>().census;
if (censusMod != null)
{
censusMod.Call("TownNPCCondition", NPCType<SEAHOE>(), "Defeat a Giant Clam after defeating the Desert Scourge");
censusMod.Call("TownNPCCondition", NPCType<THIEF>(), "Have a [i:" + ItemID.PlatinumCoin + "] in your inventory after defeating Skeletron");
censusMod.Call("TownNPCCondition", NPCType<FAP>(), "Have [i:" + ItemType<FabsolsVodka>() + "] in your inventory in Hardmode");
censusMod.Call("TownNPCCondition", NPCType<DILF>(), "Defeat Cryogen");
censusMod.Call("TownNPCCondition", NPCType<WITCH>(), "Defeat Supreme Witch, Calamitas");
}
}
private static void DialogueTweakSupport()
{
Mod dialogueMod = GetInstance<CalamityMod>().dialogueTweak;
+13
View File
@@ -1278,6 +1278,9 @@ namespace CalamityMod.NPCs
{
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
// Emit light
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1f, 0f, 0f);
// Variables for increasing difficulty
bool bossRush = BossRushEvent.BossRushActive;
bool death = CalamityWorld.death || bossRush;
@@ -1978,6 +1981,9 @@ namespace CalamityMod.NPCs
CalamityGlobalNPC.cataclysm = npc.whoAmI;
// Emit light
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1f, 0f, 0f);
bool bossRush = BossRushEvent.BossRushActive;
bool death = CalamityWorld.death || bossRush;
bool revenge = CalamityWorld.revenge || bossRush;
@@ -2282,6 +2288,9 @@ namespace CalamityMod.NPCs
CalamityGlobalNPC.catastrophe = npc.whoAmI;
// Emit light
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1f, 0f, 0f);
bool bossRush = BossRushEvent.BossRushActive;
bool death = CalamityWorld.death || bossRush;
bool revenge = CalamityWorld.revenge || bossRush;
@@ -2747,6 +2756,10 @@ namespace CalamityMod.NPCs
npc.noGravity = true;
}
// Emit light when not Idle
if (npc.ai[0] != 1f)
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1.3f, 0.5f, 0f);
// Fire projectiles while walking, teleporting, or falling
if (npc.ai[0] == 2f || npc.ai[0] >= 5f)
{
-189
View File
@@ -11252,194 +11252,5 @@ namespace CalamityMod.NPCs
#endregion
#endregion
#region DD2 Event AIs
public static int DD2EventEnemySpawnRate
{
get
{
int enemySpawnRateSpeedup = 0;
if (Main.npc.IndexInRange(CalamityGlobalNPC.DD2CrystalIndex) && Main.npc[CalamityGlobalNPC.DD2CrystalIndex].active)
enemySpawnRateSpeedup = (int)Main.npc[CalamityGlobalNPC.DD2CrystalIndex].ai[2];
return Utils.Clamp(DD2Event.LaneSpawnRate - enemySpawnRateSpeedup, 15, DD2Event.LaneSpawnRate);
}
}
public static void DD2PortalAI(NPC npc)
{
// Idly emit light if the portal has completely faded in.
if (npc.alpha == 0)
Lighting.AddLight(npc.Center, 0.5f, 0.1f, 0.3f);
ref float enemySpawnTimer = ref npc.ai[0];
ref float fadeOutTimer = ref npc.ai[2];
ref float fadeInTimer = ref npc.localAI[0];
ref float idlePlaySoundId = ref npc.localAI[3];
if (npc.ai[1] == 0f)
{
// Play the portal opening sound at the moment of the portal's creation.
if (fadeInTimer == 0f)
{
SoundEngine.PlaySound(SoundID.DD2_EtherianPortalOpen, npc.Center);
idlePlaySoundId = SlotId.Invalid.ToFloat();
}
ActiveSound soundOut;
if (fadeInTimer > 150f && !SoundEngine.TryGetActiveSound(SlotId.FromFloat(idlePlaySoundId), out soundOut))
idlePlaySoundId = SoundEngine.PlaySound(SoundID.DD2_EtherianPortalIdleLoop, npc.Center).ToFloat();
if (!DD2Event.EnemySpawningIsOnHold)
enemySpawnTimer++;
if (enemySpawnTimer >= DD2EventEnemySpawnRate)
{
if (enemySpawnTimer >= DD2EventEnemySpawnRate * 3)
enemySpawnTimer = 0f;
if (Main.netMode != NetmodeID.MultiplayerClient && (int)enemySpawnTimer % DD2EventEnemySpawnRate == 0)
{
DD2Event.SpawnMonsterFromGate(npc.Bottom);
// If enemy spawning is on hold, add 1 to the spawn timer to ensure that the above
// modulo doesn't get activated every single frame due to no other change above.
if (DD2Event.EnemySpawningIsOnHold)
enemySpawnTimer++;
}
npc.netUpdate = true;
}
fadeInTimer++;
// Begin to fade out of existence if the crystal is gone and the portal is done doing fade-in effects.
if (Main.netMode != NetmodeID.MultiplayerClient && !NPC.AnyNPCs(NPCID.DD2EterniaCrystal) && fadeInTimer >= 180f)
{
npc.ai[1] = 1f;
enemySpawnTimer = 0f;
npc.dontTakeDamage = true;
npc.netUpdate = true;
}
}
// Fade-out effects.
else if (npc.ai[1] == 1f)
{
fadeOutTimer++;
npc.scale = MathHelper.Lerp(1f, 0.05f, Utils.GetLerpValue(500f, 600f, fadeOutTimer, true));
// Reset the idle play sound if it didn't get activated before for some reason.
ActiveSound result;
if (!SoundEngine.TryGetActiveSound(SlotId.FromFloat(idlePlaySoundId), out result))
idlePlaySoundId = SoundEngine.PlaySound(SoundID.DD2_EtherianPortalIdleLoop, npc.Center).ToFloat();
ActiveSound activeSound;
if (SoundEngine.TryGetActiveSound(SlotId.FromFloat(idlePlaySoundId), out activeSound))
activeSound.Volume = npc.scale;
// Kill the portal after enough time has passed.
if (fadeOutTimer >= 550f)
{
npc.dontTakeDamage = false;
npc.life = 0;
npc.checkDead();
npc.netUpdate = true;
if (activeSound != null)
{
activeSound.Stop();
return;
}
}
}
}
public static void DD2CrystalExtraAI(NPC npc)
{
CalamityGlobalNPC.DD2CrystalIndex = npc.whoAmI;
ref float initialClickDelay = ref npc.localAI[3];
ref float enemySpawnRateSpeedup = ref npc.ai[2];
ref float animationCountdown = ref npc.ai[3];
if (animationCountdown > 0f)
animationCountdown--;
// This is done to ensure that the initial click on the pedestal is not registered as a click to the crystal itself.
initialClickDelay++;
bool clickingOnCrystal = Main.mouseRight && Main.mouseRightRelease && CalamityUtils.MouseHitbox.Intersects(npc.Hitbox) && initialClickDelay > 25f;
// Reset the spawn rate speed-up after the wave is over.
if (Main.netMode != NetmodeID.MultiplayerClient && DD2Event.TimeLeftBetweenWaves > 1 && enemySpawnRateSpeedup != 0f)
{
enemySpawnRateSpeedup = 0f;
npc.netUpdate = true;
}
if (clickingOnCrystal && npc.WithinRange(Main.LocalPlayer.Center, 285f))
{
bool changeOccured = false;
// If the event is waiting for time to pass and a player clicks on the crystal skip the wait.
if (DD2Event.TimeLeftBetweenWaves > 1)
{
DD2Event.TimeLeftBetweenWaves = 1;
if (Main.netMode == NetmodeID.Server)
NetMessage.SendData(MessageID.CrystalInvasionSendWaitTime, -1, -1, null, DD2Event.TimeLeftBetweenWaves);
changeOccured = true;
}
// Otherwise speed up the portal spawn rate for this wave.
else
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int oldSpawnRate = DD2EventEnemySpawnRate;
enemySpawnRateSpeedup += 8f;
// Release a circle of dust if a change was made to show that changes are indeed being done
// since the animation might be ongoing when this action is performed.
if (!Main.dedServ && oldSpawnRate != DD2EventEnemySpawnRate)
{
for (int i = 0; i < 55; i++)
{
for (float speed = 6f; speed < 13f; speed += 4f)
{
Vector2 shootDirection = (MathHelper.TwoPi * i / 55f).ToRotationVector2() * new Vector2(1f, 0.6f);
Dust etherealLight = Dust.NewDustPerfect(npc.Center - Vector2.UnitY * 20f + shootDirection * 12f, 264);
etherealLight.velocity = shootDirection * speed;
etherealLight.fadeIn = 0f;
etherealLight.scale = 2.3f;
etherealLight.noGravity = true;
etherealLight.noLight = true;
}
}
changeOccured = true;
}
npc.netUpdate = true;
}
}
// Play an animation to accompany the change.
if (changeOccured)
{
if (animationCountdown <= 0f)
animationCountdown = 120f;
SoundEngine.PlaySound(SoundID.DD2_DarkMageHealImpact);
}
// As well as some indicator text.
if (changeOccured)
{
bool dramaticText = DD2EventEnemySpawnRate <= 25;
Color textColor = dramaticText ? Color.DeepPink : Color.Pink;
string[] potentialTexts = new string[]
{
"The invasion hastens!",
"The ethereal invaders march ever-faster!"
};
CombatText.NewText(npc.Hitbox, textColor, Main.rand.Next(potentialTexts), dramaticText);
}
}
}
#endregion DD2 Event AIs
}
}
+11 -11
View File
@@ -255,7 +255,6 @@ namespace CalamityMod.NPCs
// whoAmI Variables
public static int[] bobbitWormBottom = new int[5];
public static int DD2CrystalIndex = -1;
public static int hiveMind = -1;
public static int perfHive = -1;
public static int slimeGodPurple = -1;
@@ -498,7 +497,6 @@ namespace CalamityMod.NPCs
for (int i = 0; i < bobbitWormBottom.Length; i++)
ResetSavedIndex(ref bobbitWormBottom[i], NPCType<BobbitWormSegment>());
ResetSavedIndex(ref DD2CrystalIndex, NPCID.DD2EterniaCrystal);
ResetSavedIndex(ref hiveMind, NPCType<HiveMind.HiveMind>());
ResetSavedIndex(ref perfHive, NPCType<PerforatorHive>());
ResetSavedIndex(ref slimeGodPurple, NPCType<SlimeGod.EbonianPaladin>(), NPCType<SplitEbonianPaladin>());
@@ -3784,12 +3782,6 @@ namespace CalamityMod.NPCs
}
}
if (npc.type == NPCID.DD2LanePortal)
{
CalamityGlobalAI.DD2PortalAI(npc);
return false;
}
return true;
}
#endregion
@@ -4310,9 +4302,6 @@ namespace CalamityMod.NPCs
if (pearlAura > 0)
npc.velocity *= 0.9f;
}
if (npc.type == NPCID.DD2EterniaCrystal)
CalamityGlobalAI.DD2CrystalExtraAI(npc);
}
#endregion
@@ -5531,6 +5520,17 @@ namespace CalamityMod.NPCs
if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode && CalamityWorld.revenge))
return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, npc.alpha);
// Spore Gas vomit color telegraph
if (npc.type == NPCID.Plantera && (CalamityWorld.revenge || BossRushEvent.BossRushActive))
{
bool startChangingColor = npc.ai[1] > PlanteraAI.SeedGatlingColorChangeGateValue;
if (startChangingColor)
{
float colorChangeAmount = npc.ai[1] - PlanteraAI.SeedGatlingColorChangeGateValue;
return Color.Lerp(drawColor, Color.Green, colorChangeAmount / PlanteraAI.SeedGatlingColorChangeDuration);
}
}
if (npc.type == NPCID.QueenBee && Main.zenithWorld)
{
if (npc.life / (float)npc.lifeMax < 0.5f)
+7
View File
@@ -281,6 +281,9 @@ namespace CalamityMod.NPCs.DesertScourge
if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
perturbedSpeed *= Main.rand.NextFloat() + 0.5f;
for (int k = 0; k < 10; k++)
Dust.NewDust(NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, 10, 10, 85, perturbedSpeed.X, perturbedSpeed.Y);
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer);
if (Main.zenithWorld)
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 3f, perturbedSpeed, type2, damage, 0f, Main.myPlayer);
@@ -444,6 +447,10 @@ namespace CalamityMod.NPCs.DesertScourge
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
for (int k = 0; k < 10; k++)
Dust.NewDust(NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, 10, 10, 85, perturbedSpeed.X, perturbedSpeed.Y);
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer);
}
}
+2 -2
View File
@@ -742,14 +742,14 @@ namespace CalamityMod.NPCs.DevourerofGods
if (NPC.Opacity >= 1f && (distanceFromTarget > 480f || (CalamityWorld.LegendaryMode && CalamityWorld.revenge)) && NPC.SafeDirectionTo(player.Center).AngleBetween((NPC.rotation - MathHelper.PiOver2).ToRotationVector2()) < MathHelper.ToRadians(18f))
{
calamityGlobalNPC.newAI[0] += 1f;
if (calamityGlobalNPC.newAI[0] >= ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 50f : 150f) && calamityGlobalNPC.newAI[0] % (phase7 ? 30f : 60f) == 0f)
if (calamityGlobalNPC.newAI[0] >= ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 30f : 150f) && calamityGlobalNPC.newAI[0] % ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 30f : phase7 ? 30f : 60f) == 0f)
{
float fireballSpeed = 8f;
Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * fireballSpeed + NPC.velocity * 0.5f;
Vector2 dustVelocity = fireballVelocity * 2f;
for (int k = 0; k < 50; k++)
Dust.NewDust(NPC.Center, 52, 52, (int)CalamityDusts.PurpleCosmilite, dustVelocity.X, dustVelocity.Y, 0, default, 1f);
Dust.NewDust(NPC.Center, 52, 52, (int)CalamityDusts.PurpleCosmilite, dustVelocity.X, dustVelocity.Y);
int type = ModContent.ProjectileType<DoGFire>();
int damage = NPC.GetProjectileDamage(type);
+92 -6
View File
@@ -638,8 +638,17 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
projectile.type == ModContent.ProjectileType<ApolloFireball>() ||
projectile.type == ModContent.ProjectileType<ApolloRocket>())
{
projectile.Kill();
projectile.owner = Main.maxPlayers;
// Prevent splitting and spawn death dust
if (projectile.type == ModContent.ProjectileType<ApolloFireball>())
{
SpawnApolloFireballKillDust(projectile);
projectile.active = false;
}
else
{
projectile.Kill();
projectile.owner = Main.maxPlayers;
}
}
}
}
@@ -743,8 +752,17 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
projectile.type == ModContent.ProjectileType<ApolloFireball>() ||
projectile.type == ModContent.ProjectileType<ApolloRocket>())
{
projectile.Kill();
projectile.owner = Main.maxPlayers;
// Prevent splitting
if (projectile.type == ModContent.ProjectileType<ApolloFireball>())
{
SpawnApolloFireballKillDust(projectile);
projectile.active = false;
}
else
{
projectile.Kill();
projectile.owner = Main.maxPlayers;
}
}
}
}
@@ -813,8 +831,17 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
projectile.type == ModContent.ProjectileType<ApolloFireball>() ||
projectile.type == ModContent.ProjectileType<ApolloRocket>())
{
projectile.Kill();
projectile.owner = Main.maxPlayers;
// Prevent splitting
if (projectile.type == ModContent.ProjectileType<ApolloFireball>())
{
SpawnApolloFireballKillDust(projectile);
projectile.active = false;
}
else
{
projectile.Kill();
projectile.owner = Main.maxPlayers;
}
}
}
}
@@ -1380,6 +1407,65 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
}
}
private void SpawnApolloFireballKillDust(Projectile projectile)
{
int height = 90;
projectile.position = projectile.Center;
projectile.width = projectile.height = height;
projectile.Center = projectile.position;
SoundEngine.PlaySound(CommonCalamitySounds.ExoPlasmaExplosionSound, projectile.Center);
for (int i = 0; i < 200; i++)
{
float dustSpeed = 16f;
if (i < 150)
dustSpeed = 12f;
if (i < 100)
dustSpeed = 8f;
if (i < 50)
dustSpeed = 4f;
int dust = Dust.NewDust(projectile.Center, 6, 6, Main.rand.NextBool(2) ? 107 : 110, 0f, 0f, 100, default, 1f);
float dustVelocityX = Main.dust[dust].velocity.X;
float dustVelocityY = Main.dust[dust].velocity.Y;
if (dustVelocityX == 0f && dustVelocityY == 0f)
dustVelocityX = 1f;
float dustVelocity = (float)Math.Sqrt(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY);
dustVelocity = dustSpeed / dustVelocity;
dustVelocityX *= dustVelocity;
dustVelocityY *= dustVelocity;
float scale = 1f;
switch ((int)dustSpeed)
{
case 4:
scale = 1.2f;
break;
case 8:
scale = 1.1f;
break;
case 12:
scale = 1f;
break;
case 16:
scale = 0.9f;
break;
default:
break;
}
Dust dust2 = Main.dust[dust];
dust2.velocity *= 0.5f;
dust2.velocity.X = dust2.velocity.X + dustVelocityX;
dust2.velocity.Y = dust2.velocity.Y + dustVelocityY;
dust2.scale = scale;
dust2.noGravity = true;
}
}
// Plays the targeting sound from both Exo Twins, indicating that they're syncing up.
public static void PlayTargetingSound()
{
+18 -10
View File
@@ -11,6 +11,11 @@ namespace CalamityMod.NPCs.NormalNPCs
{
public class KingSlimeJewel : ModNPC
{
private const int BoltShootGateValue = 75;
private const int BoltShootGateValue_Death = 60;
private const int BoltShootGateValue_BossRush = 45;
private const float LightTelegraphDuration = 30f;
public override void SetStaticDefaults()
{
NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { Hide = true };
@@ -41,9 +46,6 @@ namespace CalamityMod.NPCs.NormalNPCs
// Setting this in SetDefaults will disable expert mode scaling, so put it here instead
NPC.damage = 0;
// Red light
Lighting.AddLight((int)((NPC.position.X + (float)(NPC.width / 2)) / 16f), (int)((NPC.position.Y + (float)(NPC.height / 2)) / 16f), 1f, 0f, 0f);
// Despawn
if (!NPC.AnyNPCs(NPCID.KingSlime))
{
@@ -105,13 +107,13 @@ namespace CalamityMod.NPCs.NormalNPCs
}
// Fire projectiles
NPC.ai[0] += 1f;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
// Fire bolt every 1.5 seconds
NPC.localAI[0] += 1f;
if (NPC.localAI[0] >= (BossRushEvent.BossRushActive ? 45f : CalamityWorld.death ? 60f : 75f))
if (NPC.ai[0] >= (BossRushEvent.BossRushActive ? BoltShootGateValue_BossRush : CalamityWorld.death ? BoltShootGateValue_Death : BoltShootGateValue))
{
NPC.localAI[0] = 0f;
NPC.ai[0] = 0f;
Vector2 npcPos = new Vector2(NPC.Center.X, NPC.Center.Y);
float xDist = Main.player[NPC.target].Center.X - npcPos.X;
@@ -151,20 +153,26 @@ namespace CalamityMod.NPCs.NormalNPCs
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer);
}
}
else
Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, projVector, type, damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, projVector, type, damage, 0f, Main.myPlayer);
}
}
}
public override bool CheckActive()
public override Color? GetAlpha(Color drawColor)
{
return false;
float colorTelegraphGateValue = (BossRushEvent.BossRushActive ? BoltShootGateValue_BossRush : CalamityWorld.death ? BoltShootGateValue_Death : BoltShootGateValue) - LightTelegraphDuration;
if (NPC.ai[0] > colorTelegraphGateValue)
drawColor = Color.Lerp(drawColor, Color.White, (NPC.ai[0] - colorTelegraphGateValue) / LightTelegraphDuration);
return base.GetAlpha(drawColor);
}
public override bool CheckActive() => false;
public override void HitEffect(NPC.HitInfo hit)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, 90, hit.HitDirection, -1f, 0, default, 1f);
+6 -3
View File
@@ -535,10 +535,10 @@ namespace CalamityMod.NPCs.Providence
DoDeathAnimation();
return;
}
// Trigger the death animation
else if (NPC.life == 1)
else if (NPC.life <= 1)
{
NPC.life = 1;
DespawnSpecificProjectiles(true);
Dying = true;
NPC.dontTakeDamage = true;
@@ -1844,7 +1844,10 @@ namespace CalamityMod.NPCs.Providence
{
return false;
}
public override bool CheckDead()
{
return false;
}
public override void OnKill()
{
CalamityGlobalNPC.SetNewBossJustDowned(NPC);
@@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
hoverAcceleration += 0.05f;
}
Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 200f;
Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 320f;
Vector2 idealVelocity = npc.SafeDirectionTo(hoverDestination) * hoverSpeed;
npc.SimpleFlyMovement(idealVelocity, hoverAcceleration);
@@ -161,11 +161,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f;
if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.ServantofCthulhu) < 12)
{
int num23 = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num23].velocity = servantSpawnVelocity;
int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu);
Main.npc[eye].velocity = servantSpawnVelocity;
if (Main.netMode == NetmodeID.Server && num23 < Main.maxNPCs)
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0);
if (Main.netMode == NetmodeID.Server && eye < Main.maxNPCs)
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, eye);
}
SoundEngine.PlaySound(SoundID.NPCHit1, servantSpawnCenter);
@@ -182,7 +182,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
else if (npc.ai[1] == 1f)
{
npc.rotation = num8;
float chargeSpeed = 7.25f;
float chargeSpeed = 8f;
chargeSpeed += 5f * enrageScale;
if (death)
chargeSpeed += 8.5f * (1f - lifeRatio);
@@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
hoverAcceleration += 0.04f * (0.75f - lifeRatio);
}
Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 120f;
Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 160f;
float distanceFromHoverDestination = npc.Distance(hoverDestination);
if (distanceFromHoverDestination > 400f)
@@ -649,12 +649,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity * 10f;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num34 = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, 0f, 0f, 255);
Main.npc[num34].velocity.X = servantSpawnVelocity.X;
Main.npc[num34].velocity.Y = servantSpawnVelocity.Y;
int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu);
Main.npc[eye].velocity.X = servantSpawnVelocity.X;
Main.npc[eye].velocity.Y = servantSpawnVelocity.Y;
if (Main.netMode == NetmodeID.Server && num34 < Main.maxNPCs)
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num34, 0f, 0f, 0f, 0, 0, 0);
if (Main.netMode == NetmodeID.Server && eye < Main.maxNPCs)
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, eye);
if (CalamityWorld.LegendaryMode)
{
+153 -201
View File
@@ -12,6 +12,12 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
public static class PlanteraAI
{
public const float SeedGatlingGateValue = 900f;
public const float SeedGatlingDuration = 300f;
public const float SeedGatlingColorChangeDuration = 180f;
public const float SeedGatlingStopValue = SeedGatlingGateValue + SeedGatlingDuration;
public const float SeedGatlingColorChangeGateValue = SeedGatlingStopValue - SeedGatlingColorChangeDuration;
public static bool BuffedPlanteraAI(NPC npc, Mod mod)
{
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
@@ -31,7 +37,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
float lifeRatio = npc.life / (float)npc.lifeMax;
// Phases based on HP
bool phase1phase2 = lifeRatio < 0.75f;
bool addThornBallsToGatlingAttack = lifeRatio < 0.9f;
bool addSporeGasBlastToGatlingAttack = lifeRatio < 0.75f;
bool phase2 = lifeRatio <= 0.5f;
bool phase3 = lifeRatio < 0.35f;
bool phase4 = lifeRatio < 0.2f;
@@ -128,37 +135,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.Calamity().CurrentlyEnraged = !bossRush && enrage;
// Detect active tiles around Plantera
int radius = 20; // 20 tile radius
int diameter = radius * 2;
int npcCenterX = (int)(npc.Center.X / 16f);
int npcCenterY = (int)(npc.Center.Y / 16f);
Rectangle area = new Rectangle(npcCenterX - radius, npcCenterY - radius, diameter, diameter);
int nearbyActiveTiles = 0; // 0 to 1600
for (int x = area.Left; x < area.Right; x++)
{
for (int y = area.Top; y < area.Bottom; y++)
{
if (Main.tile[x, y] != null)
{
if (Main.tile[x, y].HasUnactuatedTile && Main.tileSolid[Main.tile[x, y].TileType] && !Main.tileSolidTop[Main.tile[x, y].TileType] && !TileID.Sets.Platforms[Main.tile[x, y].TileType])
nearbyActiveTiles++;
}
}
}
// Scale multiplier based on nearby active tiles
float tileEnrageMult = 1f;
if (nearbyActiveTiles < 800)
tileEnrageMult += (800 - nearbyActiveTiles) * 0.00075f; // Ranges from 1f to 1.6f
if (bossRush)
tileEnrageMult = 1.6f;
// Let hooks and tentacles know how enraged plantera is
npc.ai[3] = tileEnrageMult;
float tentacleEnrageMult = 1f - lifeRatio + (tileEnrageMult - 1f);
// Movement relative to the target and hook positions
Vector2 vector91 = new Vector2(num730, num731);
float num736 = Main.player[npc.target].Center.X - vector91.X;
@@ -177,16 +153,104 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
acceleration += acceleration * 0.25f * (1f - lifeRatio);
}
// Increase speed based on nearby active tiles
velocity *= tileEnrageMult;
acceleration *= tileEnrageMult;
if (Main.getGoodWorld)
{
velocity *= 1.15f;
acceleration *= 1.15f;
}
// Slow down and fire a gatling of projectiles
// These projectiles are slower than normal
// Glow gradually more green the closer the gatling attack is to ending
bool usingSeedGatling = npc.ai[1] > SeedGatlingGateValue;
if (!phase2)
{
npc.ai[1] += 1f;
if (usingSeedGatling)
{
float currentSeedGatlingTime = npc.ai[1] - SeedGatlingGateValue;
// Slow down more and more as gatling attack continues
velocity *= MathHelper.Lerp(0.25f, 1f, currentSeedGatlingTime / SeedGatlingDuration);
// Shoot projectiles
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float shootProjectileGateValue = 30f;
if (currentSeedGatlingTime >= 240f)
shootProjectileGateValue = 3f;
else if (currentSeedGatlingTime >= 180f)
shootProjectileGateValue = 5f;
else if (currentSeedGatlingTime >= 120f)
shootProjectileGateValue = 9f;
else if (currentSeedGatlingTime >= 60f)
shootProjectileGateValue = 15f;
if (npc.ai[1] % shootProjectileGateValue == 0f)
{
bool shootThornBall = npc.ai[1] % 90f == 0f && addThornBallsToGatlingAttack;
bool shootPoisonSeed = npc.ai[1] % 9f == 0f;
float projectileSpeed = 6f;
int projectileType = shootThornBall ? ProjectileID.ThornBall : shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera;
int damage = npc.GetProjectileDamage(projectileType);
Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center);
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity * 3f, projectileVelocity * projectileSpeed, projectileType, damage, 0f, Main.myPlayer);
if (projectileType == ProjectileID.ThornBall && (Main.rand.NextBool(2) || !Main.zenithWorld))
Main.projectile[proj].tileCollide = false;
}
}
}
if (npc.ai[1] >= SeedGatlingStopValue)
{
// Vomit dense spread of spore gas at the end of the gatling attack
if (Main.netMode != NetmodeID.MultiplayerClient && addSporeGasBlastToGatlingAttack)
{
SoundEngine.PlaySound(SoundID.Item107, npc.Center);
int totalProjectiles = 36;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ModContent.ProjectileType<SporeGasPlantera>();
int damage = npc.GetProjectileDamage(type);
float velocity2 = CalamityWorld.LegendaryMode ? Main.rand.NextFloat(8f, 12f) : Main.rand.NextFloat(4f, 6f);
Vector2 spinningPoint = new Vector2(0f, -velocity2);
for (int k = 0; k < totalProjectiles; k++)
{
Vector2 vector255 = spinningPoint.RotatedBy(radians * k);
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(vector255) * 50f, vector255, type, damage, 0f, Main.myPlayer);
}
}
npc.ai[1] = -SeedGatlingDuration;
}
}
else
npc.ai[1] = 0f;
// Move slowly for a bit after finishing gatling attack
bool slowedAfterGatlingAttack = npc.ai[1] < 0f;
if (slowedAfterGatlingAttack)
{
float absValueOfTimer = Math.Abs(npc.ai[1]);
velocity *= MathHelper.Lerp(0.25f, 1f, absValueOfTimer / SeedGatlingDuration);
// Shoot homing pink bulb projectiles that leave behind lingering pink clouds
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float shootBulbGateValue = death ? 60f : 120f;
if (lifeRatio < 0.75f)
shootBulbGateValue *= 0.5f;
if (absValueOfTimer % shootBulbGateValue == 0f)
{
float projectileSpeed = 12f;
int projectileType = ModContent.ProjectileType<HomingGasBulb>();
int damage = npc.GetProjectileDamage(projectileType);
Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center);
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity * 3f, projectileVelocity * projectileSpeed, projectileType, damage, 0f, Main.myPlayer);
}
}
}
// Velocity ranges from 4 to 7.2, Acceleration ranges from 0.04 to 0.072, non-enraged phase 1
// Velocity ranges from 7 to 12.6, Acceleration ranges from 0.07 to 0.126, non-enraged phase 2
// Velocity ranges from 9 to 16.2, Acceleration ranges from 0.07 to 0.126, non-enraged phase 3
@@ -250,13 +314,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.velocity.Y -= acceleration * 2f;
}
// Slow down considerably if near player
if (!speedUp && nearbyActiveTiles > 800 && !Collision.SolidCollision(npc.position, npc.width, npc.height) && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
{
if (npc.velocity.Length() > 4f)
npc.velocity *= 0.98f;
}
// Rotation
float num740 = Main.player[npc.target].Center.X - npc.Center.X;
float num741 = Main.player[npc.target].Center.Y - npc.Center.Y;
@@ -265,19 +322,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Phase 1
if (!phase2)
{
if (phase1phase2 && Main.netMode != NetmodeID.MultiplayerClient)
{
if (npc.localAI[0] == 1f)
{
npc.localAI[0] = 2f;
int baseTentacles = death ? 3 : 2;
int totalTentacles = (int)(baseTentacles * tileEnrageMult);
for (int i = 0; i < totalTentacles; i++)
{
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
}
}
}
// Emit light
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.8f, 0.2f, 0.4f);
// Adjust stats
calamityGlobalNPC.DR = 0.15f;
@@ -286,9 +332,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.damage = npc.defDamage;
// Fire projectiles
if (Main.netMode != NetmodeID.MultiplayerClient)
if (Main.netMode != NetmodeID.MultiplayerClient && !usingSeedGatling && !slowedAfterGatlingAttack)
{
float shootBoost = 8f * (1f - lifeRatio);
float shootBoost = 2f * (1f - lifeRatio);
npc.localAI[1] += 1f + shootBoost;
if (enrage)
@@ -301,7 +347,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (npc.justHit)
npc.localAI[3] = 1f;
if (npc.localAI[1] >= 75f)
float shootProjectileGateValue = death ? 40f : 60f;
if (npc.localAI[1] >= 60f)
{
npc.localAI[1] = 0f;
bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
@@ -313,50 +360,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (canHit)
{
npc.TargetClosest();
int projectileType = ProjectileID.SeedPlantera;
float projectileVelocity = 17f;
if (Main.rand.NextBool(8))
{
projectileType = ModContent.ProjectileType<SporeGasPlantera>();
projectileVelocity = 3f;
}
else if ((lifeRatio < 0.85f || CalamityWorld.LegendaryMode) && Main.rand.NextBool(4))
{
npc.localAI[1] = CalamityWorld.LegendaryMode ? -15f : -30f;
projectileType = ProjectileID.PoisonSeedPlantera;
}
else if ((lifeRatio < 0.7f || CalamityWorld.LegendaryMode) && Main.rand.NextBool(2))
{
int thornBallCount = 0;
int maxThornBalls = CalamityWorld.LegendaryMode ? 10 : 2;
for (int i = 0; i < Main.maxProjectiles; i++)
{
if (Main.projectile[i].active && Main.projectile[i].type == ProjectileID.ThornBall)
thornBallCount++;
if (thornBallCount > maxThornBalls - 1)
break;
}
if (thornBallCount < maxThornBalls)
{
npc.localAI[1] = CalamityWorld.LegendaryMode ? -60f : -120f;
projectileType = ProjectileID.ThornBall;
}
}
int projectileType = (CalamityWorld.LegendaryMode || Main.rand.NextBool(4)) ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera;
float projectileSpeed = 9f;
int damage = npc.GetProjectileDamage(projectileType);
Vector2 vector93 = npc.Center;
float num743 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector93.X;
float num744 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector93.Y;
float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744);
num745 = projectileVelocity / num745;
num743 *= num745;
num744 *= num745;
vector93.X += num743 * 3f;
vector93.Y += num744 * 3f;
Projectile.NewProjectile(npc.GetSource_FromAI(), vector93.X, vector93.Y, num743, num744, projectileType, damage, 0f, Main.myPlayer, 0f, projectileType == ProjectileID.ThornBall ? tileEnrageMult : 0f);
Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center);
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity * 3f, projectileVelocity * projectileSpeed, projectileType, damage, 0f, Main.myPlayer);
}
}
}
@@ -365,6 +373,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Phase 2
else
{
// Spore dust
if (Main.rand.NextBool(10))
{
Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 44, 0f, 0f, 250, default, 0.4f);
dust.fadeIn = 0.7f;
}
// Adjust stats
calamityGlobalNPC.DR = 0.15f;
calamityGlobalNPC.unbreakableDR = false;
@@ -374,27 +389,26 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Spawn tentacles
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (npc.localAI[0] == 2f)
if (npc.localAI[0] == 1f)
{
npc.localAI[0] = 3f;
int baseTentacles = death ? 10 : 8;
int totalTentacles = (int)(baseTentacles * tileEnrageMult);
npc.localAI[0] = 2f;
int totalTentacles = death ? 10 : 8;
if (Main.getGoodWorld)
totalTentacles += 6;
for (int i = 0; i < totalTentacles; i++)
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI);
if (Main.getGoodWorld)
{
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].active && Main.npc[i].aiStyle == 52)
if (Main.npc[i].active && Main.npc[i].aiStyle == NPCAIStyleID.PlanteraHook)
{
for (int j = 0; j < totalTentacles / 2 - 1; j++)
{
int num800 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
Main.npc[num800].ai[3] = i + 1;
int hookIndex = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI);
Main.npc[hookIndex].ai[3] = i + 1;
}
}
}
@@ -416,59 +430,18 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (Main.netMode != NetmodeID.MultiplayerClient)
{
// Spawn spores
float spawnBoost = 8f * (0.5f - lifeRatio);
npc.localAI[1] += 1f + spawnBoost;
// If hit, fire projectiles even if target is behind tiles
if (npc.justHit)
calamityGlobalNPC.newAI[2] = 1f;
if (npc.localAI[1] >= 360f)
{
npc.localAI[1] = 0f;
bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
if (calamityGlobalNPC.newAI[2] > 0f)
{
canHit = true;
calamityGlobalNPC.newAI[2] = 0f;
}
if (canHit)
{
float num757 = 4f;
Vector2 vector94 = npc.Center;
float num758 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector94.X + Main.rand.Next(-10, 11);
float num759 = Math.Abs(num758 * 0.2f);
float num760 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector94.Y + Main.rand.Next(-10, 11);
if (num760 > 0f)
num759 = 0f;
num760 -= num759;
float num761 = (float)Math.Sqrt(num758 * num758 + num760 * num760);
num761 = num757 / num761;
num758 *= num761;
num760 *= num761;
int num762 = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.Spore);
Main.npc[num762].velocity.X = num758;
Main.npc[num762].velocity.Y = num760;
Main.npc[num762].dontTakeDamage = bossRush;
Main.npc[num762].netUpdate = true;
}
}
// Fire spread of poison seeds
if (nearbyActiveTiles > 600)
npc.localAI[3] += 0.5f + (0.5f - lifeRatio) * 8f;
else
npc.localAI[3] += (nearbyActiveTiles > 300 ? 1f : 5f) + (0.5f - lifeRatio) * 8f;
npc.localAI[3] += 0.5f + (0.5f - lifeRatio) * 8f;
// If hit, fire projectiles even if target is behind tiles
if (npc.justHit)
calamityGlobalNPC.newAI[3] = 1f;
if (npc.localAI[3] >= 360f)
if (npc.localAI[3] >= 450f)
{
bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height);
if (calamityGlobalNPC.newAI[3] > 0f)
@@ -478,22 +451,11 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
if (canHit)
{
Vector2 vector93 = npc.Center;
float num742 = 8f + ((0.5f - lifeRatio) * 8f); // 8f to 12f
if (nearbyActiveTiles < 300)
num742 = 12f;
float projectileSpeed = 8f + ((0.5f - lifeRatio) * 8f); // 8f to 12f
if (bossRush)
num742 += 4f;
projectileSpeed += 4f;
float num743 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector93.X;
float num744 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector93.Y;
float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744);
num745 = num742 / num745;
num743 *= num745;
num744 *= num745;
vector93.X += num743 * 3f;
vector93.Y += num744 * 3f;
Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center);
bool anyThornBalls = false;
for (int i = 0; i < Main.maxProjectiles; i++)
@@ -509,16 +471,14 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
int type = ProjectileID.ThornBall;
int damage = npc.GetProjectileDamage(type);
Projectile.NewProjectile(npc.GetSource_FromAI(), vector93.X, vector93.Y, num743, num744, type, damage, 0f, Main.myPlayer, 0f, tileEnrageMult);
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity * 3f, projectileVelocity * projectileSpeed, type, damage, 0f, Main.myPlayer);
Main.projectile[proj].tileCollide = false;
npc.localAI[3] = -240f;
}
else
{
int spread = 3 + (int)Math.Round((0.5f - lifeRatio) * 10f); // 3 to 8, wider spread is harder to avoid
if (nearbyActiveTiles < 300)
spread = Main.rand.Next(3, 7) + (int)Math.Round((0.5f - lifeRatio) * 8f);
int numProj = spread / 2;
int type = ProjectileID.PoisonSeedPlantera;
int damage = npc.GetProjectileDamage(type);
@@ -526,8 +486,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
float rotation = MathHelper.ToRadians(spread);
for (int i = 0; i < numProj; i++)
{
Vector2 perturbedSpeed = new Vector2(num743, num744).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), vector93, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f);
Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1)));
Projectile.NewProjectile(npc.GetSource_FromAI(), perturbedSpeed * 3f, perturbedSpeed * projectileSpeed, type, damage, 0f, Main.myPlayer);
}
npc.localAI[3] = 0f;
@@ -539,34 +499,21 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
float shootBoost = 2f * (0.5f - lifeRatio);
calamityGlobalNPC.newAI[0] += 1f + shootBoost;
float sporeGasGateValue = CalamityWorld.LegendaryMode ? 150f : bossRush ? 300f : 600f;
float sporeGasGateValue = CalamityWorld.LegendaryMode ? 150f : bossRush ? 300f : 720f;
if (calamityGlobalNPC.newAI[0] >= sporeGasGateValue)
{
npc.TargetClosest();
SoundEngine.PlaySound(SoundID.Item20, npc.position);
Vector2 vector93 = npc.Center;
float num742 = 3f;
float num743 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector93.X;
float num744 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector93.Y;
float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744);
num745 = num742 / num745;
num743 *= num745;
num744 *= num745;
vector93.X += num743 * 3f;
vector93.Y += num744 * 3f;
float projectileSpeed = 3f;
Vector2 projectileVelocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * projectileSpeed;
int type = ModContent.ProjectileType<SporeGasPlantera>();
int damage = npc.GetProjectileDamage(type);
int numProj = 4;
int spread = 30;
if (nearbyActiveTiles <= 300)
spread = Main.rand.NextBool(2) ? 45 : 60;
float rotation = MathHelper.ToRadians(spread);
float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744);
double startAngle = Math.Atan2(num743, num744) - rotation / 2;
float baseSpeed = (float)Math.Sqrt(projectileVelocity.X * projectileVelocity.X + projectileVelocity.Y * projectileVelocity.Y);
double startAngle = Math.Atan2(projectileVelocity.X, projectileVelocity.Y) - rotation / 2;
double deltaAngle = rotation / numProj;
double offsetAngle;
@@ -574,7 +521,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
offsetAngle = startAngle + deltaAngle * i;
float ai0 = Main.rand.Next(3);
Projectile.NewProjectile(npc.GetSource_FromAI(), vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, ai0, 0f);
projectileVelocity = new Vector2(baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle));
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity, projectileVelocity, type, damage, 0f, Main.myPlayer, ai0, 0f);
}
calamityGlobalNPC.newAI[0] = 0f;
@@ -634,7 +582,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.ai[0] = npc.life;
if (NPC.CountNPCS(NPCID.PlanterasTentacle) < maxTentacles)
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, tentacleEnrageMult);
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI);
}
}
}
@@ -665,9 +613,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (Main.player[Main.npc[NPC.plantBoss].target].dead && !enrage)
despawn = true;
// Tile enrage
float tileEnrageMult = Main.npc[NPC.plantBoss].ai[3];
// Enrage if Plantera's target is on the surface
if (!enrage && ((Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > ((Main.maxTilesY - 200) * 16)) | despawn))
{
@@ -693,7 +638,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Timer dictating whether to pick a new location or not
float moveBoost = death ? 4f * (1f - lifeRatio) : 2f * (1f - lifeRatio);
npc.localAI[0] -= (1f + moveBoost) * MathHelper.Lerp(1f, 3.6f, (tileEnrageMult - 1f) * 1.25f);
npc.localAI[0] -= 1f + moveBoost;
if (enrage)
npc.localAI[0] -= 6f;
@@ -762,7 +707,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
// Hook movement velocity
float velocityBoost = death ? 6f * (1f - lifeRatio) : 3f * (1f - lifeRatio);
float velocity = (7f + velocityBoost) * tileEnrageMult;
float velocity = 7f + velocityBoost;
if (enrage)
velocity *= 2f;
if (despawn)
@@ -808,6 +753,13 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
{
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
// Spore dust
if (Main.rand.NextBool(10))
{
Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 44, 0f, 0f, 250, default, 0.2f);
dust.fadeIn = 0.7f;
}
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
if (Main.getGoodWorld)
@@ -838,7 +790,6 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
// Set Plantera to a variable
int num778 = NPC.plantBoss;
float tileEnrageMult = Main.npc[num778].ai[3];
// Movement variables
if (Main.netMode != NetmodeID.MultiplayerClient)
@@ -852,9 +803,9 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
// Velocity and acceleration
float num779 = (death ? 2.4f : 1.6f) * tileEnrageMult;
float num779 = death ? 2.4f : 1.6f;
float num781 = npc.ai[2];
float num780 = 100f + (num781 * 150f);
float num780 = 100f + (num781 * 75f);
float deceleration = (death ? 0.5f : 0.8f) / (1f + num781);
if (Main.getGoodWorld)
@@ -923,6 +874,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
npc.spriteDirection = -1;
npc.rotation = (float)Math.Atan2(num787, num786) + MathHelper.Pi;
}
return false;
}
}
+95
View File
@@ -0,0 +1,95 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using System;
using CalamityMod.NPCs.TownNPCs;
namespace CalamityMod.Projectiles.Boss
{
public class HomingGasBulb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = 18;
Projectile.height = 18;
Projectile.hostile = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 600;
}
public override void AI()
{
if (Projectile.localAI[0] == 0f)
{
Projectile.localAI[0] = 1f;
SoundEngine.PlaySound(SoundID.Item17, Projectile.Center);
}
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
int closestPlayer = (int)Player.FindClosest(Projectile.Center, 1, 1);
Vector2 velocity = Main.player[closestPlayer].Center - Projectile.Center;
Projectile.ai[0] += 1f;
if (Projectile.ai[0] >= 30f)
{
if (Projectile.ai[0] < 180f)
{
float scaleFactor2 = Projectile.velocity.Length();
velocity.Normalize();
velocity *= scaleFactor2;
Projectile.velocity = (Projectile.velocity * 24f + velocity) / 25f;
Projectile.velocity.Normalize();
Projectile.velocity *= scaleFactor2;
}
else if (Projectile.velocity.Length() < 18f)
{
Projectile.tileCollide = true;
Projectile.velocity *= 1.02f;
}
}
if (Projectile.ai[0] % 30f == 0f)
{
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
if (Projectile.owner == Main.myPlayer)
{
int type = ModContent.ProjectileType<HomingGasBulbSporeGas>();
float ai0 = Main.rand.Next(3);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Normalize(Projectile.velocity) * 0.25f, type, (int)Math.Round(Projectile.damage * 0.8), 0f, Main.myPlayer, ai0);
}
}
}
public override bool PreDraw(ref Color lightColor)
{
lightColor = Color.White;
lightColor.A = (byte)Projectile.alpha;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
public override void Kill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.NPCDeath1, Projectile.Center);
for (int i = 0; i < 15; i++)
{
if (Main.rand.Next(3) != 0)
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 166);
else
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 167);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

+108
View File
@@ -0,0 +1,108 @@
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class HomingGasBulbSporeGas : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 20;
Projectile.hostile = true;
Projectile.ignoreWater = true;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(Projectile.localAI[0]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
Projectile.localAI[0] = reader.ReadSingle();
}
public override void AI()
{
Projectile.ai[1] += 1f;
if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 1800f))
{
Projectile.localAI[0] += 10f;
Projectile.damage = 0;
}
if (Projectile.localAI[0] > 255f)
{
Projectile.Kill();
Projectile.localAI[0] = 255f;
}
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.12f / 255f, (255 - Projectile.alpha) * 0.06f / 255f, (255 - Projectile.alpha) * 0.12f / 255f);
Projectile.alpha = (int)(100.0 + Projectile.localAI[0] * 0.7);
Projectile.rotation += Projectile.velocity.X * 0.02f;
Projectile.rotation += Projectile.direction * 0.002f;
if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 2f : 0.5f))
Projectile.velocity *= 0.99f;
}
public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 1800f) && Projectile.ai[1] > 120f;
public override Color? GetAlpha(Color lightColor)
{
if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 1800f))
{
byte b2 = (byte)((26f - (Projectile.ai[1] - (CalamityWorld.LegendaryMode ? 600f : 1800f))) * 10f);
byte a2 = (byte)(Projectile.alpha * (b2 / 255f));
return new Color(b2, b2, b2, a2);
}
return new Color(255, 255, 255, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
{
// Changes the texture of the projectile
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
switch ((int)Projectile.ai[0])
{
case 0:
break;
case 1:
texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HomingGasBulbSporeGas2").Value;
break;
case 2:
texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HomingGasBulbSporeGas3").Value;
break;
default:
break;
}
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, texture);
return false;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if (info.Damage <= 0)
return;
if (Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 1800f) && Projectile.ai[1] > 120f)
target.AddBuff(BuffID.Poisoned, 240);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

+30
View File
@@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Boss
public class MushBomb : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 4;
@@ -22,6 +23,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.height = 14;
Projectile.hostile = true;
Projectile.tileCollide = false;
Projectile.Opacity = 0f;
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
Projectile.aiStyle = ProjAIStyleID.Arrow;
@@ -30,6 +32,32 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
if (Projectile.velocity.Y > 0f)
{
if (Projectile.Opacity == 0f)
{
Projectile.Opacity = 1f;
SoundEngine.PlaySound(SoundID.Item44, Projectile.Center);
int dustAmount = 36;
for (int i = 0; i < dustAmount; i++)
{
Vector2 dustSpawnPosition = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.5f;
dustSpawnPosition = dustSpawnPosition.RotatedBy((double)((float)(i - (dustAmount / 2 - 1)) * MathHelper.TwoPi / (float)dustAmount), default) + Projectile.Center;
Vector2 dustVelocity = dustSpawnPosition - Projectile.Center;
int dust = Dust.NewDust(dustSpawnPosition + dustVelocity, 0, 0, 56, dustVelocity.X, dustVelocity.Y);
Main.dust[dust].noGravity = true;
Main.dust[dust].noLight = true;
Main.dust[dust].velocity = dustVelocity;
}
}
}
else
{
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 0.8f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
}
Projectile.frameCounter++;
if (Projectile.frameCounter > 4)
{
@@ -47,6 +75,8 @@ namespace CalamityMod.Projectiles.Boss
Projectile.velocity.X *= 0.995f;
}
public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f;
public override Color? GetAlpha(Color drawColor) => Main.zenithWorld ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha) : new Color(255, 255, 255, Projectile.alpha);
public override bool PreDraw(ref Color lightColor)
+29 -1
View File
@@ -13,6 +13,7 @@ namespace CalamityMod.Projectiles.Boss
public class MushBombFall : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 4;
@@ -24,12 +25,39 @@ namespace CalamityMod.Projectiles.Boss
Projectile.height = 14;
Projectile.hostile = true;
Projectile.tileCollide = false;
Projectile.Opacity = 0f;
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
}
public override void AI()
{
if (Projectile.velocity.Y > 0f)
{
if (Projectile.Opacity == 0f)
{
Projectile.Opacity = 1f;
SoundEngine.PlaySound(SoundID.Item44, Projectile.Center);
int dustAmount = 36;
for (int i = 0; i < dustAmount; i++)
{
Vector2 dustSpawnPosition = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.5f;
dustSpawnPosition = dustSpawnPosition.RotatedBy((double)((float)(i - (dustAmount / 2 - 1)) * MathHelper.TwoPi / (float)dustAmount), default) + Projectile.Center;
Vector2 dustVelocity = dustSpawnPosition - Projectile.Center;
int dust = Dust.NewDust(dustSpawnPosition + dustVelocity, 0, 0, 56, dustVelocity.X, dustVelocity.Y);
Main.dust[dust].noGravity = true;
Main.dust[dust].noLight = true;
Main.dust[dust].velocity = dustVelocity;
}
}
}
else
{
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 56, 0f, 0f, 100, default, 0.8f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
}
Projectile.frameCounter++;
if (Projectile.frameCounter > 4)
{
@@ -55,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.velocity.X *= 0.995f;
}
public override bool CanHitPlayer(Player target) => Projectile.velocity.Y >= 0f;
public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f;
public override Color? GetAlpha(Color drawColor) => Main.zenithWorld ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha) : new Color(255, 255, 255, Projectile.alpha);
+3 -18
View File
@@ -30,30 +30,15 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
if (Projectile.ai[1] == 0f)
{
for (int num621 = 0; num621 < 2; num621++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 85, 0f, 0f, 100, default, 1f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
Projectile.ai[1] = 1f;
}
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
Projectile.Opacity += 0.1f;
if (Projectile.Opacity > 1f)
Projectile.Opacity = 1f;
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 85, 0f, 0f, 100, default, 0.8f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 85, 0f, 0f, 100, default, 0.8f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0f;
}
public override void Kill(int timeLeft)
+2 -2
View File
@@ -59,8 +59,8 @@ namespace CalamityMod.Projectiles.Boss
Projectile.rotation += Projectile.velocity.X * 0.02f;
Projectile.rotation += Projectile.direction * 0.002f;
if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 2f : 0.5f))
Projectile.velocity *= 0.98f;
if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 4f : 2f))
Projectile.velocity *= 0.99f;
}
public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 1800f) && Projectile.ai[1] > 120f;
+56
View File
@@ -0,0 +1,56 @@
using Microsoft.CodeAnalysis;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class ThornBallSpike : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
private const float MaxVelocity = 12f;
private const int TimeLeft = 600;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = 12;
Projectile.height = 12;
Projectile.hostile = true;
Projectile.penetrate = 1;
Projectile.timeLeft = TimeLeft;
}
public override void AI()
{
if (Projectile.velocity.Length() < MaxVelocity)
{
Projectile.velocity *= 1.05f;
if (Projectile.velocity.Length() > MaxVelocity)
{
Projectile.velocity.Normalize();
Projectile.velocity *= MaxVelocity;
}
}
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Poisoned, 90);
public override bool PreDraw(ref Color lightColor)
{
lightColor = Color.White;
lightColor.A = (byte)Projectile.alpha;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

+94 -37
View File
@@ -1267,7 +1267,7 @@ namespace CalamityMod.Projectiles
return false;
}
else if (projectile.type == ProjectileID.PoisonSeedPlantera)
else if (projectile.type == ProjectileID.SeedPlantera || projectile.type == ProjectileID.PoisonSeedPlantera)
{
projectile.frameCounter++;
if (projectile.frameCounter > 1)
@@ -1293,8 +1293,6 @@ namespace CalamityMod.Projectiles
projectile.ai[0] += 1f;
if (projectile.ai[0] >= 120f)
{
projectile.ai[0] = 120f;
if (projectile.velocity.Length() < 18f)
projectile.velocity *= 1.01f;
}
@@ -1304,12 +1302,12 @@ namespace CalamityMod.Projectiles
if (projectile.timeLeft > 600)
projectile.timeLeft = 600;
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f;
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2;
return false;
}
else if (projectile.type == ProjectileID.ThornBall)
else if (projectile.type == ProjectileID.ThornBall && !projectile.tileCollide)
{
if (projectile.alpha > 0)
{
@@ -1318,36 +1316,79 @@ namespace CalamityMod.Projectiles
projectile.alpha = 0;
}
int num147 = Player.FindClosest(projectile.Center, 1, 1);
float num146 = 7.5f * projectile.ai[1] + Vector2.Distance(Main.player[num147].Center, projectile.Center) * 0.01f;
Vector2 vector12 = Main.player[num147].Center - projectile.Center;
vector12.Normalize();
vector12 *= num146;
int num148 = 200;
projectile.velocity.X = (projectile.velocity.X * (num148 - 1) + vector12.X) / num148;
if (projectile.velocity.Length() > 16f)
Point point = projectile.Center.ToTileCoordinates();
Tile tileSafely = Framing.GetTileSafely(point);
bool stickOnCollision = tileSafely.HasUnactuatedTile && Main.tileSolid[tileSafely.TileType];
if (stickOnCollision)
{
projectile.velocity.Normalize();
projectile.velocity *= 16f;
}
projectile.ai[0] += 1f;
if (projectile.ai[0] > 15f)
{
if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f)
projectile.velocity = Vector2.Zero;
projectile.ai[1] += 1f;
float explodeGateValue = 600f;
if (projectile.ai[1] >= explodeGateValue)
{
projectile.velocity.X *= 0.97f;
if (projectile.velocity.X > -0.01f && projectile.velocity.X < 0.01f)
projectile.Kill();
if (projectile.owner == Main.myPlayer)
{
int totalProjectiles = 8;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ModContent.ProjectileType<ThornBallSpike>();
float velocity = 1f;
Vector2 spinningPoint = new Vector2(0f, -velocity);
for (int k = 0; k < totalProjectiles; k++)
{
Vector2 velocity2 = spinningPoint.RotatedBy((radians + projectile.rotation) * k);
Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center + Vector2.Normalize(velocity2) * 16f, velocity2, type, (int)Math.Round(projectile.damage * 0.8), 0f, Main.myPlayer);
}
}
SoundEngine.PlaySound(SoundID.Item17, projectile.position);
for (int i = 0; i < 8; i++)
{
int randomDustType = Main.rand.NextBool(2) ? 125 : 148;
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, randomDustType, 0f, 0f, 0, default, 2f);
Main.dust[dust].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[dust].scale = 0.5f;
Main.dust[dust].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int i = 0; i < 10; i++)
{
int randomDustType = Main.rand.NextBool(2) ? 125 : 148;
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, randomDustType, 0f, 0f, 0, default, 3f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 5f;
dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, randomDustType, 0f, 0f, 0, default, 2f);
Main.dust[dust].velocity *= 2f;
}
projectile.Kill();
}
projectile.velocity.Y += 0.1f;
}
else
{
int closestPlayer = Player.FindClosest(projectile.Center, 1, 1);
float homingSpeed = 7.5f + Vector2.Distance(Main.player[closestPlayer].Center, projectile.Center) * 0.01f;
Vector2 homingVelocity = Vector2.Normalize(Main.player[closestPlayer].Center - projectile.Center) * homingSpeed;
int inertia = 200;
projectile.velocity.X = (projectile.velocity.X * (inertia - 1) + homingVelocity.X) / inertia;
projectile.rotation += projectile.velocity.X * 0.05f;
if (projectile.velocity.Length() > 16f)
{
projectile.velocity.Normalize();
projectile.velocity *= 16f;
}
if (projectile.velocity.Y > 16f)
projectile.velocity.Y = 16f;
projectile.ai[0] += 1f;
if (projectile.ai[0] > 15f)
projectile.velocity.Y += 0.1f;
projectile.rotation += projectile.velocity.X * 0.05f;
if (projectile.velocity.Y > 16f)
projectile.velocity.Y = 16f;
}
return false;
}
@@ -2462,7 +2503,7 @@ namespace CalamityMod.Projectiles
}
#endregion
#region PostAI
#region Post AI
public override void PostAI(Projectile projectile)
{
if (projectile.FinalExtraUpdate() && flatDRTimer > 0)
@@ -2531,7 +2572,7 @@ namespace CalamityMod.Projectiles
}
#endregion
#region ModifyHitNPC
#region Modify Hit NPC
public override void ModifyHitNPC(Projectile projectile, NPC target, ref NPC.HitModifiers modifiers)
{
Player player = Main.player[projectile.owner];
@@ -2601,14 +2642,14 @@ namespace CalamityMod.Projectiles
}
#endregion
#region ModifyHitPlayer
#region Modify Hit Player
public override void ModifyHitPlayer(Projectile projectile, Player target, ref Player.HurtModifiers modifiers)
{
modifiers.FinalDamage.Flat -= flatDR;
}
#endregion
#region CanDamage + CanHit
#region Can Damage + Can Hit
public override bool? CanDamage(Projectile projectile)
{
if (projectile.hostile && (projectile.damage - flatDR <= 0))
@@ -2659,9 +2700,7 @@ namespace CalamityMod.Projectiles
if (Main.LocalPlayer.Calamity().omniscience && projectile.hostile && projectile.damage > 0 && projectile.alpha < 255)
{
if (projectile.ModProjectile is null || (projectile.ModProjectile != null && projectile.ModProjectile.CanHitPlayer(Main.LocalPlayer) && (projectile.ModProjectile.CanDamage() ?? true)))
{
return Color.Coral;
}
}
if (projectile.type == ProjectileID.Stinger)
@@ -2694,9 +2733,27 @@ namespace CalamityMod.Projectiles
return new Color(200, 200, 200, projectile.alpha);
}
if (projectile.type == ProjectileID.ThornBall)
{
float startTurningBrownGateValue = 420f;
float timeToReachFullBrown = 180f;
float timeToReachThornExplosion = startTurningBrownGateValue + timeToReachFullBrown;
Color initialColor = Color.White;
initialColor.A = (byte)projectile.alpha;
Color finalColor = Color.RosyBrown;
finalColor.A = (byte)projectile.alpha;
if (projectile.ai[1] > startTurningBrownGateValue)
{
float colorTransitionRatio = (projectile.ai[1] - startTurningBrownGateValue) / timeToReachFullBrown;
Color dehydratedColor = Color.Lerp(initialColor, finalColor, colorTransitionRatio);
return dehydratedColor;
}
else
return initialColor;
}
if (projectile.type == ProjectileID.SeedPlantera || projectile.type == ProjectileID.PoisonSeedPlantera ||
projectile.type == ProjectileID.ThornBall || projectile.type == ProjectileID.CultistBossFireBallClone ||
projectile.type == ProjectileID.AncientDoomProjectile)
projectile.type == ProjectileID.CultistBossFireBallClone || projectile.type == ProjectileID.AncientDoomProjectile)
{
if (projectile.timeLeft < 85)
{
+13 -13
View File
@@ -355,6 +355,19 @@ namespace CalamityMod.Projectiles
internal static IProjectileTweak IDStaticIFrames(int f) => new IDStaticIFrameRule(f);
#endregion
#region Ignore Water
internal class IgnoreWaterRule : IProjectileTweak
{
internal readonly bool flag = true;
public IgnoreWaterRule(bool iw) => flag = iw;
public bool AppliesTo(Projectile proj) => true;
public void ApplyTweak(Projectile proj) => proj.ignoreWater = flag;
}
internal static IProjectileTweak IgnoreWater => new IgnoreWaterRule(true);
internal static IProjectileTweak DontIgnoreWater => new IgnoreWaterRule(false);
#endregion
#region Local Immunity Frames
internal class LocalIFrameRule : IProjectileTweak
{
@@ -480,19 +493,6 @@ namespace CalamityMod.Projectiles
internal static IProjectileTweak NoTileCollide => new TileCollideRule(false);
#endregion
#region Ignore Water
internal class IgnoreWaterRule : IProjectileTweak
{
internal readonly bool flag = true;
public IgnoreWaterRule(bool iw) => flag = iw;
public bool AppliesTo(Projectile proj) => true;
public void ApplyTweak(Projectile proj) => proj.ignoreWater = flag;
}
internal static IProjectileTweak IgnoreWater => new IgnoreWaterRule(true);
internal static IProjectileTweak DontIgnoreWater => new IgnoreWaterRule(false);
#endregion
#region Time Left
internal class TimeLeftDeltaRule : IProjectileTweak
{
+1 -1
View File
@@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Enemy
{
if (Main.zenithWorld)
{
CombatText.NewText(Main.player[toTarget].getRect(), Color.Red, "Vibe check.", true);
CombatText.NewText(Main.player[toTarget].getRect(), Color.Red, CalamityUtils.GetTextValue("Misc.CragmawVibeCheck"), true);
}
Projectile.localAI[0] = 1f;
ReelingPlayer = true;
@@ -26,9 +26,6 @@ namespace CalamityMod.Projectiles.Melee
public ref float AlreadyParried => ref Projectile.ai[1];
public Player Owner => Main.player[Projectile.owner];
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.MeleeNoSpeed;
@@ -57,7 +54,7 @@ namespace CalamityMod.Projectiles.Melee
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact);
SoundEngine.PlaySound(SoundID.Item67);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), "Parry!", true);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), CalamityUtils.GetTextValue("Misc.ArkParry"), true);
AlreadyParried = 1f;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
@@ -30,9 +30,6 @@ namespace CalamityMod.Projectiles.Melee
public ref float AlreadyParried => ref Projectile.ai[1];
public Player Owner => Main.player[Projectile.owner];
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.MeleeNoSpeed;
@@ -64,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact);
SoundEngine.PlaySound(CommonCalamitySounds.ScissorGuillotineSnapSound with { Volume = CommonCalamitySounds.ScissorGuillotineSnapSound.Volume * 1.3f }, Projectile.Center);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), "Parry!", true);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), CalamityUtils.GetTextValue("Misc.ArkParry"), true);
for (int i = 0; i < 5; i ++) //Don't loose your way
{
@@ -29,9 +29,6 @@ namespace CalamityMod.Projectiles.Melee
public ref float AlreadyParried => ref Projectile.ai[1];
public Player Owner => Main.player[Projectile.owner];
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.MeleeNoSpeed;
@@ -62,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee
}
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact);
SoundEngine.PlaySound(CommonCalamitySounds.ScissorGuillotineSnapSound with { Volume = CommonCalamitySounds.ScissorGuillotineSnapSound.Volume * 1.3f }, Projectile.Center);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), "Parry!", true);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), CalamityUtils.GetTextValue("Misc.ArkParry"), true);
for (int i = 0; i < 5; i ++) //Don't loose your way
{
@@ -26,9 +26,6 @@ namespace CalamityMod.Projectiles.Melee
public ref float AlreadyParried => ref Projectile.ai[1];
public Player Owner => Main.player[Projectile.owner];
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.MeleeNoSpeed;
@@ -56,7 +53,7 @@ namespace CalamityMod.Projectiles.Melee
sword.Charge = 10f;
SoundEngine.PlaySound(SoundID.DD2_WitherBeastCrystalImpact);
SoundEngine.PlaySound(SoundID.Item67);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), "Parry!", true);
CombatText.NewText(Projectile.Hitbox, new Color(111, 247, 200), CalamityUtils.GetTextValue("Misc.ArkParry"), true);
AlreadyParried = 1f;
}
+2 -2
View File
@@ -94,9 +94,9 @@ namespace CalamityMod.Projectiles.Ranged
++LoadedBolts;
if (LoadedBolts % 2 == 0)
CombatText.NewText(Owner.Hitbox, new Color(155, 255, 255), "Tock", true);
CombatText.NewText(Owner.Hitbox, new Color(155, 255, 255), CalamityUtils.GetTextValue("Misc.ClockworkTock"), true);
else
CombatText.NewText(Owner.Hitbox, new Color(255, 200, 100), "Tick", true);
CombatText.NewText(Owner.Hitbox, new Color(255, 200, 100), CalamityUtils.GetTextValue("Misc.ClockworkTick"), true);
FramesToLoadBolt *= 0.950f;
+4 -4
View File
@@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Ranged
if (shottimer == 1)
{
SoundEngine.PlaySound(TheSevensStriker.JackpotSound, Projectile.Center);
CombatText.NewText(player.getRect(), Color.Gold, "Jackpot!!!", true);
CombatText.NewText(player.getRect(), Color.Gold, CalamityUtils.GetTextValue("Misc.SevensJackpot"), true);
}
// Every 5 frames, shoot 7 coins. The first 5 frames are excluded for timing purposes
if (shottimer % 5 == 0 && shottimer > 5)
@@ -164,14 +164,14 @@ namespace CalamityMod.Projectiles.Ranged
// A single brick with 100% damage
case 1:
Shoot(1, ModContent.ProjectileType<SevensStrikerBrick>(), weaponDamage, 0, 2f, 0);
CombatText.NewText(player.getRect(), Color.Gray, "Bust!", true);
CombatText.NewText(player.getRect(), Color.Gray, CalamityUtils.GetTextValue("Misc.SevensBust"), true);
SoundEngine.PlaySound(TheSevensStriker.BustSound, Projectile.Center);
break;
// 7 exploding oranges with 200% damage
case 2:
int doublesDamage = (int)(weaponDamage * TheSevensStriker.DoublesMultiplier);
Shoot(7, ModContent.ProjectileType<SevensStrikerOrange>(), doublesDamage, weaponKnockback, 2f, 0.1f);
CombatText.NewText(player.getRect(), Color.Orange, "Doubles!", true);
CombatText.NewText(player.getRect(), Color.Orange, CalamityUtils.GetTextValue("Misc.SevensDoubles"), true);
SoundEngine.PlaySound(TheSevensStriker.DoublesSound, Projectile.Center);
break;
// 7 piercing grapes with X% damage
@@ -181,7 +181,7 @@ namespace CalamityMod.Projectiles.Ranged
int grapeDamage = (int)(weaponDamage * TheSevensStriker.TriplesGrapeMultiplier);
Shoot(7, ModContent.ProjectileType<SevensStrikerCherry>(), cherryDamage, weaponKnockback, 1.5f, 0.1f);
Shoot(7, ModContent.ProjectileType<SevensStrikerGrape>(), grapeDamage, weaponKnockback, 2f, 0.2f);
CombatText.NewText(player.getRect(), Color.Red, "Triples!", true);
CombatText.NewText(player.getRect(), Color.Red, CalamityUtils.GetTextValue("Misc.SevensTriples"), true);
SoundEngine.PlaySound(TheSevensStriker.TriplesSound, Projectile.Center);
break;
}
@@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.velocity = new Vector2(Projectile.spriteDirection * 3f, -4f);
Projectile.netUpdate = true;
if (HeatInterpolant >= 1f)
CombatText.NewText(Owner.Hitbox, Color.OrangeRed, "OUCH! HOT!", true);
CombatText.NewText(Owner.Hitbox, Color.OrangeRed, CalamityUtils.GetTextValue("Misc.AutocannonHot"), true);
return;
}
+1 -1
View File
@@ -263,7 +263,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella
if ((Behavior == 3f || Behavior == 4f) && Main.rand.NextBool(20) && Projectile.soundDelay <= 0)
{
Rectangle location = new Rectangle((int)target.position.X, (int)target.position.Y, target.width, target.height);
CombatText.NewText(location, new Color(239, 113, 152), "Stylish!", true);
CombatText.NewText(location, new Color(239, 113, 152), CalamityUtils.GetTextValue("Misc.StylishHammerHit"), true);
SoundEngine.PlaySound(StylishSound with { Volume = 0.35f }, target.Center);
Projectile.soundDelay = 60;
for (int i = 0; i < 5; i++)
+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
Main.tileNoAttach[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.addTile(Type);
AddMapEntry(new Color(106, 80, 102), CreateMapEntryName());
AddMapEntry(new Color(106, 80, 102), CalamityUtils.GetText($"{LocalizationCategory}.AbyssVent.MapEntry"));
DustType = 33;
base.SetStaticDefaults();
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
TileObjectData.newTile.LavaDeath = true;
TileObjectData.newTile.DrawYOffset = 2;
TileObjectData.addTile(Type);
AddMapEntry(new Color(132, 56, 42), CreateMapEntryName());
AddMapEntry(new Color(132, 56, 42), CalamityUtils.GetText($"{LocalizationCategory}.ThermalVent.MapEntry"));
DustType = 162;
base.SetStaticDefaults();
+1 -1
View File
@@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.Abyss
TileObjectData.newTile.DrawYOffset = 2;
TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
TileObjectData.addTile(Type);
AddMapEntry(new Color(103, 65, 64), CreateMapEntryName());
AddMapEntry(new Color(103, 65, 64), CalamityUtils.GetText($"{LocalizationCategory}.SteamGeyser.MapEntry"));
DustType = (int)CalamityDusts.SulfurousSeaAcid;
base.SetStaticDefaults();
+1 -1
View File
@@ -133,7 +133,7 @@ namespace CalamityMod.Tiles.DraedonSummoner
{
// Create a warning if someone attempts to click on a codebreaker without a computer with which to open the UI.
if (!codebreakerTileEntity.ContainsDecryptionComputer)
CombatText.NewText(player.Hitbox, Color.Cyan, "No decryption computer installed");
CombatText.NewText(player.Hitbox, Color.Cyan, CalamityUtils.GetTextValue("Misc.NoComputer"));
CodebreakerUI.ViewedTileEntityID = -1;
SoundEngine.PlaySound(SoundID.MenuClose);
+1
View File
@@ -1145,6 +1145,7 @@ namespace CalamityMod
/// <param name="solidTop">Whether this tile is supposed to have a solid top. Defaults to true.</param>
internal static void SetUpPiano(this ModTile mt, bool lavaImmune = false, bool solidTop = true)
{
Main.tileTable[mt.Type] = solidTop;
Main.tileSolidTop[mt.Type] = solidTop;
Main.tileLighted[mt.Type] = true;
Main.tileFrameImportant[mt.Type] = true;
+28
View File
@@ -294,6 +294,34 @@ namespace CalamityMod
}
}
/// <summary>
/// Shortcut for finding a specific string in the tooltip and replacing it with a new string<br/>
/// Typically used for dynamic tooltip updating. Consider overriding Tooltip or using String.Format for applying constants.
/// </summary>
/// <param name="tooltips">The tooltip list provided to a <b>ModifyTooltips</b> TML hook.</param>
/// <param name="replacedKey">The key to be replaced.</param>
/// <param name="replacedKey">The new key.</param>
public static void FindAndReplace(this List<TooltipLine> tooltips, string replacedKey, string newKey)
{
TooltipLine line = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Text.Contains(replacedKey));
if (line != null)
line.Text = line.Text.Replace(replacedKey, newKey);
}
/// <summary>
/// Shortcut for automatically placing one keybind within a tooltip. Requires the "[KEY]" string to be replaced.
/// </summary>
/// <param name="tooltips">The tooltip list provided to a <b>ModifyTooltips</b> TML hook.</param>
/// <param name="mhk">The ModKeybind to integrate into the tooltip.</param>
public static void IntegrateHotkey(this List<TooltipLine> tooltips, ModKeybind mhk)
{
if (Main.dedServ || mhk is null)
return;
string finalKey = mhk.TooltipHotkeyString();
tooltips.FindAndReplace("[KEY]", finalKey);
}
// Original code lifted from Iban's extended armor tooltips.
/// <summary>
/// Performs standard edits to a list of tooltip lines to add more if the Left SHIFT key is held down.<br />