Beispiel #1
0
    def __init__(self, application_context):
        self.application_context = application_context
        self.reader = ScreenReader(application_context)

        QMainWindow.__init__(self)
        self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
                            | Qt.X11BypassWindowManagerHint)
        self.setGeometry(
            QStyle.alignedRect(Qt.LeftToRight, Qt.AlignCenter | Qt.AlignRight,
                               QSize(220, 700),
                               qApp.desktop().availableGeometry()))

        self.setCentralWidget(QWidget(self))
        layout = QVBoxLayout()
        self.centralWidget().setLayout(layout)

        self.accuracy_label = QLabel()
        self.damage_label = QLabel()
        self.tokens_label = QLabel()

        self.cumulative_probabilities_label = QLabel()
        self.exact_probabilities_label = QLabel()
        self.expected_damage_label = QLabel()

        layout.addWidget(self.accuracy_label, alignment=Qt.AlignCenter)
        layout.addWidget(self.damage_label, alignment=Qt.AlignCenter)
        layout.addWidget(self.tokens_label, alignment=Qt.AlignCenter)
        layout.addWidget(self.cumulative_probabilities_label,
                         alignment=Qt.AlignCenter)
        layout.addWidget(self.exact_probabilities_label,
                         alignment=Qt.AlignCenter)
        layout.addWidget(self.expected_damage_label, alignment=Qt.AlignCenter)

        dummy_character = calculator.Character(0, 0, 0)
        self.dummy_encounter = calculator.Encounter([dummy_character])
def enter(the_player):

	the_player.location = 'House with pirate flag'

	if the_player.location in the_player.visited and 'dog in pirate house' in the_player.visited:
		the_player.directions = ['Shorter street','Room with dead dog','Kitchen','Basement']
	elif the_player.location in the_player.visited and 'dog in pirate house' not in the_player.visited:
		the_player.directions = ['Shorter street','Left door','Right door','Stairs']
	else:
		the_player.directions = ['Shorter street','Left Door','Kitchen','Stairs']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
		print "There's a %s on your left, %s on your right" % (the_player.directions[1], the_player.directions[2])
		print "and stairs leading to %s." % the_player.directions[3]
	else:
		the_player.visited.append(the_player.location)

		print "It smells really bad in here. From where"
		print "you stand you see two doors, one on the"
		print "right and one on the left."
		print "You hear loud barking coming from behind"
		print "the left door."
		print "There are stairs leading down at the end"
		print "of the hall."
		print "Door behind you leads out to the street."


	while True:
		action = prompt.standard(the_player)

		if action == "shorter street" or 'shorter' in action or 'out' in action:
			return 'Suburb 4'
		elif 'left' in action or 'dog' in action:
			if 'dog in pirate house' not in the_player.visited:
				print "You open the wooden doors and angry dog jumps at you!"

				encounter = fight.Encounter(the_player,'infected dog')
				encounter.start(the_player)
				the_player.visited.append('dog in pirate house')

				print "There is nothing interesting in that room so you go out."
			else:
				print "Nothing here just the dead dog. You return to the hall."
		elif 'stairs' in action or 'basement' in action:
			return 'Basement'
		elif 'right' in action or 'kitchen' in action:
			return 'Kitchen'
		else:
			custom_error.errortype(3)
Beispiel #3
0
def enter(the_player):

	the_player.location = 'March Street'
	the_player.directions = ['Junction','Old building','Harrington River']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You come back to %s. You've been here before." % the_player.location
		print "Old building is on your left side, ahead is Junction"
		print "of Curling Street"

		if 'charlie sleepover' in the_player.visited:
			print "You hear a very distant noise, probably coming"
			print "from Junction of Curling Street."
		else:
			pass

	else:
		the_player.visited.append(the_player.location)

		print "You leave junction of Curling Street behind"
		print "and turn right to %s." % the_player.location
		print "You see something moving towards you and feel"
		print "uneasiness and chill in your spine."

		encounter = fight.Encounter(the_player, 'child zombie')
		encounter.start(the_player)

		print "You successfully killed the enemy. Now you can safely"
		print "look around."
		print "Just by the sidewalk is an old building with grey walls."
		print "It is a three story building and there's a little light"
		print "coming out of the top window."
		print "Most of the windows, especially in ground floor are boarded up."
		print "If you continue walking you will end up near Harrington River."
		print "You can also turn back to Junction of Curling Street."

	while True:
		action = prompt.standard(the_player)

		if action == "junction":
			return 'Junction'
		elif action == "old building":
			return 'Old Building'
		elif action == "harrington river":
			return 'Harrington River'
		else:
			custom_error.errortype(3)
