Exemplo n.º 1
0
        public override void OnDamageDealt(Character caster, Character target, Skill fromSkill, Modifier fromModifier, int damage)
        {
            base.OnDamageDealt(caster, target, fromSkill, fromModifier, damage);

            bool isDmgFromDOTModifier = fromModifier != null && fromModifier.Type() == ModifierType.DamageOverTime;

            if (target == targetCharacter && fromSkill != parentSkill && !isDmgFromDOTModifier)
            {
                lifetime.End();
                targetStatusModifierStats.RemoveModifier(statusModifierValueModifier);

                Action addSubModifiers = () => {
                    foreach (BaseModifierConfig subModifier in info.Smc.subModifiers)
                    {
                        DefaultSkill.Dependencies dependencies        = ((DefaultSkill)parentSkill).Dependencies_;
                        ModifierInfoFactory       modifierInfoFactory = dependencies.ModifierInfoFactory;
                        ModifierInfo mi =
                            modifierInfoFactory.CreateFrom(parentSkill, subModifier, dependencies.Environment);
                        Modifier modifier = DamageSystem.Instance.CreateModifier(
                            mi, casterEntity, targetEntity, target.Position(),
                            target.Position(), parentSkill, dependencies.Config.ShowSkillId(), 0
                            );
                        if (modifier != null)
                        {
                            target.AddModifier(modifier);
                        }
                    }
                };
                target.AddLoopable(new WaitLoopable(1, addSubModifiers));
            }
        }
Exemplo n.º 2
0
 public ComboDamageTypeModifier(ModifierInfo info, Entity casterEntity,
                                Entity targetEntity, Environment environment,
                                CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
 {
     this.info = (ComboDamageTypeModifierInfo)info;
     targetDamageTypeComponent = targetEntity.GetComponent <DamageTypeComponent>();
 }
Exemplo n.º 3
0
        protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo)
        {
            RagdollInfo ri = (RagdollInfo)modifierInfo;

            lifetime = new UnpredictableDurationLifetime();
            return(new List <Lifetime>(new[] { lifetime }));
        }
