Added script for Friend of the Ninja mission (#406)

* Added script for Friend of the Ninja mission

* Added comments
This commit is contained in:
David Markowitz
2022-02-05 04:00:10 -08:00
committed by GitHub
parent 6ba9eea993
commit 828c457614
3 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#include "FvPassThroughWall.h"
#include "InventoryComponent.h"
void FvPassThroughWall::OnCollisionPhantom(Entity* self, Entity* target) {
auto missionComponent = target->GetComponent<MissionComponent>();
if (missionComponent == nullptr) return;
//Because at the moment we do not have an ItemComponent component, we check to make sure a Maelstrom-Infused hood is equipped. There are only three in the game right now.
auto inventoryComponent = target->GetComponent<InventoryComponent>();
// If no inventory component is found then abort.
if (inventoryComponent == nullptr) return;
// If no Maelstrom hoods are equipped then abort.
if (!inventoryComponent->IsEquipped(WhiteMaelstromHood) && !inventoryComponent->IsEquipped(BlackMaelstromHood) && !inventoryComponent->IsEquipped(RedMaelstromHood)) return;
// Progress mission Friend of the Ninja since all prerequisites are met.
missionComponent->ForceProgress(friendOfTheNinjaMissionId, friendOfTheNinjaMissionUid, 1);
}