public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var technique = player.Technique.GetValue<double>();
            double result;

            // arm strength modifier
            if (technique <= 30)
            {
                result = shaker.RandomRoll(15, 25);
            }
            else if (technique > 30 && technique <= 60)
            {
                result = shaker.RandomRoll(25, 30);
            }
            else if (technique > 60 && technique <= 75)
            {
                result = shaker.RandomRoll(30, 40);
            }
            else if (technique > 75 && technique <= 90)
            {
                result = shaker.RandomRoll(40, 50);
            }
            else
            {
                result = shaker.RandomRoll(50, 60);
            }

            SetValue(result);
        }
Esempio n. 2
0
 protected Dice(IDiceAttribute dice)
     : this()
 {
     MinValue = dice.Min;
     MaxValue = dice.Max;
     Volatility = (double)dice.Volatility;
 }
Esempio n. 3
0
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var handSize = player.Hand.GetValue<double>();
            var coordination = player.Coordination.GetValue<double>();
            var value = shaker.Roll((dynamic)diceAttribute);

            // coordination modifier
            if (coordination <= 30)
            {
                _coordinationModifier = shaker.RandomRoll(-.4, -.3);
            }
            else if (coordination > 30 && coordination <= 60)
            {
                _coordinationModifier = shaker.RandomRoll(-.3, -.2);
            }
            else if (coordination > 60 && coordination <= 75)
            {
                _coordinationModifier = shaker.RandomRoll(-.1, 0);
            }
            else if (coordination > 75 && coordination <= 90)
            {
                _coordinationModifier = shaker.RandomRoll(.1, .19);
            }
            else
            {
                _coordinationModifier = shaker.RandomRoll(.19, .25);
            }

            // handSize modifier
            if (handSize <= 5)
            {
                _handSizeModifier = shaker.RandomRoll(-.2, 0);
            }
            else if (handSize > 5 && handSize <= 5.5)
            {
                _handSizeModifier = shaker.RandomRoll(-.12, 0);
            }
            else if (handSize > 5.5 && handSize <= 6)
            {
                _handSizeModifier = shaker.RandomRoll(0, .01);
            }
            else if (handSize > 6 && handSize <= 7)
            {
                _handSizeModifier = shaker.RandomRoll(.06, .1);
            }
            else if (handSize > 7 && handSize <= 8)
            {
                _handSizeModifier = shaker.RandomRoll(.1, .19);
            }
            else
            {
                _handSizeModifier = shaker.RandomRoll(.19, 1);
            }

            var result = _calculateValue(player, value);

            SetValue(result);
        }
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var roll = shaker.RandomRoll(-730, 730);
            var date = DateTime.Now.AddYears(-10).AddDays(-180);

            date = date.AddDays(roll);

            SetValue(date);
        }
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var armStrength = player.ArmStrength.GetValue<double>();
            var legStrength = player.LegStrength.GetValue<double>();
            var value = shaker.Roll((dynamic)diceAttribute);

            // arm strength modifier
            if (armStrength <= 30)
            {
                _armStrengthModifier = shaker.RandomRoll(0, .15);
            }
            else if (armStrength > 30 && armStrength <= 60)
            {
                _armStrengthModifier = shaker.RandomRoll(0, .15);
            }
            else if (armStrength > 60 && armStrength <= 75)
            {
                _armStrengthModifier = shaker.RandomRoll(0, .15);
            }
            else if (armStrength > 75 && armStrength <= 90)
            {
                _armStrengthModifier = shaker.RandomRoll(-.16, 0);
            }
            else
            {
                _armStrengthModifier = shaker.RandomRoll(-.22, -.12);
            }

            // leg strength modifier
            if (legStrength <= 30)
            {
                _legStrengthModifier = shaker.RandomRoll(0, .15);
            }
            else if (legStrength > 30 && legStrength <= 60)
            {
                _legStrengthModifier = shaker.RandomRoll(0, .15);
            }
            else if (legStrength > 60 && legStrength <= 75)
            {
                _legStrengthModifier = shaker.RandomRoll(0, .15);
            }
            else if (legStrength > 75 && legStrength <= 90)
            {
                _legStrengthModifier = shaker.RandomRoll(-.16, 0);
            }
            else
            {
                _legStrengthModifier = shaker.RandomRoll(-.22, -.12);
            }

            var result = _calculateValue(player, value);

            SetValue(result);
        }
