コード例 #1
0
def CivGen(
    Races, Govern
):  #-------------------------------------------------------------------- * CIV GEN * ----------------------------------------------------------------------------------

    Civs = []

    for x in range(CIVILIZED_CIVS):

        libtcod.namegen_parse('namegen/jice_fantasy.cfg')
        Name = libtcod.namegen_generate('Fantasy male')
        libtcod.namegen_destroy()

        Name += " Civilization"

        Race = Races[randint(0, len(Races) - 1)]
        while Race.Form != "civilized":
            Race = Races[randint(0, len(Races) - 1)]

        Government = Govern[randint(0, len(Govern) - 1)]

        Color = Palette[randint(0, len(Palette) - 1)]

        Flag = FlagGenerator(Color)

        #Initialize Civ
        Civs.append(Civ(Race, Name, Government, Color, Flag, 0))

    for a in range(TRIBAL_CIVS):

        libtcod.namegen_parse('namegen/jice_fantasy.cfg')
        Name = libtcod.namegen_generate('Fantasy male')
        libtcod.namegen_destroy()

        Name += " Tribe"

        Race = Races[randint(0, len(Races) - 1)]
        while Race.Form != "tribal":
            Race = Races[randint(0, len(Races) - 1)]

        Government = GovernmentType("Tribal", "*PLACE HOLDER*", 2, 50, 0)

        Color = libtcod.Color(randint(0, 255), randint(0, 255),
                              randint(0, 255))

        Flag = FlagGenerator(Color)

        #Initialize Civ
        Civs.append(Civ(Race, Name, Government, Color, Flag, 0))

    print '- Civs Generated -'

    return Civs
コード例 #2
0
def create_area():
    libtcod.namegen_parse('language_data.txt')

    area_type = random.choice(["crypt", "castle"])

    #make sure name isn't the same as it's confusing
    area_name_correct = False
    name_list = []
    for area in AREA_LIST:
        name_list.append(area.name)

    while area_name_correct == False:

        area_name = libtcod.namegen_generate(area_type)
        if area_name not in name_list:
            area_name_correct = True

    area = Area(name=area_name,
                area_type=area_type,
                description="",
                levels=random.randint(5, 10),
                tags=[])
    area_tags = []

    if area_type == "crypt":
        area_tags = random.choice(["dark", "cursed"])
    elif area_type == "castle":
        area_tags = random.choice(["dark", "cursed"])

    area.tags = area_tags

    area.fill_encounter_list()

    return area
コード例 #3
0
def CivGen(Races): #-------------------------------------------------------------------- * CIV GEN * ----------------------------------------------------------------------------------

    Civs = [0 for x in range(INITIAL_CIVS)]

    for x in range(INITIAL_CIVS):

        libtcod.namegen_parse('namegen/jice_fantasy.cfg')
        Name = libtcod.namegen_generate('Fantasy male')
        libtcod.namegen_destroy ()

        Name += "Empire"

        Race = Races[randint(0,NRaces-1)]

        Agression = randint(1,4)

        Type = randint(1,1)

        Color = libtcod.Color(randint(0,255),randint(0,255),randint(0,255))
      
        #Initialize Civ
        Civs[x] = Civ(Race,Name,Agression,Type,Color)

    print '- Civs Generated -'

    return Civs
コード例 #4
0
ファイル: antfarm.py プロジェクト: toomuchpete/antfarm
def place_ants(number):
    global farm, entities
    spots = farm.standable_locations()
   
    if len(spots) > 0:
        for i in range(number):
            (x, y) = choice(spots)
            entities.append(Ant(x, y, '@', libtcod.black, farm, libtcod.namegen_generate(choice(libtcod.namegen_get_sets()))))