Exemplo n.º 4
0
 public VanishModifier(ModifierInfo info, Entity casterEntity,
                       Entity targetEntity, Environment environment,
                       CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
 {
     this.info         = (VanishInfo)info;
     this.targetEntity = targetEntity;
 }
Exemplo n.º 5
0
        private static bool CustomModifiersMatch(ImmutableArray <CustomModifier> candidateCustomModifiers, ImmutableArray <ModifierInfo> targetCustomModifiers)
        {
            if (targetCustomModifiers.IsDefault || targetCustomModifiers.IsEmpty)
            {
                return(candidateCustomModifiers.IsDefault || candidateCustomModifiers.IsEmpty);
            }
            else if (candidateCustomModifiers.IsDefault)
            {
                return(false);
            }

            var n = candidateCustomModifiers.Length;

            if (targetCustomModifiers.Length != n)
            {
                return(false);
            }

            for (int i = 0; i < n; i++)
            {
                ModifierInfo   targetCustomModifier    = targetCustomModifiers[i];
                CustomModifier candidateCustomModifier = candidateCustomModifiers[i];

                if (targetCustomModifier.IsOptional != candidateCustomModifier.IsOptional ||
                    !object.Equals(targetCustomModifier.Modifier, candidateCustomModifier.Modifier))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 6
0
 public CooldownBySecondUponHitTargetModifier(ModifierInfo info, Entity casterEntity,
                                              Entity targetEntity, Environment environment,
                                              CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
 {
     this.info      = (CooldownBySecondUponHitTargetInfo)info;
     modifierTarget = targetEntity.GetComponent <SkillComponent>().Character;
 }
Exemplo n.º 7
0
    IEnumerator DoDash()
    {
        bool finished = false;

        do
        {
            dashPoints.Add(player.transform.position);
            player.transform.position += (Vector3)direction / maxDashCount;

            if (dashPoints.Count >= maxDashCount)
            {
                ModifierInfo modifierInfo = GetModifierInfo();
                foreach (Modifier modifier in modifiers)
                {
                    modifier.Action(modifierInfo);
                }

                playerScript.invulnerable = false;
                dashing  = false;
                finished = true;
                yield return(null);
            }

            yield return(new WaitForSeconds(0.1f));
        } while (!finished);
    }
Exemplo n.º 8
0
        protected BaseModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                               Environment environment, CollectionOfInteractions modifierInteractionCollection)
        {
            NotNullReference nnr = new NotNullReference();

            nnr.Check(info, "modifier info");
            nnr.Check(casterEntity, "caster entity");
            nnr.Check(targetEntity, "target entity");
            this.info         = info;
            this.casterEntity = casterEntity;
            this.targetEntity = targetEntity;
            this.environment  = environment;
            this.modifierInteractionCollection = modifierInteractionCollection;
            this.vfxs = info.ShowVfxConfig();

            pendingVfxs.AddRange(vfxs);
            targetGameObject = targetEntity.GetComponent <EntityGameObjectComponent>().GameObject;
            targetAnimation  = targetEntity.GetComponent <AnimationComponent>().Animation;
            target           = targetEntity.GetComponent <SkillComponent>().Character;
            mainLifetimes    = CreateLifetimes(info);
            for (int kIndex = 0; kIndex < mainLifetimes.Count; kIndex++)
            {
                Lifetime l = mainLifetimes[kIndex];
                if (l.ShowType() == LifetimeType.Duration)
                {
                    ((DurationBasedLifetime)l).SetDelay(info.DelayToApply());
                }
            }
        }
Exemplo n.º 9
0
        public IkModifier(ModifierInfo mi, Entity casterEntity, Entity targetEntity,
                          Environment environment,
                          CollectionOfInteractions modifierInteractionCollection) : base(mi, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.environment = environment;
            this.info        = (IkInfo)mi;
            mapCollider      = environment.MapColliders();

            caster = casterEntity.GetComponent <SkillComponent>().Character;
            FrameAndSecondsConverter fasc = FrameAndSecondsConverter._30Fps;

            aimAt                    = 0;
            aimDuration              = fasc.FramesToSeconds(info.Config.aimDuration);
            aimLogicDuration         = fasc.FramesToSeconds(info.Config.aimLogicDuration);
            aimInterpolationDuration = fasc.FramesToSeconds(info.Config.aimInterpolationDuration);
            startupAt                = aimAt + aimDuration;
            startupDuration          = fasc.FramesToSeconds(info.Config.startupDuration);
            activeAt                 = startupAt + startupDuration;
            activeDuration           = fasc.FramesToSeconds(info.Config.activeDuration);
            recoveryAt               = activeAt + activeDuration;
            recoveryDuration         = fasc.FramesToSeconds(info.Config.recoveryDuration);
            totalDuration            = recoveryAt + recoveryDuration;
            target                   = environment.FindNearbyCharacters(
                caster, Vector3.zero, 999,
                new[] { FindingFilter.ExcludeMe, FindingFilter.ExcludeDead, FindingFilter.ExcludeAllies }
                )[0];
            fabrik = caster.GameObject().GetComponent <FABRIK>();
            IKSolverFABRIK solverFabrik = (IKSolverFABRIK)fabrik.GetIKSolver();

            ikJoint       = solverFabrik.bones[solverFabrik.bones.Length - 1].transform;
            ikJointParent = solverFabrik.bones[solverFabrik.bones.Length - 2].transform;
        }
Exemplo n.º 10
0
        public FreezeModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity, Environment environment, CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info = (FreezeInfo)info;

            targetAnimationComponent = targetEntity.GetComponent <AnimationComponent>();
            targetMovementComponent  = targetEntity.GetComponent <MovementComponent>();
        }
Exemplo n.º 11
0
        private TypeWithAnnotations GetConstraintTypeOrDefault(PEModuleSymbol moduleSymbol, MetadataReader metadataReader, MetadataDecoder tokenDecoder, GenericParameterConstraintHandle constraintHandle, ref bool hasUnmanagedModreqPattern)
        {
            var constraint = metadataReader.GetGenericParameterConstraint(constraintHandle);
            var typeSymbol = tokenDecoder.DecodeGenericParameterConstraint(constraint.Type, out ImmutableArray <ModifierInfo <TypeSymbol> > modifiers);

            if (!modifiers.IsDefaultOrEmpty && modifiers.Length > 1)
            {
                typeSymbol = new UnsupportedMetadataTypeSymbol();
            }
            else if (typeSymbol.SpecialType == SpecialType.System_ValueType)
            {
                // recognize "(class [mscorlib]System.ValueType modreq([mscorlib]System.Runtime.InteropServices.UnmanagedType" pattern as "unmanaged"
                if (!modifiers.IsDefaultOrEmpty)
                {
                    ModifierInfo <TypeSymbol> m = modifiers.Single();
                    if (!m.IsOptional && m.Modifier.IsWellKnownTypeUnmanagedType())
                    {
                        hasUnmanagedModreqPattern = true;
                    }
                    else
                    {
                        // Any other modifiers, optional or not, are not allowed: http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528856
                        typeSymbol = new UnsupportedMetadataTypeSymbol();
                    }
                }

                // Drop 'System.ValueType' constraint type if the 'valuetype' constraint was also specified.
                if (typeSymbol.SpecialType == SpecialType.System_ValueType && ((_flags & GenericParameterAttributes.NotNullableValueTypeConstraint) != 0))
                {
                    return(default);
Exemplo n.º 12
0
        protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo)
        {
            IkInfo imi = (IkInfo)modifierInfo;

            return(new List <Lifetime>(new [] {
                new DurationBasedLifetime(imi.Config.ShowTotalDurationInSeconds()),
            }));
        }
Exemplo n.º 13
0
        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 }));
        }
