code:
init 3 python:
    def daily_insult_requirement():
        if mc.business.is_open_for_business and mc.business.employee_count > 0:
            if mc.business.event_triggers_dict.get("daily_insult_employees", -1) < day:
                if count_employees_talk() > 0:
                    return True
                return "Already spoke with everyone"
            return "Only once per day"
        return False

    def daily_compliment_requirement():
        if mc.business.is_open_for_business and mc.business.employee_count > 0:
            if mc.business.event_triggers_dict.get("daily_compliment_employees", -1) < day:
                if count_employees_talk() > 0:
                    return True
                return "Already spoke with everyone"
            return "Only once per day"
        return False

    def count_employees_talk():
        count = 0
        for person in [x for x in mc.business.employee_list if x.event_triggers_dict.get("day_last_employee_interaction", -1) < day]:
            count +=1
        return count

    def daily_insult_update_employee_stats():
        for person in [x for x in mc.business.employee_list if x.event_triggers_dict.get("day_last_employee_interaction", -1) < day]:
            person.event_triggers_dict["day_last_employee_interaction"] = day
            person.change_obedience(mc.charisma)
            person.change_happiness(-5)
            person.change_love(-2)
        mc.business.event_triggers_dict["daily_talk_employees"] = day
        return

    def daily_compliment_update_employee_stats():
        for person in [x for x in mc.business.employee_list if x.event_triggers_dict.get("day_last_employee_interaction", -1) < day]:
            person.event_triggers_dict["day_last_employee_interaction"] = day
            person.change_love(1)
            person.change_happiness(mc.charisma)
        mc.business.event_triggers_dict["daily_compliment_employees"] = day
        return

    def daily_insult_efficiency_initialization(self):
        lobby.add_action(self)
        return

    def daily_compliment_efficiency_initialization(self):
        lobby.add_action(self)
        return

    def company_breakfast_requirement():
        if mc.business.is_open_for_business and mc.business.employee_count > 0:
            if time_of_day == 1:
                if mc.business.event_triggers_dict.get("company_breakfast_employees", -1) < day:
                    if mc.business.funds > (10*mc.business.employee_count):
                        return True
                    return "Requires more funds"
                return "Only once per week"
            return "Only in the morning"
        return "Business not open"

    def company_breakfast_initialization(self):
        lobby.add_action(self)
        return

    def company_lunch_requirement():
        if mc.business.is_open_for_business and mc.business.employee_count > 0:
            if time_of_day == 2:
                if mc.business.event_triggers_dict.get("company_lunch_employees", -1) < day:
                    if mc.business.funds > (10*mc.business.employee_count):
                        return True
                    return "Requires more funds"
                return "Only once per week"
            return "Only in the afternoon"
        return "Business not open"

    def company_lunch_initialization(self):
        lobby.add_action(self)
        return

    def company_lunch_performance(meal_value = 0):
        count = 0
        number = 1
        for person in [x for x in mc.business.employee_list]:
            count += 1
            if person in mc.business.research_team:
                ability = person.research_skill
                if renpy.random.randint(0,(ability)) == 0:
                    person.research_skill += 1
                    mc.log_event((person.title or person.name) + ": +" + str(number) + " Research Skill", "float_text_grey")
            elif person in mc.business.market_team:
                ability = person.market_skill
                if renpy.random.randint(0,(ability)) == 0:
                    person.market_skill += 1
                    mc.log_event((person.title or person.name) + ": +" + str(number) + " Market Skill", "float_text_grey")
            elif person in mc.business.supply_team:
                ability = person.supply_skill
                if renpy.random.randint(0,(ability)) == 0:
                    person.supply_skill += 1
                    mc.log_event((person.title or person.name) + ": +" + str(number) + " Supply Skill", "float_text_grey")
            elif person in mc.business.production_team:
                ability = person.production_skill
                if renpy.random.randint(0,(ability)) == 0:
                    person.production_skill += 1
                    mc.log_event((person.title or person.name) + ": +" + str(number) + " Production Skill", "float_text_grey")
            elif person in mc.business.hr_team:
                ability = person.hr_skill
                if renpy.random.randint(0,(ability)) == 0:
                    person.hr_skill += 1
                    mc.log_event((person.title or person.name) + ": +" + str(number) + " HR Skill", "float_text_grey")
            person.change_love(meal_value-4)
            person.change_happiness(meal_value-5)
        return count

    def company_lunch_slut(meal_value = 0):
        count = 0
        for person in [x for x in mc.business.employee_list]:
            count += 1
            person.change_slut(mc.charisma*2)
            person.change_love(meal_value-4)
            person.change_happiness(meal_value-5)
        return count

    def company_lunch_obey(meal_value = 0):
        count = 0
        for person in [x for x in mc.business.employee_list]:
            count += 1
            person.change_obedience(mc.charisma)
            person.change_love(meal_value-4)
            person.change_happiness(meal_value-5)
        return count

    def company_lunch_love(meal_value = 0):
        count = 0
        for person in [x for x in mc.business.employee_list]:
            count += 1
            person.change_love(2)
            person.change_happiness(meal_value)
        return count

    def company_serum_requirement():
        if mandatory_paid_serum_testing_policy.is_active:
            if mc.business.is_open_for_business and mc.business.employee_count > 0:
                return True
            return "Business not open"
        return "Serum testing inactive"

    def company_serum_initialization(self):
        lobby.add_action(self)
        return

    def company_serum_dose(the_serum):
        for person in mc.business.employee_list:
            if person.is_at_office:
                person.give_serum(copy.copy(the_serum), add_to_log = False)
        return

    daily_insult_efficiency_action = ActionMod("Insult all employees", daily_insult_requirement, "daily_insult_efficiency_employees", initialization = daily_insult_efficiency_initialization,
        menu_tooltip = "Insult workers at the cost of 1 efficiency per employee.", category = "Business Action")
    daily_compliment_efficiency_action = ActionMod("Compliment all employees", daily_compliment_requirement, "daily_compliment_efficiency_employees", initialization = daily_compliment_efficiency_initialization,
        menu_tooltip = "Compliment workers at the cost of 1 efficiency per employee.", category = "Business Action")
    company_breakfast_action = ActionMod("Buy the company breakfast {image=gui/heart/Time_Advance.png}", company_breakfast_requirement, "company_breakfast", initialization = company_breakfast_initialization,
        menu_tooltip = "Bring in breakfast for the company and gain a chance to influence your employees.", category = "Business Action")
    company_lunch_action = ActionMod("Buy the company lunch {image=gui/heart/Time_Advance.png}", company_lunch_requirement, "company_lunch", initialization = company_lunch_initialization,
        menu_tooltip = "Have lunch catered for the company and gain a chance to influence your employees.", category = "Business Action")
    company_serum_action = ActionMod("Give all employees serum", company_serum_requirement, "company_serum", initialization = company_serum_initialization,
        menu_tooltip = "Give the entire staff a dose of the same serum.", category = "Business Action")

