Source

Lost Sky Project (Public) / Story of a Lost Sky / lostsky / missions / ch3st6.py

Full commit
from lostsky.worldmap.event import ConversationEvent
from lostsky.battle.mapdata import MapData
from lostsky.battle.mapaction import MapActionEvent

class Mission(ConversationEvent):

    def __init__(self):
        # Event Data
        name = 'Reunion'
        location = "Wind God's Lake"
        id_string = 'CH3ST6'
        prereqs = ['CH3ST5']
        show_rewards = False
        desc = "A great victory was scored for the inhabitants of Youkai Mountain today as the remainder of the Kodama Lords' forces were driven from the mountain by the valiant efforts of the Tengu and Kappa. Now reunited with Youmu and Yuyuko, Youmu and her companions gather to figure out their next step."

        ConversationEvent.__init__(self, name, location,
                             id_string, prereqs,
                             show_rewards, desc)

        # Map Data
        map_name = 'ch3st2.txt'
        mission_type = 'conversation'
        objective = None

        deploy_data = {'enable':False,
                       'max_units':None,
                       'preset_units':None,
                       'boxes':[]
                       }

        reward_list = []

        # Enemy Unit Data
        enemy_unit_data = [{'template_name': 'Tsubaki',
                                'unit_name': 'Tsubaki',
                                    'level': 25},
                        {'template_name': 'Momiji',
                                'unit_name': 'Momiji',
                                    'level': 8},
                         {'template_name': 'Nitori',
                                'unit_name': 'Nitori',
                                    'level': 7},
                        {'template_name': 'Yuyuko',
                                'unit_name': 'Yuyuko',
                                    'level': 10
                                },

                            {'template_name': 'Yukari',
                            'unit_name': 'Yukari',
                                'level': 16
                            },

                            {'template_name': 'Wolf Tengu',
                            'unit_name': 'Wolf Tengu A',
                                'level': 10
                            },
                            {'template_name': 'Wolf Tengu',
                            'unit_name': 'Wolf Tengu B',
                                'level': 10
                            }

        ]

        reserve_units = []

        initial_spells = {}

        initial_traits = {}

        initial_ai_states = {}

        initial_locations = {

                             'Mokou':(16, 19),
                             'Yuyuko':(17, 19),
                             'Youmu':(18, 19),
                             'Keine':(19, 19),
                             'Marisa':(20, 19),


                             'Ran':(16, 20),
                             'Chen':(17, 20),
                             'Yukari':(18, 20),
                             'Reimu':(20, 20),


                             'Momiji':(14, 17),
                             'Wolf Tengu A':(12, 16),
                             'Wolf Tengu B':(13, 17),


                             'Aya':(19, 17),
                             'Tsubaki':(18, 17),
                             'Nitori':(17, 17),


                             }


        all_landmarks = [
                        {'name':'Main House',
                         'id_string':'house_2',
                         'location':(18, 16)},

                        {'name':'Cherry Tree 1',
                         'id_string':'cherryblossom_tree',
                         'location':(17, 16)},
                        {'name':'Cherry Tree 2',
                         'id_string':'cherryblossom_tree',
                         'location':(19, 16)},

                        {'name':'West House',
                         'id_string':'house_1',
                         'location':(20, 17)},
                        {'name':'East House',
                         'id_string':'house_1',
                         'location':(16, 17)},

        ]

        required_starters = ['Youmu', 'Chen', 'Ran', 'Marisa', 'Reimu', 'Keine', 'Mokou', 'Aya']
        pre_mission_MAE = PreMissionMAE()
        mid_mission_MAE_list = []
        required_survivors = []
        post_mission_MAE = None

        self.map_data = MapData(map_name, mission_type, objective,
                                deploy_data, reward_list, enemy_unit_data,
                                initial_spells, initial_traits, initial_ai_states,
                                initial_locations, reserve_units, all_landmarks,
                                required_starters, pre_mission_MAE, mid_mission_MAE_list,
                                required_survivors, post_mission_MAE)

