summaryrefslogtreecommitdiff
path: root/src/effectmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/effectmanager.cpp')
-rw-r--r--src/effectmanager.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp
index 1f5db8344..a6671870b 100644
--- a/src/effectmanager.cpp
+++ b/src/effectmanager.cpp
@@ -80,6 +80,30 @@ EffectManager::~EffectManager()
{
}
+bool EffectManager::triggerDirection(const int id, Being *const being,
+ const SpriteDirection::Type &direction)
+{
+ int rotation;
+ switch (direction)
+ {
+ case SpriteDirection::DOWN:
+ default:
+ rotation = 0;
+ break;
+ case SpriteDirection::LEFT:
+ rotation = 90;
+ break;
+ case SpriteDirection::UP:
+ rotation = 180;
+ break;
+ case SpriteDirection::RIGHT:
+ rotation = 270;
+ break;
+ }
+
+ return trigger(id, being, rotation);
+}
+
bool EffectManager::trigger(const int id, Being *const being,
const int rotation)
{
@@ -162,3 +186,14 @@ bool EffectManager::trigger(const int id, const int x, const int y,
}
return rValue;
}
+
+void EffectManager::triggerDefault(int effectId,
+ Being *const being,
+ const int defaultEffectId)
+{
+ if (effectId == -1)
+ effectId = defaultEffectId;
+ if (effectId == -1)
+ return;
+ trigger(effectId, being);
+}