private void ApplyPregnancyRiskConsequence() { if (!PregnancyRisk) { return; } if (ValueIsPercentage) { if (TalesRandom.EvalPercentage(int.Parse(Value))) { MakePregnant(); } return; } if (string.IsNullOrEmpty(Value) && RandomEnd > 0) { if (TalesRandom.EvalPercentageRange(RandomStart, RandomEnd)) { MakePregnant(); } } }
private void ApplyPregnancyRiskConsequence() { if (!Outcome.PregnancyRisk) { return; } var age = GameData.Instance.GameContext.Heroes.Player.Age; if (age < 12) { return; } if (Numbers.ValueIsPercentage) { if (TalesRandom.EvalPercentage(int.Parse(Numbers.Value))) { MakePregnant(); } return; } if (string.IsNullOrEmpty(Numbers.Value) && Numbers.RandomEnd > 0) { if (TalesRandom.EvalPercentageRange(Numbers.RandomStart, Numbers.RandomEnd)) { MakePregnant(); return; } } if (age < 30) { if (TalesRandom.EvalPercentage(15)) { MakePregnant(); } return; } if (TalesRandom.EvalPercentage(15 - (age * 0.25f))) { MakePregnant(); } }
private void PlayTriggers() { var interval = _choice.Triggers.Sum(trigger => trigger.ChanceToTrigger); foreach (var trigger in _choice.Triggers) { var test = TalesRandom.EvalPercentage((trigger.ChanceToTrigger * interval) / 100); if (!test) { continue; } new MenuBroker().GotoMenuFor(trigger.Link); return; } PlayHighestChanceToTrigger(); }