Ejemplo n.º 1
0
        private static double getRatio(OrbType type)
        {
            if (!Settings.CurrencyRatios.ContainsKey(type))
                return 0;

            return calculateRatio(Settings.CurrencyRatios[type]);
        }
Ejemplo n.º 2
0
    public static OrbType GetRandomOrbType()
    {
  		OrbColorEnum[] values = (OrbColorEnum[]) Enum.GetValues(typeof(OrbColorEnum));
		OrbType result = new OrbType(values[new Random().Next(0,values.Length)]);

  		return result;
	}    
Ejemplo n.º 3
0
 public static Dictionary<OrbType, double> GetTotalCurrencyDistribution(OrbType target, IEnumerable<Currency> currency)
 {
     return currency.Where(o => !o.TypeLine.Contains("Shard"))
                    .GroupBy(orb => orb.Type)
                    .Where(group => GetTotal(target, group) > 0)
                    .Select(grp => new { Key = grp.Key, Value = GetTotal(target, grp) })
                    .OrderByDescending(at => at.Value)
                    .ToDictionary(at => at.Key, at => at.Value);
 }
    private void CollectOrb(OrbType type, GameObject go)
    {
        if(CollectedOrbs.Count < 3)
        {
            CollectedOrbs.Add(type);
        }

        OrbManager.Instance.CollectOrb(go);
        Destroy(go);
    }
Ejemplo n.º 5
0
        internal static double GetChaosValue(OrbType type)
        {
            if (!Settings.CurrencyRatios.ContainsKey(type))
                return 0;

            CurrencyRatio ratio = Settings.CurrencyRatios[type];

            if (ratio.ChaosAmount < ratio.OrbAmount)
                return ratio.ChaosAmount / ratio.OrbAmount;

            return ratio.OrbAmount * ratio.ChaosAmount;
        }
Ejemplo n.º 6
0
        public static double GetTotal(OrbType target, IEnumerable<Currency> currency)
        {
            double total = 0;

            foreach (var orb in currency)
                total += orb.StackInfo.Amount * orb.ChaosValue;

            var ratioToChaos = Settings.CurrencyRatios[target];

            total *= (ratioToChaos.OrbAmount / ratioToChaos.ChaosAmount);

            return total;
        }
Ejemplo n.º 7
0
        public StashViewModel(StashView stashView)
        {
            this.stashView = stashView;
            categoryFilter = new List<IFilter>();
            AvailableCategories = CategoryManager.GetAvailableCategories();
            tabsAndContent = new List<WhatsInTheBox>();
            stashView.Loaded += new System.Windows.RoutedEventHandler(stashView_Loaded);
            GetTabs = new DelegateCommand(GetTabList);
            ApplicationState.LeagueChanged += new PropertyChangedEventHandler(ApplicationState_LeagueChanged);
            stashView.tabControl.SelectionChanged += new SelectionChangedEventHandler(tabControl_SelectionChanged);
            getAvailableItems();
            expressionDark = Application.LoadComponent(new Uri("/Procurement;component/Controls/ExpressionDark.xaml", UriKind.RelativeOrAbsolute)) as ResourceDictionary;

            configuredOrbType = OrbType.Chaos;
            string currencyDistributionMetric = Settings.UserSettings["CurrencyDistributionMetric"];
            if (currencyDistributionMetric.ToLower() == "count")
                currencyDistributionUsesCount = true;
            else
                configuredOrbType = (OrbType)Enum.Parse(typeof(OrbType), currencyDistributionMetric);
        }
Ejemplo n.º 8
0
	private Color GetColorForType(OrbType type)
	{
		switch (type.Color)
		{
			case OrbColorEnum.BLACK:
				return Color.black;
			case OrbColorEnum.BLUE:
				return Color.blue;
			case OrbColorEnum.GREEN:
				return Color.green;
			case OrbColorEnum.RED:
				return Color.red;
			case OrbColorEnum.WHITE:
				return Color.white;
			case OrbColorEnum.YELLOW:
				return Color.yellow;
			default:
				Debug.LogWarning(string.Format("Color not found {0}", type.Color));
				return Color.white;
		}
	}
Ejemplo n.º 9
0
 internal static double GetChaosValue(OrbType type)
 {
     return ratioCache[type];
 }
Ejemplo n.º 10
0
 public OrbSpawnData(EnemyOrbData p_enemyOrbData)
 {
     m_orbType      = p_enemyOrbData.Type;
     m_orbSeekSpeed = p_enemyOrbData.SeekSpeed;
     m_orbTrackType = p_enemyOrbData.OrbTrackType;
 }
Ejemplo n.º 11
0
 public OrbSpawnData(OrbType p_orbType, float p_orbSeekSpeed = 0, TrackType p_trackType = TrackType.NONE)
 {
     m_orbType      = p_orbType;
     m_orbSeekSpeed = p_orbSeekSpeed;
     m_orbTrackType = p_trackType;
 }
