diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-01-10 17:19:24 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-01-10 17:20:33 +0100 |
commit | f5a394a5051384a930d635da22ccafc6beb1cb84 (patch) | |
tree | d28fc14408a6bb91170e05880b4d2af6a17fcc14 /src/being.cpp | |
parent | 5757066312cab082378dbc5d8df97dea3fe40af0 (diff) | |
download | mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.gz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.bz2 mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.xz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.zip |
Change code style
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/being.cpp b/src/being.cpp index 6e8449a4..613e692a 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -181,7 +181,7 @@ void Being::setDestination(int dstX, int dstY) // And add interpolation between the starting and ending offsets Path::iterator it = thisPath.begin(); int i = 0; - while(it != thisPath.end()) + while (it != thisPath.end()) { it->x = (it->x * 32) + startX + (changeX * i); it->y = (it->y * 32) + startY + (changeY * i); @@ -624,10 +624,12 @@ void Being::logic() (*it)->update(tick_time * MILLISECONDS_IN_A_TICK); // Restart status/particle effects, if needed - if (mMustResetParticles) { + if (mMustResetParticles) + { mMustResetParticles = false; for (std::set<int>::iterator it = mStatusEffects.begin(); - it != mStatusEffects.end(); it++) { + it != mStatusEffects.end(); it++) + { const StatusEffect *effect = StatusEffect::getStatusEffect(*it, true); if (effect && effect->particleEffectIsPersistent()) updateStatusEffect(*it, true); @@ -709,7 +711,8 @@ void Being::drawSpeech(int offsetX, int offsetY) { mSpeechBubble->setVisible(false); - if (! mText) { + if (! mText) + { mText = new Text(mSpeech, mPx, mPy - getHeight(), gcn::Graphics::CENTER, @@ -730,7 +733,8 @@ void Being::drawSpeech(int offsetX, int offsetY) void Being::setStatusEffectBlock(int offset, Uint16 newEffects) { - for (int i = 0; i < STATUS_EFFECTS; i++) { + for (int i = 0; i < STATUS_EFFECTS; i++) + { int index = StatusEffect::blockEffectIndexToEffectIndex(offset + i); if (index != -1) @@ -752,8 +756,11 @@ void Being::handleStatusEffect(StatusEffect *effect, int effectId) Particle *particle = effect->getParticle(); if (effectId >= 0) + { mStatusParticleEffects.setLocally(effectId, particle); - else { + } + else + { mStunParticleEffects.clearLocally(); if (particle) mStunParticleEffects.addLocally(particle); @@ -775,7 +782,8 @@ void Being::setStatusEffect(int index, bool active) { const bool wasActive = mStatusEffects.find(index) != mStatusEffects.end(); - if (active != wasActive) { + if (active != wasActive) + { updateStatusEffect(index, active); if (active) mStatusEffects.insert(index); @@ -883,7 +891,8 @@ static EffectDescription *getEffectDescription(int effectId) EffectDescription *EffectDescription = getEffectDescription(node, &id); effects[id] = EffectDescription; - } else if (xmlStrEqual(node->name, BAD_CAST "default")) + } + else if (xmlStrEqual(node->name, BAD_CAST "default")) { EffectDescription *EffectDescription = getEffectDescription(node, &id); @@ -913,21 +922,22 @@ void Being::internalTriggerEffect(int effectId, bool sfx, bool gfx) EffectDescription *ed = getEffectDescription(effectId); - if (!ed) { + if (!ed) + { logger->log("Unknown special effect and no default recorded"); return; } - if (gfx && !ed->mGFXEffect.empty()) { + if (gfx && !ed->mGFXEffect.empty()) + { Particle *selfFX; selfFX = particleEngine->addEffect(ed->mGFXEffect, 0, 0); controlParticle(selfFX); } - if (sfx && !ed->mSFXEffect.empty()) { + if (sfx && !ed->mSFXEffect.empty()) sound.playSfx(ed->mSFXEffect); - } } void Being::updateCoords() @@ -950,7 +960,7 @@ void Being::showName() mDispName = 0; std::string mDisplayName(mName); - if(getType() == MONSTER) + if (getType() == MONSTER) { if (config.getValue("showMonstersTakedDamage", false)) { |