Comments (11)
@Gr8z Yes, it is planned and will be added.
For now if you want to quickly get to it, you can use this map: https://github.com/smlbiobot/SML-Cogs/blob/master/cr_api/data/chests.json which is the full cycle data.
Then you can determine the index in cycle with
index = position % chests.length
and of course the index of special chests by
index = superMagicalPos - position
But in later iterations we will do the calculations and return you as a list of keys.
from cr-api.
UPDATE: you can now use http://api.cr-api.com/constants/chestCycle
LEGACY (pls ignore)
And if you need the source, it is parsed from the csv logic file in the apk:
from cr-api.
Thank you @selfish
Would you happen to have a map for giant and magical chests as well?
from cr-api.
@Gr8z Why did you thank Selfish? 😫
Anyway, Giant + Magical are in the index. They are part of the normal chest cycle.
from cr-api.
hahaha my bad @smlbiobot
Thanks, I also missed those chests in the index.
double blunder
from cr-api.
I do agree that it would be nice for the API to return these. I'll add this in one of the next iterations.
from cr-api.
@smlbiobot you did include the source but i believe you deleted/privated your cr-sanic repo so i coulsnt find it there.
from cr-api.
@Dino0631 cr-sanic repo has been made private so I can store my configs. You can get the full chest order here: https://github.com/smlbiobot/cr/blob/master/apk/1.9.0/com.supercell.clashroyale-1.9.0-decoded/assets/csv_logic/chest_order.decoded.csv
from cr-api.
If you want a JSON, you can get it from here right now:
https://github.com/cr-api/cr-api-data/blob/master/dst/chest_order.json
Field is “MainCycle” as chest_order now includes quest chests also.
from cr-api.
To help people understand how chests work:
- Chest cycle is pre-determined and is defined in the chest order json above.
- The app loops through full cycles and back again.
- To determine which chests you will be getting next, you need to know the current position, which is also the number of chests you have opened so far.
- Since the current position is going to be longer than the length of the cycle, you will determine the current index as
current_index = position % chests.length
- Special chests: e.g. Epic, Legendary, Super Magical replaces the current cycle.
- To see if cycle is replaced by any of those chests, calculate if special chest position coincides with those and replace.
from cr-api.
Since all required data exists in constants, I'm closing.
from cr-api.
Related Issues (20)
- warTrophies on history is always 0 HOT 2
- % Cards level in war cvs HOT 1
- Gold chest name in player chest cycle HOT 1
- trophyChange field missing in v3 player battles endpoint HOT 3
- card levels are formatted in the old form of 13-11-8-5 instead of 13-13-13-13 HOT 2
- /player/{tags}/chests endpoint, always returns HTTP 400 HOT 1
- Multitag player battles for v3-api HOT 1
- Rarities info for v3-api HOT 1
- [V3] Clan search fails without name in query HOT 1
- Clan family change HOT 1
- Tower health left HOT 4
- Add flag for global tournament HOT 1
- Battle download on the activity log? HOT 3
- App creation HOT 2
- Add a percentage of lifetime wins in a war HOT 2
- Clan War non-members data is missing HOT 1
- Get all players
- Bug: Clan page links not working properly HOT 1
- Source for Battle Replays HOT 1
- Help HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cr-api.