Exemplo n.º 14
0
        protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo)
        {
            List <Lifetime> lifetimes = base.CreateLifetimes(modifierInfo);

            gaugeLifetime = new UnpredictableDurationLifetime();
            lifetimes.Add(gaugeLifetime);
            return(lifetimes);
        }
Exemplo n.º 15
0
        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 }));
        }
Exemplo n.º 16
0
 public LifeStealModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                          Environment environment,
                          CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
 {
     this.info             = (LifeStealInfo)info;
     targetHealthComponent = targetEntity.GetComponent <HealthComponent>();
     casterCharacter       = casterEntity.GetComponent <SkillComponent>().Character;
 }
Exemplo n.º 17
0
        public MoveSpeedModifier(ModifierInfo info, Entity casterEntity,
                                 Entity targetEntity, Environment environment,
                                 CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info         = (MoveSpeedInfo)info;
            this.targetEntity = targetEntity;

            targetMovementComponent = targetEntity.GetComponent <MovementComponent>();
        }
Exemplo n.º 18
0
        public WindModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity, Environment environment,
                            CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info = (WindInfo)info;

            targetMovementComponent = targetEntity.GetComponent <MovementComponent>();
            casterMovementComponent = casterEntity.GetComponent <MovementComponent>();
            duration = this.info.Wmc.ShowDurationInSeconds();
        }
Exemplo n.º 19
0
        public ScaleModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                             Environment environment,
                             CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info = (ScaleInfo)info;

            gameObjectComponent = (GameObjectComponent)targetEntity.GetComponent <EntityGameObjectComponent>();
            originalScaleValue  = gameObjectComponent.GetScale();
        }
Exemplo n.º 20
0
 public SfxModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                    Environment environment, CollectionOfInteractions modifierInteractionCollection,
                    SkillId skillId) : base(info, casterEntity, targetEntity, environment,
                                            modifierInteractionCollection)
 {
     this.info         = (SfxInfo)info;
     this.targetEntity = targetEntity;
     this.skillId      = skillId;
 }
Exemplo n.º 21
0
        protected override List <Lifetime> CreateLifetimes(ModifierInfo modifierInfo)
        {
            List <Lifetime> lifetimes = new List <Lifetime>();

            lifetimes.AddRange(base.CreateLifetimes(modifierInfo));
            recastLifetime = new RunOutOfRecastLifetime();
            lifetimes.Add(recastLifetime);
            return(lifetimes);
        }
Exemplo n.º 22
0
        public ShackleModifier(ModifierInfo info, Entity casterEntity,
                               Entity targetEntity, Environment environment,
                               CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info = (ShackleInfo)info;

            targetCharacter = targetEntity.GetComponent <SkillComponent>().Character;
            casterCharacter = casterEntity.GetComponent <SkillComponent>().Character;
        }
Exemplo n.º 23
0
 public AttachedVfxModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity,
                            Environment environment,
                            CollectionOfInteractions modifierInteractionCollection,
                            ProjectileComponent projectile) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
 {
     this.projectile = projectile;
     projectileDirectionAtAttachment = projectile.Entity.GetComponent <ProjectileTrajectoryComponent>()
                                       .ShowTrajectoryDirection().ToLeftOrRightDirectionEnum();
 }
