summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-23 13:43:17 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-08-23 13:43:17 +0000
commit4b8df221acc3bd3e681357df912bdbc7a1ce6c3f (patch)
tree3b3d196dcbeacc67b1479d56e3eccc14dfef07e1 /src/being.cpp
parent4346b429cc875a85095fff271a8d82a46c2cfc91 (diff)
downloadmana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.tar.gz
mana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.tar.bz2
mana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.tar.xz
mana-client-4b8df221acc3bd3e681357df912bdbc7a1ce6c3f.zip
Removed two useless popup related methods, used generic close button
functionality for the debug window and renamed Particle::mVector to Particle::mVelocity for clarity.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 4c3c03f6..a1c8faf3 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -162,7 +162,7 @@ Being::setSpeech(const std::string &text, Uint32 time)
void
Being::takeDamage(int amount)
{
- gcn::Font* font;
+ gcn::Font *font;
std::string damage = amount ? toString(amount) : "miss";
// Selecting the right color
@@ -172,8 +172,9 @@ Being::takeDamage(int amount)
}
else
{
- // hit particle effect
- controlParticle(particleEngine->addEffect("graphics/particles/hit.particle.xml", 0, 0));
+ // Hit particle effect
+ controlParticle(particleEngine->addEffect(
+ "graphics/particles/hit.particle.xml", 0, 0));
if (getType() == MONSTER)
{
@@ -185,7 +186,7 @@ Being::takeDamage(int amount)
}
}
- // show damage number
+ // Show damage number
particleEngine->addTextSplashEffect(damage, 255, 255, 255, font,
mPx + 16, mPy + 16);
}
@@ -193,13 +194,11 @@ Being::takeDamage(int amount)
void
Being::showXP(int amount)
{
- gcn::Font* font;
- std::string xp = (amount ? toString(amount) : "") + " xp";
+ const std::string xp = toString(amount) + " xp";
- font = hitYellowFont;
-
- // show xp number
- particleEngine->addTextRiseFadeOutEffect(xp, font, mPx + 16, mPy - 16);
+ // Show XP number
+ particleEngine->addTextRiseFadeOutEffect(xp, hitYellowFont,
+ mPx + 16, mPy - 16);
}
void
@@ -214,7 +213,7 @@ void
Being::setMap(Map *map)
{
// Remove sprite from potential previous map
- if (mMap != NULL)
+ if (mMap)
{
mMap->removeSprite(mSpriteIterator);
}
@@ -222,12 +221,12 @@ Being::setMap(Map *map)
mMap = map;
// Add sprite to potential new map
- if (mMap != NULL)
+ if (mMap)
{
mSpriteIterator = mMap->addSprite(this);
}
- //clear particle effect list because child particles became invalid
+ // Clear particle effect list because child particles became invalid
mChildParticleEffects.clear();
}
@@ -236,7 +235,8 @@ Being::controlParticle(Particle *particle)
{
if (particle)
{
- particle->disableAutoDelete(); //the effect may not die without the beings permission or we segvault
+ // The effect may not die without the beings permission or we segfault
+ particle->disableAutoDelete();
mChildParticleEffects.push_back(particle);
}
}