2012-03-05 00:05:36 -07:00
|
|
|
#!/usr/bin/python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
2013-09-26 17:26:00 -05:00
|
|
|
import extras.pokemontools.configuration as configuration
|
2013-08-28 22:48:44 -05:00
|
|
|
import extras.pokemontools.preprocessor as preprocessor
|
|
|
|
|
2013-08-03 16:25:14 -05:00
|
|
|
from extras.pokemontools.crystal import (
|
2013-01-10 15:07:36 -06:00
|
|
|
command_classes,
|
|
|
|
Warp,
|
|
|
|
XYTrigger,
|
|
|
|
Signpost,
|
|
|
|
PeopleEvent,
|
|
|
|
DataByteWordMacro,
|
|
|
|
text_command_classes,
|
|
|
|
movement_command_classes,
|
2013-01-27 17:45:23 -06:00
|
|
|
music_classes,
|
2013-03-29 18:54:13 -04:00
|
|
|
effect_classes,
|
2013-11-07 01:15:20 -05:00
|
|
|
ChannelCommand,
|
|
|
|
OctaveCommand,
|
|
|
|
)
|
|
|
|
|
|
|
|
from extras.pokemontools.audio import (
|
|
|
|
Note,
|
2014-02-06 20:49:45 -05:00
|
|
|
Noise,
|
|
|
|
SoundCommand,
|
2013-01-10 15:07:36 -06:00
|
|
|
)
|
2012-04-26 14:14:46 -05:00
|
|
|
|
2013-12-19 04:49:20 -05:00
|
|
|
from extras.pokemontools.battle_animations import (
|
2013-12-25 06:19:37 -05:00
|
|
|
BattleAnimWait,
|
2013-12-19 04:49:20 -05:00
|
|
|
battle_animation_classes,
|
|
|
|
)
|
|
|
|
|
2013-08-31 10:13:17 -05:00
|
|
|
def load_pokecrystal_macros():
|
|
|
|
"""
|
|
|
|
Construct a list of macros that are needed for pokecrystal preprocessing.
|
|
|
|
"""
|
|
|
|
ourmacros = []
|
|
|
|
|
|
|
|
even_more_macros = [
|
|
|
|
Warp,
|
|
|
|
XYTrigger,
|
|
|
|
Signpost,
|
|
|
|
PeopleEvent,
|
|
|
|
DataByteWordMacro,
|
2013-11-07 01:15:20 -05:00
|
|
|
ChannelCommand,
|
|
|
|
OctaveCommand,
|
|
|
|
Note,
|
2014-02-06 20:49:45 -05:00
|
|
|
Noise,
|
|
|
|
SoundCommand,
|
2013-08-31 10:13:17 -05:00
|
|
|
]
|
2013-01-27 17:45:23 -06:00
|
|
|
|
2013-08-31 10:13:17 -05:00
|
|
|
ourmacros += command_classes
|
|
|
|
ourmacros += even_more_macros
|
|
|
|
ourmacros += [each[1] for each in text_command_classes]
|
|
|
|
ourmacros += movement_command_classes
|
|
|
|
ourmacros += music_classes
|
|
|
|
ourmacros += effect_classes
|
2013-12-25 06:19:37 -05:00
|
|
|
ourmacros += battle_animation_classes + [BattleAnimWait]
|
2012-04-26 14:14:46 -05:00
|
|
|
|
2013-08-31 10:13:17 -05:00
|
|
|
return ourmacros
|
2012-04-26 14:14:46 -05:00
|
|
|
|
2013-12-08 17:05:28 -05:00
|
|
|
def setup_processor():
|
|
|
|
config = configuration.Config()
|
|
|
|
macros = load_pokecrystal_macros()
|
2013-09-02 10:41:50 -05:00
|
|
|
processor = preprocessor.Preprocessor(config, macros)
|
2013-12-08 17:05:28 -05:00
|
|
|
return processor
|
2012-11-30 10:12:27 -06:00
|
|
|
|
2013-08-31 12:12:09 -05:00
|
|
|
def main():
|
2013-12-08 17:05:28 -05:00
|
|
|
processor = setup_processor()
|
|
|
|
processor.preprocess()
|
2012-11-30 10:12:27 -06:00
|
|
|
|
|
|
|
# only run against stdin when not included as a module
|
|
|
|
if __name__ == "__main__":
|
2013-08-31 12:12:09 -05:00
|
|
|
main()
|