| | |
| | | # mapType = GameWorld.GetMap().GetMapFBType()
|
| | | # 野外小怪或者其他指定的怪为了更及时的打击感,由客户端计算
|
| | | for hurobj in hurtList:
|
| | | if hurobj.HurtHP == 0:
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
|
| | | hurtHP = hurobj.HurtHP + hurobj.HurtHPEx * ShareDefine.Def_PerPointValue
|
| | | if hurtHP == 0:
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurtHP, hurobj.AttackType]
|
| | | continue
|
| | | if hurobj.ObjType != IPY_GameWorld.gotNPC:
|
| | | # 非NPC
|
| | |
| | | # 重复对象
|
| | | return False
|
| | |
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurobj.HurtHP, hurobj.AttackType]
|
| | | g_ClientHurtDict[(hurobj.ObjID, hurobj.ObjType)] = [hurtHP, hurobj.AttackType]
|
| | |
|
| | | g_UseSkillPlayerID = curPlayer.GetID()
|
| | | return True
|
| | |
| | | PlayerControl.NotifyCode(curPlayer , "Play_Attack_Null")
|
| | | return
|
| | |
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | #玩家已经死亡
|
| | | PlayerControl.NotifyCode(curPlayer, "PK_chenxin_612029")
|
| | | return False
|
| | |
| | |
|
| | | #还在冷却时间内无法释放
|
| | | if SkillCommon.RefreshSkillRemainTime(playerSkill, tick) != 0:
|
| | | PlayerControl.NotifyCode(curPlayer, "UseSkillCDLimit")
|
| | | #PlayerControl.NotifyCode(curPlayer, "UseSkillCDLimit")
|
| | | #AttackFailNotify(curPlayer, curSkill, ChConfig.SkillFail_CD)
|
| | | playerSkill.Sync_Skill()
|
| | | return False
|
| | |
| | | # #7:检查玩家的HP是否足够
|
| | | # curSkillNeedHP = curSkill.GetHP()
|
| | | #
|
| | | # if curSkillNeedHP > 0 and curPlayer.GetHP() < curSkillNeedHP:
|
| | | # if curSkillNeedHP > 0 and GameObj.GetHP(curPlayer) < curSkillNeedHP:
|
| | | # curPlayer.Notify_AttackFail(0, 0, 0, 0, IPY_GameWorld.afrHP)
|
| | | # PlayerControl.NotifyCode(curPlayer, "PK_jin_0")
|
| | | # GameWorld.DebugLog("检查玩家的HP是否足够")
|
| | |
| | |
|
| | | return True
|
| | |
|
| | | def IsNPCSkillResist(curNPC):
|
| | | ## NPC是否技能抵抗,对应技能表中伤害类型HurtType为3的技能,即对boss无效的技能
|
| | | |
| | | if curNPC.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
|
| | | #GameWorld.DebugLog("预警状态下默认抵抗")
|
| | | return True
|
| | | |
| | | bossIpyData = IpyGameDataPY.GetIpyGameDataNotLog("BOSSInfo", curNPC.GetNPCID())
|
| | | if bossIpyData and bossIpyData.GetSkillResist():
|
| | | return True
|
| | | |
| | | return False
|
| | |
|
| | | ##是否召唤兽对主人使用技能
|
| | | # @param curNPC NPC实例
|
| | |
| | | # NPC仇恨吸引,由客户端决定,适用于小怪
|
| | | # '''
|
| | | # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | # if curPlayer.GetHP() <= 0:
|
| | | # if GameObj.GetHP(curPlayer) <= 0:
|
| | | # return
|
| | | #
|
| | | # if not curPlayer.GetVisible():
|
| | |
| | | # npcAngry = npcObj.GetNPCAngry()
|
| | | # angryValue = npcAngry.FindNPCAngry(playerID, IPY_GameWorld.gotPlayer)
|
| | | #
|
| | | # if angryValue != None and angryValue.GetAngryValue() != 0 :
|
| | | # if angryValue != None and GameObj.GetAngryValue(angryValue) != 0 :
|
| | | # #该对象已经在仇恨列表中,不重复添加
|
| | | # continue
|
| | | #
|
| | |
| | | # DWORD ObjID;
|
| | | # BYTE AttackType; //爆击, miss
|
| | | # DWORD HurtHP;
|
| | | # DWORD HurtHPEx;
|
| | | # };
|
| | | #
|
| | | # struct tagCMSuperAtk
|
| | |
| | | # @return 返回值真, 检查通过
|
| | | # @remarks 检查客户端发送技能封包, 这里只简单检查一下
|
| | | def __CheckPlayerUseSkill_ClientPack(curPlayer, posX, posY, curSkill):
|
| | | if curPlayer.GetHP() <= 0:
|
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return
|
| | |
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | |
| | | if not CheckLearnSkillCondition(curPlayer, upSkill):
|
| | | return False
|
| | |
|
| | | #坐骑技能学习判断
|
| | | if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill:
|
| | | if not PlayerHorse.CheckLearnHorseSkill(curPlayer, curSkillTypeID):
|
| | | return False
|
| | | # #坐骑技能学习判断
|
| | | # if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill:
|
| | | # if not PlayerHorse.CheckLearnHorseSkill(curPlayer, curSkillTypeID):
|
| | | # return False
|
| | | #天赋技学习点数判断
|
| | | if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_GiftSkill:
|
| | | if not PlayerGreatMaster.GetGreatMasterFreeSkillPoint(curPlayer):
|
| | |
| | | GameWorld.DebugLog('更换专精 不成功 selectSkillID=%s'%selectSkillID)
|
| | | return
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, selectSkillID)
|
| | | UpdateElementSkillSelect(curPlayer, mainSkillID, selectSkillID)
|
| | | #ChEquip.ChangeEquipfacadeByLingGen(curPlayer)
|
| | | if curElementSkillID and curElementSkillID != selectSkillID:
|
| | | #原技能删除
|
| | |
| | | curControl.RefreshPlayerAttrState()
|
| | |
|
| | | NotifyElementSkillInfo(curPlayer, mainSkillID, selectSkillID if updSelectSkillLV != activeSkillLV else 0)
|
| | | return
|
| | |
|
| | | def UpdateElementSkillSelect(curPlayer, mainSkillID, selectSkillID):
|
| | | ## 更新专精技能选择, selectSkillID 可能被重置为0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, selectSkillID)
|
| | | #GameWorld.DebugLog("更新专精技能选择 mainSkillID=%s, selectSkillID=%s" % (mainSkillID, selectSkillID))
|
| | | |
| | | # 以下额外更新选择的专精技能对应编号,用于表现其他玩家不同专精技能特效用
|
| | | mainSkillList = IpyGameDataPY.GetFuncEvalCfg("SkillActTypeIdSort", curPlayer.GetJob())
|
| | | if mainSkillID not in mainSkillList:
|
| | | return
|
| | | mainSkillIndex = mainSkillList.index(mainSkillID)
|
| | | if mainSkillIndex < ShareDefine.Def_PDictDigitCnt:
|
| | | exAttrValue = curPlayer.GetExAttr7()
|
| | | exAttrIndex = mainSkillIndex
|
| | | else:
|
| | | exAttrValue = curPlayer.GetExAttr8()
|
| | | exAttrIndex = mainSkillIndex - ShareDefine.Def_PDictDigitCnt
|
| | | |
| | | elementSkillNum = 0
|
| | | if selectSkillID:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('SkillElement', selectSkillID)
|
| | | if ipyData:
|
| | | elementSkillNum = ipyData.GetElementSkillNum()
|
| | | |
| | | updExAttrValue = GameWorld.ChangeDataByDigitPlace(exAttrValue, exAttrIndex, elementSkillNum)
|
| | | #GameWorld.DebugLog(" exAttrValue=%s,exAttrIndex=%s,elementSkillNum=%s,updExAttrValue=%s" |
| | | # % (exAttrValue, exAttrIndex, elementSkillNum, updExAttrValue))
|
| | | |
| | | # 需要广播周围玩家
|
| | | if mainSkillIndex < ShareDefine.Def_PDictDigitCnt:
|
| | | curPlayer.SetExAttr7(updExAttrValue, True)
|
| | | else:
|
| | | curPlayer.SetExAttr8(updExAttrValue, True)
|
| | | return
|
| | |
|
| | | def RefreshElementSkill(curPlayer, skillTypeID, isChangeLV=True):
|
| | |
| | | if updSkillLV == 0:#重置为未选状态
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('SkillElement', skillTypeID)
|
| | | mainSkillID = ipyData.GetMainSkillID()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SkillElementID % mainSkillID, 0)
|
| | | UpdateElementSkillSelect(curPlayer, mainSkillID, 0)
|
| | | #ChEquip.ChangeEquipfacadeByLingGen(curPlayer)
|
| | | isNotify = True
|
| | | else:
|
| | |
| | | return False
|
| | |
|
| | | target = petOwner
|
| | | if target.GetHP() <= 0:
|
| | | if GameObj.GetHP(target) <= 0:
|
| | | return False
|
| | |
|
| | | if affectTag not in [ChConfig.Def_UseSkillTag_None, ChConfig.Def_UseSkillTag_Self]:
|