Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bb28f7f
AdventureItem.cs: Spectre Pickaxe can break Temple brick
MatteSevai May 24, 2025
aaeaf64
AdventurePlayer.cs: Added Shiny stone switch penalty
MatteSevai May 24, 2025
cfc89e9
AdventurePlayer.cs: Tiki armor KB immunity buff
MatteSevai May 24, 2025
7d79285
added psudo terra blade
MatteSevai May 24, 2025
e78cb7b
updated shiny stone localization
MatteSevai May 24, 2025
cb091b7
Replaced garmon's SHITTY ASS code with my COOL SHIT that makes it so …
EJCrispy May 24, 2025
00b1bbd
AdventureItem.cs: No Underground QS
MatteSevai May 24, 2025
2a25d02
Makes first wof drop 2 emblems
EJCrispy May 26, 2025
2eb1393
Updating this to account for Biome mimics
EJCrispy May 26, 2025
ece09e2
Makes all summons* dissapear when not in invetory to prevent sharing
EJCrispy May 26, 2025
3bd2f22
skeletron hand garenteed
MatteSevai May 29, 2025
8d62979
no empress underground
MatteSevai May 29, 2025
2922e72
Makes the spac and claff projectiles disappear on dead
EJCrispy May 28, 2025
4a6479d
updated shiny stone cooldown bebuff icon
MatteSevai May 31, 2025
57a6a5c
added config link
MatteSevai Jun 1, 2025
119a142
Spectre Hood setbonus works in pvp!
EJCrispy Jun 1, 2025
ee7f6a1
Revert "Merge branch 'pr/34' into feature/missinginmaster"
MatteSevai Jun 1, 2025
7d087c1
Update PvPAdventure_AdventureConfig.json
MatteSevai Jun 3, 2025
1064993
removed extra code
MatteSevai Jun 5, 2025
ba1f33d
new drop rules
MatteSevai Jun 7, 2025
fa7e02f
ADDED new money trough shimmer recipe
MatteSevai Jun 9, 2025
64cc63a
remvoed tikki kb immuinkty
MatteSevai Jun 9, 2025
6c74251
Makes Flask Buffs go away on death
EJCrispy Jun 8, 2025
1c14f86
When you have tier 3 beetleoffense you get the glowing eye vanity
EJCrispy Jun 8, 2025
65eedde
nerfed beetle armor
MatteSevai Jun 10, 2025
5304b78
remvoed lingereing rainclouds on death
MatteSevai Jun 10, 2025
2e817fa
config update
MatteSevai Jun 10, 2025
04b6247
config update
MatteSevai Jun 10, 2025
3ae80c2
Revert "AdventureInventory: Remove armor vanity slots"
MatteSevai Jun 15, 2025
6cd504b
added new chloro rate options
MatteSevai Jun 19, 2025
dab65d8
Added shimmer crafting for regualr ass mimics. Also changed plantera …
EJCrispy Jun 19, 2025
8088c7e
readded tikki no kb
MatteSevai Jun 21, 2025
53cf986
remnoved duplicate code
MatteSevai Jun 22, 2025
194f1da
updated icon
MatteSevai Jul 2, 2025
8155805
nerfged beetle might buff
MatteSevai Jul 2, 2025
f836cc9
upped unholy trident drop rates
MatteSevai Jul 2, 2025
2dfdde9
added bad luck shimmer recipes for dungeon
MatteSevai Jul 2, 2025
6aae84f
Merge branch 'master' into feature/missinginmaster
MatteSevai Jul 2, 2025
ef8ae4b
plant first drop chagned
MatteSevai Jul 9, 2025
fa960e9
power cell now yellow rarity
MatteSevai Jul 9, 2025
1399db5
Reworked nightblow behavior
EJCrispy Jul 11, 2025
07c5be5
Thanks resin! he fixed it!
EJCrispy Jul 11, 2025
e3af842
Decreased rotation strength and requires usage to home to mouse now
EJCrispy Jul 11, 2025
d711dcf
changed some stats
MatteSevai Jul 11, 2025
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
36 changes: 32 additions & 4 deletions AdventureBuff.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;

Expand All @@ -19,8 +21,8 @@ public override void Update(int type, Player player, ref int buffIndex)

if (player.beetleOrbs >= 1)
{
damage += 0.15f;
attackSpeed += 0.15f;
damage += 0.10f;
attackSpeed += 0.10f;
}

if (player.beetleOrbs >= 2)
Expand All @@ -31,8 +33,8 @@ public override void Update(int type, Player player, ref int buffIndex)

if (player.beetleOrbs >= 3)
{
damage += 0.05f;
attackSpeed += 0.20f;
damage += 0.10f;
attackSpeed += 0.10f;
}

player.GetDamage<MeleeDamageClass>() += damage;
Expand All @@ -48,4 +50,30 @@ public override bool RightClick(int type, int buffIndex)

return true;
}

