From e0e63a9a13070d271e0f01dfdf5d033ac5a3d978 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 30 Jun 2024 00:23:10 +0200 Subject: [PATCH] configurable festa options --- changelog.md | 4 ++++ docs/game_specific_info.md | 12 ++++++++---- example_config/diva.yaml | 4 ++++ titles/diva/base.py | 11 ++++++++--- titles/diva/config.py | 23 +++++++++++++++++++++++ 5 files changed, 47 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index 8148a9d..08b5b6d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,10 @@ # Changelog Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to. +## 20240630 +### DIVA ++ Added configurable festa options + ## 20240620 ### CHUNITHM + CHUNITHM LUMINOUS support diff --git a/docs/game_specific_info.md b/docs/game_specific_info.md index 53c076c..158930e 100644 --- a/docs/game_specific_info.md +++ b/docs/game_specific_info.md @@ -255,10 +255,14 @@ the Shop, Modules and Customizations. Config file is located in `config/diva.yaml`. -| Option | Info | -| -------------------- | ----------------------------------------------------------------------------------------------- | -| `unlock_all_modules` | Unlocks all modules (costumes) by default, if set to `False` all modules need to be purchased | -| `unlock_all_items` | Unlocks all items (customizations) by default, if set to `False` all items need to be purchased | +| Option | Info | +| -------------------- | ------------------------------------------------------------------------------------------------ | +| `festaEnable` | Enable or disable the ingame festa | +| `festaAddVP` | Set the extra VP you get when clearing a song, if festa is not enabled no extra VP will be given | +| `festaMultiplyVP` | Multiplier for festa add VP | +| `festaEndTime` | Set the date time for when festa will end and not show up in game anymore | +| `unlock_all_modules` | Unlocks all modules (costumes) by default, if set to `False` all modules need to be purchased | +| `unlock_all_items` | Unlocks all items (customizations) by default, if set to `False` all items need to be purchased | ### Custom PV Lists (databanks) diff --git a/example_config/diva.yaml b/example_config/diva.yaml index ad1842a..465ab93 100644 --- a/example_config/diva.yaml +++ b/example_config/diva.yaml @@ -1,6 +1,10 @@ server: enable: True loglevel: "info" + festaEnable: True + festaAddVP: "20,5" + festaMultiplyVP: "1,2" + festaEndTime: "2029-01-01 00:00:00.0" mods: unlock_all_modules: True diff --git a/titles/diva/base.py b/titles/diva/base.py index 3b96848..e07c81d 100644 --- a/titles/diva/base.py +++ b/titles/diva/base.py @@ -264,6 +264,11 @@ class DivaBase: return response async def handle_festa_info_request(self, data: Dict) -> Dict: + if self.game_config.server.festaEnable: + festa_end_time = self.game_config.server.festaEndTime + else: + festa_end_time = (datetime.datetime.now() + datetime.timedelta(days=365*2)).strftime("%Y-%m-%d %H:%M:%S") + ".0" + encoded = "&" params = { "fi_id": "1,2", @@ -273,10 +278,10 @@ class DivaBase: "fi_difficulty": "-1,-1", "fi_pv_id_lst": "ALL,ALL", "fi_attr": "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", - "fi_add_vp": "20,5", - "fi_mul_vp": "1,2", + "fi_add_vp": f"{self.game_config.server.festaAddVP}", + "fi_mul_vp": f"{self.game_config.server.festaMultiplyVP}", "fi_st": "2019-01-01 00:00:00.0,2019-01-01 00:00:00.0", - "fi_et": "2029-01-01 00:00:00.0,2029-01-01 00:00:00.0", + "fi_et": f"{festa_end_time},{festa_end_time}", "fi_lut": "{self.time_lut}", } diff --git a/titles/diva/config.py b/titles/diva/config.py index efa327e..269041a 100644 --- a/titles/diva/config.py +++ b/titles/diva/config.py @@ -19,6 +19,29 @@ class DivaServerConfig: ) ) + @property + def festaEnable(self) -> bool: + return CoreConfig.get_config_field( + self.__config, "diva", "server", "festaEnable", default=True + ) + + @property + def festaAddVP(self) -> str: + return CoreConfig.get_config_field( + self.__config, "diva", "server", "festaAddVP", default="20,5" + ) + + @property + def festaMultiplyVP(self) -> str: + return CoreConfig.get_config_field( + self.__config, "diva", "server", "festaMultiplyVP", default="1,2" + ) + + @property + def festaEndTime(self) -> str: + return CoreConfig.get_config_field( + self.__config, "diva", "server", "festaEndTime", default="2029-01-01 00:00:00.0" + ) class DivaModsConfig: def __init__(self, parent_config: "DivaConfig") -> None: