本文整理汇总了Python中core.formation.Formation.get_talent_effects方法的典型用法代码示例。如果您正苦于以下问题:Python Formation.get_talent_effects方法的具体用法?Python Formation.get_talent_effects怎么用?Python Formation.get_talent_effects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.formation.Formation
的用法示例。
在下文中一共展示了Formation.get_talent_effects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_formation_staffs
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_talent_effects [as 别名]
def load_formation_staffs(self):
# NOTE: 这段代码其实是从 Club.force_load_staffs 抄来的
from core.formation import Formation
from core.unit import UnitManager
from core.talent import TalentManager
from core.collection import Collection
from core.party import Party
from core.inspire import Inspire
self.formation_staffs = []
""":type: list[core.staff.Staff]"""
sm = StaffManger(self.server_id, self.char_id)
fm = Formation(self.server_id, self.char_id)
um = UnitManager(self.server_id, self.char_id)
ins = Inspire(self.server_id, self.char_id)
staffs = sm.get_staffs_data()
in_formation_staffs = self.in_formation_staffs()
for k, v in in_formation_staffs.iteritems():
obj = Staff(self.server_id, self.char_id, k, staffs[k])
self.formation_staffs.append(obj)
obj.policy = in_formation_staffs[k]['policy']
obj.formation_position = in_formation_staffs[k]['position']
unit_id = in_formation_staffs[k]['unit_id']
if unit_id:
obj.set_unit(um.get_unit_object(unit_id))
club = Club(self.server_id, self.char_id, load_staffs=False)
club.formation_staffs = self.formation_staffs
working_staff_oids = self.working_staff_oids()
for obj in self.formation_staffs:
obj.check_qianban(working_staff_oids)
obj.add_self_talent_effect(club)
talent_effects_1 = TalentManager(self.server_id, self.char_id).get_talent_effects()
talent_effects_2 = Collection(self.server_id, self.char_id).get_talent_effects()
talent_effects_3 = fm.get_talent_effects()
talent_effects_4 = Party(self.server_id, self.char_id).get_talent_effects()
club.add_talent_effects(talent_effects_1)
club.add_talent_effects(talent_effects_2)
club.add_talent_effects(talent_effects_3)
club.add_talent_effects(talent_effects_4)
config_inspire_level_addition, config_inspire_step_addition = ins.get_addition_config()
for obj in self.formation_staffs:
obj.config_inspire_level_addition = config_inspire_level_addition
obj.config_inspire_step_addition = config_inspire_step_addition
obj.calculate()
示例2: force_load_staffs
# 需要导入模块: from core.formation import Formation [as 别名]
# 或者: from core.formation.Formation import get_talent_effects [as 别名]
def force_load_staffs(self, send_notify=False):
from core.staff import StaffManger, Staff
from core.formation import Formation
from core.unit import UnitManager
from core.talent import TalentManager
from core.collection import Collection
from core.party import Party
from core.inspire import Inspire
from core.union import Union
from core.bag import Bag
self.formation_staffs = []
sm = StaffManger(self.server_id, self.char_id)
fm = Formation(self.server_id, self.char_id)
um = UnitManager(self.server_id, self.char_id)
ins = Inspire(self.server_id, self.char_id)
staffs = sm.get_staffs_data()
in_formation_staffs = fm.in_formation_staffs()
staff_objs = {}
""":type: dict[str, core.staff.Staff]"""
for k, v in staffs.items():
staff_objs[k] = Staff(self.server_id, self.char_id, k, v)
for k, v in staff_objs.iteritems():
if k in in_formation_staffs:
self.formation_staffs.append(v)
v.policy = in_formation_staffs[k]['policy']
v.formation_position = in_formation_staffs[k]['position']
unit_id = in_formation_staffs[k]['unit_id']
if unit_id:
v.set_unit(um.get_unit_object(unit_id))
working_staff_oids = fm.working_staff_oids()
for k in in_formation_staffs:
staff_objs[k].check_qianban(working_staff_oids)
staff_objs[k].add_self_talent_effect(self)
talent_effects_1 = TalentManager(self.server_id, self.char_id).get_talent_effects()
talent_effects_2 = Collection(self.server_id, self.char_id).get_talent_effects()
talent_effects_3 = fm.get_talent_effects()
talent_effects_4 = Party(self.server_id, self.char_id).get_talent_effects()
talent_effects_5 = Union(self.server_id, self.char_id).get_union_skill_talent_effects()
self.add_talent_effects(talent_effects_1)
self.add_talent_effects(talent_effects_2)
self.add_talent_effects(talent_effects_3)
self.add_talent_effects(talent_effects_4)
self.add_talent_effects(talent_effects_5)
config_inspire_level_addition, config_inspire_step_addition = ins.get_addition_config()
bag = Bag(self.server_id, self.char_id)
for _, v in staff_objs.iteritems():
v.config_inspire_level_addition = config_inspire_level_addition
v.config_inspire_step_addition = config_inspire_step_addition
v.calculate(bag=bag, um=um)
v.make_cache()
if send_notify:
self.send_notify()
in_formation_staff_ids = fm.in_formation_staffs().keys()
sm.send_notify(ids=in_formation_staff_ids)