Sunday 24 May 2020

The Legend of Python: Alejandro's Awakening -- Tail Cave

player = game.spawnPlayerXY("duelist", 36, 30)
player.speed = 17
player.attackDamage = 10
player.maxHealth = 3999
game.addSurviveGoal()
game.addCollectGoal(1)
bossGoal = game.addManualGoal("Defeat the boss")
trap_done = False
game.spawnMaze("forest", 533)
boss_door = game.spawnXY("fence", 44, 52)
end_door = game.spawnXY("fence", 52, 44)
game.spawnXY("forest", 60, 52)
shine = game.spawnXY("gem", 34, 12)
boss = game.spawnXY("ogre-f", 45, 60)
game.spawnXY("forest", 43, 12)
chestu = game.spawnXY("chest", 52, 12)

# What to do when the boss is beaten.
def bossKill():
    player.say("Down 'e goes.")
    boss.destroy()
    game.setGoalState(bossGoal, True)
    end_door.destroy()
game.setActionFor("ogre", "defeat", bossKill)

# Count how many ogres we have beaten.
victories = 0
def scoutDefeated():
    victories += 1
game.setActionFor("scout", "defeat", scoutDefeated)

while True:
    if trap_done == True:
        boss.behavior = "AttacksNearest"
    else:
        boss.behavior = "Collects"
    if player.pos.y < 16 and trap_done == False:
        shine.destroy()
        dorry = game.spawnXY("forest", 12, 20)
        summoner = game.spawnXY("generator", 35, 12)
        summoner.spawnType = "scout"
        summoner.spawnDelay = 10
        while True:
            if victories >= 4:
                summoner.defeat()
                trap_done = True
                dorry.destroy()
                boss_door.destroy()
                player.say("BOSSKEY!!!")
                break
 
         

No comments:

Post a Comment