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
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ This page lists all the individual contributions to the project by their author.
- **Flactine**
- Add target filtering options to attacheffect system
- Add veterancy-based target filtering for weapons and warheads
- Firer-only message and EVA on superweapon activation
- **tyuah8**:
- Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
- Destroyed unit leaves sensors bugfix
Expand Down
11 changes: 11 additions & 0 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,17 @@ EMPulse.SuspendOthers=false ; boolean
`Type=EMPulse` superweapon and any associated keys are [Ares features](https://ares-developers.github.io/Ares-docs/new/superweapons/types/empulse.html).
```

### Firer-only message and EVA on superweapon activated

- Unlike `Message.Activated` and `EVA.Activated`, this message and EVA are played only for the player who fires the superweapon, instead of being broadcast to all players.

In `rulesmd.ini`:
```ini
[SOMESW] ; SuperWeaponType
Message.Activated.Firer= ; CSF entry key
EVA.Activated.Firer= ; EVA entry
```

### LimboDelivery

- Superweapons can now deliver off-map buildings that act as if they were on the field.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ New:
- [Allow replacing vanilla repairing with togglable auto repairing](User-Interface.md#allow-replacing-vanilla-repairing-with-togglable-auto-repairing) (by TaranDahl)
- Use `OpenTopped.AllowFiringIfAttackedByLocomotor` to control whether the passengers of a non-building transport unit can fire when the unit is being attacked by a weapon whose warhead has `IsLocomotor=true` (by Noble_Fish)
- Framework for dynamic sight (by TaranDahl)
- [Firer-only message and EVA on superweapon activated](New-or-Enhanced-Logics.md#firer-only-eva-on-superweapon-activated) (by Flactine)

Vanilla fixes:
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
Expand Down
4 changes: 4 additions & 0 deletions src/Ext/SWType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ void SWTypeExt::ExtData::Serialize(T& Stm)
.Process(this->SW_Link_RollChances)
.Process(this->Message_LinkedSWAcquired)
.Process(this->EVA_LinkedSWAcquired)
.Process(this->Message_Activated_Firer)
.Process(this->EVA_Activated_Firer)
;
}

Expand Down Expand Up @@ -224,6 +226,8 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->SW_Link_Reset.Read(exINI, pSection, "SW.Link.Reset");
this->Message_LinkedSWAcquired.Read(exINI, pSection, "Message.LinkedSWAcquired");
this->EVA_LinkedSWAcquired.Read(exINI, pSection, "EVA.LinkedSWAcquired");
this->Message_Activated_Firer.Read(exINI, pSection, "Message.Activated.Firer");
this->EVA_Activated_Firer.Read(exINI, pSection, "EVA.Activated.Firer");
this->SW_Link_RollChances.Read(exINI, pSection, "SW.Link.RollChances");

// SW.Link.RandomWeights
Expand Down
7 changes: 7 additions & 0 deletions src/Ext/SWType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class SWTypeExt
ValueableVector<float> SW_Link_RollChances;
Valueable<CSFText> Message_LinkedSWAcquired;
NullableIdx<VoxClass> EVA_LinkedSWAcquired;
Valueable<CSFText> Message_Activated_Firer;
NullableIdx<VoxClass> EVA_Activated_Firer;

ExtData(SuperWeaponTypeClass* OwnerObject) : Extension<SuperWeaponTypeClass>(OwnerObject)
, TypeID { "" }
Expand Down Expand Up @@ -185,6 +187,8 @@ class SWTypeExt
, SW_Link_RandomWeightsData {}
, Message_LinkedSWAcquired {}
, EVA_LinkedSWAcquired {}
, Message_Activated_Firer {}
, EVA_Activated_Firer {}
{ }

// Ares 0.A functions
Expand All @@ -211,6 +215,9 @@ class SWTypeExt

void ApplyLinkedSW(SuperClass* pSW);

void ApplyActivatedFirerMessage(SuperClass* pSW) const;
void ApplyActivatedFirerEva(SuperClass* pSW) const;

virtual void LoadFromINIFile(CCINIClass* pINI) override;
virtual void Initialize() override;

Expand Down
24 changes: 24 additions & 0 deletions src/Ext/SWType/FireSuperWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ void SWTypeExt::FireSuperWeaponExt(SuperClass* pSW, const CellStruct& cell)
if (static_cast<int>(pType->Type) == 28 && !pTypeExt->EMPulse_TargetSelf) // Ares' Type=EMPulse SW
pTypeExt->HandleEMPulseLaunch(pSW, cell);

if (!pTypeExt->Message_Activated_Firer.Get().empty())
pTypeExt->ApplyActivatedFirerMessage(pSW);

if (pTypeExt->EVA_Activated_Firer.isset())
pTypeExt->ApplyActivatedFirerEva(pSW);

auto& sw_ext = HouseExt::ExtMap.Find(pHouse)->SuperExts[pType->ArrayIndex];
sw_ext.ShotCount++;

Expand Down Expand Up @@ -483,3 +489,21 @@ void SWTypeExt::ExtData::ApplyLinkedSW(SuperClass* pSW)
MessageListClass::Instance.PrintMessage(this->Message_LinkedSWAcquired.Get(), RulesClass::Instance->MessageDelay, HouseClass::CurrentPlayer->ColorSchemeIndex, true);
}
}

void SWTypeExt::ExtData::ApplyActivatedFirerMessage(SuperClass* pSW) const
{
const auto pHouse = pSW->Owner;
if (!pHouse->IsControlledByCurrentPlayer())
return;

MessageListClass::Instance.PrintMessage(this->Message_Activated_Firer.Get(), RulesClass::Instance->MessageDelay, HouseClass::CurrentPlayer->ColorSchemeIndex, true);
}

void SWTypeExt::ExtData::ApplyActivatedFirerEva(SuperClass* pSW) const
{
const auto pHouse = pSW->Owner;
if (!pHouse->IsControlledByCurrentPlayer())
return;

VoxClass::PlayIndex(this->EVA_Activated_Firer.Get(), -1, -1);
}
Loading