Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        strengthImage.fillAmount = 0;
        Strength     myStrength = new Strength();
        Dexterity    myDext     = new Dexterity();
        Intelligence myIntel    = new Intelligence();

        StrengthButton.onClick.AddListener(() =>
        {
            Debug.Log("Strength added");
            int StrAdd = myStrength.Give(StatIncrease);
            Debug.Log($"Strengh is {StrAdd}");
            strengthImage.fillAmount = Map((float)StrAdd, 0, 10, 0, 1);

            int DexTake = myDext.Take(StatDecrease);
            Debug.Log($"Dexterity is {DexTake}");
            DextImage.fillAmount = Map((float)DexTake, 0, 10, 0, 1);
        });
        DextButton.onClick.AddListener(() =>
        {
            int DexAdd = myDext.Give(StatIncrease);
            Debug.Log($"Dexterity is {DexAdd}");
            DextImage.fillAmount = Map((float)DexAdd, 0, 10, 0, 1);

            int StrTake = myStrength.Take(StatDecrease);
            Debug.Log($"Strengh is {StrTake}");
            strengthImage.fillAmount = Map((float)StrTake, 0, 10, 0, 1);
        });
        // WealthButton.onClick.AddListener(() =>
        // {
        //     int IntAdd = myIntel.Give(StatIncrease);
        //     Debug.Log($"Wealth is {Map(IntAdd, 0, 10, 0, 1)}");
        //     IntelImage.fillAmount = Map((float)IntAdd, 0, 10, 0, 1);
        // });
    }
