hxp
2025-01-09 c5731326acc36a3cfc6870ddb51ce2cc86e2cdc5
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerZhanling.py
@@ -42,7 +42,11 @@
ZhanlingType_GubaoTrain, # 古宝养成 8
ZhanlingType_Xianyuan, # 仙缘 9
ZhanlingType_Huanjingge, # 幻境阁 10
) = range(1, 1 + 10)
ZhanlingType_Lianqi, # 炼器 11
) = range(1, 1 + 11)
# 用Value1记录进度的战令类型
ZhanlingValue1TypeList = [ZhanlingType_Huanjingge, ZhanlingType_Lianqi]
def OnPlayerLogin(curPlayer):
    for zhanlingType in ZhanlingTypeList:
@@ -102,6 +106,9 @@
    if zhanlingType == ZhanlingType_Xianyuan:
        backValue = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanScore)
        PlayerControl.SetMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanScore, 0)
    elif zhanlingType in ZhanlingValue1TypeList:
        backValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhanlingValue1 % zhanlingType)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhanlingValue1 % zhanlingType, 0)
    GameWorld.Log("重置战令: zhanlingType=%s,backValue=%s,state=(%s to %s) stateH=(%s to %s)" 
                  % (zhanlingType, backValue, state, updState, stateH, updStateH), curPlayer.GetPlayerID())
    
@@ -161,7 +168,7 @@
    return
def AddZhanlingValue(curPlayer, zhanlingType, addValue=1):
    if zhanlingType not in [ZhanlingType_Huanjingge]:
    if zhanlingType not in ZhanlingValue1TypeList:
        return
    curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhanlingValue1 % zhanlingType)
    updValue = min(ChConfig.Def_UpperLimit_DWord, curValue + addValue)
@@ -172,7 +179,7 @@
    return updValue
def SetZhanlingValue(curPlayer, zhanlingType, value1):
    if zhanlingType not in [ZhanlingType_Huanjingge]:
    if zhanlingType not in ZhanlingValue1TypeList:
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ZhanlingValue1 % zhanlingType, value1)
    GameWorld.DebugLog("设置战令进度: zhanlingType=%s,value1=%s" % (zhanlingType, value1), curPlayer.GetPlayerID())
@@ -211,7 +218,7 @@
        curValue = PlayerActGubao.GetActGubaoTrainScore(curPlayer)
    elif zhanlingType == ZhanlingType_Xianyuan:
        curValue = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_XianyuanScore)
    elif zhanlingType == ZhanlingType_Huanjingge:
    elif zhanlingType == ZhanlingValue1TypeList:
        curValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhanlingValue1 % zhanlingType)
    else:
        return