Пример #1
0
 def __init__(self, name, gameMaster, hand):
     self.name = name
     self.gameMaster = gameMaster  # это эксемпляр игры(у всех он одинаковый), они будут так влиять друг на друга
     self.charList = [
     ]  # это нужно для игры вдвоем или втроем. Максимум будет 2 персонажа в этом списке
     self.character = character(None, self.gameMaster)
     self.city = []  # построенные кварталы
     self.hand = hand  # кварталы в руке
     self.gold = 51
     self.take = {
         'gold': 2,
         'quarter': 2
     }  # сколько игрок может взять золота или кварталов
     self.all_actions = {
         'build': True,
         'ability': True,  # все действия игроков
         'laboratory_action': False,
         'graveyard_action': False,
         'greatwall_bonus': False,
         'laboratory_action': False,
         'observatory_bonus': False,
         'smithy_action': False,
         'library_bonus': False,
         'schoolofmagic_bonus': False,
         'hauntedcity_bonus': False,
         'imperialtreasury_bonus': False,
         'maproom_bonus': False
     }
     self.action_pool = []
Пример #2
0
def startup():
    os.system('clear')
    player = characters.character(20, 10, [], "")
    while player.name == "":
        s = raw_input("What would you like to do? New/Load: ")
        choice = s.lower()
        if choice == "new":
            player.name = intro(player)
            print player.name
            game.game(player)
        elif choice == "load":
            instance.load(player)
            game.game(player)
        else:
            print "That is not a valid command."
Пример #3
0
    def __init__(self):
        game.init()
        self.clock = game.time.Clock()
        self.running = True
        self.frameRate = 60
        self.width = 1200
        self.height = 900
        self.master = game.display.set_mode((self.width, self.height))
        self.load()
        self.loadPlatforms()
        self.character = characters.character(self.width, self.height, self)
        self.inGameUIsObj = inGameGUI.inGameUIs(self.width, self.height, self)
        self.level = 1
        self.all_sprites = game.sprite.Group()
        self.all_sprites.add(self.character)

        self.rightPressed = False
        self.leftPRessed = False
        self.downPressed = False
Пример #4
0
import random

import cast
from relationships import relType as rType
from cast import ConnectionStrategy
from characters import character

# Create graph
c = cast.cast()
# Add characters
totalCharacters = random.randint(4, 15)
#totalCharacters = 4
print("TOTAL CHARACTERS: " + str(totalCharacters))
for n in range(totalCharacters):
    c.addCharacter(character())

# GENERATE FAMILIAL RELATIONSHIP NETWORK
numFamilies = (int(totalCharacters / 6), int(totalCharacters / 3))
numFamilyMembers = (max(2, int(totalCharacters / 6)), int(totalCharacters / 3))
if (numFamilies[1] * numFamilyMembers[1] > totalCharacters):
    print(
        "WARNING: May have too few characters for max possible families and members"
    )
print("Family parameters: number" + str(numFamilies) + ", size" +
      str(numFamilyMembers))

# GENERATE ROMANTIC RELATIONSHIP NETWORK
numRomances = int(0.5 * totalCharacters)

# GENERATE PROFESSIONAL RELATIONSHIP NETWORK
numEmployers = (int(totalCharacters / 6), int(totalCharacters / 3))
Пример #5
0
import cast
from relationships import relType as rType
from cast import ConnectionStrategy
from characters import character
from characters import gender

# Create graph
c = cast.cast()
# Add characters
totalCharacters = random.randint(4, 15)

characterGenders = [gender.getRandomGender() for x in range(totalCharacters)]
print("TOTAL CHARACTERS: " + str(totalCharacters))
for charGender in characterGenders:
    c.addCharacter(character(charGender))

# GENERATE FAMILIAL RELATIONSHIP NETWORK
numFamilies = (int(totalCharacters/6), int(totalCharacters/3))
numFamilyMembers = (max(2, int(totalCharacters/6)), int(totalCharacters/3))
if (numFamilies[1] * numFamilyMembers[1] > totalCharacters):
    print("WARNING: May have too few characters for max possible families and members")
print("Family parameters: number" + str(numFamilies) + ", size" + str(numFamilyMembers))

# GENERATE ROMANTIC RELATIONSHIP NETWORK
numRomances = int(0.5 * totalCharacters)

# GENERATE PROFESSIONAL RELATIONSHIP NETWORK
numEmployers = (int(totalCharacters/6), int(totalCharacters/3))
numEmployees = (max(2, int(totalCharacters/6)), int(totalCharacters/3))
if (numEmployers[1] * numEmployees[1] > totalCharacters):
Пример #6
0
import characters
import actions
import combat

#inventories
character_inventory={'potion':1}
inventory_gold={'gold':50}
inventory_basic={'potion':1}
inventory_advanced={'potion':3,'super_potion':1}

#Characters
user = characters.character('bob',10,2,1,character_inventory,50)
mouse =  characters.character('mouse',2,1,1,inventory_gold)
rat =  characters.character('rat',10,2,1,inventory_basic)
ROUS =  characters.character('ROUS',15,4,1,inventory_advanced)
print(rat.name)
choice=''
while (choice != 'x'):
    print('''What would you like to test?
    1 - arena
    2 - print character stats
    3 - slay ROUS
    4 - enter the store''')

    choice = str(input ('make your selection: '))

    print ('You chose ' +  choice)

    if (choice == '1'):
        actions.wiper()
        combat.arena()
Пример #7
0
    print("What?")

print("Now, lets get the names of your crew.")

# sets up each crew member
crew = ["captain", "doctor", "mechanic", "scientist", "soldier"]
#description = ["The captain must remain alive for the adventure to continue:  ", "The doctor is the only one who can administer medical kits:  "]
#crew = ["captain", "doctor", "mechanic", "scientist", "soldier"]
description = ["The captain must remain alive for the adventure to continue:  ", "The doctor is the only one who can administer medical kits:  ", "The mechanic is the only one who can fix the ship with repair kits:  ", "The scientist helps determine if food and water are safe to consume:  ", "The soldier is the only one who can do battle with space pirates:  "]
    
for title in crew:
    #print(crew.index(member))
    name = input("Enter the name for the " + title + ". " + description[crew.index(title)])
    #print(crew[crew.index(title)])
    if crew[crew.index(title)] == "captain":
        captain = characters.character(name, title, randint(75,100), 0)
        print("The health level of the captain is: " + str(captain.gethealth()))
    elif crew[crew.index(title)] == "doctor":
        doctor = characters.character(name, title, randint(75,100), 0)
        print("The health level of the doctor is: " + str(doctor.gethealth()))
    elif crew[crew.index(title)] == "mechanic":
        mechanic = characters.character(name, title, randint(75,100), 0)
        print("The health level of the mechanic is: " + str(mechanic.gethealth()))
    elif crew[crew.index(title)] == "scientist":
        scientist = characters.character(name, title, randint(75,100), 0)
        print("The health level of the scientist is: " + str(scientist.gethealth()))
    elif crew[crew.index(title)] == "soldier":
        soldier = characters.character(name, title, randint(75,100), 0)
        print("The health level of the soldier is: " + str(soldier.gethealth()))

print("Again, the health of the captain is: " + str(captain.gethealth()))