def isOn(self): var = self.getIterVar() result = var & game_vars.getUnlockedItems() isOn = len(result) > 0 if isOn: self.setVar(result.pop()) return isOn