hxp
2025-12-02 dbd79b2c2ddf02070041965a8d0bd70609733b78
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GameWorldLogic.FBProcess.GameLogic_Zhanchui
#
# @todo:°×¹ÇÓ¯Ò°/Õ½´¸Ãؾ³
# @author hxp
# @date 2025-09-30
# @version 1.0
#
# ÏêϸÃèÊö: °×¹ÇÓ¯Ò°/Õ½´¸Ãؾ³
#
#-------------------------------------------------------------------------------
#"""Version = 2025-09-30 10:30"""
#-------------------------------------------------------------------------------
 
import GameWorld
import ItemControler
import PlayerBeauty
import FBCommon
import PlayerTask
import ChConfig
 
def OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList):
    ## »ØºÏÕ½¶·ÇëÇó 
    
    if FBCommon.IsFBPass(curPlayer, mapID, funcLineID):
        GameWorld.DebugLog("Òѹý¹ØµÄ²»Äܲ»Öظ´ÌôÕ½! mapID=%s,funcLineID=%s" % (mapID, funcLineID))
        return
    
    return True, funcLineID
 
def OnTurnFightAward(curPlayer, guid, mapID, funcLineID, winFaction, statMsg, dateStr, reqData, awardDict):
    ## »ØºÏÕ½¶·½áËã½±Àø
    if not curPlayer:
        return
    
    isWin = winFaction == ChConfig.Def_FactionA
    
    if not isWin:
        return
    
    if FBCommon.IsFBPass(curPlayer, mapID, funcLineID):
        GameWorld.DebugLog("Òѹý¹ØµÄ²»Öظ´»ñµÃ¹ý¹Ø½±Àø! mapID=%s,funcLineID=%s" % (mapID, funcLineID))
        return
    
    itemList = FBCommon.GetPassAwardList(mapID, funcLineID)
    GameWorld.DebugLog("¹ý¹Ø½±Àø: mapID=%s,funcLineID=%s,itemList=%s" % (mapID, funcLineID, itemList))
    awardDict.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList)})
    
    # Ê×ͨ²»¿Û´ÎÊý
    FBCommon.AddEnterFBCount(curPlayer, mapID, isFree=True)
    FBCommon.SetFBPass(curPlayer, mapID, funcLineID)
    ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Zhanchui", False, {}], isNotifyAward=False)
    
    PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_FBZhanchui)
    return
    
def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, dataEx):
    ## ¿É·ñɨµ´
    
    return True
 
def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, dataEx, askRet):
    ## É¨µ´½á¹û£¬´ÎÊýÏûºÄÒÑÔÚÍâ²ã´¦Àí¿Û³ý
    
    itemList = []
    itemList += FBCommon.GetSweepAwardList(mapID, lineID, sweepCnt)
    GameWorld.DebugLog("°×¹ÇӯҰɨµ´: mapID=%s,lineID=%s,sweepCnt=%s,itemList=%s" % (mapID, lineID, sweepCnt, itemList))
    
    exItemCount, exItemID = PlayerBeauty.GetBeautyEffInfo(curPlayer, PlayerBeauty.EffType_FBZhanchuiItemEx) # É¨µ´¶îÍâÎïÆ·½±Àø
    if exItemCount and exItemID:
        itemList += [[exItemID, exItemCount, 1]] # ±ê¼ÇÊǺìÑÕЧ¹û¶îÍâ»ñµÃµÄ
        GameWorld.DebugLog("ºìÑÕ¶îÍâÔö¼Óɨµ´ÎïÆ·½±Àø: exItemID=%s, exItemCount=%s, itemList=%s" % (exItemID, exItemCount, itemList))
        
    ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Zhanchui", False, {}], isNotifyAward=False)
    
    isPass = 1
    jsonItemList = []
    for itemInfo in itemList:
        itemDict = {"ItemID":itemInfo[0], "Count":itemInfo[1]}
        if len(itemInfo) > 2:
            itemDict['BeautyEx'] = itemInfo[2]
        jsonItemList.append(itemDict)
    overDict = {FBCommon.Over_itemInfo:jsonItemList, FBCommon.Over_isSweep:1}
    FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
    
    return True