Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions docs/New-or-Enhanced-Logics.md

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,37 @@ You can use the migration utility (can be found on [Phobos supplementaries repo]

- Key `rulesmd.ini -> [TechnoType] -> Deployed.RememberTarget` is deprecated and can be removed now, the bugfix for `DeployToFire` deployers is now always on.

### Changed tags<!-- This is only a temporary solution; what method to use afterwards has not been determined yet. -->

- To standardize tag names for similar functions, prevent typos, or avoid misunderstandings, replace them with new tag names.

#### From pre-0.5 devbuilds

- The following tags were renamed:
- `[WarheadType] -> Crit.AffectAbovePercent` -> `[WarheadType] -> Crit.AffectsAbovePercent`.

#### From 0.4

- The following tags were renamed:
- `[AttachEffectType] -> AffectTargets` -> `[AttachEffectType] -> AffectsTarget`
- `[AttachEffectType] -> ReflectDamage.AffectsHouses` -> `[AttachEffectType] -> ReflectDamage.AffectsHouse`
- `[AttachEffectType/TechnoType] -> RevengeWeapon.AffectsHouses` -> `[AttachEffectType/TechnoType] -> RevengeWeapon.AffectsHouse`
- `[TechnoType] -> AutoFire` -> `[TechnoType] -> AutoTargetOwnPosition`
- `[TechnoType] -> AutoFire.TargetSelf` -> `[TechnoType] -> AutoTargetOwnPosition.Self`
- `[WarheadType] -> DetonateOnAllMapObjects.AffectHouses` -> `[WarheadType] -> DetonateOnAllMapObjects.AffectsHouse`
- `[WarheadType] -> DetonateOnAllMapObjects.AffectTargets` -> `[WarheadType] -> DetonateOnAllMapObjects.AffectsTarget`
- `[WarheadType] -> Crit.AffectBelowPercent` -> `[WarheadType] -> Crit.AffectsBelowPercent`.
- `[WarheadType] -> Crit.Affects` -> `[WarheadType] -> Crit.AffectsTarget`
- `[WarheadType] -> Crit.AffectsHouses` -> `[WarheadType] -> Crit.AffectsHouse`
- `[WarheadType] -> KillWeapon.AffectsHouses` -> `[WarheadType] -> KillWeapon.AffectsHouse`
- `[WarheadType] -> KillWeapon.OnFirer.AffectsHouses` -> `[WarheadType] -> KillWeapon.OnFirer.AffectsHouse`
- `[WarheadType/SuperWeaponType] -> Convert(N).AffectedHouses` -> `[WarheadType/SuperWeaponType] -> Convert(N).AffectsHouse`
- `[SuperWeaponType] -> LimboKill.Affected` -> `[SuperWeaponType] -> LimboKill.AffectsHouse`

```{note}
- You can use the [*MigrationUtility*](https://github.com/Phobos-developers/PhobosSupplementaries/tree/develop/MigrationUtility) in the PhobosSupplementaries repository to conveniently complete these migrations.
```

### New user settings in RA2MD.INI

- These are new user setting keys added by various features in Phobos. Most of them can be found in either in [user inteface](User-Interface.md) or [miscellaneous](Miscellanous.md) sections. Search functionality can be used to find them quickly if needed.
Expand Down
159 changes: 79 additions & 80 deletions docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/Ext/Bullet/Hooks.DetonateLogics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ DEFINE_HOOK(0x4690C1, BulletClass_Logics_DetonateOnAllMapObjects, 0x8)
auto const pWHExt = WarheadTypeExt::ExtMap.Find(pThis->WH);

if (pWHExt->DetonateOnAllMapObjects && !pWHExt->WasDetonatedOnAllMapObjects
&& pWHExt->DetonateOnAllMapObjects_AffectTargets != AffectedTarget::None
&& pWHExt->DetonateOnAllMapObjects_AffectHouses != AffectedHouse::None)
&& pWHExt->DetonateOnAllMapObjects_AffectsTarget != AffectedTarget::None
&& pWHExt->DetonateOnAllMapObjects_AffectsHouse != AffectedHouse::None)
{
pWHExt->WasDetonatedOnAllMapObjects = true;
auto const originalLocation = pThis->Location;
Expand Down Expand Up @@ -112,31 +112,31 @@ DEFINE_HOOK(0x4690C1, BulletClass_Logics_DetonateOnAllMapObjects, 0x8)
}
};

if ((pWHExt->DetonateOnAllMapObjects_AffectTargets & AffectedTarget::Aircraft) != AffectedTarget::None)
if ((pWHExt->DetonateOnAllMapObjects_AffectsTarget & AffectedTarget::Aircraft) != AffectedTarget::None)
{
auto const aircraft = copy_dvc(AircraftClass::Array);

for (auto const pAircraft : aircraft)
tryDetonate(pAircraft, pAircraft->Type);
}

if ((pWHExt->DetonateOnAllMapObjects_AffectTargets & AffectedTarget::Building) != AffectedTarget::None)
if ((pWHExt->DetonateOnAllMapObjects_AffectsTarget & AffectedTarget::Building) != AffectedTarget::None)
{
auto const buildings = copy_dvc(BuildingClass::Array);

for (auto const pBuilding : buildings)
tryDetonate(pBuilding, pBuilding->Type);
}

if ((pWHExt->DetonateOnAllMapObjects_AffectTargets & AffectedTarget::Infantry) != AffectedTarget::None)
if ((pWHExt->DetonateOnAllMapObjects_AffectsTarget & AffectedTarget::Infantry) != AffectedTarget::None)
{
auto const infantry = copy_dvc(InfantryClass::Array);

for (auto const pInf : infantry)
tryDetonate(pInf, pInf->Type);
}

