Some minor changes/additions.

This commit is contained in:
BenDol
2014-08-07 06:40:56 +12:00
parent 3343919c92
commit ef7f94ac76
5 changed files with 35 additions and 8 deletions

View File

@@ -409,8 +409,7 @@ namespace Otc
PathFindAllowNonWalkable = 8
};
enum AutomapFlags
{
enum AutomapFlags {
MapMarkTick = 0,
MapMarkQuestion,
MapMarkExclamation,
@@ -433,20 +432,24 @@ namespace Otc
MapMarkGreenSouth
};
enum VipState
{
enum VipState {
VipStateOffline = 0,
VipStateOnline = 1,
VipStatePending = 2
};
enum SpeedFormula
{
enum SpeedFormula {
SpeedFormulaA = 0,
SpeedFormulaB,
SpeedFormulaC,
LastSpeedFormula
};
enum AnimationPhase {
PhaseAutomatic = 0,
PhaseRandom = 254,
PhaseAsync = 255
};
}
#endif

View File

@@ -74,6 +74,7 @@ public:
int getNumPatternY() { return rawGetThingType()->getNumPatternY(); }
int getNumPatternZ() { return rawGetThingType()->getNumPatternZ(); }
int getAnimationPhases() { return rawGetThingType()->getAnimationPhases(); }
Animation getAnimation() { return rawGetThingType()->getAnimation(); }
int getGroundSpeed() { return rawGetThingType()->getGroundSpeed(); }
int getMaxTextLength() { return rawGetThingType()->getMaxTextLength(); }
Light getLight() { return rawGetThingType()->getLight(); }

View File

@@ -117,6 +117,12 @@ struct Animation {
int loopCount;
bool async;
std::vector<std::tuple<int, int> > frames;
float duration(uint8 frame) {
assert(frames.size() <= frame);
std::tuple<int, int> data = frames.at(frame);
return stdext::random_range((long)std::get<0>(data), (long)std::get<1>(data));
}
};
class ThingType : public LuaObject