from math import floor
import renpy
from game.main_character.MainCharacter_ren import mc
from game.major_game_classes.character_related.Person_ren import Person

"""renpy
IF FLAG_OPT_IN_ANNOTATIONS:
    rpy python annotations
init 5 python:
"""
def kina_decorate_run_day():
    #Making it harder to increase baby desire
    undecorated_run_day = Person.run_day
    def decorated_function(self,*args,**kwargs):
        #Run the vanilla "run_day" actions.
        undecorated_run_day(self,*args,**kwargs)
        #Now we update the baby desire
        kidsmult = self.kids * 5 #More kids, the higher happiness threshold needed to have another  
        kidsvar = self.kids * 20 #She more reluctant to have more kids 
        if self.happiness > 140 + kidsmult:
            if self.love > self.baby_desire + kidsvar + 20:
                self.change_baby_desire(1)
                #mc.log_event(self.title + " baby desire++ (KiNA Debug)", "float_text_grey")
        else:
            if not self.has_breeding_fetish:
                if self.love > self.baby_desire + 20:
                    self.change_baby_desire(-2) #base game add 1 if love > 20
                else:
                    self.change_baby_desire(-1)
                #mc.log_event(self.title + " baby desire-- (KiNA Debug)", "float_text_grey")
        #Happiness boost. The base game normalize toward 100 which is below happiness. The only way the girls gains happiness is through interactions with player.
        #Yet, they will lose happiness especially those that had poor opinion on Friday, weekend and Monday. Thus, after 2 weeks, they falls into depression if you didnt interact with them
        if self.love > 0 and self.happiness < 130: #This allow up to 140 happiness with 100 love.
            self.change_happiness(self.love/10)
            
        
                
    Person.run_day = decorated_function
kina_decorate_run_day()