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
|
// outfit is a real creature
|
||||||
if(m_outfit.getCategory() == ThingsType::Creature) {
|
if(m_outfit.getCategory() == ThingsType::Creature) {
|
||||||
int animationPhase = animate ? m_walkAnimationPhase : 0;
|
int animationPhase = animate ? m_walkAnimationPhase : 0;
|
||||||
|
if(isAnimateAlways()) {
|
||||||
|
int ticksPerFrame = 1000 / getAnimationPhases();
|
||||||
|
animationPhase = (g_clock.ticks() % (ticksPerFrame * getAnimationPhases())) / ticksPerFrame;
|
||||||
|
}
|
||||||
|
|
||||||
// xPattern => creature direction
|
// xPattern => creature direction
|
||||||
if(m_direction == Otc::NorthEast || m_direction == Otc::SouthEast)
|
if(m_direction == Otc::NorthEast || m_direction == Otc::SouthEast)
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
bool isHookSouth() { return m_type->properties[ThingType::HookSouth]; }
|
bool isHookSouth() { return m_type->properties[ThingType::HookSouth]; }
|
||||||
bool isHookEast() { return m_type->properties[ThingType::HookEast]; }
|
bool isHookEast() { return m_type->properties[ThingType::HookEast]; }
|
||||||
bool isStackable() { return m_type->properties[ThingType::IsStackable]; }
|
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 isLyingCorpse() { return m_type->properties[ThingType::IsLyingCorpse]; }
|
||||||
bool blocksProjectile() { return m_type->properties[ThingType::BlockProjectile]; }
|
bool blocksProjectile() { return m_type->properties[ThingType::BlockProjectile]; }
|
||||||
bool isFluid() { return m_type->properties[ThingType::IsFluid]; }
|
bool isFluid() { return m_type->properties[ThingType::IsFluid]; }
|
||||||
|
|
Loading…
Reference in New Issue