private new void ApplySurgery(Hospital.SurgeryTypes type, int cost, float failChance, string failKey, string successKey) { if (Actor.FamilyFunds > cost) { Actor.ModifyFunds(-cost); if (!RandomUtil.RandomChance01(failChance)) { if (StartPlasticSurgeryCAS(Actor, type)) { Actor.ShowTNSAndPlayStingIfSelectable(Common.LocalizeEAString(Actor.IsFemale, successKey, new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, Target.ObjectId, ObjectGuid.InvalidObjectGuid, "sting_plastic_surgery_success"); mReaction = Reaction.Happy; switch (type) { case Hospital.SurgeryTypes.PlasticSurgeryFaceCheap: case Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive: Actor.SimDescription.PreSurgeryFacialBlends = null; return; case Hospital.SurgeryTypes.PlasticSurgeryBodyCheap: case Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive: Actor.SimDescription.PreSurgeryBodyFitness = -1f; Actor.SimDescription.PreSurgeryBodyWeight = -1f; return; case Hospital.SurgeryTypes.PlasticSurgeryCorrectiveFace: case Hospital.SurgeryTypes.PlasticSurgeryCorrectiveBody: return; } } else { Actor.ModifyFunds(cost); Actor.ShowTNSIfSelectable(TNSNames.PlasticSurgeryCancelledTNS, Actor, null, new object[] { Actor }); mReaction = Reaction.None; } } else { switch (type) { case Hospital.SurgeryTypes.PlasticSurgeryFaceCheap: case Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive: OutfitUtils.RandomizeFace(Actor); break; case Hospital.SurgeryTypes.PlasticSurgeryBodyCheap: case Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive: OutfitUtils.RandomizeBody(Actor); break; } Actor.ShowTNSAndPlayStingIfSelectable(Common.LocalizeEAString(Actor.IsFemale, failKey, new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessageNegative, Target.ObjectId, ObjectGuid.InvalidObjectGuid, "sting_plastic_surgery_fail"); Actor.BuffManager.AddElement(BuffNames.Embarrassed, Origin.FromPlasticSurgery); mReaction = Reaction.Sad; } } }
public static bool StartPlasticSurgeryCAS(Sim sim, Hospital.SurgeryTypes type) { CASChangeReporter.Instance.ClearChanges(); SimDescription simDescription = sim.SimDescription; if (simDescription == null) { throw new Exception("EditSimInCAS: sim doesn't have a description!"); } switch (sim.CurrentOutfitCategory) { case OutfitCategories.Everyday: case OutfitCategories.Formalwear: case OutfitCategories.Sleepwear: case OutfitCategories.Swimwear: case OutfitCategories.Athletic: break; default: SimpleMessageDialog.Show(Cheats.LocalizeString("EditSimInCAS", new object[0x0]), Cheats.LocalizeString("CommonOutfitCategoryRequired", new object[0x0]), ModalDialog.PauseMode.PauseSimulator); return(false); } switch (type) { case Hospital.SurgeryTypes.PlasticSurgeryFaceCheap: case Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive: new Sims.Advanced.SurgeryFace().Perform(new GameHitParameters <GameObject>(sim, sim, GameObjectHit.NoHit)); break; case Hospital.SurgeryTypes.PlasticSurgeryBodyCheap: case Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive: new Sims.Advanced.SurgeryBody().Perform(new GameHitParameters <GameObject>(sim, sim, GameObjectHit.NoHit)); break; default: throw new Exception("PlasticSurgery: Option not defined!"); } while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode) { SpeedTrap.Sleep(); } bool flag = !CASChangeReporter.Instance.CasCancelled; CASChangeReporter.Instance.ClearChanges(); return(flag); }
public Definition(Hospital.SurgeryTypes surgeryType, string[] path) : base(surgeryType, path) { }