def _canActivate(self, entityName=None, avatar=None): result, error = super(_MedKitItem, self)._canActivate(entityName, avatar) return (True, IgnoreEntitySelection( '', None)) if not result and type(error) not in ( NeedEntitySelection, NotApplyingError ) and avatar_getter.isVehicleStunned() and self.isReusable else ( result, error)
def getActivationCode(self, entityName=None, avatar=None): activationCode = super(_MedKitItem, self).getActivationCode(entityName, avatar) if activationCode is None and avatar_getter.isVehicleStunned( ) and self.isReusable: extrasDict = avatar_getter.getVehicleExtrasDict(avatar) activationCode = (extrasDict[makeExtraName('commander')].index << 16) + self._descriptor.id[1] return activationCode