1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-18 09:11:31 +08:00

Opt: shop_guild adopt base infrastructure

Add: run definition to be run as independent component
Opt: re-work buy handle mechanism; break into smaller pieces rather than consolidated to one definition; compress previous globals into dictionary
This commit is contained in:
nEEtdo0d
2022-01-19 21:30:33 -05:00
parent 9ea9d17771
commit b0ce3fa80c
2 changed files with 232 additions and 199 deletions

View File

@@ -1,80 +1,5 @@
from module.base.button import ButtonGrid
# Known Guild Items with Secondary Grid
SELECT_ITEMS = [
'book',
'box',
'retrofit',
'plate',
'pr',
'dr',
]
# Known Secondary Grid Items by Category
SELECT_BOOK = {
'red': 0,
'blue': 1,
'yellow': 2,
}
SELECT_BOX = {
'eagle': 0,
'royal': 1,
'sakura': 2,
'ironblood': 3,
}
SELECT_RETROFIT = {
'dd': 0,
'cl': 1,
'bb': 2,
'cv': 3,
}
SELECT_PLATE = {
'general': 0,
'gun': 1,
'torpedo': 2,
'antiair': 3,
'plane': 4,
}
SELECT_PR = {
'neptune': 0,
'monarch': 1,
'ibuki': 2,
'izumo': 3,
'roon': 4,
'saintlouis': 5,
'seattle': 0,
'georgia': 1,
'kitakaze': 2,
'gascogne': 3,
'cheshire': 0,
'mainz': 1,
'odin': 2,
'champagne': 3,
'anchorage': 0,
'august': 1,
'marcopolo': 2,
}
SELECT_DR = {
'azuma': 0,
'friedrich': 1,
'drake': 0,
'agir': 0,
'hakuryu': 1,
}
# Known Secondary Grid Items Limits
SELECT_BOOK_LIMIT = 3
SELECT_BOX_LIMIT = 1
SELECT_RETROFIT_LIMIT = 2
SELECT_PLATE_LIMIT = 5
SELECT_PR_LIMIT = 1
SELECT_DR_LIMIT = 1
# Known Secondary Grid Sizes
SELECT_GRID_3X1 = ButtonGrid(
origin=(412, 258), delta=(158, 0), button_shape=(119, 19), grid_shape=(3, 1),
@@ -91,3 +16,92 @@ SELECT_GRID_5X1 = ButtonGrid(
SELECT_GRID_6X1 = ButtonGrid(
origin=(176, 258), delta=(158, 0), button_shape=(119, 19), grid_shape=(6, 1),
name='SHOP_SELECT_GRID_6X1')
# Consolidated Guild Item Information Map
# Placeholder entry 'DR'; not valid atm
SELECT_ITEM_INFO_MAP = {
'book': {
'limit': 3,
'grid': SELECT_GRID_3X1,
'choices': {
'red': 0,
'blue': 1,
'yellow': 2,
},
},
'box': {
'limit': 1,
'grid': SELECT_GRID_4X1,
'choices': {
'eagle': 0,
'royal': 1,
'sakura': 2,
'ironblood': 3,
},
},
'retrofit': {
'limit': 2,
'grid': SELECT_GRID_4X1,
'choices': {
'dd': 0,
'cl': 1,
'bb': 2,
'cv': 3,
},
},
'plate': {
'limit': 5,
'grid': SELECT_GRID_5X1,
'choices': {
'general': 0,
'gun': 1,
'torpedo': 2,
'antiair': 3,
'plane': 4,
},
},
'pr': {
'limit': 1,
'grid': {
's1': SELECT_GRID_6X1,
's2': SELECT_GRID_4X1,
's3': SELECT_GRID_4X1,
's4': SELECT_GRID_3X1,
},
'choices': {
'neptune': 0,
'monarch': 1,
'ibuki': 2,
'izumo': 3,
'roon': 4,
'saintlouis': 5,
'seattle': 0,
'georgia': 1,
'kitakaze': 2,
'gascogne': 3,
'cheshire': 0,
'mainz': 1,
'odin': 2,
'champagne': 3,
'anchorage': 0,
'august': 1,
'marcopolo': 2,
},
},
'dr': {
'limit': 1,
'grid': {
's1': SELECT_GRID_3X1,
's2': SELECT_GRID_3X1,
's3': SELECT_GRID_3X1,
's4': SELECT_GRID_3X1,
},
'choices': {
'azuma': 0,
'friedrich': 1,
'drake': 0,
'agir': 0,
'hakuryu': 1,
},
},
}