00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LOCATION_H
00020 #define LOCATION_H
00021
00022 #include "shape.h"
00023 #include "item.h"
00024 #include "creature.h"
00025 #include "effect.h"
00026
00027
00028 class Creature;
00029 class Effect;
00030
00035 class Location {
00036 public:
00037
00038 Uint16 x, y, z;
00039 Shape *shape;
00040 Item *item;
00041 Creature *creature;
00042 };
00043
00044 class EffectLocation {
00045 public:
00046 Uint16 x, y, z;
00047 GLuint effectDuration;
00048 GLuint damageEffectCounter;
00049 Effect *effect;
00050 int effectType;
00051 GLuint effectDelay;
00052
00053
00054 inline void setEffectType(int n) { this->effectType = n; }
00055 inline int getEffectType() { return effectType; }
00056 inline Effect *getEffect() { return effect; }
00057 inline int getDamageEffect() { return damageEffectCounter; }
00058 inline void resetDamageEffect() { damageEffectCounter = SDL_GetTicks(); }
00059 inline bool isEffectOn() {
00060 return (SDL_GetTicks() - damageEffectCounter < effectDuration + effectDelay ? true : false);
00061 }
00062 inline bool isInDelay() {
00063 return (SDL_GetTicks() - damageEffectCounter < effectDelay ? true : false);
00064 }
00065 inline void setEffectDelay(GLuint n) { this->effectDelay = n; }
00066 inline GLuint getEffectDelay() { return effectDelay; }
00067 };
00068
00069 #endif
00070