Exemple #1
0
        /// <summary>
        /// Load the Spirit from the XmlNode.
        /// </summary>
        /// <param name="objNode">XmlNode to load.</param>
        public void Load(XmlNode objNode)
        {
            if (objNode == null)
            {
                return;
            }
            objNode.TryGetField("guid", Guid.TryParse, out _guiId);
            if (objNode.TryGetStringFieldQuickly("name", ref _strName))
            {
                _objCachedMyXmlNode = null;
            }
            objNode.TryGetStringFieldQuickly("crittername", ref _strCritterName);
            objNode.TryGetInt32FieldQuickly("services", ref _intServicesOwed);
            objNode.TryGetInt32FieldQuickly("force", ref _intForce);
            objNode.TryGetBoolFieldQuickly("bound", ref _blnBound);
            objNode.TryGetBoolFieldQuickly("fettered", ref _blnFettered);
            _eEntityType = ConvertToSpiritType(objNode["type"]?.InnerText);
            objNode.TryGetStringFieldQuickly("file", ref _strFileName);
            objNode.TryGetStringFieldQuickly("relative", ref _strRelativeName);
            objNode.TryGetStringFieldQuickly("notes", ref _strNotes);

            RefreshLinkedCharacter(false);

            LoadMugshots(objNode);
        }
Exemple #2
0
        private void ParseLabel(string text)
        {
            text = text.Replace("\\'", "\"");
            var parts = text.Split(new[] { '\'' });

            ParseLevel(parts[5].Trim());
            ParseResalesCount(parts[3]);
            spirit = ItemBuilder.ParseSpirit(parts[3]);
        }
Exemple #3
0
 public void TakeDamage(int damage, SpiritType type)
 {
     //print("Enemy Hurt");
     if (type == characters[target].type)
     {
         damage = damage * 2;
     }
     UIPlayManager.ShakeEnemyPanelEvent.Invoke();
     characters[target].Hp -= (damage - characters[target].shield > 0) ? damage : 1;
     UIPlayManager.UpdateEnemyBattleHeartEvent.Invoke(characters[target].Hp.ToString());
     StartCoroutine(Delay());
 }
Exemple #4
0
        /// <summary>
        /// Updates the spirits.
        /// </summary>
        private void UpdateSpirits()
        {
            SpiritType result = 0;

            foreach (var item in wardrobe.Items)
            {
                if (item.IsPutOn)
                {
                    result = result | item.Spirit;
                }
            }
            Spirits = result;
        }
    public string GetText(SpiritType property)
    {
        AllText allText = AllText.Instance;

        if (allText != null)
        {
            return(allText.GetText(property.ToString()));
        }
        else
        {
            return(property.ToString());
        }
    }
Exemple #6
0
 public bool IsSpiritType(SpiritType type)
 {
     if (m_SpiritTypes.Contains(type))
     {
         return(true);
     }
     else if (m_Owner != null)
     {
         return(m_Owner.m_Status.m_SpiritTypes.Contains(type));
     }
     else
     {
         return(false);
     }
 }
Exemple #7
0
        public void TakeDamage(int i, SpiritType type)
        {
            if (type == characters[0].type)
            {
                i = i * 2;
            }
            UIPlayManager.ShakePlayerPanelEvent.Invoke();
            characters[0].Hp -= (i - characters[0].shield > 0) ? i : 1;
            UIPlayManager.UpdatePlayerBattleHeartEvent.Invoke(characters[0].Hp.ToString());

            string tmp = "{HP : " + characters[0].Hp + " } {ATK : " + characters[0].sword + " } {DEF : " + characters[0].shield + " } {TYPE : " + characters[0].type + " } {HERO : " + heroes.Count + " }";

            UIPlayManager.UpdatePlayerStatusTextEvent.Invoke(tmp);

            StartCoroutine(Delay());
        }
Exemple #8
0
 public void AddMember(BaseSpirit bs)
 {
     this.SName      = bs.SName;
     this.image      = bs.image;
     this.biomeFound = bs.biomeFound;
     this.type1      = bs.type1;
     this.type2      = bs.type2;
     this.rarity     = bs.rarity;
     this.HP         = bs.HP;
     this.maxHP      = bs.maxHP;
     //this.AttStat = bs.AttStat;
     // this.DefStat = bs.DefStat;
     this.spiritStats = bs.spiritStats;
     this.canAscend   = bs.canAscend;
     this.AscendTo    = bs.AscendTo;
     this.level       = bs.level;
 }
 private void DevourSpirit()
 {
     if (collisionList.Count > 0)
     {
         for (int i = 0; i < collisionList.Count; i++)
         {
             for (int j = 0; j < elementsList.elementsList.Length; j++)
             {
                 if (collisionList[i].gameObject.GetComponent <Spirit>().GetSpiritType() == elementsList.elementsList[j].spiritType)
                 {
                     transform.localScale      = elementsList.elementsList[j].ObjectSize;
                     devouredSpiritType        = elementsList.elementsList[j].spiritType;
                     timeWhenSpiritGotCaptured = Time.timeSinceLevelLoad;
                 }
             }
         }
     }
     else
     {
         ReleaseSpirit();
     }
 }
Exemple #10
0
 public Digimon(
     int number, int order, string name, Stage stage, SpiritType spiritType,
     string abilityName, Element element, string evolution, string[] extraEvolutions, bool disabled,
     int baseLevel, CombatStats stats, CombatStats bossStats,
     bool isPseudo, string code)
 {
     this.number          = number;
     this.order           = order;
     this.name            = name.ToLower();
     this.stage           = stage;
     this.spiritType      = spiritType;
     this.abilityName     = abilityName;
     this.element         = element;
     this.evolution       = evolution;
     this.extraEvolutions = extraEvolutions;
     this.disabled        = disabled;
     this.baseLevel       = baseLevel;
     this.stats           = stats;
     this.bossStats       = bossStats;
     this.bossStats       = this.bossStats ?? stats; //If the database does not have boss stats for this Digimon, use regular stats instead.
     this.isPseudo        = isPseudo;
     this.code            = code;
 }
Exemple #11
0
		/// <summary>
		/// Load the Spirit from the XmlNode.
		/// </summary>
		/// <param name="objNode">XmlNode to load.</param>
		public void Load(XmlNode objNode)
		{
			_strName = objNode["name"].InnerText;
			try
			{
				_strCritterName = objNode["crittername"].InnerText;
			}
			catch
			{
			}
			_intServicesOwed = Convert.ToInt32(objNode["services"].InnerText);
			try
			{
				_intForce = Convert.ToInt32(objNode["force"].InnerText);
			}
			catch
			{
			}
			try
			{
				_blnBound = Convert.ToBoolean(objNode["bound"].InnerText);
			}
			catch
			{
			}
			_objEntityType = ConvertToSpiritType(objNode["type"].InnerText);
			try
			{
				_strFileName = objNode["file"].InnerText;
			}
			catch
			{
			}
			try
			{
				_strRelativeName = objNode["relative"].InnerText;
			}
			catch
			{
			}
			try
			{
				_strNotes = objNode["notes"].InnerText;
			}
			catch
			{
			}
		}
 public Spirit(SpiritType type = SpiritType.None, float fillness = 0)
 {
     _type     = type;
     _fillness = fillness;
 }