Removed unnecessary custom entity sources and followed TML guidelines for set bonuses.

This commit is contained in:
Ozzatron committed 2023-07-10 18:58:19 -04:00
1 parent 5e13892ea1
commit d59315dd5e
28 files changed
+55 -209

No files matched your search

+13 -5
View File
@@ -21,6 +21,7 @@ using CalamityMod.Items;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Accessories.Vanity;
using CalamityMod.Items.Armor;
using CalamityMod.Items.Armor.Aerospec;
using CalamityMod.Items.Armor.Bloodflare;
using CalamityMod.Items.Armor.Brimflame;
using CalamityMod.Items.Armor.Demonshade;
@@ -2477,7 +2478,9 @@ namespace CalamityMod.CalPlayer
if (BossRushEvent.BossRushActive)
{
var source = new ProjectileSource_Death(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
// The boss rush visual failure effect has no meaningful source and passes no meaningful information.
var source = Player.GetSource_None();
if (Player.whoAmI == 0 && !CalamityGlobalNPC.AnyLivingPlayers() && CalamityUtils.CountProjectiles(ModContent.ProjectileType<BossRushFailureEffectThing>()) == 0)
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<BossRushFailureEffectThing>(), 0, 0f);
}
@@ -2891,7 +2894,8 @@ namespace CalamityMod.CalPlayer
Dust.NewDust(Player.Center + angle.ToRotationVector2() * 160f, 0, 0, 218, 0f, 0f, 100, default, 1f);
}
var source = new ProjectileSource_GaelsGreatswordRage(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_ItemUse(Player.ActiveItem(), GaelsGreatsword.SkullsplosionEntitySourceContext);
float rageRatio = rage / rageMax;
float baseDamage = rageRatio * GaelsGreatsword.SkullsplosionDamageMultiplier * GaelsGreatsword.BaseDamage;
int damage = (int)Player.GetTotalDamage<MeleeDamageClass>().ApplyTo(baseDamage);
@@ -6134,7 +6138,8 @@ namespace CalamityMod.CalPlayer
if (aeroSet && hurtInfo.Damage > 25)
{
var source = new ProjectileSource_AerospecSetFeathers(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, AerospecBreastplate.FeatherEntitySourceContext);
for (int n = 0; n < 4; n++)
{
int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(20);
@@ -6341,7 +6346,8 @@ namespace CalamityMod.CalPlayer
{
if (Player.whoAmI == Main.myPlayer)
{
var source = new ProjectileSource_DemonshadeSet(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, DemonshadeHelm.ShadowScytheEntitySourceContext);
for (int l = 0; l < 2; l++)
{
int shadowbeamDamage = (int)Player.GetBestClassDamage().ApplyTo(3000);
@@ -6519,7 +6525,9 @@ namespace CalamityMod.CalPlayer
{
if (CalamityWorld.getFixedBoi)
{
var source = new ProjectileSource_GFBNurseHealLeviathanMeteor(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
// The meteor is considered to be spawned from the Nurse herself
var source = nurse.GetSource_FromThis("Calamity_GetFixedBoiNurseExtinctionMeteor");
if (Player.whoAmI == Main.myPlayer)
{
int proj = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<LeviathanBomb>(), 9999, 10f, Player.whoAmI);
+23 -8
View File
@@ -66,6 +66,11 @@ using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
using CalamityMod.Items.Armor.Wulfrum;
using CalamityMod.Tiles.Abyss.AbyssAmbient;
using CalamityMod.Items.Armor.LunicCorps;
using CalamityMod.Items.Armor.Bloodflare;
using CalamityMod.Items.Armor.Hydrothermic;
using CalamityMod.Items.Armor.OmegaBlue;
using CalamityMod.Items.Armor.Prismatic;
using CalamityMod.Items.Armor.Tarragon;
namespace CalamityMod.CalPlayer
{
@@ -904,7 +909,9 @@ namespace CalamityMod.CalPlayer
{
if (Math.Abs(Player.velocity.X) > 0.1f || Math.Abs(Player.velocity.Y) > 0.1f)
{
Projectile.NewProjectile(new ProjectileSource_HydrothermalSmoke(Player), Player.Center, Vector2.Zero, ModContent.ProjectileType<HydrothermalSmoke>(), 0, 0f, Player.whoAmI);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(HydrothermicArmor.VanitySmokeEntitySourceContext);
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<HydrothermalSmoke>(), 0, 0f, Player.whoAmI);
}
}
// Trying to find a workaround because apparently putting the bool in ResetEffects prevents it from working
@@ -1011,7 +1018,7 @@ namespace CalamityMod.CalPlayer
if (!tentaclesPresent[i])
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(390);
var source = new ProjectileSource_OmegaBlueTentacles(Player);
var source = Player.GetSource_FromThis(OmegaBlueHelmet.TentacleEntitySourceContext);
Vector2 vel = new Vector2(Main.rand.Next(-13, 14), Main.rand.Next(-13, 14)) * 0.25f;
Projectile.NewProjectile(source, Player.Center, vel, ModContent.ProjectileType<OmegaBlueTentacle>(), damage, 8f, Main.myPlayer, Main.rand.Next(120), i);
}
@@ -2884,7 +2891,8 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer && bloodflareSummonTimer <= 0)
{
bloodflareSummonTimer = 900;
var source = new ProjectileSource_BloodflareSummonSet(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(BloodflareHeadSummon.GhostMineEntitySourceContext);
for (int I = 0; I < 3; I++)
{
float ai1 = I * 120;
@@ -2950,7 +2958,8 @@ namespace CalamityMod.CalPlayer
{
const int BaseDamage = 120;
int damage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(BaseDamage);
var source = new ProjectileSource_TarragonSummonAura(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(TarragonHeadSummon.LifeAuraEntitySourceContext);
float range = 300f;
for (int i = 0; i < Main.maxNPCs; ++i)
@@ -3020,7 +3029,8 @@ namespace CalamityMod.CalPlayer
{
const int BaseDamage = 50;
int damage = (int)Player.GetBestClassDamage().ApplyTo(BaseDamage);
var source = new ProjectileSource_InfernoPotionBoost(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(HydrothermicArmor.InfernoPotionEntitySourceContext);
float range = 300f;
for (int i = 0; i < Main.maxNPCs; ++i)
@@ -3189,7 +3199,10 @@ namespace CalamityMod.CalPlayer
if (Player.strongBees && Main.rand.NextBool(3))
++beeCount;
int damage = (int)Player.GetTotalDamage<SummonDamageClass>().ApplyTo(30);
var source = new ProjectileSource_PlaguebringerSetBoost(Player);
// TODO -- should be from accessory, can't do that because this code is in the wrong place.
// This needs to be part of the update accessory function of the accessory itself to have the right entity source
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis("PlaguebringerPistonBees");
for (int index = 0; index < beeCount; ++index)
{
int bee = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-35f, 35f) * 0.02f, Main.rand.NextFloat(-35f, 35f) * 0.02f, (Main.rand.NextBool(4) ? ModContent.ProjectileType<PlagueBeeSmall>() : Player.beeType()), damage, Player.beeKB(0f), Player.whoAmI, 0f, 0f);
@@ -3277,7 +3290,8 @@ namespace CalamityMod.CalPlayer
}
//Summon the aura
var source = new ProjectileSource_TeslaPotion(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_Buff(Player.FindBuffIndex(ModContent.BuffType<TeslaBuff>()));
int damage = (int)Player.GetBestClassDamage().ApplyTo(10);
if (Player.ownedProjectileCounts[ModContent.ProjectileType<TeslaAura>()] < 1)
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<TeslaAura>(), damage, 0f, Player.whoAmI, 0f, 0f);
@@ -3341,7 +3355,8 @@ namespace CalamityMod.CalPlayer
travelDist = shootSpeed / travelDist;
}
var source = new ProjectileSource_PrismaticArmorLasers(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(PrismaticHelmet.LaserEntitySourceContext);
int laserAmt = Main.rand.Next(2);
for (int index = 0; index < laserAmt; index++)
{
+3 -1
View File
@@ -7,6 +7,7 @@ using CalamityMod.Cooldowns;
using CalamityMod.Dusts;
using CalamityMod.EntitySources;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Prismatic;
using CalamityMod.Items.Armor.Reaver;
using CalamityMod.Items.VanillaArmorChanges;
using CalamityMod.Items.Weapons.Ranged;
@@ -1466,7 +1467,8 @@ namespace CalamityMod.CalPlayer
}
}
var source = new ProjectileSource_ReaverHeal(Player);
// https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list
var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext);
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileType<ReaverHealOrb>(), 0, 0f, Player.whoAmI, healTarget, heal);
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_AerospecSetFeathers : IEntitySource
{
public Player player;
public ProjectileSource_AerospecSetFeathers(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_BloodflareSummonSet : IEntitySource
{
public Player player;
public ProjectileSource_BloodflareSummonSet(Player p) => player = p;
public string? Context => null;
}
}
-13
View File
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_Death : IEntitySource
{
public Player player;
public ProjectileSource_Death(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_DemonshadeSet : IEntitySource
{
public Player player;
public ProjectileSource_DemonshadeSet(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_GFBNurseHealLeviathanMeteor : IEntitySource
{
public Player player;
public ProjectileSource_GFBNurseHealLeviathanMeteor(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_GaelsGreatswordRage : IEntitySource
{
public Player player;
public ProjectileSource_GaelsGreatswordRage(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_HydrothermalSmoke : IEntitySource
{
public Player player;
public ProjectileSource_HydrothermalSmoke(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_InfernoPotionBoost : IEntitySource
{
public Player player;
public ProjectileSource_InfernoPotionBoost(Player p) => player = p;
public string? Context => null;
}
}
-13
View File
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_LevelUp : IEntitySource
{
public Player player;
public ProjectileSource_LevelUp(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_OmegaBlueTentacles : IEntitySource
{
public Player player;
public ProjectileSource_OmegaBlueTentacles(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_PlaguebringerSetBoost : IEntitySource
{
public Player player;
public ProjectileSource_PlaguebringerSetBoost(Player p) => player = p;
public string? Context => null;
}
}
@@ -4,6 +4,7 @@ using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
// Ozzatron 10JUL2023: couldn't figure out a clever way to remove this one, because it's used for some esoteric function
public class ProjectileSource_PlayerDashHit : IEntitySource
{
public Player player;
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_PrismaticArmorLasers : IEntitySource
{
public Player player;
public ProjectileSource_PrismaticArmorLasers(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_ReaverHeal : IEntitySource
{
public Player player;
public ProjectileSource_ReaverHeal(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_TarragonSummonAura : IEntitySource
{
public Player player;
public ProjectileSource_TarragonSummonAura(Player p) => player = p;
public string? Context => null;
}
}
@@ -1,13 +0,0 @@
#nullable enable
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.EntitySources
{
public class ProjectileSource_TeslaPotion : IEntitySource
{
public Player player;
public ProjectileSource_TeslaPotion(Player p) => player = p;
public string? Context => null;
}
}
@@ -9,6 +9,8 @@ namespace CalamityMod.Items.Armor.Aerospec
public class AerospecBreastplate : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PreHardmode";
internal static string FeatherEntitySourceContext => "SetBonus_Calamity_Aerospec";
public override void SetDefaults()
{
Item.width = 18;
@@ -12,6 +12,8 @@ namespace CalamityMod.Items.Armor.Bloodflare
public class BloodflareHeadSummon : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
internal static string GhostMineEntitySourceContext => "SetBonus_Calamity_BloodflareSummon";
public override void SetDefaults()
{
Item.width = 18;
+1
View File
@@ -17,6 +17,7 @@ namespace CalamityMod.Items.Armor.Demonshade
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DemonshadeEnrage");
internal static string ShadowScytheEntitySourceContext => "SetBonus_Calamity_Demonshade";
public override void SetDefaults()
{
@@ -10,6 +10,9 @@ namespace CalamityMod.Items.Armor.Hydrothermic
public class HydrothermicArmor : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.Hardmode";
internal static string VanitySmokeEntitySourceContext => "SetBonus_Calamity_Hydrothermic_Vanity";
internal static string InfernoPotionEntitySourceContext => "SetBonus_Calamity_Hydrothermic_InfernoPotionBoost";
public override void SetDefaults()
{
Item.width = 18;
+1
View File
@@ -15,6 +15,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue
public class OmegaBlueHelmet : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
internal static string TentacleEntitySourceContext => "SetBonus_Calamity_OmegaBlue";
public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/OmegaBlueAbility");
+1
View File
@@ -11,6 +11,7 @@ namespace CalamityMod.Items.Armor.Prismatic
public class PrismaticHelmet : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
internal static string LaserEntitySourceContext => "SetBonus_Calamity_Prismatic";
public override void SetDefaults()
{
Item.width = 18;
+2
View File
@@ -11,6 +11,8 @@ namespace CalamityMod.Items.Armor.Reaver
public class ReaverHeadTank : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.Hardmode";
internal static string HealOrbEntitySourceContext => "SetBonus_Calamity_ReaverTank";
//Defense and DR Helm
public override void SetDefaults()
{
@@ -12,6 +12,8 @@ namespace CalamityMod.Items.Armor.Tarragon
public class TarragonHeadSummon : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
internal static string LifeAuraEntitySourceContext => "SetBonus_Calamity_Tarragon";
public override void SetDefaults()
{
Item.width = 18;
+1
View File
@@ -24,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee
// Skull ring attribute constants
public static readonly float SkullsplosionDamageMultiplier = 1.5f;
internal static string SkullsplosionEntitySourceContext => "GaelsGreatswordRageSkullsplosion";
// Rage gain attribute constant
public static readonly float RagePerSecond = 0.03f; // 3% rage per second, consistent with what it was prior to rage rework