From f7716b5c9946462b885223cd89d9aea97372de0c Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Sat, 4 Nov 2006 23:56:30 +0000 Subject: 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. --- src/player.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/player.cpp') 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) { -- cgit v1.2.3-70-g09d2