public class RemoveFlaskBuffsOnDeath : ModPlayer
{
// Array of buff IDs to remove on death
private readonly int[] buffsToRemove = { 71, 73, 74, 75, 76, 77, 78, 79 }; //Every single Flask buff that doesn't go away on death for some reason

public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
{

for (int i = 0; i < Player.MaxBuffs; i++)
{
int buffType = Player.buffType[i];


foreach (int buffId in buffsToRemove)
{
if (buffType == buffId)
{
Player.DelBuff(i); // Remove the buff
i--; // Adjust index since we removed a buff
break;
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions AdventureConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ public class WorldGenerationConfig
[DefaultValue(30)] public int PlanteraBulbChanceDenominator { get; set; } = 30;

[DefaultValue(8)] public int ChlorophyteSpreadChanceModifier { get; set; } = 8;

[Range(1, 1000)]
[DefaultValue(300)] public int ChlorophyteGrowChanceModifier { get; set; } = 300;

[Range(1, 999999)]
[DefaultValue(300)] public int ChlorophyteGrowLimitModifier { get; set; } = 300;
}

public WorldGenerationConfig WorldGeneration { get; set; } = new();
Expand Down
67 changes: 58 additions & 9 deletions AdventureDropDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
using System.Linq;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using System.Reflection;
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
using Mono.Cecil.Cil;

namespace PvPAdventure;

Expand Down Expand Up @@ -63,6 +67,11 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
ModifyDropRate(drop, ItemID.Stinger, 1, 1);
break;

case NPCID.GiantTortoise:
foreach (var drop in drops)
ModifyDropRate(drop, ItemID.TurtleShell, 1, 4);
break;

case NPCID.Necromancer:
case NPCID.NecromancerArmored:
foreach (var drop in drops)
Expand Down Expand Up @@ -139,6 +148,11 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
ModifyDropRate(drop, ItemID.ButterflyDust, 1, 1);
break;

case NPCID.GiantCursedSkull:
foreach (var drop in drops)
ModifyDropRate(drop, ItemID.ShadowJoustingLance, 1, 12);
break;

case NPCID.Mothron:
foreach (var drop in drops)
ModifyDropRate(drop, ItemID.BrokenHeroSword, 1, 2);
Expand All @@ -149,6 +163,11 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
ModifyDropRate(drop, ItemID.MagicQuiver, 1, 30);
break;

case NPCID.RedDevil:
foreach (var drop in drops)
ModifyDropRate(drop, ItemID.UnholyTrident, 1, 10);
break;

case NPCID.Lihzahrd:
case NPCID.LihzahrdCrawler:
case NPCID.FlyingSnake:
Expand Down Expand Up @@ -263,15 +282,6 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
]));
break;

case NPCID.GiantTortoise:
foreach (var drop in drops)
ModifyDropRate(drop, ItemID.TurtleShell, 1, 5);
break;

case NPCID.GiantCursedSkull:
foreach (var drop in drops)
ModifyDropRate(drop, ItemID.ShadowJoustingLance, 1, 12);
break;
}
}

Expand All @@ -295,4 +305,43 @@ public static IItemDropRule OnItemDropDatabaseRegisterToGlobal(On_ItemDropDataba

return entry;
}
public class PlanteraDropEdit : ModSystem
{
private static ILHook planteraHook;

public override void PostSetupContent()
{
// Apply the IL edit to change Plantera's first-time drop from item 758 to 1255
MethodInfo method = typeof(Terraria.GameContent.ItemDropRules.ItemDropDatabase).GetMethod("RegisterBoss_Plantera",
BindingFlags.NonPublic | BindingFlags.Instance);

planteraHook = new ILHook(method, PlanteraDropILEdit);
}

public override void Unload()
{
planteraHook?.Dispose();
}

private static void PlanteraDropILEdit(ILContext il)
{
ILCursor cursor = new ILCursor(il);

// Look for the instruction that loads the value 758 (Grenade Launcher ID)
// This should be: ldc.i4 758 (or ldc.i4.s 758 if it's a short form)
if (cursor.TryGotoNext(MoveType.Before,
i => i.MatchLdcI4(758))) // Match loading the constant 758
{
// Replace the 758 with 1255
cursor.Remove(); // Remove the ldc.i4 758 instruction
cursor.Emit(OpCodes.Ldc_I4, 1255); // Emit ldc.i4 1255 instead

ModContent.GetInstance<PvPAdventure>().Logger.Info("Successfully changed Plantera's first-time drop from item 758 to 1255");
}
else
{
ModContent.GetInstance<PvPAdventure>().Logger.Error("Failed to find item ID 758 in RegisterBoss_Plantera method");
}
}
}
}
52 changes: 51 additions & 1 deletion AdventureItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,61 @@ public class AdventureItem : GlobalItem
ItemID.Sets.Factory.CreateBoolSet(ItemID.MagicMirror, ItemID.CellPhone, ItemID.IceMirror, ItemID.Shellphone,
ItemID.ShellphoneSpawn);

