From 58f04040cea0c7eb64388925dcdf8de848dd47c2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 16 Oct 2010 23:22:55 +0300 Subject: Add new three colors. Add colors: Local Player Hits Monster Local Player Critical Hit Local Player Miss Reviewed-by: cody --- src/being.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index f2d95c4a..be8afa79 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -261,7 +261,15 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) // Selecting the right color if (type == CRITICAL || type == FLEE) { - color = &userPalette->getColor(UserPalette::HIT_CRITICAL); + if (attacker == player_node) + { + color = &userPalette->getColor( + UserPalette::HIT_LOCAL_PLAYER_CRITICAL); + } + else + { + color = &userPalette->getColor(UserPalette::HIT_CRITICAL); + } } else if (!amount) { @@ -269,7 +277,7 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) { // This is intended to be the wrong direction to visually // differentiate between hits and misses - color = &userPalette->getColor(UserPalette::HIT_MONSTER_PLAYER); + color = &userPalette->getColor(UserPalette::HIT_LOCAL_PLAYER_MISS); } else { @@ -278,7 +286,16 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) } else if (getType() == MONSTER) { - color = &userPalette->getColor(UserPalette::HIT_PLAYER_MONSTER); + if (attacker == player_node) + { + color = &userPalette->getColor( + UserPalette::HIT_LOCAL_PLAYER_MONSTER); + } + else + { + color = &userPalette->getColor( + UserPalette::HIT_PLAYER_MONSTER); + } } else { -- cgit v1.2.3-70-g09d2