Skip to content
Merged
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
1 change: 1 addition & 0 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<ClCompile Include="src\Ext\Side\Hooks.cpp" />
<ClCompile Include="src\Ext\Side\Hooks.SidebarGDIPositions.cpp" />
<ClCompile Include="src\Ext\TechnoType\Body.cpp" />
<ClCompile Include="src\Ext\TechnoType\Hooks.Teleport.cpp" />
<ClCompile Include="src\Ext\TechnoType\Hooks.cpp" />
<ClCompile Include="src\Ext\Techno\Body.cpp" />
<ClCompile Include="src\Ext\Techno\Hooks.cpp" />
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Credits
- wiktorderelf - overhauled Unicode font
- Thrifinesma (Uranusian) - Mind Control enhancement, custom warhead splash list, harvesters counter, promoted spawns, shields, overhauled Unicode font, help with docs
- SEC-SOME (secsome) - debug info dump hotkey, refactoring & porting of Ares helper code, introducing more Ares-derived stuff, disguise removal warhead, Mind Control removal warhead, Mind Control enhancement, shields
- Otamaa (BoredEXE) - help with CellSpread, ported and fixed custom RadType code , Disable spesific ElectricBolt bolt
- Otamaa (BoredEXE) - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass
- E1 Elite - TileSet 255 and above bridge repair fix
- FS-21 - Dump Object Info enhancements, Powered.KillSpawns, Spawner.LimitRange, ScriptType Actions 71, 72 & 73, MC deployer fixes, help with docs
- AutoGavy - interceptor logic, warhead critical damage system
Expand Down
24 changes: 24 additions & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@ SpawnsTiberium.Range=1 ; integer, radius in cells
SpawnsTiberium.GrowthStage=3 ; single int / comma-sep. range
```

## TechnoType

### Customizable Teleport/Chrono Locomotor settings per TechnoType

![image](_static/images/cust-Chrono.gif)
*Chrono Legionere and Ronco (hero) from [YR:New War] (https://www.moddb.com/mods/yuris-revenge-new-war)*

- You can now specify Teleport/Chrono Locomotor settings per TechnoType to override default rules values. Unfilled values default to values in `[General]`.
- Only applicable to Techno that have Teleport/Chrono Locomotor attached.

In `rulesmd.ini`:
```ini
[SOMETECHNO] ; TechnoType
WarpOut= ; Anim (played when Techno warping out)
WarpIn= ; Anim (played when Techno warping in)
WarpAway= ; Anim (played when Techno chronowarped by chronosphere)
ChronoTrigger= ; boolean, if yes then delay varies by distance, if no it is a constant
ChronoDistanceFactor= ; integer, amount to divide the distance to destination by to get the warped out delay
ChronoMinimumDelay= ; integer, the minimum delay for teleporting, no matter how short the distance
ChronoRangeMinimum= ; integer, can be used to set a small range within which the delay is constant
ChronoDelay= ; integer, delay after teleport for chronosphere

