Ejemplo n.º 1
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp = effect as ImbueObject;

            ImbueEffect_Preset_ID = comp.ImbuedEffect?.PresetID ?? -1;
            Lifespan = comp.LifespanImbue;
        }
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp = effect as CreateItemEffect;

            ItemToCreate = comp.ItemToCreate?.ItemID ?? -1;
            Quantity     = comp.Quantity;
        }
Ejemplo n.º 3
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var template = holder as DM_ShootBlast;
            var comp     = effect as ShootBlast;

            if (comp.BaseBlast is Blast blast)
            {
                template.BaseBlast             = blast.name;
                template.AffectHitTargetCenter = blast.AffectHitTargetCenter;
                template.HitOnShoot            = blast.HitOnShoot;
                template.IgnoreShooter         = blast.IgnoreShooter;
                template.Interruptible         = blast.Interruptible;
                template.MaxHitTargetCount     = blast.MaxHitTargetCount;
                template.Radius      = blast.Radius;
                template.RefreshTime = blast.RefreshTime;

                template.BlastLifespan      = comp.BlastLifespan;
                template.InstantiatedAmount = comp.InstanstiatedAmount;

                foreach (Transform child in blast.transform)
                {
                    var effectsChild = DM_EffectTransform.ParseTransform(child);

                    if (effectsChild.ChildEffects.Count > 0 || effectsChild.Effects.Count > 0 || effectsChild.EffectConditions.Count > 0)
                    {
                        template.BlastEffects.Add(effectsChild);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void Serialize(TrapEffectRecipe recipe, DeployableTrap trap)
        {
            var items = (Item[])At.GetField(recipe, "m_compatibleItems");
            var tags  = (TagSourceSelector[])At.GetField(recipe, "m_compatibleTags");

            trap.GetCompatibleFilters();

            var compatibleTags = ((List <Tag>[])At.GetField <DeployableTrap>("COMPATIBLE_TAGS"))[(int)trap.CurrentTrapType];

            if (items != null)
            {
                foreach (var item in items)
                {
                    switch (trap.CurrentTrapType)
                    {
                    case DeployableTrap.TrapType.PressurePlateTrap:
                        if (!item.HasTag(TagSourceManager.PlateTrapComponent) && !HasAnyTag(item, compatibleTags))
                        {
                            continue;
                        }
                        break;

                    case DeployableTrap.TrapType.TripWireTrap:
                        if (!item.HasTag(TagSourceManager.TripWireTrapComponent) && !HasAnyTag(item, compatibleTags))
                        {
                            continue;
                        }
                        break;
                    }

                    this.CompatibleItemIDs.Add(item.Name);
                }
            }


            if (tags != null)
            {
                foreach (var tag in tags)
                {
                    this.CompatibleItemTags.Add(tag.Tag.TagName);
                }
            }

            if (recipe.TrapEffectsPrefab)
            {
                this.StandardEffects = new List <DM_Effect>();
                foreach (var effect in recipe.TrapEffectsPrefab.GetComponents <Effect>())
                {
                    this.StandardEffects.Add(DM_Effect.ParseEffect(effect));
                }
            }
            if (recipe.HiddenTrapEffectsPrefab)
            {
                this.HiddenEffects = new List <DM_Effect>();
                foreach (var effect in recipe.HiddenTrapEffectsPrefab.GetComponents <Effect>())
                {
                    this.HiddenEffects.Add(DM_Effect.ParseEffect(effect));
                }
            }
        }
Ejemplo n.º 5
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var template = holder as DM_Summon;
            var comp     = effect as Summon;

            if (comp == null)
            {
                return;
            }

            if (effect is SummonAI)
            {
                template.SummonPrefabType = PrefabTypes.Resource;

                var name = comp.SummonedPrefab?.name.Replace("(Clone)", "").Trim();

                template.Prefab = name;
            }
            else
            {
                template.SummonPrefabType = PrefabTypes.Item;

                template.Prefab = comp.SummonedPrefab?.gameObject.GetComponent <Item>()?.ItemID.ToString() ?? comp.SummonedPrefab?.name;
            }

            template.BufferSize              = comp.BufferSize;
            template.LimitOfOne              = comp.LimitOfOne;
            template.SummonMode              = comp.InstantiationMode;
            template.PositionType            = comp.PositionType;
            template.MinDistance             = comp.MinDistance;
            template.MaxDistance             = comp.MaxDistance;
            template.SameDirectionAsSummoner = comp.SameDirAsSummoner;
            template.SummonLocalForward      = comp.SummonLocalForward;
            template.IgnoreOnDestroy         = comp.IgnoreOnDestroy;
        }
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp = effect as AffectStatusEffectBuildUpResistance;

            StatusEffectIdentifier = comp.StatusEffect?.IdentifierName;
            Value    = comp.Value;
            Duration = comp.Duration;
        }
Ejemplo n.º 7
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var comp = effect as AddStatusEffectBuildUpInstrument;

            ChancesPerCharge = comp.ChancesPerCharge;
        }
