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
- EVA voice switching 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
14 changes: 14 additions & 0 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,20 @@ In `rulesmd.ini`:
AISuperWeaponDelay= ; integer, game frames
```

### Change EVA voice

- Any superweapon can now change the player's EVA voice set after activation.
- `ChangeEVAIndex` specifies the EVA voice index to switch to, corresponding to entries under `[EVATypes]`.
- If set to `-1`, no change is applied.
- By default, `0` is Allied, `1` is Soviet, and `2` is Yuri.
- The change is applied to the player who activates the superweapon.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an enum of AffectedHouses


In `rulesmd.ini`:
```ini
[SOMESW] ; SuperWeaponType
ChangeEVAIndex=-1 ; integer
```

### Convert TechnoType

- Warheads can now change TechnoTypes of affected units to other Types in the same category (infantry to infantry, vehicles to vehicles, aircraft to aircraft).
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ New:
- 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)
- Customize `HarvesterLoadRate` (by Noble_Fish)
- [EVA voice switching on superweapon activation](New-or-Enhanced-Logics.md#change-eva-voice) (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
6 changes: 6 additions & 0 deletions src/Ext/House/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,13 +712,19 @@ void HouseExt::ExtData::Serialize(T& Stm)
.Process(this->FreeRadar)
.Process(this->ForceRadar)
.Process(this->PlayerAutoRepair)
.Process(this->ForceEvaIndex)
;
}

void HouseExt::ExtData::LoadFromStream(PhobosStreamReader& Stm)
{
Extension<HouseClass>::LoadFromStream(Stm);
this->Serialize(Stm);

if (this->ForceEvaIndex != -1)
{
VoxClass::EVAIndex = this->ForceEvaIndex;
}
}

void HouseExt::ExtData::SaveToStream(PhobosStreamWriter& Stm)
Expand Down
3 changes: 3 additions & 0 deletions src/Ext/House/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class HouseExt

bool PlayerAutoRepair;

int ForceEvaIndex;

ExtData(HouseClass* OwnerObject) : Extension<HouseClass>(OwnerObject)
, PowerPlantEnhancers {}
, OwnedLimboDeliveredBuildings {}
Expand Down Expand Up @@ -103,6 +105,7 @@ class HouseExt
, FreeRadar(false)
, ForceRadar(false)
, PlayerAutoRepair(true)
, ForceEvaIndex(-1)
{ }

bool OwnsLimboDeliveredBuilding(BuildingClass* pBuilding) const;
Expand Down
3 changes: 3 additions & 0 deletions src/Ext/SWType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void SWTypeExt::ExtData::Serialize(T& Stm)
.Process(this->SW_Link_RollChances)
.Process(this->Message_LinkedSWAcquired)
.Process(this->EVA_LinkedSWAcquired)
.Process(this->ChangeEVAIndex)
;
}

Expand Down Expand Up @@ -226,6 +227,8 @@ void SWTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->EVA_LinkedSWAcquired.Read(exINI, pSection, "EVA.LinkedSWAcquired");
this->SW_Link_RollChances.Read(exINI, pSection, "SW.Link.RollChances");

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

// SW.Link.RandomWeights
for (size_t i = 0; ; ++i)
{
Expand Down
5 changes: 5 additions & 0 deletions src/Ext/SWType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class SWTypeExt
Valueable<CSFText> Message_LinkedSWAcquired;
NullableIdx<VoxClass> EVA_LinkedSWAcquired;

Valueable<int> ChangeEVAIndex;

ExtData(SuperWeaponTypeClass* OwnerObject) : Extension<SuperWeaponTypeClass>(OwnerObject)
, TypeID { "" }
, Money_Amount { 0 }
Expand Down Expand Up @@ -185,6 +187,7 @@ class SWTypeExt
, SW_Link_RandomWeightsData {}
, Message_LinkedSWAcquired {}
, EVA_LinkedSWAcquired {}
, ChangeEVAIndex { -1 }
{ }

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

void ApplyLinkedSW(SuperClass* pSW);

void ApplyChangeEVAIndex(SuperClass* pSW);

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

Expand Down
13 changes: 13 additions & 0 deletions src/Ext/SWType/FireSuperWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ 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->ChangeEVAIndex != -1)
pTypeExt->ApplyChangeEVAIndex(pSW);

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

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

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

VoxClass::EVAIndex = this->ChangeEVAIndex;
HouseExt::ExtMap.Find(pHouse)->ForceEvaIndex = this->ChangeEVAIndex;
}
Loading