def isAvailableForVehicle(self, vehicle): """ Check if quest is available for provided vehicle. """ result, error = self.isAvailable() if result and not self._checkVehicleConditions(vehicle): return ValidationResult(False, 'requirement') return ValidationResult(result, error)
def isAvailable(self): if self.isDisabled(): return ValidationResult(False, 'disabled') if not self.isUnlocked(): return ValidationResult(False, 'isLocked') return ValidationResult( False, 'noVehicle' ) if not self.hasRequiredVehicles() else ValidationResult(True, '')
def isAvailable(self): if self.getStartTimeLeft() > 0: return ValidationResult(False, 'in_future') if self.isOutOfDate(): return ValidationResult(False, 'out_of_date') weekDays = self.getWeekDays() if weekDays and time_utils.getServerRegionalWeekDay() not in weekDays: return ValidationResult(False, 'invalid_weekday') intervals = self.getActiveTimeIntervals() serverTime = time_utils.getServerTimeCurrentDay() if intervals: for low, high in intervals: if low <= serverTime <= high: break else: return ValidationResult(False, 'invalid_time_interval') return ValidationResult(False, 'requirements') if not self._checkConditions() else ValidationResult(True, '')
def isAvailable(self): return ValidationResult( False, 'dailyComplete') if self.bonusCond.getBonusLimit( ) is not None and self.bonusCond.isDaily() and self.isCompleted( ) else super(Quest, self).isAvailable()
def isAvailableForVehicle(self, vehicle): result, error = self.isAvailable() return ValidationResult( False, 'requirement') if result and not self._checkVehicleConditions( vehicle) else ValidationResult(result, error)