コード例 #1
0
        /// <summary>
        /// Testing battle engine
        /// </summary>
        private void startBattle()
        {
            Trainer trainer = new Trainer();

            //BaseStatsList.initialize();


            BaseMove tackle = new BaseMove("Tackle", "hits the opponent hard", 50, 100, "Normal", "Physical", 35);

            tackle.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove scratch = new BaseMove("Scratch", "hits the opponent hard", 10, 100, "Normal", "Physical", 35);

            scratch.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove bubble = new BaseMove("Bubble", "waters the opponent", 20, 100, "Water", "Special", 30);

            bubble.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove ember = new BaseMove("Ember", "fires the opponent", 40, 100, "Fire", "Special", 25);

            ember.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";



            ActivePokemon charmander = new ActivePokemon(BaseStatsList.basestats);
            ActivePokemon squirtle   = new ActivePokemon(BaseStatsList.basestats);

            charmander.baseStat  = BaseStatsList.GetBaseStats("Charmander");
            charmander.level     = 20;
            charmander.currentHP = charmander.HP;
            charmander.setNickname("Charmander");
            charmander.addExp(charmander.expAtLevel(charmander.level) - 1);
            squirtle.baseStat  = BaseStatsList.GetBaseStats("Squirtle");
            squirtle.level     = 20;
            squirtle.currentHP = squirtle.HP;
            squirtle.setNickname("Squirtle");
            squirtle.addExp(squirtle.expAtLevel(squirtle.level) - 1);


            charmander.move[0] = new ActiveMove(scratch);
            charmander.move[1] = new ActiveMove(ember);
            squirtle.move[0]   = new ActiveMove(bubble);
            squirtle.move[1]   = new ActiveMove(tackle);

            player.addPokemon(squirtle);
            trainer.addPokemon(charmander);

            ScreenHandler.TopScreen.IsVisible = false;
            ScreenHandler.PushScreen(new BattleScreen(graphics, content, font, player, trainer));
        }
コード例 #2
0
        /// <summary>
        /// Testing battle engine
        /// </summary>
        private void startBattle()
        {
            Trainer trainer = new Trainer();

            //BaseStatsList.initialize();


            BaseMove tackle = new BaseMove("Tackle", "hits the opponent hard", 50, 100, "Normal", "Physical", 35);

            tackle.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove party = new BaseMove("Party", "hits the opponent hard", 10, 100, "Normal", "Physical", 35);

            party.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                        ShowMessage(target.pokemon.Nickname..'\'s attack decreased!')
                                    end
                                ";
            BaseMove bubble = new BaseMove("Bubble", "waters the opponent", 20, 100, "Water", "Special", 30);

            bubble.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove smile = new BaseMove("Smile", "waters the opponent", 100, 100, "Water", "Special", 30);

            smile.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                        ShowMessage(target.pokemon.Nickname..' died of cuteness!')
                                    end
                                ";
            BaseMove ember = new BaseMove("Ember", "fires the opponent", 40, 100, "Fire", "Special", 25);

            ember.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";

            BaseMove pinkiesense = new BaseMove("Pinkie Sense", "Confuses the opponent", 40, 100, "Fire", "Special", 25);

            pinkiesense.moveScript = @"  if user:hits(move, target) then
                                        s = target.pokemon.Nickname..' is confused!'
                                        ShowMessage(s)
                                    end
                                ";


            ActivePokemon charmander = new ActivePokemon(BaseStatsList.basestats);
            ActivePokemon squirtle   = new ActivePokemon(BaseStatsList.basestats);

            charmander.baseStat  = BaseStatsList.GetBaseStats("Charmander");
            charmander.level     = 20;
            charmander.currentHP = charmander.HP;
            charmander.setNickname("Charmander");
            charmander.addExp(charmander.expAtLevel(charmander.level) - 1);
            squirtle.baseStat  = BaseStatsList.GetBaseStats("Squirtle");
            squirtle.level     = 20;
            squirtle.currentHP = squirtle.HP;
            squirtle.setNickname("Pinkie Pie");
            squirtle.addExp(squirtle.expAtLevel(squirtle.level) - 1);


            charmander.move[0] = new ActiveMove(tackle);
            charmander.move[1] = new ActiveMove(ember);
            squirtle.move[0]   = new ActiveMove(party);
            squirtle.move[1]   = new ActiveMove(smile);
            squirtle.move[2]   = new ActiveMove(pinkiesense);

            player.addPokemon(squirtle);
            trainer.addPokemon(charmander);

            ScreenHandler.PushScreen(new BattleScreen(graphics, content, font, player, trainer));
        }
