| | |
| | | ## 装备有效时间到了需要脱下,有效时间物品改成不消失,但是无使用效果 可出售和续费
|
| | | def __DoLogic_ProcessTimeEquip(curPlayer, curItem, equipIndex):
|
| | | #验证物品是否过期
|
| | | curItemExpireTime = curItem.GetExpireTime()
|
| | | curItemExpireTime = curItem.GetUserAttr(ShareDefine.Def_IudetExpireTime)
|
| | | if not curItemExpireTime:
|
| | | curItemExpireTime = curItem.GetExpireTime()
|
| | | curItemPastTime = time.time() - curItem.GetUserAttr(ShareDefine.Def_IudetCreateTime)
|
| | | if curItemExpireTime - curItemPastTime > 0:
|
| | | return
|
| | |
| | | #GameWorld.DebugLog("退出Boss状态!", curPlayer.GetPlayerID())
|
| | |
|
| | | # 脱离PK战斗 X秒后按比例恢复
|
| | | if not IsInPKState(curPlayer):
|
| | | if tick - curPlayer.GetDictByKey("StartProDTick") < IpyGameDataPY.GetFuncCfg("MagicExterior", 2) * 1000:
|
| | | return
|
| | | |
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | return
|
| | | |
| | | # 每秒恢复
|
| | | if tick - curPlayer.GetDictByKey("restoreProDTick") < 1000:
|
| | | return
|
| | | #非PK状态恢复护盾
|
| | | PlayerControl.SetProDef(curPlayer, min(PlayerControl.GetProDef(curPlayer) + \
|
| | | IpyGameDataPY.GetFuncCfg("MagicExterior", 3)*PlayerControl.GetMaxProDef(curPlayer)/ChConfig.Def_MaxRateValue, \
|
| | | PlayerControl.GetMaxProDef(curPlayer)))
|
| | | curPlayer.SetDict("restoreProDTick", tick)
|
| | | ProcessProDef(curPlayer, tick)
|
| | | return
|
| | |
|
| | | # 脱离PK战斗 X秒后按比例恢复
|
| | | def ProcessProDef(curPlayer, tick):
|
| | | if PlayerControl.GetProDefHPPer(curPlayer) == 0:
|
| | | # 没转化值
|
| | | return
|
| | | |
| | | # 脱离PK战斗 X秒后按比例恢复
|
| | | if IsInPKState(curPlayer):
|
| | | return
|
| | | |
| | | if tick - curPlayer.GetDictByKey("StartProDTick") < IpyGameDataPY.GetFuncCfg("MagicExterior", 2) * 1000:
|
| | | return
|
| | | |
| | | if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
|
| | | return
|
| | | |
| | | # 每秒恢复
|
| | | if tick - curPlayer.GetDictByKey("restoreProDTick") < 1000:
|
| | | return
|
| | | |
| | | curProDef = PlayerControl.GetProDef(curPlayer)
|
| | | maxProDef = PlayerControl.GetMaxProDef(curPlayer)
|
| | | |
| | | if curProDef == maxProDef:
|
| | | return
|
| | | |
| | | #非PK状态恢复护盾
|
| | | PlayerControl.SetProDef(curPlayer, min(curProDef + \
|
| | | IpyGameDataPY.GetFuncCfg("MagicExterior", 3)*maxProDef/ChConfig.Def_MaxRateValue, maxProDef))
|
| | | curPlayer.SetDict("restoreProDTick", tick)
|
| | |
|
| | | return
|
| | |
|
| | |
|
| | | def IsInPKState(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick) > 0
|
| | | def SetPKStateTick(curPlayer, tick):
|
| | | if not curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick):
|