Skip to content

Commit 5ab0cb5

Browse files
Improve our existing tag name (#1984)
1 parent 7ab9247 commit 5ab0cb5

20 files changed

+249
-219
lines changed

docs/New-or-Enhanced-Logics.md

Lines changed: 39 additions & 39 deletions
Large diffs are not rendered by default.

docs/Whats-New.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,37 @@ You can use the migration utility (can be found on [Phobos supplementaries repo]
8989

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

92+
### Changed tags<!-- This is only a temporary solution; what method to use afterwards has not been determined yet. -->
93+
94+
- To standardize tag names for similar functions, prevent typos, or avoid misunderstandings, replace them with new tag names.
95+
96+
#### From pre-0.5 devbuilds
97+
98+
- The following tags were renamed:
99+
- `[WarheadType] -> Crit.AffectAbovePercent` -> `[WarheadType] -> Crit.AffectsAbovePercent`.
100+
101+
#### From 0.4
102+
103+
- The following tags were renamed:
104+
- `[AttachEffectType] -> AffectTargets` -> `[AttachEffectType] -> AffectsTarget`
105+
- `[AttachEffectType] -> ReflectDamage.AffectsHouses` -> `[AttachEffectType] -> ReflectDamage.AffectsHouse`
106+
- `[AttachEffectType/TechnoType] -> RevengeWeapon.AffectsHouses` -> `[AttachEffectType/TechnoType] -> RevengeWeapon.AffectsHouse`
107+
- `[TechnoType] -> AutoFire` -> `[TechnoType] -> AutoTargetOwnPosition`
108+
- `[TechnoType] -> AutoFire.TargetSelf` -> `[TechnoType] -> AutoTargetOwnPosition.Self`
109+
- `[WarheadType] -> DetonateOnAllMapObjects.AffectHouses` -> `[WarheadType] -> DetonateOnAllMapObjects.AffectsHouse`
110+
- `[WarheadType] -> DetonateOnAllMapObjects.AffectTargets` -> `[WarheadType] -> DetonateOnAllMapObjects.AffectsTarget`
111+
- `[WarheadType] -> Crit.AffectBelowPercent` -> `[WarheadType] -> Crit.AffectsBelowPercent`.
112+
- `[WarheadType] -> Crit.Affects` -> `[WarheadType] -> Crit.AffectsTarget`
113+
- `[WarheadType] -> Crit.AffectsHouses` -> `[WarheadType] -> Crit.AffectsHouse`
114+
- `[WarheadType] -> KillWeapon.AffectsHouses` -> `[WarheadType] -> KillWeapon.AffectsHouse`
115+
- `[WarheadType] -> KillWeapon.OnFirer.AffectsHouses` -> `[WarheadType] -> KillWeapon.OnFirer.AffectsHouse`
116+
- `[WarheadType/SuperWeaponType] -> Convert(N).AffectedHouses` -> `[WarheadType/SuperWeaponType] -> Convert(N).AffectsHouse`
117+
- `[SuperWeaponType] -> LimboKill.Affected` -> `[SuperWeaponType] -> LimboKill.AffectsHouse`
118+
119+
```{note}
120+
- You can use the [*MigrationUtility*](https://github.com/Phobos-developers/PhobosSupplementaries/tree/develop/MigrationUtility) in the PhobosSupplementaries repository to conveniently complete these migrations.
121+
```
122+
92123
### New user settings in RA2MD.INI
93124

94125
- 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.

docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po

Lines changed: 79 additions & 80 deletions
Large diffs are not rendered by default.

src/Ext/Bullet/Hooks.DetonateLogics.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ DEFINE_HOOK(0x4690C1, BulletClass_Logics_DetonateOnAllMapObjects, 0x8)
7171
auto const pWHExt = WarheadTypeExt::ExtMap.Find(pThis->WH);
7272

7373
if (pWHExt->DetonateOnAllMapObjects && !pWHExt->WasDetonatedOnAllMapObjects
74-
&& pWHExt->DetonateOnAllMapObjects_AffectTargets != AffectedTarget::None
75-
&& pWHExt->DetonateOnAllMapObjects_AffectHouses != AffectedHouse::None)
74+
&& pWHExt->DetonateOnAllMapObjects_AffectsTarget != AffectedTarget::None
75+
&& pWHExt->DetonateOnAllMapObjects_AffectsHouse != AffectedHouse::None)
7676
{
7777
pWHExt->WasDetonatedOnAllMapObjects = true;
7878
auto const originalLocation = pThis->Location;
@@ -105,31 +105,31 @@ DEFINE_HOOK(0x4690C1, BulletClass_Logics_DetonateOnAllMapObjects, 0x8)
105105
}
106106
};
107107

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

112112
for (auto const pAircraft : aircraft)
113113
tryDetonate(pAircraft, pAircraft->Type);
114114
}
115115

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

120120
for (auto const pBuilding : buildings)
121121
tryDetonate(pBuilding, pBuilding->Type);
122122
}
123123

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

128128
for (auto const pInf : infantry)
129129
tryDetonate(pInf, pInf->Type);
130130
}
131131

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

