Skip to content

Commit 805da81

Browse files
authored
[Minor][New Feature] Skip anim delay for burst fire (#1511)
For effects similar to Tesla coils in Red Alert 1
1 parent d44622f commit 805da81

File tree

6 files changed

+29
-0
lines changed

6 files changed

+29
-0
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ This page lists all the individual contributions to the project by their author.
392392
- Skirmish AI "sell all buildings and set all technos to hunt" behavior dehardcode
393393
- Skirmish AI "gather when MCV deploy" behavior dehardcode
394394
- Global value of `RepairBaseNodes`
395+
- Skip anim delay for burst fire
395396
- **tyuah8** - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
396397
- **Aephiex** - initial fix for Ares academy not working on the initial payloads of vehicles built from a war factory
397398
- **Ares developers**

docs/New-or-Enhanced-Logics.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,17 @@ SpyEffect.VictimSuperWeapon= ; SuperWeaponType
582582
SpyEffect.InfiltratorSuperWeapon= ; SuperWeaponType
583583
```
584584

585+
### Skip anim delay for burst fire
586+
587+
- In Red Alert 1, the tesla coil will attack multiple times after charging animation. This is not possible in Red Alert 2, where the building must play the charge animation every time it fires.
588+
- Now you can implement the above logic using the following flag.
589+
590+
In `artmd.ini`:
591+
```ini
592+
[SOMEBUILDING] ; BuildingType
593+
IsAnimDelayedBurst=true ; boolean
594+
```
595+
585596
## Infantry
586597

587598
### Customizable FLH When Infantry Is Prone Or Deployed

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ New:
317317
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
318318
- Custom exit cell for infantry factory (by Starkku)
319319
- Option for vehicles to keep target when issued move command (by Starkku)
320+
- Skip anim delay for burst fire (by TaranDahl)
320321
321322
Vanilla fixes:
322323
- Aircraft will now behave as expected according to it's `MovementZone` and `SpeedType` when moving onto different surfaces. In particular, this fixes erratic behavior when vanilla aircraft is ordered to move onto water surface and instead the movement order changes to a shore nearby (by CrimRecya)

src/Ext/Building/Hooks.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,3 +676,14 @@ DEFINE_HOOK(0x444B83, BuildingClass_ExitObject_BarracksExitCell, 0x7)
676676

677677
#pragma endregion
678678

679+
#pragma region BuildingFiring
680+
681+
DEFINE_HOOK(0x44B630, BuildingClass_MissionAttack_AnimDelayedFire, 0x6)
682+
{
683+
enum { JustFire = 0x44B6C4, VanillaCheck = 0 };
684+
GET(BuildingClass* const, pThis, ESI);
685+
auto const pTypeExt = BuildingTypeExt::ExtMap.Find(pThis->Type);
686+
return (pTypeExt && !pTypeExt->IsAnimDelayedBurst && pThis->CurrentBurstIndex != 0) ? JustFire : VanillaCheck;
687+
}
688+
689+
#pragma endregion

src/Ext/BuildingType/Body.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ void BuildingTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
166166
this->FactoryPlant_AllowTypes.Read(exINI, pSection, "FactoryPlant.AllowTypes");
167167
this->FactoryPlant_DisallowTypes.Read(exINI, pSection, "FactoryPlant.DisallowTypes");
168168

169+
this->IsAnimDelayedBurst.Read(exArtINI, pSection, "IsAnimDelayedBurst");
169170
this->Units_RepairRate.Read(exINI, pSection, "Units.RepairRate");
170171
this->Units_RepairStep.Read(exINI, pSection, "Units.RepairStep");
171172
this->Units_RepairPercent.Read(exINI, pSection, "Units.RepairPercent");
@@ -291,6 +292,7 @@ void BuildingTypeExt::ExtData::Serialize(T& Stm)
291292
.Process(this->AircraftDockingDirs)
292293
.Process(this->FactoryPlant_AllowTypes)
293294
.Process(this->FactoryPlant_DisallowTypes)
295+
.Process(this->IsAnimDelayedBurst)
294296
.Process(this->IsDestroyableObstacle)
295297
.Process(this->Units_RepairRate)
296298
.Process(this->Units_RepairStep)

src/Ext/BuildingType/Body.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class BuildingTypeExt
6464
Valueable<int> SellBuildupLength;
6565
Valueable<bool> IsDestroyableObstacle;
6666

67+
Valueable<bool> IsAnimDelayedBurst;
68+
6769
std::vector<std::optional<DirType>> AircraftDockingDirs;
6870

6971
ValueableVector<TechnoTypeClass*> FactoryPlant_AllowTypes;
@@ -120,6 +122,7 @@ class BuildingTypeExt
120122
, AircraftDockingDirs {}
121123
, FactoryPlant_AllowTypes {}
122124
, FactoryPlant_DisallowTypes {}
125+
, IsAnimDelayedBurst { true }
123126
, IsDestroyableObstacle { false }
124127
, Units_RepairRate {}
125128
, Units_RepairStep {}

0 commit comments

Comments
 (0)