Merge pull request #543 from LmeSzinc/dev

Bug fix
This commit is contained in:
LmeSzinc 2024-06-23 17:54:39 +08:00 committed by GitHub
commit f74a4fec8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 105 additions and 52 deletions

View File

@ -49,6 +49,13 @@ class GenerateMapPlane(GenerateKeyword):
world_id=-2,
plane_id=index + 1,
)
domains = ['晖长石号', '开拓之尾号', '塔塔洛夫号', '飞翔时针号']
for index, domain in enumerate(domains):
yield dict(
text_id=to_id(domain),
world_id=3,
plane_id=index + 1,
)
keywords = sorted(self.iter_planes(), key=lambda x: (x['world_id'], x['sort_id']))
for keyword in keywords:

View File

@ -94,14 +94,16 @@ class InventoryManager:
count = len(mids)
if count == 1:
return mids
elif count == 2:
# Only one row, [173.5 175. ]
mid_diff_mean = np.mean(mid_diff_range)
diff = max(mids) - min(mids)
if diff < mid_diff_mean * 0.3:
return np.mean(mids).reshape((1,))
# Double rows
# Only one row, [173.5 175. ]
mid_diff_mean = np.mean(mid_diff_range)
diff = max(mids) - min(mids)
if diff < mid_diff_mean * 0.3:
return np.mean(mids).reshape((1,))
# Double rows
if count == 2:
return mids
# print(mids)
encourage = self.COINCIDENT_POINT_ENCOURAGE_DISTANCE ** 2

View File

