void ITank::dead() { setStatus(DEAD); _mini_map_tank->setVisible(false); _sound_explode->playSound2D(pos(), principalReference()->pos(), Configuration::volumeSound()); deadAnimation(); //eliminar efectos removeAllEffects(); _current_dead_time = _dead_time; _info_bar->hide(); //adiciona experiencia a los enemigos if(_enemie.contains(_last_tank_cause_damage)) { QList<ITank*> enemie = _last_tank_cause_damage->getAllies(); int cant = _last_tank_cause_damage->getStatus() == DEAD? 0:1; int experience = _level * 12 + 100; foreach(ITank *killer, enemie) if(killer->getStatus() != DEAD && getDistance(pos(), killer->pos()) < 500) cant++; if(_last_tank_cause_damage->getStatus() != DEAD) _last_tank_cause_damage->addExperience(experience / cant); if(cant > 1) foreach(ITank *killer, enemie) if(killer->getStatus() != DEAD && getDistance(pos(), killer->pos()) < 500) killer->addExperience(experience / cant); }
void EnemyBase::init() { //texture = TexturePool::getPtr()->getTexture("Data/enemy.png",area.w,area.h); life = 0; bar.setEnemy(this); currentRoadTile = 0; road = NULL; showLifeBar(); reachedEnd = false; distance = 0.0; removeAllEffects(); }
SoundDataManager::~SoundDataManager() { removeAllEffects(); if (m_pHRes) { delete m_pHRes; m_pHRes = NULL; } if (m_pSoundMap) { delete m_pSoundMap; m_pSoundMap = NULL; } }
//----------------------------------------------------------------------- TextureUnitState & TextureUnitState::operator = ( const TextureUnitState &oth ) { assert(mAnimController == 0); removeAllEffects(); // copy basic members (int's, real's) memcpy( (uchar*)this, &oth, (const uchar *)(&oth.mFramePtrs) - (const uchar *)(&oth) ); // copy complex members mFramePtrs = oth.mFramePtrs; mSampler = oth.mSampler; mName = oth.mName; mEffects = oth.mEffects; mTextureNameAlias = oth.mTextureNameAlias; mCompositorRefName = oth.mCompositorRefName; mCompositorRefTexName = oth.mCompositorRefTexName; // Can't sharing controllers with other TUS, reset to null to avoid potential bug. for (EffectMap::iterator j = mEffects.begin(); j != mEffects.end(); ++j) { j->second.controller = 0; } // Load immediately if Material loaded if (isLoaded()) { _load(); } // Tell parent to recalculate hash if( Pass::getHashFunction() == Pass::getBuiltinHashFunction( Pass::MIN_TEXTURE_CHANGE ) ) { mParent->_dirtyHash(); } return *this; }
EnemyBase::~EnemyBase(void) { texture = NULL; removeAllEffects(); road = NULL; }