Beispiel #1
0
def getDampLair():
    monsters = fList.FrequencyList([[AricneaTheSly(), 1]])

    def enter():
        sequel = ""
        if monsters[0].canRespawn():  # if Aricnea is alive...
            sequel = "A faint light glows in distance. A huge skeleton turns to face you."
        else:  # if Aricnea is dead...
            sequel = "Aricnea's bones lie untouched, scattered across the floor."
        output.proclaim(
            "Damp Lair: Cave moss grows on the arched ceiling of the cavern. "
            + sequel)

    def exit():
        output.proclaim("You have left Damp Lair.")

    def getMonster():
        return monsters.getOption(
            condition=lambda monster: monster.canRespawn())

    skeletonCaveActions = [actions.RestHeal(player)]
    skeletonCaveInteractions = [
        [fight.Fight(getMonster), 1],
    ]
    return location.Location("Damp Lair", enter, exit, skeletonCaveActions,
                             skeletonCaveInteractions)
Beispiel #2
0
def getTraineeValley():
    def enter():
        output.proclaim(
            "Trainee Valley: Sparse trees occupy rolling expanses of lush grass. Fort Morning is barely visible in the distant north, while the Silent Forest looms to the east."
        )

    def exit():
        output.proclaim("You have left Trainee Valley.")

    monsters = fList.FrequencyList([[Wolf(), 0.8], [DrunkenTrainee(), 0.2],
                                    [GraglisTheGremlin(), 0.008]])

    def getMonster():
        return monsters.getOption(
            condition=lambda monster: monster.canRespawn())

    traineeValleyActions = [
        actions.RestHeal(player),
        actions.Scavenge(
            player,
            [
                [actions.ScavengeGold(player, 0, 2), 0.98],
                # health, armor, strength, spirit, criticalChance, criticalStrike, dodge
                [shrine.StatShrine([20, 10, 10, 10, 0.1, 1, 0.2], 50), 0.02]
            ]),
        actions.Talk(player, [oldHermit])
    ]
    traineeValleyInteractions = [[actions.Nothing(), 0.8],
                                 [fight.Fight(getMonster), 0.2]]
    return location.Location("Trainee Valley", enter, exit,
                             traineeValleyActions, traineeValleyInteractions)
Beispiel #3
0
def getTheSilentForest():
    def enter():
        output.proclaim(
            "The Silent Forest: Great oaks sway endlessly to the southerly winds. The air's oppression is lifted but briefly at the occasional rustle. Trees obscure the view to Trainee Valley."
        )

    def exit():
        output.proclaim("You have left the Silent Forest.")

    monsters = fList.FrequencyList([[ProwlingFox(), 0.4], [Owl(), 0.35],
                                    [SorcererOutcast(), 0.2],
                                    [SkeletonScout(), 0.04],
                                    [DoomPanda(), 0.01]])

    def getMonster():
        return monsters.getOption(
            condition=lambda monster: monster.canRespawn())

    theSilentForestActions = [
        actions.RestHeal(player),
        actions.Scavenge(
            player,
            [
                [actions.ScavengeGold(player, 0, 4), 0.99],
                # health, armor, strength, spirit, criticalChance, criticalStrike, dodge
                [shrine.StatShrine([20, 10, 10, 10, 0.1, 1, 0.2], 50), 0.01]
            ])
    ]
    theSilentForestInteractions = [[actions.Nothing(), 0.8],
                                   [fight.Fight(getMonster), 0.2]]
    return location.Location("The Silent Forest", enter, exit,
                             theSilentForestActions,
                             theSilentForestInteractions)
Beispiel #4
0
def getFortMorning():
    def enter():
        output.proclaim(
            "Fort Morning: Rough cobblestones pattern the streets of Fort Morning. The din of the market carries loudly to the Southern gate, whose wall protrudes ten feet from the earth below. Merchants frequent the fort, but the eastern wizards rarely visit."
        )

    def exit():
        output.proclaim("You have left the Fort Morning.")

    monsters = fList.FrequencyList([[GiantSewerRat(), 0.8],
                                    [UnholyOoze(), 0.2]])

    def getMonster():
        return monsters.getOption(
            condition=lambda monster: monster.canRespawn())

    fortMorningActions = [
        actions.RestHeal(player),
        actions.Scavenge(player, [[actions.ScavengeGold(player, 0, 3), 1]]),
        actions.Talk(player, [captainJorna]),
        actions.Shop(player, [morningWares, villageArmory])
    ]
    fortMorningInteractions = [[actions.Nothing(), 0.93],
                               [fight.Fight(getMonster), 0.07]]
    return location.Location("Fort Morning", enter, exit, fortMorningActions,
                             fortMorningInteractions)
Beispiel #5
0
def getSkeletonCave():
    def enter():
        output.proclaim(
            "Skeleton Cave: The stone walls smell of rotted flesh. Something here chafes with life."
        )

    def exit():
        output.proclaim("You have left Skeleton Cave.")

    monsters = fList.FrequencyList([[SkeletonWarrior(), 0.4],
                                    [SkeletonArcher(), 0.4], [Ghoul(), 0.2]])

    def getMonster():
        return monsters.getOption(
            condition=lambda monster: monster.canRespawn())

    skeletonCaveActions = [
        actions.RestHeal(player),
        actions.Scavenge(player, [
            [actions.ScavengeGold(player, 2, 6), 0.9],
            [
                actions.FindItem(
                    player, lambda drop:
                    "While exploring the gloomy cave, you stumble across an small iron chest. You find "
                    + str(drop) + ".", [[
                        potions.HealthPotion(
                            "viscous health potion",
                            "a ghoul might have taken a swig", 14, 49, 35), 0.6
                    ],
                                        [
                                            gear.Trinket(
                                                "misplaced femur",
                                                "where could its owner be?",
                                                sellCost=19,
                                                buyCost=59,
                                                stats={"health": 20}), 0.1
                                        ]]), 0.1
            ]
        ])
    ]
    skeletonCaveInteractions = [[actions.Nothing(), 0.7],
                                [fight.Fight(getMonster), 0.3]]
    return location.Location("Skeleton Cave", enter, exit, skeletonCaveActions,
                             skeletonCaveInteractions)