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
3 changes: 3 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,9 @@ This page lists all the individual contributions to the project by their author.
- Fix the issue where the sidebar would not refresh when an unit dies in limbo
- Enable playing ingame movie in non-campaign modes (i.e. trigger action 100 and 117)
- Allow replacing vanilla repairing with togglable auto repairing
- Forced displacement locomotor implementation
- Knock-up warhead
- Traction warhead
- **solar-III (凤九歌)**
- Target scanning delay customization (documentation)
- Skip target scanning function calling for unarmed technos (documentation)
Expand Down
4 changes: 4 additions & 0 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ClCompile Include="src\Commands\DeselectObject.cpp" />
<ClCompile Include="src\Ext\Cell\Hooks.cpp" />
<ClCompile Include="src\Ext\Event\Body.cpp" />
<ClCompile Include="src\Locomotion\ShiftLocomotionClass.cpp" />
<ClCompile Include="src\Ext\Infantry\Hooks.cpp" />
<ClCompile Include="src\Ext\Infantry\Hooks.Firing.cpp" />
<ClCompile Include="src\Ext\TechnoType\Hooks.MultiWeapon.cpp" />
Expand All @@ -33,6 +34,7 @@
<ClCompile Include="src\Ext\Unit\Hooks.SimpleDeployer.cpp" />
<ClCompile Include="src\Ext\Unit\Hooks.Unload.cpp" />
<ClCompile Include="src\New\Entity\Ares\RadarJammerClass.cpp" />
<ClCompile Include="src\New\Entity\ShiftSchedule.cpp" />
<ClCompile Include="src\New\Type\Affiliated\CreateUnitTypeClass.cpp" />
<ClCompile Include="src\Blowfish\blowfish.cpp" />
<ClCompile Include="src\Blowfish\Hooks.Blowfish.cpp" />
Expand Down Expand Up @@ -223,9 +225,11 @@
<ItemGroup>
<ClInclude Include="src\Commands\DeselectObject5.h" />
<ClInclude Include="src\Commands\DeselectObject.h" />
<ClInclude Include="src\Locomotion\ShiftLocomotionClass.h" />
<ClInclude Include="src\Ext\EBolt\Body.h" />
<ClInclude Include="src\Ext\Event\Body.h" />
<ClInclude Include="src\New\Entity\Ares\RadarJammerClass.h" />
<ClInclude Include="src\New\Entity\ShiftSchedule.h" />
<ClInclude Include="src\New\Type\Affiliated\CreateUnitTypeClass.h" />
<ClInclude Include="src\Blowfish\blowfish.h" />
<ClInclude Include="src\Ext\Cell\Body.h" />
Expand Down
2 changes: 1 addition & 1 deletion YRpp
Submodule YRpp updated 2 files
+29 −1 AStarClass.h
+10 −0 YRMathVector.h
34 changes: 34 additions & 0 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,24 @@ PenetratesIronCurtain=false ; boolean
PenetratesForceShield= ; boolean
```

### Knock-up warhead

- You can now launch targets in an arc with projectiles. The target will be knocked up in the opposite direction of its current facing.
- `KnockUp` controls whether to enable this logic.
- `KnockUp.Range` defines the knock-up distance.
- `KnockUp.Speed` defines the horizontal knock-up velocity.
- `KnockUp.Angle` defines the knock-up angle.

In `rulesmd.ini`:

```ini
[SOMEWARHEAD] ; WarheadType
KnockUp=false ; boolean
KnockUp.Range=0.0 ; floating point, cells
KnockUp.Speed=0.0 ; floating point, cells/frame (horizontal component)
KnockUp.Angle=45.0 ; floating point, degrees
```

### Launch superweapons on impact

- Superweapons can now be launched when a warhead is detonated.
Expand Down Expand Up @@ -2917,6 +2935,22 @@ ApplyPerTargetEffectsOnDetonate= ; boolean, default to [CombatDamage] -> Ap
- Ares' warhead effect controllers, such as `EffectsRequireDamage`, only affect Ares' effects. So they have nothing to do with this.
```

### Traction warhead

