Esempio n. 1
0
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();
        }
    }
    
}
Esempio n. 2
0
float getRemainingRatio(const Particle& particle)
{
	return getRemainingLifetime(particle) / getTotalLifetime(particle);
}
Esempio n. 3
0
void WaterPool::doSomething(){
    if(ActivateIfNecessary()) getWorld()->giveFrackManWater();
    setTicksToLive(getRemainingLifetime()-1);
    if(getRemainingLifetime() == 0) setDead();
}
Esempio n. 4
0
 float getRemainingRatio(const Particle& particle)
 {
     return (getRemainingLifetime(particle).asSeconds() / getTotalLifetime(particle).asSeconds());
 }