protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo) { KnockdownInfo ki = (KnockdownInfo)modifierInfo; float duration = ki.TimeToPeak + ki.FloatingDur + ki.TimeToGround + ki.LieDuration + ki.LieToIdleDuration; lifetime = new DurationBasedLifetime(duration); return(new List <Lifetime>(new [] { lifetime })); }
public KnockdownModifier(KnockdownInfo knockdownInfo, Vector3 collidedProjectilePosition, Vector3 collidedProjectileVelocity, Entity caster, Entity target, Camera camera, SkillId skillId, Environment environment, CollectionOfInteractions modifierInteractionCollection, WallHitConfig wallHitConfig, float damageScale) : base(knockdownInfo, caster, target, environment, modifierInteractionCollection) { this.knockdownInfo = knockdownInfo; this.collidedProjectilePosition = collidedProjectilePosition; this.collidedProjectileVelocity = collidedProjectileVelocity; this.caster = caster; this.target = target; this.camera = camera; this.skillId = skillId; this.environment = environment; this.whc = wallHitConfig; this.damageScale = damageScale; movementComponent = target.GetComponent <MovementComponent>(); targetAnimation = target.GetComponent <AnimationComponent>().Animation; targetCharacter = target.GetComponent <SkillComponent>().Character; UserInput userInput = target.GetComponent <HeroStateMachineComponent>().UserInput; targetDefaultUserInput = (DefaultUserInput)userInput; StatsComponent targetStatsComponent = targetEntity.GetComponent <StatsComponent>(); bool found; extraLyingDurationStats = targetStatsComponent.CharacterStats.FindStats( StatsType.ExtraLyingDuration, out found ); if (found) { lifetime.DynamicExtraDuration += extraLyingDurationStats.BakedFloatValue; } StatsComponent casterStatsComponent = casterEntity.GetComponent <StatsComponent>(); characterStats = casterStatsComponent.CharacterStats; casterMovementComponent = casterEntity.GetComponent <MovementComponent>(); }