From 4780793d49a8556c60d8a50a6734a11c3dcb111f Mon Sep 17 00:00:00 2001 From: Uranusian Date: Wed, 14 Jul 2021 15:42:15 +0800 Subject: [PATCH] Implement NoManualMove --- README.md | 2 +- docs/New-or-Enhanced-Logics.md | 8 ++++++++ docs/Whats-New.md | 1 + src/Ext/TechnoType/Body.cpp | 2 ++ src/Ext/TechnoType/Body.h | 2 ++ src/Ext/TechnoType/Hooks.cpp | 10 ++++++++++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c36efa7fe..baf030f42b 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Credits - **SMxReaver** - help with docs, extensive and thorough testing - **4SG** - help with docs - **wiktorderelf** - overhauled Unicode font -- **Uranusian (Thrifinesma)** - Mind Control enhancement, custom warhead splash list, harvesters counter, promoted spawns, shields, death after dead fix, customizeable missing cameo, cameo sorting priority, placement mode responding of tab hotkeys fix, producing progress, custom ore gathering anim, overhauled Unicode font, help with docs +- **Uranusian (Thrifinesma)** - Mind Control enhancement, custom warhead splash list, harvesters counter, promoted spawns, shields, death after dead fix, customizeable missing cameo, cameo sorting priority, placement mode responding of tab hotkeys fix, producing progress, custom ore gathering anim, NoManualMove, overhauled Unicode font, help with docs - **secsome (SEC-SOME)** - 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, AnimList.PickRandom, MoveToCell fix, unlimited waypoints, Build At trigger action buildup anim fix, Undeploy building into a unit plays `EVA_NewRallyPointEstablished` fix, custom ore gathering anim - **Otamaa (Fahroni, BoredEXE)** - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass, DebrisMaximums fixes - **E1 Elite** - TileSet 255 and above bridge repair fix diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 41b1baf334..29d2fb91d6 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -139,6 +139,14 @@ BreaksShield=false ; boolean - `PenetratesShield` allows the warhead ignore the shield and always deal full damage to the TechnoType itself. It also allows targeting the TechnoType as if shield isn't existed. - `BreaksShield` allows the warhead to always break shields of TechnoTypes, regardless of the amount of strength the shield has remaining or the damage dealt, assuming it affects the shield's armor type. Residual damage, if there is any, still respects `AbsorbOverDamage`. +### No Manual Move + +- You can now specify whether a TechnoType is unable to receive move command. + +```ini +[SOMETECHNO] ; TechnoType +NoManualMove=no ; boolean +``` ## Weapons diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 5f546bfe8a..4989b66e54 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -39,6 +39,7 @@ New: - Customizable producing progress "bars" like CnC:Remastered did (by Uranusian) - Customizable cameo sorting priority (by Uranusian) - Customizable harvester ore gathering animation (by secsome, Uranusian) +- Allow making technos unable to be issued with movement order (by Uranusian) Vanilla fixes: - TBD diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index 88537f385b..7ed8f79591 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -97,6 +97,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->Promote_IncludeSpawns.Read(exINI, pSection, "Promote.IncludeSpawns"); this->ImmuneToCrit.Read(exINI, pSection, "ImmuneToCrit"); this->MultiMindControl_ReleaseVictim.Read(exINI, pSection, "MultiMindControl.ReleaseVictim"); + this->NoManualMove.Read(exINI, pSection, "NoManualMove"); this->ShieldType.Read(exINI, pSection, "ShieldType", true); this->CameoPriority.Read(exINI, pSection, "CameoPriority"); @@ -144,6 +145,7 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm) .Process(this->ImmuneToCrit) .Process(this->MultiMindControl_ReleaseVictim) .Process(this->CameoPriority) + .Process(this->NoManualMove) .Process(this->ShieldType) .Process(this->WarpOut) .Process(this->WarpIn) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index 144a679e54..a1c183e4f1 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -36,6 +36,7 @@ class TechnoTypeExt Valueable ImmuneToCrit; Valueable MultiMindControl_ReleaseVictim; Valueable CameoPriority; + Valueable NoManualMove; Valueable ShieldType; @@ -72,6 +73,7 @@ class TechnoTypeExt ImmuneToCrit(false), MultiMindControl_ReleaseVictim(false), CameoPriority(0), + NoManualMove(false), ShieldType(), WarpOut(), WarpIn(), diff --git a/src/Ext/TechnoType/Hooks.cpp b/src/Ext/TechnoType/Hooks.cpp index 10aecc2713..90d04fb966 100644 --- a/src/Ext/TechnoType/Hooks.cpp +++ b/src/Ext/TechnoType/Hooks.cpp @@ -147,4 +147,14 @@ DEFINE_HOOK(0x73D223, UnitClass_DrawIt_OreGath, 0x6) R->EBX(pBounds); return 0x73D28C; +} + +DEFINE_HOOK(0x700C58, TechnoClass_CanPlayerMove_NoManualMove, 0x6) +{ + GET(TechnoClass*, pThis, ESI); + + if (auto pExt = TechnoTypeExt::ExtMap.Find(pThis->GetTechnoType())) + return pExt->NoManualMove ? 0x700C62 : 0; + + return 0; } \ No newline at end of file