void BurstWeapon::timepass() { if(active && nextShotTime <= getTime()) { fireBurst(); nextShotTime = getTime() + getCooldown(); } }
void BurstWeapon::startShooting() { active = true; if(nextShotTime <= getTime()) { fireBurst(); nextShotTime = getTime() + getCooldown(); } }
void Cannon::updateStill() { target = world->getNearestTarget(pos, getRange()); if (target) { shot(target); state = State::COOLDOWN; cooldown = getCooldown(); } }