insert funny merge message
No files matched your search
@@ -3,6 +3,7 @@ using CalamityMod.NPCs.Crabulon;
|
||||
using CalamityMod.NPCs.ExoMechs.Apollo;
|
||||
using CalamityMod.NPCs.ExoMechs.Artemis;
|
||||
using CalamityMod.NPCs.OldDuke;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.NPCs.Ravager;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
@@ -11,6 +12,7 @@ using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
@@ -36,8 +38,8 @@ namespace CalamityMod.Balancing
|
||||
bool DragonRageFilter(Projectile p) =>
|
||||
p.type == ProjectileType<DragonRageStaff>() || p.type == ProjectileType<DragonRageFireball>() || (p.type == ProjectileType<FuckYou>() && p.CountsAsClass<MeleeDamageClass>());
|
||||
|
||||
bool MonkStaffT3Filter(Projectile p) =>
|
||||
p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3);
|
||||
// bool MonkStaffT3Filter(Projectile p) =>
|
||||
// p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3);
|
||||
|
||||
bool MushroomSpearFilter(Projectile p) =>
|
||||
p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear;
|
||||
@@ -76,8 +78,8 @@ namespace CalamityMod.Balancing
|
||||
// Nerf Mushroom Spear projectiles by 50%.
|
||||
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)),
|
||||
|
||||
// Nerf Spectre Mask set bonus projectiles by 50%.
|
||||
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, SpectreMaskSetBonusFilter)),
|
||||
// Nerf Spectre Mask set bonus projectiles by 30%.
|
||||
Do(new ProjectileSpecificRequirementBalancingRule(0.7f, SpectreMaskSetBonusFilter)),
|
||||
};
|
||||
|
||||
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
|
||||
@@ -153,7 +155,7 @@ namespace CalamityMod.Balancing
|
||||
// 40% resist to Cryophobia
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AquaticScourgeIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<CryoBlast>()))));
|
||||
|
||||
// 15% resust to Snowstorm Staff
|
||||
// 15% resist to Snowstorm Staff
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DestroyerIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<Snowflake>()))));
|
||||
|
||||
#endregion The Destroyer
|
||||
@@ -168,7 +170,7 @@ namespace CalamityMod.Balancing
|
||||
#region Duke Fishron
|
||||
|
||||
// 35% vulnerability to Resurrection Butterfly.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
|
||||
#endregion Duke Fishron
|
||||
|
||||
@@ -177,6 +179,9 @@ namespace CalamityMod.Balancing
|
||||
// 25% resist to Resurrection Butterfly.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
|
||||
|
||||
// 20% resist to Art Attack and Nightglow.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<ArtAttackStrike>(), ProjectileID.FairyQueenMagicItemShot))));
|
||||
|
||||
#endregion Cultist
|
||||
|
||||
#region Astrum Deus
|
||||
@@ -193,10 +198,15 @@ namespace CalamityMod.Balancing
|
||||
#endregion Astrum Deus
|
||||
|
||||
#region Moon Lord
|
||||
// 30% resist to the shockwave attunement from the True biome blade.
|
||||
// 90% resist to the shockwave attunement from the True biome blade.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.MoonLordCore, Do(new ProjectileResistBalancingRule(0.1f, ProjectileType<MercurialTides>(), ProjectileType<MercurialTidesMonolith>(), ProjectileType<MercurialTidesBlast>()))));
|
||||
#endregion
|
||||
|
||||
#region Providence
|
||||
// 80% resist to Hell's Sun.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Providence>(), new ProjectileResistBalancingRule(0.2f, ProjectileType<HellsSunProj>())));
|
||||
#endregion
|
||||
|
||||
#region Ceaseless Void / Dark Energies
|
||||
|
||||
// 50% resist to true melee.
|
||||
@@ -246,23 +256,26 @@ namespace CalamityMod.Balancing
|
||||
|
||||
#region Ares
|
||||
|
||||
// 75% resist to Dragon Rage projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.25f, DragonRageFilter))));
|
||||
|
||||
// 60% resist to Murasama.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<MurasamaSlash>()))));
|
||||
|
||||
// 50% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new TrueMeleeResistBalancingRule(0.5f))));
|
||||
|
||||
// 50% resist to Enforcer projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<EssenceFlame2>()))));
|
||||
|
||||
// 30% resist to the Spin Throw part of the Ark of the Cosmos' combo
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo))));
|
||||
|
||||
// 20% resist to Eclipse's Fall stealth strike.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<EclipsesSmol>()))));
|
||||
// 25% resist to Murasama.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<MurasamaSlash>()))));
|
||||
|
||||
// 20% resist to Dragon Rage projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, DragonRageFilter))));
|
||||
|
||||
// 20% resist to Eclipse's Fall.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<EclipsesSmol>(), ProjectileType<EclipsesFallMain>()))));
|
||||
|
||||
// 15% resist to Enforcer projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<EssenceFlame2>()))));
|
||||
|
||||
// 10% resist to Seraphim lasers
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<SeraphimBeamLarge>()))));
|
||||
|
||||
#endregion Ares
|
||||
|
||||
@@ -273,25 +286,34 @@ namespace CalamityMod.Balancing
|
||||
// 10% resist to Eclipse's Fall stealth strike.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<EclipsesSmol>()))));
|
||||
|
||||
// 10% resist to Seared Pan.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<SearedPanProjectile>(), ProjectileType<PanSpark>(), ProjectileType<NiceCock>()))));
|
||||
|
||||
#endregion Artemis and Apollo
|
||||
|
||||
#region Thanatos
|
||||
|
||||
// 95% resist to Seraphim lasers (what the actual fuck?).
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.05f, ProjectileType<SeraphimBeamLarge>()))));
|
||||
// 92% resist to Seraphim lasers (what the actual fuck?).
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.08f, ProjectileType<SeraphimBeamLarge>()))));
|
||||
|
||||
// 75% resist to Celestus.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.25f, ProjectileType<CelestusBoomerang>(), ProjectileType<Celestus2>()))));
|
||||
// 85% resist to Dynamic Pursuer (the whole thing lol).
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.15f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
|
||||
|
||||
// 65% resist to true melee.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new TrueMeleeResistBalancingRule(0.35f))));
|
||||
|
||||
// 65% resist to Enforcer projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<EssenceFlame2>()))));
|
||||
|
||||
// 50% resist to Chicken Cannon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ChickenExplosion>()))));
|
||||
|
||||
// 50% resist to Prismatic Breaker. (why is this more than BOTH Rancor and Yharim's Crystal?)
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PrismaticBeam>()))));
|
||||
|
||||
// 50% resist to Tarragon Throwing Darts Thorns (LOL)
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TarraThornRight>(), ProjectileType<TarraThornTip>()))));
|
||||
|
||||
// 50% resist to Vehemence skulls.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<VehemenceSkull>(), ProjectileType<PrismaticBeam>()))));
|
||||
|
||||
@@ -307,9 +329,15 @@ namespace CalamityMod.Balancing
|
||||
// 30% resist to the Spin Throw part of the Ark of the Cosmos' combo
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo))));
|
||||
|
||||
// 30% resist to Eclipse Fall.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<EclipsesFallMain>()))));
|
||||
|
||||
// 30% resist to Sirius.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<SiriusExplosion>()))));
|
||||
|
||||
// 25% resist to Dragon Rage projectiles.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
|
||||
|
||||
// 25% resist to Godslayer Slugs.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<GodSlayerSlugProj>()))));
|
||||
|
||||
@@ -325,9 +353,16 @@ namespace CalamityMod.Balancing
|
||||
// 20% resist to Blood Boiler fire.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<BloodBoilerFire>()))));
|
||||
|
||||
// 15% resist to Final Dawn AoE, 20% resist to Final Dawn lunge.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<FinalDawnFlame>()))));
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<FinalDawnThrow2>()))));
|
||||
|
||||
// 15% resist to Gruesome Eminence.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<SpiritCongregation>()))));
|
||||
|
||||
// 15% resist to Plasma Nades
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<PlasmaGrenadeProjectile>(), ProjectileType<PlasmaGrenadeSmallExplosion>()))));
|
||||
|
||||
#endregion Thanatos
|
||||
|
||||
#region Supreme Calamitas / Brimstone Heart
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
{
|
||||
public static class BalancingConstants
|
||||
{
|
||||
// Permanent move speed boost given to the player at all stages of the game
|
||||
// When the relevant config is enabled: Gives the player a substantial +50% move speed boost at all times
|
||||
internal static readonly float DefaultMoveSpeedBoost = 0.5f;
|
||||
|
||||
// The multiplier for the player's gravity (downwards acceleration) while they are holding the Down button (S by default).
|
||||
|
||||
// When the relevant config is enabled: Increases the player's base jump height by 10%
|
||||
internal static readonly float ConfigBoostedBaseJumpHeight = 5.51f; // vanilla = 5.01f
|
||||
|
||||
// When the relevant config is enabled: Allows the player to hold the Down button (S by default) to fast fall.
|
||||
// This is the multiplier for the player's gravity (downwards acceleration) while holding Down.
|
||||
internal static readonly float HoldingDownGravityMultiplier = 2f;
|
||||
|
||||
// Altered jump speed boost provided by Shiny Red Balloon via IL edit
|
||||
@@ -48,8 +52,8 @@
|
||||
// If stealth is too weak, increase this number. If stealth is too strong, decrease this number.
|
||||
// This value is intentionally not readonly.
|
||||
public static double UniversalStealthStrikeDamageFactor = 0.5;
|
||||
internal static readonly float BaseStealthGenTime = 9f; // 9 seconds
|
||||
internal static readonly float MovingStealthGenRatio = 0.333333f;
|
||||
internal static readonly float BaseStealthGenTime = 4f; // 4 seconds
|
||||
internal static readonly float MovingStealthGenRatio = 0.5f;
|
||||
|
||||
// Rage
|
||||
internal static readonly int DefaultRageDuration = CalamityUtils.SecondsToFrames(9); // Rage lasts 9 seconds by default.
|
||||
@@ -63,6 +67,7 @@
|
||||
// See NPCUtils.IsAnEnemy
|
||||
internal const int TinyHealthThreshold = 5;
|
||||
internal const int TinyDamageThreshold = 5;
|
||||
// If an enemy has more health than this, they are considered an enemy even if they have 0 contact damage
|
||||
internal const int NoContactDamageHealthThreshold = 3000;
|
||||
internal const int UnreasonableHealthThreshold = 25000000; // 25 million
|
||||
|
||||
@@ -80,7 +85,6 @@
|
||||
internal static readonly float MaximumAllowedAttackSpeed = 10f;
|
||||
|
||||
// TODO -- Add all balance related constants here that don't belong in other files.
|
||||
// These constants were just the ones sitting in CalamityPlayer.
|
||||
// Review all constants and static readonlys in the entire mod to find things to add.
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace CalamityMod.BiomeManagers
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space;
|
||||
|
||||
@@ -22,8 +23,13 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300)) &&
|
||||
!player.ZoneDesert && !player.ZoneSnow;
|
||||
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneDesert && !player.ZoneSnow;
|
||||
}
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,9 @@ namespace CalamityMod.BiomeManagers
|
||||
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralDesertSurfaceBGStyle");
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon";
|
||||
// Could use its own unique background
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
@@ -21,8 +23,12 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300))
|
||||
&& player.ZoneDesert && !player.ZoneSnow;
|
||||
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneDesert && !player.ZoneSnow;
|
||||
}
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ namespace CalamityMod.BiomeManagers
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
|
||||
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSnowSurfaceBGStyle");
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space;
|
||||
|
||||
@@ -20,8 +21,13 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300)) &&
|
||||
!player.ZoneDesert && player.ZoneSnow;
|
||||
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneDesert && player.ZoneSnow;
|
||||
}
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,7 @@ namespace CalamityMod.BiomeManagers
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
|
||||
|
||||
public override int Music
|
||||
{
|
||||
@@ -60,13 +61,13 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("First Layer of the Abyss");
|
||||
DisplayName.SetDefault("Abyss: First Layer");
|
||||
}
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return MeetsBaseAbyssRequirement(player, out int playerYTileCoords) &&
|
||||
playerYTileCoords < (Main.rockLayer + Main.maxTilesY * 0.03);
|
||||
playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.03);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,10 +21,11 @@ namespace CalamityMod.BiomeManagers
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Second Layer of the Abyss");
|
||||
DisplayName.SetDefault("Abyss: Second Layer");
|
||||
}
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
|
||||
@@ -21,10 +21,11 @@ namespace CalamityMod.BiomeManagers
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Third Layer of the Abyss");
|
||||
DisplayName.SetDefault("Abyss: Third Layer");
|
||||
}
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
|
||||
@@ -21,10 +21,11 @@ namespace CalamityMod.BiomeManagers
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Fourth Layer of the Abyss");
|
||||
DisplayName.SetDefault("Abyss: Fourth Layer");
|
||||
}
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
|
||||
@@ -4,7 +4,9 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public class ArsenalLabBiome : ModBiome
|
||||
{
|
||||
public override string BestiaryIcon => "BiomeManagers/LaboratoryIcon";
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/LaboratoryIcon";
|
||||
// Could use its own unique background if someone even bothers
|
||||
public override string BackgroundPath => "Terraria/Images/MapBG32";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/BrimstoneCragsIcon";
|
||||
public override string BackgroundPath => "Terraria/Images/MapBG3";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace CalamityMod.BiomeManagers
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SulphurousSeaIcon";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG";
|
||||
|
||||
public override int Music
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace CalamityMod.BiomeManagers
|
||||
if (acidRain)
|
||||
{
|
||||
music = DownedBossSystem.downedPolterghast
|
||||
? CalamityMod.Instance.GetMusicFromMusicMod("AcidRain2") ?? MusicID.Eclipse // Acid Rain Tier 3
|
||||
? CalamityMod.Instance.GetMusicFromMusicMod("AcidRain2") ?? MusicID.Monsoon // Acid Rain Tier 3
|
||||
: CalamityMod.Instance.GetMusicFromMusicMod("AcidRain1") ?? MusicID.OldOnesArmy; // Acid Rain Tier 1 + 2
|
||||
}
|
||||
|
||||
@@ -61,7 +62,7 @@ namespace CalamityMod.BiomeManagers
|
||||
if (point.X > Main.maxTilesX - 380)
|
||||
sulphurPosX = true;
|
||||
}
|
||||
return BiomeTileCounterSystem.SulphurTiles >= 300 || (player.ZoneOverworldHeight && sulphurPosX);
|
||||
return (BiomeTileCounterSystem.SulphurTiles >= 300 || (player.ZoneOverworldHeight && sulphurPosX)) && !player.Calamity().ZoneAbyss;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,9 @@ namespace CalamityMod.BiomeManagers
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("SunkenSea") ?? MusicID.Temple;
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon";
|
||||
// Placeholder until we get a dedicated Sunken Sea background
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace CalamityMod.BiomeManagers
|
||||
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle");
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon";
|
||||
// Could use its own unique background
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
|
||||
public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralUnderground") ?? MusicID.Space;
|
||||
|
||||
@@ -21,8 +24,12 @@ namespace CalamityMod.BiomeManagers
|
||||
|
||||
public override bool IsBiomeActive(Player player)
|
||||
{
|
||||
return !player.ZoneDungeon && (BiomeTileCounterSystem.AstralTiles > 950 || (player.ZoneSnow && BiomeTileCounterSystem.AstralTiles > 300)) &&
|
||||
(player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight);
|
||||
return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight);
|
||||
}
|
||||
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
|
||||
}
|
||||
|
||||
// Just slightly above the above-ground astral biomes.
|
||||
|
||||
@@ -187,10 +187,6 @@ namespace CalamityMod.Buffs
|
||||
tip += ". Grants immunity to Chilled, Frozen and Glacial State";
|
||||
break;
|
||||
|
||||
case BuffID.Invisibility:
|
||||
tip += ". Grants rogue bonuses while holding certain rogue weapons";
|
||||
break;
|
||||
|
||||
case BuffID.Daybreak:
|
||||
tip = "Incinerated by solar rays";
|
||||
break;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -8,15 +9,24 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dragonfire");
|
||||
Description.SetDefault("Losing life, reduced movement speed");
|
||||
Description.SetDefault("Engulfed by roaring flames");
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().dragonFire = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
if (npc.Calamity().dragonFire < npc.buffTime[buffIndex])
|
||||
npc.Calamity().dragonFire = npc.buffTime[buffIndex];
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 444 B |
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
internal const int StackFalloffFrames = 320;
|
||||
|
||||
// 75 DPS (15x5) per stack may seem low, but it gets boosted by ranged stats and can supercrit.
|
||||
internal static int BaseDamage = 15;
|
||||
internal static int BaseDamage = 30;
|
||||
internal static int FramesPerDamageTick = 12;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
int bleedTickDamage = (int)applicator.GetTotalDamage<RangedDamageClass>().ApplyTo(BaseDamage * cgn.somaShredStacks);
|
||||
Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), bleedTickDamage, 0f, applicator.whoAmI, target.whoAmI);
|
||||
tick.DamageType = DamageClass.Ranged; // Uncommon for DirectStrikes, but it needs to be able to crit.
|
||||
tick.Calamity().canSupercrit = true;
|
||||
tick.Calamity().supercritHits = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.NPCs;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -13,6 +14,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex) => player.Calamity().vHex = true;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using CalamityMod.Items.Mounts;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Armor.MarniteArchitect;
|
||||
|
||||
namespace CalamityMod.Buffs.Mounts
|
||||
{
|
||||
public class MarniteLiftBuff : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Marnite Lift");
|
||||
Description.SetDefault("Do you even..?");
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.mount.SetMount(ModContent.MountType<MarniteLift>(), player);
|
||||
player.buffTime[buffIndex] = 10; // reset buff time
|
||||
player.GetModPlayer<MarniteArchitectPlayer>().mounted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 620 B |
|
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 497 B |
@@ -8,9 +8,7 @@ namespace CalamityMod.Buffs.Potions
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Penumbra");
|
||||
Description.SetDefault("Stealth regenerates 15% faster while moving\n" +
|
||||
"At night, stealth additionally regenerates 15% faster while standing still\n" +
|
||||
"Both boosts increase to 20% during a solar eclipse");
|
||||
Description.SetDefault("Stealth regenerates 10% faster while moving and 15% faster while standing still");
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.Potions
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Shadow");
|
||||
Description.SetDefault("You're invisible, certain rogue weapons give and gain buffs, and stealth generation is boosted.");
|
||||
Description.SetDefault("You are a shadow, rogue weapons spawn projectiles on hit, and stealth generation is boosted by 8%");
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
@@ -16,8 +16,9 @@ namespace CalamityMod.Buffs.Potions
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.invis = true;
|
||||
player.Calamity().shadow = true;
|
||||
if (player.yoraiz0rEye < 2 && CalamityConfig.Instance.StealthInvisibility)
|
||||
player.yoraiz0rEye = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 501 B |
@@ -0,0 +1,23 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
|
||||
namespace CalamityMod.Buffs.StatBuffs
|
||||
{
|
||||
public class CoralSymbiosis : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Coral Symbiosis");
|
||||
Description.SetDefault($"Coral Spout charges up faster and deals {CoralSpout.SymbiosisDamageBuff} extra damage");
|
||||
Main.debuff[Type] = false;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.GetModPlayer<CoralSpoutPlayer>().Symbiosis = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 684 B |
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 695 B |
|
Before Width: | Height: | Size: 595 B After Width: | Height: | Size: 627 B |
@@ -16,6 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.NPCs;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -13,6 +14,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.NPCs;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -13,6 +14,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.NPCs;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -13,6 +14,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -28,10 +28,5 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().teslaFreeze = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.NPCs;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -13,6 +14,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
@@ -15,6 +16,7 @@ namespace CalamityMod.Buffs.StatDebuffs
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Summon
|
||||
{
|
||||
public class ExoskeletonCannons : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ares' Cannons");
|
||||
Description.SetDefault("Pulse cannon not included");
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (AresExoskeleton.ArmExists(player))
|
||||
modPlayer.AresCannons = true;
|
||||
|
||||
if (modPlayer.AresCannons)
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
else
|
||||
{
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 604 B |
|
Before Width: | Height: | Size: 563 B After Width: | Height: | Size: 472 B |
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 645 B After Width: | Height: | Size: 450 B |
@@ -6,14 +6,21 @@ using CalamityMod.Items.Mounts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
public partial class CalamityPlayer : ModPlayer
|
||||
{
|
||||
public int VerticalGodslayerDashTimer;
|
||||
|
||||
public string DashID;
|
||||
|
||||
public string DeferredDashID;
|
||||
|
||||
public string LastUsedDashID;
|
||||
|
||||
public PlayerDashEffect UsedDash
|
||||
{
|
||||
get
|
||||
@@ -55,6 +62,11 @@ namespace CalamityMod.CalPlayer
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
NPC n = Main.npc[i];
|
||||
|
||||
// Ignore critters with the Guide to Critter Companionship
|
||||
if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type])
|
||||
continue;
|
||||
|
||||
if (n.active && !n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0)
|
||||
{
|
||||
if (hitArea.Intersects(n.getRect()) && (n.noTileCollide || Player.CanHit(n)))
|
||||
@@ -77,17 +89,39 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
if (Player.dashDelay > 0)
|
||||
{
|
||||
VerticalGodslayerDashTimer = 0;
|
||||
LastUsedDashID = string.Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player.dashDelay < 0)
|
||||
{
|
||||
int dashDelayToApply = BalancingConstants.UniversalDashCooldown;
|
||||
if (UsedDash.CollisionType == DashCollisionType.ShieldSlam)
|
||||
dashDelayToApply = BalancingConstants.UniversalShieldSlamCooldown;
|
||||
else if (UsedDash.CollisionType == DashCollisionType.ShieldBonk)
|
||||
dashDelayToApply = BalancingConstants.UniversalShieldBonkCooldown;
|
||||
|
||||
float dashSpeed = 12f;
|
||||
float dashSpeedDecelerationFactor = 0.985f;
|
||||
float runSpeed = Math.Max(Player.accRunSpeed, Player.maxRunSpeed);
|
||||
float runSpeedDecelerationFactor = 0.94f;
|
||||
|
||||
LastUsedDashID = DashID;
|
||||
|
||||
// Handle mid-dash effects.
|
||||
UsedDash.MidDashEffects(Player, ref dashSpeed, ref dashSpeedDecelerationFactor, ref runSpeedDecelerationFactor);
|
||||
if (UsedDash.IsOmnidirectional && VerticalGodslayerDashTimer < 25)
|
||||
{
|
||||
VerticalGodslayerDashTimer++;
|
||||
if (VerticalGodslayerDashTimer >= 25)
|
||||
{
|
||||
Player.dashDelay = dashDelayToApply;
|
||||
// Stop the player from going flying
|
||||
Player.velocity *= 0.2f;
|
||||
}
|
||||
}
|
||||
|
||||
if (HasCustomDash)
|
||||
{
|
||||
@@ -126,11 +160,6 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Dash delay depends on the type of dash used.
|
||||
int dashDelayToApply = BalancingConstants.UniversalDashCooldown;
|
||||
if (UsedDash.CollisionType == DashCollisionType.ShieldSlam)
|
||||
dashDelayToApply = BalancingConstants.UniversalShieldSlamCooldown;
|
||||
else if (UsedDash.CollisionType == DashCollisionType.ShieldBonk)
|
||||
dashDelayToApply = BalancingConstants.UniversalShieldBonkCooldown;
|
||||
Player.dashDelay = dashDelayToApply;
|
||||
|
||||
if (UsedDash.IsOmnidirectional)
|
||||
@@ -441,6 +470,11 @@ namespace CalamityMod.CalPlayer
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
NPC n = Main.npc[i];
|
||||
|
||||
// Ignore critters with the Guide to Critter Companionship
|
||||
if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type])
|
||||
continue;
|
||||
|
||||
if (n.active && !n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0)
|
||||
{
|
||||
Rectangle npcHitbox = n.getRect();
|
||||
|
||||
@@ -11,6 +11,8 @@ using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -37,6 +39,11 @@ namespace CalamityMod.CalPlayer
|
||||
layer.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.HeldItem.ModItem is IHideFrontArm amputator && amputator.ShouldHideArm(Player))
|
||||
{
|
||||
PlayerDrawLayers.ArmOverItem.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
public override void DrawEffects(PlayerDrawSet drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright)
|
||||
@@ -109,12 +116,13 @@ namespace CalamityMod.CalPlayer
|
||||
Player.armorEffectDrawShadowSubtle = false;
|
||||
}
|
||||
|
||||
Asset<Texture2D> heart3 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Heart3");
|
||||
Asset<Texture2D> heart4 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Heart4");
|
||||
Asset<Texture2D> heart5 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Heart5");
|
||||
Asset<Texture2D> heart6 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Heart6");
|
||||
Asset<Texture2D> heartOriginal = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/HeartOriginal"); // Life fruit
|
||||
Asset<Texture2D> heartOriginal2 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/HeartOriginal2"); // Life crystal
|
||||
// Hearts
|
||||
Asset<Texture2D> bOrange = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/HeartBloodOrange");
|
||||
Asset<Texture2D> mFruit = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/HeartMiracleFruit");
|
||||
Asset<Texture2D> eBerry = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/HeartElderberry");
|
||||
Asset<Texture2D> dFruit = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/HeartDragonfruit");
|
||||
Asset<Texture2D> heartOriginal = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/HeartOriginal"); // Life crystal
|
||||
Asset<Texture2D> heartOriginal2 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/HeartOriginal2"); // Life fruit
|
||||
|
||||
int totalFruit =
|
||||
(calamityPlayer.mFruit ? 1 : 0) +
|
||||
@@ -124,13 +132,14 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
TextureAssets.Heart2 = totalFruit switch
|
||||
{
|
||||
4 => heart6,
|
||||
3 => heart5,
|
||||
2 => heart4,
|
||||
1 => heart3,
|
||||
_ => heartOriginal,
|
||||
4 => dFruit,
|
||||
3 => eBerry,
|
||||
2 => mFruit,
|
||||
1 => bOrange,
|
||||
_ => heartOriginal2,
|
||||
};
|
||||
TextureAssets.Heart = heartOriginal2;
|
||||
TextureAssets.Heart = heartOriginal;
|
||||
|
||||
if (calamityPlayer.tRegen)
|
||||
{
|
||||
if (Main.rand.NextBool(10) && drawInfo.shadow == 0f)
|
||||
@@ -535,6 +544,12 @@ namespace CalamityMod.CalPlayer
|
||||
drawInfo.GoreCache.Add(heart);
|
||||
}
|
||||
}
|
||||
if (calamityPlayer.shadow && CalamityConfig.Instance.StealthInvisibility)
|
||||
{
|
||||
r *= 0f;
|
||||
g *= 0f;
|
||||
b *= 0f;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ using CalamityMod.Items.Fishing.SunkenSeaCatches;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.SummonItems;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.OldDuke;
|
||||
using CalamityMod.World;
|
||||
@@ -16,9 +18,10 @@ using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -35,6 +38,11 @@ namespace CalamityMod.CalPlayer
|
||||
bool lava = attempt.inLava;
|
||||
bool honey = attempt.inHoney;
|
||||
|
||||
// If vanilla catches an enemy, just cancel
|
||||
if (npcSpawn > 0)
|
||||
return;
|
||||
|
||||
// Set up for allowing fishing in the Sulphurous Sea
|
||||
Point point = Player.Center.ToTileCoordinates();
|
||||
bool canSulphurFish = false;
|
||||
if (Abyss.AtLeftSideOfWorld)
|
||||
@@ -47,7 +55,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (point.X > Main.maxTilesX - 380)
|
||||
canSulphurFish = true;
|
||||
}
|
||||
|
||||
if (ZoneAbyss || ZoneSulphur)
|
||||
canSulphurFish = true;
|
||||
|
||||
@@ -57,33 +64,42 @@ namespace CalamityMod.CalPlayer
|
||||
CalamityGlobalNPC.OldDukeSpawn(Player.whoAmI, ModContent.NPCType<OldDuke>(), bait);
|
||||
}
|
||||
|
||||
// Quest Fish
|
||||
if (ZoneSunkenSea && questFish == ModContent.ItemType<EutrophicSandfish>() && Main.rand.NextBool(10))
|
||||
// Don't do anything if you can't fish in lava
|
||||
if (!attempt.CanFishInLava && lava)
|
||||
return;
|
||||
|
||||
// If you caught junk, then ignore all Calamity catches
|
||||
if (itemDrop == ItemID.OldShoe || itemDrop == ItemID.FishingSeaweed || itemDrop == ItemID.TinCan)
|
||||
return;
|
||||
|
||||
// Handle our modded Quest Fish, You can catch these in any liquid... because I don't care if you can
|
||||
if (ZoneSunkenSea && questFish == ModContent.ItemType<EutrophicSandfish>() && attempt.uncommon)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<EutrophicSandfish>();
|
||||
return;
|
||||
}
|
||||
if (ZoneSunkenSea && questFish == ModContent.ItemType<SurfClam>() && Main.rand.NextBool(10))
|
||||
if (ZoneSunkenSea && questFish == ModContent.ItemType<SurfClam>() && attempt.uncommon)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<SurfClam>();
|
||||
return;
|
||||
}
|
||||
if (ZoneSunkenSea && questFish == ModContent.ItemType<Serpentuna>() && Main.rand.NextBool(10))
|
||||
if (ZoneSunkenSea && questFish == ModContent.ItemType<Serpentuna>() && attempt.uncommon)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Serpentuna>();
|
||||
return;
|
||||
}
|
||||
if (ZoneCalamity && questFish == ModContent.ItemType<Brimlish>() && Main.rand.NextBool(10))
|
||||
if (ZoneCalamity && questFish == ModContent.ItemType<Brimlish>() && attempt.uncommon)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Brimlish>();
|
||||
return;
|
||||
}
|
||||
if (ZoneCalamity && questFish == ModContent.ItemType<Slurpfish>() && Main.rand.NextBool(10))
|
||||
if (ZoneCalamity && questFish == ModContent.ItemType<Slurpfish>() && attempt.uncommon)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Slurpfish>();
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle Alluring Bait's increased chance for Potion Material fish
|
||||
if (alluringBait)
|
||||
{
|
||||
int chanceForPotionFish = 1000 / power;
|
||||
@@ -127,7 +143,7 @@ namespace CalamityMod.CalPlayer
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<AldebaranAlewife>(), ZoneAstral);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<CoralskinFoolfish>(), ZoneSunkenSea);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<SunkenSailfish>(), ZoneSunkenSea);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<ScarredAngelfish>(), ZoneSunkenSea);
|
||||
fishList.AddWithCondition<int>(ModContent.ItemType<Shadowfish>(), !Main.dayTime && !Player.ZoneSkyHeight);
|
||||
}
|
||||
|
||||
if (fishList.Any())
|
||||
@@ -140,6 +156,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the increased chance of crates from Enchanted Pearl and the Supreme Fishing Station
|
||||
if (enchantedPearl || fishingStation)
|
||||
{
|
||||
int chanceForCrates = (enchantedPearl ? 10 : 0) +
|
||||
@@ -176,6 +193,8 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (ZoneCalamity)
|
||||
itemDrop = ModContent.ItemType<BrimstoneCrate>();
|
||||
else
|
||||
itemDrop = Main.hardMode ? ItemID.LavaCrateHard : ItemID.LavaCrate;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,7 +263,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else if (Main.rand.NextBool(chanceForGoldCrate))
|
||||
{
|
||||
itemDrop = ItemID.GoldenCrate;
|
||||
itemDrop = Main.hardMode ? ItemID.GoldenCrateHard : ItemID.GoldenCrate;
|
||||
}
|
||||
else if (Main.rand.NextBool(chanceForBiomeCrate))
|
||||
{
|
||||
@@ -253,12 +272,15 @@ namespace CalamityMod.CalPlayer
|
||||
biomeCrateList.AddWithCondition<int>(ModContent.ItemType<AstralCrate>(), ZoneAstral);
|
||||
biomeCrateList.AddWithCondition<int>(ModContent.ItemType<SunkenCrate>(), ZoneSunkenSea);
|
||||
biomeCrateList.AddWithCondition<int>(ModContent.ItemType<AbyssalCrate>(), canSulphurFish);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.CorruptFishingCrate, Player.ZoneCorrupt);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.CrimsonFishingCrate, Player.ZoneCrimson);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.HallowedFishingCrate, Player.ZoneHallow);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.DungeonFishingCrate, Player.ZoneDungeon);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.JungleFishingCrate, Player.ZoneJungle);
|
||||
biomeCrateList.AddWithCondition<int>(ItemID.FloatingIslandFishingCrate, Player.ZoneSkyHeight);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.CorruptFishingCrateHard : ItemID.CorruptFishingCrate, Player.ZoneCorrupt);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.CrimsonFishingCrateHard : ItemID.CrimsonFishingCrate, Player.ZoneCrimson);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.HallowedFishingCrateHard : ItemID.HallowedFishingCrate, Player.ZoneHallow);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.DungeonFishingCrateHard : ItemID.DungeonFishingCrate, Player.ZoneDungeon);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.JungleFishingCrateHard : ItemID.JungleFishingCrate, Player.ZoneJungle);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.FloatingIslandFishingCrateHard : ItemID.FloatingIslandFishingCrate, Player.ZoneSkyHeight);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.FrozenCrateHard : ItemID.FrozenCrate, Player.ZoneSnow);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.OasisCrateHard : ItemID.OasisCrate, Player.ZoneDesert && !Player.ZoneBeach);
|
||||
biomeCrateList.AddWithCondition<int>(Main.hardMode ? ItemID.OceanCrateHard : ItemID.OceanCrate, Player.ZoneBeach);
|
||||
|
||||
if (biomeCrateList.Any())
|
||||
{
|
||||
@@ -269,11 +291,11 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else if (Main.rand.NextBool(chanceForIronCrate))
|
||||
{
|
||||
itemDrop = ItemID.IronCrate;
|
||||
itemDrop = Main.hardMode ? ItemID.IronCrateHard : ItemID.IronCrate;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemDrop = ItemID.WoodenCrate;
|
||||
itemDrop = Main.hardMode ? ItemID.WoodenCrateHard : ItemID.WoodenCrate;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -282,13 +304,67 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (water)
|
||||
{
|
||||
if (itemDrop == ItemID.WoodenCrate || itemDrop == ItemID.IronCrate || itemDrop == ItemID.GoldenCrate || itemDrop == ItemID.FrogLeg || itemDrop == ItemID.BalloonPufferfish || itemDrop == ItemID.ZephyrFish)
|
||||
// Handle Calamity's crates, veryrare and legendary means it's a Golden Crate
|
||||
if (attempt.crate)
|
||||
{
|
||||
if (attempt.rare && !attempt.veryrare && !attempt.legendary)
|
||||
{
|
||||
if (ZoneAstral)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<AstralCrate>();
|
||||
}
|
||||
if (ZoneSunkenSea)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<SunkenCrate>();
|
||||
}
|
||||
if (canSulphurFish)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<AbyssalCrate>();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't override the vanilla crates or any special vanilla fishing loot
|
||||
List<int> keepCatchList = new List<int>()
|
||||
{
|
||||
ItemID.WoodenCrate,
|
||||
ItemID.WoodenCrateHard,
|
||||
ItemID.IronCrate,
|
||||
ItemID.IronCrateHard,
|
||||
ItemID.GoldenCrate,
|
||||
ItemID.GoldenCrateHard,
|
||||
ItemID.FrogLeg,
|
||||
ItemID.BalloonPufferfish,
|
||||
ItemID.ZephyrFish,
|
||||
ItemID.CombatBook,
|
||||
ItemID.CorruptFishingCrate,
|
||||
ItemID.CorruptFishingCrateHard,
|
||||
ItemID.CrimsonFishingCrate,
|
||||
ItemID.CrimsonFishingCrateHard,
|
||||
ItemID.HallowedFishingCrate,
|
||||
ItemID.HallowedFishingCrateHard,
|
||||
ItemID.DungeonFishingCrate,
|
||||
ItemID.DungeonFishingCrateHard,
|
||||
ItemID.JungleFishingCrate,
|
||||
ItemID.JungleFishingCrateHard,
|
||||
ItemID.FloatingIslandFishingCrate,
|
||||
ItemID.FloatingIslandFishingCrateHard,
|
||||
ItemID.FrozenCrate,
|
||||
ItemID.FrozenCrateHard,
|
||||
ItemID.OasisCrate,
|
||||
ItemID.OasisCrateHard,
|
||||
ItemID.OceanCrate,
|
||||
ItemID.OceanCrateHard
|
||||
};
|
||||
if (keepCatchList.Contains(itemDrop))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Player.ZoneCrimson || Player.ZoneCorrupt) && Player.ZoneRockLayerHeight && Main.hardMode)
|
||||
{
|
||||
if (Main.rand.NextBool(25))
|
||||
if (attempt.uncommon && Main.rand.NextBool(7))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<FishofNight>();
|
||||
}
|
||||
@@ -296,7 +372,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (Player.ZoneHallow && Player.ZoneRockLayerHeight && Main.hardMode)
|
||||
{
|
||||
if (Main.rand.NextBool(25))
|
||||
if (attempt.uncommon && Main.rand.NextBool(7))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<FishofLight>();
|
||||
}
|
||||
@@ -304,23 +380,33 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (Player.ZoneSkyHeight && Main.hardMode)
|
||||
{
|
||||
if (Main.rand.NextBool(25))
|
||||
if (attempt.uncommon && Main.rand.NextBool(7))
|
||||
{
|
||||
itemDrop = Main.rand.NextBool() ? ModContent.ItemType<SunbeamFish>() : ModContent.ItemType<FishofFlight>();
|
||||
}
|
||||
}
|
||||
|
||||
// Increased chance of Enchanted Starfish if you don't have maximum mana
|
||||
if (Player.ZoneOverworldHeight && !Main.dayTime)
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
int chance = Player.statManaMax < 200 ? 5 : 20;
|
||||
if (attempt.uncommon && Main.rand.NextBool(chance))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<EnchantedStarfish>();
|
||||
}
|
||||
}
|
||||
|
||||
if (!Player.ZoneSkyHeight && !Main.dayTime)
|
||||
{
|
||||
if (attempt.uncommon && Main.rand.NextBool(10))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Shadowfish>();
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.ZoneOverworldHeight && Main.dayTime)
|
||||
{
|
||||
if (Main.rand.NextBool(25))
|
||||
if (attempt.uncommon && Main.rand.NextBool(7))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<StuffedFish>();
|
||||
}
|
||||
@@ -328,64 +414,66 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (Player.ZoneRockLayerHeight)
|
||||
{
|
||||
if (Main.rand.NextBool(25))
|
||||
if (attempt.uncommon && Main.rand.NextBool(7))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<GlimmeringGemfish>();
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.ZoneSnow)
|
||||
if (Player.ZoneSnow && Main.hardMode)
|
||||
{
|
||||
if (Main.rand.NextBool(25) && Main.hardMode)
|
||||
if (attempt.uncommon && Main.rand.NextBool(7))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<FishofEleum>();
|
||||
}
|
||||
}
|
||||
|
||||
// Lower chance of Spadefish in Hardmode
|
||||
if (Player.ZoneDirtLayerHeight)
|
||||
{
|
||||
if (Main.rand.NextBool(Main.hardMode ? 100 : 40))
|
||||
int chance = Main.hardMode ? 10 : 2;
|
||||
if (attempt.veryrare && Main.rand.NextBool(chance))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Spadefish>();
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.FindBuffIndex(BuffID.Gills) > -1 && DownedBossSystem.downedCalamitas && (attempt.legendary || (attempt.veryrare && Main.rand.NextBool())))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Floodtide>();
|
||||
}
|
||||
|
||||
if (Player.ZoneOverworldHeight && Main.bloodMoon)
|
||||
{
|
||||
if (attempt.uncommon && Main.rand.NextBool(7))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Xerocodile>();
|
||||
}
|
||||
}
|
||||
|
||||
if (ZoneAstral) // Astral Infection, fishing in water
|
||||
{
|
||||
int astralFish = Main.rand.Next(100);
|
||||
if (astralFish >= 85) // 15%
|
||||
if (attempt.legendary)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<ProcyonidPrawn>();
|
||||
int legendaryCatch = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ItemType<PolarisParrotfish>(),
|
||||
ModContent.ItemType<GacruxianMollusk>(),
|
||||
ModContent.ItemType<UrsaSergeant>()
|
||||
});
|
||||
itemDrop = legendaryCatch;
|
||||
}
|
||||
else if (astralFish <= 84 && astralFish >= 70) // 15%
|
||||
else if (attempt.uncommon || attempt.rare || attempt.veryrare)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<ArcturusAstroidean>();
|
||||
int uncommonCatch = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ItemType<ProcyonidPrawn>(),
|
||||
ModContent.ItemType<ArcturusAstroidean>(),
|
||||
ModContent.ItemType<AldebaranAlewife>()
|
||||
});
|
||||
itemDrop = uncommonCatch;
|
||||
}
|
||||
else if (astralFish <= 69 && astralFish >= 55) // 15%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<AldebaranAlewife>();
|
||||
}
|
||||
else if (Player.cratePotion && astralFish <= 18 && astralFish >= 9) // 10%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<AstralCrate>();
|
||||
}
|
||||
else if (!Player.cratePotion && astralFish <= 13 && astralFish >= 9) // 5%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<AstralCrate>();
|
||||
}
|
||||
else if (astralFish <= 8 && astralFish >= 6) // 3%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<UrsaSergeant>();
|
||||
}
|
||||
else if (astralFish <= 5 && astralFish >= 3) // 3%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<GacruxianMollusk>();
|
||||
}
|
||||
else if (astralFish <= 2 && astralFish >= 0) // 3%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<PolarisParrotfish>();
|
||||
}
|
||||
else // 36% w/o crate pot, 31% w/ crate pot
|
||||
else
|
||||
{
|
||||
itemDrop = ModContent.ItemType<TwinklingPollox>();
|
||||
return;
|
||||
@@ -394,62 +482,48 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (ZoneSunkenSea) // Sunken Sea, fishing in water
|
||||
{
|
||||
int sunkenFish = Main.rand.Next(100);
|
||||
if (sunkenFish >= 85 && Main.hardMode) // 15%
|
||||
if (attempt.legendary)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<ScarredAngelfish>();
|
||||
List<int> legendaryCatches = new List<int>()
|
||||
{
|
||||
ModContent.ItemType<RustedJingleBell>(),
|
||||
ModContent.ItemType<GreenwaveLoach>()
|
||||
};
|
||||
legendaryCatches.AddWithCondition<int>(ModContent.ItemType<SparklingEmpress>(), DownedBossSystem.downedDesertScourge);
|
||||
legendaryCatches.AddWithCondition<int>(ModContent.ItemType<SerpentsBite>(), Main.hardMode);
|
||||
itemDrop = legendaryCatches[Main.rand.Next(legendaryCatches.Count)];
|
||||
}
|
||||
else if (sunkenFish <= 84 && sunkenFish >= 70) // 15%
|
||||
else if (attempt.uncommon || attempt.rare || attempt.veryrare)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<SunkenSailfish>();
|
||||
int uncommonCatch = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ItemType<SunkenSailfish>(),
|
||||
ModContent.ItemType<CoralskinFoolfish>()
|
||||
});
|
||||
itemDrop = uncommonCatch;
|
||||
}
|
||||
else if (sunkenFish <= 69 && sunkenFish >= 55) // 15%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<CoralskinFoolfish>();
|
||||
}
|
||||
else if (Player.cratePotion && sunkenFish <= 18 && sunkenFish >= 9) // 10%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<SunkenCrate>();
|
||||
}
|
||||
else if (!Player.cratePotion && sunkenFish <= 13 && sunkenFish >= 9) // 5%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<SunkenCrate>();
|
||||
}
|
||||
else if (sunkenFish <= 31 && sunkenFish >= 29) // 3%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<GreenwaveLoach>();
|
||||
}
|
||||
else if (sunkenFish <= 8 && sunkenFish >= 6 && Main.hardMode) // 3%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<SerpentsBite>();
|
||||
}
|
||||
else if (sunkenFish <= 5 && sunkenFish >= 3) // 3%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<RustedJingleBell>();
|
||||
}
|
||||
else if (sunkenFish <= 2 && sunkenFish >= 0 && DownedBossSystem.downedDesertScourge) // 3%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<SparklingEmpress>();
|
||||
}
|
||||
else // 38% w/o crate pot, 33% w/ crate pot + 18% if prehardmode
|
||||
else
|
||||
{
|
||||
itemDrop = ModContent.ItemType<PrismaticGuppy>();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.FindBuffIndex(BuffID.Gills) > -1 && DownedBossSystem.downedCalamitas && Main.rand.NextBool(25))
|
||||
// There is no complete fishing pool here, so most of it is vanilla default
|
||||
if (canSulphurFish) // Sulphurous Sea, fishing in water
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Floodtide>();
|
||||
}
|
||||
|
||||
if (attempt.common)
|
||||
{
|
||||
if (canSulphurFish)
|
||||
if (attempt.legendary || (attempt.veryrare && Main.rand.NextBool()))
|
||||
{
|
||||
itemDrop = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ItemType<AlluringBait>(),
|
||||
ModContent.ItemType<AbyssalAmulet>()
|
||||
});
|
||||
}
|
||||
else if (attempt.common)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<PlantyMush>();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (canSulphurFish && (bait.type == ItemID.GoldWorm || bait.type == ItemID.GoldGrasshopper || bait.type == ItemID.GoldButterfly) && power > 150)
|
||||
@@ -471,82 +545,44 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (canSulphurFish)
|
||||
{
|
||||
if (Main.rand.NextBool(15))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<PlantyMush>();
|
||||
}
|
||||
if (Main.rand.NextFloat() < 0.08f)
|
||||
{
|
||||
itemDrop = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ModContent.ItemType<AlluringBait>(),
|
||||
ModContent.ItemType<AbyssalAmulet>()
|
||||
});
|
||||
}
|
||||
if (Player.cratePotion && Main.rand.NextBool(5)) // 20%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<AbyssalCrate>();
|
||||
}
|
||||
else if (!Player.cratePotion && Main.rand.NextBool(10)) // 10%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<AbyssalCrate>();
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.ZoneOverworldHeight && Main.bloodMoon)
|
||||
{
|
||||
if (Main.rand.NextBool(25))
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Xerocodile>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (lava)
|
||||
{
|
||||
if (ZoneCalamity) // Brimstone Crags, fishing in lava
|
||||
{
|
||||
int cragFish = Main.rand.Next(100);
|
||||
if (cragFish >= 85) // 15%
|
||||
if (attempt.legendary)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<CoastalDemonfish>();
|
||||
List<int> legendaryCatches = new List<int>()
|
||||
{
|
||||
ModContent.ItemType<CharredLasher>(),
|
||||
ModContent.ItemType<DragoonDrizzlefish>()
|
||||
};
|
||||
legendaryCatches.AddWithCondition<int>(ModContent.ItemType<SparklingEmpress>(), DownedBossSystem.downedDesertScourge);
|
||||
legendaryCatches.AddWithCondition<int>(ModContent.ItemType<SerpentsBite>(), Main.hardMode);
|
||||
itemDrop = legendaryCatches[Main.rand.Next(legendaryCatches.Count)];
|
||||
}
|
||||
else if (cragFish <= 84 && cragFish >= 70) // 15%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<BrimstoneFish>();
|
||||
}
|
||||
else if (cragFish <= 69 && cragFish >= 55) // 15%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Shadowfish>();
|
||||
}
|
||||
else if (cragFish <= 54 && cragFish >= 41 && Main.hardMode) // 14%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<ChaoticFish>();
|
||||
}
|
||||
else if (Player.cratePotion && cragFish <= 30 && cragFish >= 21) // 10%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<BrimstoneCrate>();
|
||||
}
|
||||
else if (!Player.cratePotion && cragFish <= 25 && cragFish >= 21) // 5%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<BrimstoneCrate>();
|
||||
}
|
||||
else if (cragFish <= 20 && cragFish >= 11 && DownedBossSystem.downedProvidence) // 10%
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Bloodfin>();
|
||||
}
|
||||
else if (cragFish <= 10 && cragFish >= (Main.hardMode ? 8 : 6)) // 5% (3% hardmode)
|
||||
{
|
||||
// Increased chance of Dragoon Drizzlefish in Prehardmode
|
||||
else if (attempt.veryrare && !Main.hardMode)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<DragoonDrizzlefish>();
|
||||
}
|
||||
else if (cragFish <= 2 && cragFish >= 0) // 3%
|
||||
}
|
||||
else if ((attempt.rare || attempt.veryrare) && DownedBossSystem.downedProvidence && Main.rand.Next(3) >= 2)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<Bloodfin>();
|
||||
}
|
||||
else if (attempt.uncommon || attempt.rare || attempt.veryrare)
|
||||
{
|
||||
itemDrop = ModContent.ItemType<CharredLasher>();
|
||||
List<int> uncommonCatches = new List<int>()
|
||||
{
|
||||
ModContent.ItemType<CoastalDemonfish>(),
|
||||
ModContent.ItemType<BrimstoneFish>(),
|
||||
ModContent.ItemType<Shadowfish>()
|
||||
};
|
||||
uncommonCatches.AddWithCondition<int>(ModContent.ItemType<ChaoticFish>(), Main.hardMode);
|
||||
itemDrop = uncommonCatches[Main.rand.Next(uncommonCatches.Count)];
|
||||
}
|
||||
else // 32% w/o crate pot, 27% w/ crate pot, add 10% pre-Prov, add another 12% prehardmode
|
||||
else
|
||||
{
|
||||
itemDrop = ModContent.ItemType<CragBullhead>();
|
||||
}
|
||||
@@ -565,6 +601,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.ZoneSkyHeight && fishingRod.type == ModContent.ItemType<HeronRod>())
|
||||
fishingLevel = (int)(fishingLevel * 1.1f);
|
||||
|
||||
// Prevent the player from fishing if they have the Bloodworm
|
||||
if (bait.type == ModContent.ItemType<BloodwormItem>())
|
||||
{
|
||||
Point point = Player.Center.ToTileCoordinates();
|
||||
@@ -586,6 +623,10 @@ namespace CalamityMod.CalPlayer
|
||||
Item item = Player.ActiveItem();
|
||||
if (!canSulphurFish || item.fishingPole <= 0 || item.holdStyle != 1)
|
||||
fishingLevel = -1;
|
||||
|
||||
// If your bait is the Bloodworm, set the Fisherman's Pocket Guide to display Warning!
|
||||
// This only happens when a fishing bobber projectile exists
|
||||
Player.displayedFishingInfo = Language.GetTextValue("GameUI.FishingWarning");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -147,6 +147,15 @@ namespace CalamityMod.CalPlayer
|
||||
lifeRegenLost += 20;
|
||||
}
|
||||
|
||||
if (irradiated)
|
||||
{
|
||||
if (Player.lifeRegen > 0)
|
||||
Player.lifeRegen = 0;
|
||||
|
||||
Player.lifeRegenTime = 0;
|
||||
lifeRegenLost += 4;
|
||||
}
|
||||
|
||||
if (ZoneSulphur && Player.IsUnderwater() && !decayEffigy && !abyssalDivingSuit && !Player.lavaWet && !Player.honeyWet)
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), 2, true);
|
||||
@@ -262,7 +271,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.lifeRegen = 0;
|
||||
|
||||
Player.lifeRegenTime = 0;
|
||||
lifeRegenLost += 18;
|
||||
lifeRegenLost += 36;
|
||||
}
|
||||
|
||||
if (cDepth)
|
||||
@@ -934,13 +943,13 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Calculate the ratio of the player's current max life relative to the starting HP of 100.
|
||||
// This makes the soft cap far less harsh at lower amounts of max life.
|
||||
// Ranges from 10 (at 100 max life) to 2 (at 500 max life) to 1 (at 1000 max life) to 0 (at greater than 2000 max life).
|
||||
int lifeRegenSoftCapMin = (int)Math.Round(100f / actualMaxLife * 10f);
|
||||
int lifeRegenSoftCapMax = 10;
|
||||
// Ranges from 20 (at 100 max life) to 4 (at 500 max life) to 2 (at 1000 max life) to 1 (at greater than 2000 max life).
|
||||
int lifeRegenSoftCapMax = 20;
|
||||
int lifeRegenSoftCapMin = (int)Math.Round(100f / actualMaxLife * lifeRegenSoftCapMax);
|
||||
|
||||
// The soft cap for life regen which ranges from 10 (at less than 5% HP) to 0 (at greater than or equal to 95% HP).
|
||||
// The soft cap for life regen which ranges from 20 (at less than 5% HP) to 1 (at greater than or equal to 95% HP).
|
||||
// This value is capped at a min and max amount.
|
||||
int lifeRegenSoftCap = (int)MathHelper.Clamp((int)Math.Round((1f - maxLifeRatio) * 10f), lifeRegenSoftCapMin, lifeRegenSoftCapMax);
|
||||
int lifeRegenSoftCap = (int)MathHelper.Clamp((int)Math.Round((1f - maxLifeRatio) * lifeRegenSoftCapMax), lifeRegenSoftCapMin, lifeRegenSoftCapMax);
|
||||
|
||||
// If life regen is greater than the calculated soft cap, reduce it.
|
||||
if (Player.lifeRegen > lifeRegenSoftCap)
|
||||
|
||||
@@ -17,6 +17,7 @@ using CalamityMod.Events;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Brimflame;
|
||||
using CalamityMod.Items.Armor.DesertProwler;
|
||||
using CalamityMod.Items.Armor.Silva;
|
||||
using CalamityMod.Items.DraedonMisc;
|
||||
using CalamityMod.Items.Dyes;
|
||||
@@ -58,6 +59,7 @@ using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
@@ -71,7 +73,7 @@ namespace CalamityMod.CalPlayer
|
||||
// Give the player a 24% jump speed boost while wings are equipped, otherwise grant 4% more jump speed so that players can jump 7 tiles high
|
||||
if (Player.wingsLogic > 0)
|
||||
Player.jumpSpeedBoost += 1.2f;
|
||||
else
|
||||
else if (CalamityConfig.Instance.HigherJumpHeight)
|
||||
Player.jumpSpeedBoost += 0.2f;
|
||||
|
||||
// Decrease the counter on Fearmonger set turbo regeneration
|
||||
@@ -94,6 +96,19 @@ namespace CalamityMod.CalPlayer
|
||||
// be refreshed and copied from RegisteredGameModes. Without this, the above behavior is not reflected ingame, as GameModeData is a value type, not a reference type.
|
||||
Main.GameMode = Main.GameMode;
|
||||
}
|
||||
// If people want to suffer, let them suffer
|
||||
else
|
||||
{
|
||||
var copy = Main.RegisteredGameModes[GameModeID.Expert];
|
||||
copy.DebuffTimeMultiplier = 2f;
|
||||
Main.RegisteredGameModes[GameModeID.Expert] = copy;
|
||||
|
||||
copy = Main.RegisteredGameModes[GameModeID.Master];
|
||||
copy.DebuffTimeMultiplier = 2.5f;
|
||||
Main.RegisteredGameModes[GameModeID.Master] = copy;
|
||||
|
||||
Main.GameMode = Main.GameMode;
|
||||
}
|
||||
|
||||
// Go through the old positions for the player.
|
||||
for (int i = Player.Calamity().OldPositions.Length - 1; i > 0; i--)
|
||||
@@ -105,7 +120,7 @@ namespace CalamityMod.CalPlayer
|
||||
OldPositions[0] = Player.position;
|
||||
|
||||
// Hurt the nearest NPC to the mouse if using the burning mouse.
|
||||
if (blazingCursorDamage)
|
||||
if (blazingCursorDamage || blazingCursorVisuals)
|
||||
HandleBlazingMouseEffects();
|
||||
|
||||
// Revengeance effects
|
||||
@@ -207,6 +222,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
// Apply stealth damage to rogue.
|
||||
Player.GetDamage<RogueDamageClass>() += stealthDamage;
|
||||
|
||||
//Slow the player down after any other speed modifiers might have been applied.
|
||||
//Todo - Move this back to the wulfrum set class whenever statmodifiers are implemented for stats other than damage
|
||||
if (WulfrumHat.PowerModeEngaged(Player, out _))
|
||||
Player.moveSpeed *= 0.8f;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -498,6 +518,10 @@ namespace CalamityMod.CalPlayer
|
||||
// The sigil's brightness slowly fades away every frame if not incinerating anything.
|
||||
blazingMouseAuraFade = MathHelper.Clamp(blazingMouseAuraFade - 0.025f, 0.25f, 1f);
|
||||
|
||||
// Allows the blazing aura to display if the accessory is vanity, but it deals no damage
|
||||
if (!blazingCursorDamage)
|
||||
return;
|
||||
|
||||
// miscCounter is used to limit Calamity's hit rate.
|
||||
int framesPerHit = 60 / Calamity.HitsPerSecond;
|
||||
if (Player.miscCounter % framesPerHit != 1)
|
||||
@@ -509,7 +533,7 @@ namespace CalamityMod.CalPlayer
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
NPC target = Main.npc[i];
|
||||
if (!target.active || !target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC)
|
||||
if (!target.active || !target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type])
|
||||
continue;
|
||||
|
||||
// Brighten the sigil because it is dealing damage. This can only happen once per hit event.
|
||||
@@ -648,7 +672,9 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
if (!Main.npc[i].active || Main.npc[i].friendly || Main.npc[i].lifeMax < 5 || alreadyTargetedNPCs.Contains(i) || Main.npc[i].realLife >= 0 || Main.npc[i].dontTakeDamage || Main.npc[i].immortal)
|
||||
NPC target = Main.npc[i];
|
||||
if (!target.active || target.friendly || target.lifeMax < 5 || alreadyTargetedNPCs.Contains(i) || target.realLife >= 0 ||
|
||||
target.dontTakeDamage || target.immortal || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type])
|
||||
continue;
|
||||
|
||||
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<DaawnlightSpiritOrigin>()));
|
||||
@@ -659,10 +685,6 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
// Proficiency level ups
|
||||
if (CalamityConfig.Instance.Proficiency)
|
||||
GetExactLevelUp();
|
||||
|
||||
// Max mana bonuses
|
||||
Player.statManaMax2 +=
|
||||
(permafrostsConcoction ? 50 : 0) +
|
||||
@@ -879,20 +901,30 @@ namespace CalamityMod.CalPlayer
|
||||
Player.noFallDmg = true;
|
||||
}
|
||||
|
||||
// Allow the player to double their gravity (but NOT max fall speed!) by holding the down button while in midair.
|
||||
bool holdingDown = Player.controlDown && !Player.controlJump;
|
||||
bool controlsEnabled = Player.ControlsEnabled();
|
||||
bool notInLiquid = !Player.wet;
|
||||
bool notOnRope = !Player.pulley && Player.ropeCount == 0;
|
||||
bool notGrappling = Player.grappling[0] == -1;
|
||||
bool airborne = Player.velocity.Y != 0;
|
||||
if (holdingDown && Player.ControlsEnabled() && notInLiquid && notOnRope && notGrappling && airborne)
|
||||
if (CalamityConfig.Instance.FasterFallHotkey)
|
||||
{
|
||||
Player.velocity.Y += Player.gravity * (BalancingConstants.HoldingDownGravityMultiplier - 1f);
|
||||
if (Player.velocity.Y > Player.maxFallSpeed)
|
||||
Player.velocity.Y = Player.maxFallSpeed;
|
||||
// Allow the player to double their gravity (but NOT max fall speed!) by holding the down button while in midair.
|
||||
bool holdingDown = Player.controlDown && !Player.controlJump;
|
||||
bool controlsEnabled = Player.ControlsEnabled();
|
||||
bool notInLiquid = !Player.wet;
|
||||
bool notOnRope = !Player.pulley && Player.ropeCount == 0;
|
||||
bool notGrappling = Player.grappling[0] == -1;
|
||||
bool airborne = Player.velocity.Y != 0;
|
||||
if (holdingDown && Player.ControlsEnabled() && notInLiquid && notOnRope && notGrappling && airborne)
|
||||
{
|
||||
Player.velocity.Y += Player.gravity * Player.gravDir * (BalancingConstants.HoldingDownGravityMultiplier - 1f);
|
||||
if (Player.velocity.Y * Player.gravDir > Player.maxFallSpeed)
|
||||
Player.velocity.Y = Player.maxFallSpeed * Player.gravDir;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Player.mount.Type == MountID.Slime)
|
||||
Player.velocity.X *= 0.91f;
|
||||
else if (Player.mount.Type == MountID.QueenSlime)
|
||||
Player.velocity.X *= 0.935f;
|
||||
}
|
||||
|
||||
// Omega Blue Armor bonus
|
||||
if (omegaBlueSet)
|
||||
@@ -1060,12 +1092,14 @@ namespace CalamityMod.CalPlayer
|
||||
KameiBladeUseDelay--;
|
||||
if (galileoCooldown > 0)
|
||||
galileoCooldown--;
|
||||
if (dragonRageCooldown > 0)
|
||||
dragonRageCooldown--;
|
||||
if (soundCooldown > 0)
|
||||
soundCooldown--;
|
||||
if (shadowPotCooldown > 0)
|
||||
shadowPotCooldown--;
|
||||
if (raiderCooldown > 0)
|
||||
raiderCooldown--;
|
||||
if (raiderCritBonus > 0f)
|
||||
raiderCritBonus -= RaidersTalisman.RaiderBonus / (float)CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
|
||||
if (gSabatonCooldown > 0)
|
||||
gSabatonCooldown--;
|
||||
if (gSabatonFall > 0)
|
||||
@@ -1080,6 +1114,8 @@ namespace CalamityMod.CalPlayer
|
||||
silvaMageCooldown--;
|
||||
if (tarraMageHealCooldown > 0)
|
||||
tarraMageHealCooldown--;
|
||||
if (scuttlerCooldown > 0)
|
||||
scuttlerCooldown--;
|
||||
if (rogueCrownCooldown > 0)
|
||||
rogueCrownCooldown--;
|
||||
if (spectralVeilImmunity > 0)
|
||||
@@ -1210,6 +1246,10 @@ namespace CalamityMod.CalPlayer
|
||||
adamantiteSetDefenseBoostInterpolant = 0f;
|
||||
if (ChlorophyteHealDelay > 0)
|
||||
ChlorophyteHealDelay--;
|
||||
if (monolithAccursedShader > 0)
|
||||
monolithAccursedShader--;
|
||||
if (miningSetCooldown > 0)
|
||||
miningSetCooldown--;
|
||||
|
||||
// God Slayer Armor dash debuff immunity
|
||||
if (DashID == GodSlayerDash.ID && Player.dashDelay < 0)
|
||||
@@ -1363,12 +1403,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Raider Talisman bonus
|
||||
if (raiderTalisman)
|
||||
if (raiderTalisman && !StealthStrikeAvailable())
|
||||
{
|
||||
// Nanotech use to have an exclusive nerf here, but since they are currently equal, there
|
||||
// is no check to indicate such.
|
||||
float damageMult = 0.15f;
|
||||
Player.GetDamage<ThrowingDamageClass>() += raiderStack / 150f * damageMult;
|
||||
Player.GetCritChance<ThrowingDamageClass>() += raiderCritBonus;
|
||||
}
|
||||
|
||||
if (kamiBoost)
|
||||
@@ -1997,10 +2034,10 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Asset<Texture2D> rain3 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Rain3");
|
||||
Asset<Texture2D> rainOriginal = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/RainOriginal");
|
||||
Asset<Texture2D> mana2 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Mana2");
|
||||
Asset<Texture2D> mana3 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Mana3");
|
||||
Asset<Texture2D> mana4 = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Mana4");
|
||||
Asset<Texture2D> manaOriginal = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/ManaOriginal");
|
||||
Asset<Texture2D> cometShard = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/ManaCometShard");
|
||||
Asset<Texture2D> etherealCore = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/ManaEtherealCore");
|
||||
Asset<Texture2D> phantomHeart = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/ManaPhantomHeart");
|
||||
Asset<Texture2D> manaOriginal = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/UI/HealthMana/ManaOriginal");
|
||||
Asset<Texture2D> carpetAuric = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/AuricCarpet");
|
||||
Asset<Texture2D> carpetOriginal = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Carpet");
|
||||
|
||||
@@ -2010,17 +2047,17 @@ namespace CalamityMod.CalPlayer
|
||||
(cShard ? 1 : 0);
|
||||
switch (totalManaBoost)
|
||||
{
|
||||
default:
|
||||
TextureAssets.Mana = manaOriginal;
|
||||
break;
|
||||
case 3:
|
||||
TextureAssets.Mana = mana4;
|
||||
TextureAssets.Mana = phantomHeart;
|
||||
break;
|
||||
case 2:
|
||||
TextureAssets.Mana = mana3;
|
||||
TextureAssets.Mana = etherealCore;
|
||||
break;
|
||||
case 1:
|
||||
TextureAssets.Mana = mana2;
|
||||
TextureAssets.Mana = cometShard;
|
||||
break;
|
||||
default:
|
||||
TextureAssets.Mana = manaOriginal;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2335,19 +2372,8 @@ namespace CalamityMod.CalPlayer
|
||||
Player.GetCritChance<GenericDamageClass>() += ProfanedRagePotion.CritBoost;
|
||||
}
|
||||
|
||||
if (shadow)
|
||||
{
|
||||
if (Player.FindBuffIndex(BuffID.Invisibility) > -1)
|
||||
Player.ClearBuff(BuffID.Invisibility);
|
||||
}
|
||||
|
||||
if (irradiated)
|
||||
{
|
||||
Player.statDefense -= 10;
|
||||
Player.moveSpeed -= 0.1f;
|
||||
Player.GetDamage<GenericDamageClass>() += 0.05f;
|
||||
Player.GetKnockback<SummonDamageClass>() += 0.5f;
|
||||
}
|
||||
|
||||
if (rRage)
|
||||
{
|
||||
@@ -2424,11 +2450,12 @@ namespace CalamityMod.CalPlayer
|
||||
Player.statDefense += 20;
|
||||
Player.longInvince = true;
|
||||
Player.crimsonRegen = true;
|
||||
healingPotBonus += 0.5f;
|
||||
}
|
||||
|
||||
// 50% movement speed bonus so that you don't feel like a snail in the early game.
|
||||
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy.
|
||||
if (CalamityMod.Instance.overhaul is null)
|
||||
if (CalamityMod.Instance.overhaul is null && CalamityConfig.Instance.FasterBaseSpeed)
|
||||
Player.moveSpeed += BalancingConstants.DefaultMoveSpeedBoost;
|
||||
|
||||
if (cirrusDress)
|
||||
@@ -2549,18 +2576,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (CalamityLists.highTestFishList.Contains(Player.ActiveItem().type))
|
||||
Player.accFishingLine = true;
|
||||
|
||||
if (CalamityLists.boomerangList.Contains(Player.ActiveItem().type) && Player.invis)
|
||||
Player.GetDamage<ThrowingDamageClass>() += 0.1f;
|
||||
|
||||
if (CalamityLists.javelinList.Contains(Player.ActiveItem().type) && Player.invis)
|
||||
Player.GetArmorPenetration<GenericDamageClass>() += 5;
|
||||
|
||||
if (CalamityLists.flaskBombList.Contains(Player.ActiveItem().type) && Player.invis)
|
||||
rogueVelocity += 0.1f;
|
||||
|
||||
if (CalamityLists.spikyBallList.Contains(Player.ActiveItem().type) && Player.invis)
|
||||
Player.GetCritChance<RogueDamageClass>() += 10;
|
||||
|
||||
if (planarSpeedBoost != 0)
|
||||
{
|
||||
if (Player.ActiveItem().type != ModContent.ItemType<PridefulHuntersPlanarRipper>())
|
||||
@@ -2840,7 +2855,15 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
if (bloodyWormTooth)
|
||||
{
|
||||
Player.GetDamage<MeleeDamageClass>() += 0.07f;
|
||||
Player.GetAttackSpeed<MeleeDamageClass>() += 0.07f;
|
||||
}
|
||||
|
||||
if (filthyGlove)
|
||||
{
|
||||
bonusStealthDamage += nanotech ? 0.05f : 0.1f;
|
||||
}
|
||||
|
||||
if (dAmulet)
|
||||
Player.pStone = true;
|
||||
@@ -3102,7 +3125,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (eArtifact)
|
||||
{
|
||||
Player.manaCost *= 0.85f;
|
||||
Player.GetDamage<ThrowingDamageClass>() += 0.15f;
|
||||
Player.maxMinions += 2;
|
||||
}
|
||||
|
||||
@@ -3464,9 +3486,6 @@ namespace CalamityMod.CalPlayer
|
||||
Player.GetCritChance<MeleeDamageClass>() += 5;
|
||||
}
|
||||
|
||||
if (CalamityConfig.Instance.Proficiency)
|
||||
GetStatBonuses();
|
||||
|
||||
// Amalgam boosts
|
||||
if (Main.myPlayer == Player.whoAmI)
|
||||
{
|
||||
@@ -3474,8 +3493,8 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
// TODO -- What the FUCK is this conditional chain?
|
||||
int hasBuff = Player.buffType[l];
|
||||
if ((hasBuff >= BuffID.ObsidianSkin && hasBuff <= BuffID.Gravitation) || hasBuff == BuffID.Tipsy || hasBuff == BuffID.WellFed ||
|
||||
hasBuff == BuffID.Honey || hasBuff == BuffID.WeaponImbueVenom || (hasBuff >= BuffID.WeaponImbueCursedFlames && hasBuff <= BuffID.WeaponImbuePoison) ||
|
||||
if ((hasBuff >= BuffID.ObsidianSkin && hasBuff <= BuffID.Gravitation) || hasBuff == BuffID.Tipsy || hasBuff == BuffID.WellFed || hasBuff == BuffID.WellFed2 || hasBuff == BuffID.WellFed3 ||
|
||||
hasBuff == BuffID.Honey || hasBuff == BuffID.WeaponImbueVenom || (hasBuff >= BuffID.WeaponImbueCursedFlames && hasBuff <= BuffID.WeaponImbuePoison) || hasBuff == BuffID.Lucky ||
|
||||
(hasBuff >= BuffID.Mining && hasBuff <= BuffID.Wrath) || (hasBuff >= BuffID.Lovestruck && hasBuff <= BuffID.Warmth) || hasBuff == BuffID.SugarRush ||
|
||||
hasBuff == ModContent.BuffType<AbyssalWeapon>() || hasBuff == ModContent.BuffType<AnechoicCoatingBuff>() || hasBuff == ModContent.BuffType<ArmorCrumbling>() ||
|
||||
hasBuff == ModContent.BuffType<ArmorShattering>() || hasBuff == ModContent.BuffType<AstralInjectionBuff>() || hasBuff == ModContent.BuffType<BaguetteBuff>() ||
|
||||
@@ -3800,6 +3819,9 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.statDefense > 0)
|
||||
Player.statDefense -= (int)(Player.statDefense * 0.1);
|
||||
}
|
||||
|
||||
if (DesertProwlerHat.ShroudedInSmoke(Player, out _))
|
||||
Player.statDefense -= (int)(Player.statDefense * 0.75);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -3957,8 +3979,6 @@ namespace CalamityMod.CalPlayer
|
||||
CalamityUtils.ConsumeItemViaQuickBuff(Player, item, HadalStew.BuffType, HadalStew.BuffDuration, true);
|
||||
if (item.type == ModContent.ItemType<Margarita>())
|
||||
CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Margarita.BuffType, Margarita.BuffDuration, false);
|
||||
if (item.type == ModContent.ItemType<Bloodfin>())
|
||||
CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Bloodfin.BuffType, Bloodfin.BuffDuration, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,16 +22,6 @@ namespace CalamityMod.CalPlayer
|
||||
private void EnterWorldSync()
|
||||
{
|
||||
StandardSync();
|
||||
SyncExactLevel(false, 0);
|
||||
SyncExactLevel(false, 1);
|
||||
SyncExactLevel(false, 2);
|
||||
SyncExactLevel(false, 3);
|
||||
SyncExactLevel(false, 4);
|
||||
SyncLevel(false, 0);
|
||||
SyncLevel(false, 1);
|
||||
SyncLevel(false, 2);
|
||||
SyncLevel(false, 3);
|
||||
SyncLevel(false, 4);
|
||||
}
|
||||
|
||||
internal void MouseControlsSync()
|
||||
@@ -42,74 +32,6 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Creating and Sending Packets
|
||||
private void SyncExactLevel(bool server, int levelType)
|
||||
{
|
||||
ModPacket packet = Mod.GetPacket();
|
||||
switch (levelType)
|
||||
{
|
||||
case 0:
|
||||
packet.Write((byte)CalamityModMessageType.ExactMeleeLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(exactMeleeLevel);
|
||||
break;
|
||||
case 1:
|
||||
packet.Write((byte)CalamityModMessageType.ExactRangedLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(exactRangedLevel);
|
||||
break;
|
||||
case 2:
|
||||
packet.Write((byte)CalamityModMessageType.ExactMagicLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(exactMagicLevel);
|
||||
break;
|
||||
case 3:
|
||||
packet.Write((byte)CalamityModMessageType.ExactSummonLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(exactSummonLevel);
|
||||
break;
|
||||
case 4:
|
||||
packet.Write((byte)CalamityModMessageType.ExactRogueLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(exactRogueLevel);
|
||||
break;
|
||||
}
|
||||
Player.SendPacket(packet, server);
|
||||
}
|
||||
|
||||
private void SyncLevel(bool server, int levelType)
|
||||
{
|
||||
ModPacket packet = Mod.GetPacket(256);
|
||||
switch (levelType)
|
||||
{
|
||||
case 0:
|
||||
packet.Write((byte)CalamityModMessageType.MeleeLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(meleeLevel);
|
||||
break;
|
||||
case 1:
|
||||
packet.Write((byte)CalamityModMessageType.RangedLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(rangedLevel);
|
||||
break;
|
||||
case 2:
|
||||
packet.Write((byte)CalamityModMessageType.MagicLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(magicLevel);
|
||||
break;
|
||||
case 3:
|
||||
packet.Write((byte)CalamityModMessageType.SummonLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(summonLevel);
|
||||
break;
|
||||
case 4:
|
||||
packet.Write((byte)CalamityModMessageType.RogueLevelSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(rogueLevel);
|
||||
break;
|
||||
}
|
||||
Player.SendPacket(packet, server);
|
||||
}
|
||||
|
||||
public void SyncDefenseDamage(bool server)
|
||||
{
|
||||
ModPacket packet = Mod.GetPacket(256);
|
||||
@@ -187,24 +109,6 @@ namespace CalamityMod.CalPlayer
|
||||
Player.SendPacket(packet, server);
|
||||
}
|
||||
|
||||
public void SyncItemTypeLastReforged(bool server)
|
||||
{
|
||||
ModPacket packet = Mod.GetPacket(256);
|
||||
packet.Write((byte)CalamityModMessageType.ItemTypeLastReforgedSync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(itemTypeLastReforged);
|
||||
Player.SendPacket(packet, server);
|
||||
}
|
||||
|
||||
public void SyncReforgeTierSafety(bool server)
|
||||
{
|
||||
ModPacket packet = Mod.GetPacket(256);
|
||||
packet.Write((byte)CalamityModMessageType.ReforgeTierSafetySync);
|
||||
packet.Write(Player.whoAmI);
|
||||
packet.Write(reforgeTierSafety);
|
||||
Player.SendPacket(packet, server);
|
||||
}
|
||||
|
||||
public void SyncRightClick(bool server)
|
||||
{
|
||||
ModPacket packet = Mod.GetPacket(256);
|
||||
@@ -225,56 +129,6 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Reading and Handling Packets
|
||||
internal void HandleExactLevels(BinaryReader reader, int levelType)
|
||||
{
|
||||
switch (levelType)
|
||||
{
|
||||
case 0:
|
||||
exactMeleeLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 1:
|
||||
exactRangedLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 2:
|
||||
exactMagicLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 3:
|
||||
exactSummonLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 4:
|
||||
exactRogueLevel = reader.ReadInt32();
|
||||
break;
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
SyncExactLevel(true, levelType);
|
||||
}
|
||||
|
||||
internal void HandleLevels(BinaryReader reader, int levelType)
|
||||
{
|
||||
switch (levelType)
|
||||
{
|
||||
case 0:
|
||||
meleeLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 1:
|
||||
rangedLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 2:
|
||||
magicLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 3:
|
||||
summonLevel = reader.ReadInt32();
|
||||
break;
|
||||
case 4:
|
||||
rogueLevel = reader.ReadInt32();
|
||||
break;
|
||||
}
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
SyncLevel(true, levelType);
|
||||
}
|
||||
|
||||
internal void HandleRage(BinaryReader reader)
|
||||
{
|
||||
rage = reader.ReadSingle();
|
||||
@@ -365,20 +219,6 @@ namespace CalamityMod.CalPlayer
|
||||
SyncDeathCount(true);
|
||||
}
|
||||
|
||||
internal void HandleItemTypeLastReforged(BinaryReader reader)
|
||||
{
|
||||
itemTypeLastReforged = reader.ReadInt32();
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
SyncItemTypeLastReforged(true);
|
||||
}
|
||||
|
||||
internal void HandleReforgeTierSafety(BinaryReader reader)
|
||||
{
|
||||
reforgeTierSafety = reader.ReadInt32();
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
SyncReforgeTierSafety(true);
|
||||
}
|
||||
|
||||
internal void HandleDefenseDamage(BinaryReader reader)
|
||||
{
|
||||
totalDefenseDamage = reader.ReadInt32();
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (target.type == NPCID.TargetDummy || target.type == NPCType<SuperDummyNPC>())
|
||||
return;
|
||||
if (rageModeActive && shatteredCommunity)
|
||||
ShatteredCommunity.AccumulateRageDamage(Player, this, damage);
|
||||
Player.GetModPlayer<ShatteredCommunityPlayer>().AccumulateRageDamage(damage);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -393,14 +393,14 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
ProjLifesteal(target, proj, damage, crit);
|
||||
ProjOnHit(proj, target.Center, crit, (target.damage > 5 || target.boss) && !target.SpawnedFromStatue);
|
||||
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.IsSummon(), proj.CountsAsClass<ThrowingDamageClass>(), true);
|
||||
NPCDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), true);
|
||||
|
||||
// Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies).
|
||||
if (target.type == NPCID.TargetDummy || target.type == NPCType<SuperDummyNPC>())
|
||||
return;
|
||||
|
||||
if (rageModeActive && shatteredCommunity)
|
||||
ShatteredCommunity.AccumulateRageDamage(Player, this, damage);
|
||||
Player.GetModPlayer<ShatteredCommunityPlayer>().AccumulateRageDamage(damage);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -615,7 +615,7 @@ namespace CalamityMod.CalPlayer
|
||||
target.AddBuff(BuffType<Plague>(), 300);
|
||||
}
|
||||
ProjOnHit(proj, target.Center, crit, true);
|
||||
PvpDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.IsSummon(), proj.CountsAsClass<ThrowingDamageClass>(), true);
|
||||
PvpDebuffs(target, proj.CountsAsClass<MeleeDamageClass>(), proj.CountsAsClass<RangedDamageClass>(), proj.CountsAsClass<MagicDamageClass>(), proj.CountsAsClass<SummonDamageClass>(), proj.CountsAsClass<ThrowingDamageClass>(), true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -630,15 +630,6 @@ namespace CalamityMod.CalPlayer
|
||||
if (reaverDefense)
|
||||
Player.lifeRegenTime += 1;
|
||||
|
||||
if (Player.whoAmI == Main.myPlayer && desertProwler && crit && item.CountsAsClass<RangedDamageClass>())
|
||||
{
|
||||
bool noTornado = Player.ownedProjectileCounts[ProjectileType<DesertMark>()] < 1 && Player.ownedProjectileCounts[ProjectileType<DesertTornado>()] < 1;
|
||||
if (noTornado && Main.rand.NextBool(15))
|
||||
{
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<DesertMark>(), damage, item.knockBack, Player.whoAmI);
|
||||
}
|
||||
}
|
||||
|
||||
if (npcCheck)
|
||||
{
|
||||
if (item.CountsAsClass<MeleeDamageClass>() && aBulwarkRare && aBulwarkRareTimer == 0)
|
||||
@@ -771,7 +762,7 @@ namespace CalamityMod.CalPlayer
|
||||
RangedOnHit(proj, modProj, position, crit, npcCheck);
|
||||
if (proj.CountsAsClass<MagicDamageClass>())
|
||||
MagicOnHit(proj, modProj, position, crit, npcCheck);
|
||||
if (proj.IsSummon())
|
||||
if (proj.CountsAsClass<SummonDamageClass>() && !proj.CountsAsClass<SummonMeleeSpeedDamageClass>())
|
||||
SummonOnHit(proj, modProj, position, crit, npcCheck);
|
||||
if (proj.CountsAsClass<ThrowingDamageClass>())
|
||||
RogueOnHit(proj, modProj, position, crit, npcCheck);
|
||||
@@ -827,14 +818,6 @@ namespace CalamityMod.CalPlayer
|
||||
private void RangedOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck)
|
||||
{
|
||||
var source = proj.GetSource_FromThis();
|
||||
if (Player.whoAmI == Main.myPlayer && desertProwler && crit)
|
||||
{
|
||||
bool noTornado = Player.ownedProjectileCounts[ProjectileType<DesertMark>()] < 1 && Player.ownedProjectileCounts[ProjectileType<DesertTornado>()] < 1;
|
||||
if (noTornado && Main.rand.NextBool(15))
|
||||
{
|
||||
Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType<DesertMark>(), proj.damage, proj.knockBack, Player.whoAmI);
|
||||
}
|
||||
}
|
||||
|
||||
if (npcCheck)
|
||||
{
|
||||
@@ -919,6 +902,7 @@ namespace CalamityMod.CalPlayer
|
||||
private void SummonOnHit(Projectile proj, CalamityGlobalProjectile modProj, Vector2 position, bool crit, bool npcCheck)
|
||||
{
|
||||
var source = proj.GetSource_FromThis();
|
||||
|
||||
if (npcCheck)
|
||||
{
|
||||
if (phantomicArtifact)
|
||||
@@ -950,7 +934,7 @@ namespace CalamityMod.CalPlayer
|
||||
int damage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(75);
|
||||
int dagger = Projectile.NewProjectile(source, proj.position, proj.velocity, ProjectileType<PhantomicDagger>(), damage, 1f, Player.whoAmI, 0f);
|
||||
if (dagger.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[dagger].DamageType = DamageClass.Generic;
|
||||
Main.projectile[dagger].DamageType = DamageClass.Summon;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1008,7 +992,7 @@ namespace CalamityMod.CalPlayer
|
||||
int apparatusDamage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(60);
|
||||
int projectile = Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType<ApparatusExplosion>(), apparatusDamage, 4f, proj.owner);
|
||||
if (projectile.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[projectile].DamageType = DamageClass.Generic;
|
||||
Main.projectile[projectile].DamageType = DamageClass.Summon;
|
||||
jellyDmg = 100f;
|
||||
}
|
||||
else if (starbusterCore)
|
||||
@@ -1016,7 +1000,7 @@ namespace CalamityMod.CalPlayer
|
||||
int starburstDamage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(40);
|
||||
int projectile = Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType<SummonAstralExplosion>(), starburstDamage, 3.5f, proj.owner);
|
||||
if (projectile.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[projectile].DamageType = DamageClass.Generic;
|
||||
Main.projectile[projectile].DamageType = DamageClass.Summon;
|
||||
jellyDmg = 60f;
|
||||
}
|
||||
else if (nuclearRod)
|
||||
@@ -1024,7 +1008,7 @@ namespace CalamityMod.CalPlayer
|
||||
int nuclearDamage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(20);
|
||||
int projectile = Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType<IrradiatedAura>(), nuclearDamage, 0f, proj.owner);
|
||||
if (projectile.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[projectile].DamageType = DamageClass.Generic;
|
||||
Main.projectile[projectile].DamageType = DamageClass.Summon;
|
||||
jellyDmg = 60f;
|
||||
}
|
||||
else if (jellyChargedBattery)
|
||||
@@ -1045,7 +1029,7 @@ namespace CalamityMod.CalPlayer
|
||||
int hallowedDamage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(30);
|
||||
int projectile = Projectile.NewProjectile(source, spawnPosition, Vector2.Normalize(position - spawnPosition) * speed, ProjectileType<HallowedStarSummon>(), hallowedDamage, 3f, proj.owner);
|
||||
if (projectile.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[projectile].DamageType = DamageClass.Generic;
|
||||
Main.projectile[projectile].DamageType = DamageClass.Summon;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1178,7 +1162,10 @@ namespace CalamityMod.CalPlayer
|
||||
int featherDamage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(15);
|
||||
int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType<StickyFeather>(), featherDamage, 3f, proj.owner);
|
||||
if (feather.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[feather].DamageType = DamageClass.Generic;
|
||||
Main.projectile[feather].extraUpdates += 3;
|
||||
}
|
||||
}
|
||||
spawnedFeathers = true;
|
||||
}
|
||||
@@ -1251,55 +1238,17 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 5)
|
||||
{
|
||||
if (CalamityLists.javelinProjList.Contains(proj.type))
|
||||
{
|
||||
int randrot = Main.rand.Next(-30, 391);
|
||||
Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot));
|
||||
int soul = Projectile.NewProjectile(spawnSource, proj.Center, SoulSpeed, ProjectileType<PenumbraSoul>(), (int)(proj.damage * 0.1), 3f, proj.owner, 0f, 0f);
|
||||
if (soul.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[soul].DamageType = DamageClass.Generic;
|
||||
shadowPotCooldown = 30;
|
||||
}
|
||||
if (CalamityLists.spikyBallProjList.Contains(proj.type))
|
||||
{
|
||||
int scythe = Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<CosmicScythe>(), (int)(proj.damage * 0.05), 3f, proj.owner, 1f, 0f);
|
||||
if (scythe.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[scythe].DamageType = DamageClass.Generic;
|
||||
Main.projectile[scythe].usesLocalNPCImmunity = true;
|
||||
Main.projectile[scythe].localNPCHitCooldown = 10;
|
||||
Main.projectile[scythe].penetrate = 2;
|
||||
shadowPotCooldown = 30;
|
||||
}
|
||||
if (CalamityLists.daggerProjList.Contains(proj.type))
|
||||
{
|
||||
Vector2 shardVelocity = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f));
|
||||
shardVelocity.Normalize();
|
||||
shardVelocity *= 5f;
|
||||
int shard = Projectile.NewProjectile(spawnSource, proj.Center, shardVelocity, ProjectileType<EquanimityDarkShard>(), (int)(proj.damage * 0.15), 0f, proj.owner);
|
||||
if (shard.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[shard].DamageType = DamageClass.Generic;
|
||||
Main.projectile[shard].timeLeft = 150;
|
||||
shadowPotCooldown = 30;
|
||||
}
|
||||
if (CalamityLists.boomerangProjList.Contains(proj.type))
|
||||
{
|
||||
int spiritDamage = (int)(proj.damage * 0.2);
|
||||
Projectile ghost = CalamityUtils.SpawnOrb(proj, spiritDamage, ProjectileID.SpectreWrath, 800f, 4f);
|
||||
if (ghost.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
ghost.DamageType = DamageClass.Generic;
|
||||
ghost.penetrate = 1;
|
||||
}
|
||||
shadowPotCooldown = 30;
|
||||
}
|
||||
if (CalamityLists.flaskBombProjList.Contains(proj.type))
|
||||
{
|
||||
int blackhole = Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<ShadowBlackhole>(), (int)(proj.damage * 0.05), 3f, proj.owner, 0f, 0f);
|
||||
if (blackhole.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[blackhole].DamageType = DamageClass.Generic;
|
||||
Main.projectile[blackhole].Center = proj.Center;
|
||||
shadowPotCooldown = 30;
|
||||
}
|
||||
int randrot = Main.rand.Next(-30, 391);
|
||||
Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot));
|
||||
int soul = Projectile.NewProjectile(spawnSource, proj.Center, SoulSpeed, ProjectileType<PenumbraSoul>(), (int)(proj.damage * 0.1), 3f, proj.owner, 0f, 0f);
|
||||
if (soul.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[soul].DamageType = DamageClass.Generic;
|
||||
shadowPotCooldown = 30;
|
||||
}
|
||||
|
||||
if (raiderTalisman && modProj.stealthStrike)
|
||||
{
|
||||
raiderCritBonus = RaidersTalisman.RaiderBonus;
|
||||
}
|
||||
|
||||
if (npcCheck)
|
||||
@@ -1311,18 +1260,12 @@ namespace CalamityMod.CalPlayer
|
||||
int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50);
|
||||
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<UmbraphileBoom>(), umbraBlastDamage, 0f, Player.whoAmI);
|
||||
}
|
||||
|
||||
if (raiderTalisman && raiderStack < 150 && crit && raiderCooldown <= 0)
|
||||
{
|
||||
raiderStack++;
|
||||
raiderCooldown = 30;
|
||||
}
|
||||
if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 5)
|
||||
{
|
||||
for (int s = 0; s < 3; s++)
|
||||
{
|
||||
Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f);
|
||||
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(20);
|
||||
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(15);
|
||||
int spark = Projectile.NewProjectile(spawnSource, position, velocity, ProjectileType<Spark>(), damage, 0f, Player.whoAmI);
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
@@ -1405,7 +1348,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (corrosiveSpine)
|
||||
{
|
||||
target.AddBuff(BuffID.Venom, 240);
|
||||
target.AddBuff(BuffID.Poisoned, 240);
|
||||
}
|
||||
if (aWeapon)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace CalamityMod.CalPlayer.Dashes
|
||||
{
|
||||
public static new string ID => "Godslayer Armor";
|
||||
|
||||
public static int GodslayerCooldown = 45;
|
||||
|
||||
public override DashCollisionType CollisionType => DashCollisionType.ShieldSlam;
|
||||
|
||||
public override bool IsOmnidirectional => true;
|
||||
@@ -63,7 +65,7 @@ namespace CalamityMod.CalPlayer.Dashes
|
||||
runSpeedDecelerationFactor = 0.8f;
|
||||
|
||||
// Cooldown for God Slayer Armor dash.
|
||||
player.AddCooldown(Cooldowns.GodSlayerDash.ID, CalamityUtils.SecondsToFrames(35));
|
||||
player.AddCooldown(Cooldowns.GodSlayerDash.ID, CalamityUtils.SecondsToFrames(GodslayerCooldown));
|
||||
player.Calamity().godSlayerDashHotKeyPressed = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,17 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
return;
|
||||
|
||||
Player drawPlayer = drawInfo.drawPlayer;
|
||||
int bodyItem = drawPlayer.armor[1].type;
|
||||
Item bodyItem = drawPlayer.armor[1];
|
||||
if (drawPlayer.armor[11].type > ItemID.None)
|
||||
bodyItem = drawPlayer.armor[11].type;
|
||||
bodyItem = drawPlayer.armor[11];
|
||||
|
||||
if (ModContent.GetModItem(bodyItem) is IBulkyArmor chestplateBulkDrawer)
|
||||
if (ModContent.GetModItem(bodyItem.type) is IBulkyArmor chestplateBulkDrawer)
|
||||
{
|
||||
string equipSlotName = chestplateBulkDrawer.EquipSlotName(drawPlayer) != "" ? chestplateBulkDrawer.EquipSlotName(drawPlayer) : bodyItem.ModItem.Name;
|
||||
int equipSlot = EquipLoader.GetEquipSlot(Mod, equipSlotName, EquipType.Body);
|
||||
if (drawPlayer.body != equipSlot)
|
||||
return;
|
||||
|
||||
int dyeShader = drawPlayer.dye?[1].dye ?? 0;
|
||||
Vector2 drawPosition = drawInfo.Position - Main.screenPosition;
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.CalPlayer.DrawLayers
|
||||
{
|
||||
|
||||
//Draws the front arm of the armor over the shoulderpad when walking.
|
||||
public class FrontARmOverShoulderpadLayer : PlayerDrawLayer
|
||||
{
|
||||
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.ArmOverItem);
|
||||
|
||||
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) => drawInfo.shadow == 0f || !drawInfo.drawPlayer.dead;
|
||||
|
||||
protected override void Draw(ref PlayerDrawSet drawInfo)
|
||||
{
|
||||
Player drawPlayer = drawInfo.drawPlayer;
|
||||
Item bodyItem = drawPlayer.armor[1];
|
||||
if (drawPlayer.armor[11].type > ItemID.None)
|
||||
bodyItem = drawPlayer.armor[11];
|
||||
|
||||
if (ModContent.GetModItem(bodyItem.type) is IDrawArmOverShoulderpad frontArmDrawer)
|
||||
{
|
||||
string equipSlotName = frontArmDrawer.EquipSlotName(drawPlayer) != "" ? frontArmDrawer.EquipSlotName(drawPlayer) : bodyItem.ModItem.Name;
|
||||
int equipSlot = EquipLoader.GetEquipSlot(Mod, equipSlotName, EquipType.Body);
|
||||
if (drawPlayer.body != equipSlot)
|
||||
return;
|
||||
|
||||
|
||||
int dyeShader = drawPlayer.dye?[1].dye ?? 0;
|
||||
Vector2 drawPosition = drawInfo.Position - Main.screenPosition;
|
||||
|
||||
// Using drawPlayer to get width & height and such is perfectly fine, on the other hand. Just center everything
|
||||
drawPosition += new Vector2((drawPlayer.width - drawPlayer.bodyFrame.Width) / 2f, drawPlayer.height - drawPlayer.bodyFrame.Height + 4f);
|
||||
|
||||
//Convert to int to remove the jitter.
|
||||
drawPosition = new Vector2((int)drawPosition.X, (int)drawPosition.Y);
|
||||
|
||||
//Some dispalcements
|
||||
drawPosition += drawPlayer.bodyPosition + drawInfo.bodyVect;
|
||||
|
||||
//Grab the extension texture
|
||||
Texture2D extraPieceTexture = ModContent.Request<Texture2D>(frontArmDrawer.FrontArmTexture).Value;
|
||||
|
||||
//Get the frame of the extension based on the players body frame
|
||||
Rectangle frame = extraPieceTexture.Frame(1, 20, 0, drawPlayer.bodyFrame.Y / drawPlayer.bodyFrame.Height);
|
||||
|
||||
DrawData pieceDrawData = new DrawData(extraPieceTexture, drawPosition, frame, drawInfo.colorArmorBody, drawPlayer.fullRotation, drawInfo.bodyVect, 1f, drawInfo.playerEffect, 0)
|
||||
{
|
||||
shader = dyeShader
|
||||
};
|
||||
drawInfo.DrawDataCache.Add(pieceDrawData);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,14 +15,19 @@ namespace CalamityMod.CalPlayer.DrawLayers
|
||||
|
||||
protected override void Draw(ref PlayerDrawSet drawInfo)
|
||||
{
|
||||
//Todo : Make this work even for accessories by somehow checking for the players.head equipslot's item instead of the head item.
|
||||
Player drawPlayer = drawInfo.drawPlayer;
|
||||
int headItemType = drawPlayer.armor[0].type;
|
||||
if (drawPlayer.armor[10].type > ItemID.None)
|
||||
headItemType = drawPlayer.armor[10].type;
|
||||
Item headItem = drawPlayer.armor[0];
|
||||
|
||||
if (ModContent.GetModItem(headItemType) is IExtendedHat extendedHatDrawer)
|
||||
if (drawPlayer.armor[10].type > ItemID.None)
|
||||
headItem = drawPlayer.armor[10];
|
||||
|
||||
if (ModContent.GetModItem(headItem.type) is IExtendedHat extendedHatDrawer)
|
||||
{
|
||||
if (extendedHatDrawer.PreDrawExtension(drawInfo) && !drawInfo.drawPlayer.dead)
|
||||
string equipSlotName = extendedHatDrawer.EquipSlotName(drawPlayer) != "" ? extendedHatDrawer.EquipSlotName(drawPlayer) : headItem.ModItem.Name;
|
||||
int equipSlot = EquipLoader.GetEquipSlot(Mod, equipSlotName, EquipType.Head);
|
||||
|
||||
if (extendedHatDrawer.PreDrawExtension(drawInfo) && !drawInfo.drawPlayer.dead && equipSlot == drawPlayer.head)
|
||||
{
|
||||
int dyeShader = drawPlayer.dye?[0].dye ?? 0;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
|
||||
/// <summary>
|
||||
/// Interface that can be used by chestplates to appear extra bulky, by drawing partly over the players helmet with an extra layer
|
||||
@@ -11,4 +12,10 @@ public interface IBulkyArmor
|
||||
/// This should be the same size as a regular equipped sprite (20 x 560 in 1x1)
|
||||
/// </summary>
|
||||
string BulkTexture { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the equip slot for the item. If left empty, the equip slot that is looked for will use the name of the item.
|
||||
/// Useful if you have multiple body textures you need to add bulk to.
|
||||
/// </summary>
|
||||
string EquipSlotName(Player drawPlayer) => "";
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
|
||||
/// <summary>
|
||||
/// Interface that can be used by chestplates that need their front arm (when walking) to go over the shoulderpads
|
||||
/// </summary>
|
||||
public interface IDrawArmOverShoulderpad
|
||||
{
|
||||
/// <summary>
|
||||
/// The texture of the part that goes above the shoulderpads
|
||||
/// This should be the same size as a regular equipped sprite (20 x 560 in 1x1)
|
||||
/// </summary>
|
||||
string FrontArmTexture { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the equip slot for the item. If left empty, the equip slot that is looked for will use the name of the item.
|
||||
/// Useful if you have multiple head textures you need to extend.
|
||||
/// </summary>
|
||||
string EquipSlotName(Player drawPlayer) => "";
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
|
||||
public interface IExtendedHat
|
||||
{
|
||||
@@ -15,4 +16,10 @@ public interface IExtendedHat
|
||||
///Return true to make the extension get drawn automatically from the texture and offsets provided. Return false if you want to draw it yourself
|
||||
/// </summary>
|
||||
bool PreDrawExtension(PlayerDrawSet drawInfo) => true;
|
||||
|
||||
/// <summary>
|
||||
/// The name of the equip slot for the item. If left empty, the equip slot that is looked for will use the name of the item.
|
||||
/// Useful if you have multiple head textures you need to extend.
|
||||
/// </summary>
|
||||
string EquipSlotName(Player drawPlayer) => "";
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
|
||||
/// <summary>
|
||||
/// Interface that can be used by items that need to hide the players front arm when held.
|
||||
/// Useful for prosthesis type items.
|
||||
/// </summary>
|
||||
public interface IHideFrontArm
|
||||
{
|
||||
/// <summary>
|
||||
/// When should the arm be hidden. Defauls to always
|
||||
/// </summary>
|
||||
bool ShouldHideArm(Player player) => true;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod.Items.PermanentBoosters;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
@@ -70,6 +71,12 @@ namespace CalamityMod
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.ShopNewAlert")]
|
||||
public bool ShopNewAlert { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.WikiStatusMessage")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.WikiStatusMessage")]
|
||||
public bool WikiStatusMessage { get; set; }
|
||||
#endregion
|
||||
|
||||
#region UI Changes
|
||||
@@ -179,18 +186,18 @@ namespace CalamityMod
|
||||
#region General Gameplay Changes
|
||||
[Header("$Mods.CalamityMod.Config.SectionTitle.Gameplay")]
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.RemoveReforgeRNG")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.RemoveReforgeRNG")]
|
||||
public bool RemoveReforgeRNG { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.EarlyHardmodeProgressionRework")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.EarlyHardmodeProgressionRework")]
|
||||
public bool EarlyHardmodeProgressionRework { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.Proficiency")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.Proficiency")]
|
||||
public bool Proficiency { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.BossZen")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
@@ -229,6 +236,41 @@ namespace CalamityMod
|
||||
public float BossHealthBoost { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Default Player Stat Boosts
|
||||
[Header("$Mods.CalamityMod.Config.SectionTitle.BaseBoosts")]
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterBaseSpeed")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterBaseSpeed")]
|
||||
public bool FasterBaseSpeed { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.HigherJumpHeight")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.HigherJumpHeight")]
|
||||
public bool HigherJumpHeight { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterJumpSpeed")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterJumpSpeed")]
|
||||
public bool FasterJumpSpeed { get; set; }
|
||||
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterFallHotkey")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterFallHotkey")]
|
||||
public bool FasterFallHotkey { get; set; }
|
||||
|
||||
[Label("$Mods.CalamityMod.Config.EntryTitle.FasterTilePlacement")]
|
||||
[BackgroundColor(192, 54, 64, 192)]
|
||||
[DefaultValue(true)]
|
||||
[Tooltip("$Mods.CalamityMod.Config.EntryTooltip.FasterTilePlacement")]
|
||||
public bool FasterTilePlacement { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Expert and Master Mode Changes
|
||||
[Header("$Mods.CalamityMod.Config.SectionTitle.ExpertMaster")]
|
||||
|
||||
@@ -338,6 +380,7 @@ namespace CalamityMod
|
||||
new("ParticleLimit", ItemID.FragmentStardust),
|
||||
new("StealthInvisibility", ModContent.ItemType<StealthHairDye>()),
|
||||
new("ShopNewAlert", ItemID.GoldChest),
|
||||
new("WikiStatusMessage", ItemID.Book),
|
||||
|
||||
new("BossHealthBarExtraInfo", ModContent.ItemType<EncryptedSchematicPlanetoid>()),
|
||||
new("DebuffDisplay", ItemID.FlaskofIchor),
|
||||
@@ -357,18 +400,24 @@ namespace CalamityMod
|
||||
new("SpeedrunTimerPosX", ItemID.LaserRuler),
|
||||
new("SpeedrunTimerPosY", ItemID.LaserRuler),
|
||||
|
||||
new("RemoveReforgeRNG", ItemID.TinHammer),
|
||||
new("EarlyHardmodeProgressionRework", ItemID.Pwnhammer),
|
||||
new("Proficiency", ModContent.ItemType<MagicLevelMeter>()),
|
||||
new("BossZen", ModContent.ItemType<ZenPotion>()),
|
||||
new("TownNPCsSpawnAtNight", ItemID.ClothierVoodooDoll),
|
||||
new("TownNPCSpawnRateMultiplier", ItemID.GuideVoodooDoll),
|
||||
new("BossHealthBoost", ItemID.LifeCrystal),
|
||||
|
||||
new("FasterBaseSpeed", ItemID.HermesBoots),
|
||||
new("HigherJumpHeight", ItemID.ShinyRedBalloon),
|
||||
new("FasterJumpSpeed", ItemID.FrogLeg),
|
||||
new("FasterFallHotkey", ModContent.ItemType<BallAndChain>()),
|
||||
new("FasterTilePlacement", ItemID.ArchitectGizmoPack),
|
||||
|
||||
new("NerfExpertDebuffs", ItemID.AnkhCharm),
|
||||
new("ChilledWaterRework", ItemID.ArcticDivingGear),
|
||||
new("ForceTownSafety", ItemID.Sunflower),
|
||||
|
||||
new("RipperMeterShake", ModContent.ItemType<RevengeanceModeItem>()),
|
||||
new("RipperMeterShake", ModContent.ItemType<RedLightningContainer>()),
|
||||
new("RageMeterPosX", ItemID.LaserRuler),
|
||||
new("RageMeterPosY", ItemID.LaserRuler),
|
||||
new("AdrenalineMeterPosX", ItemID.LaserRuler),
|
||||
|
||||
@@ -109,16 +109,6 @@ namespace CalamityMod
|
||||
public static List<int> needsDebuffIconDisplayList;
|
||||
public static List<int> trapProjectileList;
|
||||
public static List<int> scopedWeaponList;
|
||||
public static List<int> boomerangList;
|
||||
public static List<int> javelinList;
|
||||
public static List<int> daggerList;
|
||||
public static List<int> flaskBombList;
|
||||
public static List<int> spikyBallList;
|
||||
public static List<int> boomerangProjList;
|
||||
public static List<int> javelinProjList;
|
||||
public static List<int> daggerProjList;
|
||||
public static List<int> flaskBombProjList;
|
||||
public static List<int> spikyBallProjList;
|
||||
public static List<int> lavaFishList;
|
||||
public static List<int> highTestFishList;
|
||||
public static List<int> flamethrowerList;
|
||||
@@ -133,7 +123,6 @@ namespace CalamityMod
|
||||
public static List<int> mossHornetList;
|
||||
public static List<int> bossMinionList;
|
||||
public static List<int> minibossList;
|
||||
public static List<int> heartDropBlockList;
|
||||
public static List<int> pierceResistList;
|
||||
public static List<int> pierceResistExceptionList;
|
||||
|
||||
@@ -151,6 +140,8 @@ namespace CalamityMod
|
||||
public static List<int> AresIDs;
|
||||
public static List<int> SkeletronPrimeIDs;
|
||||
public static List<int> StormWeaverIDs;
|
||||
public static List<int> RavagerIDs;
|
||||
public static List<int> GolemIDs;
|
||||
public static List<int> BoundNPCIDs;
|
||||
|
||||
public static List<int> GrenadeResistIDs;
|
||||
@@ -279,7 +270,6 @@ namespace CalamityMod
|
||||
"Cameron",
|
||||
"Orudeon",
|
||||
"BumbleDoge",
|
||||
"John",
|
||||
"Naglfar",
|
||||
"Helixas",
|
||||
"Vetus",
|
||||
@@ -520,7 +510,8 @@ namespace CalamityMod
|
||||
"Himakaze",
|
||||
"Face",
|
||||
"Carboniferous",
|
||||
"James"
|
||||
"James",
|
||||
"Taitou1"
|
||||
};
|
||||
|
||||
projectileDestroyExceptionList = new List<int>()
|
||||
@@ -1329,301 +1320,6 @@ namespace CalamityMod
|
||||
ItemType<TyrannysEnd>()
|
||||
};
|
||||
|
||||
boomerangList = new List<int>()
|
||||
{
|
||||
ItemType<Brimblade>(),
|
||||
ItemType<BlazingStar>(),
|
||||
ItemType<Celestus>(),
|
||||
ItemType<ElementalDisk>(),
|
||||
ItemType<EnchantedAxe>(),
|
||||
ItemType<EpidemicShredder>(),
|
||||
ItemType<Equanimity>(),
|
||||
ItemType<Eradicator>(),
|
||||
ItemType<SubductionSlicer>(),
|
||||
ItemType<Glaive>(),
|
||||
ItemType<GhoulishGouger>(),
|
||||
ItemType<Icebreaker>(),
|
||||
ItemType<KelvinCatalyst>(),
|
||||
ItemType<Kylie>(),
|
||||
ItemType<MangroveChakram>(),
|
||||
ItemType<MoltenAmputator>(),
|
||||
ItemType<NanoblackReaper>(),
|
||||
ItemType<SandDollar>(),
|
||||
ItemType<FishboneBoomerang>(),
|
||||
ItemType<InfestedClawmerang>(),
|
||||
ItemType<Valediction>(),
|
||||
ItemType<FrostcrushValari>(),
|
||||
ItemType<DefectiveSphere>(),
|
||||
ItemType<TerraDisk>(),
|
||||
ItemType<ToxicantTwister>(),
|
||||
ItemType<TrackingDisk>()
|
||||
};
|
||||
|
||||
boomerangProjList = new List<int>()
|
||||
{
|
||||
ProjectileType<ElementalDiskProj>(),
|
||||
ProjectileType<ElementalDiskSplit>(),
|
||||
ProjectileType<BlazingStarProj>(),
|
||||
ProjectileType<CelestusBoomerang>(),
|
||||
ProjectileType<BrimbladeProj>(),
|
||||
ProjectileType<Brimblade2>(),
|
||||
ProjectileType<EnchantedAxeProj>(),
|
||||
ProjectileType<EpidemicShredderProjectile>(),
|
||||
ProjectileType<EquanimityProj>(),
|
||||
ProjectileType<EradicatorProjectile>(),
|
||||
ProjectileType<SubductionSlicerProj>(),
|
||||
ProjectileType<GhoulishGougerBoomerang>(),
|
||||
ProjectileType<GlaiveProj>(),
|
||||
ProjectileType<KylieBoomerang>(),
|
||||
ProjectileType<MangroveChakramProjectile>(),
|
||||
ProjectileType<MoltenAmputatorProj>(),
|
||||
ProjectileType<FallenPaladinsHammerProj>(),
|
||||
ProjectileType<SandDollarProj>(),
|
||||
ProjectileType<SandDollarStealth>(),
|
||||
ProjectileType<FishboneBoomerangProjectile>(),
|
||||
ProjectileType<InfestedClawmerangProj>(),
|
||||
ProjectileType<TriactisHammerProj>(),
|
||||
ProjectileType<ValedictionBoomerang>(),
|
||||
ProjectileType<GalaxySmasherHammer>(),
|
||||
ProjectileType<KelvinCatalystBoomerang>(),
|
||||
ProjectileType<NanoblackMain>(),
|
||||
ProjectileType<StellarContemptHammer>(),
|
||||
ProjectileType<IcebreakerHammer>(),
|
||||
ProjectileType<PwnagehammerProj>(),
|
||||
ProjectileType<ValariBoomerang>(),
|
||||
ProjectileType<SphereSpiked>(),
|
||||
ProjectileType<SphereBladed>(),
|
||||
ProjectileType<SphereYellow>(),
|
||||
ProjectileType<ButcherKnife>(),
|
||||
ProjectileType<TerraDiskProjectile>(),
|
||||
ProjectileType<TerraDiskProjectile2>(),
|
||||
ProjectileType<ToxicantTwisterTwoPointZero>(),
|
||||
ProjectileType<TrackingDiskProjectile>()
|
||||
};
|
||||
|
||||
javelinList = new List<int>()
|
||||
{
|
||||
ItemType<CrystalPiercer>(),
|
||||
ItemType<PalladiumJavelin>(),
|
||||
ItemType<WaveSkipper>(),
|
||||
ItemType<EclipsesFall>(),
|
||||
ItemType<IchorSpear>(),
|
||||
ItemType<Wrathwing>(),
|
||||
ItemType<LuminousStriker>(),
|
||||
ItemType<ScarletDevil>(),
|
||||
ItemType<ScourgeoftheDesert>(),
|
||||
ItemType<ScourgeoftheSeas>(),
|
||||
ItemType<SpearofDestiny>(),
|
||||
ItemType<SpearofPaleolith>(),
|
||||
ItemType<ShardofAntumbra>(),
|
||||
ItemType<PhantasmalRuin>(),
|
||||
ItemType<PhantomLance>(),
|
||||
ItemType<ProfanedPartisan>(),
|
||||
ItemType<Turbulance>(),
|
||||
ItemType<NightsGaze>(),
|
||||
ItemType<FrequencyManipulator>(),
|
||||
ItemType<TheAtomSplitter>()
|
||||
};
|
||||
|
||||
javelinProjList = new List<int>()
|
||||
{
|
||||
ProjectileType<CrystalPiercerProjectile>(),
|
||||
ProjectileType<DuneHopperProjectile>(),
|
||||
ProjectileType<EclipsesFallMain>(),
|
||||
ProjectileType<EclipsesStealth>(),
|
||||
ProjectileType<IchorSpearProj>(),
|
||||
ProjectileType<WrathwingSpear>(),
|
||||
ProjectileType<LuminousStrikerProj>(),
|
||||
ProjectileType<PalladiumJavelinProjectile>(),
|
||||
ProjectileType<PhantasmalRuinProj>(),
|
||||
ProjectileType<PhantomLanceProj>(),
|
||||
ProjectileType<ProfanedPartisanProj>(),
|
||||
ProjectileType<ScarletDevilProjectile>(),
|
||||
ProjectileType<ScourgeoftheDesertProj>(),
|
||||
ProjectileType<ScourgeoftheSeasProjectile>(),
|
||||
ProjectileType<ScourgeoftheCosmosProj>(),
|
||||
ProjectileType<SpearofDestinyProjectile>(),
|
||||
ProjectileType<SpearofPaleolithProj>(),
|
||||
ProjectileType<AntumbraShardProjectile>(),
|
||||
ProjectileType<TurbulanceProjectile>(),
|
||||
ProjectileType<NightsGazeProjectile>(),
|
||||
ProjectileType<FrequencyManipulatorProjectile>(),
|
||||
ProjectileType<TheAtomSplitterProjectile>()
|
||||
};
|
||||
|
||||
daggerList = new List<int>()
|
||||
{
|
||||
ItemType<AshenStalactite>(),
|
||||
ItemType<CobaltKunai>(),
|
||||
ItemType<FeatherKnife>(),
|
||||
ItemType<GelDart>(),
|
||||
ItemType<MonkeyDarts>(),
|
||||
ItemType<MythrilKnife>(),
|
||||
ItemType<OrichalcumSpikedGemstone>(),
|
||||
ItemType<TarragonThrowingDart>(),
|
||||
ItemType<WulfrumKnife>(),
|
||||
ItemType<Cinquedea>(),
|
||||
ItemType<CosmicKunai>(),
|
||||
ItemType<CorpusAvertor>(),
|
||||
ItemType<Crystalline>(),
|
||||
ItemType<CursedDagger>(),
|
||||
ItemType<Malachite>(),
|
||||
ItemType<Mycoroot>(),
|
||||
ItemType<Prismalline>(),
|
||||
ItemType<RadiantStar>(),
|
||||
ItemType<ShatteredSun>(),
|
||||
ItemType<StellarKnife>(),
|
||||
ItemType<StormfrontRazor>(),
|
||||
ItemType<TimeBolt>(),
|
||||
ItemType<LunarKunai>(),
|
||||
ItemType<GildedDagger>(),
|
||||
ItemType<GleamingDagger>(),
|
||||
ItemType<InfernalKris>(),
|
||||
ItemType<UtensilPoker>(),
|
||||
ItemType<ShinobiBlade>(),
|
||||
ItemType<JawsOfOblivion>(),
|
||||
ItemType<LeviathanTeeth>(),
|
||||
ItemType<DeificThunderbolt>(),
|
||||
ItemType<Sacrifice>(),
|
||||
ItemType<Seraphim>()
|
||||
};
|
||||
|
||||
daggerProjList = new List<int>()
|
||||
{
|
||||
ProjectileType<AshenStalactiteProj>(),
|
||||
ProjectileType<AshenStalagmiteProj>(),
|
||||
ProjectileType<CinquedeaProj>(),
|
||||
ProjectileType<CobaltKunaiProjectile>(),
|
||||
ProjectileType<CosmicKunaiProj>(),
|
||||
ProjectileType<CrystallineProj>(),
|
||||
ProjectileType<Crystalline2>(),
|
||||
ProjectileType<CursedDaggerProj>(),
|
||||
ProjectileType<EmpyreanKnife>(),
|
||||
ProjectileType<FeatherKnifeProjectile>(),
|
||||
ProjectileType<GelDartProjectile>(),
|
||||
ProjectileType<GildedDaggerProj>(),
|
||||
ProjectileType<GleamingDaggerProj>(),
|
||||
ProjectileType<IllustriousKnife>(),
|
||||
ProjectileType<LunarKunaiProj>(),
|
||||
ProjectileType<MalachiteProj>(),
|
||||
ProjectileType<MalachiteBolt>(),
|
||||
ProjectileType<MalachiteStealth>(),
|
||||
ProjectileType<MonkeyDart>(),
|
||||
ProjectileType<MycorootProj>(),
|
||||
ProjectileType<MythrilKnifeProjectile>(),
|
||||
ProjectileType<OrichalcumSpikedGemstoneProjectile>(),
|
||||
ProjectileType<PrismallineProj>(),
|
||||
ProjectileType<Prismalline2>(),
|
||||
ProjectileType<Prismalline3>(),
|
||||
ProjectileType<RadiantStarKnife>(),
|
||||
ProjectileType<RadiantStar2>(),
|
||||
ProjectileType<ShatteredSunKnife>(),
|
||||
ProjectileType<StellarKnifeProj>(),
|
||||
ProjectileType<StormfrontRazorProjectile>(),
|
||||
ProjectileType<TarragonThrowingDartProjectile>(),
|
||||
ProjectileType<TimeBoltKnife>(),
|
||||
ProjectileType<WulfrumKnifeProj>(),
|
||||
ProjectileType<Fork>(),
|
||||
ProjectileType<Knife>(),
|
||||
ProjectileType<CarvingFork>(),
|
||||
ProjectileType<InfernalKrisProjectile>(),
|
||||
ProjectileType<ShinobiBladeProjectile>(),
|
||||
ProjectileType<JawsProjectile>(),
|
||||
ProjectileType<LeviathanTooth>(),
|
||||
ProjectileType<DeificThunderboltProj>(),
|
||||
ProjectileType<SacrificeProjectile>(),
|
||||
ProjectileType<SeraphimProjectile>()
|
||||
};
|
||||
|
||||
flaskBombList = new List<int>()
|
||||
{
|
||||
ItemType<Plaguenade>(),
|
||||
ItemType<BallisticPoisonBomb>(),
|
||||
ItemType<BrackishFlask>(),
|
||||
ItemType<DuststormInABottle>(),
|
||||
ItemType<SeafoamBomb>(),
|
||||
ItemType<ConsecratedWater>(),
|
||||
ItemType<DesecratedWater>(),
|
||||
ItemType<TotalityBreakers>(),
|
||||
ItemType<BlastBarrel>(),
|
||||
ItemType<Penumbra>(),
|
||||
ItemType<Supernova>(),
|
||||
ItemType<ShockGrenade>(),
|
||||
ItemType<Exorcism>(),
|
||||
ItemType<MeteorFist>(),
|
||||
ItemType<StarofDestruction>(),
|
||||
ItemType<CraniumSmasher>(),
|
||||
ItemType<ContaminatedBile>(),
|
||||
ItemType<AcidicRainBarrel>(),
|
||||
ItemType<SkyfinBombers>(),
|
||||
ItemType<SpentFuelContainer>(),
|
||||
ItemType<SealedSingularity>(),
|
||||
ItemType<PlasmaGrenade>(),
|
||||
ItemType<WavePounder>()
|
||||
};
|
||||
|
||||
flaskBombProjList = new List<int>()
|
||||
{
|
||||
ProjectileType<BallisticPoisonBombProj>(),
|
||||
ProjectileType<BlastBarrelProjectile>(),
|
||||
ProjectileType<BrackishFlaskProj>(),
|
||||
ProjectileType<DuststormInABottleProj>(),
|
||||
ProjectileType<PlaguenadeProj>(),
|
||||
ProjectileType<SeafoamBombProj>(),
|
||||
ProjectileType<TotalityFlask>(),
|
||||
ProjectileType<ConsecratedWaterProjectile>(),
|
||||
ProjectileType<DesecratedWaterProj>(),
|
||||
ProjectileType<PenumbraBomb>(),
|
||||
ProjectileType<SupernovaBomb>(),
|
||||
ProjectileType<ShockGrenadeProjectile>(),
|
||||
ProjectileType<ExorcismProj>(),
|
||||
ProjectileType<MeteorFistProj>(),
|
||||
ProjectileType<CraniumSmasherProj>(),
|
||||
ProjectileType<CraniumSmasherExplosive>(),
|
||||
ProjectileType<CraniumSmasherStealth>(),
|
||||
ProjectileType<DestructionStar>(),
|
||||
ProjectileType<DestructionBolt>(),
|
||||
ProjectileType<ContaminatedBileFlask>(),
|
||||
ProjectileType<GreenDonkeyKongReference>(),
|
||||
ProjectileType<SkyfinNuke>(),
|
||||
ProjectileType<SpentFuelContainerProjectile>(),
|
||||
ProjectileType<SealedSingularityProj>(),
|
||||
ProjectileType<PlasmaGrenadeProjectile>(),
|
||||
ProjectileType<WavePounderProjectile>()
|
||||
};
|
||||
|
||||
spikyBallList = new List<int>()
|
||||
{
|
||||
ItemType<BouncySpikyBall>(),
|
||||
ItemType<GodsParanoia>(),
|
||||
ItemType<NastyCholla>(),
|
||||
ItemType<HellsSun>(),
|
||||
ItemType<SkyStabber>(),
|
||||
ItemType<StickySpikyBall>(),
|
||||
ItemType<WebBall>(),
|
||||
ItemType<PoisonPack>(),
|
||||
ItemType<Nychthemeron>(),
|
||||
ItemType<MetalMonstrosity>(),
|
||||
ItemType<BurningStrife>(),
|
||||
ItemType<SystemBane>()
|
||||
};
|
||||
|
||||
spikyBallProjList = new List<int>()
|
||||
{
|
||||
ProjectileType<BouncyBol>(),
|
||||
ProjectileType<GodsParanoiaProj>(),
|
||||
ProjectileType<HellsSunProj>(),
|
||||
ProjectileType<NastyChollaBol>(),
|
||||
ProjectileType<StickyBol>(),
|
||||
ProjectileType<SkyStabberProj>(),
|
||||
ProjectileType<WebBallBol>(),
|
||||
ProjectileType<PoisonBol>(),
|
||||
ProjectileType<NychthemeronProjectile>(),
|
||||
ProjectileType<MetalChunk>(),
|
||||
ProjectileType<BurningStrifeProj>(),
|
||||
ProjectileType<SystemBaneProjectile>()
|
||||
};
|
||||
|
||||
highTestFishList = new List<int>()
|
||||
{
|
||||
ItemID.GoldenFishingRod,
|
||||
@@ -1673,7 +1369,7 @@ namespace CalamityMod
|
||||
ItemType<KnowledgeSulphurSea>(),
|
||||
ItemType<KnowledgeOcean>(),
|
||||
ItemType<KnowledgeOldDuke>(),
|
||||
ItemType<VictoryShard>(),
|
||||
ItemType<PearlShard>(),
|
||||
ItemType<AeroStone>(),
|
||||
ItemType<TheCommunity>(),
|
||||
ItemType<DukesDecapitator>(),
|
||||
@@ -1882,25 +1578,6 @@ namespace CalamityMod
|
||||
NPCID.MartianSaucerTurret,
|
||||
};
|
||||
|
||||
heartDropBlockList = new List<int>()
|
||||
{
|
||||
NPCID.ServantofCthulhu,
|
||||
NPCID.TheHungryII,
|
||||
NPCID.LeechHead,
|
||||
NPCID.LeechBody,
|
||||
NPCID.LeechTail,
|
||||
NPCID.QueenSlimeMinionBlue,
|
||||
NPCID.QueenSlimeMinionPink,
|
||||
NPCID.QueenSlimeMinionPurple,
|
||||
NPCID.Probe,
|
||||
NPCID.Bee,
|
||||
NPCID.BeeSmall,
|
||||
NPCID.PlanterasTentacle,
|
||||
NPCID.Sharkron,
|
||||
NPCID.Sharkron2,
|
||||
NPCType<DarkEnergy>()
|
||||
};
|
||||
|
||||
pierceResistList = new List<int>()
|
||||
{
|
||||
NPCID.EaterofWorldsHead,
|
||||
@@ -2129,6 +1806,26 @@ namespace CalamityMod
|
||||
NPCType<StormWeaverTail>()
|
||||
};
|
||||
|
||||
// Purposefully does not include the freed head
|
||||
RavagerIDs = new List<int>
|
||||
{
|
||||
NPCType<RavagerBody>(),
|
||||
NPCType<RavagerClawLeft>(),
|
||||
NPCType<RavagerClawRight>(),
|
||||
NPCType<RavagerLegLeft>(),
|
||||
NPCType<RavagerLegRight>(),
|
||||
NPCType<RavagerHead>()
|
||||
};
|
||||
|
||||
GolemIDs = new List<int>
|
||||
{
|
||||
NPCID.Golem,
|
||||
NPCID.GolemHead,
|
||||
NPCID.GolemHeadFree,
|
||||
NPCID.GolemFistLeft,
|
||||
NPCID.GolemFistRight
|
||||
};
|
||||
|
||||
GrenadeResistIDs = new List<int>
|
||||
{
|
||||
ProjectileID.Grenade,
|
||||
@@ -2721,16 +2418,6 @@ namespace CalamityMod
|
||||
needsDebuffIconDisplayList = null;
|
||||
trapProjectileList = null;
|
||||
scopedWeaponList = null;
|
||||
boomerangList = null;
|
||||
javelinList = null;
|
||||
daggerList = null;
|
||||
flaskBombList = null;
|
||||
spikyBallList = null;
|
||||
boomerangProjList = null;
|
||||
javelinProjList = null;
|
||||
daggerProjList = null;
|
||||
flaskBombProjList = null;
|
||||
spikyBallProjList = null;
|
||||
lavaFishList = null;
|
||||
highTestFishList = null;
|
||||
flamethrowerList = null;
|
||||
@@ -2745,7 +2432,6 @@ namespace CalamityMod
|
||||
mossHornetList = null;
|
||||
bossMinionList = null;
|
||||
minibossList = null;
|
||||
heartDropBlockList = null;
|
||||
pierceResistList = null;
|
||||
pierceResistExceptionList = null;
|
||||
|
||||
@@ -2763,6 +2449,8 @@ namespace CalamityMod
|
||||
AresIDs = null;
|
||||
SkeletronPrimeIDs = null;
|
||||
StormWeaverIDs = null;
|
||||
RavagerIDs = null;
|
||||
GolemIDs = null;
|
||||
BoundNPCIDs = null;
|
||||
GrenadeResistIDs = null;
|
||||
ZeroContactDamageNPCList = null;
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
using CalamityMod.Balancing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.CalPlayer;
|
||||
@@ -11,10 +17,15 @@ using CalamityMod.FluidSimulation;
|
||||
using CalamityMod.ILEditing;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Dyes.HairDye;
|
||||
using CalamityMod.Items.PermanentBoosters;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Localization;
|
||||
using CalamityMod.NPCs.AdultEidolonWyrm;
|
||||
using CalamityMod.NPCs.AquaticScourge;
|
||||
using CalamityMod.NPCs.Astral;
|
||||
using CalamityMod.NPCs.AstrumAureus;
|
||||
using CalamityMod.NPCs.AstrumDeus;
|
||||
using CalamityMod.NPCs.BrimstoneElemental;
|
||||
@@ -41,9 +52,11 @@ using CalamityMod.NPCs.Ravager;
|
||||
using CalamityMod.NPCs.Signus;
|
||||
using CalamityMod.NPCs.SlimeGod;
|
||||
using CalamityMod.NPCs.StormWeaver;
|
||||
using CalamityMod.NPCs.SulphurousSea;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.NPCs.Yharon;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Particles.Metaballs;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Schematics;
|
||||
@@ -55,12 +68,6 @@ using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Dyes;
|
||||
@@ -71,6 +78,7 @@ using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
|
||||
[assembly: InternalsVisibleTo("CalTestHelpers")]
|
||||
[assembly: InternalsVisibleTo("InfernumMode")]
|
||||
namespace CalamityMod
|
||||
{
|
||||
public class CalamityMod : Mod
|
||||
@@ -84,8 +92,8 @@ namespace CalamityMod
|
||||
public static int sharkKillCount = 0;
|
||||
|
||||
// Textures
|
||||
public static Asset<Texture2D> heartOriginal2;
|
||||
public static Asset<Texture2D> heartOriginal;
|
||||
public static Asset<Texture2D> heartOriginal2;
|
||||
public static Asset<Texture2D> rainOriginal;
|
||||
public static Asset<Texture2D> manaOriginal;
|
||||
public static Asset<Texture2D> carpetOriginal;
|
||||
@@ -110,7 +118,7 @@ namespace CalamityMod
|
||||
|
||||
// Debuff immunities, these are used in the NPCDebuffs file
|
||||
public static int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned };
|
||||
public static int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, ModContent.BuffType<GlacialState>(), ModContent.BuffType<ExoFreeze>() };
|
||||
public static int[] iceEnemyImmunities = new int[4] { BuffID.Frostburn, BuffID.Frostburn2, ModContent.BuffType<GlacialState>(), ModContent.BuffType<ExoFreeze>() };
|
||||
public static int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType<SulphuricPoisoning>(), ModContent.BuffType<Irradiated>() };
|
||||
public static int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType<Eutrophication>(), ModContent.BuffType<PearlAura>() };
|
||||
public static int[] abyssEnemyImmunities = new int[1] { ModContent.BuffType<CrushDepth>() };
|
||||
@@ -133,10 +141,11 @@ namespace CalamityMod
|
||||
internal Mod overhaul = null;
|
||||
internal Mod redemption = null;
|
||||
internal Mod soa = null;
|
||||
internal Mod subworldLibrary = null;
|
||||
internal Mod summonersAssociation = null;
|
||||
internal Mod thorium = null;
|
||||
internal Mod varia = null;
|
||||
internal Mod subworldLibrary = null;
|
||||
internal Mod wikithis = null;
|
||||
|
||||
#region Load
|
||||
public override void Load()
|
||||
@@ -144,8 +153,8 @@ namespace CalamityMod
|
||||
Instance = this;
|
||||
|
||||
// Save vanilla textures.
|
||||
heartOriginal2 = TextureAssets.Heart;
|
||||
heartOriginal = TextureAssets.Heart2;
|
||||
heartOriginal = TextureAssets.Heart;
|
||||
heartOriginal2 = TextureAssets.Heart2;
|
||||
rainOriginal = TextureAssets.Rain;
|
||||
manaOriginal = TextureAssets.Mana;
|
||||
carpetOriginal = TextureAssets.FlyingCarpet;
|
||||
@@ -172,14 +181,16 @@ namespace CalamityMod
|
||||
ModLoader.TryGetMod("Redemption", out redemption);
|
||||
soa = null;
|
||||
ModLoader.TryGetMod("SacredTools", out soa);
|
||||
subworldLibrary = null;
|
||||
ModLoader.TryGetMod("SubworldLibrary", out subworldLibrary);
|
||||
summonersAssociation = null;
|
||||
ModLoader.TryGetMod("SummonersAssociation", out summonersAssociation);
|
||||
thorium = null;
|
||||
ModLoader.TryGetMod("ThoriumMod", out thorium);
|
||||
varia = null;
|
||||
ModLoader.TryGetMod("Varia", out varia);
|
||||
subworldLibrary = null;
|
||||
ModLoader.TryGetMod("SubworldLibrary", out subworldLibrary);
|
||||
wikithis = null;
|
||||
ModLoader.TryGetMod("Wikithis", out wikithis);
|
||||
|
||||
// Initialize the EnemyStats struct as early as it is safe to do so
|
||||
NPCStats.Load();
|
||||
@@ -206,6 +217,10 @@ namespace CalamityMod
|
||||
{
|
||||
LoadClient();
|
||||
GeneralParticleHandler.Load();
|
||||
ForegroundDrawing.ForegroundManager.Load();
|
||||
|
||||
// Wikithis support
|
||||
WeakReferenceSupport.WikiThisSupport();
|
||||
}
|
||||
|
||||
CooldownRegistry.Load();
|
||||
@@ -266,6 +281,9 @@ namespace CalamityMod
|
||||
Filters.Scene["CalamityMod:ExoMechs"] = new Filter(new ExoMechsScreenShaderData("FilterMiniTower").UseColor(ExoMechsSky.DrawColor).UseOpacity(0.25f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:ExoMechs"] = new ExoMechsSky();
|
||||
|
||||
Filters.Scene["CalamityMod:MonolithAccursed"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh);
|
||||
SkyManager.Instance["CalamityMod:MonolithAccursed"] = new MonolithSky();
|
||||
|
||||
SkyManager.Instance["CalamityMod:Astral"] = new AstralSky();
|
||||
SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky();
|
||||
SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky();
|
||||
@@ -331,6 +349,7 @@ namespace CalamityMod
|
||||
public override void Unload()
|
||||
{
|
||||
musicMod = null;
|
||||
|
||||
ancientsAwakened = null;
|
||||
bossChecklist = null;
|
||||
census = null;
|
||||
@@ -339,9 +358,11 @@ namespace CalamityMod
|
||||
overhaul = null;
|
||||
redemption = null;
|
||||
soa = null;
|
||||
subworldLibrary = null;
|
||||
summonersAssociation = null;
|
||||
thorium = null;
|
||||
varia = null;
|
||||
wikithis = null;
|
||||
|
||||
AstralSky = null;
|
||||
|
||||
@@ -385,8 +406,8 @@ namespace CalamityMod
|
||||
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
TextureAssets.Heart = heartOriginal2;
|
||||
TextureAssets.Heart2 = heartOriginal;
|
||||
TextureAssets.Heart = heartOriginal;
|
||||
TextureAssets.Heart2 = heartOriginal2;
|
||||
TextureAssets.Rain = rainOriginal;
|
||||
TextureAssets.Mana = manaOriginal;
|
||||
TextureAssets.FlyingCarpet = carpetOriginal;
|
||||
@@ -402,8 +423,8 @@ namespace CalamityMod
|
||||
SceneMetrics.GraveyardTileMin = 16;
|
||||
SceneMetrics.GraveyardTileThreshold = 28;
|
||||
|
||||
heartOriginal2 = null;
|
||||
heartOriginal = null;
|
||||
heartOriginal2 = null;
|
||||
rainOriginal = null;
|
||||
manaOriginal = null;
|
||||
carpetOriginal = null;
|
||||
@@ -414,14 +435,6 @@ namespace CalamityMod
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Late Loading
|
||||
public override void PostAddRecipes()
|
||||
{
|
||||
// This is placed here so that all tiles from all mods are guaranteed to be loaded at this point.
|
||||
TileFraming.Load();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Render Target Management
|
||||
|
||||
public static void PrepareRenderTargets(GameTime gameTime)
|
||||
@@ -578,11 +591,11 @@ namespace CalamityMod
|
||||
{ NPCID.EaterofWorldsHead, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.EaterofWorldsBody, 7200 },
|
||||
{ NPCID.EaterofWorldsTail, 7200 },
|
||||
{ NPCID.BrainofCthulhu, 5400 }, // 1:30 (90 seconds)
|
||||
{ NPCID.Creeper, 1800 }, // 0:30 (30 seconds)
|
||||
{ NPCID.BrainofCthulhu, 5400 }, // 1:30 (90 seconds, total length of fight including Creepers phase)
|
||||
{ NPCID.Creeper, 1800 }, // 0:30 (30 seconds, length of Creepers phase)
|
||||
{ NPCID.Deerclops, 5400 }, // 1:30 (90 seconds)
|
||||
{ NPCID.QueenBee, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.SkeletronHead, 9000 }, // 2:30 (150 seconds)
|
||||
{ NPCID.SkeletronHead, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.WallofFlesh, 7200 }, // 2:00 (120 seconds)
|
||||
{ NPCID.WallofFleshEye, 7200 },
|
||||
{ NPCID.QueenSlimeBoss, 7200 }, // 2:00 (120 seconds)
|
||||
@@ -611,11 +624,11 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<Crabulon>(), 5400 }, // 1:30 (90 seconds)
|
||||
{ ModContent.NPCType<HiveMind>(), 7200 }, // 2:00 (120 seconds)
|
||||
{ ModContent.NPCType<PerforatorHive>(), 7200 }, // 2:00 (120 seconds)
|
||||
{ ModContent.NPCType<SlimeGodCore>(), 10800 }, // 3:00 (180 seconds) -- total length of Slime God fight
|
||||
{ ModContent.NPCType<EbonianSlimeGod>(), 3600 }, // 1:00 (60 seconds)
|
||||
{ ModContent.NPCType<CrimulanSlimeGod>(), 3600 }, // 1:00 (60 seconds)
|
||||
{ ModContent.NPCType<SplitEbonianSlimeGod>(), 3600 }, // 1:00 (60 seconds) -- split slimes should spawn at 1:00 and die at around 2:00
|
||||
{ ModContent.NPCType<SplitCrimulanSlimeGod>(), 3600 }, // 1:00 (60 seconds)
|
||||
{ ModContent.NPCType<SlimeGodCore>(), 9000 }, // 2:30 (150 seconds) -- total length of Slime God fight
|
||||
{ ModContent.NPCType<EbonianSlimeGod>(), 4500 }, // 1:15 (75 seconds)
|
||||
{ ModContent.NPCType<CrimulanSlimeGod>(), 4500 }, // 1:15 (75 seconds)
|
||||
{ ModContent.NPCType<SplitEbonianSlimeGod>(), 4500 }, // 1:15 (75 seconds) -- split slimes should spawn at 1:15 and die at around 2:30
|
||||
{ ModContent.NPCType<SplitCrimulanSlimeGod>(), 4500 }, // 1:15 (75 seconds)
|
||||
{ ModContent.NPCType<Cryogen>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<AquaticScourgeHead>(), 7200 }, // 2:00 (120 seconds)
|
||||
{ ModContent.NPCType<AquaticScourgeBody>(), 7200 },
|
||||
@@ -643,8 +656,8 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<Polterghast>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<OldDuke>(), 10800 }, // 3:00 (180 seconds)
|
||||
{ ModContent.NPCType<DevourerofGodsHead>(), 14400 }, // 4:00 (240 seconds)
|
||||
{ ModContent.NPCType<DevourerofGodsBody>(), 14400 }, // NOTE: Sentinels Phase takes 1:00, so with that included it's 5:00
|
||||
{ ModContent.NPCType<DevourerofGodsTail>(), 14400 }, // DoG Phase 1 is 1:30, DoG Phase 2 is 2:30
|
||||
{ ModContent.NPCType<DevourerofGodsBody>(), 14400 }, // DoG Phase 1 is 1:30, DoG Phase 2 is 2:30
|
||||
{ ModContent.NPCType<DevourerofGodsTail>(), 14400 },
|
||||
{ ModContent.NPCType<Yharon>(), 14700 }, // 4:05 (245 seconds) -- he spends 5 seconds invincible where you can't do anything
|
||||
{ ModContent.NPCType<Apollo>(), 21600 }, // 6:00 (360 seconds)
|
||||
{ ModContent.NPCType<Artemis>(), 21600 },
|
||||
@@ -794,12 +807,6 @@ namespace CalamityMod
|
||||
public override object Call(params object[] args) => ModCalls.Call(args);
|
||||
#endregion
|
||||
|
||||
#region Recipes
|
||||
public override void AddRecipeGroups() => CalamityRecipes.AddRecipeGroups();
|
||||
|
||||
public override void AddRecipes() => CalamityRecipes.AddRecipes();
|
||||
#endregion
|
||||
|
||||
#region Seasons
|
||||
public static Season CurrentSeason
|
||||
{
|
||||
|
||||
@@ -24,41 +24,6 @@ namespace CalamityMod
|
||||
CalamityModMessageType msgType = (CalamityModMessageType)reader.ReadByte();
|
||||
switch (msgType)
|
||||
{
|
||||
//
|
||||
// Proficiency levels
|
||||
//
|
||||
|
||||
case CalamityModMessageType.MeleeLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 0);
|
||||
break;
|
||||
case CalamityModMessageType.RangedLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 1);
|
||||
break;
|
||||
case CalamityModMessageType.MagicLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 2);
|
||||
break;
|
||||
case CalamityModMessageType.SummonLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 3);
|
||||
break;
|
||||
case CalamityModMessageType.RogueLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleLevels(reader, 4);
|
||||
break;
|
||||
case CalamityModMessageType.ExactMeleeLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 0);
|
||||
break;
|
||||
case CalamityModMessageType.ExactRangedLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 1);
|
||||
break;
|
||||
case CalamityModMessageType.ExactMagicLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 2);
|
||||
break;
|
||||
case CalamityModMessageType.ExactSummonLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 3);
|
||||
break;
|
||||
case CalamityModMessageType.ExactRogueLevelSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleExactLevels(reader, 4);
|
||||
break;
|
||||
|
||||
//
|
||||
// Player mechanic syncs
|
||||
//
|
||||
@@ -246,17 +211,6 @@ namespace CalamityMod
|
||||
CalamityWorld.DraedonMechToSummon = (ExoMech)reader.ReadInt32();
|
||||
break;
|
||||
|
||||
//
|
||||
// Reforge syncs
|
||||
//
|
||||
|
||||
case CalamityModMessageType.ItemTypeLastReforgedSync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleItemTypeLastReforged(reader);
|
||||
break;
|
||||
case CalamityModMessageType.ReforgeTierSafetySync:
|
||||
Main.player[reader.ReadInt32()].Calamity().HandleReforgeTierSafety(reader);
|
||||
break;
|
||||
|
||||
//
|
||||
// Mouse control syncs
|
||||
//
|
||||
@@ -269,6 +223,19 @@ namespace CalamityMod
|
||||
break;
|
||||
|
||||
|
||||
//
|
||||
// Difficulty syncs
|
||||
//
|
||||
|
||||
case CalamityModMessageType.SyncDifficulties:
|
||||
int sender = reader.ReadInt32();
|
||||
CalamityWorld.revenge = reader.ReadBoolean();
|
||||
CalamityWorld.death = reader.ReadBoolean();
|
||||
//TODO - Something so that other mods that hijack the difficulty ui can also use the remainder of the reader to have their own shit
|
||||
|
||||
if (Main.netMode == NetmodeID.Server)
|
||||
SyncCalamityWorldDifficulties(sender);
|
||||
break;
|
||||
|
||||
//
|
||||
// Default case: with no idea how long the packet is, we can't safely read data.
|
||||
@@ -288,7 +255,7 @@ namespace CalamityMod
|
||||
else if (e is IOException ioe)
|
||||
CalamityMod.Instance.Logger.Error("Failed to parse Calamity packet: An unknown I/O error occurred.", ioe);
|
||||
else
|
||||
throw e; // this either will crash the game or be caught by TML's packet policing
|
||||
throw; // this either will crash the game or be caught by TML's packet policing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,6 +265,21 @@ namespace CalamityMod
|
||||
NetMessage.SendData(MessageID.WorldData);
|
||||
}
|
||||
|
||||
public static void SyncCalamityWorldDifficulties(int sender)
|
||||
{
|
||||
if (Main.netMode == NetmodeID.SinglePlayer)
|
||||
return;
|
||||
|
||||
var netMessage = CalamityMod.Instance.GetPacket();
|
||||
netMessage.Write((byte)CalamityModMessageType.SyncDifficulties);
|
||||
netMessage.Write(sender);
|
||||
netMessage.Write(CalamityWorld.revenge);
|
||||
netMessage.Write(CalamityWorld.death);
|
||||
|
||||
//TODO - Let other mods also add their own bits in that sync. Ideally would be done through the difficultystem itself
|
||||
netMessage.Send(-1, sender);
|
||||
}
|
||||
|
||||
public static void NewNPC_ClientSide(Vector2 spawnPosition, int npcType, Player player)
|
||||
{
|
||||
if (Main.netMode == NetmodeID.SinglePlayer)
|
||||
@@ -318,19 +300,6 @@ namespace CalamityMod
|
||||
|
||||
public enum CalamityModMessageType : byte
|
||||
{
|
||||
// Proficiency levels
|
||||
// TODO -- simplify proficiency netcode, there do not need to be this many separate packet types
|
||||
MeleeLevelSync,
|
||||
RangedLevelSync,
|
||||
MagicLevelSync,
|
||||
SummonLevelSync,
|
||||
RogueLevelSync,
|
||||
ExactMeleeLevelSync,
|
||||
ExactRangedLevelSync,
|
||||
ExactMagicLevelSync,
|
||||
ExactSummonLevelSync,
|
||||
ExactRogueLevelSync,
|
||||
|
||||
// Player mechanic syncs
|
||||
DefenseDamageSync, // TODO -- this can't be synced every 60 frames, it needs to be synced when the player gets hit, or every time it heals up
|
||||
RageSync, // TODO -- this can't be synced every 60 frames, it needs to be synced every time the player is
|
||||
@@ -380,12 +349,11 @@ namespace CalamityMod
|
||||
AcidRainOldDukeSummonSync,
|
||||
EncounteredOldDukeSync,
|
||||
|
||||
// Reforge syncs
|
||||
ItemTypeLastReforgedSync, // TODO -- reforge netcode is no longer needed thanks to 1.4 clone fixes
|
||||
ReforgeTierSafetySync,
|
||||
|
||||
// Mouse Controls syncs
|
||||
RightClickSync,
|
||||
MousePositionSync
|
||||
MousePositionSync,
|
||||
|
||||
// World state sync
|
||||
SyncDifficulties
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader.IO;
|
||||
using CalamityMod.UI;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
@@ -108,7 +109,7 @@ namespace CalamityMod.Cooldowns
|
||||
/// <summary>
|
||||
/// A ratio of how "completed" an instance of a cooldown is.
|
||||
/// </summary>
|
||||
public float Completion => duration != 0 ? timeLeft / (float)duration : 0;
|
||||
public float Completion => CooldownRackUI.DebugFullDisplay ? CooldownRackUI.DebugForceCompletion : (duration != 0 ? timeLeft / (float)duration : 0);
|
||||
|
||||
/// <summary>
|
||||
/// The handler which implements the behavior of this cooldown instance.
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
using CalamityMod.Items.Armor.DesertProwler;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.UI;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class SandsmokeBomb : CooldownHandler
|
||||
{
|
||||
public bool PowerActive => instance.timeLeft > DesertProwlerHat.SmokeCooldown;
|
||||
public float PowerPercent => (instance.timeLeft - DesertProwlerHat.SmokeCooldown) / (float)DesertProwlerHat.SmokeDuration;
|
||||
|
||||
|
||||
public static new string ID => "SandsmokeBomb";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override string DisplayName => PowerActive ? "Sandsmoke Bomb Duration" : "Sandsmoke Bomb Cooldown";
|
||||
public override string Texture => "CalamityMod/Cooldowns/SandsmokeBomb";
|
||||
public override string OutlineTexture => "CalamityMod/Cooldowns/SandsmokeBombOutline";
|
||||
public override string OverlayTexture => "CalamityMod/Cooldowns/SandsmokeBombOverlay";
|
||||
public override Color OutlineColor => new Color(255, 299, 156);
|
||||
public override Color CooldownStartColor => PowerActive ? Color.Lerp(new Color(204, 181, 72), new Color(169, 142, 16), PowerPercent) : new Color(204, 181, 72);
|
||||
public override Color CooldownEndColor => PowerActive ? Color.Lerp(new Color(204, 181, 72), new Color(169, 142, 16), PowerPercent) : new Color(169, 142, 16);
|
||||
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombReload");
|
||||
|
||||
public override void OnCompleted()
|
||||
{
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
Vector2 dustDisplace = Main.rand.NextVector2Circular(80f, 50f);
|
||||
Vector2 dustPosition = instance.player.MountedCenter + dustDisplace;
|
||||
Vector2 dustSpeed = Main.rand.NextVector2Circular(0.5f, 0.5f) + instance.player.velocity / 8f - Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * 0.06f;
|
||||
dustSpeed.X += 1.4f * (float)Math.Sin(((dustDisplace.X + 80f) / 160f) * MathHelper.Pi) * (Main.rand.NextBool() ? -1 : 1);
|
||||
Particle dust = new SandyDustParticle(dustPosition, dustSpeed, Color.White, Main.rand.NextFloat(0.7f, 1.2f), Main.rand.Next(20, 50), 0.03f, Vector2.UnitY * 0.03f);
|
||||
GeneralParticleHandler.SpawnParticle(dust);
|
||||
}
|
||||
}
|
||||
|
||||
//Charge down at first, and then charge back up
|
||||
private float AdjustedCompletion => CooldownRackUI.DebugFullDisplay ? CooldownRackUI.DebugForceCompletion : PowerActive ? PowerPercent : 1 - (instance.timeLeft / (float)DesertProwlerHat.SmokeCooldown);
|
||||
|
||||
public override void ApplyBarShaders(float opacity)
|
||||
{
|
||||
//Use the adjusted completion
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].Apply();
|
||||
}
|
||||
|
||||
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
Texture2D sprite = Request<Texture2D>(Texture).Value;
|
||||
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
|
||||
Texture2D overlay = Request<Texture2D>(OverlayTexture).Value;
|
||||
|
||||
//Draw the outline
|
||||
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the small overlay
|
||||
int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion);
|
||||
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
|
||||
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 356 B |
|
After Width: | Height: | Size: 271 B |
|
After Width: | Height: | Size: 177 B |
@@ -0,0 +1,74 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
using CalamityMod.Items.Armor.Wulfrum;
|
||||
using CalamityMod.UI;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class WulfrumBastion : CooldownHandler
|
||||
{
|
||||
public bool PowerActive => instance.timeLeft > WulfrumHat.BastionCooldown;
|
||||
public float DurabilityPercent => (instance.timeLeft - WulfrumHat.BastionCooldown) / (float)WulfrumHat.BastionTime;
|
||||
|
||||
|
||||
public static new string ID => "WulfrumBastion";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override string DisplayName => PowerActive ? "Power Armor Durability" : "Wulfrum Bastion Cooldown";
|
||||
public override string Texture => PowerActive ? "CalamityMod/Cooldowns/WulfrumBastionActive" : "CalamityMod/Cooldowns/WulfrumBastion";
|
||||
public override string OutlineTexture => "CalamityMod/Cooldowns/WulfrumBastionOutline";
|
||||
public override string OverlayTexture => "CalamityMod/Cooldowns/WulfrumBastionOverlay";
|
||||
public override Color OutlineColor => PowerActive ? new Color(194, 255, 67) : new Color(206, 201, 170);
|
||||
public override Color CooldownStartColor => PowerActive ? Color.Lerp(new Color(112, 244, 244), new Color(54, 177, 221), DurabilityPercent) : new Color(92, 187, 99);
|
||||
public override Color CooldownEndColor => PowerActive ? Color.Lerp(new Color(112, 244, 244), new Color(54, 177, 221), DurabilityPercent) : new Color(160, 232, 77);
|
||||
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Custom/AbilitySounds/WulfrumBastionRecharge");
|
||||
//public override bool SavedWithPlayer => false;
|
||||
|
||||
public override void OnCompleted()
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Vector2 dustDirection = Main.rand.NextVector2CircularEdge(1f, 1f);
|
||||
Dust d = Dust.NewDustPerfect(instance.player.Center + dustDirection * Main.rand.NextFloat(0.4f, 10f), 226, dustDirection * Main.rand.NextFloat(1f, 4f), 100, Color.Transparent, Main.rand.NextFloat(0.8f, 1.2f));
|
||||
d.noGravity = true;
|
||||
d.noLight = true;
|
||||
d.fadeIn = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
//Charge down at first, and then charge back up
|
||||
private float AdjustedCompletion => CooldownRackUI.DebugFullDisplay ? CooldownRackUI.DebugForceCompletion : PowerActive ? (instance.timeLeft - WulfrumHat.BastionCooldown) / (float)WulfrumHat.BastionTime : 1 - (instance.timeLeft / (float)WulfrumHat.BastionCooldown);
|
||||
|
||||
public override void ApplyBarShaders(float opacity)
|
||||
{
|
||||
//Use the adjusted completion
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].Apply();
|
||||
}
|
||||
|
||||
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
Texture2D sprite = Request<Texture2D>(Texture).Value;
|
||||
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
|
||||
Texture2D overlay = Request<Texture2D>(OverlayTexture).Value;
|
||||
|
||||
//Draw the outline
|
||||
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the small overlay
|
||||
int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion);
|
||||
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
|
||||
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 489 B |
|
After Width: | Height: | Size: 500 B |
|
After Width: | Height: | Size: 281 B |
|
After Width: | Height: | Size: 262 B |
@@ -0,0 +1,93 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using static CalamityMod.CalamityUtils;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
public class WulfrumRoverDriveDurability : CooldownHandler
|
||||
{
|
||||
private static Color ringColorLerpStart = new Color(49, 220, 221);
|
||||
private static Color ringColorLerpEnd = new Color(99, 226, 142);
|
||||
|
||||
private float AdjustedCompletion => (instance.timeLeft) / (float)RoverDrive.ProtectionMatrixDurabilityMax;
|
||||
|
||||
public static new string ID => "WulfrumRoverDriveDurability";
|
||||
public override bool CanTickDown => !instance.player.GetModPlayer<RoverDrivePlayer>().RoverDriveOn || instance.timeLeft <= 0;
|
||||
public override bool ShouldDisplay => instance.player.GetModPlayer<RoverDrivePlayer>().RoverDriveOn;
|
||||
public override string DisplayName => "Protective Matrix Durability";
|
||||
public override string Texture => "CalamityMod/Cooldowns/WulfrumRoverDriveActive";
|
||||
public override string OutlineTexture => "CalamityMod/Cooldowns/WulfrumRoverDriveOutline";
|
||||
public override string OverlayTexture => "CalamityMod/Cooldowns/WulfrumRoverDriveOverlay";
|
||||
public override Color OutlineColor => new Color(112, 244, 244);
|
||||
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
|
||||
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
|
||||
public override bool SavedWithPlayer => false;
|
||||
public override bool PersistsThroughDeath => false;
|
||||
|
||||
|
||||
public override void ApplyBarShaders(float opacity)
|
||||
{
|
||||
//Use the adjusted completion
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor);
|
||||
GameShaders.Misc["CalamityMod:CircularBarShader"].Apply();
|
||||
}
|
||||
|
||||
public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
base.DrawExpanded(spriteBatch, position, opacity, scale);
|
||||
|
||||
float Xoffset = instance.timeLeft > 9 ? -10f : -5;
|
||||
DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.timeLeft.ToString(), position + new Vector2(Xoffset, 4) * scale, Color.Lerp(ringColorLerpStart, Color.OrangeRed, 1 - instance.Completion), Color.Black, scale);
|
||||
}
|
||||
|
||||
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
|
||||
{
|
||||
Texture2D sprite = Request<Texture2D>(Texture).Value;
|
||||
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
|
||||
Texture2D overlay = Request<Texture2D>(OverlayTexture).Value;
|
||||
|
||||
//Draw the outline
|
||||
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the icon
|
||||
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
//Draw the small overlay
|
||||
int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion);
|
||||
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
|
||||
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
|
||||
|
||||
float Xoffset = instance.timeLeft > 9 ? -10f : -5;
|
||||
DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.timeLeft.ToString(), position + new Vector2(Xoffset, 4) * scale, Color.Lerp(ringColorLerpStart, Color.OrangeRed, 1 - instance.Completion), Color.Black, scale);
|
||||
}
|
||||
}
|
||||
|
||||
public class WulfrumRoverDriveRecharge : CooldownHandler
|
||||
{
|
||||
private static Color ringColorLerpStart = new Color(194, 255, 57);
|
||||
private static Color ringColorLerpEnd = new Color(92, 187, 99);
|
||||
|
||||
public static new string ID => "WulfrumRoverDriveRecharge";
|
||||
public override bool ShouldDisplay => true;
|
||||
public override string DisplayName => "Protective Matrix Recharge";
|
||||
public override string Texture => "CalamityMod/Cooldowns/WulfrumRoverDrive";
|
||||
public override bool SavedWithPlayer => false;
|
||||
public override bool PersistsThroughDeath => false;
|
||||
public override Color OutlineColor => new Color(194, 255, 67);
|
||||
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
|
||||
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
|
||||
|
||||
public override void OnCompleted() => instance.player.GetModPlayer<RoverDrivePlayer>().ProtectionMatrixDurability = RoverDrive.ProtectionMatrixDurabilityMax;
|
||||
public override SoundStyle? EndSound => null;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 331 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 179 B |
|
After Width: | Height: | Size: 128 B |
@@ -1,4 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CalamityMod.DataStructures
|
||||
@@ -34,6 +34,9 @@ namespace CalamityMod.DataStructures
|
||||
points = nextPoints;
|
||||
}
|
||||
|
||||
if (points.Length <= 1)
|
||||
return Vector2.Zero;
|
||||
|
||||
return Vector2.Lerp(points[0], points[1], T);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,9 +98,7 @@ namespace CalamityMod.DataStructures
|
||||
return;
|
||||
|
||||
Player owner = Main.player[ownerIndex];
|
||||
Endogenesis.SummonEndoCooper(new EntitySource_Misc("1"), AttackMode, Main.MouseWorld, Damage, OriginalKnockback, owner, out int bodyIndex, out int limbsIndex);
|
||||
Main.projectile[bodyIndex].originalDamage = OriginalDamage;
|
||||
Main.projectile[limbsIndex].originalDamage = OriginalDamage;
|
||||
Endogenesis.SummonEndoCooper(new EntitySource_Misc("1"), AttackMode, Main.MouseWorld, Damage, OriginalDamage, OriginalKnockback, owner, out int bodyIndex, out int limbsIndex);
|
||||
Main.projectile[bodyIndex].Calamity().RequiresManualResurrection = true;
|
||||
Main.projectile[limbsIndex].Calamity().RequiresManualResurrection = true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace CalamityMod.DataStructures
|
||||
{
|
||||
|
||||
// Restarting the sprite batch for each different projectile is analogously equivalent to creating an entire new factory just to build a single car.
|
||||
// It is inefficient and leads to performance problems as many projectiles do it.
|
||||
// To mitigate this problem, a special interface exists for the purpose of deferring drawing of certain entities to a time in which they all may be
|
||||
// subject to the same additive draw state before all of the spritebatch's contents are flushed.
|
||||
// Manual drawing hooks should not be utilized when using this interface, such as ModNPC.PreDraw.
|
||||
|
||||
// The implementation of this is almost identical to that of SLR but they're both so simple that it really shouldn't matter.
|
||||
public interface IAdditiveDrawer
|
||||
{
|
||||
void AdditiveDraw(SpriteBatch spriteBatch);
|
||||
}
|
||||
}
|
||||
@@ -567,7 +567,7 @@ namespace CalamityMod
|
||||
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHive>(), ModContent.ProjectileType<IchorShot>()), new int[] { 36, 56, 68, 76, 102 } },
|
||||
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHive>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 76, 102 } },
|
||||
|
||||
{ new Tuple<int, int>(NPCID.QueenBee, ProjectileID.Stinger), new int[] { 22, 44, 64, 72, 96 } }, // 66 damage in non-rev master mode
|
||||
{ new Tuple<int, int>(NPCID.QueenBee, ProjectileID.QueenBeeStinger), new int[] { 22, 44, 64, 72, 96 } }, // 66 damage in non-rev master mode
|
||||
|
||||
{ new Tuple<int, int>(NPCID.SkeletronHead, ProjectileID.Skull), new int[] { 46, 68, 84, 92, 126 } }, // 102 damage in non-rev master mode
|
||||
{ new Tuple<int, int>(NPCID.SkeletronHead, ProjectileID.Shadowflames), new int[] { 40, 60, 76, 84, 114 } },
|
||||
@@ -627,11 +627,11 @@ namespace CalamityMod
|
||||
{ new Tuple<int, int>(ModContent.NPCType<BrimstoneElemental>(), ModContent.ProjectileType<BrimstoneHellblast>()), new int[] { 80, 140, 160, 176, 234 } },
|
||||
{ new Tuple<int, int>(ModContent.NPCType<BrimstoneElemental>(), ModContent.ProjectileType<BrimstoneRay>()), new int[] { 120, 200, 240, 252, 342 } },
|
||||
{ new Tuple<int, int>(ModContent.NPCType<Brimling>(), ModContent.ProjectileType<BrimstoneHellfireball>()), new int[] { 80, 140, 160, 176, 234 } },
|
||||
{ new Tuple<int, int>(ModContent.NPCType<Brimling>(), ModContent.ProjectileType<BrimstoneBarrage>()), new int[] { 70, 112, 128, 140, 192 } },
|
||||
|
||||
{ new Tuple<int, int>(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 50, 100, 124, 136, 186 } },
|
||||
{ new Tuple<int, int>(NPCID.SkeletronPrime, ProjectileID.DeathLaser), new int[] { 50, 100, 124, 136, 186 } },
|
||||
{ new Tuple<int, int>(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 160, 222 } },
|
||||
{ new Tuple<int, int>(NPCID.SkeletronPrime, ProjectileID.SaucerMissile), new int[] { 60, 120, 148, 160, 222 } },
|
||||
{ new Tuple<int, int>(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 160, 222 } },
|
||||
{ new Tuple<int, int>(NPCID.PrimeCannon, ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 0, 0, 240 } },
|
||||
{ new Tuple<int, int>(NPCID.PrimeLaser, ProjectileID.DeathLaser), new int[] { 50, 100, 124, 136, 186 } }, // 150 in non-rev master mode
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CalamityMod.DataStructures
|
||||
{
|
||||
public class VerletSimulatedSegment
|
||||
{
|
||||
public Vector2 position, oldPosition;
|
||||
public bool locked;
|
||||
|
||||
public VerletSimulatedSegment(Vector2 _position, bool _locked = false)
|
||||
{
|
||||
position = _position;
|
||||
oldPosition = _position;
|
||||
locked = _locked;
|
||||
}
|
||||
|
||||
public static List<VerletSimulatedSegment> SimpleSimulation(List<VerletSimulatedSegment> segments, float segmentDistance, int loops = 10, float gravity = 0.3f)
|
||||
{
|
||||
//https://youtu.be/PGk0rnyTa1U?t=400 verlet integration chains reference here
|
||||
foreach (VerletSimulatedSegment segment in segments)
|
||||
{
|
||||
if (!segment.locked)
|
||||
{
|
||||
Vector2 positionBeforeUpdate = segment.position;
|
||||
|
||||
segment.position += (segment.position - segment.oldPosition); // This adds conservation of energy to the segments. This makes it super bouncy and shouldnt be used but it's really funny
|
||||
segment.position += Vector2.UnitY * gravity; //=> This adds gravity to the segments.
|
||||
|
||||
segment.oldPosition = positionBeforeUpdate;
|
||||
}
|
||||
}
|
||||
|
||||
int segmentCount = segments.Count;
|
||||
|
||||
for (int k = 0; k < loops; k++)
|
||||
{
|
||||
for (int j = 0; j < segmentCount - 1; j++)
|
||||
{
|
||||
VerletSimulatedSegment pointA = segments[j];
|
||||
VerletSimulatedSegment pointB = segments[j + 1];
|
||||
Vector2 segmentCenter = (pointA.position + pointB.position) / 2f;
|
||||
Vector2 segmentDirection = Terraria.Utils.SafeNormalize(pointA.position - pointB.position, Vector2.UnitY);
|
||||
|
||||
if (!pointA.locked)
|
||||
pointA.position = segmentCenter + segmentDirection * segmentDistance / 2f;
|
||||
|
||||
if (!pointB.locked)
|
||||
pointB.position = segmentCenter - segmentDirection * segmentDistance / 2f;
|
||||
|
||||
segments[j] = pointA;
|
||||
segments[j + 1] = pointB;
|
||||
}
|
||||
}
|
||||
|
||||
return segments;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,12 @@ namespace CalamityMod.Effects
|
||||
public static Effect LocalLinearTransformationShader;
|
||||
public static Effect BasicPrimitiveShader;
|
||||
public static Effect ArtemisLaserShader;
|
||||
public static Effect ExobladeSlashShader;
|
||||
public static Effect ExobladePierceShader;
|
||||
public static Effect ExoVortexShader;
|
||||
public static Effect SideStreakTrailShader;
|
||||
public static Effect HeavenlyGaleTrailShader;
|
||||
public static Effect HeavenlyGaleLightningShader;
|
||||
|
||||
public static Effect BaseFusableParticleEdgeShader;
|
||||
public static Effect AdditiveFusableParticleEdgeShader;
|
||||
@@ -75,6 +81,12 @@ namespace CalamityMod.Effects
|
||||
LocalLinearTransformationShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/LocalLinearTransformationShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
BasicPrimitiveShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/BasicPrimitiveShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
ArtemisLaserShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/ArtemisLaserShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
ExobladeSlashShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/ExobladeSlashShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
ExobladePierceShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/ExobladePierceShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
ExoVortexShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/ExoVortexShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
SideStreakTrailShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/SideStreakTrail", AssetRequestMode.ImmediateLoad).Value;
|
||||
HeavenlyGaleTrailShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/HeavenlyGaleTrailShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
HeavenlyGaleLightningShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/HeavenlyGaleLightningShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
BaseFusableParticleEdgeShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/ParticleFusion/BaseFusableParticleEdgeShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
AdditiveFusableParticleEdgeShader = CalamityMod.Instance.Assets.Request<Effect>("Effects/ParticleFusion/AdditiveFusableParticleEdgeShader", AssetRequestMode.ImmediateLoad).Value;
|
||||
@@ -111,6 +123,12 @@ namespace CalamityMod.Effects
|
||||
GameShaders.Misc["CalamityMod:LinearTransformation"] = new MiscShaderData(new Ref<Effect>(LocalLinearTransformationShader), "TransformationPass");
|
||||
GameShaders.Misc["CalamityMod:PrimitiveDrawer"] = new MiscShaderData(new Ref<Effect>(BasicPrimitiveShader), "TrailPass");
|
||||
GameShaders.Misc["CalamityMod:ArtemisLaser"] = new MiscShaderData(new Ref<Effect>(ArtemisLaserShader), "TrailPass");
|
||||
GameShaders.Misc["CalamityMod:ExobladeSlash"] = new MiscShaderData(new Ref<Effect>(ExobladeSlashShader), "TrailPass");
|
||||
GameShaders.Misc["CalamityMod:ExobladePierce"] = new MiscShaderData(new Ref<Effect>(ExobladePierceShader), "PiercePass");
|
||||
GameShaders.Misc["CalamityMod:ExoVortex"] = new MiscShaderData(new Ref<Effect>(ExoVortexShader), "VortexPass");
|
||||
GameShaders.Misc["CalamityMod:SideStreakTrail"] = new MiscShaderData(new Ref<Effect>(SideStreakTrailShader), "TrailPass");
|
||||
GameShaders.Misc["CalamityMod:HeavenlyGaleTrail"] = new MiscShaderData(new Ref<Effect>(HeavenlyGaleTrailShader), "PiercePass");
|
||||
GameShaders.Misc["CalamityMod:HeavenlyGaleLightningArc"] = new MiscShaderData(new Ref<Effect>(HeavenlyGaleLightningShader), "TrailPass");
|
||||
|
||||
GameShaders.Misc["CalamityMod:BaseFusableParticleEdge"] = new MiscShaderData(new Ref<Effect>(BaseFusableParticleEdgeShader), "ParticlePass");
|
||||
GameShaders.Misc["CalamityMod:AdditiveFusableParticleEdge"] = new MiscShaderData(new Ref<Effect>(AdditiveFusableParticleEdgeShader), "ParticlePass");
|
||||
@@ -125,6 +143,26 @@ namespace CalamityMod.Effects
|
||||
screenRef = new Ref<Effect>(CalamityMod.Instance.Assets.Request<Effect>("Effects/PixelatedSightLine", AssetRequestMode.ImmediateLoad).Value);
|
||||
Filters.Scene["PixelatedSightLine"] = new Filter(new ScreenShaderData(screenRef, "SightLinePass"), EffectPriority.High);
|
||||
Filters.Scene["PixelatedSightLine"].Load();
|
||||
|
||||
screenRef = new Ref<Effect>(CalamityMod.Instance.Assets.Request<Effect>("Effects/WulfrumTilePing", AssetRequestMode.ImmediateLoad).Value);
|
||||
Filters.Scene["WulfrumTilePing"] = new Filter(new ScreenShaderData(screenRef, "TilePingPass"), EffectPriority.High);
|
||||
Filters.Scene["WulfrumTilePing"].Load();
|
||||
|
||||
screenRef = new Ref<Effect>(CalamityMod.Instance.Assets.Request<Effect>("Effects/WulfrumScaffoldSelection", AssetRequestMode.ImmediateLoad).Value);
|
||||
Filters.Scene["WulfrumScaffoldSelection"] = new Filter(new ScreenShaderData(screenRef, "TilePingPass"), EffectPriority.High);
|
||||
Filters.Scene["WulfrumScaffoldSelection"].Load();
|
||||
|
||||
screenRef = new Ref<Effect>(CalamityMod.Instance.Assets.Request<Effect>("Effects/RoverDriveShield", AssetRequestMode.ImmediateLoad).Value);
|
||||
Filters.Scene["RoverDriveShield"] = new Filter(new ScreenShaderData(screenRef, "ShieldPass"), EffectPriority.High);
|
||||
Filters.Scene["RoverDriveShield"].Load();
|
||||
|
||||
screenRef = new Ref<Effect>(CalamityMod.Instance.Assets.Request<Effect>("Effects/RotateSprite", AssetRequestMode.ImmediateLoad).Value);
|
||||
Filters.Scene["RotateSprite"] = new Filter(new ScreenShaderData(screenRef, "RotationPass"), EffectPriority.High);
|
||||
Filters.Scene["RotateSprite"].Load();
|
||||
|
||||
screenRef = new Ref<Effect>(CalamityMod.Instance.Assets.Request<Effect>("Effects/SwingSprite", AssetRequestMode.ImmediateLoad).Value);
|
||||
Filters.Scene["SwingSprite"] = new Filter(new ScreenShaderData(screenRef, "SwingPass"), EffectPriority.High);
|
||||
Filters.Scene["SwingSprite"].Load();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
float4 uShaderSpecificData;
|
||||
|
||||
float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
// Calculate the swirl coordinates.
|
||||
float2 centeredCoords = coords - 0.5;
|
||||
float swirlRotation = length(centeredCoords) * 17.2 - uTime * 6;
|
||||
float swirlColorFade = 1 - saturate(length(centeredCoords) * 1.8);
|
||||
float swirlSine = sin(swirlRotation);
|
||||
float swirlCosine = sin(swirlRotation + 1.5707);
|
||||
float2x2 swirlRotationMatrix = float2x2(swirlCosine, -swirlSine, swirlSine, swirlCosine);
|
||||
float2 swirlCoordinates = mul(centeredCoords, swirlRotationMatrix) + 0.5;
|
||||
return tex2D(uImage0, swirlCoordinates) * sampleColor * swirlColorFade;
|
||||
}
|
||||
technique Technique1
|
||||
{
|
||||
pass VortexPass
|
||||
{
|
||||
PixelShader = compile ps_2_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
sampler uImage0 : register(s0);
|
||||
sampler uImage1 : register(s1);
|
||||
sampler uImage2 : register(s2);
|
||||
float3 uColor;
|
||||
float3 uSecondaryColor;
|
||||
float3 fireColor;
|
||||
float uOpacity;
|
||||
float uSaturation;
|
||||
float uRotation;
|
||||
float uTime;
|
||||
float4 uSourceRect;
|
||||
float2 uWorldPosition;
|
||||
float uDirection;
|
||||
float3 uLightSource;
|
||||
float2 uImageSize0;
|
||||
float2 uImageSize1;
|
||||
float2 uImageSize2;
|
||||
matrix uWorldViewProjection;
|
||||
float4 uShaderSpecificData;
|
||||
bool flipped;
|
||||
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float4 Color : COLOR0;
|
||||
float2 TextureCoordinates : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 Position : SV_POSITION;
|
||||
float4 Color : COLOR0;
|
||||
float2 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 InverseLerp(float from, float to, float x)
|
||||
{
|
||||
return saturate((x - from) / (to - from));
|
||||
}
|
||||
|
||||
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
|
||||
{
|
||||
float4 color = input.Color;
|
||||
float2 coords = input.TextureCoordinates;
|
||||
float bloomOpacity = pow(sin(coords.y * 3.141), 5.6);
|
||||
float noise = tex2D(uImage1, coords * 3 - float2(uTime * 2.44, 0));
|
||||
float brightnessStreak = tex2D(uImage2, coords * float2(2, 1) - float2(uTime * 1.61, 0)) + noise * bloomOpacity;
|
||||
float4 energyColor = float4(lerp(uColor, uSecondaryColor, noise), 1);
|
||||
|
||||
return (energyColor * bloomOpacity + brightnessStreak * bloomOpacity) * color.a * pow(1 - coords.x, 1.6);
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass PiercePass
|
||||
{
|
||||
VertexShader = compile vs_2_0 VertexShaderFunction();
|
||||
PixelShader = compile ps_2_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||