hch
2019-06-06 8748bbbb0bcf027f0e77cc203aa60b2d68ddcebc
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
@@ -592,7 +592,7 @@
        return
    FBLogic.OnCollecting(curPlayer, tick)
    npcID = curNPC.GetNPCID()
    collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
    collectNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("CollectNPC", npcID)
    if collectNPCIpyData:
        DoCollectingLostHP(curPlayer, collectNPCIpyData, tick, False)
    return
@@ -614,7 +614,7 @@
    curPlayer.SetDict(ChConfig.Def_PlayerKey_CollectLostHPTick, tick)
    lostValue = int(GameObj.GetMaxHP(curPlayer) * lostHPPer / 100.0) * lostTime
    skillTypeID, buffOwner = 0, None
    SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick)
    SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick, skillAffect=False)
    GameWorld.DebugLog("采集掉血: npcID=%s,lostHPPer=%s,lostTime=%s,lostValue=%s" % (collectNPCIpyData.GetNPCID(), lostHPPer, lostTime, lostValue))
    return
@@ -673,14 +673,14 @@
# @remarks 刷新以单位时间(分钟)消耗耐久的物品
def ProcessRefreshTimeItem(curPlayer, tick):
    reFlash = False
    #2分钟遍历一次,时效道具时间到不消失,
    if tick - curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_EquipTime) \
    < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_TimeItem] :
        < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_TimeItem]:
        return reFlash
    #耐久减少值/分钟
    reFlash = ProcessTimeEquip(curPlayer, tick)
    return reFlash
@@ -1074,38 +1074,38 @@
# @return 布尔值
# @remarks 处理耐久计算方式为:现实时间刷新方式的物品
def ProcessTimeEquip(curPlayer, tick):
    return
#境界装备修改,暂屏蔽,待优化
#    itemManager = curPlayer.GetItemManager()
#    hasItemClear = False
#
#    curPack = itemManager.GetPack(IPY_GameWorld.rptEquip)
#    for i in range(0, curPack.GetCount()):
#        curItem = curPack.GetAt(i)
#
#        #异常物品
#        if not ItemCommon.CheckItemCanUse(curItem):
#            continue
#
#        if curItem.GetEndureReduceType() not in [ChConfig.Def_EquipReduceType_RTimeItem,
#                                             ChConfig.Def_EquipReduceType_Time]:
#            continue
#
#        #处理现实时间物品逻辑
#        if __DoLogic_ProcessTimeEquip(curPlayer, curItem, i):
#            hasItemClear = True
#
#
#    if hasItemClear:
#        #装备重刷属性
#        PlayerWing.CalcWingAttr(curPlayer)
#        ChEquip.RefreshPlayerEquipAttribute(curPlayer)
#
#
#    # 进行更新时效道具刷新时间
#    curPlayer.SetDict(ChConfig.Def_PlayerKey_EquipTime, tick)
#
#    return hasItemClear
    itemManager = curPlayer.GetItemManager()
    hasItemClear = False
    classLV = 0 # 只处理非境界装备的时效物品
    curPack = itemManager.GetPack(IPY_GameWorld.rptEquip)
    for equipPlace in ChConfig.EquipPlace_LingQi:
        ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
        if not ipyData:
            continue
        index = ipyData.GetGridIndex()
        curItem = curPack.GetAt(index)
        #异常物品
        if not ItemCommon.CheckItemCanUse(curItem):
            continue
        if curItem.GetEndureReduceType() not in [ChConfig.Def_EquipReduceType_RTimeItem,
                                                 ChConfig.Def_EquipReduceType_Time]:
            continue
        #处理现实时间物品逻辑
        if __DoLogic_ProcessTimeEquip(curPlayer, curItem, index):
            hasItemClear = True
    if hasItemClear:
        #装备重刷属性
        ChEquip.RefreshPlayerLingQiEquipAttr(curPlayer)
    # 进行更新时效道具刷新时间
    curPlayer.SetDict(ChConfig.Def_PlayerKey_EquipTime, tick)
    return hasItemClear
#---------------------------------------------------------------------
## 装备有效时间到了需要脱下,有效时间物品改成不消失,但是无使用效果 可出售和续费
def __DoLogic_ProcessTimeEquip(curPlayer, curItem, equipIndex):
@@ -1122,7 +1122,7 @@
        # 没有空位,玩家主动取下,计算属性时无效化
        # 过期属性时效需刷属性
        return True
    result = ItemControler.PlayerItemControler(curPlayer).UnEquipItem(equipIndex, spaceIndex)
    if not result:
        # 过期属性时效需刷属性