Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ This page lists all the individual contributions to the project by their author.
- Fix the bug that `IsLocomotor=yes` warhead rendering hover units unselectable and undamageable on elevated bridge
- Fix the bug that Locomotor warhead won't stop working when firer (except for vehicle) stop firing
- Fix the bug that hover vehicle will sink if destroyed on bridge
- Spawns particle when spawns tiberium by terrain
- **Apollo** - Translucent SHP drawing patches
- **ststl**:
- Customizable `ShowTimer` priority of superweapons
Expand Down
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@ SpawnsTiberium.Type=0 ; tiberium/ore type index
SpawnsTiberium.Range=1 ; integer, radius in cells
SpawnsTiberium.GrowthStage=3 ; integer - single or comma-sep. range
SpawnsTiberium.CellsPerAnim=1 ; integer - single or comma-sep. range
SpawnsTiberium.Particle= ; particle
```

### Damaged frames and crumbling animation
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ New:
- [Damaged aircraft image changes](New-or-Enhanced-Logics.md#damaged-aircraft-image-changes) (by Fryone)
- [Additional attached animation position customizations](Fixed-or-Improved-Logics.md#attached-animation-position-customization) (by Starkku)
- Use `SkipCrushSlowdown=true` to avoid the bug related to `Accelerates=true` and `MovementZone=CrushAll` (by TaranDahl)
- Spawns particle when spawns tiberium by terrain (by NetsuNegi)

Vanilla fixes:
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/TerrainType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void TerrainTypeExt::ExtData::Serialize(T& Stm)
.Process(this->SpawnsTiberium_Range)
.Process(this->SpawnsTiberium_GrowthStage)
.Process(this->SpawnsTiberium_CellsPerAnim)
.Process(this->SpawnsTiberium_Particle)
.Process(this->DestroyAnim)
.Process(this->DestroySound)
.Process(this->MinimapColor)
Expand All @@ -73,6 +74,7 @@ void TerrainTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->SpawnsTiberium_Range.Read(exINI, pSection, "SpawnsTiberium.Range");
this->SpawnsTiberium_GrowthStage.Read(exINI, pSection, "SpawnsTiberium.GrowthStage");
this->SpawnsTiberium_CellsPerAnim.Read(exINI, pSection, "SpawnsTiberium.CellsPerAnim");
this->SpawnsTiberium_Particle.Read(exINI, pSection, "SpawnsTiberium.Particle");

this->DestroyAnim.Read(exINI, pSection, "DestroyAnim");
this->DestroySound.Read(exINI, pSection, "DestroySound");
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/TerrainType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TerrainTypeExt
Valueable<int> SpawnsTiberium_Range;
Valueable<PartialVector2D<int>> SpawnsTiberium_GrowthStage;
Valueable<PartialVector2D<int>> SpawnsTiberium_CellsPerAnim;
ValueableIdx<ParticleTypeClass> SpawnsTiberium_Particle;
Valueable<AnimTypeClass*> DestroyAnim;
ValueableIdx<VocClass> DestroySound;
Nullable<ColorStruct> MinimapColor;
Expand All @@ -39,6 +40,7 @@ class TerrainTypeExt
, SpawnsTiberium_Range { 1 }
, SpawnsTiberium_GrowthStage { { 3, 0 } }
, SpawnsTiberium_CellsPerAnim { { 1, 0 } }
, SpawnsTiberium_Particle { -1 }
, DestroyAnim {}
, DestroySound {}
, MinimapColor {}
Expand Down
9 changes: 9 additions & 0 deletions src/Ext/TerrainType/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <TacticalClass.h>
#include <TiberiumClass.h>
#include <TerrainClass.h>
#include <ParticleSystemClass.h>

#include <Ext/Rules/Body.h>
#include <Utilities/GeneralUtils.h>
Expand Down Expand Up @@ -47,6 +48,14 @@ DEFINE_HOOK(0x71C84D, TerrainClass_AI_Animated, 0x6)
for (int i = 0; i < cellCount; i++)
pCell->SpreadTiberium(true);

const int particleIdx = pTypeExt->SpawnsTiberium_Particle;

if (particleIdx >= 0)
{
const auto particleSys = reinterpret_cast<ParticleSystemClass*>(0xA8ED78);
reinterpret_cast<ParticleClass*(__thiscall*)(void*, ParticleTypeClass*, const CoordStruct&)>(0x62E430)(particleSys, ParticleTypeClass::Array[particleIdx], pThis->Location);
}

// Unset context for CellClass hooks.
TerrainTypeTemp::pCurrentType = nullptr;
TerrainTypeTemp::pCurrentExt = nullptr;
Expand Down
Loading