Exemple #1
0
    def timeout(self):
        if not self.quest.guarding_players:
            gold = GOLD_REWARD_BIG + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

            # Let the invaders in!
            msg = (
                '{0} have secretly managed to collaborate with the Frostguard raiders, letting them all in without '
                'any opposition. For your devious work, everyone is rewarded with {1} gold and {2} exp!'.format(
                    list_to_string(self.quest.party), gold, EXP_REWARD_BIG
                )
            )
            self.channel.send_msg(msg)
            self.reward(self.quest.party, gold=gold, exp=EXP_REWARD_BIG)
        else:
            gold = GOLD_PENALTY + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

            msg = (
                '{0} only managed to defend the {1} {2}. How pitiful. The Frostguard storm the town and murdalize '
                'all the people. Everyone loses {3} gold.'.format(
                    list_to_string(self.quest.party), list_to_string(self.quest.defended_sides),
                    'gate' if len(self.quest.defended_sides) == 1 else 'gates', gold
                )
            )
            self.channel.send_msg(msg)
            self.penalize(self.quest.party, gold=gold)

        self.complete_quest()
Exemple #2
0
    def timeout(self):
        if not self.quest.guarding_players:
            gold = GOLD_REWARD_BIG + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

            # Let the invaders in!
            msg = (
                '{0} have secretly managed to collaborate with the Frostguard raiders, letting them all in without '
                'any opposition. For your devious work, everyone is rewarded with {1} gold and {2} exp!'
                .format(list_to_string(self.quest.party), gold,
                        EXP_REWARD_BIG))
            self.channel.send_msg(msg)
            self.reward(self.quest.party, gold=gold, exp=EXP_REWARD_BIG)
        else:
            gold = GOLD_PENALTY + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

            msg = (
                '{0} only managed to defend the {1} {2}. How pitiful. The Frostguard storm the town and murdalize '
                'all the people. Everyone loses {3} gold.'.format(
                    list_to_string(self.quest.party),
                    list_to_string(self.quest.defended_sides),
                    'gate' if len(self.quest.defended_sides) == 1 else 'gates',
                    gold))
            self.channel.send_msg(msg)
            self.penalize(self.quest.party, gold=gold)

        self.complete_quest()
Exemple #3
0
    def captured(self):
        losers = set(self.quest.party) - set(self.quest.escaped)

        gold_gained = GOLD_REWARD + randint(-GOLD_VARIANCE, GOLD_VARIANCE)
        gold_lost = GOLD_PENALTY + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

        msg = ('In the end, {0} managed to escape from {1} unscathed! {1} happily munches on {2} with terrifying '
               'crunches, snaps, and some odd purring noises. Those that escaped gain {3} gold and {4} exp, '
               'while those left behind lose {5} gold.'.format(
               list_to_string(self.quest.escaped), MONSTER_NAME, list_to_string(losers), gold_gained, EXP_REWARD, gold_lost))
        self.channel.send_msg(msg)
        self.reward(self.quest.escaped, gold=gold_gained, exp=EXP_REWARD)
        self.penalize(losers, gold=gold_lost)

        self.complete_quest()
Exemple #4
0
 def play(self):
     self.channel.send_msg(
         '{0} stand their ground and bravely decide to fight {1}! Surround and attack the !front, !left, and !right '
         'to see if you are strong enough to defeat this massive foe!'.format(
             list_to_string(self.quest.party), MONSTER_NAME
         )
     )
Exemple #5
0
 def play(self):
     msg = (
         'In the Castle of the Mad Yordle, {0} stumbles across a prison full of comrades. But the castle is '
         'collapsing with only time to save one! Do you save {1}?'.format(
             self.quest.party[0], list_to_string(self.quest.party[1:], join_word='or', prefix='!')
         )
     )
     self.channel.send_msg(msg)
Exemple #6
0
    def successful_defense(self):
        gold = GOLD_REWARD + randint(-GOLD_VARIANCE, GOLD_VARIANCE)
        msg = (
            '{0} have successfully held the gates, huzzah! {1} gold and {2} exp for all!'
            .format(list_to_string(self.quest.party), gold, EXP_REWARD))
        self.channel.send_msg(msg)
        self.reward(self.quest.party, gold=gold, exp=EXP_REWARD)

        self.complete_quest()
