summaryrefslogtreecommitdiff
path: root/src/being.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 17:45:36 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 17:45:45 +0100
commit1dcaa196fd8339dbdd28f9c09c62636b663a3846 (patch)
treec7faf82210e428787804204e3dc8e5dc6c725947 /src/being.h
parent17b2b19e7b907ae955e500d44dd167d2f31ce7bd (diff)
downloadmana-client-1dcaa196fd8339dbdd28f9c09c62636b663a3846.tar.gz
mana-client-1dcaa196fd8339dbdd28f9c09c62636b663a3846.tar.bz2
mana-client-1dcaa196fd8339dbdd28f9c09c62636b663a3846.tar.xz
mana-client-1dcaa196fd8339dbdd28f9c09c62636b663a3846.zip
Fixed some positioning issues
Started with not being able to click NPCs properly, and I ended up correcting the draw positions of overhead text, targets and sprite ordering. It's now a bit more straight-forward. The position of a being is simply in the middle of the sprite at the bottom. When drawing the sprite, an offset remains because all the sprites are compensating for getting drawn half a tile to the left and one tile up.
Diffstat (limited to 'src/being.h')
-rw-r--r--src/being.h47
1 files changed, 16 insertions, 31 deletions
diff --git a/src/being.h b/src/being.h
index 0faf794e..daedcf33 100644
--- a/src/being.h
+++ b/src/being.h
@@ -163,12 +163,13 @@ class Being : public Sprite
/**
* Constructor.
+ *
+ * @param id a unique being id
+ * @param job partly determines the type of the being
+ * @param map the map the being is on
*/
Being(int id, int job, Map *map);
- /**
- * Destructor.
- */
virtual ~Being();
/**
@@ -276,9 +277,6 @@ class Being : public Sprite
*/
virtual void setGender(Gender gender) { mGender = gender; }
- /**
- * Gets the gender of this being.
- */
Gender getGender() const { return mGender; }
#ifdef EATHENA_SUPPORT
@@ -290,9 +288,6 @@ class Being : public Sprite
/**
* Triggers whether or not to show the name as a GM name.
- * NOTE: This doesn't mean that just anyone can use this.
- * If the server doesn't acknowlege you, you won't be shown
- * as a GM on other people's clients.
*/
virtual void setGM() { mIsGM = true; }
@@ -317,26 +312,19 @@ class Being : public Sprite
virtual Type getType() const;
/**
- * Gets the walk speed.
- * @see setWalkSpeed(int)
- */
- int getWalkSpeed() const { return mWalkSpeed; }
-
- /**
* Sets the walk speed (in pixels per second).
*/
void setWalkSpeed(int speed) { mWalkSpeed = speed; }
- /**
- * Gets the being id.
- */
- int getId() const { return mId; }
+ int getWalkSpeed() const { return mWalkSpeed; }
/**
* Sets the sprite id.
*/
void setId(int id) { mId = id; }
+ int getId() const { return mId; }
+
/**
* Sets the map the being is on
*/
@@ -348,9 +336,9 @@ class Being : public Sprite
virtual void setAction(Action action, int attackType = 0);
/**
- * Gets the current action.
+ * Returns whether this being is still alive.
*/
- bool isAlive() { return mAction != DEAD; }
+ bool isAlive() const { return mAction != DEAD; }
/**
* Returns the current direction.
@@ -364,9 +352,9 @@ class Being : public Sprite
#ifdef EATHENA_SUPPORT
/**
- * Gets the current action.
+ * Returns the walk time.
*/
- int getWalkTime() { return mWalkTime; }
+ int getWalkTime() const { return mWalkTime; }
#endif
/**
@@ -515,17 +503,14 @@ class Being : public Sprite
internalTriggerEffect(effectId, false, true);
}
- // Target cursor being used by the being
- Image *mTargetCursor;
-
static int getHairColorCount();
static int getHairStyleCount();
static std::string getHairColor(int index);
- virtual AnimatedSprite* getSprite(int index) const
- { return mSprites[index]; }
+ virtual AnimatedSprite *getSprite(int index) const
+ { return mSprites[index]; }
static void load();
@@ -556,7 +541,7 @@ class Being : public Sprite
void internalTriggerEffect(int effectId, bool sfx, bool gfx);
/**
- * Notify self that the stun mode has been updated. Invoked by
+ * Notify self that the stun mode has been updated. Invoked by
* setStunMode if something changed.
*/
virtual void updateStunMode(int oldMode, int newMode);
@@ -623,7 +608,7 @@ class Being : public Sprite
/** Reset particle status effects on next redraw? */
bool mMustResetParticles;
- // Speech Bubble components
+ /** Speech Bubble components */
SpeechBubble *mSpeechBubble;
int mWalkSpeed; /**< Walking speed (pixels/sec) */
@@ -632,7 +617,7 @@ class Being : public Sprite
Vector mDest;
int mPx, mPy; /**< Position in pixels */
- // Target cursor being used
+ /** Target cursor being used */
SimpleAnimation* mUsedTargetCursor;
};