private static double getRatio(OrbType type) { if (!Settings.CurrencyRatios.ContainsKey(type)) return 0; return calculateRatio(Settings.CurrencyRatios[type]); }
public static OrbType GetRandomOrbType() { OrbColorEnum[] values = (OrbColorEnum[]) Enum.GetValues(typeof(OrbColorEnum)); OrbType result = new OrbType(values[new Random().Next(0,values.Length)]); return result; }
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); }
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; }
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; }
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); }
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; } }
internal static double GetChaosValue(OrbType type) { return ratioCache[type]; }
public OrbSpawnData(EnemyOrbData p_enemyOrbData) { m_orbType = p_enemyOrbData.Type; m_orbSeekSpeed = p_enemyOrbData.SeekSpeed; m_orbTrackType = p_enemyOrbData.OrbTrackType; }
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; }
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(); }
public Dictionary <OrbType, double> GetTotalCurrencyDistribution(OrbType target) { return(CurrencyHandler.GetTotalCurrencyDistribution(target, Get <Currency>())); }
public double GetTotal(OrbType target) { return(CurrencyHandler.GetTotal(target, Get <Currency>())); }
public CurrencyRatio(OrbType orbType, double OrbAmount, double ChaosAmount) { this.OrbType = orbType; this.OrbAmount = OrbAmount; this.ChaosAmount = ChaosAmount; }
private void OrbChange(OrbType orbType) { orbChanged = true; }
public bool checkOrbType(OrbType check) { return(check == orbScript.orbType); }
public Orb(OrbType type) { OrbType = type; }