| | |
| | | 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):
|
| | |
| | | gameObj.SetBaseMaxHP(value % ShareDefine.Def_PerPointValue, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | def GetXP(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrXP)
|
| | | def GetXP(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_XP)
|
| | | def SetXP(gameObj, value, isNotify=True):
|
| | | ## XP值,用作怒气值
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_AttrXP, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_XP, value)
|
| | | if isNotify:
|
| | | NotifyObjInfoRefresh(gameObj, IPY_GameWorld.CDBPlayerRefresh_XP, value)
|
| | | return
|
| | |
| | |
|
| | | def GetBloodShiledHurt(gameObj):
|
| | | ## 伤害值用于血盾抵消
|
| | | hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | | hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurtEx)
|
| | | return hurtEx * ShareDefine.Def_PerPointValue + hurt
|
| | | return 0
|
| | | def SetBloodShiledHurt(gameObj, value):
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurt, value % ShareDefine.Def_PerPointValue)
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurtEx, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | ## ---------------------------------------------------------
|
| | |
| | | SetSuperHitHurtDefPer(gameObj, 0)
|
| | | return
|
| | |
|
| | | def GetPetDamPer(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrPetDamPer)
|
| | | def GetPetDamPer(gameObj): return 0
|
| | | def SetPetDamPer(gameObj, value):
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_AttrPetDamPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_PetDamPer, value)
|
| | | return
|
| | |
|
| | | def GetFinalHurtPer(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtPer)
|
| | | def GetFinalHurtPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_FinalDamPer)
|
| | | def SetFinalHurtPer(gameObj, value):
|
| | | ## 最终伤害百分比
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_FinalHurtPer, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_FinalDamPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_FinalHurtPer, value)
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_FinalDamPer, value)
|
| | | return
|
| | |
|
| | | def GetFinalHurtReducePer(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtReducePer)
|
| | | def GetFinalHurtReducePer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_FinalDamPerDef)
|
| | | def SetFinalHurtReducePer(gameObj, value):
|
| | | ## 最终伤害减免百分比
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_FinalHurtReducePer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_FinalHurtReducePer, 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):
|
| | |
| | | gameObj.SetFaction(value)
|
| | | return
|
| | |
|
| | | def GetAtkSpeed(gameObj):
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | return gameObj.GetBattleValEx1()
|
| | | return gameObj.GetDictByKey(ChConfig.AttrName_AtkSpeed)
|
| | | def GetAtkSpeed(gameObj): return 0
|
| | | def SetAtkSpeed(gameObj, value):
|
| | | ## 攻击速度
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | gameObj.SetBattleValEx1(value, True)
|
| | | else:
|
| | | gameObj.SetDict(ChConfig.AttrName_AtkSpeed, value)
|
| | | return
|
| | |
|
| | | def GetMissRate(gameObj): return gameObj.GetMiss()
|
| | |
| | | ## 暴击概率
|
| | | gameObj.SetSuperHitRate(value)
|
| | | return
|
| | | def GetSuperHitRateReduce(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_SuperHitRateReduce)
|
| | | def GetSuperHitRateReduce(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuperHitRateDef)
|
| | | def SetSuperHitRateReduce(gameObj, value):
|
| | | ## 抗暴击概率
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_SuperHitRateReduce, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_SuperHitRateReduce, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuperHitRateDef, value)
|
| | | return
|
| | |
|
| | | def GetSuperHitReduce(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_SuperHitReduce)
|
| | | def GetSuperHitReduce(gameObj): return 0
|
| | | def SetSuperHitReduce(gameObj, value):
|
| | | ## 暴击固定伤害减免 - 暴击时附加固定伤害减免,与 atkObj.GetSuperHit() 相对
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_SuperHitReduce, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_SuperHitReduce, value)
|
| | | return
|
| | |
|
| | | def GetSuperHitHurtPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_SuperHitHurtPer)
|
| | | def GetSuperHitHurtPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuperDamPer)
|
| | | def SetSuperHitHurtPer(gameObj, value):
|
| | | ## 强化暴伤 - 暴击时的总伤害加成,与 SuperHitHurtDefPer 相对,注意与暴击固定伤害区分
|
| | | gameObj.SetDict(ChConfig.AttrName_SuperHitHurtPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_SuperHitHurtPer, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuperDamPer, value)
|
| | | return
|
| | | def GetSuperHitHurtDefPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_SuperHitHurtDefPer)
|
| | | def GetSuperHitHurtDefPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuperDamPerDef)
|
| | | def SetSuperHitHurtDefPer(gameObj, value):
|
| | | ## 弱化暴伤 - 暴击时的总伤害减免
|
| | | gameObj.SetDict(ChConfig.AttrName_SuperHitHurtDefPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_SuperHitHurtDefPer, 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 GetFaintRate(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrFaintRate)
|
| | | 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(ChConfig.Def_PlayerKey_AttrFaintRate, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_FaintRate, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_StunRate, value)
|
| | | return
|
| | | def GetFaintDefRate(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrFaintDefRate)
|
| | | def GetFaintDefRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_StunRateDef)
|
| | | def SetFaintDefRate(gameObj, value):
|
| | | ## 抗击晕概率
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_AttrFaintDefRate, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_FaintDefRate, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_StunRateDef, value)
|
| | | return
|
| | |
|
| | | def GetComboRate(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrComboRate)
|
| | | def GetComboRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ComboRate)
|
| | | def SetComboRate(gameObj, value):
|
| | | ## 连击概率
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_AttrComboRate, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_ComboRate, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ComboRate, value)
|
| | | return
|
| | | def GetComboDefRate(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_ComboDefRate)
|
| | | def GetComboDefRate(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_ComboRateDef)
|
| | | def SetComboDefRate(gameObj, value):
|
| | | ## 抗连击概率
|
| | | gameObj.SetDict(ChConfig.AttrName_ComboDefRate, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_ComboDefRate, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_ComboRateDef, value)
|
| | | return
|
| | | def GetComboDamPer(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrComboDamPer)
|
| | | def GetComboDamPer(gameObj): return 0
|
| | | def SetComboDamPer(gameObj, value):
|
| | | ## 连击伤害
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_AttrComboDamPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_ComboDamPer, value)
|
| | | return
|
| | |
|
| | | def GetAtkBackRate(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_AtkBackRate)
|
| | | def GetAtkBackRate(gameObj): return 0
|
| | | def SetAtkBackRate(gameObj, value):
|
| | | ## 反击概率
|
| | | gameObj.SetDict(ChConfig.AttrName_AtkBackRate, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_AtkBackRate, value)
|
| | | return
|
| | | def GetAtkBackDefRate(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_AtkBackDefRate)
|
| | | def GetAtkBackDefRate(gameObj): return 0
|
| | | def SetAtkBackDefRate(gameObj, value):
|
| | | ## 抗反击概率
|
| | | gameObj.SetDict(ChConfig.AttrName_AtkBackDefRate, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_AtkBackDefRate, value)
|
| | | return
|
| | |
|
| | | def GetSuckHPPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_SuckHPPer)
|
| | | def GetSuckHPPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuckHPPer)
|
| | | def SetSuckHPPer(gameObj, value):
|
| | | ## 吸血比率
|
| | | gameObj.SetDict(ChConfig.AttrName_SuckHPPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_SuckHPPer, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuckHPPer, value)
|
| | | return
|
| | | def GetSuckHPDefPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_SuckHPDefPer)
|
| | | def GetSuckHPDefPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_SuckHPPerDef)
|
| | | def SetSuckHPDefPer(gameObj, value):
|
| | | ## 抗吸血比率
|
| | | gameObj.SetDict(ChConfig.AttrName_SuckHPDefPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_SuckHPDefPer, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_SuckHPPerDef, value)
|
| | | return
|
| | | def GetAtkBackHP(gameObj):
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | return gameObj.GetBattleValEx2()
|
| | | return gameObj.GetDictByKey(ChConfig.AttrName_AtkBackHP)
|
| | | def GetAtkBackHP(gameObj): return 0
|
| | | def SetAtkBackHP(gameObj, value):
|
| | | ## 吸血固定值
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | gameObj.SetBattleValEx2(value)
|
| | | else:
|
| | | gameObj.SetDict(ChConfig.AttrName_AtkBackHP, value)
|
| | | return
|
| | |
|
| | | def GetCurePer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_CurePer)
|
| | | def GetCurePer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_CurePer)
|
| | | def SetCurePer(gameObj, value):
|
| | | ## 强化治疗
|
| | | gameObj.SetDict(ChConfig.AttrName_CurePer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_CurePer, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_CurePer, value)
|
| | | return
|
| | | def GetCureDefPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_CureDefPer)
|
| | | def GetCureDefPer(gameObj): return gameObj.GetDictByKey(Def_AttrValue % ChConfig.AttrID_CurePerDef)
|
| | | def SetCureDefPer(gameObj, value):
|
| | | ## 弱化治疗
|
| | | gameObj.SetDict(ChConfig.AttrName_CureDefPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_CureDefPer, value)
|
| | | gameObj.SetDict(Def_AttrValue % ChConfig.AttrID_CurePerDef, value)
|
| | | return
|
| | |
|
| | | def GetPetStrengthenPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_PetStrengthenPer)
|
| | | def GetPetStrengthenPer(gameObj): return 0
|
| | | def SetPetStrengthenPer(gameObj, value):
|
| | | ## 强化灵兽
|
| | | gameObj.SetDict(ChConfig.AttrName_PetStrengthenPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_PetStrengthenPer, value)
|
| | | return
|
| | | def GetPetWeakenPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_PetWeakenPer)
|
| | | def GetPetWeakenPer(gameObj): return 0
|
| | | def SetPetWeakenPer(gameObj, value):
|
| | | ## 弱化灵兽
|
| | | gameObj.SetDict(ChConfig.AttrName_PetWeakenPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_PetWeakenPer, value)
|
| | | return
|
| | |
|
| | | def GetDamageBackRate(gameObj):
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | return gameObj.GetDamageBackRate()
|
| | | return gameObj.GetDictByKey(ChConfig.AttrName_DamBackPer)
|
| | | def GetDamageBackRate(gameObj): 0
|
| | | def SetDamageBackRate(gameObj, value):
|
| | | ## 反弹伤害
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | gameObj.SetDamageBackRate(value)
|
| | | else:
|
| | | gameObj.SetDict(ChConfig.AttrName_DamBackPer, value)
|
| | | return
|
| | |
|
| | | def NotifyObjInfoRefresh(gameObj, refreshType, value):
|
| | | def NotifyObjInfoRefresh(gameObj, refreshType, value, isBig=False):
|
| | | ##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
|
| | | 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)
|