MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / __init__

Method __init__

eos/saveddata/fighter.py:44–76  ·  view source on GitHub ↗

Initialize a fighter from the program

(self, item)

Source from the content-addressed store, hash-verified

42 DAMAGE_TYPES2 = ("EM", "Kin", "Exp", "Therm")
43
44 def __init__(self, item):
45 """Initialize a fighter from the program"""
46 self.__item = item
47
48 if self.isInvalid:
49 raise ValueError("Passed item is not a Fighter")
50
51 self.itemID = item.ID if item is not None else None
52 self.projected = False
53 self.projectionRange = None
54 self.active = True
55
56 # -1 is a placeholder that represents max squadron size, which we may not know yet as ships may modify this with
57 # their effects. If user changes this, it is then overridden with user value.
58 self._amount = -1
59
60 self.__abilities = self.__getAbilities()
61
62 self.build()
63
64 standardAttackActive = False
65 for ability in self.abilities:
66 if ability.effect.isImplemented and ability.effect.name == 'fighterAbilityAttackM':
67 # Activate "standard attack" if available
68 ability.active = True
69 standardAttackActive = True
70 else:
71 # Activate all other abilities (Neut, Web, etc) except propmods if no standard attack is active
72 if ability.effect.isImplemented and \
73 standardAttackActive is False and \
74 ability.effect.name != 'fighterAbilityMicroWarpDrive' and \
75 ability.effect.name != 'fighterAbilityEvasiveManeuvers':
76 ability.active = True
77
78 @reconstructor
79 def init(self):

Callers 1

rebaseMethod · 0.45

Calls 2

__getAbilitiesMethod · 0.95
buildMethod · 0.95

Tested by

no test coverage detected