Ejemplo n.º 1
0
        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();
                }
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        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();
        }