Пример #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Dexterityid,Dexsaveprof,Dexvalue,Acrobaticsid,Stealthid,Sleightid")] Dexterity dexterity)
        {
            if (id != dexterity.Dexterityid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(dexterity);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DexterityExists(dexterity.Dexterityid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Acrobaticsid"] = new SelectList(_context.Acrobatics, "Acrobaticsid", "Acrobaticsid", dexterity.Acrobaticsid);
            ViewData["Sleightid"]    = new SelectList(_context.Set <SleightOfHand>(), "Sleightofhandid", "Sleightofhandid", dexterity.Sleightid);
            ViewData["Stealthid"]    = new SelectList(_context.Set <Stealth>(), "Stealthid", "Stealthid", dexterity.Stealthid);
            return(View(dexterity));
        }
Пример #3
0
        /// <summary>
        /// Saves properties
        /// </summary>
        /// <param name="writer">XmlWriter</param>
        /// <returns>True if saved</returns>
        public virtual bool Save(XmlWriter writer)
        {
            if (writer == null || writer.WriteState != WriteState.Element)
            {
                return(false);
            }

            HitPoint.Save(writer);
            Strength.Save("strength", writer);
            Intelligence.Save("intelligence", writer);
            Wisdom.Save("wisdom", writer);
            Dexterity.Save("dexterity", writer);
            Constitution.Save("constitution", writer);
            Charisma.Save("charisma", writer);

            writer.WriteStartElement("alignment");
            writer.WriteAttributeString("value", Alignment.ToString());
            writer.WriteEndElement();

            writer.WriteStartElement("movespeed");
            writer.WriteAttributeString("value", MoveSpeed.TotalMilliseconds.ToString());
            writer.WriteEndElement();


            return(true);
        }
Пример #4
0
    public void LoadTexture()
    {
        //check to see if PlayerPrefs (our save location) HasKey (has a save file...you will need to reference the name of a file)
        if (!PlayerPrefs.HasKey("CharacterName"))
        {
            //if it doesnt then load the CustomSet level
            SceneManager.LoadScene("CharacterSettings");
        }
        else
        {
            //if it does have a save file then load and SetTexture Skin, Hair, Mouth and Eyes from PlayerPrefs
            SetTexture("Skin", PlayerPrefs.GetInt("SkinIndex"));
            SetTexture("Hair", PlayerPrefs.GetInt("HairIndex"));
            SetTexture("Mouth", PlayerPrefs.GetInt("MouthIndex"));
            SetTexture("Eyes", PlayerPrefs.GetInt("EyesIndex"));
            SetTexture("Armour", PlayerPrefs.GetInt("ArmourIndex"));
            SetTexture("Clothes", PlayerPrefs.GetInt("ClothesIndex"));
            //grab the gameObject in scene that is our character and set its Object name to the Characters name
            gameObject.name = PlayerPrefs.GetString("CharacterName");
            //get character class
            characterClass = PlayerPrefs.GetString("CharacterClass");
            //get character skills stats
            Strength     = PlayerPrefs.GetInt("Strength");
            Dexterity    = PlayerPrefs.GetInt("Dexterity");
            Constitution = PlayerPrefs.GetInt("Constitution");
            Intelligence = PlayerPrefs.GetInt("Intelligence");
            Wisdom       = PlayerPrefs.GetInt("Wisdom");
            Charisma     = PlayerPrefs.GetInt("Charisma");

            Debug.Log(gameObject.name + "  " + characterClass);
            Debug.Log("Strength:" + Strength.ToString() + "  Dexterity:" + Dexterity.ToString()
                      + "  Constitution:" + Constitution.ToString() + "  Intelligence:" + Intelligence.ToString()
                      + "  Wisdom:" + Wisdom.ToString() + "  Charisma:" + Charisma.ToString());
        }
    }
Пример #5
0
 public Entity(int strength, int dex, int con, int intelligence, int wisdom, int charisma)
 {
     Ammunition = new List <Ammunition>();
     Purse      = new CoinPurse();
     Weapons    = new List <Weapon>();
     Strength   = new Strength()
     {
         Score = strength
     };
     Dexterity = new Dexterity()
     {
         Score = dex
     };
     Constitution = new Constitution()
     {
         Score = con
     };
     Intelligence = new Intelligence()
     {
         Score = intelligence
     };
     Wisdom = new Wisdom()
     {
         Score = wisdom
     };
     Charisma = new Charisma()
     {
         Score = charisma
     };
 }
Пример #6
0
 private void CreateBasicStats()
 {
     strenght     = new Strenght(statisticsLevelUpdate.StrenghtMultiplier);
     vitality     = new Vitality(statisticsLevelUpdate.VitalityMultiplier);
     intelligence = new Intelligence(statisticsLevelUpdate.IntelligenceMultiplier);
     dexterity    = new Dexterity(statisticsLevelUpdate.DexterityMultiplier);
 }
Пример #7
0
        //Organize and display character information.
        public void DisplayCharacterInfo()
        {
            string title  = " 1920's Investigator \n";
            string spacer = "- - - - - - - - - - - \n";
            string stat   = "\n Characteristics \n";

            String[,] invDet = new string[, ]
            {
                { "Name: ", Name },
                { "Player: ", Player },
                { "Occupation: ", Occupation },
                { "Sex: ", Sex },
                { "Age: ", Age.ToString() },
                { "Birthplace: ", BirthPlace },
                { "Residence: ", Residence }
            };

            String[,] invCha = new string[, ]
            {
                { "STR: ", Strength.ToString() },
                { "DEX: ", Dexterity.ToString() },
                { "INT: ", Intelligence.ToString() },
                { "CON: ", Constitution.ToString() },
                { "APP: ", Appearance.ToString() },
                { "POW: ", Power.ToString() },
                { "SIZ: ", Size.ToString() },
                { "EDU: ", Education.ToString() }
            };

            Console.WriteLine(title + spacer);
            DisplaySplit(invDet, false);
            Console.WriteLine(stat + spacer);
            Console.WriteLine("       #   | 1/2 | 1/5 ");
            DisplaySplit(invCha, true);
        }
Пример #8
0
        public override string ToString()
        {
            string stats = Health.ToString() + "\n" + Strength.ToString() + "\n" + Dexterity.ToString() + "\n" + Agility.ToString() + "\n" + Inteligence.ToString() + "\n" + Luck.ToString() + "\n" + Statpoints.ToString() + "\n" + Level.ToString() + "\n" + ExperiencePoints.ToString();
            string hash  = GetSha1("Blin113" + stats);      //blin113 is just here to make sure you can't cheat without access to the code.

            stats += "\n" + hash;
            return(stats);
        }
Пример #9
0
 public override void WriteToFile()
 {
     File.WriteAllText("hunter.txt", "========Fighter type: " + WhatType());
     File.AppendAllText("hunter.txt", "\r\n~~~Level: " + Level.ToString());
     File.AppendAllText("hunter.txt", "\r\n~~~Dexterity: " + Dexterity.ToString());
     File.AppendAllText("hunter.txt", "\r\n~~~HP: " + HP.ToString());
     File.AppendAllText("hunter.txt", "\r\n~~~Damage: " + Damage.ToString());
 }
Пример #10
0
        public void Bonus_DexteritySpecified_ShouldWork()
        {
            SetupCharacter();

            SavingThrows dexterity = new Dexterity(true);

            Assert.AreEqual(-5, dexterity.Bonus);
            Assert.IsTrue(dexterity.Proficiency);
        }
Пример #11
0
 public StatArray(byte str, byte dex, byte con, byte intel, byte wis, byte cha)
 {
     Strength     = new Strength(str);
     Dexterity    = new Dexterity(dex);
     Constitution = new Constitution(con);
     Intelligence = new Intelligence(intel);
     Wisdom       = new Wisdom(wis);
     Charisma     = new Charisma(cha);
 }
Пример #12
0
 public StatArray()
 {
     Strength     = new Strength();
     Dexterity    = new Dexterity();
     Constitution = new Constitution();
     Intelligence = new Intelligence();
     Wisdom       = new Wisdom();
     Charisma     = new Charisma();
 }
Пример #13
0
 public override string ToString()
 {
     return(Stregnth.ToString() + ' ' +
            Dexterity.ToString() + ' ' +
            Constitution.ToString() + ' ' +
            Intelligence.ToString() + ' ' +
            Wisdom.ToString() + ' ' +
            Charisma.ToString());
 }
Пример #14
0
 public bool Equals(StatBlock other)
 {
     return(Strength.Equals(other.Strength) &&
            Dexterity.Equals(other.Dexterity) &&
            Constitution.Equals(other.Constitution) &&
            Intelligence.Equals(other.Intelligence) &&
            Wisdom.Equals(other.Wisdom) &&
            Charisma.Equals(other.Charisma));
 }
Пример #15
0
 protected Fighter(string type, double h, double d, double dex)
 {
     count++;
     ID        = Level.GetHashCode() + Dexterity.GetHashCode() + HP.GetHashCode() + Damage.GetHashCode();
     this.type = type;
     HP        = Convert.ToInt32(400 * h);
     Damage    = Convert.ToInt32(10 * d);
     Dexterity = Convert.ToInt32(20 * dex);
     Level     = 1;
 }
Пример #16
0
 public static DndCharacter Generate()
 {
     Strength     = Strength.Ability();
     Dexterity    = Dexterity.Ability();
     Constitution = Constitution.Ability();
     Intelligence = Intelligence.Ability();
     Wisdom       = Wisdom.Ability();
     Charisma     = Charisma.Ability();
     Hitpoints    = 10 + Modifier();
 }
Пример #17
0
        public Appearance()
        {
            description = new List <string>();

            theAge       = new Age();
            theBeauty    = new Beauty();
            theDexterity = new Dexterity();
            theGrooming  = new Grooming();
            theHeight    = new Height();
            theStrength  = new Strength();
            theWeight    = new Weight();
        }
Пример #18
0
 public AbilityScores DeepCopy()
 {
     return(new AbilityScores
     {
         Strength = Strength.DeepCopy(),
         Dexterity = Dexterity.DeepCopy(),
         Constitution = Constitution.DeepCopy(),
         Intelligence = Intelligence.DeepCopy(),
         Wisdom = Wisdom.DeepCopy(),
         Charisma = Charisma.DeepCopy(),
     });
 }
Пример #19
0
 public Entity()
 {
     Strength     = new Strength();
     Dexterity    = new Dexterity();
     Constitution = new Constitution();
     Intelligence = new Intelligence();
     Wisdom       = new Wisdom();
     Charisma     = new Charisma();
     Weapons      = new List <Weapon>();
     Ammunition   = new List <Ammunition>();
     Purse        = new CoinPurse();
 }
 public IResettable Reset()
 {
     Name = "";
     Strength.Reset();
     Dexterity.Reset();
     Constitution.Reset();
     Intelligence.Reset();
     Wisdom.Reset();
     Charisma.Reset();
     Level.Reset();
     Race = Race.Unset;
     return(this);
 }
Пример #21
0
 public Abilities(
     Strength strength,
     Dexterity dexterity,
     Constitution constitution,
     Intelligence intelligence,
     Wisdom wisdom, Charisma charisma)
 {
     Strength     = strength;
     Dexterity    = dexterity;
     Constitution = constitution;
     Intelligence = intelligence;
     Wisdom       = wisdom;
     Charisma     = charisma;
 }
Пример #22
0
        public async Task <IActionResult> Create([Bind("Dexterityid,Dexsaveprof,Dexvalue,Acrobaticsid,Stealthid,Sleightid")] Dexterity dexterity)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dexterity);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Acrobaticsid"] = new SelectList(_context.Acrobatics, "Acrobaticsid", "Acrobaticsid", dexterity.Acrobaticsid);
            ViewData["Sleightid"]    = new SelectList(_context.Set <SleightOfHand>(), "Sleightofhandid", "Sleightofhandid", dexterity.Sleightid);
            ViewData["Stealthid"]    = new SelectList(_context.Set <Stealth>(), "Stealthid", "Stealthid", dexterity.Stealthid);
            return(View(dexterity));
        }
