Example #1
0
 def test_judgment(self):
     doc = load_test_doc("_template")
     doc["item"] = "Flame Plate"
     doc["moves"] = ["Judgment"]
     resultset = pokecat.populate_pokeset(doc)
     result = pokecat.instantiate_pokeset(resultset)
     self.assertEqual(result["moves"][0]["type"], "Fire")
Example #2
0
 def test_natural_gift(self):
     doc = load_test_doc("_template")
     doc["item"] = "Colbur Berry"
     doc["moves"] = ["Natural Gift"]
     resultset = pokecat.populate_pokeset(doc)
     result = pokecat.instantiate_pokeset(resultset)
     self.assertEqual(result["moves"][0]["type"], "Dark")
     self.assertEqual(result["moves"][0]["power"], 60)
Example #3
0
 def test_move_separations(self):
     doc = load_test_doc("_template")
     doc["moves"] = [["Pound", "Aqua Jet"], ["Surf", "Rock Smash"]]
     doc["separations"] = [["Pound", "Surf"]]
     pokeset = pokecat.populate_pokeset(doc)
     result = pokecat.instantiate_pokeset(pokeset)
     for _ in range(100):
         if result["moves"][0]["name"] == "Pound":
             self.assertEqual(result["moves"][1]["name"], "Rock Smash")
Example #4
0
 def test_move_in_different_slots_separations(self):
     doc = load_test_doc("_template")
     doc["moves"] = [["Pound", "Aqua Jet"], ["Surf", "Aqua Jet"]]
     doc["separations"] = [["Aqua Jet", "Aqua Jet"], ["Pound", "Surf"]]
     pokeset = pokecat.populate_pokeset(doc)
     for _ in range(100):
         result = pokecat.instantiate_pokeset(pokeset)
         if result["moves"][0]["name"] == "Aqua Jet":
             self.assertEqual(result["moves"][1]["name"], "Surf")
         elif result["moves"][1]["name"] == "Aqua Jet":
             self.assertEqual(result["moves"][0]["name"], "Pound")
         else:
             self.assertTrue(False)
Example #5
0
import time
import logging
import pokecat
import yaml

import crashchecker
import monitor

from pbrEngine import PBREngine
from pbrEngine.states import EngineStates
from pbrEngine import Colosseums

with open("testpkmn.yaml", encoding="utf-8") as f:
    yaml_data = yaml.load_all(f)
    data = [
        pokecat.instantiate_pokeset(pokecat.populate_pokeset(single_set))
        for single_set in yaml_data
    ]
    # reduce by shinies
    #data = [d for d in data if not d["shiny"]]
    # TODO remove this again, it's debugging stuff
    # only keep certain moves
    # moves = ["Explosion", "Self-Destruct", "Whirlwind", "Roar",
    # "Perish Song", "Destiny Bond", "Encore", "Metronome", "Me First",
    # "Transform", "Counter"]
    # data = [d for d in data if any(set(moves) & set([m["name"]
    #         for m in d["moves"]]))]

    # TODO this is stupid
    # remove all unicode, because windows console crashes otherwise
    # should only affect nidorans, but better be safe
Example #6
0
import sys
import time
import logging
import pokecat
import yaml

import crashchecker
import monitor

from pbrEngine import PBREngine
from pbrEngine.states import EngineStates
from pbrEngine import Colosseums

with open("testpkmn.yaml", encoding="utf-8") as f:
    yaml_data = yaml.load_all(f)
    data = [pokecat.instantiate_pokeset(pokecat.populate_pokeset(single_set)) for single_set in yaml_data]
    # reduce by shinies
    #data = [d for d in data if not d["shiny"]]
    # TODO remove this again, it's debugging stuff
    # only keep certain moves
    # moves = ["Explosion", "Self-Destruct", "Whirlwind", "Roar",
    # "Perish Song", "Destiny Bond", "Encore", "Metronome", "Me First",
    # "Transform", "Counter"]
    # data = [d for d in data if any(set(moves) & set([m["name"]
    #         for m in d["moves"]]))]

    # TODO this is stupid
    # remove all unicode, because windows console crashes otherwise
    # should only affect nidorans, but better be safe
    for i, _ in enumerate(data):
        data[i]["position"] = i