src/Ext/SWType/Body.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void SWTypeExt::ExtData::Serialize(T& Stm)
5353
.Process(this->LimboDelivery_IDs)
5454
.Process(this->LimboDelivery_RandomWeightsData)
5555
.Process(this->LimboDelivery_RollChances)
56-
.Process(this->LimboKill_Affected)
56+
.Process(this->LimboKill_AffectsHouse)
5757
.Process(this->LimboKill_IDs)
5858
.Process(this->RandomBuffer)
5959
.Process(this->Detonate_Warhead)
@@ -141,7 +141,7 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
141141
this->LimboDelivery_Types.Read(exINI, pSection, "LimboDelivery.Types");
142142
this->LimboDelivery_IDs.Read(exINI, pSection, "LimboDelivery.IDs");
143143
this->LimboDelivery_RollChances.Read(exINI, pSection, "LimboDelivery.RollChances");
144-
this->LimboKill_Affected.Read(exINI, pSection, "LimboKill.Affected");
144+
this->LimboKill_AffectsHouse.Read(exINI, pSection, "LimboKill.AffectsHouse");
145145
this->LimboKill_IDs.Read(exINI, pSection, "LimboKill.IDs");
146146
this->SW_Next.Read(exINI, pSection, "SW.Next");
147147
this->SW_Next_RealLaunch.Read(exINI, pSection, "SW.Next.RealLaunch");

src/Ext/SWType/Body.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SWTypeExt
5454
ValueableVector<BuildingTypeClass*> LimboDelivery_Types;
5555
ValueableVector<int> LimboDelivery_IDs;
5656
ValueableVector<float> LimboDelivery_RollChances;
57-
Valueable<AffectedHouse> LimboKill_Affected;
57+
Valueable<AffectedHouse> LimboKill_AffectsHouse;
5858
ValueableVector<int> LimboKill_IDs;
5959
Valueable<double> RandomBuffer;
6060
ValueableIdxVector<SuperWeaponTypeClass> SW_Next;
@@ -141,7 +141,7 @@ class SWTypeExt
141141
, LimboDelivery_IDs {}
142142
, LimboDelivery_RollChances {}
143143
, LimboDelivery_RandomWeightsData {}
144-
, LimboKill_Affected { AffectedHouse::Owner }
144+
, LimboKill_AffectsHouse { AffectedHouse::Owner }
145145
, LimboKill_IDs {}
146146
, RandomBuffer { 0.0 }
147147
, Detonate_Warhead {}

src/Ext/SWType/FireSuperWeapon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void SWTypeExt::ExtData::ApplyLimboKill(HouseClass* pHouse)
197197
{
198198
for (HouseClass* pTargetHouse : HouseClass::Array)
199199
{
200-
if (EnumFunctions::CanTargetHouse(this->LimboKill_Affected, pHouse, pTargetHouse))
200+
if (EnumFunctions::CanTargetHouse(this->LimboKill_AffectsHouse, pHouse, pTargetHouse))
201201
{
202202
auto const pHouseExt = HouseExt::ExtMap.Find(pTargetHouse);
203203
auto& vec = pHouseExt->OwnedLimboDeliveredBuildings;

src/Ext/Techno/Body.Update.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,8 @@ void TechnoExt::ExtData::UpdateTypeData(TechnoTypeClass* pCurrentType)
11061106
}
11071107
}
11081108

1109-
// handle AutoFire
1110-
if (pOldTypeExt->AutoFire && !pNewTypeExt->AutoFire)
1109+
// handle AutoTargetOwnPosition
1110+
if (pOldTypeExt->AutoTargetOwnPosition && !pNewTypeExt->AutoTargetOwnPosition)
11111111
pThis->SetTarget(nullptr);
11121112
}
11131113

@@ -1909,7 +1909,7 @@ void TechnoExt::ExtData::UpdateSelfOwnedAttachEffects()
19091909
{
19101910
auto const attachEffect = it->get();
19111911
auto const pType = attachEffect->GetType();
1912-
const bool isValid = EnumFunctions::IsTechnoEligible(pThis, pType->AffectTargets, true)
1912+
const bool isValid = EnumFunctions::IsTechnoEligible(pThis, pType->AffectsTarget, true)
19131913
&& (pType->AffectTypes.empty() || pType->AffectTypes.Contains(pTechnoType)) && !pType->IgnoreTypes.Contains(pTechnoType);
19141914
const bool remove = !isValid || (attachEffect->IsSelfOwned() && !pTypeExt->AttachEffects.AttachTypes.Contains(pType));
19151915

src/Ext/Techno/Hooks.ReceiveDamage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ DEFINE_HOOK(0x701E18, TechnoClass_ReceiveDamage_ReflectDamage, 0x7)
380380
{
381381
auto const pInvoker = attachEffect->GetInvoker();
382382

383-
if (pInvoker && EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouses, pInvoker->Owner, pSourceHouse))
383+
if (pInvoker && EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouse, pInvoker->Owner, pSourceHouse))
384384
{
385385
auto const pWHExtRef = WarheadTypeExt::ExtMap.Find(pWH);
386386
pWHExtRef->Reflected = true;
@@ -393,7 +393,7 @@ DEFINE_HOOK(0x701E18, TechnoClass_ReceiveDamage_ReflectDamage, 0x7)
393393
pWHExtRef->Reflected = false;
394394
}
395395
}
396-
else if (EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouses, pThis->Owner, pSourceHouse))
396+
else if (EnumFunctions::CanTargetHouse(pType->ReflectDamage_AffectsHouse, pThis->Owner, pSourceHouse))
397397
{
398398
auto const pWHExtRef = WarheadTypeExt::ExtMap.Find(pWH);
399399
pWHExtRef->Reflected = true;

src/Ext/Techno/Hooks.TargetEvaluation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ DEFINE_HOOK(0x7098B9, TechnoClass_TargetSomethingNearby_AutoFire, 0x6)
1010

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

13-
if (pExt->AutoFire)
13+
if (pExt->AutoTargetOwnPosition)
1414
{
15-
if (pExt->AutoFire_TargetSelf)
15+
if (pExt->AutoTargetOwnPosition_Self)
1616
pThis->SetTarget(pThis);
1717
else
1818
pThis->SetTarget(pThis->GetCell());

0 commit comments

Comments
 (0)