mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 12:49:25 +08:00
add: flexible coin consumption settings
This commit is contained in:
@@ -2173,7 +2173,7 @@
|
||||
"UseGems": false,
|
||||
"Refresh": false,
|
||||
"BuySkinBox": false,
|
||||
"ConsumeCoins": false,
|
||||
"ConsumeCoins": 550000,
|
||||
"Filter": "BookRedT3 > BookYellowT3 > BookBlueT3 > BookRedT2\n> Cube\n> FoodT6 > FoodT5"
|
||||
},
|
||||
"Storage": {
|
||||
|
||||
@@ -15045,8 +15045,8 @@
|
||||
"value": false
|
||||
},
|
||||
"ConsumeCoins": {
|
||||
"type": "checkbox",
|
||||
"value": false
|
||||
"type": "input",
|
||||
"value": 550000
|
||||
},
|
||||
"Filter": {
|
||||
"type": "textarea",
|
||||
|
||||
@@ -468,7 +468,7 @@ GeneralShop:
|
||||
UseGems: false
|
||||
Refresh: false
|
||||
BuySkinBox: false
|
||||
ConsumeCoins: false
|
||||
ConsumeCoins: 550000
|
||||
Filter: |-
|
||||
BookRedT3 > BookYellowT3 > BookBlueT3 > BookRedT2
|
||||
> Cube
|
||||
|
||||
@@ -267,7 +267,7 @@ class GeneratedConfig:
|
||||
GeneralShop_UseGems = False
|
||||
GeneralShop_Refresh = False
|
||||
GeneralShop_BuySkinBox = False
|
||||
GeneralShop_ConsumeCoins = False
|
||||
GeneralShop_ConsumeCoins = 550000
|
||||
GeneralShop_Filter = 'BookRedT3 > BookYellowT3 > BookBlueT3 > BookRedT2\n> Cube\n> FoodT6 > FoodT5'
|
||||
|
||||
# Group `GuildShop`
|
||||
|
||||
@@ -1731,7 +1731,7 @@
|
||||
},
|
||||
"ConsumeCoins": {
|
||||
"name": "消耗溢出物资",
|
||||
"help": "物资超过550000时购买所有消耗物资的物品"
|
||||
"help": "设置为0则不启用,默认为550000"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "商店过滤器",
|
||||
|
||||
@@ -155,6 +155,26 @@ class GeneralShop(ShopClerk, ShopUI, ShopStatus):
|
||||
break
|
||||
|
||||
|
||||
class GeneralShop(GeneralShop):
|
||||
def shop_check_custom_item(self, item):
|
||||
if isinstance(self.config.GeneralShop_ConsumeCoins, bool):
|
||||
self.config.GeneralShop_ConsumeCoins = 550000
|
||||
|
||||
if self.config.GeneralShop_ConsumeCoins and self._currency >= self.config.GeneralShop_ConsumeCoins:
|
||||
if item.cost == 'Coins':
|
||||
return True
|
||||
|
||||
if self.config.GeneralShop_BuySkinBox:
|
||||
if (not item.is_known_item()) and item.amount == 1 and item.cost == 'Coins' and item.price == 7000:
|
||||
# check a custom item that cannot be template matched as color
|
||||
# and design constantly changes i.e. equip skin box
|
||||
logger.info(f'Item {item} is considered to be an equip skin box')
|
||||
if self._currency >= item.price:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
class GeneralShop_250814(GeneralShop):
|
||||
# New UI in 2025-08-14
|
||||
@cached_property
|
||||
|
||||
Reference in New Issue
Block a user