label daily_insult_efficiency_employees():
    $ count = count_employees_talk()
    "Things have not been running as smoothly as you would like, and it is time to crack the whip."
    "Before settling down to work you send off an email asking each of your [count] employees to stop by today for a quick chat."
    "While this won't take much out of your day it will hinder their effectiveness somewhat."
    "It is also going to upset them, although the obedience gain should be worth it."
    $ daily_insult_update_employee_stats()
    $ mc.business.change_team_effectiveness(-count)
    return

label company_serum():
    $ count = len(mc.business.employee_list)
    $ money = count*100
    "You currently have [count] employees, that means to give them each a dose of serum you will need to have [count] doses in the production department."
    if not mandatory_unpaid_serum_testing_policy.is_active:
        "Unfortunately this is also going to cost you $[money] to accomplish."
        menu:
            "Proceed" if mc.business.funds > money:
                $ mc.business.change_funds(-money)
                "That is a small price to pay for what you can accomplish with the serums, so you decide to proceed."
            "Nevermind":
                "That is a bit pricey, so on second thought you decide to be a bit more selective and hand out individual doses instead."
                return
    $ finished = False
    "You just need to pick a serum for them to take."
    while not finished:
        "You quickly remind yourself you need at least [count]."
        call screen serum_inventory_select_ui(mc.business.inventory)
        if isinstance(_return, SerumDesign):
            $ the_serum = _return
            if mc.business.inventory.get_serum_count(the_serum) >= count:
                "After double-checking the inventory you set aside [count] doses to be used by the staff."
                $ mc.business.inventory.change_serum(the_serum, -count)
                $ finished = True
            elif mc.business.inventory.get_serum_count(the_serum) < count:
                "Unfortunately you don't have enough of that serum to use."
        else:
            $ the_serum = None
            "You decide not to give a serum out after all."
            return
    "Before settling down to work you send off an email asking each of your [count] employees to swing by production for a special dose of serum."
    $ company_serum_dose(the_serum)
    return

