22 lines
578 B
Ruby
22 lines
578 B
Ruby
module InstanceHelper
|
|
def is_day?
|
|
et = Clock.get_current_eorzea_time
|
|
et.between?(et.change(hour: 6), et.change(hour: 18))
|
|
end
|
|
def has_missing_reqs?(nm, forecast)
|
|
et = Clock.get_current_eorzea_time
|
|
if nm[:weather] && nm[:weather] != forecast[0][:curr_weather]
|
|
return true
|
|
end
|
|
if nm[:spawned_by][:weather] && nm[:spawned_by][:weather] != forecast[0][:curr_weather]
|
|
return true
|
|
end
|
|
if nm[:night_only] && is_day?
|
|
return true
|
|
end
|
|
if nm[:spawned_by][:night_only] && is_day?
|
|
return true
|
|
end
|
|
false
|
|
end
|
|
end
|