Esempio n. 1
0
        public static StatusEffects CalculateStatusEffects(BoostResponse boosts)         // TODO: Which values does it use and need? More research on official servers needed
        {
            var baseBoosts    = boosts;
            var statusEffects = new StatusEffects();
            var baseSettings  = StateSingleton.Instance.settings;

            statusEffects.tappableInteractionRadius =
                (int?)(baseSettings.result.tappableinteractionradius + baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "tappableinteractionradius")?.effect.value);

            //baseBoosts.result.statusEffects.itemExperiencePointRates = baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "tappableinteractionradius").effect.value);
            statusEffects.attackDamageRate      = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "tappableinteractionradius")?.effect.value;
            statusEffects.blockDamageRate       = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "blockdamage")?.effect.value;
            statusEffects.craftingSpeed         = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "craftingspeed")?.effect.value;
            statusEffects.experiencePointRate   = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "itemexperiencepoints")?.effect.value;           // Find out if this or the other one
            statusEffects.foodHealthRate        = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "foodhealth")?.effect.value;
            statusEffects.maximumPlayerHealth   = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "maximumplayerhealth")?.effect.value;
            statusEffects.playerDefenseRate     = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "playerdefense")?.effect.value;
            statusEffects.smeltingFuelIntensity = (int?)baseBoosts.result.activeEffects.Find(match => match.effect.type.ToLower() == "smeltingfuelintensity")?.effect.value;

            return(statusEffects);
        }
Esempio n. 2
0
 public static bool WriteBoosts(string playerId, BoostResponse resp)
 {
     return(GenericUtils.WriteJsonFile(playerId, resp, "boosts"));
 }