Exemple #1
0
LocalPlayer::LocalPlayer(const Uint32 &id, const Uint16 &job, Map *map):
    Player(id, job, map),
    mCharId(0),
    mJobXp(0),
    mLevel(0),
    mJobLevel(0),
    mXpForNextLevel(0), mJobXpForNextLevel(0),
    mHp(0), mMaxHp(0), mMp(0), mMaxMp(0),
    mGp(0),
    mAttackRange(0),
    mTotalWeight(0), mMaxWeight(0),
    ATK(0), MATK(0), DEF(0), MDEF(0), HIT(0), FLEE(0),
    ATK_BONUS(0), MATK_BONUS(0), DEF_BONUS(0), MDEF_BONUS(0), FLEE_BONUS(0),
    mStatPoint(0), mSkillPoint(0),
    mStatsPointsToAttribute(0),
    mEquipment(new Equipment()),
    mXp(0),
    mTarget(NULL), mPickUpTarget(NULL),
    mTrading(false), mGoingToTarget(false), mKeepAttacking(false),
    mTargetTime(-1), mLastAction(-1), mWalkingDir(0),
    mDestX(0), mDestY(0),
    mInventory(new Inventory(INVENTORY_SIZE)),
    mStorage(new Inventory(STORAGE_SIZE))
{
    mUpdateName = true;

    initTargetCursor();
}
LocalPlayer::LocalPlayer(int id, int job, Map *map):
    Player(id, job, map),
#ifdef EATHENA_SUPPORT
    mAttackRange(0),
#endif
    mEquipment(new Equipment),
    mInStorage(false),
#ifdef EATHENA_SUPPORT
    mTargetTime(-1),
#endif
    mLastTarget(-1),
    mCharacterPoints(0),
    mCorrectionPoints(0),
    mLevel(1),
    mExp(0), mExpNeeded(0),
    mMp(0), mMaxMp(0),
    mMoney(0),
    mTotalWeight(1), mMaxWeight(1),
    mHp(1), mMaxHp(1),
    mSkillPoints(0),
    mTarget(NULL), mPickUpTarget(NULL),
    mTrading(false), mGoingToTarget(false), mKeepAttacking(false),
    mLastAction(-1),
    mWalkingDir(0),
    mDestX(0), mDestY(0),
    mInventory(new Inventory(INVENTORY_SIZE)),
#ifdef TMWSERV_SUPPORT
    mLocalWalkTime(-1),
#endif
    mStorage(new Inventory(STORAGE_SIZE)),
    mMessageTime(0)
{
    // Variable to keep the local player from doing certain actions before a map
    // is initialized. e.g. drawing a player's name using the TextManager, since
    // it appears to be dependant upon map coordinates for updating drawing.
    mMapInitialized = false;

    mUpdateName = true;

    mTextColor = &guiPalette->getColor(Palette::PLAYER);
    mNameColor = &guiPalette->getColor(Palette::SELF);

    initTargetCursor();

    config.addListener("showownname", this);
    setShowName(config.getValue("showownname", 1));
}