Skip to content

Commit

Permalink
add challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrErde committed Dec 23, 2024
1 parent a2e8508 commit 41ee704
Show file tree
Hide file tree
Showing 4 changed files with 469 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: var
run: |
packageId="com.kiloo.subwaysurf" >> $GITHUB_OUTPUT
echo version=$(curl -s "https://gplayapi.cashlessconsumer.in/api/apps/$packageId" | jq -r '.version' | tr '.' '-') >> $GITHUB_OUTPUT
echo version=$(curl -s "https://gplayapi.herrerde.xyz/api/apps/$packageId" | jq -r '.version' | tr '.' '-') >> $GITHUB_OUTPUT
- name: Create Folder
run: |
Expand Down Expand Up @@ -53,6 +53,7 @@ jobs:
python script/playerprofile.py
python script/userstats.py
python script/collection.py
python script/challenges.py
python script/calender.py
python script/mailbox.py
python script/achievements.py
Expand Down
1 change: 1 addition & 0 deletions all.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def get_scripts(
["script/playerprofile.py"],
["script/userstats.py"],
["script/collection.py"],
["script/challenges.py"],
["script/calender.py"],
["script/mailbox.py"],
["script/achievements.py"],
Expand Down
329 changes: 329 additions & 0 deletions docs/dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,329 @@
# Dev Ramblings

(This text is not completely after checked.\
Some things may be wrong, missing or hard to understand.I don't care.)

(Some stuff where I tried to explain some the working (eventough i have absolutely no idea) or just some thing that I found interesting)

Info as of version 3.39.0\
While losing my mind tying to reverse-engineering the generic_challenges code

## Challenges

Challenges have different "Kinds"

1: Daily\
2: Meter\
3: ?\
4: City

in `rewardStates`\
the States are\
`0` not available to claim\
`1` able to claim\
`10` claimed

### Requirements

In save files are requirements that only allow the playing of a challenge with for example a specific character with a cooldown.\
apparently any can have a operator with recursively going lower

<details>

```json
"requirements": {
"access": {
"data": [
{
"type": "BaseMultiplier",
"operator": "GreaterEqual",
"value": "4"
}
],
"operator": "And"
}
```

```json
"requirements": {
"data":[{
"operator":"GreaterEqual",
"type":"AccountCreationTime",
"value":"20"
},
{
"operator":"Equal",
"type":"HasInternet"
}],
"operator":"And"
},
```

</details>

### Participation

participation of characters allowed in challenges\
with cost, ads, reuse time, key unlock

<details>

```json
"participation": {
"data": [
{
"type": "SelectedCharacter",
"operator": "Equal",
"value": "rudyrascal,buzz",
"meta": {
"items": [
{
"alternativeSkipCost": [
{
"adPlacement": "SkipCharacterCooldown",
"currencyType": "Ads",
"value": 1
}
],
"cooldown": 7200,
"id": "rudyrascal",
"limitRuns": 1,
"skipCostKeys": [
16
],
"tryable": true
},
{
"alternativeSkipCost": [
{
"adPlacement": "SkipCharacterCooldown",
"currencyType": "Ads",
"value": 1
}
],
"cooldown": 7200,
"id": "buzz",
"limitRuns": 1,
"skipCostKeys": [
16
]
}
]
}
}
],
"operator": "And"
}
```

</details>

### Progress

```json
"progress": {
"data": [
{
"type": "City",
"operator": "Equal",
"value": "subwaycityfloorislava"
}
],
"operator": "And"
}
}
```

### Operators

#### Types

Any\
GameCounts

#### Value

int in string

##### operator

And\
Or\
Equal

GreaterEqual\
LowerEqual

<details>

```json
{
"type": "SelectedCharacter",
"operator": "Equal",
"value": "jake,tricky,fresh,yutani",
"meta": {
"items": [
{
"alternativeSkipCost": [],
"cooldown": 7200,
"id": "jake",
"limitRuns": 1,
"skipCostKeys": [16]
}
]
}
}
```

```json
"requirements": {
"data":[{
"operator":"GreaterEqual",
"type":"AccountCreationTime",
"value":"20"
},
{
"operator":"Equal",
"type":"HasInternet"
}],
"operator":"And"
}
```

</details>

<p>
These have mostly meta data for their one option.
values show apparently the values that can be choosen with the items
items showing a more specified data overview of the settings
</p>
=======

here is a challenge from the file `generic_challenges.json`
in this state, which is sort of a level in the challenge, the reward requires an Ad set by the `AdRequired` key and cannot be collected without having to watch it

<details>

```json
"challengeStates": {
"coinChallenge": {
"challengeId": "coinChallenge",
"rewardStates": [
{
"State": 10,
"RequiredScore": 500,
"AdRequired": true,
"Rewards": [
{
"reward": {
"type": "Currency",
"id": "EventCoins",
"value": 300
},
"fallbackReward": {
"type": "Currency",
"id": "Coins",
"value": 300
}
}
]
}
```

</details>

rewards are sorted into groups which begin from not set to 1\
for example 3 rewards then begins the next stage wich is then the next group

<details>

```json
"rewardStates": [
{
"State": 10,
"RequiredScore": 250,
"Rewards": [
{
"reward": {
},
"fallbackReward": {
}
}
]
},
{
"State": 10,
"RequiredScore": 500,
"AdRequired": true,
"Rewards": [
{
"reward": {
},
"fallbackReward": {
}
}
]
},
{
"State": 10,
"RequiredScore": 1000,
"Rewards": [
{
"reward": {
},
"fallbackReward": {
}
},
{
"reward": {
}
}
]
},
{
"State": 1,
"RequiredScore": 2000,
"GroupId": 1,
"Rewards": [
{
"reward": {
},
"fallbackReward": {
}
}
]
},
{
"State": 0,
"RequiredScore": 3000,
"GroupId": 1,
"Rewards": [
{
"reward": {
},
"fallbackReward": {
}
},
{
"reward": {
}
}
]
},
{
"State": 0,
"RequiredScore": 4000,
"GroupId": 2,
"Rewards": [
{
"reward": {
},
"fallbackReward": {
}
}
]
}
]
```

</details>
Loading

0 comments on commit 41ee704

Please sign in to comment.