| | |
| | | #NPC读表取
|
| | | return attack.GetHurtType()
|
| | |
|
| | | def GetAtkDistType(curObj):
|
| | | ## 获取是近战还是远程,默认近战
|
| | | if curObj.GetGameObjType() != IPY_GameWorld.gotNPC:
|
| | | return ChConfig.AtkDistType_Short
|
| | | |
| | | playerID = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_LineupPlayerID)
|
| | | if not playerID:
|
| | | return ChConfig.AtkDistType_Short
|
| | | |
| | | heroID = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_HeroID)
|
| | | if heroID:
|
| | | heroIpyData = IpyGameDataPY.GetIpyGameData("Hero", heroID)
|
| | | if heroIpyData:
|
| | | return heroIpyData.GetAtkDistType()
|
| | | |
| | | npcID = curObj.GetNPCID()
|
| | | npcDataEx = NPCCommon.GetNPCDataPy(npcID)
|
| | | if npcDataEx:
|
| | | return npcDataEx.GetAtkDistType()
|
| | | |
| | | return ChConfig.AtkDistType_Short
|
| | |
|
| | | #--------------------------------------------------------------------------
|
| | | ## 设置玩家进入战斗状态
|
| | | # @param defender 当前玩家(被攻击了)
|
| | |
| | | # 攻击时防守方神兵护盾的处理
|
| | | def CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick):
|
| | | return hurtValue
|
| | | # if defObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | # return hurtValue
|
| | | # |
| | | # if not CheckIsPlayerOnwer(atkObj):
|
| | | # return hurtValue
|
| | | #
|
| | | # curProDef = PlayerControl.GetProDef(defObj)
|
| | | # if not curProDef:
|
| | | # return hurtValue
|
| | | # |
| | | # absortValue = min(PlayerControl.GetProDefAbsorb(defObj)*hurtValue/ChConfig.Def_MaxRateValue, curProDef)
|
| | | # |
| | | # PlayerControl.SetProDef(defObj, curProDef - absortValue)
|
| | | # |
| | | # # 被动技能触发
|
| | | # defObj.SetDict(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef, curProDef)
|
| | | # PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, None, ChConfig.TriggerType_ProDefValue, tick)
|
| | | # return hurtValue - absortValue
|
| | |
|
| | |
|
| | | # 设置玩家一次主动型攻击中的第一个防御者
|
| | | def SetFirstDefender(attacker, defObj, curSkill):
|