コード例 #3
0
ファイル: TFScriptHelper.cs プロジェクト: luodua/PokemonAzure
        public static void StartRandomEncounter(Player player)
        {
            //This is only a test implementation for now
            //Starts random battle with Starly, Rattata, or HootHoot
            Trainer trainer = new Trainer();


            BaseMove tackle = new BaseMove("Tackle", "hits the opponent hard", 50, 100, "Normal", "Physical", 35);

            tackle.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove scratch = new BaseMove("Scratch", "hits the opponent hard", 40, 100, "Normal", "Physical", 35);

            scratch.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove growl = new BaseMove("Growl", "Lowers target's attack", 0, 100, "Normal", "Special", 40);

            growl.moveScript = @" if user:hits(move, target) then
                                    target:changeStat('Attack', -1)
                                    ShowMessage(target.pokemon.Nickname .. 'has had their attack lowered')
                                    end
                                ";
            BaseMove foresight = new BaseMove("Foresight", "Negates accuracy reduction moves", 0, "Normal", "Status", 40);

            foresight.moveScript = @"target:changeStat('Accuracy', 12)
                                    target:changeStat('Accuracy', -6)
                                    ShowMessage(target.pokemon.Nickname .. 'has had their accuracy reset')
                                ";
            BaseMove quickattack = new BaseMove("Quick Attack", "Always strikes first", 40, 100, "Normal", "Physical", 30);

            quickattack.basePriority = 1;
            quickattack.moveScript   = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove tailwhip = new BaseMove("Tail Whip", "Lowers target's defense", 0, 100, "Normal", "Special", 40);

            tailwhip.moveScript = @" if user:hits(move, target) then
                                    target:changeStat('Defense', -1)
                                    ShowMessage(target.pokemon.Nickname .. 'has had their defense lowered')
                                    end
                                ";


            ActivePokemon enemy  = new ActivePokemon(BaseStatsList.basestats);
            Random        random = new Random();
            int           r      = random.Next(3);

            switch (r)
            {
            case 0:
                enemy.baseStat = BaseStatsList.GetBaseStats("Starly");
                enemy.move[0]  = new ActiveMove(tackle);
                enemy.move[1]  = new ActiveMove(growl);
                enemy.move[2]  = new ActiveMove(quickattack);
                break;

            case 1:
                enemy.baseStat = BaseStatsList.GetBaseStats("Hoothoot");
                enemy.move[0]  = new ActiveMove(tackle);
                enemy.move[1]  = new ActiveMove(growl);
                enemy.move[2]  = new ActiveMove(foresight);
                break;

            case 2:
                enemy.baseStat = BaseStatsList.GetBaseStats("Rattata");
                enemy.move[0]  = new ActiveMove(tackle);
                enemy.move[1]  = new ActiveMove(tailwhip);
                enemy.move[2]  = new ActiveMove(quickattack);
                break;

            default: return;
            }

            enemy.level     = 5;
            enemy.currentHP = enemy.HP;
            enemy.addExp(enemy.expAtLevel(enemy.level) - 1);

            trainer.addPokemon(enemy);

            ScreenHandler.TopScreen.IsVisible = false;
            ScreenHandler.PushScreen(new BattleScreen(graphics, content, font, player, trainer));
        }