if ((pWHExt->DetonateOnAllMapObjects_AffectTargets & AffectedTarget::Unit) != AffectedTarget::None)
if ((pWHExt->DetonateOnAllMapObjects_AffectsTarget & AffectedTarget::Unit) != AffectedTarget::None)
{
auto const units = copy_dvc(UnitClass::Array);

Expand Down
4 changes: 2 additions & 2 deletions src/Ext/SWType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void SWTypeExt::ExtData::Serialize(T& Stm)
.Process(this->LimboDelivery_IDs)
.Process(this->LimboDelivery_RandomWeightsData)
.Process(this->LimboDelivery_RollChances)
.Process(this->LimboKill_Affected)
.Process(this->LimboKill_AffectsHouse)
.Process(this->LimboKill_IDs)
.Process(this->RandomBuffer)
.Process(this->Detonate_Warhead)
Expand Down Expand Up @@ -143,7 +143,7 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->LimboDelivery_Types.Read(exINI, pSection, "LimboDelivery.Types");
this->LimboDelivery_IDs.Read(exINI, pSection, "LimboDelivery.IDs");
this->LimboDelivery_RollChances.Read(exINI, pSection, "LimboDelivery.RollChances");
this->LimboKill_Affected.Read(exINI, pSection, "LimboKill.Affected");
this->LimboKill_AffectsHouse.Read(exINI, pSection, "LimboKill.AffectsHouse");
this->LimboKill_IDs.Read(exINI, pSection, "LimboKill.IDs");
this->SW_Next.Read(exINI, pSection, "SW.Next");
this->SW_Next_RealLaunch.Read(exINI, pSection, "SW.Next.RealLaunch");
Expand Down
4 changes: 2 additions & 2 deletions src/Ext/SWType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SWTypeExt
ValueableVector<BuildingTypeClass*> LimboDelivery_Types;
ValueableVector<int> LimboDelivery_IDs;
ValueableVector<float> LimboDelivery_RollChances;
Valueable<AffectedHouse> LimboKill_Affected;
Valueable<AffectedHouse> LimboKill_AffectsHouse;
ValueableVector<int> LimboKill_IDs;
Valueable<double> RandomBuffer;
ValueableIdxVector<SuperWeaponTypeClass> SW_Next;
Expand Down Expand Up @@ -147,7 +147,7 @@ class SWTypeExt
, LimboDelivery_IDs {}
, LimboDelivery_RollChances {}
, LimboDelivery_RandomWeightsData {}
, LimboKill_Affected { AffectedHouse::Owner }
, LimboKill_AffectsHouse { AffectedHouse::Owner }
, LimboKill_IDs {}
, RandomBuffer { 0.0 }
, Detonate_Warhead {}
Expand Down
2 changes: 1 addition & 1 deletion src/Ext/SWType/FireSuperWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void SWTypeExt::ExtData::ApplyLimboKill(HouseClass* pHouse)
{
for (HouseClass* pTargetHouse : HouseClass::Array)
{
if (EnumFunctions::CanTargetHouse(this->LimboKill_Affected, pHouse, pTargetHouse))
if (EnumFunctions::CanTargetHouse(this->LimboKill_AffectsHouse, pHouse, pTargetHouse))
{
auto const pHouseExt = HouseExt::ExtMap.Find(pTargetHouse);
auto& vec = pHouseExt->OwnedLimboDeliveredBuildings;
Expand Down
6 changes: 3 additions & 3 deletions src/Ext/Techno/Body.Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,8 @@ void TechnoExt::ExtData::UpdateTypeData(TechnoTypeClass* pCurrentType)
}
}

// handle AutoFire
if (pOldTypeExt->AutoFire && !pNewTypeExt->AutoFire)
// handle AutoTargetOwnPosition
if (pOldTypeExt->AutoTargetOwnPosition && !pNewTypeExt->AutoTargetOwnPosition)
pThis->SetTarget(nullptr);
}

Expand Down Expand Up @@ -1916,7 +1916,7 @@ void TechnoExt::ExtData::UpdateSelfOwnedAttachEffects()
{
auto const attachEffect = it->get();
auto const pType = attachEffect->GetType();
const bool isValid = EnumFunctions::IsTechnoEligible(pThis, pType->AffectTargets, true)
const bool isValid = EnumFunctions::IsTechnoEligible(pThis, pType->AffectsTarget, true)
&& (pType->AffectTypes.empty() || pType->AffectTypes.Contains(pTechnoType)) && !pType->IgnoreTypes.Contains(pTechnoType);
const bool remove = !isValid || (attachEffect->IsSelfOwned() && !pTypeExt->AttachEffects.AttachTypes.Contains(pType));

Expand Down
4 changes: 2 additions & 2 deletions src/Ext/Techno/Hooks.ReceiveDamage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ DEFINE_HOOK(0x701E18, TechnoClass_ReceiveDamage_ReflectDamage, 0x7)
{
auto const pInvoker = attachEffect->GetInvoker();

if (pInvoker && EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouses, pInvoker->Owner, pSourceHouse))
if (pInvoker && EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouse, pInvoker->Owner, pSourceHouse))
{
auto const pWHExtRef = WarheadTypeExt::ExtMap.Find(pWH);
pWHExtRef->Reflected = true;
Expand All @@ -396,7 +396,7 @@ DEFINE_HOOK(0x701E18, TechnoClass_ReceiveDamage_ReflectDamage, 0x7)
pWHExtRef->Reflected = false;
}
}
else if (EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouses, pThis->Owner, pSourceHouse))
else if (EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouse, pThis->Owner, pSourceHouse))
{
auto const pWHExtRef = WarheadTypeExt::ExtMap.Find(pWH);
pWHExtRef->Reflected = true;
Expand Down
4 changes: 2 additions & 2 deletions src/Ext/Techno/Hooks.TargetEvaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ DEFINE_HOOK(0x7098B9, TechnoClass_TargetSomethingNearby_AutoFire, 0x6)

const auto pExt = TechnoExt::ExtMap.Find(pThis)->TypeExtData;

if (pExt->AutoFire)
if (pExt->AutoTargetOwnPosition)
{
if (pExt->AutoFire_TargetSelf)
if (pExt->AutoTargetOwnPosition_Self)
pThis->SetTarget(pThis);
else
pThis->SetTarget(pThis->GetCell());
Expand Down
10 changes: 5 additions & 5 deletions src/Ext/Techno/WeaponHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ void TechnoExt::ApplyKillWeapon(TechnoClass* pThis, TechnoClass* pSource, Warhea
const bool hasFilters = pTypeExt->SuppressKillWeapons_Types.size() > 0;

// KillWeapon can be triggered without the source
if (pWHExt->KillWeapon && (!pSource || (EnumFunctions::CanTargetHouse(pWHExt->KillWeapon_AffectsHouses, pSource->Owner, pThis->Owner)
if (pWHExt->KillWeapon && (!pSource || (EnumFunctions::CanTargetHouse(pWHExt->KillWeapon_AffectsHouse, pSource->Owner, pThis->Owner)
&& EnumFunctions::IsTechnoEligible(pThis, pWHExt->KillWeapon_Affects))))
{
if (!pTypeExt->SuppressKillWeapons || (hasFilters && !pTypeExt->SuppressKillWeapons_Types.Contains(pWHExt->KillWeapon)))
WeaponTypeExt::DetonateAt(pWHExt->KillWeapon, pThis, pSource);
}

// KillWeapon.OnFirer must have a source
if (pWHExt->KillWeapon_OnFirer && pSource && EnumFunctions::CanTargetHouse(pWHExt->KillWeapon_OnFirer_AffectsHouses, pSource->Owner, pThis->Owner)
if (pWHExt->KillWeapon_OnFirer && pSource && EnumFunctions::CanTargetHouse(pWHExt->KillWeapon_OnFirer_AffectsHouse, pSource->Owner, pThis->Owner)
&& EnumFunctions::IsTechnoEligible(pThis, pWHExt->KillWeapon_OnFirer_Affects))
{
if (!pTypeExt->SuppressKillWeapons || (hasFilters && !pTypeExt->SuppressKillWeapons_Types.Contains(pWHExt->KillWeapon_OnFirer)))
Expand All @@ -262,7 +262,7 @@ void TechnoExt::ApplyRevengeWeapon(TechnoClass* pThis, TechnoClass* pSource, War
const bool suppress = pWHExt->SuppressRevengeWeapons;
const bool hasFilters = suppressType.size() > 0;

if (pTypeExt->RevengeWeapon && EnumFunctions::CanTargetHouse(pTypeExt->RevengeWeapon_AffectsHouses, pThisOwner, pSourceOwner))
if (pTypeExt->RevengeWeapon && EnumFunctions::CanTargetHouse(pTypeExt->RevengeWeapon_AffectsHouse, pThisOwner, pSourceOwner))
{
if (!suppress || (hasFilters && !suppressType.Contains(pTypeExt->RevengeWeapon)))
WeaponTypeExt::DetonateAt(pTypeExt->RevengeWeapon, pSource, pThis);
Expand All @@ -285,10 +285,10 @@ void TechnoExt::ApplyRevengeWeapon(TechnoClass* pThis, TechnoClass* pSource, War
{
auto const pInvoker = attachEffect->GetInvoker();

if (pInvoker && EnumFunctions::CanTargetHouse(pType->RevengeWeapon_AffectsHouses, pInvoker->Owner, pSourceOwner))
if (pInvoker && EnumFunctions::CanTargetHouse(pType->RevengeWeapon_AffectsHouse, pInvoker->Owner, pSourceOwner))
WeaponTypeExt::DetonateAt(pType->RevengeWeapon, pSource, pInvoker);
}
else if (EnumFunctions::CanTargetHouse(pType->RevengeWeapon_AffectsHouses, pThisOwner, pSourceOwner))
else if (EnumFunctions::CanTargetHouse(pType->RevengeWeapon_AffectsHouse, pThisOwner, pSourceOwner))
{
WeaponTypeExt::DetonateAt(pType->RevengeWeapon, pSource, pThis);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,8 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->OpenTransport_RangeBonus.Read(exINI, pSection, "OpenTransport.RangeBonus");
this->OpenTransport_DamageMultiplier.Read(exINI, pSection, "OpenTransport.DamageMultiplier");

this->AutoFire.Read(exINI, pSection, "AutoFire");
this->AutoFire_TargetSelf.Read(exINI, pSection, "AutoFire.TargetSelf");
this->AutoTargetOwnPosition.Read(exINI, pSection, "AutoTargetOwnPosition");
this->AutoTargetOwnPosition_Self.Read(exINI, pSection, "AutoTargetOwnPosition.Self");

this->NoSecondaryWeaponFallback.Read(exINI, pSection, "NoSecondaryWeaponFallback");
this->NoSecondaryWeaponFallback_AllowAA.Read(exINI, pSection, "NoSecondaryWeaponFallback.AllowAA");
Expand Down Expand Up @@ -982,7 +982,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->Tint_VisibleToHouses.Read(exINI, pSection, "Tint.VisibleToHouses");

this->RevengeWeapon.Read<true>(exINI, pSection, "RevengeWeapon");
this->RevengeWeapon_AffectsHouses.Read(exINI, pSection, "RevengeWeapon.AffectsHouses");
this->RevengeWeapon_AffectsHouse.Read(exINI, pSection, "RevengeWeapon.AffectsHouse");

this->RecountBurst.Read(exINI, pSection, "RecountBurst");

Expand Down Expand Up @@ -1510,8 +1510,8 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
.Process(this->OpenTransport_RangeBonus)
.Process(this->OpenTransport_DamageMultiplier)

.Process(this->AutoFire)
.Process(this->AutoFire_TargetSelf)
.Process(this->AutoTargetOwnPosition)
.Process(this->AutoTargetOwnPosition_Self)
.Process(this->NoSecondaryWeaponFallback)
.Process(this->NoSecondaryWeaponFallback_AllowAA)
.Process(this->AllowWeaponSelectAgainstWalls)
Expand Down Expand Up @@ -1642,7 +1642,7 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
.Process(this->Tint_VisibleToHouses)

.Process(this->RevengeWeapon)
.Process(this->RevengeWeapon_AffectsHouses)
.Process(this->RevengeWeapon_AffectsHouse)

.Process(this->AttachEffects)

Expand Down
12 changes: 6 additions & 6 deletions src/Ext/TechnoType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ class TechnoTypeExt
Valueable<int> OpenTransport_RangeBonus;
Valueable<float> OpenTransport_DamageMultiplier;

Valueable<bool> AutoFire;
Valueable<bool> AutoFire_TargetSelf;
Valueable<bool> AutoTargetOwnPosition;
Valueable<bool> AutoTargetOwnPosition_Self;

Valueable<bool> NoSecondaryWeaponFallback;
Valueable<bool> NoSecondaryWeaponFallback_AllowAA;
Expand Down Expand Up @@ -289,7 +289,7 @@ class TechnoTypeExt
Valueable<AffectedHouse> Tint_VisibleToHouses;

Valueable<WeaponTypeClass*> RevengeWeapon;
Valueable<AffectedHouse> RevengeWeapon_AffectsHouses;
Valueable<AffectedHouse> RevengeWeapon_AffectsHouse;

AEAttachInfoTypeClass AttachEffects;

Expand Down Expand Up @@ -545,8 +545,8 @@ class TechnoTypeExt
, OpenTransport_RangeBonus { 0 }
, OpenTransport_DamageMultiplier { 1.0 }

, AutoFire { false }
, AutoFire_TargetSelf { false }
, AutoTargetOwnPosition { false }
, AutoTargetOwnPosition_Self { false }
, NoSecondaryWeaponFallback { false }
, NoSecondaryWeaponFallback_AllowAA { false }
, AllowWeaponSelectAgainstWalls {}
Expand Down Expand Up @@ -712,7 +712,7 @@ class TechnoTypeExt
, Tint_VisibleToHouses { AffectedHouse::All }

, RevengeWeapon {}
, RevengeWeapon_AffectsHouses { AffectedHouse::All }
, RevengeWeapon_AffectsHouse { AffectedHouse::All }

, AttachEffects {}

Expand Down
Loading