diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index e6fe6a6d38..8a3b5720df 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -268,11 +268,12 @@ DefaultDisguise=E2 ; InfantryType In `rulesmd.ini`: ```ini [SOMETECHNO] ; TechnoType -PassengerDeletion.Rate= ; integer, game frames +PassengerDeletion.Rate=0 ; integer, game frames PassengerDeletion.Rate.SizeMultiply=yes ; boolean, whether to multiply frames amount by size PassengerDeletion.Soylent=no ; boolean PassengerDeletion.SoylentFriendlies=no ; boolean PassengerDeletion.ReportSound= ; sound +PassengerDeletion.Anim= ; animation ``` ### Customizable OpenTopped Properties diff --git a/src/Ext/Techno/Body.cpp b/src/Ext/Techno/Body.cpp index cc36605a38..8bb88868da 100644 --- a/src/Ext/Techno/Body.cpp +++ b/src/Ext/Techno/Body.cpp @@ -358,6 +358,16 @@ void TechnoExt::EatPassengers(TechnoClass* pThis) { VocClass::PlayAt(pData->PassengerDeletion_ReportSound, pThis->GetCoords(), nullptr); + if (pData->PassengerDeletion_Anim.isset()) + { + const auto pAnimType = pData->PassengerDeletion_Anim.Get(); + if (auto const pAnim = GameCreate(pAnimType, pThis->Location)) + { + pAnim->SetOwnerObject(pThis); + pAnim->Owner = pThis->Owner; + } + } + // Check if there is money refund if (pData->PassengerDeletion_Soylent) { diff --git a/src/Ext/Techno/Body.h b/src/Ext/Techno/Body.h index b6832f49f7..66b3d688cb 100644 --- a/src/Ext/Techno/Body.h +++ b/src/Ext/Techno/Body.h @@ -1,5 +1,6 @@ #pragma once #include +#include #include #include diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index 0554f807b0..ae9168f2ee 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -122,6 +122,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI) this->PassengerDeletion_ReportSound.Read(exINI, pSection, "PassengerDeletion.ReportSound"); this->PassengerDeletion_Rate_SizeMultiply.Read(exINI, pSection, "PassengerDeletion.Rate.SizeMultiply"); this->PassengerDeletion_Rate.Read(exINI, pSection, "PassengerDeletion.Rate"); + this->PassengerDeletion_Anim.Read(exINI, pSection, "PassengerDeletion.Anim"); this->DefaultDisguise.Read(exINI, pSection, "DefaultDisguise"); @@ -265,6 +266,7 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm) .Process(this->PassengerDeletion_Rate) .Process(this->PassengerDeletion_ReportSound) .Process(this->PassengerDeletion_Rate_SizeMultiply) + .Process(this->PassengerDeletion_Anim) .Process(this->OpenTopped_RangeBonus) .Process(this->OpenTopped_DamageMultiplier) .Process(this->OpenTopped_WarpDistance) diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index dce4cb64b4..6900bda51b 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -46,6 +46,7 @@ class TechnoTypeExt Valueable PassengerDeletion_Rate; NullableIdx PassengerDeletion_ReportSound; Valueable PassengerDeletion_Rate_SizeMultiply; + Nullable PassengerDeletion_Anim; Valueable ShieldType; @@ -149,6 +150,7 @@ class TechnoTypeExt , PassengerDeletion_Rate { 0 } , PassengerDeletion_ReportSound {} , PassengerDeletion_Rate_SizeMultiply { true } + , PassengerDeletion_Anim {} , DefaultDisguise {} , OpenTopped_RangeBonus {} , OpenTopped_DamageMultiplier {}