Skip to content

Feature: Add badge boost flag in data.json#3

Open
Adelay95 wants to merge 1 commit into
emilyploszaj:masterfrom
Adelay95:feature/badge_boost_flag
Open

Feature: Add badge boost flag in data.json#3
Adelay95 wants to merge 1 commit into
emilyploszaj:masterfrom
Adelay95:feature/badge_boost_flag

Conversation

@Adelay95

Copy link
Copy Markdown

Add badge boost flag to data.json
Implement conditions in the calc weather or not should be considered
Add feature_flags object to data.json for future compatibility

Add badge boost flag

@emilyploszaj emilyploszaj 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.

Couple nits, going in the right direction. Currently we're hardcoded for gen 2 badge boost but I think that's probably fine to start with? No need to overdevelop features when more pressing things could be focused on.

Comment thread ck+/script/data.js
]);

//ADD GENERAL FLAGS OBJECT TO GLOBAL VARIABLES
const game_general_flags = {

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.

Might be better to go with a shorter name? I imagine flags will be used all over the codebase so something like flags would probably same some time.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Got it, I tend to use longer names to avoid comments but, in this case, I used both of them. I'll try to use shorter names from now on.

Comment thread ck+/script/data.js

//ADD GENERAL FLAGS TO DATA PARSE
const feature_flags = j.feature_flags;
game_general_flags.badge_boost = feature_flags.badge_boost;

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 is good for now but in the future we might want to go with a more general case parsing solution, what do you think?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think the parsing is fine, every data.json file will have a series of specific parameters that define how the calc should behave. Documentation of the parsing part should be the first one imo.

Comment thread ck+/script/data.js
"bonemerang", "double-hit", "double-kick", "twineedle"
]);

//ADD GENERAL FLAGS OBJECT TO GLOBAL VARIABLES

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.

nit: space before comment text

Comment thread ck+/script/calc.js
}
if (defenderBoost && special && badges >= specialBadges) {
d = parseInt(d * 1.125);

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.

nit: no double blank lines in method bodies

Comment thread ck+/data.json
@@ -1,4 +1,8 @@
{

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.

nit: blank lines in json

@Adelay95

Adelay95 commented Mar 6, 2023

Copy link
Copy Markdown
Author

I agree with the comments. But now that I think about it, badge_boost flag should not be a boolean type. It should be three types:

  • No boost at all
  • Type boost + Stat boost (Gen 2)
  • Stat boost (Gen 3 and onwards)

WDYT?

@Adelay95

Adelay95 commented Mar 6, 2023

Copy link
Copy Markdown
Author

Also, I think the roadmap of the general calc should be first define the flags and apply them to the code, and then implement the other cases that are not right now in the CK+ calc.

@emilyploszaj

Copy link
Copy Markdown
Owner

We could have a more general badge boost solution to accommodate rom hacks. For instance:

"badge_boost": [
  {
    "badges": 2,
    "type": "dark",
    "multiplier": 1.5
  },
  {
    "badges": 6,
    "stat": "spa",
    "multiplier": 0.5
  }
]

Doesn't even necessarily have to be a flag, could just be a field where empty is equivalent to "no boosts". I think your roadmap makes sense.

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.

2 participants