Ejemplo n.º 12
0
 public CurrencyRatio(OrbType orbType, double OrbAmount, double GCPAmount)
 {
     this.OrbType = orbType;
     this.OrbAmount = OrbAmount;
     this.GCPAmount = GCPAmount;
 }
    /// <summary>
    /// Drops held orbs on to the board
    /// </summary>
    /// <param name="Line"></param>
    public void DropOrbs(int Line)
    {
        bool LastOne        = true;
        int  initchildcount = GrabbedOrbs.childCount;

        while (GrabbedOrbs.childCount > 0)
        {
            GameObject ancorOrb;
            if (Cols[Line].Count > 0)
            {
                ancorOrb = Cols[Line].Last.Value;
            }
            else
            {
                ancorOrb = OobCols[Line].Last.Value;
            }



            Transform moveingOrb = GrabbedOrbs.GetChild(GrabbedOrbs.childCount - 1);
            Debug.Log("Dropping " + GrabbedOrbs.GetChild(GrabbedOrbs.childCount - 1).ToString());
            Vector3 start = moveingOrb.position;
            moveingOrb.position                      = new Vector3(ancorOrb.transform.position.x, ancorOrb.transform.position.y - 1, ORB_VIEW_LAYER);
            moveingOrb.GetChild(0).position          = start;
            moveingOrb.GetComponent <Orb>().curState = Orb.OrbState.Falling;
            moveingOrb.SetParent(orbs.transform);
            Cols[Line].AddLast(moveingOrb.gameObject);

            HeldObrs--;

            if (GrabbedOrbs.childCount == initchildcount)
            {
                LastOne = true;
            }
            IEnumerator MoveToSpot()
            {
                float     elapsedTime = 0;
                float     waitTime    = 0.25f - 0.01f * Cols[Line].Count;
                Transform moving      = moveingOrb.GetChild(0);

                moving.position = new Vector3(moveingOrb.transform.position.x + X_OFF_SET, -5 + Y_OFF_SET, 0);
                Vector3 currentPos = moving.position;

                while (elapsedTime < waitTime)
                {
                    try
                    {
                        moving.position = Vector3.Lerp(currentPos,
                                                       new Vector3(moveingOrb.transform.position.x + X_OFF_SET,
                                                                   moveingOrb.position.y + Y_OFF_SET,
                                                                   moveingOrb.transform.position.z),
                                                       Mathf.Clamp((elapsedTime / waitTime), 0, 1));
                    }
                    catch
                    {
                    }
                    elapsedTime += Time.deltaTime;
                    yield return(null);
                }
                // Make sure we got there
                try
                {
                    moving.position = Vector3.Lerp(currentPos,
                                                   new Vector3(moveingOrb.transform.position.x + X_OFF_SET,
                                                               moveingOrb.position.y + Y_OFF_SET,
                                                               moveingOrb.transform.position.z),
                                                   1);
                }
                catch
                {
                    // TODO add wait timer for a small amount of time before reechecking
                }

                moveingOrb.GetComponent <Orb>().curState = Orb.OrbState.Evaluating;
                if (!CurrentlyPoping)
                {
                }
                Debug.Log("Coroutine is done");
                yield return(null);
            }

            StartCoroutine(MoveToSpot());
        }
        if (fallenPopConter <= 0)
        {
            fallenPopConter = 0.26f;
        }
        HeldObrs = 0;
        heldType = OrbType.ERROR;
        CheckPickerType();
    }
Ejemplo n.º 14
0
 public Dictionary <OrbType, double> GetTotalCurrencyDistribution(OrbType target)
 {
     return(CurrencyHandler.GetTotalCurrencyDistribution(target, Get <Currency>()));
 }
Ejemplo n.º 15
0
 public double GetTotal(OrbType target)
 {
     return(CurrencyHandler.GetTotal(target, Get <Currency>()));
 }
Ejemplo n.º 16
0
 public CurrencyRatio(OrbType orbType, double OrbAmount, double ChaosAmount)
 {
     this.OrbType = orbType;
     this.OrbAmount = OrbAmount;
     this.ChaosAmount = ChaosAmount;
 }
Ejemplo n.º 17
0
 internal static double GetChaosValue(OrbType type)
 {
     return ratioCache[type];
 }
Ejemplo n.º 18
0
 private void OrbChange(OrbType orbType)
 {
     orbChanged = true;
 }
Ejemplo n.º 19
0
 public bool checkOrbType(OrbType check)
 {
     return(check == orbScript.orbType);
 }
Ejemplo n.º 20
0
 public Orb(OrbType type)
 {
     OrbType = type;
 }