







default lc = LifeCycle(1, 2020, 5, 28, 'Spring', 'Sunny', False)
$ lc.advance_time()
$ lc.advance_calendar()
init python:
    import datetime
    class LifeCycle(renpy.store.object):
        def __init__(self, daynumber, year, month, dayOfMonth, season, weather, cataclysm):
            self.daynumber = daynumber
            self.calendar = datetime.datetime(year, month, dayOfMonth)
            self.season = season
            self.weather = weather
            self.cataclysm = cataclysm
            
            self.times = (
                'Early Morning',
                'Morning',
                'Noon',
                'Evening',
                'Night',
            )
            self.period = self.times[0] 
        
        def advance_calendar(self, days_to_advance = 1):
            self.calendar += datetime.timedelta(days = days_to_advance)
        
        def advance_time(self, periods_to_advance = 1):
            
            
            
            
            
            
            
            
            
            was_night = self.period == self.times[len(self.times) - 1]
            current_period = self.times.index(self.period)
            new_period_index = current_period + periods_to_advance
            delta = new_period_index % len(self.times)
            periods_advanced = new_period_index // len(self.times)
            
            self.period = self.times[delta]
            
            if (periods_advanced > 1) or was_night:
                self.advance_calendar(periods_advanced)
        
        @property
        def day_of_week(self):
            return self.calendar.isoweekday() 
        @property
        def is_weekday(self):
            return self.day_of_week not in (6, 7) 
        @property
        def is_weekend(self):
            return self.day_of_week in (6, 7) 
        @property
        def week(self):
            return self.calendar.isocalendar()[1]
        
        @property
        def year(self):
            return self.calendar.year
        
        @property
        def month(self):
            return self.calendar.month
        
        @property
        def day_of_month(self):
            return self.calendar.day
        
        @property 
        def day_month_date(self): 
            return self.calendar.strftime('%d %B, %A') 
# Decompiled by unrpyc: https://github.com/CensoredUsername/unrpyc
