| | |
| | | import GameMap
|
| | | import collections
|
| | | import PassiveBuffEffMng
|
| | | import EffGetSet
|
| | | import ChEquip
|
| | | import SkillShell
|
| | | import FBCommon
|
| | | import IpyGameDataPY
|
| | | import PyGameData
|
| | | import EventShell
|
| | | #import EquipZhuXian
|
| | | #---------------------------------------------------------------------
|
| | | GameWorld.ImportAll("Script\\Skill\\" , "GameSkills")
|
| | | GameWorld.ImportAll("Script\\Skill\\" , "GameBuffs")
|
| | |
| | |
|
| | | #还在冷却时间内无法释放
|
| | | 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
|
| | |
| | |
|
| | | 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实例
|
| | |
| | |
|
| | | #升级技能CD直接冷却
|
| | | curSkill.SetRemainTime(0)
|
| | | learnSkillNotifyDict = IpyGameDataPY.GetFuncEvalCfg("SPSkillType", 3, {})
|
| | | if curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_HorseSkill:
|
| | | PlayerControl.WorldNotify(0, 'GetMountSkill', [curPlayer.GetName(), curSkillID])
|
| | | elif skillTypeID in learnSkillNotifyDict:
|
| | | PlayerControl.WorldNotify(0, learnSkillNotifyDict[skillTypeID], [curPlayer.GetName(), curSkillID]) |
| | | else:
|
| | | #通知技能已升级成功 GeRen_admin_31379
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_admin_31379", [curSkillID, curSkill.GetSkillLV()])
|
| | |
| | | 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):
|
| | | return False
|
| | | #诛仙技能学习判断
|
| | | #if upSkill.GetFuncType() == ChConfig.Def_SkillFuncType_ZhuXian:
|
| | | # if not EquipZhuXian.CheckLearnZhuXianSkill(curPlayer, curSkillTypeID):
|
| | | # return False
|
| | |
|
| | | #经验检测
|
| | | skillLvUpNeedExp = upSkill.GetLVUpCostExp()
|
| | |
| | | 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:
|
| | | #原技能删除
|
| | | skillManager.DeleteSkillBySkillTypeID(curElementSkillID)
|
| | |
| | | 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:
|
| | | for _ in xrange(updSkillLV-curSkillLV):
|
| | |
| | | #--- 1. 先取得触发技能---
|
| | |
|
| | | #先检查数据库有没该类技能,如果最高等级不一样会找不到
|
| | | exSkill = GameWorld.GetGameData().FindSkillByType(skillEnhanceID, skillLV)
|
| | | #exSkill = GameWorld.GetGameData().FindSkillByType(skillEnhanceID, skillLV)
|
| | | exSkill = GameWorld.GetGameData().GetSkillBySkillID(skillEnhanceID)
|
| | | #异常
|
| | | if not exSkill:
|
| | | GameWorld.ErrLog("对象 = %s, 找不到附加技能ID = %s, skillLv = %s"%(attacker.GetID() , skillEnhanceID , useSkill.GetSkillLV()))
|
| | |
| | |
|
| | | #这个技能是Buff
|
| | | if SkillCommon.IsBuff(curSkill):
|
| | | if ChConfig.Def_SkillType_LstPlsBuffAtk == curSkill.GetSkillType():
|
| | | if curSkill.GetSkillType() in [ChConfig.Def_SkillType_LstPlsBuffAtk, ChConfig.Def_SkillType_PassiveLstPlsBuffAtk]:
|
| | | defender = attacker
|
| | | return __DoLogic_AddBuff(attacker, defender, curSkill, isEnhanceSkill, tick, tagRoundPosX, tagRoundPosY)
|
| | |
|
| | |
| | |
|
| | | # 当技能类型为被动技能并且tag字段为0,则此技能为媒介用于触发技能 SkillEnhance1 SkillEnhance2
|
| | | skill1 = GameWorld.GetGameData().GetSkillBySkillID(curSkill.GetSkillEnhance1())
|
| | | if skill1:
|
| | | if skill1 and GameWorld.CanHappen(skill1.GetHappenRate(), ChConfig.Def_MaxRateValue):
|
| | | result = True if UsePassiveTriggerSkill(attacker, skill1, target, tick, True) else result
|
| | |
|
| | | skill2 = GameWorld.GetGameData().GetSkillBySkillID(curSkill.GetSkillEnhance2())
|
| | | if skill2:
|
| | | if skill2 and GameWorld.CanHappen(skill2.GetHappenRate(), ChConfig.Def_MaxRateValue):
|
| | | result = True if UsePassiveTriggerSkill(attacker, skill2, target, tick, True) else result
|
| | |
|
| | | SkillCommon.SetSkillRemainTime(curSkill, PlayerControl.GetReduceSkillCDPer(attacker), tick, attacker)
|
| | |
| | | GameWorld.DebugLog("释放被动触发技能 : %s- %s"%(skillAim, curSkill.GetSkillID()))
|
| | |
|
| | | if skillAim == ChConfig.Def_UseSkillAim_None:
|
| | | if curSkill.GetSkillType() in ChConfig.Def_CanAttackSkill_List:
|
| | | if curSkill.GetSkillType() in ChConfig.Def_CanAttackSkill_List and affectTag != ChConfig.Def_UseSkillTag_Self:
|
| | | if target and target.GetGameObjType() == IPY_GameWorld.gotNPC and target.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
|
| | | owner = NPCCommon.GetNpcObjOwnerDetail(target)
|
| | | if owner and owner.GetID() == attacker.GetID():
|