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