mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-24 22:47:25 +00:00
6aa90ad5b2
* Breakout rest of the enums from dcommonvars so we don't have to deal with merge conflicts ePlayerFlags is not a scoped enum, yet, due to it's complexity * address feedback * make player flag types consistent * fix typo
29 lines
638 B
C++
29 lines
638 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(), eKillType::VIOLENT);
|
|
}
|