Esempio n. 1
0
def main():
    print("------Testing Player------")
    Joe = mainPlayer.mainPlayer("Joe")
    Joe.displayStats()
    Joe.levelUp()
    print()
    print("------Testing NPCs------")
    maleficent = NPC.NPC("Zombie")
    maleficent.displayStats()
    print()
    print("------Testing Invalid Input------")
    Anna = mainPlayer.mainPlayer("Max", 0, -1, 0, 0)
    Jacquie = mainPlayer.mainPlayer("Max", 0, 0, -1, 0)
    Isabel = mainPlayer.mainPlayer("Max", 0, 0, 0, -1)
    Max = mainPlayer.mainPlayer("Max", -1, 0, 0, 0)
    Max.displayStats()
    print()
    print("------Testing Attack Win------")
    Joe.attackNPC(maleficent)
    Joe.displayStats()
    print()
    print("------Testing Attack Loss------")
    hades = NPC.NPC("Vampire", 5, 5, 5)
    hades.displayStats()
    Joe.attackNPC(hades)
    Joe.displayStats()
    print()
    print("------Testing Attack Tie------")
    hades = NPC.NPC("Vampire", 2, 2, 2)
    hades.displayStats()
    Joe.displayStats()
    Joe.attackNPC(hades)
    Joe.displayStats()
Esempio n. 2
0
 def make_vil(self):
     sx = self.sizex
     sy = self.sizey
     nwpos = (2, 2)
     for i in range(0, 6):
         for j in range(0, 6):
             self.storage[i + nwpos[0]][j + nwpos[1]].set_terrain('1')
             self.vilposes.append((i + nwpos[0], j + nwpos[1]))
     for i in range(3, 5):
         for j in range(0, 2):
             if (i == 3):
                 if (j == 0):
                     self.storage[i +
                                  nwpos[0]][j +
                                            nwpos[1]].set_terrain('3_h_1')
                 elif (j == 1):
                     self.storage[i +
                                  nwpos[0]][j +
                                            nwpos[1]].set_terrain('3_h_4')
             if (i == 4):
                 if (j == 0):
                     self.storage[i +
                                  nwpos[0]][j +
                                            nwpos[1]].set_terrain('3_h_2')
                 elif (j == 1):
                     self.storage[i +
                                  nwpos[0]][j +
                                            nwpos[1]].set_terrain('3_h_3')
     self.storage[6][4].set_terrain('3_h_w')
     self.storage[7][2].set_terrain('3_h_b')
     self.storage[7][3].set_terrain('3_h_b2')
     self.storage[3][6].set_terrain('3_h_t')
     npc = NPC((2, 6), '1')
     self.add_npc(npc)
Esempio n. 3
0
def load_npc(session):
    # load bestiary
    with open(r"NPCS.csv", encoding='utf-8') as csvfile:
        spam_reader = csv.DictReader(csvfile, delimiter=',', quotechar='"')
        creature_list = []
        npc_list = []
        for row in spam_reader:
            # Create new entries
            new_npc = NPC(row)
            session.add(new_npc)
            #creature_list.append(new_npc.creature)
            session.add(new_npc.creature)
            #npc_list.append(new_npc)
        session.commit()
        # max_entries = 5
        # num_creatures = max_entries
        # for creature in creature_list:
        #     num_creatures -= 1
        #     if num_creatures <= 0:
        #         break
        # session.commit()
        #
        # num_npcs = max_entries
        # for npc in npc_list:
        #     session.add(npc)
        #     num_npcs -= 1
        #     if num_npcs <= 0:
        #         break
        # session.commit()

    print("num creatures: " +
          str(session.query(func.count(Creature.Id)).scalar()))
Esempio n. 4
0
 def initNPC(self):
     npc = shopOwner("ImmortalMammal", self.gameTime["Hour"])
     self.npcList = []
     self.npcList.append(npc)
     npc = NPC("Amy", self.gameTime["Hour"])
     self.npcList.append(npc)
     npc = NPC("Katie", self.gameTime["Hour"])
     self.npcList.append(npc)
     npc = NPC("Kim", self.gameTime["Hour"])
     self.npcList.append(npc)
     self.customer = None
     self.npcGroup = pygame.sprite.Group()
     self.objects = self.room.objects
     self.objectGroup = pygame.sprite.Group()
     for objects in self.objects:
         self.objectGroup.add(objects)
Esempio n. 5
0
def receive_connection(Non):
    global receive_socket
    global entity_dict
    global p

    try:
        message = receive_socket.recv(zmq.NOBLOCK).decode()
        m = NetMessage(message)
    except zmq.Again:
        return

    print(Fore.RED + "RECEIVE: " + message)

    # If gets your own ID
    if (m.type == "PLAYER_ID"):
        entity_dict[int(m.data)] = p
        p.id = int(m.data)

    # If gets individual entity information
    elif (m.type == "ENTITY_INFO"):
        id, ent_data = m.data.split("#")
        id = int(id)
        ent_data = ent_data.split(";")
        if (id > 0):
            if (id == p.id):
                return
            entity_dict[id] = Player([int(x) for x in ent_data[0].split(",")],
                                     [int(x) for x in ent_data[1].split(",")],
                                     ent_data[2])
        else:
            entity_dict[id] = NPC([int(x) for x in ent_data[0].split(",")],
                                  [int(x) for x in ent_data[1].split(",")],
                                  ent_data[2])
            entity_dict[id].load()
Esempio n. 6
0
def load(gameobj):
    print("LOADING....")
    name = "levels/%s.lvl" % gameobj.loadname
    print(name)

    with open(name, "rb") as file:
        gameobj.blocklist, tempEntList, XMG, YMG, startX, startY, SG = pickle.load(
            file)

    gameobj.blocksetlist.clear()
    gameobj.poslist.clear()
    gameobj.entlist.clear()
    gameobj.entlist = []

    gameobj.player.startPos.x = startX
    gameobj.player.startPos.y = startY
    mapDict["XMAX_GRID"] = XMG
    mapDict["YMAX_GRID"] = YMG
    globDict["scoregoal"] = SG

    mapDict["MAP_WIDTH"] = mapDict["GRID_SIZE"] * mapDict["XMAX_GRID"]
    mapDict["MAP_HEIGHT"] = mapDict["GRID_SIZE"] * mapDict["YMAX_GRID"]

    coordx = 0
    coordy = 0

    gameobj.poslist = [[] for p in range(mapDict["YMAX_GRID"])]

    for i in range(mapDict["XMAX_GRID"] * mapDict["YMAX_GRID"]):
        gameobj.poslist[coordy].append(i)
        if coordx == mapDict["XMAX_GRID"] - 1:
            coordx = 0
            coordy += 1
        else:
            coordx += 1

    for block in gameobj.blocklist:
        if block.blockType == "tower":
            setblock = Tower(block.x, block.y, block.size, block.blockType,
                             gameobj.player, block.range)
            setblock.rofMax = block.rofMax
        elif block.blockType == "respawntower":
            setblock = RespawnTower(block.x, block.y, block.size,
                                    block.blockType, gameobj.player)
        elif block.blockType == "end":
            setblock = EndTower(block.x, block.y, block.size, block.blockType,
                                gameobj.player)
        else:
            setblock = BlockSet(block.x, block.y, block.size, block.blockType)
        gameobj.blocksetlist.append(setblock)
    del gameobj.blocklist

    for ent in tempEntList:
        setent = NPC(ent.x, ent.y, ent.size, ent.blockType, gameobj.player,
                     ent.range)
        setent.rofMax = ent.rofMax
        gameobj.entlist.append(setent)
    del tempEntList
Esempio n. 7
0
def main():
    root = Tk()
    root.geometry("600x600")
    canvas = Canvas(root, width=500, height=500)
    canvas.pack()
    app = Map(root)
    # Create grid
    app.draw_grid(canvas=canvas)

    npc1 = NPC(canvas=canvas)
    npc1.draw()

    root.mainloop()
Esempio n. 8
0
def initMatrix(self, window, map, keyowned, oldcurrentlevel):
    player = None
    self.mapmatrix = []
    for i in range(map.tmxdata.height):
        self.mapmatrix.append([])
        for j in range(map.tmxdata.width):
            self.mapmatrix[i].append(0)
    for object in map.tmxdata.objects:
        if object.name == 'o':
            self.mapmatrix[int(object.y / 16)][int(object.x / 16)] = 1
        if object.name.startswith('player') and int(
                object.name[6:]) == oldcurrentlevel:
            player = Player.Player(object.x, object.y,
                                   int(object.properties['speed']),
                                   "textures/link.png",
                                   [1, 1, 1, 1, 10, 10, 10, 10], 3)
            player.entities.remove(player)
            player.entities.insert(0, player)
            if keyowned:
                player.key = True
                player.keyowned = True
                player.inventory.addItem(window, "key")
        if object.name == 'enemy':
            nbAnimsFrames = []
            for i in object.properties['nbAnimsFrames'].split(','):
                nbAnimsFrames.append(int(i))
            pattern = []
            for i in object.properties['pattern'].split(','):
                pattern.append([])
                for j in i.split(';'):
                    pattern[len(pattern) - 1].append(int(j))
            Enemy.Enemy(object.x, object.y, int(object.properties['speed']),
                        object.properties['texture'], nbAnimsFrames, 2,
                        pattern)
        if object.name == 'npc':
            nbAnimsFrames = []
            for i in object.properties['nbAnimsFrames'].split(','):
                nbAnimsFrames.append(int(i))
            pattern = []
            for i in object.properties['pattern'].split(','):
                pattern.append([])
                for j in i.split(';'):
                    pattern[len(pattern) - 1].append(int(j))
            NPC.NPC(object.x, object.y, int(object.properties['speed']),
                    object.properties['texture'], nbAnimsFrames, 2, pattern,
                    object.properties['dialog'])
        if object.name == "anthony":
            Anthony.Anthony(int(object.properties['minX']),
                            int(object.properties['maxX']),
                            int(object.properties['minY']),
                            int(object.properties['maxY']))
Esempio n. 9
0
    def save(self, path, gene=False):
        if str(self.id) + '.pkl' not in os.listdir(path):
            if gene:
                path1 = path + '/objsgene'
                path2 = path + '/npcsgene'
            else:
                path1 = path + '/objs' + str(self.id)
                path2 = path + '/npcs' + str(self.id)
            if not os.path.exists(path1):
                os.makedirs(path1)
            if not os.path.exists(path2):
                os.makedirs(path2)

            path1 += '/'
            for obj in self.objects:
                obj1 = Object.Object(name=obj.name,
                                     info=obj.info,
                                     usages=obj.usages,
                                     image=obj.image_n,
                                     w=obj.w,
                                     h=obj.h)
                obj1.image = None
                self.save_by_name(path1 + obj1.name, obj1)

            path2 += '/'
            for npc in self.npcs:
                npc1 = NPC.NPC(game_display=None,
                               name=npc.name,
                               dialogs=npc.dialogs,
                               acts=npc.acts)
                self.save_by_name(path2 + npc1.name, npc1)
            try:
                if gene:
                    self.save_by_name(path + 'gene', self)
                else:
                    self.save_by_name(path + str(self.id), self)
            except Exception:
                pass

        if self.left is not None:
            if str(self.left.id) + '.pkl' not in os.listdir(path):
                self.left.save(path)
        if self.right is not None:
            if str(self.right.id) + '.pkl' not in os.listdir(path):
                self.right.save(path)
        if self.up is not None:
            if str(self.up.id) + '.pkl' not in os.listdir(path):
                self.up.save(path)
        if self.down is not None:
            if str(self.down.id) + '.pkl' not in os.listdir(path):
                self.down.save(path)
Esempio n. 10
0
    def __init__(self, dungeonObject, color, numSpawners):
        self.NPCObject = NPC.NPC(356, Display.GAME_SCREEN_START + 56, self,
                                 "Hey! you found me! youre a dick")
        self.winNPC = NPC.NPC(
            356, Display.GAME_SCREEN_START + 56, self,
            "You killed all the spawners. How could you do that? They were endangered. I hope you're happy. Dick"
        )
        self.merchant = Shopkeeper.Shopkeeper(356,
                                              Display.GAME_SCREEN_START + 300,
                                              self,
                                              "Hello friend! Let's trade!")
        self.text = ""
        self.color = color
        self.width = Display.SCREEN_WIDTH
        self.height = Display.SCREEN_HEIGHT
        self.x = 0
        self.y = 0

        #x, y, True if player enters this door, connected room,

        #self.doors =   {'leftDoor': [0, Display.SCREEN_HEIGHT/2, None, 'leftDoor'],
        #                'rightDoor': [Display.SCREEN_WIDTH-DOOR_WIDTH, Display.SCREEN_HEIGHT/2, None, 'rightDoor'],
        #                'upDoor': [Display.SCREEN_WIDTH/2, Display.GAME_SCREEN_START, None, 'upDoor'],
        #                'downDoor': [Display.SCREEN_WIDTH/2, Display.SCREEN_HEIGHT - DOOR_LENGTH, None, 'downDoor']}
        self.doors = [-1, -1, -1, -1]
        Dungeon.listDoors.extend(self.doors)
        self.currentRoom = True
        self.index = dungeonObject.numRooms
        self.playerObj = dungeonObject.playerObj
        self.dungeonObject = dungeonObject
        self.hasSpawners = False
        self.spawnnerlist = []
        self.enemylist = []
        for i in range(0, numSpawners):
            self.hasSpawners = True
            self.spawnnerlist.append(
                Spawnner.Spawnner(self.playerObj, self.enemylist))
        Dungeon.numRooms += 1
Esempio n. 11
0
 def make_smallvil(self):
     qpos = random.randint(1, 2)
     if (qpos == 1):
         nwpos = (1, 2)
     elif (qpos == 2):
         nwpos = (7, 2)
     for i in range(0, 2):
         for j in range(0, 2):
             self.storage[i + nwpos[0]][j + nwpos[1]].set_terrain('1')
             self.vilposes.append((i + nwpos[0], j + nwpos[1]))
     self.storage[nwpos[0] + 1][nwpos[1]].set_terrain('3_h_w')
     self.storage[nwpos[0]][nwpos[1]].set_terrain('3_h_s')
     npc = NPC((nwpos[0], nwpos[1] + 1), str(random.randint(2, 3)))
     self.add_npc(npc)
Esempio n. 12
0
 def __init__(self, canvasWidth, canvasHeight, player):
     self.pic = Animation("Village Entrance", 2, 15)
     self.canvasWidth = canvasWidth
     self.canvasHeight = canvasHeight
     self.font = createFont("zx_spectrum-7.ttf", 96)
     self.player = player
     self.testBox = Readout(0, canvasHeight*4/5, canvasWidth, canvasHeight/5, "Ayup...It's Harvest Time.")
     self.enterArrows = ArrowChoiceBar(canvasWidth*19/20, canvasHeight*19/20, canvasWidth/5, canvasHeight/5, True, False, False, False)
     self.board = Board(canvasWidth, canvasHeight, "Village", 2, 2, 1)
     self.pharmacist = NPC("cody")
     self.apothePlate = TriggerPlate(canvasWidth*4/5 - canvasWidth/50, canvasHeight*2/5, canvasWidth/20, canvasHeight/20, "apothe", self.player)
     self.leaveApothe = TriggerPlate(self.canvasWidth/2 - self.canvasWidth/40, self.canvasHeight - self.canvasHeight/20, self.canvasWidth/20, self.canvasHeight/20, "village-2", self.player)
     self.talkToApothePlate = TriggerPlate(self.canvasWidth/2 - self.canvasWidth/40, self.canvasHeight/2 + self.canvasHeight/10, self.canvasWidth/20, self.canvasHeight/20, "talkToApothe", self.player)
     self.villagePlates = [self.apothePlate, self.talkToApothePlate, self.leaveApothe] # For checking the plates
     self.apothePopup = Popup("apotheTrade.txt", player, canvasWidth, canvasHeight)
def randomNPC():
    if timePeriod == "colonial":
        health = random.randint(25,50)
    elif timePeriod == "1940s":
        health = random.randint(50,100)
    elif timePeriod == "1980s":
        health = random.randint(65,100)
    weapon = random.randint(0,2)
    enemy = random.randint(0,2)
    if enemy == 0:
        isEnemy = True
    else:
        isEnemy = False
    if isEnemy:
        linePossibilities=["You're new around here. Be careful who you bump into.","You never should have come here!","Let's see what you're made of.","You're walking around like you own the place.","If you just turn around, no one will get hurt."]
        repeatLinePossibilities=["I'm itching to fight you.","Back for more?","You know, you should never back down from a fight.","Time to put you in your place!","Someone doesn't know how to listen."]
    else:
        linePossibilities = ["Hello, traveler.","Greetings, stranger.","Who are you?","You're not from around here, are you?","What's with your funny looking clothes?"]
        repeatLinePossibilities = ["Hello again, traveler.","Hello again, stranger.","I still don't entirely trust you.","Now stay on your best behavior.","Now I'm not sure I can believe anything you say."]
    line = random.randint(0,4)
    return NPC.NPC(timePeriod,linePossibilities[line],repeatLinePossibilities[line],health,itemList[weapon],isEnemy,False)
Esempio n. 14
0
    def __init__(self, obj):
        attribs = obj.attrib

        # set requried attributes
        self.name = attribs["name"]
        self.shortdesc = attribs["shortdesc"]

        # set unrequired attributes
        self.longdesc = attribs["longdesc"] if "longdesc" in attribs.keys(
        ) else self.shortdesc

        self.visit_count = 0
        self.children = []
        self.children_names = []

        # instantiate children locations, npcs and features
        for element in obj:
            if element.tag == "Location":
                self.children.append(Location(element))
                self.children_names.append(element.attrib["name"])
            elif element.tag == "Feature":
                # features are simply objects that can be interacted with and nothing more
                self.children_names.append(element.attrib["name"])
                self.children.append({
                    "name": element.attrib["name"],
                    "text": element.text,
                    "type": "Feature"
                })
            elif element.tag == "NPC":
                self.children.append(NPC.NPC(element))
                self.children_names.append(element.attrib["name"])

        # add each parent to the child's options so you can go back from a location or NPC
        for child in self.children:
            if type(child) == Location or type(child) == NPC.NPC:
                child.children_names.append(self.name)
                child.children.append(self)
Esempio n. 15
0
def main():
    print('Program is Running')
    current_PC_pool = []
    current_NPC_pool = []
    selected_PCs = []
    selected_NPCs = []
    check_parameters = []

    # TODO: Remove these 8 lines when working
    test_PC = PC.PC('Malcolm', 5, 5, 5, 5, 20)
    test_PC2 = PC.PC('Amy', 5, 5, 5, 5, 20)
    test_NPC = NPC.NPC('Guard1', 2, 2)
    test_NPC2 = NPC.NPC('Guard2', 2, 2)
    selected_PCs.append(test_PC)
    selected_PCs.append(test_PC2)
    selected_NPCs.append(test_NPC)
    selected_NPCs.append(test_NPC2)

    outermost_loop_variable = True

    # Follows are the various menus that the user will be navigating
    def display_main_menu():
        print('Welcome to the stealth simplifier app.'
              '\nMore options to come in future editions.'
              '\n----------'
              '\n1)Setup and run stealth checks.'
              '\n2)Exit program.')

    # One menu deep, this is where PCs and NPCs will be chosen and

    def display_setup_menu():
        print('----------'
              '\nSetup Menu'
              '\n----------'
              '\n1)Create PC\'s to add to the Current PC\'s Pool'
              '\n2)Create NPC\'s to add to the Current NPC\'s Pool')

        if current_PC_pool:
            print('3)Select PC from Current PC\'s Pool')

        if current_NPC_pool:
            print('4)Select NPC from Current NPC\'s Pool')

        if len(selected_NPCs) >= 1 and len(selected_PCs) >= 1:
            print(
                '5)Run Stealth Checks with currently selected NPC\'s and PC\'s.'
            )
            selections_display()
        print('X) Exit this menu to main menu.\n')

    def selections_display():
        print('---Selected PC\'s---')
        for pc in selected_PCs:
            print(pc.name)
        print('---Selected NPC\'s---')
        for npc in selected_NPCs:
            print(npc.name)

        # print(tabulate(selected_PCs, headers=["Selected PC's"], tablefmt="pipe"))
        # print(tabulate(selected_NPCs, headers=["Selected NPC's"], tablefmt="pipe"))

    def display_pc_pool():
        menu_counter = 0
        print('Currently created PC\'s\n--------------------------')
        for pc in current_PC_pool:
            menu_counter = menu_counter + 1
            print('{}) {}'.format(menu_counter, pc.name))

    def display_npc_pool():
        menu_counter = 0
        print('Currently created NPC\'s\n--------------------------')
        for npc in current_NPC_pool:
            menu_counter = menu_counter + 1
            print('{}) {}'.format(menu_counter, npc.name))

    def display_terrain_mods():
        print('---Terrain Modifiers---')
        print(
            '1) No terrain modifier\n'
            '2) Noisy (scree, shallow or deep bog, undergrowth, dense rubble)\n'
            '3) Very noisy (dense undergrowth, deep snow)')

    def display_speed_mod_options():
        print('---Speed Modifiers---')
        print('1) Moving Up To Half Speed (No Modifier)\n'
              '2) Moving Up To Full Speed (-5)\n'
              '3) Moving Full Speed or Faster (-20)\n')

    # add pcs to pool

    def add_NPC_to_pool():
        stats_list = []
        name = input('What is the Character\'s name?')
        stats_list.append(name)
        # TODO: Switch it so instead of "Character's" it actually says the name.
        # I had to use seperate and repeating try/except/while loops to achieve the results I wanted.
        # I wanted the user to only have to input a single piece of information again should something be entered wrong.
        while True:
            try:
                spot_mod = int(
                    input('What is the Character\'s Spot Modifier?'))
                stats_list.append(spot_mod)
                break
            except ValueError:
                print('That was not a valid number please enter an integer.')
        while True:
            try:
                listen_mod = int(
                    input('What is the Character\'s Listen Modifier?'))
                stats_list.append(listen_mod)
                break
            except ValueError:
                print('That was not a valid number please enter an integer.')
        #         Pass these stats back out.  This is so that I could reuse this code for the PC createion as well.
        return stats_list

    def add_PC_to_pool():
        # TODO: Add a detector for whatever symbol you keep the items in the file seperated by once File Support is inlcuded

        # run the NPC creator, take the elements that it provides and then filll in the others.
        pc_data_set = add_NPC_to_pool()
        # while there is a ValueError exception, keep asking for data until they finally give you something correct.
        while True:
            # try:
            #     spot_mod = int(input('What is the PC\'s Spot Modifier?'))
            # except ValueError:
            #     print('That was not a valid number please enter an integer.')
            #
            # try:
            #     listen_mod = int(input('What is the PC\'s Listen Modifier?'))
            # except ValueError:
            #     print('That was not a valid number please enter an integer.')
            #
            try:
                sneak_mod = int(
                    input('What is the PC\'s Move Silently Modifier?'))
                pc_data_set.append(sneak_mod)
                break
            except ValueError:
                print('That was not a valid number please enter an integer.')
        while True:
            try:
                hide_mod = int(input('What is the PC\'s Hide Modifier?'))
                pc_data_set.append(hide_mod)
                break
            except ValueError:
                print('That was not a valid number please enter an integer.')
        try:
            # Check for a value error, but more importantly...
            while True:
                speed = int(
                    input(
                        'What is the PC\'s speed in 5 foot intervals(5 or 10 or 15, etc...)?'
                    ))
                # Check that the number they gave yyou is divisible by 5.  This is D&D Dammit not the real world.
                if (speed % 5) != 0:

                    print('That was not a valid speed, try again.)')
                elif (speed % 5) == 0:
                    pc_data_set.append(speed)
                    break
        except ValueError:
            print('That was not a valid number please enter an integer.')

        #         MAKE THE PC If EVERYTHING WENT FINE
        new_pc = PC.PC(pc_data_set[0], pc_data_set[1], pc_data_set[2],
                       pc_data_set[3], pc_data_set[4], pc_data_set[5])
        # Add them to the pool of PCS
        current_PC_pool.append(new_pc)

    def create_check_parameters():
        # Empty the list of parameters so it is fresh.
        del check_parameters[:]
        while True:
            try:
                # Didtance?
                distance = int(
                    input(
                        'How far are the PC\'s attempting to stealth, in feet?'
                    ))
                check_parameters.append(distance)
                break

            except ValueError:
                'That was not a Integer, please try again.'

        while True:
            # display options
            display_speed_mod_options()
            # speed modifiers for the roll
            speed_mod_choice = input('What is the Speed Modifier Option?')

            if speed_mod_choice in '123':
                check_parameters.append(speed_mod_choice)
                break

            else:
                print('Please Choose An Option From the Menu')

        while True:
            # Display Options
            display_terrain_mods()
            # terrain modifiers for the rolls?
            terrain_mod_choice = input('What type of terrain?')
            if terrain_mod_choice in '123':
                check_parameters.append(terrain_mod_choice)
                break
            else:
                print('Please select an option from above.')
        # return the parameters so that the next function can use them
        return check_parameters

    def run_checks():
        # Make the parameters
        check_params = create_check_parameters()
        # Pass them to the checks function (Which needs to be broken down further into even MORE discrete bits.)
        final_list = pcs_vs_npcs_checks(check_params)
        # Display the list or results using this nice and fancy tabulate module
        print(
            tabulate(final_list,
                     headers=[
                         'PC', selected_NPCs[0].name, selected_NPCs[0].name,
                         selected_NPCs[1].name, selected_NPCs[1].name
                     ],
                     tablefmt="pipe",
                     missingval='Null'))

    def pcs_vs_npcs_checks(check_parameters):
        # TODO: Make this smoother code in the future.
        terrain_modifier = 0
        speed_modifier = 0
        total_env_mods = 0
        row_result = []
        final_results = []
        distance = int(check_parameters[0])
        fastest_pc_speed = 0
        # For each character find out which is fastest, and use their speed for the checks since they will reach the destination first.
        # TODO: Put this in its own function (EASY)
        for pc in selected_PCs:
            if pc.speed > 0:
                fastest_pc_speed = pc.speed
                if check_parameters[1] == '1':
                    fastest_pc_speed = fastest_pc_speed / 2
                elif check_parameters[1] == '3':
                    fastest_pc_speed = fastest_pc_speed * 2
        # Figure out what those parameters that were passed to you even mean! These are for how fast they're moving
        if check_parameters[1] == '2':
            # Ah! theyre moving quickly, hard to be stealthy when quick! MINUS 5
            speed_modifier = speed_modifier - 5
        elif check_parameters[1] == '3':
            # Theyre literally running while trying to be stealthy.  nearly impossible. MINUS 20
            speed_modifier = speed_modifier - 20
        # These params are for the type of terrain theyre going over
        if check_parameters[2] == '2':
            # Sort of noisy terrain, MINUS 2
            terrain_modifier = terrain_modifier - 2
        elif check_parameters[2] == '3':
            # Fairly loud terrain, MINUS 5
            terrain_modifier = terrain_modifier - 5

        #     Add the modifiers together into a lump mod to be subtracted from the roll
        total_env_mods = total_env_mods - speed_modifier - terrain_modifier

        # This variable is improperly named, but wont be changed until v1.2
        # It was originally a checker for just 2 players stealthing, to see that the distance(or number of checks really)
        # Isnt changed until all the PC's have taken a check.  I realized later on that I could use the modulus of the length of the
        # selected_PCs list to more accurately track that, since I could have 5 players doing it, or just 1 even
        even_or_odd = 0
        # While the PCs are not at their end point
        while distance >= 0:
            # for each PC check their stealth and hides against
            for pc in selected_PCs:
                # This bit here is causing trouble, and I am getting repeat rows... not sure whats wrong with it...
                row_result = []
                # keep the tracker counting
                even_or_odd = even_or_odd + 1
                # Add the name to the results row
                row_result.append(pc.name)
                # Each of the NPC's looking and listening
                for npc in selected_NPCs:
                    # Make the PC's Checks
                    sneak_result = d20.d20.roll(d20,
                                                pc.sneak_mod - total_env_mods)
                    # and the NPCs checks
                    listen_result = d20.d20.roll(d20, npc.listen_mod)
                    # PC
                    hide_result = d20.d20.roll(d20, pc.hide_mod)
                    # NPC
                    spot_result = d20.d20.roll(d20, npc.spot_mod)
                    # COMPARE RESULTS TO SEE IF SPOTTED OR HEARD
                    if sneak_result > listen_result:
                        row_result.append('Sneak: Success')
                    else:
                        row_result.append('-----FAIL-----')

                    if hide_result > spot_result:
                        row_result.append('Hide:  Success')
                    else:
                        row_result.append('-----FAIL-----')
                #         Push the results out onto the display board
                final_results.append(row_result)
                # If each PC has gone, then subtract the speed they are going from distance remaining
                if even_or_odd % len(selected_PCs) == 0:
                    distance = distance - fastest_pc_speed
        #             return the final list to be tabulated
        return final_results

    #  This function allows a character to be selected, it has been generified to work on either the NPC list or the PC list
    def select_the_char(which_list):
        if which_list == 0:
            # This is going to take a NPC
            choice = int(input('Which Character to add to the selected list?'))
            npc = current_NPC_pool[choice - 1]
            selected_NPCs.append(npc)
            del current_NPC_pool[choice - 1]

        elif which_list == 1:
            # This will take a PC
            choice = int(input('Which PC to add to the selected list?'))
            pc = current_PC_pool[choice - 1]
            selected_PCs.append(pc)
            del current_PC_pool[choice - 1]

    #         removes all characters from the selected pool automatically

    def remove_all_chars_from_selected():
        counter = 0
        for pc in selected_PCs:
            current_PC_pool.append(pc)
            counter = counter + 1
        del selected_PCs[:]
        counter2 = 0
        for npc in selected_NPCs:
            current_NPC_pool.append(npc)
            counter2 = counter2 + 1
        del selected_NPCs[:]

    # TODO: Put all of this below into a method as well. Maybe
    # Here begins the guts of the runtime components
    while outermost_loop_variable:
        display_main_menu()
        main_menu_choice = input('Please Choose An Option From Above.\n')

        if main_menu_choice == '1':
            setup_menu_loop = True
            print('ENTERING SETUP AND RUN')
            while setup_menu_loop:
                # Show the Setup Menu
                display_setup_menu()
                # User Selects and Option
                # TODO: Surely there is a better way to do menus.
                setup_menu_choice = input(
                    'Please Choose And Option From Above.\n')
                if setup_menu_choice == '1':
                    print('Running Add PC to Pool Method')
                    # Add a PC
                    add_PC_to_pool()
                elif setup_menu_choice == '2':
                    print('Running Add NPC to Pool Method')
                    # add an NPC
                    char_data_set = add_NPC_to_pool()
                    new_npc = NPC.NPC(char_data_set[0], char_data_set[1],
                                      char_data_set[2])
                    current_NPC_pool.append(new_npc)

                elif setup_menu_choice == '3' and len(current_PC_pool) >= 1:
                    print('Running Select a PC Method')
                    display_pc_pool()
                    select_the_char(1)

                elif setup_menu_choice == '4' and len(current_NPC_pool) >= 1:
                    print('Running Select a NPC Method')
                    display_npc_pool()
                    select_the_char(0)

                elif setup_menu_choice == '5' and len(
                        selected_PCs) >= 1 and len(selected_NPCs) >= 1:
                    print('Running Checks with Tabulate OutPut')
                    run_checks()
                    remove_all_chars_from_selected()

                elif setup_menu_choice.lower() == 'x':
                    print('Exiting Setup Menu')
                    setup_menu_loop = False

        elif main_menu_choice == '2':
            # Version 2.0 will save some of these and allow editing of saved ones.
            print('EXITING PROGRAM\nFLUSHING ALL CURRENT PCS AND NPCS')
            sys.exit()
        else:
            print(
                'Sorry, the option you selected either is not yet available or never will be.'
                '\nPlease select a different option'
                '\n')
Esempio n. 16
0
import pygame, time

pygame.init()

import Room, ChatBox, NPC, Player, Object
from globals import *
import globals_vars

import ui_util


game_display = pygame.display.set_mode((DISPLAY_WIDTH, DISPLAY_HEIGHT))
def c_h():
    cb.string = 'Hell Yeah'

joe = NPC.NPC(game_display, 'Joe', {'F**K YOU': 'Nah f**k you!'}, {"TEST":c_h})
dale = NPC.NPC(game_display, 'Dale', {'F**K YOU': 'Nah f**k you!'}, {"TEST":c_h})
chicken_leg = Object.Object('Chicken Leg',
                            info = 'Its a f*****g chicken leg.',
                            image = 'imgs/pulke.png',
                            w = 780, h = 370)

genesis = Room.Room(npcs=[joe], objects=[chicken_leg], id_n=1)
r1 = Room.Room(npcs=[dale], right=genesis, objects=[chicken_leg], id_n=2)
r2 = Room.Room(left=genesis, objects=[chicken_leg], id_n=3)
r3 = Room.Room(up=r2, objects=[chicken_leg], id_n=4)
r4 = Room.Room(right=r3, up=genesis, objects=[chicken_leg], id_n=5)
r2.down = r3
r3.left = r4

player = Player.Player(game_display, genesis)
        if npc_home_num > 0 and npc_home_num < (home_i + 1):
            break
        else:
            print("Please choose a number shown above")
            continue
    
    for location in NPC_Data.locations:
        npc_home_num -= 1
        if npc_home_num == 0:
            npc_home = location
            break


#Number of NPCs
while True:
    num_NPCs = input("How many NPCs would you like to create?\nAnswer:")
    try:
        num_NPCs = int(num_NPCs)
    except:
        print("\nPlease choose an integer as your answer.")
        continue
    break

#NPC CREATION
while num_NPCs > 0:
    new_NPC = NPC.NPC(race = npc_race, sex = npc_sex, home = npc_home)
    new_NPC.assign()
    new_NPC.create()
    num_NPCs -= 1

Esempio n. 18
0
async def on_message(message):
    member = message.author
    username = "******" % (member.name, member.discriminator)

    ##USER COMMANDS

    if message.content.startswith('!hello'):
        msg = "Hello, welcome to The Joey DnD RP Server, %s." % (username)
        await message.author.send(
            msg, file=discord.File('images/BaldursGate2Enhanced.jpg'))

    if message.content == ('!greet'):
        channel = message.channel
        await channel.send('Say hello!')

        def check(m):
            return m.content == 'hello' and m.channel == channel

        try:
            msg = await client.wait_for('message', timeout=30.0, check=check)
            await channel.send('Hello {.author}!'.format(msg))
        except asyncio.TimeoutError:
            await message.author.send("I waited for you to say hello... </3")

    if message.content.startswith('!login'):
        response, nick = do_login(message)
        if nick != None:  # change their nickname
            if username in ADMINS:
                print(
                    "tried to change your name but you are too powerful, %s" %
                    (username))
            else:
                await member.edit(nick=nick)
        await message.channel.send(response)

    if message.content.startswith('!logout'):
        response = await do_logout(message)
        if response == "logout!":
            await member.edit(nick=username)  # restore username
            return
        else:
            await message.channel.send(response)

    ## ROLEPLAY COMMANDS

    if message.content == ("!whoami") or message.content == ("!me"):
        char_sheet = dm.logged_in_as[
            username]  ## Finds your character sheet from your discord username
        response = "You are playing %s, AKA %s" % (char_sheet.display_name,
                                                   char_sheet.name)
        await message.author.send(response)

    if message.content.startswith("!whois"):
        if message.content == "!whoisplaying" or message.content == "!whoisloggedin":
            char_name_list = []
            for key in dm.logged_in_as.keys(
            ):  ## grabs all users who are logged in
                char_name_list.append(
                    dm.logged_in_as[key].display_name
                )  ## appends their current character to a list
            if char_name_list == []:
                response = "Noone is logged in at the moment."
            else:  #players on the list
                response = "Characters currently logged in: "
                for char_name in char_name_list:
                    response = "%s\n%s\n" % (response, char_name)
            await message.author.send(response)
        else:  # typed !whois something
            target_character = message.content.split(" ")[1].strip(
            )  ## gets the second parameter which is the target chara
            char_sheet = None
            for key in dm.logged_in_as.keys():  # A list of usernames
                if dm.logged_in_as[
                        key].name == target_character:  # check if a username is associated with a certain character
                    char_sheet = dm.logged_in_as[
                        key]  ## Finds their character sheet from theirr discord username
                    response, image_file = char_sheet.get_profile(
                    )  # This is their public profile
                    await message.author.send(response,
                                              file=discord.File(image_file))

    ## BATTLE COMMANDS

    if message.content == ("!begincombat") or message.content == (
            "!startcombat"):
        ## Start Combat
        ## Switch to combat mode
        pass

    if message.content.startswith('!addcombatant'):
        ## Check if they have DM power
        if not (str(message.author) in ADMINS):
            await message.author.send(
                "Hey!! You're not allowed to add combatants to the initiative. Nice try. Chump."
            )

        else:
            combatant_name = message.content.split(" ")[1].strip(
            )  ## grabs the second element and removes whitespace
            if combatant_name in dm.logged_in_as.values():
                pass
                ## to do, during the login by the user, retrieve all their info
            enemy = NPC(
                combatant_name)  ## tries to make an npc of the type specified
            dm.add_to_combat(enemy)

    ## DICE COMMANDS

    if message.content.startswith('!roll'):
        if message.content.startswith('!rollwod'):
            try:
                command, dice_pool = message.content.split(" ")
            except ValueError:
                await message.channel.send("Sorry that didn't work. Try again."
                                           )
                return
            if command == ("!rollwod"):
                response = do_roll_wod(message, dice_pool)
                await message.channel.send(response)
            if command == ("!rollwod8again"):
                response = do_roll_wod(message, dice_pool, eight_again=True)
                await message.channel.send(response)
            if command == ("!rollwod9again"):
                response = do_roll_wod(message, dice_pool, nine_again=True)
                await message.channel.send(response)

        if message.content.startswith('!rollchancedie'):
            dice_result = rolld(10)
            if dice_result == 1:
                await message.channel.send(
                    "%s rolled a chance die and suffered a dramatic failure. [Rolled 1 on a d10]"
                    % (username))
            elif dice_result == 10:
                await message.channel.send(
                    "%s rolled a chance die and managed to succeed. [Rolled 10 on a d10]"
                    % (username))
            else:
                await message.channel.send(
                    "%s rolled a chance die and failed. [Rolled %s on a d10]" %
                    (username, dice_result))
        else:
            cmd = message.content
            response = do_roll(cmd, username)
            await message.channel.send(response)

    if message.content.startswith('!coinflip') or message.content.startswith(
            '!flipcoin') or message.content.startswith('!cointoss'):
        result = coinflip()
        await message.channel.send("%s flips a coin! Result is %s." %
                                   (username, result))

    if message.content.startswith('!rockpaperscissors'):
        response = do_rock_paper_scissors(message)
        await message.channel.send(response)

    ## GAME COMMANDS

    if message.content == ("!play poker"):
        await do_poker_game(message)

    ## JUST FOR FUN COMMANDS

    if message.content.startswith('!breaktable'):
        result = rolld(2)
        print(result)
        if (result == 1):
            await message.channel.send(
                username +
                " dropkicks his foot straight through the table, splintering it into two seperate halves!"
            )
        if (result == 2):
            await message.channel.send(
                username +
                " hammers their fist down upon  the innocent table in an unbridled display of nerd rage. It cracks directly in half!"
            )

    if message.content.startswith('!fliptable') or message.content.startswith(
            '!tableflip'):
        await message.channel.send(
            username +
            " grabs the table by the edges, flipping it over like an absolute savage and ruining everything! Paper, dice and doritos crash into the ground!"
        )

    if message.content.startswith('!unfliptable'):
        await message.channel.send(
            username +
            " sheepishly returns the table to an upright position, collecting up the dice and brushing Dorito crumbs off the now orange-dusted character sheets."
        )

    if message.content.startswith('!kickinthedoor'):
        result, dice_type = rolld(2)
        print(result)
        if (result == 1):
            await message.channel.send(
                username +
                " delivers a swift kick to the door, but the sturdy door doesn't budge. Their foot crumples as the force of the blow reverberates back through their leg. You hop up and down on one foot for 1d4 rounds in agony."
            )
        if (result == 2):
            await message.channel.send(
                username +
                " delivers a hearty kick to the door. The door flies off its hinges under the weight of their mighty boot."
            )

    if message.content.startswith('!sunglassesfingerguns'):
        await message.channel.send(
            "%s is looking too damn cool with their sunglasses and fingerguns. Watch out, here comes %s!"
            % (username, username))

    ## HELP AND SUGGESTION COMMANDS
    if message.content.startswith('!suggest'):
        global suggestions
        await message.author.send(
            "Please type your message to be added to the suggestion box.")
        try:
            msg = await client.wait_for('message', timeout=180.0, check=None)
        except asyncio.TimeoutError:
            await message.author.send(
                "Sorry, your suggestion has timed out. (180 secs or 3 minutes elapsed)"
            )
            msg = None
        if msg != None:
            suggestions += 1
            data = msg.content
            today = date.today()
            data = data + " -- Suggestion written by %s on %s." % (username,
                                                                   today)
            filename = "suggestionbox/suggestion%i.txt" % (suggestions)
            f = open(filename, mode='w+')
            f.write(data)
            f.close()
            print("Suggestion#%i just got saved. Thanks %s!" %
                  (suggestions, username))
            await message.author.send("Thanks! received suggestion: %s" %
                                      (msg.content))

    if message.content.startswith('!help'):  ## All Help Commands
        if message.content == '!help login':
            await message.author.send(HELP_LOGIN_MESSAGE)
        if message.content == '!help whois':
            await message.author.send(HELP_WHOIS_MESSAGE)
        if message.content == ('!help'):
            await message.author.send(HELP_GENERAL_MESSAGE)
Esempio n. 19
0
from globals import *
from consumables import *
from NPC import *
from player import *
from map_engine import *
from textures import *
from UltraColor import *

pygame.init()

#Declaring NPC's, player, world and ither variables / functions needed in the main gameloop---------------------------------------

player1 = player("Alex", 9)
player.pos_calc(player1, [Globals.camera_x, Globals.camera_y])

steffan = NPC("stwffin", [0, 0],["Have you seen link?", "We still haven't finished..."], [0, 128])
Skinner = NPC("Skinner", [256, 128], ["Do you know what I did in Nam?", "It wasn't pretty..."], [256, 512])

npc_list = [steffan, Skinner]

for npc in npc_list:
    NPC.npc_pos(npc)

size = [800, 600]
window = pygame.display.set_mode(size, pygame.HWSURFACE|pygame.RESIZABLE|pygame.DOUBLEBUF)
pygame.display.set_caption("The Dungeons of Plasmawr")

tile_data = map_engine.load_map("/home/euler/Desktop/plasmawr_game/maps/blank.txt")
Tiles.blocked = map_engine.blocked(tile_data, Tiles.blocked_types, Tiles.blocked)
render_chunk = pygame.Rect(-64, -64, (size[0] + 128), (size[1] + 128))
def createRooms():
    centerRoom=Room()
    southRoom=Room()
    northRoom=Room()
    lessNorthRoom=Room()
    eastRoom=Room()
    northEastRoom=Room()
    southEastRoom=Room()
    southWestRoom=Room()
    centerRoom.addExit(lessNorthRoom,False,"north")
    centerRoom.addExit(southRoom,False,"south")
    centerRoom.addExit(eastRoom,False,"east")
    eastRoom.addExit(centerRoom,False,"west")
    southRoom.addExit(centerRoom,False,"north")
    southRoom.addExit(southEastRoom,False,"east")
    southRoom.addExit(southWestRoom,True,"west")
    southEastRoom.addExit(southRoom,False,"west")
    southWestRoom.addExit(southRoom,True,"east")
    eastRoom.addExit(northEastRoom,False,"north")
    northEastRoom.addExit(eastRoom,False,"south")
    northRoom.addExit(lessNorthRoom,False,"south")
    lessNorthRoom.addExit(northRoom,False,"north")
    lessNorthRoom.addExit(centerRoom,False,"south")
    rooms=[southRoom,northRoom,lessNorthRoom,eastRoom,northEastRoom,southEastRoom]
    player.setCurrentRoom(centerRoom)
    if timePeriod=="1980s":
        centerRoom.setDescription("in the middle of the road, where you should try not to get hit by a car.")
        southRoom.setDescription("in the Watergate Hotel which is lavish and fancy with many fancy amenities.")
        northRoom.setDescription("in the police station accross from the Watergate hotel monitoring for suspicious activity.")
        lessNorthRoom.setDescription("in the parking lot in front of the police station where numerous Ford Mustangs are parked. There is a Hot Rod parked in the lot.")
        eastRoom.setDescription("in the Watergate office building, where numerous offices such as the Democratic Party's office is located.")
        northEastRoom.setDescription("in a gas station, in which you can fill up your car. You are next to the police station and Watergate office bulding.")
        southEastRoom.setDescription("in the building east of the Watergate hotel.")
        southWestRoom.setDescription("in the building west of the Watergate hotel.")
    elif timePeriod=="1940s":
        centerRoom.setDescription("in the middle square of the hollywood studio where everyone gathers and is the central hub of the studio.")
        southRoom.setDescription("in the main entrance of the studio, this has heavy studio to protect our actors, if you get here at a good time you might even catch a peek at an actor.")
        northRoom.setDescription("in the main studio where all the movies are filmed and the biggest space in the hollywood studio.")
        lessNorthRoom.setDescription("in the room where all the cameras and equipment are housed. Be carefull, this stuff ain't cheep.")
        eastRoom.setDescription("in the room where all the actors get ready for shooting their scenes.")
        northEastRoom.setDescription("in the closet where all the makeup and equipment is stored to get the actors ready.")
        southEastRoom.setDescription("in the place where all the cars are parked for the day. Contains lots of fancy cars from all the rich producers and actors.")
        southWestRoom.setDescription("in the shed where all the props are stored.")
    elif timePeriod=="colonial":
        centerRoom.setDescription("in a small clearing in a forest, where a road travels north to a small Native American village and south to a small town of colonists.")
        southRoom.setDescription("in a town filled with primarily sick and tired residents. You see most out tending to farms and working other jobs.")
        northRoom.setDescription("in a small Native American village that has the air of impending doom covering it like a blanket. You can feel the tensions between the two factions rising.")
        lessNorthRoom.setDescription("in an outside wall going into the Native American tribe. You can see some weapons with blood splattering every inch, and others collecting dust.")
        eastRoom.setDescription("in a dark and gloomy forest, with the sun's warm rays being blocked by the dense leaves of the treese above. Birds sing their songs and wildlife scurries at your feet.")
        northEastRoom.setDescription("in a clearing. It looks as if a massacre has taken place as the body of a deer is being held up by a bloodied colonial soldier.")
        southEastRoom.setDescription("in the eastmost part of the town, where the butcher's shop resides. The area smells of death and you can see the butcher standing outside.")
        southWestRoom.setDescription("in an area near a small building. People are gathering near the town hall as tensions rise concerning the Native American threat that looms on the other side of the forest. Inside, the mayor sits at his table with his head in his hands.")
    for room in rooms:
        num = random.randint(0, 3)
        for times in range(num):
            room.addNPC(randomNPC())
    randRoom=random.randint(0,len(rooms)-1)
    rooms[randRoom].addNPC(NPC.NPC(timePeriod,"Greetings, time traveler. I have been looking for you. Are you ready to die?","You come again time traveler. Face me.",90,Item(itemList[2].name,itemList[2].description,itemList[2].type,itemList[2].value),True,True))
    for room in rooms:
        for n in range(3):
            r=random.randint(0,len(itemList)-2)
            room.addItem(itemList[r])
 def MakeNPCs(self, file_path):
     with open(file_path) as data_file:
         data = json.load(data_file)
         for npc in data:
             a_npc = NPC.NPC(data, npc)
             self.NPCs.append(a_npc)
Esempio n. 22
0
    def __init__(self):
        self.objects = [
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 30, 1, 1, 1, 1, 1, 1, 40, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 40, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 2, 0, 0, 0, 0, 14, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 50, 1, 1, 1, 1, 1, 1, 61, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 30, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 2, 0, 0, 0, 0, 15, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 71, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 91, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 13, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0,
                7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ],
            [
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
            ],
        ]
        self.npc = [
            NPC(232, 288 + DELTA, "john", player_steps1, [
                ("Привет, проходи. У меня есть для тебя задание", "", "",
                 None),
                ("Ты же знаешь, что 3 квартира давно заброшена? Недавно я нашел ключи от нее. Но я боюсь туда зайти. Я до ужаса боюсь крыс. Я слышу по ночам там шуршание.",
                 '', "", None),
                ("Ты не мог бы осмотреть комнату за меня? можешь забрать что-нибудь оттуда. Я дам тебе ключи, но перед этим, ты можешь принести свечу, уж больно темновато тут.",
                 "", "Да, конечно", None),
                ("Спасибо, Но не мог бы ты найти свечу, без нее мне не найти ключа",
                 "", "", None),
                (
                    "Отлично, где же этот ключ...",
                    "Без свечки я не найду ключа. Поищи у себя",
                    "",
                    "x",
                ), ("А, вот, держи", "", "", None, "c"),
                ("Вот это да!", "Я не вижу у тебя за спиной мешок!", "", "p"),
                ("Слушай, я знаю, что ты хочешь сбежать.", "", "", None),
                ("Джейн из 2 квартиры живет тут больше всех. Я думаю если ты подаришь ей что нибудь, то она может тебе помочь.",
                 "",
                 "А что она любит? Может в этом барахле найдется что-нибудь",
                 None),
                ("Я знаю, она любит музыку.Ты можешь дать ей что-нибудь и разговорить ее.",
                 "", "Хорошо, я подумаю", None), ("Удачи", "", "", None)
            ]),
            NPC(640, 288 + DELTA, "jane", player_steps2, [
                ("А что это у тебя в руках?",
                 "Можно потише, у еня ребенок спит", "", "g"),
                ("Если ты думаешь, что если я одинокая женщина с ребенком, то ты можешь взять меня простым подарком? Даже не думай",
                 "", "Нет, подожди, ты должна мне помочь", None),
                ("Ну что еще?", "",
                 "Я хочу сбежать оттуда, а единственный выход-через вахтера. Джон сказал мне, что ты знаешь как выйти отсюда",
                 None),
                ("Ладно. Я знаю, что он в свое время занимал всокую должность при Большом Брате...",
                 "", "И как он оказался здесь?", None),
                ("Он стал просто не нужен. И все. Самое интересное, что он не оставил своей любви к партии.",
                 "",
                 "Стой, ведь город захватили повстанцы? Как он остался жив?",
                 None),
                ("Он не выходит из своей дыры уже месяц, даже представить не могу что он там делает.",
                 "",
                 "А если шантажировать его? Сказать, что если он не откроет дверь, то мы сдадим его?",
                 None),
                ("Хорошая идея. Если честно, меня от него тошнит. И вот, покажи ему это. это досье на него.",
                 "", "Хорошо. Тогда я пошел", None, "v"),
                ("Я верю в тебя", "", "", None)
            ]),
            EnemyNPC(700, 400 + DELTA, "tom", player_steps3, [
                ("Что это у тебя? Урод, а ну дай сюда",
                 "А ну пошел вон отсюда!", "", "v"),
                ("Что тебе надо?", "",
                 "Если ты сейчас же не откроешь мне дверь-этот листок увидят все. Что тут у нас: Политиче..",
                 None),
                ("Нет! Стой! Я сам не знаю где ключ!", "",
                 "Врешь! Я сейчас пройдусь ломом по твоей пустой башке, если ты не скажешь где ключ!",
                 None), ("Аггггхххх", "Ну давай, попробуй", "", "r")
            ])
        ]

        self.obj = []
        self.obj1 = []
        self.dict = {
            10: wall2,
            11: wall1,
            12: wall3,
            13: wall4,
            14: wall6,
            15: wall7,
            16: wall8,
            20: roof
        }
        x = 0
        y = 0
        for i in range(len(self.objects)):
            self.obj.append([
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            ], )
            for j in range(len(self.objects[i])):
                if self.objects[i][j] == 3:
                    obj = Entity(x, y + DELTA, "shelf", ["g", "p"])
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 4:
                    obj = Entity(x, y + DELTA, "bed1", [])
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 5:
                    obj = Entity(x, y + DELTA, "bed", [])
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 6:
                    obj = Entity(x, y + DELTA, "table1", ["r"])
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 7:
                    obj = Entity(x, y + DELTA, "bed2", [])
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 8:
                    obj = Entity(x, y + DELTA, "shelf1", ["d"])
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 9:
                    obj = Entity(x, y + DELTA, "comp", ["x"])
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 2:
                    obj = Ladder(x, y + DELTA)
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 40:
                    obj = Door(x, y + DELTA, "Door1")
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 30:
                    obj = Door(x, y + DELTA, "Door1", "c")
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 31:
                    obj = Door(x, y + DELTA, "Door1", "c")
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 50:
                    obj = Door(x, y + DELTA, "Door1", "u", self.npc[0])
                    self.obj1.append(obj)
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 61:
                    obj = Door(x, y + DELTA, "Door1", "u", self.npc[1])
                    self.obj1.append(obj)
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 71:
                    obj = Door(x, y + DELTA, "Door1", "u", self.npc[2])
                    self.obj1.append(obj)
                    self.obj[i][j] = obj
                elif self.objects[i][j] == 91:
                    obj = Door(x, y + DELTA, "Door2", "d")
                    self.obj[i][j] = obj
                x += SCALE
            y += SCALE
            x = 0
Esempio n. 23
0
tDirections = {0: "North", 1: "South", 2: "East", 3: "West"}

#Define NPCs
pFamily = NPC(
    0,
    "Cranky Family",
    "You notice what appears to be a family of 4. Looks like they're arguing.",
    "You see the cranky family.",
    1,
    [
        [
            "Cranky Family: Honey, where's Jack's binky?",
            "Cranky Family: It's in his diaper bag.",
            "Cranky Family: And where's his diaper bag?",
            "Cranky Family: I'm hungry!",
            "Cranky Family: Hold on, sweety! I don't know, check the trunk!",
            "Cranky Family: Don't tell me you left it at the rest stop...",
            "Cranky Family: Is it not there? How is that my problem? You're the one that changed him!",
            "Cranky Family: Waaaaaaah!!!",
            "Cranky Family: Oh, so it's my fault now? Maybe if you helped out for once we're being having this discussion!",
            "Cranky Family: I gotta go potty!",
            "Cranky Family: Why does everything have to be an argument with you? Look, you take Anna to the bathroom and check in, I'll get the diaper bag.",
            "Cranky Family: Yeah, sure, how about YOU take Anna to the bathroom and I'll get the diaper bag? As if I trust you!",
            "Cranky Family: Here we go again with this! Whyyyy does it matter who does what?!",
            "It's doesn't seem like they're going to stop anytime soon..."
        ],  #0
        ["They're still going at it. Perhaps you should stay out of this."]  #1
    ])
pAngryWoman = NPC(
    1,
    "Irritated Lady",
Esempio n. 24
0
# Licence:     <your licence>
#-------------------------------------------------------------------------------
from Warrior import *
from Player import *
from Enemy import *
from Battle import *
from NPC import *
from Location import *
from Item import *
from Armor import *
from Quest import *

# Инициация персонажей
player = Player('Путник', 100, 1, 10, 499)
bandit = Enemy('Бандит', 100, 1.2, 10, 2)
weapon_merchant = NPC('Торговец оружием', 'Оружие')
armor_merchant = NPC('Торговец бронёй', 'Броня', talk = 1)
boozy_hacksmith = NPC('Пьяный кузнец')

# Инициация локаций
armor_shop = Location('Лавка продавца брони', player, armor_merchant)
street = Location('Улица', player, weapon_merchant, bandit, {armor_shop}, {'money': 1})
armor_shop.where_to_go = {street}
tavern = Location('Таверна', player, boozy_hacksmith, where_to_go = {street}, is_inn = 1)
forge = Location('Кузница', player, where_to_go = {street})
street.where_to_go.add(tavern)
street.where_to_go.add(forge)

location = street

# Инициация предметов