Пример #23
0
 public override string ToString()
 {
     return(String.Format("Race: {0}\nStrength: {1}\nDexterity: {2}\nConstitution: {3}\nIntelligence: {4}\nWisdom: {5}\nCharisma: {6}\nArcane: {7}\nDivine: {8}\nDeviation Index: {9}",
                          Race.ToString(),
                          Strength.ToString(),
                          Dexterity.ToString(),
                          Constitution.ToString(),
                          Intelligence.ToString(),
                          Wisdom.ToString(),
                          Charisma.ToString(),
                          Arcane.ToString(),
                          Divine.ToString(),
                          DeviationIndex));
 }
Пример #24
0
 private void Start()
 {
     luck                       = new Luck("Luck", Stat.StatType.LUCK, Stat.Rarity.RARE, Stat.AffectedStat.RARITY, 0);
     dexterity                  = new Dexterity("Dexterity", Stat.StatType.DEXTERITY, Stat.Rarity.UNCOMMON, Stat.AffectedStat.ACCUMULATION, 0);
     intelligence               = new Intelligence("Intelligence", Stat.StatType.INTELLIGENCE, Stat.Rarity.COMMON, Stat.AffectedStat.THEME, 0);
     strength                   = new Strength("Strength", Stat.StatType.STRENGTH, Stat.Rarity.COMMON, Stat.AffectedStat.LOOT_AMOUNT, 0);
     playerName                 = "";
     level                      = 1;
     lootBoxes                  = 1;
     maxLootBoxes               = 5;
     inventorySlots             = 12;
     weaponSlots                = 2;
     experienceToNext           = 100;
     lastLootBoxAccumulatedTime = 100;
 }
