public static void AfterMoochMoney(Sim actor, Sim target, float moochSkillPoints, int moochSkillLevel) { try { Skill skill = actor.SkillManager.AddElement(SkillNames.Mooch); if (actor.SimDescription.Child) { skill.AddSkillPointsLevelClamped(moochSkillPoints, TraitTuning.MoochTraitChildSkill); } else if (actor.SimDescription.Teen) { skill.AddSkillPointsLevelClamped(moochSkillPoints, TraitTuning.MoochTraitTeenSkill); } else { skill.AddPoints(moochSkillPoints); } int delta = Mooch.MoochAmounts[moochSkillLevel]; if (RandomUtil.RandomChance01(TraitTuning.MoochTraitMoneyQuadChance)) { delta *= 0x4; } else if (RandomUtil.RandomChance01(TraitTuning.MoochTraitMoneyDoubleChance)) { delta *= 0x2; } delta = (int)(delta * RandomUtil.RandomFloatGaussianDistribution(TraitTuning.MoochTraitMoneyRandomBegin, TraitTuning.MoochTraitMoneyRandomEnd)); NRaas.StoryProgression.Main.Money.AdjustFunds(target.SimDescription, "GiveAway", -delta); NRaas.StoryProgression.Main.Money.AdjustFunds(actor.SimDescription, "GiveAway", delta); actor.ShowTNSIfSelectable(SocialCallback.LocalizeString(actor.IsFemale, "MoochMoney", new object[] { actor, delta, target }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, target.ObjectId); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(actor, target, e); } }
public static void OnMoveInWith(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i) { try { bool isFemale = actor.IsFemale && target.IsFemale; if (actor.Household == target.Household) { if (actor.IsSelectable && Household.RoommateManager.IsNPCRoommate(target)) { Household.RoommateManager.MakeRoommateSelectable(target.SimDescription); } if (target.IsSelectable && Household.RoommateManager.IsNPCRoommate(actor)) { Household.RoommateManager.MakeRoommateSelectable(actor.SimDescription); } actor.ShowTNSIfSelectable(SocialCallback.LocalizeString(isFemale, "MarriedSameHousehold", new object[] { actor, target }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, actor.ObjectId); } else { int value = RandomUtil.GetInt(MovingSituation.kMarriageGiftAndTaxBenefits[0x0], MovingSituation.kMarriageGiftAndTaxBenefits[0x1]); if (actor.IsSelectable || target.IsSelectable) { MovingDialogEx.Show(new GameplayMovingModelEx(actor, target)); } actor.ModifyFunds(value); actor.ShowTNSIfSelectable(SocialCallback.LocalizeString(isFemale, "MarriedDifferentHouseholds", new object[] { value, actor, target }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, actor.ObjectId); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(actor, target, e); } }