Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vengeful Spirit, Living Blood, Haunted Set Tweaks #770

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content/Items/Gravedigger/Materials.LivingBlood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void DropLivingBlood(NPC npc, NPCLoot npcLoot)
{
if (npc.type == NPCID.BloodZombie || npc.type == NPCID.Drippler)
{
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<LivingBlood>(), 6, 1, 3));
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<LivingBlood>(), 5, 1, 4));
}
}
}
Expand Down
29 changes: 27 additions & 2 deletions Content/Items/Haunted/Armors.PoltergeistArmor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using StarlightRiver.Content.Items.Gravedigger;
using Mono.Cecil;
using StarlightRiver.Content.Items.Gravedigger;
using System.Collections.Generic;
using System.Linq;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ID;
using static Terraria.ModLoader.ModContent;

Expand All @@ -12,6 +15,17 @@ public class PoltergeistHead : ModItem
public List<Projectile> minions = new();
public int timer;
public int sleepTimer;
public (string singular, string plural)[] minionBoredomMessages =
{
("Your _ seems bored...", "Your _ seem bored..."),
("Your _ lost interest...", "Your _ lost interest..."),
("Your _ is hanging limply...", "Your _ are hanging limply..."),
("Looks like your _ isn't feeling it...", "Looks like your _ aren't feeling it..."),
("Your _ is clearly unimpressed...", "Your _ are clearly unimpressed..."),
("It seems the magic is just gone for your _...", "It seems the magic is just gone for your _..."),
("Looks like your _ is totally checked out...", "Looks like your _ are totally checked out..."),
("Your _ is hovering aimlessly...", "Your _ are hovering aimlessly..."),
};

public override string Texture => AssetDirectory.HauntedItem + Name;

Expand Down Expand Up @@ -78,7 +92,17 @@ public override void UpdateArmorSet(Player player)
}

if (player == Main.LocalPlayer && sleepTimer == 1 && minions.Count > 0) //warning message
Main.NewText("Your haunted weapons seem bored...", new Color(200, 120, 255));
{
AdvancedPopupRequest request = default;
(string messageSingular, string messagePlural) = minionBoredomMessages[Main.rand.Next(minionBoredomMessages.Length)];
request.Text = messagePlural.Replace("_", "haunted weapons");
if (minions.Count == 1)
request.Text = messageSingular.Replace("_", (minions.First().ModProjectile as PoltergeistMinion).Item.Name);
request.DurationInFrames = 180;
request.Color = new Color(200, 120, 255);
request.Velocity = new Vector2(0f, -4f);
PopupText.NewText(request, player.Top);
}

if (sleepTimer > 0) //decrement sleep timer
sleepTimer--;
Expand Down Expand Up @@ -115,6 +139,7 @@ private void HauntItem(On_Player.orig_KeyDoubleTap orig, Player player, int keyD

helm.minions.Add(proj);
helm.sleepTimer = 1200;
SoundEngine.PlaySound(item.UseSound.Value with { Pitch = item.UseSound.Value.Pitch - 0.3f});
}
}

Expand Down
2 changes: 1 addition & 1 deletion Content/NPCs/Misc/LootWraith.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public override void FindFrame(int frameHeight)

public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ItemDropRule.Common(ItemType<VengefulSpirit>(), 1, 2, 4));
npcLoot.Add(ItemDropRule.Common(ItemType<VengefulSpirit>(), 1, 4, 6));
}

private void UpdateChain()
Expand Down
4 changes: 2 additions & 2 deletions Content/WorldGeneration/GenerateLootWraiths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ private void LootWraithGen()
{
foreach (Chest chest in Main.chest)
{
if (chest != null && WorldGen.genRand.NextBool(8))
if (chest != null && WorldGen.genRand.NextBool(6))
{
int frameX = Framing.GetTileSafely(chest.x, chest.y).TileFrameX / 36;
if (frameX == 11 || frameX == 1)
if (frameX == 11 || frameX == 1) //Golden or Frozen Chests
{
var npc = NPC.NewNPCDirect(new EntitySource_Misc("Loot Wraith"), chest.x * 16, chest.y * 16, ModContent.NPCType<LootWraith>());
if (npc.ModNPC is LootWraith wraith)
Expand Down
Loading