public HealByRawAtkUponEnemyHitModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity, Environment environment, CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection) { this.info = (HealByRawAtkUponEnemyHitInfo)info; modifierTarget = targetEntity.GetComponent <SkillComponent>().Character; equippedSkillsComponent = targetEntity.GetComponent <EquippedSkillsComponent>(); healthComponent = targetEntity.GetComponent <HealthComponent>(); rawAtk = targetEntity.GetComponent <StatsComponent>().CharacterStats.FindStats(StatsType.RawAtk); }
public override void Process(Entity entity) { if (!ccBreakEventConfig.enable) { return; } StatsComponent statsComponent = entity.GetComponent <StatsComponent>(); if (statsComponent.BasicStatsFromConfig.ShowRole() != EntityRole.Hero) { return; } JustCreatedModifiersComponent justCreatedModifiers = entity.GetComponent <JustCreatedModifiersComponent>(); bool found = false; Modifier triggerModifier = null; foreach (Modifier modifier in justCreatedModifiers.modifiers) { if (!CcBreakByInputModifier.interested.Contains(modifier.Type())) { continue; } triggerModifier = modifier; found = true; break; } if (!found) { return; } EquippedSkillsComponent equippedSkills = entity.GetComponent <EquippedSkillsComponent>(); if (!equippedSkills.EquippedSkills.IsPassiveRecovery2Equipped()) { return; } SkillComponent skillComponent = entity.GetComponent <SkillComponent>(); CcBreakByInputInfo info = new CcBreakByInputInfo(Target.Target, modifierConfig, null); Character character = skillComponent.Character; character.AddModifier(new CcBreakByInputModifier( info, entity, entity, triggerModifier, ccBreakEventConfig, environment, modifierInteractionCollection )); }
protected override void OnDelayedAttachAsMain(Character target) { esc = targetEntity.GetComponent <EquippedSkillsComponent>(); hsmc = targetEntity.GetComponent <HeroStateMachineComponent>(); int comboCount = esc.EquippedSkills.ComboCount(); string[] interested = new string[comboCount]; for (int i = 1; i <= comboCount; i++) { interested[i - 1] = StateName.COMBO_ATTACK + i; } string targetStateName = hsmc.HeroStateMachine.GetCurrentStateName(); stateAtAttachMoment = targetStateName; if (interested.Contains(targetStateName)) { for (int i = 0; i < comboCount; i++) { esc.EquippedSkills.GetCombo(i + 1).AttackStateWindow.StartSoonerBy(info.Value); } } int airComboCount = esc.EquippedSkills.JumpAtkCount(); interested = new string[airComboCount]; for (int i = 1; i < airComboCount; i++) { interested[i - 1] = StateName.JUMP_ATTACK + i; } if (interested.Contains(targetStateName)) { for (int i = 0; i < airComboCount; i++) { esc.EquippedSkills.GetJumpAtk(i + 1).AttackStateWindow.StartSoonerBy(info.Value); } } skill.EndChannelingSoonerBy(info.ChannelingValue); skill.EndStateBindingSoonerBy(info.StateBindingValue); }