-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix item distribution on level tresholds #848
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,14 +40,20 @@ module.exports = { | |
}, | ||
async switchShininessAndGet(id) { | ||
let shinx = await this.getShinx(id, ['user_id', 'shiny']); | ||
return shinx.switchShininessAndGet(); | ||
let user = await this.getUser(id, ['user_id']); | ||
let hasShinyCharm = await this.hasEventTrophy(user.user_id, 'Shiny Charm'); | ||
if (hasShinyCharm) { | ||
return shinx.switchShininessAndGet(); | ||
} else { | ||
throw new Error('User does not have the Shiny Charm'); | ||
} | ||
}, | ||
async changeAutoFeed(id, mode) { | ||
let shinx = await this.getShinx(id, ['user_id', 'auto_feed']); | ||
return shinx.setAutoFeed(mode); | ||
}, | ||
async addExperience(id, experience) { | ||
let shinx = await this.getShinx(id, ['user_id', 'experience']); | ||
let shinx = await this.getShinx(id, ['user_id', 'experience', 'level']); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Level is determined from the EXP count instead of being stored seperately so it doesn't really make sense to pass that in the arguments. Also doesn't look like you're using the level anyways so idk. |
||
const res = await shinx.addExperienceAndLevelUp(experience); | ||
if (res.pre != res.post) { | ||
if (hasPassedLevel(res.pre, res.post, 5)) await this.addEventTrophy(id, 'Bronze Trophy'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've gathered this bug is not in the functionality for switching between shiny and non-shiny.
This seems to work correctly already.
The bug seems to be in users not receiving a shiny charm, or any level-up rewards, when reaching the required level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will look into it tomorrow if i remember