Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def date_roll
- month = $game_variables[101]
- date = $game_variables[102]
- day = $game_variables[103]
- moon = $game_variables[105]
- total = $game_variables[106]
- date += 1 # Push date +1
- mon_length = month % 2 # Mod month; even = 0, odd = 1
- if mon_length == 0
- if date > 30 or (month == 2 and date > 28) # February
- date = 1
- month += 1
- end
- else
- if date > 31
- date = 1
- month += 1
- end
- end
- month = 1 if month > 12 # if January, make it January
- day += 1 # Advance day of week
- day = 1 if day > 7 # If Sunday, make it Sunday
- total += 1 # Total number of days ever passed
- #~ moon += 1 # Advance moon phase
- #~ moon = 1 if moon > 27 # Constant loop of lunacy
- $game_variables[101] = month
- $game_variables[102] = date
- $game_variables[103] = day
- $game_variables[106] = total
- case ((total % 28) + 1)
- when 1
- $game_variables[105] = 1
- #~ phase = "Full"
- when (2..5)
- $game_variables[105] = 2
- #~ phase = "Waning Gibbous"
- when (6..11)
- $game_variables[105] = 3
- #~ phase = "Last Quarter"
- when (12..15)
- $game_variables[105] = 4
- #~ phase = "Waning Crescent"
- when (16)
- $game_variables[105] = 5
- #~ phase = "New"
- when (17..20)
- $game_variables[105] = 6
- #~ phase = "Waxing Crescent"
- when (21..25)
- $game_variables[105] = 7
- #~ phase = "First Quarter"
- when (26..28)
- $game_variables[105] = 8
- #~ phase = "Waxing Gibbous"
- end
- case $game_variables[105]
- when 1
- physphase = 100
- magiphase = 100
- when 2
- physphase = 90
- magiphase = 110
- when 3
- physphase = 80
- magiphase = 120
- when 4
- physphase = 90
- magiphase = 110
- when 5
- physphase = 100
- magiphase = 100
- when 6
- physphase = 110
- magiphase = 90
- when 7
- physphase = 120
- magiphase = 80
- when 8
- physphase = 110
- magiphase = 90
- end
- end
Add Comment
Please, Sign In to add comment