Esempio n. 1
0
 public override void OnActivate()
 {
     PropertyHelper.SetProperty("ModActive", true);
 }
Esempio n. 2
0
 public override void OnDeactivate()
 {
     PropertyHelper.SetProperty("ModActive", false);
 }
Esempio n. 3
0
        private System.Collections.IEnumerator CustomUpdate()
        {
            while (true)
            {
                yield return(new WaitForSeconds(1f));

                if (!PropertyHelper.GetProperty("ModActive") || !isActiveAndEnabled || !PropertyHelper.DoStuff)
                {
                    yield break;
                }

                if (Input.GetKey(KeyCode.F1) && !Main.IsShowed)
                {
                    Main.SpawnWindow();
                }

                if (Input.GetKey(KeyCode.F2) && Main.IsShowed)
                {
                    Main.SpawnWindow();
                }

                if (PropertyHelper.GetProperty("FreeStaff"))
                {
                    settings.StaffSalaryDue = 0f;
                }

                foreach (Furniture item in settings.sRoomManager.AllFurniture)
                {
                    if (PropertyHelper.GetProperty("NoiseReduction"))
                    {
                        item.ActorNoise       = 0f;
                        item.EnvironmentNoise = 0f;
                        item.FinalNoise       = 0f;
                        item.Noisiness        = 0;
                    }

                    if (PropertyHelper.GetProperty("NoWaterElectricity"))
                    {
                        item.Water   = 0;
                        item.Wattage = 0;
                    }
                }

                for (int i = 0; i < settings.sRoomManager.Rooms.Count; i++)
                {
                    Room room = settings.sRoomManager.Rooms[i];

                    if (PropertyHelper.GetProperty("CleanRooms"))
                    {
                        room.ClearDirt();
                    }

                    if (PropertyHelper.GetProperty("TemperatureLock"))
                    {
                        room.Temperature = 21.4f;
                    }

                    if (PropertyHelper.GetProperty("FullEnvironment"))
                    {
                        room.FurnEnvironment = 4;
                    }

                    if (PropertyHelper.GetProperty("FullRoomBrightness"))
                    {
                        room.IndirectLighting = 8;
                    }
                }

                for (int i = 0; i < settings.sActorManager.Actors.Count; i++)
                {
                    Actor    act      = settings.sActorManager.Actors[i];
                    Employee employee = settings.sActorManager.Actors[i].employee;

                    if (PropertyHelper.GetProperty("DisableSkillDecay"))
                    {
                        for (int index = 0; index < 5; index++)
                        {
                            if (employee.IsRole((Employee.EmployeeRole)index))
                            {
                                employee.ChangeSkillDirect((Employee.EmployeeRole)index, 1f);
                                foreach (var specialization in settings.Specializations)
                                {
                                    employee.AddToSpecialization(Employee.EmployeeRole.Designer, specialization, 1f, 0, true);
                                    employee.AddToSpecialization(Employee.EmployeeRole.Artist, specialization, 1f, 0, true);
                                    employee.AddToSpecialization(Employee.EmployeeRole.Programmer, specialization, 1f, 0, true);
                                }
                            }
                        }
                    }

                    if (PropertyHelper.GetProperty("LockAge"))
                    {
                        act.employee.AgeMonth = (int)act.employee.Age * 12; //20*12
                        act.UpdateAgeLook();
                    }

                    if (PropertyHelper.GetProperty("NoStress"))
                    {
                        act.employee.Stress = 1;
                    }

                    if (PropertyHelper.GetProperty("FullEfficiency"))
                    {
                        if (act.employee.RoleString.Contains("Lead"))
                        {
                            act.Effectiveness = PropertyHelper.GetProperty("UltraEfficiency") ? 20 : 4;
                        }
                        else
                        {
                            act.Effectiveness = PropertyHelper.GetProperty("UltraEfficiency") ? 10 : 2;
                        }
                    }

                    if (PropertyHelper.GetProperty("FullSatisfaction"))
                    {
                        //act.ChangeSatisfaction(10, 10, Employee.Thought.LoveWork, Employee.Thought.LikeTeamWork, 0);
                        employee.JobSatisfaction     = 2f;
                        act.employee.JobSatisfaction = 2f;
                    }

                    if (PropertyHelper.GetProperty("NoNeeds"))
                    {
                        act.employee.Bladder = 1;
                        act.employee.Hunger  = 1;
                        act.employee.Energy  = 1;
                        act.employee.Social  = 1;
                    }

                    if (PropertyHelper.GetProperty("FreeEmployees"))
                    {
                        act.employee.Salary = 0;
                        act.NegotiateSalary = false;
                        act.IgnoreOffSalary = true;
                    }

                    if (PropertyHelper.GetProperty("NoiseReduction"))
                    {
                        act.Noisiness = 0;
                    }

                    if (PropertyHelper.GetProperty("NoVacation"))
                    {
                        act.VacationMonth = SDateTime.NextMonth(24);
                    }
                }

                LoanWindow.factor     = 250000;
                GameSettings.MaxFloor = 75; //10 default
                //settings.scenario.MaxFloor = 75;
                CourierAI.MaxBoxes = PropertyHelper.GetProperty("IncreaseCourierCapacity") ? 108 : 54;
                Server.ISPCost     = PropertyHelper.GetProperty("ReduceISPCost") ? 25f : 50f;

                if (PropertyHelper.GetProperty("AutoDistributionDeals"))
                {
                    foreach (var x in settings.simulation.Companies)
                    {
                        float m = x.Value.GetMoneyWithInsurance(true);

                        if (m < 10000000f)
                        {
                            x.Value.DistributionDeal = 0.05f;
                        }
                        else if (m > 10000000f && m < 100000000f)
                        {
                            x.Value.DistributionDeal = 0.10f;
                        }
                        else if (m > 100000000f && m < 250000000f)
                        {
                            x.Value.DistributionDeal = 0.15f;
                        }
                        else if (m > 250000000f && m < 500000000f)
                        {
                            x.Value.DistributionDeal = 0.20f;
                        }
                        else if (m > 500000000f && m < 1000000000f)
                        {
                            x.Value.DistributionDeal = 0.25f;
                        }
                        else if (m > 1000000000f)
                        {
                            x.Value.DistributionDeal = 0.30f;
                        }
                    }
                }

                if (PropertyHelper.GetProperty("MoreHostingDeals"))
                {
                    int inGameHour = TimeOfDay.Instance.Hour;

                    if ((inGameHour == 9 || inGameHour == 15) && PropertyHelper.DealIsPushed == false)
                    {
                        PushDeal();
                    }
                    else if (inGameHour != 9 && inGameHour != 15 && PropertyHelper.DealIsPushed)
                    {
                        PropertyHelper.DealIsPushed = false;
                    }

                    if (PropertyHelper.RewardIsGained == false && inGameHour == 12)
                    {
                        PushReward();
                    }
                    else if (inGameHour != 12 && PropertyHelper.RewardIsGained)
                    {
                        PropertyHelper.RewardIsGained = false;
                    }
                }

                if (PropertyHelper.GetProperty("IncreasePrintSpeed"))
                {
                    for (int i = 0; i < settings.ProductPrinters.Count; i++)
                    {
                        settings.ProductPrinters[i].PrintSpeed = 2f;
                    }
                }

                //add printspeed and printprice when it's disabled (else) TODO
                if (PropertyHelper.GetProperty("FreePrint"))
                {
                    settings.ProductPrinters.ForEach(p => p.PrintPrice = 0f);
                }

                if (PropertyHelper.GetProperty("IncreaseBookshelfSkill"))
                {
                    foreach (var bookshelf in settings.sRoomManager.AllFurniture)
                    {
                        if (bookshelf.Type != "Bookshelf")
                        {
                            continue;
                        }

                        foreach (var x in bookshelf.AuraValues)
                        {
                            bookshelf.AuraValues[1] = 0.75f;
                        }
                    }
                }

                //else 0.25 TODO
                if (PropertyHelper.GetProperty("NoMaintenance"))
                {
                    foreach (Furniture furniture in settings.sRoomManager.AllFurniture)
                    {
                        switch (furniture.Type)
                        {
                        case "Server":
                        case "Computer":
                        case "Product Printer":
                        case "Ventilation":
                        case "Radiator":
                        case "Lamp":
                        case "Toilet":
                            furniture.upg.Quality = 1f;
                            break;
                        }
                    }
                }

                if (PropertyHelper.GetProperty("NoSickness"))
                {
                    settings.sActorManager.Actors.ForEach(actor => actor.SickDays = 0);
                    //settings.Insurance.SickRatio = 0f;
                }
            }
        }