def enter(the_player):

    the_player.location = '22nd Street'
    the_player.directions = ['Junction', 'Suburbs']

    print "\nLocation:", the_player.location
    print "-" * 30

    chance_of_encounter = random.randint(0, 1)

    if chance_of_encounter == 1:
        print "You hear growling... Looks like"
        print "an enemy stumbled upon you.\n"
        encounter = fight.Encounter(the_player, 'random')
        encounter.start(the_player)
        random.seed(chance_of_encounter)
    else:
        pass

    if the_player.location in the_player.visited:

        print "Your at %s again." % the_player.location

    else:
        the_player.visited.append(the_player.location)

        print "You come to %s, it looks empty here." % the_player.location
        print "If you continue going forward, you'll"
        print "reach Suburbs of Welton."

    while True:
        action = prompt.standard(the_player)

        if action == "suburbs":
            return 'Suburbs'
        elif action == "junction":
            return 'Junction'
        else:
            custom_error.errortype(3)
Beispiel #5
0
def enter(the_player):

    if 'Wanda' in the_player.visited:
        the_player.location = 'Wanda\'s boat'
    else:
        the_player.location = 'Yellow boat'

    the_player.directions = ['Marina']

    print "\nLocation:", the_player.location
    print "-" * 30

    if 'zombie captain' not in the_player.visited:

        print "Looks like a habitant of Marina has turned."
        print "You see funny looking dead in striped shirt"
        print "and captain's hat... but boy he's ripped"
        print "as hell..."

        custom_error.errortype(3)

        encounter = fight.Encounter(the_player, 'zombie captain')
        encounter.start(the_player)

        the_player.visited.append('zombie captain')

    else:
        pass

    if 'Wanda' in the_player.visited:
        if the_player.location in the_player.visited:
            print "You're back at %s." % the_player.location
            print "Wanda: 'OK, let's get this thing going.'"
        else:
            the_player.visited.append(the_player.location)

            print "Wanda: 'So this is the boat that me and"
            print "Dave found.'"

            print "You both inspect the ship and see that the"
            print "motor is indeed missing. Also the boat"
            print "needs special key to operate."
    else:
        pass

    if the_player.location in the_player.visited:
        print "You're back at the %s." % the_player.location

    else:
        the_player.visited.append(the_player.location)
        print "You inspect the boat and notice that the motor is missing."
        print "Also you need special key to operate the boat."

    while True:

        action = prompt.standard(the_player)

        if 'motor' in action and 'motor' in the_player.inventory.keys():
            print "You install the motor onto the boat. There seems to"
            print "be enough fuel left in tanks. Now all you need"
            print "is to start the motor."

            the_player.visited.append('motor installed')
        elif 'start' in action or 'key' in action or 'boat key' in action:
            print "You put the boat key in the ignition."

            if 'motor installed' in the_player.visited:
                print "You hear the motor start."
                score.calculate(the_player, 'end game')
                custom_error.errortype(4)
                return 'Ending'
            else:
                print "Nothing happens, the motor is still missing."
        elif action == "marina":
            return 'Marina'
        else:
            custom_error.errortype(3)