コード例 #5
0
ファイル: chargen.py プロジェクト: pom2ter/immortal
def quick_start():
	libtcod.namegen_parse('data/names.txt')
	game.player.gender = game.GENDER[libtcod.random_get_int(game.rnd, 0, len(game.GENDER) - 1)]
	game.player.race = game.RACES[libtcod.random_get_int(game.rnd, 0, len(game.RACES) - 1)]
	game.player.profession = game.CLASSES[libtcod.random_get_int(game.rnd, 0, len(game.CLASSES) - 1)]
	game.player.name = libtcod.namegen_generate(game.player.gender.lower())
	while game.player.name.lower() in game.savefiles:
		game.player.name = libtcod.namegen_generate(game.player.gender.lower())

	game.player.base_strength = game.BASE_STATS[game.player.race + game.player.profession][0] + libtcod.random_get_int(game.rnd, 0, 6)
	game.player.base_dexterity = game.BASE_STATS[game.player.race + game.player.profession][1] + libtcod.random_get_int(game.rnd, 0, 6)
	game.player.base_intelligence = game.BASE_STATS[game.player.race + game.player.profession][2] + libtcod.random_get_int(game.rnd, 0, 6)
	game.player.base_wisdom = game.BASE_STATS[game.player.race + game.player.profession][3] + libtcod.random_get_int(game.rnd, 0, 6)
	game.player.base_endurance = game.BASE_STATS[game.player.race + game.player.profession][4] + libtcod.random_get_int(game.rnd, 0, 6)
	game.player.base_karma = libtcod.random_get_int(game.rnd, 0, 20)
	starting_stats()
	return 'playing'
コード例 #6
0
ファイル: ai.py プロジェクト: Erik-k/roguelike
def namegenerator():
    """Create a random male or female demon name and return it as a string."""

    alphanumerics = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
    choices = []
    new_name = ''
    for i in range(0, libtcod.random_get_int(0, 2, 4)):
        choices.append(choice(alphanumerics))

    try:
        libtcod.namegen_parse('libtcod-1.5.1/data/namegen/mingos_demon.cfg')
        if libtcod.random_get_int(0, 0, 1):
            return new_name.join(choices[i] for i in range(len(choices))) + '-' + libtcod.namegen_generate('demon male')
        else:
            return new_name.join(choices[i] for i in range(len(choices))) + '-' + libtcod.namegen_generate('demon female')
    except:
        print 'Cannot find name generator file. Is it in ./libtcod-1.5.1/data/namegen/mingos_demon.cfg ?'
コード例 #7
0
ファイル: player.py プロジェクト: fiddlerwoaroof/yinjar
	def __init__(self, map, con, x,y, char, color, fighter=None, level=None):
		Object.__init__(self, None, con, x,y, char,
			libtcod.namegen_generate('Celtic male'), color, True, fighter=fighter, level=level
		)

		map.player = self
		self.inventory = Inventory()
		self.mods = Inventory()

		class Item:
			stack_limit = 5
		obj = Object(None, con, None,None, 'b', 'boost', color, item=Item())
		obj.mod = mods.Boost()
		self.mods.add_item(obj)
コード例 #8
0
ファイル: city.py プロジェクト: Lemmily/py-shopRL
    def __init__(self, x, y, name="name", resource_list=[]):
        self.x = x
        self.y = y
        self.char = "C"
        self.colour = libtcod.Color(100, 55, 55)
        self.population = libtcod.random_get_int(0, 10, 20)
        self.name = name
        if self.name == "name":
            try:
                self.name = libtcod.namegen_generate("city")
            except:
                self.name = "couldn't generate"
        self.trader = entities.Trader()
        if len(resource_list) == 0:
            resource_list = master_commodity_list

        self.treasury = 10000
        self.resources = self.trader.resources = {
        }  # these will be stroed as ["resource_name", quantity generated per hour.0]

        #TODO: for now, void. there will be three type "raw"
        self.trader.believed_prices = {}
        for resource in R.resource_list:
            self.trader.believed_prices[resource] = [
                38.00, 10.00
            ]  #name as key. then [believed price, deviance]
            self.trader.resources[resource] = [
                resource, 10.00
            ]  #resource as key, then the name and the quantity.
        self.trader.believed_prices["produce"] = [50.0, 30.0]

        self.producing = {
        }  # these will be stored as ["resource_name", quantity generated per hour.0]

        self.define_generation_goods()
        #self.pickGeneratedResources(resource_list) #TODO: re-initialise this.
        self.findDesiredResources()
        self.relationships = {}  #name of city, or city object.

        self.in_city = []

        #self.productionRound()

        self.trade_house = TradeHouse(self)
        for resource in master_commodity_list:
            self.trade_house.collect_info(resource)

        self.activity_log = {"produced": [], "traded": []}
        self.actions_queue = []