Ejemplo n.º 8
0
 public override void SerializeEffect <T>(T effect, DM_Effect holder)
 {
     if ((effect as AddStatusEffect).Status)
     {
         (holder as DM_AddStatusEffect).StatusEffect     = (effect as AddStatusEffect).Status.IdentifierName;
         (holder as DM_AddStatusEffect).ChanceToContract = (effect as AddStatusEffect).BaseChancesToContract;
     }
 }
Ejemplo n.º 9
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp = effect as AddAllStatusEffectBuildUp;

            BuildUpValue     = comp.BuildUpValue;
            NoDealer         = comp.NoDealer;
            AffectController = comp.AffectController;
            BuildUpBonus     = (float)At.GetField(comp, "m_buildUpBonus");
        }
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var comp = effect as PunctualDamageInstrument;

            DamageCap       = comp.DamageCap;
            DamagePerCharge = comp.DamagePerCharge;
        }
Ejemplo n.º 11
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var puncDamage = effect as PunctualDamage;

            Knockback             = puncDamage.Knockback;
            HitInventory          = puncDamage.HitInventory;
            Damage                = Damages.ParseDamageArray(puncDamage.Damages);
            Damages_AI            = Damages.ParseDamageArray(puncDamage.DamagesAI);
            IgnoreHalfResistances = puncDamage.IgnoreHalfResistances;
        }
Ejemplo n.º 12
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var template = holder as DM_ThrowItem;
            var comp     = effect as ThrowItem;

            template.CollisionBehaviour  = comp.CollisionBehavior;
            template.ProjectileBehaviour = comp.ProjectileBehavior;
        }
Ejemplo n.º 13
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var template = holder as DM_PlaySoundEffect;
            var comp     = effect as PlaySoundEffect;

            template.Follow   = comp.Follow;
            template.MaxPitch = comp.MaxPitch;
            template.MinPitch = comp.MinPitch;
            template.Sounds   = comp.Sounds.ToList();
        }
Ejemplo n.º 14
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp     = effect as Shooter;
            var template = holder as DM_Shooter;

            template.CastPosition     = comp.CastPosition;
            template.NoAim            = comp.NoAim;
            template.LocalPositionAdd = comp.LocalCastPositionAdd;
            template.TargetType       = comp.TargetType;
            template.TransformName    = comp.TransformName;
        }
Ejemplo n.º 15
0
        public override void SerializeEffect<T>(T effect, DM_Effect holder)
        {
            var template = holder as DM_Teleport;
            var comp = effect as Teleport;

            template.MaxRange = comp.MaxRange;
            template.MaxYDiff = comp.MaxYDiff;
            template.MaxTargetRange = comp.MaxTargetRange;
            template.OffsetRelativeTarget = comp.OffsetRelativeTarget;
            template.UseTarget = comp.UseTarget;
        }
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var template = holder as DM_PunctualDamageAoE;
            var comp     = effect as PunctualDamageAoE;

            template.Radius        = comp.Radius;
            template.TargetType    = comp.TargetType;
            template.IgnoreShooter = comp.IgnoreShooter;
        }
