void GoldNugget::doSomething(){ if(!wasDropped){ ActivatingObject::doSomething(); if(!isAlive()) getWorld()->giveFrackManGold(); } else { if(getRemainingLifetime() == 0){ setDead(); return; } setTicksToLive(getRemainingLifetime()-1); Actor* a = getWorld()->findNearbyProtester(this, 3); if(a){ a->addGold(); getWorld()->increaseScore(25); setDead(); } } }
float getRemainingRatio(const Particle& particle) { return getRemainingLifetime(particle) / getTotalLifetime(particle); }
void WaterPool::doSomething(){ if(ActivateIfNecessary()) getWorld()->giveFrackManWater(); setTicksToLive(getRemainingLifetime()-1); if(getRemainingLifetime() == 0) setDead(); }
float getRemainingRatio(const Particle& particle) { return (getRemainingLifetime(particle).asSeconds() / getTotalLifetime(particle).asSeconds()); }