コード例 #9
0
ファイル: monsters.py プロジェクト: fiddlerwoaroof/yinjar
	def load_monster(self, doc):
		color = doc.get('color', None)
		if color is None:
			color = libtcod.red
		elif hasattr(color, 'upper'):
			color = getattr(libtcod, color)
		else:
			color = libtcod.Color(*color)

		ai_class = doc.get('ai_class', BasicMonster)
		cls_data = {}
		if ai_class is not BasicMonster:
			cls_data = {}
			if hasattr(ai_class, 'items'):
				nm = ai_class.pop('class_name', 'monsters.BasicMonster')
				cls_data.update(ai_class)
				ai_class = nm

			module, clas = ai_class.rsplit('.',1)
			module = __import__(module)
			ai_class = getattr(module, clas)

		death_func = getattr(ai_class, 'death', monster_death)

		print 'loading', doc
		Game.register_monster_type(
			(lambda doc:
				lambda map,level,con,x,y: objects.Object( map, con, x,y,
					doc['char'],
					doc.get('name_fmt', '%s the %s') % (
						libtcod.namegen_generate(doc['namegen_class']).capitalize(),
						doc['race_name'].capitalize()
					),
					color,
					True,
					fighter=objects.Fighter(
						hp=doc['hp'],
						defense=doc['defense'],
						power=doc['power'],
						death_function=death_func
					),
					ai=ai_class().load_data(cls_data),
					level=level
				)
			)(doc), doc['spawn_chance'])
コード例 #10
0
ファイル: city.py プロジェクト: Lemmily/py-shopRL
 def __init__(self, x, y, name = "name", resource_list = []):
     self.x = x
     self.y = y
     self.char = "C"
     self.colour = libtcod.Color(100,55,55)
     self.population = libtcod.random_get_int(0, 10, 20)
     self.name = name
     if self.name == "name":
         try: self.name = libtcod.namegen_generate("city")
         except: self.name = "couldn't generate"
     self.trader = entities.Trader()   
     if len(resource_list) == 0:
         resource_list = master_commodity_list
         
     self.treasury = 10000
     self.resources = self.trader.resources = {}# these will be stroed as ["resource_name", quantity generated per hour.0]
     
     #TODO: for now, void. there will be three type "raw"
     self.trader.believed_prices = {}
     for resource in R.resource_list:
         self.trader.believed_prices[resource] = [38.00,10.00] #name as key. then [believed price, deviance]
         self.trader.resources[resource] = [resource, 10.00] #resource as key, then the name and the quantity.
     self.trader.believed_prices["produce"] = [50.0,30.0]
         
     self.producing = {} # these will be stored as ["resource_name", quantity generated per hour.0]
     
     self.define_generation_goods()
     #self.pickGeneratedResources(resource_list) #TODO: re-initialise this. 
     self.findDesiredResources()
     self.relationships = {} #name of city, or city object.
     
     self.in_city = []
      
     
     
     #self.productionRound()
     
     self.trade_house = TradeHouse(self)
     for resource in master_commodity_list:
         self.trade_house.collect_info(resource)
         
     self.activity_log = {"produced":[], "traded":[]}
     self.actions_queue = []
コード例 #11
0
def gen_snake_cobra(coords):
    x, y = coords
    base_attack = libtcod.random_get_int(0, 3, 6)
    max_health = libtcod.random_get_int(0, 15, 20)
    creature_name = libtcod.namegen_generate("Celtic male")

    creature_com = com_Creature(creature_name,
                                base_atk=base_attack,
                                death_function=death_snake,
                                max_hp=max_health)
    ai_com = ai_Chase()

    snake = obj_Actor(x,
                      y,
                      "Cobra",
                      ASSETS.A_SNAKE_02,
                      animation_speed=1.0,
                      creature=creature_com,
                      ai=ai_com)
    return snake
