6603 【后端】【2.0】增加新版的sp和被动技能 - 4012状态判定增加 查找是否释放者
| | |
| | | Def_Skill_Effect_ProcessAttack = 1314 # 间隔性攻击,A值为攻击次数,B值为是否广播客户端
|
| | | Def_Skill_Effect_BuffTick = 9999 #BUFF的时间处理间隔
|
| | | Def_Skill_Effect_BurnToAddHP = 1091 #buff中灼烧伤害转化吸血给 放灼烧者
|
| | | Def_Skill_Effect_ProBloodPer = 4505 #buff中中毒伤害百分比增加(给受害者的buff)
|
| | |
|
| | |
|
| | | #写死的技能效果ID------------NPC专用
|
| | | Def_Skill_Effect_AttackMove = 2100 # NPC位移战斗
|
| | |
| | | Def_SkillType_Aura , #光环技能 10
|
| | | Def_SkillType_Summon , #召唤 13
|
| | | ]
|
| | | |
| | | # 玩家独有的,NPC没有这些接口
|
| | | Def_BuffType_OnlyPlayer = [IPY_GameWorld.bfIncBuff, IPY_GameWorld.btPassiveBuf, IPY_GameWorld.bfEquipBuff, IPY_GameWorld.bfMapBuff]
|
| | |
|
| | | # Buff层级增减定义
|
| | | Def_BuffLayer_Add = 0 # 每次触发层级递增
|
| | |
| | | import GMCommon
|
| | | import FamilyRobBoss
|
| | | import ShareDefine
|
| | | import ChConfig
|
| | |
|
| | | import random
|
| | | #---------------------------------------------------------------------
|
| | |
| | |
|
| | | def PrintNPCBuff(curPlayer, curNPC):
|
| | | for buffType in range(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax):
|
| | | if buffType in [IPY_GameWorld.bfIncBuff, IPY_GameWorld.btPassiveBuf, IPY_GameWorld.bfEquipBuff, IPY_GameWorld.bfMapBuff]:
|
| | | if buffType in ChConfig.Def_BuffType_OnlyPlayer:
|
| | | continue
|
| | | PrintBuffState(curPlayer, curNPC, buffType)
|
| | | return
|
| | |
| | | import ChConfig
|
| | | import IPY_GameWorld
|
| | | import IpyGameDataPY
|
| | | import SkillCommon
|
| | |
|
| | | # 关于血量的函数这里只包装最简单的超DWORD处理
|
| | |
|
| | |
| | | # # 目前当目标身上多个buff都有同一效果时(如定身),在一个buff消失时会解除该状态
|
| | | # # 故该状态标记仅为一个非精确的标记,应用中请注意!!!(当且仅当多个buff有同一个效果时会提前结束该状态)
|
| | | #===============================================================================
|
| | | def GetPyPlayerState(gameObj, pyState):
|
| | | def GetPyPlayerState(gameObj, pyState, ownerID = 0, ownerType = 0):
|
| | | curState = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_CurState)
|
| | |
|
| | | state = curState & pow(2, pyState)
|
| | | |
| | | if state and ownerID:
|
| | | # 进一步判断是否释放者
|
| | | return True if IsInStateEffectByOwner(gameObj, ChConfig.Def_Skill_Effect_BuffState, pyState, ownerID, ownerType) else False
|
| | | return state
|
| | |
|
| | | # 大于等于2个状态 则不清理状态
|
| | | def IsInStateEffectByOwner(curObj, effectID, stateType, ownerID, ownerType):
|
| | | |
| | | for buffType in xrange(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax):
|
| | | if buffType in ChConfig.Def_BuffType_OnlyPlayer:
|
| | | continue
|
| | | |
| | | buffTuple = SkillCommon.GetBuffManagerByBuffType(curObj, buffType)
|
| | | #通过类型获取目标的buff管理器为空,则跳出
|
| | | if buffTuple == ():
|
| | | continue
|
| | | |
| | | buffManager = buffTuple[0]
|
| | | |
| | | for i in range(buffManager.GetEffectCount()):
|
| | | effect = buffManager.GetEffect(i)
|
| | | if not effect:
|
| | | continue
|
| | | |
| | | if effect.GetEffectID() != effectID:
|
| | | continue
|
| | | |
| | | if effect.GetEffectValue(0) != stateType:
|
| | | continue
|
| | | |
| | | if buffManager.GetEffectOwnerID() != ownerID:
|
| | | continue
|
| | | |
| | | if buffManager.GetEffectOwnerType() != ownerType:
|
| | | continue
|
| | | |
| | | return True
|
| | | return False
|
| | |
|
| | |
|
| | | def ClearPyPlayerState(gameObj):
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_CurState, 0)
|
| | | return
|
| | |
| | | layer = max(curBuff.GetLayer(), 1)
|
| | | #单次伤害, 毒有层级的情况
|
| | | singleDecHP = curBuff.GetValue()*layer
|
| | | #hurtPer = FindBuffPer(defender, curBuff) # 找到另外一个buff对中毒的伤害加成
|
| | | |
| | | #singleDecHP = int((hurtPer + ChConfig.Def_MaxRateValue)*1.0/ChConfig.Def_MaxRateValue*singleDecHP)
|
| | | #GameWorld.DebugLog("1033---------%s-%s-%s-%s"%(curBuff.GetValue(), layer, hurtPer, singleDecHP ) )
|
| | | #buff拥有者
|
| | | buffOwner = SkillCommon.GetBuffOwner(curBuff)
|
| | |
| | | return
|
| | |
|
| | |
|
| | |
|
| | | # 找到对应加成伤害的毒
|
| | | def FindBuffPer(curObj, curBuff):
|
| | | ownerID = curBuff.GetOwnerID()
|
| | | ownerType = curBuff.GetOwnerType()
|
| | | |
| | | if not ownerType:
|
| | | return 0
|
| | | |
| | | buffManager = curObj.GetDeBuffState()
|
| | | curEffect, plusValue, skillID = BuffSkill.FindBuffEffectByOwnertID(buffManager, ChConfig.Def_Skill_Effect_ProBloodPer, ownerID, ownerType)
|
| | | if not curEffect:
|
| | | return 0
|
| | | |
| | | # buff相同归属者的指定buff才有伤害加成
|
| | | for i in range(buffManager.GetBuffCount()):
|
| | | findBuff = buffManager.GetBuff(i)
|
| | | if findBuff.GetBuffID() != skillID:
|
| | | continue
|
| | | if findBuff.GetOwnerID() != ownerID:
|
| | | continue
|
| | | |
| | | if curEffect.GetEffectValue(1) == curBuff.GetBuffID():
|
| | | return curEffect.GetEffectValue(0)
|
| | |
|
| | | return 0
|
| | |
|
| | |
|
| | |
|
| | |
| | | def CanDelStateEffect(curObj, effectID, stateType):
|
| | | cnt = 0
|
| | | for buffType in xrange(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax):
|
| | | if buffType in [IPY_GameWorld.bfIncBuff, IPY_GameWorld.btPassiveBuf, IPY_GameWorld.bfEquipBuff, IPY_GameWorld.bfMapBuff]:
|
| | | if buffType in ChConfig.Def_BuffType_OnlyPlayer:
|
| | | continue
|
| | |
|
| | | buffTuple = SkillCommon.GetBuffManagerByBuffType(curObj, buffType)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #
|
| | | ##@package
|
| | | #
|
| | | # @todo: buff中攻击处于XX状态的目标附加技能伤害
|
| | | #
|
| | | # @author: Alee
|
| | | # @date 2019-5-10 下午03:56:42
|
| | | # @version 1.0
|
| | | #
|
| | | # @note: |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameObj
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
|
| | | |
| | | ownerID, ownerType = 0, 0
|
| | | if passiveEffect.GetEffectValue(2):
|
| | | ownerID, ownerType = attacker.GetID(), attacker.GetGameObjType()
|
| | | |
| | | if not GameObj.GetPyPlayerState(defender, passiveEffect.GetEffectValue(1), ownerID, ownerType):
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | |
|
| | | def GetValue(attacker, defender, passiveEffect):
|
| | | return passiveEffect.GetEffectValue(0)
|
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #
|
| | | # @todo: |
| | | ##@package
|
| | | #
|
| | | # @todo: 攻击处于XX状态下的目标后触发被动技能
|
| | | #
|
| | | # @author: Alee
|
| | | # @date 2018-1-9 下午09:39:37
|
| | | # @date 2019-5-10 下午03:44:42
|
| | | # @version 1.0
|
| | | #
|
| | | # @note:
|
| | |
| | | import GameObj
|
| | | import PlayerControl
|
| | |
|
| | | # 目标某个状态时触发
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | if not defender:
|
| | | return False
|
| | |
|
| | | if GameObj.GetPyPlayerState(defender, effect.GetEffectValue(1)):#ChConfig.Def_PlayerState_Stun):
|
| | | #GameWorld.DebugLog("状态触发----%s"%effect.GetEffectValue(1))
|
| | | return True
|
| | |
|
| | | return False
|
| | | ownerID, ownerType = 0, 0
|
| | | if effect.GetEffectValue(1):
|
| | | ownerID, ownerType = attacker.GetID(), attacker.GetGameObjType()
|
| | |
|
| | | # 增加伤害值
|
| | | def GetValue(attacker, defender, effect):
|
| | | return effect.GetEffectValue(0)
|
| | | if not GameObj.GetPyPlayerState(defender, effect.GetEffectValue(0), ownerID, ownerType):
|
| | | return False
|
| | |
|
| | | return True |
| | |
| | | if not defender:
|
| | | return False
|
| | |
|
| | | if GameObj.GetPyPlayerState(defender, effect.GetEffectValue(1)):#ChConfig.Def_PlayerState_Stun):
|
| | | GameWorld.DebugLog("状态触发----%s"%effect.GetEffectValue(1))
|
| | | ownerID, ownerType = 0, 0
|
| | | if effect.GetEffectValue(2):
|
| | | ownerID, ownerType = attacker.GetID(), attacker.GetGameObjType()
|
| | | |
| | | if GameObj.GetPyPlayerState(defender, effect.GetEffectValue(1), ownerID, ownerType):#ChConfig.Def_PlayerState_Stun):
|
| | | #GameWorld.DebugLog("状态触发----%s"%effect.GetEffectValue(1))
|
| | | return True
|
| | |
|
| | | return False
|
| | |
| | |
|
| | | 4000:ChConfig.TriggerType_BuffState, # 进入4012的某个状态触发技能 2
|
| | | 4001:ChConfig.TriggerType_TagBuffState, # 目标进入4012的某个状态触发技能 2
|
| | | 4003:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | | 4004:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | | 4005:ChConfig.TriggerType_AttackAddSkillPer, # 所有攻击伤害(SkillPer)增加,含普攻,计算时 5
|
| | | 4006:ChConfig.TriggerType_SuperHit, # 暴击时 触发技能6,
|
| | |
| | | 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消失
|