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

Parser Changes #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SomeRandom-WhoLikesCode
Copy link
Contributor

PLEASE NOTE:
While this all works locally I would really appreciate a second pair of eyes to see if there is anything else I can do or that needs to be changed!

Also didn't understand how to add pets to the Pet.js so please make sure that it is correct or I can remove it if needed

Things added:
Pristine stat
Social skill support (even though it doesn't appear in API?)

Things changed:
Cleaned up API response by combining things under one object if they related to each other (e.g. quiver, talisman bag)
Added some level data to dungeon object

PLEASE NOTE:
While this all works locally i would really appreciate a second pair of eyes to see if there is anything else i can or that needs to be changed!

Things added:
Pristine stat
Social skill support (even though it doesn't appear in api?)

Things changed:
Cleaned up api response by combining things under one object if they related to each other (e.g quiver, talisman bag)
Added some level data to dungeon object
@builder-247
Copy link
Member

Thanks for your contribution. Can you run the linter?

disabled_potions,
cake_buffs: cake_soul_buffs,
};
this.HOTM_Data = {
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to all lowercase

getPristineStats() {
// check if actibe armour has any gems that are topaz
if (this.armor.length < 1) return;
const gemstones = {
Copy link
Member

Choose a reason for hiding this comment

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

You probably meant to use the values from constants here

},
};
for (let i = 0; i < this.armor.length; i++) {
const armour_Piece = this.armor[i];
Copy link
Member

Choose a reason for hiding this comment

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

The general style guide applies here as well, variables should use camelCase aside the values appearing in the API that use snake_case

@@ -141,6 +141,9 @@ function getLevelByXp(xp = 0, type) {
case 'runecrafting':
xpTable = constants.runecraftingXp;
break;
case 'social':
xpTable = constants.runecraftingXp;
Copy link
Member

Choose a reason for hiding this comment

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

social uses a different xp table

},
3: {
ability: [0.15],
4: {},
Copy link
Member

Choose a reason for hiding this comment

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

accidentally a property of 3

}

// eslint-disable-next-line class-methods-use-this
calculateLevel(experience) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be moved to utils with a more descriptive name

return Math.min(level, 50);
}

addLevelsToLocation(directive) {
Copy link
Member

Choose a reason for hiding this comment

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

this could also be more descriptive

@@ -382,7 +378,9 @@ class Player {
let pristine_values = [];
const temp_inv = this.inventory;
for (let i = 0; i < 8; i++) {
if (['pickaxe', 'drill', 'gauntlet'].includes(temp_inv[`${i}`].type)) {
const item = temp_inv[`${i}`];
Copy link
Member

Choose a reason for hiding this comment

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

you can just use temp_inv[i] here :)

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