本文整理匯總了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,
)