本文整理汇总了Python中the_tale.game.mobs.prototypes.MobRecordPrototype.create方法的典型用法代码示例。如果您正苦于以下问题:Python MobRecordPrototype.create方法的具体用法?Python MobRecordPrototype.create怎么用?Python MobRecordPrototype.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.game.mobs.prototypes.MobRecordPrototype
的用法示例。
在下文中一共展示了MobRecordPrototype.create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from the_tale.game.mobs.prototypes import MobRecordPrototype [as 别名]
# 或者: from the_tale.game.mobs.prototypes.MobRecordPrototype import create [as 别名]
def setUp(self):
super(MobsStorageTests, self).setUp()
create_test_map()
self.mob_1, self.mob_2, self.mob_3 = mobs_storage.all()
self.mob_1.type = MOB_TYPE.CIVILIZED
self.mob_1.save()
self.mob_2.type = MOB_TYPE.BARBARIAN
self.mob_2.save()
self.mob_3.type = MOB_TYPE.CIVILIZED
self.mob_3.save()
self.bandit = MobRecordPrototype.create(uuid='bandit',
level=1,
utg_name=names.generator.get_test_name(name='bandint'),
description='description',
abilities=['hit'],
terrains=[TERRAIN.PLANE_SAND],
type=MOB_TYPE.CIVILIZED,
state=MOB_RECORD_STATE.ENABLED)
self.bandint_wrong = MobRecordPrototype.create(uuid='bandit_wrong',
level=1,
utg_name=names.generator.get_test_name(name='bandit_wrong'),
description='bandit_wrong description',
abilities=['hit'],
terrains=[TERRAIN.PLANE_SAND],
type=MOB_TYPE.CIVILIZED,
state=MOB_RECORD_STATE.DISABLED)
示例2: test_mob_attributes
# 需要导入模块: from the_tale.game.mobs.prototypes import MobRecordPrototype [as 别名]
# 或者: from the_tale.game.mobs.prototypes.MobRecordPrototype import create [as 别名]
def test_mob_attributes(self):
MobRecordPrototype.create(uuid='bandit',
level=1,
utg_name=names.generator.get_test_name(name='bandit'),
description='bandint',
abilities=['hit', 'thick', 'slow', 'extra_strong'],
terrains=TERRAIN.records,
type=MOB_TYPE.CIVILIZED,
archetype=game_relations.ARCHETYPE.NEUTRAL,
state=MOB_RECORD_STATE.ENABLED)
mobs_storage.sync(force=True)
bandit = MobPrototype(record_id=mobs_storage.get_by_uuid('bandit').id, level=1)
self.assertEqual(bandit.health_cooficient, 1.025)
self.assertEqual(bandit.initiative, 0.975)
self.assertEqual(bandit.damage_modifier, 1.05)
示例3: construct_mob_with_abilities
# 需要导入模块: from the_tale.game.mobs.prototypes import MobRecordPrototype [as 别名]
# 或者: from the_tale.game.mobs.prototypes.MobRecordPrototype import create [as 别名]
def construct_mob_with_abilities(abilities, index):
from the_tale.game.mobs.prototypes import MobRecordPrototype
from the_tale.game.mobs.relations import MOB_RECORD_STATE
uuid = 'test_mob %d' % index
mob_record = MobRecordPrototype.create(uuid,
level=1,
utg_name=names.generator.get_test_name(uuid),
description='',
abilities=abilities,
terrains=[],
type=game_relations.BEING_TYPE.CIVILIZED,
state=MOB_RECORD_STATE.ENABLED)
return MobPrototype(level=1, record_id=mob_record.id)
示例4: setUp
# 需要导入模块: from the_tale.game.mobs.prototypes import MobRecordPrototype [as 别名]
# 或者: from the_tale.game.mobs.prototypes.MobRecordPrototype import create [as 别名]
def setUp(self):
super(MobsStorageTests, self).setUp()
create_test_map()
self.mob_1, self.mob_2, self.mob_3 = mobs_storage.all()
self.mob_1.type = game_relations.BEING_TYPE.CIVILIZED
self.mob_1.save()
self.mob_2.type = game_relations.BEING_TYPE.CIVILIZED
self.mob_2.is_mercenary = False
self.mob_2.save()
self.mob_3.type = game_relations.BEING_TYPE.CIVILIZED
self.mob_3.save()
self.bandit = MobRecordPrototype.create(
uuid="bandit",
level=1,
utg_name=names.generator.get_test_name(name="bandint"),
description="description",
abilities=["hit"],
terrains=[map_relations.TERRAIN.PLANE_SAND],
type=game_relations.BEING_TYPE.CIVILIZED,
state=MOB_RECORD_STATE.ENABLED,
)
self.bandint_wrong = MobRecordPrototype.create(
uuid="bandit_wrong",
level=1,
utg_name=names.generator.get_test_name(name="bandit_wrong"),
description="bandit_wrong description",
abilities=["hit"],
terrains=[map_relations.TERRAIN.PLANE_SAND],
type=game_relations.BEING_TYPE.CIVILIZED,
state=MOB_RECORD_STATE.DISABLED,
)