Ejemplo n.º 17
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var template = holder as DM_RunicBlade;
            var comp     = effect as RunicBlade;

            template.SummonLifespan       = comp.SummonLifeSpan;
            template.WeaponID             = comp.RunicBladePrefab.ItemID;
            template.GreaterWeaponID      = comp.RunicGreatBladePrefab.ItemID;
            template.PrefixImbueID        = comp.ImbueAmplifierRunicBlade.PresetID;
            template.PrefixGreaterImbueID = comp.ImbueAmplifierGreatRunicBlade.PresetID;
        }
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp = effect as AddStatusEffectBuildUp;

            if (comp.Status)
            {
                StatusEffect = comp.Status.IdentifierName;
            }

            Buildup           = comp.BuildUpValue;
            BuildUpMultiplier = comp.BuildUpMultiplier;
            BypassCounter     = comp.BypassCounter;
            AffectController  = comp.AffectController;
        }
Ejemplo n.º 19
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp = effect as AffectStat;

            this.Stat_Tag       = comp.AffectedStat.Tag.TagName;
            this.AffectQuantity = comp.Value;
            this.IsModifier     = comp.IsModifier;

            if (comp.Tags != null)
            {
                this.Tags = comp.Tags
                            .Select(it => it.Tag.TagName)
                            .ToArray();
            }
        }
Ejemplo n.º 20
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var weaponDamage = effect as WeaponDamage;
            var wdHolder     = holder as DM_WeaponDamage;

            wdHolder.ForceOnlyLeftHand       = weaponDamage.ForceOnlyLeftHand;
            wdHolder.OverrideType            = weaponDamage.OverrideDType;
            wdHolder.Damage_Multiplier       = weaponDamage.WeaponDamageMult;
            wdHolder.Damage_Multiplier_Kback = weaponDamage.WeaponDamageMultKBack;
            wdHolder.Damage_Multiplier_Kdown = weaponDamage.WeaponDamageMultKDown;
            wdHolder.Impact_Multiplier       = weaponDamage.WeaponKnockbackMult;
            wdHolder.Impact_Multiplier_Kback = weaponDamage.WeaponKnockbackMultKBack;
            wdHolder.Impact_Multiplier_Kdown = weaponDamage.WeaponKnockbackMultKDown;
        }
        public static DM_EffectTransform ParseTransform(Transform transform)
        {
            var effectTransformHolder = new DM_EffectTransform
            {
                TransformName = transform.name
            };

            foreach (Effect effect in transform.GetComponents<Effect>())
            {
                if (!effect.enabled)
                {
                    continue;
                }

                if (DM_Effect.ParseEffect(effect) is DM_Effect holder)
                {
                    effectTransformHolder.Effects.Add(holder);
                }
            }

            foreach (EffectCondition condition in transform.GetComponents<EffectCondition>())
            {
                var effectConditionHolder = DM_EffectCondition.ParseCondition(condition);
                effectTransformHolder.EffectConditions.Add(effectConditionHolder);
            }

            foreach (Transform child in transform)
            {
                if (child.name == "ExplosionFX" || child.name == "ProjectileFX")
                {
                    // visual effects, we dont care about these
                    continue;
                }

                var transformHolder = ParseTransform(child);
                if (transformHolder.ChildEffects.Count > 0 || transformHolder.Effects.Count > 0 || transformHolder.EffectConditions.Count > 0)
                {
                    effectTransformHolder.ChildEffects.Add(transformHolder);
                }
            }

            return effectTransformHolder;
        }
