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

Support Imaginarium Theater #198

Merged
merged 7 commits into from
Jul 1, 2024
Merged

Conversation

seriaati
Copy link
Collaborator

@seriaati seriaati commented Jul 1, 2024

This PR adds support for the new "Imaginarium Theater" game mode in Genshin Impact.
I personally don't play Genshin anymore and I obtained this data from one of my users. I named the fields and models based on what I see on HoYoLAB, but they might be inaccurate or can be shortened, so suggestions are welcomed.
For some fields I have left some comments to indicate that I don't know what they mean, and the difficulty enums values are guessed because I don't have data in other difficulties.

In the root validator of ImgTheater I unnest the data field, but as you might have noticed, data is a list, which could indicate that it has multiple data sets. I thought it is for including data from different difficulties of the game mode, however my user said he did complete the normal mode, but it doesn't show up in HoYoLAB (only hard mode is shown).

The code has been tested on my user's account, but further tests are needed on other accounts .

@seriaati seriaati added the enhancement New feature or request label Jul 1, 2024
@seriaati seriaati self-assigned this Jul 1, 2024
@seriaati seriaati requested a review from omg-xtao July 1, 2024 08:58
@seriaati seriaati changed the base branch from master to dev July 1, 2024 09:05
@seriaati seriaati changed the base branch from dev to master July 1, 2024 09:06
genshin/models/genshin/chronicle/img_theater.py Outdated Show resolved Hide resolved
genshin/models/genshin/chronicle/img_theater.py Outdated Show resolved Hide resolved
genshin/client/components/chronicle/genshin.py Outdated Show resolved Hide resolved
seriaati and others added 4 commits July 2, 2024 00:08
Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com>
@seriaati
Copy link
Collaborator Author

seriaati commented Jul 1, 2024

Thanks for the review.

@seriaati seriaati changed the base branch from master to dev July 1, 2024 15:24
@seriaati
Copy link
Collaborator Author

seriaati commented Jul 1, 2024

Merging into dev for now, feel free to test it out guys :)

@seriaati seriaati merged commit dd06c8b into thesadru:dev Jul 1, 2024
4 of 6 checks passed
seriaati added a commit that referenced this pull request Jul 24, 2024
* Support Imaginarium Theater (#198)

* Add models and method

* Add test

* Continue to use Aliased field cuz it magically works again

* Add medal_num field

Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com>

* Rename is_enhanced field

* Improve implementation

* Add need_detail param

---------

Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com>

* Add Partial ZZZ Support (#200)

* Add zzz code redeem route

* Modify game check logic

* Add zzz server recognition function

* Add daily reward URLs

* Remove unreachable code

* Add real-time notes support

* Apply reformat and export models to dunder all

* Add fetching user stats

* Fix code redemption not working

* Sort dunder all

* Add buddy_list

* Return Game.ZZZ for GenshinAccount.game

* Prevent enum crashes (#203)

* Add Support for Passing in More Device Info (#202)

* Update game auth headers with client custom headers

* Add device_id and device_fp setter

* Allow passing in custom payload

* Allow passing in custom device_name, device_model, and client_type

* Refactor

* Use GameRoute for battle chronicle route

* Fix honkai -> honkai3rd

* Forgot to add kwargs to overload

* Export ImgTheaterData to dunder all

* Add unknown img theater difficulty

* Use game-specific game_biz header for game auth

* Handle special card wapi endpoints

* feat: Add ZZZ gacha support + fix for Chronicled Banner (#206)

* Add More ZZZ Features (#207)

* Fix get_zz_user method doctsring

* Add 2 new icon props and rename 1 icon prop

* Add get_zzz_characters method

* Add get_bangboos method

* Add full agent info

* Run nox

* Clarify docstrings and add list conversion

* Rename methods for better consistency

* Add icon field to WEngine

Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com>

* Rename star field to refinement

* Fix requesting the wrong endpoint

---------

Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com>

* Add property type

* Fix lang arg has no effect on ZZZ endpoitns

* Add missing disc prop types

* Merge DISC_IMPACT and ENGINE_IMPACT

* Add full_name field to ZZZBaseAgent

* Fix typo speciality -> specialty

* Fix stuff related to AgentSkill

* Add game_name and game_logo fields to RecordCard

* Add ZZZRecordCard

* Support TOT daily reward claiming

* Fix Game.TOT not being recognized

* Change Game.TOT enum value to 'tot'

* Implement recognize_region for Game.TOT

* Add banner_art prop to BattleSuit model

* Support recognizing game_biz for Game.TOT

* Support TOT code redemption

* Add caching to get_server_region method

* Add region param to redeem_code method

* Add boss kills and sub-area explorations to the Exploration model and Long-Term Encounter points (#209)

* Add boss kills and sub-area explorations to Exploration

* Add stored encounter points and refresh countdown

* Ran nox reformatting

* Change returning None to returning an empty list

* Remove validators as they are no longer required

* Add "explored" property to AreaExploration

* Support ZZZ Shiyu defense

* Fix dunder all not formatted

* Remove wiki tests

* Remove model reserialization test

* Fix raising error for no game even the request doesnt need it

* Fix calcualtor test not passing

* Update fixture genshin UID and hoyolab ID

* Remove unused import

* Add type ignore for challenge_time field

* Fix type error

* Fix invalid import of ModelField

* Fix type error

* Fix missing type annotation on headers attr

* Fix invalid attr access

* Update user nickname accordingly

* Remove event_loop fixture

* Fix test failing caused by get_gacha_items

---------

Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com>
Co-authored-by: Furia <83609040+FuriaPaladins@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants