Results 1 to 8 of 8

Thread: Challenge roller

Threaded View

  1. #1
    Join Date
    Mar 2008
    Location
    Kentucky
    Posts
    5,067

    Default Challenge roller

    This post is regarding a challenge bot that has been implimented on #adom on freenode.

    I did most of the blue collar programming on it myself (which explains its ugly/nonsensical structure), but was
    turned into an actual working bot by somebody who actually knows what they are doing. For now it only gives
    quests such as 'kill a mimic/rust monster' or 'find a mithril sword' 'by turn 5000' or such. Very few options
    for now, only 3 or 4 types of monsters/items. I really just posted the idea to see if it was possible, and was
    quite surprised to wake up to a working bot.

    So now it is time to try to expand it by adding more quests, and even assigning points based on quest difficulty.
    I think the lists we used for the last mission impossible challenge could be referred to for assigning points
    based on class, meaning rolling a wiz would give maybe 1 point, but a thief 5? For now I have separated them
    into 3 catagories, 11 in the wiz/archer/barb class, 5 in the assassin/ranger area, and 4 in the farmer/merchant
    catagory. I can't really see how a scale of points for race would work, except to give humans +1 for suckiness,
    while giving drakes -1 for awesome? Problem is, trolls would probably do better on most quests than drakes, as
    I tried to keep the quests rather short. Maybe limiting them to 20 minutes type things? Maybe things that could
    be accomplished in 5000 turns?

    Anyhow, I will post what I have so far (minus blokem's code, that actually makes it work ) in hopes of ideas
    regarding a point system, quest options, and other various feedbacks.

    EDIT: please ignore this code, the next is the one with point system
    Code:
    import random
    
    INTRO = 'Your challenge is to roll a'
    RACE = ['human', 'troll', 'high elf', 'gray elf', 'dark elf', 'dwarf', 'gnome', 'hurthling', 'orc', 'drakeling']
    CLASS1 = ['wizard.', 'fighter.', 'paladin.', 'priest.', 'monk.', 'archer.', 'barbarian.', 'druid.', 'necromancer.', 'elementalist.', 'beastfighter.']
    CLASS2 = ['assassin.', 'ranger.', 'bard.', 'healer.', 'weaponsmith.']
    CLASS3 = ['merchant.', 'thief.', 'mindcrafter.', 'farmer.']
    
    QUEST_TYPE = ['return the cute puppy to the tiny girl ', 'kill ', 'find ', 'commit suicide in ']
    QUEST_MONSTER = ['a mimic ', 'a rust monster ', 'a master swordsman ', 'a ratling duelist ']
    QUEST_ITEM = ['an amulet of willpower ', 'a mithril shield ', 'a mithril sword' , 'pair of mithril boots ']  
    LOCATION = ['the pyramid, \ndungeon level 3, ', 'GriffYard, \ndungeon level 2, ', ' the tomb of the high kings, \ndungeon level 6, ', 'caverns of chaos, \ndungeon level 15, ']
    TURN_COUNT = ['5000', '6000', '8000', '10000']
    
    CRUEL_RESTRICTION = ['cruel restriction, you must drop all your \nitems in the wilderness on turn 1.', 'cruel restriction, you must pray until your \ninventory is cursed upon game start.', 'cruel restriction, you must pray until you are doomed upon game start.', 'cruel restriction, you must forego all armor \nfor 5000 turns, starting on game turn 1.', 'cruel restriction, you must forego melee attacks \nfor 5000 turns, starting on game turn 1.']
    RESTRICTION = ['restriction, you must drop all your \nfood in the wilderness upon game start.', 'restriction, you must kick the air until \nyour HPs are under 5 upon game start.', 'restriction, you must forego all armor for 2000 turns.', 'restriction, you must forego melee attacks \nfor 2000 turns, starting on game turn 1.', 'restriction, you must not intentionally acquire the detect traps skill.']
    
    def Choose_Quest():
        RNG = random.randrange(0, 4, 1)
        if RNG == 0:
            a = QUEST_TYPE[0]
            b = 'by turn count '
            c = Choose_Turns()
            d = '.'
            return a+b+c+d
        if RNG == 1:
            a = QUEST_TYPE[1]
            b = Choose_Monster()
            c = 'by turn count '
            d = Choose_Turns()
            e = '.'
            return a+b+c+d+e
        if RNG == 2:
            a = QUEST_TYPE[2]
            b = Choose_Item()
            c = 'by turn count '
            d = Choose_Turns()
            e = '.'
            return a+b+c+d+e
        if RNG == 3:
            a = QUEST_TYPE[3]
            b = Choose_Location()
            c = 'by turn count '
            d = Choose_Turns()
            e = '.'
            return a+b+c+d+e
    
    def Choose_Turns():
        RNG = random.randrange(0, 4, 1)
        if RNG == 0:
            return TURN_COUNT[0]
        if RNG == 1:
            return TURN_COUNT[1]
        if RNG == 2:
            return TURN_COUNT[2]
        if RNG == 3:
            return TURN_COUNT[3]
    
    def Choose_Monster():
        RNG = random.randrange(0, 4, 1)
        if RNG == 0:
            return QUEST_MONSTER[0]
        if RNG == 1:
            return QUEST_MONSTER[1]
        if RNG == 2:
            return QUEST_MONSTER[2]
        if RNG == 3:
            return QUEST_MONSTER[3]
    
    def Choose_Item():
        RNG = random.randrange(0, 4, 1)
        if RNG == 0:
            return QUEST_ITEM[0]
        if RNG == 1:
            return QUEST_ITEM[1]
        if RNG == 2:
            return QUEST_ITEM[2]
        if RNG == 3:
            return QUEST_ITEM[3]
    
    def Choose_Location():
        RNG = random.randrange(0, 4, 1)
        if RNG == 0:
            return LOCATION[0]
        if RNG == 1:
            return LOCATION[1]
        if RNG == 2:
            return LOCATION[2]
        if RNG == 3:
            return LOCATION[3]
    
    def Choose_Race():
        RNG = random.randrange(0, 10, 1)
        if RNG == 0:
            return RACE[0]
        if RNG == 1:
            return RACE[1]
        if RNG == 2:
            return RACE[2]
        if RNG == 3:
            return RACE[3]
        if RNG == 4:
            return RACE[4]
        if RNG == 5:
            return RACE[5]
        if RNG == 6:
            return RACE[6]
        if RNG == 7:
            return  RACE[7]
        if RNG == 8:
            return RACE[8]
        if RNG == 9:
            return RACE[9]
    
    def Choose_Class():
        RNG = random.randrange(0, 20, 1)
        if RNG == 0:
            return CLASS1[0]
        if RNG == 1:
            return CLASS1[1]
        if RNG == 2:
            return CLASS1[2]
        if RNG == 3:
            return CLASS1[3]
        if RNG == 4:
            return CLASS1[4]
        if RNG == 5:
            return CLASS1[5]
        if RNG == 6:
            return CLASS1[6]
        if RNG == 7:
            return CLASS1[7]
        if RNG == 8:
            return CLASS1[8]
        if RNG == 9:
            return CLASS1[9]
        if RNG == 10:
            return CLASS1[10]
        if RNG == 11:
            return CLASS2[0]
        if RNG == 12:
            return CLASS2[1]
        if RNG == 13:
            return CLASS2[2]
        if RNG == 14:
            return CLASS2[3]
        if RNG == 15:
            return CLASS2[4]
        if RNG == 16:
            return CLASS3[0]
        if RNG == 17:
            return CLASS3[1]
        if RNG == 18:
            return CLASS3[2]
        if RNG == 19:
            return CLASS3[3]
    
    def Choose_Restriction():
        RNG = random.randrange(0, 5, 1)
        if RNG == 0:
            RNG = random.randrange(0, 5, 1)
            if RNG == 0:
                return CRUEL_RESTRICTION[0]
            if RNG == 1:
                return CRUEL_RESTRICTION[1]
            if RNG == 2:
                return CRUEL_RESTRICTION[2]
            if RNG == 3:
                return CRUEL_RESTRICTION[3]
            if RNG == 4:
                return CRUEL_RESTRICTION[4]
        else:
            RNG = random.randrange(0, 5, 1)
            if RNG == 0:
                return RESTRICTION[0]
            if RNG == 1:
                return RESTRICTION[1]
            if RNG == 2:
                return RESTRICTION[2]
            if RNG == 3:
                return RESTRICTION[3]
            if RNG == 4:
                return RESTRICTION[4]
    
    def Challenge():
            print INTRO, Choose_Race(), Choose_Class()
            print 'You must', Choose_Quest()
            print 'As a', Choose_Restriction(), '\n'
    
    Challenge()
    P.S.
    The purpose (or at least intention) behind all the 'if' statements is that is how I intended to add in
    a points system, before realizing I didn't really know what I was doing. Why should I let a little
    thing like that stop me?
    Last edited by gut; 10-21-2011 at 06:19 PM.
    "Whip me!" pleads the adom player. The rng replies... "No."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •