diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2006-11-04 23:56:30 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2006-11-04 23:56:30 +0000 |
commit | f7716b5c9946462b885223cd89d9aea97372de0c (patch) | |
tree | 8a16ad410029228a804e7e3d076f44bdd7b05e82 /src/player.cpp | |
parent | 205decb772ed62df6a16a06d7a75b71aaba46af1 (diff) | |
download | mana-f7716b5c9946462b885223cd89d9aea97372de0c.tar.gz mana-f7716b5c9946462b885223cd89d9aea97372de0c.tar.bz2 mana-f7716b5c9946462b885223cd89d9aea97372de0c.tar.xz mana-f7716b5c9946462b885223cd89d9aea97372de0c.zip |
added scythe as a permanent weapon.
When you want to test it: either spawn an item with the id 623 or uncomment the lines 439-441 in being.cpp to use the sharp knive as scythe.
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/player.cpp b/src/player.cpp index 0ba99fe7..3f0ebfc4 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -37,7 +37,7 @@ Player::Player(Uint32 id, Uint16 job, Map *map): // Load the weapon sprite. // When there are more different weapons this should be moved to the // setWeapon Method. - mSprites[WEAPON_SPRITE] = new AnimatedSprite("graphics/sprites/weapons.xml", 0); + setWeapon(0); } void @@ -103,6 +103,35 @@ Player::setSex(Uint8 sex) Being::setSex(sex); } + +void +Player::setWeapon(Uint16 weapon) +{ + if (weapon != mWeapon) + { + delete mSprites[WEAPON_SPRITE]; + mSprites[WEAPON_SPRITE] = NULL; + + switch (weapon) + { + case 0: + mSprites[WEAPON_SPRITE] = new AnimatedSprite("graphics/sprites/weapon-fist.xml", 0); + break; + case 1: + mSprites[WEAPON_SPRITE] = new AnimatedSprite("graphics/sprites/weapon-dagger.xml", 0); + break; + case 2: + mSprites[WEAPON_SPRITE] = new AnimatedSprite("graphics/sprites/weapon-bow.xml", 0); + break; + case 3: + mSprites[WEAPON_SPRITE] = new AnimatedSprite("graphics/sprites/weapon-scythe.xml", 0); + break; + } + } + Being::setWeapon(weapon); +} + + void Player::setHairColor(Uint16 color) { |