public class GelatinCrystalRestriction : GlobalItem
{
public override bool CanUseItem(Item item, Player player)
{
if (item.type == ItemID.QueenSlimeCrystal)
{
bool isUnderground = player.position.Y > Main.worldSurface * 16;
bool inUndergroundHallow = isUnderground && player.ZoneHallow;

if (inUndergroundHallow)
{
Main.NewText("Queen Slime refuses to emerge in the corrupted crystals here!", 255, 50, 50);
return false;
}

// Still block summon in other underground areas but without message
if (isUnderground)
{
return false;
}
}
return base.CanUseItem(item, player);
}
}
public class PrismaticLacewingRestriction : GlobalItem
{
public override bool CanUseItem(Item item, Player player)
{
// Target Prismatic Lacewing (Empress summon item)
if (item.type == ItemID.EmpressButterfly)
{
// Check if player is below surface level
bool isUnderground = player.position.Y > Main.worldSurface * 16;
bool inUndergroundHallow = isUnderground && player.ZoneHallow;

if (isUnderground)
{
Main.NewText("The sacred light refuses to manifest in these corrupted depths!", 200, 150, 255);
return false;
}
}
return base.CanUseItem(item, player);
}
}

public override void SetDefaults(Item item)
{
var adventureConfig = ModContent.GetInstance<AdventureConfig>();

if (item.type == ItemID.LihzahrdPowerCell)
{

item.rare = ItemRarityID.Yellow;
}

if (RecallItems[item.type])
{
var recallTime = adventureConfig.RecallFrames;
Expand Down Expand Up @@ -50,7 +101,6 @@ public override void SetDefaults(Item item)
if (statistics.Value != null)
item.value = statistics.Value.Value;
}

if (item.type == ItemID.SpectrePickaxe || item.type == ItemID.ShroomiteDiggingClaw)
item.pick = 210;
}
Expand Down
93 changes: 83 additions & 10 deletions AdventurePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,77 @@ public override bool PreKill(double damage, int hitDirection, bool pvp, ref bool
return true;
}

private bool hadShinyStoneLastFrame;

public override void PostUpdateEquips()
{
// Check if Shiny Stone is equipped
bool hasShinyStone = IsShinyStoneEquipped();

// Apply debuff when first equipped or after respawn
if (hasShinyStone && !hadShinyStoneLastFrame)
{
Player.AddBuff(ModContent.BuffType<ShinyStoneHotswap>(), 3600); // 60 seconds
}

// Disable Shiny Stone effects while debuffed
if (Player.HasBuff(ModContent.BuffType<ShinyStoneHotswap>()))
{
Player.shinyStone = false;
}

hadShinyStoneLastFrame = hasShinyStone;

if (Player.beetleOffense)
{
Player.GetDamage<MeleeDamageClass>() += 0;
Player.GetAttackSpeed<MeleeDamageClass>() += 0;
}
else
{
// If we don't have the beetle offense set bonus, remove all possible buffs.
Player.ClearBuff(BuffID.BeetleMight1);
Player.ClearBuff(BuffID.BeetleMight2);
Player.ClearBuff(BuffID.BeetleMight3);
}

if (Player.HasBuff(BuffID.BeetleMight3))
{
// we apply the glowing eye effect from Yoraiz0rsSpell item
Player.yoraiz0rEye = 33;
}

// Check if wearing full Tiki Armor
if (Player.armor[0].type == ItemID.TikiMask &&
Player.armor[1].type == ItemID.TikiShirt &&
Player.armor[2].type == ItemID.TikiPants)
{
Player.noKnockback = true;
}

}
public override void OnRespawn()
{
// Re-apply debuff if equipped during respawn
if (IsShinyStoneEquipped())
{
Player.AddBuff(ModContent.BuffType<ShinyStoneHotswap>(), 900);
}
}

private bool IsShinyStoneEquipped()
{
for (int i = 3; i < 10; i++) // Check all accessory slots
{
if (Player.armor[i].type == ItemID.ShinyStone &&
(i < 7 || !Player.hideVisibleAccessory[i - 3]))
{
return true;
}
}
return false;
}

public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource)
{
// Only play kill markers on clients that we hurt that aren't ourselves
Expand Down Expand Up @@ -874,16 +945,7 @@ public override void UpdateBadLifeRegen()
}
}

public override void PostUpdateEquips()
{
if (!Player.beetleOffense)
{
// If we don't have the beetle offense set bonus, remove all possible buffs.
Player.ClearBuff(BuffID.BeetleMight1);
Player.ClearBuff(BuffID.BeetleMight2);
Player.ClearBuff(BuffID.BeetleMight3);
}
}


private void SendPingPong()
{
Expand Down Expand Up @@ -957,4 +1019,15 @@ public override string ToString()
{
return $"{Player.whoAmI}/{Player.name}/{DiscordUser?.Id}";
}
}
public class ShinyStoneHotswap : ModBuff
{
public override string Texture => $"PvPAdventure/Assets/Buff/ShinyStoneHotswap";

public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = false; // Show timer
}
}
Loading