public int CalculateDamage(Monster playMon, Monster enemMon, Move move) { double dmg = (((2 * playMon.level + 10)/250) * (playMon.currAtk / enemMon.currDef) * move.basePower + 2); double mod = stab * DetermineEffect(playMon.type, enemMon.type) * critical * RandomExtension.NextDouble(rand, 0.85, 1); dmg = dmg * mod; return (int)dmg; }
public UseMoveCommand(Damage dmg, Monster atkMon, Monster enemMon, Move move) { this.dmg = dmg; this.atkMon = atkMon; this.enemMon = enemMon; this.move = move; }
public EncounterGameState(Game1 game) { font = Game1.gameContent.Load<SpriteFont>("Fonts/guiFont"); this.game = game; game.background = Color.White; menu = new UniversalGUI(game); menu.columnOne.Add(new KeyValuePair<ICommands, string>(new FightMenuCommand(this, game), "FIGHT")); menu.columnOne.Add(new KeyValuePair<ICommands, string>(new MonsterMenuCommand(game), "MONSTERS")); menu.columnTwo.Add(new KeyValuePair<ICommands, string>(new BagMenuCommand(), "BAG")); menu.columnTwo.Add(new KeyValuePair<ICommands, string>(new RunAwayCommand(game), "RUN")); menu.defaultOne.Add(new KeyValuePair<ICommands, string>(new FightMenuCommand(this, game), "FIGHT")); menu.defaultOne.Add(new KeyValuePair<ICommands, string>(new MonsterMenuCommand(game), "MONSTERS")); menu.defaultTwo.Add(new KeyValuePair<ICommands, string>(new BagMenuCommand(), "BAG")); menu.defaultTwo.Add(new KeyValuePair<ICommands, string>(new RunAwayCommand(game), "RUN")); menu.currentCommand = menu.columnOne[0].Key; menu.Column1StartingPosition = new Vector2(550, 350); menu.Column2StartingPosition = new Vector2(650, 350); menu.arrowStartingPosition = new Vector2(540, 350); menu.CameraPointer = new Vector2(530, 270); game.keyboard = new EncounterController(menu); menu.graphicHolder.Add(new KeyValuePair<Texture2D, Rectangle>(Game1.gameContent.Load<Texture2D>("GUI Sprites/encounterWindow"), new Rectangle(330, 342, 400, 47))); menu.graphicHolder.Add(new KeyValuePair<Texture2D, Rectangle>(Game1.gameContent.Load<Texture2D>("GUI Sprites/encounterSelectWindow"), new Rectangle(530, 342, 200, 47))); faderTexture = new Texture2D(game.GraphicsDevice, 1, 1); var colors = new Color[] { Color.White }; faderTexture.SetData<Color>(colors); faderStart = true; dmg = new Damage(); enemyMon = game.level.player.monsterBuilder.monsterList["Pikachu"]; //enemyMon = new Monster("Pikachu", "Electric", 25, 25, 25, 25, 25, 25, "MonsterSprites/jigglypuff"); }