コード例 #12
0
def create_area():
    libtcod.namegen_parse('language_data.txt')

    area_type = random.choice(["crypt", "castle"])
    area_name = libtcod.namegen_generate(area_type)

    area = Area(name=area_name,
                area_type=area_type,
                description="",
                levels=random.randint(5, 10),
                tags=[])
    area_tags = []

    if area_type == "crypt":
        area_tags = random.choice(["dark", "cursed"])
    elif area_type == "castle":
        area_tags = random.choice(["dark", "cursed"])

    area.tags = area_tags

    return area
コード例 #13
0
def gen_snake_anaconda(coords):
    x, y = coords
    base_attack = libtcod.random_get_int(0, 1, 2)
    max_health = libtcod.random_get_int(0, 5, 10)

    creature_name = libtcod.namegen_generate("Celtic female")

    creature_com = com_Creature(creature_name,
                                base_atk=base_attack,
                                max_hp=max_health,
                                death_function=death_snake)
    ai_com = ai_Chase()

    snake = obj_Actor(x,
                      y,
                      "Anaconda",
                      ASSETS.A_SNAKE_01,
                      animation_speed=1.0,
                      creature=creature_com,
                      ai=ai_com)
    return snake
コード例 #14
0
ファイル: monsters.py プロジェクト: fiddlerwoaroof/yinjar
					color,
					True,
					fighter=objects.Fighter(
						hp=doc['hp'],
						defense=doc['defense'],
						power=doc['power'],
						death_function=death_func
					),
					ai=ai_class().load_data(cls_data),
					level=level
				)
			)(doc), doc['spawn_chance'])

Game.register_monster_type(
	lambda map,level, con,x,y: objects.Object(map, con,
		x,y, '\x02', '%s the Orc' % libtcod.namegen_generate('Fantasy male'),
			libtcod.blue, True,

		fighter=objects.Fighter(hp=10, defense=2, power=3, death_function=monster_death),
		ai=AdvancedMonster(),
		level=level
), 8)