Пример #25
0
        public XmlElement Serialize(XmlDocument doc)
        {
            XmlElement xmlStats = doc.CreateElement("stats");

            xmlStats.SetAttribute("health", Health.ToString());
            xmlStats.SetAttribute("maxHealth", MaxHealth.ToString());
            xmlStats.SetAttribute("endurance", Endurance.ToString());
            xmlStats.SetAttribute("strength", Strength.ToString());
            xmlStats.SetAttribute("intelligence", Intelligence.ToString());
            xmlStats.SetAttribute("agility", Agility.ToString());
            xmlStats.SetAttribute("dexterity", Dexterity.ToString());
            xmlStats.SetAttribute("upgradePoint", UpgradePoint.ToString());

            return(xmlStats);
        }
Пример #26
0
    public override string GetTooltip()
    {
        string stats = string.Empty;

        if (Strenght > 0)
        {
            stats += "\n+" + Strenght.ToString() + " Strenght";
        }
        else if (Strenght < 0)
        {
            stats += "\n" + Strenght.ToString() + " Strenght";
        }
        if (Dexterity > 0)
        {
            stats += "\n+" + Dexterity.ToString() + " Dexterity";
        }
        else if (Dexterity < 0)
        {
            stats += "\n" + Dexterity.ToString() + " Dexterity";
        }
        if (Stamina > 0)
        {
            stats += "\n+" + Stamina.ToString() + " Stamina";
        }
        else if (Stamina < 0)
        {
            stats += "\n" + Stamina.ToString() + " Stamina";
        }
        if (Magic > 0)
        {
            stats += "\n+" + Magic.ToString() + " Magic";
        }
        else if (Magic < 0)
        {
            stats += "\n" + Magic.ToString() + " Magic";
        }

        string itemTip = base.GetTooltip();

        return(string.Format("{0}" + "<size=15>{1}</size>", itemTip, stats));
    }
