diff --git a/app/core/nice/event/campaign.py b/app/core/nice/event/campaign.py index 3467fe47..db43b1c2 100644 --- a/app/core/nice/event/campaign.py +++ b/app/core/nice/event/campaign.py @@ -10,6 +10,7 @@ def get_nice_campaign(campaign: MstEventCampaign) -> NiceEventCampaign: return NiceEventCampaign( targetIds=campaign.targetIds, warIds=campaign.warIds, + warGroupIds=campaign.warGroupIds or [], target=COMBINE_ADJUST_TARGET_TYPE_NAME[campaign.target], idx=campaign.idx, value=campaign.value, diff --git a/app/core/nice/war.py b/app/core/nice/war.py index eefda0b6..a4ae0038 100644 --- a/app/core/nice/war.py +++ b/app/core/nice/war.py @@ -7,6 +7,8 @@ from ...schemas.common import Language, Region from ...schemas.gameenums import ( COND_TYPE_NAME, + QUEST_AFTER_CLEAR_NAME, + QUEST_TYPE_NAME, SPOT_OVERWRITE_TYPE_NAME, WAR_FLAG_NAME, WAR_OVERWRITE_TYPE_NAME, @@ -27,6 +29,7 @@ NiceSpotRoad, NiceWar, NiceWarAdd, + NiceWarGroup, NiceWarQuestSelection, NiceWarRelease, ) @@ -41,6 +44,7 @@ MstSpotRoad, MstWar, MstWarAdd, + MstWarGroup, MstWarQuestSelection, MstWarRelease, QuestEntity, @@ -185,6 +189,14 @@ def get_nice_war_add( ) +def get_nice_war_group(war_group: MstWarGroup) -> NiceWarGroup: + return NiceWarGroup( + id=war_group.id, + questAfterClear=QUEST_AFTER_CLEAR_NAME[war_group.questAfterClear], + questType=QUEST_TYPE_NAME[war_group.questType], + ) + + def get_nice_war_quest_selection( region: Region, quest_selection: MstWarQuestSelection, @@ -454,6 +466,7 @@ async def get_nice_war( get_nice_war_add(region, war_add, banner_template) for war_add in raw_war.mstWarAdd ], + groups=[get_nice_war_group(war_group) for war_group in raw_war.mstWarGroup], maps=[ get_nice_map( region, diff --git a/app/core/raw.py b/app/core/raw.py index 6f24f181..a3ae5364 100644 --- a/app/core/raw.py +++ b/app/core/raw.py @@ -177,6 +177,7 @@ MstWarBoardStage, MstWarBoardStageLayout, MstWarBoardTreasure, + MstWarGroup, MstWarQuestSelection, MstWarRelease, MysticCodeEntity, @@ -899,6 +900,7 @@ async def get_war_entity(conn: AsyncConnection, war_id: int) -> WarEntity: mstWar=war_db, mstEvent=await fetch.get_one(conn, MstEvent, war_db.eventId), mstWarAdd=await fetch.get_all(conn, MstWarAdd, war_id), + mstWarGroup=await fetch.get_all(conn, MstWarGroup, war_id), mstMap=maps, mstMapGimmick=await fetch.get_all_multiple(conn, MstMapGimmick, map_ids), mstBgm=bgms, diff --git a/app/db/helpers/fetch.py b/app/db/helpers/fetch.py index 1c540f4c..63f87fde 100644 --- a/app/db/helpers/fetch.py +++ b/app/db/helpers/fetch.py @@ -133,6 +133,7 @@ mstWarBoardStage, mstWarBoardStageLayout, mstWarBoardTreasure, + mstWarGroup, mstWarQuestSelection, mstWarRelease, ) @@ -265,6 +266,7 @@ MstWarBoardStage, MstWarBoardStageLayout, MstWarBoardTreasure, + MstWarGroup, MstWarQuestSelection, MstWarRelease, ) @@ -384,6 +386,7 @@ async def get_one( ), MstMap: (mstMap, mstMap.c.warId, mstMap.c.id), MstWarAdd: (mstWarAdd, mstWarAdd.c.warId, mstWarAdd.c.priority), + MstWarGroup: (mstWarGroup, mstWarGroup.c.warId, mstWarGroup.c.id), MstWarQuestSelection: ( mstWarQuestSelection, mstWarQuestSelection.c.warId, diff --git a/app/models/raw.py b/app/models/raw.py index fc15cb85..1c5ab982 100644 --- a/app/models/raw.py +++ b/app/models/raw.py @@ -1641,6 +1641,7 @@ metadata, Column("targetIds", ARRAY(Integer)), Column("warIds", ARRAY(Integer)), + Column("warGroupIds", ARRAY(Integer)), Column("eventId", Integer, index=True), Column("target", Integer), Column("idx", Integer), @@ -2077,6 +2078,17 @@ Column("assetId", Integer), ) + +mstWarGroup = Table( + "mstWarGroup", + metadata, + Column("id", Integer), + Column("warId", Integer), + Column("questAfterClear", Integer), + Column("questType", Integer), +) + + mstMapGimmick = Table( "mstMapGimmick", metadata, @@ -2905,7 +2917,7 @@ [mstMap], [mstSpot, mstBlankEarthSpot, mstSpotAdd, mstSpotRoad], [mstMapGimmick], - [mstWarAdd, mstWarRelease], + [mstWarAdd, mstWarRelease, mstWarGroup], [mstWarQuestSelection], [mstEventCampaign], [mstEventQuest], diff --git a/app/schemas/nice.py b/app/schemas/nice.py index edc5b538..270af6c5 100644 --- a/app/schemas/nice.py +++ b/app/schemas/nice.py @@ -1871,6 +1871,7 @@ class NiceEventQuest(BaseModelORJson): class NiceEventCampaign(BaseModelORJson): targetIds: list[int] warIds: list[int] + warGroupIds: list[int] target: NiceCombineAdjustTarget idx: int value: int @@ -2979,6 +2980,13 @@ class NiceSpot(BaseModel): quests: list[NiceQuest] +class NiceWarGroup(BaseModelORJson): + id: int + # warId: int + questAfterClear: NiceQuestAfterClearType + questType: NiceQuestType + + class NiceWarAdd(BaseModelORJson): warId: int type: NiceWarOverwriteType @@ -3034,6 +3042,7 @@ class NiceWar(BaseModelORJson): lastQuestId: int releaseConditions: list[NiceWarRelease] warAdds: list[NiceWarAdd] + groups: list[NiceWarGroup] maps: list[NiceMap] spots: list[NiceSpot] spotRoads: list[NiceSpotRoad] diff --git a/app/schemas/raw.py b/app/schemas/raw.py index 4b68193f..7683d11d 100644 --- a/app/schemas/raw.py +++ b/app/schemas/raw.py @@ -1409,6 +1409,7 @@ class MstEventQuestCooltime(BaseModelORJson): class MstEventCampaign(BaseModelORJson): targetIds: list[int] warIds: list[int] + warGroupIds: list[int] | None = None eventId: int target: int idx: int @@ -1732,6 +1733,13 @@ class MstWar(BaseModelORJson): assetId: int # 0 +class MstWarGroup(BaseModelORJson): + id: int + warId: int + questAfterClear: int + questType: int + + class MstWarAdd(BaseModelORJson): script: dict[str, Any] warId: int @@ -2438,6 +2446,7 @@ class WarEntity(BaseModelORJson): mstWar: MstWar mstEvent: Optional[MstEvent] = None mstWarAdd: list[MstWarAdd] + mstWarGroup: list[MstWarGroup] mstMap: list[MstMap] mstBgm: list[MstBgm] mstMapGimmick: list[MstMapGimmick]