|
|
|
@ -13,15 +13,19 @@ Effect::Effect() : Thing(THING_EFFECT)
|
|
|
|
|
|
|
|
|
|
void Effect::draw(int x, int y)
|
|
|
|
|
{
|
|
|
|
|
if(!m_finished && g_platform.getTicks() - m_lastTicks > 75) {
|
|
|
|
|
const ThingAttributes& attributes = getAttributes();
|
|
|
|
|
m_animation++;
|
|
|
|
|
if(m_animation == attributes.animcount)
|
|
|
|
|
g_dispatcher.addEvent(std::bind(&Map::removeThing, &g_map, asThing()));
|
|
|
|
|
m_lastTicks = g_platform.getTicks();
|
|
|
|
|
}
|
|
|
|
|
if(!m_finished) {
|
|
|
|
|
if(g_platform.getTicks() - m_lastTicks > 75) {
|
|
|
|
|
const ThingAttributes& attributes = getAttributes();
|
|
|
|
|
m_animation++;
|
|
|
|
|
if(m_animation == attributes.animcount) {
|
|
|
|
|
g_dispatcher.addEvent(std::bind(&Map::removeThing, &g_map, asThing()));
|
|
|
|
|
m_finished = true;
|
|
|
|
|
}
|
|
|
|
|
m_lastTicks = g_platform.getTicks();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internalDraw(x, y, 0, 0, 0, 0, m_animation);
|
|
|
|
|
internalDraw(x, y, 0, 0, 0, 0, m_animation);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ThingAttributes& Effect::getAttributes()
|
|
|
|
|