public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_floorType          = (FloorMechanismType)Serialization.JsonTokenValue <int>(jsonObject, "floorType", 1);
     m_activationValue    = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "activationValue");
     m_activationType     = (ActionType)Serialization.JsonTokenValue <int>(jsonObject, "activationType", 0);
     m_activationTrigger  = (FloorMechanismActivationType)Serialization.JsonTokenValue <int>(jsonObject, "activationTrigger", 0);
     m_removeOnActivation = Serialization.JsonTokenValue <bool>(jsonObject, "removeOnActivation", true);
 }
        public bool TryGetActionValue(out int val)
        {
            ILevelOnlyDependant actionValue = m_definition.actionValue;

            if (actionValue != null)
            {
                val = actionValue.GetValueWithLevel(m_level);
                return(true);
            }
            val = 0;
            return(false);
        }
Beispiel #3
0
 public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_precomputedData    = PrecomputedData.FromJsonProperty(jsonObject, "precomputedData");
     m_families           = Serialization.JsonArrayAsList <Family>(jsonObject, "families");
     m_life               = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "life");
     m_movementPoints     = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "movementPoints");
     m_actionValue        = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "actionValue");
     m_customActionTarget = IEntitySelectorUtils.FromJsonProperty(jsonObject, "customActionTarget");
     m_actionType         = (ActionType)Serialization.JsonTokenValue <int>(jsonObject, "actionType", 0);
     m_actionRange        = ActionRange.FromJsonProperty(jsonObject, "actionRange");
     m_aiArchetype        = (AIArchetype)Serialization.JsonTokenValue <int>(jsonObject, "aiArchetype", 0);
 }
        public bool TryGetActionValue(out int actionValue)
        {
            actionValue = 0;
            if (m_value == null)
            {
                return(true);
            }
            ILevelOnlyDependant actionValue2 = m_value.definition.actionValue;

            if (actionValue2 == null)
            {
                return(false);
            }
            actionValue = actionValue2.GetValueWithLevel(m_value.level);
            return(true);
        }
Beispiel #5
0
        public override void PopulateFromJson(JObject jsonObject)
        {
            base.PopulateFromJson(jsonObject);
            m_god = (God)Serialization.JsonTokenValue <int>(jsonObject, "god", 0);
            m_playerActionPoints   = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "playerActionPoints");
            m_maxMechanismsOnBoard = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "maxMechanismsOnBoard");
            m_maxSummoningsOnBoard = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "maxSummoningsOnBoard");
            JArray val = Serialization.JsonArray(jsonObject, "spells");

            m_spells = new List <Id <SpellDefinition> >((val != null) ? val.get_Count() : 0);
            if (val != null)
            {
                foreach (JToken item2 in val)
                {
                    Id <SpellDefinition> item = Serialization.JsonTokenIdValue <SpellDefinition>(item2);
                    m_spells.Add(item);
                }
            }
            m_defaultDeck = Serialization.JsonTokenIdValue <SquadDefinition>(jsonObject, "defaultDeck");
        }
 public static int GetValueInt(this IReadOnlyList <ILevelOnlyDependant> dynamicValues, string name, int level)
 {
     if (dynamicValues != null)
     {
         int count = dynamicValues.Count;
         for (int i = 0; i < count; i++)
         {
             ILevelOnlyDependant levelOnlyDependant = dynamicValues[i];
             if (levelOnlyDependant.get_referenceId() == name)
             {
                 return(levelOnlyDependant.GetValueWithLevel(level));
             }
         }
     }
     if (Enumerable.Contains(name, '.'))
     {
         return(GetValueInOtherData(name, level));
     }
     Log.Error("dynamic value " + name + " not found", 47, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\Localization\\TextFormatting\\ValueProviders\\FightValueProviders\\IFightValueProvider.cs");
     return(0);
 }
Beispiel #7
0
 public void PopulateFromJson(JObject jsonObject)
 {
     m_min = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "min");
     m_max = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "max");
 }
 public override void PopulateFromJson(JObject jsonObject)
 {
     base.PopulateFromJson(jsonObject);
     m_baseMecaLife = ILevelOnlyDependantUtils.FromJsonProperty(jsonObject, "baseMecaLife");
 }
        public static ILevelOnlyDependant FromJsonProperty(JObject jsonObject, string propertyName, ILevelOnlyDependant defaultValue = null)
        {
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Invalid comparison between Unknown and I4
            JProperty val = jsonObject.Property(propertyName);

            if (val == null || (int)val.get_Value().get_Type() == 10)
            {
                return(defaultValue);
            }
            return(FromJsonToken(val.get_Value()));
        }