2021-12-05 17:54:36 +00:00
|
|
|
#include "AgSpaceStuff.h"
|
2023-01-07 05:17:05 +00:00
|
|
|
#include "EntityInfo.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
#include "GeneralUtils.h"
|
|
|
|
#include "GameMessages.h"
|
|
|
|
#include "EntityManager.h"
|
2023-03-20 13:10:52 +00:00
|
|
|
#include "RenderComponent.h"
|
|
|
|
#include "Entity.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void AgSpaceStuff::OnStartup(Entity* self) {
|
|
|
|
self->AddTimer("FloaterScale", 5.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AgSpaceStuff::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
if (timerName == "FloaterScale") {
|
|
|
|
int scaleType = GeneralUtils::GenerateRandomNumber<int>(1, 5);
|
|
|
|
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(self, u"scale_0" + GeneralUtils::to_u16string(scaleType));
|
2021-12-05 17:54:36 +00:00
|
|
|
self->AddTimer("FloaterPath", 0.4);
|
|
|
|
} else if (timerName == "FloaterPath") {
|
|
|
|
int pathType = GeneralUtils::GenerateRandomNumber<int>(1, 4);
|
|
|
|
int randTime = GeneralUtils::GenerateRandomNumber<int>(20, 25);
|
|
|
|
|
2023-03-20 13:10:52 +00:00
|
|
|
RenderComponent::PlayAnimation(self, u"path_0" + (GeneralUtils::to_u16string(pathType)));
|
2021-12-05 17:54:36 +00:00
|
|
|
self->AddTimer("FloaterScale", randTime);
|
2021-12-08 02:14:15 +00:00
|
|
|
}
|
|
|
|
}
|