Replace CogAbilityCheat window with CogEngineCheat window

CogEngineCheat window relies on an Execution to execute the cheat which can be extended. One implementation is implemented in CogAbility which applies an effect on the selected target (same logic as the previous CogAbilityCheat window)
This commit is contained in:
Arnaud Jamin
2025-01-13 03:06:41 -05:00
parent c3100d59b5
commit a05d8cc9a4
14 changed files with 828 additions and 4 deletions
@@ -220,3 +220,26 @@ void ACogEngineReplicator::Server_DeleteActor_Implementation(AActor* Actor)
#endif // !UE_BUILD_SHIPPING
}
//--------------------------------------------------------------------------------------------------------------------------
void ACogEngineReplicator::Server_ApplyCheat_Implementation(const AActor* CheatInstigator, const TArray<AActor*>& Targets, const FCogEngineCheat& Cheat) const
{
if (Cheat.Execution == nullptr)
{
return;
}
Cheat.Execution->Execute(CheatInstigator, Targets);
}
//--------------------------------------------------------------------------------------------------------------------------
ECogEngineCheat_ActiveState ACogEngineReplicator::IsCheatActiveOnTargets(const TArray<AActor*>& Targets, const FCogEngineCheat& Cheat)
{
if (Cheat.Execution == nullptr)
{
return ECogEngineCheat_ActiveState::Inactive;
}
return Cheat.Execution->IsActiveOnTargets(Targets);
}