class PreMissionMAE(MapActionEvent):

    def __init__(self):
        triggers = []
        MapActionEvent.__init__(self, triggers)

    def execute(self):
        """
        Prologue event
        """
        self.set_cursor_state(False)
        self.set_stats_display(False)
        self.set_bg_overlay('Sunset')
        self.play_music('event01')

        # Momiji conversing with other Wolf Tengu guards
        self.center_on('Momiji')
        self.say("Momiji! What was it like fighting that Kodama Lord?",
            'Wolf Tengu A',
            'Wolf Tengu')
        self.say("Ayaka put up a difficult fight. Nitori and Lady Tsubaki were critical to us holding them off.",
            'Momiji',
            'Momiji')
        self.say("Looks like the meeting's starting. You should go listen in. I'll take the watch.",
            'Wolf Tengu B',
            'Wolf Tengu')

        # Planning what to do next
        self.center_on('Tsubaki')
        self.emote('Tsubaki', 'heart')
        self.say("We would normally not do this, but the Kappa are building a way to send some water from our mountain to your village.",
            'Tsubaki',
            'Tsubaki')
        self.say("We are eternally grateful. If I may ask, wouldn't the Tengu's upper ranks oppose it?",
            'Keine',
            'Keine')
        self.say("Yuyuko and I convinced them. I had to pull quite a few strings.",
            'Yukari',
            'Yukari')
        self.say("I suppose we owe you one, Yukari.",
            'Keine',
            'Keine')
        self.say("Ufufu~ I'll remember that. ",
            'Yukari',
            'Yukari')

        # Reimu knows that Yukari is a trickster. Pulls Marisa aside.
        self.move_unit('Reimu', (22, 20))
        self.move_unit('Marisa', (22, 19))
        self.center_on('Reimu')
        self.say("That's probably a cover for some dirty trick she pulled.",
            'Reimu',
            'Reimu')
        self.say("Maybe she made all their silverware disappear or something.",
            'Marisa',
            'Marisa')
        self.say("Their silverware and dishes: zipped away into the Nether.",
            'Reimu',
            'Reimu')
        # Reimu and Marisa return to the group
        self.move_unit('Reimu', (20, 20))
        self.move_unit('Marisa', (20, 19))

        self.center_on('Youmu')
        self.say("It's a time for unity. Some of the Tengu see that, though most of us are too stubborn to accept it.",
            'Tsubaki',
            'Tsubaki')
        self.say("Yuyuko and I will work on repairing the lantern.",
            'Yukari',
            'Yukari')
        self.say("We'll need to gather some pretty rare parts, so we'll leave getting the lantern oil to you.",
            'Yukari',
            'Yukari')
        self.say("I already tried synthesizing that oil stuff for the lantern.",
            'Marisa',
            'Marisa')
        self.say("How did that go?",
            'Youmu',
            'Youmu')
        self.emote('Nitori', 'scribble')
        self.say("She started a huge fire in my workshop.",
            'Nitori',
            'Nitori')
        self.say("... and I blew up my entire potion creation kit in the process. I'll have to get a new one from Kourin.",
            'Marisa',
            'Marisa')
        self.say("In all seriousness, it'll take me months at best since it's such a complicated process. I've never had to work with anything like this stuff before.",
            'Marisa',
            'Marisa')
        self.emote('Yukari', 'lightbulb')
        self.say("Hmm... one of my crows tells me that Fuyuhana has moved into the Bamboo Forest with Ayaka personally leading their trees.",
            'Yukari',
            'Yukari')
        self.say("This might actually be a good opportunity to us.",
            'Yukari',
            'Yukari')
        self.say("You know, if there's anyone in Gensokyo who can make this lantern oil, I bet that Eirin of Eientei can.",
            'Marisa',
            'Marisa')
        self.say("Do you think she'll help us?",
            'Youmu',
            'Youmu')
        self.say("They won't help us. And you can count out that recluse Kaguya from wanting to get involved.",
            'Mokou',
            'Mokou')
        self.say("That's under normal conditions, Mokou.",
            'Keine',
            'Keine')
        self.say("Lady Yukari, do we know how the battle is progressing?",
            'Ran',
            'Ran')
        self.say("Poorly for Eientei. Ayaka is a calculating general and commands the most experienced of trees. Those cute bunnies don't stand a chance.",
            'Yukari',
            'Yukari')
        self.say("Unlike the Tengu, they don't have a set of well trained soldiers.",
            'Tsubaki',
            'Tsubaki')
        self.say("Maybe they'll agree to help us in exchange for helping to drive the invaders out.",
            'Youmu',
            'Youmu')
        self.startle('Marisa')
        self.say("Sounds like we have a plan.",
            'Marisa',
            'Marisa')
        self.say("Then let's head out to the Bamboo Forest as soon as we're ready.",
            'Youmu',
            'Youmu')
        self.say("I still have some business with the Tengu. You all go ahead. We can meet at the human village.",
            'Yukari',
            'Yukari')

        # Remove everyone but Yuyuko and Youmu
        self.fade_to_color('black', 1.0)
        self.set_unit_pos('Reimu', (-1, -1))
        self.set_unit_pos('Marisa', (-1, -1))
        self.set_unit_pos('Ran', (-1, -1))
        self.set_unit_pos('Chen', (-1, -1))
        self.set_unit_pos('Mokou', (-1, -1))
        self.set_unit_pos('Keine', (-1, -1))
        self.set_unit_pos('Aya', (-1, -1))
        self.set_unit_pos('Tsubaki', (-1, -1))
        self.set_unit_pos('Nitori', (-1, -1))
        self.set_unit_pos('Momiji', (-1, -1))
        self.set_unit_pos('Yukari', (-1, -1))
        self.set_unit_pos('Wolf Tengu A', (-1, -1))
        self.set_unit_pos('Wolf Tengu B', (-1, -1))
        self.set_unit_pos('Youmu', (12, 15))
        self.set_unit_pos('Yuyuko', (13, 15))
        self.fade_from_color('black', 1.0)

        # Youmu and Yuyuko have a conversation together
        self.center_on('Youmu')
        self.say("Ah, Youmu?",
            'Yuyuko',
            'Yuyuko')
        self.say("What is it, milady?",
            'Youmu',
            'Youmu')
        self.say("Youmu, I'm really proud of you. You've led this group this far.",
            'Yuyuko',
            'Yuyuko')
        self.say("To be honest, I was scared when I had found out that you were gone. I thought that I had failed in my duty to protect you.",
            'Youmu',
            'Youmu')
        self.say("No, Youmu. You've done well.",
            'Yuyuko',
            'Yuyuko')
        self.say("Yukari and I will be periodically back in the village, so don't worry too much. Now, off you go!",
            'Yuyuko',
            'Yuyuko')
        self.say("Lady Yuyuko. I won't let you down!",
            'Youmu',
            'Youmu')

        # Remove Youmu from map.
        self.fade_to_color('black', 1.0)
        self.set_unit_pos('Youmu', (-1, -1))
        self.fade_from_color('black', 1.0)

        # Yuyuko monologue
        self.say("Youki Konpaku, are you watching this crisis somewhere in your secluded existence?",
            'Yuyuko',
            'Yuyuko')
        self.say("When you first brought Youmu to me, she was so frail and uncertain of herself.",
            'Yuyuko',
            'Yuyuko')
        self.say("I am happy to have watched her grow through these many years.",
            'Yuyuko',
            'Yuyuko')


        self.say("That concludes the main story of Story of a Lost Sky version 0.9.0. Look forward to missions from the next chapter in the next version!",
            None,
            None)
        self.say("Thanks for playing!",
            None,
            None)

        self.set_cursor_state(True)
        self.set_stats_display(True)
        self.done = True