label daily_compliment_efficiency_employees():
    $ count = count_employees_talk()
    "Things have been going great, and it is about time that you recognise your employees."
    "Before settling down to work you send off an email asking each of your [count] employees to stop by today for a quick chat."
    "While this won't take much our of your day it will hinder their effectiveness somewhat."
    "They should be thrilled to hear from you."
    $ daily_compliment_update_employee_stats()
    $ mc.business.change_team_effectiveness(-count)
    return

label company_breakfast():
    $ department = all
    $ goal = None
    $ count = mc.business.employee_count
    $ meal_value = 1
    "To help get the day off to the right start you decide to pick up breakfast for the company."
    if count < 10:
        "There are only [count] employees, feeding them shouldn't be a problem."
    elif count > 10:
        "You currently have [count] employees, feeding all of them could be expensive."
    "You pick up some assorted pastries and coffee."
    "Now you just need a plan for what you want to improve about your employees."
    menu:
        "Performance":
            "Work is the reason they are here, it would be nice if they were a bit better at their jobs. Although learning can be boring."
            $ count = company_lunch_performance(meal_value)
        "Sluttiness":
            "They could stand to be more free spirited. Although you'll have to push boundaries."
            $ count = company_lunch_slut(meal_value)
        "Obedience":
            "They could stand to be more obedient. Although you'll have to be mean."
            $ count = company_lunch_obey(meal_value)
        "Love":
            "They are already making you happy, and deserve to be happy in turn. They will appreciate the attention."
            $ count = company_lunch_love(meal_value)
    $ mc.business.change_funds(count*meal_value*-10)
    $ mc.business.event_triggers_dict["company_breakfast_employees"] = (day + 6)
    call advance_time from company_breakfast_advance
    return

label company_lunch():
    $ department = all
    $ goal = None
    $ count = mc.business.employee_count
    $ meal_value = 1
    "You think that the company could use a catered lunch to reward them for their hard work."
    if count < 10:
        "There are only [count] employees, feeding them shouldn't be a problem."
    elif count > 10:
        "You currently have [count] employees, feeding all of them could be expensive."
    "There are a wide range of options for food. It all comes down to how much you want to pay, and how happy you want your employees to be."
    menu:
        "Pizza\n{color=#ff0000}{size=18}Costs: $10/each{/size}{/color}" if mc.business.funds > (10*count):
            "Free food is always good, surely they will be happy with something simple like pizza."
        "Sandwiches and sides\n{color=#ff0000}{size=18}Costs: $30/each{/size}{/color}" if mc.business.funds > (30*count):
            "Sandwiches are a good middle of the road option. Throw in some side dishes and they will be happy, right?"
            $ meal_value = 3
        "Lobster\n{color=#ff0000}{size=18}Costs: $50/each{/size}{/color}" if mc.business.funds > (50*count):
            "Only the best for your employees, money doesn't matter. This will make everyone happy."
            $ meal_value = 5
    "Now you just need a plan for what you want to improve about your employees."
    menu:
        "Performance":
            "Work is the reason they are here, it would be nice if they were a bit better at their jobs. Although learning can be boring."
            $ count = company_lunch_performance(meal_value)
        "Sluttiness":
            "They could stand to be more free spirited. Although you'll have to push boundaries."
            $ count = company_lunch_slut(meal_value)
        "Obedience":
            "They could stand to be more obedient. Although you'll have to be mean."
            $ count = company_lunch_obey(meal_value)
        "Love":
            "They are already making you happy, and deserve to be happy in turn. They will appreciate the attention."
            $ count = company_lunch_love(meal_value)
    $ mc.business.change_funds(count*meal_value*-10)
    $ mc.business.event_triggers_dict["company_lunch_employees"] = (day + 6)
    call advance_time from company_lunch_advance
    return