Beispiel #6
0
def enter(the_player):

    the_player.location = 'Foreman Ave'
    the_player.directions = [
        'Junction', 'Commercial Building', 'Car barricade'
    ]
    glass = random.randint(1, 4)

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:
        print "You're back at %s." % the_player.location
        print "There are waste containers on the side"
        print "of the road."
        print "Building with broken shop window is next to them."

    else:
        the_player.visited.append(the_player.location)

        print "You come to wide street with various shops"
        print "on each side and garbage everywhere."
        print "There are seven green waste containers on the right"
        print "side of the road that are stuffed"
        print "with various things."
        print "You see a commercial building, probably a shop"
        print "with broken front shop window."
        print "The street ends with a huge barricade made out of"
        print "cars."

    while True:

        action = prompt.standard(the_player)

        if action == "junction":
            return 'Junction'
        elif 'waste' in action or 'container' in action:
            container(the_player)
        elif 'window' in action or 'commercial' in action or 'building' in action:
            if glass == 1:
                death.type(12, the_player)
            else:
                print "You lose balance while stepping to the shop,"
                print "you almost impale yourself on glass shrapnel."
                print "Don't try that again!"
                score.calculate(the_player, 'glass')
        elif 'cars' in action or 'barricade' in action or 'car' in action:

            print "You try to climb the car barricade but"
            print "you fail, falling to the ground."

            if 'car barricade' not in the_player.visited:
                encounter = fight.Encounter(the_player, 'random')
                print "Somehow, a zombie crawls from one of the cars."

                custom_error.errortype(4)
                encounter.start(the_player)
                the_player.visited.append('car barricade')
            else:
                pass
        else:
            custom_error.errortype(3)
def enter(the_player):
    the_player.location = 'Curling Street'
    the_player.directions = ['Apartment', 'Junction']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited and 'charlie sleepover' in the_player.visited and 'Wanda' in the_player.visited:
        print "\nThe whole Curling St. is swarmed with a herd of zombies."
        print "Wanda: 'Tss.. be careful."
        print "Here's the plan: I'm gonna sneak onto other side"
        print "and distract them."
        print "Meanwhile get in the shop and look for the motor - it should"
        print "have label 'K5-22TS' on it. It's pretty heavy so you might need"
        print "something to move it around."
        print "We'll meet back at Junction once you're done but be quick!'"

        score.calculate(the_player, 'wanda decoy')

        print "\nWanda sneaks behind the cars and gets about 30m away from you."
        print "'Come on, you fuckers!' she screams. The herd starts moving towards"
        print "her. You hope she'll be fine."
        print "'B&D Motors' is ahead, you carefully sneak into the shop..."

        custom_error.errortype(4)

        return 'Motor Shop'

    elif the_player.location in the_player.visited and 'charlie sleepover' in the_player.visited:
        print "You try to step carefully, hiding behind close by dumpster."
        print "Unfortunately you step on broken glass and the"
        print "swarm starts to navigate towards you..."

        custom_error.errortype(4)

        while True:
            encounter = fight.Encounter(the_player, 'zombie male')
            encounter.start(the_player)
            print "As you finished one zombie, another one approaches."
            print "Time to get ready..."

            custom_error.errortype(4)

    elif 'motor' in the_player.inventory.keys(
    ) and 'Wanda' in the_player.visited:
        print "Wanda: 'We already got what we need, let's just go"
        print "the herd might move back here again.'"
        return 'Junction'

    elif the_player.location in the_player.visited:

        if 'gun' in the_player.inventory.keys():
            pass

        else:
            print "There is still a policeman lying on the floor."
            pass

        print "You're in %s again." % the_player.location
        print "You've been here before."

        pass

    else:

        the_player.visited.append(the_player.location)

        print "You walk out of your apartment."
        print "You are on %s, it's a large street" % the_player.location
        print "with junction at the end."
        print "There are corpses everywhere, all of them"
        print "are dead and didn't turn."
        print "Most of them probably commited suicide."
        print "You notice a corpse of policeman few meters from you."

    while True:
        if the_player.hitpoints <= 0:
            death.type(3, the_player)
        else:
            pass

        action = prompt.standard(the_player)

        if action == "apartment":
            return the_player.directions[0]
            break
        elif action == "policeman" and not 'gun' in the_player.inventory.keys(
        ):
            bullets = random.randint(5, 10)
            the_player.inventory['gun'] = bullets
            print "You take the gun which has %d bullets in it." % bullets
            get_score = score.calculate(the_player, 'gun')
        elif action == "policeman":
            print "You already searched the policeman."
        elif action == "junction":
            return 'Junction'
        else:
            custom_error.errortype(3)
