DarkflameServer/dScripts/02_server/Map/AM/AmBridge.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
659 B
C++
Raw Normal View History

#include "AmBridge.h"
#include "EntityManager.h"
#include "Entity.h"
void AmBridge::OnStartup(Entity* self) {
2022-07-28 13:39:57 +00:00
}
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, u"BridgeBuilt");
self->AddTimer("SmashBridge", 50);
}
void AmBridge::OnTimerDone(Entity* self, std::string timerName) {
if (timerName != "SmashBridge") {
return;
}
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
}