Difference between revisions of "User:Rasikko"
Jump to navigation
Jump to search
→Moon info
imported>Rasikko |
imported>Rasikko |
||
Line 192: | Line 192: | ||
To calculate the current moon phase each day: | To calculate the current moon phase each day: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
String Function GetCurrentMoonPhase() | |||
Int iCurrentMoonPhase = (((228 + GameDaysPassed.GetValue() as int) % 24) / 3) as int | |||
if iCurrentMoonPhase == 0 | |||
return "New Moon" | |||
elseif iCurrentMoonPhase == 1 | |||
return "Waxing Crescent" | |||
elseif iCurrentMoonPhase == 2 | |||
return "First Quarter" | |||
elseif iCurrentMoonPhase == 3 | |||
return "Waxing Gibbous" | |||
elseif iCurrentMoonPhase == 4 | |||
return "Full Moon" | |||
elseif iCurrentMoonPhase == 5 | |||
return "Waning Crescent" | |||
elseif iCurrentMoonPhase == 6 | |||
return "Last Quarter" | |||
elseif iCurrentMoonPhase == 7 | |||
return "Waning Gibbous" | |||
else | |||
return "Unable to calculate the moon phase." | |||
endif | |||
EndFunction | EndFunction | ||
</source> | </source> |