2023-04-12 16:46:31 +00:00
|
|
|
#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");
|
2023-06-16 08:01:13 +00:00
|
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Crane");
|
2023-04-12 16:46:31 +00:00
|
|
|
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");
|
2023-06-16 08:01:13 +00:00
|
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Tiger");
|
2023-04-12 16:46:31 +00:00
|
|
|
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");
|
2023-06-16 08:01:13 +00:00
|
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Mantis");
|
2023-04-12 16:46:31 +00:00
|
|
|
self->AddTimer("Bow", 15.5f);
|
|
|
|
self->AddTimer("CraneStart", 25);
|
|
|
|
GameMessages::SendPlayAnimation(self, u"mantis");
|
|
|
|
} else if (timerName == "Bow") {
|
|
|
|
auto ninjas = EntityManager::Instance()->GetEntitiesInGroup("Ninjastuff");
|
2023-06-16 08:01:13 +00:00
|
|
|
for (auto ninja : ninjas) ninja->NotifyObject(self, u"Bow");
|
2023-04-12 16:46:31 +00:00
|
|
|
GameMessages::SendPlayAnimation(self, u"bow");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|