summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2006-11-04 23:56:30 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2006-11-04 23:56:30 +0000
commitf7716b5c9946462b885223cd89d9aea97372de0c (patch)
tree8a16ad410029228a804e7e3d076f44bdd7b05e82 /src/player.cpp
parent205decb772ed62df6a16a06d7a75b71aaba46af1 (diff)
downloadmana-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.cpp31
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)
{