mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-27 07:57:21 +00:00
92006123b8
- change NotifyObject to use u16 string - move stuff to header that is inline - use u16strings instead of converting to u16 string - move entity to dEntity
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
#include "WildNinjaSensei.h"
|
|
#include "Entity.h"
|
|
|
|
void WildNinjaSensei::OnStartup(Entity* self) {
|
|
GameMessages::SendPlayAnimation(self, u"bow");
|
|
self->AddTimer("CraneStart", 5);
|
|
}
|
|
|
|
void WildNinjaSensei::OnTimerDone(Entity* self, std::string timerName) {
|
|
if (timerName == "CraneStart") {
|
|
auto ninjas = EntityManager::Instance()->GetEntitiesInGroup("Ninjastuff");
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Crane");
|
|
self->AddTimer("Bow", 15.5f);
|
|
self->AddTimer("TigerStart", 25);
|
|
GameMessages::SendPlayAnimation(self, u"crane");
|
|
} else if (timerName == "TigerStart") {
|
|
auto ninjas = EntityManager::Instance()->GetEntitiesInGroup("Ninjastuff");
|
|
GameMessages::SendPlayAnimation(self, u"bow");
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Tiger");
|
|
self->AddTimer("Bow", 15.5f);
|
|
self->AddTimer("MantisStart", 25);
|
|
GameMessages::SendPlayAnimation(self, u"tiger");
|
|
} else if (timerName == "MantisStart") {
|
|
auto ninjas = EntityManager::Instance()->GetEntitiesInGroup("Ninjastuff");
|
|
GameMessages::SendPlayAnimation(self, u"tiger");
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Mantis");
|
|
self->AddTimer("Bow", 15.5f);
|
|
self->AddTimer("CraneStart", 25);
|
|
GameMessages::SendPlayAnimation(self, u"mantis");
|
|
} else if (timerName == "Bow") {
|
|
auto ninjas = EntityManager::Instance()->GetEntitiesInGroup("Ninjastuff");
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Bow");
|
|
GameMessages::SendPlayAnimation(self, u"bow");
|
|
}
|
|
}
|
|
|