protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!mFailure.TestBeforehand(Manager, Sim, Target)) { IncStat("Failure TestBeforehand Fail"); return(false); } if (!base.PrivateUpdate(frame)) { return(false); } Add(frame, new PropagateClanDelightScenario(Sim, Manager, Origin.FromBurglar), ScenarioResult.Start); if (Fail) { mFailure.Perform(this, frame, "Failure", Sim, Target); } else { mSuccess.Perform(this, frame, "Success", Sim, Target); } return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!mFailure.TestBeforehand(Manager, Sim, Target)) { IncStat("Failure TestBeforehand Fail"); return(false); } mFail = ((!string.IsNullOrEmpty(mAcceptanceScoring)) && (AddScoring("Acceptance", ScoringLookup.GetScore(mAcceptanceScoring, Target, Sim)) <= 0)); if (!mFail) { if (!base.PrivateUpdate(frame)) { return(false); } Add(frame, new PropagateClanDelightScenario(Sim, Manager, Origin.FromSocialization), ScenarioResult.Start); mSuccess.Perform(this, frame, "Success", Sim, Target); return(true); } else { mFailure.Perform(this, frame, "Failure", Sim, Target); return(false); } }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!base.PrivateUpdate(frame)) { return(false); } SimPersonality manager = Manager as SimPersonality; if (manager == null) { return(false); } manager.SetLeader(null, false); mSuccess.Perform(this, frame, "Success", Sim, Target); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!base.PrivateUpdate(frame)) { return(false); } HomeworkScenario.Perform(this, Sim, 100); HomeworkScenario.Perform(this, Target, 100); School school = Target.CareerManager.School; if (school != null) { school.mPerformance += 25; if (school.mPerformance > 100) { school.mPerformance = 100; } } mSuccess.Perform(this, frame, "Success", Sim, Target); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } Add(frame, new GoToHospitalScenario(Target, Sim, mInjuredStory, mType), ScenarioResult.Start); mSuccess.Perform(this, frame, "Success", Sim, Target); return(false); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!mFailure.TestBeforehand(Manager, Sim, Target)) { IncStat("Failure TestBeforehand Fail"); return(false); } if (!RandomUtil.RandomChance(mChance)) { IncStat("Chance Fail"); return(false); } SimPersonality clan = Personalities.GetPersonality(TargetFilter.Clan); if (clan == null) { clan = Manager as SimPersonality; } if (clan == null) { IncStat("Clan Missing"); return(false); } mFail = ((!string.IsNullOrEmpty(mAcceptanceScoring)) && (AddScoring("Acceptance", ScoringLookup.GetScore(mAcceptanceScoring, Target, Sim)) <= 0)); if (!mFail) { if (!clan.RemoveFromClan(Target)) { return(false); } mSuccess.Perform(this, frame, "Success", Sim, Target); } else { mFailure.Perform(this, frame, "Failure", Sim, Target); } return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Sim)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!base.PrivateUpdate(frame)) { return(false); } mSuccess.Perform(this, frame, "Success", Sim, Sim); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!mFailure.TestBeforehand(Manager, Sim, Target)) { IncStat("Failure TestBeforehand Fail"); return(false); } return(base.PrivateUpdate(frame)); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!base.PrivateUpdate(frame)) { return(false); } mNemesis = ExistingEnemyScenario.HandleNemesis(Sim, Target); mSuccess.Perform(this, frame, "Success", Sim, Target); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!mFailure.TestBeforehand(Manager, Sim, Target)) { IncStat("Failure TestBeforehand Fail"); return(false); } mFail = false; if (!string.IsNullOrEmpty(mAcceptanceScoring)) { mFail = (AddScoring(mAcceptanceScoring, Target) <= 0); } if (!mFail) { ExchangeSims(); bool result = base.PrivateUpdate(frame); ExchangeSims(); if (result) { mSuccess.Perform(this, frame, "Success", Sim, Target); } return(result); } else { mFailure.Perform(this, frame, "Failure", Sim, Target); return(true); } }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!mFailure.TestBeforehand(Manager, Sim, Target)) { IncStat("Failure TestBeforehand Fail"); return(false); } if (!base.PrivateUpdate(frame)) { return(false); } SimPersonality clan = Manager as SimPersonality; if (clan == null) { IncStat("No Clan"); return(false); } mFail = !clan.AddToClan(this, Target, mAllowSteal); if (mFail) { mFailure.Perform(this, frame, "Failure", Sim, Target); return(false); } else { mSuccess.Perform(this, frame, "Success", Sim, Target); return(true); } }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Sim)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!base.PrivateUpdate(frame)) { return(false); } Add(frame, new PropagateClanDelightScenario(Sim, Manager, Origin.FromCharity), ScenarioResult.Start); if (House != Sim.Household) { mSuccess.Perform(this, frame, "Success", Sim, SimTypes.HeadOfFamily(House)); } return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } if (!HomeworkScenario.Perform(this, Sim, 100)) { return(false); } base.PrivateUpdate(frame); HomeworkScenario.Perform(this, Target, -100); mSuccess.Perform(this, frame, "Success", Sim, Target); Add(frame, new SuccessScenario(), ScenarioResult.Start); return(true); }
protected override bool PrivateUpdate(ScenarioFrame frame) { if (!mSuccess.TestBeforehand(Manager, Sim, Target)) { IncStat("Success TestBeforehand Fail"); return(false); } List <Trait> choices = new List <Trait>(); foreach (Trait trait in Sim.TraitManager.List) { if (trait.IsReward) { continue; } if (trait.IsHidden) { continue; } choices.Add(trait); } Trait choice = null; while (choices.Count > 0) { choice = RandomUtil.GetRandomObjectFromList(choices); choices.Remove(choice); if (!Target.TraitManager.HasElement(choice.Guid)) { break; } choice = null; } if (choice != null) { Trait remove = null; choices.Clear(); foreach (Trait trait in Target.TraitManager.List) { if (trait.IsReward) { continue; } if (trait.IsHidden) { continue; } choices.Add(trait); } if (choices.Count > 0) { remove = RandomUtil.GetRandomObjectFromList(choices); } if (remove != null) { Target.TraitManager.RemoveElement(remove.Guid); Target.TraitManager.AddElement(choice.Guid); mTrait = choice.ToString(); mSuccess.Perform(this, frame, "Success", Sim, Target); return(true); } } return(false); }