Exemple #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());
        }
    }
Exemple #2
0
 public override string ToString()
 {
     return(Stregnth.ToString() + ' ' +
            Dexterity.ToString() + ' ' +
            Constitution.ToString() + ' ' +
            Intelligence.ToString() + ' ' +
            Wisdom.ToString() + ' ' +
            Charisma.ToString());
 }
Exemple #3
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));
 }
Exemple #4
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();
        }