Merge branch '1.4.4' into MageAccessories

This commit is contained in:
sunny-raindrops committed 2025-06-03 11:21:45 -07:00
commit 5d0897faf0
693 files changed
+7667 -18941

No files matched your search

+1 -1
View File
@@ -1 +1 @@
patreon: Fabsol
patreon: CalamityMod
+6 -1
View File
@@ -17,7 +17,12 @@ namespace CalamityMod.BiomeManagers
{
if (CalamityPlayer.areThereAnyDamnBosses)
return Main.curMusic;
return CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer3") ?? MusicID.Hell;
int? musicSlot = CalamityClientConfig.Instance.AbyssLayer3Alt ?
CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer3Alt") :
CalamityMod.Instance.GetMusicFromMusicMod("AbyssLayer3");
return musicSlot ?? MusicID.Hell;
}
}
+4 -1
View File
@@ -21,9 +21,12 @@ namespace CalamityMod.BiomeManagers
public override bool IsBiomeActive(Player player)
{
bool MoreThanShores = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaShoresTiles;
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaBasaltTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
return BiomeTileCounterSystem.SunkenSeaBasaltTiles > 1000 && MoreThanBurrows;
return BiomeTileCounterSystem.SunkenSeaBasaltTiles > 1000 && MoreThanShores && MoreThanReefs && MoreThanPolyp && MoreThanBurrows;
}
}
}
+3 -2
View File
@@ -21,10 +21,11 @@ namespace CalamityMod.BiomeManagers
public override bool IsBiomeActive(Player player)
{
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
bool MoreThanShores = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaShoresTiles;
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
bool MoreThanBurrows = BiomeTileCounterSystem.SunkenSeaReefsTiles > BiomeTileCounterSystem.SunkenSeaBurrowsTiles;
return BiomeTileCounterSystem.SunkenSeaReefsTiles > 1000 && MoreThanBurrows && MoreThanPolyp;
return ((BiomeTileCounterSystem.SunkenSeaReefsTiles > 500) || (BiomeTileCounterSystem.SunkenSeaBasaltTiles + BiomeTileCounterSystem.SunkenSeaReefsTiles > 500)) && MoreThanBurrows && MoreThanPolyp && MoreThanShores;
}
}
}
+2 -2
View File
@@ -21,10 +21,10 @@ namespace CalamityMod.BiomeManagers
public override bool IsBiomeActive(Player player)
{
bool MoreThanPolyp = BiomeTileCounterSystem.SunkenSeaShoresTiles > BiomeTileCounterSystem.SunkenSeaPolypTiles;
bool MoreThanReefs = BiomeTileCounterSystem.SunkenSeaShoresTiles > BiomeTileCounterSystem.SunkenSeaReefsTiles;
bool MoreThanBasalt = BiomeTileCounterSystem.SunkenSeaShoresTiles > BiomeTileCounterSystem.SunkenSeaBasaltTiles;
return BiomeTileCounterSystem.SunkenSeaShoresTiles > 1000 && MoreThanPolyp && MoreThanReefs;
return BiomeTileCounterSystem.SunkenSeaShoresTiles > 1000 && MoreThanReefs && MoreThanBasalt;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 680 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 698 B

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 691 B

After

Width:  |  Height:  |  Size: 649 B

@@ -4,7 +4,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Alcohol
{
public class CirrusVodkaBuff : ModBuff
public class PurpleHazeBuff : ModBuff
{
public override void SetStaticDefaults()
{
@@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.Alcohol
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().cirrusVodka = true;
player.Calamity().purpleHaze = true;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 664 B

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 698 B

+36
View File
@@ -14,6 +14,24 @@ namespace CalamityMod.Buffs
public override void Update(int type, Player player, ref int buffIndex)
{
// Globally remove summon tag buff stacking
// Other mods need to add to this list because we genuinely don't have any way to tell this
if (SummonTagBuffList.Includes(type) && buffIndex > 0)
{
for (int i = buffIndex; i >= 0; i--)
{
if (player.buffTime[i] > 0)
{
int buffID = player.buffType[i];
if (SummonTagBuffList.Includes(buffID) && buffID != type)
{
player.DelBuff(i);
break;
}
}
}
}
if (type == BuffID.Archery)
{
player.arrowDamage *= 0.955f;
@@ -106,6 +124,24 @@ namespace CalamityMod.Buffs
public override void Update(int type, NPC npc, ref int buffIndex)
{
// Globally remove summon tag debuff stacking, unless allowed in the SummonTag
// Other mods need to add to this list because otherwise we can't tell which IsATag buff is actually for whips
if (SummonTagDebuffDict.TryGet(type, out var tag1) && !tag1.AllowsWhipStacking && buffIndex > 0)
{
for (int i = buffIndex; i >= 0; i--)
{
if (npc.buffTime[i] > 0)
{
int buffID = npc.buffType[i];
if (SummonTagDebuffDict.TryGet(buffID, out var tag2) && !tag2.AllowsWhipStacking && buffID != type)
{
npc.DelBuff(i);
break;
}
}
}
}
if (type == BuffID.Webbed)
{
if (npc.Calamity().webbed < npc.buffTime[buffIndex])
-21
View File
@@ -1,21 +0,0 @@
using CalamityMod.Items.Mounts;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Mounts
{
public class AlicornBuff : ModBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.mount.SetMount(ModContent.MountType<AlicornMount>(), player);
player.buffTime[buffIndex] = 10;
player.Calamity().fab = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 698 B

+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Buffs.Mounts
public override void Update(Player player, ref int buffIndex)
{
player.mount.SetMount(ModContent.MountType<PhuppersChair>(), player);
player.mount.SetMount(ModContent.MountType<BrimroseChair>(), player);
player.buffTime[buffIndex] = 10;
}
}
@@ -5,7 +5,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Placeables
{
public class CirrusBlueCandleBuff : ModBuff
public class BlueCandleBuff : ModBuff
{
public override void SetStaticDefaults()
{
File renamed without changes.

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 575 B

@@ -4,7 +4,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Placeables
{
public class CirrusPinkCandleBuff : ModBuff
public class PinkCandleBuff : ModBuff
{
public override void SetStaticDefaults()
{
File renamed without changes.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 562 B

@@ -5,7 +5,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Placeables
{
public class CirrusPurpleCandleBuff : ModBuff
public class PurpleCandleBuff : ModBuff
{
public override void SetStaticDefaults()
{
File renamed without changes.

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 535 B

@@ -6,7 +6,8 @@ using static Terraria.NPC;
namespace CalamityMod.Buffs.Placeables
{
public class CirrusYellowCandleBuff : ModBuff
public class YellowCandleBuff
: ModBuff
{
public override void SetStaticDefaults()
{
File renamed without changes.

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 587 B

-27
View File
@@ -1,27 +0,0 @@
using CalamityMod.Items.Weapons.Typeless;
using Terraria;
using Terraria.Audio;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatBuffs
{
public class KamiBuff : ModBuff
{
public override LocalizedText Description => base.Description.WithFormatArgs(YanmeisKnife.RunSpeedBoost.ToPercent());
public override void SetStaticDefaults()
{
Main.debuff[Type] = false;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().kamiBoost = true;
if (player.buffTime[buffIndex] == 1)
SoundEngine.PlaySound(YanmeisKnife.ExpireSound, player.Center);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 B

-27
View File
@@ -1,27 +0,0 @@
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class KamiFlu : ModBuff
{
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().kamiFlu < npc.buffTime[buffIndex])
npc.Calamity().kamiFlu = npc.buffTime[buffIndex];
if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().kamiFlu;
npc.DelBuff(buffIndex);
buffIndex--;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

+44 -52
View File
@@ -116,7 +116,6 @@ namespace CalamityMod.CalPlayer
public int searedPanTimer = 0;
/// <summary> Used to get around the hardcoded Potion Sickness duration to allow Hadal Stew's reduced duration. </summary>
public int potionTimer = 0;
public bool cirrusDress = false;
/// <summary> If set to true, prevents all player dashes. Used by Ball and Chain, and Stygian Shield. </summary>
public bool blockAllDashes = false;
/// <summary> Used by Flamsteed Ring to reset the player's hitbox size after dismounting. </summary>
@@ -244,7 +243,6 @@ namespace CalamityMod.CalPlayer
public bool newPrincessInventory = false;
public bool newSkeletonMerchantInventory = false;
public bool newPermafrostInventory = false;
public bool newCirrusInventory = false;
public bool newAmidiasInventory = false;
public bool newBanditInventory = false;
public bool newCalamitasInventory = false;
@@ -363,7 +361,6 @@ namespace CalamityMod.CalPlayer
public int murasamaHitCooldown = 0;
public int giantShellPostHit = 0;
public int tortShellPostHit = 0;
public int RustyMedallionCooldown = 0;
public int MiniSwarmerCooldown = 0;
public float SulphWaterPoisoningLevel;
public float holyInfernoFadeIntensity;
@@ -466,7 +463,6 @@ namespace CalamityMod.CalPlayer
#region Mount
public bool onyxExcavator = false;
public bool rimehound = false;
public bool fab = false;
public bool crysthamyr = false;
public bool ExoChair = false;
public AndromedaPlayerState andromedaState;
@@ -847,7 +843,7 @@ namespace CalamityMod.CalPlayer
public int raiderCritLifespan = 0;
public int raiderSoundCooldown = 0;
public bool gSabaton = false;
public int gSabatonHotkeyHoldTime = 0;
public int gSabatonHotkeyFallWindup = -1;
public int gSabatonFall = 0;
public bool gSabatonFalling = false;
public int gSabatonTempJumpSpeed = 0;
@@ -963,6 +959,7 @@ namespace CalamityMod.CalPlayer
public bool XykVisualsBlue = false;
public bool XykVisualsOrange = false;
public Color XykFXColor = Color.Black;
public int XykWingTimer = 0;
public bool manaOverloader = false;
/// <summary> Used for allowing Calamity slimes to be affected by Royal Gel. </summary>
public bool royalGel = false;
@@ -1026,6 +1023,9 @@ namespace CalamityMod.CalPlayer
public bool veneratedLocket = false;
public bool camper = false;
public bool corrosiveSpine = false;
public bool scionsCurio = false;
public bool scionsCurioGotHit = false;
public bool scionsCurioVisuals = false;
public bool miniOldDuke = false;
public bool miniOldDukeVanity = false;
public bool starbusterCore = false;
@@ -1042,7 +1042,6 @@ namespace CalamityMod.CalPlayer
public int phantomicHeartRegen = 0;
/// <summary> General cooldown variable for spawning projectiles from wing bonus effects. Used by Soul of Cryogen, Tattered Fairy Wings, and Festive Wings. </summary>
public int wingProjectileCooldown = 0;
public bool RustyMedallionDroplets = false;
public bool noStupidNaturalARSpawns = false;
/// <summary> Used for animating Void Concentration Staff's draw layer. </summary>
public int voidFrameCounter = 0;
@@ -1329,7 +1328,7 @@ namespace CalamityMod.CalPlayer
public bool zen = false;
public bool isNearbyBoss = false;
public bool flaskBrimstone = false;
public bool cirrusVodka = false;
public bool purpleHaze = false;
public bool mushy = false;
public bool PinkJellyRegen = false;
public bool GreenJellyRegen = false;
@@ -1391,7 +1390,6 @@ namespace CalamityMod.CalPlayer
public int bloodfinTimer = 30;
public bool hallowedRegen = false;
public bool hallowedPower = false;
public bool kamiBoost = false;
public bool avertorBonus = false;
public bool divineBless = false;
public bool infiniteFlight = false;
@@ -1542,6 +1540,16 @@ namespace CalamityMod.CalPlayer
public bool AmphibiansGuitarBool = false;
#endregion
#region Whip
public bool forceSummonTagCrit = false; //Forces whip multiplicative effects to function as crit chance
public bool forceSummonTagMultiplicative = false; //Forces whip multiplicative effects to function as multiplicative damage
//Allows providing flat, crit, and multiplicative tag values on gear. These will apply on *any* minion or sentry hit, not just if the target is tagged.
public int bonusFlatTag = 0;
public float bonusCritTag = 0;
public float bonusMultTag = 0;
#endregion
#region Biome
public bool ZoneSunkenSea => ZoneTimelessShores || ZoneRadiantReefs || ZonePolypForest || ZoneGleamingBurrows || ZoneClamDen || ZoneBasaltGully;
public bool ZoneTimelessShores => Player.InModBiome<TimelessShoresBiome>();
@@ -1775,7 +1783,6 @@ namespace CalamityMod.CalPlayer
newPrincessInventory = false;
newSkeletonMerchantInventory = false;
newPermafrostInventory = false;
newCirrusInventory = false;
newAmidiasInventory = false;
newBanditInventory = false;
newCalamitasInventory = false;
@@ -1829,7 +1836,6 @@ namespace CalamityMod.CalPlayer
boost.AddWithCondition("newPrincessInventory", newPrincessInventory);
boost.AddWithCondition("newSkeletonMerchantInventory", newSkeletonMerchantInventory);
boost.AddWithCondition("newPermafrostInventory", newPermafrostInventory);
boost.AddWithCondition("newCirrusInventory", newCirrusInventory);
boost.AddWithCondition("newAmidiasInventory", newAmidiasInventory);
boost.AddWithCondition("newBanditInventory", newBanditInventory);
boost.AddWithCondition("newCalamitasInventory", newCalamitasInventory);
@@ -1921,7 +1927,6 @@ namespace CalamityMod.CalPlayer
newPrincessInventory = boost.Contains("newPrincessInventory");
newSkeletonMerchantInventory = boost.Contains("newSkeletonMerchantInventory");
newPermafrostInventory = boost.Contains("newPermafrostInventory");
newCirrusInventory = boost.Contains("newCirrusInventory");
newAmidiasInventory = boost.Contains("newAmidiasInventory");
newBanditInventory = boost.Contains("newBanditInventory");
newCalamitasInventory = boost.Contains("newCalamitasInventory");
@@ -2096,7 +2101,6 @@ namespace CalamityMod.CalPlayer
onyxExcavator = false;
rimehound = false;
fab = false;
crysthamyr = false;
ExoChair = false;
miniOldDuke = false;
@@ -2160,7 +2164,6 @@ namespace CalamityMod.CalPlayer
shadowSpeed = false;
dsSetBonus = false;
wearingRogueArmor = false;
cirrusDress = false;
blockAllDashes = false;
blazingCursorDamage = false;
@@ -2303,7 +2306,6 @@ namespace CalamityMod.CalPlayer
phantomicArtifact = false;
hallowedRegen = false;
hallowedPower = false;
kamiBoost = false;
tracersDust = false;
tracersCelestial = false;
tracersElysian = false;
@@ -2321,7 +2323,7 @@ namespace CalamityMod.CalPlayer
starTaintedGenerator = false;
camper = false;
corrosiveSpine = false;
RustyMedallionDroplets = false;
scionsCurio = false;
rottenDogTooth = false;
angelicAlliance = false;
BloomStoneRegen = false;
@@ -2544,7 +2546,7 @@ namespace CalamityMod.CalPlayer
trippy = false;
amidiasBlessing = false;
flaskBrimstone = false;
cirrusVodka = false;
purpleHaze = false;
shine = false;
anechoicCoating = false;
mushy = false;
@@ -2711,6 +2713,13 @@ namespace CalamityMod.CalPlayer
AmphibiansGuitarBool = false;
#endregion
//On GFB both are enabled to cause the game to pick between multiplicative and crit at random
forceSummonTagMultiplicative = (Main.zenithWorld ? true : false);
forceSummonTagCrit = (Main.zenithWorld ? true : false);
bonusFlatTag = 0;
bonusCritTag = 0;
bonusMultTag = 0;
/* Spawn blockers from back when they used to work by being favorited and not a toggleable item
noStupidNaturalARSpawns = false
disableVoodooSpawns = false;
@@ -2867,7 +2876,6 @@ namespace CalamityMod.CalPlayer
bloomStoneHealTimer = 0;
bloomStoneDR = 0;
murasamaHitCooldown = 0;
RustyMedallionCooldown = 0;
SulphWaterPoisoningLevel = 0f;
holyInfernoFadeIntensity = 0f;
spiritOriginCritBoost = 0;
@@ -2876,7 +2884,7 @@ namespace CalamityMod.CalPlayer
adrenaline = 0f;
raiderCritLifespan = 0;
raiderSoundCooldown = 0;
gSabatonHotkeyHoldTime = 0;
gSabatonHotkeyFallWindup = -1;
gSabatonFall = 0;
gSabatonFalling = false;
gSabatonTempJumpSpeed = 0;
@@ -3004,7 +3012,6 @@ namespace CalamityMod.CalPlayer
hallowedPower = false;
onyxExcavator = false;
rimehound = false;
fab = false;
crysthamyr = false;
ExoChair = false;
abyssalDivingSuitPlates = false;
@@ -3018,7 +3025,6 @@ namespace CalamityMod.CalPlayer
crimEffigy = false;
rRage = false;
xWrath = false;
kamiBoost = false;
graxDefense = false;
encased = false;
brutalCarnage = false;
@@ -3042,7 +3048,7 @@ namespace CalamityMod.CalPlayer
sulphurskin = false;
baguette = false;
flaskBrimstone = false;
cirrusVodka = false;
purpleHaze = false;
shine = false;
anechoicCoating = false;
mushy = false;
@@ -3337,18 +3343,20 @@ namespace CalamityMod.CalPlayer
}
//Only increment hotkey holdtime if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset hold time to zero
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != 0) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
//Only increment the slam if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset slam time to zero
if (CalamityKeybinds.GravistarSabatonHotkey.JustPressed && gSabatonHotkeyFallWindup < 0)
gSabatonHotkeyFallWindup = 0;
if (gSabaton && gSabatonHotkeyFallWindup >= 0 && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != 0) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
{
gSabatonHotkeyHoldTime++;
if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime % 3f == 0)
gSabatonHotkeyFallWindup++;
if (gSabatonHotkeyFallWindup < 20 && gSabatonHotkeyFallWindup % 2f == 0)
{
SpawnGravistarParticle();
}
}
else if (Main.myPlayer == Player.whoAmI)
{
gSabatonHotkeyHoldTime = 0;
gSabatonHotkeyFallWindup = -1;
}
if (CalamityKeybinds.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == Player.whoAmI)
@@ -4124,16 +4132,16 @@ namespace CalamityMod.CalPlayer
{
if (Player.whoAmI == Main.myPlayer)
{
// While holding hotkey, but before slam, bring Y velocity closer to 0
if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 2f)) / 60f;
// While preparing slam, bring Y velocity closer to 0
if (gSabatonHotkeyFallWindup < 20 && gSabatonHotkeyFallWindup != 0 && !gSabatonFalling)
Player.velocity.Y *= (60 - (gSabatonHotkeyFallWindup * 0.75f)) / 60f;
// Play sound a bit early so it goes in time with the fall
if (gSabatonHotkeyHoldTime == 15 && !gSabatonFalling)
if (gSabatonHotkeyFallWindup == 5 && !gSabatonFalling)
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
// 0.5 seconds passed, falling time
if (gSabatonHotkeyHoldTime == 30)
if (gSabatonHotkeyFallWindup == 20)
{
gSabatonFalling = true;
Player.velocity.Y = 0.01f;
@@ -4145,6 +4153,7 @@ namespace CalamityMod.CalPlayer
{
gSabatonFall = 0;
gSabatonFalling = false;
gSabatonHotkeyFallWindup = -1;
}
if (gSabatonFalling)
@@ -4172,6 +4181,7 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ProjectileType<StomperSlam>(), damage, 4f, Player.whoAmI, gSabatonFall);
gSabatonFall = 0;
gSabatonFalling = false;
gSabatonHotkeyFallWindup = -1;
// Temporary jump speed is granted for 40 frames
gSabatonTempJumpSpeed = 40;
@@ -4183,6 +4193,7 @@ namespace CalamityMod.CalPlayer
{
gSabatonFall = 0;
gSabatonFalling = false;
gSabatonHotkeyFallWindup = -1;
}
// Reset The Evolution's same projectile DR if unequipped or the cooldown ends
@@ -4462,7 +4473,6 @@ namespace CalamityMod.CalPlayer
(laudanum && Player.HasBuff(BuffID.VortexDebuff) ? 0.15f : 0f) +
((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) +
(dragonScales ? 0.1f : 0f) +
(kamiBoost ? YanmeisKnife.RunAccelerationBoost : 0f) +
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
(silvaSet ? 0.05f : 0f) +
(getSandCloakAccelBoost ? 0.75f : 0f) +
@@ -4483,7 +4493,6 @@ namespace CalamityMod.CalPlayer
(aquaticHeartWaterBuff ? AquaticHeart.WaterSpeedBoost : 0f) +
((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) +
(dragonScales ? 0.1f : 0f) +
(kamiBoost ? YanmeisKnife.RunSpeedBoost : 0f) +
(CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) +
(silvaSet ? 0.05f : 0f) +
(nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) +
@@ -4857,21 +4866,6 @@ namespace CalamityMod.CalPlayer
}
}
}
if (RustyMedallionDroplets && RustyMedallionCooldown <= 0)
{
if (item.CountsAsClass<RangedDamageClass>())
{
var MedallionSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<RustyMedallion>()));
int d = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(RustyMedallion.AcidDropBaseDamage);
Vector2 mouse = Player.ClampedMouseWorld();
Vector2 startingPosition = mouse - Vector2.UnitY.RotatedByRandom(0.3f) * 1250f;
Vector2 directionToMouse = (mouse - startingPosition).SafeNormalize(Vector2.UnitX);
Projectile.NewProjectile(MedallionSource, startingPosition, directionToMouse * 15f, ProjectileType<RustyMedallionDroplet>(), d, 0f, Player.whoAmI, 3);
RustyMedallionCooldown = RustyMedallion.AcidCreationCooldown;
}
}
return true;
}
#endregion
@@ -4916,8 +4910,6 @@ namespace CalamityMod.CalPlayer
abyssalDivingSuitForce = true;
if (vanity.type == ModContent.ItemType<AquaticHeart>())
aquaticHeartForce = true;
if (vanity.type == ModContent.ItemType<CrystalHeartVodka>())
Player.GetModPlayer<CrystalHeartVodkaPlayer>().vanityEquipped = true;
if (vanity.type == ModContent.ItemType<GhostBracelet>())
ghostBracelet = true;
if (vanity.type == ModContent.ItemType<HapuFruit>())
@@ -5321,7 +5313,7 @@ namespace CalamityMod.CalPlayer
public override void PostNurseHeal(NPC nurse, int health, bool removeDebuffs, int price)
{
// Remove excess alcohol
if (removeDebuffs && alcoholPoisonLevel > (cirrusDress ? 5 : 3))
if (removeDebuffs && alcoholPoisonLevel > 3)
{
List<int[]> Alcohol = new List<int[]>();
for (int i = 0; i < Player.MaxBuffs; i++)
@@ -5340,7 +5332,7 @@ namespace CalamityMod.CalPlayer
poison -= relation[1]; // Cancel the poison level
Alcohol.RemoveAt(0);
}
while (poison > (cirrusDress ? 5 : 3));
while (poison > 3);
}
}
#endregion
-15
View File
@@ -506,21 +506,6 @@ namespace CalamityMod.CalPlayer
public void ModHorizontalMovement()
{
if (Player.mount.Active && Player.mount.Type == ModContent.MountType<AlicornMount>() && Math.Abs(Player.velocity.X) > Player.mount.DashSpeed - Player.mount.RunSpeed / 2f)
{
Rectangle damageHitbox = Player.getRect();
if (Player.direction == 1)
damageHitbox.Offset(Player.width - 1, 0);
damageHitbox.Width = 2;
damageHitbox.Inflate(6, 12);
float damage = Player.GetTotalDamage<SummonDamageClass>().ApplyTo(800f);
float knockback = 10f;
int NPCImmuneTime = 30;
int playerImmuneTime = 6;
DoMountDashDamage(damageHitbox, damage, knockback, NPCImmuneTime, playerImmuneTime);
}
if (Player.mount.Active && Player.mount.Type == ModContent.MountType<ExoTank>() && Math.Abs(Player.velocity.X) > Player.mount.RunSpeed)
{
+17 -8
View File
@@ -535,7 +535,10 @@ namespace CalamityMod.CalPlayer
// FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit
CalamityGlobalNPC cgn = target.Calamity();
if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f)
modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite;
modifiers.ModifyHitInfo += YellowCandleBuff.ModifyHitInfo_Spite;
if (Player.Calamity().scionsCurio && item.CountsAsClass<RangedDamageClass>())
target.Calamity().scionsCurioEffected = true;
// Frost Armor's rework gives +X% melee damage and +Y% ranged damage based on distance, where X+Y = 15.
if (frostSet)
@@ -619,7 +622,7 @@ namespace CalamityMod.CalPlayer
// FinalDamage cannot be used for the intended effect because there is no way to access the actual damage of the hit
CalamityGlobalNPC cgn = target.Calamity();
if (yellowCandle && cgn.DR < 0.99f && target.takenDamageMultiplier > 0.05f)
modifiers.ModifyHitInfo += CirrusYellowCandleBuff.ModifyHitInfo_Spite;
modifiers.ModifyHitInfo += YellowCandleBuff.ModifyHitInfo_Spite;
// Stealth strike damage multipliers are applied here.
// TODO -- stealth should be its own damage class and this should be applied as player StealthDamage *= XYZ
@@ -638,6 +641,9 @@ namespace CalamityMod.CalPlayer
if (proj.type == ProjectileID.InfernoFriendlyBlast)
modifiers.SourceDamage *= 1.2f;
if (Player.Calamity().scionsCurio && proj.CountsAsClass<RangedDamageClass>())
target.Calamity().scionsCurioEffected = true;
// Frost Armor's rework gives +X% melee damage and +Y% ranged damage based on distance, where X+Y = 15.
if (frostSet)
{
@@ -718,7 +724,7 @@ namespace CalamityMod.CalPlayer
// Enemies deal less contact damage while sick, due to being weakened.
if (npc.poisoned)
{
float damageReductionFromPoison = npc.Calamity().irradiated > 0 ? 0.075f : 0.05f;
float damageReductionFromPoison = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -733,7 +739,7 @@ namespace CalamityMod.CalPlayer
if (npc.venom)
{
float damageReductionFromVenom = npc.Calamity().irradiated > 0 ? 0.075f : 0.05f;
float damageReductionFromVenom = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -748,7 +754,7 @@ namespace CalamityMod.CalPlayer
if (npc.Calamity().astralInfection > 0)
{
float damageReductionFromAstralInfection = npc.Calamity().irradiated > 0 ? 0.075f : 0.05f;
float damageReductionFromAstralInfection = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -763,7 +769,7 @@ namespace CalamityMod.CalPlayer
if (npc.Calamity().pFlames > 0)
{
float damageReductionFromPlague = npc.Calamity().irradiated > 0 ? 0.075f : 0.05f;
float damageReductionFromPlague = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.05f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -778,7 +784,7 @@ namespace CalamityMod.CalPlayer
if (npc.Calamity().wDeath > 0)
{
float damageReductionFromWhisperingDeath = npc.Calamity().irradiated > 0 ? 0.15f : 0.1f;
float damageReductionFromWhisperingDeath = (float)((npc.Calamity().irradiated > 0 ? npc.Calamity().irradiatedContactBoost : 1) * 0.1f);
if (npc.Calamity().VulnerableToSickness.HasValue)
{
if (npc.Calamity().VulnerableToSickness.Value)
@@ -1780,7 +1786,7 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center); //metal hit noise
hurtSoundTimer = 10;
}
else if (((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide) || Player.GetModPlayer<CrystalHeartVodkaPlayer>().vanityEquipped)
else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide)
{
modifiers.DisableSound();
SoundEngine.PlaySound(SoundID.FemaleHit, Player.Center); //female hit noise
@@ -1913,6 +1919,9 @@ namespace CalamityMod.CalPlayer
Player.AddCooldown(ParryCooldown.ID, 1200, false, "shieldoftheocean");
ShieldoftheOcean.ActivateParry(Player);
}
if (Player.Calamity().scionsCurio)
scionsCurioGotHit = true;
}
private void ModifyHurtInfo_Calamity(ref Player.HurtInfo info)
+11 -11
View File
@@ -234,7 +234,7 @@ namespace CalamityMod.CalPlayer
Player.fishingSkill += 5;
}
if (alcoholPoisonLevel > (cirrusDress ? 5 : 3))
if (alcoholPoisonLevel > 3)
{
// Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning.
Player.nebulaLevelLife = 0;
@@ -251,12 +251,6 @@ namespace CalamityMod.CalPlayer
}
#endregion
if (manaOverloader)
{
if (Player.statMana > (int)(Player.statManaMax2 * 0.5))
totalNegativeLifeRegen += 3;
}
if (brimflameFrenzy)
{
Player.manaRegen = 0;
@@ -398,7 +392,7 @@ namespace CalamityMod.CalPlayer
{
float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2;
//Ambrosial Ampule and ooze give between 2 and 6 hp/s
int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp((purity || aAmpoule? 2f : 4f), (purity || aAmpoule ? 8f : 12f), missingLifeRatio));//Rounding is needed for it to ever actually give +6 hp/s, as the integer conversion would otherwise floor it.
int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp((purity || aAmpoule? 2f : 4f), (purity || aAmpoule ? 10f : 12f), missingLifeRatio));//Rounding is needed for it to ever actually give +6 hp/s, as the integer conversion would otherwise floor it.
Player.lifeRegen += lifeRegenToGive;
radiantOozeRegen += lifeRegenToGive / 2f;
ambrosialAmpouleRegen += lifeRegenToGive / 2f;
@@ -715,13 +709,19 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += (int)MathHelper.Lerp(2f, 6f, regenBenefitFactor);
Player.lifeRegenTime += (int)MathHelper.Lerp(1f, 3f, regenBenefitFactor);
}
if (manaOverloader)
{
float manaRatio = Player.statMana / (float)Player.statManaMax2;
Player.lifeRegen += (int)(MathF.Round(MathHelper.Lerp(4f, -4f, manaRatio)) * (Player.HasBuff(BuffID.ManaSickness) ? 0.5f : 1f));
}
#region Standing Still Life Regen
// Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly)
if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0)
{
bool honeyDewWorking = honeyTurboRegen && Player.honeyWet;
bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || aAmpoule || purity;
bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || aAmpoule || purity;
// Divides all negative life regen by two before applying any other effects.
if (anyStandingStillLifeRegen && Player.lifeRegen < 0)
@@ -759,8 +759,8 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += turboRegenPower;
Player.lifeRegenTime += turboRegenPower;
purityRegen += turboRegenPower/2f;
if (!shadeRegen || cFreeze || purity) ambrosialAmpouleRegen += turboRegenPower/2f;
purityRegen += turboRegenPower / 2f;
if (!shadeRegen || cFreeze || purity) ambrosialAmpouleRegen += turboRegenPower / 2f;
}
}
+20 -28
View File
@@ -254,12 +254,21 @@ namespace CalamityMod.CalPlayer
foreach (Projectile p in Main.ActiveProjectiles)
if (p.type == ModContent.ProjectileType<XykWings>() && p.owner == Player.whoAmI && p.ai[1] == 0)
numOfActiveWings++;
bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && !(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0;
bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && ((!(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0) || XykWingTimer >= 3);
if (spawnWings)
{
int wingCount = numOfActiveWings;
Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<XykWings>(), 0, 0f, Player.whoAmI, wingCount);
if (XykWingTimer >= 3)
{
int wingCount = numOfActiveWings;
Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<XykWings>(), 0, 0f, Player.whoAmI, wingCount);
if (numOfActiveWings + 1 == maxWingPieces)
XykWingTimer = 0;
}
else
XykWingTimer++;
}
else
XykWingTimer = 0;
}
// First Frame dash effects
@@ -293,16 +302,6 @@ namespace CalamityMod.CalPlayer
Player.velocity.X *= 0.9f;
}
}
if (Player.Calamity().statisNinjaBelt)
{
Player.Calamity().DashID = StatisNinjaBeltDash.ID;
}
if (Player.Calamity().statisVoidSash)
{
Player.Calamity().DashID = StatisVoidSashDash.ID;
}
if ((devilsDevastationKillMode || exaltedKillMode) && !Player.mount.Active)
{
float fxScale = 1;
@@ -1296,8 +1295,6 @@ namespace CalamityMod.CalPlayer
{
if (!Player.wet)
{
if (cirrusDress)
Player.maxFallSpeed = 12f;
if (aeroSet)
Player.maxFallSpeed = 15f;
if (Player.PortalPhysicsEnabled)
@@ -2300,8 +2297,6 @@ namespace CalamityMod.CalPlayer
if (miningSetCooldown > 0)
miningSetCooldown--;
if (RustyMedallionCooldown > 0)
RustyMedallionCooldown--;
if (MiniSwarmerCooldown > 0)
MiniSwarmerCooldown--;
@@ -2516,9 +2511,6 @@ namespace CalamityMod.CalPlayer
if (vampiricTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f)
Player.GetCritChance<ThrowingDamageClass>() += VampiricTalisman.RaiderBonus;
if (kamiBoost)
Player.GetDamage<GenericDamageClass>() += YanmeisKnife.DamageBoost;
if (avertorBonus)
Player.GetDamage<GenericDamageClass>() += 0.1f;
@@ -3521,11 +3513,8 @@ namespace CalamityMod.CalPlayer
if (Player.chilled)
Player.moveSpeed *= 1f + (1f / 6f);
if (cirrusDress)
Player.moveSpeed -= 0.2f;
if (cirrusVodka)
Player.GetDamage<GenericDamageClass>() += CirrusVodka.DamageBoost;
if (purpleHaze)
Player.GetDamage<GenericDamageClass>() += PurpleHaze.DamageBoost;
if (vodka)
{
@@ -3805,7 +3794,10 @@ namespace CalamityMod.CalPlayer
}
if (manaOverloader)
Player.GetDamage<MagicDamageClass>() += 0.06f;
{
float manaRatio = Player.statMana / (float)Player.statManaMax2;
Player.GetDamage<MagicDamageClass>() += MathHelper.Lerp(0.05f,0.15f,manaRatio);
}
if (bloodyWormTooth)
{
@@ -4828,10 +4820,10 @@ namespace CalamityMod.CalPlayer
// Multiplicative defense reductions.
// These are done last because they need to be after the defense lower cap at 0.
if (cirrusVodka)
if (purpleHaze)
{
if (Player.statDefense > 0)
Player.statDefense -= (int)(Player.statDefense * CirrusVodka.DefenseLossPercent);
Player.statDefense -= (int)(Player.statDefense * PurpleHaze.DefenseLossPercent);
}
if (vodka)
+2 -3
View File
@@ -144,7 +144,6 @@ namespace CalamityMod.CalPlayer
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
if (generalBandCooldown == 0)
{
int cooldown = 0;
@@ -1402,9 +1401,9 @@ namespace CalamityMod.CalPlayer
{
if (manaOverloader)
{
double healMult = 0.2;
double healMult = 0.1;
healMult -= proj.numHits * healMult * 0.25;
int heal = (int)Math.Round(damage * healMult * (Player.statMana / (double)Player.statManaMax2));
int heal = (int)Math.Round(damage * healMult);
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
+12 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.CalPlayer.Dashes
public int Time = 0;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => (50f * player.moveSpeed);
public override float CalculateDashSpeed(Player player) => (55f * player.moveSpeed);
public override void OnDashEffects(Player player)
{
@@ -69,6 +69,17 @@ namespace CalamityMod.CalPlayer.Dashes
dust2.fadeIn = 0.5f;
player.velocity.X *= 0.93f;
if (player.velocity.X > 140)
{
player.velocity.X = 140;
}
if (player.velocity.X < -140)
{
player.velocity.X = -140;
}
if (Time > 6)
player.velocity.X *= 0.5f;
}
}
}
+10
View File
@@ -110,6 +110,16 @@ namespace CalamityMod.CalPlayer.Dashes
}
}
player.velocity.X *= 0.912f;
if (player.velocity.X > 140)
{
player.velocity.X = 140;
}
if (player.velocity.X < -140)
{
player.velocity.X = -140;
}
if (Time > 8)
player.velocity.X *= 0.5f;
}
}
}
@@ -13,7 +13,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
Player drawPlayer = drawInfo.drawPlayer;
CalamityPlayer modPlayer = drawPlayer.Calamity();
return drawPlayer.mount != null && (modPlayer.fab || modPlayer.crysthamyr || modPlayer.onyxExcavator);
return drawPlayer.mount != null && (modPlayer.crysthamyr || modPlayer.onyxExcavator);
}
protected override void Draw(ref PlayerDrawSet drawInfo)
@@ -0,0 +1,41 @@
using CalamityMod.Items.Accessories.Wings;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Graphics.PackedVector;
using ReLogic.Content;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.DrawLayers
{
public class WingsofRebirthLayer : PlayerDrawLayer
{
public static Asset<Texture2D> yharwingTexture;
public override void Load()
{
yharwingTexture = ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/Wings/WingsofRebirth_Wings_Real");
}
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.Wings);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => drawInfo.drawPlayer.wings == EquipLoader.GetEquipSlot(Mod, "WingsofRebirth", EquipType.Wings);
protected override void Draw(ref PlayerDrawSet drawInfo)
{
Player drawPlayer = drawInfo.drawPlayer;
if (drawPlayer.dead)
return;
Texture2D texture = yharwingTexture.Value;
Vector2 Position = drawInfo.Position;
Vector2 pos = new Vector2((int)(Position.X - Main.screenPosition.X + (drawPlayer.width / 2) - (2 * drawPlayer.direction)), (int)(Position.Y - Main.screenPosition.Y + (drawPlayer.height / 2) - 2f * drawPlayer.gravDir));
Color lightColor = Lighting.GetColor((int)drawPlayer.Center.X / 16, (int)drawPlayer.Center.Y / 16, Color.White);
Color color = lightColor * (1 - drawInfo.shadow);
DrawData d = new DrawData(texture, pos, texture.Frame(1, 9, 0, drawInfo.drawPlayer.wingFrame), color, 0f, new Vector2(texture.Width / 2, texture.Height / 18), 1f, drawInfo.playerEffect, 0);
d.shader = drawInfo.drawPlayer.cWings;
drawInfo.DrawDataCache.Add(d);
}
}
}
-7
View File
@@ -23,13 +23,6 @@ namespace CalamityMod
public static readonly Condition PlayerHasWings = Create("HasWings", () => Main.LocalPlayer.wingTimeMax > 0);
public static readonly Condition PlayerAlcoholPoisoned = Create("AlcoholPoison", () => Main.LocalPlayer.Calamity().alcoholPoisoning);
//
// NPC conditions
//
/// <summary>Don't use this. It's always `true`.</summary>
public static readonly Condition TrasherTextCondition = Create("Drops.TrasherKill", () => true);
//
// Calamity Event Flag conditions
//
+10 -2
View File
@@ -64,6 +64,10 @@ namespace CalamityMod
[DefaultValue(false)]
public bool DisableGravityScreenSwap { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool TextEffects { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool Afterimages { get; set; }
@@ -262,8 +266,8 @@ namespace CalamityMod
public float FlightBarPosY { get; set; }
#endregion
#region Music Events
[Header("MusicEvents")]
#region Music Toggles
[Header("MusicToggles")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
@@ -281,6 +285,10 @@ namespace CalamityMod
[DefaultValue(true)]
public bool DevourerofGodsEulogy { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
public bool AbyssLayer3Alt { get; set; }
#endregion
#region General Gameplay Changes
+7 -4
View File
@@ -5,6 +5,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using CalamityMod.FluidSimulation;
using CalamityMod.Items;
using CalamityMod.MainMenu;
using CalamityMod.Particles;
using CalamityMod.Projectiles;
using Microsoft.Xna.Framework;
@@ -19,10 +20,6 @@ namespace CalamityMod
public class CalamityMod : Mod
{
#region External Flags
// External flag to disable non-Revengeance boss AI edits
// This can be edited by other mods using reflection to prevent compatibility issues
public static bool ExternalFlag_DisableNonRevBossAI = false;
// External flag to disable Defense Damage
// This can be edited by other mods using reflection if desired
// Note that this flag trumps Bloodflare Core and will stop that accessory from working properly.
@@ -50,6 +47,12 @@ namespace CalamityMod
Main.QueueMainThreadAction(() => Main.OnPreDraw += PrepareRenderTargets);
}
}
public override void PostSetupContent()
{
// Force open certain ModMenus for various reasons and the added flair of "Hey! Something big has happened! Check it out!"
CalamityMainMenu_Sunken.ForceMenuStyle();
}
#endregion
#region Unload
+184
View File
@@ -0,0 +1,184 @@
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ID;
namespace CalamityMod.DataStructures
{
/// <summary>
/// This is used to store summon tag stats so they can be applied automatically.
/// </summary>
public class SummonTag
{
#region SummonTag data
/// <summary>
/// Flat tag damage from this summon tag
/// </summary>
public int FlatTagDamage = 0;
/// <summary>
/// This is tag damage that isn't added to the tooltip. Used for removing Vanilla whip tag damage.
/// </summary>
public int UnlistedTagDamage = 0;
/// <summary>
/// Multiplicative tag damage from this summon tag. Stacks additively with other tags.
/// </summary>
public float MultiplicativeTagDamage = 0;
/// <summary>
/// This is tag damage that isn't added to the tooltip. Used for removing Firecracker whip damage.
/// </summary>
public float UnlistedMultiplicativeTagDamage = 0;
/// <summary>
/// Tag critical strike chance from this stummon tag. Stacks additively with other tags.
/// </summary>
public float TagCritChance = 0;
/// <summary>
/// How much the Critical Strike damage multiplier should be adjusted with this tag. Stacks additively with other tags.
/// </summary>
public float TagCritDamage = 0;
/// <summary>
/// UNIMPLEMENTED. Need to add animation frame support before using.
/// What the texture for the tag effect should be.
/// </summary>
public Asset<Texture2D> TagTexture;
/// <summary>
/// What item inflicted this tag
/// </summary>
public int TagItem = -1;
/// <summary>
/// The ModifyHitByProjectileTag code to run. Defaults to just applying the tag effects.
/// </summary>
public ModifyHitByProjectileTag TagModifyHitEffects;
/// <summary>
/// Disable to stop tooltips from drawing automatically, for things that change TagModifyHitEffects
/// </summary>
public bool AutoDrawTooltip = true;
/// <summary>
/// Setting to true allows this tag to be used alongside other tag effects.
/// </summary>
public bool AllowsWhipStacking = false;
/// <summary>
/// The OnHitByProjectile code to run when this tag is applied. Defaults to nothing.
/// </summary>
public OnHitByProjectile TagOnHit = BlankOnHit;
public SummonTag()
{
TagModifyHitEffects = ApplyTagModifyHit;
}
public SummonTag(int itemType)
{
TagItem = itemType;
TagModifyHitEffects = ApplyTagModifyHit;
}
/// <summary>
/// A modified version of ModifyHitByProjectile that incorporates tag damage multipliers and tag critical chance.
/// This delegate is used for TagModifyHitEffects
/// </summary>
/// <param name="proj"></param>
/// <param name="npc"></param>
/// <param name="modifiers"></param>
/// <param name="tagDamageMult"></param>
/// <param name="critChance"></param>
public delegate void ModifyHitByProjectileTag(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers, ref float tagDamageMult, ref float critChance);
/// <summary>
/// This delegate is used for TagOnHit
/// </summary>
/// <param name="npc"></param>
/// <param name="projectile"></param>
/// <param name="hit"></param>
/// <param name="damageDone"></param>
public delegate void OnHitByProjectile(NPC npc, Projectile projectile, NPC.HitInfo hit, int damageDone);
/// <summary>
/// The default tag damage functionality
/// </summary>
public void ApplyTagModifyHit(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers, ref float tagDamageMult, ref float critChance)
{
modifiers.FlatBonusDamage += (FlatTagDamage + UnlistedTagDamage) * tagDamageMult;
modifiers.ScalingBonusDamage += (MultiplicativeTagDamage + UnlistedMultiplicativeTagDamage) * tagDamageMult;
critChance += TagCritChance;
modifiers.CritDamage += TagCritDamage;
}
/// <summary>
/// Due to how Firecracker works, this allows it to work with crit accessories.
/// </summary>
public static void FirecrackerModifyHit(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers, ref float tagDamageMult, ref float critChance)
{
modifiers.ScalingBonusDamage += (Firecracker.MultiplicativeTagDamage + Firecracker.UnlistedMultiplicativeTagDamage) * tagDamageMult;
modifiers.CritDamage += Firecracker.TagCritDamage;
}
/// <summary>
/// This is replaced by custom tag on hit effects. Does nothing.
/// </summary>
public static void BlankOnHit(NPC npc, Projectile projectile, NPC.HitInfo hit, int damagedone) { }
#endregion
#region Vanilla whip stats
public static SummonTag LeatherWhip = new SummonTag(ItemID.BlandWhip)
{
FlatTagDamage = 4,
UnlistedTagDamage = -4 //Negative value cancels out vanilla tag damage
};
public static SummonTag Snapthorn = new SummonTag(ItemID.ThornWhip)
{
FlatTagDamage = 4,
UnlistedTagDamage = -6 //Negative value cancels out vanilla tag damage
};
public static SummonTag SpinalTap = new SummonTag(ItemID.BoneWhip)
{
FlatTagDamage = 5,
UnlistedTagDamage = -7 //Negative value cancels out vanilla tag damage
};
public static SummonTag Firecracker = new SummonTag(ItemID.FireWhip)
{
MultiplicativeTagDamage = 1f,
TagCritDamage = -1f,
TagModifyHitEffects = FirecrackerModifyHit,
UnlistedMultiplicativeTagDamage = -1.75f, //Cancels out the vanilla firecracker tag damage
AutoDrawTooltip = false
};
public static SummonTag CoolWhip = new SummonTag(ItemID.CoolWhip)
{
FlatTagDamage = 8,
UnlistedTagDamage = -6 //Negative value cancels out vanilla tag damage
};
public static SummonTag Durendal = new SummonTag(ItemID.SwordWhip)
{
FlatTagDamage = 5,
TagCritChance = 0.05f,
UnlistedTagDamage = -9 //Negative value cancels out vanilla tag damage
};
public static SummonTag MorningStar = new SummonTag(ItemID.MaceWhip)
{
TagCritChance = 0.13f,
UnlistedTagDamage = -8 //Negative value cancels out vanilla tag damage
};
public static SummonTag DarkHarvest = new SummonTag(ItemID.ScytheWhip)
{
FlatTagDamage = 14,
UnlistedTagDamage = -10, //Negative value cancels out vanilla tag damage
//This has a unique on hit effect from vanilla.
};
public static SummonTag Kaleidoscope = new SummonTag(ItemID.RainbowWhip)
{
FlatTagDamage = 10,
TagCritChance = 0.10f,
UnlistedTagDamage = -20 //Negative value cancels out vanilla tag damage
};
#endregion
}
}
+23 -5
View File
@@ -19,9 +19,9 @@ namespace CalamityMod.Effects
internal static Effect AstralFogShader;
//
// All below shaders created by Dominic Karma
// All below shaders created by Lucille Karma
//
#region Dominic's Shaders
#region Lucille's Shaders
// The Dance of Light's Blinding Light
internal static Effect DanceOfLightBlindingShader;
@@ -50,7 +50,7 @@ namespace CalamityMod.Effects
// Generic solid trail shader. Used by many things?
internal static Effect FadingSolidTrailShader;
// Scarlet Devil main spear glowing trail. BEWARE: Is reused by many other items!
// Typical projectile javelin glowing trail. BEWARE: Is used by many items!
internal static Effect ScarletDevilShader;
// Yharon border flame pillar trail.
@@ -92,7 +92,7 @@ namespace CalamityMod.Effects
// Was previously used by Dom's Bladecrest Oathsword. Appears to govern the swing animation.
internal static Effect LocalLinearTransformationShader;
// UNUSED -- Probably leftover from Dominic's experiments with applying shaders to primitives (arbitrary GPU-rendered triangles)
// UNUSED -- Probably leftover from Lucille's experiments with applying shaders to primitives (arbitrary GPU-rendered triangles)
internal static Effect BasicPrimitiveShader;
// Artemis Ohio Beam. Also used by get fixed boi Nuclear Terror's "G-FUEL BEAM"
@@ -145,6 +145,12 @@ namespace CalamityMod.Effects
// Used to render the results of Navier-Stokes fluid simulations.
internal static Effect FluidShaders;
// Used by projectiles fired by the Sylvestaff.
internal static Effect SylvestaffProjectileShader;
// Used by the ribbons on the Sylvestaff.
internal static Effect SylvestaffRibbonShader;
#endregion
//
@@ -216,6 +222,9 @@ namespace CalamityMod.Effects
#region fryzahh's Shaders
// A simple shader which distorts an image using a provided texture of choice.
internal static Effect BasicTextureDistortionShader;
// The underwater rays seen at the top of the Sunken Sea Mod Menu.
internal static Effect UnderwaterRaysShader;
#endregion
public override void PostSetupContent()
@@ -234,7 +243,7 @@ namespace CalamityMod.Effects
var astralPassReg = new AstralScreenShaderData(new Ref<Effect>(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f);
RegisterSceneFilter(astralPassReg, "Astral", EffectPriority.VeryHigh);
#region Loading Dominic's Shaders
#region Loading Lucille's Shaders
DanceOfLightBlindingShader = LoadShader("LightBurstShader");
RegisterScreenShader(DanceOfLightBlindingShader, "BurstPass", "LightBurst");
@@ -357,6 +366,12 @@ namespace CalamityMod.Effects
// This shader is not registered with the game but is invoked directly to render the results of fluid simulation.
FluidShaders = LoadShader("FluidShaders");
SylvestaffProjectileShader = LoadShader("SylvestaffProjectileShader");
RegisterMiscShader(SylvestaffProjectileShader, "TrailPass", "SylvestaffProjectile");
SylvestaffRibbonShader = LoadShader("SylvestaffRibbonShader");
RegisterMiscShader(SylvestaffRibbonShader, "AutoloadPass", "SylvestaffRibbon");
#endregion
#region Loading Iban's Shaders
@@ -429,6 +444,9 @@ namespace CalamityMod.Effects
#region Loading fryzahh's Shaders
BasicTextureDistortionShader = LoadShader("BasicTextureDistortionShader");
RegisterMiscShader(BasicTextureDistortionShader, "DistortionPass", "BasicTextureDistortion");
UnderwaterRaysShader = LoadShader("UnderwaterRaysShader");
RegisterMiscShader(UnderwaterRaysShader, "UnderwaterRayPass", "UnderwaterRays");
#endregion
}
+76
View File
@@ -0,0 +1,76 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
matrix uWorldViewProjection;
float4 uShaderSpecificData;
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float3 TextureCoordinates : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float3 TextureCoordinates : TEXCOORD0;
};
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
{
VertexShaderOutput output = (VertexShaderOutput) 0;
float4 pos = mul(input.Position, uWorldViewProjection);
output.Position = pos;
output.Color = input.Color;
output.TextureCoordinates = input.TextureCoordinates;
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
float4 color = input.Color;
float2 coords = input.TextureCoordinates;
// Account for texture distortion artifacts.
coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5;
float bump = sin(coords.y * 3.141);
// Calculate the amount of additive glow for this pixel, using a combination of a scrolling texture and an extreme
// exponential squash of the prior 0-1-0 bump, creating a "center" to the glow and ensuring that the
// ray doesn't look like just a scrolling gradient.
float streakColor = tex2D(uImage1, coords + float2(uTime * -2.75, 0));
float glow = streakColor.r + pow(bump, 20) * 0.4;
// Determine opacity based on a weaker exponential squash of the bump in order to create faded horizontal edges.
float opacity = pow(bump, 5);
// Apply glow.
opacity += glow * opacity;
return color * opacity;
}
technique Technique1
{
pass TrailPass
{
VertexShader = compile vs_2_0 VertexShaderFunction();
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+89
View File
@@ -0,0 +1,89 @@
sampler noiseTextureA : register(s1);
float pixelationFactor;
float uSaturation;
float4 uShaderSpecificData;
matrix uWorldViewProjection;
struct VertexShaderInput
{
float4 Position : POSITION0;
float4 Color : COLOR0;
float3 TextureCoordinates : TEXCOORD0;
};
struct VertexShaderOutput
{
float4 Position : SV_POSITION;
float4 Color : COLOR0;
float3 TextureCoordinates : TEXCOORD0;
};
VertexShaderOutput VertexShaderFunction(in VertexShaderInput input)
{
VertexShaderOutput output = (VertexShaderOutput) 0;
float4 pos = mul(input.Position, uWorldViewProjection);
output.Position = pos;
output.Color = input.Color;
output.TextureCoordinates = input.TextureCoordinates;
return output;
}
float QuadraticBump(float x)
{
return x * (4 - x * 4);
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
float4 color = 1;
float2 coords = input.TextureCoordinates;
coords.y = (coords.y - 0.5) / input.TextureCoordinates.z + 0.5;
float feelerColorStart = 0.61;
float colorSpacingFactor = 1.9;
float4 outlineColor = float4(91, 114, 119, 255) / 255;
float erasePixelInterpolant = coords.x - 0.9 - distance(coords.y, 0.5) * 0.1;
// Band 1: Outline color.
color = lerp(color, outlineColor, coords.x >= feelerColorStart);
// Band 2: Pink.
float pinkStart = feelerColorStart + colorSpacingFactor * 0.01;
color = lerp(color, float4(221, 150, 179, 255) / 255, coords.x >= pinkStart);
// Band 3: Outline color.
float outlineAStart = pinkStart + colorSpacingFactor * 0.04;
color = lerp(color, outlineColor, coords.x >= outlineAStart);
// Band 4: Blue.
float blueStart = outlineAStart + colorSpacingFactor * 0.01;
color = lerp(color, float4(48, 117, 222, 255) / 255, coords.x >= blueStart);
// Band 5: Baby blue.
float babyBlueStart = blueStart + colorSpacingFactor * 0.04;
color = lerp(color, float4(167, 222, 255, 255) / 255, coords.x >= babyBlueStart);
// Add an outline to the ends of the feeler.
float horizontalDistanceFromCenter = distance(coords.y, 0.5);
color = lerp(color, outlineColor, horizontalDistanceFromCenter >= 0.3);
color = lerp(color, outlineColor, erasePixelInterpolant >= -0.02);
float permittedDirection = sign(uSaturation);
float direction = sign(dot(input.Position.xy - uShaderSpecificData.xy, uShaderSpecificData.zw));
erasePixelInterpolant *= direction == permittedDirection || coords.x < 0.5;
return color * (erasePixelInterpolant < 0) * input.Color;
}
technique Technique1
{
pass AutoloadPass
{
VertexShader = compile vs_3_0 VertexShaderFunction();
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Binary file not shown.
+48
View File
@@ -0,0 +1,48 @@
sampler baseTexture : register(s0);
float time;
float fadeOutMargin;
float overallOpacity;
float pixelationAmount;
float scrollSpeedX;
float scrollSpeedY;
float2 noiseScale;
float3 rayColor;
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
{
// Pixelation.
coords = round(coords * pixelationAmount) / pixelationAmount;
// Distort the coords into a sine wave.
coords.y += sin(coords.x + time * 0.25) * 0.05;
// Get the correct scale for our two noise maps.
float2 scaledCoords = coords * noiseScale;
// Calculate the offsets for each noise map.
float2 noiseOffset1 = float2(time * scrollSpeedX, time * scrollSpeedY);
float2 noiseOffset2 = float2(time * -scrollSpeedX, time * -scrollSpeedY);
// Calculate the colors of the two noise maps.
float4 noiseTexture1 = tex2D(baseTexture, scaledCoords + noiseOffset1);
float4 noiseTexture2 = tex2D(baseTexture, scaledCoords + noiseOffset2);
// Add the noise maps together to layer them over each other.
// Ensure to add them at 50% intensity to avoid making a super bright effect.
float combinedNoise = (noiseTexture1.r * 0.5) + (noiseTexture2.r * 0.5);
// Fade out at a certain margin.
float opacity = (1 - (coords.y * 2 - fadeOutMargin));
return (float4(rayColor, 1) * combinedNoise * opacity) * overallOpacity;
}
technique Technique1
{
pass UnderwaterRayPass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
-1
View File
@@ -243,7 +243,6 @@ namespace CalamityMod.Events
if (inNaturalSeaPosition && player.Calamity().ZoneSulphur)
{
// Makes rain pour at its maximum intensity (but only after an idiot meanders into the Sulphurous Sea)
// You'll never catch me, Fabs, Not when I shift into MAXIMUM OVERDRIVE!!
HasStartedAcidicDownpour = true;
CalamityNetcode.SyncWorld();
break;
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

@@ -12,6 +12,14 @@ using Terraria.ModLoader;
namespace CalamityMod.ForegroundDrawing.LoopingTextures
{
public class NuclearTorrentPlayer : ModPlayer
{
public bool ShouldDisplayTorrentMonolith = false;
public override void ResetEffects()
{
ShouldDisplayTorrentMonolith = false;
}
}
public class NuclearTorrentForeground : LoopingTextureForeground
{
public override Vector2 ParallaxDepth => new Vector2(1f, 1f);
@@ -59,7 +67,9 @@ namespace CalamityMod.ForegroundDrawing.LoopingTextures
Raindrops.Remove(drop);
}
public override bool DoesThisShow() => NPC.CountNPCS(ModContent.NPCType<OldDuke>()) > 0 && Main.LocalPlayer.Calamity().ZoneSulphur && !CalamityServerConfig.Instance.BossesStopWeather;
public bool ShouldDisplayDuringOldDuke() => NPC.CountNPCS(ModContent.NPCType<OldDuke>()) > 0 && Main.LocalPlayer.Calamity().ZoneSulphur && !CalamityServerConfig.Instance.BossesStopWeather;
public override bool DoesThisShow() => ShouldDisplayDuringOldDuke() || Main.LocalPlayer.GetModPlayer<NuclearTorrentPlayer>().ShouldDisplayTorrentMonolith;
public override void Update()
{
@@ -15,6 +15,6 @@ namespace CalamityMod.Graphics.Primitives
/// <summary>
/// Render primitives that use pixelation here.
/// </summary>
void RenderPixelatedPrimitives(SpriteBatch spriteBatch);
void RenderPixelatedPrimitives(SpriteBatch spriteBatch, PixelationPrimitiveLayer layer);
}
}
@@ -1,15 +1,17 @@
using Microsoft.Xna.Framework.Graphics;
using System;
namespace CalamityMod.Graphics.Primitives
{
/// <summary>
/// Controls what layer the <see cref="IPixelatedPrimitiveRenderer.RenderPixelatedPrimitives"/> renders to.
/// </summary>
[Flags]
public enum PixelationPrimitiveLayer
{
BeforeNPCs,
AfterNPCs,
BeforeProjectiles,
AfterProjectiles
BeforeNPCs = 1,
AfterNPCs = 2,
BeforeProjectiles = 4,
AfterProjectiles = 8,
AfterPlayers = 16
}
}
@@ -18,6 +18,8 @@ namespace CalamityMod.Graphics.Primitives
private static ManagedRenderTarget PixelationTarget_AfterProjectiles;
private static ManagedRenderTarget PixelationTarget_AfterPlayers;
private static RenderTarget2D CreatePixelTarget(int width, int height) => new(Main.instance.GraphicsDevice, width / 2, height / 2);
/// <summary>
@@ -36,11 +38,13 @@ namespace CalamityMod.Graphics.Primitives
On_Main.CheckMonoliths += DrawToTargets;
On_Main.DoDraw_DrawNPCsOverTiles += DrawTarget_NPCs;
On_Main.DrawProjectiles += DrawTarget_Projectiles;
On_Main.DrawPlayers_AfterProjectiles += DrawTarget_Players;
PixelationTarget_BeforeNPCs = new(true, CreatePixelTarget);
PixelationTarget_AfterNPCs = new(true, CreatePixelTarget);
PixelationTarget_BeforeProjectiles = new(true, CreatePixelTarget);
PixelationTarget_AfterProjectiles = new(true, CreatePixelTarget);
PixelationTarget_AfterPlayers = new(true, CreatePixelTarget);
}
public override void Unload()
@@ -63,6 +67,7 @@ namespace CalamityMod.Graphics.Primitives
var afterNPCs = new List<IPixelatedPrimitiveRenderer>();
var beforeProjectiles = new List<IPixelatedPrimitiveRenderer>();
var afterProjectiles = new List<IPixelatedPrimitiveRenderer>();
var afterPlayers = new List<IPixelatedPrimitiveRenderer>();
// Check every active projectile.
foreach (Projectile projectile in Main.ActiveProjectiles)
@@ -70,14 +75,14 @@ namespace CalamityMod.Graphics.Primitives
// If the projectile is active, a mod projectile, and uses the interface, add it to the list of primitives to draw this frame.
if (projectile.ModProjectile != null && projectile.ModProjectile is IPixelatedPrimitiveRenderer pixelPrimitiveProjectile)
{
var listToUse = pixelPrimitiveProjectile.LayerToRenderTo switch
{
PixelationPrimitiveLayer.BeforeNPCs => beforeNPCs,
PixelationPrimitiveLayer.AfterNPCs => afterNPCs,
PixelationPrimitiveLayer.BeforeProjectiles => beforeProjectiles,
_ => afterProjectiles
};
listToUse.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeNPCs))
beforeNPCs.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterNPCs))
afterNPCs.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeProjectiles))
beforeProjectiles.Add(pixelPrimitiveProjectile);
if (pixelPrimitiveProjectile.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterPlayers))
afterPlayers.Add(pixelPrimitiveProjectile);
}
}
@@ -87,23 +92,24 @@ namespace CalamityMod.Graphics.Primitives
// If the NPC is active, a mod NPC, and uses the interface, add it to the list of primitives to draw this frame.
if (npc.ModNPC != null && npc.ModNPC is IPixelatedPrimitiveRenderer pixelPrimitiveNPC)
{
var listToUse = pixelPrimitiveNPC.LayerToRenderTo switch
{
PixelationPrimitiveLayer.BeforeNPCs => beforeNPCs,
PixelationPrimitiveLayer.AfterNPCs => afterNPCs,
PixelationPrimitiveLayer.BeforeProjectiles => beforeProjectiles,
_ => afterProjectiles
};
listToUse.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeNPCs))
beforeNPCs.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterNPCs))
afterNPCs.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.BeforeProjectiles))
beforeProjectiles.Add(pixelPrimitiveNPC);
if (pixelPrimitiveNPC.LayerToRenderTo.HasFlag(PixelationPrimitiveLayer.AfterPlayers))
afterPlayers.Add(pixelPrimitiveNPC);
}
}
CurrentlyRendering = true;
DrawPrimsToRenderTarget(PixelationTarget_BeforeNPCs, beforeNPCs);
DrawPrimsToRenderTarget(PixelationTarget_AfterNPCs, afterNPCs);
DrawPrimsToRenderTarget(PixelationTarget_BeforeProjectiles, beforeProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_AfterProjectiles, afterProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_BeforeNPCs, PixelationPrimitiveLayer.BeforeNPCs, beforeNPCs);
DrawPrimsToRenderTarget(PixelationTarget_AfterNPCs, PixelationPrimitiveLayer.AfterNPCs, afterNPCs);
DrawPrimsToRenderTarget(PixelationTarget_BeforeProjectiles, PixelationPrimitiveLayer.BeforeProjectiles, beforeProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_AfterProjectiles, PixelationPrimitiveLayer.AfterProjectiles, afterProjectiles);
DrawPrimsToRenderTarget(PixelationTarget_AfterPlayers, PixelationPrimitiveLayer.AfterPlayers, afterPlayers);
Main.instance.GraphicsDevice.SetRenderTarget(null);
@@ -111,7 +117,7 @@ namespace CalamityMod.Graphics.Primitives
orig();
}
private static void DrawPrimsToRenderTarget(RenderTarget2D renderTarget, List<IPixelatedPrimitiveRenderer> pixelPrimitives)
private static void DrawPrimsToRenderTarget(RenderTarget2D renderTarget, PixelationPrimitiveLayer layer, List<IPixelatedPrimitiveRenderer> pixelPrimitives)
{
// Swap to the target regardless, in order to clear any leftover content from last frame. Not doing this results in the final frame lingering once it stops rendering.
renderTarget.SwapTo();
@@ -121,7 +127,7 @@ namespace CalamityMod.Graphics.Primitives
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null);
foreach (var pixelPrimitiveDrawer in pixelPrimitives)
pixelPrimitiveDrawer.RenderPixelatedPrimitives(Main.spriteBatch);
pixelPrimitiveDrawer.RenderPixelatedPrimitives(Main.spriteBatch, layer);
Main.spriteBatch.End();
}
@@ -143,6 +149,12 @@ namespace CalamityMod.Graphics.Primitives
DrawTargetScaled(PixelationTarget_AfterProjectiles);
}
private void DrawTarget_Players(On_Main.orig_DrawPlayers_AfterProjectiles orig, Main self)
{
orig(self);
DrawTargetScaled(PixelationTarget_AfterPlayers);
}
private static void DrawTargetScaled(ManagedRenderTarget target)
{
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
+1 -1
View File
@@ -213,7 +213,7 @@ namespace CalamityMod.ILEditing
On_Player.ItemCheck_CheckCanUse += RemoveUseLocks;
On_Player.ItemCheck_UseEventItems += ApplyCelestialSigilChanges;
IL_Main.DrawInfoAccs += RemoveDamageConditionFromRadar;
On_ShopHelper.ApplyNpcRelationshipEffect += AllowMultipleLikedNPCs;
//On_ShopHelper.ApplyNpcRelationshipEffect += AllowMultipleLikedNPCs;
On_Player.UpdateControlHolds += DelayGravity;
On_PlayerInput.SetZoom_MouseInWorld += GravityMouse;
+1 -20
View File
@@ -1764,27 +1764,8 @@ namespace CalamityMod.ILEditing
#region Shimmer effect edits
public static void ShimmerEffectEdits(Terraria.On_Item.orig_GetShimmered orig, Item self)
{
// Don't keep the original stack amount when shimmering Cirrus' Vodka into Crystal Heart Vodka
if (self.type == ModContent.ItemType<CirrusVodka>())
{
self.SetDefaults(ModContent.ItemType<CrystalHeartVodka>());
self.shimmered = true;
self.shimmerWet = true;
self.wet = true;
self.velocity *= 0.1f;
if (Main.netMode == 0)
{
Item.ShimmerEffect(self.Center);
}
else
{
NetMessage.SendData(146, -1, -1, null, 0, (int)self.Center.X, (int)self.Center.Y);
NetMessage.SendData(145, -1, -1, null, self.whoAmI, 1f);
}
AchievementsHelper.NotifyProgressionEvent(27);
}
// Make Plagued Containment Bricks turn into Plagued Nanodroids if shimmered before defeating Golem
else if (self.type == ModContent.ItemType<PlaguedContainmentBrick>())
if (self.type == ModContent.ItemType<PlaguedContainmentBrick>())
{
if (NPC.downedGolemBoss)
orig(self);
+9 -6
View File
@@ -174,7 +174,7 @@ namespace CalamityMod.ILEditing
}
// Remove the Expert Mode check, and in its place put a check for the Zenith seed (Get fixed boi).
// Note from CIT: I originally removed these entirely; restoring it in GFB was Fabsol's idea.
// Note from CIT: I originally removed these entirely;
cursor.Emit(OpCodes.Pop);
cursor.Emit(OpCodes.Ldsfld, typeof(Main).GetField("zenithWorld"));
}
@@ -1153,14 +1153,17 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Multiple NPC Happiness support for Cirrus
private static void AllowMultipleLikedNPCs(On_ShopHelper.orig_ApplyNpcRelationshipEffect orig, ShopHelper self, int npcType, AffectionLevel affectionLevel)
#region Multiple NPC Happiness support
// Currently unused as the one NPC who used it was removed. However it is very likely it'll be used again in the future, so this code is being kept.
/*private static void AllowMultipleLikedNPCs(On_ShopHelper.orig_ApplyNpcRelationshipEffect orig, ShopHelper self, int npcType, AffectionLevel affectionLevel)
{
FieldInfo npcTalkField = typeof(ShopHelper).GetField("_currentNPCBeingTalkedTo", BindingFlags.Instance | BindingFlags.NonPublic);
NPC talkedNPC = (NPC)npcTalkField.GetValue(self);
// Allow Cirrus to have things to say about multiple NPCs with the same happiness level
if (talkedNPC.type == ModContent.NPCType<Cirrus>())
int npcTypee = 0;
// Allow the given NPC to have things to say about multiple NPCs with the same happiness level
if (talkedNPC.type == npcTypee)
{
MethodInfo addReportField = typeof(ShopHelper).GetMethod("AddHappinessReportText", BindingFlags.Instance | BindingFlags.NonPublic);
@@ -1182,7 +1185,7 @@ namespace CalamityMod.ILEditing
{
orig(self, npcType, affectionLevel);
}
}
}*/
#endregion
#region Allow disabling gravity swap visual && allow gravity keybind
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.defense = 12;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 28;
Item.height = 28;
Item.accessory = true;
Item.rare = ModContent.RarityType<Violet>();
Item.rare = ModContent.RarityType<BurnishedAuric>();
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
}
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 44;
Item.height = 108;
Item.rare = ModContent.RarityType<Violet>();
Item.rare = ModContent.RarityType<BurnishedAuric>();
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.accessory = true;
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories
Item.width = Item.height = 32;
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Accessories
Item.defense = 10;
Item.lifeRegen = 1;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 28;
Item.height = 28;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
}
+1 -1
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
Item.defense = 48;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<Violet>();
Item.rare = ModContent.RarityType<BurnishedAuric>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 32;
Item.height = 34;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<Violet>();
Item.rare = ModContent.RarityType<BurnishedAuric>();
Item.accessory = true;
}
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 30;
Item.height = 46;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.accessory = true;
}
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 38;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 32;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 46;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 14;
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void Update(ref float gravity, ref float maxFallSpeed)
+1 -1
View File
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 52;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.Items.Accessories
Item.width = 82;
Item.height = 62;
Item.defense = 5;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.accessory = true;
Item.SetRevExclusive();
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories
Item.height = 32;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.accessory = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.rare = ModContent.RarityType<CosmicPurple>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+25
View File
@@ -6,6 +6,8 @@ using CalamityMod.Buffs.Summon.Whips;
using CalamityMod.CalPlayer;
using CalamityMod.DataStructures;
using CalamityMod.Items.Materials;
using CalamityMod.NPCs.Providence;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
@@ -14,6 +16,7 @@ using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
@@ -31,6 +34,26 @@ namespace CalamityMod.Items.Accessories
public const int maxMinionRequirement = 10;
public const int maxPscAnimTime = 120;
public static SummonTag SummonTag = new() { MultiplicativeTagDamage = 0.2f, TagModifyHitEffects = ApplyTagModifyHit, AutoDrawTooltip = false };
public static void ApplyTagModifyHit(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers, ref float tagDamageMult, ref float critChance)
{
if (Main.player[proj.owner].Calamity().pscState >= (int)ProfanedSoulCrystalState.Buffs)
{
var empowered = Main.player[proj.owner].Calamity().pscState == (int)ProfanedSoulCrystalState.Empowered;
//20% is balanced for non empowered, while 40% helps ensure psc remains balanced at empowered tier
//Some PSC projectiles receive a reduced amount of benefit from this, for balancing purposes
modifiers.ScalingBonusDamage += (empowered ? 0.4f : SummonTag.MultiplicativeTagDamage) * tagDamageMult;
if (!Main.dedServ)
{
var color = ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, 0);
float power = Math.Min(npc.height / 100f, 3f);
var position = new Vector2(Main.rand.NextFloat(npc.Left.X, npc.Right.X), Main.rand.NextFloat(npc.Top.Y, npc.Bottom.Y));
var particle = new FlameParticle(position, 50, 0.25f, power, color * (Main.dayTime ? 1f : 1.25f), color * (Main.dayTime ? 1.25f : 1f));
GeneralParticleHandler.SpawnParticle(particle);
}
}
}
// Interface stuff.
public int OwnerPlayer { get; set; }
@@ -192,6 +215,8 @@ namespace CalamityMod.Items.Accessories
public override void SetDefaults()
{
SummonTag.TagItem = Item.type;
SummonTag.TagTexture = TextureAssets.Item[Type];
Item.width = 50;
Item.height = 50;
Item.accessory = true;
+1 -1
View File
@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Accessories
Item.defense = 8;
Item.accessory = true;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<Violet>();
Item.rare = ModContent.RarityType<BurnishedAuric>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.defense = 12;
Item.accessory = true;
Item.rare = ModContent.RarityType<Violet>();
Item.rare = ModContent.RarityType<BurnishedAuric>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
-33
View File
@@ -1,33 +0,0 @@
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class RustyMedallion : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public const int AcidDropBaseDamage = 9;
// BAD Minishark! You will NOT become stupid sleeper agent item!
public const int AcidCreationCooldown = 25;
public override void SetDefaults()
{
Item.width = 18;
Item.height = 32;
Item.rare = ItemRarityID.Blue;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.RustyMedallionDroplets = true;
player.buffImmune[ModContent.BuffType<Irradiated>()] = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

+36
View File
@@ -0,0 +1,36 @@
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Items.Accessories
{
public class ScionsCurio : ModItem, ILocalizedModType
{
public static int postHitDamage = 45;
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 32;
Item.height = 38;
Item.rare = ItemRarityID.Blue;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.scionsCurio = true;
modPlayer.scionsCurioVisuals = !hideVisual;
if (player.ownedProjectileCounts[ProjectileType<ScionsCurioMini>()] < 1 && !player.dead)
{
Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType<ScionsCurioMini>(), 0, 0f, player.whoAmI);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Loaded 100 of 693 files, more files were not shown because too many files have changed in this diff. Show more