示例#1
0
def b_before_reward(adventure: Adventure):
    battle.qsab(adventure, Location.LAKE, 'A')
    if random.random() < 0.5:
        adventure.add_chapter(MoneyRewardChapter(random.randint(75, 125)))
    else:
        item: Equipment = RandomEquipmentBuilder(0).set_location(Location.ANYWHERE) \
            .choose_rarity([ItemRarity.UNCOMMON, ItemRarity.RARE], [5, 2]).build()
        adventure.add_chapter(ItemRewardChapter(item))
示例#2
0
def ab_around(adventure: Adventure):
    battle.qsab(adventure, Location.LAKE, 'A')
    battle.qsab(adventure, Location.LAKE, 'C')
    if random.random() < 0.5:
        adventure.add_chapter(MoneyRewardChapter(random.randint(175, 225)))
    else:
        item: Equipment = RandomEquipmentBuilder(0).set_location(Location.ANYWHERE) \
            .choose_rarity([ItemRarity.RARE, ItemRarity.EPIC], [5, 2]).build()
        adventure.add_chapter(ItemRewardChapter(item))
示例#3
0
def qsbb(adventure: Adventure,
         bot_entity: BotEntity,
         icon: Emoji = Emoji.BATTLE,
         pre_text: list[str] = None) -> None:
    adventure.add_chapter(
        BattleChapter(BattleGroupUserDelayed(),
                      BattleGroup([bot_entity]),
                      icon=icon,
                      pre_text=pre_text,
                      is_boss=True))
示例#4
0
async def setup(_: 'Command', adventure: Adventure):
    battle.qsab(adventure, Location.LAKE, 'A')
    adventure.add_chapter(
        ChoiceChapter(Emoji.LAKE,
                      tr(adventure.get_lang(),
                         'LAKE.DECISION1_TEXT')).add_choice(
                             Emoji.UP,
                             tr(adventure.get_lang(),
                                'LAKE.DECISION1_OPTION1'), a_deep).add_choice(
                                    Emoji.RIGHT,
                                    tr(adventure.get_lang(),
                                       'LAKE.DECISION1_OPTION2'), b_around))
示例#5
0
def b_around(adventure: Adventure):
    battle.qsab(adventure, Location.LAKE, 'A')
    battle.qsab(adventure, Location.LAKE, 'B')
    adventure.add_chapter(
        ChoiceChapter(Emoji.SEED,
                      tr(adventure.get_lang(),
                         'LAKE.DECISION2_TEXT')).add_choice(
                             Emoji.SEED,
                             tr(adventure.get_lang(),
                                'LAKE.DECISION2_OPTION1'), ba_pick).add_choice(
                                    Emoji.RIGHT,
                                    tr(adventure.get_lang(),
                                       'LAKE.DECISION2_OPTION2'), bb_ignore))
示例#6
0
def ba_pick(adventure: Adventure):
    if random.random() < 0.5:
        bc: BonusChapter = BonusChapter(
            tr(adventure.get_lang(), 'LAKE.DECISION2_RESULT1'))
        if random.random() < 0.5:
            bc.add_modifier(
                StatModifier(Stat.STR, 2, StatModifierOperation.ADD))
        else:
            bc.add_modifier(
                StatModifier(Stat.DEF, 2, StatModifierOperation.ADD))
        adventure.add_chapter(bc)
        battle.qsab(adventure, Location.LAKE, 'A')
    else:
        battle.qsab(
            adventure,
            Location.LAKE,
            'B',
            pre_text=[tr(adventure.get_lang(), 'LAKE.DECISION2_RESULT2')])
    b_before_reward(adventure)
示例#7
0
def aa_deepest(adventure: Adventure):
    battle.qsab(adventure, Location.LAKE, 'C')
    battle.qsab(adventure, Location.LAKE, 'C')
    bc: BonusChapter = BonusChapter(tr(adventure.get_lang(), 'LAKE.EVENT2'))
    bc.add_persistent(Stat.HP, 20)
    adventure.add_chapter(bc)
    ability_ai: AbilityAI = AbilityAI(
        [AbilityDecision(0, 1, AbilityContainer(AbilityEnum.CLAW, 0))])
    boss: BotEntity = battle.rnd(adventure, Location.LAKE, 'BOSS', ability_ai)
    battle.qsbb(adventure,
                boss,
                icon=Emoji.WAVES,
                pre_text=[
                    tr(adventure.get_lang(), 'LAKE.BOSS1'),
                    tr(adventure.get_lang(), 'LAKE.BOSS2'),
                    tr(adventure.get_lang(), 'LAKE.BOSS3')
                ])
    item: Equipment = RandomEquipmentBuilder(0).set_location(
        Location.LAKE).build()
    adventure.add_chapter(ItemRewardChapter(item))
示例#8
0
def a_deep(adventure: Adventure):
    battle.qsab(adventure, Location.LAKE, 'B')
    battle.qsab(adventure, Location.LAKE, 'B')
    bc: BonusChapter = BonusChapter(tr(adventure.get_lang(), 'LAKE.EVENT1'))
    if random.random() < 0.5:
        bc.add_modifier(StatModifier(Stat.EVA, 3, StatModifierOperation.ADD))
    else:
        bc.add_modifier(StatModifier(Stat.CONT, 4, StatModifierOperation.ADD))
    bc.add_persistent(Stat.HP, 4)
    adventure.add_chapter(bc)
    adventure.add_chapter(
        ChoiceChapter(Emoji.LAKE,
                      tr(adventure.get_lang(),
                         'LAKE.DECISION3_TEXT')).add_choice(
                             Emoji.UP,
                             tr(adventure.get_lang(),
                                'LAKE.DECISION3_OPTION1'),
                             aa_deepest).add_choice(
                                 Emoji.RIGHT,
                                 tr(adventure.get_lang(),
                                    'LAKE.DECISION3_OPTION2'), ab_around))
示例#9
0
def aa_deeper(adventure: Adventure):
    battle.qsab(adventure, Location.FOREST, 'C')
    bc = BonusChapter(tr(adventure.get_lang(), 'FOREST.EVENT5'))
    if random.random() < 0.5:
        bc.add_modifier(StatModifier(Stat.EVA, 3, StatModifierOperation.ADD))
    else:
        bc.add_modifier(StatModifier(Stat.SPD, 3, StatModifierOperation.ADD))
    adventure.add_chapter(bc)
    battle.qsab(adventure, Location.FOREST, 'C')

    cc = ChoiceChapter(Emoji.MUSHROOM, tr(adventure.get_lang(), 'FOREST.DECISION4_TEXT'))
    cc.add_choice(Emoji.RED, tr(adventure.get_lang(), 'FOREST.DECISION4_OPTION1'), eat_mushroom(0))
    cc.add_choice(Emoji.BLUE, tr(adventure.get_lang(), 'FOREST.DECISION4_OPTION2'), eat_mushroom(1))
    cc.add_choice(Emoji.GREEN, tr(adventure.get_lang(), 'FOREST.DECISION4_OPTION3'), eat_mushroom(2))
    adventure.add_chapter(cc)

    battle.qsab(adventure, Location.FOREST, 'B')
    ability_ai: AbilityAI = AbilityAI([
        AbilityDecision(0, 0.5, AbilityContainer(AbilityEnum.SUMMON, 100), max_uses=1)
    ])
    boss: BotEntity = battle.rnd(adventure, Location.FOREST, 'BOSS', ability_ai)
    battle.qcsab(adventure, boss,
                 icon=Emoji.FOREST,
                 pre_text=[tr(adventure.get_lang(), 'FOREST.BOSS1'),
                           tr(adventure.get_lang(), 'FOREST.BOSS2'),
                           tr(adventure.get_lang(), 'FOREST.BOSS3')])

    item: Equipment = RandomEquipmentBuilder(0).set_location(Location.FOREST).build()
    adventure.add_chapter(ItemRewardChapter(item))
示例#10
0
async def setup(cmd: 'Command', adventure: Adventure):
    adventure.start_override_text = f"{cmd.user.get_name()} challenged " \
                                    f"{adventure.saved_data['duel_user'].get_name()} to a duel!"
    adventure.add_chapter(DuelAwaitChapter())
示例#11
0
def qtvt(adventure: Adventure, team_a: list['User'],
         team_b: list['User']) -> None:
    adventure.add_chapter(
        BattleChapter(BattleGroup(users=team_a), BattleGroup(users=team_b)))