@ -102,8 +102,52 @@ Rogue_DomainTransaction = MapPlane(
world_id=-2,
plane_id=7,
)
Herta_ParlorCar = MapPlane(
Penacony_RadiantFeldspar = MapPlane(
id=10,
name='Penacony_RadiantFeldspar',
cn='晖长石号',
cht='暉長石號',
en='Radiant Feldspar',
jp='暉長石号',
es='Feldespato Radiante',
world_id=3,
plane_id=1,
)
Penacony_TheTrailblazeStern = MapPlane(
id=11,
name='Penacony_TheTrailblazeStern',
cn='开拓之尾号',
cht='開拓之尾號',
en="The Trailblaze's Stern",
jp='テールオブパム号',
es='Aplustre Trazacaminos',
world_id=3,
plane_id=2,
)
Penacony_TheTatalov = MapPlane(
id=12,
name='Penacony_TheTatalov',
cn='塔塔洛夫号',
cht='塔塔洛夫號',
en='The Tatalov',
jp='タルタロフ号',
es='Tátalov',
world_id=3,
plane_id=3,
)
Penacony_TheSoaringClockHand = MapPlane(
id=13,
name='Penacony_TheSoaringClockHand',
cn='飞翔时针号',
cht='飛翔時針號',
en='The Soaring Clock Hand',
jp='フライングクロック号',
es='Manecilla Voladora',
world_id=3,
plane_id=4,
)
Herta_ParlorCar = MapPlane(
id=14,
name='Herta_ParlorCar',
cn='观景车厢',
cht='觀景車廂',
@ -114,7 +158,7 @@ Herta_ParlorCar = MapPlane(
plane_id=1000001,
)
Herta_MasterControlZone = MapPlane(
id=11,
id=15,
name='Herta_MasterControlZone',
cn='主控舱段',
cht='主控艙段',
@ -125,7 +169,7 @@ Herta_MasterControlZone = MapPlane(
plane_id=1000101,
)
Herta_BaseZone = MapPlane(
id=12,
id=16,
name='Herta_BaseZone',
cn='基座舱段',
cht='基座艙段',
@ -136,7 +180,7 @@ Herta_BaseZone = MapPlane(
plane_id=2000101,
)
Herta_StorageZone = MapPlane(
id=13,
id=17,
name='Herta_StorageZone',
cn='收容舱段',
cht='收容艙段',
@ -147,7 +191,7 @@ Herta_StorageZone = MapPlane(
plane_id=2000201,
)
Herta_SupplyZone = MapPlane(
id=14,
id=18,
name='Herta_SupplyZone',
cn='支援舱段',
cht='支援艙段',
@ -158,7 +202,7 @@ Herta_SupplyZone = MapPlane(
plane_id=2000301,
)
Herta_SeclusionZone = MapPlane(
id=15,
id=19,
name='Herta_SeclusionZone',
cn='禁闭舱段',
cht='禁閉艙段',
@ -169,7 +213,7 @@ Herta_SeclusionZone = MapPlane(
plane_id=2000401,
)
Jarilo_AdministrativeDistrict = MapPlane(
id=16,
id=20,
name='Jarilo_AdministrativeDistrict',
cn='行政区',
cht='行政區',
@ -180,7 +224,7 @@ Jarilo_AdministrativeDistrict = MapPlane(
plane_id=1010101,
)
Jarilo_OutlyingSnowPlains = MapPlane(
id=17,
id=21,
name='Jarilo_OutlyingSnowPlains',
cn='城郊雪原',
cht='城郊雪原',
@ -191,7 +235,7 @@ Jarilo_OutlyingSnowPlains = MapPlane(
plane_id=2010101,
)
Jarilo_BackwaterPass = MapPlane(
id=18,
id=22,
name='Jarilo_BackwaterPass',
cn='边缘通路',
cht='邊緣通道',
@ -202,7 +246,7 @@ Jarilo_BackwaterPass = MapPlane(
plane_id=2011101,
)
Jarilo_SilvermaneGuardRestrictedZone = MapPlane(
id=19,
id=23,
name='Jarilo_SilvermaneGuardRestrictedZone',
cn='铁卫禁区',
cht='鐵衛禁區',
@ -213,7 +257,7 @@ Jarilo_SilvermaneGuardRestrictedZone = MapPlane(
plane_id=2013101,
)
Jarilo_CorridorofFadingEchoes = MapPlane(
id=20,
id=24,
name='Jarilo_CorridorofFadingEchoes',
cn='残响回廊',
cht='殘響迴廊',
@ -224,7 +268,7 @@ Jarilo_CorridorofFadingEchoes = MapPlane(
plane_id=2013201,
)
Jarilo_EverwinterHill = MapPlane(
id=21,
id=25,
name='Jarilo_EverwinterHill',
cn='永冬岭',
cht='永冬嶺',
@ -235,7 +279,7 @@ Jarilo_EverwinterHill = MapPlane(
plane_id=2013401,
)
Jarilo_PillarsofCreation = MapPlane(
id=22,
id=26,
name='Jarilo_PillarsofCreation',
cn='造物之柱',
cht='造物之柱',
@ -246,7 +290,7 @@ Jarilo_PillarsofCreation = MapPlane(
plane_id=2013501,
)
Jarilo_OldWeaponTestingGround = MapPlane(
id=23,
id=27,
name='Jarilo_OldWeaponTestingGround',
cn='旧武器试验场',
cht='舊武器試驗場',
@ -257,7 +301,7 @@ Jarilo_OldWeaponTestingGround = MapPlane(
plane_id=2013601,
)
Jarilo_BoulderTown = MapPlane(
id=24,
id=28,
name='Jarilo_BoulderTown',
cn='磐岩镇',
cht='磐岩鎮',
@ -268,7 +312,7 @@ Jarilo_BoulderTown = MapPlane(
plane_id=1010201,
)
Jarilo_GreatMine = MapPlane(
id=25,
id=29,
name='Jarilo_GreatMine',
cn='大矿区',
cht='大礦區',
@ -279,7 +323,7 @@ Jarilo_GreatMine = MapPlane(
plane_id=2012101,
)
Jarilo_RivetTown = MapPlane(
id=26,
id=30,
name='Jarilo_RivetTown',
cn='铆钉镇',
cht='鉚釘鎮',
@ -290,7 +334,7 @@ Jarilo_RivetTown = MapPlane(
plane_id=2012201,
)
Jarilo_RobotSettlement = MapPlane(
id=27,
id=31,
name='Jarilo_RobotSettlement',
cn='机械聚落',
cht='機械聚落',
@ -301,7 +345,7 @@ Jarilo_RobotSettlement = MapPlane(
plane_id=2012301,
)
Luofu_CentralStarskiffHaven = MapPlane(
id=28,
id=32,
name='Luofu_CentralStarskiffHaven',
cn='星槎海中枢',
cht='星槎海中樞',
@ -312,7 +356,7 @@ Luofu_CentralStarskiffHaven = MapPlane(
plane_id=1020101,
)
Luofu_Cloudford = MapPlane(
id=29,
id=33,
name='Luofu_Cloudford',
cn='流云渡',
cht='流雲渡',
@ -323,7 +367,7 @@ Luofu_Cloudford = MapPlane(
plane_id=2021101,
)
Luofu_StargazerNavalia = MapPlane(
id=30,
id=34,
name='Luofu_StargazerNavalia',
cn='迴星港',
cht='迴星港',
@ -334,7 +378,7 @@ Luofu_StargazerNavalia = MapPlane(
plane_id=2021201,
)
Luofu_ExaltingSanctum = MapPlane(
id=31,
id=35,
name='Luofu_ExaltingSanctum',
cn='长乐天',
cht='長樂天',
@ -345,7 +389,7 @@ Luofu_ExaltingSanctum = MapPlane(
plane_id=1020201,
)
Luofu_AurumAlley = MapPlane(
id=32,
id=36,
name='Luofu_AurumAlley',
cn='金人巷',
cht='金人巷',
@ -356,7 +400,7 @@ Luofu_AurumAlley = MapPlane(
plane_id=1020204,
)
Luofu_DivinationCommission = MapPlane(
id=33,
id=37,
name='Luofu_DivinationCommission',
cn='太卜司',
cht='太卜司',
@ -367,7 +411,7 @@ Luofu_DivinationCommission = MapPlane(
plane_id=2022101,
)
Luofu_ArtisanshipCommission = MapPlane(
id=34,
id=38,
name='Luofu_ArtisanshipCommission',
cn='工造司',
cht='工造司',
@ -378,7 +422,7 @@ Luofu_ArtisanshipCommission = MapPlane(
plane_id=2022201,
)
Luofu_FyxestrollGarden = MapPlane(
id=35,
id=39,
name='Luofu_FyxestrollGarden',
cn='绥园',
cht='綏園',
@ -389,7 +433,7 @@ Luofu_FyxestrollGarden = MapPlane(
plane_id=2022301,
)
Luofu_AlchemyCommission = MapPlane(
id=36,
id=40,
name='Luofu_AlchemyCommission',
cn='丹鼎司',
cht='丹鼎司',
@ -400,7 +444,7 @@ Luofu_AlchemyCommission = MapPlane(
plane_id=2023101,
)
Luofu_ScalegorgeWaterscape = MapPlane(
id=37,
id=41,
name='Luofu_ScalegorgeWaterscape',
cn='鳞渊境',
cht='鱗淵境',
@ -411,7 +455,7 @@ Luofu_ScalegorgeWaterscape = MapPlane(
plane_id=2023201,
)
Penacony_TheReverieReality = MapPlane(
id=38,
id=42,
name='Penacony_TheReverieReality',
cn='「白日梦」酒店-现实',
cht='「白日夢」飯店-現實',
@ -422,7 +466,7 @@ Penacony_TheReverieReality = MapPlane(
plane_id=1030501,
)
Penacony_GoldenHour = MapPlane(
id=39,
id=43,
name='Penacony_GoldenHour',
cn='黄金的时刻',
cht='黃金的時刻',
@ -433,7 +477,7 @@ Penacony_GoldenHour = MapPlane(
plane_id=1030101,
)
Penacony_DreamEdge = MapPlane(
id=40,
id=44,
name='Penacony_DreamEdge',
cn='筑梦边境',
cht='築夢邊境',
@ -444,7 +488,7 @@ Penacony_DreamEdge = MapPlane(
plane_id=2031301,
)
Penacony_AChildDream = MapPlane(
id=41,
id=45,
name='Penacony_AChildDream',
cn='稚子的梦',
cht='稚子的夢',
@ -455,7 +499,7 @@ Penacony_AChildDream = MapPlane(
plane_id=2031201,
)
Penacony_TheReverieDreamscape = MapPlane(
id=42,
id=46,
name='Penacony_TheReverieDreamscape',
cn='「白日梦」酒店-梦境',
cht='「白日夢」飯店-夢境',
@ -466,7 +510,7 @@ Penacony_TheReverieDreamscape = MapPlane(
plane_id=2031101,
)
Penacony_DewlightPavilion = MapPlane(
id=43,
id=47,
name='Penacony_DewlightPavilion',
cn='朝露公馆',
cht='朝露公館',
@ -477,7 +521,7 @@ Penacony_DewlightPavilion = MapPlane(
plane_id=2032201,
)
Penacony_ClockStudiosThemePark = MapPlane(
id=44,
id=48,
name='Penacony_ClockStudiosThemePark',
cn='克劳克影视乐园',
cht='克勞克影視樂園',
@ -488,7 +532,7 @@ Penacony_ClockStudiosThemePark = MapPlane(
plane_id=2032101,
)
Penacony_DreamfluxReef = MapPlane(
id=45,
id=49,
name='Penacony_DreamfluxReef',
cn='流梦礁',
cht='流夢礁',
@ -499,7 +543,7 @@ Penacony_DreamfluxReef = MapPlane(
plane_id=1030401,
)
Penacony_SoulGladScorchsandAuditionVenue = MapPlane(
id=46,
id=50,
name='Penacony_SoulGladScorchsandAuditionVenue',
cn='苏乐达热砂海选会场',
cht='蘇樂達熱砂海選會場',
@ -510,7 +554,7 @@ Penacony_SoulGladScorchsandAuditionVenue = MapPlane(
plane_id=2033101,
)
Penacony_PenaconyGrandTheater = MapPlane(
id=47,
id=51,
name='Penacony_PenaconyGrandTheater',
cn='匹诺康尼大剧院',
cht='匹諾康尼大劇院',

View File

@ -293,7 +293,7 @@ class StoredPlannerProxy(BaseModelWithFallback):
"""
Estimate remaining days to farm
"""
if not self.need_farm():
if not self.can_daily_farm():
return 0.
if self.item.dungeon is None:
return 0.
@ -304,12 +304,11 @@ class StoredPlannerProxy(BaseModelWithFallback):
cost = self.combat_cost
drop = self.drop_equivalent_green
if self.item.is_ItemWeekly:
weeks = math.ceil(remain / drop / 3)
return weeks * 7
else:
stamina = math.ceil(remain / drop) * cost
return round(stamina / 240, 1)
# if self.item.is_ItemWeekly:
# weeks = math.ceil(remain / drop / 3)
# return weeks * 7
stamina = math.ceil(remain / drop) * cost
return round(stamina / 240, 1)
def update(self, time=False):
for attr in SET_ROW_EXCLUDE:
@ -534,6 +533,7 @@ class PlannerProgressParser:
name = f'Item_{row.item.name}'
dic = row.model_dump(exclude=SET_ROW_EXCLUDE)
dic['item'] = row.item.name
dic['time'] = str(row.time)
data[name] = dic
return data