protected override bool PrivateUpdate(ScenarioFrame frame) { if ((mMoveInWith == null) || (!House.Contains(mMoveInWith))) { mMoveInWith = SimTypes.HeadOfFamily(House); } List <SimDescription> movers = GetMovers(House, true); AddStat("Movers", movers.Count); foreach (SimDescription sim in movers) { int funds = 0, debt = 0; if ((!SimTypes.IsSpecial(sim)) && (!Household.RoommateManager.IsNPCRoommate(sim))) { int count = HouseholdsEx.NumHumans(sim.Household); if (count > 0) { funds = sim.FamilyFunds / count; Money.AdjustFunds(sim, "MoveOut", -funds); } if (count == 1) { debt += GetValue <DebtOption, int>(sim.Household); SetValue <DebtOption, int>(sim.Household, 0); funds += Households.Assets(sim); } } AddStat("New Funds", funds); Money.AdjustFunds(House, "MoveIn", funds); AddValue <DebtOption, int>(House, debt); Households.MoveSim(sim, House); } mMovers = movers; return(true); }
protected void AdjustFundsMoveInLot(SimDescription sim, Dictionary <Household, bool> oldHouses) { if (!SimTypes.IsSpecial(sim)) { if (!oldHouses.ContainsKey(sim.Household)) { oldHouses.Add(sim.Household, true); AddStat("Old Home Funds", sim.FamilyFunds); } if (HouseholdsEx.NumHumans(sim.Household) > 0) { int funds = sim.Household.FamilyFunds / HouseholdsEx.NumHumans(sim.Household); AddStat("Transfer", funds); Money.AdjustFunds(House, "MoveIn", funds); Money.AdjustFunds(sim, "MoveOut", -funds); AddStat("Transfer Remainder", sim.FamilyFunds); if (HouseholdsEx.NumHumans(sim.Household) == 1) { Lots.PackupVehicles(sim.CreatedSim, false); int debt = GetValue <DebtOption, int>(sim.Household); AddValue <DebtOption, int>(House, debt); SetValue <DebtOption, int>(sim.Household, 0); AddStat("Debt Conversion", debt); funds = Households.Assets(sim); Money.AdjustFunds(House, "SellLot", funds); AddStat("Total Conversion", funds); } } } }