本文整理汇总了C#中PokemonData类的典型用法代码示例。如果您正苦于以下问题:C# PokemonData类的具体用法?C# PokemonData怎么用?C# PokemonData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PokemonData类属于命名空间,在下文中一共展示了PokemonData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Client
public Client(ClientIdentifier id)
{
Id = id;
var stats = new Stats { Atk = 10, Def = 10, HP = 30, SpAtk = 10, SpDef = 10, Speed = 10 };
var data = new PokemonData { Id = 0, Type1 = PokemonType.Normal, BaseStats = stats };
var moveData = new MoveData
{
Name = "Move",
Accuracy = 100,
Damage = 120,
DamageType = DamageCategory.Physical,
PokemonType = PokemonType.Normal,
PP = 20
};
for (int i = 0; i < 6; i++)
{
var pkmn = new Pokemon(data, stats) { Name = Id.Name + "_Pkmn" + i, Level = i + 20};
for (int j = 0; j < 2; j++)
pkmn.SetMove(j, new Move(moveData));
pkmn.Stats.HP = 30;
pkmn.HP = 30;
pokemons.Add(pkmn);
}
}
开发者ID:Nexus87,项目名称:PokeClone,代码行数:28,代码来源:Client.cs
示例2: CalculateCpMultiplier
public static double CalculateCpMultiplier(PokemonData poke)
{
var baseStats = GetBaseStats(poke.PokemonId);
return (baseStats.BaseAttack + poke.IndividualAttack)*
Math.Sqrt(baseStats.BaseDefense + poke.IndividualDefense)*
Math.Sqrt(baseStats.BaseStamina + poke.IndividualStamina);
}
开发者ID:ChronoXNL,项目名称:NecroBot,代码行数:7,代码来源:PokemonInfo.cs
示例3: CalculatePokemonPerfection
public static float CalculatePokemonPerfection(PokemonData poke)
{
if (poke != null)
return (poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0f * 15.0f) * 100.0f;
else
return 0;
}
开发者ID:yuyutak,项目名称:PokemonGo-Bot-SimpleGUI,代码行数:7,代码来源:Logic.cs
示例4: PokemonCaught
public static async Task PokemonCaught(PokemonData poke)
{
OnPokemonCaught(null, new PokemonCaughtArgs() { CaughtPokemon = poke });
await PokemonCaughtReset.WaitAsync();
PokemonCaughtReset.Reset();
}
开发者ID:RedNax67,项目名称:GoBot,代码行数:8,代码来源:Events.cs
示例5: GetHighestCPofType
public async Task<int> GetHighestCPofType(PokemonData pokemon)
{
var myPokemon = await GetPokemons();
var pokemons = myPokemon.ToList();
return pokemons.Where(x => x.PokemonId == pokemon.PokemonId)
.OrderByDescending(x => x.Cp)
.First().Cp;
}
开发者ID:RDalziel,项目名称:Pokemon-Go-Bot,代码行数:8,代码来源:Inventory.cs
示例6: CalculateMinCp
public static int CalculateMinCp(PokemonData poke)
{
return
Math.Max(
(int)
Math.Floor(0.1*CalculateMinCpMultiplier(poke)*
Math.Pow(poke.CpMultiplier + poke.AdditionalCpMultiplier, 2)), 10);
}
开发者ID:ChronoXNL,项目名称:NecroBot,代码行数:8,代码来源:PokemonInfo.cs
示例7: GetHighestIVofType
public async Task<IEnumerable<PokemonData>> GetHighestIVofType(PokemonData pokemon)
{
var myPokemon = await GetPokemons();
var pokemons = myPokemon.ToList();
return pokemons.Where(x => x.PokemonId == pokemon.PokemonId)
.OrderByDescending(PokemonInfo.CalculatePokemonPerfection)
.ThenBy(x => x.Cp)
.ToList();
}
开发者ID:Cenkyavuz,项目名称:PokemonGo-Bot,代码行数:9,代码来源:Inventory.cs
示例8: CalculatePokemonPerfection
public static double CalculatePokemonPerfection(PokemonData poke)
{
if (Math.Abs(poke.CpMultiplier + poke.AdditionalCpMultiplier) <= 0)
return (poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0 * 15.0) * 100.0;
var maxCp = CalculateMaxCpMultiplier(poke);
var minCp = CalculateMinCpMultiplier(poke);
var curCp = CalculateCpMultiplier(poke);
return ((curCp - minCp) / (maxCp - minCp)) * 100.0;
}
开发者ID:Cavaken,项目名称:PokemoGoBot-GottaCatchEmAll,代码行数:11,代码来源:PokemonInfo.cs
示例9: CalculatePokemonPerfection
public static double CalculatePokemonPerfection(PokemonData poke)
{
if (poke.CpMultiplier + poke.AdditionalCpMultiplier == 0)
return (poke.IndividualAttack * 2 + poke.IndividualDefense + poke.IndividualStamina) / (4.0 * 15.0) * 100.0;
BaseStats baseStats = GetBaseStats(poke.PokemonId);
var max_cp = CalculateMaxCPMultiplier(poke);
var min_cp = CalculateMinCPMultiplier(poke);
var cur_cp = CalculateCPMultiplier(poke);
return ((cur_cp - min_cp) / (max_cp - min_cp)) * 100.0;
}
开发者ID:CSGCoding,项目名称:NecroBot,代码行数:12,代码来源:PokemonInfo.cs
示例10: Transfer
public async Task<TransferStatus> Transfer(PokemonData pokemon, float keepPerfectPokemonLimit = 80.0f)
{
if (Perfect(pokemon) >= keepPerfectPokemonLimit || pokemon.Favorite == 0) return TransferStatus.Ignored;
var transferPokemonResponse = await PokemonClient.TransferPokemon(pokemon.Id);
await Task.Delay(3000);
if (transferPokemonResponse.Status == 1)
{
return TransferStatus.Success;
}
return TransferStatus.Fail;
}
开发者ID:XibalbaTM,项目名称:PokeBot2,代码行数:14,代码来源:PokemonTransferer.cs
示例11: HandleEvent
protected void HandleEvent(PokemonData pokemon, TransferStatus status)
{
if (status == TransferStatus.Success)
{
OnTransferSuccess(pokemon);
}
else if (status == TransferStatus.Fail)
{
OnTransferFailed(pokemon);
}
else if(status == TransferStatus.Ignored)
{
OnTransferIgnored(pokemon);
}
}
开发者ID:XibalbaTM,项目名称:PokeBot2,代码行数:15,代码来源:AllButStrongestTransferStrategy.cs
示例12: FromPokemonData
public Pokemon FromPokemonData(PokemonData data)
{
if (data == null)
return null;
//var iStats = GenerateIV();
// var stats = new Stats
// {
// HP = data.BaseStats.HP + iStats.HP,
// Atk = data.BaseStats.Atk + iStats.Atk,
// Def = data.BaseStats.Def + iStats.Def,
// SpAtk = data.BaseStats.SpAtk + iStats.SpAtk,
// SpDef = data.BaseStats.SpDef + iStats.SpDef,
// Speed = data.BaseStats.Speed + iStats.Speed
// };
//var builder = new PokemonBuilder(data);
//builder.SetIV (iStats).SetStats (stats);
//return builder.Build ();
throw new NotImplementedException();
}
开发者ID:Nexus87,项目名称:PokeClone,代码行数:22,代码来源:Gen1CharRules.cs
示例13: GetHighestPokemonOfTypeByCp
public async Task<PokemonData> GetHighestPokemonOfTypeByCp(PokemonData pokemon)
{
var myPokemon = await GetPokemons();
var pokemons = myPokemon.ToList();
return pokemons.Where(x => x.PokemonId == pokemon.PokemonId)
.OrderByDescending(x => x.Cp)
.FirstOrDefault();
}
开发者ID:ChlckenWings,项目名称:NecroBot,代码行数:8,代码来源:Inventory.cs
示例14: GetPokemonMove2
public static PokemonMove GetPokemonMove2(PokemonData poke)
{
var move2 = poke.Move2;
return move2;
}
开发者ID:ChronoXNL,项目名称:NecroBot,代码行数:5,代码来源:PokemonInfo.cs
示例15: GetPowerUpLevel
public static int GetPowerUpLevel(PokemonData poke)
{
return (int) (GetLevel(poke)*2.0);
}
开发者ID:ChronoXNL,项目名称:NecroBot,代码行数:4,代码来源:PokemonInfo.cs
示例16: TransferPokemon
private async void TransferPokemon(PokemonData pokemon)
{
if (MessageBox.Show($"Are you sure you want to transfer {pokemon.PokemonId.ToString()} with {pokemon.Cp} CP?", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
var transferPokemonResponse = await client2.TransferPokemon(pokemon.Id);
if (transferPokemonResponse.Status == 1)
{
ColoredConsoleWrite(Color.Magenta, $"{pokemon.PokemonId} was transferred. {transferPokemonResponse.CandyAwarded} candy awarded");
ReloadPokemonList();
}
else
{
ColoredConsoleWrite(Color.Magenta, $"{pokemon.PokemonId} could not be transferred");
}
}
}
开发者ID:CaptDreamer,项目名称:Pokemon-Go-Rocket-API,代码行数:17,代码来源:MainForm.cs
示例17: GetPokemonMove1
public static PokemonMove GetPokemonMove1(PokemonData poke)
{
var move1 = poke.Move1;
return move1;
}
开发者ID:ChronoXNL,项目名称:NecroBot,代码行数:5,代码来源:PokemonInfo.cs
示例18: GetCandy
public static int GetCandy(PokemonData pokemon, List<Candy> PokemonFamilies, IEnumerable<PokemonSettings> PokemonSettings)
{
var setting = PokemonSettings.FirstOrDefault(q => pokemon != null && q.PokemonId.Equals(pokemon.PokemonId));
var family = PokemonFamilies.FirstOrDefault(q => setting != null && q.FamilyId.Equals(setting.FamilyId));
return family.Candy_;
}
开发者ID:ChronoXNL,项目名称:NecroBot,代码行数:7,代码来源:PokemonInfo.cs
示例19: GetLevel
public static double GetLevel(PokemonData poke)
{
switch ((int) ((poke.CpMultiplier + poke.AdditionalCpMultiplier)*1000.0))
{
case 93: // 0.094 * 1000 = 93.99999678134
case 94:
return 1;
case 135:
return 1.5;
case 166:
return 2;
case 192:
return 2.5;
case 215:
return 3;
case 236:
return 3.5;
case 255:
return 4;
case 273:
return 4.5;
case 290:
return 5;
case 306:
return 5.5;
case 321:
return 6;
case 335:
return 6.5;
case 349:
return 7;
case 362:
return 7.5;
case 375:
return 8;
case 387:
return 8.5;
case 399:
return 9;
case 411:
return 9.5;
case 422:
return 10;
case 432:
return 10.5;
case 443:
return 11;
case 453:
return 11.5;
case 462:
return 12;
case 472:
return 12.5;
case 481:
return 13;
case 490:
return 13.5;
case 499:
return 14;
case 508:
return 14.5;
case 517:
return 15;
case 525:
return 15.5;
case 534:
return 16;
case 542:
return 16.5;
case 550:
return 17;
case 558:
return 17.5;
case 566:
return 18;
case 574:
return 18.5;
case 582:
return 19;
case 589:
return 19.5;
case 597:
return 20;
case 604:
return 20.5;
case 612:
return 21;
case 619:
return 21.5;
case 626:
return 22;
case 633:
return 22.5;
case 640:
return 23;
case 647:
return 23.5;
case 654:
return 24;
case 661:
//.........这里部分代码省略.........
开发者ID:ChronoXNL,项目名称:NecroBot,代码行数:101,代码来源:PokemonInfo.cs
示例20: evolvePokemon
private static async Task evolvePokemon(PokemonData pokemon)
{
try
{
var evolvePokemonResponse = await client.EvolvePokemon(pokemon.Id);
string message = "";
string caption = "";
MessageBoxButtons buttons = MessageBoxButtons.OK;
DialogResult result;
if (evolvePokemonResponse.Result == 1)
{
message = $"{pokemon.PokemonId} successfully evolved into {evolvePokemonResponse.EvolvedPokemon.PokemonType}\n{evolvePokemonResponse.ExpAwarded} experience awarded\n{evolvePokemonResponse.CandyAwarded} candy awarded";
caption = $"{pokemon.PokemonId} evolved into {evolvePokemonResponse.EvolvedPokemon.PokemonType}";
}
else
{
message = $"{pokemon.PokemonId} could not be evolved";
caption = $"Evolve {pokemon.PokemonId} failed";
}
result = MessageBox.Show(message, caption, buttons, MessageBoxIcon.Information);
}
catch (TaskCanceledException) { await evolvePokemon(pokemon); }
catch (UriFormatException) { await evolvePokemon(pokemon); }
catch (ArgumentOutOfRangeException) { await evolvePokemon(pokemon); }
catch (ArgumentNullException) { await evolvePokemon(pokemon); }
catch (NullReferenceException) { await evolvePokemon(pokemon); }
catch (Exception ex) { await evolvePokemon(pokemon); }
}
开发者ID:Ryuya1995,项目名称:Pokemon-Go-Rocket-API,代码行数:30,代码来源:PokeUi.cs
注:本文中的PokemonData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论