#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#
|
##@package E:/GameSVN/U3DGame/ProjectSServer/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameObj.py
|
# @todo:
|
#
|
# @author: Alee
|
# @date 2017-10-24 ÏÂÎç07:49:45
|
# @version 1.0
|
#
|
# @note:
|
#
|
#---------------------------------------------------------------------
|
|
import ShareDefine
|
import ChConfig
|
import IPY_GameWorld
|
import IpyGameDataPY
|
import SkillCommon
|
import PlayerControl
|
import ChNetSendPack
|
import TurnAttack
|
|
# ͨÓÃÊôÐÔÖµ×Öµäkey
|
Def_AttrValue = "AttrValue_%s"
|
|
#Õ½¶·µ¥Î»ÊôÐÔͨÓýӿÚ, ½öÅäÖÃÐèÒªÖ¸¶¨º¯ÊýµÄÊôÐÔID¼´¿É£¬Ã»ÓеĻ°Í¨¹ýͨÓýӿڿÉÖ±½Ó GetAttrValue, SetAttrValue
|
#ͬ¸öÊôÐÔGet, Set дÔÚÒ»Æð£¬·½±ãά»¤ [Get, Set]
|
ObjProperty_AttrIDDict = {
|
ChConfig.AttrID_Atk:[lambda curObj:curObj.GetMaxAtk(), lambda curObj, value:curObj.SetMaxAtk(value)],
|
ChConfig.AttrID_Def:[lambda curObj:curObj.GetDef(), lambda curObj, value:curObj.SetDef(value)],
|
ChConfig.AttrID_MaxHP:[lambda curObj:GetMaxHP(curObj), lambda curObj, value:SetMaxHP(curObj, value)],
|
ChConfig.AttrID_HP:[lambda curObj:GetHP(curObj), lambda curObj, value:SetHP(curObj, value)],
|
ChConfig.AttrID_AtkSpeed:[lambda curObj:GetAtkSpeed(curObj), lambda curObj, value:SetAtkSpeed(curObj, value)],
|
ChConfig.AttrID_XP:[lambda curObj:GetXP(curObj), lambda curObj, value:SetXP(curObj, value)],
|
ChConfig.AttrID_StunRate:[lambda curObj:GetFaintRate(curObj), lambda curObj, value:SetFaintRate(curObj, value)],
|
ChConfig.AttrID_StunRateDef:[lambda curObj:GetFaintDefRate(curObj), lambda curObj, value:SetFaintDefRate(curObj, value)],
|
ChConfig.AttrID_SuperHitRate:[lambda curObj:GetSuperHitRate(curObj), lambda curObj, value:SetSuperHitRate(curObj, value)],
|
ChConfig.AttrID_SuperHitRateDef:[lambda curObj:GetSuperHitRateReduce(curObj), lambda curObj, value:SetSuperHitRateReduce(curObj, value)],
|
ChConfig.AttrID_ComboRate:[lambda curObj:GetComboRate(curObj), lambda curObj, value:SetComboRate(curObj, value)],
|
ChConfig.AttrID_ComboRateDef:[lambda curObj:GetComboDefRate(curObj), lambda curObj, value:SetComboDefRate(curObj, value)],
|
ChConfig.AttrID_MissRate:[lambda curObj:GetMissRate(curObj), lambda curObj, value:SetMissRate(curObj, value)],
|
ChConfig.AttrID_MissRateDef:[lambda curObj:GetMissDefRate(curObj), lambda curObj, value:SetMissDefRate(curObj, value)],
|
ChConfig.AttrID_ParryRate:[lambda curObj:GetParryRate(curObj), lambda curObj, value:SetParryRate(curObj, value)],
|
ChConfig.AttrID_ParryRateDef:[lambda curObj:GetParryRateDef(curObj), lambda curObj, value:SetParryRateDef(curObj, value)],
|
ChConfig.AttrID_SuckHPPer:[lambda curObj:GetSuckHPPer(curObj), lambda curObj, value:SetSuckHPPer(curObj, value)],
|
ChConfig.AttrID_SuckHPPerDef:[lambda curObj:GetSuckHPDefPer(curObj), lambda curObj, value:SetSuckHPDefPer(curObj, value)],
|
ChConfig.AttrID_FinalDamPer:[lambda curObj:GetFinalHurtPer(curObj), lambda curObj, value:SetFinalHurtPer(curObj, value)],
|
ChConfig.AttrID_FinalDamPerDef:[lambda curObj:GetFinalHurtReducePer(curObj), lambda curObj, value:SetFinalHurtReducePer(curObj, value)],
|
ChConfig.AttrID_PhyDamPer:[lambda curObj:GetPhyDamPer(curObj), lambda curObj, value:SetPhyDamPer(curObj, value)],
|
ChConfig.AttrID_PhyDamPerDef:[lambda curObj:GetPhyDamPerDef(curObj), lambda curObj, value:SetPhyDamPerDef(curObj, value)],
|
ChConfig.AttrID_MagDamPer:[lambda curObj:GetMagDamPer(curObj), lambda curObj, value:SetMagDamPer(curObj, value)],
|
ChConfig.AttrID_MagDamPerDef:[lambda curObj:GetMagDamPerDef(curObj), lambda curObj, value:SetMagDamPerDef(curObj, value)],
|
ChConfig.AttrID_NormalSkillPer:[lambda curObj:GetNormalSkillPer(curObj), lambda curObj, value:SetNormalSkillPer(curObj, value)],
|
ChConfig.AttrID_NormalSkillPerDef:[lambda curObj:GetNormalSkillPerDef(curObj), lambda curObj, value:SetNormalSkillPerDef(curObj, value)],
|
ChConfig.AttrID_AngerSkillPer:[lambda curObj:GetAngerSkillPer(curObj), lambda curObj, value:SetAngerSkillPer(curObj, value)],
|
ChConfig.AttrID_AngerSkillPerDef:[lambda curObj:GetAngerSkillPerDef(curObj), lambda curObj, value:SetAngerSkillPerDef(curObj, value)],
|
ChConfig.AttrID_SuperDamPer:[lambda curObj:GetSuperHitHurtPer(curObj), lambda curObj, value:SetSuperHitHurtPer(curObj, value)],
|
ChConfig.AttrID_SuperDamPerDef:[lambda curObj:GetSuperHitHurtDefPer(curObj), lambda curObj, value:SetSuperHitHurtDefPer(curObj, value)],
|
ChConfig.AttrID_CurePer:[lambda curObj:GetCurePer(curObj), lambda curObj, value:SetCurePer(curObj, value)],
|
ChConfig.AttrID_CurePerDef:[lambda curObj:GetCureDefPer(curObj), lambda curObj, value:SetCureDefPer(curObj, value)],
|
ChConfig.AttrID_ShieldPer:[lambda curObj:GetShieldPer(curObj), lambda curObj, value:SetShieldPer(curObj, value)],
|
ChConfig.AttrID_ShieldPerDef:[lambda curObj:GetShieldPerDef(curObj), lambda curObj, value:SetShieldPerDef(curObj, value)],
|
ChConfig.AttrID_DOTPer:[lambda curObj:GetDOTPer(curObj), lambda curObj, value:SetDOTPer(curObj, value)],
|
ChConfig.AttrID_DOTPerDef:[lambda curObj:GetDOTPerDef(curObj), lambda curObj, value:SetDOTPerDef(curObj, value)],
|
}
|
|
def GetAttrValue(gameObj, attrID):
|
## ͨÓõĻñÈ¡ÊôÐÔ
|
if attrID in ObjProperty_AttrIDDict:
|
return ObjProperty_AttrIDDict[attrID][0](gameObj)
|
return gameObj.GetDictByKey(Def_AttrValue % attrID)
|
|
def SetAttrValue(gameObj, attrID, value, isNotify=True):
|
## ͨÓõÄÉèÖÃÊôÐÔ
|
if attrID in ObjProperty_AttrIDDict:
|
ObjProperty_AttrIDDict[attrID][1](gameObj, value)
|
else:
|
gameObj.SetDict(Def_AttrValue % attrID, value)
|
|
if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
# ¿¨ÅÆÏîÄ¿£¬Ôݲ»ÐèÒªÍ¨ÖªÍæ¼ÒÏà¹ØµÄÊôÐÔ£¬ÒòΪ×îÖÕ¶¼ÌåÏÖÔÚ¿¨ÅÆÉÏ£¬È«²¿ÓÉǰ¶Ë×Ô¼º¼ÆËã
|
return
|
|
if isNotify:
|
if attrID in ChConfig.CDBRefresh_AttrIDDict:
|
refreshType, isBig = ChConfig.CDBRefresh_AttrIDDict[attrID]
|
NotifyObjInfoRefresh(gameObj, refreshType, isBig)
|
|
return
|
|
# ¹ØÓÚѪÁ¿µÄº¯ÊýÕâÀïÖ»°ü×°×î¼òµ¥µÄ³¬DWORD´¦Àí
|
|
def GetMaxHP(gameObj):
|
return gameObj.GetMaxHPEx() * ShareDefine.Def_PerPointValue + gameObj.GetMaxHP()
|
|
def SetMaxHP(gameObj, value):
|
gameObj.SetMaxHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
return
|
|
def GetHP(gameObj):
|
return gameObj.GetHPEx() * ShareDefine.Def_PerPointValue + gameObj.GetHP()
|
|
def SetHP(gameObj, value, isNotify=None, isByTime=False):
|
if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
if isNotify == None:
|
isNotify = True
|
else:
|
if isNotify == None:
|
isNotify = False
|
if gameObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
npcID = gameObj.GetNPCID()
|
if IpyGameDataPY.GetIpyGameDataNotLog("NPCTimeLostHP", npcID) and not isByTime and value not in [GetMaxHP(gameObj), 0]:
|
#GameWorld.DebugLog("²»ÄÜÉèÖð´Ê±¼äµôѪµÄ¹ÖÎïѪÁ¿! id=%s,npciD=%s,value=%s,isByTime=%s" % (gameObj.GetID(), gameObj.GetNPCID(), value, isByTime))
|
return
|
|
gameObj.SetHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue, False)
|
if isNotify:
|
NotifyObjInfoRefresh(gameObj, IPY_GameWorld.CDBPlayerRefresh_HP, value)
|
return
|
|
def SetHPFull(gameObj, isNotify=True):
|
SetHP(gameObj, GetMaxHP(gameObj), isNotify)
|
return
|
|
def SetBaseMaxHP(gameObj, value):
|
gameObj.SetBaseMaxHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
return
|
|
def GetXP(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_XP)
|
def SetXP(gameObj, value, isNotify=True):
|
## XPÖµ£¬ÓÃ×÷ÅÆøÖµ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_XP, value)
|
if isNotify:
|
NotifyObjInfoRefresh(gameObj, IPY_GameWorld.CDBPlayerRefresh_XP, value)
|
return
|
|
def GetAngryValue(curAngry):
|
return curAngry.GetAngryValue() + curAngry.GetAngryValueEx() * ShareDefine.Def_PerPointValue
|
def SetAngryValue(curAngry, value):
|
curAngry.SetAngryValue(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
return
|
|
## ÉèÖÃbuff״̬(½Å±¾×Ô¶¨Òåö¾Ù)
|
# @param pyState ״̬
|
# @param isTrue ÊÇ·ñÉèÖøÃ״̬
|
# @return None
|
def SetPyPlayerState(gameObj, pyState, isAdd):
|
if pyState == 0:
|
return
|
if pyState not in ChConfig.Def_PlayerStateList:
|
return
|
|
curState = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_CurState)
|
if isAdd:
|
# Ôö¼Ó
|
updState = curState | pow(2, pyState)
|
else:
|
# ɾ³ý
|
if curState & pow(2, pyState) == 0:
|
return
|
else:
|
updState = curState ^ pow(2, pyState)
|
|
|
#GameWorld.DebugLog("SetPyPlayerState (%s - %s), curState=%s,updState=%s"
|
# % (pyState, isAdd, curState, updState))
|
gameObj.SetDict(ChConfig.Def_PlayerKey_CurState, updState)
|
return
|
|
## »ñÈ¡buff״̬(½Å±¾×Ô¶¨Òåö¾Ù)
|
# @param pyState ״̬
|
# @return ÊÇ·ñ¸Ã״̬
|
# @remarks ¸Ã״̬Ϊbuff¶ÔÓ¦µÄ×Ô¶¨Òå״̬Ч¹û
|
|
#===============================================================================
|
# ´ËÎÊÌâÔÚ4012 Ïûʧʱ´¦Àí
|
# # Ŀǰµ±Ä¿±êÉíÉ϶à¸öbuff¶¼ÓÐͬһЧ¹ûʱ(È綨Éí)£¬ÔÚÒ»¸öbuffÏûʧʱ»á½â³ý¸Ã״̬
|
# # ¹Ê¸Ã״̬±ê¼Ç½öΪһ¸ö·Ç¾«È·µÄ±ê¼Ç£¬Ó¦ÓÃÖÐÇë×¢Ò⣡£¡£¡(µ±ÇÒ½öµ±¶à¸öbuffÓÐͬһ¸öЧ¹ûʱ»áÌáǰ½áÊø¸Ã״̬)
|
#===============================================================================
|
def GetPyPlayerState(gameObj, pyState, ownerID=0, ownerType=0):
|
if not gameObj:
|
return False
|
if pyState == 0:
|
# 0²»ÐèÒªÅжÏ
|
return True
|
curState = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_CurState)
|
|
state = curState & pow(2, pyState)
|
|
if state and ownerID:
|
# ½øÒ»²½ÅжÏÊÇ·ñÊÍ·ÅÕß
|
return True if IsInStateEffectByOwner(gameObj, ChConfig.Def_Skill_Effect_BuffState, pyState, ownerID, ownerType) else False
|
return state
|
|
# ´óÓÚµÈÓÚ2¸ö״̬ Ôò²»ÇåÀí״̬
|
def IsInStateEffectByOwner(curObj, effectID, stateType, ownerID, ownerType):
|
|
for buffType in xrange(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax):
|
if buffType in ChConfig.Def_BuffType_OnlyPlayer:
|
continue
|
|
buffTuple = SkillCommon.GetBuffManagerByBuffType(curObj, buffType)
|
#ͨ¹ýÀàÐÍ»ñȡĿ±êµÄbuff¹ÜÀíÆ÷Ϊ¿Õ£¬ÔòÌø³ö
|
if buffTuple == ():
|
continue
|
|
buffManager = buffTuple[0]
|
|
for i in range(buffManager.GetEffectCount()):
|
effect = buffManager.GetEffect(i)
|
if not effect:
|
continue
|
|
if effect.GetEffectID() != effectID:
|
continue
|
|
if effect.GetEffectValue(0) != stateType:
|
continue
|
|
if buffManager.GetEffectOwnerID(i) != ownerID:
|
continue
|
|
if buffManager.GetEffectOwnerType(i) != ownerType:
|
continue
|
|
return True
|
return False
|
|
|
def ClearPyPlayerState(gameObj):
|
gameObj.SetDict(ChConfig.Def_PlayerKey_CurState, 0)
|
return
|
|
def GetLastHurtValue(gameObj):
|
## ×îºóÒ»»÷É˺¦Öµ
|
hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValue)
|
hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastHurtValueEx)
|
return hurtEx * ShareDefine.Def_PerPointValue + hurt
|
def SetLastHurtValue(gameObj, value):
|
gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValue, value % ShareDefine.Def_PerPointValue)
|
gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValueEx, value / ShareDefine.Def_PerPointValue)
|
return
|
|
def GetLastBeHurtValue(gameObj):
|
## ×îºóÒ»´ÎÊÜÉËÖµ
|
return 0
|
#hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastBeHurtValue)
|
#hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastBeHurtValueEx)
|
#return hurtEx * ShareDefine.Def_PerPointValue + hurt
|
def SetLastBeHurtValue(gameObj, value):
|
#gameObj.SetDict(ChConfig.Def_PlayerKey_LastBeHurtValue, value % ShareDefine.Def_PerPointValue)
|
#gameObj.SetDict(ChConfig.Def_PlayerKey_LastBeHurtValueEx, value / ShareDefine.Def_PerPointValue)
|
return
|
|
def GetBloodShiledHurt(gameObj):
|
## É˺¦ÖµÓÃÓÚѪ¶ÜµÖÏû
|
return 0
|
def SetBloodShiledHurt(gameObj, value):
|
return
|
|
## ---------------------------------------------------------
|
def ClearBattleEffect(gameObj):
|
gameObj.ClearBattleEffect()
|
# ÆäËûpy²ã×Ô¶¨ÒåÕ½¶·ÊôÐÔ£¬ÓÉÓÚEffGetSetÖв»ÊÇËùÓÐÊôÐÔ½Ó¿Ú¾ùͨÓ㬹ÌÕâÀïÏÈÊÖ¶¯µ÷ÓÃ
|
SetPetDamPer(gameObj, 0)
|
SetFinalHurtPer(gameObj, 0)
|
SetFinalHurtReducePer(gameObj, 0)
|
SetAtkSpeed(gameObj, 0)
|
SetSuperHitRateReduce(gameObj, 0)
|
SetSuperHitReduce(gameObj, 0)
|
SetFaintRate(gameObj, 0)
|
SetFaintDefRate(gameObj, 0)
|
SetComboRate(gameObj, 0)
|
SetComboDefRate(gameObj, 0)
|
SetComboDamPer(gameObj, 0)
|
SetAtkBackRate(gameObj, 0)
|
SetAtkBackDefRate(gameObj, 0)
|
SetSuckHPPer(gameObj, 0)
|
SetSuckHPDefPer(gameObj, 0)
|
SetAtkBackHP(gameObj, 0)
|
SetCurePer(gameObj, 0)
|
SetCureDefPer(gameObj, 0)
|
SetPetStrengthenPer(gameObj, 0)
|
SetPetWeakenPer(gameObj, 0)
|
SetDamageBackRate(gameObj, 0)
|
SetSuperHitHurtPer(gameObj, 0)
|
SetSuperHitHurtDefPer(gameObj, 0)
|
return
|
|
def GetPetDamPer(gameObj): return 0
|
def SetPetDamPer(gameObj, value):
|
return
|
|
def GetFinalHurtPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_FinalDamPer)
|
def SetFinalHurtPer(gameObj, value):
|
## ×îÖÕÉ˺¦°Ù·Ö±È
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_FinalDamPer, value)
|
if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_FinalDamPer, value)
|
return
|
|
def GetFinalHurtReducePer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_FinalDamPerDef)
|
def SetFinalHurtReducePer(gameObj, value):
|
## ×îÖÕÉ˺¦¼õÃâ°Ù·Ö±È
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_FinalDamPerDef, value)
|
return
|
|
def GetPhyDamPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_PhyDamPer)
|
def SetPhyDamPer(gameObj, value):
|
## ÎïÀíÔöÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_PhyDamPer, value)
|
return
|
|
def GetPhyDamPerDef(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_PhyDamPerDef)
|
def SetPhyDamPerDef(gameObj, value):
|
## ÎïÀí¼õÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_PhyDamPerDef, value)
|
return
|
|
def GetMagDamPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_MagDamPer)
|
def SetMagDamPer(gameObj, value):
|
## ·¨ÊõÔöÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_MagDamPer, value)
|
return
|
|
def GetMagDamPerDef(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_MagDamPerDef)
|
def SetMagDamPerDef(gameObj, value):
|
## ·¨Êõ¼õÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_MagDamPerDef, value)
|
return
|
|
def GetNormalSkillPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_NormalSkillPer)
|
def SetNormalSkillPer(gameObj, value):
|
## ÆÕ¼¼ÔöÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_NormalSkillPer, value)
|
return
|
|
def GetNormalSkillPerDef(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_NormalSkillPerDef)
|
def SetNormalSkillPerDef(gameObj, value):
|
## ÆÕ¼¼¼õÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_NormalSkillPerDef, value)
|
return
|
|
def GetAngerSkillPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_AngerSkillPer)
|
def SetAngerSkillPer(gameObj, value):
|
## ż¼ÔöÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_AngerSkillPer, value)
|
return
|
|
def GetAngerSkillPerDef(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_AngerSkillPerDef)
|
def SetAngerSkillPerDef(gameObj, value):
|
## ż¼¼õÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_AngerSkillPerDef, value)
|
return
|
|
def GetDOTPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_DOTPer)
|
def SetDOTPer(gameObj, value):
|
## ³ÖÐøÔöÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_DOTPer, value)
|
return
|
|
def GetDOTPerDef(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_DOTPerDef)
|
def SetDOTPerDef(gameObj, value):
|
## ³ÖÐø¼õÉË
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_DOTPerDef, value)
|
return
|
|
def GetShieldPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ShieldPer)
|
def SetShieldPer(gameObj, value):
|
## Ç¿»¯»¤¶Ü
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ShieldPer, value)
|
return
|
|
def GetShieldPerDef(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ShieldPerDef)
|
def SetShieldPerDef(gameObj, value):
|
## Èõ»¯»¤¶Ü
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ShieldPerDef, value)
|
return
|
|
def GetFaction(gameObj):
|
faction = gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_Faction)
|
if faction:
|
return faction
|
if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
return gameObj.GetFaction()
|
return gameObj.GetCountry()
|
def SetFaction(gameObj, value):
|
gameObj.SetDict(ChConfig.Def_Obj_Dict_Faction, value)
|
if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
gameObj.SetFaction(value)
|
return
|
|
def GetAtkSpeed(gameObj): return 0
|
def SetAtkSpeed(gameObj, value):
|
## ¹¥»÷ËÙ¶È
|
return
|
|
def GetMissRate(gameObj): return gameObj.GetMiss()
|
def SetMissRate(gameObj, value):
|
## ÉÁ±Ü¸ÅÂÊ
|
gameObj.SetMiss(value)
|
return
|
def GetMissDefRate(gameObj): return gameObj.GetHit()
|
def SetMissDefRate(gameObj, value):
|
## ¿¹ÉÁ±ÜÂÊ = ÃüÖÐ
|
gameObj.SetHit(value)
|
return
|
def GetSuperHitRate(gameObj): return gameObj.GetSuperHitRate()
|
def SetSuperHitRate(gameObj, value):
|
## ±©»÷¸ÅÂÊ
|
gameObj.SetSuperHitRate(value)
|
return
|
def GetSuperHitRateReduce(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuperHitRateDef)
|
def SetSuperHitRateReduce(gameObj, value):
|
## ¿¹±©»÷¸ÅÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuperHitRateDef, value)
|
return
|
|
def GetSuperHitReduce(gameObj): return 0
|
def SetSuperHitReduce(gameObj, value):
|
## ±©»÷¹Ì¶¨É˺¦¼õÃâ - ±©»÷ʱ¸½¼Ó¹Ì¶¨É˺¦¼õÃ⣬Óë atkObj.GetSuperHit() Ïà¶Ô
|
return
|
|
def GetSuperHitHurtPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuperDamPer)
|
def SetSuperHitHurtPer(gameObj, value):
|
## Ç¿»¯±©ÉË - ±©»÷ʱµÄ×ÜÉ˺¦¼Ó³É£¬Óë SuperHitHurtDefPer Ïà¶Ô£¬×¢ÒâÓ뱩»÷¹Ì¶¨É˺¦Çø·Ö
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuperDamPer, value)
|
return
|
def GetSuperHitHurtDefPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuperDamPerDef)
|
def SetSuperHitHurtDefPer(gameObj, value):
|
## Èõ»¯±©ÉË - ±©»÷ʱµÄ×ÜÉ˺¦¼õÃâ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuperDamPerDef, value)
|
return
|
|
def GetParryRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ParryRate)
|
def SetParryRate(gameObj, value):
|
## ¸ñµ²¸ÅÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ParryRate, value)
|
return
|
|
def GetParryRateDef(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ParryRateDef)
|
def SetParryRateDef(gameObj, value):
|
## ¿¹¸ñµ²¸ÅÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ParryRateDef, value)
|
return
|
|
def GetFaintRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_StunRate)
|
def SetFaintRate(gameObj, value):
|
## »÷ÔθÅÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_StunRate, value)
|
return
|
def GetFaintDefRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_StunRateDef)
|
def SetFaintDefRate(gameObj, value):
|
## ¿¹»÷ÔθÅÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_StunRateDef, value)
|
return
|
|
def GetComboRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ComboRate)
|
def SetComboRate(gameObj, value):
|
## Á¬»÷¸ÅÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ComboRate, value)
|
return
|
def GetComboDefRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ComboRateDef)
|
def SetComboDefRate(gameObj, value):
|
## ¿¹Á¬»÷¸ÅÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ComboRateDef, value)
|
return
|
def GetComboDamPer(gameObj): return 0
|
def SetComboDamPer(gameObj, value):
|
## Á¬»÷É˺¦
|
return
|
|
def GetAtkBackRate(gameObj): return 0
|
def SetAtkBackRate(gameObj, value):
|
## ·´»÷¸ÅÂÊ
|
return
|
def GetAtkBackDefRate(gameObj): return 0
|
def SetAtkBackDefRate(gameObj, value):
|
## ¿¹·´»÷¸ÅÂÊ
|
return
|
|
def GetSuckHPPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuckHPPer)
|
def SetSuckHPPer(gameObj, value):
|
## ÎüѪ±ÈÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuckHPPer, value)
|
return
|
def GetSuckHPDefPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuckHPPerDef)
|
def SetSuckHPDefPer(gameObj, value):
|
## ¿¹ÎüѪ±ÈÂÊ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuckHPPerDef, value)
|
return
|
def GetAtkBackHP(gameObj): return 0
|
def SetAtkBackHP(gameObj, value):
|
## ÎüѪ¹Ì¶¨Öµ
|
return
|
|
def GetCurePer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_CurePer)
|
def SetCurePer(gameObj, value):
|
## Ç¿»¯ÖÎÁÆ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_CurePer, value)
|
return
|
def GetCureDefPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_CurePerDef)
|
def SetCureDefPer(gameObj, value):
|
## Èõ»¯ÖÎÁÆ
|
gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_CurePerDef, value)
|
return
|
|
def GetPetStrengthenPer(gameObj): return 0
|
def SetPetStrengthenPer(gameObj, value):
|
## Ç¿»¯ÁéÊÞ
|
return
|
def GetPetWeakenPer(gameObj): return 0
|
def SetPetWeakenPer(gameObj, value):
|
## Èõ»¯ÁéÊÞ
|
return
|
|
def GetDamageBackRate(gameObj): 0
|
def SetDamageBackRate(gameObj, value):
|
## ·´µ¯É˺¦
|
return
|
|
def NotifyObjInfoRefresh(gameObj, refreshType, value, isBig=False):
|
##0418֪ͨ¶ÔÏóÊôÐÔË¢ÐÂ
|
sendPack = ChNetSendPack.tagObjInfoRefresh()
|
sendPack.Clear()
|
sendPack.ObjID = gameObj.GetID()
|
sendPack.ObjType = gameObj.GetGameObjType()
|
sendPack.RefreshType = refreshType
|
if isBig:
|
sendPack.Value = value % ShareDefine.Def_PerPointValue
|
sendPack.ValueEx = value / ShareDefine.Def_PerPointValue
|
else:
|
sendPack.Value = value
|
sendPack.ValueEx = 0
|
turnFight = TurnAttack.GetTurnFightMgr().getNPCTurnFight(gameObj.GetID())
|
if turnFight:
|
turnFight.addBatPack(sendPack)
|
return
|
gameObj.NotifyAll(sendPack.GetBuffer(), sendPack.GetLength())
|
return
|