Skip to content

Commit d9e6149

Browse files
committed
customized warp anim tweak
- `Chronoshift.WarpIn/Out` will take precedence over `WarpIn/Out` when being chronowarped - tweak `WarpAway` logic to make it not break Ares' `Temporal.WarpAway`
1 parent 8c9dcff commit d9e6149

File tree

5 files changed

+27
-11
lines changed

5 files changed

+27
-11
lines changed

docs/Fixed-or-Improved-Logics.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,13 +1034,17 @@ TargetZoneScanType=same ; target zone scan enumeration (same|any|inrange)
10341034

10351035
- You can now specify Teleport/Chrono Locomotor settings per TechnoType to override default rules values. Unfilled values default to values in `[General]`.
10361036
- Applicable to Techno that have Teleport/Chrono Locomotor attached, or being chronowarped by chronosphere.
1037+
- `Chronoshift.WarpOut` and `Chronoshift.WarpIn` will override `WarpOut` and `WarpIn` respectively when the techno is being chronowarped by chronosphere, if set.
1038+
- `WarpAway` specify the anim when the techno is being erased by `Temporal=yes` warhead. Will override Ares' `Temporal.WarpAway` tag on warhead, if set.
10371039
- If more than one animation is listed in `WarpOut`, `WarpIn` or `WarpAway`, a random one is selected.
10381040

10391041
In `rulesmd.ini`:
10401042
```ini
10411043
[SOMETECHNO] ; TechnoType
10421044
WarpOut= ; List of AnimationTypes (played when Techno warping out), default to [General] -> WarpOut
10431045
WarpIn= ; List of AnimationTypes (played when Techno warping in), default to [General] -> WarpIn
1046+
Chronoshift.WarpOut= ; List of AnimationTypes (played when Techno warping out by chronosphere), default to WarpOut
1047+
Chronoshift.WarpIn= ; List of AnimationTypes (played when Techno warping in by chronosphere), default to WarpIn
10441048
WarpAway= ; List of AnimationTypes (played when Techno being erased by `Temporal=yes` warhead), default to [General] -> WarpAway
10451049
ChronoTrigger= ; boolean, if yes then delay varies by distance, if no it is a constant
10461050
ChronoDistanceFactor= ; integer, amount to divide the distance to destination by to get the warped out delay

src/Ext/Techno/Hooks.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,12 +1303,8 @@ DEFINE_HOOK(0x71A8BD, TemporalClass_Update_WarpAwayAnim, 0x5)
13031303
if (pExt->WarpAway.size() > 0)
13041304
{
13051305
AnimExt::CreateRandomAnim(pExt->WarpAway, pTarget->Location, nullptr, pTarget->Owner);
1306+
return 0x71A90E;
13061307
}
1307-
else if (auto const pWarpAway = RulesClass::Instance->WarpAway)
1308-
{
1309-
auto const pAnim = GameCreate<AnimClass>(pWarpAway, pTarget->Location);
1310-
AnimExt::SetAnimOwnerHouseKind(pAnim, pTarget->Owner, nullptr, false, true);
1311-
}
1312-
1313-
return 0x71A90E;
1308+
1309+
return 0;
13141310
}

src/Ext/TechnoType/Body.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
664664

665665
this->WarpOut.Read(exINI, pSection, "WarpOut");
666666
this->WarpIn.Read(exINI, pSection, "WarpIn");
667+
this->Chronoshift_WarpOut.Read(exINI, pSection, "Chronoshift.WarpOut");
668+
this->Chronoshift_WarpIn.Read(exINI, pSection, "Chronoshift.WarpIn");
667669
this->WarpAway.Read(exINI, pSection, "WarpAway");
668670
this->ChronoTrigger.Read(exINI, pSection, "ChronoTrigger");
669671
this->ChronoDistanceFactor.Read(exINI, pSection, "ChronoDistanceFactor");
@@ -1300,6 +1302,8 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
13001302

13011303
.Process(this->WarpOut)
13021304
.Process(this->WarpIn)
1305+
.Process(this->Chronoshift_WarpOut)
1306+
.Process(this->Chronoshift_WarpIn)
13031307
.Process(this->WarpAway)
13041308
.Process(this->ChronoTrigger)
13051309
.Process(this->ChronoDistanceFactor)

src/Ext/TechnoType/Body.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ class TechnoTypeExt
113113

114114
ValueableVector<AnimTypeClass*> WarpOut;
115115
ValueableVector<AnimTypeClass*> WarpIn;
116+
ValueableVector<AnimTypeClass*> Chronoshift_WarpOut;
117+
ValueableVector<AnimTypeClass*> Chronoshift_WarpIn;
116118
ValueableVector<AnimTypeClass*> WarpAway;
117119
Nullable<bool> ChronoTrigger;
118120
Nullable<int> ChronoDistanceFactor;
@@ -470,6 +472,8 @@ class TechnoTypeExt
470472

471473
, WarpOut {}
472474
, WarpIn {}
475+
, Chronoshift_WarpOut {}
476+
, Chronoshift_WarpIn {}
473477
, WarpAway {}
474478
, ChronoTrigger {}
475479
, ChronoDistanceFactor {}

src/Ext/TechnoType/Hooks.Teleport.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,15 @@ DEFINE_HOOK(0x719742, TeleportLocomotionClass_ILocomotion_Process_WarpInAnim, 0x
102102
return 0x719796;
103103
}
104104

105-
DEFINE_HOOK(0x719827, TeleportLocomotionClass_ILocomotion_Process_WarpOutChronoshiftAnim, 0x5)
105+
DEFINE_HOOK(0x719827, TeleportLocomotionClass_ILocomotion_Process_ChronoshiftWarpOutAnim, 0x5)
106106
{
107107
GET_LOCO(ESI);
108108

109-
if (pExt->WarpOut.size() > 0)
109+
if (pExt->Chronoshift_WarpOut.size() > 0)
110+
{
111+
AnimExt::CreateRandomAnim(pExt->Chronoshift_WarpOut, pLinked->Location, nullptr, pLinked->Owner);
112+
}
113+
else if (pExt->WarpOut.size() > 0)
110114
{
111115
AnimExt::CreateRandomAnim(pExt->WarpOut, pLinked->Location, nullptr, pLinked->Owner);
112116
}
@@ -119,11 +123,15 @@ DEFINE_HOOK(0x719827, TeleportLocomotionClass_ILocomotion_Process_WarpOutChronos
119123
return 0x719878;
120124
}
121125

122-
DEFINE_HOOK(0x719B1E, TeleportLocomotionClass_ILocomotion_Process_WarpInChronoshiftAnim, 0x5)
126+
DEFINE_HOOK(0x719B1E, TeleportLocomotionClass_ILocomotion_Process_ChronoshiftWarpInAnim, 0x5)
123127
{
124128
GET_LOCO(ESI);
125129

126-
if (pExt->WarpIn.size() > 0)
130+
if (pExt->Chronoshift_WarpIn.size() > 0)
131+
{
132+
AnimExt::CreateRandomAnim(pExt->Chronoshift_WarpIn, pLinked->Location, nullptr, pLinked->Owner);
133+
}
134+
else if (pExt->WarpIn.size() > 0)
127135
{
128136
AnimExt::CreateRandomAnim(pExt->WarpIn, pLinked->Location, nullptr, pLinked->Owner);
129137
}

0 commit comments

Comments
 (0)