Game.register_monster_type(
	lambda map,level, con,x,y: objects.Object(map, con,
		x,y, '\x01', '%s the Troll' % libtcod.namegen_generate('Norse male'),
			libtcod.orange, True,

		fighter=objects.Fighter(hp=16, defense=1, power=4, death_function=monster_death),
		ai=AdvancedMonster(),
		level=level
コード例 #15
0
def init():
    global Player, session_world
    session_world = World()
    libtcod.namegen_parse('language_data.txt')
    #create world
    for x in xrange(random.randint(10, 20)):
        area = create_area()
        session_world.areas.append(area)

    #create deities
    for i in range(5):
        domains = [
            "light", "dark", "fire", "ice", "earth", "air", "war", "peace"
        ]
        deity_name = libtcod.namegen_generate("deity_names")
        symbols = libtcod.namegen_generate("symbols")
        colours = libtcod.namegen_generate("colours")
        deity = Deity(name=deity_name,
                      domain=random.choice(domains),
                      symbol=symbols,
                      colour=colours)
        session_world.deities.append(deity)
        print deity.name

    #init player
    Player = Character(name="Player",
                       hp=10,
                       strength=5,
                       dexterity=5,
                       intelligence=5,
                       charisma=5,
                       tags=[])
    dagger = Item(name='Dagger',
                  item_type="weapon",
                  tags=[],
                  damage=1,
                  armour=0)
    axe = Item(name='Axe',
               item_type="weapon",
               tags=[],
               damage=12,
               armour=0,
               dex_mod=-2)
    torch = Item(name='Torch',
                 item_type="utility",
                 tags=["light"],
                 damage=0,
                 armour=0)
    clothes = Item(name='Clothing',
                   item_type="armour",
                   tags=["light"],
                   damage=0,
                   armour=1)
    Player.inventory.append(dagger)
    Player.inventory.append(axe)
    Player.inventory.append(torch)
    Player.inventory.append(clothes)

    #read general encounters
    with open('encounters.json') as enc_json:
        encs = json.load(enc_json)
        for enc in encs["encounters"]:
            encounter = Encounter(name=enc["name"],
                                  description=enc["description"],
                                  tags=enc["tags"],
                                  item_tags=enc["item_tags"],
                                  options=enc["options"])
            options = encounter.options
            encounter.options = []
            for opt in options:
                option = Option(description=opt["description"],
                                tags=opt["tags"],
                                check=opt["check"],
                                check_num=opt["check_num"],
                                reward=opt["reward"],
                                failure=opt["failure"])
                encounter.options.append(option)

            session_world.encounters[encounter.name] = encounter

    #deitys
    for deity in session_world.deities:
        pray_option = Option(
            "Pray to {}".format(deity.name),
            tags=[],
            check="intelligence",
            check_num=1,
            reward={
                "blessing": "You receive a blessing from {}".format(deity.name)
            },
            failure={"curse": "{} curses you!".format(deity.name)})
        leave_option = Option("Leave",
                              tags=[],
                              check="none",
                              check_num=1,
                              reward={"nothing": "You continue onwards."},
                              failure={"nothing": "You continue onwards."})

        shrine_modifier = libtcod.namegen_generate("general_modifiers")
        shr_start = [
            "You come across a {} shrine to {}, ",
            "Ahead you see a {} shrine dedicated to {}, "
        ]
        shr_end = [
            "it is covered with {} {}s", "it is adorned with a {} {}",
            "littered with icons of {} {}s",
            "in the center is a statue of a {} {}"
        ]
        shrine_phrase = random.choice(shr_start) + random.choice(shr_end)

        encounter = Encounter(name="shrine of {}".format(deity.name),
                              description=shrine_phrase.format(
                                  shrine_modifier, deity.name, deity.colour,
                                  deity.symbol),
                              tags=[deity.domain],
                              item_tags={
                                  "item": "none",
                                  "desc": "",
                                  "reward": "nothing"
                              },
                              options=[pray_option, leave_option])

        session_world.encounters[encounter.name] = encounter

    #monsters
    with open('monsters.json') as enc_json:
        mons = json.load(enc_json)
        for mon in mons:
            monster = Character(name=mon["name"],
                                hp=mon["hp"],
                                strength=mon["strength"],
                                dexterity=mon["dexterity"],
                                intelligence=mon["intelligence"],
                                charisma=mon["charisma"],
                                armour=mon["armour"],
                                damage=mon["damage"],
                                tags=mon["tags"],
                                level=mon["level"])
            session_world.monsters.append(monster)

    #add items
    with open('items.json') as enc_json:
        items = json.load(enc_json)
        for ite in items["items"]:
            item = Item(name=ite["name"],
                        item_type=ite["item_type"],
                        tags=ite["tags"],
                        damage=ite["dmg"],
                        armour=ite["armour"],
                        depth=ite["depth"])

            #add modifier search so JSON isn't so redic
            if "crit_chance" in ite:
                item.crit_chance = ite["crit_chance"]
            if "dex_mod" in ite:
                item.dex_mod = ite["dex_mod"]
            if "int_mod" in ite:
                item.int_mod = ite["int_mod"]
            if "str_mod" in ite:
                item.str_mod = ite["str_mod"]
            session_world.items.append(item)

    #start first area
    session_world.current_area = Area(
        name="Crumbling Ruins",
        area_type="cave",
        description="A cave network filled with crumbling ruins",
        levels=5,
        tags=[],
        depth=1)
    session_world.current_area.fill_encounter_list()

    total_levels = 0
    #create world and populate
    for x in xrange(random.randint(7, 10)):
        area = create_area()
        AREA_LIST.append(area)

    num_of_areas = len(AREA_LIST)

    depth_num = 2
    for area in AREA_LIST:
        area.depth = depth_num
        depth_num += 1
        print area.name + str(area.depth)

    for area in AREA_LIST:
        total_levels += area.levels

    #search list for reasonable start:
    for enc in session_world.current_area.encounter_list:
        if enc.name != 'combat':
            session_world.current_encounter = enc
コード例 #16
0
ファイル: worldgen.py プロジェクト: retropunch/CyberRogue
def setcorps():
	global corpone, corponeproducts, corponehistory, corptwo, corptwoproducts, corptwohistory, corpthree, corpthreeproducts, corpthreehistory, corpchosen, corpchosenproducts

	libtcod.namegen_parse('corpgen.txt'),

	#historychoice = [
	#	' In %(histyear1), %histcorp1 and + histcorp2 + "agreed to a mutual merger of equals, ending their long-running rivalry in pursuit of a common goal. The new entity," +corpchosen+ ", would start off with a complete monopoly over" +corpchosenproducts+'
	#	#,
	#	#'In %histyear2+ "," +histcorp2+ "declared bankruptcy. Their assets were forcibly seized by a shadowy cabal of investors known informally as" +corpchosen+". "+corpchosen+ "would later use those assets to engineer the destruction of several other minor competitors to secure a monopoly over" +corpchosenproducts+'
	#	#,
	#	#'"In" +histyear3+"," +corpchosen+ "("+country1+ "special operations division), refused to follow orders from their mother country and instead went rogue." +corpchosen+ "would later use their military assets to engineer the takeover of several other minor companies to secure a monopoly over" +corpchosenproducts+'
	#
	#	#'In +year+, wealthy philanthropists formed a 'nonprofit corporation  called +corpchosen+, dedicated towards +nonprofitaction+ +corpproducts+.'
	#	#,
	#	#'In +year+, +corpchosen+ (+country+ government agency) was formally privatized to help raise money for the mother country. +corpchosen+ specialized in +corpproducts+.'
	#	#,
	#	#'In +year+, the religious organization +corpchosen+ was established, dedicated towards +nonprofitaction+ +religiousactivity+. To secure funding for its nonprofit activities, +corpchosen+ opened up a business front that specialized in +corpproducts+.'
	#	#,
	#	#'In +year+, +corpname+ successfully infiltrated +corpname+, ending the long-running rivalry between the two companies. The newly merged entity, +corpchosen+, would start off with a complete monopoly over +corpproducts+.'
	#	#,
	#	#'In +year+, vulture capitalists established +corpchosen+ to fund innovative +corpproducts+ start-ups so as to later take them over and seize their considerable profits.'
	#	#,
	#	#'In +year+, the +ideology+ terrorist organization +corpchosen+  went legit  in return for legal immunity for their crimes. +corpchosen+ abandoned their political activism to instead focus on maintaining their massive +corpproducts holdings.'
	#	#,
	#	#'In +year+, the criminal organization +corpchosen+  went legit  in return for legal immunity for their crimes. +corpchosen+ abandoned their criminal activities to instead focus on maintaining their massive +corpproducts+ holdings.'
	#	#,
	#	#'In +year+, +moderateideology+ activists established a nonprofit corporation known as +corpchosen+ to help coordinate their political campaigns. To secure funding for its nonprofit activities, +corpchosen+ opened up a business front that specialized in +corpproducts+.'
	#	#,
	#	#'In +year+, a rich entrepreneur formed +corpchosen+, a +corpproducts+ startup, after being inspired by dreams about +religiousactivity+.'
	#	#,
	#	#'In +year+, +name+, +country+ preacher, declared himself the reincarnation of Jesus Christ and established a popular megachurch, today known as +corpchosen+, dedicated towards +nonprofitaction+ +religiousactivity+. To secure funding for its nonprofit activities, +corpchosen+ opened up a business front that specialized in +corpproducts+.'
	#	#,
	#	#'In +year+, +name+, +country+ general, established a private military corporation known as +corpchosen+. +corpchosen+ would later use their military assets to engineer the takeover of several other minor companies to secure a monopoly over +corpproducts+.'
	#	#,
	#	#'In +year+, +name+ died, leaving behind a charitable trust worth billions of dollars. This trust, known today as +corpchosen+, is dedicated towards +nonprofitaction+ +corpproducts+.'
	#	% dict(
	##histcorp1 = libtcod.namegen_generate('corpnames'),
	##histcorp2 = libtcod.namegen_generate('corpnames'),
	##histcorp3 = libtcod.namegen_generate('corpnames'),
	#histyear1 = random.randrange str(2014, 2019, 1))]
	##histyear2 = random.randrange(2014, 2019, 1),
	##histyear3 = random.randrange(2014, 2019, 1),
	##country1 = libtcod.namegen_generate('corpcountry'),
	##country2 = libtcod.namegen_generate('corpcountry'),
	##country3 = libtcod.namegen_generate('corpcountry'))]

	libtcod.namegen_parse('corpgen.txt')

	corpone = libtcod.namegen_generate('corpnames')
	corpchosen = corpone
	corponeproducts = libtcod.namegen_generate('corpproducts')
	corpchosenproducts = corponeproducts
	corponehistyear = random.randrange(2014, 2019, 1)
	corponehistory = "in the year " + str(corponehistyear) + " " + corpone + " " + str(
		libtcod.namegen_generate('corpactions')) \
					 + " " + str(
		libtcod.namegen_generate('corpnames')) + " causing " + corpone + " to gain a monopoly on " + corponeproducts

	corptwo = libtcod.namegen_generate('corpnames')
	corpchosen = corptwo
	corptwoproducts = libtcod.namegen_generate('corpproducts')
	corpchosenproducts = corptwoproducts
	corptwohistyear = random.randrange(2014, 2019, 1)
	corptwohistory = "in the year " + str(corptwohistyear) + " " + corptwo + " " + str(
		libtcod.namegen_generate('corpactions')) \
					 + " " + str(
		libtcod.namegen_generate('corpnames')) + " causing " + corptwo + " to gain a monopoly on " + corptwoproducts

	corpthree = libtcod.namegen_generate('corpnames')
	corpchosen = corpthree
	corpthreeproducts = libtcod.namegen_generate('corpproducts')
	corpchosenproducts = corpthreeproducts
	corpthreehistyear = random.randrange(2014, 2019, 1)
	corpthreehistory = "in the year " + str(corpthreehistyear) + " " + corpthree + " " + str(
		libtcod.namegen_generate('corpactions')) \
					   + " " + str(
		libtcod.namegen_generate('corpnames')) + " causing " + corpthree + " to gain a monopoly on " + corpthreeproducts
コード例 #17
0
def test_namegen_parse():
    libtcodpy.namegen_parse('../data/namegen/jice_celtic.cfg')
    assert libtcodpy.namegen_generate('Celtic female')
    assert libtcodpy.namegen_get_sets()
    libtcodpy.namegen_destroy()
コード例 #18
0
ファイル: worldgen.py プロジェクト: esroh/CyberRogue
def setcorps():
	global corpone, corponeproducts, corponehistory, corptwo, corptwoproducts, corptwohistory, corpthree, corpthreeproducts, corpthreehistory

	libtcod.namegen_parse('corpgen.txt')

	corpone = libtcod.namegen_generate('corpnames')
	corponeproducts = libtcod.namegen_generate('corpproducts')
	corponehistyear = random.randrange(2014, 2019, 1)
	corponehistory = "in the year " + str(corponehistyear) + " " + corpone + " " + str(libtcod.namegen_generate('corpactions'))\
					 + " " + str(libtcod.namegen_generate('corpnames')) + " causing " + corpone + " to gain a monopoly on " + corponeproducts

	corptwo = libtcod.namegen_generate('corpnames')
	corptwoproducts = libtcod.namegen_generate('corpproducts')
	corptwohistyear = random.randrange(2014, 2019, 1)
	corptwohistory = "in the year " + str(corptwohistyear) + " " + corptwo + " " + str(libtcod.namegen_generate('corpactions')) \
					 + " " + str(libtcod.namegen_generate('corpnames')) + " causing " + corptwo + " to gain a monopoly on " + corptwoproducts

	corpthree = libtcod.namegen_generate('corpnames')
	corpthreeproducts = libtcod.namegen_generate('corpproducts')
	corpthreehistyear = random.randrange(2014, 2019, 1)
	corpthreehistory = "in the year " + str(corpthreehistyear) + " " + corpthree + " " + str(libtcod.namegen_generate('corpactions')) \
					 + " " + str(libtcod.namegen_generate('corpnames')) + " causing " + corpthree + " to gain a monopoly on " + corpthreeproducts