- `Traction` pulls affected targets toward the explosion point.
- `Traction` controls whether to enable this logic.
- `Traction.Range` is treated as a movement "budget" (floating point, in cells) used to limit how far the pull can progress.
- `Traction.Speed` controls the linear movement speed applied when the pull occurs (cells/frame).

In `rulesmd.ini`:

```ini
[SOMEWARHEAD] ; WarheadType
Traction=false ; boolean
Traction.Range=0.0 ; floating point, cells
Traction.Speed=0.0 ; floating point, cells/frame
```

### Trigger specific NotHuman infantry Death anim sequence

- Warheads are now able to trigger specific `NotHuman=yes` infantry `Death` anim sequence using the corresponding tag. It's value represents sequences from `Die1` to `Die5`.
Expand Down
3 changes: 3 additions & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ New:
- [Updateable firing anim](Fixed-or-Improved-Logics.md#updateable-firing-anim) (by TaranDahl)
- [Additional customizations for `Splits` concerning target selection](Fixed-or-Improved-Logics.md#airburst--splits) (by Starkku)
- [Allow replacing vanilla repairing with togglable auto repairing](User-Interface.md#allow-replacing-vanilla-repairing-with-togglable-auto-repairing) (by TaranDahl)
- Forced displacement locomotor implementation (by TaranDahl)
- [Knock-up warhead](New-or-Enhanced-Logics.md#knock-up-warhead) (by TaranDahl)
- [Traction warhead](New-or-Enhanced-Logics.md#traction-warhead) (by TaranDahl)

Vanilla fixes:
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
Expand Down
22 changes: 22 additions & 0 deletions src/Ext/Techno/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,12 +1225,17 @@ void TechnoExt::ExtData::Serialize(T& Stm)
.Process(this->HoverShutdown)
.Process(this->LastTargetCrd)
.Process(this->LastTargetCrdClearTimer)
/*.Process(this->QueuedShift)*/ // Always set and reset in one function
.Process(this->ShiftApplier)
.Process(this->ShiftApplierHouse)
;
}

void TechnoExt::ExtData::InvalidatePointer(void* ptr, bool bRemoved)
{
AnnounceInvalidPointer(this->AirstrikeTargetingMe, ptr);
AnnounceInvalidPointer(this->ShiftApplier, ptr);
AnnounceInvalidPointer(this->ShiftApplierHouse, ptr);
}

void TechnoExt::ExtData::LoadFromStream(PhobosStreamReader& Stm)
Expand Down Expand Up @@ -1264,6 +1269,23 @@ TechnoExt::ExtContainer::ExtContainer() : Container("TechnoClass") { }

TechnoExt::ExtContainer::~ExtContainer() = default;

bool TechnoExt::ExtContainer::InvalidateExtDataIgnorable(void* const ptr) const
{
auto const abs = static_cast<AbstractClass*>(ptr)->WhatAmI();

switch (abs)
{
case AbstractType::Airstrike:
case AbstractType::Aircraft:
case AbstractType::Building:
case AbstractType::Infantry:
case AbstractType::Unit:
case AbstractType::House:
return false;
}

return true;
}

// =============================
// container hooks
Expand Down
22 changes: 10 additions & 12 deletions src/Ext/Techno/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#include <New/Entity/ShieldClass.h>
#include <New/Entity/LaserTrailClass.h>
#include <New/Entity/AttachEffectClass.h>
#include <New/Entity/ShiftSchedule.h>

class BulletClass;
struct ShiftSchedule;

class TechnoExt
{
Expand Down Expand Up @@ -106,6 +108,10 @@ class TechnoExt
CoordStruct LastTargetCrd;
CDTimerClass LastTargetCrdClearTimer;

std::unique_ptr<ShiftSchedule> QueuedShift;
TechnoClass* ShiftApplier;
HouseClass* ShiftApplierHouse;

ExtData(TechnoClass* OwnerObject) : Extension<TechnoClass>(OwnerObject)
, TypeExtData { nullptr }
, Shield {}
Expand Down Expand Up @@ -177,6 +183,9 @@ class TechnoExt
, HoverShutdown { false }
, LastTargetCrd { CoordStruct::Empty }
, LastTargetCrdClearTimer {}
, QueuedShift {}
, ShiftApplier { nullptr }
, ShiftApplierHouse { nullptr }
{ }

void OnEarlyUpdate();
Expand Down Expand Up @@ -235,18 +244,7 @@ class TechnoExt
ExtContainer();
~ExtContainer();

virtual bool InvalidateExtDataIgnorable(void* const ptr) const override
{
auto const abs = static_cast<AbstractClass*>(ptr)->WhatAmI();

switch (abs)
{
case AbstractType::Airstrike:
return false;
default:
return true;
}
}
virtual bool InvalidateExtDataIgnorable(void* const ptr) const override;
};

static ExtContainer ExtMap;
Expand Down
20 changes: 20 additions & 0 deletions src/Ext/WarheadType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,15 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)

this->Taunt.Read(exINI, pSection, "Taunt");

this->KnockUp.Read(exINI, pSection, "KnockUp");
this->KnockUp_Range.Read(exINI, pSection, "KnockUp.Range");
this->KnockUp_Speed.Read(exINI, pSection, "KnockUp.Speed");
this->KnockUp_Angle.Read(exINI, pSection, "KnockUp.Angle");

this->Traction.Read(exINI, pSection, "Traction");
this->Traction_Range.Read(exINI, pSection, "Traction.Range");
this->Traction_Speed.Read(exINI, pSection, "Traction.Speed");

// Convert.From & Convert.To
TypeConvertGroup::Parse(this->Convert_Pairs, exINI, pSection, AffectedHouse::All);

Expand Down Expand Up @@ -465,6 +474,8 @@ void WarheadTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
|| this->ReturnWarhead
|| this->PenetratesTransport_Level > 0
|| this->Taunt
|| this->KnockUp
|| this->Traction
);

char tempBuffer[32];
Expand Down Expand Up @@ -737,6 +748,15 @@ void WarheadTypeExt::ExtData::Serialize(T& Stm)

.Process(this->Taunt)

.Process(this->KnockUp)
.Process(this->KnockUp_Range)
.Process(this->KnockUp_Speed)
.Process(this->KnockUp_Angle)

.Process(this->Traction)
.Process(this->Traction_Range)
.Process(this->Traction_Speed)

// Ares tags
.Process(this->AffectsEnemies)
.Process(this->AffectsOwner)
Expand Down
20 changes: 20 additions & 0 deletions src/Ext/WarheadType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ class WarheadTypeExt

Valueable<bool> Taunt;

Valueable<bool> KnockUp;
Valueable<Leptons> KnockUp_Range;
Valueable<Leptons> KnockUp_Speed;
Valueable<double> KnockUp_Angle;

Valueable<bool> Traction;
Valueable<Leptons> Traction_Range;
Valueable<Leptons> Traction_Speed;

// Ares tags
// http://ares-developers.github.io/Ares-docs/new/warheads/general.html
Valueable<bool> AffectsEnemies;
Expand Down Expand Up @@ -522,6 +531,15 @@ class WarheadTypeExt
, ApplyPerTargetEffectsOnDetonate {}

, Taunt { false }

, KnockUp { false }
, KnockUp_Range { Leptons(0) }
, KnockUp_Speed { Leptons(0) }
, KnockUp_Angle { 45.0 }

, Traction { false }
, Traction_Range { Leptons(0) }
, Traction_Speed { Leptons(0) }
{ }

void ApplyConvert(HouseClass* pHouse, TechnoClass* pTarget);
Expand Down Expand Up @@ -561,6 +579,8 @@ class WarheadTypeExt
void ApplyReverseEngineer(HouseClass* pHouse, TechnoClass* pTarget);
void ApplyReturnWarhead(HouseClass* pHouse, TechnoClass* pTarget, TechnoClass* Owner);
void ApplyPenetratesTransport(TechnoClass* pTarget, TechnoClass* pInvoker, HouseClass* pInvokerHouse, const CoordStruct& coords, int damage, int distance);
void ApplyKnockUp(TechnoClass* pTarget);
void ApplyTraction(TechnoClass* pTarget, const CoordStruct& coords);
double GetCritChance(TechnoClass* pFirer) const;
};

Expand Down
Loading
Loading