Esempio n. 6
0
        // http://hypertextbook.com/facts/2006/bodyproportions.shtml
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var attribute = (ProportionalityDiceAttribute)diceAttribute;
            var basedOnProperty =
                player.GetType().GetProperties().First(w => w.PropertyType == attribute.ProportionalToType);
            var proportionalToValue = (PlayerAttribute)basedOnProperty.GetValue(player);
            const double min = .996d;
            const double max = 1.8d;

            var value = shaker.RandomRoll(min, max);
            var result = Convert.ToDouble(proportionalToValue.Value) * value;

            SetValue(result);
        }
Esempio n. 7
0
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var baseline = player.DriveBaseline;
            double value;

            // arm strength modifier
            if (baseline <= 15)
            {
                value = shaker.RandomRoll(10, 20);
            }
            else if (baseline > 15 && baseline <= 30)
            {
                value = shaker.RandomRoll(20, 30);
            }
            else if (baseline > 30 && baseline <= 45)
            {
                value = shaker.RandomRoll(30, 40);
            }
            else if (baseline > 45 && baseline <= 60)
            {
                value = shaker.RandomRoll(40, 50);
            }
            else if (baseline > 60 && baseline <= 75)
            {
                value = shaker.RandomRoll(50, 75);
            }
            else if (baseline > 75 && baseline <= 85)
            {
                value = shaker.RandomRoll(75, 85);
            }
            else if (baseline > 85 && baseline <= 90)
            {
                value = shaker.RandomRoll(85, 90);
            }
            else
            {
                value = shaker.RandomRoll(90, 100);
            }

            SetValue(value);
        }
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var twitch = player.MuscleFibreTwitch.GetValue<double>();
            var strength = player.LegStrength.GetValue<double>();
            var flexibility = player.Flexibility.GetValue<double>();
            var value = shaker.Roll((dynamic)diceAttribute);

            // strength modifier
            if (strength <= 30)
            {
                _strengthModifier = shaker.RandomRoll(-.3, -.2);
            }
            else if (strength > 30 && strength <= 60)
            {
                _strengthModifier = shaker.RandomRoll(-.15, -.05);
            }
            else if (strength > 60 && strength <= 75)
            {
                _strengthModifier = shaker.RandomRoll(.09, .15);
            }
            else if (strength > 75 && strength <= 90)
            {
                _strengthModifier = shaker.RandomRoll(.15, .19);
            }
            else
            {
                _strengthModifier = shaker.RandomRoll(.19, .25);
            }

            // twitch modifier
            if (twitch <= 30)
            {
                _twitchModifier = shaker.RandomRoll(-.12, 0);
            }
            else if (twitch > 30 && twitch <= 60)
            {
                _twitchModifier = shaker.RandomRoll(-.8, 0);
            }
            else if (twitch > 60 && twitch <= 75)
            {
                _twitchModifier = shaker.RandomRoll(.03, .06);
            }
            else if (twitch > 75 && twitch <= 90)
            {
                _twitchModifier = shaker.RandomRoll(.06, .09);
            }
            else
            {
                _twitchModifier = shaker.RandomRoll(.09, .15);
            }

            // How much of the flexibility should we take
            if (flexibility <= 30)
            {
                _flexibilityModifier = shaker.RandomRoll(-.2, 0);
            }
            else if (flexibility > 30 && flexibility <= 60)
            {
                _flexibilityModifier = shaker.RandomRoll(-.1, 0);
            }
            else if (flexibility > 60 && flexibility <= 75)
            {
                _flexibilityModifier = shaker.RandomRoll(0, .05);
            }
            else if (flexibility > 75 && flexibility <= 90)
            {
                _flexibilityModifier = shaker.RandomRoll(.05, .08);
            }
            else
            {
                _flexibilityModifier = shaker.RandomRoll(.08, .12);
            }

            var result = _calculateValue(player, value);

            SetValue(result);
        }
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var mechanics = player.ThrowingMechanics.GetValue<double>();
            var coordination = player.Coordination.GetValue<double>();
            double value;

            // coordination modifier
            if (coordination <= 30)
            {
                value = 5;
                _coordinationModifier = shaker.RandomRoll(-.5, -.3);
            }
            else if (coordination > 30 && coordination <= 60)
            {
                value = 8;
                _coordinationModifier = shaker.RandomRoll(-.3, -.1);
            }
            else if (coordination > 60 && coordination <= 75)
            {
                value = shaker.RandomRoll(20, 30);
                _coordinationModifier = shaker.RandomRoll(-.1, .1);
            }
            else if (coordination > 75 && coordination <= 90)
            {
                value = shaker.RandomRoll(20, 50);
                _coordinationModifier = shaker.RandomRoll(.1, .15);
            }
            else
            {
                value = shaker.RandomRoll(20, 60);
                _coordinationModifier = shaker.RandomRoll(.15, .25);
            }

            // handSize modifier
            if (mechanics <= 30)
            {
                _mechanicsModifier = shaker.RandomRoll(-.6, -.5);
            }
            else if (mechanics > 30 && mechanics <= 50)
            {
                _mechanicsModifier = shaker.RandomRoll(-.4, -.3);
            }
            else if (mechanics > 50 && mechanics <= 60)
            {
                _mechanicsModifier = shaker.RandomRoll(-.3, -.2);
            }
            else if (mechanics > 60 && mechanics <= 70)
            {
                _mechanicsModifier = shaker.RandomRoll(-.1, 0);
            }
            else if (mechanics > 70 && mechanics <= 80)
            {
                _mechanicsModifier = shaker.RandomRoll(0, .1);
            }
            else if (mechanics > 80 && mechanics <= 90)
            {
                _mechanicsModifier = shaker.RandomRoll(.1, .13);
            }
            else
            {
                _mechanicsModifier = shaker.RandomRoll(.15, .19);
            }

            var result = _calculateValue(player, value);

            SetValue(result);
        }
        public override void Create(Player player, IDiceShaker shaker, IDiceAttribute diceAttribute)
        {
            var mechanics = player.ThrowingMechanics.GetValue<double>();
            var coordination = player.Coordination.GetValue<double>();
            var armStrength = player.ArmStrength.GetValue<double>();
            var value = 30d;

            // armStrength modifier
            if (armStrength <= 30)
            {
                _armStrengthModifier = shaker.RandomRoll(-.2, -.1);
            }
            else if (armStrength > 30 && armStrength <= 40)
            {
                _armStrengthModifier = shaker.RandomRoll(-.1, -.05);
            }
            else if (armStrength > 40 && armStrength <= 50)
            {
                _armStrengthModifier = shaker.RandomRoll(-.05, 0);
            }
            else if (armStrength > 60 && armStrength <= 75)
            {
                _armStrengthModifier = shaker.RandomRoll(0, .1);
            }
            else if (armStrength > 75 && armStrength <= 90)
            {
                _armStrengthModifier = shaker.RandomRoll(.1, .15);
            }
            else
            {
                _armStrengthModifier = shaker.RandomRoll(.15, .25);
            }

            // coordination modifier
            if (coordination <= 30)
            {
                _coordinationModifier = shaker.RandomRoll(-.3, -.1);
            }
            else if (coordination > 30 && coordination <= 60)
            {
                _coordinationModifier = shaker.RandomRoll(-.1, -.05);
            }
            else if (coordination > 60 && coordination <= 75)
            {
                _coordinationModifier = shaker.RandomRoll(-.05, .1);
            }
            else if (coordination > 75 && coordination <= 90)
            {
                _coordinationModifier = shaker.RandomRoll(.1, .15);
            }
            else
            {
                _coordinationModifier = shaker.RandomRoll(.15, .25);
            }

            // mechanics modifier
            if (mechanics <= 30)
            {
                _mechanicsModifier = shaker.RandomRoll(-.6, -.5);
            }
            else if (mechanics > 30 && mechanics <= 50)
            {
                _mechanicsModifier = shaker.RandomRoll(-.4, -.3);
            }
            else if (mechanics > 50 && mechanics <= 60)
            {
                _mechanicsModifier = shaker.RandomRoll(-.3, -.2);
            }
            else if (mechanics > 60 && mechanics <= 70)
            {
                _mechanicsModifier = shaker.RandomRoll(-.1, 0);
            }
            else if (mechanics > 70 && mechanics <= 80)
            {
                _mechanicsModifier = shaker.RandomRoll(0, .1);
            }
            else if (mechanics > 80 && mechanics <= 90)
            {
                _mechanicsModifier = shaker.RandomRoll(.1, .13);
            }
            else
            {
                _mechanicsModifier = shaker.RandomRoll(.15, .19);
            }

            var result = _calculateValue(player, value);

            SetValue(result);
        }