Пример #27
0
    //Base Methods
    public CharInfo(
        Divine.Moniker moniker, BattleObjStats initialStats, List <SpellInfo> spells,
        Dexterity priority, int xp, int level, long id,
        int coolDownRemainingTime, int cardCount, NextUpgradeStats nextUpgradeStats,
        Divine.Moniker owner = Divine.Moniker.Unknown, bool isActive = true)

    {
        this.xp    = xp;
        this.level = level;

        uniqueID     = id;
        this.spells  = spells;
        this.moniker = moniker;
        turnPriority = priority;
        baseStats    = initialStats;
        ownerHero    = owner;

        curCardCount          = cardCount;
        this.nextUpgradeStats = nextUpgradeStats;
        SetRemainingCooldownTime(coolDownRemainingTime);
        enableInStart = isActive;
    }
Пример #28
0
    // Start is called before the first frame update
    void Start()
    {
        Strength  myStrength = new Strength();
        Dexterity myDext     = new Dexterity();
        Wealth    myWealth   = new Wealth();

        StrengthButton.onClick.AddListener(() =>
        {
            int tmp = myStrength.GiveStrength();
            Debug.Log($"Strengh is {tmp}");
        });
        DextButton.onClick.AddListener(() =>
        {
            int tmp = myDext.GiveDext();
            Debug.Log($"Dexterity is {tmp}");
        });
        WealthButton.onClick.AddListener(() =>
        {
            int tmp = myWealth.GiveWealth();
            Debug.Log($"Wealth is {tmp}");
        });
    }
Пример #29
0
        }                                                      // modiferDict -> key: MemberName as string. Value: int modifier

        public Character(string name, string race, int str, int dex, int con, int intelligence, int wis, int cha, AbstractClass charClass, AbstractWeapon weapon, AbstractArmor armor, bool shield, int team, int level = 1)
        {
            Name = name;
            Race = race;

            Str   = new Strength(str);
            Dex   = new Dexterity(dex);
            Con   = new Constitution(con);
            Int   = new Intelligence(intelligence);
            Wis   = new Wisdom(wis);
            Cha   = new Charisma(cha);
            Class = new Fighter(level);

            EquippedArmor  = armor;
            EquippedWeapon = weapon;
            ShieldEquipped = shield;

            CalculateHitPoints();
            CalculateAC();
            CalculateAttackBonus();

            Team = team;
        }
Пример #30
0
 public void Init()
 {
     strength  = new Strength(0);
     intellect = new Intellect(0);
     dexterity = new Dexterity(0);
 }