Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def checkRequirements(self, fit):
- char = fit.character
- reqs = {}
- for thing in itertools.chain(fit.modules, fit.drones, (fit.ship,)):
- for attr in ("item", "charge"):
- subThing = getattr(thing, attr, None)
- if subThing is not None:
- for req, level in subThing.requiredSkills.iteritems():
- currLevel = reqs.get(req)
- if currLevel is None or level > currLevel and (char is None or char.getSkill(req).level < currLevel):
- reqs[req] = level
- return reqs
Add Comment
Please, Sign In to add comment