mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Implement some scripts for alpha FV (#1049)
* Implement maelstrom fog for alpha FV add OnOffCollisionPhantom call to cppscripts Add physics shape for gas blocking volume * Add Ninja Sensie Script for alpha FV and migration * Fix private var casing * And ninja wild scripts they keep making me add more things * address feedback --------- Co-authored-by: Gie "Max" Vanommeslaeghe <gievanom@hotmail.com>
This commit is contained in:
@@ -4,5 +4,8 @@ set(DSCRIPTS_SOURCES_AI_WILD
|
||||
"WildAmbientCrab.cpp"
|
||||
"WildAndScared.cpp"
|
||||
"WildGfGlowbug.cpp"
|
||||
"WildNinjaBricks.cpp"
|
||||
"WildNinjaStudent.cpp"
|
||||
"WildNinjaSensei.cpp"
|
||||
"WildPants.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
13
dScripts/ai/WILD/WildNinjaBricks.cpp
Normal file
13
dScripts/ai/WILD/WildNinjaBricks.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "WildNinjaBricks.h"
|
||||
#include "Entity.h"
|
||||
|
||||
void WildNinjaBricks::OnStartup(Entity* self) {
|
||||
self->AddToGroup("Ninjastuff");
|
||||
}
|
||||
|
||||
void WildNinjaBricks::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "Crane") GameMessages::SendPlayAnimation(self, u"crane");
|
||||
else if (name == "Tiger") GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
else if (name == "Mantis") GameMessages::SendPlayAnimation(self, u"mantis");
|
||||
}
|
||||
|
9
dScripts/ai/WILD/WildNinjaBricks.h
Normal file
9
dScripts/ai/WILD/WildNinjaBricks.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildNinjaBricks : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self);
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1 = 0, int32_t param2 = 0) override;
|
||||
};
|
||||
|
36
dScripts/ai/WILD/WildNinjaSensei.cpp
Normal file
36
dScripts/ai/WILD/WildNinjaSensei.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#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, "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, "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, "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, "Bow");
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
}
|
||||
}
|
||||
|
9
dScripts/ai/WILD/WildNinjaSensei.h
Normal file
9
dScripts/ai/WILD/WildNinjaSensei.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildNinjaSensei : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self);
|
||||
void OnTimerDone(Entity* self, std::string timerName);
|
||||
};
|
||||
|
14
dScripts/ai/WILD/WildNinjaStudent.cpp
Normal file
14
dScripts/ai/WILD/WildNinjaStudent.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "WildNinjaStudent.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
void WildNinjaStudent::OnStartup(Entity* self) {
|
||||
self->AddToGroup("Ninjastuff");
|
||||
GameMessages::SendPlayAnimation(self, u"bow");
|
||||
}
|
||||
|
||||
void WildNinjaStudent::OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) {
|
||||
if (name == "Crane") GameMessages::SendPlayAnimation(self, u"crane");
|
||||
else if (name == "Tiger") GameMessages::SendPlayAnimation(self, u"tiger");
|
||||
else if (name == "Mantis") GameMessages::SendPlayAnimation(self, u"mantis");
|
||||
else if (name == "Bow") GameMessages::SendPlayAnimation(self, u"bow");
|
||||
}
|
9
dScripts/ai/WILD/WildNinjaStudent.h
Normal file
9
dScripts/ai/WILD/WildNinjaStudent.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include "CppScripts.h"
|
||||
|
||||
class WildNinjaStudent : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self);
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1 = 0, int32_t param2 = 0) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user