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

Initial Implementation of Global for Prefix Benefits #4185

Draft
wants to merge 1 commit into
base: 1.4.4
Choose a base branch
from

Conversation

Solxanich
Copy link
Collaborator

What is the new feature?

#4184

Why should this be part of tModLoader?

To increase cross-mod compatibility and 'vanilla'-like behavior.

Are there alternative designs?

Could implement new GlobalPrefix instead of adding another hook to GlobalItem class

For one hook, I'm not sure it adds significant value to break out a net new global. There isn't exactly a 'Prefix' entity to apply this to in 'normal' fashion. And all the other 'Update Accessory' logic is already in GlobalItem.
On the flip side, it would be significantly more consistent with other hook usage & I assume more performant.

Sample usage for the new feature

              {
                  /* Prehardmode = 1
                   * Hardmode = 2
                   * Post-Moon Lord = 3
                   * Post-DoG = 4
                   */
  
                  if (DownedBossSystem.downedDoG)
                      self.statDefense += 3;
                  else if (NPC.downedMoonlord)
                      self.statDefense += 2;
                  else if (Main.hardMode)
                      self.statDefense += 1;
  
                  self.endurance += 0.0025f;
              }```

### ExampleMod updates

@Solxanich Solxanich marked this pull request as draft April 28, 2024 00:47
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.

None yet

1 participant