Beispiel #8
0
def enter(the_player):

	the_player.location = 'Old Building (first floor)'
	the_player.directions = ['Old Building', 'Old Building (second floor)']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		dave = False

		print "You're on %s again. Dave's corpse is still here." % the_player.location
		print "You can go down in Old Building Lobby or up"
		print "in to second floor."

		if 'Wanda' in the_player.visited and 'Dave is dead' in the_player.visited:
			print "\nYou see Wanda turning away from Dave's body."
			print "'Let's go' she says."

		elif 'Wanda' in the_player.visited:
			print "\nWanda: 'My god... that's David... or what's left of him!'"
			print "She starts sobbing uncontrollably. You decide"
			print "that it's best if you just go."

		else:
			pass
	
	else:
		the_player.visited.append(the_player.location)

		dave = True

		print "You see that the light comes from the windows"
		print "that were not boarded up."
		print "You see a grafitti painted on eastern wall"
		print "saying 'DON'T GO UP!'."
		print "You go to near the window to look outside."
		print "You scan the horizon towards Curling Street"
		print "and see a pack of zombies coming towards you."
		print "You quickly step away from the window and"
		print "immediately hear growling breath behind you."
		print "You quickly turn around to see decomposed"
		print "guy in uniform." 
		print "He reminds you if pizza delivery boy"
		print "that you used to meet."

		custom_error.errortype(4)

		if 'Wanda' in the_player.visited:
			print "'DAVE!' Wanda shouts. 'Please let's leave him"
			print "alone!'"
		else:
			pass

		custom_error.errortype(4)

		print "It's weird. He has a leash on his neck and"
		print "he angrily swings his arm towards you,"
		print "clenching his teeth."
		print "You try to slide past him but pizza boy"
		print "snaps into amok."
		print "In one moment the rope on his leash snaps."
		print "Ooops..."

		custom_error.errortype(4)

		encounter = fight.Encounter(the_player, 'Dave')
		encounter.start(the_player)

		dave = False

		the_player.visited.append('Dave is dead')

		if 'Wanda' in the_player.visited:
			print "'Oh my what did we just do? ..."
			print "I guess it was necessary... but.."
			print "poor Dave. He didn't deserve this.'"
			custom_error.errortype(4)
		else:
			pass

		print "Breathing heavily you observe remains of this"
		print "familiar guy and notice a name tag on his"
		print "shirt. It says 'DAVE'."

	while True:
		action = prompt.standard(the_player)

		if action == "dave" and 'dave chocolate' in the_player.visited:
			print "There's not anything on Dave."

		elif action == "dave" and not 'dave chocolate' in the_player.visited:
			the_player.visited.append('dave chocolate')
			print "You quickly search Dave's body"
			print "and to your surprise you find"
			print "old chocolate but it still looks OK."

			if 'chocolate bar' in the_player.inventory.keys():
				print "Cool another chocolate bar."
				the_player.inventory['chocolate bar'] = the_player.inventory['chocolate bar'] + 1
				print "You have %d bars now." % the_player.inventory['chocolate bar']
				score.calculate(the_player, 'chocolate bar')
			elif 'chocolate bar' not in the_player.inventory.keys():
				the_player.inventory['chocolate bar'] = 1
				score.calculate(the_player, 'chocolate bar')
		elif action == "second floor" or action == "old building (second floor)":
			return 'Old Building (second floor)'
		elif action == "lobby" or action == "old building":
			return 'Old Building'
		else:
			custom_error.errortype(3)