/// <summary> /// Launch an attack on a creature with a move. /// </summary> /// <param name="move">The move to attack with.</param> /// <param name="target">The target to attack.</param> public void LaunchAttack(Move move, Creature target) { //Stop here if the move or target isn't valid, or if a move already has been set in motion. if (move == null || target == null || _BattleState != BattleState.Idle) { return; } //Prepare for the attack. _BattleState = BattleState.Waiting; //Create the activated form of the move. BattleMove active = new BattleMove(move, this, target); //Attack. BattleCoordinator.Instance.QueueMove(active); }
public void Add(Creature pokemon) { //Add the Pokemon to the list. _ListOfPokemon.Add(pokemon); }
public void Remove(Creature pokemon) { //Remove the Pokemon from the list. _ListOfPokemon.Remove(pokemon); }
/// <summary> /// Create a Pokémon. /// </summary> /// <param name="name">The name of the pokémon.</param> /// <param name="gender">The gender of the pokémon.</param> /// <param name="types">The types of the pokémon.</param> /// <param name="hp">The max HP of the pokémon.</param> /// <param name="attackPhysical">The physical attack power of the pokémon.</param> /// <param name="defensePhysical">The physical defense power of the pokémon.</param> /// <param name="specialAttack">The special attack power of the pokémon.</param> /// <param name="specialDefense">The special defense power of the pokémon.</param> /// <param name="powerPhysical">The physical power of the move.</param> /// <param name="powerSpecial">The special power of the move.</param> /// <param name="speed">The speed of the pokémon.</param> /// <param name="level">The level of the pokémon.</param> /// <param name="moves">The moves that this pokémon knows.</param> /// <param name="maxEnergy">The max energy of the pokémon.</param> /// <returns>The pokémon created with the given data.</returns> public Creature CreatePokemon(string name, Gender gender, List<PokemonType> types, float hp, float attackPhysical, float defensePhysical, float specialAttack, float specialDefense, float speed, int level, List<Move> moves, float maxEnergy) { //Create the Pokémon. Creature pokemon = new Creature(); //Set the stats accordingly. pokemon.Name = name; pokemon.Gender = gender; pokemon.Types = types; pokemon.CurrentHP = hp; pokemon.HP = hp; pokemon.AttackPhysical = attackPhysical; pokemon.DefensePhysical = defensePhysical; pokemon.SpecialAttack = specialAttack; pokemon.SpecialDefense = specialDefense; pokemon.Speed = speed; pokemon.Level = level; pokemon.Moves = moves; pokemon.CurrentEnergy = maxEnergy; pokemon.MaxEnergy = maxEnergy; //Return the move. return pokemon; }