#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
#-------------------------------------------------------------------------------
|
#
|
##@package Skill.PassiveBuffEffMng
|
#
|
# @todo:±»¶¯buffЧ¹û¹ÜÀí
|
# @author hxp
|
# @date 2015-3-6
|
# @version 1.1
|
#
|
# @change: "2016-11-16 15:30" hxp Ôö¼Ó»ñȡ˥ÈõЧ¹ûÐÅÏ¢Áбí
|
#
|
# ÏêϸÃèÊö: ±»¶¯buffЧ¹û¹ÜÀís
|
#
|
#---------------------------------------------------------------------
|
#"""Version = 2016-11-16 15:30"""
|
#---------------------------------------------------------------------
|
|
#µ¼Èë
|
import IPY_GameWorld
|
import PassiveBuff
|
import GameWorld
|
import ChConfig
|
import IpyGameDataPY
|
import SkillCommon
|
import BuffSkill
|
import SkillShell
|
import PlayerControl
|
import NetPackCommon
|
import ChPyNetSendPack
|
import PlayerVip
|
import AttackCommon
|
import PyGameData
|
import PlayerHorse
|
import BaseAttack
|
import EventShell
|
import NPCCommon
|
import PetControl
|
import QuestCommon
|
import ItemCommon
|
import FBCommon
|
|
GameWorld.ImportAll("Script\\Skill\\", "PassiveBuff")
|
|
# ±»¶¯¹ØÁªµÄ¼¼ÄÜÄ£¿é
|
# »ñµÃ¹ØÁª¼¼ÄÜ,0 È«²¿ 1ÊÇÖ÷¶¯Ðͼ¼ÄÜ£¨·¨±¦£¬ÆÕ¹¥£© 2 ΪÈË×å·¨±¦¼¼ÄÜ 3ΪÆÕ¹¥ ÆäËû¼¼ÄÜID
|
Def_ConnSkill_Template = {
|
ChConfig.Def_SkillFuncType_FbSkill:[1,2],
|
ChConfig.Def_SkillFuncType_NormalAttack:[1,3],
|
}
|
|
Def_PassiveSkillValueNoCD = [52000, 57000] # ÌØÊâ´¦Àí²¿·Ö¼¼ÄÜÔöÇ¿´¥·¢²»ÊÜCDÓ°Ïì
|
|
|
# --------±»¶¯¹¦·¨ÉèÖÃ--------------------------------------------------------------------
|
|
#===============================================================================
|
# // B4 07 ±»¶¯¼¼ÄÜÉèÖ㨹¦·¨£© # tagCMPassiveSet
|
#
|
# struct tagCMPassiveSet
|
# {
|
# tagHead Head;
|
# BYTE Page; // ·ÖÒ³
|
# BYTE Index; // ÐòºÅ
|
# DWORD SkillID; // ¼¼ÄÜID
|
# };
|
#===============================================================================
|
def OnPassiveSet(index, clientData, tick):
|
#¸ÄΪ¶¼ÉúЧ£¬²»ÐèÒªÉèÖÃ
|
return
|
# curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
# findSkill = None
|
# if clientData.SkillID != 0:
|
# findSkill = curPlayer.GetSkillManager().FindSkillBySkillID(clientData.SkillID)
|
# if not findSkill:
|
# return
|
#
|
# if findSkill.GetFuncType() != ChConfig.Def_SkillFuncType_FbPassiveSkill:
|
# return
|
#
|
# holeCnt = IpyGameDataPY.GetFuncCfg('PassSkillEquipLimit', 2)
|
# if clientData.Index >= holeCnt:
|
# # ³¬³ö¿×Êý
|
# return
|
#
|
# pageCnt = IpyGameDataPY.GetFuncCfg('PassSkillEquipLimit', 3)
|
# if clientData.Page >= pageCnt:
|
# # ³¬³öÒ³Êý
|
# return
|
#
|
# tmpDict = IpyGameDataPY.GetFuncEvalCfg('PassSkillEquipLimit', 1)
|
# # Ê£ÓàVIPʱ¼ä
|
# #haveVipTime = PlayerVip.GetCurVIPTime(curPlayer)
|
# strIndex = str(clientData.Index)
|
# if strIndex in tmpDict:
|
# # ÅжÏÌõ¼þ
|
# for key, value in tmpDict[strIndex].items():
|
# if key == "level" and curPlayer.GetLV() < value:
|
# return
|
# if key == "vipLv":
|
# if curPlayer.GetVIPLv() < value:# or haveVipTime <=0:
|
# return
|
# if key == "MountLv":
|
# if PlayerHorse.GetHorseSumLV(curPlayer) < value:
|
# return
|
#
|
#
|
# # ¶à¼ÓÒ»ÖÖÈÎÎñÅжÏ
|
# if key == "OpenSkillSlots":
|
# # Ö÷ÏßÈÎÎñÍê³Éʱ»áÉèÖñêÖ¾¿É½øµØÍ¼±êÖ¾
|
# mission_1 = QuestCommon.GetCommonMission(curPlayer)
|
# if not mission_1:
|
# return
|
#
|
# if (pow(2, int(strIndex)) & mission_1.GetProperty("OpenSkillSlots")) == 0:
|
# return
|
#
|
# PlayerControl.NomalDictSetProperty(curPlayer,
|
# ChConfig.Def_PDict_GFPassiveIndex%(clientData.Page, clientData.Index),
|
# clientData.SkillID,
|
# ChConfig.Def_PDictType_GFPassive)
|
#
|
# # ֪ͨ¿Í»§¶ËÉèÖóɹ¦
|
# sendPack = ChPyNetSendPack.tagMCPassiveSetAnswer()
|
# sendPack.Page = clientData.Page
|
# sendPack.Index = clientData.Index
|
# sendPack.SkillID = clientData.SkillID
|
# NetPackCommon.SendFakePack(curPlayer, sendPack)
|
#
|
# # Ë¢±»¶¯Ð§¹ûºÍÊôÐÔ
|
# page = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GFPassivePage, 0, ChConfig.Def_PDictType_GFPassive)
|
# if clientData.Page == page:
|
# GetPassiveEffManager().RegistPassiveEffSet(curPlayer, True)
|
# PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
#
|
# EventShell.EventRespons_PassiveSet(curPlayer)
|
# return
|
|
|
#===============================================================================
|
# //B4 08 ±»¶¯¼¼ÄÜҳѡÔñ£¨¹¦·¨£© # tagCMPassivePage
|
#
|
# struct tagCMPassivePage
|
# {
|
# tagHead Head;
|
# BYTE Page; // ·ÖÒ³
|
# };
|
#===============================================================================
|
|
def OnPassivePage(index, clientData, tick):
|
#¸ÄΪ¶¼ÉúЧ£¬²»ÐèÒªÉèÖÃ
|
return
|
# curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
# pageCnt = IpyGameDataPY.GetFuncCfg('PassSkillEquipLimit', 3)
|
# if clientData.Page >= pageCnt:
|
# # ³¬³öÒ³Êý
|
# return
|
#
|
#
|
# PlayerControl.NomalDictSetProperty(curPlayer,
|
# ChConfig.Def_PDict_GFPassivePage,
|
# clientData.Page,
|
# ChConfig.Def_PDictType_GFPassive)
|
#
|
# # ֪ͨ¿Í»§¶ËÉèÖóɹ¦
|
# sendPack = ChPyNetSendPack.tagMCPassivePage()
|
# sendPack.Page = clientData.Page
|
# NetPackCommon.SendFakePack(curPlayer, sendPack)
|
#
|
# # Ë¢±»¶¯Ð§¹ûºÍÊôÐÔ
|
# GetPassiveEffManager().RegistPassiveEffSet(curPlayer, True)
|
# PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
# return
|
|
|
# ¼ì²éÊÇ·ñµ±Ç°ÕýÔÚʹÓõı»¶¯¼¼ÄÜ
|
def FindUsePassiveSkills(curPlayer):
|
skills = []
|
skillManager = curPlayer.GetSkillManager()
|
for i in xrange(skillManager.GetSkillCount()):
|
curSkill = skillManager.GetSkillByIndex(i)
|
if not curSkill:
|
continue
|
|
if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_FbPassiveSkill:
|
continue
|
|
findSkillID = curSkill.GetSkillID()
|
passiveEff = GetPassiveEffManager().GetPassiveEff(curPlayer)
|
if passiveEff:
|
findSkillID = passiveEff.ChangeSkillTypeID(findSkillID)
|
|
skills.append(findSkillID)
|
|
return skills
|
|
#¸ÄΪ¶¼ÉúЧ£¬²»ÐèÒªÉèÖÃ
|
# page = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GFPassivePage, 0, ChConfig.Def_PDictType_GFPassive)
|
# holeCnt = IpyGameDataPY.GetFuncCfg('PassSkillEquipLimit', 2)
|
# skills = []
|
# for i in xrange(holeCnt):
|
# findSkillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GFPassiveIndex%(page, i), 0,
|
# ChConfig.Def_PDictType_GFPassive)
|
# if findSkillID == 0:
|
# continue
|
#
|
# passiveEff = GetPassiveEffManager().GetPassiveEff(curPlayer)
|
# if passiveEff:
|
# findSkillID = passiveEff.ChangeSkillTypeID(findSkillID)
|
#
|
# skills.append(findSkillID)
|
#
|
# return skills
|
|
# µÇ¼֪ͨ£¬²¢¹ýÂ˹ýÆÚVIP¿×
|
def OnLoginGFPassive(curPlayer):
|
#¸ÄΪ¶¼ÉúЧ£¬²»ÐèÒªÉèÖÃ
|
return
|
# # ---֪ͨÿҳÊý¾Ý---
|
# holeCnt = IpyGameDataPY.GetFuncCfg('PassSkillEquipLimit', 2)
|
# pageCnt = IpyGameDataPY.GetFuncCfg('PassSkillEquipLimit', 3)
|
#
|
# sendPack = ChPyNetSendPack.tagMCPassiveSet()
|
# sendPack.PageCnt = pageCnt
|
# sendPack.PassiveSkills = []
|
#
|
#
|
# #tmpDict = IpyGameDataPY.GetFuncEvalCfg('PassSkillEquipLimit', 1)
|
#
|
# # Ê£ÓàVIPʱ¼ä
|
# #haveVipTime = PlayerVip.GetCurVIPTime(curPlayer)
|
#
|
# for i in xrange(pageCnt):
|
# skills = ChPyNetSendPack.tagMCPassiveSkills()
|
# skills.Count = holeCnt
|
# skills.SkillIDList = []
|
# for j in xrange(holeCnt):
|
#
|
# #===================================================================
|
# # # ÅжÏVIP¹ýÆÚµÄÇé¿ö
|
# # for key, value in tmpDict.get(j, {}).items():
|
# # if key == "vipLv":
|
# # if curPlayer.GetVIPLv() < value or haveVipTime <=0:
|
# # PlayerControl.NomalDictSetProperty(curPlayer,
|
# # ChConfig.Def_PDict_GFPassiveIndex%(i, j),
|
# # 0,
|
# # ChConfig.Def_PDictType_GFPassive)
|
# #===================================================================
|
#
|
# skillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GFPassiveIndex%(i, j), 0,
|
# ChConfig.Def_PDictType_GFPassive)
|
# skills.SkillIDList.append(skillID)
|
#
|
# sendPack.PassiveSkills.append(skills)
|
#
|
# NetPackCommon.SendFakePack(curPlayer, sendPack)
|
#
|
# # ---֪ͨ¼¤»îÒ³---
|
# page = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GFPassivePage, 0, ChConfig.Def_PDictType_GFPassive)
|
# sendPack = ChPyNetSendPack.tagMCPassivePage()
|
# sendPack.Page = page
|
# NetPackCommon.SendFakePack(curPlayer, sendPack)
|
# return
|
|
# Çл»µØÍ¼
|
def OnLoadMapGFPassive(curPlayer):
|
# ±»¶¯¼¼ÄÜ
|
GetPassiveEffManager().RegistPassiveEff(curPlayer)
|
|
#tmpDict = IpyGameDataPY.GetFuncEvalCfg('PassSkillEquipLimit', 1)
|
#holeCnt = IpyGameDataPY.GetFuncCfg('PassSkillEquipLimit', 2)
|
|
# Ê£ÓàVIPʱ¼ä
|
#haveVipTime = PlayerVip.GetCurVIPTime(curPlayer)
|
|
#µ±Ç°Ê¹ÓÃÒ³
|
#page = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GFPassivePage, 0, ChConfig.Def_PDictType_GFPassive)
|
|
#===============================================================================
|
# for j in xrange(holeCnt):
|
#
|
# # ÅжÏVIP¹ýÆÚµÄÇé¿ö
|
# for key, value in tmpDict.get(j, {}).items():
|
# if key != "vipLv":
|
# continue
|
# if curPlayer.GetVIPLv() < value or haveVipTime <= 0:
|
# PlayerControl.NomalDictSetProperty(curPlayer,
|
# ChConfig.Def_PDict_GFPassiveIndex%(page, j),
|
# 0,
|
# ChConfig.Def_PDictType_GFPassive)
|
#===============================================================================
|
|
# ħ×å·¨±¦-±»¶¯¼¼ÄÜÒ³
|
GetPassiveEffManager().RegistPassiveEffSet(curPlayer)
|
|
GetPassiveEffManager().RegistPassiveBuff(curPlayer)
|
|
# ÖúÕ½ÉñÊÞ¼¼ÄÜ
|
GetPassiveEffManager().RegistPassiveEffDogz(curPlayer)
|
|
GetPassiveEffManager().RegistSuperEquipSkillDict(curPlayer)
|
|
#-±»¶¯Âß¼´¦Àí--------------------------------------------------------------------------------------------------
|
##À뿪µØÍ¼´¦Àí
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return
|
def OnPlayerLeaveMap(curPlayer):
|
GetPassiveEffManager().RemovePassiveEff((curPlayer.GetID(), IPY_GameWorld.gotPlayer))
|
for i in range(1,3):
|
#³èÎï
|
GetPassiveEffManager().RemovePassiveEff((curPlayer.GetID()*10+i, IPY_GameWorld.gotNPC))
|
return
|
|
# »ñµÃ¡¾¼¼ÄÜ¡¿±»¶¯Ð§¹û¶ÔÓ¦µÄ ±»¶¯´¥·¢·½Ê½ ÓëGetBuffTriggerTypeByEffectID»¥²¹
|
def GetTriggerTypeByEffectID(effectID):
|
# ÁÙʱÅäÖÃ
|
tdict = {
|
1304:ChConfig.TriggerType_HitValue, # ÃüÖмǼ 89
|
|
2102:ChConfig.TriggerType_BeAttackOver, # ±»¹¥»÷ºó´¥·¢ 20
|
2104:ChConfig.TriggerType_LockHP, # ËøÑª´¥·¢¼¼ÄÜ 63
|
2105:ChConfig.TriggerType_BeLuckyHit, # ±»»áÐÄÒ»»÷´¥·¢¼¼ÄÜ 64
|
2106:ChConfig.TriggerType_BeSuperHit, # ±»±©»÷´¥·¢¼¼ÄÜ
|
|
4000:ChConfig.TriggerType_BuffState, # ½øÈë4012µÄij¸ö״̬´¥·¢¼¼ÄÜ 2
|
4001:ChConfig.TriggerType_TagBuffState, # Ä¿±ê½øÈë4012µÄij¸ö״̬´¥·¢¼¼ÄÜ 2
|
4002:ChConfig.TriggerType_SkillValue, # Ôö¼Ó¼¼ÄÜÉ˺¦¹Ì¶¨Öµ 82
|
4003:ChConfig.TriggerType_AttackOver, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ 4
|
4004:ChConfig.TriggerType_AttackOver, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ 4
|
4005:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
4006:ChConfig.TriggerType_SuperHit, # ±©»÷ʱ ´¥·¢¼¼ÄÜ6,
|
4007:ChConfig.TriggerType_SuperHitPer, # ±©»÷ʱ Ôö¼Ó±©»÷Öµ°Ù·Ö±È,
|
4008:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
4009:ChConfig.TriggerType_HurtObjAddBuff, # »÷ÖÐÍæ¼Ò£¨Èº¹¥¶à´Î´¥·¢£©8,
|
4010:ChConfig.TriggerType_ReduceCD, # ¼õÉÙCD9, #CD
|
4011:ChConfig.TriggerType_SuperHitSkillPer, # ±©»÷ʱ£¬Ôö¼Ó¼¼ÄÜÉ˺¦ 10
|
4013:ChConfig.TriggerType_AttackAddFinalValue, #¹¥»÷Ôö¼ÓÊä³öÉ˺¦11
|
4014:ChConfig.TriggerType_HappenState, #±Ø¶¨´¥·¢
|
4015:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
#4016:ChConfig.TriggerType_AbsorbShield, # Ìá¸ß÷è÷ëÓÓÉíµÄ¼õÉÙÉ˺¦Ð§¹ûÌáÉý20% 13
|
4017:ChConfig.TriggerType_BounceHP, # ·´µ¯É˺¦¹Ì¶¨Öµ14,
|
4018:ChConfig.TriggerType_BuffDisappear, # buffÏûʧºó´¥·¢¼¼ÄÜ15,
|
4019:ChConfig.TriggerType_BuffTime, # ÑÓ³¤BUFFʱ¼ä16,
|
4020:ChConfig.TriggerType_BounceHPPer, # ·´µ¯É˺¦°Ù·Ö±ÈÖµ17,
|
4021:ChConfig.TriggerType_AddSingleSkillPer, # ³ÖÐøÐÔ¹¥»÷µÄµ¥´Î¹¥»÷Öð´ÎÔö¼Ó¼¼ÄÜÉ˺¦18,
|
4022:ChConfig.TriggerType_SkillOverNoAttack, # ¼¼ÄÜÊͷźó ÓëTriggerType_AttackOverÏà·´19,
|
4023:ChConfig.TriggerType_BeAttackOver, # ±»¹¥»÷ºó´¥·¢ 20
|
#4024:ChConfig.TriggerType_AddIceAtkPer, # ¹¥»÷¸½¼ÓÕæÊµÉ˺¦°Ù·Ö±È 21
|
4025:ChConfig.TriggerType_AddIceAtk, # ¹¥»÷¸½¼ÓÕæÊµÉ˺¦¹Ì¶¨Öµ 22
|
4026:ChConfig.TriggerType_DebuffOff, # µÖÏûÒ»´Îdebuff 23
|
4027:ChConfig.TriggerType_AttackKill, # նɱ 24
|
4028:ChConfig.TriggerType_WillDead, # ½øÈë±ôËÀ״̬ʱ´¥·¢¼¼ÄÜ 25
|
4029:ChConfig.TriggerType_BuffBoom, # Öж¾ºó±¬Õ¨ 26
|
4030:ChConfig.TriggerType_ThumpSkillValue, # ÖØ»÷Ôö¼Ó¼¼Ä̶ܹ¨ÖµÉ˺¦ 88
|
4031:ChConfig.TriggerType_HurtObjAddBuff, # ÔÚËãÉ˺¦Ê±Èº¹¥1¶Ô1¼Óbuff£¬¿ÉÓÃÓÚÒ»¸öÉ˺¦¶à´Î´¥·¢ 28
|
4032:ChConfig.TriggerType_BeBoomSeed, # ±»¶¯Òý±¬ÊÓÒ°ÄÚ¶ÔÏóµÄbuffÖÖ×Ó 29
|
4033:ChConfig.TriggerType_AttackOver, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ 4
|
4034:ChConfig.TriggerType_AttackAddSkillPer, # Ôö¼ÓXP¼¼ÄÜ·ÇС¹ÖÉ˺¦
|
4035:ChConfig.TriggerType_AttackAddSkillPer, # Ôö¼ÓXP¼¼ÄÜС¹ÖÉ˺¦
|
4036:ChConfig.TriggerType_AttackCnt, # Ôö¼Ó¼¼Äܹ¥»÷ÊýÁ¿£¨Ð§¹ûID1200£©
|
4037:ChConfig.TriggerType_SuperHitOneByOne, # Ö»¶Ô±©»÷Ä¿±ê´¥·¢¼¼ÄÜ
|
4038:ChConfig.TriggerType_BuffState, # ½øÈë4012µÄij¸ö״̬´¥·¢¼¼ÄÜ 2
|
4039:ChConfig.TriggerType_AttackOverPassive, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ÔÚÆäËû±»¶¯Ð§¹û´¦Àíºóµ÷Ó㬴¥·¢Ë³ÐòÔÒò
|
4040:ChConfig.TriggerType_BeSuperHit, # ±»±©»÷´¥·¢¼¼ÄÜ
|
4041:ChConfig.TriggerType_AddExpRate, # ¸ÅÂÊÐÔ¼Ó³Éɱ¹Ö¾Ñé
|
4042:ChConfig.TriggerType_DamageReduce, # ¼õÉÙÉ˺¦
|
4043:ChConfig.TriggerType_DamageReducePVP, # PVP¼õÉÙÉ˺¦
|
4044:ChConfig.TriggerType_MissPer, # ÉÁ±ÜÌáÉý°Ù·Ö±È
|
4045:ChConfig.TriggerType_SkillDist, # Ôö¼Ó¼¼Äܹ¥»÷¾àÀë
|
4046:ChConfig.TriggerType_ReduceHurtHPPer, # °Ù·Ö±È¼õÉÙ¹¥»÷¼ÆËãºóÉ˺¦
|
4047:ChConfig.TriggerType_TimeCalc, # Ò»¶¨Ê±¼äÑ»·Öд¥·¢Êͷż¼ÄÜ
|
4048:ChConfig.TriggerType_MissSkill, # ÉÁ±Üºó´¥·¢Êͷż¼ÄÜ
|
4049:ChConfig.TriggerType_MissSuccessPer, # ÉÁ±Ü³É¹¦ÂÊÌáÉý
|
4050:ChConfig.TriggerType_OneDamage, # É˺¦½µµÍµ½1µã
|
4051:ChConfig.TriggerType_LuckyHit, # »áÐÄÒ»»÷ʱÔö¼Ó»áÐÄÉ˺¦¹Ì¶¨Öµ 50
|
4052:ChConfig.TriggerType_Buff_SuckBloodPer, # ¹¥»÷ °Ù·Ö±ÈÎüѪ
|
4053:ChConfig.TriggerType_AddLayer, # BUFF²ã¼¶Ôö¼Óʱ 52
|
4054:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
4055:ChConfig.TriggerType_StormAttackReduceCD, # ÀལÈз籩¹¥»÷ºó´¥·¢Ð§¹û
|
4056:ChConfig.TriggerType_PassiveBuffValue, ## ±»¶¯buffÖµ¼ÆËãÖжþ´Î»ñÈ¡±»¶¯Öµ 54
|
4057:ChConfig.TriggerType_AttackKillHappen, ## ¶Ô±»¶¯¼¼ÄÜնɱµÄ¸ÅÂÊÔöÇ¿ 55
|
4058:ChConfig.TriggerType_AddBuffOver, # Ìí¼ÓbuffÖ®ºó´¥·¢¼¼ÄÜ 56
|
4059:ChConfig.TriggerType_StormAttackOneByOne, # ÀལÈз籩¹¥»÷1¶Ô1´¥·¢¼¼ÄÜ 57
|
4060:ChConfig.TriggerType_StormAttackOver, # ÀལÈз籩¹¥»÷ºó´¥·¢¼¼ÄÜ 57
|
4061:ChConfig.TriggerType_AttackOverPassive, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ÔÚÆäËû±»¶¯Ð§¹û´¦Àíºóµ÷Ó㬴¥·¢Ë³ÐòÔÒò
|
4062:ChConfig.TriggerType_AttackAddFinalPer, # Ôö¼Ó×îÖÕÉ˺¦°Ù·Ö±È 59
|
4063:ChConfig.TriggerType_SummonDie, #×ÔÉíÕÙ»½ÊÞËÀÍö´¥·¢¼¼ÄÜ 60
|
4064:ChConfig.TriggerType_GiftReduceCD, # Ì츳¼õÉÙCD9, #CD
|
4065:ChConfig.TriggerType_DamageReducePVP, # PVP¼õÉÙÉ˺¦
|
4066:ChConfig.TriggerType_AddPVPDamagePer, # Ìá¸ßPVPÔö¼ÓÉ˺¦ÊôÐÔÖµ£¬¼ÆËãʱ 3
|
4067:ChConfig.TriggerType_ProDefValue, # Éñ±ø»¤¶ÜֵϽµÊ± 62
|
4068:ChConfig.TriggerType_LockHP, # ËøÑª´¥·¢¼¼ÄÜ 63
|
4069:ChConfig.TriggerType_ZhongjiZhansha, # ÖÕ¼«Õ¶É± 64
|
4070:ChConfig.TriggerType_DebuffOff, # µÖÏûÒ»´Îdebuff 23
|
4071:ChConfig.TriggerType_Buff_SuckBloodPer, # ¹¥»÷ °Ù·Ö±ÈÎüѪ
|
4072:ChConfig.TriggerType_SuperHitSkipCD, # ±©»÷ÎÞÀäÈ´ 68
|
4073:ChConfig.TriggerType_BuffHurtCnt, # µ±³ÖÐøbuffÉ˺¦µÚX´Îʱ´¥·¢¼¼ÄÜ 69
|
4074:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
4075:ChConfig.TriggerType_AddThumpHitPer, # Ôö¼ÓÖØ»÷É˺¦°Ù·Ö±È
|
4076:ChConfig.TriggerType_dFinalHurtReducePer, # ·ÀÊØ·½µÄ×îÖÕÉ˺¦¼õÉÙ°Ù·Ö±È 71
|
4077:ChConfig.TriggerType_AttackAddFinalPer, # Ôö¼Ó×îÖÕÉ˺¦°Ù·Ö±È 59
|
4078:ChConfig.TriggerType_AttackOver, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ 4
|
4079:ChConfig.TriggerType_IsDealy, # ÊÇ·ñ´¥·¢ÖÂÃüÒ»»÷ 72
|
4080:ChConfig.TriggerType_BounceHPPer, # ·´µ¯É˺¦°Ù·Ö±ÈÖµ17,
|
4081:ChConfig.TriggerType_AddThumpHitRate, # Ìá¸ßÖØ»÷¸ÅÂÊ 73
|
4082:ChConfig.TriggerType_ThumpHit, # ¶ÔµÚһĿ±êÖØ»÷´¥·¢¼¼ÄÜ
|
4083:ChConfig.TriggerType_AddThumpHitPer, # Ôö¼ÓÖØ»÷É˺¦°Ù·Ö±È
|
4084:ChConfig.TriggerType_ThumpHit, # ¶ÔµÚһĿ±êÖØ»÷´¥·¢¼¼ÄÜ
|
4085:ChConfig.TriggerType_SkillSuccess, # Èκμ¼ÄÜÊͷųɹ¦¶¼¿É´¥·¢ 76 ¼ÓÓ¡¼Ç
|
4086:ChConfig.TriggerType_AttackAddSkillPerYinji, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ ΪÁËÆ®×ÖʹÓÃ
|
4087:ChConfig.TriggerType_AttackAddSkillPerYinji, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ ΪÁËÆ®×ÖʹÓÃ
|
4088:ChConfig.TriggerType_AttackAddSkillPerYinji, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ ΪÁËÆ®×ÖʹÓÃ
|
4089:ChConfig.TriggerType_AttackAddSkillPerYinji, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ ΪÁËÆ®×ÖʹÓÃ
|
4090:ChConfig.TriggerType_AttackOver, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ 4
|
4091:ChConfig.TriggerType_SkillOverNoAttack, # ¼¼ÄÜÊͷźó ÓëTriggerType_AttackOverÏà·´19,
|
4092:ChConfig.TriggerType_SkillSuccessExpend, # Èκμ¼ÄÜÊͷųɹ¦¶¼¿É´¥·¢ 76 ¼õÓ¡¼Ç
|
4093:ChConfig.TriggerType_NoControl, # ʹ¹ØÁª¼¼Äܲ»ÊÜ¿ØÖÆ 78
|
4094:ChConfig.TriggerType_Buff_AddSuperHitRate, # BUFFÀà:Ôö¼Ó±©»÷ÂÊ
|
4095:ChConfig.TriggerType_SuperHitSuckBloodPer, # BUFFÀࣺ ±©»÷°Ù·Ö±ÈÎüѪ, 79
|
4096:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
4097:ChConfig.TriggerType_BurnPer, # ׯÉÕÉ˺¦°Ù·Ö±È 80
|
4098:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
4099:ChConfig.TriggerType_WillDead, # ½øÈë±ôËÀ״̬ʱ´¥·¢¼¼ÄÜ 25
|
4100:ChConfig.TriggerType_AttackOver, # ¹¥»÷£¨¶ÔµÐ¼¼ÄÜ£©ºó±»¶¯¼¼Äܱ»´¥·¢ 4
|
4101:ChConfig.TriggerType_AttackAddSkillPer, # ËùÓй¥»÷É˺¦(SkillPer)Ôö¼Ó£¬º¬ÆÕ¹¥£¬¼ÆËãʱ 5
|
4102:ChConfig.TriggerType_SkillValue, # Ôö¼Ó¼¼ÄÜÉ˺¦¹Ì¶¨Öµ 82
|
4103:ChConfig.TriggerType_ThumpHitSuckBloodPer, # ¹¥»÷ °Ù·Ö±ÈÎüѪ
|
4104:ChConfig.TriggerType_HitSuccess, # ÃüÖгɹ¦ÂÊ 83
|
4106:ChConfig.TriggerType_AddHP, # ¼¼ÄÜ»ØÑª 84
|
4107:ChConfig.TriggerType_SkillValue, # Ôö¼Ó¼¼ÄÜÉ˺¦¹Ì¶¨Öµ 82
|
4108:ChConfig.TriggerType_SkillSuccess, # ʹÓü¼Äܳɹ¦ºó²»´¥·¢¼¼ÄÜ ´¦ÀíÏûºÄµÈÎÊÌâÓà 87
|
4109:ChConfig.TriggerType_SkillValue, # Ôö¼Ó¼¼ÄÜÉ˺¦¹Ì¶¨Öµ 82
|
4110:ChConfig.TriggerType_ChangeSkillEff, # ¸Ä±ä¼¼ÄÜÌØÐ§
|
}
|
return tdict.get(effectID, -1)
|
#===========================================================================
|
# # ´Ë±íÅäÖà ӰÏìÀàÐÍ
|
# ipyData = IpyGameDataPY.GetIpyGameData('SkillEffect', effectID)
|
# if not ipyData:
|
# return -1
|
#
|
# #{(´¥·¢·½Ê½/µã£¬ ¹ØÁª¼¼ÄÜ)£º{buff£º¡¾Ð§¹û¡¿}}
|
#
|
# return ipyData.GetTriggerType()
|
#===========================================================================
|
|
# »ñµÃ¡¾BUFF¡¿±»¶¯´¥·¢µÄ·½Ê½ ÓëGetTriggerTypeByEffectID»¥²¹
|
def GetBuffTriggerTypeByEffectID(effectID):
|
tdict = {
|
1011:ChConfig.TriggerType_Buff_AttackSubLayer, # BUFFÀࣺ¹¥»÷¼õbuff²ã£¬0Ïûʧ
|
4500:ChConfig.TriggerType_AttackOver, # BUFFÀࣺ¹¥»÷´¥·¢Ð¼¼ÄÜ
|
4501:ChConfig.TriggerType_AttackAddSkillPer, # BUFFÀࣺÌá¸ßÖ÷¶¯¼¼Äܵļ¼ÄÜÉ˺¦
|
4502:ChConfig.TriggerType_BeAttackOver, # BUFFÀࣺ±»¹¥»÷´¥·¢¼¼ÄÜ
|
4503:ChConfig.TriggerType_AttackOver, # BUFFÀࣺ¹¥»÷´¥·¢Ð¼¼ÄÜ
|
4504:ChConfig.TriggerType_BounceHP, # BUFFÀࣺ ·´µ¯É˺¦¹Ì¶¨Öµ
|
4505:ChConfig.TriggerType_AttackAddSkillPer, # BUFFÀࣺÌá¸ßÖ÷¶¯¼¼Äܵļ¼ÄÜÉ˺¦
|
4506:ChConfig.TriggerType_BeAttackOver, # BUFFÀࣺ±»¹¥»÷´¥·¢¼¼ÄÜ Ö»Ë¢ÐÂÊôÐÔ ²»´¥·¢¼¼ÄÜ
|
4507:ChConfig.TriggerType_Buff_AddSuperHitRate, # BUFFÀà:Ôö¼Ó±©»÷ÂÊ
|
4508:ChConfig.TriggerType_Buff_AttackSubLayer, # BUFFÀࣺ¹¥»÷¼õbuff²ã£¬0Ïûʧ
|
4509:ChConfig.TriggerType_Buff_SuckBloodPer, # BUFFÀࣺ °Ù·Ö±ÈÎüѪ, ´Ë´¦·ÇÊôÐÔÀà
|
4510:ChConfig.TriggerType_Buff_MustBeHit, # BUFFÀࣺ ÎÞÊÓÉÁ±Ü±ØÖÐ
|
4511:ChConfig.TriggerType_AttackAddFinalValue, #¹¥»÷Ôö¼ÓÊä³öÉ˺¦11
|
4512:ChConfig.TriggerType_ReduceHurtHPPer, # °Ù·Ö±È¼õÉÙ¹¥»÷¼ÆËãºóÉ˺¦
|
4513:ChConfig.TriggerType_AttackAddFinalValue, #¹¥»÷Ôö¼ÓÊä³öÉ˺¦11
|
4514:ChConfig.TriggerType_Buff_BeAttackSubLayer, # BUFFÀࣺ±»¹¥»÷¼õbuff²ã£¬0Ïûʧ
|
#4515:ChConfig.TriggerType_AddIceAtkPer, # BUFFÀࣺ¹¥»÷¸½¼ÓÕæÊµÉ˺¦°Ù·Ö±È
|
4516:ChConfig.TriggerType_ChangeHurtToHP, # BUFFÀࣺbuffÖаÑÊܵ½É˺¦µÄxx%ת»¯ÎªÉúÃüÖµ
|
4517:ChConfig.TriggerType_DebuffOff, # BUFFÀࣺ µÖÏûdebuff
|
4518:ChConfig.TriggerType_ForbidenCure, # BUFFÀࣺ ½ûÖ¹ÖÎÁÆ 53
|
4519:ChConfig.TriggerType_WillDead, # BUFFÀࣺ ½øÈë±ôËÀ״̬ 25
|
4520:ChConfig.TriggerType_AddLayer, # BUFFÀࣺ Ä¿±êBUFF²ã¼¶Ôö¼Óʱ 52
|
4521:ChConfig.TriggerType_BeLuckyHitSubPer, # ¼õÉÙÊܵ½µÄ»áÐÄÉ˺¦ 65
|
4522:ChConfig.TriggerType_DebuffOff, # BUFFÀࣺ µÖÏûdebuff
|
4523:ChConfig.TriggerType_SuperHitSkillPer, # ±©»÷ʱ£¬Ôö¼Ó¼¼ÄÜÉ˺¦ 10
|
4524:ChConfig.TriggerType_SuperHitSubLayer, # ±©»÷¼õ²ã 67
|
4525:ChConfig.TriggerType_SuperHitSkipCD, # ±©»÷ÎÞÀäÈ´ 68
|
4526:ChConfig.TriggerType_AddThumpHitRate, # Ôö¼ÓÖØ»÷¸ÅÂÊ
|
4528:ChConfig.TriggerType_AddThumpHitPer, # ÖØ»÷ʱ Ôö¼ÓÖØ»÷°Ù·Ö±È 75
|
4529:ChConfig.TriggerType_Buff_SuckBloodPer, # BUFFÀࣺ °Ù·Ö±ÈÎüѪ, ´Ë´¦·ÇÊôÐÔÀà
|
4530:ChConfig.TriggerType_Buff_AttackSubLayer, # BUFFÀࣺ¹¥»÷¼õbuff²ã£¬0Ïûʧ
|
4531:ChConfig.TriggerType_BounceHPPerByAttacker, # ·´µ¯É˺¦°Ù·Ö±ÈÖµ, Óɹ¥»÷·½¾ö¶¨ 77
|
4532:ChConfig.TriggerType_AttackOver, # BUFFÀࣺ¹¥»÷´¥·¢Ð¼¼ÄÜ
|
4533:ChConfig.TriggerType_BurnDisappear, # ׯÉÕÏûʧ´¥·¢ 81
|
4534:ChConfig.TriggerType_DebuffOff, # BUFFÀࣺ µÖÏûdebuff
|
4535:ChConfig.TriggerType_BeAttackAddSkillPer, # buffÖУ¬ ±»¹¥»÷Ìá¸ß¼¼ÄÜÉ˺¦
|
4536:ChConfig.TriggerType_AddBuffOver,
|
4537:ChConfig.TriggerType_BurnPer, # ׯÉÕÉ˺¦°Ù·Ö±È 80
|
4538:ChConfig.TriggerType_SkillValue, # Ôö¼Ó¼¼ÄÜÉ˺¦¹Ì¶¨Öµ 82
|
4539:ChConfig.TriggerType_SkillValue, # Ôö¼Ó¼¼ÄÜÉ˺¦¹Ì¶¨Öµ 82
|
4540:ChConfig.TriggerType_SuperHitPer, # ±©»÷É˺¦°Ù·Ö±È
|
4541:ChConfig.TriggerType_AttackAddSkillPer, # BUFFÀࣺÌá¸ßÖ÷¶¯¼¼Äܵļ¼ÄÜÉ˺¦
|
|
803:ChConfig.TriggerType_BloodShield, # Ѫ¶Ü
|
806:ChConfig.TriggerType_BloodShield, # Ѫ¶Ü
|
807:ChConfig.TriggerType_BloodShield, # Ѫ¶Ü
|
808:ChConfig.TriggerType_BloodShield, # Ѫ¶Ü
|
}
|
return tdict.get(effectID, -1)
|
|
|
#--------±»¶¯Ð§¹û---------------------------
|
# ±»¶¯Ð§¹ûµÄÀ´Ô´¿ÉÄÜÊDZ»¶¯¼¼ÄÜ£¬±»¶¯buff£¬»òÕ߯äËûÔöÒæbuff
|
# ¸ù¾Ý´¥·¢µã×éÖ¯²»Í¬µÄ´æ´¢
|
# Êý¾ÝΪ¿ÕÖØÐÂ×éÖ¯
|
class PassiveEff(object):
|
def __init__(self, gameObj):
|
self.gameObj = gameObj
|
#{(´¥·¢Ä£Ê½£¬ ±»Ó°ÏìµÄ¼¼ÄÜID):{BUFFid£º[Ó°ÏìBUFFµÄ¸½´øÐ§¹û]}}
|
self.AffectBuffDict = {} # µ±Ç°ÕýÊÜÓ°ÏìµÄЧ¹ûbuff, keyΪ´¥·¢µã
|
self.AffectSkillDict = {} # ±»¶¯¼¼ÄÜ {(´¥·¢Ä£Ê½£¬ ±»Ó°ÏìµÄ¼¼ÄÜID):[±»¶¯¼¼ÄÜID£¬Ð§¹û]
|
self.AffectPassiveSkillSetDict = {} # ±»¶¯¼¼ÄÜ×°±¸ {(´¥·¢Ä£Ê½£¬ ±»Ó°ÏìµÄ¼¼ÄÜID):[±»¶¯¼¼ÄÜID£¬Ð§¹û]
|
self.AffectDogzSkillDict = {} # ÉñÊÞÖúÕ½¼¼ÄÜ
|
self.AffectSuperEquipSkillDict = {} # ÌØÊâ×°±¸³ÖÓм¼ÄÜ£¬Ïàͬ¼¼Äܲ»Öظ´£¬ÊýÖµÔö³¤ÐÔË¥¼õ, ´¥·¢Ê¹ÓÃ
|
self.AffectSuperEquipEffectCntDict = {} # ÌØÊâ×°±¸¼¼ÄÜЧ¹û¶ÔÓ¦µÄÒѼÆËãºóµÄÊýÖµ£¬Ö±½Óµ÷ÓÃ
|
|
self.ChangeSkill = {} # ¸Ä±äÊͷŵļ¼ÄÜID£¬·½±ã´¦ÀíÌØÐ§¶¯×÷±íÏÖµÈÎÊÌâ {ÔSkillTypeID: ¸Ä±äºóµÄSkillTypeID}
|
self.IsChangeSkill = False # µ±Ç°ÊÇ·ñˢм¼ÄÜÌæ»»
|
|
#¼Ç¼»áÓ°ÏìÆäËû¼¼ÄÜ»òÕß±»¶¯´¥·¢Êͷż¼ÄܵÄBUFF
|
def AddBuffInfoByEffect(self, effect, skillID, onwerID, onwerType):
|
effectID = effect.GetEffectID()
|
|
#{(´¥·¢·½Ê½/µã£¬ ¹ØÁª¼¼ÄÜ)£º{BUFFID£º¡¾Ð§¹û¡¿}}
|
triggerType = GetBuffTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
return
|
|
releaseSkillID = 0
|
keyTuple = (triggerType, releaseSkillID)
|
if keyTuple not in self.AffectBuffDict:
|
self.AffectBuffDict[keyTuple] = {}
|
|
if skillID not in self.AffectBuffDict[keyTuple]:
|
self.AffectBuffDict[keyTuple][skillID] = []
|
self.AffectBuffDict[keyTuple][skillID].append([effect, onwerID, onwerType]) # ´æ´¢ÊÜÓ°ÏìµÄÐÅÏ¢
|
return
|
|
|
|
# ÐèÔÚɾ³ýBUFF´¦Àí
|
def DelBuffInfo(self, skillData):
|
if not skillData:
|
return
|
|
skillID = skillData.GetSkillID()
|
releaseSkillID = 0 # ÔÝÇÒÎÞ¹ØÁª¾ßÌå¼¼ÄÜ
|
for i in range(0, skillData.GetEffectCount()):
|
curEffect = skillData.GetEffect(i)
|
effectID = curEffect.GetEffectID()
|
|
triggerType = GetBuffTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
continue
|
|
if (triggerType, releaseSkillID) not in self.AffectBuffDict:
|
continue
|
|
if skillID not in self.AffectBuffDict[(triggerType, releaseSkillID)]:
|
continue
|
|
self.AffectBuffDict[(triggerType, releaseSkillID)].pop(skillID)
|
|
return
|
|
|
|
# »ñµÃ±»¶¯´¥·¢µÄ buff
|
def GetBuffsByTriggerType(self, triggerType, useSkillID=0):
|
return self.AffectBuffDict.get((triggerType, 0), {})
|
|
|
# ÖØË¢ÉñÊÞÖúÕ½¼¼ÄÜ
|
def RefreshDogzBattleSkill(self):
|
self.AffectDogzSkillDict = {}
|
skills = FindDogzBattleSkills(self.gameObj)
|
|
for curSkill in skills:
|
if not SkillCommon.isPassiveTriggerSkill(curSkill):
|
continue
|
|
skillTypeID = curSkill.GetSkillTypeID()
|
|
connSkillID = SkillShell.GetConnectSkillID(curSkill) # ¹ØÁª¼¼ÄÜID, 0´ú±í²»ÏÞ¼¼ÄÜ
|
for i in xrange(curSkill.GetEffectCount()):
|
curEffect = curSkill.GetEffect(i)
|
effectID = curEffect.GetEffectID()
|
if effectID == 0:
|
continue
|
|
triggerType = GetTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
continue
|
|
key = (triggerType,connSkillID)
|
if key not in self.AffectDogzSkillDict:
|
self.AffectDogzSkillDict[key] = []
|
|
self.AffectDogzSkillDict[key].append((skillTypeID, effectID))
|
|
return self.AffectDogzSkillDict
|
|
|
# ÖØË¢ÌØÊâ×°±¸¼¼ÄÜ
|
def RefreshSuperEquipSkillDict(self):
|
self.AffectSuperEquipSkillDict = {}
|
self.AffectSuperEquipEffectCntDict = {}
|
skillsDict = FindSuperEquipSkills(self.gameObj)
|
|
for skillID, value in skillsDict.items():
|
curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
if not curSkill:
|
continue
|
if not SkillCommon.isPassiveTriggerSkill(curSkill):
|
continue
|
|
skillTypeID = curSkill.GetSkillTypeID()
|
|
connSkillID = SkillShell.GetConnectSkillID(curSkill) # ¹ØÁª¼¼ÄÜID, 0´ú±í²»ÏÞ¼¼ÄÜ
|
for i in xrange(curSkill.GetEffectCount()):
|
curEffect = curSkill.GetEffect(i)
|
effectID = curEffect.GetEffectID()
|
if effectID == 0:
|
continue
|
|
triggerType = GetTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
continue
|
|
key = (triggerType,connSkillID)
|
if key not in self.AffectSuperEquipSkillDict:
|
self.AffectSuperEquipSkillDict[key] = []
|
|
self.AffectSuperEquipSkillDict[key].append((skillTypeID, effectID))
|
# Ч¹ûµþ¼Ó¸ù¾Ý¼¼ÄܸöÊý»áË¥¼õ = 1-pow((1-³õʼֵ/10000.0),Ïàͬ¼¼ÄܸöÊý)*10000
|
self.AffectSuperEquipEffectCntDict[effectID] = int((1 - pow((1 - curEffect.GetEffectValue(0)/10000.0),value))*10000)
|
|
GameWorld.DebugLog("RefreshSuperEquipSkillDict %s-%s"%(self.AffectSuperEquipSkillDict, self.AffectSuperEquipEffectCntDict))
|
|
return self.AffectSuperEquipSkillDict
|
|
|
# ÖØË¢¿É×°±¸µÄ±»¶¯¼¼ÄÜ
|
def RefreshPassiveSkillSet(self, isCD=False):
|
self.AffectPassiveSkillSetDict = {}
|
skillManager = self.gameObj.GetSkillManager()
|
skills = FindUsePassiveSkills(self.gameObj)
|
|
tick = GameWorld.GetGameWorld().GetTick()
|
|
for skillID in skills:
|
curSkill = skillManager.FindSkillBySkillID(skillID)
|
if not curSkill:
|
continue
|
|
if isCD:
|
# ÖØÇÐÐè½øÈëCD
|
SkillCommon.SetSkillRemainTime(curSkill, PlayerControl.GetReduceSkillCDPer(self.gameObj), tick, self.gameObj)
|
|
skillTypeID = curSkill.GetSkillTypeID()
|
connSkillID = SkillShell.GetConnectSkillID(curSkill) # ¹ØÁª¼¼ÄÜID, 0´ú±í²»ÏÞ¼¼ÄÜ
|
for i in xrange(curSkill.GetEffectCount()):
|
curEffect = curSkill.GetEffect(i)
|
effectID = curEffect.GetEffectID()
|
if effectID == 0:
|
continue
|
|
triggerType = GetTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
continue
|
|
key = (triggerType,connSkillID)
|
if key not in self.AffectPassiveSkillSetDict:
|
self.AffectPassiveSkillSetDict[key] = []
|
|
self.AffectPassiveSkillSetDict[key].append((skillTypeID, effectID))
|
|
return self.AffectPassiveSkillSetDict
|
|
# ¸Ä±ä¼¼ÄÜIDµÄ´¦Àí, ÏÈ´æ´¢ÊͷŵÄʱºòÌæ»», ²¢ÇÒ²»µÇ¼Çµ½±»¶¯´¥·¢
|
def ChangeSkillTypeIDDict(self, curSkill):
|
hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_ChangeSkillTypeID)
|
if not hasEffect:
|
return
|
changeSkillID = 0
|
|
#ÕÒµ½¶ÔÓ¦·¨±¦¼¼ÄÜ
|
upIpyData = IpyGameDataPY.GetIpyGameData('TreasureUp', hasEffect.GetEffectValue(0), 1)
|
if not upIpyData:
|
return
|
skillIDList = upIpyData.GetUnLockSkill()
|
for skillID in skillIDList:
|
skillData = GameWorld.GetGameData().FindSkillByType(skillID, 1)
|
if not skillData:
|
continue
|
if not SkillCommon.CheckSkillJob(self.gameObj, skillData):
|
continue
|
changeSkillID = skillID
|
break
|
|
if changeSkillID == 0:
|
return
|
|
self.ChangeSkill[changeSkillID] = curSkill.GetSkillTypeID()
|
|
self.IsChangeSkill = True
|
GameWorld.DebugLog("self.ChangeSkill --- %s"%self.ChangeSkill)
|
return True
|
|
# ÕæÊµÌæ»»¼¼ÄÜID
|
def ChangeSkillTypeID(self, skillID):
|
return self.ChangeSkill.get(skillID, skillID)
|
|
|
# ÖØË¢±»¶¯Ðͼ¼ÄÜ£¨º¬sp£¬Ì츳£¬²»º¬±»¶¯¼¼Äܹ¦ÄÜ£©´æ´¢
|
def RefreshPassiveSkill(self):
|
self.AffectSkillDict = {}
|
self.ChangeSkill = {}
|
mapID = FBCommon.GetRecordMapID(GameWorld.GetGameWorld().GetMapID())
|
invalidPassiveSkillFuncTypeDict = IpyGameDataPY.GetFuncEvalCfg("PassiveSkillEffect", 1, {})
|
invalidPassiveSkillFuncTypeList = invalidPassiveSkillFuncTypeDict.get(mapID, [])
|
if invalidPassiveSkillFuncTypeList:
|
GameWorld.Log("±¾µØÍ¼ÎÞЧµÄ±»¶¯¼¼Äܹ¦ÄÜ·ÖÀàÁбí: mapID=%s,%s" % (mapID, str(invalidPassiveSkillFuncTypeList)))
|
skillManager = self.gameObj.GetSkillManager()
|
for i in range(0 , skillManager.GetSkillCount()):
|
curSkill = skillManager.GetSkillByIndex(i)
|
if not curSkill:
|
continue
|
|
if not SkillCommon.isPassiveTriggerSkill(curSkill):
|
continue
|
|
if curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbPassiveSkill,
|
ChConfig.Def_SkillFuncType_Dogz,
|
ChConfig.Def_SkillFuncType_EquipPassiveSkill]:
|
# ±»¶¯¼¼ÄܺÍÉñÊÞÐèÉèÖòÅÓÐЧ
|
continue
|
|
# ¸Ä±ä¼¼ÄÜIDµÄ´¦Àí
|
if self.ChangeSkillTypeIDDict(curSkill):
|
continue
|
|
skillTypeID = curSkill.GetSkillTypeID()
|
connSkillID = SkillShell.GetConnectSkillID(curSkill) # ¹ØÁª¼¼ÄÜID, 0´ú±í²»ÏÞ¼¼ÄÜ
|
if invalidPassiveSkillFuncTypeList and curSkill.GetFuncType() in invalidPassiveSkillFuncTypeList:
|
#GameWorld.DebugLog("ÎÞЧµÄ±»¶¯¼¼ÄÜ: skillTypeID=%s,skillID=%s,connSkillID=%s,funcType=%s"
|
# % (skillTypeID, curSkill.GetSkillID(), connSkillID, curSkill.GetFuncType()))
|
continue
|
for i in xrange(curSkill.GetEffectCount()):
|
curEffect = curSkill.GetEffect(i)
|
effectID = curEffect.GetEffectID()
|
if effectID == 0:
|
continue
|
|
triggerType = GetTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
continue
|
|
key = (triggerType,connSkillID)
|
if key not in self.AffectSkillDict:
|
self.AffectSkillDict[key] = []
|
|
self.AffectSkillDict[key].append((skillTypeID, effectID))
|
|
return self.AffectSkillDict
|
|
# Ìí¼Ó±»¶¯¼¼ÄÜ
|
def AddPassiveSkill(self, skillID):
|
curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
if not curSkill:
|
return
|
|
if not SkillCommon.isPassiveTriggerSkill(curSkill):
|
return
|
|
skillTypeID = curSkill.GetSkillTypeID()
|
connSkillID = SkillShell.GetConnectSkillID(curSkill) # ¹ØÁª¼¼ÄÜID, 0´ú±í²»ÏÞ¼¼ÄÜ
|
for i in xrange(curSkill.GetEffectCount()):
|
curEffect = curSkill.GetEffect(i)
|
effectID = curEffect.GetEffectID()
|
if effectID == 0:
|
continue
|
|
triggerType = GetTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
continue
|
|
key = (triggerType,connSkillID)
|
if key not in self.AffectSkillDict:
|
self.AffectSkillDict[key] = []
|
|
if (skillTypeID, effectID) not in self.AffectSkillDict[key]:
|
self.AffectSkillDict[key].append((skillTypeID, effectID))
|
|
return self.AffectSkillDict
|
|
|
def GetPassiveSkillsByTriggerType(self, triggerType, connSkill=None):
|
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
|
skillList = []
|
## bug:2018-03-15
|
## skillList=self.AffectSkillDict.get((triggerType, connSkillID), [])ÔÙÓÃextend»áµ¼ÖÂAffectSkillDictÎÞÏÞÔö³¤
|
skillList.extend(self.AffectSkillDict.get((triggerType, connSkillID), []))
|
skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, connSkillID), []))
|
skillList.extend(self.AffectDogzSkillDict.get((triggerType, connSkillID), []))
|
skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, connSkillID), []))
|
|
# Ö¸¶¨ÌØÊâÀàÐͿɴ¥·¢
|
# »ñµÃ¹ØÁª¼¼ÄÜ,0 È«²¿ 1ÊÇÖ÷¶¯Ðͼ¼ÄÜ£¨·¨±¦£¬ÆÕ¹¥£© 2 ΪÈË×å·¨±¦¼¼ÄÜ 3ΪÆÕ¹¥ ÆäËû¼¼ÄÜID
|
if connSkill and connSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbSkill, ChConfig.Def_SkillFuncType_NormalAttack]:
|
funcTypeList = Def_ConnSkill_Template.get(connSkill.GetFuncType(), [])
|
for funcType in funcTypeList:
|
skillList.extend(self.AffectSkillDict.get((triggerType, funcType), []))
|
skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, funcType), []))
|
skillList.extend(self.AffectDogzSkillDict.get((triggerType, funcType), []))
|
skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, funcType), []))
|
|
# ±»¶¯ÔÙ´¥·¢±»¶¯ÏÞÖÆÎªÖ¸¶¨
|
if connSkill and SkillCommon.isPassiveSkill(connSkill) and not PassPassiveLimit(connSkill):
|
return skillList
|
|
if connSkillID != 0 and connSkillID != ChConfig.Def_SkillID_Somersault:
|
skillList.extend(self.AffectSkillDict.get((triggerType, 0), []))
|
skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, 0), []))
|
skillList.extend(self.AffectDogzSkillDict.get((triggerType, 0), []))
|
skillList.extend(self.AffectSuperEquipSkillDict.get((triggerType, 0), []))
|
return skillList
|
|
#ËùÓÐobjµÄ±»¶¯Ð§¹û¹ÜÀí
|
class PassiveEffManager(object):
|
|
def __init__(self):
|
self.passiveEffClassDict = {}
|
|
# ÊÇ·ñ³õʼ»¯
|
def GetPassiveEff(self, gameObj):
|
key = (gameObj.GetID(), gameObj.GetGameObjType())
|
|
return self.passiveEffClassDict.get(key, None)
|
|
|
def InitObjPassiveEff(self, gameObj):
|
key = (gameObj.GetID(), gameObj.GetGameObjType())
|
if key not in self.passiveEffClassDict:
|
self.passiveEffClassDict[key] = PassiveEff(gameObj)
|
return self.passiveEffClassDict[key]
|
|
def AddPassiveEff(self, gameObj, passiveEff):
|
key = (gameObj.GetID(), gameObj.GetGameObjType())
|
self.passiveEffClassDict[key] = passiveEff
|
|
# ×¢²á±»¶¯¼¼ÄÜ
|
def RegistPassiveEff(self, gameObj, skillID=0):
|
passiveEff = self.GetPassiveEff(gameObj)
|
if not passiveEff or not skillID:
|
|
if passiveEff:
|
# µ±´ÓÓб»¶¯µ½ÍêȫûÓб»¶¯µÄ¹ý³Ì£¬ÐèÒªÔÚ´ËË¢ÐÂ
|
passiveEff.RefreshPassiveSkill()
|
return
|
|
# Ç¿ÖÆË¢ÐÂËùÓб»¶¯¼¼ÄÜ
|
passiveEff = PassiveEff(gameObj)
|
if not passiveEff.RefreshPassiveSkill():
|
# ´Ë´¦ÊÇΪÁ˲»¸øAddPassiveEffÔö¼Ó¿ÕÀà. ¹Ê²»Ã¿´Îµ÷ÓÃAddPassiveEff
|
# µ«ÁíÒ»ÖÖ´ÓÓб»¶¯µ½ÍêȫûÓб»¶¯»á±»´Ë¹ýÂË£¬µ¼ÖÂɾ³ý²»ÁË£¬ÔÚÉÏÃæ´¦Àí
|
return
|
self.AddPassiveEff(gameObj, passiveEff)
|
elif skillID:
|
curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
if curSkill and passiveEff.ChangeSkillTypeIDDict(curSkill):
|
# Ìæ»»¼¼Äܲ»Ìí¼Ó
|
return
|
|
# µ¥¸öÌí¼Ó±»¶¯¼¼ÄÜ
|
passiveEff.AddPassiveSkill(skillID)
|
|
if passiveEff.IsChangeSkill:
|
GameWorld.DebugLog("Ë¢±»¶¯----")
|
# ´æÔÚÌæ»»¼¼ÄÜ Ä¿Ç°ÐèҪˢÐÂÏâǶµÄ±»¶¯¼¼ÄÜ£¬´æÔÚ¶àË¢ÏÖÏó
|
self.RegistPassiveEffSet(gameObj)
|
passiveEff.IsChangeSkill = False
|
return True
|
return
|
|
# ÈËÎïÐèͬ²½×¢²á±»¶¯¼¼ÄÜ
|
def RegistPassiveEffSet(self, gameObj, isCD=False):
|
passiveEff = self.GetPassiveEff(gameObj)
|
if not passiveEff:
|
# Ç¿ÖÆË¢ÐÂËùÓб»¶¯¼¼ÄÜ
|
passiveEff = PassiveEff(gameObj)
|
if not passiveEff.RefreshPassiveSkillSet(isCD):
|
return
|
self.AddPassiveEff(gameObj, passiveEff)
|
else:
|
passiveEff.RefreshPassiveSkillSet(isCD)
|
return
|
|
|
# ÈËÎïÐèͬ²½×¢²áÉñÊÞ¼¼ÄÜ
|
def RegistPassiveEffDogz(self, gameObj):
|
passiveEff = self.GetPassiveEff(gameObj)
|
if not passiveEff:
|
# Ç¿ÖÆË¢ÐÂËùÓб»¶¯¼¼ÄÜ
|
passiveEff = PassiveEff(gameObj)
|
if not passiveEff.RefreshDogzBattleSkill():
|
return
|
self.AddPassiveEff(gameObj, passiveEff)
|
else:
|
passiveEff.RefreshDogzBattleSkill()
|
return
|
|
|
|
# ÈËÎïÐèͬ²½×¢²á×°±¸¼¼ÄÜ£¬¼¼ÄÜĿǰΪ¿É´¥·¢µÄ±»¶¯À࣬ÈôÓж¨Òå³åÍ»Ôò¿ÉÓù¦ÄÜÀàÐÍ»®·Ö
|
def RegistSuperEquipSkillDict(self, gameObj):
|
passiveEff = self.GetPassiveEff(gameObj)
|
if not passiveEff:
|
# Ç¿ÖÆË¢ÐÂËùÓб»¶¯¼¼ÄÜ
|
passiveEff = PassiveEff(gameObj)
|
if not passiveEff.RefreshSuperEquipSkillDict():
|
return
|
self.AddPassiveEff(gameObj, passiveEff)
|
else:
|
passiveEff.RefreshSuperEquipSkillDict()
|
return
|
|
|
def RegistPassiveBuff(self, gameObj):
|
# buff # ɸѡbuffType ·ñÔòNPCûÓд˽ӿڻᱨ´í
|
for buffType in [IPY_GameWorld.bfBuff, IPY_GameWorld.bfDeBuff, IPY_GameWorld.bfProcessBuff
|
, IPY_GameWorld.btPassiveBuf, IPY_GameWorld.bfActionBuff, IPY_GameWorld.bfProcessDeBuff]:
|
|
if buffType == IPY_GameWorld.btPassiveBuf and gameObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
# NPCÖ»ÓгèÎïÓб»¶¯BUFF
|
if not PetControl.IsPet(gameObj):
|
continue
|
|
buffTuple = SkillCommon.GetBuffManagerByBuffType(gameObj, buffType)
|
#ͨ¹ýÀàÐÍ»ñȡĿ±êµÄbuff¹ÜÀíÆ÷Ϊ¿Õ£¬ÔòÌø³ö
|
if buffTuple == ():
|
continue
|
|
buffManager = buffTuple[0]
|
|
for i in xrange(buffManager.GetBuffCount()):
|
curBuff = buffManager.GetBuff(i)
|
buffSkill = curBuff.GetSkill()
|
if not buffSkill:
|
continue
|
|
onwerID, onwerType = curBuff.GetOwnerID(), curBuff.GetOwnerType()
|
for effectIndex in range(0, buffSkill.GetEffectCount()):
|
curEffect = buffSkill.GetEffect(effectIndex)
|
effectID = curEffect.GetEffectID()
|
if effectID == 0:
|
continue
|
|
triggerType = GetBuffTriggerTypeByEffectID(effectID)
|
if triggerType == -1:
|
continue
|
passiveEff = self.InitObjPassiveEff(gameObj)
|
passiveEff.AddBuffInfoByEffect(curEffect, buffSkill.GetSkillID(), onwerID, onwerType)
|
|
return
|
|
|
def RemovePassiveEff(self, key):
|
if key in self.passiveEffClassDict:
|
self.passiveEffClassDict.pop(key)
|
return
|
|
|
def GetPassiveEffManager():
|
if not PyGameData.g_PassiveEffManager:
|
PyGameData.g_PassiveEffManager = PassiveEffManager()
|
return PyGameData.g_PassiveEffManager
|
|
|
# ²éÕÒ±»¶¯¼¼ÄÜʱµÄ¶ÔÏó
|
def GetPassiveDefender(attacker, defender):
|
# ѰÕÒ±»»÷Õߣ¬1.Ä¿±êÅųýÊÇ×Ô¼º£¨ºóÃæÂß¼»á¸ü»»£© 2. ²é¿Í»§¶ËÉ˺¦¶ÓÁУ¬3.²é·þÎñ¶ËÉ˺¦¶ÓÁÐ
|
if defender and defender != attacker:
|
return defender
|
|
# ûÓÐÄ¿±êµÄÇé¿öÈ¡É˺¦¶ÓÁÐÖеĵÚÒ»¸ö¶ÔÏó
|
if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
return
|
|
useSkillTagID = attacker.GetUseSkillTagID()
|
useSkillTagType = attacker.GetUseSkillTagType()
|
defender = GameWorld.GetObj(useSkillTagID, useSkillTagType)
|
if defender:
|
return defender
|
|
curHurt = BaseAttack.GetFirstHurtObj()
|
if not curHurt:
|
return
|
|
return GameWorld.GetObj(curHurt.GetObjID(), curHurt.GetObjType())
|
|
# µ±Ç°ÓÐЧ±»¶¯´¥·¢¼¼ÄÜ, ¿ÉÓÃÓÚ»ù´¡Ê¹ÓÃÅж¨
|
def IsValidPassiveSkill(curSkill):
|
validMap = SkillShell.GetAttrMapID(curSkill)
|
if validMap and validMap != GameWorld.GetMap().GetMapID():
|
# ÓÐЧµØÍ¼¿É´¥·¢
|
return False
|
|
return True
|
|
# ¶àÖÖ±»¶¯¼¼ÄÜÓÅÏÈ´¥·¢ÊÍ·ÅÒ»¸ö£¬Èç±»¶¯ ѪÁ¿40%´¥·¢Î޵м¼ÄÜ£¬ÑªÁ¿Ò»¶¨ÊÇÍ£ÁôÔÚ40%
|
# ÏÈËøÑª£¬ºó´¥·¢¼¼ÄÜ Í¬ DelayUsePassiveTriggerSkill ʹÓÃ
|
def OnPassiveSkillLockHP(attacker, defender, connSkill, triggerType, tick, isEnhanceSkill=False):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return 0, 0
|
|
stopPassiveSkill = False # ±»¶¯¼¼Äܲ»ÄÜÔÙ´¥·¢±»¶¯¼¼ÄÜ£¬µ«¿ÉÒÔ´¥·¢Ì츳¼¼ÄÜ
|
if connSkill:
|
if not connSkill.GetFuncType():
|
# ·Ç¹¦ÄÜÀ༼ÄÜ£¬±ÜÃâËÀÑ»·
|
return 0, 0
|
if SkillCommon.isPassiveSkill(connSkill) and not PassPassiveLimit(connSkill):
|
stopPassiveSkill = True
|
|
if SkillCommon.GetUsingPassiveSkill(attacker) and triggerType != ChConfig.TriggerType_BuffState:
|
# ·À·¶±»¶¯¼¼ÄÜ´¥·¢µÄ ·Ç±»¶¯¼¼ÄÜ
|
stopPassiveSkill = True
|
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return 0, 0
|
|
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
|
skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
|
if not skills:
|
return 0, 0
|
|
defender = GetPassiveDefender(attacker, defender)
|
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
#GameWorld.DebugLog("OnPriorityPassiveSkillTrigger-----------%s-%s"%(skills, battleRelationType))
|
|
lockHPPerMax = 0 ## È¡ÓÐЧµÄ×î¸ßѪÁ¿
|
lockHPSkillID = 0
|
for skillTypeID, effectID in skills:
|
if connSkillID == skillTypeID:
|
continue
|
curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
|
if not curSkill:
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
|
if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
|
# Ö»ÓÐÌ츳²Å¿ÉÒÔÔٴα»´¥·¢
|
continue
|
|
effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
|
if not effect:
|
continue
|
|
if SkillCommon.RefreshSkillRemainTime(curSkill, tick):
|
continue
|
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, curSkill, battleRelationType):
|
# PKģʽµÄÅж¨
|
continue
|
|
pyName = "PassiveSkill_%s" % effectID
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
if not callFunc:
|
continue
|
if not callFunc(attacker, defender, effect, curSkill):
|
continue
|
|
# ×îÖÕÈ¡×î¸ßÖµÀ´¾ö¶¨µ±Ç°ÉúÃüÖµ£¬¿¨ÑªÉ趨
|
if effect.GetEffectValue(0) > lockHPPerMax:
|
lockHPPerMax = effect.GetEffectValue(0)
|
lockHPSkillID = skillTypeID
|
|
return lockHPSkillID, lockHPPerMax
|
|
|
# ËøÑª¹¦Äܵļ¼ÄÜ º¬ÈËÎïºÍ³èÎï
|
def OnObjsPassiveSkillLockHP(attacker, defender, connSkill, triggerType, tick,):
|
if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
return 0
|
|
lockHPSkillID, lockHPPerMax = OnPassiveSkillLockHP(attacker, defender, connSkill, triggerType, tick)
|
rolePet = attacker.GetPetMgr().GetFightPet()
|
if rolePet:
|
lockHPSkillIDPet, lockHPPerMaxPet = OnPassiveSkillLockHP(rolePet, defender, connSkill, triggerType, tick)
|
|
if lockHPPerMax + lockHPPerMaxPet == 0:
|
# ÎÞ´¥·¢
|
return 0
|
|
# ´¥·¢³èÎï¼¼ÄܱêÖ¾
|
if lockHPPerMaxPet > lockHPPerMax:
|
rolePet.SetDict(ChConfig.Def_PlayerKey_LockHPSkillID, lockHPSkillIDPet)
|
return lockHPPerMaxPet
|
|
if lockHPPerMax == 0:
|
return 0
|
|
# ´¥·¢ÈËÎï¼¼ÄܱêÖ¾
|
attacker.SetDict(ChConfig.Def_PlayerKey_LockHPSkillID, lockHPSkillID)
|
return lockHPPerMax
|
|
|
# ´ÓÉËѪÑÓºóµ½¼¼ÄܽáÊø´¥·¢±»¶¯¼¼ÄÜ
|
def DelayUsePassiveTriggerSkill(attacker, curSkill, defender, tick):
|
if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
return
|
|
# ¼ì²éÊdzèÎﻹÊÇÈËÎï¼¼ÄÜ
|
skillTypeID = attacker.GetDictByKey(ChConfig.Def_PlayerKey_LockHPSkillID)
|
if not skillTypeID:
|
rolePet = attacker.GetPetMgr().GetFightPet()
|
if not rolePet:
|
return
|
skillTypeID = rolePet.GetDictByKey(ChConfig.Def_PlayerKey_LockHPSkillID)
|
if not skillTypeID:
|
return
|
attacker = rolePet
|
GameWorld.DebugLog("DelayUsePassiveTriggerSkill-----pet")
|
|
# Ò»¶¨ÒªÇå±êÖ¾
|
attacker.SetDict(ChConfig.Def_PlayerKey_LockHPSkillID, 0)
|
|
curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
|
if not curSkill:
|
return
|
|
GameWorld.DebugLog("DelayUsePassiveTriggerSkill-----skillTypeID-%s"%skillTypeID)
|
# ÉèÖñêÖ¾±ÜÃâ±»¶¯¼¼ÄÜ´¥·¢±»¶¯¼¼ÄÜ, ±»¶¯µ±ÖпÉÄܻᴥ·¢¶àÖÖÀàÐͼ¼ÄÜ£¬¹Ê²»ÓÃisPassiveSkill×öÆÁ±Î
|
SkillCommon.SetUsingPassiveSkill(attacker, 1)
|
if not SkillShell.UsePassiveTriggerSkill(attacker, curSkill, defender, tick):
|
# ²»¹Ü¼¼ÄÜÊÇ·ñÊÇ·ñ³É¹¦¶¼±ØÐë½øÈëCD
|
SkillCommon.SetSkillRemainTime(curSkill, PlayerControl.GetReduceSkillCDPer(attacker), tick, attacker)
|
|
SkillCommon.SetUsingPassiveSkill(attacker, 0)
|
return
|
|
|
# Áé³è²¿·Ö¼¼ÄÜÐèҪͨ¹ýÖ÷ÈË´¥·¢£¬Áé³è×Ô¼º´¥·¢µÄÂß¼ÒÀÈ»×ß OnPassiveSkillTrigger
|
def OnPetPassiveSkillTrigger(attacker, defender, connSkill, triggerType, tick):
|
if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
return
|
|
rolePet = attacker.GetPetMgr().GetFightPet()
|
#ÎÞ³öÕ½³èÎï
|
if rolePet == None:
|
return
|
|
OnPassiveSkillTrigger(rolePet, defender, connSkill, triggerType, tick)
|
|
|
# ±»¶¯¼¼ÄÜ´¥·¢ÊÍ·Å
|
def OnPassiveSkillTrigger(attacker, defender, connSkill, triggerType, tick, isEnhanceSkill=False, skillIDSet=None):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return False
|
|
if connSkill:
|
if not connSkill.GetFuncType():
|
# ·Ç¹¦ÄÜÀ༼ÄÜ£¬±ÜÃâËÀÑ»·
|
return False
|
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return False
|
|
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
|
skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
|
if not skills:
|
return False
|
|
defender = GetPassiveDefender(attacker, defender)
|
|
result = False
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
#GameWorld.DebugLog("OnPassiveSkillTrigger-----------%s-%s"%(skills, battleRelationType))
|
for skillTypeID, effectID in skills:
|
if connSkillID == skillTypeID:
|
continue
|
curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
|
if not curSkill:
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
|
effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
|
if not effect:
|
continue
|
|
if SkillCommon.RefreshSkillRemainTime(curSkill, tick):
|
continue
|
result = True # ´ú±íÓÐЧ´¥·¢£¬µ«²»¹ØÏµ´¥·¢½á¹û
|
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, curSkill, battleRelationType):
|
# PKģʽµÄÅж¨
|
continue
|
|
pyName = "PassiveSkill_%s" % effectID
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
if callFunc and not callFunc(attacker, defender, effect, curSkill):
|
continue
|
|
# ÉèÖñêÖ¾±ÜÃâ±»¶¯¼¼ÄÜ´¥·¢±»¶¯¼¼ÄÜ, ±»¶¯µ±ÖпÉÄܻᴥ·¢¶àÖÖÀàÐͼ¼ÄÜ£¬¹Ê²»ÓÃisPassiveSkill×öÆÁ±Î
|
SkillCommon.SetUsingPassiveSkill(attacker, 1)
|
if SkillShell.UsePassiveTriggerSkill(attacker, curSkill, defender, tick, isEnhanceSkill):
|
if skillIDSet:
|
curSkill.SetRemainTime(0) # Ò»´Î¹¥»÷¶à´Îµ÷Óà £¬ÔÚÍâ²ãͳһµ÷ÓÃCD
|
skillIDSet.add(skillTypeID)
|
SkillCommon.SetUsingPassiveSkill(attacker, 0)
|
|
# ´ú±íÓÐЧ´¥·¢£¬µ«²»¹ØÏµ´¥·¢½á¹û, Íâ²ã¸ù¾ÝÐèÇóʹÓã¬Èç¼õÉÙÑ»·ÅжÏ
|
return result
|
|
|
#ntSummon£º£¨3£©ÆÕͨÕÙ»½ÊÞ£¬¿É¼Ì³ÐÖ÷ÈË»ù´¡ÊôÐÔÈç¹¥»÷
|
#ntElf£º£¨4£©Íæ¼ÒÌæÉí£¬ÍêȫӵÓÐÍæ¼ÒÊôÐԺͱ»¶¯¹¦ÄÜ
|
#ntFairy £º£¨7£©Í¬ntSummon£¬µ«¼¼Äܿɴ¥·¢±»¶¯¹¦ÄÜ
|
|
# ntElf ¶¨ÒåΪÈËÎïʹÓöԵسÖÐøÐÔ¼¼ÄÜ£¬²¢ÇÒÈËÎï¿ÉÒÔÒÆ¶¯£¬ÔòÐèÒªntElf×öÒÀÍÐÎïµÄÇé¿ö
|
# ÄÇôntElfÖ´ÐÐÈËÎïµÄÉ˺¦¼ÆËãºÍ±»¶¯´¥·¢Ð§¹û
|
# ±»¶¯¼¼ÄÜÖ»´¦ÀíÍæ¼Ò£¬³èÎºÍÁé
|
def FindRealAttacker(attacker):
|
if attacker.GetGameObjType() != IPY_GameWorld.gotNPC:
|
# --Íæ¼Ò
|
return attacker
|
|
npcType = attacker.GetType()
|
if npcType not in [IPY_GameWorld.ntPet, IPY_GameWorld.ntElf, IPY_GameWorld.ntFairy]:
|
if attacker.GetIsBoss():
|
return attacker
|
return
|
|
if npcType == IPY_GameWorld.ntPet:
|
# --³èÎï
|
return attacker
|
|
else:
|
# ntElf ¶¨ÒåΪÈËÎïʹÓöԵسÖÐøÐÔ¼¼ÄÜ£¬²¢ÇÒÈËÎï¿ÉÒÔÒÆ¶¯£¬ÔòÐèÒªntElf×öÒÀÍÐÎïµÄÇé¿ö
|
# ÄÇôntElfÖ´ÐÐÈËÎïµÄÉ˺¦¼ÆËãºÍ±»¶¯´¥·¢Ð§¹û
|
attacker = NPCCommon.GetSummonNPCOwner(IPY_GameWorld.gotPlayer, attacker)
|
return attacker
|
|
return
|
|
# ±»¶¯¼¼ÄܸıäÖµ connSkill ΪÖ÷¶¯Êͷż¼ÄÜ
|
def GetPassiveSkillValueByTriggerType(attacker, defender, connSkill, triggerType):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return 0
|
|
stopPassiveSkill = False # ±»¶¯¼¼Äܲ»ÄÜÔÙ´¥·¢±»¶¯¼¼ÄÜ£¬µ«¿ÉÒÔ´¥·¢Ì츳¼¼ÄÜ
|
if connSkill and SkillCommon.isPassiveSkill(connSkill):
|
#GameWorld.DebugLog("±»¶¯¼¼Äܲ»ÄÜÔٴδ¥·¢±»¶¯¼¼ÄÜ")
|
#return 0
|
if not PassPassiveLimit(connSkill):
|
stopPassiveSkill = True
|
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return 0
|
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
|
skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
|
if not skills:
|
return 0
|
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
tick = GameWorld.GetGameWorld().GetTick()
|
curValue = 0
|
|
for skillTypeID, effectID in skills:
|
if connSkillID == skillTypeID:
|
continue
|
curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
|
if not curSkill:
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
|
if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
|
# Ö»ÓÐÌ츳²Å¿ÉÒÔÔٴα»´¥·¢
|
continue
|
|
if skillTypeID not in Def_PassiveSkillValueNoCD:
|
# ÌØÊâ¼¼Äܲ»×ßCD´¦Àí
|
if curSkill.GetCoolDownTime() and SkillCommon.RefreshSkillRemainTime(curSkill, tick):
|
#ÓÐÅäÖÃCDµÄ²ÅÅжÏ
|
continue
|
|
effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
|
if not effect:
|
continue
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, curSkill, battleRelationType):
|
continue
|
|
pyName = "PassiveSkill_%s" % effectID
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
|
# Ìõ¼þ²»Âú×ã
|
if callFunc and not callFunc(attacker, defender, effect, curSkill):
|
continue
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "GetValue"))
|
if callFunc is None:
|
continue
|
|
if triggerType == ChConfig.TriggerType_IsDealy:
|
curValue = callFunc(attacker, defender, effect)
|
else:
|
curValue += callFunc(attacker, defender, effect)
|
if skillTypeID not in Def_PassiveSkillValueNoCD:
|
if curSkill.GetCoolDownTime():
|
SkillCommon.SetSkillRemainTime(curSkill, 0, tick, attacker)
|
|
return curValue
|
|
|
# È¡³öÊÜÓ°ÏìµÄ±»¶¯¼¼ÄÜ£¬Íⲿ´¦Àí
|
def GetPassiveSkillByTriggerType(attacker, defender, connSkill, triggerType):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return []
|
if connSkill and SkillCommon.isPassiveSkill(connSkill):
|
#GameWorld.DebugLog("±»¶¯¼¼Äܲ»ÄÜÔٴδ¥·¢±»¶¯¼¼ÄÜ")
|
return []
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return []
|
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
|
skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
|
if not skills:
|
return []
|
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
#tick = GameWorld.GetGameWorld().GetTick()
|
skillList = []
|
for skillTypeID, effectID in skills:
|
if connSkillID == skillTypeID:
|
continue
|
curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
|
#if SkillCommon.RefreshSkillRemainTime(curSkill, tick):
|
# continue
|
if not curSkill:
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
|
effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
|
if not effect:
|
continue
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, curSkill, battleRelationType):
|
continue
|
|
pyName = "PassiveSkill_%s" % effectID
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
|
# Ìõ¼þ²»Âú×ã
|
if callFunc and not callFunc(attacker, defender, effect, curSkill):
|
continue
|
|
skillList.append(curSkill)
|
|
return skillList
|
|
|
# ±»¶¯¼¼ÄÜ´¥·¢µ«ÎÞÐèÊÍ·Å£¬ÈçµÖÏûdebuff£¬Ö»Ðè×ßCD¼´¿É
|
def OnPassiveSkillHappen(attacker, defender, connSkill, triggerType, tick):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return
|
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
|
skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
|
if not skills:
|
return
|
|
defender = GetPassiveDefender(attacker, defender)
|
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
|
for skillTypeID, effectID in skills:
|
if connSkillID == skillTypeID:
|
continue
|
curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
|
if not curSkill:
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
|
effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
|
if not effect:
|
continue
|
if SkillCommon.RefreshSkillRemainTime(curSkill, tick):
|
continue
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, curSkill, battleRelationType):
|
# PKģʽµÄÅж¨
|
continue
|
|
pyName = "PassiveSkill_%s" % effectID
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
|
if callFunc and not callFunc(attacker, defender, effect, curSkill, connSkill):
|
continue
|
|
SkillCommon.SetSkillRemainTime(curSkill, 0, tick, attacker)
|
SkillShell.DoLogic_UseEnhanceSkill(attacker, defender, curSkill, tick)
|
|
return True
|
|
return False
|
|
|
# ±»¶¯¼¼ÄÜ´¥·¢µ«ÎÞÐèÊÍ·Å£¬ÈçµÖÏûdebuff£¬Ö»Ðè×ßCD¼´¿É
|
def OnPassiveBuffHappen(attacker, defender, tagSkill, triggerType, tick):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return False
|
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return False
|
buffDict = passiveEff.GetBuffsByTriggerType(triggerType)
|
if not buffDict:
|
return False
|
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, tagSkill, battleRelationType):
|
return
|
|
|
for skillID, effectList in buffDict.items():
|
|
curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
if not curSkill:
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
for effectInfo in effectList:
|
passiveEffect = effectInfo[0]
|
# ±»¶¯´¥·¢µÄ¼¼ÄÜ
|
pyName = "PassiveBuff_%s"%passiveEffect.GetEffectID()
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
if not callFunc:
|
continue
|
|
if not callFunc(attacker, defender, passiveEffect, tagSkill, ownerID=effectInfo[1], ownerType=effectInfo[2]):
|
continue
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "DoLogic"))
|
if callFunc:
|
callFunc(attacker, defender, passiveEffect, tagSkill, skillID)
|
|
return True
|
|
return False
|
#------------------------BuffÀà ±»¶¯´¥·¢, ²¢·ÇÈ«ÊDZ»¶¯¼¼ÄÜ-----------------------------------------------
|
|
#buffÀà´¥·¢Êͷż¼ÄÜ£¬ÎÞCDÑéÖ¤
|
def OnPassiveBuffTrigger(attacker, defender, useSkill, triggerType, tick):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return
|
|
stopPassiveSkill = False # ±»¶¯¼¼Äܲ»ÄÜÔÙ´¥·¢±»¶¯¼¼ÄÜ£¬µ«¿ÉÒÔ´¥·¢Ì츳¼¼ÄÜ
|
if useSkill:
|
if not useSkill.GetFuncType():
|
# ·Ç¹¦ÄÜÀ༼ÄÜ£¬±ÜÃâËÀÑ»·
|
return
|
if SkillCommon.isPassiveSkill(useSkill) and not PassPassiveLimit(useSkill):
|
#GameWorld.DebugLog("±»¶¯¼¼Äܲ»ÄÜÔٴδ¥·¢±»¶¯¼¼ÄÜ")
|
#return
|
stopPassiveSkill = True
|
|
if SkillCommon.GetUsingPassiveSkill(attacker):
|
# ·À·¶±»¶¯¼¼ÄÜ´¥·¢µÄ ·Ç±»¶¯¼¼ÄÜ
|
#GameWorld.DebugLog("±»¶¯¼¼Äܲ»ÄÜÔٴδ¥·¢±»¶¯¼¼ÄÜ---%s"%triggerType)
|
#return
|
stopPassiveSkill = True
|
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return
|
|
buffDict = passiveEff.GetBuffsByTriggerType(triggerType)
|
if not buffDict:
|
return
|
|
defender = GetPassiveDefender(attacker, defender)
|
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
useSkillID = useSkill.GetSkillID() if useSkill else 0
|
|
for skillID, effectList in buffDict.items():
|
if skillID == useSkillID:
|
continue
|
curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
if not curSkill:
|
continue
|
|
if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
|
# Ö»ÓÐÌ츳²Å¿ÉÒÔÔٴα»´¥·¢
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
for effectInfo in effectList:
|
passiveEffect = effectInfo[0]
|
# ±»¶¯´¥·¢µÄ¼¼ÄÜ
|
pyName = "PassiveBuff_%s"%passiveEffect.GetEffectID()
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
if not callFunc:
|
continue
|
|
if not callFunc(attacker, defender, passiveEffect, skillID, useSkill=useSkill, ownerID=effectInfo[1], ownerType=effectInfo[2]):
|
continue
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "GetSkillData"))
|
if not callFunc:
|
continue
|
|
skillData = callFunc(passiveEffect)
|
if not skillData:
|
continue
|
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, skillData, battleRelationType):
|
# PKģʽµÄÅж¨
|
continue
|
|
SkillCommon.SetUsingPassiveSkill(attacker, 1)
|
if SkillShell.UsePassiveTriggerSkill(attacker, skillData, defender, tick):
|
AfterUsePassiveSkill(pyName, attacker, defender, passiveEffect, tick)
|
SkillCommon.SetUsingPassiveSkill(attacker, 0)
|
|
def AfterUsePassiveSkill(pyName, attacker, defender, passiveEffect, tick):
|
# ¸½¼Ó´¥·¢ºóÂß¼
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "AfterUsePassiveSkill"))
|
if not callFunc:
|
return
|
callFunc(attacker, defender, passiveEffect, tick)
|
return
|
|
# buff Ó°ÏìµÄ(¹¥»÷)ÐÐΪֵ
|
# ·µ»ØÊýÖµ
|
def GetValueByPassiveBuffTriggerType(attacker, defender, useSkill, triggerType, isStopPassiveSkill=True):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return 0
|
|
stopPassiveSkill = False # ±»¶¯¼¼Äܲ»ÄÜÔÙ´¥·¢±»¶¯¼¼ÄÜ£¬µ«¿ÉÒÔ´¥·¢Ì츳¼¼ÄÜ
|
if useSkill and SkillCommon.isPassiveSkill(useSkill) and isStopPassiveSkill:
|
#GameWorld.DebugLog("±»¶¯¼¼Äܲ»ÄÜÔٴδ¥·¢±»¶¯¼¼ÄÜ")
|
#return 0
|
if not PassPassiveLimit(useSkill):
|
stopPassiveSkill = True
|
|
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return 0
|
buffDict = passiveEff.GetBuffsByTriggerType(triggerType)
|
if not buffDict:
|
return 0
|
|
# µ±Ç°Õ½¶·¹ØÏµ pvp pve
|
battleRelationType = AttackCommon.GetBattleRelationType(attacker, defender)
|
if not AttackCommon.CheckBattleRelationType(attacker, defender, useSkill, battleRelationType):
|
return 0
|
|
useSkillID = useSkill.GetSkillID() if useSkill else 0
|
#tick = GameWorld.GetGameWorld().GetTick()
|
curValue = 0
|
|
for skillID, effectList in buffDict.items():
|
if skillID == useSkillID:
|
continue
|
curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
if not curSkill:
|
continue
|
|
if not IsValidPassiveSkill(curSkill):
|
continue
|
|
for effectInfo in effectList:
|
if stopPassiveSkill and curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_GiftSkill:
|
# Ö»ÓÐÌ츳²Å¿ÉÒÔÔٴα»´¥·¢
|
continue
|
passiveEffect = effectInfo[0]
|
# ±»¶¯´¥·¢µÄ¼¼ÄÜ
|
pyName = "PassiveBuff_%s"%passiveEffect.GetEffectID()
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
if not callFunc:
|
continue
|
|
# Ìõ¼þ²»Âú×ã
|
if not callFunc(attacker, defender, passiveEffect, skillID, useSkill=useSkill, ownerID=effectInfo[1], ownerType=effectInfo[2]):
|
continue
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "GetValue"))
|
if callFunc is None:
|
continue
|
|
# Èç±»¶¯¼¼ÄÜ£ºÇ§»ÃÚ¤Ñ×ÕæÊµÉ˺¦´Ó2±ä4±¶
|
#curValue += GetPassiveSkillValueByTriggerType(attacker, defender, curSkill, ChConfig.TriggerType_PassiveBuffValue)
|
curValue += callFunc(attacker, defender, passiveEffect)
|
|
return curValue
|
|
|
# ÒòΪҪ¼æÈݵ͵ȼ¶¼¼ÄÜ£¬ËùÒÔ¼¼ÄÜÖ»ÄÜÊÇÔÚÖúÕ½µÄʱºò£¬ÏÈɾ³ýÉñÊÞ¼¼ÄÜÔÙѧϰеÄÖúÕ½ÉñÊÞ¼¼ÄÜ
|
def PlayerDogzSkill(curPlayer):
|
|
dogzSkills = [] # ÐèҪѧϰµÄ¼¼ÄÜ
|
ipyDataMgr = IpyGameDataPY.IPY_Data()
|
for i in xrange(ipyDataMgr.GetDogzCount()):
|
ipyData = ipyDataMgr.GetDogzByIndex(i)
|
if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, i):
|
continue
|
|
dogzSkills.extend(ipyData.GetHelpBattleSkills())
|
|
delDogzSkills = [] # ɾ³ý²»ÔÚÖúÕ½ÉñÊÞ¶ÓÁеļ¼ÄÜ
|
skillManager = curPlayer.GetSkillManager()
|
for i in xrange(skillManager.GetSkillCount()):
|
curSkill = skillManager.GetSkillByIndex(i)
|
if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
|
continue
|
skillID = curSkill.GetSkillID()
|
|
delDogzSkills.append(skillID)
|
|
GameWorld.DebugLog("PlayerDogzSkill:%s - ɾ³ý%s"%(dogzSkills, delDogzSkills))
|
|
# ɾ³ýÉñÊÞ¼¼ÄÜ
|
for skillID in delDogzSkills:
|
skillManager.DeleteSkillBySkillID(skillID, False)
|
|
# Ìí¼ÓÖúÕ½¼¼ÄÜ£¬Í¬À༼ÄÜÈ¡×î¸ß
|
dogzSkills.sort()
|
for skillID in dogzSkills:
|
skillData = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
if not skillData:
|
continue
|
if skillData.GetSkillType() == ChConfig.Def_SkillType_AttrSkillNoLearn:
|
# ͬ¼¼Äܿɶà¸öµþ¼ÓµÄ¼¼Äܲ»ÄÜѧ£¬ËãÊôÐÔʱֱ½ÓÈ¡±í
|
continue
|
|
skillManager.LearnSkillByID(skillID, False)
|
|
# Ë¢±»¶¯Ð§¹û
|
GetPassiveEffManager().RegistPassiveEffDogz(curPlayer)
|
return
|
|
|
# »ñÈ¡ÖúÕ½ÉñÊ޵ļ¼ÄÜÁбí
|
def FindDogzBattleSkills(gameObj):
|
skills = []
|
if gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
return skills
|
|
skillManager = gameObj.GetSkillManager()
|
for i in xrange(skillManager.GetSkillCount()):
|
curSkill = skillManager.GetSkillByIndex(i)
|
if not curSkill:
|
continue
|
|
if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
|
continue
|
skills.append(curSkill)
|
|
return skills
|
|
|
# ±éÀúÉíÉÏ×°±¸¼¼ÄÜÒÔ¼°¸÷×Ô¸öÊý£¬×°±¸¼¼Äܲ»ÐèҪѧϰ
|
# ±£Ö¤²»Í¬µÄ×°±¸¼¼Äܲ»»áÓÐÏàͬµÄЧ¹û£¬ Ч¹ûÊýÖµµÄË¥¼õÊǸù¾ÝÏàͬ¼¼ÄܸöÊý¼ÆËã¶ø²»ÊÇЧ¹û¸öÊý 1-pow((1-³õʼֵ),Ïàͬ¼¼ÄܸöÊý)
|
def FindSuperEquipSkills(gameObj):
|
skillsDict = {}
|
if gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
return skillsDict
|
|
equipPack = gameObj.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
for i in xrange(equipPack.GetCount()):
|
curEquip = equipPack.GetAt(i)
|
|
if not curEquip or curEquip.IsEmpty():
|
continue
|
|
if curEquip.GetAddSkillCount() <= 0:
|
continue
|
|
if curEquip.GetAddSkill(0) == 0:
|
#ÎÞ¼¼ÄÜ
|
continue
|
|
itemSkillIDList = ItemCommon.GetItemSkillIDList(curEquip)
|
for skillID in itemSkillIDList:
|
skillsDict[skillID] = skillsDict.get(skillID, 0) + 1
|
|
skillManager = gameObj.GetSkillManager()
|
for skillID in PyGameData.EquipItemSkillIDList:
|
hasSkill = skillManager.FindSkillBySkillTypeID(skillID)
|
if skillID in skillsDict:
|
if not hasSkill:
|
skillManager.LVUpSkillBySkillTypeID(skillID)
|
#GameWorld.DebugLog("ѧϰװ±¸¼¼ÄÜ: %s" % skillID, gameObj.GetPlayerID())
|
else:
|
if hasSkill:
|
skillManager.DeleteSkillBySkillTypeID(skillID)
|
#GameWorld.DebugLog("ɾ³ý×°±¸¼¼ÄÜ: %s" % skillID, gameObj.GetPlayerID())
|
|
return skillsDict
|
|
# ĬÈÏÇé¿öÏ ±»¶¯²»Ó¦¸ÃÔÙ´¥·¢£¨»ò¼ÓÇ¿£©±»¶¯¼¼ÄÜ£¬»áÔì³É¶îÍâ´¥·¢»òÕßËÀÑ»·
|
# µ«Ò²ÓÐÒ»Ð©ÌØÊâÇé¿ö ·ÅÔÚ´Ë´¦¹ýÂË
|
def PassPassiveLimit(useSkill):
|
# ÈçׯÉÕÊDZ»¶¯¼¼ÄÜ µ«¿ÉÒÔ±»²»¶ÏµÄÇ¿»¯
|
if useSkill.GetSkillType() == ChConfig.Def_SkillType_PassiveLstDepBuff:
|
return True
|
|
if useSkill.GetFuncType() == ChConfig.Def_SkillFuncType_PassiveSkillWithSP:
|
# ÓÐר¾«µÄ±»¶¯¼¼ÄÜ£¬¿ÉÒÔÔٴδ¥·¢±»¶¯Ð§¹û
|
return True
|
return False
|
|
|
# ±»¶¯¼¼ÄܸıäÖµ ÎÞÌõ¼þÏÞÖÆ ´¿È¡Öµ
|
def GetPassiveSkillValueByTriggerTypeEx(attacker, defender, connSkill, triggerType):
|
attacker = FindRealAttacker(attacker)
|
if not attacker:
|
return 0
|
|
passiveEff = GetPassiveEffManager().GetPassiveEff(attacker)
|
if not passiveEff:
|
return 0
|
connSkillID = connSkill.GetSkillTypeID() if connSkill else 0
|
skills = passiveEff.GetPassiveSkillsByTriggerType(triggerType, connSkill)
|
if not skills:
|
return 0
|
|
curValue = 0
|
|
for skillTypeID, effectID in skills:
|
if connSkillID == skillTypeID:
|
continue
|
curSkill = attacker.GetSkillManager().FindSkillBySkillTypeID(skillTypeID)
|
if not curSkill:
|
continue
|
|
effect = SkillCommon.GetSkillEffectByEffectID(curSkill, effectID)
|
if not effect:
|
continue
|
pyName = "PassiveSkill_%s" % effectID
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "CheckCanHappen"))
|
|
# Ìõ¼þ²»Âú×ã
|
if callFunc and not callFunc(attacker, defender, effect, curSkill):
|
continue
|
|
callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "GetValue"))
|
if callFunc is None:
|
continue
|
|
curValue += callFunc(attacker, defender, effect, skillTypeID)
|
|
return curValue
|