|  |  | 
 |  |  | import IpyGameDataPY
 | 
 |  |  | import SkillCommon
 | 
 |  |  | import PlayerControl
 | 
 |  |  | import ChNetSendPack
 | 
 |  |  | import GameWorld
 | 
 |  |  | 
 | 
 |  |  | # 关于血量的函数这里只包装最简单的超DWORD处理
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |     return
 | 
 |  |  | def GetLowestHP(gameObj):
 | 
 |  |  |     return gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnLowestHP) + gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnLowestHPEx) * ShareDefine.Def_PerPointValue
 | 
 |  |  | 
 | 
 |  |  | def GetMaxXP(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrMaxXP)
 | 
 |  |  | def SetMaxXP(gameObj, value): gameObj.SetDict(ChConfig.Def_PlayerKey_AttrMaxXP, value)
 | 
 |  |  | def GetXP(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrXP)
 | 
 |  |  | def SetXP(gameObj, value):
 | 
 |  |  |     ## XP值,用作妖气值
 | 
 |  |  |     befXP = GetXP(gameObj)
 | 
 |  |  |     maxXP = GetMaxXP(gameObj)
 | 
 |  |  |     value = min(value, maxXP)
 | 
 |  |  |     gameObj.SetDict(ChConfig.Def_PlayerKey_AttrXP, value)
 | 
 |  |  |     NotifyObjInfoRefresh(gameObj, IPY_GameWorld.CDBPlayerRefresh_XP, value)
 | 
 |  |  |     timeline = gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline)
 | 
 |  |  |     if timeline:
 | 
 |  |  |         if befXP < maxXP and value >= maxXP:
 | 
 |  |  |             GameWorld.DebugLog("        XP已满: curID=%s,timeline=%s" % (gameObj.GetID(), timeline))
 | 
 |  |  |             gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnXPFullTimeline, timeline) # 设置XP满时的回合
 | 
 |  |  |         elif value < maxXP:
 | 
 |  |  |             gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnXPFullTimeline, 0)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | #---自动恢复XP值比率----
 | 
 |  |  | def GetXPRestorePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrXPRestorePer)
 | 
 |  |  | def SetXPRestorePer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrXPRestorePer, value)
 | 
 |  |  | 
 | 
 |  |  | def GetAngryValue(curAngry):
 | 
 |  |  |     return curAngry.GetAngryValue() + curAngry.GetAngryValueEx() * ShareDefine.Def_PerPointValue
 | 
 |  |  | 
 |  |  |     if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
 | 
 |  |  |         PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_CureDefPer, value)
 | 
 |  |  |     return
 | 
 |  |  | 
 | 
 |  |  | def NotifyObjInfoRefresh(gameObj, refreshType, value):
 | 
 |  |  |     ##0418通知对象属性刷新
 | 
 |  |  |     sendPack = ChNetSendPack.tagObjInfoRefresh()
 | 
 |  |  |     sendPack.Clear()
 | 
 |  |  |     sendPack.ObjID = gameObj.GetID()
 | 
 |  |  |     sendPack.ObjType = gameObj.GetGameObjType()
 | 
 |  |  |     sendPack.RefreshType = refreshType
 | 
 |  |  |     sendPack.Value = value % ShareDefine.Def_PerPointValue
 | 
 |  |  |     sendPack.ValueEx = value / ShareDefine.Def_PerPointValue
 | 
 |  |  |     gameObj.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength())
 | 
 |  |  |     return
 |