public void PlayerTileCollide(Grass grass)
        {
            double value = RandomExtension.NextDouble(rnd, 0.01, 99.99);

            if (value <= veryCommon)
            {
                game.gameState = new EncounterGameState(game);
            }
        }
Exemple #2
0
        public void Execute()
        {
            int A   = 25; //your pokemons speed
            int B   = 50; //other pokemons speed
            int F   = (((A * 128) / B) + 30 * escapeCount) % 256;
            int rnd = RandomExtension.NextInt(rndNum, 0, 255);

            if (rnd < F)
            {
                game.transition = true;
                game.gameState  = new PlayingGameState(game);
            }
            escapeCount++;
        }
Exemple #3
0
 public void Update(GameTime gameTime)
 {
     if (!talkedTo)
     {
         Random rnd   = new Random();
         int    value = RandomExtension.NextInt(rnd, 0, 100);
         if (value == 0)
         {
             value = RandomExtension.NextInt(rnd, 0, 3);
             if (value == 0)
             {
                 state.Up();
             }
             else if (value == 1)
             {
                 state.Down();
             }
             else if (value == 2)
             {
                 state.Left();
             }
             else
             {
                 state.Right();
             }
         }
         state.Update(gameTime);
     }
     else
     {
         textBox.Update(gameTime);
         if (textBox.complete == true)
         {
             talkedTo = false;
         }
     }
 }
Exemple #4
0
        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);
        }