Ejemplo n.º 1
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());
        }
    }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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());
 }
Ejemplo n.º 5
0
 public override string ToString()
 {
     return(Stregnth.ToString() + ' ' +
            Dexterity.ToString() + ' ' +
            Constitution.ToString() + ' ' +
            Intelligence.ToString() + ' ' +
            Wisdom.ToString() + ' ' +
            Charisma.ToString());
 }
Ejemplo n.º 6
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));
 }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
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));
    }
Ejemplo n.º 9
0
        public override void WritePropertyXML(XmlWriter xmlWriter)
        {
            base.WritePropertyXML(xmlWriter);

            xmlWriter.WriteStartElement("Type");
            xmlWriter.WriteString(Methods.GetCreatureTypeString(Type));
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("ChallengeRating");
            xmlWriter.WriteString(ChallengeRating.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("AttackSets");
            foreach (AttackSet attackSet in AttackSets)
            {
                attackSet.WriteXML(xmlWriter);
            }
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Strength");
            xmlWriter.WriteString(Strength.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Dexterity");
            xmlWriter.WriteString(Dexterity.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Constitution");
            xmlWriter.WriteString(Constitution.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Intelligence");
            xmlWriter.WriteString(Intelligence.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Wisdom");
            xmlWriter.WriteString(Wisdom.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Charisma");
            xmlWriter.WriteString(Charisma.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("BaseAttackBonus");
            xmlWriter.WriteString(BaseAttackBonus.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("GrappleModifier");
            xmlWriter.WriteString(GrappleModifier.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("HitPoints");
            xmlWriter.WriteString(HitPoints.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("HitDice");
            xmlWriter.WriteString(HitDice.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("HitDieType");
            xmlWriter.WriteString(Methods.GetDieTypeString(HitDieType));
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("ArmorClass");
            xmlWriter.WriteString(ArmorClass.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("TouchArmorClass");
            xmlWriter.WriteString(TouchArmorClass.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("FlatFootedArmorClass");
            xmlWriter.WriteString(FlatFootedArmorClass.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Speed");
            Speed.WriteXML(xmlWriter);
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("FortitudeSave");
            xmlWriter.WriteString(FortitudeSave.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("ReflexSave");
            xmlWriter.WriteString(ReflexSave.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("WillSave");
            xmlWriter.WriteString(WillSave.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Feats");
            foreach (string feat in Feats)
            {
                xmlWriter.WriteStartElement("Feat");
                xmlWriter.WriteString(feat);
                xmlWriter.WriteEndElement();
            }
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Space");
            xmlWriter.WriteString(Space.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Reach");
            xmlWriter.WriteString(Reach.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Size");
            xmlWriter.WriteString(Methods.GetSizeString(Size));
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("DamageReductions");
            foreach (DamageReduction dr in DamageReductions)
            {
                dr.WriteXML(xmlWriter);
            }
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("Immunities");
            Immunities.WriteXML(xmlWriter);
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("EnergyResistances");
            foreach (EnergyResistance er in EnergyResistances)
            {
                er.WriteXML(xmlWriter);
            }
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("SpellResistance");
            xmlWriter.WriteString(SpellResistance.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("FastHealing");
            xmlWriter.WriteString(FastHealing.ToString());
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("SpecialAttacks");
            xmlWriter.WriteString(SpecialAttacks);
            xmlWriter.WriteEndElement();

            xmlWriter.WriteStartElement("SpecialQualities");
            xmlWriter.WriteString(String.Join(", ", SpecialQualities));
            xmlWriter.WriteEndElement();
        }
Ejemplo n.º 10
0
        public string[] toStringArray()
        {
            string[] info = { Health.ToString(), Armor.ToString(), Strength.ToString(), Dexterity.ToString(), Mana.ToString(),
                              Level.ToString(),  EXP.ToString(),   Name,                Race,                 ClassName };

            return(info);
        }