code:
init 3 python:
    def mansion_threesome_requirement():
        if len(known_people_at_location(mc.location)) > 1:
            return True
        return "Not enough girls around the mansion"

    def mansion_threesome_initialization(self):
        harem_mansion.add_action(self)
        return

    def get_threesome_partners(person, partner_list = []):
        temp_list = []
        for other_person in partner_list:
            if not town_relationships.get_relationship(person, other_person):
                if other_person.home == harem_mansion:
                    town_relationships.begin_relationship(person, other_person)
            if town_relationships.get_relationship(person, other_person):
                temp_relationship = town_relationships.get_relationship(person, other_person).type_b
                temp_list.append([str(other_person.name) + " " + str(other_person.last_name) + " (" + temp_relationship + ")", other_person])
        temp_list.append(["Back", "Back"])
        return temp_list

    mansion_threesome_action = ActionMod("Start threesome", mansion_threesome_requirement, "mansion_threesome_label",
        initialization = mansion_threesome_initialization, menu_tooltip = "Start a threesome with two of your harem members.", category="Home")

label mansion_threesome_label():
    $ scene_manager = Scene()
    "You take a look around your mansion to see which girls are around."
    call screen main_choice_display(build_menu_items([get_sorted_people_list(known_people_at_location(mc.location), "Start threesome with...", "Back")]))
    $ the_person = _return
    if not the_person == "Back":
        $ scene_manager.add_actor(the_person)
        mc.name "Hey [the_person.title], we should have a threesome."
        the_person "Sounds fun, who do you want to join us?"
        $ the_other_person = menu(get_threesome_partners(the_person, partner_list = (known_people_at_location(mc.location))))
        if not the_other_person == "Back":
            $ relationship = town_relationships.get_relationship(the_person, the_other_person).type_b
            mc.name "[the_other_person.fname]."
            if relationship in ["Mother", "Daughter", "Sister", "Aunt", "Cousin"]:
                if the_person.opinion.incest > 0:
                    the_person "Kinky, you know I like hooking up with my [relationship!l]!"
                else:
                    the_person "Seriously? Isn't that a little weird?"
            elif relationship in ["Rival", "Nemesis"]:
                the_person "Really? You know we don't exactly get along right?"
            else:
                the_person "Great, we always have fun together."
            $ scene_manager.add_actor(the_other_person)

            call start_threesome(the_person, the_other_person) from _call_start_threesome_mansion
        else:
            mc.name "Nevermind, I don't know who else to pick."
            the_person "Oh, okay. Well if you change your mind let me know!"
            "She smiles at you and waits to see if you need something else."
    else:
        "None of them interest you enough to do anything right now."
    $ scene_manager.clear_scene()
    return

license: unknown