Ejemplo n.º 22
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var template = holder as DM_ShootProjectile;
            var comp     = effect as ShootProjectile;

            if (comp.BaseProjectile is Projectile projectile)
            {
                template.BaseProjectile = projectile.name;

                template.AutoTarget               = comp.AutoTarget;
                template.AutoTargetMaxAngle       = comp.AutoTargetMaxAngle;
                template.AutoTargetRange          = comp.AutoTargetRange;
                template.IgnoreShooterCollision   = comp.IgnoreShooterCollision;
                template.TargetCountPerProjectile = comp.TargetCountPerProjectile;
                template.TargetingMode            = comp.TargetingMode;
                template.TargetRange              = comp.TargetRange;
                template.InstantiatedAmount       = comp.IntanstiatedAmount;

                template.DisableOnHit = projectile.DisableOnHit;
                template.EffectsOnlyIfHitCharacter = projectile.EffectsOnlyIfHitCharacter;
                template.EndMode       = projectile.EndMode;
                template.LateShootTime = projectile.LateShootTime;
                template.Lifespan      = projectile.Lifespan;
                template.Unblockable   = projectile.Unblockable;

                if (comp.ProjectileShots != null)
                {
                    template.ProjectileShots = comp.ProjectileShots.Length;
                }

                foreach (Transform child in projectile.transform)
                {
                    var effectsChild = DM_EffectTransform.ParseTransform(child);

                    if (effectsChild.ChildEffects.Count > 0 || effectsChild.Effects.Count > 0 || effectsChild.EffectConditions.Count > 0)
                    {
                        template.ProjectileEffects.Add(effectsChild);
                    }
                }
            }
        }
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            base.SerializeEffect(effect, holder);

            var template = holder as DM_ShootBlastHornetControl;
            var comp     = effect as ShootBlastHornetControl;

            template.BurstSkillID = comp.BurstSkill?.ItemID ?? -1;
            template.HealSkillID  = comp.HealSkill?.ItemID ?? -1;

            template.Acceleration             = comp.Acceleration;
            template.DistStayOnTarget         = comp.DistStayOnTarget;
            template.EndEffectTriggerDist     = comp.EndEffectTriggerDist;
            template.EnvironmentCheckRadius   = comp.EnvironmentCheckRadius;
            template.HornetLookForTargetRange = comp.HornetLookForTargetRange;
            template.HornetPassiveAttackTimer = comp.HornetPassiveAttackTimer;
            template.HornetPassiveTargetRange = comp.HornetPassiveTargetRange;
            template.PassiveTimeFlight        = comp.PassiveTimeFlight;
            template.PassiveTimeStayOnTarget  = comp.PassiveTimeStayOnTarget;
            template.Speed = comp.Speed;
            template.SpeedDistLerpWhenCloseMult = comp.SpeedDistLerpWhenCloseMult;
            template.TimeFlight       = comp.TimeFlight;
            template.TimeStayOnTarget = comp.TimeStayOnTarget;
        }
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var template = holder as DM_RemoveStatusEffect;
            var comp     = effect as RemoveStatusEffect;

            template.CleanseType = comp.CleanseType;

            if (template.CleanseType == RemoveStatusEffect.RemoveTypes.StatusSpecific && comp.StatusEffect)
            {
                template.Status_Name = comp.StatusEffect.IdentifierName;
            }
            else if (template.CleanseType == RemoveStatusEffect.RemoveTypes.StatusFamily && comp.StatusFamily != null)
            {
                template.Status_Name = comp.StatusFamily.SelectorValue;
            }
            else if (template.CleanseType == RemoveStatusEffect.RemoveTypes.StatusType)
            {
                template.Status_Tag = comp.StatusType?.Tag.TagName;
            }
            else if (template.CleanseType == RemoveStatusEffect.RemoveTypes.StatusNameContains)
            {
                template.Status_Name = comp.StatusName;
            }
        }
Ejemplo n.º 25
0
 public override void SerializeEffect <T>(T effect, DM_Effect holder)
 {
     (holder as DM_LightLantern).Light = (effect as LightLantern).Light;
 }
Ejemplo n.º 26
0
        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
            var comp = effect as AddChargeInstrument;

            Charges = comp.Charges;
        }
Ejemplo n.º 27
0
 public override void SerializeEffect <T>(T effect, DM_Effect holder)
 {
     UnlockedAchievement = (effect as AchievementOnEffect).UnlockedAchievement;
 }
Ejemplo n.º 28
0
 public override void SerializeEffect <T>(T effect, DM_Effect holder)
 {
     (holder as DM_LoadWeapon).WeaponSlot  = (effect as LoadWeapon).WeaponSlot;
     (holder as DM_LoadWeapon).UnloadFirst = (effect as LoadWeapon).UnloadFirst;
 }
Ejemplo n.º 29
0
        // This class uses no fields, it's a self-executing effect.

        public override void SerializeEffect <T>(T effect, DM_Effect holder)
        {
        }
Ejemplo n.º 30
0
 public override void SerializeEffect <T>(T effect, DM_Effect holder)
 {
     (holder as DM_Stun).Duration = (effect as Stun).Duration;
 }