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

[GH-437] Claim dungeon AFK Rewards #487

Merged
merged 6 commits into from
Jun 12, 2024
Merged

Conversation

ncontinanza
Copy link
Collaborator

@ncontinanza ncontinanza commented Jun 10, 2024

Closes #437

Motivation

We need to claim the AFK rewards every time the user goes to the Dungeon Settlement

Summary of changes

  • Claim AFK rewards when entering the Dungeon Settlement scene

How has this been tested?

  1. Start the backend using the main branch. Before doing it, you may want to edit apps/champions/priv/dungeon_settlement_levels.json and increase the amount of afk supplies provided by the first Dungeon level. Changing it to 1440 will give you 1 supply per minute, and you won't need to wait that long to test this behaviour.
  2. Get your user in the backend and check the initial amount of supplies. To do so, you can run {:ok, user} = Champions.Users.get_user(user_id) and then user.currencies to see the available currencies.
  3. Wait a few moments (depending of what you did in step 1) and go to the Dungeon Settlement scene.
  4. Get your user from the backend again, and check that the claimed supplies were added.

You'll notice that if you come back and forth from that scene during the waiting time, you won't receive any rewards despite how long you wait. We'll address this problem in this issue: #491

Test additions / changes

List tests added/updated.

Checklist

  • I have tested the changes locally.
  • I self-reviewed the changes on GitHub, line by line.
  • Tests have been added/updated.
  • This change requires new documentation.
    • Documentation has been added/updated.
  • I have tested the changes in another devices.
    • Tested in iOS.
    • Tested in Android.

@ncontinanza ncontinanza added the Waiting on PR Use this tag to alert reviewers that this PR shouldn't be merged until another one is merged first label Jun 10, 2024
@ncontinanza ncontinanza changed the title [GH-437] Show and Claim dungeon AFK Rewards [GH-437] Claim dungeon AFK Rewards Jun 11, 2024
Copy link
Collaborator

@lotuuu lotuuu left a comment

Choose a reason for hiding this comment

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

Let's make the claim happen on Dungeon scene instead of DungeonSettlementScene. The idea is that it will look like it is seamlessly applying your rewards every 20 minutes or so, while not needing a job to trigger every said amount of time. Instead, when we would display the currency to the user, we first calculate all the accumulated rewards.

Also, if we could add the supplies to the header as related currency there that'd be great and really tie all this functionality together

@lotuuu lotuuu removed the Waiting on PR Use this tag to alert reviewers that this PR shouldn't be merged until another one is merged first label Jun 11, 2024
Copy link
Contributor

@alfopisano alfopisano left a comment

Choose a reason for hiding this comment

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

Nice!!

@ncontinanza ncontinanza merged commit 116227e into main Jun 12, 2024
1 check passed
@ncontinanza ncontinanza deleted the gh-437-claim-dungeon-supplies branch June 12, 2024 20:54
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.

[FEATURE] Claim Dungeon supplies
3 participants