Merge pull request #405 from EmosewaMC/FvGateCrasherFix

Added missing script for Gate Crasher mission
This commit is contained in:
Gie "Max" Vanommeslaeghe 2022-01-25 15:49:19 +01:00 committed by GitHub
commit 344af924fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View File

@ -145,6 +145,7 @@
#include "ImgBrickConsoleQB.h"
#include "ActParadoxPipeFix.h"
#include "FvNinjaGuard.h"
#include "FvBounceOverWall.h"
// FB Scripts
#include "AgJetEffectServer.h"
@ -556,6 +557,8 @@ CppScripts::Script* CppScripts::GetScript(Entity* parent, const std::string& scr
script = new ActParadoxPipeFix();
else if (scriptName == "scripts\\ai\\FV\\L_FV_NINJA_GUARDS.lua")
script = new FvNinjaGuard();
else if (scriptName == "scripts\\ai\\FV\\L_ACT_BOUNCE_OVER_WALL.lua")
script = new FvBounceOverWall();
//Misc:
if (scriptName == "scripts\\02_server\\Map\\General\\L_EXPLODING_ASSET.lua")

View File

@ -0,0 +1,9 @@
#include "FvBounceOverWall.h"
void FvBounceOverWall::OnCollisionPhantom(Entity* self, Entity* target) {
auto missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent == nullptr) return;
// We force progress here to the Gate Crasher mission due to an overlap in LOTs with the 'Shark Bite' missions.
missionComponent->ForceProgress(GateCrasherMissionId, GateCrasherMissionUid, 1);
}

View File

@ -0,0 +1,22 @@
#pragma once
#include "CppScripts.h"
class FvBounceOverWall : public CppScripts::Script
{
/**
* @brief When a collision has been made with self this method is called.
*
* @param self The Entity that called this function.
* @param target The target Entity of self.
*/
void OnCollisionPhantom(Entity* self, Entity* target) override;
private:
/**
* MissionId for the Gate Crasher mission.
*/
int32_t GateCrasherMissionId = 849;
/**
* MissionUid for the Gate Crasher mission.
*/
int32_t GateCrasherMissionUid = 1241;
};