public PokeballsEnemy(Game game, Trainer trainer) : base(game) { _trainer = trainer; Position = new Vector2(0, 24); _elementsTexture = game.Content.Load<Texture2D>("Resources/Battlesystem/elements"); }
/// <summary> /// Initialization of variables used in battles /// </summary> /// <param name="alliedTrainer">instance of an allied trainer</param> /// <param name="trainer">instance of an enemy trainer</param> /// <returns>returns instance of game</returns> public BattleScreen InitializeBattle(Trainer alliedTrainer, Trainer trainer) { _battle = new Battle(GameRef, alliedTrainer, trainer, true); _battle.Exit += EndBattle; ChildComponents.Add(_battle); StateManager.PushState(this); AudioController.PauseAll(); AudioController.RequestTrack("battle").Play(); return this; }
public PokemonInstance(Game game, long uniqueId, PokemonArchetype archetype, string nickname, Gender gender, bool isWild, Trainer originalTrainer, int experience) : base(game) { UniqueId = uniqueId; Archetype = archetype; Nickname = nickname; Gender = gender; IsWild = isWild; OriginalTrainer = originalTrainer; Experience = experience; CalculateLevel(); }
public Battle(Game1 game, Trainer alliedTrainer, Trainer enemyTrainer, bool trainerBattle) : base(game) { Camera = new Camera(game.ScreenRectangle) {Zoom = 4f}; Camera.LockToCenter(game.ScreenRectangle); _trainerBattle = trainerBattle; CurrentPhase = BattlePhase.Starting; AlliedTrainer = alliedTrainer; AlliedTrainer.PrepareForCombat(RenderingPosition.Ally); EnemyTrainer = enemyTrainer; EnemyTrainer.PrepareForCombat(RenderingPosition.Enemy); foreach (var pokemon in EnemyTrainer.PokemonSet.Where(pokemon => pokemon.CurrentHealth > 0)) { ActiveEnemyPokemon = new PokemonWrapper(game, pokemon); break; } foreach (var pokemon in AlliedTrainer.PokemonSet.Where(pokemon => pokemon.CurrentHealth > 0)) { ActiveAlliedPokemon = new PokemonWrapper(game, pokemon); break; } ActiveAlliedPokemon.PokemonInstance.PrepareForCombat(RenderingPosition.Ally); ActiveEnemyPokemon.PokemonInstance.PrepareForCombat(RenderingPosition.Enemy); // Initiate state BattleConclusion = BattleConclusion.Undecided; EndStage = EndStage.DisplayResult; CurrentPlayerTurnPhase = PlayerTurnPhase.ChoosingAction; RewardState = RewardState.ExperienceToBeAwarded; LoadContent(); }