public RenewableResourceDescription(RawNode node, IContext context = null) : base(node, context)
 {
     recoveryTime     = node.GetInt("recovery_time");
     renewableMaximum = node.GetInt("renewable_maximum");
     recoveryStep     = node.GetInt("recovery_step");
     maximum          = node.GetInt("maximum");
 }
 public RangeAmount(RawNode node, IContext context)
     : base(node, context)
 {
     _random = PathUtil.GetModelPath(GetContext(), node.GetString("random"), null).GetSelf <Random>();
     min     = node.GetInt("min");
     max     = node.GetInt("max");
 }
예제 #3
0
        public KnifeDef(string key, KnifeMode mode, RawNode config)
        {
            this.key  = key;
            this.mode = mode;

            name             = config.GetString("name");
            rarity           = KnifeUtils.GetRarity(config.GetString("rarity", "common"));
            modes            = KnifeUtils.GetSupportedModes(config);
            timeScale        = config.GetFloat("time_scale");
            minForce         = config.GetFloat("knife_min_force");
            maxForce         = config.GetFloat("knife_max_force");
            gravity          = config.GetFloat("gravity");
            bounceMultiplier = config.GetFloat("knife_bounce_multiplier");
            heightMultiplier = config.GetFloat("height_multiplier");
            rotationSpeed    = config.GetFloat("rotation_speed");
            rotationDecrease = config.GetFloat("rotation_decrease");
            rotationMinSpeed = config.GetFloat("rotation_min_speed");

            prefab = config.GetString("prefab");
            scale  = config.GetFloat("scale");
            sides  = config.GetInt("sides", 1);
            size   = config.GetFloat("size");

            price = config.CheckKey("price") ? new PriceDef(config.GetNode("price")) : PriceDef.NewNone();

            visibleInCollection   = config.GetBool("collection_visible", true);
            visibleInRoulette     = config.GetBool("roulette_visible", true);
            droppableFromRoulette = config.GetBool("roulette_drop", true);

            ReadDeflection(config, "success_deflection", out successDeflectionLeft, out successDeflectionRight);
            ReadDeflection(config, "perfect_success_deflection", out perfectDeflectionLeft, out perfectDeflectionRight);

            hasSkillSuccessDeflection = HasDeflection(config, "skill_success_deflection");
            if (hasSkillSuccessDeflection)
            {
                ReadDeflection(config, "skill_success_deflection", out skillSuccessDeflectionLeft, out skillSuccessDeflectionRight);
            }

            hasSkillPerfectDeflection = HasDeflection(config, "skill_perfect_deflection");
            if (hasSkillPerfectDeflection)
            {
                ReadDeflection(config, "skill_perfect_deflection", out skillPerfectDeflectionLeft, out skillPerfectDeflectionRight);
            }

            if (config.CheckKey("skill_pefect_flip_gold_probability"))
            {
                skillPefectFlipGoldProbability = config.GetFloat("skill_pefect_flip_gold_probability");
                skillPefectFlipGoldMin         = config.GetInt("skill_pefect_flip_gold_min", 0);
                skillPefectFlipGoldMax         = config.GetInt("skill_pefect_flip_gold_max", 0);
            }

            if (config.CheckKey("skill_ads_multiplier"))
            {
                skillAdsMultiplier = config.GetFloat("skill_ads_multiplier", 1);
            }

            skillTooltip = config.GetString("skill_tooltip", null);
            skillIcon    = config.GetString("skill_icon", null);
            skillAdsIcon = config.GetString("skill_ads_icon", null);
        }
 public CriticalAmount(RawNode node, IContext context)
     : base(node, context)
 {
     probability = node.GetDouble("probability");
     critical    = node.GetInt("critical");
     regular     = node.GetInt("regular");
     _random     = PathUtil.GetModelPath(GetContext(), node.GetString("random"), null).GetSelf <Random>();
 }
예제 #5
0
 public AssetBundleRepositoryItem(RawNode node)
 {
     dependencies = node.GetStringArray("dependencies");
     crc32        = node.GetUInt("crc");
     packedSize   = node.GetInt("size");
     hash         = Hash128.Parse(node.GetString("hash"));
 }
 protected CounterTrigger(RawNode initNode, TriggerCategories categories, TriggerDescription description, IContext context)
     : base(initNode, categories, description, context)
 {
     count    = initNode.GetInt("count");
     maxCount = description.GetNode().GetInt("max-count");
 }
예제 #7
0
 public SimpleResourceRequirement(RawNode node, IContext context) : base(node, context)
 {
     resource = GetPath().GetSelf <SimpleResource>();
     amount   = node.GetInt("amount");
 }
예제 #8
0
 public Price(RawNode node, IContext context) : base(node, context)
 {
     type   = node.GetString("type");
     amount = node.GetInt("amount");
 }
예제 #9
0
 public PriceDef(RawNode config)
 {
     type   = PriceUtils.GetPriceType(config.GetString("type"));
     amount = config.GetInt("amount", 0);
 }
 public LimitedResource(RawNode initNode, LimitedResourceCategories categories, LimitedResourceDescription description, IContext context) : base(initNode, categories, description, context)
 {
     amount            = initNode.GetInt("amount");
     additionalMaximum = initNode.GetInt("additional-maximum");
 }
 public SimpleAmount(RawNode node, IContext context)
     : base(node, context)
 {
     amount = node.GetInt("amount");
 }
 public LimitedResourceDescription(RawNode node, IContext context = null) : base(node, context)
 {
     maximum = node.GetInt("max");
 }
예제 #13
0
 public SimpleResource(RawNode initNode, SimpleResourceCategories categories, SimpleResourceDescription description, IContext context) : base(initNode, categories, description, context)
 {
     amount = initNode.GetInt("amount");
 }
 public SimpleResourceRewardResult(RawNode node, IContext context) : base(node, context)
 {
     resource = PathUtil.GetModelPath(context, node.GetString("path"), null).GetSelf <SimpleResource>();
     amount   = node.GetInt("amount");
 }
예제 #15
0
 public Random(RawNode initNode, RandomCategories categories, RandomDescription description, IContext context) : base(initNode, categories, description, context)
 {
     _seed   = initNode.GetInt("seed");
     _random = (IRandomImplementation)FactoryManager.Build(typeof(IRandomImplementation), description.type);
 }
예제 #16
0
 public RenewableResource(RawNode initNode, RenewableResourceCategories categories, RenewableResourceDescription description, IContext context)
     : base(initNode, categories, description, context)
 {
     innerAmount    = initNode.GetInt("amount");
     lastUpdateTime = TimeUtil.GetUnixTime(initNode.GetLong("ts"));
 }
 public QueueTrigger(RawNode initNode, TriggerCategories categories, TriggerDescription description, IContext context)
     : base(initNode, categories, description, context)
 {
     _step = initNode.GetInt("step");
 }