animate idle creatures
This commit is contained in:
parent
30330d1d2e
commit
fa915e088c
|
@ -96,6 +96,10 @@ void Creature::draw(const Point& dest, float scaleFactor, bool animate)
|
|||
// outfit is a real creature
|
||||
if(m_outfit.getCategory() == ThingsType::Creature) {
|
||||
int animationPhase = animate ? m_walkAnimationPhase : 0;
|
||||
if(isAnimateAlways()) {
|
||||
int ticksPerFrame = 1000 / getAnimationPhases();
|
||||
animationPhase = (g_clock.ticks() % (ticksPerFrame * getAnimationPhases())) / ticksPerFrame;
|
||||
}
|
||||
|
||||
// xPattern => creature direction
|
||||
if(m_direction == Otc::NorthEast || m_direction == Otc::SouthEast)
|
||||
|
|
|
@ -83,6 +83,7 @@ public:
|
|||
bool isHookSouth() { return m_type->properties[ThingType::HookSouth]; }
|
||||
bool isHookEast() { return m_type->properties[ThingType::HookEast]; }
|
||||
bool isStackable() { return m_type->properties[ThingType::IsStackable]; }
|
||||
bool isAnimateAlways() { return m_type->properties[ThingType::AnimateAlways]; }
|
||||
bool isLyingCorpse() { return m_type->properties[ThingType::IsLyingCorpse]; }
|
||||
bool blocksProjectile() { return m_type->properties[ThingType::BlockProjectile]; }
|
||||
bool isFluid() { return m_type->properties[ThingType::IsFluid]; }
|
||||
|
|
Loading…
Reference in New Issue