internal SimOnboardPokemon(SimPokemon pokemon, PokemonOutward outward) { _pokemon = pokemon; Outward = outward; X = outward.Position.X; Moves = new SimMove[4]; for (int i = 0; i < pokemon.Moves.Length; ++i) { Moves[i] = new SimMove(pokemon.Moves[i]); } ZMoves = new SimMove[4]; for (int i = 0; i < pokemon.Moves.Length; ++i) { var x = GameHelper.Zmove(pokemon.Moves[i], pokemon.Item, pokemon.Form.Species.Number, pokemon.Form.Index); if (x != null) { ZMoves[i] = new SimMove(x); } } DetailOfMove = new string[4]; ZDetailOfMove = new string[4]; for (int i = 0; i < pokemon.Moves.Length; ++i) { DetailOfMove[i] = detail(Moves[i], pokemon); if (ZMoves[i] != null) { ZDetailOfMove[i] = detail(ZMoves[i], pokemon); } } }
public void SwitchPokemon(int origin, int sendout) { if (0 <= origin && origin < _pokemons.Length && 0 <= sendout && sendout < _pokemons.Length) { SimPokemon temp = _pokemons[origin]; _pokemons[origin] = _pokemons[sendout]; _pokemons[sendout] = temp; } }
public SimPlayer(int team, int indexInTeam, IPokemonData[] pokemons) { Team = team; TeamIndex = indexInTeam; _pokemons = new SimPokemon[pokemons.Length]; for (int i = 0; i < pokemons.Length; i++) { _pokemons[i] = new SimPokemon(team * 50 + indexInTeam * 10 + i, this, pokemons[i]); } }
public bool Pokemon(SimPokemon pokemon) { if (Pms[CurrentI].Pokemon(pokemon)) { input.Switch(CurrentI, pokemon); NextPm(); return(true); } error = Pms[CurrentI].GetErrorMessage(); return(false); }
internal SimOnboardPokemon(SimPokemon pokemon, PokemonOutward outward) { _pokemon = pokemon; Outward = outward; X = outward.Position.X; Moves = new SimMove[4]; for (int i = 0; i < pokemon.Moves.Length; ++i) { Moves[i] = new SimMove(pokemon.Moves[i]); } }
private string detail(SimMove move, SimPokemon pokemon) { int p = move.Type.Power; int a = move.Type.Accuracy; string power = p.ToString(); string acc = a.ToString(); if (p == 0) { power = "--"; } if (p == 1) { power = "不定"; } if (a == 0) { acc = "--"; } if (move.Type.Id == Ms.NATURAL_GIFT) { power = GameHelper.NaturalGiftPower(pokemon.Item).ToString(); } if (move.Type.Id == Ms.FLING) { power = GameHelper.FlingPower(pokemon.Item).ToString(); } if (move.Type.Id == Ms.RETURN) { power = (pokemon.Happiness * 4 / 10).ToString(); } if (move.Type.Id == Ms.FRUSTRATION) { power = ((255 - pokemon.Happiness) * 4 / 10).ToString(); } return("威力:" + power + " 命中率:" + acc + '\n' + GameString.Current.MoveD(move.Type.Id)); }
public bool Pokemon(SimPokemon pokemon, int index) { if (pokemon.Owner != game.Player) { error = GameString.Current.BattleLog("PokemonIsPartner"); return(false); } if (pokemon.Hp.Value == 0) { error = string.Format(GameString.Current.BattleLog("PokemonFainted"), pokemon.Name); return(false); } if (pokemon.IndexInOwner < game.Settings.Mode.OnboardPokemonsPerPlayer()) { error = string.Format(GameString.Current.BattleLog("PokemonFighting"), pokemon.Name); return(false); } input.SendOut(index, pokemon); //多打中有多只精灵倒下,要把哪只精灵收回来 //单打和合作没有这种需要 InputFinished(input); return(true); }
/// <summary> /// 判断pokemon是否在场和Hp /// </summary> /// <param name="pokemon"></param> /// <returns></returns> public bool Pokemon(SimPokemon pokemon) { if (pokemon.Owner != Game.Player) { error = GameString.Current.BattleLog("PokemonIsPartner"); return(false); } if (pokemon.Hp.Value == 0) { error = string.Format(GameString.Current.BattleLog("PokemonFainted"), pokemon.Name); return(false); } if (pokemon.IndexInOwner < Game.Settings.Mode.OnboardPokemonsPerPlayer()) { error = string.Format(GameString.Current.BattleLog("PokemonFighting"), pokemon.Name); return(false); } if (CantWithdraw) { error = string.Format(GameString.Current.BattleLog("PokemonCannotWithdraw"), Pm.Pokemon.Name); return(false); } return(true); }
public static IInput SendOut(SimPokemon sendout) { return(new IInput(0, false, false, 0, 0, sendout.IndexInOwner)); }
public void SendOut(int i, SimPokemon sendout) { Set(i, IInput.SendOut(sendout)); }