10019 【砍树】回合战斗(增加神通部分技能支持;增加部分属性;优化伤血公式;)
1. 增加强化灵兽(属性ID 217)、弱化灵兽属性(属性ID 218);
2. 去除反击必命中设定;优化反击灵兽协同释放方式46支持配置是否重新进入技能CD;
3. 细化回合战斗伤血公式分类;技能表HurtType字段增加十位数表示原攻击类型(1-物理攻击;2-魔法攻击;新增3-额外攻击),个位数保留目前设定;
4. 增加xp道法攻击被动增伤,道法技能释放被动触发;
5. NPC支持反弹伤害;
6. 灵宠释放技能、灵宠攻击触发被动支持区分(每次、每只独立首次,所有灵宠共享首次)
7. 治疗支持强化治疗、弱化治疗属性;区分主角主动治疗、灵宠治疗;强化灵兽及弱化灵兽属性对灵宠治疗有效;
8. 技能释放方式增加 恢复妖气-47;扣除妖气-48;
| | |
| | | Def_Effect_SuckHPDefPer = 214 # 抗吸血比率
|
| | | Def_Effect_CurePer = 215 # 强化治疗
|
| | | Def_Effect_CureDefPer = 216 # 弱化治疗
|
| | | Def_Effect_PetStrengthenPer = 217 # 强化灵兽
|
| | | Def_Effect_PetWeakenPer = 218 # 弱化灵兽
|
| | |
|
| | | #增加%d物理伤害值,其中a值为伤害值
|
| | | Def_Effect_AddAtk = 1005
|
| | |
| | | CDBPlayerRefresh_Xiantao, # 仙桃 254
|
| | | CDBPlayerRefresh_CurePer, # 强化治疗 255
|
| | | CDBPlayerRefresh_CureDefPer, # 弱化治疗 256
|
| | | ) = range(146, 257)
|
| | | CDBPlayerRefresh_PetStrengthenPer, # 弱化灵兽 257
|
| | | CDBPlayerRefresh_PetWeakenPer, # 弱化灵兽 258
|
| | | ) = range(146, 259)
|
| | |
|
| | | TYPE_Price_Gold_Paper_Money = 5 # 金钱类型,(先用礼券,再用金子)
|
| | | TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
|
| | |
| | | GameFuncID_FaQi = 199 # 法器
|
| | | GameFuncID_LianTi = 207 # 炼体
|
| | | GameFuncID_Championship = 210 # 排位
|
| | | GameFuncID_MineArea = 223 # 福地
|
| | | GameFuncID_MineArea = 223 # 福地
|
| | | # 以下为暂时无用的
|
| | | GameFuncID_Truck = 33 # 运镖
|
| | | GameFuncID_RunDaily = 34 # 日常跑环
|
| | |
| | | # @remarks 获取攻击类型
|
| | | def GetBattleType(attack, attackUseSkill):
|
| | | # GetHurtType用法改成 pvp pve标识
|
| | | return IPY_GameWorld.ghtPhy
|
| | | return SkillCommon.GetBattleType(attackUseSkill)
|
| | | #return IPY_GameWorld.ghtPhy
|
| | | # #---技能攻击, 读表获取攻击类型---
|
| | | # if attackUseSkill != None:
|
| | | # return attackUseSkill.GetHurtType()
|
| | |
| | | mustHit = True
|
| | | GameWorld.DebugLog(" 灵宠必命中")
|
| | | petNPCOwner = PetControl.GetPetNPCOwner(atkObj)
|
| | | if turnFightTimeline:
|
| | | if atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnBattleType) == ChConfig.TurnBattleType_AtkBack:
|
| | | mustHit = True
|
| | | GameWorld.DebugLog(" 反击必命中: atkID=%s,defID=%s" % (atkObj.GetID(), defObj.GetID()))
|
| | | #去除反击必命中设定
|
| | | #if turnFightTimeline:
|
| | | # if atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnBattleType) == ChConfig.TurnBattleType_AtkBack:
|
| | | # mustHit = True
|
| | | # GameWorld.DebugLog(" 反击必命中: atkID=%s,defID=%s" % (atkObj.GetID(), defObj.GetID()))
|
| | | if IsHappenStateByType(happenState, ChConfig.Def_Skill_HappenState_HitOn):
|
| | | mustHit = True
|
| | | GameWorld.DebugLog(" 技能必命中: skillID=%s" % skillID)
|
| | |
| | | # 印记增加的技能伤害,用于飘字
|
| | | atkSkillPerYinji = PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddSkillPerYinji)
|
| | | atkSkillPer += atkSkillPerYinji
|
| | | |
| | | if curSkill and curSkill.GetXP():
|
| | | atkSkillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_XPAttackAddSkillPer)
|
| | | |
| | | if hurtType == ChConfig.Def_HurtType_SuperHit:
|
| | | # 暴击增加技能伤害
|
| | | atkSkillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SuperHitSkillPer)
|
| | |
| | | aMinAtk = petNPCOwner.GetMinAtk() * summonAtkPer # 攻击方最小攻击
|
| | | aMaxAtk = petNPCOwner.GetMaxAtk() * summonAtkPer # 攻击方最大攻击
|
| | | #GameWorld.DebugLog("灵宠攻击,直接取主人攻击力: %s ~ %s, 自己: %s ~ %s" % (aMinAtk, aMaxAtk, atkObj.GetMinAtk(), atkObj.GetMaxAtk()))
|
| | | |
| | | enemyObj = None
|
| | | aPetStrengthenPer, dPetWeakenPer = 0, 0 # 强化灵兽, 弱化灵兽
|
| | | if turnFightTimeline:
|
| | | if petNPCOwner:
|
| | | aPetStrengthenPer = GameObj.GetPetStrengthenPer(petNPCOwner)
|
| | | |
| | | enemyObj = TurnAttack.GetEnemyObj(petNPCOwner)
|
| | | if enemyObj:
|
| | | dPetWeakenPer = GameObj.GetPetWeakenPer(enemyObj)
|
| | | |
| | | aIceAtk = atkObj.GetIceAtk() # 冰攻, 元素真伤, 玩家及NPC通用
|
| | | aIceAtk += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AddIceAtk)
|
| | | #------- 防守方
|
| | |
| | |
|
| | | # 回合战斗
|
| | | if turnFightTimeline:
|
| | | hurtFormulaKey = "TurnFight"
|
| | | hurtFormulaKey = "TurnFight_%sV%s_%s" % (atkStateMark, defStateMark, atkType)
|
| | |
|
| | | if hurtFormulaKey not in hurtDist:
|
| | | GameWorld.ErrLog("CalcAttackValue.txt 伤害公式未配置, key=%s" % (hurtFormulaKey))
|
| | | GameWorld.ErrLog("CalcAttackValue.txt 伤害公式未配置, key=%s, skillID=%s" % (hurtFormulaKey, skillID))
|
| | | return 0, ChConfig.Def_HurtType_Miss
|
| | |
|
| | | if atkwargs.get('hurtFormulaKey', None):
|
| | |
| | | CalcBounceHP(atkObj, defObj, resultHurtType.LostHP, resultHurtType.HurtType, curSkill)
|
| | | #吸血
|
| | | CalcSuckBlood(atkObj, defObj, curSkill, resultHurtType, tick)
|
| | | |
| | | if atkObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | |
| | | turnFightTimeline = atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline)
|
| | | if atkObj.GetGameObjType() == IPY_GameWorld.gotPlayer or turnFightTimeline:
|
| | | # 记录最后一次伤害值
|
| | | GameObj.SetLastHurtValue(atkObj, resultHurtType.RealHurtHP)
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
| | |
| | | if not atkObj.GetCanAttack():
|
| | | return
|
| | |
|
| | | if GameObj.GetHP(atkObj) <= 1:
|
| | | return
|
| | | |
| | | #只有玩家会反弹
|
| | | defObjType = defObj.GetGameObjType()
|
| | | if defObjType != IPY_GameWorld.gotPlayer:
|
| | | return
|
| | | |
| | | #boss境界压制不反弹
|
| | | atkObjType = atkObj.GetGameObjType()
|
| | | aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) # 获取境界
|
| | | if atkObjType == IPY_GameWorld.gotNPC and ChConfig.IsGameBoss(atkObj) and aRealmLV > dRealmLV:
|
| | | aRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", aRealmLV)
|
| | | dRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", dRealmLV)
|
| | | aRealmLVLarge = aRealmIpyData.GetLvLarge() if aRealmIpyData else 0
|
| | | dRealmLVLarge = dRealmIpyData.GetLvLarge() if dRealmIpyData else 0
|
| | | if aRealmLVLarge > dRealmLVLarge:
|
| | | #GameWorld.DebugLog("boss大境界压制玩家,不反弹: aRealmLV=%s,dRealmLV=%s,aRealmLVLarge=%s,dRealmLVLarge=%s" % (aRealmLV, dRealmLV, aRealmLVLarge, dRealmLVLarge))
|
| | | return
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | #boss境界压制不反弹
|
| | | atkObjType = atkObj.GetGameObjType()
|
| | | aRealmLV, dRealmLV = GetPVERealmLVs(atkObj, defObj, atkObjType, defObjType) # 获取境界
|
| | | if atkObjType == IPY_GameWorld.gotNPC and ChConfig.IsGameBoss(atkObj) and aRealmLV > dRealmLV:
|
| | | aRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", aRealmLV)
|
| | | dRealmIpyData = IpyGameDataPY.GetIpyGameDataNotLog("Realm", dRealmLV)
|
| | | aRealmLVLarge = aRealmIpyData.GetLvLarge() if aRealmIpyData else 0
|
| | | dRealmLVLarge = dRealmIpyData.GetLvLarge() if dRealmIpyData else 0
|
| | | if aRealmLVLarge > dRealmLVLarge:
|
| | | #GameWorld.DebugLog("boss大境界压制玩家,不反弹: aRealmLV=%s,dRealmLV=%s,aRealmLVLarge=%s,dRealmLVLarge=%s" % (aRealmLV, dRealmLV, aRealmLVLarge, dRealmLVLarge))
|
| | | return
|
| | |
|
| | | if GameObj.GetHP(atkObj) == 1:
|
| | | return
|
| | | |
| | | ##摸怪次数判断
|
| | | #if not CheckAttackNPCByCnt(defObj, atkObj, False):
|
| | | # GameWorld.DebugLog("不能攻击,不反弹")
|
| | | # return
|
| | | #杀怪次数判断
|
| | | if not CheckKillNPCByCnt(defObj, atkObj, False) and not NPCHurtManager.IsAssistPlayer(defObj.GetPlayerID(), atkObj):
|
| | | #GameWorld.DebugLog("不能攻击,不反弹")
|
| | | return
|
| | | ##摸怪次数判断
|
| | | #if not CheckAttackNPCByCnt(defObj, atkObj, False):
|
| | | # GameWorld.DebugLog("不能攻击,不反弹")
|
| | | # return
|
| | | #杀怪次数判断
|
| | | if not CheckKillNPCByCnt(defObj, atkObj, False) and not NPCHurtManager.IsAssistPlayer(defObj.GetPlayerID(), atkObj):
|
| | | #GameWorld.DebugLog("不能攻击,不反弹")
|
| | | return
|
| | |
|
| | | #没有反弹退出
|
| | | defObj_DamageBackRate = defObj.GetDamageBackRate()
|
| | | defObj_DamageBackRate = GameObj.GetDamageBackRate(defObj)
|
| | | defObj_DamageBackRate += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, None, None, ChConfig.TriggerType_BounceHPPer)
|
| | | defObj_DamageBackRate += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_BounceHPPerByAttacker)
|
| | |
|
| | |
| | | bounceHP = int(bounceHP + PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, None, None, ChConfig.TriggerType_BounceHP))
|
| | | if bounceHP <= 0:
|
| | | return
|
| | | skillID = curSkill.GetSkillID() if curSkill else 0
|
| | | GameWorld.DebugLog(" 反弹: defID=%s,atkID=%s,skillID=%s,hurtValue=%s,defObj_DamageBackRate=%s,bounceHP=%s" |
| | | % (defObj.GetID(), atkObj.GetID(), skillID, hurtValue, defObj_DamageBackRate, bounceHP))
|
| | |
|
| | | bounceHP = bounceHP if bounceHP < GameObj.GetHP(atkObj) else GameObj.GetHP(atkObj) - 1
|
| | |
|
| | |
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | OnPVPDamage(defObj, bounceHP, atkObj, "Player bounce Player")
|
| | |
|
| | | ChangeHPView(atkObj, defObj, 0, bounceHP, ChConfig.Def_HurtType_BounceHurt)
|
| | | ChangeHPView(atkObj, defObj, skillID, bounceHP, ChConfig.Def_HurtType_BounceHurt)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | suckHPTotal = suckHPByPer + suckHP
|
| | | if suckHPTotal <= 0:
|
| | | return
|
| | | |
| | | skillID = curSkill.GetSkillID() if curSkill else 0
|
| | | GameObj.SetHP(atkObj, min(GameObj.GetMaxHP(atkObj), GameObj.GetHP(atkObj) + suckHPTotal), False)
|
| | |
|
| | | ChangeHPView(atkObj, None, 0, suckHPTotal, ChConfig.Def_HurtTYpe_Recovery)
|
| | | GameWorld.DebugLog(" 吸血: atkID=%s,defID=%s,最终比例=%s(%s-%s),伤血=%s,总吸血=%s(%s+%s),HP=%s" |
| | | % (atkObj.GetID(), defObj.GetID(), suckHPPerFinal, suckHPPer, suckHPDefPer, hurtValue, suckHPTotal, suckHPByPer, suckHP, GameObj.GetHP(atkObj)))
|
| | | ChangeHPView(atkObj, None, skillID, suckHPTotal, ChConfig.Def_HurtTYpe_Recovery)
|
| | | GameWorld.DebugLog(" 吸血: atkID=%s,defID=%s,最终比例=%s(%s-%s),伤血=%s,总吸血=%s(%s+%s),HP=%s,skillID=%s" |
| | | % (atkObj.GetID(), defObj.GetID(), suckHPPerFinal, suckHPPer, suckHPDefPer, hurtValue, suckHPTotal, suckHPByPer, suckHP, GameObj.GetHP(atkObj), skillID))
|
| | | return
|
| | |
|
| | | ## 攻击者回蓝逻辑
|
| | |
| | | # TriggerType_AttackOver 和 TriggerType_AttackOverPassive 根据触发的被动buff效果顺序而定
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_AttackOverPassive, tick)
|
| | |
|
| | | if curSkill and curSkill.GetXP():
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_XPAttackOver, tick)
|
| | | |
| | | else:
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(attacker, defender, curSkill, ChConfig.TriggerType_SkillOverNoAttack, tick)
|
| | |
|
| | |
| | |
|
| | | if PetControl.IsPetNPC(attacker):
|
| | | petOwner = PetControl.GetPetNPCOwner(attacker)
|
| | | petOwner.SetDict("useSkillPetID", attacker.GetID())
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(petOwner, defender, curSkill, ChConfig.TriggerType_SkillSuccessPet, tick)
|
| | | if isAtkSkill:
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(petOwner, defender, curSkill, ChConfig.TriggerType_AttackOverPet, tick)
|
| | | |
| | | # 更新状态放最后
|
| | | attacker.SetDict(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState, 1)
|
| | | petOwner.SetDict(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState, 1)
|
| | | if isAtkSkill:
|
| | | attacker.SetDict(ChConfig.Def_Obj_Dict_TurnAttackOverPetState, 1)
|
| | | petOwner.SetDict(ChConfig.Def_Obj_Dict_TurnAttackOverPetState, 1)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
| | | return |
| | | return GameWorld.FindNPCByID(tagID) |
| | | |
| | | def GetEnemyCureDefPer(gameObj): |
| | | ## 获取敌对方弱化治疗值 |
| | | tagObj = GetEnemyObj(gameObj) |
| | | if not tagObj: |
| | | return 0 |
| | | cureDefPer = GameObj.GetCureDefPer(tagObj) |
| | | #其他的... |
| | | return cureDefPer |
| | | |
| | | def GetRebornTypeInfo(gameObj): |
| | | ''' 获取可复活的方式信息 |
| | | @return: None-代表不可复活 |
| | |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnRebornCount, 0) |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnTotalHurt, 0) |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnTotalHurtEx, 0) |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState, 0) |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnAttackOverPetState, 0) |
| | | SetTimeline(gameObj, 1, 0) |
| | | faction = GameObj.GetFaction(gameObj) |
| | | GameObj.SetHPFull(gameObj, True) |
| | |
| | | return |
| | | |
| | | def __logGameObjAttr(gameObj): |
| | | GameWorld.DebugLog(" HP=%s/%s,atk=%s~%s,Def=%s,atkSpeed=%s,XP=%s/%s" |
| | | GameWorld.DebugLog(" HP=%s/%s,atk=%s~%s,Def=%s,atkSpeed=%s" |
| | | % (GameObj.GetHP(gameObj), GameObj.GetMaxHP(gameObj), gameObj.GetMinAtk(), gameObj.GetMaxAtk(), |
| | | gameObj.GetDef(), GameObj.GetAtkSpeed(gameObj), GameObj.GetXP(gameObj), GameObj.GetMaxXP(gameObj))) |
| | | gameObj.GetDef(), GameObj.GetAtkSpeed(gameObj))) |
| | | if not gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightMainRolePlace): |
| | | return |
| | | GameWorld.DebugLog(" 闪(%s,%s),暴(%s,%s),晕(%s,%s),连(%s,%s),反(%s,%s),吸(%s,%s)" |
| | | % (GameObj.GetMissRate(gameObj), GameObj.GetMissDefRate(gameObj), |
| | | GameObj.GetSuperHitRate(gameObj), GameObj.GetSuperHitRateReduce(gameObj), |
| | |
| | | GameObj.GetAtkBackRate(gameObj), GameObj.GetAtkBackDefRate(gameObj), |
| | | GameObj.GetSuckHPPer(gameObj), GameObj.GetSuckHPDefPer(gameObj), |
| | | )) |
| | | GameWorld.DebugLog(" XP=%s/%s,强疗=%s,弱疗=%s,强灵=%s,弱灵=%s" |
| | | % (GameObj.GetXP(gameObj), GameObj.GetMaxXP(gameObj), GameObj.GetCurePer(gameObj), GameObj.GetCureDefPer(gameObj), |
| | | GameObj.GetPetStrengthenPer(gameObj), GameObj.GetPetWeakenPer(gameObj))) |
| | | return |
| | | |
| | | def TurnFightObjPerTurnStart(gameObj, tagObj, turnNum, tick): |
| | |
| | | Def_BuffValue_Count = 3 # buff记录的value个数
|
| | |
|
| | | #游戏对象属性--------------------------------------------
|
| | | Def_Calc_AllAttrType_MAX = 172
|
| | | Def_Calc_AllAttrType_MAX = 174
|
| | | #基本属性BUFF计算,顺序与 ObjProperty_AttrByIndex 对应,同时也为buff效果ID同步通知策划
|
| | | TYPE_Calc_AttrList = (
|
| | | TYPE_Calc_Metal, # 金 1
|
| | |
| | | TYPE_Calc_SuckHPPer, # 吸血比率
|
| | | TYPE_Calc_SuckHPDefPer, # 抗吸血比率 170
|
| | | TYPE_Calc_CureDefPer, # 弱化对方治疗效果
|
| | | TYPE_Calc_PetStrengthenPer, # 强化灵兽
|
| | | TYPE_Calc_PetWeakenPer, # 弱化灵兽
|
| | | ) = range(1, Def_Calc_AllAttrType_MAX)
|
| | |
|
| | | ## 支持大数值属性,超过20E
|
| | |
| | | Def_Obj_Dict_TurnAtkAddXPCount = 'TurnAtkAddXPCount' # 每回合攻击已增加XP次数
|
| | | Def_Obj_Dict_TurnXPFullTimeline = 'TurnXPFullTimeline' # XP满时的回合时间点
|
| | | Def_Obj_Dict_TurnXPUseState = 'TurnXPUseState' # XP使用状态;0-不可用;1-可用;2-已用
|
| | | Def_Obj_Dict_TurnSkillSuccessPetState = 'TurnSkillSuccessPetState' # 回合制灵宠是否已使用过技能,主人及灵宠均有该值,独立算
|
| | | Def_Obj_Dict_TurnAttackOverPetState = 'TurnAttackOverPetState' # 回合制灵宠是否已攻击过,主人及灵宠均有该值,独立算
|
| | |
|
| | | #---NPC字典-------
|
| | | #每道龙卷风最终坐标
|
| | |
| | | AttrName_SuckHPDefPer = "SuckHPDefPer" # 抗吸血比率
|
| | | AttrName_CurePer = "CurePer" # 强化治疗
|
| | | AttrName_CureDefPer = "CureDefPer" # 弱化治疗
|
| | | AttrName_PetStrengthenPer = "PetStrengthenPer" # 强化灵兽
|
| | | AttrName_PetWeakenPer = "PetWeakenPer" # 弱化灵兽
|
| | |
|
| | | #物品效果(ID或指定类型)对应的属性计算信息 {效果(ID/指定类型):[[属性索引, ...], 是否基础属性,(非)线性]}
|
| | | #对应 Def_Calc_AllAttrType_MAX
|
| | |
| | | AttrName_SuckHPDefPer:[[TYPE_Calc_SuckHPDefPer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_CurePer:[[TYPE_Calc_CurePer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_CureDefPer:[[TYPE_Calc_CureDefPer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_PetStrengthenPer:[[TYPE_Calc_PetStrengthenPer], False, TYPE_Linear],
|
| | | ShareDefine.Def_Effect_PetWeakenPer:[[TYPE_Calc_PetWeakenPer], False, TYPE_Linear],
|
| | |
|
| | | #战斗非线性
|
| | | ShareDefine.Def_Effect_SuperHitPer:[[TYPE_Calc_SuperHit], False, TYPE_NoLinear],
|
| | |
| | | TriggerType_AtkBackBef, # 反击前触发 94
|
| | | TriggerType_AtkBackAft, # 反击后触发 95
|
| | | TriggerType_SkillSuccessPet, # 灵宠技能释放成功都可触发 96
|
| | | ) = range(1, 97)
|
| | | TriggerType_AttackOverPet, # 灵宠攻击(对敌技能)后被动技能被触发 97
|
| | | TriggerType_XPAttackAddSkillPer, # 道法攻击增加伤害百分比 98
|
| | | TriggerType_XPAttackOver, # 道法攻击后触发99
|
| | | ) = range(1, 100)
|
| | |
|
| | |
|
| | | #不可以佩戴翅膀的地图
|
| | |
| | | Def_BattleRelationType_CommNoBoss, # 除了(指定)BOSS,可对其释放技能,但是无实际效果
|
| | | ) = range(0, 4)
|
| | |
|
| | | #IPY_GameWorld.ghtPhy
|
| | | # 攻击类型
|
| | | (
|
| | | ghtPhy, # 物理攻击 1
|
| | | ghtMag, # 魔法攻击 2
|
| | | ghtEx, # 额外攻击 3
|
| | | ) = range(1, 1 + 3)
|
| | |
|
| | | # 经验倍率限制类型
|
| | | (
|
| | | ExpRateLimitType_Recover, # 资源找回
|
| | |
| | | SetAtkBackHP(gameObj, 0)
|
| | | SetCurePer(gameObj, 0)
|
| | | SetCureDefPer(gameObj, 0)
|
| | | SetPetStrengthenPer(gameObj, 0)
|
| | | SetPetWeakenPer(gameObj, 0)
|
| | | SetDamageBackRate(gameObj, 0)
|
| | | return
|
| | |
|
| | | def GetPetDamPer(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_AttrPetDamPer)
|
| | |
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_CureDefPer, value)
|
| | | return
|
| | |
|
| | | def GetPetStrengthenPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_PetStrengthenPer)
|
| | | def SetPetStrengthenPer(gameObj, value):
|
| | | ## 强化灵兽
|
| | | gameObj.SetDict(ChConfig.AttrName_PetStrengthenPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_PetStrengthenPer, value)
|
| | | return
|
| | | def GetPetWeakenPer(gameObj): return gameObj.GetDictByKey(ChConfig.AttrName_PetWeakenPer)
|
| | | def SetPetWeakenPer(gameObj, value):
|
| | | ## 弱化灵兽
|
| | | gameObj.SetDict(ChConfig.AttrName_PetWeakenPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_PetWeakenPer, value)
|
| | | return
|
| | |
|
| | | def GetDamageBackRate(gameObj):
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | return gameObj.GetDamageBackRate()
|
| | | return gameObj.GetDictByKey(ChConfig.AttrName_DamBackPer)
|
| | | def SetDamageBackRate(gameObj, value):
|
| | | ## 反弹伤害
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | gameObj.SetDamageBackRate(value)
|
| | | else:
|
| | | gameObj.SetDict(ChConfig.AttrName_DamBackPer, value)
|
| | | return
|
| | |
|
| | | def NotifyObjInfoRefresh(gameObj, refreshType, value):
|
| | | ##0418通知对象属性刷新
|
| | | sendPack = ChNetSendPack.tagObjInfoRefresh()
|
| | |
| | | GameObj.SetSuckHPDefPer(curNPC, PropDict.get("SuckHPDefPer", 0))
|
| | | GameObj.SetCurePer(curNPC, PropDict.get("CurePer", 0))
|
| | | GameObj.SetCureDefPer(curNPC, PropDict.get("CureDefPer", 0))
|
| | | GameObj.SetPetStrengthenPer(curNPC, PropDict.get("PetStrengthenPer", 0))
|
| | | GameObj.SetPetWeakenPer(curNPC, PropDict.get("PetWeakenPer", 0))
|
| | | GameObj.SetFinalHurtPer(curNPC, PropDict.get("FinalHurtPer", 0))
|
| | | GameObj.SetFinalHurtReducePer(curNPC, PropDict.get("FinalHurtReducePer", 0))
|
| | |
|
| | |
| | | curPlayerPropDict["PVPAtkBackHP"] = PlayerControl.GetPVPAtkBackHP(curPlayer) # PVP攻击回血
|
| | | curPlayerPropDict["CurePer"] = GameObj.GetCurePer(curPlayer) # 强化治疗
|
| | | curPlayerPropDict["CureDefPer"] = GameObj.GetCureDefPer(curPlayer) # 弱化治疗
|
| | | curPlayerPropDict["PetStrengthenPer"] = GameObj.GetPetStrengthenPer(curPlayer) # 强化灵兽
|
| | | curPlayerPropDict["PetWeakenPer"] = GameObj.GetPetWeakenPer(curPlayer) # 弱化灵兽
|
| | |
|
| | | #-----------
|
| | | #扩展属性缓存
|
| | |
| | | Def_Effect_SuckHPDefPer = 214 # 抗吸血比率
|
| | | Def_Effect_CurePer = 215 # 强化治疗
|
| | | Def_Effect_CureDefPer = 216 # 弱化治疗
|
| | | Def_Effect_PetStrengthenPer = 217 # 强化灵兽
|
| | | Def_Effect_PetWeakenPer = 218 # 弱化灵兽
|
| | |
|
| | | #增加%d物理伤害值,其中a值为伤害值
|
| | | Def_Effect_AddAtk = 1005
|
| | |
| | | CDBPlayerRefresh_Xiantao, # 仙桃 254
|
| | | CDBPlayerRefresh_CurePer, # 强化治疗 255
|
| | | CDBPlayerRefresh_CureDefPer, # 弱化治疗 256
|
| | | ) = range(146, 257)
|
| | | CDBPlayerRefresh_PetStrengthenPer, # 弱化灵兽 257
|
| | | CDBPlayerRefresh_PetWeakenPer, # 弱化灵兽 258
|
| | | ) = range(146, 259)
|
| | |
|
| | | TYPE_Price_Gold_Paper_Money = 5 # 金钱类型,(先用礼券,再用金子)
|
| | | TYPE_Price_Family_Contribution = 6 # 战盟贡献度(活跃度转换得来)
|
| | |
| | | [lambda curObj:PlayerControl.GetMaxProDef(curObj), lambda curObj, value:PlayerControl.SetMaxProDef(curObj, value), ShareDefine.CDBPlayerRefresh_MaxProDef, 1, 0], # 最大防护值
|
| | | [lambda curObj:PlayerControl.GetProDefHPPer(curObj), lambda curObj, value:PlayerControl.SetProDefHPPer(curObj, value), ShareDefine.CDBPlayerRefresh_ProDefHPPer, 1, 0], # 生命上限换算为防护值的百分比
|
| | | [lambda curObj:PlayerControl.GetProDefAbsorb(curObj), lambda curObj, value:PlayerControl.SetProDefAbsorb(curObj, value), ShareDefine.CDBPlayerRefresh_ProDefAbsorb, 1, 0], # 防护值吸收伤害比率
|
| | | [lambda curObj:curObj.GetDamageBackRate(), lambda curObj, value:curObj.SetDamageBackRate(value), IPY_PlayerDefine.CDBPlayerRefresh_DamageBackRate, 1, 0], # 反伤百分比
|
| | | [lambda curObj:GameObj.GetDamageBackRate(curObj), lambda curObj, value:GameObj.SetDamageBackRate(curObj, value), IPY_PlayerDefine.CDBPlayerRefresh_DamageBackRate, 1, 0], # 反伤百分比
|
| | | [lambda curObj:PlayerControl.GetDamChanceDef(curObj), lambda curObj, value:PlayerControl.SetDamChanceDef(curObj, value), ShareDefine.CDBPlayerRefresh_DamChanceDef, 1, 0], # 20%的概率抵御伤害比率
|
| | | [lambda curObj:PlayerControl.GetShieldMPCostRate(curObj), lambda curObj, value:PlayerControl.SetShieldMPCostRate(curObj, value), 0, 0, 0], # 魔法盾伤害吸收蓝耗比率
|
| | | [lambda curObj:GameObj.GetFaintRate(curObj), lambda curObj, value:GameObj.SetFaintRate(curObj, value), ShareDefine.CDBPlayerRefresh_FaintRate, 1, 0], # 触发击晕
|
| | |
| | | [lambda curObj:GameObj.GetSuckHPPer(curObj), lambda curObj, value:GameObj.SetSuckHPPer(curObj, value), ShareDefine.CDBPlayerRefresh_SuckHPPer, 1, 0], # 吸血比率
|
| | | [lambda curObj:GameObj.GetSuckHPDefPer(curObj), lambda curObj, value:GameObj.SetSuckHPDefPer(curObj, value), ShareDefine.CDBPlayerRefresh_SuckHPDefPer, 1, 0], # 抗吸血比率
|
| | | [lambda curObj:GameObj.GetCureDefPer(curObj), lambda curObj, value:GameObj.SetCureDefPer(curObj, value), ShareDefine.CDBPlayerRefresh_CureDefPer, 1, 0], # 弱化对方治疗
|
| | | [lambda curObj:GameObj.GetPetStrengthenPer(curObj), lambda curObj, value:GameObj.SetPetStrengthenPer(curObj, value), ShareDefine.CDBPlayerRefresh_PetStrengthenPer, 1, 0], # 强化灵兽
|
| | | [lambda curObj:GameObj.GetPetWeakenPer(curObj), lambda curObj, value:GameObj.SetPetWeakenPer(curObj, value), ShareDefine.CDBPlayerRefresh_PetWeakenPer, 1, 0], # 弱化灵兽
|
| | | ]
|
| | |
|
| | | ## 通过索引获得属性值
|
| | |
| | | # 禁止治疗
|
| | | return
|
| | |
|
| | | # 治疗加成
|
| | | curePer = GameObj.GetCurePer(curObj) + ChConfig.Def_MaxRateValue
|
| | | curePerReduce = TurnAttack.GetEnemyCureDefPer(curObj) # 弱化治疗,取对方的
|
| | | curePerFinal = max(0, curePer - curePerReduce)
|
| | | addValueFianl = int(addValue*curePerFinal*1.0/ChConfig.Def_MaxRateValue)
|
| | | addValueFianl = addValue
|
| | |
|
| | | maxHP = GameObj.GetMaxHP(curObj)
|
| | |
|
| | |
| | | if isNotify:
|
| | | AttackCommon.ChangeHPView(curObj, curObj, skillTypeID, addValueFianl, ChConfig.Def_HurtTYpe_Recovery)
|
| | |
|
| | | GameWorld.DebugLog(" 治疗: curID=%s,skillTypeID=%s,curePerFinal=%s(%s-%s),addValue=%s,addValueFianl=%s,HP=%s" |
| | | % (curObj.GetID(), skillTypeID, curePerFinal, curePer, curePerReduce, addValue, addValueFianl, remainHP))
|
| | | GameWorld.DebugLog(" 治疗: curID=%s,skillTypeID=%s,addValue=%s,addValueFianl=%s,HP=%s" |
| | | % (curObj.GetID(), skillTypeID, addValue, addValueFianl, remainHP))
|
| | | return addValueFianl
|
| | |
|
| | | ## 直接扣血不走公式
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def GetBattleType(curSkill):
|
| | | ## 攻击类型
|
| | | if not curSkill:
|
| | | return ChConfig.ghtPhy
|
| | | battleType = curSkill.GetHurtType() / 10
|
| | | if not battleType:
|
| | | # 没有配置,默认物理攻击
|
| | | return ChConfig.ghtPhy
|
| | | return battleType
|
| | |
|
| | | def GetSkillBattleType(curSkill):
|
| | | if not curSkill:
|
| | | return ChConfig.Def_BattleRelationType_Comm
|
| | | #0通哟 1 PVP类型 2PVE类型
|
| | | return curSkill.GetHurtType()
|
| | | return curSkill.GetHurtType() % 10
|
| | |
|
| | | ## 检查技能是否为被动技能, 用于控制不可释放技能
|
| | | def isPassiveSkill(curSkill):
|
| | |
| | | #获得技能的计算参数值
|
| | | if cureType == ChConfig.Def_Cure_PHY:
|
| | | # 根据敏捷,力量差值及效果系数计算恢复比例
|
| | | skillPer = max(0, userObj.GetPHY() - userObj.GetSTR()) / float(curSkill.GetEffect(0).GetEffectValue(0))
|
| | | skillPer = max(0, userObj.GetPHY() - userObj.GetSTR()) / float(curSkill.GetEffect(0).GetEffectValue(0)) * ChConfig.Def_MaxRateValue
|
| | | GameWorld.DebugLog("英勇复苏: 敏=%s,力=%s,skillPer=%s" % (userObj.GetPHY(), userObj.GetSTR(), skillPer))
|
| | | else:
|
| | | skillPer = curSkill.GetEffect(0).GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)
|
| | | skillPer = curSkill.GetEffect(0).GetEffectValue(0)
|
| | | #技能附加
|
| | | skillValue = curSkill.GetEffect(0).GetEffectValue(1)
|
| | |
|
| | | skillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(userObj, None, curSkill, ChConfig.TriggerType_AddHP)/float(ChConfig.Def_MaxRateValue)
|
| | | skillPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(userObj, None, curSkill, ChConfig.TriggerType_AddHP)
|
| | | |
| | | # 回合制
|
| | | curePer = 0 # 治疗加成、强化灵兽
|
| | | cureDefPer = 0 # 敌方的弱化治疗、弱化灵兽
|
| | | if userObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline):
|
| | | isPetNPC = PetControl.IsPetNPC(userObj)
|
| | | enemyObj = None
|
| | | |
| | | if isPetNPC:
|
| | | petOwner = PetControl.GetPetNPCOwner(userObj)
|
| | | enemyObj = TurnAttack.GetEnemyObj(petOwner)
|
| | | |
| | | curePer += GameObj.GetCurePer(petOwner)
|
| | | curePer += GameObj.GetPetStrengthenPer(petOwner) # 强化灵兽
|
| | | else:
|
| | | enemyObj = TurnAttack.GetEnemyObj(userObj)
|
| | | |
| | | curePer += GameObj.GetCurePer(userObj)
|
| | | |
| | | if enemyObj:
|
| | | cureDefPer += GameObj.GetCureDefPer(enemyObj)
|
| | | if isPetNPC:
|
| | | cureDefPer += GameObj.GetPetWeakenPer(enemyObj) # 弱化灵兽
|
| | | |
| | | skillPer += (curePer - cureDefPer) # 可能负值
|
| | | #公式计算治疗值
|
| | | cureHP = int((cureBaseValue * skillPer + skillValue + addExValue) * curePercent)
|
| | | cureHP = int((cureBaseValue * skillPer / float(ChConfig.Def_MaxRateValue) + skillValue + addExValue) * curePercent)
|
| | | if not largeNum:
|
| | | cureHP = min(cureHP, ChConfig.Def_UpperLimit_DWord)
|
| | | cureHP = max(1, cureHP) # 保底1点
|
| | |
|
| | | #GameWorld.DebugLog("获取治疗值(%s):cureType=%s,cureBaseValue=%s,skillPer=%s,skillValue=%s" |
| | | # % (cureHP, cureType, cureBaseValue, skillPer, skillValue))
|
| | | #GameWorld.DebugLog("获取治疗值(%s):skillID=%s,cureType=%s,cureBaseValue=%s,skillPer=%s,skillValue=%s,curePer=%s,cureDefPer=%s" |
| | | # % (cureHP, curSkill.GetSkillID(), cureType, cureBaseValue, skillPer, skillValue, curePer, cureDefPer))
|
| | | return cureHP
|
| | |
|
| | |
|
| | |
| | | # @date 2024-02-01
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 命令第一位置灵兽立即使用一次技能(具体效果由灵兽技能决定),回合制适用
|
| | | # 详细描述: 命令第一位置灵兽立即使用一次技能(具体效果由灵兽技能决定),效果1: A值-灵兽技能是否重新进入技能CD,回合制适用
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-02-01 15:30"""
|
| | |
| | | if not attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline):
|
| | | return
|
| | |
|
| | | # 默认第一位置灵兽强制使用技能1,并重新进入CD
|
| | | # 默认第一位置灵兽强制使用技能1
|
| | | curPet = PetControl.GetFightPet(attacker, 1)
|
| | | if not curPet:
|
| | | return
|
| | |
| | | tagObj = TurnAttack.GetEnemyObj(attacker)
|
| | | if not tagObj:
|
| | | return
|
| | | |
| | | skillEffect = curSkill.GetEffect(0)
|
| | | isCD = skillEffect.GetEffectValue(0) # 是否重新进入冷却时间
|
| | | remainTime = None
|
| | |
|
| | | useSkill = None
|
| | | skillManager = curPet.GetSkillManager()
|
| | |
| | | if SkillCommon.isPassiveSkill(skill):
|
| | | continue
|
| | |
|
| | | remainTime = skill.GetRemainTime()
|
| | | skill.SetRemainTime(0)
|
| | | useSkill = skill
|
| | | break
|
| | |
| | |
|
| | | BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
| | | tagDist = 0
|
| | | return AICommon.DoNPCUseSkill(curPet, tagObj, useSkill, tagDist, tick)
|
| | | isOK = AICommon.DoNPCUseSkill(curPet, tagObj, useSkill, tagDist, tick)
|
| | | if isOK:
|
| | | # 不重新进入CD的话,还原原剩余时间
|
| | | if not isCD and remainTime != None:
|
| | | skill.SetRemainTime(remainTime)
|
| | | else:
|
| | | # 释放失败,还原原剩余时间
|
| | | if remainTime != None:
|
| | | skill.SetRemainTime(remainTime)
|
| | | |
| | | return isOK
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.GameSkills.SkillModule_47
|
| | | #
|
| | | # @todo:恢复妖气
|
| | | # @author hxp
|
| | | # @date 2024-03-26
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 恢复妖气 效果1: A值-恢复百分比,B值-恢复固定值
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-03-26 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameObj
|
| | | import GameWorld
|
| | |
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | skillEffect = curSkill.GetEffect(0)
|
| | | addPer = skillEffect.GetEffectValue(0)
|
| | | addValue = skillEffect.GetEffectValue(1)
|
| | | maxXP = GameObj.GetMaxXP(attacker)
|
| | | curXP = GameObj.GetXP(attacker)
|
| | | updXP = min(curXP + int(maxXP * addPer / 10000.0) + addValue, maxXP)
|
| | | GameObj.SetXP(attacker, updXP)
|
| | | GameWorld.DebugLog(" 恢复妖气: curXP=%s,addPer=%s,addValue=%s,updXP=%s,curID=%s" % (curXP, addPer, addValue, updXP, attacker.GetID()))
|
| | | return True # 不通知使用成功
|
| | | #return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.GameSkills.SkillModule_48
|
| | | #
|
| | | # @todo:扣除目标妖气
|
| | | # @author hxp
|
| | | # @date 2024-03-26
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 扣除妖气 效果1: A值-扣除百分比,B值-扣除固定值
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-03-26 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameObj
|
| | | import GameWorld
|
| | |
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | if not defender:
|
| | | return
|
| | | skillEffect = curSkill.GetEffect(0)
|
| | | delPer = skillEffect.GetEffectValue(0)
|
| | | delValue = skillEffect.GetEffectValue(1)
|
| | | maxXP = GameObj.GetMaxXP(defender)
|
| | | curXP = GameObj.GetXP(defender)
|
| | | updXP = max(curXP - int(maxXP * delPer / 10000.0) - delValue, 0)
|
| | | GameObj.SetXP(defender, updXP)
|
| | | GameWorld.DebugLog(" 扣除妖气: curXP=%s,delPer=%s,delValue=%s,updXP=%s,atkID=%s,curID=%s" % (curXP, delPer, delValue, updXP, attacker.GetID(), defender.GetID()))
|
| | | return True # 不通知使用成功
|
| | | #return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
| | |
|
| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | #生效类型(0-每次;1-独立首次,即每只灵宠独立算首次;2-共享首次,即本场战斗本方多只灵宠的情况下仅首次生效)
|
| | | effType = effect.GetEffectValue(1)
|
| | | if effType == 1:
|
| | | # 独立首次,取灵宠自己的状态
|
| | | useSkillPetID = attacker.GetDictByKey("useSkillPetID")
|
| | | if not useSkillPetID:
|
| | | return False
|
| | | petObj = GameWorld.FindNPCByID(useSkillPetID)
|
| | | if not petObj:
|
| | | return False
|
| | | if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState):
|
| | | #GameWorld.DebugLog("该灵宠释放过技能! 不再触发独立首次!", useSkillPetID.GetID())
|
| | | return False
|
| | | elif effType == 2:
|
| | | # 共享首次,直接取主人的状态
|
| | | if attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState):
|
| | | #GameWorld.DebugLog("已经有灵宠释放过技能! 不再触发共享首次!", attacker.GetID())
|
| | | return False
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5006
|
| | | #
|
| | | # @todo:灵宠攻击后触发
|
| | | # @author hxp
|
| | | # @date 2024-03-26
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 灵宠攻击后触发
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-03-26 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | #生效类型(0-每次;1-独立首次,即每只灵宠独立算首次;2-共享首次,即本场战斗本方多只灵宠的情况下仅首次生效)
|
| | | effType = effect.GetEffectValue(1)
|
| | | if effType == 1:
|
| | | # 独立首次,取灵宠自己的状态
|
| | | useSkillPetID = attacker.GetDictByKey("useSkillPetID")
|
| | | if not useSkillPetID:
|
| | | return False
|
| | | petObj = GameWorld.FindNPCByID(useSkillPetID)
|
| | | if not petObj:
|
| | | return False
|
| | | if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
|
| | | #GameWorld.DebugLog("该灵宠攻击过! 不再触发独立首次!", useSkillPetID.GetID())
|
| | | return False
|
| | | elif effType == 2:
|
| | | # 共享首次,直接取主人的状态
|
| | | if attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
|
| | | #GameWorld.DebugLog("已经有灵宠攻击过! 不再触发共享首次!", attacker.GetID())
|
| | | return False
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5007
|
| | | #
|
| | | # @todo:道法攻击增加技能伤害百分比
|
| | | # @author hxp
|
| | | # @date 2024-03-26
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 道法攻击增加技能伤害百分比
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-03-26 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return True
|
| | |
|
| | | def GetValue(attacker, defender, effect):
|
| | | return effect.GetEffectValue(0)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5008
|
| | | #
|
| | | # @todo:道法攻击触发技能
|
| | | # @author hxp
|
| | | # @date 2024-03-26
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 道法攻击触发技能
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-03-26 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | 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_5009
|
| | | #
|
| | | # @todo:受到攻击时,反射X%的伤害
|
| | | # @author hxp
|
| | | # @date 2024-03-26
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 受到攻击时,反射X%的伤害
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-03-26 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return True
|
| | |
|
| | | def GetValue(attacker, defender, effect):
|
| | | return effect.GetEffectValue(0)
|
| | |
|
| | |
| | | 5003:ChConfig.TriggerType_AtkBackAft, # 反击后触发 95
|
| | | 5004:ChConfig.TriggerType_BeAttackOver, # 被攻击后触发 20
|
| | | 5005:ChConfig.TriggerType_SkillSuccessPet, # 灵宠技能释放成功都可触发 96
|
| | | 5006:ChConfig.TriggerType_AttackOverPet, # 灵宠攻击(对敌技能)后被动技能被触发 97
|
| | | 5007:ChConfig.TriggerType_XPAttackAddSkillPer, # 道法攻击增加伤害百分比 98
|
| | | 5008:ChConfig.TriggerType_XPAttackOver, # 道法攻击后触发99
|
| | | 5009:ChConfig.TriggerType_BounceHPPer, # 受到攻击时,反弹伤害百分比值17
|
| | | }
|
| | | return tdict.get(effectID, -1)
|
| | | #===========================================================================
|