@@ -246,11 +246,12 @@ async def do_task(self, client: pcrclient):
246246 self ._log (f"==常驻角色==" )
247247 self ._log ('\n ' .join (db .get_unit_name (id ) for id in resident_unit ))
248248
249- @description ('警告!真抽!\n 抽到出指NEW出保底角色,或达天井停下来,如果已有保底角色,就不会NEW!意味着就是一井!\n 智能pickup指当前pickup角色为已拥有角色时会自动切换成未拥有的角色。\n 附奖池自动选择缺口最多的碎片,pickup池未选满角色自动选择未拥有角色,有多个则按角色编号大到小选取 \n 先免费十连->限定十连券->钻石' )
249+ @description ('警告!真抽!\n 抽到出指NEW出保底角色,或达天井停下来,如果已有保底角色,就不会NEW!意味着就是一井!\n 智能pickup指当前pickup角色为已拥有角色时会自动切换成未拥有的角色。\n 附奖池自动选择缺口最多的碎片,pickup池未选满角色自动选择未拥有角色,有多个则按角色编号大到小或小到大选取 \n 先免费十连->限定十连券->钻石' )
250250@name ('抽卡' )
251- @booltype ( "single_ticket " , "用单抽券 " , False )
251+ @singlechoice ( "gacha_method " , "抽取方式 " , '十连' , [ '十连' , '单抽' , '单抽券' ] )
252252@singlechoice ("pool_id" , "池子" , "" , db .get_cur_gacha )
253- @booltype ('gacha_start_auto_select_pickup' , "智能pickup" , True )
253+ @booltype ('gacha_start_auto_select_pickup_min_first' , "PickUp编号小优先" , False )
254+ @booltype ('gacha_start_auto_select_pickup' , "智能PickUp" , True )
254255@booltype ("cc_until_get" , "抽到出" , False )
255256@default (True )
256257class gacha_start (Module ):
@@ -262,7 +263,8 @@ async def do_task(self, client: pcrclient):
262263 if ':' not in self .get_config ('pool_id' ):
263264 raise ValueError ("配置格式不正确" )
264265 gacha_id = int (self .get_config ('pool_id' ).split (':' )[0 ])
265- single_ticket = self .get_config ('single_ticket' )
266+ gacha_method = self .get_config ('gacha_method' )
267+ pickup_min_first = self .get_config ('gacha_start_auto_select_pickup_min_first' )
266268 real_exchange_id = 0
267269 if gacha_id == 120001 :
268270 if not client .data .return_fes_info_list or all (item .end_time <= client .time for item in client .data .return_fes_info_list ):
@@ -287,26 +289,36 @@ async def do_task(self, client: pcrclient):
287289 gacha_start_auto_select_pickup : bool = self .get_config ('gacha_start_auto_select_pickup' )
288290 try :
289291 while True :
290- if single_ticket :
291- reward += await client .exec_gacha_aware (target_gacha , 1 , eGachaDrawType .Ticket , client .data .get_inventory (db .gacha_single_ticket ), 0 )
292- else :
292+ if gacha_method == '单抽券' :
293+ reward += await client .exec_gacha_aware (target_gacha , 1 , eGachaDrawType .Ticket , client .data .get_inventory (db .gacha_single_ticket ), 0 , gacha_start_auto_select_pickup , pickup_min_first )
294+ elif gacha_method == '单抽' :
295+ reward += await client .exec_gacha_aware (target_gacha , 1 , eGachaDrawType .Payment , client .data .jewel .free_jewel + client .data .jewel .jewel , 0 , gacha_start_auto_select_pickup , pickup_min_first )
296+ elif gacha_method == '十连' :
293297 if isinstance (resp , GachaIndexResponse ) and resp .campaign_info and resp .campaign_info .fg10_exec_cnt and target_gacha .id in db .campaign_free_gacha_data [resp .campaign_info .campaign_id ]:
294- reward += await client .exec_gacha_aware (target_gacha , 10 , eGachaDrawType .Campaign10Shot , cnt , resp .campaign_info .campaign_id , gacha_start_auto_select_pickup )
298+ reward += await client .exec_gacha_aware (target_gacha , 10 , eGachaDrawType .Campaign10Shot , cnt , resp .campaign_info .campaign_id , gacha_start_auto_select_pickup , pickup_min_first )
295299 resp .campaign_info .campaign_id -= 1
296300 elif any (client .data .get_inventory (temp_ticket ) > 0 for temp_ticket in temp_tickets ):
297301 # find first ticket
298302 ticket = next ((temp_ticket for temp_ticket in temp_tickets if client .data .get_inventory (temp_ticket )))
299303 num = client .data .get_inventory (ticket )
300- reward += await client .exec_gacha_aware (target_gacha , 10 , eGachaDrawType .Temp_Ticket_10 , num , 0 , gacha_start_auto_select_pickup )
304+ reward += await client .exec_gacha_aware (target_gacha , 10 , eGachaDrawType .Temp_Ticket_10 , num , 0 , gacha_start_auto_select_pickup , pickup_min_first )
305+ elif any (client .data .get_inventory (gacha_ten_ticket ) > 0 for gacha_ten_ticket in db .gacha_ten_tickets ):
306+ ticket = next ((gacha_ten_ticket for gacha_ten_ticket in db .gacha_ten_tickets if client .data .get_inventory (gacha_ten_ticket )))
307+ num = client .data .get_inventory (ticket )
308+ reward += await client .exec_gacha_aware (target_gacha , 10 , eGachaDrawType .Ticket , num , 0 , gacha_start_auto_select_pickup , pickup_min_first ) # real ticket ?
301309 else :
302- reward += await client .exec_gacha_aware (target_gacha , 10 , eGachaDrawType .Payment , client .data .jewel .free_jewel + client .data .jewel .jewel , 0 , gacha_start_auto_select_pickup )
310+ reward += await client .exec_gacha_aware (target_gacha , 10 , eGachaDrawType .Payment , client .data .jewel .free_jewel + client .data .jewel .jewel , 0 , gacha_start_auto_select_pickup , pickup_min_first )
311+ else :
312+ raise ValueError ("未知的抽卡方式" )
313+
303314 cnt += 1
304315 if not always or self .can_stop (reward .new_unit , db .gacha_exchange_chara [target_gacha .exchange_id if not real_exchange_id else real_exchange_id ]):
305316 break
317+
306318 except :
307319 raise
308320 finally :
309- self ._log (f"抽取了{ cnt } 次{ '十连' if not single_ticket else '单抽' } " )
321+ self ._log (f"抽取了{ cnt } 次{ gacha_method } " )
310322 self ._log (await client .serlize_gacha_reward (reward , target_gacha .id ))
311323 point = client .data .gacha_point [target_gacha .exchange_id ].current_point if target_gacha .exchange_id in client .data .gacha_point else 0
312324 self ._log (f"当前pt为{ point } " )
0 commit comments