当前位置: 首页>>代码示例>>Python>>正文


Python ComponentManager.add_Component方法代码示例

本文整理汇总了Python中ComponentManager.ComponentManager.add_Component方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentManager.add_Component方法的具体用法?Python ComponentManager.add_Component怎么用?Python ComponentManager.add_Component使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ComponentManager.ComponentManager的用法示例。


在下文中一共展示了ComponentManager.add_Component方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
 def __init__(self, lionid):
     self.LionId = lionid
     self.BasicAttackId = EM.new_Id
     tile = CM.get_Component('Tile', lionid)
     if tile.TileName == 'Lion':
         CM.add_Component(self.BasicAttackId, 'Attack', Attack(2, 6))
     else:
         CM.add_Component(self.BasicAttackId, 'Attack',
                          Attack(2, 6, special={'PierceDefense': 10}))
开发者ID:Akhier,项目名称:12Down,代码行数:11,代码来源:Lion.py

示例2: __init__

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
 def __init__(self, kangarooid):
     self.KangarooId = kangarooid
     self.BasicAttackId = EM.new_Id
     tile = CM.get_Component('Tile', kangarooid)
     if tile.TileName == 'Kangaroo':
         CM.add_Component(self.BasicAttackId, 'Attack', Attack(4, 2))
     else:
         CM.add_Component(self.BasicAttackId, 'Attack',
                          Attack(4, 2, special={'Paralyze': 10}))
     self.playerinvision = False
开发者ID:Akhier,项目名称:12Down,代码行数:12,代码来源:Kangaroo.py

示例3: make_kangaroo

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_kangaroo(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Kangaroo', 'k', False, True,
                          color=Color.dark_sepia))
    CM.add_Component(newmonsterid, 'Death',
                     Death('This kangaroo won\'t be hopping anymore.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(10, 0, 10, 25, 10, 73))
    CM.add_Component(newmonsterid, 'Action', Kangaroo_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:15,代码来源:Kangaroo.py

示例4: make_dog

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_dog(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Dog', 'd', False, True,
                          color=Color.darker_yellow))
    CM.add_Component(newmonsterid, 'Death',
                     Death('The little doggie wimpers as it falls over.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(12, 1, 14, 8, 5, 26, special={'Dodge': 10}))
    CM.add_Component(newmonsterid, 'Action', Dog_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:15,代码来源:Dog.py

示例5: make_frog

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_frog(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Frog', 'f', False, True,
                          color=Color.lighter_green))
    CM.add_Component(newmonsterid, 'Death',
                     Death('Squished frog, how droll.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(10, 0, 5, 20, 5, 61))
    CM.add_Component(newmonsterid, 'Action', Frog_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:15,代码来源:Frog.py

示例6: make_bat

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_bat(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Bat', 'b', False, True,
                          color=Color.dark_gray))
    CM.add_Component(newmonsterid, 'Death',
                     Death('The small bat lets out one final pitiful squeak.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(3, 0, 8, 10, 5, 15))
    CM.add_Component(newmonsterid, 'Action', Bat_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:15,代码来源:Bat.py

示例7: make_lion

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_lion(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Lion', 'l', False, True,
                          color=Color.yellow))
    CM.add_Component(newmonsterid, 'Death',
                     Death('Dead on the floor a lion lays.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(30, 2, 10, 15, 6, 81))
    CM.add_Component(newmonsterid, 'Action', Lion_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:15,代码来源:Lion.py

示例8: make_imp

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_imp(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Imp', 'i', False, True,
                          color=Color.red))
    CM.add_Component(newmonsterid, 'Death',
                     Death('The dead imp quickly fades from reality.',
                           '.', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(20, 0, 10, 18, 4, 79))
    CM.add_Component(newmonsterid, 'Action', Imp_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:15,代码来源:Imp.py

示例9: make_hawk

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_hawk(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Hawk', 'h', False, True,
                          color=Color.darker_orange))
    CM.add_Component(newmonsterid, 'Death',
                     Death('The dead hawk flutters to the ground dead.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(10, 0, 10, 25, 10, 73))
    CM.add_Component(newmonsterid, 'Action', Hawk_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:15,代码来源:Hawk.py

示例10: make_jellyfish

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_jellyfish(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Jellyfish', 'j', False, True,
                          color=Color.white))
    CM.add_Component(newmonsterid, 'Death',
                     Death('The jellyfish splats onto the floor. Wonder ' +
                           'how it was floating in the first place.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(10, 10, 10, 10, 4, 84))
    CM.add_Component(newmonsterid, 'Action', Jellyfish_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:16,代码来源:Jellyfish.py

示例11: make_goblin

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_goblin(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Goblin', 'g', False, True,
                          color=Color.green))
    CM.add_Component(newmonsterid, 'Death',
                     Death('A dead goblin, now this is ' +
                           'generic adventuring fair!',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(20, 2, 10, 10, 8, 68))
    CM.add_Component(newmonsterid, 'Action', Goblin_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:16,代码来源:Goblin.py

示例12: make_elephant

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_elephant(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Elephant', 'e', False, True,
                          color=Color.gray))
    CM.add_Component(newmonsterid, 'Death',
                     Death('Before like an angry mountain this elephant ' +
                           'is now just a boulder.',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(30, 1, 10, 5, 7, 42))
    CM.add_Component(newmonsterid, 'Action', Elephant_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:16,代码来源:Elephant.py

示例13: make_ant

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_ant(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Ant', 'a', False, True,
                          color=Color.darker_red))
    CM.add_Component(newmonsterid, 'Death',
                     Death('The ants shell now smashed gives way ' +
                           'as it breaths it\'s final breath',
                           '~', effects=[death_cleanup]))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(1, 5, 10, 5, 5, 8))
    CM.add_Component(newmonsterid, 'Action', Ant_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:16,代码来源:Ant.py

示例14: make_poison_frog

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_poison_frog(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Poison Frog', 'F', False, True,
                          color=Color.red))
    deatheffects = [death_cleanup, poison_choice]
    CM.add_Component(newmonsterid, 'Death',
                     Death('Congradulations! You didn\'t even need a blender.',
                           '~', effects=deatheffects))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(20, 0, 10, 21, 5, 244))
    CM.add_Component(newmonsterid, 'Action', Frog_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:16,代码来源:Frog.py

示例15: make_hobgoblin

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import add_Component [as 别名]
def make_hobgoblin(coord, dungeonlevel):
    newmonsterid = EM.new_Id()
    CM.add_Component(newmonsterid, 'Coord', coord)
    CM.add_Component(newmonsterid, 'Tile',
                     Tile('Hobgoblin', 'G', False, True,
                          color=Color.dark_green))
    deatheffects = [death_cleanup, hobs_choice]
    CM.add_Component(newmonsterid, 'Death',
                     Death('Hobgoblins die like goblins, just darker.',
                           '~', effects=deatheffects))
    CM.add_Component(newmonsterid, 'Creature',
                     Creature(30, 3, 12, 10, 8, 272))
    CM.add_Component(newmonsterid, 'Action', Goblin_AI(newmonsterid))
    dungeonlevel.MonsterIds.append(newmonsterid)
开发者ID:Akhier,项目名称:12Down,代码行数:16,代码来源:Goblin.py


注:本文中的ComponentManager.ComponentManager.add_Component方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。