Feature/shiny stone - #16
Conversation
… 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.
|
Shoulda changed the title |
drunderscore
left a comment
There was a problem hiding this comment.
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.
| 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 | ||
| } | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
dont worry guys i fixed it
| //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 |
There was a problem hiding this comment.
This should be squashed into the preceding commit.
…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.
…Adventure into feature/shiny-stone
…sition. Still can't see errors
|
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. |
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.