diff --git a/Buffs/PlayerBuff/ElectricVeil.cs b/Buffs/PlayerBuff/ElectricVeil.cs index 71a13195..e6a98704 100644 --- a/Buffs/PlayerBuff/ElectricVeil.cs +++ b/Buffs/PlayerBuff/ElectricVeil.cs @@ -10,7 +10,7 @@ public class ElectricVeil : ModBuff public override void Update(Player player, ref int buffIndex) { player.thorns += 0.2f; - player.moveSpeed -= 0.6f; + player.moveSpeed += 0.2f; player.aggro -= 500; } } diff --git a/Buffs/Summons/AreusMirrorBuff.cs b/Buffs/Summons/AreusMirrorBuff.cs index 2854ab16..6297ddc8 100644 --- a/Buffs/Summons/AreusMirrorBuff.cs +++ b/Buffs/Summons/AreusMirrorBuff.cs @@ -15,7 +15,8 @@ public override void SetStaticDefaults() public override void Update(Player player, ref int buffIndex) { // If the minions exist reset the buff time, otherwise remove the buff from the player - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 || player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 || + player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) { player.buffTime[buffIndex] = 18000; } diff --git a/Buffs/Summons/AreusMirrorBuff.png b/Buffs/Summons/AreusMirrorBuff.png index e2db30b8..fca6d991 100644 Binary files a/Buffs/Summons/AreusMirrorBuff.png and b/Buffs/Summons/AreusMirrorBuff.png differ diff --git a/CrossMod/ElementsMod/SetProjectileElements.cs b/CrossMod/ElementsMod/SetProjectileElements.cs deleted file mode 100644 index 14ff175c..00000000 --- a/CrossMod/ElementsMod/SetProjectileElements.cs +++ /dev/null @@ -1,270 +0,0 @@ -using BattleNetworkElements.Utilities; -using ShardsOfAtheria.Projectiles.Ammo; -using ShardsOfAtheria.Projectiles.Magic; -using ShardsOfAtheria.Projectiles.Magic.ByteCrush; -using ShardsOfAtheria.Projectiles.Magic.ElecGauntlet; -using ShardsOfAtheria.Projectiles.Magic.Gambit; -using ShardsOfAtheria.Projectiles.Magic.Spectrum; -using ShardsOfAtheria.Projectiles.Melee; -using ShardsOfAtheria.Projectiles.Melee.AreusDaggerProjs; -using ShardsOfAtheria.Projectiles.Melee.AreusGlaive; -using ShardsOfAtheria.Projectiles.Melee.AreusJoustingLance; -using ShardsOfAtheria.Projectiles.Melee.AreusJustitia; -using ShardsOfAtheria.Projectiles.Melee.AreusSwordProjs; -using ShardsOfAtheria.Projectiles.Melee.BloodDagger; -using ShardsOfAtheria.Projectiles.Melee.BloodthirstySword; -using ShardsOfAtheria.Projectiles.Melee.ElecKatana; -using ShardsOfAtheria.Projectiles.Melee.EnergyScythe; -using ShardsOfAtheria.Projectiles.Melee.EntropyCutter; -using ShardsOfAtheria.Projectiles.Melee.GenesisRagnarok; -using ShardsOfAtheria.Projectiles.Melee.GenesisRagnarok.IceStuff; -using ShardsOfAtheria.Projectiles.Melee.Gomorrah; -using ShardsOfAtheria.Projectiles.Melee.HeroSword; -using ShardsOfAtheria.Projectiles.NPCProj; -using ShardsOfAtheria.Projectiles.NPCProj.Elizabeth; -using ShardsOfAtheria.Projectiles.NPCProj.Nova; -using ShardsOfAtheria.Projectiles.NPCProj.Variant; -using ShardsOfAtheria.Projectiles.NPCProj.Variant.HarpyFeather; -using ShardsOfAtheria.Projectiles.Other; -using ShardsOfAtheria.Projectiles.Ranged; -using ShardsOfAtheria.Projectiles.Ranged.DeckOfCards; -using ShardsOfAtheria.Projectiles.Ranged.EventHorizon; -using ShardsOfAtheria.Projectiles.Ranged.FireCannon; -using ShardsOfAtheria.Projectiles.Ranged.GunRose; -using ShardsOfAtheria.Projectiles.Ranged.VergilFlamethrower; -using ShardsOfAtheria.Projectiles.Summon; -using ShardsOfAtheria.Projectiles.Summon.Minions; -using ShardsOfAtheria.Projectiles.Summon.Whip; -using ShardsOfAtheria.Projectiles.Tools; -using System.Collections.Generic; -using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; - -namespace ShardsOfAtheria.CrossMod.ElementsMod -{ - [JITWhenModsEnabled("BattleNetworkElements")] - internal class SetProjectileElements : GlobalProjectile - { - public override bool IsLoadingEnabled(Mod mod) - { - return SoA.ElementModEnabled; - } - - static readonly List Fire = new() - { - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - }; - static readonly List Aqua = new() - { - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - }; - static readonly List Elec = new() - { - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - }; - static readonly List Wood = new() - { - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - }; - - [JITWhenModsEnabled("BattleNetworkElements")] - public override void SetStaticDefaults() - { - foreach (int i in Fire) - { - i.AddFireProjectile(); - } - foreach (int i in Aqua) - { - i.AddAquaProjectile(); - } - foreach (int i in Elec) - { - i.AddElecProjectile(); - } - foreach (int i in Wood) - { - i.AddWoodProjectile(); - } - } - } -} diff --git a/CrossMod/TerraTypes/Ammo.csv b/CrossMod/TerraTypes/Ammo.csv index 04dd5473..f04e736c 100644 --- a/CrossMod/TerraTypes/Ammo.csv +++ b/CrossMod/TerraTypes/Ammo.csv @@ -1,7 +1,8 @@ internalName,type,type AreusArrow,Electric, AreusBullet,Electric, +AreusGrenade,Electric, BB,Steel, +PlagueCell,Poison, SpectralArrow,Ghost, -SpectralBullet,Ghost, -AreusGrenade,Electric, \ No newline at end of file +SpectralBullet,Ghost, \ No newline at end of file diff --git a/CrossMod/TerraTypes/Items.csv b/CrossMod/TerraTypes/Items.csv index fb1d50cb..09f13204 100644 --- a/CrossMod/TerraTypes/Items.csv +++ b/CrossMod/TerraTypes/Items.csv @@ -2,7 +2,7 @@ internalName,type,type,tooltipOverride AmberCore,Rock,Bug,"{""Tooltips"": [{""Type"":""Rock,Bug"",""Tooltip"": ""Amber flies are {0}""}]}" AmberCore_Greater,Rock,Bug,"{""Tooltips"": [{""Type"":""Rock,Bug"",""Tooltip"": ""Amber flies are {0}""}]}" AmberCore_Super,Rock,Bug,"{""Tooltips"": [{""Type"":""Rock,Bug"",""Tooltip"": ""Amber flies are {0}""}]}" -SapphireCore_Greater,Rock,,"{""Tooltips"": [{""Type"":""Rock"",""Tooltip"": ""Sapphire spikes are {0}""}]}" -SapphireCore_Super,Rock,,"{""Tooltips"": [{""Type"":""Rock"",""Tooltip"": ""Sapphire spikes are {0}""}]}" -MegaGemCore,Rock,,,"{""DontOverride"":true,""Tooltips"":[{""Type"":""Rock"",""Tooltip"": ""Sapphire spikes are {0}""},{""Type"":""Rock,Bug"",""Tooltip"": ""Amber flies are {0}""}]}" +SapphireCore_Greater,Rock,,"{""Tooltips"": [{""Type"":""Rock"",""Tooltip"": ""Sapphire spikes are {0}""},{""Type"":""Rock"",""Tooltip"": ""Sapphire Spirit projectile is {0}""}]}" +SapphireCore_Super,Rock,,"{""Tooltips"": [{""Type"":""Rock"",""Tooltip"": ""Sapphire spikes are {0}""},{""Type"":""Rock"",""Tooltip"": ""Sapphire Spirit projectile is {0}""}]}" +MegaGemCore,Rock,,,"{""DontOverride"":true,""Tooltips"":[{""Type"":""Rock"",""Tooltip"": ""Sapphire spikes are {0}""},{""Type"":""Rock"",""Tooltip"": ""Gem Soul projectile is {0}""},{""Type"":""Rock,Bug"",""Tooltip"": ""Amber flies are {0}""}]}" AmethystDagger,Rock,, \ No newline at end of file diff --git a/CrossMod/TerraTypes/Projectiles.csv b/CrossMod/TerraTypes/Projectiles.csv index d1b89476..cf52d16a 100644 --- a/CrossMod/TerraTypes/Projectiles.csv +++ b/CrossMod/TerraTypes/Projectiles.csv @@ -24,11 +24,11 @@ SilverBoltHostile,Steel, ElectricTrail,Electric, FeatherBlade,Electric, HardlightKnifeHostile,Electric, +HardlightBladeHitbox,Electric, LightningBolt,Electric, StormCloud,Electric, StormLance,Electric, StormSword,Electric, -HardlightBladeHitbox,Electric, CactusNeedle,Grass, FlamePillar,Fire, @@ -48,7 +48,6 @@ ElectricTrailFriendly,Electric, ElementExplosion,, GolemBeam,Fire, PhantasmalEye,Dragon,Dark -RubyExplosive,Rock, RubyShard,Rock, SpinPrime,Steel, SpinSkull,Bone, @@ -74,6 +73,7 @@ AreusGambleDagger,Electric, AreusGambleGoodExplosion,Electric, AreusShardProj,Electric, AreusShockwave,Electric, +AreusWandBlade,Electric, BitBlock,Electric, BloodDropFriendly,Blood, BloodWaveFriendly,Blood, @@ -81,15 +81,16 @@ ByteBlock,, DeathNote,Ghost, ElecBlade,Electric, ElecCannon,Electric, +ElecCoin,Electric, ElecCrossbow,Electric, ElecDagger,Electric, ElecKnuckle,Electric, ElecPistol,Electric, -ElectricOrb,Electric, -ElectricSpike,Electric, -ElecCoin,Electric, ElecScorpionFang,Electric, ElecScorpionTail,Electric,Poison +ElectricHook,Electric, +ElectricOrb,Electric, +ElectricSpike,Electric, GunswordProj,Steel, HardlightFeatherMagic,Electric, IceBolt,Ice, @@ -212,6 +213,7 @@ HeroBullet,Fire, KusarigamaKing,Water, LaserArrow,Electric, MetalBladeProj,Steel, +PlagueBeam,Poison, PrometheusFire,Fire, ScarletSpark,Electric, SilverBoltFriendly,Steel, @@ -219,6 +221,7 @@ SilverBoltFriendly,Steel, AmberFly,Rock,Bug AmberSpit,Rock,Bug AreusChainWhip,Electric, +AreusStabber,Electric, BlackStar,Dark,Electric BloodSickleFriendly,Blood, DragonBone,Dark,Poison diff --git a/CrossMod/TerraTypes/Weapons.csv b/CrossMod/TerraTypes/Weapons.csv index f30c01f8..94875429 100644 --- a/CrossMod/TerraTypes/Weapons.csv +++ b/CrossMod/TerraTypes/Weapons.csv @@ -83,11 +83,13 @@ MetalBlade,Steel,, P90,Grass,, Pantheon,Steel,, PhantomRose,Dark,Grass, +PlagueRailgun,Poison,, Scarlet,Dark,Grass, TheBall,Blood,, AreusChain,Electric,Steel,"{""Tooltips"": [{""Type"":""Electric"",""Tooltip"": ""Whip: {0}""},{""Type"":""Steel"",""Tooltip"": ""Gold Chain: {0}""}]}" AreusCrate,Electric,, +AreusStabberStaff,Electric,, AreusStriker,Electric,, BloodTome,Blood,, BrokenAreusMirror,Electric,, diff --git a/Dusts/PlagueDust.cs b/Dusts/PlagueDust.cs new file mode 100644 index 00000000..192d8110 --- /dev/null +++ b/Dusts/PlagueDust.cs @@ -0,0 +1,18 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace ShardsOfAtheria.Dusts +{ + public class PlagueDust : ModDust + { + public override bool Update(Dust dust) + { + if (!dust.noLight) + { + Lighting.AddLight(dust.position, TorchID.Green); + } + return base.Update(dust); + } + } +} diff --git a/Dusts/PlagueDust.png b/Dusts/PlagueDust.png new file mode 100644 index 00000000..e0e7dfdd Binary files /dev/null and b/Dusts/PlagueDust.png differ diff --git a/Globals/SoAGlobalItem.cs b/Globals/SoAGlobalItem.cs index ab05dbbf..49f184f0 100644 --- a/Globals/SoAGlobalItem.cs +++ b/Globals/SoAGlobalItem.cs @@ -10,6 +10,7 @@ using ShardsOfAtheria.Items.Consumable; using ShardsOfAtheria.Items.Placeable.Furniture; using ShardsOfAtheria.Items.SinfulSouls; +using ShardsOfAtheria.Items.Weapons.Ammo; using ShardsOfAtheria.Items.Weapons.Melee; using ShardsOfAtheria.NPCs.Town.TheArchivist; using ShardsOfAtheria.NPCs.Town.TheAtherian; @@ -57,6 +58,13 @@ public class SoAGlobalItem : GlobalItem public override void SetDefaults(Item item) { base.SetDefaults(item); + if (item.ModItem != null) + { + if (item.ModItem.Name == "PlagueCellCanister") + { + item.ammo = ModContent.ItemType(); + } + } switch (item.type) { case ItemID.TungstenBullet: diff --git a/Items/Accessories/AcidTrip.cs b/Items/Accessories/AcidTrip.cs index 1392d5ee..95a65f2f 100644 --- a/Items/Accessories/AcidTrip.cs +++ b/Items/Accessories/AcidTrip.cs @@ -8,7 +8,9 @@ public class AcidTrip : ModItem { public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 1; + Item.AddElementWood(); + Item.AddRedemptionElement(10); + Item.AddRedemptionElement(11); } public override void SetDefaults() diff --git a/Items/Accessories/HardlightBraces.cs b/Items/Accessories/HardlightBraces.cs index 2e74f279..614e95b5 100644 --- a/Items/Accessories/HardlightBraces.cs +++ b/Items/Accessories/HardlightBraces.cs @@ -13,8 +13,8 @@ public class HardlightBraces : ModItem { public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 1; Item.AddElementElec(); + Item.AddRedemptionElement(7); } public override void SetDefaults() diff --git a/Items/Accessories/MidnightCloak.png b/Items/Accessories/MidnightCloak.png index 72825c4c..0d8afe03 100644 Binary files a/Items/Accessories/MidnightCloak.png and b/Items/Accessories/MidnightCloak.png differ diff --git a/Items/Accessories/PrototypeAreusBand.cs b/Items/Accessories/PrototypeAreusBand.cs index 3b46bd24..418616de 100644 --- a/Items/Accessories/PrototypeAreusBand.cs +++ b/Items/Accessories/PrototypeAreusBand.cs @@ -22,7 +22,7 @@ public class PrototypeAreusBand : ModItem public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 1; + Item.AddAreus(); } public override void SetDefaults() diff --git a/Items/Accessories/TomeOfOmniscience.cs b/Items/Accessories/TomeOfOmniscience.cs index 9a3f0aa2..97bf60d6 100644 --- a/Items/Accessories/TomeOfOmniscience.cs +++ b/Items/Accessories/TomeOfOmniscience.cs @@ -35,19 +35,19 @@ public override void UpdateAccessory(Player player, bool hideVisual) public override void ModifyTooltips(List tooltips) { SlayerPlayer slayer = Main.LocalPlayer.Slayer(); - var line = new TooltipLine(Mod, "Verbose:RemoveMe", "This tooltip won't show in-game"); + TooltipLine line = new(Mod, "Verbose:RemoveMe", "This tooltip won't show in-game"); if (slayer.TomeKnowledge == 0) - line = new TooltipLine(Mod, "CurrentKnowledgeBase", Language.GetTextValue(SoA.LocalizeCommon + "Combat")) + line = new(Mod, "CurrentKnowledgeBase", Language.GetTextValue(SoA.LocalizeCommon + "Combat")) { OverrideColor = Color.Red }; if (slayer.TomeKnowledge == 1) - line = new TooltipLine(Mod, "CurrentKnowledgeBase", Language.GetTextValue(SoA.LocalizeCommon + "Conservation")) + line = new(Mod, "CurrentKnowledgeBase", Language.GetTextValue(SoA.LocalizeCommon + "Conservation")) { OverrideColor = Color.Green }; if (slayer.TomeKnowledge == 2) - line = new TooltipLine(Mod, "CurrentKnowledgeBase", Language.GetTextValue(SoA.LocalizeCommon + "Exploration")) + line = new(Mod, "CurrentKnowledgeBase", Language.GetTextValue(SoA.LocalizeCommon + "Exploration")) { OverrideColor = Color.Blue }; diff --git a/Items/Accessories/ValkyrieCrown.cs b/Items/Accessories/ValkyrieCrown.cs index 3a2a04b0..d01edb33 100644 --- a/Items/Accessories/ValkyrieCrown.cs +++ b/Items/Accessories/ValkyrieCrown.cs @@ -16,6 +16,7 @@ public override void SetStaticDefaults() Item.ResearchUnlockCount = 1; Item.AddElementElec(); + Item.AddRedemptionElement(7); } public override void SetDefaults() diff --git a/Items/Armor/Areus/AreusArmorPiece.cs b/Items/Armor/Areus/AreusArmorPiece.cs index d2161eba..74e1be77 100644 --- a/Items/Armor/Areus/AreusArmorPiece.cs +++ b/Items/Armor/Areus/AreusArmorPiece.cs @@ -39,41 +39,41 @@ public override void UpdateEquip(Player player) public override void UpdateArmorSet(Player player) { string itemKey = this.GetLocalizationKey(string.Empty); - string bonusText = Language.GetTextValue(SoA.LocalizeSetBonus + "Areus"); + string setBonusText = Language.GetTextValue(SoA.LocalizeSetBonus + "Areus"); - bool melee = ArmorPlayer.classChip == DamageClass.Melee; - bool ranged = ArmorPlayer.classChip == DamageClass.Ranged; - bool magic = ArmorPlayer.classChip == DamageClass.Magic; - bool summon = ArmorPlayer.classChip == DamageClass.Summon; + bool melee = ArmorPlayer.WarriorSet; + bool ranged = ArmorPlayer.RangerSet; + bool magic = ArmorPlayer.MageSet; + bool summon = ArmorPlayer.CommanderSet; - bonusText += "\n" + Language.GetTextValue(itemKey + "SetBonus"); + setBonusText += "\n" + Language.GetTextValue(itemKey + "SetBonus"); if (melee || ranged || magic || summon) { itemKey += ArmorPlayer.classChip.Name + "Bonus"; - bonusText += "\n" + Language.GetTextValue(itemKey); + setBonusText += "\n" + Language.GetTextValue(itemKey); } if (melee) { MeleeSet(player); - bonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusMelee"); + setBonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusMelee"); } else if (ranged) { RangedSet(player); - bonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusRanged"); + setBonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusRanged"); } else if (magic) { MagicSet(player); - bonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusMagic"); + setBonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusMagic"); } else if (summon) { SummonSet(player); - bonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusSummon"); + setBonusText += "\n" + Language.GetTextValue(SoA.LocalizeSetBonus + "AreusSummon"); } - player.setBonus = bonusText; + player.setBonus = setBonusText; } public virtual void MeleeSet(Player player) diff --git a/Players/AreusArmorPlayer.Royal.cs b/Players/AreusArmorPlayer.Royal.cs index 6a14b2e0..725ed6b1 100644 --- a/Players/AreusArmorPlayer.Royal.cs +++ b/Players/AreusArmorPlayer.Royal.cs @@ -111,15 +111,12 @@ private void RoyalOnHitEffect(NPC target, NPC.HitInfo hit) Player.statMana += 5; } } - if (hit.DamageType == classChip) + if (!Player.HasBuff() || CommanderSet) { - if (!Player.HasBuff() || CommanderSet) + royalVoid += 3; + if (royalVoid > ROYAL_VOID_MAX) { - royalVoid += 3; - if (royalVoid > ROYAL_VOID_MAX) - { - royalVoid = ROYAL_VOID_MAX; - } + royalVoid = ROYAL_VOID_MAX; } } if (Player.HasBuff()) diff --git a/Players/SlayerPlayer.cs b/Players/SlayerPlayer.cs index 459d978b..238917b7 100644 --- a/Players/SlayerPlayer.cs +++ b/Players/SlayerPlayer.cs @@ -60,24 +60,16 @@ public override void ResetEffects() { creeperPet = false; maxCrystals = 6; - } - - public override void Initialize() - { - slayerMode = false; slayerSet = false; - TomeKnowledge = 0; omnicientTome = false; } - public override void SaveData(TagCompound tag) + public override void Initialize() { - tag["slayerMode"] = slayerMode; - - tag.Add("soulCrystalNames", soulCrystalNames); - tag["TomeKnowledge"] = TomeKnowledge; + slayerMode = false; + TomeKnowledge = 0; } public override void LoadData(TagCompound tag) @@ -96,6 +88,14 @@ public override void LoadData(TagCompound tag) } } + public override void SaveData(TagCompound tag) + { + tag["slayerMode"] = slayerMode; + + tag.Add("soulCrystalNames", soulCrystalNames); + tag["TomeKnowledge"] = TomeKnowledge; + } + public override void SyncPlayer(int toWho, int fromWho, bool newPlayer) { ModPacket packet = Mod.GetPacket(); diff --git a/ShardsConditions/ItemDrop/DownedBossRules.cs b/ShardsConditions/ItemDrop/DownedBossRules.cs index c4f0e44c..c9b2bd76 100644 --- a/ShardsConditions/ItemDrop/DownedBossRules.cs +++ b/ShardsConditions/ItemDrop/DownedBossRules.cs @@ -5,29 +5,6 @@ namespace ShardsOfAtheria.ShardsConditions.ItemDrop { - // Very simple drop condition: drop after Skeletron's defeat - public class DownedSkeletron : IItemDropRuleCondition - { - public bool CanDrop(DropAttemptInfo info) - { - if (!info.IsInSimulation) - { - return NPC.downedBoss3; - } - return false; - } - - public bool CanShowItemDropInUI() - { - return true; - } - - public string GetConditionDescription() - { - return Language.GetTextValue("Mods.ShardsOfAtheria.DropCondition.PostSkeletron"); - } - } - // Very simple drop condition: drop after Nova's defeat public class DownedValkyrie : IItemDropRuleCondition { @@ -47,7 +24,7 @@ public bool CanShowItemDropInUI() public string GetConditionDescription() { - return Language.GetTextValue("Mods.ShardsOfAtheria.DropCondition.PostSkeletron"); + return Language.GetTextValue("Mods.ShardsOfAtheria.Condition.DownedNova"); } } @@ -70,7 +47,7 @@ public bool CanShowItemDropInUI() public string GetConditionDescription() { - return Language.GetTextValue("Mods.ShardsOfAtheria.DropCondition.PostGolem"); + return Language.GetTextValue("Mods.ShardsOfAtheria.Condition.PostGolem"); } } @@ -93,7 +70,7 @@ public bool CanShowItemDropInUI() public string GetConditionDescription() { - return Language.GetTextValue("Mods.ShardsOfAtheria.DropCondition.PostCultist"); + return Language.GetTextValue("Mods.ShardsOfAtheria.Condition.PostCultist"); } } // Very simple drop condition: drop after Moon Lord's defeat @@ -115,7 +92,7 @@ public bool CanShowItemDropInUI() public string GetConditionDescription() { - return Language.GetTextValue("Mods.ShardsOfAtheria.DropCondition.PostMoonLord"); + return Language.GetTextValue("Mods.ShardsOfAtheria.Condition.PostMoonLord"); } } } \ No newline at end of file diff --git a/ShardsConditions/ItemDrop/IsInRain.cs b/ShardsConditions/ItemDrop/IsInRain.cs new file mode 100644 index 00000000..42c87d4a --- /dev/null +++ b/ShardsConditions/ItemDrop/IsInRain.cs @@ -0,0 +1,29 @@ +using Terraria; +using Terraria.GameContent.ItemDropRules; +using Terraria.Localization; + +namespace ShardsOfAtheria.ShardsConditions.ItemDrop +{ + // Very simple drop condition: drop while it is raining + public class IsInRain : IItemDropRuleCondition + { + public bool CanDrop(DropAttemptInfo info) + { + if (!info.IsInSimulation) + { + return Main.raining && info.player.ZoneOverworldHeight; + } + return false; + } + + public bool CanShowItemDropInUI() + { + return true; + } + + public string GetConditionDescription() + { + return Language.GetTextValue("Mods.ShardsOfAtheria.Conditions.RainSurface"); + } + } +} \ No newline at end of file diff --git a/ShardsConditions/ItemDrop/IsRaining.cs b/ShardsConditions/ItemDrop/IsRaining.cs new file mode 100644 index 00000000..d833f174 --- /dev/null +++ b/ShardsConditions/ItemDrop/IsRaining.cs @@ -0,0 +1,29 @@ +using Terraria; +using Terraria.GameContent.ItemDropRules; +using Terraria.Localization; + +namespace ShardsOfAtheria.ShardsConditions.ItemDrop +{ + // Very simple drop condition: drop while it is raining + public class IsRaining : IItemDropRuleCondition + { + public bool CanDrop(DropAttemptInfo info) + { + if (!info.IsInSimulation) + { + return Main.raining; + } + return false; + } + + public bool CanShowItemDropInUI() + { + return true; + } + + public string GetConditionDescription() + { + return Language.GetTextValue("Mods.ShardsOfAtheria.Conditions.Rain"); + } + } +} \ No newline at end of file diff --git a/ShardsConditions/ItemDrop/IsSlayerMode.cs b/ShardsConditions/ItemDrop/IsSlayerMode.cs index 7659a1b4..c3b373c9 100644 --- a/ShardsConditions/ItemDrop/IsSlayerMode.cs +++ b/ShardsConditions/ItemDrop/IsSlayerMode.cs @@ -1,5 +1,4 @@ using ShardsOfAtheria.Utilities; -using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.Localization; @@ -12,7 +11,7 @@ public bool CanDrop(DropAttemptInfo info) { if (!info.IsInSimulation) { - return Main.LocalPlayer.Slayer().slayerMode; + return info.player.Slayer().slayerMode; } return false; } @@ -24,7 +23,7 @@ public bool CanShowItemDropInUI() public string GetConditionDescription() { - return Language.GetTextValue("Mods.ShardsOfAtheria.DropConditions.Slayer"); + return Language.GetTextValue("Mods.ShardsOfAtheria.Conditions.Slayer"); } } } \ No newline at end of file diff --git a/ShardsOfAtheria.csproj b/ShardsOfAtheria.csproj index 9a6b3031..0136bff6 100644 --- a/ShardsOfAtheria.csproj +++ b/ShardsOfAtheria.csproj @@ -39,16 +39,21 @@ + + + + + diff --git a/ShardsUI/Upgrade/UpgradeUI.cs b/ShardsUI/Upgrade/UpgradeUI.cs index 059dd0f2..0fd8e414 100644 --- a/ShardsUI/Upgrade/UpgradeUI.cs +++ b/ShardsUI/Upgrade/UpgradeUI.cs @@ -25,7 +25,8 @@ class UpgradeUI : UIState VanillaItemSlotWrapper[] materialSlots; UIHoverImageButton upgradeButton; bool slotsCreated = false; - float HalfPanelSqrt => (500 - 22) / 2; + static int AtherianType => ModContent.NPCType(); + static Atherian FirstActiveAtherian => NPC.AnyNPCs(AtherianType) ? Main.npc[NPC.FindFirstNPC(AtherianType)].ModNPC as Atherian : null; public override void OnInitialize() { @@ -34,9 +35,9 @@ public override void OnInitialize() mainSlot = new VanillaItemSlotWrapper(scale: 0.8f) { - Left = { Pixels = HalfPanelSqrt - 41.6f / 2 }, - Top = { Pixels = HalfPanelSqrt - 41.6f / 2 }, - ValidItemFunc = item => item.IsAir || (!item.IsAir && item.IsUpgradable()) + Left = { Pixels = 239 - 41.6f / 2 }, + Top = { Pixels = 239 - 41.6f / 2 }, + ValidItemFunc = item => item.IsAir || (!item.IsAir && item.IsUpgradable() /*&& (FirstActiveAtherian.UpgradeFinished() || !FirstActiveAtherian.upgrading)*/) }; panel.Append(mainSlot); @@ -57,7 +58,7 @@ void CreateSlots(int amount) } materialSlots = new VanillaItemSlotWrapper[amount]; float rotation = MathHelper.TwoPi / amount; - Vector2 center = new(HalfPanelSqrt); + Vector2 center = new(239); for (int i = 0; i < amount; i++) { var vector = new Vector2(1, 0).RotatedBy(rotation * i) * 150; @@ -157,54 +158,57 @@ void UpgradeItem(UIMouseEvent evt, UIElement listeningElement) var shards = player.Shards(); #region Arsenal upgrades (Genesis and Ragnarok) - if (UpgradeArsenal1()) + if (mainSlot.Item.type == ModContent.ItemType()) { - int[,] materials = new[,] + if (UpgradeArsenal1()) { - { ModContent.ItemType(), 1 } - }; - ConsumeItems(materials); - shards.genesisRagnarockUpgrades++; - } - else if (UpgradeArsenal2()) - { - int[,] materials = new[,] + int[,] materials = new[,] + { + { ModContent.ItemType(), 1 } + }; + ConsumeItems(materials); + shards.genesisRagnarockUpgrades++; + } + else if (UpgradeArsenal2()) { - { ModContent.ItemType(), 1 }, - { ItemID.ChlorophyteBar, 14 } - }; - ConsumeItems(materials); - shards.genesisRagnarockUpgrades++; - } - else if (UpgradeArsenal3()) - { - int[,] materials = new[,] + int[,] materials = new[,] + { + { ModContent.ItemType(), 1 }, + { ItemID.ChlorophyteBar, 14 } + }; + ConsumeItems(materials); + shards.genesisRagnarockUpgrades++; + } + else if (UpgradeArsenal3()) { - { ModContent.ItemType(), 1 }, - { ItemID.BeetleHusk, 16 } - }; - ConsumeItems(materials); - shards.genesisRagnarockUpgrades++; - } - else if (UpgradeArsenal4()) - { - int[,] materials = new[,] + int[,] materials = new[,] + { + { ModContent.ItemType(), 1 }, + { ItemID.BeetleHusk, 16 } + }; + ConsumeItems(materials); + shards.genesisRagnarockUpgrades++; + } + else if (UpgradeArsenal4()) { - { ModContent.ItemType(), 1 }, - { ItemID.FragmentSolar, 18 } - }; - ConsumeItems(materials); - shards.genesisRagnarockUpgrades++; - } - else if (UpgradeArsenal5()) - { - int[,] materials = new[,] + int[,] materials = new[,] + { + { ModContent.ItemType(), 1 }, + { ItemID.FragmentSolar, 18 } + }; + ConsumeItems(materials); + shards.genesisRagnarockUpgrades++; + } + else if (UpgradeArsenal5()) { - { ModContent.ItemType(), 1 }, - { ItemID.LunarBar, 20 } - }; - ConsumeItems(materials); - shards.genesisRagnarockUpgrades++; + int[,] materials = new[,] + { + { ModContent.ItemType(), 1 }, + { ItemID.LunarBar, 20 } + }; + ConsumeItems(materials); + shards.genesisRagnarockUpgrades++; + } } #endregion #region Areus upgrades @@ -268,11 +272,10 @@ void UpgradeItem(UIMouseEvent evt, UIElement listeningElement) void ConsumeItems(int[,] items) { - for (int i = 0; i < items.Length / 2; i++) + for (int i = 0; i < items.GetLength(0); i++) { int itemid = items[i, 0]; int itemStack = items[i, 1]; - var player = Main.LocalPlayer; var ind = FindSlotWithItem(itemid); if (ind != -1) { @@ -288,6 +291,7 @@ void ConsumeItems(int[,] items) } } } + FirstActiveAtherian.upgrading = true; SoundEngine.PlaySound(SoundID.Item37); // Reforge/Anvil sound } int FindSlotWithItem(int item) @@ -374,10 +378,6 @@ bool ShouldUpgradeArsenal(int toLevel) { var item = mainSlot.Item; var player = Main.LocalPlayer; - if (item.type != ModContent.ItemType()) - { - return false; - } if (player.Shards().genesisRagnarockUpgrades >= toLevel) { return false; diff --git a/SoA.cs b/SoA.cs index 7bbffd8f..52c0489e 100644 --- a/SoA.cs +++ b/SoA.cs @@ -307,6 +307,14 @@ public static void TryElementCall(params object[] args) } } + public static void TryRedemptionCall(params object[] args) + { + if (ModLoader.TryGetMod("Redemption", out var redemption)) + { + redemption.Call(args); + } + } + public static string ChooseTitleText() { WeightedRandom title = new(); diff --git a/Utilities/ShardsHelpers.Item.cs b/Utilities/ShardsHelpers.Item.cs index ec35f650..3cba9009 100644 --- a/Utilities/ShardsHelpers.Item.cs +++ b/Utilities/ShardsHelpers.Item.cs @@ -57,12 +57,13 @@ public static void BasicInWorldGlowmask(this Item item, SpriteBatch spriteBatch, 0f); } - public static void AddAreus(this Item item, bool dark = false) + public static void AddAreus(this Item item, bool dark = false, bool forceAddElements = false) { item.type.AddAreusItem(dark); - if (!dark) + if (!dark || forceAddElements) { item.AddElementElec(); + item.AddRedemptionElement(7); } } public static void AddAreusItem(this int id, bool dark) @@ -117,5 +118,29 @@ public static void AddElementWood(this Item item) { SoA.TryElementCall("assignElement", item, 3); } + + /// + /// 1 (Arcane) + /// 2 (Fire) + /// 3 (Water) + /// 4 (Ice) + /// 5 (Earth) + /// 6 (Wind) + /// 7 (Thunder) + /// 8 (Holy) + /// 9 (Shadow) + /// 10 (Nature) + /// 11 (Poison) + /// 12 (Blood) + /// 13 (Psychic) + /// 14 (Celestial) + /// 15 (Exposive) + /// + /// + /// + public static void AddRedemptionElement(this Item item, int elementID) + { + SoA.TryRedemptionCall("addElementItem", elementID, item.type); + } } } diff --git a/Utilities/ShardsHelpers.NPC.cs b/Utilities/ShardsHelpers.NPC.cs index 8a453343..72ca7ead 100644 --- a/Utilities/ShardsHelpers.NPC.cs +++ b/Utilities/ShardsHelpers.NPC.cs @@ -197,12 +197,64 @@ public static void ElementMultipliers(this NPC npc, float[] multipliers) { SoA.TryElementCall("assignElement", npc, multipliers); } - public static readonly float[] NPCMultipliersFire = new float[] { 0.8f, 2f, 1f, 0.5f }; - public static readonly float[] NPCMultipliersAqua = new float[] { 0.5f, 0.8f, 2f, 1f }; + /// + /// 1 (Arcane) + /// 2 (Fire) + /// 3 (Water) + /// 4 (Ice) + /// 5 (Earth) + /// 6 (Wind) + /// 7 (Thunder) + /// 8 (Holy) + /// 9 (Shadow) + /// 10 (Nature) + /// 11 (Poison) + /// 12 (Blood) + /// 13 (Psychic) + /// 14 (Celestial) + /// 15 (Exposive) + /// + /// + /// + public static void AddRedemptionElement(this NPC npc, int elementID) + { + SoA.TryRedemptionCall("addElementNPC", elementID, npc.type); + } + + /// + /// Skeleton + /// SkeletonHumanoid + /// Humanoid + /// Undead + /// Spirit + /// Plantlike + /// Demon + /// Cold + /// Hot + /// Wet + /// Dragonlike + /// Inorganic + /// Robotic + /// Armed + /// Hallowed + /// Dark + /// Blood + /// Slime + /// + /// + /// + public static void AddRedemptionElementType(this NPC npc, string elementTypeName) + { + SoA.TryRedemptionCall("addNPCToElementTypeList", elementTypeName, npc.type); + } + + public static readonly float[] NPCMultipliersFire = [0.8f, 2f, 1f, 0.5f]; + + public static readonly float[] NPCMultipliersAqua = [0.5f, 0.8f, 2f, 1f]; - public static readonly float[] NPCMultipliersElec = new float[] { 1f, 0.5f, 0.8f, 2f }; + public static readonly float[] NPCMultipliersElec = [1f, 0.5f, 0.8f, 2f]; - public static readonly float[] NPCMultipliersWood = new float[] { 2f, 1f, 0.5f, 0.8f }; + public static readonly float[] NPCMultipliersWood = [2f, 1f, 0.5f, 0.8f]; } } diff --git a/Utilities/ShardsHelpers.Projectile.cs b/Utilities/ShardsHelpers.Projectile.cs index ebb311f0..d4b039e3 100644 --- a/Utilities/ShardsHelpers.Projectile.cs +++ b/Utilities/ShardsHelpers.Projectile.cs @@ -250,9 +250,14 @@ public static SoAGlobalProjectile Atheria(this Projectile projectile) return projectile.GetGlobalProjectile(); } - public static void AddAreus(this Projectile projectile, bool dark = false) + public static void AddAreus(this Projectile projectile, bool dark = false, bool forceAddElements = false) { projectile.type.AddAreusProj(dark); + if (!dark || forceAddElements) + { + projectile.AddElementElec(); + projectile.AddRedemptionElement(7); + } } public static void AddAreusProj(this int projID, bool dark) { @@ -284,5 +289,29 @@ public static void AddElementWood(this Projectile projectile) { SoA.TryElementCall("assignElement", projectile, 3); } + + /// + /// 1 (Arcane) + /// 2 (Fire) + /// 3 (Water) + /// 4 (Ice) + /// 5 (Earth) + /// 6 (Wind) + /// 7 (Thunder) + /// 8 (Holy) + /// 9 (Shadow) + /// 10 (Nature) + /// 11 (Poison) + /// 12 (Blood) + /// 13 (Psychic) + /// 14 (Celestial) + /// 15 (Exposive) + /// + /// + /// + public static void AddRedemptionElement(this Projectile projectile, int elementID) + { + SoA.TryRedemptionCall("addElementProj", elementID, projectile.type); + } } } diff --git a/Utilities/ShardsHelpers.cs b/Utilities/ShardsHelpers.cs index 3dd603fb..1d77518c 100644 --- a/Utilities/ShardsHelpers.cs +++ b/Utilities/ShardsHelpers.cs @@ -106,6 +106,15 @@ public static Vector2 SlowDown(this Vector2 vector, float slowdown = 1f) return vector; } + public static void AdjustMagnitude(ref Vector2 vector) + { + float magnitude = (float)Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y); + if (magnitude > 6f) + { + vector *= 14f / magnitude; + } + } + public static Color UseA(this Color color, int alpha) => new(color.R, color.G, color.B, alpha); public static Color UseA(this Color color, float alpha) => new(color.R, color.G, color.B, (int)(alpha * 255));