Exemplo n.º 24
0
    private ModifierInfo GetModifierInfo()
    {
        ModifierInfo modifierInfo = new ModifierInfo(player);

        modifierInfo.points = dashPoints.ToArray();
        modifierInfo.radius = 2.5f;

        return(modifierInfo);
    }
 public AetherOnDamagedModifier(ModifierInfo info,
                                Entity casterEntity, Entity targetEntity,
                                Environment environment,
                                CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
 {
     this.info       = (AetherOnDamagedInfo)info;
     aetherComponent = targetEntity.GetComponent <AetherComponent>();
     targetCharacter = targetEntity.GetComponent <SkillComponent>().Character;
 }
Exemplo n.º 26
0
        public BleedModifier(ModifierInfo info, Entity casterEntity, Entity targetEntity, Environment environment, CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.casterEntity     = casterEntity;
            this.info             = (BleedInfo)info;
            this.environment      = environment;
            targetHealthComponent = targetEntity.GetComponent <HealthComponent>();
            StatsComponent casterStats = casterEntity.GetComponent <StatsComponent>();

            characterStats = casterStats.CharacterStats;
        }
Exemplo n.º 27
0
        public KnockdownWeightModifier(ModifierInfo info, Entity casterEntity,
                                       Entity targetEntity, Environment environment,
                                       CollectionOfInteractions modifierInteractionCollection) : base(info, casterEntity, targetEntity, environment, modifierInteractionCollection)
        {
            this.info = (KnockdownWeightInfo)info;
            bool found;

            targetKnockdownWeightStats = targetEntity.GetComponent <StatsComponent>().CharacterStats
                                         .FindStats(StatsType.KnockdownWeight, out found);
        }
Exemplo n.º 28
0
        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 }));
        }
Exemplo n.º 29
0
 public override void Action(ModifierInfo modifierInfo)
 {
     if (environmentManager == null)
     {
         environmentManager = GameObject.Find(Constants.GAMEOBJECT_NAME_ENVIRONMENTMANAGER).GetComponent <EnvironmentManager>();
     }
     for (int i = 0; i < modifierInfo.points.Length; i++)
     {
         environmentManager.AddElectric(modifierInfo.points[i], modifierInfo.radius * 2f);
     }
 }
Exemplo n.º 30
0
        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);
        }
Exemplo n.º 31
0
 private static CustomModifier Convert(ModifierInfo<TypeSymbol> customModifier)
 {
     var modifier = (NamedTypeSymbol)customModifier.Modifier;
     return customModifier.IsOptional ? CreateOptional(modifier) : CreateRequired(modifier);
 }
Exemplo n.º 32
0
        private static ArrayList ParseModifiers(XmlDbRow dr, string[] columnKeys, int numRewards)
        {
            ArrayList list = new ArrayList();
            for (int i = 0x0; i < numRewards; i++)
            {
                bool flag = false;
                List<string> stringList = dr.GetStringList(columnKeys[i], ',');
                if (stringList.Count > 0x0)
                {
                    ModifierType type;
                    ParserFunctions.TryParseEnum<ModifierType>(stringList[0x0], out type, ModifierType.Undefined);
                    ModifierInfo info = null;
                    switch (type)
                    {
                        case ModifierType.Mood:
                        case ModifierType.RelationshipWithBoss:
                        case ModifierType.RelationshipWithCoworkers:
                            info = new ModifierInfo();
                            info.mType = type;
                            flag = int.TryParse(stringList[0x1], out info.mAmount);
                            break;

                        case ModifierType.Skill:
                            info = ParseSkillModifierInfo(stringList);
                            flag = info != null;
                            break;
                    }
                    if (flag)
                    {
                        list.Add(info);
                    }
                }
            }
            if (list.Count != 0x0)
            {
                return list;
            }
            return null;
        }
Exemplo n.º 33
0
        private static ModifierInfo ParseSkillModifierInfo(List<string> entry)
        {
            if (entry.Count == 0x3)
            {
                ModifierInfo info = new ModifierInfo();
                info.mType = ModifierType.Skill;

                // Custom
                SkillNames names = SkillManager.sSkillEnumValues.ParseEnumValue(entry[1]);

                info.mGuid = (ulong)names;
                int.TryParse(entry[0x2], out info.mAmount);
                return info;
            }
            return null;
        }