public BattleEffect(PokeBattle battle, BattlePosition[] targets, string effectScript) { this.targets = targets; this.turnsLeft = -1; this.battle = battle; this.effectScript = effectScript; }
public static void initializeStacks(PokeBattle currentBattle) { battle = currentBattle; //Gets items and abilities that can be triggered. weather = new SortedList <int, BattleEffect>(); move = new SortedList <int, BattleEffect>(); item = new SortedList <int, BattleEffect>(); effect = new SortedList <int, BattleEffect>(); triggered = new SortedList <int, BattleEffect>(); positions = new SortedList <int, BattlePosition>(); }
static public void Initialize(GraphicsDeviceManager g, ContentManager c, SpriteFont f, PokeBattle inBattle, BattleScreen battleScreen) { graphics = g; content = c; font = f; isVisible = true; optionChoice = 0; battle = inBattle; pokemon = battle.Positions[0].pokemon; player = (Player)battle.Positions[0].trainer; fightChoice = 0; pokeChoice = 0; itemOptions = new int[player.inventory.Count]; itemChoice = 0; Textures.fightMenu = SaveLoad.LoadTexture2D(@"Content\Textures\Battle\fightMenu.png", g.GraphicsDevice); Textures.pokeMenu = SaveLoad.LoadTexture2D(@"Content\Textures\Battle\pokeMenu.png", g.GraphicsDevice); Textures.itemMenu = SaveLoad.LoadTexture2D(@"Content\Textures\Battle\itemMenu.png", g.GraphicsDevice); Textures.runMenu = SaveLoad.LoadTexture2D(@"Content\Textures\Battle\runMenu.png", g.GraphicsDevice); Textures.moveButton = SaveLoad.LoadTexture2D(@"Content\Textures\Battle\moveButton.png", g.GraphicsDevice); Rectangles.menuRect = new Rectangle( graphics.PreferredBackBufferWidth / 2 - Textures.fightMenu.Width / 2, graphics.PreferredBackBufferHeight - Textures.fightMenu.Height, Textures.fightMenu.Width, Textures.fightMenu.Height); Rectangles.moveRect[0] = new Rectangle( Rectangles.menuRect.X + 40, Rectangles.menuRect.Y + 40, Textures.moveButton.Width, Textures.moveButton.Height); Rectangles.moveRect[1] = new Rectangle( Rectangles.moveRect[0].X + Textures.moveButton.Width + 10, Rectangles.moveRect[0].Y, Textures.moveButton.Width, Textures.moveButton.Height); Rectangles.moveRect[2] = new Rectangle( Rectangles.moveRect[0].X, Rectangles.moveRect[0].Y + Textures.moveButton.Height + 10, Textures.moveButton.Width, Textures.moveButton.Height); Rectangles.moveRect[3] = new Rectangle( Rectangles.moveRect[0].X + Textures.moveButton.Width + 10, Rectangles.moveRect[0].Y + Textures.moveButton.Height + 10, Textures.moveButton.Width, Textures.moveButton.Height); }
public void startSingleBattle(Trainer trainerOne, Trainer trainerTwo) { //our state is currently at the start of the battle state = State.BattleStart; //create instance of battle battle = new PokeBattle(trainerOne, trainerTwo); //start the battle thread thread = new Thread(battle.BattleLoop); thread.Start(); BattleMenu.Initialize(graphics, content, font, battle, this); }
public static void initializeStacks(PokeBattle currentBattle) { battle = currentBattle; //Gets items and abilities that can be triggered. weather = new List <BattleEffect>(); weather.OrderBy(e => e.speed); move = new List <BattleEffect>(); move.OrderBy(e => e.speed); item = new List <BattleEffect>(); item.OrderBy(e => e.speed); effect = new List <BattleEffect>(); effect.OrderBy(e => e.speed); triggered = new List <BattleEffect>(); triggered.OrderBy(e => e.speed); positions = new List <BattlePosition>(); positions.OrderBy(pos => pos.PriorityIndex); }