Difference between revisions of "User:Rasikko"
Jump to navigation
Jump to search
no edit summary
imported>Rasikko |
imported>Rasikko |
||
Line 153: | Line 153: | ||
return months[aiGameMonth] | return months[aiGameMonth] | ||
EndFunction | EndFunction | ||
</source> | |||
== Lunar Functions == | |||
Returns the time Masser rises. If the current time is beyond this, will return how many hours til the next moonrise. | |||
If more than 1 day has not passed, will return the time Masser will rise instead. | |||
<source lang="papyrus"> | |||
Float Function GetMasserRiseTime() | |||
Float gameTime = Utility.GetCurrentGameTime() | |||
Float riseTime = 20.00 ; 8PM | |||
Float hoursPerDay = 24.00 | |||
Float currentHour = (gameTime - gameTime as int) * hoursPerDay | |||
if (gameTime >= 1.0) | |||
if currentHour > riseTime | |||
; let's say it's 22:00 | |||
riseTime = hoursPerDay - (currentHour - riseTime) | |||
return riseTime | |||
else | |||
return riseTime | |||
endif | |||
endif | |||
return riseTime | |||
EndFuntion | |||
</source> | </source> | ||