using CoreGame.Logic; using Sirenix.OdinInspector; namespace GAS.Runtime { public class DotBoomGEComponent : GameplayEffectComponent { [LabelText("触发的技能ID")] public int cfgId; [ShowInInspector] [HideReferenceObjectPicker] [ShowIf("m_Cfg")] private SkillDesc m_Cfg => SkillDescMgr.Instance.GetConfig(cfgId); public override void OnOverflowGameplayEffectStack(GameplayEffectComponentSpec partSelf, GameplayEffectSpec GESpec, int maxStackCount) { GameAbilityContext attachActiveAbility = null; if (GESpec.Source.owner == false) { return; } var owner = GESpec.Owner.owner; // 给造成伤害的人添加技能 attachActiveAbility = AbilitySvc.GrantTransferAbility(GESpec.Source.owner, cfgId, GESpec.effectParams.gaInitCfg); // 溢出一定有技能来源 if (attachActiveAbility != null) { attachActiveAbility.attackCarrierEid = owner.creationIndex; attachActiveAbility.castTarget.Add(owner.creationIndex); attachActiveAbility.castPos.Add(owner.logicTransform.position); // dotboom技能的参数 attachActiveAbility.dropAbilityWhenEnd = true; attachActiveAbility.asc.TryActivateAbility_WithSeqAndParam(attachActiveAbility.gaSeq, GESpec.effectParams.gaParams); } } } }