10019 【砍树】回合战斗(增加灵兽协同攻击支持;增加灵兽释放技能触发被动;增加精怪复活方式;被动触发的技能造成伤害改为不吸血;)
| | |
| | | if not hurtValue:
|
| | | return
|
| | |
|
| | | if curSkill and SkillCommon.isPassiveSkill(curSkill):
|
| | | #GameWorld.DebugLog(" 被动技能不吸血: skillID=%s" % curSkill.GetSkillID())
|
| | | return
|
| | | |
| | | if atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline):
|
| | | pass
|
| | | else:
|
| | |
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_SkillSuccess, tick)
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_SkillSuccessExpend, tick)
|
| | |
|
| | | if PetControl.IsPetNPC(attacker):
|
| | | petOwner = PetControl.GetPetNPCOwner(attacker)
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(petOwner, defender, curSkill, ChConfig.TriggerType_SkillSuccessPet, tick)
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | | FBLogic.DoOverNPCAttackSuccess(curNPC, target, tick)
|
| | |
|
| | | #被动技能触放不再处理,避免死循环
|
| | | if SkillCommon.GetUsingPassiveSkill(curNPC):
|
| | | OnHurtTypeTriggerPassiveSkill(curNPC, target, curSkill, tick)
|
| | | return True
|
| | | |
| | | # 灵为玩家的替身需要走此逻辑
|
| | | UseSkillOver(curNPC, target, curSkill, tick)
|
| | | return True
|
| | |
| | | # 回合战斗复活类型 |
| | | ( |
| | | RebornType_PetSkill, |
| | | ) = range(1, 1 + 1) |
| | | RebornType_ElfSkill, |
| | | ) = range(1, 1 + 2) |
| | | |
| | | def GetObjName(gameObj): |
| | | objName = gameObj.GetName() |
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack) |
| | | return True |
| | | |
| | | def GetEnemyCureDefPer(gameObj): |
| | | ## 获取敌对方弱化治疗值 |
| | | def GetEnemyObj(gameObj): |
| | | ## 获取回合对手实例 |
| | | tagID = gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnEnemyID) |
| | | if not tagID: |
| | | return 0 |
| | | tagObj = GameWorld.FindNPCByID(tagID) |
| | | return |
| | | return GameWorld.FindNPCByID(tagID) |
| | | |
| | | def GetEnemyCureDefPer(gameObj): |
| | | ## 获取敌对方弱化治疗值 |
| | | tagObj = GetEnemyObj(gameObj) |
| | | if not tagObj: |
| | | return 0 |
| | | cureDefPer = GameObj.GetCureDefPer(tagObj) |
| | |
| | | if curRebornCount >= rebornCountMax: |
| | | GameWorld.DebugLog("%s 已经超过复活次数,不能再复活! curID=%s,curRebornCount=%s" % (GetObjName(gameObj), gameObj.GetID(), curRebornCount)) |
| | | return |
| | | |
| | | |
| | | # 自己技能 - 如精怪 |
| | | skillManager = gameObj.GetSkillManager() |
| | | for skillIndex in range(skillManager.GetSkillCount()): |
| | | skill = skillManager.GetSkillByIndex(skillIndex) |
| | | if skill.GetSkillType() != ChConfig.Def_SkillType_Revive: |
| | | continue |
| | | if skill.GetRemainTime(): |
| | | continue |
| | | if skill.GetFuncType() == ChConfig.Def_SkillFuncType_ElfSkill: |
| | | return RebornType_ElfSkill, skill |
| | | |
| | | # 检查是否有灵宠复活技能 |
| | | for index in range(gameObj.GetSummonCount()): |
| | | curSummonNPC = gameObj.GetSummonNPCAt(index) |
| | |
| | | hpPer = skill.GetEffect(0).GetEffectValue(0) |
| | | rebornValue1 = petNPC.GetID() |
| | | rebornValue2 = skill.GetSkillID() |
| | | elif rebornType == RebornType_ElfSkill: |
| | | skill = rebornTypeInfo[1] |
| | | skill.SetRemainTime(skill.GetCoolDownTime()) |
| | | hpPer = skill.GetEffect(0).GetEffectValue(0) |
| | | rebornValue1 = skill.GetSkillID() |
| | | |
| | | rebornCount = gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnRebornCount) + 1 |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnRebornCount, rebornCount) |
| | |
| | | gameObj.ChangeAction(IPY_GameWorld.laNPCNull) |
| | | |
| | | curHP = GameObj.GetHP(gameObj) |
| | | GameWorld.DebugLog("复活 %s: rebornType=%s,objID=%s,hpPer=%s,curHP=%s,rebornCount=%s" % (objName, rebornType, objID, hpPer, curHP, rebornCount)) |
| | | GameWorld.DebugLog("复活 %s: rebornType=%s,objID=%s,hpPer=%s,curHP=%s,rebornCount=%s,rebornValue1=%s,rebornValue2=%s" |
| | | % (objName, rebornType, objID, hpPer, curHP, rebornCount, rebornValue1, rebornValue2)) |
| | | |
| | | playerID = gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightID) |
| | | if not playerID: |
| | |
| | | TriggerType_Combo, # 连击触发 93
|
| | | TriggerType_AtkBackBef, # 反击前触发 94
|
| | | TriggerType_AtkBackAft, # 反击后触发 95
|
| | | ) = range(1, 96)
|
| | | TriggerType_SkillSuccessPet, # 灵宠技能释放成功都可触发 96
|
| | | ) = range(1, 97)
|
| | |
|
| | |
|
| | | #不可以佩戴翅膀的地图
|
| | |
| | | Def_SkillFuncType_EquipPassiveSkill, #18 装备被动技能
|
| | | Def_SkillFuncType_LianTiSkill, #19 炼体技能
|
| | | Def_SkillFuncType_ShentongSkill, #20 神通技能
|
| | | ) = range(21)
|
| | | Def_SkillFuncType_ElfSkill, #21 精怪技能
|
| | | ) = range(22)
|
| | |
|
| | | # 受技能效果完全影响的怪, 对应 Def_BattleRelationType_CommNoBoss
|
| | | Def_SkillAttack_NPCIsBoss = [ Def_NPCType_Ogre_Normal , #平凡小怪 0 # c++ 定义为普通NPC视野刷新
|
| | |
| | | # @return 返回值. 是否通过检查
|
| | | # @remarks 概率相关, 这个事件是否能够出现
|
| | | def CanHappen(rate, maxRate=ShareDefine.Def_MaxRateValue):
|
| | | if rate >= maxRate:
|
| | | return 1
|
| | | if random.randint(0, maxRate -1) < rate:
|
| | | return 1
|
| | |
|
| | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | def GetFightPet(curObj, placeNum=1):
|
| | | ## 获取对应战斗位置灵宠实例
|
| | | for index in range(curObj.GetSummonCount()):
|
| | | curSummonNPC = curObj.GetSummonNPCAt(index)
|
| | | if not IsPetNPC(curSummonNPC):
|
| | | continue
|
| | | if placeNum and placeNum == curSummonNPC.GetDictByKey(ChConfig.Def_Obj_Dict_FightPetPlaceNum):
|
| | | return curSummonNPC
|
| | | return
|
| | |
|
| | | def CalloutFightPet(curObj, petCacheInfo):
|
| | | ## 召唤出战上阵的灵宠
|
| | | # @param curObj: 灵宠所属战斗实例
|
| | |
| | |
|
| | | # 击晕触发
|
| | | if curSkill.GetSkillTypeID() == ChConfig.Def_SkillID_AtkerFaint:
|
| | | GameWorld.DebugLog(" 被击晕: curID=%s,atkID=%s" % (curObj.GetID(), buffOwner.GetID()))
|
| | | GameWorld.DebugLog(" 击晕目标: atkID=%s,curID=%s" % (buffOwner.GetID(), curObj.GetID()))
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(buffOwner, curObj, None, ChConfig.TriggerType_Faint, tick)
|
| | |
|
| | | #是否是持续性技能
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.GameSkills.SkillModule_46
|
| | | #
|
| | | # @todo:命令第一位置灵兽立即使用一次技能
|
| | | # @author hxp
|
| | | # @date 2024-02-01
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 命令第一位置灵兽立即使用一次技能(具体效果由灵兽技能决定),回合制适用
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-02-01 15:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import PetControl
|
| | | import SkillCommon
|
| | | import TurnAttack
|
| | | import BaseAttack
|
| | | import AICommon
|
| | |
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | if not attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline):
|
| | | return
|
| | | |
| | | # 默认第一位置灵兽强制使用技能1,并重新进入CD
|
| | | curPet = PetControl.GetFightPet(attacker, 1)
|
| | | if not curPet:
|
| | | return
|
| | | |
| | | tagObj = TurnAttack.GetEnemyObj(attacker)
|
| | | if not tagObj:
|
| | | return
|
| | | |
| | | useSkill = None
|
| | | skillManager = curPet.GetSkillManager()
|
| | | for index in range(0, skillManager.GetSkillCount()):
|
| | | skill = skillManager.GetSkillByIndex(index)
|
| | | #已经到尾部了
|
| | | if not skill or skill.GetSkillTypeID() == 0:
|
| | | break
|
| | | |
| | | if skill.GetSkillType() == ChConfig.Def_SkillType_Revive:
|
| | | #复活技能单独处理
|
| | | continue
|
| | | |
| | | #被动技能不释放
|
| | | if SkillCommon.isPassiveSkill(skill):
|
| | | continue
|
| | | |
| | | skill.SetRemainTime(0)
|
| | | useSkill = skill
|
| | | break
|
| | | |
| | | if not useSkill:
|
| | | return
|
| | | |
| | | BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill) |
| | | tagDist = 0
|
| | | return AICommon.DoNPCUseSkill(curPet, tagObj, useSkill, tagDist, tick)
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_4112
|
| | | #
|
| | | # @todo:击晕触发技能
|
| | | # @author hxp
|
| | | # @date 2024-02-01
|
| | | # @version 1.0
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-02-01 15:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5001
|
| | | #
|
| | | # @todo:连击触发技能
|
| | | # @author hxp
|
| | | # @date 2024-02-01
|
| | | # @version 1.0
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-02-01 15:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5002
|
| | | #
|
| | | # @todo:反击前触发技能
|
| | | # @author hxp
|
| | | # @date 2024-02-01
|
| | | # @version 1.0
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-02-01 15:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5003
|
| | | #
|
| | | # @todo:反击后触发技能
|
| | | # @author hxp
|
| | | # @date 2024-02-01
|
| | | # @version 1.0
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-02-01 15:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5005
|
| | | #
|
| | | # @todo:灵宠释放技能后触发
|
| | | # @author hxp
|
| | | # @date 2024-02-01
|
| | | # @version 1.0
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-02-01 15:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
| | |
| | | 5002:ChConfig.TriggerType_AtkBackBef, # 反击前触发 94
|
| | | 5003:ChConfig.TriggerType_AtkBackAft, # 反击后触发 95
|
| | | 5004:ChConfig.TriggerType_BeAttackOver, # 被攻击后触发 20
|
| | | 5005:ChConfig.TriggerType_SkillSuccessPet, # 灵宠技能释放成功都可触发 96
|
| | | }
|
| | | return tdict.get(effectID, -1)
|
| | | #===========================================================================
|
| | |
| | | # 那么ntElf执行人物的伤害计算和被动触发效果
|
| | | # 被动技能只处理玩家,宠物,和灵
|
| | | def FindRealAttacker(attacker):
|
| | | if not attacker:
|
| | | return
|
| | | if attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline):
|
| | | # 回合制下都代表自己
|
| | | return attacker
|
| | |
| | | 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)
|
| | | reduceSkillCDPer = PlayerControl.GetReduceSkillCDPer(attacker) if attacker.GetGameObjType() == IPY_GameWorld.gotPlayer else 0
|
| | | SkillCommon.SetSkillRemainTime(curSkill, reduceSkillCDPer, tick, attacker)
|
| | | return result
|
| | |
|
| | | skillAim = GetSkillFireAim(curSkill)
|
| | | affectTag = GetSkillAffectTag(curSkill)
|
| | | GameWorld.DebugLog("释放被动触发技能 : atkID=%s,skillID=%s(%s)" % (attacker.GetID(), curSkill.GetSkillID(), curSkill.GetSkillName()))
|
| | | skillID = curSkill.GetSkillID()
|
| | | GameWorld.DebugLog("释放被动触发技能 : atkID=%s,skillID=%s(%s)" % (attacker.GetID(), skillID, curSkill.GetSkillName()))
|
| | |
|
| | | if skillAim == ChConfig.Def_UseSkillAim_None:
|
| | | if curSkill.GetSkillType() in ChConfig.Def_CanAttackSkill_List and affectTag != ChConfig.Def_UseSkillTag_Self:
|
| | |
| | | # 指定目标为自己
|
| | | result = DoLogic_UseSkill(attacker, attacker, curSkill, tick, isEnhanceSkill=isEnhanceSkill)
|
| | |
|
| | | GameWorld.DebugLog("触发结果-----------%s"%result)
|
| | | GameWorld.DebugLog("触发结果-----------skillID=%s, %s" % (skillID, result))
|
| | | return result
|
| | |
|
| | |
|