Beispiel #1
0
from src import combathandler
from src import silconstants
from src import weaponlist

from src import funclist
from src import genetree

# all of the "from src" stuff is nonsense but I don't know what this package
# is called yet ...

from pyevolve import G1DList
from pyevolve import GSimpleGA
from pyevolve import Util

evolving_thug = character.Character(
    name="Geoff", weapons=[weaponlist.hth(), weaponlist.meleeWeapon(), weaponlist.gun()]
)

simple_thug = character.Character(name="Thug", weapons=[weaponlist.meleeWeapon()])


def eval_func(chromosome):

    # populate the AI functions!
    evolving_thug.fillSlots(chromosome)

    for i in range(0, 100):

        # one hundred combats for each contestant!

        evolving_thug.clear()
Beispiel #2
0
from src import character
from src import combathandler
from src import weaponlist

# how to instantiate characters!

yuri = character.Character( name="Yuri",
                            dmg=11,
                            attroll=(4,2),
                            defroll=(4,2),
                            stamina=45,
                            armor=36,
                            head_armored=False,
                            init=(2,-1),
                            health=1,
                            weapons=[weaponlist.iron_fist,weaponlist.hth()] )

katsuro = character.Character(  name="Kaito Katsuro",
                                dmg=8,
                                attroll=(5,0),
                                defroll=(5,1),
                                stamina=35,
                                armor=0,
                                head_armored=False,
                                init=(2,0),
                                health=2,
                                weapons=[weaponlist.staff,weaponlist.hth()] )
                            
# a note about the weapons in those two characters; weaponlist.hth() inits
# a new instance of the hth class, whereas the iron_fist is an object defined
# in weaponlist. Be careful with that since they can be overwritten. And if more