protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is PowerLevelAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(PowerUnitsRequired, () => wrapper.PowerUnitsRequired);
            loader.ApplyPMultPatch(PowerUnitsRequiredMult, () => wrapper.PowerUnitsRequired);

            loader.ApplyPPatch(HeatPointsProvided, () => wrapper.HeatPointsProvided);
            loader.ApplyPMultPatch(HeatPointsProvidedMult, () => wrapper.HeatPointsProvided);

            var statusEffects = wrapper.StatusEffectsToApply?.Select(x => new StatusEffectAttributesWrapper(x)).ToList() ?? new List <StatusEffectAttributesWrapper>();

            loader.ApplyNamedLPatch(StatusEffectsToApply, statusEffects, (x) => new StatusEffectAttributesWrapper(x), "StatusEffectsToApply");
            wrapper.StatusEffectsToApply = statusEffects.ToArray();

            if (LocalizedShortDescriptionStringID != null)
            {
                PowerLevelViewAttributesWrapper powerLevelViewAttributesWrapper = new PowerLevelViewAttributesWrapper(wrapper.View);
                loader.ApplyPPatch(LocalizedShortDescriptionStringID, () => powerLevelViewAttributesWrapper.LocalizedShortDescriptionStringID);
                wrapper.View = powerLevelViewAttributesWrapper;
            }
        }
