Skip to content
Open
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
32 changes: 17 additions & 15 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2535,21 +2535,23 @@ Burst.NoDelay=false ; boolean
- If `DelayedFire.CenterAnimOnFirer` is set the animation is created at the firer's center rather than at the firing coordinates.
- If the weapon was fired by InfantryType and `DelayedFire.PauseFiringSequence` is set to true, the infantry's firing sequence animation is paused when it hits the firing frame defined by `FireUp/Prone` or `SecondaryFire/Prone` in its `artmd.ini` entry until the delay timer has expired.
- If the weapon has `Burst` > 1 and `DelayedFire.OnlyOnInitialBurst` set to true, the delay occurs only before the initial burst shot. Note that if using Ares, `Burst` index does not reset if firing is interrupted or the firer loses target, meaning it will be able to resume firing without waiting for the delay.

In `rulesmd.ini`:
```ini
[SOMEWEAPON] ; WeaponType
DelayedFire.Duration= ; integer - single or comma-sep. range (game frames)
DelayedFire.SkipInTransport=false ; boolean
DelayedFire.Animation= ; Animation
DelayedFire.OpenToppedAnimation= ; Animation
DelayedFire.AnimIsAttached=true ; boolean
DelayedFire.AnimOffset= ; integer - Forward,Lateral,Height
DelayedFire.AnimOnTurret=true ; boolean
DelayedFire.CenterAnimOnFirer=false ; boolean
DelayedFire.RemoveAnimOnNoDelay=false ; boolean
DelayedFire.PauseFiringSequence=false ; boolean
DelayedFire.OnlyOnInitialBurst=false ; boolean
- If the weapon has `DelayedFire.OnlyOnInitialBurst` set to true and `DelayedFire.InitialBurstSymmetrical` set to true, then there will be created second `DelayedFire.Animation` on opposite by lateral side played at the same time as the first one.

In `rulesmd.ini`:
```ini
[SOMEWEAPON] ; WeaponType
DelayedFire.Duration= ; integer - single or comma-sep. range (game frames)
DelayedFire.SkipInTransport=false ; boolean
DelayedFire.Animation= ; Animation
DelayedFire.OpenToppedAnimation= ; Animation
DelayedFire.AnimIsAttached=true ; boolean
DelayedFire.AnimOffset= ; integer - Forward,Lateral,Height
DelayedFire.AnimOnTurret=true ; boolean
DelayedFire.CenterAnimOnFirer=false ; boolean
DelayedFire.RemoveAnimOnNoDelay=false ; boolean
DelayedFire.PauseFiringSequence=false ; boolean
DelayedFire.OnlyOnInitialBurst=false ; boolean
DelayedFire.InitialBurstSymmetrical=false ; boolean
```

```{note}
Expand Down
4 changes: 4 additions & 0 deletions src/Ext/Techno/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,10 @@ bool TechnoExt::HandleDelayedFireWithPauseSequence(TechnoClass* pThis, int weapo
TechnoExt::CreateDelayedFireAnim(pThis, pAnimType, weaponIndex, pWeaponExt->DelayedFire_AnimIsAttached, pWeaponExt->DelayedFire_CenterAnimOnFirer,
pWeaponExt->DelayedFire_RemoveAnimOnNoDelay, pWeaponExt->DelayedFire_AnimOnTurret, firingCoords);

if (pWeaponExt->DelayedFire_InitialBurstSymmetrical)
TechnoExt::CreateDelayedFireAnim(pThis, pAnimType, weaponIndex, pWeaponExt->DelayedFire_AnimIsAttached, pWeaponExt->DelayedFire_CenterAnimOnFirer,
pWeaponExt->DelayedFire_RemoveAnimOnNoDelay, pWeaponExt->DelayedFire_AnimOnTurret, {firingCoords.X, -firingCoords.Y, firingCoords.Z});

return true;
}
else if (timer.InProgress())
Expand Down
4 changes: 4 additions & 0 deletions src/Ext/Techno/Hooks.Firing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ DEFINE_HOOK(0x6FDDC0, TechnoClass_FireAt_BeforeTruelyFire, 0x6)
TechnoExt::CreateDelayedFireAnim(pThis, pAnimType, weaponIndex, pWeaponExt->DelayedFire_AnimIsAttached, pWeaponExt->DelayedFire_CenterAnimOnFirer,
pWeaponExt->DelayedFire_RemoveAnimOnNoDelay, pWeaponExt->DelayedFire_AnimOnTurret, firingCoords);

if (pWeaponExt->DelayedFire_InitialBurstSymmetrical)
TechnoExt::CreateDelayedFireAnim(pThis, pAnimType, weaponIndex, pWeaponExt->DelayedFire_AnimIsAttached, pWeaponExt->DelayedFire_CenterAnimOnFirer,
pWeaponExt->DelayedFire_RemoveAnimOnNoDelay, pWeaponExt->DelayedFire_AnimOnTurret, {firingCoords.X, -firingCoords.Y, firingCoords.Z});

return SkipFiring;
}
else
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/WeaponType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ void WeaponTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->DelayedFire_RemoveAnimOnNoDelay.Read(exINI, pSection, "DelayedFire.RemoveAnimOnNoDelay");
this->DelayedFire_PauseFiringSequence.Read(exINI, pSection, "DelayedFire.PauseFiringSequence");
this->DelayedFire_OnlyOnInitialBurst.Read(exINI, pSection, "DelayedFire.OnlyOnInitialBurst");
this->DelayedFire_InitialBurstSymmetrical.Read(exINI, pSection, "DelayedFire.InitialBurstSymmetrical");
this->DelayedFire_AnimOffset.Read(exINI, pSection, "DelayedFire.AnimOffset");
this->DelayedFire_AnimOnTurret.Read(exINI, pSection, "DelayedFire.AnimOnTurret");

Expand Down Expand Up @@ -235,6 +236,7 @@ void WeaponTypeExt::ExtData::Serialize(T& Stm)
.Process(this->DelayedFire_RemoveAnimOnNoDelay)
.Process(this->DelayedFire_PauseFiringSequence)
.Process(this->DelayedFire_OnlyOnInitialBurst)
.Process(this->DelayedFire_InitialBurstSymmetrical)
.Process(this->DelayedFire_AnimOffset)
.Process(this->DelayedFire_AnimOnTurret)
;
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/WeaponType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class WeaponTypeExt
Valueable<bool> DelayedFire_RemoveAnimOnNoDelay;
Valueable<bool> DelayedFire_PauseFiringSequence;
Valueable<bool> DelayedFire_OnlyOnInitialBurst;
Valueable<bool> DelayedFire_InitialBurstSymmetrical;
Nullable<CoordStruct> DelayedFire_AnimOffset;
Valueable<bool> DelayedFire_AnimOnTurret;

Expand Down Expand Up @@ -162,6 +163,7 @@ class WeaponTypeExt
, DelayedFire_RemoveAnimOnNoDelay { false }
, DelayedFire_PauseFiringSequence { false }
, DelayedFire_OnlyOnInitialBurst { false }
, DelayedFire_InitialBurstSymmetrical { false }
, DelayedFire_AnimOffset {}
, DelayedFire_AnimOnTurret { true }
{ }
Expand Down
Loading