diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 4dd72e4d2c..33c4d80581 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -119,7 +119,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Fixed `DeployToFire` not recalculating firer's position on land if it cannot currently deploy. - `Arcing=true` projectile elevation inaccuracy can now be fixed by setting `Arcing.AllowElevationInaccuracy=false`. - Wall overlays are now drawn with the custom palette defined in `Palette` in `artmd.ini` if possible. -- Setting `ReloadInTransport` to true on units with `Ammo` will allow the ammo to be reloaded according to `Reload` or `EmptyReload` timers even while the unit is inside a transport. +- Setting `ReloadInTransport` to true on units with `Ammo` will allow the ammo to be reloaded according to `Reload` or `EmptyReload` timers even while the unit is inside a transport. Can also be defined at `[General] -> ReloadInTransport` for a global default value. - It is now possible to enable `Verses` and `PercentAtMax` to be applied on negative damage by setting `ApplyModifiersOnNegativeDamage` to true on the Warhead. - Attached animations on flying units now have their layer updated immediately after the parent unit, if on same layer they always draw above the parent. - Fixed an issue where the powered anims of `Powered` / `PoweredSpecial` buildings cease to update when being captured by enemies. @@ -754,8 +754,11 @@ CurleyShuffle= ; boolean, default to [General] -> CurleyShuffle In `rulesmd.ini`: ```ini -[SOMEAIRCRAFT] ; AircraftType -FiringForceScatter=true ; boolean +[General] +AircraftFiringForceScatter=true ; boolean + +[SOMEAIRCRAFT] ; AircraftType +FiringForceScatter= ; boolean, default to [General] -> AircraftFiringForceScatter ``` ### Extended Aircraft Missions @@ -1737,11 +1740,15 @@ DropPod.Weapon.HitLandOnly= ; boolean, default to no In `rulesmd.ini`: ```ini -[SOMETECHNO] ; TechnoType +[General] Explodes.KillPassengers=true ; boolean +Explodes.DuringBuildup=true ; boolean + +[SOMETECHNO] ; TechnoType +Explodes.KillPassengers= ; boolean, default to [General] -> Explodes.KillPassengers [SOMEBUILDING] ; BuildingType -Explodes.DuringBuildup=true ; boolean +Explodes.DuringBuildup= ; boolean, default to [General] -> Explodes.DuringBuildup ``` ### Forbid parallel AI queues @@ -2316,10 +2323,15 @@ KeepTargetOnMove.ExtraDistance=0 ; floating point value, distance in cells In `rulesmd.ini`: ```ini -[SOMEVEHICLE] ; VehicleType +[General] Sinkable= ; boolean SinkSpeed=5 ; integer, leptons per frame Sinkable.SquidGrab=true ; boolean + +[SOMEVEHICLE] ; VehicleType +Sinkable= ; boolean, default to [General] -> Sinkable +SinkSpeed=5 ; integer, leptons per frame, default to [General] -> SinkSpeed +Sinkable.SquidGrab=true ; boolean, default to [General] -> Sinkable.SquidGrab ``` ### Stationary vehicles @@ -2499,6 +2511,10 @@ Rocker.AmplitudeOverride= ; integer In `rulesmd.ini`: ```ini +[General] +CreateAnimsOnZeroDamage=false ; boolean +Conventional.IgnoreUnits=false ; boolean + [SOMEWARHEAD] ; WarheadType AnimList.PickRandom=false ; boolean AnimList.CreateAll=false ; boolean @@ -2511,8 +2527,8 @@ SplashList.CreateAll=false ; boolean SplashList.CreationInterval=0 ; integer SplashList.ScatterMin=0.0 ; floating point value, distance in cells SplashList.ScatterMax=0.0 ; floating point value, distance in cells -CreateAnimsOnZeroDamage=false ; boolean -Conventional.IgnoreUnits=false ; boolean +CreateAnimsOnZeroDamage= ; boolean, default to [General] -> CreateAnimsOnZeroDamage +Conventional.IgnoreUnits=false ; boolean, default to [General] -> Conventional.IgnoreUnits ``` ### Customizable Warhead trigger conditions @@ -2538,8 +2554,11 @@ EffectsRequireVerses=false ; boolean In `rulesmd.ini`: ```ini -[SOMEWARHEAD] ; WarheadType +[General] DecloakDamagedTargets=true ; boolean + +[SOMEWARHEAD] ; WarheadType +DecloakDamagedTargets= ; boolean, default to [General] -> DecloakDamagedTargets ``` ### Customizing locomotor warhead diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index d6d4f24f32..165ae81345 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -46,7 +46,7 @@ This page describes all the engine features that are either new and introduced b - `ForceDecloak`, if set to true, will uncloak and make the object the effect is attached to unable to cloak itself for duration of the effect. - `WeaponRange.Multiplier` and `WeaponRange.ExtraRange` can be used to multiply the weapon firing range of the object the effect is attached to, or give it an increase / decrease (measured in cells), respectively. `ExtraRange` is cumulatively applied from all attached effects after all `Multiplier` values have been applied. - `WeaponRange.AllowWeapons` can be used to list only weapons that can benefit from this range bonus and `WeaponRange.DisallowWeapons` weapons that are not allowed to, respectively. - - On TechnoTypes with `OpenTopped=true`, `OpenTopped.UseTransportRangeModifiers` can be set to true to make passengers firing out use the transport's active range bonuses instead. + - On TechnoTypes with `OpenTopped=true`, `OpenTopped.UseTransportRangeModifiers` can be set to true to make passengers firing out use the transport's active range bonuses instead. `[General] -> OpenTopped.UseTransportRangeModifiers` defines its global default value. - `Crit.Multiplier` and `Crit.ExtraChance` can be used to multiply the [critical hit](#chance-based-extra-damage-or-warhead-detonation--critical-hits) chance or grant a fixed bonus to it for the object the effect is attached to, respectively. - `Crit.AllowWarheads` can be used to list only Warheads that can benefit from this critical hit chance multiplier and `Crit.DisallowWarheads` weapons that are not allowed to, respectively. - `RevengeWeapon` can be used to temporarily grant the specified weapon as a [revenge weapon](#revenge-weapon) for the attached object. @@ -56,7 +56,7 @@ This page describes all the engine features that are either new and introduced b - Warheads can prevent reflect damage from occuring by setting `SuppressReflectDamage` to true. `SuppressReflectDamage.Types` can control which AttachEffectTypes' reflect damage is suppressed, if none are listed then all of them are suppressed. `SuppressReflectDamage.Groups` does the same thing but for all AttachEffectTypes in the listed groups. - `ReflectDamage.UseInvokerAsOwner` can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the reflected damage's owner & invoker instead of the object the effect is attached to. - `DisableWeapons` can be used to disable ability to fire any and all weapons. - - On TechnoTypes with `OpenTopped=true`, `OpenTopped.CheckTransportDisableWeapons` can be set to true to make passengers not be able to fire out if transport's weapons are disabled by `DisableWeapons`. + - On TechnoTypes with `OpenTopped=true`, `OpenTopped.CheckTransportDisableWeapons` can be set to true to make passengers not be able to fire out if transport's weapons are disabled by `DisableWeapons`. `[General] -> OpenTopped.CheckTransportDisableWeapons` defines its global default value. - `Unkillable` can be used to prevent the techno from being killed by taken damage (minimum health will be 1). - It is possible to set groups for attach effect types by defining strings in `Groups`. - Groups can be used instead of types for removing effects and weapon filters. @@ -152,14 +152,18 @@ Unkillable=false ; boolean LaserTrail.Type= ; LaserTrailType Groups= ; comma-separated list of strings (group IDs) +[General] +OpenTopped.UseTransportRangeModifiers=false ; boolean +OpenTopped.CheckTransportDisableWeapons=false ; boolean + [SOMETECHNO] ; TechnoType AttachEffect.AttachTypes= ; List of AttachEffectTypes AttachEffect.DurationOverrides= ; integer - duration overrides (comma-separated) for AttachTypes in order from first to last. AttachEffect.Delays= ; integer - delays (comma-separated) for AttachTypes in order from first to last. AttachEffect.InitialDelays= ; integer - initial delays (comma-separated) for AttachTypes in order from first to last. AttachEffect.RecreationDelays= ; integer - recreation delays (comma-separated) for AttachTypes in order from first to last. -OpenTopped.UseTransportRangeModifiers=false ; boolean -OpenTopped.CheckTransportDisableWeapons=false ; boolean +OpenTopped.UseTransportRangeModifiers= ; boolean, default to [General] -> OpenTopped.UseTransportRangeModifiers +OpenTopped.CheckTransportDisableWeapons= ; boolean, default to [General] -> OpenTopped.CheckTransportDisableWeapons [SOMEWEAPON] ; WeaponType AttachEffect.RequiredTypes= ; List of AttachEffectTypes @@ -819,6 +823,9 @@ BombParachute= ; AnimationType, default to [General] -> BombParachute In `rulesmd.ini`: ```ini +[General] +Interceptable=false ; boolean + [SOMETECHNO] ; TechnoType Interceptor=false ; boolean Interceptor.Weapon=0 ; integer, weapon slot index (0 or 1) @@ -839,7 +846,7 @@ Interceptor.KeepIntact=false ; boolean [SOMEPROJECTILE] ; Projectile Interceptable=false ; boolean -Interceptable.DeleteOnIntercept=false ; boolean +Interceptable.DeleteOnIntercept= ; boolean, default to [General] -> Interceptable Interceptable.WeaponOverride= ; WeaponType Strength=0 ; integer Armor= ; ArmorType @@ -1452,9 +1459,13 @@ PassengerDeletion.UnderEMP=false ; boolean In `rulesmd.ini`: ```ini -[SOMETECHNO] ; TechnoType +[General] Passengers.SyncOwner=false ; boolean Passengers.SyncOwner.RevertOnExit=true ; boolean + +[SOMETECHNO] ; TechnoType +Passengers.SyncOwner= ; boolean, default to [General] -> Passengers.SyncOwner +Passengers.SyncOwner.RevertOnExit= ; boolean, default to [General] -> Passengers.SyncOwner.RevertOnExit ``` ### Automatically firing weapons @@ -1566,6 +1577,9 @@ DrainMoneyDisplay.OnTarget.UseDisplayIncome= ; boolean In `rulesmd.ini`: ```ini [General] +OpenTopped.IgnoreRangefinding=false ; boolean +OpenTopped.AllowFiringIfDeactivated=true ; boolean +OpenTopped.ShareTransportTarget=true ; boolean OpenTopped.AllowFiringIfAttackedByLocomotor=true ; boolean OpenTopped.DecloakToFire=true ; boolean @@ -1573,15 +1587,19 @@ OpenTopped.DecloakToFire=true ; boolean OpenTopped.RangeBonus= ; integer, default to [CombatDamage] -> OpenToppedRangeBonus OpenTopped.DamageMultiplier= ; floating point value, default to [CombatDamage] -> OpenToppedDamageMultiplier OpenTopped.WarpDistance= ; integer, default to [CombatDamage] -> OpenToppedWarpDistance -OpenTopped.IgnoreRangefinding=false ; boolean -OpenTopped.AllowFiringIfDeactivated=true ; boolean +OpenTopped.IgnoreRangefinding= ; boolean, defaults to [General] -> OpenTopped.IgnoreRangefinding +OpenTopped.AllowFiringIfDeactivated= ; boolean, defaults to [General] -> OpenTopped.AllowFiringIfDeactivated OpenTopped.AllowFiringIfAttackedByLocomotor= ; boolean, defaults to [General] -> OpenTopped.AllowFiringIfAttackedByLocomotor -OpenTopped.ShareTransportTarget=true ; boolean +OpenTopped.ShareTransportTarget= ; boolean, defaults to [General] -> OpenTopped.ShareTransportTarget OpenTopped.DecloakToFire= ; boolean, defaults to [General] -> OpenTopped.DecloakToFire -[SOMETECHNO] ; TechnoType, passenger +[CombatDamage] OpenTransport.RangeBonus=0 ; integer OpenTransport.DamageMultiplier=1.0 ; floating point value + +[SOMETECHNO] ; TechnoType, passenger +OpenTransport.RangeBonus= ; integer, defaults to [CombatDamage] -> OpenTransport.RangeBonus +OpenTransport.DamageMultiplier= ; floating point value, defaults to [CombatDamage] -> OpenTransport.DamageMultiplier ``` ```{note} @@ -2305,8 +2323,11 @@ Ammo.DeployUnlockMaximumAmount=-1 ; integer In `rulesmd.ini`: ```ini -[SOMEVEHICLE] ; VehicleType +[General] HoverDrownable=true ; boolean + +[SOMEVEHICLE] ; VehicleType +HoverDrownable= ; boolean, default to [General] -> HoverDrownable ``` ### Damaged unit image changes diff --git a/src/Ext/Aircraft/Hooks.cpp b/src/Ext/Aircraft/Hooks.cpp index 4c063db1c5..263702fcf2 100644 --- a/src/Ext/Aircraft/Hooks.cpp +++ b/src/Ext/Aircraft/Hooks.cpp @@ -320,7 +320,7 @@ DEFINE_HOOK(0x41879D, AircraftClass_Mission_Attack_StrafeCell, 0x6) AircraftExt::FireWeapon(pThis, pTargetCell); - if (pExt->TypeExtData->FiringForceScatter) + if (pExt->TypeExtData->FiringForceScatter.Get(RulesExt::Global()->AircraftFiringForceScatter)) pTargetCell->ScatterContent(pThis->Location, true, false, false); pThis->SetDestination(pTargetCell, true); @@ -344,13 +344,13 @@ DEFINE_HOOK_AGAIN(0x418B46, AircraftClass_MissionAttack_ScatterCell1, 0x6) DEFINE_HOOK(0x41847E, AircraftClass_MissionAttack_ScatterCell1, 0x6) { GET(AircraftClass*, pThis, ESI); - return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter ? 0 : (R->Origin() + 0x44); + return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter.Get(RulesExt::Global()->AircraftFiringForceScatter) ? 0 : (R->Origin() + 0x44); } DEFINE_HOOK(0x4186DD, AircraftClass_MissionAttack_ScatterCell2, 0x5) { GET(AircraftClass*, pThis, ESI); - return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter ? 0 : (R->Origin() + 0x43); + return TechnoTypeExt::ExtMap.Find(pThis->Type)->FiringForceScatter.Get(RulesExt::Global()->AircraftFiringForceScatter) ? 0 : (R->Origin() + 0x43); } #pragma endregion diff --git a/src/Ext/Bullet/Body.cpp b/src/Ext/Bullet/Body.cpp index 6571a5b149..4f9e5ba284 100644 --- a/src/Ext/Bullet/Body.cpp +++ b/src/Ext/Bullet/Body.cpp @@ -67,7 +67,7 @@ void BulletExt::ExtData::InterceptBullet(TechnoClass* pSource, BulletClass* pInt this->InitializeLaserTrails(); // Lose target if the current bullet is no longer interceptable. - if (pSource && (!pTypeExt->Interceptable || (pTypeExt->Armor.isset() && GeneralUtils::GetWarheadVersusArmor(pInterceptor->WH, pTypeExt->Armor.Get()) == 0.0))) + if (pSource && (!pTypeExt->Interceptable.Get(RulesExt::Global()->Interceptable) || (pTypeExt->Armor.isset() && GeneralUtils::GetWarheadVersusArmor(pInterceptor->WH, pTypeExt->Armor.Get()) == 0.0))) pSource->SetTarget(nullptr); } } diff --git a/src/Ext/Bullet/Hooks.DetonateLogics.cpp b/src/Ext/Bullet/Hooks.DetonateLogics.cpp index e044ab8c0a..2cdf513384 100644 --- a/src/Ext/Bullet/Hooks.DetonateLogics.cpp +++ b/src/Ext/Bullet/Hooks.DetonateLogics.cpp @@ -246,7 +246,7 @@ DEFINE_HOOK(0x469B44, BulletClass_Logics_LandTypeCheck, 0x6) auto const pWHExt = WarheadTypeExt::ExtMap.Find(pThis->WH); - if (pWHExt->Conventional_IgnoreUnits) + if (pWHExt->Conventional_IgnoreUnits.Get(RulesExt::Global()->Conventional_IgnoreUnits)) return SkipChecks; return 0; diff --git a/src/Ext/BulletType/Body.h b/src/Ext/BulletType/Body.h index 693eba867e..71aa963a4f 100644 --- a/src/Ext/BulletType/Body.h +++ b/src/Ext/BulletType/Body.h @@ -21,7 +21,7 @@ class BulletTypeExt public: // Valueable Strength; //Use OwnerObject()->ObjectTypeClass::Strength Nullable Armor; - Valueable Interceptable; + Nullable Interceptable; Valueable Interceptable_DeleteOnIntercept; Valueable Interceptable_WeaponOverride; ValueableIdxVector LaserTrail_Types; @@ -82,7 +82,7 @@ class BulletTypeExt ExtData(BulletTypeClass* OwnerObject) : Extension(OwnerObject) , Armor {} - , Interceptable { false } + , Interceptable {} , Interceptable_DeleteOnIntercept { false } , Interceptable_WeaponOverride {} , LaserTrail_Types {} diff --git a/src/Ext/Rules/Body.cpp b/src/Ext/Rules/Body.cpp index ce46bfedff..df6a69c5c9 100644 --- a/src/Ext/Rules/Body.cpp +++ b/src/Ext/Rules/Body.cpp @@ -349,8 +349,37 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI) this->FallingDownTargetingFix.Read(exINI, GameStrings::General, "FallingDownTargetingFix"); this->AIAirTargetingFix.Read(exINI, GameStrings::General, "AIAirTargetingFix"); - this->OpenTopped_DecloakToFire.Read(exINI, GameStrings::General, "OpenTopped.DecloakToFire"); + + this->ReloadInTransport.Read(exINI, GameStrings::General, "ReloadInTransport"); + this->OpenTopped_IgnoreRangefinding.Read(exINI, GameStrings::General, "OpenTopped.IgnoreRangefinding"); + this->OpenTopped_AllowFiringIfDeactivated.Read(exINI, GameStrings::General, "OpenTopped.AllowFiringIfDeactivated"); this->OpenTopped_AllowFiringIfAttackedByLocomotor.Read(exINI, GameStrings::General, "OpenTopped.AllowFiringIfAttackedByLocomotor"); + this->OpenTopped_ShareTransportTarget.Read(exINI, GameStrings::General, "OpenTopped.ShareTransportTarget"); + this->OpenTopped_UseTransportRangeModifiers.Read(exINI, GameStrings::General, "OpenTopped.UseTransportRangeModifiers"); + this->OpenTopped_CheckTransportDisableWeapons.Read(exINI, GameStrings::General, "OpenTopped.CheckTransportDisableWeapons"); + this->OpenTopped_DecloakToFire.Read(exINI, GameStrings::General, "OpenTopped.DecloakToFire"); + this->OpenTransport_RangeBonus.Read(exINI, GameStrings::CombatDamage, "OpenTransport.RangeBonus"); + this->OpenTransport_DamageMultiplier.Read(exINI, GameStrings::CombatDamage, "OpenTransport.DamageMultiplier"); + + this->Passengers_SyncOwner.Read(exINI, GameStrings::General, "Passengers.SyncOwner"); + this->Passengers_SyncOwner_RevertOnExit.Read(exINI, GameStrings::General, "Passengers.SyncOwner.RevertOnExit"); + + this->Explodes_KillPassengers.Read(exINI, GameStrings::General, "Explodes.KillPassengers"); + this->Explodes_DuringBuildup.Read(exINI, GameStrings::General, "Explodes.DuringBuildup"); + + this->AircraftFiringForceScatter.Read(exINI, GameStrings::General, "AircraftFiringForceScatter"); + + this->HoverDrownable.Read(exINI, GameStrings::General, "HoverDrownable"); + + this->Sinkable.Read(exINI, GameStrings::General, "Sinkable"); + this->Sinkable_SquidGrab.Read(exINI, GameStrings::General, "Sinkable.SquidGrab"); + this->SinkSpeed.Read(exINI, GameStrings::General, "SinkSpeed"); + + this->CreateAnimsOnZeroDamage.Read(exINI, GameStrings::General, "CreateAnimsOnZeroDamage"); + this->Conventional_IgnoreUnits.Read(exINI, GameStrings::General, "Conventional.IgnoreUnits"); + this->DecloakDamagedTargets.Read(exINI, GameStrings::General, "DecloakDamagedTargets"); + + this->Interceptable.Read(exINI, GameStrings::General, "Interceptable"); this->SortCameoByName.Read(exINI, GameStrings::General, "SortCameoByName"); @@ -687,8 +716,29 @@ void RulesExt::ExtData::Serialize(T& Stm) .Process(this->IvanBombAttachToCenter) .Process(this->FallingDownTargetingFix) .Process(this->AIAirTargetingFix) - .Process(this->OpenTopped_DecloakToFire) + .Process(this->ReloadInTransport) + .Process(this->OpenTopped_IgnoreRangefinding) + .Process(this->OpenTopped_AllowFiringIfDeactivated) .Process(this->OpenTopped_AllowFiringIfAttackedByLocomotor) + .Process(this->OpenTopped_ShareTransportTarget) + .Process(this->OpenTopped_UseTransportRangeModifiers) + .Process(this->OpenTopped_CheckTransportDisableWeapons) + .Process(this->OpenTopped_DecloakToFire) + .Process(this->OpenTransport_RangeBonus) + .Process(this->OpenTransport_DamageMultiplier) + .Process(this->Passengers_SyncOwner) + .Process(this->Passengers_SyncOwner_RevertOnExit) + .Process(this->Explodes_KillPassengers) + .Process(this->Explodes_DuringBuildup) + .Process(this->AircraftFiringForceScatter) + .Process(this->HoverDrownable) + .Process(this->Sinkable) + .Process(this->Sinkable_SquidGrab) + .Process(this->SinkSpeed) + .Process(this->CreateAnimsOnZeroDamage) + .Process(this->Conventional_IgnoreUnits) + .Process(this->DecloakDamagedTargets) + .Process(this->Interceptable) .Process(this->SortCameoByName) .Process(this->MergeBuildingDamage) .Process(this->BuildingRadioLink_SyncOwner) diff --git a/src/Ext/Rules/Body.h b/src/Ext/Rules/Body.h index 12736c3c7c..250257f685 100644 --- a/src/Ext/Rules/Body.h +++ b/src/Ext/Rules/Body.h @@ -298,8 +298,37 @@ class RulesExt Valueable FallingDownTargetingFix; Valueable AIAirTargetingFix; - Valueable OpenTopped_DecloakToFire; + + Valueable ReloadInTransport; + Valueable OpenTopped_IgnoreRangefinding; + Valueable OpenTopped_AllowFiringIfDeactivated; Valueable OpenTopped_AllowFiringIfAttackedByLocomotor; + Valueable OpenTopped_ShareTransportTarget; + Valueable OpenTopped_UseTransportRangeModifiers; + Valueable OpenTopped_CheckTransportDisableWeapons; + Valueable OpenTopped_DecloakToFire; + Valueable OpenTransport_RangeBonus; + Valueable OpenTransport_DamageMultiplier; + + Valueable Passengers_SyncOwner; + Valueable Passengers_SyncOwner_RevertOnExit; + + Valueable Explodes_KillPassengers; + Valueable Explodes_DuringBuildup; + + Valueable AircraftFiringForceScatter; + + Valueable HoverDrownable; + + Nullable Sinkable; + Valueable Sinkable_SquidGrab; + Valueable SinkSpeed; + + Valueable CreateAnimsOnZeroDamage; + Valueable Conventional_IgnoreUnits; + Valueable DecloakDamagedTargets; + + Valueable Interceptable; Valueable SortCameoByName; @@ -584,8 +613,37 @@ class RulesExt , FallingDownTargetingFix { false } , AIAirTargetingFix { false } - , OpenTopped_DecloakToFire { false } + + , ReloadInTransport { false } + , OpenTopped_IgnoreRangefinding { false } + , OpenTopped_AllowFiringIfDeactivated { true } , OpenTopped_AllowFiringIfAttackedByLocomotor { true } + , OpenTopped_ShareTransportTarget { true } + , OpenTopped_UseTransportRangeModifiers { false } + , OpenTopped_CheckTransportDisableWeapons { false } + , OpenTopped_DecloakToFire { false } + , OpenTransport_RangeBonus { 0 } + , OpenTransport_DamageMultiplier { 1.0f } + + , Passengers_SyncOwner { false } + , Passengers_SyncOwner_RevertOnExit { true } + + , Explodes_KillPassengers { true } + , Explodes_DuringBuildup { true } + + , AircraftFiringForceScatter { true } + + , HoverDrownable { true } + + , Sinkable {} + , Sinkable_SquidGrab { true } + , SinkSpeed { 5 } + + , CreateAnimsOnZeroDamage { false } + , Conventional_IgnoreUnits { false } + , DecloakDamagedTargets { true } + + , Interceptable { false } , SortCameoByName { false } diff --git a/src/Ext/Techno/Body.Update.cpp b/src/Ext/Techno/Body.Update.cpp index c6fad9272d..24d0d32248 100644 --- a/src/Ext/Techno/Body.Update.cpp +++ b/src/Ext/Techno/Body.Update.cpp @@ -83,7 +83,7 @@ void TechnoExt::ExtData::ApplyInterceptor() const auto pBulletExt = BulletExt::ExtMap.Find(pBullet); const auto pBulletTypeExt = pBulletExt->TypeExtData; - if (!pBulletTypeExt->Interceptable || pBullet->SpawnNextAnim) + if (!pBulletTypeExt->Interceptable.Get(RulesExt::Global()->Interceptable) || pBullet->SpawnNextAnim) continue; const bool isTargetedOrLocked = static_cast(pBulletExt->InterceptedStatus & (InterceptedStatus::Targeted | InterceptedStatus::Locked)); @@ -766,7 +766,8 @@ void TechnoExt::ExtData::UpdateTypeData(TechnoTypeClass* pCurrentType) } // Remove from limbo reloaders if no longer applicable - if (pOldType->Ammo > 0 && pOldTypeExt->ReloadInTransport && !pNewTypeExt->ReloadInTransport) + if (pOldType->Ammo > 0 && pOldTypeExt->ReloadInTransport.Get(RulesExt::Global()->ReloadInTransport) + && !pNewTypeExt->ReloadInTransport.Get(RulesExt::Global()->ReloadInTransport)) { auto& vec = ScenarioExt::Global()->TransportReloaders; vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end()); diff --git a/src/Ext/Techno/Body.cpp b/src/Ext/Techno/Body.cpp index a1a5987a1a..e89a7a62e4 100644 --- a/src/Ext/Techno/Body.cpp +++ b/src/Ext/Techno/Body.cpp @@ -28,7 +28,7 @@ TechnoExt::ExtData::~ExtData() } if (whatAmI != AbstractType::AircraftType && whatAmI != AbstractType::BuildingType - && pType->Ammo > 0 && pTypeExt->ReloadInTransport) + && pType->Ammo > 0 && pTypeExt->ReloadInTransport.Get(RulesExt::Global()->ReloadInTransport)) { auto& vec = ScenarioExt::Global()->TransportReloaders; vec.erase(std::remove(vec.begin(), vec.end(), this), vec.end()); diff --git a/src/Ext/Techno/Hooks.Firing.cpp b/src/Ext/Techno/Hooks.Firing.cpp index 5947304fac..0a9fb5b81d 100644 --- a/src/Ext/Techno/Hooks.Firing.cpp +++ b/src/Ext/Techno/Hooks.Firing.cpp @@ -433,7 +433,7 @@ DEFINE_HOOK(0x6FC5C7, TechnoClass_CanFire_OpenTopped, 0x6) auto const pTypeExt = TechnoExt::ExtMap.Find(pTransport)->TypeExtData; - if (pTransport->Deactivated && !pTypeExt->OpenTopped_AllowFiringIfDeactivated) + if (pTransport->Deactivated && !pTypeExt->OpenTopped_AllowFiringIfDeactivated.Get(RulesExt::Global()->OpenTopped_AllowFiringIfDeactivated)) return Illegal; if (const auto pTransportFoot = abstract_cast(pTransport)) @@ -445,8 +445,11 @@ DEFINE_HOOK(0x6FC5C7, TechnoClass_CanFire_OpenTopped, 0x6) if (pTransport->Transporter) return Illegal; - if (pTypeExt->OpenTopped_CheckTransportDisableWeapons && TechnoExt::ExtMap.Find(pTransport)->AE.DisableWeapons && pThis->GetWeapon(weaponIndex)->WeaponType) + if (pTypeExt->OpenTopped_CheckTransportDisableWeapons.Get(RulesExt::Global()->OpenTopped_CheckTransportDisableWeapons) + && TechnoExt::ExtMap.Find(pTransport)->AE.DisableWeapons && pThis->GetWeapon(weaponIndex)->WeaponType) + { return OutOfRange; + } return Continue; } @@ -682,7 +685,7 @@ DEFINE_HOOK(0x6FE43B, TechnoClass_FireAt_OpenToppedDmgMult, 0x8) nDamageMult = pExt->OpenTopped_DamageMultiplier.Get(nDamageMult); } - nDamageMult *= TechnoExt::ExtMap.Find(pThis)->TypeExtData->OpenTransport_DamageMultiplier; + nDamageMult *= TechnoExt::ExtMap.Find(pThis)->TypeExtData->OpenTransport_DamageMultiplier.Get(RulesExt::Global()->OpenTransport_DamageMultiplier); R->EAX(static_cast(nDamage * nDamageMult)); return ApplyDamageMult; diff --git a/src/Ext/Techno/Hooks.ReceiveDamage.cpp b/src/Ext/Techno/Hooks.ReceiveDamage.cpp index c1b4675114..0da2a6050a 100644 --- a/src/Ext/Techno/Hooks.ReceiveDamage.cpp +++ b/src/Ext/Techno/Hooks.ReceiveDamage.cpp @@ -197,7 +197,7 @@ DEFINE_HOOK(0x702819, TechnoClass_ReceiveDamage_Decloak, 0xA) if (auto const pExt = WarheadTypeExt::ExtMap.TryFind(pWarhead)) { - if (pExt->DecloakDamagedTargets) + if (pExt->DecloakDamagedTargets.Get(RulesExt::Global()->DecloakDamagedTargets)) pThis->Uncloak(false); } @@ -228,11 +228,14 @@ DEFINE_HOOK(0x702603, TechnoClass_ReceiveDamage_Explodes, 0x6) if (pThis->WhatAmI() == AbstractType::Building) { - if (!pTypeExt->Explodes_DuringBuildup && (pThis->CurrentMission == Mission::Construction || pThis->CurrentMission == Mission::Selling)) + if (!pTypeExt->Explodes_DuringBuildup.Get(RulesExt::Global()->Explodes_DuringBuildup) + && (pThis->CurrentMission == Mission::Construction || pThis->CurrentMission == Mission::Selling)) + { return SkipExploding; + } } - if (!pTypeExt->Explodes_KillPassengers) + if (!pTypeExt->Explodes_KillPassengers.Get(RulesExt::Global()->Explodes_KillPassengers)) return SkipKillingPassengers; return 0; diff --git a/src/Ext/Techno/Hooks.Transport.cpp b/src/Ext/Techno/Hooks.Transport.cpp index 8416ebf863..30328f7e69 100644 --- a/src/Ext/Techno/Hooks.Transport.cpp +++ b/src/Ext/Techno/Hooks.Transport.cpp @@ -35,7 +35,7 @@ DEFINE_HOOK(0x6F8FD7, TechnoClass_ThreatEvals_OpenToppedOwner, 0x5) // Tec if (auto const pTransport = pThis->Transporter) { - if (TechnoExt::ExtMap.Find(pTransport)->TypeExtData->Passengers_SyncOwner) + if (TechnoExt::ExtMap.Find(pTransport)->TypeExtData->Passengers_SyncOwner.Get(RulesExt::Global()->Passengers_SyncOwner)) return returnAddress; } @@ -48,7 +48,7 @@ DEFINE_HOOK(0x701881, TechnoClass_ChangeHouse_Passenger_SyncOwner, 0x5) if (auto pPassenger = pThis->Passengers.GetFirstPassenger()) { - if (TechnoExt::ExtMap.Find(pThis)->TypeExtData->Passengers_SyncOwner) + if (TechnoExt::ExtMap.Find(pThis)->TypeExtData->Passengers_SyncOwner.Get(RulesExt::Global()->Passengers_SyncOwner)) { const auto pOwner = pThis->Owner; @@ -76,11 +76,14 @@ DEFINE_HOOK(0x71067B, TechnoClass_EnterTransport, 0x7) auto const whatAmI = pPassenger->WhatAmI(); auto const pTransTypeExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData; - if (pTransTypeExt->Passengers_SyncOwner && pTransTypeExt->Passengers_SyncOwner_RevertOnExit) + if (pTransTypeExt->Passengers_SyncOwner.Get(RulesExt::Global()->Passengers_SyncOwner) + && pTransTypeExt->Passengers_SyncOwner_RevertOnExit.Get(RulesExt::Global()->Passengers_SyncOwner_RevertOnExit)) + { pExt->OriginalPassengerOwner = pPassenger->Owner; + } if (whatAmI != AbstractType::Aircraft && whatAmI != AbstractType::Building - && pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport) + && pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport.Get(RulesExt::Global()->ReloadInTransport)) { ScenarioExt::Global()->TransportReloaders.push_back(pExt); } @@ -103,14 +106,14 @@ DEFINE_HOOK(0x4DE722, FootClass_LeaveTransport, 0x6) // Remove from transport reloader list before switching house if (whatAmI != AbstractType::Aircraft && whatAmI != AbstractType::Building - && pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport) + && pType->Ammo > 0 && pExt->TypeExtData->ReloadInTransport.Get(RulesExt::Global()->ReloadInTransport)) { auto& vec = ScenarioExt::Global()->TransportReloaders; vec.erase(std::remove(vec.begin(), vec.end(), pExt), vec.end()); } - if (pTransTypeExt->Passengers_SyncOwner - && pTransTypeExt->Passengers_SyncOwner_RevertOnExit + if (pTransTypeExt->Passengers_SyncOwner.Get(RulesExt::Global()->Passengers_SyncOwner) + && pTransTypeExt->Passengers_SyncOwner_RevertOnExit.Get(RulesExt::Global()->Passengers_SyncOwner_RevertOnExit) && pExt->OriginalPassengerOwner) { pPassenger->SetOwningHouse(pExt->OriginalPassengerOwner, false); @@ -129,7 +132,8 @@ DEFINE_HOOK(0x737F80, UnitClass_ReceiveDamage_Cargo_SyncOwner, 0x6) { auto const pTypeExt = TechnoTypeExt::ExtMap.Find(pThis->Type); - if (pTypeExt->Passengers_SyncOwner && pTypeExt->Passengers_SyncOwner_RevertOnExit) + if (pTypeExt->Passengers_SyncOwner.Get(RulesExt::Global()->Passengers_SyncOwner) + && pTypeExt->Passengers_SyncOwner_RevertOnExit.Get(RulesExt::Global()->Passengers_SyncOwner_RevertOnExit)) { do { @@ -156,7 +160,7 @@ DEFINE_HOOK(0x51DF82, InfantryClass_FireAt_ReloadInTransport, 0x6) auto const pType = pThis->Type; auto const pTypeExt = TechnoTypeExt::ExtMap.Find(pType); - if (pTypeExt->ReloadInTransport && pType->Ammo > 0 && pThis->Ammo < pType->Ammo) + if (pTypeExt->ReloadInTransport.Get(RulesExt::Global()->ReloadInTransport) && pType->Ammo > 0 && pThis->Ammo < pType->Ammo) pThis->StartReloading(); } @@ -174,7 +178,7 @@ DEFINE_HOOK(0x6F72D2, TechnoClass_IsCloseEnoughToTarget_OpenTopped_RangeBonus, 0 auto const pExt = TechnoExt::ExtMap.Find(pTransport)->TypeExtData; const int rangeBonus = pExt->OpenTopped_RangeBonus.Get(RulesClass::Instance->OpenToppedRangeBonus); - R->EAX(rangeBonus + TechnoExt::ExtMap.Find(pThis)->TypeExtData->OpenTransport_RangeBonus); + R->EAX(rangeBonus + TechnoExt::ExtMap.Find(pThis)->TypeExtData->OpenTransport_RangeBonus.Get(RulesExt::Global()->OpenTransport_RangeBonus)); return 0x6F72DE; } @@ -206,7 +210,7 @@ DEFINE_HOOK(0x710552, TechnoClass_SetOpenTransportCargoTarget_ShareTarget, 0x6) { auto const pTypeExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData; - if (!pTypeExt->OpenTopped_ShareTransportTarget) + if (!pTypeExt->OpenTopped_ShareTransportTarget.Get(RulesExt::Global()->OpenTopped_ShareTransportTarget)) return ReturnFromFunction; } diff --git a/src/Ext/Techno/Hooks.WeaponRange.cpp b/src/Ext/Techno/Hooks.WeaponRange.cpp index c60dea0db5..c65ce6d224 100644 --- a/src/Ext/Techno/Hooks.WeaponRange.cpp +++ b/src/Ext/Techno/Hooks.WeaponRange.cpp @@ -19,7 +19,7 @@ DEFINE_HOOK(0x7012C2, TechnoClass_WeaponRange, 0x8) result = WeaponTypeExt::GetRangeWithModifiers(pWeapon, pThis); auto const pTypeExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData; - if (!pTypeExt->OpenTopped_IgnoreRangefinding && pTypeExt->OwnerObject()->OpenTopped) + if (!pTypeExt->OpenTopped_IgnoreRangefinding.Get(RulesExt::Global()->OpenTopped_IgnoreRangefinding) && pTypeExt->OwnerObject()->OpenTopped) { int smallestRange = INT32_MAX; auto pPassenger = abstract_cast(pThis->Passengers.GetFirstPassenger()); diff --git a/src/Ext/Techno/Hooks.cpp b/src/Ext/Techno/Hooks.cpp index 96c7d24059..d7787998d5 100644 --- a/src/Ext/Techno/Hooks.cpp +++ b/src/Ext/Techno/Hooks.cpp @@ -894,7 +894,7 @@ DEFINE_HOOK(0x5F4021, ObjectClass_Update_FallingDown_ToDead, 0x6) if (hoverShutdown) { - if (pExt->TypeExtData->HoverDrownable) + if (pExt->TypeExtData->HoverDrownable.Get(RulesExt::Global()->HoverDrownable)) { int damage = pThis->Health; pTechno->ReceiveDamage(&damage, 0, RulesClass::Instance->C4Warhead, nullptr, true, false, nullptr); diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index 7f9c38b3c5..a5f1588dd0 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -69,7 +69,7 @@ class TechnoTypeExt PhobosPCXFile AltCameoPCX; Valueable NoManualMove; Nullable InitialStrength; - Valueable ReloadInTransport; + Nullable ReloadInTransport; Valueable ForbidParallelAIQueues; Valueable IgnoreForBaseCenter; @@ -162,15 +162,15 @@ class TechnoTypeExt Nullable OpenTopped_RangeBonus; Nullable OpenTopped_DamageMultiplier; Nullable OpenTopped_WarpDistance; - Valueable OpenTopped_IgnoreRangefinding; - Valueable OpenTopped_AllowFiringIfDeactivated; + Nullable OpenTopped_IgnoreRangefinding; + Nullable OpenTopped_AllowFiringIfDeactivated; Nullable OpenTopped_AllowFiringIfAttackedByLocomotor; - Valueable OpenTopped_ShareTransportTarget; - Valueable OpenTopped_UseTransportRangeModifiers; - Valueable OpenTopped_CheckTransportDisableWeapons; + Nullable OpenTopped_ShareTransportTarget; + Nullable OpenTopped_UseTransportRangeModifiers; + Nullable OpenTopped_CheckTransportDisableWeapons; Nullable OpenTopped_DecloakToFire; - Valueable OpenTransport_RangeBonus; - Valueable OpenTransport_DamageMultiplier; + Nullable OpenTransport_RangeBonus; + Nullable OpenTransport_DamageMultiplier; Valueable AutoTargetOwnPosition; Valueable AutoTargetOwnPosition_Self; @@ -221,8 +221,8 @@ class TechnoTypeExt Valueable Ammo_Shared_Group; Nullable SelfHealGainType; - Valueable Passengers_SyncOwner; - Valueable Passengers_SyncOwner_RevertOnExit; + Nullable Passengers_SyncOwner; + Nullable Passengers_SyncOwner_RevertOnExit; Nullable IronCurtain_KeptOnDeploy; Nullable IronCurtain_Effect; @@ -230,8 +230,8 @@ class TechnoTypeExt Nullable ForceShield_KeptOnDeploy; Nullable ForceShield_Effect; Nullable ForceShield_KillWarhead; - Valueable Explodes_KillPassengers; - Valueable Explodes_DuringBuildup; + Nullable Explodes_KillPassengers; + Nullable Explodes_DuringBuildup; Valueable DriverKilled_KeptPassengers; Nullable DriverKilled_KillPassengers; Nullable DeployFireWeapon; @@ -374,8 +374,8 @@ class TechnoTypeExt Valueable Spawner_RecycleOnTurret; Nullable Sinkable; - Valueable Sinkable_SquidGrab; - Valueable SinkSpeed; + Nullable Sinkable_SquidGrab; + Nullable SinkSpeed; Nullable ProneSpeed; Nullable DamagedSpeed; @@ -435,7 +435,7 @@ class TechnoTypeExt Valueable Ammo_AutoConvertMaximumAmount; Nullable Ammo_AutoConvertType; - Valueable FiringForceScatter; + Nullable FiringForceScatter; Valueable FireUp; Valueable FireUp_ResetInRetarget; @@ -494,7 +494,7 @@ class TechnoTypeExt Nullable JumpjetClimbIgnoreBuilding; - Valueable HoverDrownable; + Nullable HoverDrownable; bool ExtraThreat_Enabled; Nullable ExtraThreat_IsThreat; Valueable AlwaysConsideredThreat; @@ -551,7 +551,7 @@ class TechnoTypeExt , AltCameoPCX {} , NoManualMove { false } , InitialStrength {} - , ReloadInTransport { false } + , ReloadInTransport {} , ForbidParallelAIQueues { false } , IgnoreForBaseCenter { false } , TintColorAirstrike { 0 } @@ -595,15 +595,15 @@ class TechnoTypeExt , OpenTopped_RangeBonus {} , OpenTopped_DamageMultiplier {} , OpenTopped_WarpDistance {} - , OpenTopped_IgnoreRangefinding { false } + , OpenTopped_IgnoreRangefinding {} + , OpenTopped_AllowFiringIfDeactivated {} , OpenTopped_AllowFiringIfAttackedByLocomotor {} - , OpenTopped_AllowFiringIfDeactivated { true } - , OpenTopped_ShareTransportTarget { true } - , OpenTopped_UseTransportRangeModifiers { false } - , OpenTopped_CheckTransportDisableWeapons { false } + , OpenTopped_ShareTransportTarget {} + , OpenTopped_UseTransportRangeModifiers {} + , OpenTopped_CheckTransportDisableWeapons {} , OpenTopped_DecloakToFire {} - , OpenTransport_RangeBonus { 0 } - , OpenTransport_DamageMultiplier { 1.0f } + , OpenTransport_RangeBonus {} + , OpenTransport_DamageMultiplier {} , AutoTargetOwnPosition { false } , AutoTargetOwnPosition_Self { false } @@ -690,8 +690,8 @@ class TechnoTypeExt , Ammo_Shared_Group { -1 } , SelfHealGainType {} - , Passengers_SyncOwner { false } - , Passengers_SyncOwner_RevertOnExit { true } + , Passengers_SyncOwner {} + , Passengers_SyncOwner_RevertOnExit {} , OnlyUseLandSequences { false } @@ -707,8 +707,8 @@ class TechnoTypeExt , ForceShield_Effect {} , ForceShield_KillWarhead {} - , Explodes_KillPassengers { true } - , Explodes_DuringBuildup { true } + , Explodes_KillPassengers {} + , Explodes_DuringBuildup {} , DriverKilled_KeptPassengers { false } , DriverKilled_KillPassengers {} , DeployFireWeapon {} @@ -855,8 +855,8 @@ class TechnoTypeExt , Spawner_RecycleOnTurret { false } , Sinkable { } - , Sinkable_SquidGrab { true } - , SinkSpeed { 5 } + , Sinkable_SquidGrab { } + , SinkSpeed { } , ProneSpeed { } , DamagedSpeed { } @@ -895,7 +895,7 @@ class TechnoTypeExt , Ammo_AutoConvertMaximumAmount { -1 } , Ammo_AutoConvertType { nullptr } - , FiringForceScatter { true } + , FiringForceScatter {} , FireUp { -1 } , FireUp_ResetInRetarget { true } @@ -954,7 +954,7 @@ class TechnoTypeExt , JumpjetClimbIgnoreBuilding {} - , HoverDrownable { true } + , HoverDrownable {} , Unsellable {} diff --git a/src/Ext/Unit/Hooks.Sinking.cpp b/src/Ext/Unit/Hooks.Sinking.cpp index 023fa66466..e15b3a9a6a 100644 --- a/src/Ext/Unit/Hooks.Sinking.cpp +++ b/src/Ext/Unit/Hooks.Sinking.cpp @@ -6,7 +6,7 @@ DEFINE_HOOK(0x7364DC, UnitClass_Update_SinkSpeed, 0x7) GET(const int, CoordZ, EDX); auto const pTypeExt = TechnoTypeExt::ExtMap.Find(pThis->Type); - R->EDX(CoordZ - (pTypeExt->SinkSpeed - 5)); + R->EDX(CoordZ - (pTypeExt->SinkSpeed.Get(RulesExt::Global()->SinkSpeed) - 5)); return 0; } @@ -19,7 +19,7 @@ DEFINE_HOOK(0x737DE2, UnitClass_ReceiveDamage_Sinkable, 0x6) auto const pTypeExt = TechnoTypeExt::ExtMap.Find(pType); const bool shouldSink = pType->Weight > RulesClass::Instance->ShipSinkingWeight && pType->Naval && !pType->Underwater && !pType->Organic; - return pTypeExt->Sinkable.Get(shouldSink) ? GoOtherChecks : NoSink; + return pTypeExt->Sinkable.Get(shouldSink || RulesExt::Global()->Sinkable) ? GoOtherChecks : NoSink; } DEFINE_HOOK(0x629C67, ParasiteClass_UpdateSquid_SinkableBySquid, 0x9) @@ -32,7 +32,7 @@ DEFINE_HOOK(0x629C67, ParasiteClass_UpdateSquid_SinkableBySquid, 0x9) const auto pVictimTypeExt = TechnoExt::ExtMap.Find(pVictim)->TypeExtData; const auto pOwner = pThis->Owner; - if (pVictimTypeExt->Sinkable_SquidGrab || pVictim->WhatAmI() != AbstractType::Unit) + if (pVictimTypeExt->Sinkable_SquidGrab.Get(RulesExt::Global()->Sinkable_SquidGrab) || pVictim->WhatAmI() != AbstractType::Unit) { pVictim->IsSinking = true; pVictim->Destroyed(pOwner); diff --git a/src/Ext/WarheadType/Body.h b/src/Ext/WarheadType/Body.h index 88be830a6d..a09f25c7b6 100644 --- a/src/Ext/WarheadType/Body.h +++ b/src/Ext/WarheadType/Body.h @@ -36,14 +36,14 @@ class WarheadTypeExt Valueable AnimList_CreationInterval; Valueable AnimList_ScatterMin; Valueable AnimList_ScatterMax; - Valueable CreateAnimsOnZeroDamage; - Valueable Conventional_IgnoreUnits; + Nullable CreateAnimsOnZeroDamage; + Nullable Conventional_IgnoreUnits; Valueable RemoveDisguise; Valueable RemoveMindControl; Nullable RemoveParasite; ValueableVector RemoveParasite_Allow; ValueableVector RemoveParasite_Disallow; - Valueable DecloakDamagedTargets; + Nullable DecloakDamagedTargets; Valueable ShakeIsLocal; Valueable ApplyModifiersOnNegativeDamage; Valueable PenetratesIronCurtain; @@ -293,14 +293,14 @@ class WarheadTypeExt , AnimList_CreationInterval { 0 } , AnimList_ScatterMin { Leptons(-1) } , AnimList_ScatterMax { Leptons(-1) } - , CreateAnimsOnZeroDamage { false } - , Conventional_IgnoreUnits { false } + , CreateAnimsOnZeroDamage {} + , Conventional_IgnoreUnits {} , RemoveDisguise { false } , RemoveMindControl { false } , RemoveParasite {} , RemoveParasite_Allow {} , RemoveParasite_Disallow {} - , DecloakDamagedTargets { true } + , DecloakDamagedTargets {} , ShakeIsLocal { false } , ApplyModifiersOnNegativeDamage { false } , PenetratesIronCurtain { false } diff --git a/src/Ext/WarheadType/Detonate.cpp b/src/Ext/WarheadType/Detonate.cpp index ac3036e5bc..ce46bf2f4b 100644 --- a/src/Ext/WarheadType/Detonate.cpp +++ b/src/Ext/WarheadType/Detonate.cpp @@ -569,7 +569,7 @@ void WarheadTypeExt::ExtData::InterceptBullets(TechnoClass* pOwner, BulletClass* { const auto pBulletExt = BulletExt::ExtMap.Find(pBullet); - if (!pBulletExt->TypeExtData->Interceptable) + if (!pBulletExt->TypeExtData->Interceptable.Get(RulesExt::Global()->Interceptable)) return; // 1/8th of a cell as a margin of error if not Inviso interceptor. @@ -586,7 +586,7 @@ void WarheadTypeExt::ExtData::InterceptBullets(TechnoClass* pOwner, BulletClass* const auto pBulletExt = BulletExt::ExtMap.Find(pBullet); // Cells don't know about bullets that may or may not be located on them so it has to be this way. - if (!pBulletExt->TypeExtData->Interceptable || pBullet->SpawnNextAnim) + if (!pBulletExt->TypeExtData->Interceptable.Get(RulesExt::Global()->Interceptable) || pBullet->SpawnNextAnim) continue; if (pBullet->Location.DistanceFromSquared(coords) <= cellSpreadSq) diff --git a/src/Ext/WarheadType/Hooks.cpp b/src/Ext/WarheadType/Hooks.cpp index 2b59d709ac..97ddd51b2f 100644 --- a/src/Ext/WarheadType/Hooks.cpp +++ b/src/Ext/WarheadType/Hooks.cpp @@ -305,7 +305,7 @@ DEFINE_HOOK(0x48A4F3, SelectDamageAnimation_NegativeZeroDamage, 0x6) pWHExt->Splashed = false; - if (damage == 0 && !pWHExt->CreateAnimsOnZeroDamage) + if (damage == 0 && !pWHExt->CreateAnimsOnZeroDamage.Get(RulesExt::Global()->CreateAnimsOnZeroDamage)) return NoAnim; else if (damage < 0) damage = -damage; diff --git a/src/Ext/WeaponType/Body.cpp b/src/Ext/WeaponType/Body.cpp index 0fd2b65ea2..721faf42cb 100644 --- a/src/Ext/WeaponType/Body.cpp +++ b/src/Ext/WeaponType/Body.cpp @@ -1,4 +1,4 @@ -#include "Body.h" +#include "Body.h" #include #include @@ -343,7 +343,7 @@ int WeaponTypeExt::GetRangeWithModifiers(WeaponTypeClass* pThis, TechnoClass* pF { auto const pTypeExt = TechnoExt::ExtMap.Find(pTransport)->TypeExtData; - if (pTypeExt->OpenTopped_UseTransportRangeModifiers && pTypeExt->OwnerObject()->OpenTopped) + if (pTypeExt->OpenTopped_UseTransportRangeModifiers.Get(RulesExt::Global()->OpenTopped_UseTransportRangeModifiers) && pTypeExt->OwnerObject()->OpenTopped) pTechno = pTransport; } diff --git a/src/New/Entity/ShieldClass.cpp b/src/New/Entity/ShieldClass.cpp index c3e11cb3e0..792249af8c 100644 --- a/src/New/Entity/ShieldClass.cpp +++ b/src/New/Entity/ShieldClass.cpp @@ -259,7 +259,7 @@ int ShieldClass::ReceiveDamage(args_ReceiveDamage* args) if (!pWHExt->Nonprovocative) this->ResponseAttack(); - if (pWHExt->DecloakDamagedTargets) + if (pWHExt->DecloakDamagedTargets.Get(RulesExt::Global()->DecloakDamagedTargets)) pTechno->Uncloak(false); const int residueDamage = shieldDamage - health;