```

## Weapons

### Togglable ElectricBolt visuals
Expand Down
Binary file added docs/_static/images/cust-Chrono.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->Shield_HitAnim.Read(exINI, pSection, "Shield.HitAnim");
this->Shield_BracketDelta.Read(exINI, pSection, "Shield.BracketDelta");

//
this->WarpOut.Read(exINI, pSection, "WarpOut");
this->WarpIn.Read(exINI, pSection, "WarpIn");
this->WarpAway.Read(exINI, pSection, "WarpAway");
this->ChronoTrigger.Read(exINI, pSection, "ChronoTrigger");
this->ChronoDistanceFactor.Read(exINI, pSection, "ChronoDistanceFactor");
this->ChronoMinimumDelay.Read(exINI, pSection, "ChronoMinimumDelay");
this->ChronoRangeMinimum.Read(exINI, pSection, "ChronoRangeMinimum");
this->ChronoDelay.Read(exINI, pSection, "ChronoDelay");


// Ares 0.A
this->GroupAs.Read(pINI, pSection, "GroupAs");

Expand Down Expand Up @@ -158,6 +169,14 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
.Process(this->Shield_BreakAnim)
.Process(this->Shield_RespawnAnim)
.Process(this->Shield_HitAnim)
.Process(this->WarpOut)
.Process(this->WarpIn)
.Process(this->WarpAway)
.Process(this->ChronoTrigger)
.Process(this->ChronoDistanceFactor)
.Process(this->ChronoMinimumDelay)
.Process(this->ChronoRangeMinimum)
.Process(this->ChronoDelay)
;
}
void TechnoTypeExt::ExtData::LoadFromStream(PhobosStreamReader& Stm)
Expand Down
19 changes: 18 additions & 1 deletion src/Ext/TechnoType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ class TechnoTypeExt
Nullable<AnimTypeClass*> Shield_RespawnAnim;
Nullable<AnimTypeClass*> Shield_HitAnim;

Nullable<AnimTypeClass*> WarpOut;
Nullable<AnimTypeClass*> WarpIn;
Nullable<AnimTypeClass*> WarpAway;
Nullable<bool> ChronoTrigger;
Nullable<int> ChronoDistanceFactor;
Nullable<int> ChronoMinimumDelay;
Nullable<int> ChronoRangeMinimum;
Nullable<int> ChronoDelay;

ExtData(TechnoTypeClass* OwnerObject) : Extension<TechnoTypeClass>(OwnerObject),
HealthBar_Hide(false),
UIDescription(),
Expand Down Expand Up @@ -74,7 +83,15 @@ class TechnoTypeExt
Shield_IdleAnim(),
Shield_BreakAnim(),
Shield_RespawnAnim(),
Shield_HitAnim()
Shield_HitAnim(),
WarpOut(),
WarpIn(),
WarpAway(),
ChronoTrigger(),
ChronoDistanceFactor(),
ChronoMinimumDelay(),
ChronoRangeMinimum(),
ChronoDelay()
{ }

virtual ~ExtData() = default;
Expand Down
99 changes: 99 additions & 0 deletions src/Ext/TechnoType/Hooks.Teleport.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#include "Body.h"
#include <LocomotionClass.h>
#include <TeleportLocomotionClass.h>

#define GET_LOCO(reg_Loco) \
GET(ILocomotion *, Loco, reg_Loco); \
TeleportLocomotionClass *pLocomotor = static_cast<TeleportLocomotionClass*>(Loco); \
TechnoTypeClass *pType = pLocomotor->LinkedTo->GetTechnoType(); \
TechnoTypeExt::ExtData *pExt = TechnoTypeExt::ExtMap.Find(pType);

DEFINE_HOOK(719439, TeleportLocomotionClass_ILocomotion_Process_WarpoutAnim, 6)
{
GET_LOCO(ESI);

R->EDX<AnimTypeClass*>(pExt->WarpOut.Get(RulesClass::Instance->WarpOut));

return 0x71943F;
}

DEFINE_HOOK(719788, TeleportLocomotionClass_ILocomotion_Process_WarpInAnim, 6)
{
GET_LOCO(ESI);

R->EDX<AnimTypeClass*>(pExt->WarpIn.Get(RulesClass::Instance->WarpOut));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just use the default but unused [General]WarpIn for this one, instead of keep using WarpOut.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just following vanilla behaviour there , but yeah should change it to proper WarpIn and mention it on the doc since it change vanilla behaviour.


return 0x71978E;
}

DEFINE_HOOK(71986A, TeleportLocomotionClass_ILocomotion_Process_WarpAway, 6)
{
GET_LOCO(ESI);

R->ECX<AnimTypeClass*>(pExt->WarpAway.Get(RulesClass::Instance->WarpOut));

return 0x719870;
}

DEFINE_HOOK(7194D0, TeleportLocomotionClass_ILocomotion_Process_ChronoTrigger, 6)
{
GET_LOCO(ESI);

R->AL(pExt->ChronoTrigger.Get(RulesClass::Instance->ChronoTrigger));

return 0x7194D6;
}

DEFINE_HOOK(7194E3, TeleportLocomotionClass_ILocomotion_Process_ChronoDistanceFactor, 6)
{
GET_LOCO(ESI);
GET(int, val, EAX);

auto factor = pExt->ChronoDistanceFactor.Get(RulesClass::Instance->ChronoDistanceFactor);
factor = factor == 0 ? 1 : factor; //fix factor 0 crash by force it to 1 (Vanilla bug)

//IDIV
R->EAX(val / factor);
R->EDX(val % factor);

return 0x7194E9;
}

DEFINE_HOOK(719519, TeleportLocomotionClass_ILocomotion_Process_ChronoMinimumDelay, 6)
{
GET_LOCO(ESI);

R->EBX(pExt->ChronoMinimumDelay.Get(RulesClass::Instance->ChronoMinimumDelay));

return 0x71951F;
}

DEFINE_HOOK(719562, TeleportLocomotionClass_ILocomotion_Process_ChronoMinimumDelay2, 6)
{
GET_LOCO(ESI);

R->ECX(pExt->ChronoMinimumDelay.Get(RulesClass::Instance->ChronoMinimumDelay));

return 0x719568;
}

DEFINE_HOOK(719555, TeleportLocomotionClass_ILocomotion_Process_ChronoRangeMinimum, 6)
{
GET_LOCO(ESI);
GET(int, comparator, EDX);

auto factor = pExt->ChronoRangeMinimum.Get(RulesClass::Instance->ChronoRangeMinimum);

return comparator < factor ? 0x71955D : 0x719576;
}

DEFINE_HOOK(71997B, TeleportLocomotionClass_ILocomotion_Process_ChronoDelay, 6)
{
GET_LOCO(ESI);

R->ECX(pExt->ChronoDelay.Get(RulesClass::Instance->ChronoDelay));

return 0x719981;
}

#undef GET_LOCO