コード例 #4
0
ファイル: TFScriptHelper.cs プロジェクト: luodua/PokemonAzure
        public static void AddNewPokemon(Player player, string pokemonname, int level)
        {
            BaseMove tackle = new BaseMove("Tackle", "hits the opponent hard", 50, 100, "Normal", "Physical", 35);

            tackle.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove scratch = new BaseMove("Scratch", "hits the opponent hard", 40, 100, "Normal", "Physical", 35);

            scratch.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove pound = new BaseMove("Pound", "hits the opponent hard", 40, 100, "Normal", "Physical", 35);

            pound.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove growl = new BaseMove("Growl", "Lowers target's attack", 0, 100, "Normal", "Special", 40);

            growl.moveScript = @" if user:hits(move, target) then
                                    target:changeStat('Attack', -1)
                                    ShowMessage(target.pokemon.Nickname .. 'has had their attack lowered')
                                    end
                                ";
            BaseMove foresight = new BaseMove("Foresight", "Negates accuracy reduction moves", 0, "Normal", "Status", 40);

            foresight.moveScript = @"target:changeStat('Accuracy', 12)
                                    target:changeStat('Accuracy', -6)
                                    ShowMessage(target.pokemon.Nickname .. 'has had their accuracy reset')
                                ";
            BaseMove quickattack = new BaseMove("Quick Attack", "Always strikes first", 40, 100, "Normal", "Physical", 30);

            quickattack.basePriority = 1;
            quickattack.moveScript   = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove tailwhip = new BaseMove("Tail Whip", "Lowers target's defense", 0, 100, "Normal", "Special", 40);

            tailwhip.moveScript = @" if user:hits(move, target) then
                                    target:changeStat('Defense', -1)
                                    ShowMessage(target.pokemon.Nickname .. 'has had their defense lowered')
                                    end
                                ";
            BaseMove ember = new BaseMove("Ember", "fires the opponent", 40, 100, "Fire", "Special", 25);

            ember.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove bubble = new BaseMove("Bubble", "waters the opponent", 20, 100, "Water", "Special", 30);

            bubble.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";
            BaseMove razorleaf = new BaseMove("Razor Leaf", "Sends razor sharp leaves at the target", 55, 95, "Grass", "Special", 25);

            razorleaf.moveScript = @"  if user:hits(move, target) then
                                        user:doDamageTo(move, target)
                                    end
                                ";


            ActivePokemon newPokemon = new ActivePokemon(BaseStatsList.basestats);

            switch (pokemonname)
            {
            case "Charmander":
                newPokemon.baseStat = BaseStatsList.GetBaseStats("Charmander");
                newPokemon.move[0]  = new ActiveMove(scratch);
                newPokemon.move[1]  = new ActiveMove(growl);
                newPokemon.move[2]  = new ActiveMove(ember);
                break;

            case "Mudkip":
                newPokemon.baseStat = BaseStatsList.GetBaseStats("Piplup");
                newPokemon.move[0]  = new ActiveMove(pound);
                newPokemon.move[1]  = new ActiveMove(growl);
                newPokemon.move[2]  = new ActiveMove(bubble);
                break;

            case "Chikorita":
                newPokemon.baseStat = BaseStatsList.GetBaseStats("Chikorita");
                newPokemon.move[0]  = new ActiveMove(tackle);
                newPokemon.move[1]  = new ActiveMove(growl);
                newPokemon.move[2]  = new ActiveMove(razorleaf);
                break;

            default:
                newPokemon.baseStat = BaseStatsList.GetBaseStats("Piplup");
                newPokemon.move[0]  = new ActiveMove(pound);
                newPokemon.move[1]  = new ActiveMove(growl);
                newPokemon.move[2]  = new ActiveMove(bubble);
                break;
            }

            newPokemon.level     = 7;
            newPokemon.currentHP = newPokemon.HP;
            newPokemon.addExp(newPokemon.expAtLevel(newPokemon.level) - 1);
            player.currentPokemon[0] = newPokemon;
        }