Esempio n. 2
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is HarvesterAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(SalvageDistance, () => w.SalvageDistance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(SalvageDistanceMult, () => w.SalvageDistance);

            loader.ApplyPPatch(MaxDropOffRange, () => w.MaxDropOffRange, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MaxDropOffRangeMult, () => w.MaxDropOffRange);

            loader.ApplyPPatch(ClosestResourceControllerHysteresisDistance, () => w.ClosestResourceControllerHysteresisDistance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(ClosestResourceControllerHysteresisDistanceMult, () => w.ClosestResourceControllerHysteresisDistance);

            loader.ApplyPPatch(AutoReturnToDepositOnArtifactPickup, () => w.AutoReturnToDepositOnArtifactPickup);

            if (SalvageCycles != null)
            {
                var l = w.SalvageCycles?.Select(x => new SalvageCycleWrapper(x)).ToList() ?? new List <SalvageCycleWrapper>();
                loader.ApplyLPatch(SalvageCycles, l, () => new SalvageCycleWrapper(), nameof(SalvageCycle));
                w.SalvageCycles = l.ToArray();
            }
        }
Esempio n. 3
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ResearchItemAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(Resource1Cost, () => wrapper.Resource1Cost);
            loader.ApplyPMultPatch(Resource1CostMult, () => wrapper.Resource1Cost);

            loader.ApplyPPatch(Resource2Cost, () => wrapper.Resource2Cost);
            loader.ApplyPMultPatch(Resource2CostMult, () => wrapper.Resource2Cost);

            loader.ApplyPPatch(ResearchTime, () => wrapper.ResearchTime, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(ResearchTimeMult, () => wrapper.ResearchTime);

            loader.ApplyPPatch(TypeOfResearch, () => wrapper.TypeOfResearch);
            loader.ApplyPPatch(IconSpriteName, () => wrapper.IconSpriteName);
            loader.ApplyPPatch(LocalizedResearchTitleStringID, () => wrapper.LocalizedResearchTitleStringID);
            loader.ApplyPPatch(LocalizedShortDescriptionStringID, () => wrapper.LocalizedShortDescriptionStringID);
            loader.ApplyPPatch(LocalizedLongDescriptionStringID, () => wrapper.LocalizedLongDescriptionStringID);
            loader.ApplyPPatch(Dependencies, () => wrapper.Dependencies);
            loader.ApplyPPatch(ResearchVOCode, () => wrapper.ResearchVOCode);

            if (UnitTypeBuffs != null)
            {
                var l = wrapper.UnitTypeBuffs?.Select(x => new UnitTypeBuffWrapper(x)).ToList() ?? new List <UnitTypeBuffWrapper>();
                loader.ApplyLPatch(UnitTypeBuffs, l, () => new UnitTypeBuffWrapper(), nameof(UnitTypeBuff));
                wrapper.UnitTypeBuffs = l.Where(x => x != null).ToArray();
            }
        }
Esempio n. 4
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is UnitHangarAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(AlignmentTime, () => w.AlignmentTime, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AlignmentTimeMult, () => w.AlignmentTime);

            loader.ApplyPPatch(ApproachTime, () => w.ApproachTime, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(ApproachTimeMult, () => w.ApproachTime);

            for (var i = 0; i < w.HangarBays.Length; i++)
            {
                var hangarBay = w.HangarBays[i];
                if (HangarBays.TryGetValue(hangarBay.Name, out HangarBayPatch hangarBayPatch))
                {
                    using (loader.logger.BeginScope($"HangarBay: {hangarBay.Name}"))
                    {
                        var hangarBayWrapper = new HangarBayWrapper(hangarBay);
                        hangarBayPatch.Apply(loader, hangarBayWrapper, null);
                        w.HangarBays[i] = hangarBayWrapper;
                    }
                }
            }
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is PowerSystemAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(StartingPowerLevelIndex, () => wrapper.StartingPowerLevelIndex);
            loader.ApplyPMultPatch(StartingPowerLevelIndexMult, () => wrapper.StartingPowerLevelIndex);

            loader.ApplyPPatch(StartingMaxPowerLevelIndex, () => wrapper.StartingMaxPowerLevelIndex);
            loader.ApplyPMultPatch(StartingMaxPowerLevelIndexMult, () => wrapper.StartingMaxPowerLevelIndex);

            loader.ApplyPPatch(PowerSystemType, () => wrapper.PowerSystemType);

            {
                var l = wrapper.PowerLevels?.Select(x => new PowerLevelAttributesWrapper(x)).ToList() ?? new List <PowerLevelAttributesWrapper>();
                loader.ApplyLPatch(PowerLevels, l, () => new PowerLevelAttributesWrapper(), "PowerLevels");
                wrapper.PowerLevels = l.ToArray();
            }

            if (View != null)
            {
                PowerSystemViewAttributesWrapper powerSystemViewAttributesWrapper = new PowerSystemViewAttributesWrapper(wrapper.View);
                View.Apply(loader, powerSystemViewAttributesWrapper, null);
                wrapper.View = powerSystemViewAttributesWrapper;
            }
        }
Esempio n. 6
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ProjectileAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(DetonationDelay, () => wrapper.DetonationDelay, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(DetonationDelayMult, () => wrapper.DetonationDelay);

            loader.ApplyPPatch(MissStageIndex, () => wrapper.MissStageIndex);
            loader.ApplyPMultPatch(MissStageIndexMult, () => wrapper.MissStageIndex);

            loader.ApplyPPatch(MinimumMissDistance, () => wrapper.MinimumMissDistance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MinimumMissDistanceMult, () => wrapper.MinimumMissDistance);

            loader.ApplyPPatch(MaximumMissDistance, () => wrapper.MaximumMissDistance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MaximumMissDistanceMult, () => wrapper.MaximumMissDistance);

            loader.ApplyPPatch(ProjectileType, () => wrapper.ProjectileType);

            if (Stages.Count > 0)
            {
                var l = wrapper.Stages?.Select(x => new ProjectileMotionStageWrapper(x)).ToList() ?? new List <ProjectileMotionStageWrapper>();
                loader.ApplyLPatch(Stages, l, () => new ProjectileMotionStageWrapper(), nameof(ProjectileMotionStage));
                wrapper.Stages = l.ToArray();
            }
        }
Esempio n. 7
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is PeelOutAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(InitialForwardAccelerationPercentage, () => w.InitialForwardAccelerationPercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(InitialForwardAccelerationPercentage, () => w.InitialForwardAccelerationPercentage);

            loader.ApplyPPatch(RadiusProportionalGrowthConstant, () => w.RadiusProportionalGrowthConstant, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(RadiusProportionalGrowthConstant, () => w.RadiusProportionalGrowthConstant);

            loader.ApplyPPatch(InitialTurnRadiusAsMaxTurnRadiusPercentage, () => w.InitialTurnRadiusAsMaxTurnRadiusPercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(InitialTurnRadiusAsMaxTurnRadiusPercentage, () => w.InitialTurnRadiusAsMaxTurnRadiusPercentage);

            loader.ApplyPPatch(MaxTurnRatePercentage, () => w.MaxTurnRatePercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MaxTurnRatePercentage, () => w.MaxTurnRatePercentage);

            loader.ApplyPPatch(UsePeelOut, () => w.UsePeelOut);
            loader.ApplyPPatch(DoOppositeTurn, () => w.DoOppositeTurn);

            if (PeelOutRegion != null)
            {
                using (loader.logger.BeginScope($"PeelOutRegion:"))
                {
                    var w2 = new ManeuverRegionAttributesWrapper(w.PeelOutRegion);
                    PeelOutRegion.Apply(loader, w2, null);
                    w.PeelOutRegion = w2;
                }
            }
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is TargetPriorizationAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(WeaponEffectivenessWeight, () => wrapper.WeaponEffectivenessWeight, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(WeaponEffectivenessWeightMult, () => wrapper.WeaponEffectivenessWeight);

            loader.ApplyPPatch(TargetThreatWeight, () => wrapper.TargetThreatWeight, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TargetThreatWeightMult, () => wrapper.TargetThreatWeight);

            loader.ApplyPPatch(DistanceWeight, () => wrapper.DistanceWeight, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(DistanceWeightMult, () => wrapper.DistanceWeight);

            loader.ApplyPPatch(AngleWeight, () => wrapper.AngleWeight, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AngleWeightMult, () => wrapper.AngleWeight);

            loader.ApplyPPatch(TargetPriorityWeight, () => wrapper.TargetPriorityWeight, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TargetPriorityWeightMult, () => wrapper.TargetPriorityWeight);

            loader.ApplyPPatch(AutoTargetStickyBias, () => wrapper.AutoTargetStickyBias, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AutoTargetStickyBiasMult, () => wrapper.AutoTargetStickyBias);

            loader.ApplyPPatch(ManualTargetStickyBias, () => wrapper.ManualTargetStickyBias, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(ManualTargetStickyBiasMult, () => wrapper.ManualTargetStickyBias);

            loader.ApplyPPatch(TargetSameCommanderBias, () => wrapper.TargetSameCommanderBias, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TargetSameCommanderBiasMult, () => wrapper.TargetSameCommanderBias);

            loader.ApplyPPatch(TargetWithinFOVBias, () => wrapper.TargetWithinFOVBias, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TargetWithinFOVBiasMult, () => wrapper.TargetWithinFOVBias);
        }
Esempio n. 9
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is InventoryAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(Capacity, () => wrapper.Capacity);
            loader.ApplyPMultPatch(CapacityMult, () => wrapper.Capacity);

            loader.ApplyPPatch(StartingAmount, () => wrapper.StartingAmount);
            loader.ApplyPMultPatch(StartingAmountMult, () => wrapper.StartingAmount);

            loader.ApplyPPatch(HasUnlimitedCapacity, () => wrapper.HasUnlimitedCapacity);
        }
Esempio n. 10
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ResourceAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(StartingAmount, () => wrapper.StartingAmount);
            loader.ApplyPMultPatch(StartingAmountMult, () => wrapper.StartingAmount);

            loader.ApplyPPatch(MaxHarvesters, () => wrapper.MaxHarvesters);
            loader.ApplyPMultPatch(MaxHarvestersMult, () => wrapper.MaxHarvesters);

            loader.ApplyPPatch(ResourceType, () => wrapper.ResourceType);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is RangeBasedWeaponAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(Accuracy, () => wrapper.Accuracy, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AccuracyMult, () => wrapper.Accuracy);

            loader.ApplyPPatch(Distance, () => wrapper.Distance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(DistanceMult, () => wrapper.Distance);

            loader.ApplyPPatch(MinDistance, () => wrapper.MinDistance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MinDistanceMult, () => wrapper.MinDistance);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is AirSortieAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(LoiterLength, () => w.LoiterLength, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(LoiterLengthMult, () => w.LoiterLength);

            loader.ApplyPPatch(SetAttackTargetsWithinRadius, () => w.SetAttackTargetsWithinRadius, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(SetAttackTargetsWithinRadiusMult, () => w.SetAttackTargetsWithinRadius);

            loader.ApplyPPatch(SortieSquadSize, () => w.SortieSquadSize);
            loader.ApplyPMultPatch(SortieSquadSizeMult, () => w.SortieSquadSize);
        }
Esempio n. 13
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is TurretAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(FieldOfFire, () => wrapper.FieldOfFire, x => Fixed64.UnsafeFromDouble(x));
            loader.ApplyPMultPatch(FieldOfFireMult, () => wrapper.FieldOfFire);

            loader.ApplyPPatch(FieldOfView, () => wrapper.FieldOfView, x => Fixed64.UnsafeFromDouble(x));
            loader.ApplyPMultPatch(FieldOfViewMult, () => wrapper.FieldOfView);

            loader.ApplyPPatch(RotationSpeed, () => wrapper.RotationSpeed, x => Fixed64.UnsafeFromDouble(x));
            loader.ApplyPMultPatch(RotationSpeedMult, () => wrapper.RotationSpeed);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ManeuverRegionAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(HalfAngle, () => w.HalfAngle, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(HalfAngleMult, () => w.HalfAngle);

            loader.ApplyPPatch(MinRange, () => w.MinRange, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MinRangeMult, () => w.MinRange);

            loader.ApplyPPatch(MaxRange, () => w.MaxRange, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MaxRangeMult, () => w.MaxRange);

            loader.ApplyPPatch(Direction, () => w.Direction);
        }
Esempio n. 15
0
        protected override void Apply(AttributeLoader loader, object wrapperObjj)
        {
            if (!(wrapperObjj is SalvageCycleWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(CycleDuration, () => w.CycleDuration, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(CycleDurationMult, () => w.CycleDuration);

            loader.ApplyPPatch(ResourcesLoadedPerCycle, () => w.ResourcesLoadedPerCycle);
            loader.ApplyPMultPatch(ResourcesLoadedPerCycleMult, () => w.ResourcesLoadedPerCycle);

            loader.ApplyPPatch(ResourcesExtractedPerCycle, () => w.ResourcesExtractedPerCycle);
            loader.ApplyPMultPatch(ResourcesExtractedPerCycleMult, () => w.ResourcesExtractedPerCycle);

            loader.ApplyPPatch(ResourceType, () => w.ResourceType);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ReversePolarityAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(RelativeWeight, () => w.RelativeWeight, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(RelativeWeightMult, () => w.RelativeWeight);

            loader.ApplyPPatch(PushRadiusMultiplier, () => w.PushRadiusMultiplier, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(PushRadiusMultiplierMult, () => w.PushRadiusMultiplier);

            loader.ApplyPPatch(SquishinessFactor, () => w.SquishinessFactor, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(SquishinessFactorMult, () => w.SquishinessFactor);

            loader.ApplyPPatch(Enabled, () => w.Enabled);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is PowerShuntAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(PowerLevelChargeTimeSeconds, () => wrapper.PowerLevelChargeTimeSeconds, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(PowerLevelChargeTimeSecondsMult, () => wrapper.PowerLevelChargeTimeSeconds);

            loader.ApplyPPatch(PowerLevelDrainTimeSeconds, () => wrapper.PowerLevelDrainTimeSeconds, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(PowerLevelDrainTimeSecondsMult, () => wrapper.PowerLevelDrainTimeSeconds);

            loader.ApplyPPatch(HeatThreshold, () => wrapper.HeatThreshold);
            loader.ApplyPMultPatch(HeatThresholdMult, () => wrapper.HeatThreshold);

            loader.ApplyPPatch(CooldownRate, () => wrapper.CooldownRate);
            loader.ApplyPMultPatch(CooldownRateMult, () => wrapper.CooldownRate);

            loader.ApplyPPatch(OverheatDamage, () => wrapper.OverheatDamage);
            loader.ApplyPMultPatch(OverheatDamageMult, () => wrapper.OverheatDamage);

            loader.ApplyPPatch(NearOverheatWarningMargin, () => wrapper.NearOverheatWarningMargin);
            loader.ApplyPMultPatch(NearOverheatWarningMarginMult, () => wrapper.NearOverheatWarningMargin);

            loader.ApplyPPatch(OverheatReminderPeriod, () => wrapper.OverheatReminderPeriod);
            loader.ApplyPMultPatch(OverheatReminderPeriodMult, () => wrapper.OverheatReminderPeriod);

            {
                var l = wrapper.PowerSystems?.Select(x => new PowerSystemAttributesWrapper(x)).ToList() ?? new List <PowerSystemAttributesWrapper>();
                loader.ApplyLPatch(PowerSystems, l, () => new PowerSystemAttributesWrapper(), "PowerSystems");
                wrapper.PowerSystems = l.ToArray();
            }

            if (ReservePowerPool != null)
            {
                InventoryAttributesWrapper inventoryAttributesWrapper = new InventoryAttributesWrapper(wrapper.ReservePowerPool);
                ReservePowerPool.Apply(loader, inventoryAttributesWrapper, null);
                wrapper.ReservePowerPool = inventoryAttributesWrapper;
            }
            if (OverheatingPool != null)
            {
                InventoryAttributesWrapper inventoryAttributesWrapper = new InventoryAttributesWrapper(wrapper.OverheatingPool);
                OverheatingPool.Apply(loader, inventoryAttributesWrapper, null);
                wrapper.OverheatingPool = inventoryAttributesWrapper;
            }
            if (HeatSystem != null)
            {
                InventoryAttributesWrapper inventoryAttributesWrapper = new InventoryAttributesWrapper(wrapper.HeatSystem);
                HeatSystem.Apply(loader, inventoryAttributesWrapper, null);
                wrapper.HeatSystem = inventoryAttributesWrapper;
            }
            if (View != null)
            {
                PowerShuntViewAttributesWrapper powerShuntViewAttributesWrapper = new PowerShuntViewAttributesWrapper(wrapper.View);
                View.Apply(loader, powerShuntViewAttributesWrapper, null);
                wrapper.View = powerShuntViewAttributesWrapper;
            }
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is HoverDynamicsAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(TurnAcceleration, () => w.TurnAcceleration, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TurnAccelerationMult, () => w.TurnAcceleration);

            loader.ApplyPPatch(TurnMaxLookAheadTime, () => w.TurnMaxLookAheadTime, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TurnMaxLookAheadTimeMult, () => w.TurnMaxLookAheadTime);

            loader.ApplyPPatch(NoTurnDistance, () => w.NoTurnDistance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(NoTurnDistanceMult, () => w.NoTurnDistance);

            loader.ApplyPPatch(FaceTargetOnlyInCombat, () => w.FaceTargetOnlyInCombat);
            loader.ApplyPPatch(TurnHeuristic, () => w.TurnHeuristic);
        }
Esempio n. 19
0
		protected override void Apply(AttributeLoader loader, object wrapperObj)
		{
			if (!(wrapperObj is ActivationDependenciesAttributesWrapper w))
				throw new System.InvalidCastException();

			loader.ApplyPPatch(TakeNoDamageForMS, () => w.TakeNoDamageForMS);
			loader.ApplyPMultPatch(TakeNoDamageForMSMult, () => w.TakeNoDamageForMS);

			loader.ApplyPPatch(ManeuveringDependencies, () => w.ManeuveringDependencies);
			loader.ApplyPPatch(CommanderHasUnitWithTargetables, () => w.CommanderHasUnitWithTargetables);
		}
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is DetectableAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(LastKnownDuration, () => wrapper.LastKnownDuration, x => Fixed64.UnsafeFromDouble(x));
            loader.ApplyPMultPatch(LastKnownDurationMult, () => wrapper.LastKnownDuration);

            loader.ApplyPPatch(TimeVisibleAfterFiring, () => wrapper.TimeVisibleAfterFiring);
            loader.ApplyPMultPatch(TimeVisibleAfterFiringMult, () => wrapper.TimeVisibleAfterFiring);

            loader.ApplyPPatch(FOWFadeDuration, () => wrapper.FOWFadeDuration, x => Fixed64.UnsafeFromDouble(x));
            loader.ApplyPMultPatch(FOWFadeDurationMult, () => wrapper.FOWFadeDuration);

            loader.ApplyPPatch(DisplayLastKnownLocation, () => wrapper.DisplayLastKnownLocation);
            loader.ApplyPPatch(AlwaysVisible, () => wrapper.AlwaysVisible);
            loader.ApplyPPatch(MinimumStateAfterDetection, () => wrapper.MinimumStateAfterDetection);
            loader.ApplyPPatch(SetHasBeenSeenBeforeOnSpawn, () => wrapper.SetHasBeenSeenBeforeOnSpawn);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is EntityTypeToSpawnAttributesWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(SpawnRotationOffsetDegrees, () => wrapper.SpawnRotationOffsetDegrees, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(SpawnRotationOffsetDegreesMult, () => wrapper.SpawnRotationOffsetDegrees);

            loader.ApplyPPatch(EntityTypeToSpawn, () => wrapper.EntityTypeToSpawn);
        }
Esempio n. 22
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ChargeAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(ChargesPerUse, () => w.ChargesPerUse);
            loader.ApplyPMultPatch(ChargesPerUseMult, () => w.ChargesPerUse);

            loader.ApplyPPatch(InventoryID, () => w.InventoryID);
        }
Esempio n. 23
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ModifyInventoryAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(Delta, () => w.Delta);
            loader.ApplyPMultPatch(DeltaMult, () => w.Delta);

            loader.ApplyPPatch(InventoryID, () => w.InventoryID);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ProjectileMotionStageWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(OutroValue, () => wrapper.OutroValue, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(OutroValueMult, () => wrapper.OutroValue);

            loader.ApplyPPatch(MinSpeed, () => wrapper.MinSpeed, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MinSpeedMult, () => wrapper.MinSpeed);

            loader.ApplyPPatch(MaxSpeed, () => wrapper.MaxSpeed, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MaxSpeedMult, () => wrapper.MaxSpeed);

            loader.ApplyPPatch(AccelerationTime, () => wrapper.AccelerationTime, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AccelerationTimeMult, () => wrapper.AccelerationTime);

            loader.ApplyPPatch(OutroType, () => wrapper.OutroType);
            loader.ApplyPPatch(TurnsToTarget, () => wrapper.TurnsToTarget);
        }
Esempio n. 25
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is UnitDynamicsRandomizationParametersWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(AccelerationTimeRandomVariancePercentage, () => w.AccelerationTimeRandomVariancePercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AccelerationTimeRandomVariancePercentageMult, () => w.AccelerationTimeRandomVariancePercentage);

            loader.ApplyPPatch(MaxSpeedTurnRadiusRandomVariancePercentage, () => w.MaxSpeedTurnRadiusRandomVariancePercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MaxSpeedTurnRadiusRandomVariancePercentageMult, () => w.MaxSpeedTurnRadiusRandomVariancePercentage);

            loader.ApplyPPatch(DriftTypeRandomVariancePercentage, () => w.DriftTypeRandomVariancePercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(DriftTypeRandomVariancePercentageMult, () => w.DriftTypeRandomVariancePercentage);

            loader.ApplyPPatch(DriftOvershootFactorRandomVariancePercentage, () => w.DriftOvershootFactorRandomVariancePercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(DriftOvershootFactorRandomVariancePercentageMult, () => w.DriftOvershootFactorRandomVariancePercentage);

            loader.ApplyPPatch(MinDriftSlipSpeedRandomVariancePercentage, () => w.MinDriftSlipSpeedRandomVariancePercentage, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MinDriftSlipSpeedRandomVariancePercentageMult, () => w.MinDriftSlipSpeedRandomVariancePercentage);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is UnitAvoidanceAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(AvoidanceDistance, () => w.AvoidanceDistance, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AvoidanceDistanceMult, () => w.AvoidanceDistance);

            loader.ApplyPPatch(AvoidsCarriers, () => w.AvoidsCarriers);
            loader.ApplyPPatch(AvoidsWrecks, () => w.AvoidsWrecks);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is UnitCombatBehaviorAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(MinDesiredCombatRange, () => w.MinDesiredCombatRange, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MinDesiredCombatRangeMult, () => w.MinDesiredCombatRange);

            loader.ApplyPPatch(MaxDesiredCombatRange, () => w.MaxDesiredCombatRange, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(MaxDesiredCombatRangeMult, () => w.MaxDesiredCombatRange);

            loader.ApplyPPatch(HoverStrafeCycleDuration, () => w.HoverStrafeCycleDuration, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(HoverStrafeCycleDurationMult, () => w.HoverStrafeCycleDuration);

            loader.ApplyPPatch(HoverStrafeLateralDisplacement, () => w.HoverStrafeLateralDisplacement, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(HoverStrafeLateralDisplacementMult, () => w.HoverStrafeLateralDisplacement);

            loader.ApplyPPatch(PassiveCombatApproachMode, () => w.PassiveCombatApproachMode);
            loader.ApplyPPatch(ActiveCombatApproachMode, () => w.ActiveCombatApproachMode);
            loader.ApplyPPatch(AdvanceThroughSmokeScreen, () => w.AdvanceThroughSmokeScreen);
        }
Esempio n. 28
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is ChainCastingAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(QueuedAbilityDelay, () => w.QueuedAbilityDelay, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(QueuedAbilityDelayMult, () => w.QueuedAbilityDelay);

            loader.ApplyPPatch(QueuedAbility, () => w.QueuedAbility);
            loader.ApplyPPatch(RetryQueueIfAbilityFails, () => w.RetryQueueIfAbilityFails);
            loader.ApplyPPatch(AbilityOnToggledOff, () => w.AbilityOnToggledOff);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is WeaponModifierInfoWrapper wrapper))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(Amount, () => wrapper.Amount);
            loader.ApplyPMultPatch(AmountMult, () => wrapper.Amount);

            loader.ApplyPPatch(TargetClass, () => wrapper.TargetClass);
            loader.ApplyPPatch(ClassOperator, () => wrapper.ClassOperator);
            loader.ApplyPPatch(Modifier, () => wrapper.Modifier);
        }
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is SelfDestructAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(DurationSeconds, () => w.DurationSeconds, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(DurationSecondsMult, () => w.DurationSeconds);

            loader.ApplyPPatch(WeaponID, () => w.WeaponID);
            loader.ApplyPPatch(Lifetime, () => w.Lifetime);
            loader.ApplyPPatch(TimeoutType, () => w.TimeoutType);
        }