Exemple #7
0
    def battle(self):
        level = randint(-LEVEL_VARIANCE, LEVEL_VARIANCE) + self.sum_levels(self.quest.attacking_players)
        gold_penalty = GOLD_PENALTY_SMALL + randint(-GOLD_VARIANCE, GOLD_VARIANCE)
        gold_stolen = GOLD_REWARD_MEDIUM + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

        cowards = set(self.quest.party) - set(self.quest.attacking_players)
        coward_message = '{0} slipped away while pocketing {1} gold in the confusion.'.format(list_to_string(cowards),
                                                                                              gold_stolen)

        if level < MONSTER_LEVEL / 2:
            self.channel.send_msg(
                '{0} barely managed to surround {1}, but they were swatted down like flies against a giant spider '
                'with 8 flyswatters. Each lose {2} gold.{3}'.format(
                    list_to_string(self.quest.attacking_players), MONSTER_NAME, gold_penalty,
                    coward_message if cowards else ''
                )
            )
            self.penalize(self.quest.attacking_players, gold=gold_penalty)
            self.reward(cowards, gold=gold_stolen, exp=EXP_REWARD_MEDIUM)
        elif level < MONSTER_LEVEL:
            self.channel.send_msg(
                '{0} surrounded {1} and seemed like they had a chance to win, but ended up tactically repositioning '
                'somewhere...anywhere else. Each lose {2} gold.{3}'.format(
                    list_to_string(self.quest.party), MONSTER_NAME, gold_penalty, coward_message if cowards else ''
                )
            )
            self.penalize(self.quest.attacking_players, gold=gold_penalty)
            self.reward(cowards, gold=gold_stolen, exp=EXP_REWARD_MEDIUM)
        else:
            gold = GOLD_REWARD_BIG + randint(-GOLD_VARIANCE, GOLD_VARIANCE)
            self.channel.send_msg(
                '{0} gracefully and brilliantly surrounded {1}, launching devastating blow after blow in a coordinated '
                'joint assault! {1} has been defeated! Woohoo! Everyone gains {2} gold and {3} exp!'.format(
                    list_to_string(self.quest.party), MONSTER_NAME, gold, EXP_REWARD_BIG
                )
            )
            self.reward(self.quest.party, gold=gold, exp=EXP_REWARD_BIG)

            self.drop_item(self.quest.attacking_players, DROP_ITEM, DROP_CHANCE,
                           'After the battle, you manage to salvage something valuable from the corpse of {0}!'.format(
                               MONSTER_NAME))

        self.complete_quest()
Exemple #8
0
    def successful_defense(self):
        gold = GOLD_REWARD + randint(-GOLD_VARIANCE, GOLD_VARIANCE)
        msg = (
            '{0} have successfully held the gates, huzzah! {1} gold and {2} exp for all!'.format(
                list_to_string(self.quest.party), gold, EXP_REWARD
            )
        )
        self.channel.send_msg(msg)
        self.reward(self.quest.party, gold=gold, exp=EXP_REWARD)

        self.complete_quest()
Exemple #9
0
    def timeout(self):
        if len(self.quest.attacked_sides) == 3:
            self.battle()
            return

        gold = GOLD_PENALTY + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

        if self.quest.attacked_sides:
            self.channel.send_msg(
                '{0} just attacked {1}, so {2} tore everyone to shreds. And then shredded those shreds. '
                'Everyone loses {3} gold.'.format(
                    list_to_string(self.quest.party), list_to_string(self.quest.attacked_sides, prefix='the '),
                    MONSTER_NAME, gold
                )
            )
        else:
            self.channel.send_msg(
                '{0} mistook stupidity for bravery, and rectified the mistake by promptly devouring {1}. '
                'Everyone loses {2} gold'.format(MONSTER_NAME, list_to_string(self.quest.party),  gold)
            )
        self.penalize(self.quest.party, gold=gold)

        self.complete_quest()
Exemple #10
0
    def pick(self, display_name, saved):
        # Has to be the first player to be valid input
        if display_name != self.quest.party[0]:
            return

        gold_gained = GOLD_REWARD + randint(-GOLD_VARIANCE, GOLD_VARIANCE)
        gold_lost = GOLD_PENALTY + randint(-GOLD_VARIANCE, GOLD_VARIANCE)

        forsaken_adventurers = [player for player in self.quest.party if player != display_name and player != saved]
        msg = (
            '{0} decided to save {1}! {2} are left behind and crushed under the rubble of the collapsing castle, '
            'losing {3} gold. {0} and {1} gain {4} gold and {5} exp!'.format(
                display_name, saved, list_to_string(forsaken_adventurers), gold_lost, gold_gained, EXP_REWARD
            )
        )
        self.channel.send_msg(msg)
        self.reward([display_name, saved], gold=gold_gained, exp=EXP_REWARD)
        self.penalize(forsaken_adventurers, gold=gold_lost)

        self.complete_quest()
Exemple #11
0
 def play(self):
     msg = (
         '{} are defending an Avorosan town from a Frostguard invasion! Split up and defend the '
         '!north, !south, !east, and !west gates!'.format(
             list_to_string(self.quest.party)))
     self.channel.send_msg(msg)
Exemple #12
0
 def play(self):
     msg = '{0} are all running away from a rampaging {1}! Quick, type {2} to get away!'.format(
         list_to_string(self.quest.party), MONSTER_NAME, self.quest.escape_word)
     self.channel.send_msg(msg)
Exemple #13
0
 def play(self):
     msg = (
         '{} are defending an Avorosan town from a Frostguard invasion! Split up and defend the '
         '!north, !south, !east, and !west gates!'.format(list_to_string(self.quest.party))
     )
     self.channel.send_msg(msg)