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 })); }
protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo) { BlastInfo bi = (BlastInfo)modifierInfo; float duration = bi.TimeToPeak + bi.TimeToGround + bi.TimeToRoll + bi.TimeToLie; lifetime = new DurationBasedLifetime(duration); return(new List <Lifetime>(new [] { lifetime })); }
protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo) { LockFrameInfo lfi = (LockFrameInfo)modifierInfo; float durationForTarget = lfi.DelayForTarget + lfi.DurationForTarget; float durationForCaster = lfi.DelayForCaster + lfi.DurationForCaster; float durationForGlobal = lfi.DelayForGlobal + lfi.DurationForGlobal; float duration = Math.Max(Math.Max(durationForTarget, durationForCaster), durationForGlobal); lifetime = new DurationBasedLifetime(duration, true); return(new List <Lifetime>(new[] { lifetime })); }
protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo) { List <Lifetime> lifetimes = base.CreateLifetimes(modifierInfo); foreach (Lifetime l in lifetimes) { if (l is DurationBasedLifetime) { lifetime = (DurationBasedLifetime)l; } } return(lifetimes); }
protected virtual List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo) { List <Lifetime> lifetimes = new List <Lifetime>(); foreach (LifetimeConfig lc in info.ShowLifetimeConfigs()) { switch (lc.ShowType()) { case LifetimeType.Duration: DurationInSecondsLifetimeConfig dis = (DurationInSecondsLifetimeConfig)lc; DurationBasedLifetime durationBasedLifetime = new DurationBasedLifetime(dis.duration); configByLifetime[durationBasedLifetime] = lc; lifetimes.Add(durationBasedLifetime); break; case LifetimeType.ParentSkill: ParentSkillBasedLifetime parentSkillBasedLifetime = new ParentSkillBasedLifetime(info.ShowParentSkill()); configByLifetime[parentSkillBasedLifetime] = lc; lifetimes.Add(parentSkillBasedLifetime); break; case LifetimeType.DurationInFrames: DurationInFramesLifetimeConfig dif = (DurationInFramesLifetimeConfig)lc; durationBasedLifetime = new DurationBasedLifetime(FrameAndSecondsConverter._30Fps.FloatFramesToSeconds(dif.duration)); configByLifetime[durationBasedLifetime] = lc; lifetimes.Add(durationBasedLifetime); break; case LifetimeType.SuccessfulHit: SuccessfulHitLifetimeConfig shl = (SuccessfulHitLifetimeConfig)lc; SuccessfulHitLifetime successfulHitLifetime = new SuccessfulHitLifetime(shl.count, shl.ShowCategories(), targetEntity.GetComponent <SkillComponent>().Character); configByLifetime[successfulHitLifetime] = lc; lifetimes.Add(successfulHitLifetime); break; case LifetimeType.SpecificSkillStateExit: SpecificSkillStateExitLifetimeConfig ssselc = (SpecificSkillStateExitLifetimeConfig)lc; SpecificSkillStateExitLifetime specificSkillStateExitLifetime = new SpecificSkillStateExitLifetime( ssselc, targetEntity.GetComponent <SkillComponent>().Character ); configByLifetime[specificSkillStateExitLifetime] = ssselc; lifetimes.Add(specificSkillStateExitLifetime); break; case LifetimeType.SpecificSkillFinish: SpecificSkillFinishLifetimeConfig ssflc = (SpecificSkillFinishLifetimeConfig)lc; SpecificSkillFinishLifetime specificSkillFinishLifetime = new SpecificSkillFinishLifetime( ssflc, targetEntity.GetComponent <SkillComponent>().Character ); configByLifetime[specificSkillFinishLifetime] = ssflc; lifetimes.Add(specificSkillFinishLifetime); break; case LifetimeType.ParentSkillHitTarget: ParentSkillHitTargetLifetime pshtl = new ParentSkillHitTargetLifetime( targetEntity.GetComponent <SkillComponent>().Character, modifierInfo.ShowParentSkill() ); configByLifetime[pshtl] = lc; lifetimes.Add(pshtl); break; case LifetimeType.ParentSkillStateExit: ParentSkillStateExitLifetime pssel = new ParentSkillStateExitLifetime(modifierInfo.ShowParentSkill()); configByLifetime[pssel] = lc; lifetimes.Add(pssel); break; default: throw new Exception("Missing logic to create lifetime of type " + lc.ShowType()); } } return(lifetimes); }