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
3 changes: 2 additions & 1 deletion docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/Ext/Techno/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<AnimClass>(pAnimType, pThis->Location))
{
pAnim->SetOwnerObject(pThis);
pAnim->Owner = pThis->Owner;
}
}

// Check if there is money refund
if (pData->PassengerDeletion_Soylent)
{
Expand Down
1 change: 1 addition & 0 deletions src/Ext/Techno/Body.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#include <TechnoClass.h>
#include <AnimClass.h>

#include <Helpers/Macro.h>
#include <Utilities/Container.h>
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/TechnoType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class TechnoTypeExt
Valueable<int> PassengerDeletion_Rate;
NullableIdx<VocClass> PassengerDeletion_ReportSound;
Valueable<bool> PassengerDeletion_Rate_SizeMultiply;
Nullable<AnimTypeClass*> PassengerDeletion_Anim;

Valueable<ShieldTypeClass*> ShieldType;

Expand Down Expand Up @@ -149,6 +150,7 @@ class TechnoTypeExt
, PassengerDeletion_Rate { 0 }
, PassengerDeletion_ReportSound {}
, PassengerDeletion_Rate_SizeMultiply { true }
, PassengerDeletion_Anim {}
, DefaultDisguise {}
, OpenTopped_RangeBonus {}
, OpenTopped_DamageMultiplier {}
Expand Down