code:
init 3 python:
    def weekly_redesign_requirement():
        if mc.business.is_open_for_business:
            if mc.business.event_triggers_dict.get("weekly_redesign", -7) < day - 7:
                if mc.business.funds > 500:
                    return True
                return "Requires $500"
            return "Only once per week"
        return "Wait for business to open"

    def weekly_distraction_requirement():
        if mc.business.is_open_for_business:
            if mc.business.event_triggers_dict.get("weekly_distraction", -7) < day - 7:
                return True
            return "Only once per week"
        return "Wait for business to open"

    def weekly_redesign_function():
        mc.business.attention -= builtins.int((3*mc.charisma) + (mc.focus) + (2*mc.market_skill))
        mc.business.change_funds(-500)
        mc.business.event_triggers_dict["weekly_redesign"] = day
        return

    def weekly_distraction_function():
        mc.business.attention -= builtins.int((3*mc.charisma) + (mc.focus) + (2*mc.int))
        mc.business.event_triggers_dict["weekly_distraction"] = day
        return

    def weekly_redesign_initialization(self):
        m_division.add_action(self)
        return

    def weekly_distraction_initialization(self):
        m_division.add_action(self)
        return

    weekly_redesign_action = ActionMod("Redesign logo {image=gui/heart/Time_Advance.png}\n{color=#ff0000}{size=18}Costs: $500{/size}{/color}", weekly_redesign_requirement, "weekly_redesign_label", initialization = weekly_redesign_initialization,
        menu_tooltip = "Spend time redesigning your packaging to confuse regulators.", category = "Business Action")
    weekly_distraction_action = ActionMod("Distract regulators {image=gui/heart/Time_Advance.png}", weekly_distraction_requirement, "weekly_distraction_label", initialization = weekly_distraction_initialization,
        menu_tooltip = "Call in false complaints about a competitor so regulators are too busy to bother you.", category = "Business Action")

label weekly_redesign_label():
    "Looking at the recent sales reports in the marketing department have you a bit concerned."
    if mc.business.attention > mc.business.max_attention:
        "You've been getting a lot of attention lately and it's a little surprising the regulators haven't been here yet."
    elif mc.business.attention > mc.business.max_attention*0.75:
        "You have a ton of attention at the moment. It is so bad that your next sale could be the one that draws the regulators' ire."
    elif mc.business.attention > mc.business.max_attention*0.5:
        "You have a bit of attention at the moment, and if you want to keep selling serums you probably need to do something about it."
    else:
        "You thankfully don't really have any attention at the moment, but you could still decrease it for safety before your next sale."
    "The unique packaging that signifies [b_name] products has helped you grow brand recognition, but in this situation that can be a double-edged sword."
    "If you were to work on a redesign of the logo it might dilute the regulators focus if the products don't look connected."
    "Since you slap on labels as part of the production process it shouldn't be too hard to get some new ones printed out, but it will be a bit expensive."
    menu:
        "Continue\n{color=#ff0000}{size=18}Costs: $500{/size}{/color}":
            "It's worth it."
            "You get to work and after a bit of time you have something you are happy with."
            "You send the files to the industrial printer in the production department along with an email to alert them about the new packaging."
            $ weekly_redesign_function()
            call advance_time from _call_advance_time_attention_drop
        "Never mind":
            "Actually, maybe it isn't worth it. You'll have to reconsider."
    return

label weekly_distraction_label():
    "Looking at the recent sales reports in the marketing department have you a bit concerned."
    if mc.business.attention > mc.business.max_attention:
        "You've been getting a lot of attention lately and it's a little surprising the regulators haven't been here yet."
    elif mc.business.attention > mc.business.max_attention*0.75:
        "You have a ton of attention at the moment. It is so bad that your next sale could be the one that draws the regulators ire."
    elif mc.business.attention > mc.business.max_attention*0.5:
        "You have a bit of attention at the moment, and if you want to keep selling serums you probably need to do something about it."
    else:
        "You thankfully don't really have any attention at the moment, but you could still decrease it for safety before your next sale."
    "You've been capturing more and more market share from your competitors, but that can be a double-edged sword."
    "As one of the leading companies in your industry you have more customers, but also draw more attention."
    "If you were to point the regulators towards one of your competitors they might be distracted enough to give you some breathing room."
    "You settle on a target, break out a few fake accents and get to work calling in complaints about their products."
    "By the time you are wrapping up your last call the agent on the other line assures you that they will send an investigator to check on them."
    $ weekly_distraction_function()
    call advance_time from _call_advance_time_attention_drop2
    return