mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
Add OnStartup and OnTimer
This commit is contained in:
@@ -110,6 +110,7 @@ void Strip::HandleMsg(GameMessages::ResetModelToDefaults& msg) {
|
||||
m_InActionRotation = NiPoint3Constant::ZERO;
|
||||
m_RotationProgress = 0.0f;
|
||||
m_Speed = DEFAULT_SPEED;
|
||||
m_PausedFromOnTimer = false;
|
||||
}
|
||||
|
||||
void Strip::OnChatMessageReceived(const std::string& sMessage) {
|
||||
@@ -399,13 +400,25 @@ void Strip::Update(float deltaTime, ModelComponent& modelComponent, UpdateResult
|
||||
m_Speed = DEFAULT_SPEED;
|
||||
if (nextAction.GetType() == "OnInteract") {
|
||||
modelComponent.AddInteract();
|
||||
m_WaitingForAction = true;
|
||||
} else if (nextAction.GetType() == "OnChat") {
|
||||
// logic here if needed
|
||||
m_WaitingForAction = true;
|
||||
} else if (nextAction.GetType() == "OnAttack") {
|
||||
modelComponent.AddAttack();
|
||||
m_WaitingForAction = true;
|
||||
} else if (nextAction.GetType() == "OnStartup") {
|
||||
IncrementAction();
|
||||
} else if (nextAction.GetType() == "OnTimer") {
|
||||
if (!m_PausedFromOnTimer) {
|
||||
m_PausedTime = nextAction.GetValueParameterDouble();
|
||||
m_PausedFromOnTimer = true;
|
||||
} else {
|
||||
IncrementAction();
|
||||
m_PausedFromOnTimer = false;
|
||||
}
|
||||
}
|
||||
|
||||
Game::entityManager->SerializeEntity(entity);
|
||||
m_WaitingForAction = true;
|
||||
} else { // should be a normal block
|
||||
ProcNormalAction(deltaTime, modelComponent, updateResult);
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ private:
|
||||
// The amount of time this strip is paused for. Any interactions with this strip should be bounced if this is greater than 0.
|
||||
// Actions that do not use time do not use this (ex. positions).
|
||||
float m_PausedTime{ 0.0f };
|
||||
bool m_PausedFromOnTimer{ false };
|
||||
|
||||
// The index of the next action to be played. This should always be within range of [0, m_Actions.size()).
|
||||
size_t m_NextActionIndex{ 0 };
|
||||
|
||||
Reference in New Issue
Block a user