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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Credits
- **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, NoManualMove, DeathWeapon fix, re-enable obsolete `JumpjetControls`, overhauled Unicode font, docs maintenance, CN docs translation
- **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, TemporaryClass related crash
- **Otamaa (Fahroni, BoredEXE)** - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass, DebrisMaximums fixes, Anim-to-Unit, NotHuman anim sequences improvements
- **Otamaa (Fahroni, BoredEXE)** - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass, DebrisMaximums fixes, Anim-to-Unit, NotHuman anim sequences improvements, Customizable OpenTopped Properties
- **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
11 changes: 11 additions & 0 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ NotHuman.RandomDeathSequence=yes ; boolean
NoManualMove=no ; boolean
```

### Customizable OpenTopped Properties

- You can now override settings of `OpenTopped` transport properties per TechnoType.

```ini
[SOMETECHNO] ; TechnoType
OpenTopped.RangeBonus=1 ; integer
OpenTopped.DamageMultiplier=1.3 ; float
OpenTopped.WarpDistance=8 ; integer
```

## Technos

### Mind Control enhancement
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ New:
- Allow `NotHuman=yes` infantry to use random `Death` anim sequence (by Otamaa)
- Ability for warheads to trigger specific `NotHuman=yes` infantry `Death` anim sequence (by Otamaa)
- XDrawOffset for animations (by Morton)
- Customizable OpenTopped properties (by Otamaa)

Vanilla fixes:
- Fixed laser drawing code to allow for thicker lasers in house color draw mode (by Kerbiter, ChrisLv_CN)
Expand Down
69 changes: 65 additions & 4 deletions src/Ext/Techno/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DEFINE_HOOK(0x6F9E50, TechnoClass_AI, 0x5)

// LaserTrails update routine is in TechnoClass::AI hook because TechnoClass::Draw
// doesn't run when the object is off-screen which leads to visual bugs - Kerbiter
for (auto const& trail: pExt->LaserTrails)
for (auto const& trail : pExt->LaserTrails)
trail->Update(TechnoExt::GetFLHAbsoluteCoords(pThis, trail->FLH, trail->IsOnTurret));

return 0;
Expand Down Expand Up @@ -126,7 +126,7 @@ DEFINE_HOOK(0x518505, InfantryClass_TakeDamage_NotHuman, 0x4)
REF_STACK(args_ReceiveDamage const, receiveDamageArgs, STACK_OFFS(0xD0, -0x4));

// Die1-Die5 sequences are offset by 10
#define Die(x) x + 10
constexpr auto Die = [](int x) { return x + 10; };

int resultSequence = Die(1);
auto const pTypeExt = TechnoTypeExt::ExtMap.Find(pThis->GetTechnoType());
Expand All @@ -144,10 +144,71 @@ DEFINE_HOOK(0x518505, InfantryClass_TakeDamage_NotHuman, 0x4)
}
}

#undef Die(x)

R->ECX(pThis);
pThis->PlayAnim(static_cast<Sequence>(resultSequence), true);

return 0x518515;
}

// Customizable OpenTopped Properties
// Author: Otamaa

DEFINE_HOOK(0x6F72D2, TechnoClass_IsCloseEnoughToTarget_OpenTopped_RangeBonus, 0xC)
{
GET(TechnoClass* const, pThis, ESI);

if (auto pTransport = pThis->Transporter)
{
if (auto pExt = TechnoTypeExt::ExtMap.Find(pTransport->GetTechnoType()))
{
R->EAX(pExt->OpenTopped_RangeBonus.Get(RulesClass::Instance->OpenToppedRangeBonus));
return 0x6F72DE;
}
}

return 0;
}

DEFINE_HOOK(0x6FE43B, TechnoClass_Fire_OpenTopped_DmgMult, 0x8)
{
enum { ApplyDamageMult = 0x6FE45A, ContinueCheck = 0x6FE460 };

GET(TechnoClass* const, pThis, ESI);

//replacing whole check due to `fild`
if (pThis->InOpenToppedTransport)
{
GET_STACK(int, nDamage, STACK_OFFS(0xB4, -0x2C));
float nDamageMult = static_cast<float>(RulesClass::Instance->OpenToppedDamageMultiplier);

if (auto pTransport = pThis->Transporter)
{
if (auto pExt = TechnoTypeExt::ExtMap.Find(pTransport->GetTechnoType()))
{
//it is float isnt it YRPP ? , check tomson26 YR-IDB !
nDamageMult = pExt->OpenTopped_DamageMultiplier.Get(nDamageMult);
}
}

R->EAX(Game::F2I(nDamage * nDamageMult));
return ApplyDamageMult;
}

return ContinueCheck;
}

DEFINE_HOOK(0x71A82C, TemporalClass_AI_Opentopped_WarpDistance, 0xC)
{
GET(TemporalClass* const, pThis, ESI);

if (auto pTransport = pThis->Owner->Transporter)
{
if (auto pExt = TechnoTypeExt::ExtMap.Find(pTransport->GetTechnoType()))
{
R->EDX(pExt->OpenTopped_WarpDistance.Get(RulesClass::Instance->OpenToppedWarpDistance));
return 0x71A838;
}
}

return 0;
}
7 changes: 7 additions & 0 deletions src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
// Ares 0.A
this->GroupAs.Read(pINI, pSection, "GroupAs");

this->OpenTopped_RangeBonus.Read(exINI, pSection, "OpenTopped.RangeBonus");
this->OpenTopped_DamageMultiplier.Read(exINI, pSection, "OpenTopped.DamageMultiplier");
this->OpenTopped_WarpDistance.Read(exINI, pSection, "OpenTopped.WarpDistance");

// Art tags
INI_EX exArtINI(CCINIClass::INI_Art);
auto pArtSection = pThis->ImageFile;
Expand Down Expand Up @@ -221,6 +225,9 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
.Process(this->NotHuman_RandomDeathSequence)
.Process(this->WeaponBurstFLHs)
.Process(this->EliteWeaponBurstFLHs)
.Process(this->OpenTopped_RangeBonus)
.Process(this->OpenTopped_DamageMultiplier)
.Process(this->OpenTopped_WarpDistance)
;
}
void TechnoTypeExt::ExtData::LoadFromStream(PhobosStreamReader& Stm)
Expand Down
9 changes: 8 additions & 1 deletion src/Ext/TechnoType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class TechnoTypeExt
Valueable<bool> DestroyAnim_Random;
Valueable<bool> NotHuman_RandomDeathSequence;

Nullable<int> OpenTopped_RangeBonus;
Nullable<float> OpenTopped_DamageMultiplier;
Nullable<int> OpenTopped_WarpDistance;

struct LaserTrailDataEntry
{
ValueableIdx<LaserTrailTypeClass> idxType;
Expand Down Expand Up @@ -113,7 +117,10 @@ class TechnoTypeExt
OreGathering_FramesPerDir(),
LaserTrailData(),
DestroyAnim_Random(true),
NotHuman_RandomDeathSequence(false)
NotHuman_RandomDeathSequence(false),
OpenTopped_RangeBonus(),
OpenTopped_DamageMultiplier(),
OpenTopped_WarpDistance()
{ }

virtual ~ExtData() = default;
Expand Down