DarkflameServer/dScripts/02_server/Map/AM/AmBridge.cpp
David Markowitz 8d37d9b681
Organize dScripts (#814)
* Organize dScripts

whitespace

Remove parent scope

Remove parent scope from initial setter

Remove debug

Remove helper programs

* Fix NtImagimeterVisibility script

Co-authored-by: aronwk-aaron <aronwk.aaron@gmail.com>
2022-11-03 12:57:54 -05:00

29 lines
627 B
C++

#include "AmBridge.h"
#include "EntityManager.h"
void AmBridge::OnStartup(Entity* self) {
}
void AmBridge::OnRebuildComplete(Entity* self, Entity* target) {
const auto consoles = EntityManager::Instance()->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
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;
}
self->Smash(self->GetObjectID(), VIOLENT);
}