2021-12-05 17:54:36 +00:00
|
|
|
#include "AmBridge.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
|
|
|
void AmBridge::OnStartup(Entity* self) {
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2023-12-29 04:24:30 +00:00
|
|
|
void AmBridge::OnQuickBuildComplete(Entity* self, Entity* target) {
|
2023-07-15 20:56:33 +00:00
|
|
|
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
if (consoles.empty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto* console = consoles[0];
|
|
|
|
|
|
|
|
console->NotifyObject(self, "BridgeBuilt");
|
|
|
|
|
|
|
|
self->AddTimer("SmashBridge", 50);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AmBridge::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
if (timerName != "SmashBridge") {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-05-02 22:39:21 +00:00
|
|
|
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|