本文整理汇总了Python中core.formation.Formation.get_skill_sequence方法的典型用法代码示例。如果您正苦于以下问题:Python Formation.get_skill_sequence方法的具体用法?Python Formation.get_skill_sequence怎么用?Python Formation.get_skill_sequence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.formation.Formation
的用法示例。
在下文中一共展示了Formation.get_skill_sequence方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: match
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_skill_sequence [as 别名]
def match(self, friend_id):
friend_id = int(friend_id)
if not self.check_friend_exist(friend_id):
raise GameException(ConfigErrorMessage.get_error_id("FRIEND_NOT_OK"))
club_one = Club(self.server_id, self.char_id)
club_two = Club(self.server_id, friend_id)
f_one = Formation(self.server_id, self.char_id)
f_two = Formation(self.server_id, self.char_id)
match = ClubMatch(club_one, club_two, 6, f_one.get_skill_sequence(), f_two.get_skill_sequence())
msg = match.start()
msg.key = ""
msg.map_name = GlobalConfig.value_string("MATCH_MAP_FRIEND")
friend_match_signal.send(
sender=None,
server_id=self.server_id,
char_id=self.char_id,
target_id=friend_id,
win=msg.club_one_win
)
return msg
示例2: start
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_skill_sequence [as 别名]
def start(self, dungeon_id, formation_slots=None):
grade_conf = ConfigDungeonGrade.get(dungeon_id)
if not grade_conf:
raise GameException(ConfigErrorMessage.get_error_id("DUNGEON_NOT_EXIST"))
map_name = ConfigDungeon.get(grade_conf.belong).map_name
club_level = get_club_property(self.server_id, self.char_id, 'level')
if grade_conf.need_level > club_level:
raise GameException(ConfigErrorMessage.get_error_id("DUNGEON_CLUB_LEVEL_NOT_ENOUGH"))
f = Formation(self.server_id, self.char_id)
if formation_slots:
f.sync_slots(formation_slots)
Energy(self.server_id, self.char_id).check(ConfigDungeon.get(grade_conf.belong).cost)
ri = TimesInfo(self.server_id, self.char_id, grade_conf.belong)
if not ri.remained_match_times:
# 购买
self.buy_times(grade_conf.belong)
club_one = Club(self.server_id, self.char_id)
club_two = ConfigNPCFormation.get(grade_conf.npc)
msg = ClubMatch(club_one, club_two, 6, f.get_skill_sequence(), {}).start()
msg.key = str(dungeon_id)
msg.map_name = map_name
return msg
示例3: start
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_skill_sequence [as 别名]
def start(self, challenge_id, formation_slots=None):
config = ConfigChallengeMatch.get(challenge_id)
if not config:
raise GameException(ConfigErrorMessage.get_error_id("CHALLENGE_NOT_EXIST"))
if config.condition_challenge:
doc = MongoChallenge.db(self.server_id).find_one(
{'_id': self.char_id},
{'challenge_star.{0}'.format(config.condition_challenge): 1}
)
if str(config.condition_challenge) not in doc['challenge_star']:
raise GameException(ConfigErrorMessage.get_error_id("CHALLENGE_NOT_OPEN"))
rt = RemainedTimes(self.server_id, self.char_id, challenge_id)
if not rt.remained_match_times:
raise GameException(ConfigErrorMessage.get_error_id("CHALLENGE_WITHOUT_TIMES"))
f = Formation(self.server_id, self.char_id)
if formation_slots:
f.sync_slots(formation_slots)
Energy(self.server_id, self.char_id).check(config.energy)
club_one = Club(self.server_id, self.char_id)
club_two = ChallengeNPCClub(challenge_id)
match = ClubMatch(club_one, club_two, 6, f.get_skill_sequence(), {})
msg = match.start()
msg.key = str(challenge_id)
msg.map_name = config.map_name
return msg
示例4: help
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_skill_sequence [as 别名]
def help(self, friend_id, building_id):
friend_id = int(friend_id)
if not FriendManager(self.server_id, self.char_id).check_friend_exist(friend_id):
raise GameException(ConfigErrorMessage.get_error_id("FRIEND_NOT_OK"))
if not self.get_remained_help_times():
raise GameException(ConfigErrorMessage.get_error_id("TERRITORY_NO_HELP_FRIEND_TIMES"))
if not TerritoryFriend(self.server_id, friend_id).get_remained_got_help_times():
raise GameException(ConfigErrorMessage.get_error_id("TERRITORY_NO_GOT_HELP_TIMES"))
t = Territory(self.server_id, friend_id)
building = t.get_building_object(building_id, slots_ids=[])
event_id = building.event_id
if not event_id:
raise GameException(ConfigErrorMessage.get_error_id("TERRITORY_BUILDING_NO_EVENT"))
MongoTerritory.db(self.server_id).update_one(
{'_id': friend_id},
{'$set': {
'buildings.{0}.event_id'.format(building_id): 0
}}
)
config = ConfigTerritoryEvent.get(event_id)
if not config.npc:
resource_classified = ResourceClassification.classify(config.reward_win)
resource_classified.add(self.server_id, self.char_id, message="TerritoryFriend.help")
# NOTE: 战斗要等到结算的时候再记录次数
ValueLogTerritoryHelpFriendTimes(self.server_id, self.char_id).record()
self.send_remained_times_notify()
Territory(self.server_id, friend_id).got_help(self.char_id, building_id, config.target_exp)
return None, resource_classified
npc_club = ConfigNPCFormation.get(config.npc)
my_club = Club(self.server_id, self.char_id)
f = Formation(self.server_id, self.char_id)
match = ClubMatch(my_club, npc_club, 6, f.get_skill_sequence(), {})
msg = match.start()
msg.key = "{0}:{1}:{2}".format(friend_id, building_id, event_id)
msg.map_name = GlobalConfig.value_string("MATCH_MAP_TERRITORY_FRIEND")
return msg, None
示例5: match_start
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_skill_sequence [as 别名]
def match_start(self, key, formation_slots=None):
try:
friend_id, building_id, event_id = key.split(':')
friend_id = int(friend_id)
building_id = int(building_id)
event_id = int(event_id)
except:
raise GameException(ConfigErrorMessage.get_error_id("BAD_MESSAGE"))
f = Formation(self.server_id, self.char_id)
if formation_slots:
f.sync_slots(formation_slots)
config = ConfigTerritoryEvent.get(event_id)
npc_club = ConfigNPCFormation.get(config.npc)
my_club = Club(self.server_id, self.char_id)
match = ClubMatch(my_club, npc_club, 6, f.get_skill_sequence(), {})
msg = match.start()
msg.key = "{0}:{1}:{2}".format(friend_id, building_id, event_id)
msg.map_name = GlobalConfig.value_string("MATCH_MAP_TERRITORY_FRIEND")
return msg
示例6: match
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_skill_sequence [as 别名]
def match(self, formation_slots=None):
sweep_end_at = self.doc.get('sweep_end_at', 0)
if sweep_end_at:
raise GameException(ConfigErrorMessage.get_error_id("TOWER_IN_SWEEP_CANNOT_OPERATE"))
level = self.get_current_level()
if not level:
raise GameException(ConfigErrorMessage.get_error_id("TOWER_ALREADY_ALL_PASSED"))
f = Formation(self.server_id, self.char_id)
if formation_slots:
f.sync_slots(formation_slots)
config = ConfigTowerLevel.get(level)
club_one = Club(self.server_id, self.char_id)
if config.talent_id:
club_one.add_talent_effects([config.talent_id])
club_two = config.make_club()
if not club_one.formation_staffs:
club_one.load_staffs()
if not club_two.formation_staffs:
club_two.load_staffs()
club_one.add_tower_temporary_talent_effects()
club_one.make_temporary_staff_calculate()
club_two.add_tower_temporary_talent_effects()
club_two.make_temporary_staff_calculate()
club_match = ClubMatch(club_one, club_two, 6, f.get_skill_sequence(), {})
msg = club_match.start()
msg.key = str(level)
msg.map_name = config.map_name
return msg
示例7: match
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_skill_sequence [as 别名]
def match(self, formation_slots=None):
doc = MongoArena.db(self.server_id).find_one(
{'_id': str(self.char_id)},
{'rival': 1}
)
rival_id = doc['rival']
if not rival_id:
raise GameException(ConfigErrorMessage.get_error_id("ARENA_MATCH_NO_RIVAL"))
f = Formation(self.server_id, self.char_id)
if formation_slots:
f.sync_slots(formation_slots)
self.check_and_buy_times()
club_one = Club(self.server_id, self.char_id)
club_two = ArenaClub(self.server_id, rival_id)
club_match = ClubMatch(club_one, club_two, 6, f.get_skill_sequence(), {})
msg = club_match.start()
msg.key = rival_id
msg.map_name = GlobalConfig.value_string("MATCH_MAP_ARENA")
return msg