| | |
| | | var Hurt = tagUseSkillAttack.HurtList[i]; |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)Hurt.ObjID); |
| | | |
| | | string targetName = battleObject != null ? battleObject.teamHero.name : "Unknown"; |
| | | string targetName = battleObject != null ? battleObject.GetName() : "Unknown"; |
| | | long hurtHp = GeneralDefine.GetFactValue(Hurt.HurtHP, Hurt.HurtHPEx); |
| | | long curHp = GeneralDefine.GetFactValue(Hurt.CurHP, Hurt.CurHPEx); |
| | | |
| | |
| | | var HurtEx = tagUseSkillAttack.HurtListEx[i]; |
| | | BattleObject battleObject = caster.battleField.battleObjMgr.GetBattleObject((int)HurtEx.ObjID); |
| | | |
| | | string targetName = battleObject != null ? battleObject.teamHero.name : "Unknown"; |
| | | string targetName = battleObject != null ? battleObject.GetName() : "Unknown"; |
| | | long hurtHp = GeneralDefine.GetFactValue(HurtEx.HurtHP, HurtEx.HurtHPEx); |
| | | long curHp = GeneralDefine.GetFactValue(HurtEx.CurHP, HurtEx.CurHPEx); |
| | | |
| | |
| | | { |
| | | // 广播技能释放事件 |
| | | string guid = battleField.guid; |
| | | TeamHero teamHero = caster.teamHero; |
| | | // 获取释放者数据:Hero 传递 teamHero,Mingge 传递 null(因为事件监听器只处理 Hero 数据) |
| | | TeamHero teamHero = null; |
| | | if (caster is HeroBattleObject heroBattleObject) |
| | | { |
| | | teamHero = heroBattleObject.teamHero; |
| | | } |
| | | // 命格释放技能时 teamHero 为 null,监听器会正确处理(已有 null 检查) |
| | | EventBroadcast.Instance.Broadcast<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, guid, skillConfig, teamHero); |
| | | |
| | | if (skillConfig.SkinllSFX1 != 0) |
| | |
| | | else |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, () => |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()), Vector2.zero, () => |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | |
| | | |
| | | ExecuteMoveAndCastSequence(targetTrans, () => |
| | | { |
| | | RectTransform rectTransform = battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum); |
| | | RectTransform rectTransform = battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()); |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(rectTransform, Vector2.zero, () => |
| | | { |
| | |
| | | else |
| | | { |
| | | // ShadowIllutionCreate(true); |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, () => |
| | | MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.GetPositionNum()), Vector2.zero, () => |
| | | { |
| | | // ShadowIllutionCreate(false); |
| | | OnAttackFinish(); |
| | |
| | | // 命中目标回调:处理所有被命中的目标(包括主目标、弹射目标、溅射目标) |
| | | protected virtual void OnHitTargets(int _hitIndex, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hitList) |
| | | { |
| | | // Debug.LogError($"Skill {skillConfig.SkillID} hit targets _hitIndex: {_hitIndex} hit {string.Join(", ", hitList.Select(h => h.ObjID + ":" + battleField.battleObjMgr.GetBattleObject((int)h.ObjID)?.teamHero.name))}"); |
| | | // Debug.LogError($"Skill {skillConfig.SkillID} hit targets _hitIndex: {_hitIndex} hit {string.Join(", ", hitList.Select(h => h.ObjID + ":" + battleField.battleObjMgr.GetBattleObject((int)h.ObjID)?.GetName()))}"); |
| | | |
| | | // 造成伤害前先处理血量刷新包 |
| | | HandleRefreshHP(); |
| | |
| | | Hint(battleObject, hintConfig); |
| | | battleField.battleEffectMgr.PlayEffect(battleObject, |
| | | BattleConst.BreakArmorEffectID, battleObject.GetRectTransform(), battleObject.Camp, |
| | | battleObject.teamHero.modelScale); |
| | | battleObject.GetModelScale()); |
| | | } |
| | | } |
| | | else if ((hurt.AttackTypes & (int)DamageType.Parry) == (int)DamageType.Parry) |
| | |
| | | Hint(battleObject, hintConfig); |
| | | battleField.battleEffectMgr.PlayEffect(battleObject, |
| | | BattleConst.ParryEffectID, battleObject.GetRectTransform(), battleObject.Camp, |
| | | battleObject.teamHero.modelScale); |
| | | battleObject.GetModelScale()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | BattleDebug.LogError( |
| | | (hurtParam.caster.casterObj.Camp == BattleCamp.Red ? "【红方行动】" : "【蓝方行动】 ") + |
| | | $"攻击者: {hurtParam.caster.casterObj.teamHero.name} (ObjID:{hurtParam.caster.casterObj.ObjID})\n" + |
| | | $"目标: {hurtParam.hurter.hurtObj.teamHero.name} (ObjID:{hurtParam.hurter.hurtObj.ObjID})\n" + |
| | | $"攻击者: {hurtParam.caster.casterObj.GetName()} (ObjID:{hurtParam.caster.casterObj.ObjID})\n" + |
| | | $"目标: {hurtParam.hurter.hurtObj.GetName()} (ObjID:{hurtParam.hurter.hurtObj.ObjID})\n" + |
| | | $"技能: {hurtParam.skillConfig.SkillName} (ID:{hurtParam.skillConfig.SkillID})\n" + |
| | | $"击数: 第{hurtParam.hitIndex + 1}击 / 共{hurtParam.skillConfig.DamageDivide.Length}击" + (isLastHit ? " [最后一击]" : " [中间击]") + "\n" + |
| | | $"\n" + |
| | |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffRefresh.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | battleObj.buffMgr.RefreshBuff(buffRefresh, true); |
| | | var buffMgr = battleObj.GetBuffMgr(); |
| | | if (buffMgr != null) // 命格不有 buff 管理器 |
| | | { |
| | | buffMgr.RefreshBuff(buffRefresh, true); |
| | | } |
| | | } |
| | | } |
| | | else if (pack is HB429_tagSCBuffDel buffDel) |
| | |
| | | BattleObject battleObj = battleField.battleObjMgr.GetBattleObject((int)buffDel.ObjID); |
| | | if (battleObj != null) |
| | | { |
| | | battleObj.buffMgr.RemoveBuff(buffDel, false); |
| | | var buffMgr = battleObj.GetBuffMgr(); |
| | | if (buffMgr != null) // 命格不有 buff 管理器 |
| | | { |
| | | buffMgr.RemoveBuff(buffDel, false); |
| | | } |
| | | } |
| | | } |
| | | } |