Skip to content

Feature/shiny stone - #16

Open
EJCrispy wants to merge 9 commits into
drunderscore:masterfrom
EJCrispy:feature/shiny-stone
Open

Feature/shiny stone#16
EJCrispy wants to merge 9 commits into
drunderscore:masterfrom
EJCrispy:feature/shiny-stone

Conversation

@EJCrispy

@EJCrispy EJCrispy commented Apr 7, 2025

Copy link
Copy Markdown

Basically added a new debuff that I call "Charged" but it won't be called that because I didn't change the localization. But basically this debuff will prevent the shinystone item from doing, and you get this debuff for 60 seconds whenever shinystone is switched on, and 15 seconds when you respawn with shinystone equipped. Also I don't know if the asset will sync with it, I don't really know if that works but we will see I suppose.

EJCrispy added 2 commits April 6, 2025 20:39
… not sure if I need to do something special for the asset to line up, and because It's my first time doing this I probably fucked up. Also the code might be shit but we will see. Anyways I'm supposed to describe my change so: Added new debuff that prevents shiny stone from working, preventing players from switching shiny stone on/off whenever they need to heal.
… not sure if I need to do something special for the asset to line up, and because It's my first time doing this I probably fucked up. Also the code might be shit but we will see. Anyways I'm supposed to describe my change so: Added new debuff that prevents shiny stone from working, preventing players from switching shiny stone on/off whenever they need to heal. Also this time im pushing this to remote.
@EJCrispy

EJCrispy commented Apr 7, 2025

Copy link
Copy Markdown
Author

Shoulda changed the title

@drunderscore drunderscore left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. I know understand why this item is a little silly in PvP 🙄

Most comments could be removed if the code sufficiently explains what it does or if it isn't appropriate... although I am known to be bad at that -- I'll go through and remove my poor comments.

Try formatting your code inside of your editor before you commit. If it doesn't do anything that's alright, I'll go make an editor config and deal with it later.

Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment thread ShinyStoneHotswap.cs Outdated
Comment on lines +17 to +49
public class ShinyStoneDisabler : ModPlayer
{
private bool hadShinyStoneLastFrame;

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

// Apply debuff when first equipped or when you relog and rejoin (unintentional but works so who gafs)
if (hasShinyStone && !hadShinyStoneLastFrame)
{
Player.AddBuff(ModContent.BuffType<ShinyStoneHotswap>(), 3600); // 60 seconds of charging upon being swapped on
}

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

hadShinyStoneLastFrame = hasShinyStone;
}

public override void OnRespawn()
{
// We re-apply debuff if equipped and you respawn
//TODO: we could maybe make it so that if you equip the shiny stone witin the bounds of the spawnbox you don't get the Charging debuff
if (IsShinyStoneEquipped())
{
Player.AddBuff(ModContent.BuffType<ShinyStoneHotswap>(), 900); // 15 seconds of Charging after respawning
}
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the decision long ago that TML is too stupid to get their internal names correctly (in a proper and pleasing way) for us to bother having multiple ModPlayer for multiple features, as much as I would want this.

Let's collapse this into AdventurePlayer

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe im here too

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont worry guys i fixed it

Comment thread ShinyStoneHotswap.cs Outdated
//TODO: we could maybe make it so that if you equip the shiny stone witin the bounds of the spawnbox you don't get the Charging debuff
if (IsShinyStoneEquipped())
{
Player.AddBuff(ModContent.BuffType<ShinyStoneHotswap>(), 900); // 15 seconds of Charging after respawning

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be squashed into the preceding commit.

EJCrispy added 7 commits April 6, 2025 22:00
…is works but I don't have high hopes not going to lie.
…is works but I don't have high hopes not going to lie.

Added the shiny stone code I wrote from addon to here. Truthfully I'm not sure if I need to do something special for the asset to line up, and because It's my first time doing this I probably fucked up. Also the code might be shit but we will see. Anyways I'm supposed to describe my change so: Added new debuff that prevents shiny stone from working, preventing players from switching shiny stone on/off whenever they need to heal. Also this time im pushing this to remote.
@drunderscore

Copy link
Copy Markdown
Owner

If you want a review on this from me, you'll have to squash and force-push to the branch so I can figure out what's going on -- like this I'll never be able to review it.

@MatteSevai

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants