Otclient
14/8/2020
|
#include <creature.h>
Public Types | |
enum | { SHIELD_BLINK_TICKS = 500, VOLATILE_SQUARE_DURATION = 1000 } |
Public Member Functions | |
Creature () | |
virtual void | draw (const Point &dest, float scaleFactor, bool animate, LightView *lightView=nullptr) |
void | internalDrawOutfit (Point dest, float scaleFactor, bool animateWalk, bool animateIdle, Otc::Direction direction, LightView *lightView=nullptr) |
void | drawOutfit (const Rect &destRect, bool resize) |
void | drawInformation (const Point &point, bool useGray, const Rect &parentRect, int drawFlags) |
void | setId (uint32 id) |
void | setName (const std::string &name) |
void | setHealthPercent (uint8 healthPercent) |
void | setDirection (Otc::Direction direction) |
void | setOutfit (const Outfit &outfit) |
void | setOutfitColor (const Color &color, int duration) |
void | setLight (const Light &light) |
void | setSpeed (uint16 speed) |
void | setBaseSpeed (double baseSpeed) |
void | setSkull (uint8 skull) |
void | setShield (uint8 shield) |
void | setEmblem (uint8 emblem) |
void | setType (uint8 type) |
void | setIcon (uint8 icon) |
void | setSkullTexture (const std::string &filename) |
void | setShieldTexture (const std::string &filename, bool blink) |
void | setEmblemTexture (const std::string &filename) |
void | setTypeTexture (const std::string &filename) |
void | setIconTexture (const std::string &filename) |
void | setPassable (bool passable) |
void | setSpeedFormula (double speedA, double speedB, double speedC) |
void | addTimedSquare (uint8 color) |
void | removeTimedSquare () |
void | showStaticSquare (const Color &color) |
void | hideStaticSquare () |
uint32 | getId () |
std::string | getName () |
uint8 | getHealthPercent () |
Otc::Direction | getDirection () |
Outfit | getOutfit () |
Light | getLight () |
uint16 | getSpeed () |
double | getBaseSpeed () |
uint8 | getSkull () |
uint8 | getShield () |
uint8 | getEmblem () |
uint8 | getType () |
uint8 | getIcon () |
bool | isPassable () |
Point | getDrawOffset () |
int | getStepDuration (bool ignoreDiagonal=false, Otc::Direction dir=Otc::InvalidDirection) |
Point | getWalkOffset () |
Position | getLastStepFromPosition () |
Position | getLastStepToPosition () |
float | getStepProgress () |
float | getStepTicksLeft () |
ticks_t | getWalkTicksElapsed () |
double | getSpeedFormula (Otc::SpeedFormula formula) |
bool | hasSpeedFormula () |
std::array< double, Otc::LastSpeedFormula > | getSpeedFormulaArray () |
virtual Point | getDisplacement () |
virtual int | getDisplacementX () |
virtual int | getDisplacementY () |
virtual int | getExactSize (int layer=0, int xPattern=0, int yPattern=0, int zPattern=0, int animationPhase=0) |
PointF | getJumpOffset () |
void | updateShield () |
void | turn (Otc::Direction direction) |
void | jump (int height, int duration) |
virtual void | walk (const Position &oldPos, const Position &newPos) |
virtual void | stopWalk () |
void | allowAppearWalk () |
bool | isWalking () |
bool | isRemoved () |
bool | isInvisible () |
bool | isDead () |
bool | canBeSeen () |
bool | isCreature () |
const ThingTypePtr & | getThingType () |
ThingType * | rawGetThingType () |
virtual void | onPositionChange (const Position &newPos, const Position &oldPos) |
virtual void | onAppear () |
virtual void | onDisappear () |
virtual void | onDeath () |
Public Member Functions inherited from Thing | |
Thing () | |
virtual | ~Thing () |
void | setPosition (const Position &position) |
Position | getPosition () |
int | getStackPriority () |
const TilePtr & | getTile () |
ContainerPtr | getParentContainer () |
int | getStackPos () |
virtual bool | isItem () |
virtual bool | isEffect () |
virtual bool | isMissile () |
virtual bool | isNpc () |
virtual bool | isMonster () |
virtual bool | isPlayer () |
virtual bool | isLocalPlayer () |
virtual bool | isAnimatedText () |
virtual bool | isStaticText () |
Size | getSize () |
int | getWidth () |
int | getHeight () |
int | getLayers () |
int | getNumPatternX () |
int | getNumPatternY () |
int | getNumPatternZ () |
int | getAnimationPhases () |
AnimatorPtr | getAnimator () |
int | getGroundSpeed () |
int | getMaxTextLength () |
Light | getLight () |
int | getMinimapColor () |
int | getLensHelp () |
int | getClothSlot () |
int | getElevation () |
bool | isGround () |
bool | isGroundBorder () |
bool | isOnBottom () |
bool | isOnTop () |
bool | isContainer () |
bool | isStackable () |
bool | isForceUse () |
bool | isMultiUse () |
bool | isWritable () |
bool | isChargeable () |
bool | isWritableOnce () |
bool | isFluidContainer () |
bool | isSplash () |
bool | isNotWalkable () |
bool | isNotMoveable () |
bool | blockProjectile () |
bool | isNotPathable () |
bool | isPickupable () |
bool | isHangable () |
bool | isHookSouth () |
bool | isHookEast () |
bool | isRotateable () |
bool | hasLight () |
bool | isDontHide () |
bool | isTranslucent () |
bool | hasDisplacement () |
bool | hasElevation () |
bool | isLyingCorpse () |
bool | isAnimateAlways () |
bool | hasMiniMapColor () |
bool | hasLensHelp () |
bool | isFullGround () |
bool | isIgnoreLook () |
bool | isCloth () |
bool | isMarketable () |
bool | isUsable () |
bool | isWrapable () |
bool | isUnwrapable () |
bool | isTopEffect () |
MarketData | getMarketData () |
Public Member Functions inherited from LuaObject | |
LuaObject () | |
virtual | ~LuaObject () |
template<typename T > | |
void | connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false) |
template<typename... T> | |
int | luaCallLuaField (const std::string &field, const T &... args) |
template<typename R , typename... T> | |
R | callLuaField (const std::string &field, const T &... args) |
template<typename... T> | |
void | callLuaField (const std::string &field, const T &... args) |
bool | hasLuaField (const std::string &field) |
Returns true if the lua field exists. More... | |
template<typename T > | |
void | setLuaField (const std::string &key, const T &value) |
Sets a field in this lua object. More... | |
template<typename T > | |
T | getLuaField (const std::string &key) |
Gets a field from this lua object. More... | |
void | releaseLuaFieldsTable () |
Release fields table reference. More... | |
void | luaSetField (const std::string &key) |
Sets a field from this lua object, the value must be on the stack. More... | |
void | luaGetField (const std::string &key) |
Gets a field from this lua object, the result is pushed onto the stack. More... | |
void | luaGetMetatable () |
Get object's metatable. More... | |
void | luaGetFieldsTable () |
Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More... | |
int | getUseCount () |
std::string | getClassName () |
Returns the derived class name, its the same name used in Lua. More... | |
LuaObjectPtr | asLuaObject () |
void | operator= (const LuaObject &) |
Public Member Functions inherited from stdext::shared_object | |
shared_object () | |
virtual | ~shared_object () |
void | add_ref () |
void | dec_ref () |
refcount_t | ref_count () |
template<typename T > | |
stdext::shared_object_ptr< T > | static_self_cast () |
template<typename T > | |
stdext::shared_object_ptr< T > | dynamic_self_cast () |
template<typename T > | |
stdext::shared_object_ptr< T > | const_self_cast () |
Protected Member Functions | |
virtual void | updateWalkAnimation (int totalPixelsWalked) |
virtual void | updateWalkOffset (int totalPixelsWalked) |
void | updateWalkingTile () |
virtual void | nextWalkUpdate () |
virtual void | updateWalk () |
virtual void | terminateWalk () |
void | updateOutfitColor (Color color, Color finalColor, Color delta, int duration) |
void | updateJump () |
Definition at line 37 of file creature.h.
anonymous enum |
Enumerator | |
---|---|
SHIELD_BLINK_TICKS | |
VOLATILE_SQUARE_DURATION |
Definition at line 40 of file creature.h.
Creature::Creature | ( | ) |
void Creature::addTimedSquare | ( | uint8 | color | ) |
|
inline |
Definition at line 119 of file creature.h.
|
inline |
Definition at line 125 of file creature.h.
|
virtual |
Reimplemented from Thing.
Definition at line 66 of file creature.cpp.
void Creature::drawOutfit | ( | const Rect & | destRect, |
bool | resize | ||
) |
Definition at line 196 of file creature.cpp.
|
inline |
|
inline |
|
virtual |
Reimplemented from Thing.
Definition at line 912 of file creature.cpp.
|
virtual |
Reimplemented from Thing.
Definition at line 921 of file creature.cpp.
|
virtual |
Reimplemented from Thing.
Definition at line 936 of file creature.cpp.
Point Creature::getDrawOffset | ( | ) |
|
inline |
|
virtual |
Reimplemented from Thing.
Definition at line 951 of file creature.cpp.
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented from Thing.
Definition at line 81 of file creature.h.
|
inline |
Definition at line 110 of file creature.h.
|
inline |
Definition at line 98 of file creature.h.
|
inline |
Definition at line 99 of file creature.h.
|
inline |
Definition at line 86 of file creature.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 103 of file creature.h.
|
inline |
Definition at line 105 of file creature.h.
int Creature::getStepDuration | ( | bool | ignoreDiagonal = false , |
Otc::Direction | dir = Otc::InvalidDirection |
||
) |
Definition at line 855 of file creature.cpp.
|
inline |
Definition at line 100 of file creature.h.
|
inline |
Definition at line 101 of file creature.h.
|
virtual |
Reimplemented from Thing.
Definition at line 973 of file creature.cpp.
|
inline |
|
inline |
Definition at line 97 of file creature.h.
|
inline |
Definition at line 102 of file creature.h.
bool Creature::hasSpeedFormula | ( | ) |
|
inline |
void Creature::internalDrawOutfit | ( | Point | dest, |
float | scaleFactor, | ||
bool | animateWalk, | ||
bool | animateIdle, | ||
Otc::Direction | direction, | ||
LightView * | lightView = nullptr |
||
) |
Definition at line 105 of file creature.cpp.
|
inlinevirtual |
Reimplemented from Thing.
Definition at line 127 of file creature.h.
|
inline |
|
inline |
Definition at line 123 of file creature.h.
|
inline |
|
inline |
|
inline |
void Creature::jump | ( | int | height, |
int | duration | ||
) |
Definition at line 374 of file creature.cpp.
|
protectedvirtual |
Definition at line 567 of file creature.cpp.
|
virtual |
Reimplemented from Thing.
Reimplemented in LocalPlayer.
Definition at line 431 of file creature.cpp.
|
virtual |
Definition at line 481 of file creature.cpp.
|
virtual |
Reimplemented from Thing.
Definition at line 457 of file creature.cpp.
Reimplemented from Thing.
Reimplemented in LocalPlayer.
Definition at line 426 of file creature.cpp.
|
virtual |
Reimplemented from Thing.
Definition at line 978 of file creature.cpp.
|
inline |
Definition at line 76 of file creature.h.
void Creature::setBaseSpeed | ( | double | baseSpeed | ) |
void Creature::setDirection | ( | Otc::Direction | direction | ) |
void Creature::setEmblem | ( | uint8 | emblem | ) |
Definition at line 748 of file creature.cpp.
void Creature::setEmblemTexture | ( | const std::string & | filename | ) |
Definition at line 786 of file creature.cpp.
void Creature::setHealthPercent | ( | uint8 | healthPercent | ) |
Definition at line 637 of file creature.cpp.
void Creature::setIcon | ( | uint8 | icon | ) |
Definition at line 760 of file creature.cpp.
void Creature::setIconTexture | ( | const std::string & | filename | ) |
Definition at line 796 of file creature.cpp.
|
inlinevirtual |
Reimplemented from Thing.
Definition at line 53 of file creature.h.
|
inline |
void Creature::setName | ( | const std::string & | name | ) |
Definition at line 631 of file creature.cpp.
void Creature::setOutfit | ( | const Outfit & | outfit | ) |
Definition at line 665 of file creature.cpp.
void Creature::setOutfitColor | ( | const Color & | color, |
int | duration | ||
) |
Definition at line 683 of file creature.cpp.
|
inline |
void Creature::setShield | ( | uint8 | shield | ) |
Definition at line 742 of file creature.cpp.
void Creature::setShieldTexture | ( | const std::string & | filename, |
bool | blink | ||
) |
Definition at line 771 of file creature.cpp.
void Creature::setSkull | ( | uint8 | skull | ) |
Definition at line 736 of file creature.cpp.
void Creature::setSkullTexture | ( | const std::string & | filename | ) |
Definition at line 766 of file creature.cpp.
void Creature::setSpeed | ( | uint16 | speed | ) |
Definition at line 714 of file creature.cpp.
void Creature::setSpeedFormula | ( | double | speedA, |
double | speedB, | ||
double | speedC | ||
) |
Definition at line 801 of file creature.cpp.
void Creature::setType | ( | uint8 | type | ) |
Definition at line 754 of file creature.cpp.
void Creature::setTypeTexture | ( | const std::string & | filename | ) |
Definition at line 791 of file creature.cpp.
|
inline |
|
virtual |
Reimplemented in LocalPlayer.
Definition at line 365 of file creature.cpp.
|
protectedvirtual |
Reimplemented in LocalPlayer.
Definition at line 604 of file creature.cpp.
void Creature::turn | ( | Otc::Direction | direction | ) |
Definition at line 325 of file creature.cpp.
|
protected |
Definition at line 386 of file creature.cpp.
|
protected |
Definition at line 699 of file creature.cpp.
void Creature::updateShield | ( | ) |
|
protectedvirtual |
Reimplemented in LocalPlayer.
Definition at line 586 of file creature.cpp.
|
protectedvirtual |
Definition at line 486 of file creature.cpp.
|
protected |
Definition at line 535 of file creature.cpp.
|
protectedvirtual |
Reimplemented in LocalPlayer.
Definition at line 521 of file creature.cpp.
Reimplemented in LocalPlayer.
Definition at line 335 of file creature.cpp.
|
protected |
Definition at line 190 of file creature.h.
|
protected |
Definition at line 155 of file creature.h.
|
protected |
Definition at line 151 of file creature.h.
|
protected |
Definition at line 194 of file creature.h.
|
protected |
Definition at line 158 of file creature.h.
|
protected |
Definition at line 163 of file creature.h.
|
protected |
Definition at line 185 of file creature.h.
|
protected |
Definition at line 191 of file creature.h.
|
protected |
Definition at line 187 of file creature.h.
|
protected |
Definition at line 150 of file creature.h.
|
protected |
Definition at line 160 of file creature.h.
|
protected |
Definition at line 165 of file creature.h.
|
protected |
Definition at line 148 of file creature.h.
|
protected |
Definition at line 175 of file creature.h.
|
protected |
Definition at line 204 of file creature.h.
|
protected |
Definition at line 203 of file creature.h.
|
protected |
Definition at line 205 of file creature.h.
|
protected |
Definition at line 206 of file creature.h.
|
protected |
Definition at line 197 of file creature.h.
|
protected |
Definition at line 198 of file creature.h.
|
protected |
Definition at line 199 of file creature.h.
|
protected |
Definition at line 153 of file creature.h.
|
protected |
Definition at line 149 of file creature.h.
|
protected |
Definition at line 174 of file creature.h.
|
protected |
Definition at line 200 of file creature.h.
|
protected |
Definition at line 152 of file creature.h.
|
protected |
Definition at line 176 of file creature.h.
|
protected |
Definition at line 178 of file creature.h.
|
protected |
Definition at line 177 of file creature.h.
|
protected |
Definition at line 168 of file creature.h.
|
protected |
Definition at line 173 of file creature.h.
|
protected |
Definition at line 157 of file creature.h.
|
protected |
Definition at line 167 of file creature.h.
|
protected |
Definition at line 162 of file creature.h.
|
protected |
Definition at line 166 of file creature.h.
|
protected |
Definition at line 172 of file creature.h.
|
protected |
Definition at line 171 of file creature.h.
|
protected |
Definition at line 156 of file creature.h.
|
protected |
Definition at line 161 of file creature.h.
|
protected |
Definition at line 154 of file creature.h.
|
protected |
Definition at line 180 of file creature.h.
|
protected |
Definition at line 170 of file creature.h.
|
protected |
Definition at line 169 of file creature.h.
|
protected |
Definition at line 159 of file creature.h.
|
protected |
Definition at line 164 of file creature.h.
|
protected |
Definition at line 183 of file creature.h.
|
protected |
Definition at line 184 of file creature.h.
|
protected |
Definition at line 193 of file creature.h.
|
protected |
Definition at line 189 of file creature.h.
|
protected |
Definition at line 188 of file creature.h.
|
protected |
Definition at line 195 of file creature.h.
|
protected |
Definition at line 186 of file creature.h.
|
protected |
Definition at line 196 of file creature.h.
|
protected |
Definition at line 192 of file creature.h.