public List <Ship> SortByStat(string stat) { _filterListByStat = _filterList; List <KeyValuePair <int, Ship> > sortedList = new List <KeyValuePair <int, Ship> >(); List <Ship> sort = new List <Ship>(); foreach (Ship ship in _filterListByStat) { object value1Obj; Basestats level120Rets1 = ship.Stats.Level120Retrofit; Basestats level120s1 = ship.Stats.Level120; if (level120Rets1 == null) { value1Obj = level120s1.GetType().GetProperty(stat).GetValue(level120s1); } else { value1Obj = level120Rets1.GetType().GetProperty(stat).GetValue(level120Rets1); } int.TryParse(value1Obj.ToString(), out int value1Int); sortedList.Add(new KeyValuePair <int, Ship>(value1Int, ship)); } sortedList = sortedList.OrderBy(x => x.Key).ToList(); sortedList.Reverse(); foreach (KeyValuePair <int, Ship> ship in sortedList) { sort.Add(ship.Value); } _filterListByStat = sort; return(_filterListByStat); }
public static void DetermineStats(Basestats.Classes Cur) { Basestats.SelectClass(Cur); speed = Basestats.Speed; dmg = Basestats.Dmg; agi = Basestats.Agi; str = Basestats.Str; magi = Basestats.Magi; luck = Basestats.Luck; arm = Basestats.Arm; vit = Basestats.Vit; }
public override void Refresh() { pokemon = BattlePokemonData.Context [trainerData.pokemons[ChosePokemonIndex].GetInstanceID()]; basestats = pokemon.basestats; Show_Icons(); Show_Power(); Show_Skills(); Show_Race(); Show_prop(); Resources.UnloadUnusedAssets(); }
private void CalcMaxStat() { if (CurrentShip.Ship != null) { Basestats stat120 = CurrentShip.Ship.Stats.Level120; Basestats stat120Retro = CurrentShip.Ship.Stats.Level120Retrofit; Basestats stat = new Basestats(); if (CurrentShip.MyShip.IsRetrofitted) { stat.Health = CalcMaxStatAtAffection(stat120.Health, stat120Retro.Health); stat.Firepower = CalcMaxStatAtAffection(stat120.Firepower, stat120Retro.Firepower); stat.Antiair = CalcMaxStatAtAffection(stat120.Antiair, stat120Retro.Antiair); stat.AntisubmarineWarfare = CalcMaxStatAtAffection(stat120.AntisubmarineWarfare, stat120Retro.AntisubmarineWarfare); stat.Oxygen = CalcMaxStatAtAffection(stat120.Oxygen, stat120Retro.Oxygen); stat.Torpedo = CalcMaxStatAtAffection(stat120.Torpedo, stat120Retro.Torpedo); stat.Aviation = CalcMaxStatAtAffection(stat120.Aviation, stat120Retro.Aviation); stat.Ammunition = CalcMaxStatAtAffection(stat120.Ammunition, stat120Retro.Ammunition); stat.Reload = CalcMaxStatAtAffection(stat120.Reload, stat120Retro.Reload); stat.Evasion = CalcMaxStatAtAffection(stat120.Evasion, stat120Retro.Evasion); stat.OilConsumption = stat120Retro.OilConsumption; } else { stat.Health = CalcMaxStatAtAffection(stat120.Health); stat.Firepower = CalcMaxStatAtAffection(stat120.Firepower); stat.Antiair = CalcMaxStatAtAffection(stat120.Antiair); stat.AntisubmarineWarfare = CalcMaxStatAtAffection(stat120.AntisubmarineWarfare); stat.Oxygen = CalcMaxStatAtAffection(stat120.Oxygen); stat.Torpedo = CalcMaxStatAtAffection(stat120.Torpedo); stat.Aviation = CalcMaxStatAtAffection(stat120.Aviation); stat.Ammunition = CalcMaxStatAtAffection(stat120.Ammunition); stat.Reload = CalcMaxStatAtAffection(stat120.Reload); stat.Evasion = CalcMaxStatAtAffection(stat120.Evasion); stat.OilConsumption = stat120.OilConsumption; } CurrentMaxStat = stat; RaisePropertyChanged("CurrentMaxStat"); } else { CurrentMaxStat = new Basestats(); } }
public BattlePokemonData(Pokemon pokemon) { this.pokemon = pokemon; race = pokemon.PokeRace; basestats = pokemon.Basestats; IV = pokemon.IV; nature = pokemon.PokeNature; ShowAbility = pokemon.ShowAbility; Ename = pokemon.Ename; LHCoroutine.CoroutineManager.DoCoroutine(InitPokemonData()); entity = Contexts.sharedInstance.game.CreateEntity(); entity.AddBattlePokemonData(this); Action action = DefaultAction; entity.AddPokemonDataChangeEvent(action); ID = pokemon.GetInstanceID(); Context[ID] = this; }