Exemple #1
0
        public bool CreateValue(HexValue hexValue)
        {
            _hexValue = hexValue;

            if (_hexValue == null)
            {
                Console.WriteLine("HexValue is null, can\'t calculate value without.");
                return(false);
            }

            if (!HexHashUtil.TryHexPosConversion(Position, Size, Salted ? hexValue.Salted : hexValue.UnSalted, out var result))
            {
                Console.WriteLine($"CreateValue, failed trying to convert hex position.{Position}, {Size}, {Salted}");
                return(false);
            }

            var modValue = result % (Creation - MinRange) + MinRange;

            if (Math.Abs(modValue % 1) > Double.Epsilon)
            {
                Console.WriteLine($"CreateValue, failed to cast double in same int value.{modValue},{(int)modValue}");
                return(false);
            }

            _value = (int)modValue;
            return(true);
        }
Exemple #2
0
        public bool CreateValue(HexValue hexValue)
        {
            this._hexValue = hexValue;

            if (this._hexValue == null)
            {
                Console.WriteLine($"HexValue is null, can't calculate value without.");
                return(false);
            }

            if (!HexHashUtil.TryHexPosConversion(Position, Size, Salted? hexValue.Salted : hexValue.UnSalted, out double result))
            {
                Console.WriteLine($"CreateValue, failed trying to convert hex position.{Position}, {Size}, {Salted}");
                return(false);
            }

            double modValue = (result % (Creation - MinRange)) + MinRange;

            if (modValue % 1 != 0)
            {
                Console.WriteLine($"CreateValue, failed to cast double in same int value.{modValue},{(int)modValue}");
                return(false);
            }

            value = (int)modValue;
            return(true);
        }
Exemple #3
0
        public Mogwai(string key, Dictionary <double, Shift> shifts)
        {
            Key    = key;
            Shifts = shifts;

            currentShift = shifts.Values.First();

            LevelShifts.Add(currentShift.Height); // adding initial creation level up

            blockHeight = currentShift.Height;
            Pointer     = currentShift.Height;

            // create appearance
            var hexValue = new HexValue(currentShift);

            Name  = NameGen.GenerateName(hexValue);
            Body  = new Body(hexValue);
            Coat  = new Coat(hexValue);
            Stats = new Stats(hexValue);

            // create abilities
            int[] rollEvent = new int[] { 4, 6, 3 };
            Gender       = currentShift.MogwaiDice.Roll(2, -1);
            Strength     = currentShift.MogwaiDice.Roll(rollEvent);
            Dexterity    = currentShift.MogwaiDice.Roll(rollEvent);
            Constitution = currentShift.MogwaiDice.Roll(rollEvent);
            Inteligence  = currentShift.MogwaiDice.Roll(rollEvent);
            Wisdom       = currentShift.MogwaiDice.Roll(rollEvent);
            Charisma     = currentShift.MogwaiDice.Roll(rollEvent);

            BaseSpeed = 30;

            NaturalArmor = 0;
            SizeType     = SizeType.MEDIUM;

            BaseAttackBonus = new int[] { 0 };

            // create experience
            Experience = new Experience(currentShift);

            // add simple rapier as weapon
            Equipment.PrimaryWeapon = Weapons.Rapier;

            // add simple rapier as weapon
            Equipment.Armor = Armors.StuddedLeather;

            HitPointDice     = 8;
            CurrentHitPoints = MaxHitPoints;
        }
Exemple #4
0
 public Stats(HexValue hexValue)
 {
     All.ForEach(p => p.CreateValue(hexValue));
 }
Exemple #5
0
 public AttributBuilder SetHexValue(HexValue hexValue)
 {
     HexValue = hexValue;
     return(this);
 }
Exemple #6
0
 public Body(HexValue hexValue)
 {
     All.ForEach(p => p.CreateValue(hexValue));
 }
Exemple #7
0
 public AttributBuilder HexValue(HexValue hexValue)
 {
     this.hexValue = hexValue;
     return(this);
 }
Exemple #8
0
 public Coat(HexValue hexValue)
 {
     All.ForEach(p => p.CreateValue(hexValue));
 }